UNPKG

@engie-group/fluid-design-system-react

Version:

Fluid Design System React

78 lines (77 loc) 1.97 kB
import React from 'react'; import { IIconProps } from '../icon'; export declare const switchStyleToCssClasses: TSwitchColor; export type TSwitchColor = { primary: string; success: string; warning: string; danger: string; }; export interface ISwitchProps { /** * Right and left displayed text * */ text?: { right: string; left: string; }; /** * Right and left value returned with onChange function * */ values: { right: string | number | boolean; left: string | number | boolean; }; /** * Left icon props as an object (example: `{ name: 'flash_on', variant: 'brand' }`) */ iconLeftProps?: IIconProps; /** * Right icon props as an object (example: `{ name: 'check', variant: 'brand' }`) */ iconRightProps?: IIconProps; /** * Whether the Switch is disabled or not */ isDisabled?: boolean; /** * Whether the Switch is checked or not */ isChecked?: boolean; /** * Switch variant theme */ variant?: keyof TSwitchColor; /** * Aria label, for accessibility reasons */ ariaLabel?: string; /** * Aria labelled by, for accessibility reasons */ ariaLabelledBy?: string; /** * Id of the input inside the switch */ id?: string; /** * Name of the input inside the switch */ name?: string; /** * Title of the input inside the switch */ title?: string; /** * Optional additional className */ className?: string; /** * use onChange function to get checked status and value from parent * */ onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: string | number | boolean) => void; } /** * @deprecated NJSwitch component is deprecated, please use NJSegmentedControl component instead */ export declare const NJSwitch: React.FC<ISwitchProps>;