import React from 'react'; import { SwitchContainerProps } from './SwitchContainer'; import { SwitchToggleWrapperProps } from './SwitchToggleWrapper'; import { SwitchTextWrapperProps } from './SwitchTextWrapper'; import { SwitchDotProps } from './SwitchDot'; import { SwitchTrackProps } from './SwitchTrack'; import { SwitchWrapperProps } from './SwitchWrapper'; import { SwitchErrorTextProps } from './SwitchErrorText'; import { SwitchAsteriskProps } from './SwitchAsterisk'; export type SwitchProps = Omit & { /** * If true then `errorText` value will be displayed under the Switch element */ readonly error?: boolean; /** * If is true then the asterisk will be displayed in label\ * If is ReactNode then ReactNode will be displayed in label */ readonly requiredAsterisk?: boolean | React.ReactNode; /** * Text or ReactNode to show in error element\ * Will be displaed only if `error` property is tru */ readonly errorText?: React.ReactNode; /** * This prop allows you to provide switch state and control it. This property overrides internal component state * Default: undefined */ readonly checked?: boolean; /** * This prop allows you to control switch component. Function will be executed when user click a switch * This prop overrides internal comonent control function * Default: undefined */ readonly onChange?: React.InputHTMLAttributes['onChange']; /** * if `true` switch state can not be changed * Default: false; */ readonly disabled?: boolean; /** * if `true` switch would be turned on by default * Default: false; */ readonly defaultChecked?: boolean; /** * You can pass the primary, default, secondary name of the colors or your specified color value */ readonly color?: 'default' | 'primary' | 'secondary' | string; /** * This property changes position of switch and its label. * Default: `end` */ readonly labelPosition?: 'start' | 'end' | 'top' | 'bottom'; readonly overrides?: SwitchOverrides; }; export interface SwitchOverrides { /** * Element container */ readonly Container?: React.ComponentType>; /** * Element toggle */ readonly ToggleWrapper?: React.ComponentType>; /** * text wrapper */ readonly TextWrapper?: React.ComponentType>; /** * Dot wrapper */ readonly Dot?: React.ComponentType>; /** * Toggle track wrapper */ readonly Track?: React.ComponentType>; /** * error text wrapper */ readonly ErrorText?: React.ComponentType>; /** * error text wrapper */ readonly Asterisk?: React.ComponentType>; /** * the main cwitch wrapper */ readonly Wrapper?: React.ComponentType>; } declare const _default: React.ForwardRefExoticComponent & { /** * If true then `errorText` value will be displayed under the Switch element */ readonly error?: boolean | undefined; /** * If is true then the asterisk will be displayed in label\ * If is ReactNode then ReactNode will be displayed in label */ readonly requiredAsterisk?: React.ReactNode; /** * Text or ReactNode to show in error element\ * Will be displaed only if `error` property is tru */ readonly errorText?: React.ReactNode; /** * This prop allows you to provide switch state and control it. This property overrides internal component state * Default: undefined */ readonly checked?: boolean | undefined; /** * This prop allows you to control switch component. Function will be executed when user click a switch * This prop overrides internal comonent control function * Default: undefined */ readonly onChange?: React.ChangeEventHandler | undefined; /** * if `true` switch state can not be changed * Default: false; */ readonly disabled?: boolean | undefined; /** * if `true` switch would be turned on by default * Default: false; */ readonly defaultChecked?: boolean | undefined; /** * You can pass the primary, default, secondary name of the colors or your specified color value */ readonly color?: string | undefined; /** * This property changes position of switch and its label. * Default: `end` */ readonly labelPosition?: "bottom" | "top" | "start" | "end" | undefined; readonly overrides?: SwitchOverrides | undefined; } & React.RefAttributes>; export default _default;