import { ID } from "../../types/index.mjs"; import { AtomExpose, AtomProps } from "../Atom/Atom.vue.mjs"; import "../Atom/index.mjs"; import { MaybeRefOrGetter, Ref } from "vue"; //#region src/components/Switch/SwitchRoot.vue.d.ts /** Visual state of the switch for styling purposes */ type SwitchState = 'checked' | 'unchecked' | 'indeterminate'; interface SwitchRootContext { /** Unique identifier */ readonly id: ID; /** Optional display label */ readonly label?: string; /** Value associated with this switch */ readonly value: V | undefined; /** Form field name (triggers auto hidden input when provided) */ readonly name?: string; /** Associate with form by ID */ readonly form?: string; /** Whether this switch is currently on */ isChecked: Readonly>; /** Whether this switch is in a mixed/indeterminate state */ isMixed: Readonly>; /** Whether this switch is disabled */ isDisabled: Readonly>; /** Turn this switch on */ select: () => void; /** Turn this switch off */ unselect: () => void; /** Toggle this switch's state */ toggle: () => void; /** Set this switch to mixed/indeterminate state (group mode only) */ mix: () => void; /** Clear mixed/indeterminate state (group mode only) */ unmix: () => void; } interface SwitchRootProps extends AtomProps { /** Unique identifier (auto-generated if not provided) */ id?: ID; /** Optional display label (passed through to slot) */ label?: string; /** Value associated with this switch (used in group mode and form submission) */ value?: V; /** Form field name - triggers auto hidden input when provided */ name?: string; /** Associate with form by ID */ form?: string; /** Disables this switch */ disabled?: boolean | MaybeRefOrGetter; /** Sets the indeterminate state */ indeterminate?: boolean | MaybeRefOrGetter; /** Namespace for context provision to children (Track, Thumb, HiddenInput) */ namespace?: string; /** Namespace for connecting to parent Switch.Group */ groupNamespace?: string; /** ID of element that labels this switch */ ariaLabelledby?: string; /** ID of element that describes this switch */ ariaDescribedby?: string; /** Whether the switch has an invalid value */ ariaInvalid?: boolean; } interface SwitchRootSlotProps { /** Unique identifier */ id: ID; /** Optional display label */ label?: string; /** Value associated with this switch */ value: V | undefined; /** Whether this switch is currently on */ isChecked: boolean; /** Whether this switch is in a mixed/indeterminate state */ isMixed: boolean; /** Whether this switch is disabled */ isDisabled: boolean; /** Turn this switch on */ select: () => void; /** Turn this switch off */ unselect: () => void; /** Toggle this switch's state */ toggle: () => void; /** Set this switch to mixed/indeterminate state (group mode only) */ mix: () => void; /** Clear mixed/indeterminate state (group mode only) */ unmix: () => void; /** Pre-computed ARIA and data attributes for the root element */ attrs: { 'type': 'button' | undefined; 'role': 'switch'; 'aria-checked': boolean; 'aria-disabled': boolean; 'aria-label': string | undefined; 'aria-labelledby': string | undefined; 'aria-describedby': string | undefined; 'aria-invalid': boolean | undefined; 'tabindex': 0 | undefined; 'data-state': SwitchState; 'data-disabled': true | undefined; 'onClick': () => void; 'onKeydown': (e: KeyboardEvent) => void; }; } declare const useSwitchRoot: (key: string, defaultValue?: SwitchRootContext | undefined) => SwitchRootContext, provideSwitchRoot: (key: string, context: SwitchRootContext, app?: import("vue").App) => SwitchRootContext; declare const _default: typeof __VLS_export; declare const __VLS_export: (__VLS_props: NonNullable>["props"], __VLS_ctx?: __VLS_PrettifyLocal>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable>["expose"], __VLS_setup?: Promise<{ props: import("vue").PublicProps & __VLS_PrettifyLocal<(SwitchRootProps & { modelValue?: boolean; }) & { "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined; "onUpdate:model-value"?: ((value: boolean) => any) | undefined; }> & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P; } ? P : {}); expose: (exposed: import("vue").ShallowUnwrapRef) => void; attrs: any; slots: { default: (props: SwitchRootSlotProps) => any; }; emit: ((evt: "update:model-value", value: boolean) => void) & ((event: "update:modelValue", value: boolean | undefined) => void); }>) => import("vue").VNode & { __ctx?: NonNullable>; }; type __VLS_PrettifyLocal = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {}; //#endregion export { SwitchRootContext, SwitchRootProps, SwitchRootSlotProps, SwitchState, _default as default, provideSwitchRoot, useSwitchRoot };