import React from "react"; import { MarginProps } from "styled-system"; import { TagProps } from "../../__internal__/utils/helpers/tags/tags"; export interface SwitchProps extends MarginProps, TagProps { /** Checked state of the switch */ checked: boolean; /** OnChange event handler */ onChange: (ev: React.ChangeEvent) => void; /** OnBlur event handler */ onBlur?: (ev: React.FocusEvent) => void; /** OnFocus event handler */ onFocus?: (ev: React.FocusEvent) => void; /** If true, the input will auto-focus on mount */ autoFocus?: boolean; /** The id attribute of the hidden input */ id?: string; /** The name attribute of the hidden input */ name?: string; /** The value attribute of the hidden input, passed on form submit */ value?: string; /** Accessible text label rendered above the switch */ label?: React.ReactNode; /** Disables the switch */ disabled?: boolean; /** Triggers the loading state — hides On/Off text and shows a spinner */ loading?: boolean; /** Text shown beside the spinner during loading. Defaults to "Processing..." */ processingLabel?: string; /** When true, the processing label is rendered below the switch rather than to its right */ processingLabelBelowSwitch?: boolean; /** Size of the switch track */ size?: "small" | "large"; /** When true, the label is displayed inline (beside the switch) rather than above it */ labelInline?: boolean; /** Spacing between the label and switch when labelInline is true (multiplier of base spacing unit) */ labelSpacing?: 1 | 2; /** Label width as a percentage when labelInline is true */ labelWidth?: number; /** Hint text displayed below the switch */ inputHint?: React.ReactNode; /** Whether the input is required */ required?: boolean; /** * @deprecated Use `inputHint` instead. */ labelHelp?: React.ReactNode; /** * @deprecated Use `inputHint` instead. */ fieldHelp?: React.ReactNode; /** * @deprecated This prop is no longer supported. */ isDarkBackground?: boolean; /** * @deprecated This prop is no longer supported. */ reverse?: boolean; /** * @deprecated This prop is no longer supported. */ error?: boolean | string; /** * @deprecated This prop is no longer supported. */ warning?: boolean | string; /** * @deprecated This prop is no longer supported. */ info?: boolean | string; /** * @deprecated This prop is no longer supported. */ validationOnLabel?: boolean; /** * @deprecated This prop is no longer supported. */ fieldHelpInline?: boolean; /** * @deprecated This prop is no longer supported. */ tooltipPosition?: "top" | "bottom" | "left" | "right"; /** * @deprecated This prop is no longer supported. */ helpAriaLabel?: string; /** * @deprecated This prop is no longer supported. */ validationMessagePositionTop?: boolean; } export declare const SwitchComponent: React.ForwardRefExoticComponent>; export { SwitchComponent as Switch }; export default SwitchComponent;