import { Field } from '@headlessui/react'; import React from 'react'; import type { ReactNode } from 'react'; import type { EitherInclusive, ExtractProps } from '../../util/utility-types'; type ToggleLabelProps = { /** * Visible text label for the toggle. */ children: ReactNode; /** * Additional classnames passed in for styling the toggle label. */ className?: string; }; type ToggleButtonProps = { /** * Additional classnames passed in for styling the toggle button. */ className?: string; /** * Whether toggle is checked or unchecked. */ checked: boolean; /** * Callback called when toggle state is changed. */ onChange: (checked: boolean) => void; /** * Whether toggle is disabled. */ disabled?: boolean; }; type ToggleProps = ToggleButtonProps & { children?: ReactNode; subLabel?: ReactNode; } & EitherInclusive<{ /** * Visible text label for the component. */ label: ReactNode; }, { /** * Aria-label to provide an accesible name for the text input if no visible label is provided. */ 'aria-label': string; }>; /** * `import {Toggle} from "@chanzuckerberg/eds";` * * Toggle wrapping the Headless UI Switch component https://headlessui.dev/react/switch, generally used as an input for controlling between two states. * * **NOTE**: This component requires `label` or `aria-label` prop */ export declare const Toggle: { ({ label, subLabel, ...other }: ToggleProps): React.JSX.Element; displayName: string; Label: { ({ children, className }: ToggleLabelProps): React.JSX.Element; displayName: string; }; Button: { ({ className, checked, ...other }: ToggleButtonProps): React.JSX.Element; displayName: string; }; Wrapper: { (props: ExtractProps): React.JSX.Element; displayName: string; }; SubLabel: { ({ children, className }: ToggleLabelProps): React.JSX.Element; displayName: string; }; }; export {};