/** * Toggle Group Context Interface * Defines how the parent toggle-group component communicates with child toggle components. * The toggle-group exposes this context on its DOM element, and child toggles read it via `closest()`. */ /** * Context shared between toggle-group and toggle components * Provided by seki-toggle-group, consumed by child seki-toggle components */ export interface ToggleGroupContext { /** Selection mode: 'single' allows one selection, 'multiple' allows many */ type: 'single' | 'multiple'; /** Current selected value(s) - string for single, string[] for multiple */ value: string | string[]; /** Visual variant style */ variant: 'default' | 'outline'; /** Size of toggle items */ size: 'sm' | 'md' | 'lg'; /** Whether the entire group is disabled */ disabled: boolean; /** Currently focused toggle value for keyboard navigation */ focusedValue: string | null; /** Handler called when a toggle is activated */ onToggle: (value: string) => void; /** Check if a toggle value is currently pressed/selected */ isPressed: (value: string) => boolean; /** Handler for focus changes during keyboard navigation */ onFocusChange: (value: string) => void; /** Register a toggle item with the group */ registerToggle: (value: string, element: HTMLElement) => void; /** Unregister a toggle item from the group */ unregisterToggle: (value: string) => void; } /** * Event detail for toggle group value changes * Emitted via 'sekiValueChange' custom event */ export interface ToggleGroupValueChangeEventDetail { /** Current selected value(s) - string for single mode, string[] for multiple mode */ value: string | string[]; }