import type { AsTag } from 'reka-ui'; /** * Accessible toggle switch for binary settings that take effect immediately. * * Use for "notifications on/off", "dark mode", "auto-save" — anything where the * change commits the instant the user toggles it. For form state held until submit, * use a checkbox instead; the visual difference signals when the change applies. * * ## Custom value types * * Generic over `T` (default `boolean`). To bind v-model to a non-boolean state, * declare `trueValue` and `falseValue` together: * * const status = ref<'active' | 'paused'>('paused') * // template: TSwitch v-model="status" :true-value="'active'" :false-value="'paused'" * * The "on" position emits `trueValue`; the "off" position emits `falseValue`. Useful * for state machines, form payloads with string enums, or anywhere boolean coercion * would lose semantic meaning. Reach for it when v-model would otherwise need a * derived boolean adapter — not for simple on/off, which is the 95% case. * * The legacy `value` prop is `boolean`-only; don't mix it with non-boolean generic mode. * * ## Theming * * The "on" track resolves to `var(--color-bg-primary-default)` — the tenant brand. * Wrap a subtree in `TThemeProvider` with a brand override to retheme at runtime * (no re-renders; CSS variable cascade only). */ export interface TSwitchProps { /** Visible label rendered next to the switch. Also serves as the accessible name. */ label?: string; /** Disables interaction. @defaultValue false */ disabled?: boolean; /** * Initial / fallback checked state. **Deprecated — prefer `v-model`** (`modelValue`). * Kept for the pre-migration `:value` + `@input` API; removal in a future major. * Boolean-only — don't mix with non-boolean generic mode. */ value?: boolean; /** Two-way bound state. Idiomatic usage: `v-model="enabled"`. */ modelValue?: T; /** Value emitted when the switch is "on". Default: `true` (when T = boolean). */ trueValue?: T; /** Value emitted when the switch is "off". Default: `false` (when T = boolean). */ falseValue?: T; /** Position of the label relative to the switch. @defaultValue 'right' */ labelPosition?: 'left' | 'right'; /** Explicit id for the underlying control. Auto-generated via `useId()` if omitted. */ id?: string; /** * Element the outer wrapper renders as. Use `'label'` to make the entire row * clickable (native `label for=...` toggles the switch), `'li'` when placing * switches inside a `ul`, or a component for polymorphic rendering. * @defaultValue 'div' */ as?: AsTag; } export interface TSwitchEmits { /** Fires on every toggle (mouse, Space, Enter). Payload is the new value. */ change: [value: T]; /** Mirrors `change`. **Deprecated** — use `@change` or `v-model`. */ input: [value: T]; } export interface TSwitchSlots { /** Override the default label rendering. Receives the resolved `label` prop. */ label?: (props: { label: string | undefined; }) => unknown; } declare const _default: typeof __VLS_export; export default _default; 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<(TSwitchProps & { modelValue?: T; }) & { onInput?: ((value: T) => any) | undefined; onChange?: ((value: T) => any) | undefined; "onUpdate:modelValue"?: ((value: T | undefined) => any) | undefined; }> & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P; } ? P : {}); expose: (exposed: {}) => void; attrs: any; slots: TSwitchSlots; emit: (((evt: "input", value: T) => void) & ((evt: "change", value: T) => void)) & ((event: "update:modelValue", value: T | undefined) => void); }>) => import("vue").VNode & { __ctx?: Awaited; }; type __VLS_PrettifyLocal = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {}; //# sourceMappingURL=TSwitch.vue.d.ts.map