import { WidthProp } from "@marigold/system"; import { ReactNode, Ref } from "react"; import RAC from "react-aria-components"; type RemovedProps = 'children' | 'className' | 'style' | 'isDisabled' | 'isReadOnly' | 'isSelected' | 'isInvalid' | 'slot'; export interface SwitchProps extends Omit { /** * Visual variant of the component. Which values exist is defined by the theme * and listed in the "Appearance" section of the component's documentation. */ variant?: string; /** * Size of the component. Which values exist is defined by the theme and listed * in the "Appearance" section of the component's documentation. */ size?: string; /** * Set the label of the switch. */ label?: ReactNode; /** * Content on the label's first line, such as a `` or ``. * Keeps the track centred, and a badge is read as the switch's description. */ addon?: ReactNode; /** * A helpful text. */ description?: ReactNode; /** * If `true`, the switch is considered invalid and, if set, the `errorMessage` * is shown instead of the `description`. * @default false */ error?: RAC.SwitchFieldProps['isInvalid']; /** * An error message shown when `error` is set. */ errorMessage?: ReactNode; /** * Sets the width of the field. You can see allowed tokens here: https://tailwindcss.com/docs/width * * Numeric/scale values are spacing-scale tokens, not pixels: `width={64}` * resolves to `calc(var(--spacing) * 64)` ~= 16rem (256px), not 64px. * @default full */ width?: WidthProp['width']; /** * Disables the switch. * @default false */ disabled?: RAC.SwitchFieldProps['isDisabled']; /** * Set the switch to read-only. * @default false */ readOnly?: RAC.SwitchFieldProps['isReadOnly']; /** * With this prop you can set the switch selected. * @default false */ selected?: RAC.SwitchFieldProps['isSelected']; /** Ref to the DOM element the component renders. */ ref?: Ref; } declare const Switch: ({ variant, size, width, label, addon, description, error, errorMessage, selected, disabled, readOnly, ref, ...rest }: SwitchProps) => import("react").JSX.Element; export { Switch };