@tribepad/themis 1.9.0 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/elements/Checkbox/Checkbox.d.ts.map +1 -1
  3. package/dist/elements/Checkbox/index.js +1 -1
  4. package/dist/elements/Checkbox/index.js.map +1 -1
  5. package/dist/elements/Checkbox/index.mjs +1 -1
  6. package/dist/elements/Checkbox/index.mjs.map +1 -1
  7. package/dist/elements/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  8. package/dist/elements/CheckboxGroup/index.js +1 -1
  9. package/dist/elements/CheckboxGroup/index.js.map +1 -1
  10. package/dist/elements/CheckboxGroup/index.mjs +1 -1
  11. package/dist/elements/CheckboxGroup/index.mjs.map +1 -1
  12. package/dist/elements/Filters/index.js +1 -1
  13. package/dist/elements/Filters/index.js.map +1 -1
  14. package/dist/elements/Filters/index.mjs +1 -1
  15. package/dist/elements/Filters/index.mjs.map +1 -1
  16. package/dist/elements/RadioGroup/RadioGroup.d.ts.map +1 -1
  17. package/dist/elements/RadioGroup/index.js +1 -1
  18. package/dist/elements/RadioGroup/index.js.map +1 -1
  19. package/dist/elements/RadioGroup/index.mjs +1 -1
  20. package/dist/elements/RadioGroup/index.mjs.map +1 -1
  21. package/dist/elements/Sidebar/Sidebar.styles.d.ts +4 -0
  22. package/dist/elements/Sidebar/Sidebar.styles.d.ts.map +1 -1
  23. package/dist/elements/Sidebar/index.js +1 -1
  24. package/dist/elements/Sidebar/index.js.map +1 -1
  25. package/dist/elements/Sidebar/index.mjs +1 -1
  26. package/dist/elements/Sidebar/index.mjs.map +1 -1
  27. package/dist/elements/SituationalJudgement/index.js +1 -1
  28. package/dist/elements/SituationalJudgement/index.js.map +1 -1
  29. package/dist/elements/SituationalJudgement/index.mjs +1 -1
  30. package/dist/elements/SituationalJudgement/index.mjs.map +1 -1
  31. package/dist/elements/Switch/Switch.d.ts.map +1 -1
  32. package/dist/elements/Switch/index.js +1 -1
  33. package/dist/elements/Switch/index.js.map +1 -1
  34. package/dist/elements/Switch/index.mjs +1 -1
  35. package/dist/elements/Switch/index.mjs.map +1 -1
  36. package/dist/elements/Table/index.js +1 -1
  37. package/dist/elements/Table/index.js.map +1 -1
  38. package/dist/elements/Table/index.mjs +1 -1
  39. package/dist/elements/Table/index.mjs.map +1 -1
  40. package/dist/elements/index.js +1 -1
  41. package/dist/elements/index.js.map +1 -1
  42. package/dist/elements/index.mjs +1 -1
  43. package/dist/elements/index.mjs.map +1 -1
  44. package/dist/index.js +1 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/index.mjs +1 -1
  47. package/dist/index.mjs.map +1 -1
  48. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/cn.ts","../../../src/styles/interaction-states.ts","../../../src/styles/shared-variants.ts","../../../src/elements/Button/Button.styles.ts","../../../src/elements/ButtonGroup/ButtonGroupContext.tsx","../../../src/elements/ButtonGroup/ButtonGroup.variants.ts","../../../src/elements/Button/Button.tsx","../../../src/elements/TextField/TextField.icons.tsx","../../../src/elements/TextField/TextField.styles.ts","../../../src/elements/TextField/TextField.hooks.ts","../../../src/elements/TextField/TextField.tsx","../../../src/elements/SearchField/SearchField.tsx","../../../src/utils/shouldAnimate.ts","../../../src/hooks/useReducedMotion.ts","../../../src/elements/Switch/Switch.tsx","../../../src/elements/RadioGroup/RadioGroup.tsx","../../../src/elements/CheckboxGroup/CheckboxGroup.tsx","../../../src/utils/browserExtensionOverlay.ts","../../../src/elements/Combobox/Combobox.styles.ts","../../../src/elements/Combobox/Combobox.tsx","../../../src/elements/Select/Select.styles.ts","../../../src/elements/Select/Select.tsx","../../../src/elements/Badge/Badge.tsx","../../../src/elements/Filters/Filters.styles.ts","../../../src/elements/Filters/FilterPopover.tsx","../../../src/elements/Filters/AppliedFilters.tsx","../../../src/elements/Filters/FiltersContext.tsx","../../../src/elements/Filters/Filters.tsx","../../../src/elements/Filters/Filters.types.ts"],"names":["cn","inputs","twMerge","clsx","FOCUS_STYLES","PRESSED_STYLES","HIGH_CONTRAST_FOCUS","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","DISABLED_STYLES","DEFAULT_INTERACTIONS","TEXT_SIZE_SMALL_SCALE","FIELD_HEIGHTS","FIELD_INPUT_SIZES","FIELD_TOUCH_TARGET","buttonOuterVariants","cva","buttonVisualVariants","ButtonGroupContext","createContext","useButtonGroupContext","useContext","ButtonGroupItemContext","useButtonGroupItemContext","buttonGroupItemVariants","Button","memo","forwardRef","className","buttonVisualClassName","variant","size","visualSize","fullWidth","loading","loadingText","shortcut","children","isDisabled","paywall","paywallRedirect","paywallDescription","onPress","props","ref","paywallDescriptionId","useId","groupContext","itemContext","effectiveVariant","effectiveSize","effectiveIsDisabled","isInVerticalGroup","effectiveFullWidth","positionClassName","effectiveVisualSize","jsx","AriaButton","e","renderProps","jsxs","Fragment","Loader2","Zap","EyeIcon","EyeOffIcon","inputVariants","labelVariants","descriptionVariants","errorMessageVariants","successMessageVariants","useExpandOnFocus","expandOnFocus","collapsedWidth","value","defaultValue","userOnFocus","userOnBlur","isFocused","setIsFocused","useState","handleFocus","useCallback","handleBlur","inputWidth","useMemo","useCopyPasteProtection","disableCopyPaste","isShaking","setIsShaking","screenReaderMessage","setScreenReaderMessage","useEffect","handlePaste","usePasswordToggle","type","showPasswordToggle","showPassword","setShowPassword","handlePasswordToggle","prev","actualType","TextFieldLabel","state","AriaLabel","TextFieldInput","AriaInput","TextFieldDescription","AriaText","TextFieldError","AriaFieldError","TextFieldSuccess","TextField","label","labelHint","description","errorMessage","successMessage","isRequired","isReadOnly","isInvalid","isValid","id","autoComplete","pattern","patternDescription","prefix","suffix","prefixSize","suffixSize","isIconHidden","onSubmit","onClear","errorId","generatedId","fieldId","isSearch","searchValue","setSearchValue","isControlledSearch","currentSearchValue","handleSearchChange","newValue","handleSearchClear","handleSearchKeyDown","inputState","labelState","combinedDescription","actualPrefix","Search","inputPadding","basePadding","prefixWidth","suffixWidth","actualSuffix","X","hasInteractiveSuffix","AriaTextField","SearchField","ariaLabel","ariaLabelledBy","shouldAnimate","animated","prefersReducedMotion","QUERY","getInitialState","useReducedMotion","setPrefersReducedMotion","mql","handler","event","cachedAnimate","loadMotionAnimate","m","DEFAULT_SPRING","switchOuterVariants","switchTrackVariants","switchThumbVariants","Switch","springConfig","onChangeProp","doAnimate","thumbRef","useRef","motionReady","animateRef","activeAnimation","fn","isCurrentlySelected","handleChange","isSelected","useMotionThumb","AriaSwitch","_classNameProps","RadioGroupContext","radioGroupVariants","radioItemVariants","radioIndicatorVariants","radioInnerDotVariants","RadioLabel","RadioDescription","RadioComponent","AriaRadio","Radio","RadioGroup","orientation","name","onChange","onFocusChange","ariaLabelledby","ariaDescribedby","dataTestId","restProps","radioGroupId","labelId","descriptionId","describedByParts","computedAriaDescribedBy","AriaRadioGroup","Label","Text","FieldError","CheckboxGroupContext","checkboxGroupVariants","checkboxItemVariants","checkboxIndicatorVariants","checkmarkVariants","CheckmarkIcon","CheckboxLabel","CheckboxDescription","CheckboxComponent","selectedIcon","groupDisabled","effectiveDisabled","renderSelectedIcon","iconClassName","dataSelected","isValidElement","iconElement","cloneElement","AriaCheckbox","Checkbox","dedupeWithWarning","values","componentName","uniqueValues","CheckboxGroup","checkboxGroupId","dedupedValue","dedupedDefaultValue","AriaCheckboxGroup","isExtensionInjectedElement","element","node","depth","tag","root","custom","parent","createInteractOutsideGuard","consumerShouldClose","comboboxVariants","comboboxLabelVariants","comboboxInputVariants","comboboxTriggerWrapperVariants","comboboxButtonVariants","comboboxPopoverVariants","comboboxListBoxVariants","comboboxItemVariants","comboboxDescriptionVariants","comboboxErrorVariants","Combobox","placeholder","allowsCustomValue","menuTrigger","defaultInputValue","inputValue","defaultSelectedKey","selectedKey","onInputChange","onSelectionChange","AriaComboBox","ChevronsUpDown","AriaPopover","AriaListBox","ComboboxItem","textValue","computedTextValue","AriaListBoxItem","Check","selectTriggerVariants","selectItemVariants","selectPopoverVariants","selectSectionVariants","selectErrorVariants","LOADING_SKELETON","_","i","SelectBase","ariaSelectProps","triggerContent","triggerRef","isLoading","emptyStateMessage","childCount","rootClassName","restAriaSelectProps","AriaSelect","ChevronDown","validationErrors","displayError","Popover","ListBox","ListBoxItem","SelectRoot","isOpen","disabledKeys","validate","validationBehavior","onOpenChange","Children","key","SelectValue","MultiSelectRoot","_selectionMode","valueToLabelMap","map","processChildren","nodes","child","SelectItem","itemValue","itemChildren","displayValue","v","keys","message","selectionMode","itemDisabled","CheckSquare","SelectSection","ListBoxSection","SelectHeader","Header","Select","badgeOuterVariants","badgeVisualVariants","iconSizeClasses","Badge","icon","iconPosition","count","visualClasses","multipleElements","renderContent","filtersBarVariants","filterPillVariants","filterPopoverVariants","filterPopoverHeaderVariants","appliedFiltersVariants","filterSheetBackdropVariants","filterSheetVariants","filterSheetHeaderVariants","filterSheetBodyVariants","filterSheetFooterVariants","filterSheetGrabVariants","filterChipVariants","FilterPopover","badge","isActive","doneLabel","align","hasBadge","DialogTrigger","Dialog","close","setRef","AppliedFilters","chips","onRemove","onClearAll","clearAllLabel","removeChipLabel","scrollable","forwardedRef","regionRef","FOCUSABLE","handleRemove","chip","index","region","current","buttons","FiltersContext","useFiltersContext","ctx","Filters","labels","narrow","registry","registryVersion","setRegistryVersion","valuesRef","setValue","replaceValues","next","syncControl","control","n","contextValue","activeCount","clearAll","sheetOpen","setSheetOpen","panelRef","backdropRef","closeSheet","onDown","target","onKey","childArray","isChips","c","FilterChips","chipsChildren","controlChildren","SlidersHorizontal","FocusScope","useControlRegistration","optionsSignature","options","o","optionLabel","FilterSearch","chipGroup","FilterToggle","selected","SELECT_ALL_SENTINEL","FilterSelect","allLabel","sig","option","FilterWithin","presets","sentinel","radios","extra","preset","FilterMulti","optionValue","checkboxes","FilterCombobox","onSearch","labelCache","list","FilterOptionSchema","z"],"mappings":"0rBAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAA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A,CAAUR,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAIX,EAAK,GAAG,CAAA,CAC7Ce,CAAAA,CAASf,CAAAA,CAAK,GAAA,CAAKmB,CAAAA,CAAUA,CAAAA,CAAQ,YAAA,CAAe,EAAE,EACxD,CACF,CAAA,CAcI,UAAA,CAZmB,IAAY,CACjC,IAAMF,EAAqB,CAAE,GAAGlK,CAAO,CAAA,CACvC,IAAA,GAAW,CAACrC,CAAAA,CAAMyM,CAAO,CAAA,GAAKR,CAAAA,CAAS,OAAA,CACrCM,CAAAA,CAAKvM,CAAI,CAAA,CAAIyM,CAAAA,CAAQ,YAAA,CAEvBH,EAAcC,CAAI,EACpB,CAAA,CAOI,aAAA,CAAexB,CAAAA,CACf,eAAA,CAAiBC,CAAAA,CACjB,UAAA,CAAYgB,CAAAA,CACZ,YAAA,CAAY/O,CAAAA,CACZ,SAAA,CAAWnI,CAAAA,CACX,aAAA,CAAauL,CAAAA,CACf,CAEJ,CCxoBO,IAAMoP,EAAAA,CAAqBC,CAAAA,CAAE,MAAA,CAAO,CACzC,KAAA,CAAOA,CAAAA,CAAE,MAAA,EAAO,CAChB,KAAA,CAAOA,CAAAA,CAAE,MAAA,EACX,CAAC","file":"index.mjs","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","/**\n * Shared CVA Variant Utilities\n *\n * Common patterns extracted from component variants for consistency and reduced bundle size.\n * Use these constants in CVA definitions to ensure consistent styling across Themis.\n *\n * @see interaction-states.ts for interaction-specific styles (focus, hover, pressed)\n */\n\n// =============================================================================\n// Focus Ring Patterns\n// =============================================================================\n\n/**\n * Focus-within ring (for container elements with focusable children)\n * Use when the container should show focus when any child is focused\n */\nexport const FOCUS_WITHIN_RING = [\n 'focus-within:outline-none',\n 'focus-within:ring-2',\n 'focus-within:ring-[var(--ring)]',\n 'focus-within:ring-offset-2',\n] as const;\n\n/**\n * Focus-visible ring (for directly focusable elements)\n * Use for buttons, inputs, and other interactive elements\n */\nexport const FOCUS_VISIBLE_RING = [\n 'focus-visible:outline-none',\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n] as const;\n\n/**\n * Standard focus ring (for elements using :focus pseudo-class)\n * Prefer focus-visible when possible for better UX\n */\nexport const FOCUS_RING = [\n 'focus:outline-none',\n 'focus:ring-2',\n 'focus:ring-[var(--ring)]',\n] as const;\n\n/**\n * Focus with background change (for segments, cells, menu items)\n */\nexport const FOCUS_HIGHLIGHT = [\n 'focus:outline-none',\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Disabled State Patterns\n// =============================================================================\n\n/**\n * Standard disabled state using disabled attribute\n */\nexport const DISABLED_STANDARD = [\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n] as const;\n\n/**\n * Disabled state using data attribute (React Aria pattern)\n */\nexport const DISABLED_DATA_ATTR = [\n 'data-[disabled]:pointer-events-none',\n 'data-[disabled]:opacity-50',\n 'data-[disabled]:cursor-not-allowed',\n] as const;\n\n// =============================================================================\n// Size-Based Text Variants\n// =============================================================================\n\n/**\n * Small text size scale (xs -> sm -> base)\n */\nexport const TEXT_SIZE_SMALL_SCALE = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n} as const;\n\n/**\n * Medium text size scale (sm -> base -> lg)\n */\nexport const TEXT_SIZE_MEDIUM_SCALE = {\n sm: 'text-sm',\n default: 'text-base',\n lg: 'text-lg',\n} as const;\n\n// =============================================================================\n// Touch Target Utilities\n// =============================================================================\n\n/**\n * WCAG 2.2 AAA minimum touch target (44x44px)\n */\nexport const TOUCH_TARGET_MIN = [\n 'min-h-[44px]',\n 'min-w-[44px]',\n] as const;\n\n/**\n * Common button/cell sizes with touch target compliance\n */\nexport const INTERACTIVE_SIZES = {\n sm: 'h-9 w-9', // 36px - desktop only, NOT AAA compliant\n default: 'h-11 w-11', // 44px - AAA compliant\n lg: 'h-14 w-14', // 56px - AAA compliant, enhanced\n} as const;\n\n/**\n * Height-only sizes for fields and inputs\n */\nexport const FIELD_HEIGHTS = {\n sm: 'h-9', // 36px\n default: 'h-10', // 40px\n lg: 'h-11', // 44px\n} as const;\n\n/**\n * Layer 2: Visual sizing for form field inputs (height + padding + font).\n * Use on the <input>, <select>, or trigger element itself.\n *\n * Components may append additional classes (e.g. gap-* for segmented fields, py-* for text inputs).\n */\nexport const FIELD_INPUT_SIZES = {\n sm: `${FIELD_HEIGHTS.sm} px-2 text-xs`,\n default: `${FIELD_HEIGHTS.default} px-3 text-sm`,\n lg: `${FIELD_HEIGHTS.lg} px-4 text-base`,\n} as const;\n\n/**\n * Layer 1: Invisible touch target wrapper for form fields.\n * Apply to a <label> (or wrapper div) around the input element.\n * The <label> natively routes clicks/taps to the contained input\n * without JavaScript — achieving a 44px touch target while the\n * input stays at its visual height (h-9/h-10/h-11).\n */\nexport const FIELD_TOUCH_TARGET = 'min-h-[44px] flex items-center' as const;\n\n// =============================================================================\n// Message/Feedback Patterns\n// =============================================================================\n\n/**\n * Error message styling\n */\nexport const ERROR_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--destructive-background)]',\n] as const;\n\n/**\n * Success message styling\n */\nexport const SUCCESS_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--success-background)]',\n] as const;\n\n/**\n * Description/helper text styling\n */\nexport const DESCRIPTION_BASE = [\n 'text-[var(--menu-muted)]',\n] as const;\n\n/**\n * Label base styling\n */\nexport const LABEL_BASE = [\n 'font-medium',\n 'text-[var(--content-foreground)]',\n] as const;\n\n/**\n * Required indicator pattern\n */\nexport const REQUIRED_INDICATOR = \"after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]\";\n\n// =============================================================================\n// Animation Patterns\n// =============================================================================\n\n/**\n * Popover/dropdown entry animation\n */\nexport const POPOVER_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n] as const;\n\n/**\n * Popover/dropdown exit animation\n */\nexport const POPOVER_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n] as const;\n\n/**\n * Modal content enter animation (fade + zoom)\n * Uses React Aria data-[entering]/data-[exiting] attributes\n */\nexport const MODAL_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\n/**\n * Modal content exit animation (fade + zoom)\n * Uses React Aria data-[entering]/data-[exiting] attributes\n */\nexport const MODAL_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Modal slide enter animation (fade + slide up)\n */\nexport const MODAL_SLIDE_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:slide-in-from-bottom-4',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\n/**\n * Modal slide exit animation (fade + slide down)\n */\nexport const MODAL_SLIDE_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:slide-out-to-bottom-4',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Directional slide animations for edge-anchored drawers (Modal `position` variant).\n *\n * Unitless `slide-in-from-*` / `slide-out-to-*` translate the full extent of the\n * element (100%), so the drawer slides all the way in from / out to its anchored\n * edge — distinct from `MODAL_SLIDE_*` above, which is the small 1rem nudge used by\n * the centred `slide` animation. No `fade` is paired here: a drawer slides, it\n * does not fade. Honour `prefers-reduced-motion` via REDUCED_MOTION on the element.\n */\nexport const MODAL_SLIDE_IN_LEFT = [\n 'data-[entering]:animate-in',\n 'data-[entering]:slide-in-from-left',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\nexport const MODAL_SLIDE_OUT_LEFT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:slide-out-to-left',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\nexport const MODAL_SLIDE_IN_RIGHT = [\n 'data-[entering]:animate-in',\n 'data-[entering]:slide-in-from-right',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\nexport const MODAL_SLIDE_OUT_RIGHT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:slide-out-to-right',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\nexport const MODAL_SLIDE_IN_TOP = [\n 'data-[entering]:animate-in',\n 'data-[entering]:slide-in-from-top',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\nexport const MODAL_SLIDE_OUT_TOP = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:slide-out-to-top',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\nexport const MODAL_SLIDE_IN_BOTTOM = [\n 'data-[entering]:animate-in',\n 'data-[entering]:slide-in-from-bottom',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\nexport const MODAL_SLIDE_OUT_BOTTOM = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:slide-out-to-bottom',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Modal overlay enter/exit animation (fade only)\n */\nexport const MODAL_OVERLAY_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:duration-200',\n] as const;\n\nexport const MODAL_OVERLAY_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:duration-150',\n] as const;\n\n/**\n * Reduced motion support (WCAG 2.2)\n */\nexport const REDUCED_MOTION = [\n 'motion-reduce:transition-none',\n 'motion-reduce:animate-none',\n] as const;\n\n/**\n * Standard transition for colors\n */\nexport const TRANSITION_COLORS = [\n 'transition-colors',\n 'duration-200',\n] as const;\n\n/**\n * Fast transition for interactions\n */\nexport const TRANSITION_FAST = [\n 'transition-colors',\n 'duration-150',\n] as const;\n\n// =============================================================================\n// Hover State Patterns\n// =============================================================================\n\n/**\n * Accent background on hover (for interactive items)\n */\nexport const HOVER_ACCENT = [\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Helper Functions\n// =============================================================================\n\n/**\n * Combines multiple style arrays into a flat array for CVA base styles\n */\nexport function combineStyles(...styles: (readonly string[] | string)[]): string[] {\n return styles.flatMap(s => Array.isArray(s) ? [...s] : [s]);\n}\n","import { cva } from 'class-variance-authority';\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * Handles WCAG 2.2 AAA touch target requirement\n * Always transparent, centers the visual button inside\n * IMPORTANT: Focus ring stays on Layer 1 for AAA compliance (2.4.13)\n *\n * In vertical ButtonGroups, uses items-stretch so the visual layer (Layer 2)\n * can fill the full touch target height, eliminating gaps between buttons.\n */\nexport const buttonOuterVariants = cva(\n \"inline-flex justify-center min-h-[44px] min-w-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n inVerticalGroup: {\n true: \"items-stretch\",\n false: \"items-center\",\n },\n },\n defaultVariants: {\n fullWidth: false,\n inVerticalGroup: false,\n },\n }\n);\n\n/**\n * Layer 2: Visual button appearance (adjustable size)\n * Provides the visual appearance with configurable size\n * Can be smaller than touch target for use cases like carousel dots\n * NOTE: NO focus-visible styles here - focus ring is on Layer 1\n */\nexport const buttonVisualVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-normal ring-offset-background motion-safe:transition-transform motion-safe:duration-200 motion-safe:[transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer\",\n {\n variants: {\n variant: {\n default:\n \"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] hover:-translate-y-1\",\n destructive:\n \"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] hover:bg-[var(--destructive-background-hover,var(--destructive-background))] motion-safe:hover:btn-warn-shake\",\n outline:\n \"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)]\",\n secondary:\n \"bg-[var(--secondary)] text-[var(--secondary-foreground)] hover:bg-[var(--secondary-hover,var(--secondary))]\",\n ghost:\n \"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]\",\n link: \"text-[var(--text-link)] underline underline-offset-4 hover:bg-[var(--accent)] hover:text-[var(--text-link-hover)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n visualSize: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3 text-xs\",\n lg: \"h-11 rounded-md px-6 text-base\",\n icon: \"h-10 w-10\",\n dot: \"h-5 w-5 rounded-full p-0 min-h-0 min-w-0\",\n },\n paywall: {\n true: \"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n visualSize: \"default\",\n paywall: false,\n },\n }\n);\n\n/**\n * @deprecated Use buttonVisualVariants instead. This alias is kept for backward compatibility.\n */\nexport const buttonVariants = buttonVisualVariants;\n","\"use client\";\n\nimport { createContext, useContext } from 'react';\nimport type {\n ButtonGroupContextValue,\n ButtonGroupItemContextValue,\n} from './ButtonGroup.types';\n\n/**\n * ButtonGroup Context System (Two-Level)\n *\n * Provides a two-level context pattern for ButtonGroup:\n *\n * 1. ButtonGroupContext (group-level):\n * - Provides: orientation, variant, size, isDisabled\n * - Consumed by: Button (for prop inheritance), Separator (for orientation)\n *\n * 2. ButtonGroupItemContext (item-level):\n * - Provides: position ('first' | 'middle' | 'last' | 'only')\n * - Consumed by: Button (for border-radius styling)\n *\n * Both contexts return null when not in a provider, allowing Button\n * to work standalone without any group context.\n *\n * @see plan.md for architecture details\n * @see ButtonGroup.tsx for Provider implementation\n */\n\n// =============================================================================\n// Group-Level Context\n// =============================================================================\n\n/**\n * Context for group-level props (orientation, variant, size, isDisabled)\n * Default value is null to indicate \"not in a group\"\n */\nconst ButtonGroupContext = createContext<ButtonGroupContextValue | null>(null);\n\nButtonGroupContext.displayName = 'ButtonGroupContext';\n\n/**\n * Hook to access group-level context\n * @returns ButtonGroupContextValue if inside a ButtonGroup, null otherwise\n */\nexport function useButtonGroupContext(): ButtonGroupContextValue | null {\n return useContext(ButtonGroupContext);\n}\n\n// =============================================================================\n// Item-Level Context\n// =============================================================================\n\n/**\n * Context for per-button position information\n * Default value is null to indicate \"not wrapped with position context\"\n */\nconst ButtonGroupItemContext =\n createContext<ButtonGroupItemContextValue | null>(null);\n\nButtonGroupItemContext.displayName = 'ButtonGroupItemContext';\n\n/**\n * Hook to access item-level context (position)\n * @returns ButtonGroupItemContextValue if wrapped with position context, null otherwise\n */\nexport function useButtonGroupItemContext(): ButtonGroupItemContextValue | null {\n return useContext(ButtonGroupItemContext);\n}\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroupContext, ButtonGroupItemContext };\n","import { cva } from 'class-variance-authority';\n\n/**\n * ButtonGroup CVA Variants\n *\n * Defines Class Variance Authority (CVA) variants for:\n * - ButtonGroup container (orientation-based layout)\n * - ButtonGroupItem (position-based border-radius)\n * - ButtonGroupSeparator (orientation-based styling)\n *\n * @see plan.md Phase 1: Design & Contracts - CVA Variants\n * @see constitution.md Principle V (Component Quality Standards)\n */\n\n// =============================================================================\n// Container Variants\n// =============================================================================\n\n/**\n * ButtonGroup container variants\n * Controls the layout direction based on orientation\n * Uses gap-0 to ensure buttons are connected (share borders)\n */\nexport const buttonGroupVariants = cva('inline-flex items-center gap-0', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col w-full',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// =============================================================================\n// Item Position Variants\n// =============================================================================\n\n/**\n * ButtonGroupItem position variants\n * Applied to Button's visual layer (Layer 2) for position-aware border-radius\n *\n * Compound variants handle both orientation and position combinations:\n * - Horizontal: left/right borders and radii\n * - Vertical: top/bottom borders and radii\n */\nexport const buttonGroupItemVariants = cva('', {\n variants: {\n orientation: {\n // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)\n horizontal: 'min-w-[44px]',\n // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,\n // eliminating gaps between stacked buttons in vertical orientation\n vertical: 'flex min-h-[44px]',\n },\n position: {\n first: '',\n middle: '',\n last: '',\n only: '', // Single button - no modifications needed\n },\n },\n compoundVariants: [\n // ==========================================================================\n // Horizontal Orientation\n // ==========================================================================\n {\n orientation: 'horizontal',\n position: 'first',\n className: 'rounded-r-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'middle',\n className: 'rounded-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'last',\n className: 'rounded-l-none',\n },\n // ==========================================================================\n // Vertical Orientation\n // Note: w-full is handled by Button's effectiveFullWidth for both layers\n // ==========================================================================\n {\n orientation: 'vertical',\n position: 'first',\n className: 'rounded-b-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'middle',\n className: 'rounded-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'last',\n className: 'rounded-t-none',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n position: 'only',\n },\n});\n\n// =============================================================================\n// Separator Variants\n// =============================================================================\n\n/**\n * ButtonGroupSeparator variants\n * Orientation-aware visual divider between button groups\n */\nexport const buttonGroupSeparatorVariants = cva('bg-[var(--border)]', {\n variants: {\n orientation: {\n horizontal: 'w-px h-6 mx-1',\n vertical: 'h-px w-full my-1',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n","\"use client\";\n\n/**\n * Button Component - 3-Layer Architecture\n * Accessible button with React Aria primitives and CVA styling\n *\n * Architecture:\n * - Layer 1: Touch Target (44x44px WCAG AAA compliant, transparent)\n * - Layer 2: Visual Button (configurable size, colors, borders)\n * - Layer 3: Content & Effects (text, icons, ripple, loading spinner)\n *\n * @see 3layer-plan.md for architecture details\n * @see spec.md FR-029 to FR-037 (Button Component Requirements)\n * @see spec.md FR-009 (WCAG 2.2 AAA - 7:1 contrast ratio)\n * @see spec.md FR-014 (44x44px minimum touch targets)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, useId } from 'react';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { Loader2, Zap } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { ButtonProps } from './Button.types';\nimport { buttonOuterVariants, buttonVisualVariants, buttonVariants } from './Button.styles';\nimport { PRESSED_STYLES, HOVER_STYLES, HIGH_CONTRAST_HOVER, HIGH_CONTRAST_PRESSED } from '../../styles/interaction-states';\nimport {\n useButtonGroupContext,\n useButtonGroupItemContext,\n} from '../ButtonGroup/ButtonGroupContext';\nimport { buttonGroupItemVariants } from '../ButtonGroup/ButtonGroup.variants';\n\n/**\n * Button Component - 3-Layer Architecture\n * Fully accessible button with React Aria and themed styling\n *\n * Layer 1: Touch Target (AriaButton) - 44x44px WCAG AAA compliant\n * Layer 2: Visual Button (span) - configurable appearance\n * Layer 3: Content (children) - text, icons, effects\n */\nconst Button = memo(forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n buttonVisualClassName,\n variant,\n size,\n visualSize,\n fullWidth,\n loading = false,\n loadingText = \"Loading...\",\n shortcut,\n children,\n isDisabled,\n paywall = false,\n paywallRedirect,\n paywallDescription,\n onPress,\n ...props\n },\n ref\n ) => {\n const paywallDescriptionId = useId();\n\n // ==========================================================================\n // ButtonGroup Context Integration\n // ==========================================================================\n\n // Consume group-level context (variant, size, isDisabled, orientation)\n const groupContext = useButtonGroupContext();\n\n // Consume item-level context (position for border-radius styling)\n const itemContext = useButtonGroupItemContext();\n\n // Merge context values with props (props take precedence)\n const effectiveVariant = variant ?? groupContext?.variant ?? 'default';\n const effectiveSize = size ?? groupContext?.size;\n const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;\n\n // In vertical groups, buttons should be full width automatically\n const isInVerticalGroup = groupContext?.orientation === 'vertical';\n const effectiveFullWidth = fullWidth || isInVerticalGroup;\n\n // Position styling for ButtonGroup (only applied when in a group)\n const positionClassName = itemContext\n ? buttonGroupItemVariants({\n orientation: groupContext?.orientation ?? 'horizontal',\n position: itemContext.position,\n })\n : '';\n\n // Default visualSize to size for backward compatibility\n const effectiveVisualSize = visualSize ?? effectiveSize ?? 'default';\n\n // AAA Accessibility: Warn in dev/test if icon/dot variant lacks accessible name\n if (process.env.NODE_ENV !== 'production') {\n if (\n (effectiveVisualSize === 'dot' || effectiveVisualSize === 'icon') &&\n !props['aria-label'] &&\n !children\n ) {\n console.warn(\n '[Button] visualSize=\"dot\" or \"icon\" requires aria-label when no visible text is provided (WCAG 1.1.1)'\n );\n }\n }\n\n /**\n * Handle button press - intercepts action when paywalled\n * If paywalled with redirect URL, opens in new tab\n * Otherwise, calls the normal onPress handler\n */\n const handlePress = (e: Parameters<NonNullable<AriaButtonProps['onPress']>>[0]): void => {\n if (paywall) {\n if (paywallRedirect) {\n window.open(paywallRedirect, '_blank', 'noopener,noreferrer');\n }\n // Don't call onPress when paywalled\n return;\n }\n onPress?.(e);\n };\n\n // Only set isDisabled when we have a reason to disable\n // Otherwise, let slot system control disabled state (e.g., in NumberField)\n const computedIsDisabled = effectiveIsDisabled || loading || undefined;\n\n return (\n <AriaButton\n ref={ref}\n isDisabled={computedIsDisabled}\n aria-disabled={paywall ? true : undefined}\n aria-describedby={paywall ? paywallDescriptionId : undefined}\n onPress={handlePress}\n className={cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className)}\n {...props}\n >\n {(renderProps) => (\n /* Layer 2: Visual Button */\n <span\n className={cn(\n buttonVisualVariants({\n variant: effectiveVariant,\n visualSize: effectiveVisualSize,\n paywall,\n fullWidth: effectiveFullWidth,\n }),\n // Position styling from ButtonGroup context (border-radius adjustments)\n positionClassName,\n buttonVisualClassName,\n // Layer 2 interaction styles (no focus - focus ring is on Layer 1)\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED\n )}\n data-pressed={renderProps.isPressed || undefined}\n >\n {/* Layer 3: Content & Effects */}\n\n {/* FR-033: Loading spinner with screen reader announcement */}\n {/* Uses motion-safe: for WCAG 2.3.3 AAA (Animation from Interactions) */}\n {loading && (\n <>\n <Loader2 className=\"motion-safe:animate-spin\" aria-hidden=\"true\" />\n <span className=\"sr-only\" aria-live=\"polite\">\n {loadingText}\n </span>\n </>\n )}\n\n {/* Hide children during loading */}\n {!loading && children}\n\n {/* Paywall: Lightning bolt icon */}\n {paywall && (\n <Zap\n data-testid=\"zap-icon\"\n aria-hidden=\"true\"\n className=\"ml-1\"\n />\n )}\n\n {/* Paywall: Screen reader description */}\n {paywall && (\n <span id={paywallDescriptionId} className=\"sr-only\">\n Premium feature: {paywallDescription || \"Upgrade required to access this feature\"}\n </span>\n )}\n\n {/* FR-034: Keyboard shortcut display on focus */}\n {renderProps.isFocusVisible && shortcut && (\n <kbd className=\"ml-auto hidden text-xs opacity-60 lg:inline\">\n {shortcut}\n </kbd>\n )}\n\n </span>\n )}\n </AriaButton>\n );\n }\n));\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants, buttonOuterVariants, buttonVisualVariants };\nexport type { ButtonProps } from './Button.types';\n","/**\n * TextField Icon Components\n * SVG icons for password toggle functionality\n *\n * Extracted from TextField.tsx to keep the main component file focused.\n * These are module-level components to avoid re-creating on every render.\n */\n\nimport type { ReactElement } from 'react';\n\n/**\n * Eye icon for \"show password\" state\n * Rendered when the password is currently hidden\n */\nexport const EyeIcon = (): ReactElement => (\n <svg\n data-testid=\"password-toggle-icon-show\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M1 8s3-5 7-5 7 5 7 5-3 5-7 5-7-5-7-5z\" />\n <circle cx=\"8\" cy=\"8\" r=\"2\" />\n </svg>\n);\n\n/**\n * Eye-off icon for \"hide password\" state\n * Rendered when the password is currently visible\n */\nexport const EyeOffIcon = (): ReactElement => (\n <svg\n data-testid=\"password-toggle-icon-hide\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10.5 5.5l-5 5\" />\n <path d=\"M1 8s3-5 7-5c1.5 0 2.8.6 4 1.5M15 8s-1.5 2.5-4 4\" />\n <path d=\"M3 13l2-2m7-7l2-2\" />\n <circle cx=\"8\" cy=\"8\" r=\"2\" />\n </svg>\n);\n","/**\n * TextField CVA Variant Styles\n * Extracted from TextField.tsx for separation of concerns\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements - WCAG 2.2 AAA)\n * @see React Aria TextField: https://react-spectrum.adobe.com/react-aria/TextField.html\n * @see ShadCN Input: https://ui.shadcn.com/docs/components/input\n * @see ShadCN Label: https://ui.shadcn.com/docs/components/label\n */\n\nimport { cva } from 'class-variance-authority';\nimport { FIELD_INPUT_SIZES } from '../../styles';\n\n/**\n * Input variant styles using CVA\n * Adapts ShadCN Input styling with Themis semantic tokens\n */\nexport const inputVariants = cva(\n // Base styles - FR-014: Proper input styling with focus states\n \"flex w-full rounded-md border bg-[var(--content-background)] px-3 py-2 text-sm ring-offset-[var(--content-background)] file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-[var(--content-foreground)] placeholder:text-[var(--menu-muted)] transition-all duration-200\",\n {\n variants: {\n // Size variants (matching Button sizes)\n size: {\n sm: `${FIELD_INPUT_SIZES.sm} py-1`,\n default: `${FIELD_INPUT_SIZES.default} py-2`,\n lg: `${FIELD_INPUT_SIZES.lg} py-3`,\n },\n // State variants\n state: {\n default: \"border-[var(--input-border)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2\",\n error: \"border-[var(--destructive-background)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--destructive-background)] focus-visible:ring-offset-2\",\n success: \"border-[var(--success-background)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--success-ring)] focus-visible:ring-offset-2\",\n disabled: \"cursor-not-allowed opacity-50\",\n readonly: \"cursor-default bg-[var(--content-background)] opacity-70\"\n }\n },\n defaultVariants: {\n size: \"default\",\n state: \"default\"\n }\n }\n);\n\n/**\n * Label variant styles using CVA\n * Adapts ShadCN Label styling with Themis semantic tokens\n */\nexport const labelVariants = cva(\n // Base styles - FR-009: WCAG 2.2 AAA compliance\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n {\n variants: {\n // Labels stay the default content colour even when the field is\n // invalid — the destructive asterisk and the inline error message\n // already convey the error. Only `disabled` carries a distinct style.\n state: {\n default: \"text-[var(--content-foreground)]\",\n disabled: \"opacity-50 cursor-not-allowed\"\n }\n },\n defaultVariants: {\n state: \"default\"\n }\n }\n);\n\n/**\n * Description text variant styles\n */\nexport const descriptionVariants = cva(\n \"text-sm text-[var(--content-foreground)]\"\n);\n\n/**\n * Error message variant styles\n *\n * No mt-* margin: the parent AriaTextField wrapper supplies a `gap-1.5` (6px)\n * flex gap between children, which satisfies the input → hint/error spacing.\n */\nexport const errorMessageVariants = cva(\n \"text-sm text-[var(--destructive-background)] font-medium\"\n);\n\n/**\n * Success message variant styles\n *\n * No mt-* margin: the parent AriaTextField wrapper supplies a `gap-1.5` (6px)\n * flex gap between children, which satisfies the input → hint/error spacing.\n */\nexport const successMessageVariants = cva(\n \"text-sm text-[var(--success-foreground)] font-medium\"\n);\n","/**\n * TextField Custom Hooks\n * Extracted from TextField.tsx for separation of concerns\n *\n * These hooks encapsulate the behavioral logic for:\n * - Expand on focus\n * - Copy/paste protection\n * - Password visibility toggle\n */\n\nimport { useState, useEffect, useCallback, useMemo } from 'react';\nimport type { FocusEvent, ClipboardEvent } from 'react';\n\n/**\n * Hook: useExpandOnFocus\n * Manages the expand-on-focus behavior where an input starts narrow\n * and expands to full width when focused or when it has a value.\n *\n * @param expandOnFocus - Whether expand-on-focus is enabled\n * @param collapsedWidth - CSS width when collapsed (e.g., '200px')\n * @param value - Controlled value (if any)\n * @param defaultValue - Default value (if any)\n * @param userOnFocus - User-provided onFocus handler to call through\n * @param userOnBlur - User-provided onBlur handler to call through\n */\nexport function useExpandOnFocus({\n expandOnFocus,\n collapsedWidth,\n value,\n defaultValue,\n userOnFocus,\n userOnBlur,\n}: {\n expandOnFocus: boolean;\n collapsedWidth: string;\n value: string | undefined;\n defaultValue: string | undefined;\n userOnFocus: ((e: FocusEvent<HTMLInputElement>) => void) | undefined;\n userOnBlur: ((e: FocusEvent<HTMLInputElement>) => void) | undefined;\n}) {\n const [isFocused, setIsFocused] = useState(false);\n\n const handleFocus = useCallback((e: FocusEvent<HTMLInputElement>) => {\n if (expandOnFocus) {\n setIsFocused(true);\n }\n userOnFocus?.(e);\n }, [expandOnFocus, userOnFocus]);\n\n const handleBlur = useCallback((e: FocusEvent<HTMLInputElement>) => {\n if (expandOnFocus) {\n const isEmpty = e.target.value === '';\n if (isEmpty) {\n setIsFocused(false);\n }\n }\n userOnBlur?.(e);\n }, [expandOnFocus, userOnBlur]);\n\n const inputWidth = useMemo(() => {\n if (!expandOnFocus) return undefined;\n\n const hasValue = value !== undefined ? value !== '' : defaultValue !== undefined && defaultValue !== '';\n\n if (isFocused || hasValue) {\n return '100%';\n }\n\n return collapsedWidth;\n }, [expandOnFocus, isFocused, value, defaultValue, collapsedWidth]);\n\n return { handleFocus, handleBlur, inputWidth };\n}\n\n/**\n * Hook: useCopyPasteProtection\n * Manages copy/paste prevention with shake animation and screen reader announcements.\n *\n * @param disableCopyPaste - Whether copy/paste should be disabled\n */\nexport function useCopyPasteProtection({\n disableCopyPaste,\n}: {\n disableCopyPaste: boolean;\n}) {\n const [isShaking, setIsShaking] = useState(false);\n const [screenReaderMessage, setScreenReaderMessage] = useState('');\n\n // Development mode warning for disableCopyPaste\n useEffect(() => {\n if (disableCopyPaste && typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {\n console.warn(\n '[TextField] Copy/paste prevention should only be used for security-critical fields like password confirmation. ' +\n 'This feature can break assistive technology workflows and password managers.'\n );\n }\n }, [disableCopyPaste]);\n\n const handlePaste = useCallback((e: ClipboardEvent<HTMLInputElement>) => {\n if (disableCopyPaste) {\n e.preventDefault();\n\n // Trigger shake animation\n setIsShaking(true);\n\n // Announce to screen readers\n setScreenReaderMessage('Pasting is not allowed in this field. Please type your entry.');\n\n // Remove shake animation and clear message after 250ms\n setTimeout(() => {\n setIsShaking(false);\n setScreenReaderMessage('');\n }, 250);\n }\n }, [disableCopyPaste]);\n\n return { isShaking, screenReaderMessage, handlePaste };\n}\n\n/**\n * Hook: usePasswordToggle\n * Manages password show/hide toggle state and determines the actual input type.\n *\n * @param type - The input type ('text', 'email', 'password', etc.)\n * @param showPasswordToggle - Whether the toggle button should be shown\n */\nexport function usePasswordToggle({\n type,\n showPasswordToggle,\n}: {\n type: string;\n showPasswordToggle: boolean | undefined;\n}) {\n const [showPassword, setShowPassword] = useState(false);\n\n const handlePasswordToggle = useCallback(() => {\n setShowPassword(prev => !prev);\n }, []);\n\n const actualType = useMemo(() => {\n if (type === 'password' && showPasswordToggle && showPassword) {\n return 'text';\n }\n return type;\n }, [type, showPasswordToggle, showPassword]);\n\n return { showPassword, actualType, handlePasswordToggle };\n}\n","\"use client\";\n\n/**\n * TextField Component\n * Accessible text input with React Aria primitives and CVA styling\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements - WCAG 2.2 AAA)\n * @see React Aria TextField: https://react-spectrum.adobe.com/react-aria/TextField.html\n * @see ShadCN Input: https://ui.shadcn.com/docs/components/input\n * @see ShadCN Label: https://ui.shadcn.com/docs/components/label\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport './TextField.css';\nimport { forwardRef, useId, useMemo, useState, useCallback } from 'react';\nimport {\n TextField as AriaTextField,\n Label as AriaLabel,\n Input as AriaInput,\n Text as AriaText,\n FieldError as AriaFieldError,\n} from 'react-aria-components';\nimport { cn } from '../../utils/cn';\nimport { DISABLED_STYLES } from '../../styles/interaction-states';\nimport { FIELD_TOUCH_TARGET } from '../../styles';\nimport type {\n TextFieldProps,\n TextFieldLabelProps,\n TextFieldInputProps,\n TextFieldDescriptionProps,\n TextFieldErrorProps,\n} from './TextField.types';\nimport { Search, X } from 'lucide-react';\nimport { Button } from '../Button';\nimport { EyeIcon, EyeOffIcon } from './TextField.icons';\nimport {\n inputVariants,\n labelVariants,\n descriptionVariants,\n errorMessageVariants,\n successMessageVariants,\n} from './TextField.styles';\nimport { useExpandOnFocus, useCopyPasteProtection, usePasswordToggle } from './TextField.hooks';\n\n// Re-export CVA variants so existing imports from './TextField' continue to work\nexport {\n inputVariants,\n labelVariants,\n descriptionVariants,\n errorMessageVariants,\n successMessageVariants,\n};\n\n/**\n * TextFieldLabel Sub-component\n * Styled label with optional required indicator\n */\nexport const TextFieldLabel = forwardRef<HTMLLabelElement, TextFieldLabelProps>(\n ({ className, state = 'default', children, ...props }, ref) => {\n return (\n <AriaLabel\n ref={ref}\n className={cn(labelVariants({ state }), className)}\n {...props}\n >\n {children}\n </AriaLabel>\n );\n }\n);\n\nTextFieldLabel.displayName = \"TextFieldLabel\";\n\n/**\n * TextFieldInput Sub-component\n * Styled input with size and state variants\n */\nexport const TextFieldInput = forwardRef<HTMLInputElement, TextFieldInputProps>(\n ({ className, size = 'default', state = 'default', ...props }, ref) => {\n return (\n <AriaInput\n ref={ref}\n className={cn(inputVariants({ size, state }), DISABLED_STYLES, className)}\n {...props}\n />\n );\n }\n);\n\nTextFieldInput.displayName = \"TextFieldInput\";\n\n/**\n * TextFieldDescription Sub-component\n * Helper text displayed below the input\n */\nexport const TextFieldDescription = forwardRef<HTMLDivElement, TextFieldDescriptionProps>(\n ({ className, children, ...props }, ref) => {\n return (\n <AriaText\n ref={ref}\n slot=\"description\"\n className={cn(descriptionVariants(), className)}\n {...props}\n >\n {children}\n </AriaText>\n );\n }\n);\n\nTextFieldDescription.displayName = \"TextFieldDescription\";\n\n/**\n * TextFieldError Sub-component\n * Error message displayed when field is invalid\n * Note: We use AriaFieldError with explicit role=\"alert\" for screen reader announcements\n */\nexport const TextFieldError = forwardRef<HTMLDivElement, TextFieldErrorProps>(\n ({ className, children, ...props }, ref) => {\n // AriaFieldError already wires aria-describedby/aria-invalid back to the\n // parent field so screen readers announce the error — no explicit\n // role=\"alert\" needed.\n return (\n <AriaFieldError\n ref={ref}\n {...props}\n className={cn(errorMessageVariants(), className)}\n >\n {children}\n </AriaFieldError>\n );\n }\n);\n\nTextFieldError.displayName = \"TextFieldError\";\n\n/**\n * TextFieldSuccess Sub-component\n * Success message displayed when field is valid\n */\nexport const TextFieldSuccess = forwardRef<HTMLDivElement, TextFieldDescriptionProps>(\n ({ className, children, ...props }, ref) => {\n return (\n <AriaText\n ref={ref}\n slot=\"description\"\n className={cn(successMessageVariants(), className)}\n {...props}\n >\n {children}\n </AriaText>\n );\n }\n);\n\nTextFieldSuccess.displayName = \"TextFieldSuccess\";\n\n/**\n * TextField Component\n * Fully accessible text input with React Aria and themed styling\n *\n * @example\n * <TextField\n * label=\"Email\"\n * description=\"We'll never share your email\"\n * isRequired\n * type=\"email\"\n * />\n */\nexport const TextField = forwardRef<HTMLDivElement, TextFieldProps>(\n (\n {\n className,\n size = 'default',\n label,\n labelHint,\n description,\n errorMessage,\n successMessage,\n type = 'text',\n isRequired = false,\n isReadOnly = false,\n isDisabled = false,\n isInvalid = false,\n isValid = false,\n id,\n autoComplete,\n disableCopyPaste = false,\n pattern,\n patternDescription,\n expandOnFocus = false,\n collapsedWidth = '200px',\n prefix,\n suffix,\n prefixSize = 16,\n suffixSize = 16,\n showPasswordToggle,\n isIconHidden = false,\n onSubmit,\n onClear,\n value,\n defaultValue,\n onFocus: userOnFocus,\n onBlur: userOnBlur,\n ...props\n },\n ref\n ) => {\n // Generate unique IDs for error message linking\n const errorId = useId();\n const generatedId = useId();\n const fieldId = id || generatedId;\n\n // Custom hooks for behavioral logic\n const { handleFocus, handleBlur, inputWidth } = useExpandOnFocus({\n expandOnFocus,\n collapsedWidth,\n value,\n defaultValue,\n userOnFocus,\n userOnBlur,\n });\n\n const { isShaking, screenReaderMessage, handlePaste } = useCopyPasteProtection({\n disableCopyPaste,\n });\n\n const { showPassword, actualType, handlePasswordToggle } = usePasswordToggle({\n type,\n showPasswordToggle,\n });\n\n // ==========================================================================\n // Search functionality (type=\"search\")\n // ==========================================================================\n const isSearch = type === 'search';\n const [searchValue, setSearchValue] = useState(defaultValue ?? '');\n const isControlledSearch = value !== undefined;\n const currentSearchValue = isControlledSearch ? value : searchValue;\n\n const handleSearchChange = useCallback(\n (newValue: string) => {\n if (!isControlledSearch) {\n setSearchValue(newValue);\n }\n (props as { onChange?: (v: string) => void }).onChange?.(newValue);\n },\n [isControlledSearch, props]\n );\n\n const handleSearchClear = useCallback(() => {\n if (!isControlledSearch) {\n setSearchValue('');\n }\n (props as { onChange?: (v: string) => void }).onChange?.('');\n onClear?.();\n }, [isControlledSearch, props, onClear]);\n\n const handleSearchKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && onSubmit) {\n onSubmit(currentSearchValue);\n }\n if (e.key === 'Escape' && currentSearchValue) {\n e.preventDefault();\n handleSearchClear();\n }\n },\n [currentSearchValue, onSubmit, handleSearchClear]\n );\n\n // Determine input state based on props\n const inputState = useMemo(() => {\n if (isDisabled) return 'disabled';\n if (isReadOnly) return 'readonly';\n if (isInvalid) return 'error';\n if (isValid) return 'success';\n return 'default';\n }, [isDisabled, isReadOnly, isInvalid, isValid]);\n\n // Determine label state — labels don't carry an error state any more\n // (the asterisk + error message already convey it).\n const labelState = useMemo(() => {\n if (isDisabled) return 'disabled';\n return 'default';\n }, [isDisabled]);\n\n // Combine description and patternDescription\n const combinedDescription = useMemo(() => {\n if (description && patternDescription) {\n return `${description} ${patternDescription}`;\n }\n return description || patternDescription;\n }, [description, patternDescription]);\n\n // Determine actual prefix (search icon auto-added for type=\"search\")\n const actualPrefix = useMemo(() => {\n if (isSearch && !isIconHidden && !prefix) {\n const iconSize = size === 'sm' ? 'h-3.5 w-3.5' : size === 'lg' ? 'h-5 w-5' : 'h-4 w-4';\n return <Search className={iconSize} />;\n }\n return prefix;\n }, [isSearch, isIconHidden, prefix, size]);\n\n // Calculate dynamic padding for prefix/suffix\n const inputPadding = useMemo(() => {\n const basePadding = { left: 12, right: 12 }; // Default px-3 = 12px\n\n if (actualPrefix) {\n const prefixWidth = typeof actualPrefix === 'string'\n ? actualPrefix.length * 8 + 16\n : prefixSize + 16;\n basePadding.left = prefixWidth;\n }\n\n if (type === 'password' && showPasswordToggle) {\n basePadding.right = 16 + 16;\n } else if (isSearch && currentSearchValue) {\n basePadding.right = 44; // Space for clear button\n } else if (suffix) {\n const suffixWidth = typeof suffix === 'string'\n ? suffix.length * 8 + 16\n : suffixSize + 16;\n basePadding.right = suffixWidth;\n }\n\n return basePadding;\n }, [actualPrefix, prefix, suffix, prefixSize, suffixSize, type, showPasswordToggle, isSearch, currentSearchValue]);\n\n // Determine actual suffix (password toggle / search clear / custom suffix)\n const actualSuffix = useMemo(() => {\n if (type === 'password' && showPasswordToggle) {\n return (\n <Button\n variant=\"ghost\"\n visualSize=\"icon\"\n onPress={handlePasswordToggle}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n className=\"!min-h-0 !min-w-0 h-8 w-8\"\n >\n {showPassword ? <EyeOffIcon /> : <EyeIcon />}\n </Button>\n );\n }\n if (isSearch && currentSearchValue) {\n const iconSize = size === 'sm' ? 'h-3 w-3' : size === 'lg' ? 'h-5 w-5' : 'h-4 w-4';\n return (\n <Button\n variant=\"ghost\"\n visualSize=\"icon\"\n onPress={handleSearchClear}\n aria-label=\"Clear search\"\n className=\"!min-h-0 !min-w-0 h-8 w-8\"\n >\n <X className={iconSize} />\n </Button>\n );\n }\n return suffix;\n }, [type, showPasswordToggle, showPassword, suffix, handlePasswordToggle, isSearch, currentSearchValue, size, handleSearchClear]);\n\n // Whether the suffix is an interactive button (password toggle or search clear)\n const hasInteractiveSuffix = (type === 'password' && showPasswordToggle) || (isSearch && !!currentSearchValue);\n\n return (\n <AriaTextField\n ref={ref}\n className={cn(\"flex flex-col gap-1.5\", className)}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n value={isSearch ? currentSearchValue : value}\n defaultValue={isSearch ? undefined : defaultValue}\n onChange={isSearch ? handleSearchChange : undefined}\n {...props}\n >\n {/* Label with optional hint and required indicator */}\n {label && (\n <AriaLabel className={cn(labelVariants({ state: labelState }), labelHint && \"flex items-baseline justify-between\")}>\n <span>\n {label}\n {isRequired && (\n <span className=\"ml-1 text-[var(--destructive-background)]\" aria-hidden=\"true\">\n <strong>*</strong>\n </span>\n )}\n </span>\n {labelHint && (\n <span className=\"text-xs font-normal text-[var(--muted-foreground)]\">{labelHint}</span>\n )}\n </AriaLabel>\n )}\n\n {/* Description text (helper text) */}\n {combinedDescription && (\n <AriaText slot=\"description\" className={cn(descriptionVariants())}>\n {combinedDescription}\n </AriaText>\n )}\n\n {/* Layer 1: Touch target (44px min) — clicking routes focus to input */}\n {/* Layer 2: Input (visual height h-10) is inside */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={cn(FIELD_TOUCH_TARGET, \"relative cursor-text motion-safe:transition-colors motion-safe:duration-200\")}\n style={{\n width: inputWidth,\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n >\n {/* Prefix */}\n {actualPrefix && (\n <div\n data-testid=\"textfield-prefix\"\n className=\"absolute left-3 flex items-center justify-center pointer-events-none text-[var(--content-foreground)]\"\n aria-hidden=\"true\"\n >\n {actualPrefix}\n </div>\n )}\n\n {/* Input */}\n <AriaInput\n type={actualType}\n id={fieldId}\n className={cn(\n inputVariants({ size, state: inputState }),\n DISABLED_STYLES,\n isShaking && 'shake'\n )}\n style={{\n width: '100%',\n paddingLeft: `${inputPadding.left}px`,\n paddingRight: `${inputPadding.right}px`,\n }}\n autoComplete={autoComplete}\n pattern={pattern}\n onPaste={handlePaste}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={isSearch ? handleSearchKeyDown : undefined}\n aria-required={isRequired ? 'true' : undefined}\n aria-readonly={isReadOnly ? 'true' : undefined}\n aria-errormessage={isInvalid && errorMessage ? errorId : undefined}\n />\n\n {/* Suffix */}\n {actualSuffix && (\n <div\n data-testid=\"textfield-suffix\"\n className={cn(\n \"absolute right-3 flex items-center justify-center text-[var(--content-foreground)]\",\n hasInteractiveSuffix ? \"\" : \"pointer-events-none\"\n )}\n aria-hidden={hasInteractiveSuffix ? undefined : \"true\"}\n >\n {actualSuffix}\n </div>\n )}\n </div>\n\n {/* Success message (shown when valid) */}\n {isValid && successMessage && !isInvalid && (\n <AriaText slot=\"description\" className={cn(successMessageVariants())}>\n {successMessage}\n </AriaText>\n )}\n\n {/* Error message (shown when invalid) - takes precedence over success */}\n {isInvalid && errorMessage && (\n <TextFieldError id={errorId}>\n {errorMessage}\n </TextFieldError>\n )}\n\n {/* Screen reader announcement for paste prevention */}\n {screenReaderMessage && (\n <div className=\"sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {screenReaderMessage}\n </div>\n )}\n </AriaTextField>\n );\n }\n);\n\nTextField.displayName = \"TextField\";\n\nexport { inputVariants as textFieldInputVariants, labelVariants as textFieldLabelVariants };\n","'use client';\n\n/**\n * SearchField Component\n *\n * A specialized search input built on the Themis TextField component.\n * Delegates all rendering and behavior to TextField with type=\"search\",\n * which provides search icon, clear button (Themis Button), and keyboard support.\n *\n * WCAG 2.2 AAA compliant:\n * - 44x44px touch targets on all interactive elements (via Themis Button)\n * - Clear button uses Themis Button three-layer architecture\n * - Escape key clears input\n * - Enter key submits search\n * - role=\"searchbox\" via type=\"search\"\n *\n * @example\n * ```tsx\n * <SearchField\n * label=\"Search\"\n * placeholder=\"Search items...\"\n * onSubmit={(value) => console.log('Search:', value)}\n * />\n * ```\n */\n\nimport { forwardRef } from 'react';\nimport { TextField } from '../TextField/TextField';\nimport type { SearchFieldProps } from './SearchField.types';\n\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (\n {\n label,\n description,\n errorMessage,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref\n ) => {\n // Warn if no accessible label is provided\n if (process.env.NODE_ENV !== 'production') {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n '[SearchField] Either label, aria-label, or aria-labelledby is required for accessibility (WCAG 1.1.1)'\n );\n }\n }\n\n return (\n <TextField\n ref={ref}\n type=\"search\"\n label={label}\n description={errorMessage ? undefined : description}\n errorMessage={errorMessage}\n isInvalid={!!errorMessage}\n aria-label={!label ? ariaLabel : undefined}\n aria-labelledby={ariaLabelledBy}\n {...props}\n />\n );\n }\n);\n\nSearchField.displayName = 'SearchField';\n","/**\n * Determines whether a component should animate.\n *\n * Returns `false` if:\n * - The `animated` prop is explicitly `false`\n * - The user prefers reduced motion\n *\n * @param animated - The component's `animated` prop value (default: `true`)\n * @param prefersReducedMotion - Whether the user prefers reduced motion\n */\nexport function shouldAnimate(\n animated: boolean | undefined,\n prefersReducedMotion: boolean,\n): boolean {\n if (animated === false) return false;\n if (prefersReducedMotion) return false;\n return true;\n}\n","'use client';\n\nimport { useState, useEffect } from 'react';\n\nconst QUERY = '(prefers-reduced-motion: reduce)';\n\nfunction getInitialState(): boolean {\n if (typeof window === 'undefined') return false;\n return window.matchMedia(QUERY).matches;\n}\n\n/**\n * Detects whether the user prefers reduced motion.\n *\n * - SSR-safe (returns `false` on the server)\n * - Reacts to changes in the OS preference\n * - Cleans up the listener on unmount\n */\nexport function useReducedMotion(): boolean {\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(getInitialState);\n\n useEffect(() => {\n const mql = window.matchMedia(QUERY);\n setPrefersReducedMotion(mql.matches);\n\n const handler = (event: MediaQueryListEvent): void => {\n setPrefersReducedMotion(event.matches);\n };\n\n mql.addEventListener('change', handler);\n return () => mql.removeEventListener('change', handler);\n }, []);\n\n return prefersReducedMotion;\n}\n","\"use client\";\n\n/**\n * Switch Component\n * Accessible toggle switch with React Aria primitives and CVA styling.\n * Supports optional spring animation via motion.dev.\n *\n * @see React Aria Switch: https://react-spectrum.adobe.com/react-aria/Switch.html\n * @see ShadCN Switch: https://ui.shadcn.com/docs/components/switch\n * @see spec.md (WCAG 2.2 AAA - 7:1 contrast ratio, 44x44px touch targets)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, useRef, useEffect, useCallback } from 'react';\nimport {\n Switch as AriaSwitch,\n type SwitchProps as AriaSwitchProps,\n} from 'react-aria-components';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { shouldAnimate } from '../../utils/shouldAnimate';\nimport { useReducedMotion } from '../../hooks/useReducedMotion';\nimport { DEFAULT_INTERACTIONS } from '../../styles/interaction-states';\nimport type { AnimatedProps, SpringConfig } from '../../types/animation';\n\n// ---------------------------------------------------------------------------\n// Motion lazy-loader — avoids hard dep on optional peer\n// ---------------------------------------------------------------------------\n\ntype AnimateFn = (\n element: Element,\n keyframes: Record<string, string | number>,\n options?: Record<string, unknown>,\n) => { stop: () => void };\n\nlet cachedAnimate: AnimateFn | null | undefined; // undefined = pending, null = unavailable\n\nfunction loadMotionAnimate(): Promise<AnimateFn | null> {\n if (cachedAnimate !== undefined) return Promise.resolve(cachedAnimate);\n\n return import('motion')\n .then((m) => {\n cachedAnimate = m.animate as unknown as AnimateFn;\n return cachedAnimate;\n })\n .catch(() => {\n cachedAnimate = null;\n return null;\n });\n}\n\n// ---------------------------------------------------------------------------\n// Default spring configuration\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_SPRING: SpringConfig = { stiffness: 500, damping: 30 };\n\n// ---------------------------------------------------------------------------\n// CVA Variants\n// ---------------------------------------------------------------------------\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * This layer handles the WCAG 2.2 AAA touch target requirement\n * Always invisible, centers the visual switch inside\n */\nconst switchOuterVariants = cva(\n // Base styles - WCAG 2.2 AAA: 44x44px minimum touch target\n \"inline-flex shrink-0 cursor-pointer items-center justify-center min-h-[44px] min-w-[44px] disabled:cursor-not-allowed disabled:opacity-50 data-[readonly]:cursor-default\",\n {\n variants: {},\n defaultVariants: {},\n }\n);\n\n/**\n * Layer 2: Visual switch track/background (adjustable size)\n * This layer provides the visual appearance and size flexibility\n * Background color changes based on variant and selection state\n */\nconst switchTrackVariants = cva(\n // Base styles - visual track with transitions and focus states\n \"relative inline-flex shrink-0 items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n {\n variants: {\n variant: {\n // Default variant: Uses primary color when selected\n default:\n \"bg-[var(--border)] data-[selected]:bg-[var(--primary)]\",\n // Destructive variant: Uses destructive/error color when selected\n destructive:\n \"bg-[var(--border)] data-[selected]:bg-[var(--destructive-background)]\",\n },\n size: {\n // Small: h-6 w-10 (visual track size)\n sm: \"h-6 w-10\",\n // Default: h-7 w-12\n default: \"h-7 w-12\",\n // Large: h-8 w-14\n lg: \"h-8 w-14\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n/**\n * Layer 3: Switch thumb (sliding circle)\n * Inner visual element that slides horizontally when switch is selected.\n * When spring animation is active, CSS transition is removed and\n * motion.dev controls the translateX via inline transform.\n */\nconst switchThumbVariants = cva(\n // Base styles: rounded circle with shadow\n \"pointer-events-none absolute left-0.5 rounded-full bg-[var(--content-background)] ring-0\",\n {\n variants: {\n size: {\n // Thumb is slightly smaller than track height for proper padding\n sm: \"h-4 w-4\",\n default: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n animated: {\n // When CSS handles the animation (motion.dev unavailable or disabled)\n false: \"transition-transform data-[selected]:translate-x-full\",\n // When motion.dev handles the animation — no CSS transition\n true: \"\",\n },\n },\n defaultVariants: {\n size: \"default\",\n animated: false,\n },\n }\n);\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport interface SwitchProps\n extends Omit<AriaSwitchProps, 'className' | 'children'>,\n VariantProps<typeof switchTrackVariants>,\n AnimatedProps {\n variant?: 'default' | 'destructive';\n size?: 'sm' | 'default' | 'lg';\n label?: string;\n description?: string;\n className?: string;\n /** Spring physics configuration. Default: { stiffness: 500, damping: 30 } */\n springConfig?: SpringConfig;\n}\n\n/**\n * Switch Component\n * Fully accessible toggle switch with React Aria and themed styling.\n * When `animated` is true (default) and motion.dev is installed,\n * the thumb uses spring physics for a natural bounce effect.\n */\nconst Switch = memo(forwardRef<HTMLLabelElement, SwitchProps>(\n (\n {\n className,\n variant,\n size,\n label,\n description,\n isDisabled,\n isReadOnly,\n animated,\n springConfig = DEFAULT_SPRING,\n onChange: onChangeProp,\n ...props\n },\n ref\n ) => {\n const prefersReducedMotion = useReducedMotion();\n const doAnimate = shouldAnimate(animated, prefersReducedMotion);\n\n const thumbRef = useRef<HTMLDivElement>(null);\n const motionReady = useRef(false);\n const animateRef = useRef<AnimateFn | null>(null);\n const activeAnimation = useRef<{ stop: () => void } | null>(null);\n\n // Preload motion.dev when animation is desired\n useEffect(() => {\n if (!doAnimate) return;\n\n loadMotionAnimate().then((fn) => {\n if (fn) {\n animateRef.current = fn;\n motionReady.current = true;\n\n // Set initial thumb position if already selected (no animation)\n if (thumbRef.current) {\n const isCurrentlySelected = thumbRef.current.hasAttribute('data-selected');\n thumbRef.current.style.transform = isCurrentlySelected\n ? 'translateX(100%)'\n : 'translateX(0)';\n }\n }\n });\n }, [doAnimate]);\n\n const handleChange = useCallback(\n (isSelected: boolean) => {\n // Forward to consumer's onChange\n onChangeProp?.(isSelected);\n\n // Trigger spring animation if motion is ready\n if (doAnimate && motionReady.current && animateRef.current && thumbRef.current) {\n // Stop any in-progress animation\n activeAnimation.current?.stop();\n\n activeAnimation.current = animateRef.current(\n thumbRef.current,\n { x: isSelected ? '100%' : '0%' },\n {\n type: 'spring',\n stiffness: springConfig.stiffness,\n damping: springConfig.damping,\n },\n );\n }\n },\n [doAnimate, springConfig.stiffness, springConfig.damping, onChangeProp],\n );\n\n // Use motion for thumb position when motion.dev is handling it\n const useMotionThumb = doAnimate;\n\n return (\n <AriaSwitch\n ref={ref}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n onChange={handleChange}\n className={(_classNameProps) =>\n cn(\n \"group inline-flex items-center gap-2\",\n isDisabled && \"cursor-not-allowed opacity-50\",\n className\n )\n }\n {...props}\n >\n {(renderProps) => (\n <>\n {/* Layer 1: Transparent outer touch target (44x44px WCAG compliant) */}\n <div\n className={cn(switchOuterVariants())}\n data-selected={renderProps.isSelected || undefined}\n data-readonly={isReadOnly || undefined}\n >\n {/* Layer 2: Visual switch track (adjustable size with variants) */}\n <div\n className={cn(\n switchTrackVariants({ variant, size }),\n DEFAULT_INTERACTIONS\n )}\n data-selected={renderProps.isSelected || undefined}\n >\n {/* Layer 3: Thumb (sliding circle, absolutely positioned) */}\n <div\n ref={thumbRef}\n className={cn(switchThumbVariants({\n size,\n animated: useMotionThumb,\n }))}\n data-selected={renderProps.isSelected || undefined}\n />\n </div>\n </div>\n\n {/* Optional label and description */}\n {(label || description) && (\n <div className=\"flex flex-col\">\n {label && (\n <span className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n </span>\n )}\n {description && (\n <span className=\"text-xs text-[var(--menu-muted)]\">\n {description}\n </span>\n )}\n </div>\n )}\n </>\n )}\n </AriaSwitch>\n );\n }\n));\n\nSwitch.displayName = \"Switch\";\n\nexport { Switch, switchOuterVariants, switchTrackVariants, switchThumbVariants };\n","\"use client\";\n\n/**\n * RadioGroup Component\n * Accessible single-selection radio group with React Aria primitives and CVA styling\n *\n * Key Features:\n * - Bordered container design with explicit 44px+ touch targets\n * - 2 variants: default, destructive (no outline per clarification)\n * - 3 sizes: sm (44px), default (48px), lg (56px)\n * - Arrow keys move focus AND select (WAI-ARIA standard selection-follows-focus)\n * - Error styling on ALL items (cognitive accessibility)\n * - Spring animation for selection indicator\n * - RTL support (indicator auto-flips)\n * - Radio.Label and Radio.Description sub-components\n *\n * @see radiogroup-prd.md (Product Requirements)\n * @see plan.md (11 Key Clarifications)\n * @see React Aria RadioGroup: https://react-spectrum.adobe.com/react-aria/RadioGroup.html\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AAA)\n */\n\nimport {\n forwardRef,\n createContext,\n useContext,\n useId,\n type ReactNode,\n type ForwardedRef,\n} from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n Label,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { FOCUS_STYLES, HIGH_CONTRAST_FOCUS } from '../../styles/interaction-states';\nimport type {\n RadioGroupProps,\n RadioProps,\n RadioLabelProps,\n RadioDescriptionProps,\n RadioGroupVariant,\n RadioGroupSize,\n} from './RadioGroup.types';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface RadioGroupContextValue {\n variant: RadioGroupVariant;\n size: RadioGroupSize;\n isInvalid: boolean;\n}\n\nconst RadioGroupContext = createContext<RadioGroupContextValue>({\n variant: 'default',\n size: 'default',\n isInvalid: false,\n});\n\n// ============================================================================\n// CVA Variants\n// ============================================================================\n\n/**\n * RadioGroup container variants\n * Controls orientation and spacing (gap-2 = 8px per clarification)\n */\nconst radioGroupVariants = cva(\n // Base: flex container\n \"flex\",\n {\n variants: {\n orientation: {\n vertical: \"flex-col gap-2\",\n horizontal: \"flex-row flex-wrap gap-2\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n }\n);\n\n/**\n * Radio item bordered container variants\n * Bordered container design with explicit touch targets\n * All sizes maintain 44px minimum height (WCAG 2.2 AAA)\n * All sizes use rounded-md (6px) per clarification\n */\nconst radioItemVariants = cva(\n // Base: bordered container with flex layout, RTL support\n [\n \"flex items-center gap-3 rounded-md border cursor-pointer\",\n \"transition-colors duration-200\",\n \"rtl:flex-row-reverse\", // RTL: indicator flips to right\n // Focus ring on entire container\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: [\n \"border-[var(--border)]\",\n \"data-[hovered]:bg-[var(--accent)]/10\",\n \"data-[selected]:border-[var(--primary)]\",\n \"data-[selected]:bg-[var(--primary)]/10\",\n ].join(\" \"),\n destructive: [\n \"border-[var(--border)]\",\n \"data-[hovered]:bg-[var(--destructive-background)]/10\",\n \"data-[selected]:border-[var(--destructive-background)]\",\n \"data-[selected]:bg-[var(--destructive-background)]/10\",\n ].join(\" \"),\n },\n size: {\n sm: \"min-h-[44px] py-2 px-3 text-sm\",\n default: \"min-h-[48px] py-3 px-4 text-sm\",\n lg: \"min-h-[56px] py-4 px-5 text-base\",\n },\n isDisabled: {\n true: \"opacity-50 cursor-not-allowed\",\n false: \"\",\n },\n isInvalid: {\n // Error: ALL items get destructive border (cognitive accessibility)\n true: \"border-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n isDisabled: false,\n isInvalid: false,\n },\n }\n);\n\n/**\n * Circle indicator (outer ring) variants\n */\nconst radioIndicatorVariants = cva(\n // Base: circle with border, flex-shrink-0 to prevent squishing\n \"flex-shrink-0 rounded-full border-2 flex items-center justify-center transition-colors duration-200\",\n {\n variants: {\n variant: {\n default: [\n \"border-[var(--border)]\",\n \"data-[selected]:border-[var(--primary)]\",\n ].join(\" \"),\n destructive: [\n \"border-[var(--border)]\",\n \"data-[selected]:border-[var(--destructive-background)]\",\n ].join(\" \"),\n },\n size: {\n sm: \"h-4 w-4\",\n default: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n/**\n * Inner dot variants (appears when selected)\n * Spring animation: cubic-bezier(0.34, 1.56, 0.64, 1) with slight overshoot\n */\nconst radioInnerDotVariants = cva(\n // Base: centered dot with spring animation\n [\n \"rounded-full transition-transform duration-200\",\n // Spring animation with overshoot\n \"[transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)]\",\n // Respect reduced motion preference\n \"motion-reduce:transition-none\",\n // Scale from 0 to 1 on selection\n \"scale-0 data-[selected]:scale-100\",\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: \"bg-[var(--primary)]\",\n destructive: \"bg-[var(--destructive-background)]\",\n },\n size: {\n sm: \"h-2 w-2\",\n default: \"h-2.5 w-2.5\",\n lg: \"h-3 w-3\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\n/**\n * Radio.Label - Styled label for radio item content\n */\nfunction RadioLabel({ children, className }: RadioLabelProps): ReactNode {\n return (\n <span className={cn(\"font-medium text-[var(--content-foreground)]\", className)}>\n {children}\n </span>\n );\n}\n\nRadioLabel.displayName = \"Radio.Label\";\n\n/**\n * Radio.Description - Styled description for radio item content (muted)\n */\nfunction RadioDescription({ children, className }: RadioDescriptionProps): ReactNode {\n return (\n <span className={cn(\"text-sm text-[var(--menu-muted)]\", className)}>\n {children}\n </span>\n );\n}\n\nRadioDescription.displayName = \"Radio.Description\";\n\n// ============================================================================\n// Radio Component\n// ============================================================================\n\n/**\n * Radio item component with bordered container design\n */\nfunction RadioComponent({ value, isDisabled, children, className }: RadioProps): ReactNode {\n const { variant, size, isInvalid } = useContext(RadioGroupContext);\n\n return (\n <AriaRadio\n value={value}\n isDisabled={isDisabled}\n className={(renderProps) =>\n cn(\n radioItemVariants({\n variant,\n size,\n isDisabled: renderProps.isDisabled,\n isInvalid,\n }),\n className\n )\n }\n >\n {(renderProps) => (\n <>\n {/* Circle indicator */}\n <div\n className={radioIndicatorVariants({ variant, size })}\n data-selected={renderProps.isSelected || undefined}\n >\n {/* Inner dot with spring animation */}\n <div\n className={radioInnerDotVariants({ variant, size })}\n data-selected={renderProps.isSelected || undefined}\n />\n </div>\n\n {/* Children content (flexible - text, icons, complex layouts) */}\n <div className=\"flex-1 flex flex-col\">\n {children}\n </div>\n </>\n )}\n </AriaRadio>\n );\n}\n\n// Attach sub-components\nconst Radio = Object.assign(RadioComponent, {\n Label: RadioLabel,\n Description: RadioDescription,\n}) as typeof RadioComponent & {\n Label: typeof RadioLabel;\n Description: typeof RadioDescription;\n displayName: string;\n};\n\nRadio.displayName = \"Radio\";\n\n// ============================================================================\n// RadioGroup Component\n// ============================================================================\n\n/**\n * RadioGroup root component\n * Accessible single-selection control with bordered container design\n */\nconst RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup(props: RadioGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n const {\n // Display props\n label,\n description,\n errorMessage,\n // Selection props\n value,\n defaultValue,\n // State props\n isDisabled = false,\n isReadOnly = false,\n isRequired = false,\n isInvalid = false,\n // Layout props\n orientation = 'vertical',\n // Variant props\n variant = 'default',\n size = 'default',\n // Form props\n name,\n // Event handlers\n onChange,\n onFocusChange,\n // Standard props\n className,\n children,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'data-testid': dataTestId,\n ...restProps\n } = props;\n\n // Generate unique IDs for accessibility\n const generatedId = useId();\n const radioGroupId = id ?? generatedId;\n const labelId = `${radioGroupId}-label`;\n const descriptionId = `${radioGroupId}-description`;\n const errorId = `${radioGroupId}-error`;\n\n // Build aria-describedby from description and error\n const describedByParts: string[] = [];\n if (ariaDescribedby) describedByParts.push(ariaDescribedby);\n if (description) describedByParts.push(descriptionId);\n if (isInvalid && errorMessage) describedByParts.push(errorId);\n const computedAriaDescribedBy = describedByParts.length > 0\n ? describedByParts.join(' ')\n : undefined;\n\n return (\n <RadioGroupContext.Provider value={{ variant, size, isInvalid }}>\n <AriaRadioGroup\n ref={ref}\n id={radioGroupId}\n name={name}\n value={value ?? undefined}\n defaultValue={defaultValue ?? undefined}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n isInvalid={isInvalid}\n orientation={orientation}\n onChange={onChange}\n onFocusChange={onFocusChange}\n aria-label={ariaLabel}\n aria-labelledby={label ? labelId : ariaLabelledby}\n aria-describedby={computedAriaDescribedBy}\n data-testid={dataTestId}\n data-orientation={orientation}\n className={cn(\"flex flex-col gap-1.5\", className)}\n {...restProps}\n >\n {/* Label with optional required asterisk */}\n {label && (\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && (\n <span className=\"ml-1 text-[var(--destructive-background)]\" aria-hidden=\"true\">\n *\n </span>\n )}\n </Label>\n )}\n\n {/* Description */}\n {description && (\n <Text\n id={descriptionId}\n slot=\"description\"\n className=\"text-sm text-[var(--menu-muted)]\"\n >\n {description}\n </Text>\n )}\n\n {/* Radio items container with orientation */}\n <div className={radioGroupVariants({ orientation })}>\n {children}\n </div>\n\n {/* Error message with role=\"alert\" for screen reader announcements */}\n {isInvalid && errorMessage && (\n <FieldError\n id={errorId}\n className=\"text-sm text-[var(--destructive-background)]\"\n >\n <span role=\"alert\">{errorMessage}</span>\n </FieldError>\n )}\n </AriaRadioGroup>\n </RadioGroupContext.Provider>\n );\n }\n);\n\nRadioGroup.displayName = \"RadioGroup\";\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nexport {\n RadioGroup,\n Radio,\n radioGroupVariants,\n radioItemVariants,\n radioIndicatorVariants,\n radioInnerDotVariants,\n};\n","\"use client\";\n\n/**\n * CheckboxGroup Component\n * Accessible multi-selection checkbox group with React Aria primitives and CVA styling\n *\n * Key Features:\n * - Bordered container design with explicit 44px+ touch targets\n * - 2 variants: default, destructive (no outline per clarification)\n * - 3 sizes: sm (44px), default (48px), lg (56px)\n * - Tab moves focus between checkboxes, Space toggles (standard checkbox behavior)\n * - Error styling on ALL items (cognitive accessibility)\n * - Spring animation for checkmark indicator\n * - RTL support (indicator auto-flips)\n * - Checkbox.Label and Checkbox.Description sub-components\n * - value: string[] for multi-select (key difference from RadioGroup)\n *\n * @see checkboxgroup-prd.md (Product Requirements)\n * @see plan.md (12 Key Clarifications)\n * @see React Aria CheckboxGroup: https://react-spectrum.adobe.com/react-aria/CheckboxGroup.html\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AAA)\n */\n\nimport {\n forwardRef,\n createContext,\n useContext,\n useId,\n cloneElement,\n isValidElement,\n type ReactNode,\n type ForwardedRef,\n type ReactElement,\n} from 'react';\nimport {\n CheckboxGroup as AriaCheckboxGroup,\n Checkbox as AriaCheckbox,\n Label,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { FOCUS_STYLES, HIGH_CONTRAST_FOCUS } from '../../styles/interaction-states';\nimport type {\n CheckboxGroupProps,\n CheckboxProps,\n CheckboxLabelProps,\n CheckboxDescriptionProps,\n CheckboxGroupVariant,\n CheckboxGroupSize,\n} from './CheckboxGroup.types';\n\n// ============================================================================\n// Context\n// ============================================================================\n\n/**\n * CheckboxGroup context value\n * Includes isDisabled and isReadOnly per clarification (plan.md #10)\n */\ninterface CheckboxGroupContextValue {\n variant: CheckboxGroupVariant;\n size: CheckboxGroupSize;\n isInvalid: boolean;\n isDisabled: boolean;\n isReadOnly: boolean;\n}\n\nconst CheckboxGroupContext = createContext<CheckboxGroupContextValue>({\n variant: 'default',\n size: 'default',\n isInvalid: false,\n isDisabled: false,\n isReadOnly: false,\n});\n\n// ============================================================================\n// CVA Variants\n// ============================================================================\n\n/**\n * CheckboxGroup container variants\n * Controls orientation and spacing (gap-2 = 8px per clarification)\n */\nconst checkboxGroupVariants = cva(\n // Base: flex container\n \"flex\",\n {\n variants: {\n orientation: {\n vertical: \"flex-col gap-2\",\n horizontal: \"flex-row flex-wrap gap-2\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n }\n);\n\n/**\n * Checkbox item bordered container variants\n * Bordered container design with explicit touch targets\n * All sizes maintain 44px minimum height (WCAG 2.2 AAA)\n * All sizes use rounded-md (6px) per clarification\n */\nconst checkboxItemVariants = cva(\n // Base: bordered container with flex layout, RTL support\n [\n \"flex items-center gap-3 rounded-md border cursor-pointer\",\n \"transition-colors duration-200\",\n \"rtl:flex-row-reverse\", // RTL: indicator flips to right\n // Focus ring on entire container\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: [\n \"border-[var(--border)]\",\n \"data-[hovered]:bg-[var(--accent)]/10\",\n \"data-[selected]:border-[var(--primary)]\",\n \"data-[selected]:bg-[var(--primary)]/10\",\n ].join(\" \"),\n destructive: [\n \"border-[var(--border)]\",\n \"data-[hovered]:bg-[var(--destructive-background)]/10\",\n \"data-[selected]:border-[var(--destructive-background)]\",\n \"data-[selected]:bg-[var(--destructive-background)]/10\",\n ].join(\" \"),\n },\n size: {\n sm: \"min-h-[44px] py-2 px-3 text-sm\",\n default: \"min-h-[48px] py-3 px-4 text-sm\",\n lg: \"min-h-[56px] py-4 px-5 text-base\",\n },\n isDisabled: {\n true: \"opacity-50 cursor-not-allowed\",\n false: \"\",\n },\n isReadOnly: {\n // Subtle visual cue per clarification\n true: \"cursor-default\",\n false: \"\",\n },\n isInvalid: {\n // Error: ALL items get destructive border (cognitive accessibility)\n true: \"border-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n isDisabled: false,\n isReadOnly: false,\n isInvalid: false,\n },\n }\n);\n\n/**\n * Square indicator (checkbox box) variants\n * Uses rounded-sm (2px) for square appearance (unlike RadioGroup's circle)\n */\nconst checkboxIndicatorVariants = cva(\n // Base: square with border, flex-shrink-0 to prevent squishing\n \"flex-shrink-0 rounded-sm border-2 flex items-center justify-center transition-colors duration-200\",\n {\n variants: {\n variant: {\n default: [\n \"border-[var(--border)]\",\n \"data-[selected]:border-[var(--primary)]\",\n \"data-[selected]:bg-[var(--primary)]\",\n ].join(\" \"),\n destructive: [\n \"border-[var(--border)]\",\n \"data-[selected]:border-[var(--destructive-background)]\",\n \"data-[selected]:bg-[var(--destructive-background)]\",\n ].join(\" \"),\n },\n size: {\n sm: \"h-4 w-4\",\n default: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n/**\n * Checkmark SVG variants\n * Spring animation: cubic-bezier(0.34, 1.56, 0.64, 1) with slight overshoot\n */\nconst checkmarkVariants = cva(\n // Base: centered checkmark with spring animation\n [\n \"transition-transform duration-200\",\n // Spring animation with overshoot\n \"[transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)]\",\n // Respect reduced motion preference\n \"motion-reduce:transition-none\",\n // Scale from 0 to 1 on selection\n \"scale-0 data-[selected]:scale-100\",\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: \"text-[var(--primary-foreground)]\",\n destructive: \"text-[var(--destructive-foreground)]\",\n },\n size: {\n sm: \"h-3 w-3\",\n default: \"h-3.5 w-3.5\",\n lg: \"h-4 w-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n// ============================================================================\n// Icon Components\n// ============================================================================\n\n/**\n * Checkmark SVG icon (default)\n * Used inside the checkbox indicator when selected\n */\nfunction CheckmarkIcon({ className, ...props }: { className?: string; 'data-selected'?: boolean }): ReactNode {\n return (\n <svg\n className={className}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n );\n}\n\n/**\n * Times (X) SVG icon\n * Alternative icon for destructive or exclusion selections\n * @example <Checkbox value=\"exclude\" selectedIcon={<TimesIcon />}>Exclude this item</Checkbox>\n */\nfunction TimesIcon({ className, ...props }: { className?: string; 'data-selected'?: boolean }): ReactNode {\n return (\n <svg\n className={className}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\n/**\n * Checkbox.Label - Styled label for checkbox item content\n */\nfunction CheckboxLabel({ children, className }: CheckboxLabelProps): ReactNode {\n return (\n <span className={cn(\"font-medium text-[var(--content-foreground)]\", className)}>\n {children}\n </span>\n );\n}\n\nCheckboxLabel.displayName = \"Checkbox.Label\";\n\n/**\n * Checkbox.Description - Styled description for checkbox item content (muted)\n */\nfunction CheckboxDescription({ children, className }: CheckboxDescriptionProps): ReactNode {\n return (\n <span className={cn(\"text-sm text-[var(--menu-muted)]\", className)}>\n {children}\n </span>\n );\n}\n\nCheckboxDescription.displayName = \"Checkbox.Description\";\n\n// ============================================================================\n// Checkbox Component\n// ============================================================================\n\n/**\n * Checkbox item component with bordered container design\n */\nfunction CheckboxComponent({ value, isDisabled, children, className, selectedIcon }: CheckboxProps): ReactNode {\n const { variant, size, isInvalid, isDisabled: groupDisabled, isReadOnly } = useContext(CheckboxGroupContext);\n\n // Individual isDisabled OR group isDisabled\n const effectiveDisabled = isDisabled || groupDisabled;\n\n // Render the selected icon - use custom icon if provided, otherwise default CheckmarkIcon\n const renderSelectedIcon = (isSelected: boolean) => {\n const iconClassName = cn(checkmarkVariants({ variant, size }));\n const dataSelected = isSelected || undefined;\n\n if (selectedIcon) {\n // Clone the custom icon element to add our styling classes\n if (isValidElement(selectedIcon)) {\n const iconElement = selectedIcon as ReactElement<{ className?: string; 'data-selected'?: boolean }>;\n return cloneElement(iconElement, {\n className: cn(iconClassName, iconElement.props.className),\n 'data-selected': dataSelected,\n });\n }\n // If it's not a valid element (e.g., just text), wrap it\n return <span className={iconClassName} data-selected={dataSelected}>{selectedIcon}</span>;\n }\n\n // Default: CheckmarkIcon\n return (\n <CheckmarkIcon\n className={iconClassName}\n data-selected={dataSelected}\n />\n );\n };\n\n return (\n <AriaCheckbox\n value={value}\n isDisabled={effectiveDisabled}\n className={(renderProps) =>\n cn(\n checkboxItemVariants({\n variant,\n size,\n isDisabled: renderProps.isDisabled,\n isReadOnly,\n isInvalid,\n }),\n className\n )\n }\n >\n {(renderProps) => (\n <>\n {/* Square indicator */}\n <div\n className={checkboxIndicatorVariants({ variant, size })}\n data-selected={renderProps.isSelected || undefined}\n >\n {/* Icon with spring animation */}\n {renderSelectedIcon(renderProps.isSelected)}\n </div>\n\n {/* Children content (flexible - text, icons, complex layouts) */}\n <div className=\"flex-1 flex flex-col\">\n {children}\n </div>\n </>\n )}\n </AriaCheckbox>\n );\n}\n\n// Attach sub-components\nconst Checkbox = Object.assign(CheckboxComponent, {\n Label: CheckboxLabel,\n Description: CheckboxDescription,\n}) as typeof CheckboxComponent & {\n Label: typeof CheckboxLabel;\n Description: typeof CheckboxDescription;\n displayName: string;\n};\n\nCheckbox.displayName = \"Checkbox\";\n\n// ============================================================================\n// Duplicate Value Warning\n// ============================================================================\n\n/**\n * Deduplicates array and warns in development mode\n * Per clarification: dedupe internally + console.warn in development\n */\nfunction dedupeWithWarning(values: string[] | undefined, componentName: string): string[] | undefined {\n if (!values) return values;\n\n const uniqueValues = [...new Set(values)];\n\n if (process.env.NODE_ENV !== 'production' && uniqueValues.length !== values.length) {\n console.warn(\n `[${componentName}] Received duplicate values in value/defaultValue prop. ` +\n `Original: [${values.join(', ')}], Deduplicated: [${uniqueValues.join(', ')}]. ` +\n `Duplicate values are automatically removed.`\n );\n }\n\n return uniqueValues;\n}\n\n// ============================================================================\n// CheckboxGroup Component\n// ============================================================================\n\n/**\n * CheckboxGroup root component\n * Accessible multi-selection control with bordered container design\n */\nconst CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(\n function CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n const {\n // Display props\n label,\n description,\n errorMessage,\n // Selection props (string[] for multi-select)\n value,\n defaultValue,\n // State props\n isDisabled = false,\n isReadOnly = false,\n isRequired = false,\n isInvalid = false,\n // Layout props\n orientation = 'vertical',\n // Variant props\n variant = 'default',\n size = 'default',\n // Form props\n name,\n // Event handlers\n onChange,\n onFocusChange,\n // Standard props\n className,\n children,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'data-testid': dataTestId,\n ...restProps\n } = props;\n\n // Generate unique IDs for accessibility\n const generatedId = useId();\n const checkboxGroupId = id ?? generatedId;\n const labelId = `${checkboxGroupId}-label`;\n const descriptionId = `${checkboxGroupId}-description`;\n const errorId = `${checkboxGroupId}-error`;\n\n // Build aria-describedby from description and error\n const describedByParts: string[] = [];\n if (ariaDescribedby) describedByParts.push(ariaDescribedby);\n if (description) describedByParts.push(descriptionId);\n if (isInvalid && errorMessage) describedByParts.push(errorId);\n const computedAriaDescribedBy = describedByParts.length > 0\n ? describedByParts.join(' ')\n : undefined;\n\n // Dedupe values with warning in development\n const dedupedValue = dedupeWithWarning(value, 'CheckboxGroup');\n const dedupedDefaultValue = dedupeWithWarning(defaultValue, 'CheckboxGroup');\n\n return (\n <CheckboxGroupContext.Provider value={{ variant, size, isInvalid, isDisabled, isReadOnly }}>\n <AriaCheckboxGroup\n ref={ref}\n id={checkboxGroupId}\n name={name}\n value={dedupedValue}\n defaultValue={dedupedDefaultValue}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n isInvalid={isInvalid}\n onChange={onChange}\n onFocusChange={onFocusChange}\n aria-label={ariaLabel}\n aria-labelledby={label ? labelId : ariaLabelledby}\n aria-describedby={computedAriaDescribedBy}\n aria-orientation={orientation}\n aria-required={isRequired || undefined}\n aria-invalid={isInvalid || undefined}\n data-testid={dataTestId}\n className={cn(\"flex flex-col gap-1.5\", className)}\n {...restProps}\n >\n {/* Label with optional required asterisk */}\n {label && (\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && (\n <span className=\"ml-1 text-[var(--destructive-background)]\" aria-hidden=\"true\">\n *\n </span>\n )}\n </Label>\n )}\n\n {/* Description */}\n {description && (\n <Text\n id={descriptionId}\n slot=\"description\"\n className=\"text-sm text-[var(--menu-muted)]\"\n >\n {description}\n </Text>\n )}\n\n {/* Checkbox items container with orientation */}\n <div className={checkboxGroupVariants({ orientation })}>\n {children}\n </div>\n\n {/* Error message with role=\"alert\" for screen reader announcements */}\n {isInvalid && errorMessage && (\n <FieldError\n id={errorId}\n className=\"text-sm text-[var(--destructive-background)]\"\n >\n <span role=\"alert\">{errorMessage}</span>\n </FieldError>\n )}\n </AriaCheckboxGroup>\n </CheckboxGroupContext.Provider>\n );\n }\n);\n\nCheckboxGroup.displayName = \"CheckboxGroup\";\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nexport {\n CheckboxGroup,\n Checkbox,\n checkboxGroupVariants,\n checkboxItemVariants,\n checkboxIndicatorVariants,\n checkmarkVariants,\n // Icon exports for custom selectedIcon usage\n CheckmarkIcon,\n TimesIcon,\n};\n","/**\n * Detection + dismissal guard for in-page writing-assistant browser extensions\n * (Grammarly, LanguageTool, Wordtune, …).\n *\n * These extensions inject their suggestion UI as elements appended to `<body>`,\n * outside any open overlay's DOM subtree. React Aria's `isDismissable` behaviour\n * treats a click on that injected UI as an \"outside click\" and dismisses the\n * overlay — so clicking a spelling suggestion silently closes the form pop-up\n * and discards the user's in-progress correction.\n *\n * The guard below lets overlays keep open when the interaction lands on an\n * extension-injected node, while every other outside click, Escape, and the\n * close button behave exactly as before.\n */\n\nconst MAX_ANCESTOR_DEPTH = 100;\n\n/**\n * Returns `true` when `element` belongs to an injected in-page writing\n * assistant (Grammarly, LanguageTool, Wordtune, …).\n *\n * UX-ONLY heuristic. This is a deliberately spoofable DOM sniff used solely to\n * keep a form pop-up open when a writing-assistant suggestion is clicked. It is\n * NOT a security/authorization control and must never gate access to data or\n * actions (the frontend is not a security boundary). Pure function — never log\n * the element (it can reference arbitrary DOM / user content).\n */\nexport function isExtensionInjectedElement(element: Element): boolean {\n if (!(element instanceof Element)) return false;\n\n // 1. Known-vendor markers (authoritative). Walk up via parentElement, and\n // climb shadow boundaries via getRootNode().host so detection still finds\n // the <grammarly-extension> host if React Aria's shadowDOM flag is ever\n // enabled (it defaults to false today → the document-level listener\n // already receives the retargeted host, so the parentElement walk alone\n // suffices currently). Depth-bounded as a defensive guard against a\n // crafted/overridden getRootNode/host returning a cycle (which would\n // otherwise hang the tab — a client-side DoS).\n let node: Element | null = element;\n for (let depth = 0; node && depth < MAX_ANCESTOR_DEPTH; depth++) {\n const tag = node.tagName?.toLowerCase() ?? '';\n if (tag.startsWith('grammarly-')) return true; // Grammarly\n if (tag.startsWith('lt-')) return true; // LanguageTool\n if (node.hasAttribute('data-grammarly-shadow-root')) return true;\n\n if (node.parentElement) {\n node = node.parentElement;\n } else {\n const root = node.getRootNode();\n node = root instanceof ShadowRoot ? root.host : null;\n }\n }\n\n // 2. Structural fallback (best-effort, future-proofs the long tail).\n // Extensions inject their UI as a custom element (hyphenated tag name)\n // mounted as a top-level sibling of the React root — i.e. a direct child\n // of <body>/<html>. Our app never renders body-level custom elements, and\n // React Aria portals render plain <div>s, so this stays safe for any\n // future first-party web component nested inside the app tree.\n let custom: Element | null = element;\n while (custom && !custom.tagName.includes('-')) {\n custom = custom.parentElement;\n }\n if (!custom) return false;\n\n const parent = custom.parentElement;\n return parent === document.body || parent === document.documentElement;\n}\n\n/**\n * Builds a `shouldCloseOnInteractOutside` predicate for React Aria overlays\n * that keeps the overlay open when the interaction targets an extension-injected\n * element, while preserving any consumer-supplied predicate.\n *\n * React Aria semantics: the predicate returns `true` ⇒ the overlay should\n * close. So we close only when the element is NOT extension-injected AND the\n * consumer (if any) also agrees it should close.\n */\nexport function createInteractOutsideGuard(\n consumerShouldClose?: (element: Element) => boolean,\n): (element: Element) => boolean {\n return (element: Element): boolean =>\n !isExtensionInjectedElement(element) && (consumerShouldClose?.(element) ?? true);\n}\n","import { cva } from 'class-variance-authority';\nimport { FIELD_INPUT_SIZES, TEXT_SIZE_SMALL_SCALE } from '../../styles';\n\nexport const comboboxVariants = cva(\n 'group flex flex-col gap-1.5 w-full',\n {\n variants: {\n size: {\n sm: '',\n default: '',\n lg: '',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxLabelVariants = cva(\n 'text-[var(--text-primary)] font-medium',\n {\n variants: {\n size: {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxInputVariants = cva(\n [\n 'flex-1 bg-transparent outline-none',\n 'placeholder:text-[var(--muted-foreground)]',\n 'disabled:cursor-not-allowed',\n ],\n {\n variants: {\n size: TEXT_SIZE_SMALL_SCALE,\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxTriggerWrapperVariants = cva(\n [\n 'flex items-center w-full rounded-md border',\n 'bg-[var(--input-background)] text-[var(--content-foreground)]',\n 'border-[var(--input-border)]',\n 'transition-colors duration-[var(--transition-fast)]',\n 'focus-within:ring-2 focus-within:ring-[var(--ring)] focus-within:ring-offset-[var(--ring-offset)]',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n 'data-[invalid]:border-[var(--destructive-background)]',\n ],\n {\n variants: {\n size: {\n sm: `${FIELD_INPUT_SIZES.sm} gap-1`,\n default: `${FIELD_INPUT_SIZES.default} gap-2`,\n lg: `${FIELD_INPUT_SIZES.lg} gap-2`,\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxButtonVariants = cva(\n [\n 'flex items-center justify-end shrink-0',\n 'text-[var(--muted-foreground)]',\n 'hover:text-[var(--text-primary)]',\n 'transition-colors',\n 'focus:outline-none',\n ],\n {\n variants: {\n size: {\n sm: 'h-4 w-4 min-h-[44px] min-w-[44px]',\n default: 'h-5 w-5 min-h-[44px] min-w-[44px]',\n lg: 'h-6 w-6 min-h-[44px] min-w-[44px]',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxPopoverVariants = cva(\n [\n 'w-[var(--trigger-width)] overflow-auto',\n 'rounded-md border border-[var(--border)]',\n 'bg-[var(--content-background)] text-[var(--content-foreground)]',\n 'data-[entering]:motion-safe:animate-in data-[entering]:motion-safe:fade-in-0',\n 'data-[exiting]:motion-safe:animate-out data-[exiting]:motion-safe:fade-out-0',\n ]\n);\n\nexport const comboboxListBoxVariants = cva(\n 'p-1 outline-none max-h-[300px] overflow-auto'\n);\n\nexport const comboboxItemVariants = cva(\n [\n 'flex items-center gap-2 w-full rounded-sm px-2 py-1.5',\n 'text-[var(--content-foreground)]',\n 'cursor-pointer outline-none',\n 'data-[focused]:bg-[var(--accent-background)] data-[focused]:text-[var(--accent-foreground)]',\n 'data-[selected]:font-medium',\n 'data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed',\n ],\n {\n variants: {\n size: {\n sm: 'text-xs min-h-[44px]',\n default: 'text-sm min-h-[44px]',\n lg: 'text-base min-h-[44px]',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxSectionVariants = cva('pt-1');\n\nexport const comboboxSectionHeaderVariants = cva(\n 'px-2 py-1.5 text-xs font-semibold text-[var(--muted-foreground)]'\n);\n\nexport const comboboxDescriptionVariants = cva(\n 'text-[var(--muted-foreground)]',\n {\n variants: {\n size: {\n sm: 'text-xs',\n default: 'text-xs',\n lg: 'text-sm',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxErrorVariants = cva(\n 'text-[var(--destructive-background)]',\n {\n variants: {\n size: {\n sm: 'text-xs',\n default: 'text-xs',\n lg: 'text-sm',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n","'use client';\n\nimport { forwardRef, type ReactElement } from 'react';\nimport {\n ComboBox as AriaComboBox,\n Label as AriaLabel,\n Input as AriaInput,\n Button as AriaButton,\n Popover as AriaPopover,\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n ListBoxSection as AriaListBoxSection,\n Header as AriaHeader,\n Text as AriaText,\n} from 'react-aria-components';\nimport { ChevronsUpDown, Check } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport { createInteractOutsideGuard } from '../../utils/browserExtensionOverlay';\nimport { FIELD_TOUCH_TARGET } from '../../styles';\nimport type {\n ComboboxProps,\n ComboboxItemProps,\n ComboboxSectionProps,\n} from './Combobox.types';\nimport {\n comboboxVariants,\n comboboxLabelVariants,\n comboboxInputVariants,\n comboboxTriggerWrapperVariants,\n comboboxButtonVariants,\n comboboxPopoverVariants,\n comboboxListBoxVariants,\n comboboxItemVariants,\n comboboxSectionVariants,\n comboboxSectionHeaderVariants,\n comboboxDescriptionVariants,\n comboboxErrorVariants,\n} from './Combobox.styles';\n\n// ============================================================================\n// Combobox\n// ============================================================================\n\n/**\n * Combobox Component\n *\n * A filterable select/autocomplete component built on React Aria's ComboBox.\n * Supports type-to-filter, keyboard navigation, and optional custom values.\n *\n * @example\n * ```tsx\n * <Combobox label=\"Framework\">\n * <ComboboxItem id=\"react\">React</ComboboxItem>\n * <ComboboxItem id=\"vue\">Vue</ComboboxItem>\n * <ComboboxItem id=\"angular\">Angular</ComboboxItem>\n * </Combobox>\n * ```\n */\nexport const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(\n (\n {\n className,\n size = 'default',\n label,\n description,\n errorMessage,\n isRequired,\n isDisabled,\n isReadOnly,\n placeholder,\n name,\n allowsCustomValue = false,\n menuTrigger = 'input',\n defaultInputValue,\n inputValue,\n defaultSelectedKey,\n selectedKey,\n onInputChange,\n onSelectionChange,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'data-testid': dataTestId,\n ...props\n },\n ref\n ): ReactElement => {\n // Warn if no accessible label\n if (process.env.NODE_ENV !== 'production') {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n '[Combobox] Either label, aria-label, or aria-labelledby is required for accessibility (WCAG 1.1.1)'\n );\n }\n }\n\n return (\n <AriaComboBox\n ref={ref}\n className={cn(comboboxVariants({ size }), className)}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n name={name}\n allowsCustomValue={allowsCustomValue}\n menuTrigger={menuTrigger}\n defaultInputValue={defaultInputValue}\n inputValue={inputValue}\n defaultSelectedKey={defaultSelectedKey}\n selectedKey={selectedKey}\n onInputChange={onInputChange}\n onSelectionChange={onSelectionChange}\n aria-label={!label ? ariaLabel : undefined}\n aria-labelledby={ariaLabelledBy}\n data-testid={dataTestId}\n {...props}\n >\n {label && (\n <AriaLabel className={comboboxLabelVariants({ size })}>\n {label}\n {isRequired && (\n <span className=\"text-[var(--destructive-background)] ml-1\" aria-hidden=\"true\">\n *\n </span>\n )}\n </AriaLabel>\n )}\n\n <div className={cn(FIELD_TOUCH_TARGET, comboboxTriggerWrapperVariants({ size }))}>\n <AriaInput\n className={comboboxInputVariants({ size })}\n placeholder={placeholder}\n />\n <AriaButton className={comboboxButtonVariants({ size })}>\n <ChevronsUpDown className=\"h-4 w-4\" strokeWidth={1.5} aria-hidden=\"true\" />\n </AriaButton>\n </div>\n\n {description && !errorMessage && (\n <AriaText slot=\"description\" className={comboboxDescriptionVariants({ size })}>\n {description}\n </AriaText>\n )}\n\n {errorMessage && (\n <AriaText slot=\"errorMessage\" className={comboboxErrorVariants({ size })}>\n {errorMessage}\n </AriaText>\n )}\n\n <AriaPopover\n shouldCloseOnInteractOutside={createInteractOutsideGuard()}\n className={comboboxPopoverVariants()}\n >\n <AriaListBox className={comboboxListBoxVariants()}>\n {children}\n </AriaListBox>\n </AriaPopover>\n </AriaComboBox>\n );\n }\n);\n\nCombobox.displayName = 'Combobox';\n\n// ============================================================================\n// ComboboxItem\n// ============================================================================\n\nexport function ComboboxItem({\n children,\n className,\n textValue,\n ...props\n}: ComboboxItemProps): ReactElement {\n // Compute textValue from string children if not explicitly provided\n const computedTextValue = textValue || (typeof children === 'string' ? children : undefined);\n\n return (\n <AriaListBoxItem\n className={cn(comboboxItemVariants({ size: 'default' }), className)}\n textValue={computedTextValue}\n {...props}\n >\n {({ isSelected }) => (\n <>\n <span className=\"flex-1\">{children}</span>\n {isSelected && (\n <Check className=\"h-4 w-4 shrink-0 text-[var(--primary)]\" aria-hidden=\"true\" />\n )}\n </>\n )}\n </AriaListBoxItem>\n );\n}\n\nComboboxItem.displayName = 'ComboboxItem';\n\n// ============================================================================\n// ComboboxSection\n// ============================================================================\n\nexport function ComboboxSection({\n header,\n children,\n className,\n}: ComboboxSectionProps): ReactElement {\n return (\n <AriaListBoxSection className={cn(comboboxSectionVariants(), className)}>\n {header && (\n <AriaHeader className={comboboxSectionHeaderVariants()}>\n {header}\n </AriaHeader>\n )}\n {children}\n </AriaListBoxSection>\n );\n}\n\nComboboxSection.displayName = 'ComboboxSection';\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport { FIELD_INPUT_SIZES } from '../../styles';\n\n/**\n * CVA Variants for Select Trigger Button\n *\n * Styles the trigger button that opens the select popover.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectTriggerVariants = cva(\n [\n // Base styles\n 'flex',\n 'w-full',\n 'items-center',\n 'justify-between',\n 'gap-2',\n 'rounded-md',\n 'border',\n 'bg-[var(--content-background)]',\n 'text-[var(--content-foreground)]',\n 'transition-colors',\n 'duration-200',\n 'outline-none',\n // Focus ring (WCAG 2.2 AAA - 7:1 contrast)\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n // Hover state\n 'hover:bg-[var(--accent)]/10',\n // Disabled state\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n // Loading state\n 'data-[loading=true]:cursor-wait',\n // Truncate text\n 'truncate',\n ],\n {\n variants: {\n size: {\n sm: `${FIELD_INPUT_SIZES.sm} pr-1`,\n default: `${FIELD_INPUT_SIZES.default} pr-1.5`,\n lg: `${FIELD_INPUT_SIZES.lg} pr-2`,\n },\n isInvalid: {\n true: 'border-[var(--destructive-background)]',\n false: 'border-[var(--input-border)] hover:border-[var(--input-border)]/80',\n },\n },\n defaultVariants: {\n size: 'default',\n isInvalid: false,\n },\n }\n);\n\n/**\n * CVA Variants for Select Items\n *\n * Styles individual selectable items within the listbox.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectItemVariants = cva(\n [\n // Base styles\n 'relative',\n 'flex',\n 'w-full',\n 'cursor-pointer',\n 'select-none',\n 'items-center',\n 'rounded-sm',\n 'outline-none',\n 'transition-colors',\n // Padding for checkmark icon (left side)\n 'pl-8',\n 'pr-2',\n // Hover state\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n // Focus state\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n // Selected state\n 'data-[selected=true]:bg-[var(--accent)]',\n 'data-[selected=true]:text-[var(--accent-foreground)]',\n // Disabled state\n 'data-[disabled=true]:pointer-events-none',\n 'data-[disabled=true]:opacity-50',\n 'data-[disabled=true]:text-[var(--menu-muted)]',\n ],\n {\n variants: {\n size: {\n sm: `${FIELD_INPUT_SIZES.sm} py-1`,\n default: `${FIELD_INPUT_SIZES.default} py-2`,\n lg: `${FIELD_INPUT_SIZES.lg} py-3`,\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Select Popover\n *\n * Styles the popover container that holds the listbox.\n * Uses menu tokens to match Dropdown styling.\n */\nexport const selectPopoverVariants = cva(\n [\n // Base styles - use menu tokens to match Dropdown styling\n 'z-50',\n 'w-[--trigger-width]',\n 'rounded-md',\n 'border',\n 'border-[var(--menu-border)]',\n 'bg-[var(--menu-background)]',\n 'text-[var(--menu-foreground)]',\n 'outline-none',\n 'overflow-auto',\n // Animations\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n ],\n {\n variants: {\n size: {\n sm: 'max-h-[200px] p-1',\n default: 'max-h-[300px] p-1',\n lg: 'max-h-[400px] p-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Section Headers\n *\n * Styles the non-interactive section header labels within grouped selects.\n */\nexport const selectSectionVariants = cva(\n [\n 'px-2',\n 'py-1.5',\n 'text-xs',\n 'font-semibold',\n 'text-[var(--menu-muted)]',\n 'uppercase',\n 'tracking-wider',\n ],\n {\n variants: {\n size: {\n sm: 'px-2 py-1 text-[10px]',\n default: 'px-2 py-1 text-xs',\n lg: 'px-2 py-1.5 text-xs',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Error Messages\n *\n * Styles the error message displayed below the select trigger.\n */\nexport const selectErrorVariants = cva(\n [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-sm',\n 'font-medium',\n 'text-[var(--destructive-background)]',\n // mt-1 (4px) per design spec \"Input → hint: 4px\"; variants below override for size\n 'mt-1',\n ],\n {\n variants: {\n size: {\n sm: 'text-xs mt-1',\n default: 'text-sm mt-1',\n lg: 'text-base mt-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * Type exports for variant props.\n * Allows TypeScript inference of variant combinations.\n */\nexport type SelectTriggerVariantProps = VariantProps<typeof selectTriggerVariants>;\nexport type SelectItemVariantProps = VariantProps<typeof selectItemVariants>;\nexport type SelectPopoverVariantProps = VariantProps<typeof selectPopoverVariants>;\nexport type SelectSectionVariantProps = VariantProps<typeof selectSectionVariants>;\nexport type SelectErrorVariantProps = VariantProps<typeof selectErrorVariants>;\n","'use client';\n\n/**\n * Select Component - Implementation\n *\n * Accessible select/dropdown component combining React Aria primitives with ShadCN styling.\n * Follows Themis library patterns with compound component structure.\n *\n * Architecture:\n * - SelectBase: Internal component containing shared label, description, trigger, error, and listbox rendering.\n * - SelectRoot: Single selection wrapper (thin layer over SelectBase).\n * - MultiSelectRoot: Multiple selection wrapper with display value logic (thin layer over SelectBase).\n * - SelectItem, SelectSection, SelectHeader: Compound sub-components.\n *\n * @see select-prd.md (Full requirements)\n * @see Select.types.ts (Zod schemas)\n * @see Select.styles.ts (CVA variant definitions)\n * @see plan.md (Implementation plan)\n */\n\nimport {\n forwardRef,\n memo,\n Children,\n useId,\n useMemo,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport {\n Select as AriaSelect,\n Label,\n Button,\n SelectValue,\n Popover,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Header,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { Check, CheckSquare, ChevronDown, Loader2 } from 'lucide-react';\nimport { FIELD_TOUCH_TARGET } from '../../styles';\nimport { cn } from '../../utils/cn';\nimport { createInteractOutsideGuard } from '../../utils/browserExtensionOverlay';\nimport type {\n SelectProps,\n SelectItemProps,\n SelectSectionProps,\n SelectHeaderProps,\n SelectSize,\n} from './Select.types';\nimport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n// Re-export CVA variants so existing imports from './Select' continue to work\nexport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n// Hoisted static JSX — avoids re-creation on every render\nconst LOADING_SKELETON = Array.from({ length: 3 }).map((_, i) => (\n <div\n key={`skeleton-${i}`}\n className=\"h-11 px-4 py-2\"\n >\n <div className=\"h-4 bg-[var(--accent-background)] rounded animate-pulse\" />\n </div>\n));\n\n/**\n * Internal props for SelectBase.\n * Extends the shared props with selection-mode-specific configuration.\n */\ninterface SelectBaseProps {\n /** The AriaSelect props to spread onto the root element */\n ariaSelectProps: Record<string, unknown>;\n /** Content to render inside the trigger button (SelectValue for single, span for multi) */\n triggerContent: ReactNode;\n /** Ref to forward to the trigger button */\n triggerRef: Ref<HTMLButtonElement>;\n /** Label text */\n label: string;\n /** Optional description text */\n description?: string;\n /** Whether the field is required */\n isRequired: boolean;\n /** Whether the field is disabled */\n isDisabled: boolean;\n /** Whether the field is in a loading state */\n isLoading: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Size variant */\n size: SelectSize;\n /** Empty state message override */\n emptyStateMessage?: string;\n /** Child count (pre-computed by parent) */\n childCount: number;\n /** Children to render in the listbox */\n children: ReactNode;\n}\n\n/**\n * SelectBase - Internal shared rendering component\n *\n * Contains the shared rendering logic for label, description, trigger button,\n * error message, and popover/listbox that both SelectRoot and MultiSelectRoot use.\n * This is not exported as part of the public API.\n */\nfunction SelectBase({\n ariaSelectProps,\n triggerContent,\n triggerRef,\n label,\n description,\n isRequired,\n isDisabled,\n isLoading,\n errorMessage,\n size,\n emptyStateMessage,\n childCount,\n children,\n}: SelectBaseProps): ReactElement {\n // Generate unique IDs for accessibility\n const labelId = useId();\n const descriptionId = useId();\n const errorId = useId();\n\n // Determine if invalid based on errorMessage\n const isInvalid = Boolean(errorMessage);\n\n // Stack label, description, trigger and error vertically (matching TextField). Without\n // this the inline <label> and description <span> collapse onto one line, so the helper\n // text reads as part of the label instead of sitting beneath the field.\n const { className: rootClassName, ...restAriaSelectProps } = ariaSelectProps as { className?: string } & Record<string, unknown>;\n\n return (\n <AriaSelect\n {...restAriaSelectProps}\n className={cn('flex flex-col gap-1.5', rootClassName)}\n isInvalid={isInvalid}\n >\n {/* Label */}\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && <span className=\"text-[var(--destructive-background)] ml-1\">*</span>}\n </Label>\n\n {/* Description (if provided) — sits below the label; the root's gap handles spacing. */}\n {description && (\n <Text id={descriptionId} slot=\"description\" className=\"text-sm text-[var(--menu-muted)]\">\n {description}\n </Text>\n )}\n\n {/* Layer 1: Touch target (44px min) */}\n <div className={FIELD_TOUCH_TARGET}>\n {/* Layer 2: Visual trigger button */}\n <Button\n ref={triggerRef}\n className={selectTriggerVariants({ size, isInvalid })}\n aria-labelledby={labelId}\n aria-describedby={description ? descriptionId : errorMessage ? errorId : undefined}\n data-loading={isLoading}\n {...(isRequired && { 'aria-required': 'true' })}\n {...(isLoading && { 'aria-busy': 'true' })}\n {...((isDisabled || isLoading) && { 'aria-disabled': 'true' })}\n >\n {triggerContent}\n\n {/* Loading spinner or chevron icon */}\n {isLoading ? (\n <Loader2 className=\"ml-auto h-4 w-4 shrink-0 animate-spin text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n ) : (\n <ChevronDown className=\"ml-auto h-4 w-4 shrink-0 text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n )}\n </Button>\n </div>\n\n {/* Error Message — text only, no decorative icon. Errors are conveyed\n by the red border on the trigger plus the message text colour;\n a leading icon adds visual noise that the other field types don't\n carry (NumberField, TextField error message, RichTextEditor). */}\n <FieldError id={errorId} className={selectErrorVariants({ size })}>\n {({ validationErrors }) => {\n const displayError = errorMessage || validationErrors.join(' ');\n return displayError ? <>{displayError}</> : null;\n }}\n </FieldError>\n\n {/* Popover with ListBox */}\n <Popover\n shouldCloseOnInteractOutside={createInteractOutsideGuard()}\n className={selectPopoverVariants({ size })}\n >\n <ListBox className=\"outline-none\">\n {/* Loading skeleton (if loading and has children) */}\n {isLoading && childCount > 0 && LOADING_SKELETON}\n\n {/* Items or empty state */}\n {!isLoading && (\n <>\n {children}\n {/* Empty state - render as disabled item so popover can open */}\n {childCount === 0 && (\n <ListBoxItem\n id=\"__empty__\"\n textValue=\"empty\"\n isDisabled\n className=\"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none\"\n >\n <span role=\"status\">\n {emptyStateMessage || 'No options available'}\n </span>\n </ListBoxItem>\n )}\n </>\n )}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n}\n\n/**\n * Select Root Component (Single Selection Only)\n *\n * Main select component with controlled/uncontrolled modes for single selection.\n * For multiple selection, use MultiSelect component.\n * Delegates shared rendering to SelectBase.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst SelectRoot = forwardRef<HTMLButtonElement, Omit<SelectProps, 'selectionMode'>>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items (Decision 22: Large Item Count Handling)\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string,\n defaultValue: defaultValue as string,\n onChange: (key: unknown) => {\n if (onChange) {\n onChange(key as string);\n }\n },\n placeholder,\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={<SelectValue className=\"flex-1 text-left truncate\" />}\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nSelectRoot.displayName = 'Select';\n\n/**\n * MultiSelect Root Component (Multiple Selection)\n *\n * Select component for multiple selection. Uses different API from single Select.\n * Delegates shared rendering to SelectBase, adding multi-select display value logic.\n *\n * @see select-prd.md US-6 (Multiple Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst MultiSelectRoot = forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n selectionMode: _selectionMode = 'multiple',\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n // Build value-to-label map for display (memoized to prevent recreation on every render)\n const valueToLabelMap = useMemo(() => {\n const map = new Map<string, string>();\n const processChildren = (nodes: ReactNode): void => {\n Children.forEach(nodes, (child) => {\n if (isValidElement(child)) {\n const element = child as ReactElement<{ value?: string; children?: ReactNode }>;\n if (element.type === SelectItem || element.props?.value) {\n const itemValue = element.props.value;\n const itemChildren = element.props.children;\n if (itemValue && typeof itemChildren === 'string') {\n map.set(itemValue, itemChildren);\n }\n }\n if (element.props?.children) {\n processChildren(element.props.children);\n }\n }\n });\n };\n processChildren(children);\n return map;\n }, [children]);\n\n // Multi-select display logic (Decision 5: Multi-select threshold)\n // Memoized to prevent recalculation on every render\n const displayValue = useMemo(() => {\n if (!value || !Array.isArray(value) || value.length === 0) {\n return placeholder || '';\n }\n\n if (value.length <= 2) {\n // Show item labels for 1-2 items\n const labels = value.map(v => valueToLabelMap.get(v as string) || v);\n return labels.join(', ');\n }\n\n // Show count for 3+ items\n return `${value.length} items selected`;\n }, [value, valueToLabelMap, placeholder]);\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string[],\n defaultValue: defaultValue as string[],\n onChange: (keys: unknown) => {\n if (onChange) {\n onChange(keys as string[]);\n }\n },\n selectionMode: 'multiple',\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={\n <span className=\"flex-1 text-left truncate\">\n {displayValue}\n </span>\n }\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nMultiSelectRoot.displayName = 'MultiSelect';\n\n/**\n * Select.Item Component\n *\n * Individual selectable item with checkmark icon.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 6 (Left-side checkmark)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nconst SelectItem = memo(function SelectItem({ children, textValue, value, isDisabled = false, className, ...props }: SelectItemProps): ReactElement {\n // Validate textValue for custom children (Decision 23)\n if (!textValue && typeof children !== 'string') {\n const message = 'Select.Item with custom children requires textValue prop for accessibility';\n if (process.env.NODE_ENV === 'development') {\n throw new Error(message);\n } else {\n console.warn(message);\n }\n }\n\n return (\n <ListBoxItem\n id={value}\n textValue={textValue || (typeof children === 'string' ? children : undefined)}\n className={`${selectItemVariants({ size: 'default' })} ${className || ''}`}\n isDisabled={isDisabled}\n {...props}\n >\n {({ isSelected, selectionMode, isDisabled: itemDisabled }) => (\n <>\n {/* Checkmark icon (left side) - Decision 6 */}\n {selectionMode === 'multiple' ? (\n <CheckSquare\n className={`absolute left-2 h-4 w-4 ${isSelected ? 'visible' : 'invisible'}`}\n aria-hidden=\"true\"\n />\n ) : (\n isSelected && <Check className=\"absolute left-2 h-4 w-4\" aria-hidden=\"true\" />\n )}\n <span className={itemDisabled ? 'text-[var(--menu-muted)]' : ''}>\n {children}\n </span>\n </>\n )}\n </ListBoxItem>\n );\n});\n\nSelectItem.displayName = 'SelectItem';\n\n/**\n * Select.Section Component\n *\n * Groups related items with optional header.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectSection({ children, className, ...props }: SelectSectionProps): ReactElement {\n return (\n <ListBoxSection className={`border-t border-[var(--border)] first:border-t-0 ${className || ''}`} {...props}>\n {children}\n </ListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n\n/**\n * Select.Header Component\n *\n * Section header with non-interactive label.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectHeader({ children, className, ...props }: SelectHeaderProps): ReactElement {\n return (\n <Header className={`${selectSectionVariants({ size: 'default' })} ${className || ''}`} {...props}>\n {children}\n </Header>\n );\n}\n\nSelectHeader.displayName = 'SelectHeader';\n\n/**\n * Compound Component Exports\n *\n * Uses Object.assign() for compound components (e.g., Select.Item, Select.Section).\n * Named exports (SelectItem, SelectSection, SelectHeader) are also available below\n * for better tree-shaking. Prefer named exports in new code.\n *\n * @deprecated (v2) The Object.assign compound pattern will be removed in v2.\n * Migrate to named imports: `import { SelectItem, SelectSection, SelectHeader } from '...'`\n *\n * @see GUIDE.mdx (Compound component pattern)\n */\nexport const Select = Object.assign(SelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\nexport const MultiSelect = Object.assign(MultiSelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\n// Named exports for individual components (preferred for tree-shaking)\nexport { SelectRoot, MultiSelectRoot, SelectItem, SelectSection, SelectHeader };\n","\"use client\";\n\n/**\n * Badge Component - 2-Layer Architecture for Actionable Badges\n * Accessible badge with React Aria primitives and CVA styling\n *\n * Architecture:\n * - Static badges: Single span element\n * - Actionable badges (with onPress):\n * - Layer 1: Touch Target (44x44px WCAG AAA compliant, transparent)\n * - Layer 2: Visual Badge (compact size, colors)\n *\n * @see plan.md for architecture details\n * @see badge-prd.md for requirements\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, type ReactElement } from 'react';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport {\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED,\n} from '../../styles/interaction-states';\nimport type { BadgeProps } from './Badge.types';\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * Only used for actionable badges (with onPress)\n * Handles WCAG 2.2 AAA touch target requirement\n * IMPORTANT: Focus ring stays on Layer 1 for AAA compliance (2.4.13)\n */\nexport const badgeOuterVariants = cva(\n [\n 'relative inline-flex items-center justify-center',\n 'min-h-[44px] min-w-[44px]',\n 'focus-visible:outline-none',\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-[var(--page-background)]',\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n ],\n {\n variants: {},\n defaultVariants: {},\n }\n);\n\n/**\n * Layer 2: Visual Badge appearance\n * Used for all badges (both static and actionable)\n * Provides the visual appearance with configurable size and variant\n * NOTE: NO focus-visible styles here - focus ring is on Layer 1\n */\nexport const badgeVisualVariants = cva(\n [\n 'inline-flex items-center justify-center',\n 'gap-1',\n 'rounded-full',\n 'font-medium',\n 'whitespace-nowrap',\n 'transition-colors',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'bg-[var(--primary-action)]',\n 'text-[var(--primary-action-foreground)]',\n 'hover:bg-[var(--primary-action)]/90',\n 'data-[pressed]:bg-[var(--primary-action)]/80',\n ],\n accent: [\n 'bg-[var(--accent-background)]',\n 'text-[var(--accent-foreground)]',\n 'hover:bg-[var(--accent-background)]/90',\n 'data-[pressed]:bg-[var(--accent-background)]/80',\n ],\n destructive: [\n 'bg-[var(--destructive-background)]',\n 'text-[var(--destructive-foreground)]',\n 'hover:bg-[var(--destructive-background)]/90',\n 'data-[pressed]:bg-[var(--destructive-background)]/80',\n ],\n content: [\n 'bg-[var(--accent-background)]',\n 'text-[var(--accent-foreground)]',\n 'hover:bg-[var(--accent-background)]/90',\n 'data-[pressed]:bg-[var(--accent-background)]/80',\n ],\n },\n size: {\n sm: 'h-5 px-2 text-xs',\n default: 'h-6 px-2.5 text-xs',\n lg: 'h-7 px-3 text-sm',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'default',\n },\n }\n);\n\n/**\n * @deprecated Use badgeVisualVariants instead. This alias is kept for backward compatibility.\n */\nexport const badgeVariants = badgeVisualVariants;\n\n// Icon size classes mapped to badge sizes\n// Sizes are proportional to badge height: sm=20px, default=24px, lg=28px\nconst iconSizeClasses: Record<NonNullable<BadgeProps['size']>, string> = {\n sm: '[&_svg]:h-2.5 [&_svg]:w-2.5', // 10px icons for 20px badge\n default: '[&_svg]:h-3 [&_svg]:w-3', // 12px icons for 24px badge\n lg: '[&_svg]:h-3.5 [&_svg]:w-3.5', // 14px icons for 28px badge\n};\n\n/**\n * Badge Component - Accessible badge for labels, tags, and status indicators\n *\n * Features:\n * - WCAG 2.2 AAA compliant (7:1 contrast, 44x44px touch targets for actionable)\n * - 4 semantic variants (primary, accent, destructive, content)\n * - 3 sizes (sm, default, lg)\n * - Icon support with configurable position\n * - Count display (number or string)\n * - Static badges (span) vs actionable badges (button)\n */\nconst Badge = memo(\n forwardRef<HTMLButtonElement | HTMLSpanElement, BadgeProps>(\n (\n {\n className,\n variant = 'primary',\n size = 'default',\n children,\n icon,\n iconPosition = 'start',\n count,\n onPress,\n isDisabled,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'data-testid': dataTestId,\n ...props\n },\n ref\n ): ReactElement => {\n // Visual classes for the badge appearance\n const visualClasses = cn(\n badgeVisualVariants({ variant, size }),\n iconSizeClasses[size],\n className\n );\n\n // Check if we have multiple content elements (need gap styling)\n const hasIcon = !!icon;\n const hasCount = count !== undefined;\n const hasChildren = !!children;\n const multipleElements =\n [hasIcon, hasCount, hasChildren].filter(Boolean).length > 1;\n\n // Content rendering: icon + children + count (all can display together)\n // Only wrap children in span when there are multiple elements (for gap)\n const renderContent = (): ReactElement => (\n <>\n {icon && iconPosition === 'start' && (\n <span className=\"shrink-0\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {children && (multipleElements ? <span>{children}</span> : children)}\n {count !== undefined && (\n <span className=\"font-mono tabular-nums\">{count}</span>\n )}\n {icon && iconPosition === 'end' && (\n <span className=\"shrink-0\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n </>\n );\n\n // Actionable badge (with onPress) - uses 2-layer architecture\n if (onPress) {\n return (\n <AriaButton\n ref={ref as React.Ref<HTMLButtonElement>}\n isDisabled={isDisabled}\n onPress={onPress}\n className={badgeOuterVariants()}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-testid={dataTestId}\n {...(props as Omit<AriaButtonProps, 'className'>)}\n >\n {(renderProps) => (\n <span\n className={cn(\n visualClasses,\n // Interaction styles for visual feedback\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED\n )}\n data-pressed={renderProps.isPressed || undefined}\n >\n {renderContent()}\n </span>\n )}\n </AriaButton>\n );\n }\n\n // Static badge - simple span element\n return (\n <span\n ref={ref as React.Ref<HTMLSpanElement>}\n className={visualClasses}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-testid={dataTestId}\n {...props}\n >\n {renderContent()}\n </span>\n );\n }\n )\n);\n\nBadge.displayName = 'Badge';\n\nexport { Badge };\n","import { cva } from 'class-variance-authority';\n\n/** The filter bar — a horizontal, wrapping row of controls. */\nexport const filtersBarVariants = cva([\n 'flex flex-wrap items-center gap-2',\n]);\n\n/** A filter pill trigger (the button that opens a popover). */\nexport const filterPillVariants = cva([\n 'inline-flex items-center gap-2',\n]);\n\n/** The popover panel surface. */\nexport const filterPopoverVariants = cva([\n 'min-w-[14rem] max-w-[20rem] rounded-md border border-[var(--border)]',\n 'bg-[var(--content-background)] p-2 shadow-md',\n 'motion-safe:data-[entering]:animate-in motion-safe:data-[entering]:fade-in-0',\n 'motion-safe:data-[exiting]:animate-out motion-safe:data-[exiting]:fade-out-0',\n]);\n\n/** The popover header (label + Done). */\nexport const filterPopoverHeaderVariants = cva([\n 'flex items-center justify-between gap-2 px-1 pb-2 mb-1',\n 'border-b border-[var(--border)]',\n]);\n\n/** Chips region. */\nexport const appliedFiltersVariants = cva(['flex items-center gap-2'], {\n variants: {\n // On mobile chips scroll horizontally instead of wrapping.\n scrollable: {\n true: 'flex-nowrap overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&>*]:flex-none',\n false: 'flex-wrap',\n },\n },\n defaultVariants: { scrollable: false },\n});\n\n// ── Mobile bottom-sheet (narrow Filters) ───────────────────────────────────\n\n/** Backdrop behind the bottom-sheet. */\nexport const filterSheetBackdropVariants = cva([\n 'fixed inset-0 z-[80] bg-[rgb(23_23_23_/_0.42)]',\n 'motion-safe:data-[entering]:animate-in motion-safe:data-[entering]:fade-in-0',\n 'motion-safe:data-[exiting]:animate-out motion-safe:data-[exiting]:fade-out-0',\n]);\n\n/** The bottom-sheet panel itself. */\nexport const filterSheetVariants = cva([\n 'fixed inset-x-0 bottom-0 z-[81] flex max-h-[88vh] flex-col',\n 'rounded-t-3xl border-t border-[var(--border)] bg-[var(--content-background)]',\n 'motion-safe:data-[entering]:animate-in motion-safe:data-[entering]:slide-in-from-bottom',\n 'motion-safe:data-[exiting]:animate-out motion-safe:data-[exiting]:slide-out-to-bottom',\n]);\n\nexport const filterSheetHeaderVariants = cva([\n 'flex items-center justify-between gap-2 px-5 py-3 border-b border-[var(--border)] flex-none',\n]);\n\nexport const filterSheetBodyVariants = cva([\n 'flex flex-col gap-5 overflow-auto p-5 flex-1',\n // Every control fills the sheet width (full-width stacked fields on mobile).\n '[&>*]:w-full',\n]);\n\nexport const filterSheetFooterVariants = cva([\n 'flex items-center justify-between gap-3 px-5 pt-3 flex-none',\n 'pb-[calc(0.75rem+env(safe-area-inset-bottom))] border-t border-[var(--border)]',\n]);\n\n/** Grab handle at the top of the sheet. */\nexport const filterSheetGrabVariants = cva([\n 'mx-auto mt-2.5 mb-0.5 h-1.5 w-10 flex-none rounded-full bg-[var(--border)]',\n]);\n\n/** A single removable chip (a button). */\nexport const filterChipVariants = cva([\n 'inline-flex items-center gap-1.5 min-h-[44px] px-3 rounded-full',\n 'border border-[var(--border)] bg-[var(--accent-background)]',\n 'text-sm text-[var(--content-foreground)]',\n 'hover:bg-[var(--accent)] motion-safe:transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2',\n 'cursor-pointer',\n]);\n","'use client';\n\n/**\n * FilterPopover — a NON-MODAL disclosure popover for a single filter control.\n *\n * Built on the React-Aria `DialogTrigger` + `Popover` + `Dialog` precedent (see\n * DatePicker). Crucially NON-modal: there is no `ModalOverlay`, so the page\n * behind stays interactive. React-Aria's `Popover` supplies outside-dismiss,\n * Esc, return-focus-to-trigger and auto-flip; `Dialog` is only a labelled\n * focus-scope (focus moves in on open, Tab is contained, no `aria-modal`).\n *\n * No hand-rolled focus-on-open effect — RAC's `Dialog` autofocus handles it\n * (focusing the checked control of a RadioGroup/CheckboxGroup when present).\n */\n\nimport { type ReactNode } from 'react';\nimport { DialogTrigger, Popover, Dialog } from 'react-aria-components';\nimport { ChevronDown } from 'lucide-react';\nimport { Button } from '../Button';\nimport { Badge } from '../Badge';\nimport { cn } from '../../utils/cn';\nimport { createInteractOutsideGuard } from '../../utils/browserExtensionOverlay';\nimport {\n filterPillVariants,\n filterPopoverVariants,\n filterPopoverHeaderVariants,\n} from './Filters.styles';\n\nexport interface FilterPopoverProps {\n /** Pill label (and the popover's accessible name). */\n label: string;\n /** Badge content (e.g. a count) shown when the filter is active. */\n badge?: string | number | null;\n /** Whether the filter is active (drives the pill's emphasis). */\n isActive?: boolean;\n /**\n * Popover body. Use the function form to receive `close` (single-choice\n * controls call it to close on select).\n */\n children: ReactNode | ((close: () => void) => ReactNode);\n /** Show a \"Done\" button in the header (multi-select). Omit for close-on-select. */\n doneLabel?: string;\n /** Popover alignment relative to the trigger. */\n align?: 'start' | 'end';\n className?: string;\n}\n\nexport function FilterPopover({\n label,\n badge,\n isActive = false,\n children,\n doneLabel,\n align = 'start',\n className,\n}: FilterPopoverProps): ReactNode {\n const hasBadge = badge !== null && badge !== undefined && badge !== '';\n\n return (\n <DialogTrigger>\n <Button\n variant={isActive ? 'secondary' : 'outline'}\n className={cn(filterPillVariants(), className)}\n >\n <span>{label}</span>\n {hasBadge && <Badge size=\"sm\">{String(badge)}</Badge>}\n <ChevronDown aria-hidden=\"true\" className=\"h-4 w-4 opacity-60\" />\n </Button>\n <Popover\n isNonModal\n shouldCloseOnInteractOutside={createInteractOutsideGuard()}\n placement={align === 'end' ? 'bottom end' : 'bottom start'}\n className={filterPopoverVariants()}\n >\n <Dialog aria-label={label} className=\"outline-none\">\n {({ close }) => (\n <>\n {doneLabel && (\n <div className={filterPopoverHeaderVariants()}>\n <span className=\"text-xs font-bold uppercase tracking-wide text-[var(--menu-muted)]\">\n {label}\n </span>\n <Button variant=\"link\" onPress={close}>\n {doneLabel}\n </Button>\n </div>\n )}\n {typeof children === 'function' ? children(close) : children}\n </>\n )}\n </Dialog>\n </Popover>\n </DialogTrigger>\n );\n}\n","'use client';\n\n/**\n * AppliedFilters — the removable applied-filter chips.\n *\n * Pure data in (`chips` from {@link deriveChips}); the consumer turns\n * `onRemove(chip)` into the next values map via {@link removeChip}. On removal\n * focus cascades (next chip → previous → \"Clear all\" → the region) so it never\n * drops to `<body>` (WCAG 2.4.3).\n */\n\nimport { forwardRef, useRef, type Ref } from 'react';\nimport { X } from 'lucide-react';\nimport { Button } from '../Button';\nimport { cn } from '../../utils/cn';\nimport { appliedFiltersVariants } from './Filters.styles';\nimport type { AppliedFiltersProps, FilterChip } from './Filters.types';\n\nfunction setRef<T>(ref: Ref<T> | undefined, value: T | null): void {\n if (typeof ref === 'function') ref(value);\n else if (ref) (ref as { current: T | null }).current = value;\n}\n\nconst AppliedFilters = forwardRef<HTMLDivElement, AppliedFiltersProps>(\n (\n {\n chips,\n onRemove,\n onClearAll,\n clearAllLabel,\n removeChipLabel,\n scrollable = false,\n 'aria-label': ariaLabel = 'Active filters',\n className,\n 'data-testid': dataTestId = 'applied-filters',\n },\n forwardedRef\n ) => {\n const regionRef = useRef<HTMLDivElement | null>(null);\n\n if (chips.length === 0) return null;\n\n const FOCUSABLE = 'button,a[href],input,select,textarea,[tabindex]:not([tabindex=\"-1\"])';\n\n const handleRemove = (chip: FilterChip, index: number): void => {\n const region = regionRef.current;\n const willBeEmpty = chips.length <= 1;\n\n if (willBeEmpty && region) {\n // The region unmounts (renders null) once empty — move focus to the\n // preceding region (the filter bar) BEFORE the removal so it never\n // drops to <body> (WCAG 2.4.3). Falls back to the region itself.\n const prev = region.previousElementSibling as HTMLElement | null;\n const target =\n (prev?.matches(FOCUSABLE) ? prev : prev?.querySelector<HTMLElement>(FOCUSABLE)) ??\n region;\n target.focus();\n onRemove(chip);\n return;\n }\n\n onRemove(chip);\n // After the chip at `index` unmounts, focus the chip now occupying that\n // slot (the former next), else the new last.\n requestAnimationFrame(() => {\n const current = regionRef.current;\n if (!current) return;\n const buttons = current.querySelectorAll<HTMLElement>('[data-chip]');\n if (buttons.length > 0) {\n buttons[Math.min(index, buttons.length - 1)]?.focus();\n } else {\n current.focus();\n }\n });\n };\n\n return (\n <div\n ref={(node) => {\n regionRef.current = node;\n setRef(forwardedRef, node);\n }}\n role=\"region\"\n aria-label={ariaLabel}\n tabIndex={-1}\n className={cn(appliedFiltersVariants({ scrollable }), 'outline-none', className)}\n data-testid={dataTestId}\n >\n {chips.map((chip, index) => (\n <Button\n key={chip.id}\n variant=\"outline\"\n data-chip\n aria-label={removeChipLabel(\n `${chip.group ? `${chip.group} ` : ''}${chip.label}`\n )}\n onPress={() => handleRemove(chip, index)}\n >\n {chip.group && (\n <span className=\"text-xs font-bold uppercase tracking-wide opacity-60\">\n {chip.group}\n </span>\n )}\n <span className=\"font-semibold\">{chip.label}</span>\n <X aria-hidden=\"true\" className=\"h-3.5 w-3.5 opacity-60\" />\n </Button>\n ))}\n {chips.length > 1 && (\n <Button\n variant=\"link\"\n onPress={() => {\n onClearAll();\n requestAnimationFrame(() => regionRef.current?.focus());\n }}\n >\n {clearAllLabel}\n </Button>\n )}\n </div>\n );\n }\n);\n\nAppliedFilters.displayName = 'AppliedFilters';\n\nexport { AppliedFilters };\n","'use client';\n\nimport { createContext, useContext, type MutableRefObject } from 'react';\nimport type {\n FilterValue,\n FilterValues,\n FiltersLabels,\n FilterChip,\n} from './Filters.types';\n\n/**\n * Each control registers how to interpret its value: whether it's active, the\n * chips it produces, and the value that clears it. `FilterChips` reads the\n * registry to derive removable chips without the consumer re-declaring metadata.\n */\nexport interface RegisteredControl {\n name: string;\n isActive: (value: FilterValue | undefined) => boolean;\n toChips: (value: FilterValue | undefined) => FilterChip[];\n clearedValue: FilterValue;\n}\n\nexport interface FiltersContextValue {\n values: FilterValues;\n /**\n * Narrow (mobile) layout: controls render stacked (full-width labelled fields)\n * for the bottom-sheet instead of inline pills.\n */\n narrow: boolean;\n /** Set a single key (spreads the latest values). */\n setValue: (name: string, value: FilterValue) => void;\n /** Replace the whole values map (used by \"Clear all\"). */\n replaceValues: (next: FilterValues) => void;\n labels: FiltersLabels;\n /** Live registry of mounted controls (insertion order ≈ DOM order). */\n registry: MutableRefObject<Map<string, RegisteredControl>>;\n /** Bumps whenever the registry changes — forces chip-consumers to re-read it. */\n registryVersion: number;\n /** Called by a control on mount / meta-change / unmount to refresh chips. */\n syncControl: (name: string, control: RegisteredControl | null) => void;\n}\n\nconst FiltersContext = createContext<FiltersContextValue | null>(null);\n\nexport function useFiltersContext(componentName: string): FiltersContextValue {\n const ctx = useContext(FiltersContext);\n if (!ctx) {\n throw new Error(`<${componentName}> must be rendered inside <Filters>.`);\n }\n return ctx;\n}\n\nexport { FiltersContext };\n","'use client';\n\n/**\n * Filters — a compositional, spec-light filter bar.\n *\n * `<Filters values onChange labels>` owns one controlled values map and shares it\n * via context. Controls are composed as children — `<FilterSearch>`,\n * `<FilterSelect>`, `<FilterMulti>`, `<FilterToggle>`, `<FilterWithin>`,\n * `<FilterCombobox>` (API-backed type-ahead) — plus an optional `<FilterChips>`\n * for removable applied-filter chips. Importing only the controls you use keeps\n * unused ones out of your bundle (named exports, no dot-namespace).\n *\n * Domain-free (labels-as-props), non-modal popovers, WCAG 2.2 AAA (44px targets,\n * focus-managed chip removal, labelled region).\n */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n Children,\n isValidElement,\n type ReactNode,\n} from 'react';\nimport { FocusScope } from 'react-aria';\nimport { SlidersHorizontal, X } from 'lucide-react';\nimport { SearchField } from '../SearchField';\nimport { Switch } from '../Switch';\nimport { RadioGroup, Radio } from '../RadioGroup';\nimport { CheckboxGroup, Checkbox } from '../CheckboxGroup';\nimport { Combobox, ComboboxItem } from '../Combobox';\nimport { Select } from '../Select';\nimport { Button } from '../Button';\nimport { Badge } from '../Badge';\nimport { cn } from '../../utils/cn';\nimport { FilterPopover } from './FilterPopover';\nimport { AppliedFilters } from './AppliedFilters';\nimport {\n FiltersContext,\n useFiltersContext,\n type RegisteredControl,\n} from './FiltersContext';\nimport {\n filtersBarVariants,\n filterPillVariants,\n filterSheetBackdropVariants,\n filterSheetVariants,\n filterSheetHeaderVariants,\n filterSheetBodyVariants,\n filterSheetFooterVariants,\n filterSheetGrabVariants,\n} from './Filters.styles';\nimport type {\n FilterChip,\n FilterOption,\n FilterValue,\n FilterValues,\n FiltersProps,\n FilterSearchProps,\n FilterSelectProps,\n FilterMultiProps,\n FilterToggleProps,\n FilterWithinProps,\n FilterComboboxProps,\n FilterChipsProps,\n} from './Filters.types';\n\n// ============================================================================\n// Root provider\n// ============================================================================\n\nconst Filters = forwardRef<HTMLDivElement, FiltersProps>(\n (\n {\n values,\n onChange,\n labels,\n narrow = false,\n children,\n 'aria-label': ariaLabel = 'Filters',\n className,\n 'data-testid': dataTestId = 'filters',\n },\n ref\n ) => {\n const registry = useRef<Map<string, RegisteredControl>>(new Map());\n const [registryVersion, setRegistryVersion] = useState(0);\n\n const valuesRef = useRef(values);\n valuesRef.current = values;\n\n const setValue = useCallback(\n (name: string, value: FilterValue) => {\n onChange({ ...valuesRef.current, [name]: value });\n },\n [onChange]\n );\n\n const replaceValues = useCallback(\n (next: FilterValues) => onChange(next),\n [onChange]\n );\n\n const syncControl = useCallback(\n (name: string, control: RegisteredControl | null) => {\n if (control) registry.current.set(name, control);\n else registry.current.delete(name);\n setRegistryVersion((n) => n + 1);\n },\n []\n );\n\n const contextValue = useMemo(\n () => ({ values, narrow, setValue, replaceValues, labels, registry, registryVersion, syncControl }),\n [values, narrow, setValue, replaceValues, labels, registryVersion, syncControl]\n );\n\n // Active-filter count (drives the mobile trigger badge). Reads the registry,\n // so it tracks registryVersion + values.\n const activeCount = useMemo(() => {\n let count = 0;\n for (const [name, control] of registry.current) {\n if (control.isActive(values[name])) count += 1;\n }\n return count;\n }, [values, registryVersion]);\n\n const clearAll = (): void => {\n const next: FilterValues = { ...valuesRef.current };\n for (const [name, control] of registry.current) next[name] = control.clearedValue;\n replaceValues(next);\n };\n\n // ── Mobile bottom-sheet state ──────────────────────────────────────────\n const [sheetOpen, setSheetOpen] = useState(false);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const backdropRef = useRef<HTMLDivElement>(null);\n\n const closeSheet = useCallback(() => {\n setSheetOpen(false);\n requestAnimationFrame(() => triggerRef.current?.focus());\n }, []);\n\n // Move focus into the sheet when it opens (the panel is always mounted so\n // the controls register even while closed — display:none, not Activity,\n // which would suspend their effects).\n useEffect(() => {\n if (!sheetOpen) return;\n const FOCUSABLE =\n 'button,a[href],input,select,textarea,[tabindex]:not([tabindex=\"-1\"])';\n panelRef.current?.querySelector<HTMLElement>(FOCUSABLE)?.focus();\n }, [sheetOpen]);\n\n // Dismiss the sheet on Escape or a tap on the backdrop. We match the backdrop\n // element specifically (not \"anything outside the panel\") so that clicks in a\n // control's portalled dropdown — a Select/Combobox listbox renders above the\n // backdrop, outside the panel — don't close the sheet mid-selection.\n useEffect(() => {\n if (!sheetOpen) return;\n const onDown = (e: PointerEvent): void => {\n const target = e.target as Node;\n if (backdropRef.current && backdropRef.current.contains(target)) {\n closeSheet();\n }\n };\n const onKey = (e: globalThis.KeyboardEvent): void => {\n if (e.key === 'Escape') {\n e.preventDefault();\n closeSheet();\n }\n };\n document.addEventListener('pointerdown', onDown, true);\n document.addEventListener('keydown', onKey);\n return () => {\n document.removeEventListener('pointerdown', onDown, true);\n document.removeEventListener('keydown', onKey);\n };\n }, [sheetOpen, closeSheet]);\n\n // Separate the controls from the chips so the bar can lay each out itself —\n // a pill row + chips row on desktop, stacked controls in the sheet + chips\n // under the trigger on mobile. Consumers pass controls + <FilterChips> as\n // direct children (no layout wrapper needed).\n const childArray = Children.toArray(children);\n const isChips = (c: ReactNode): boolean => isValidElement(c) && c.type === FilterChips;\n const chipsChildren = childArray.filter(isChips);\n const controlChildren = childArray.filter((c) => !isChips(c));\n\n if (narrow) {\n return (\n <FiltersContext.Provider value={contextValue}>\n <div\n ref={ref}\n role=\"region\"\n aria-label={ariaLabel}\n className={cn('flex flex-col gap-3', className)}\n data-testid={dataTestId}\n >\n <div>\n <Button\n ref={triggerRef}\n variant=\"outline\"\n className={filterPillVariants()}\n aria-haspopup=\"dialog\"\n aria-expanded={sheetOpen}\n onPress={() => setSheetOpen(true)}\n >\n <SlidersHorizontal aria-hidden=\"true\" className=\"h-4 w-4\" />\n <span>{labels.filtersButton ?? ariaLabel}</span>\n {activeCount > 0 && <Badge size=\"sm\">{String(activeCount)}</Badge>}\n </Button>\n </div>\n\n {sheetOpen && (\n <div ref={backdropRef} className={filterSheetBackdropVariants()} aria-hidden=\"true\" />\n )}\n\n {/* Always mounted (display:none when closed) so the controls keep their\n registration; FocusScope traps Tab while open. */}\n <FocusScope contain={sheetOpen} restoreFocus>\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-modal={sheetOpen || undefined}\n aria-label={ariaLabel}\n className={sheetOpen ? filterSheetVariants() : 'hidden'}\n >\n <span className={filterSheetGrabVariants()} aria-hidden=\"true\" />\n <div className={filterSheetHeaderVariants()}>\n <span className=\"text-lg font-semibold\">\n {labels.filtersButton ?? ariaLabel}\n </span>\n <Button\n variant=\"ghost\"\n visualSize=\"icon\"\n aria-label={labels.close ?? 'Close'}\n onPress={closeSheet}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </div>\n <div className={filterSheetBodyVariants()}>{controlChildren}</div>\n <div className={filterSheetFooterVariants()}>\n <Button variant=\"link\" onPress={clearAll}>\n {labels.clearAll ?? labels.clear}\n </Button>\n <Button variant=\"default\" onPress={closeSheet}>\n {labels.done}\n </Button>\n </div>\n </div>\n </FocusScope>\n\n {chipsChildren}\n </div>\n </FiltersContext.Provider>\n );\n }\n\n return (\n <FiltersContext.Provider value={contextValue}>\n <div\n ref={ref}\n role=\"region\"\n aria-label={ariaLabel}\n className={cn('flex flex-col gap-3', className)}\n data-testid={dataTestId}\n >\n <div className={filtersBarVariants()}>{controlChildren}</div>\n {chipsChildren}\n </div>\n </FiltersContext.Provider>\n );\n }\n);\n\nFilters.displayName = 'Filters';\n\n// ============================================================================\n// Shared registration hook\n// ============================================================================\n\nfunction useControlRegistration(name: string, control: RegisteredControl): void {\n const { syncControl } = useFiltersContext('Filter control');\n useEffect(() => {\n syncControl(name, control);\n return () => syncControl(name, null);\n }, [name, control, syncControl]);\n}\n\nfunction optionsSignature(options: FilterOption[]): string {\n return options.map((o) => `${o.value}\u0000${o.label}`).join('\u0001');\n}\n\nfunction optionLabel(options: FilterOption[], value: string): string {\n return options.find((o) => o.value === value)?.label ?? value;\n}\n\n// ============================================================================\n// FilterSearch\n// ============================================================================\n\nfunction FilterSearch({ name, label, placeholder, chipGroup, className }: FilterSearchProps): ReactNode {\n const { values, setValue } = useFiltersContext('FilterSearch');\n const value = typeof values[name] === 'string' ? (values[name] as string) : '';\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: '',\n isActive: (v) => typeof v === 'string' && v.trim() !== '',\n toChips: (v) =>\n typeof v === 'string' && v.trim() !== ''\n ? [{ id: name, key: name, label: `“${v}”`, group: chipGroup ?? label }]\n : [],\n }),\n [name, label, chipGroup]\n );\n useControlRegistration(name, control);\n\n return (\n <SearchField\n aria-label={label}\n placeholder={placeholder}\n value={value}\n onChange={(next) => setValue(name, next)}\n onClear={() => setValue(name, '')}\n className={cn('min-w-[14rem]', className)}\n />\n );\n}\n\n// ============================================================================\n// FilterToggle\n// ============================================================================\n\nfunction FilterToggle({ name, label, className }: FilterToggleProps): ReactNode {\n const { values, setValue } = useFiltersContext('FilterToggle');\n const value = values[name] === true;\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: false,\n isActive: (v) => v === true,\n toChips: (v) => (v === true ? [{ id: name, key: name, label }] : []),\n }),\n [name, label]\n );\n useControlRegistration(name, control);\n\n return (\n <Switch\n label={label}\n isSelected={value}\n onChange={(selected) => setValue(name, Boolean(selected))}\n className={className}\n />\n );\n}\n\n// ============================================================================\n// FilterSelect (single choice — closes on select)\n// ============================================================================\n\nconst SELECT_ALL_SENTINEL = '__all__';\n\nfunction FilterSelect({ name, label, options, allLabel, className }: FilterSelectProps): ReactNode {\n const { values, setValue, narrow } = useFiltersContext('FilterSelect');\n const value = typeof values[name] === 'string' ? (values[name] as string) : '';\n const sig = optionsSignature(options);\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: '',\n isActive: (v) => typeof v === 'string' && v !== '',\n toChips: (v) =>\n typeof v === 'string' && v !== ''\n ? [{ id: name, key: name, label: optionLabel(options, v), group: label }]\n : [],\n }),\n [name, label, sig]\n );\n useControlRegistration(name, control);\n\n // Mobile sheet: a full-width labelled Select (the \"All\" option clears it).\n if (narrow) {\n return (\n <Select\n label={label}\n value={value === '' ? SELECT_ALL_SENTINEL : value}\n onChange={(next: string | string[]) => {\n const v = Array.isArray(next) ? next[0] : next;\n setValue(name, !v || v === SELECT_ALL_SENTINEL ? '' : v);\n }}\n className={className}\n >\n <Select.Item value={SELECT_ALL_SENTINEL}>{allLabel ?? 'All'}</Select.Item>\n {options.map((option) => (\n <Select.Item key={option.value} value={option.value}>\n {option.label}\n </Select.Item>\n ))}\n </Select>\n );\n }\n\n return (\n <FilterPopover label={label} isActive={value !== ''} className={className}>\n {(close) => (\n <RadioGroup\n aria-label={label}\n value={value}\n onChange={(next) => {\n setValue(name, next);\n close();\n }}\n >\n <Radio value=\"\">{allLabel ?? 'All'}</Radio>\n {options.map((option) => (\n <Radio key={option.value} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </RadioGroup>\n )}\n </FilterPopover>\n );\n}\n\n// ============================================================================\n// FilterWithin (date-recency presets — closes on select)\n// ============================================================================\n\nfunction FilterWithin({ name, label, presets, className }: FilterWithinProps): ReactNode {\n const { values, setValue, narrow } = useFiltersContext('FilterWithin');\n const sentinel = presets[0]?.value ?? '';\n const value = typeof values[name] === 'string' ? (values[name] as string) : sentinel;\n const sig = optionsSignature(presets);\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: sentinel,\n isActive: (v) => typeof v === 'string' && v !== sentinel,\n toChips: (v) =>\n typeof v === 'string' && v !== sentinel\n ? [{ id: name, key: name, label: optionLabel(presets, v), group: label }]\n : [],\n }),\n [name, label, sentinel, sig]\n );\n useControlRegistration(name, control);\n\n const radios = (extra?: () => void) => (\n <RadioGroup\n label={narrow ? label : undefined}\n aria-label={narrow ? undefined : label}\n value={value}\n onChange={(next) => {\n setValue(name, next);\n extra?.();\n }}\n className={narrow ? className : undefined}\n >\n {presets.map((preset) => (\n <Radio key={preset.value} value={preset.value}>\n {preset.label}\n </Radio>\n ))}\n </RadioGroup>\n );\n\n // Mobile sheet: an inline labelled radio group (no popover).\n if (narrow) return radios();\n\n return (\n <FilterPopover label={label} isActive={value !== sentinel} className={className}>\n {(close) => radios(close)}\n </FilterPopover>\n );\n}\n\n// ============================================================================\n// FilterMulti (multiple choice — stays open, badge count, Done)\n// ============================================================================\n\nfunction FilterMulti({ name, label, options, className }: FilterMultiProps): ReactNode {\n const { values, setValue, labels, narrow } = useFiltersContext('FilterMulti');\n const value = Array.isArray(values[name]) ? (values[name] as string[]) : [];\n const sig = optionsSignature(options);\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: [],\n isActive: (v) => Array.isArray(v) && v.length > 0,\n toChips: (v) =>\n Array.isArray(v)\n ? v.map((optionValue) => ({\n id: `${name}:${optionValue}`,\n key: name,\n optionValue,\n label: optionLabel(options, optionValue),\n group: label,\n }))\n : [],\n }),\n [name, label, sig]\n );\n useControlRegistration(name, control);\n\n const checkboxes = (\n <CheckboxGroup\n label={narrow ? label : undefined}\n aria-label={narrow ? undefined : label}\n value={value}\n onChange={(next) => setValue(name, next)}\n className={narrow ? className : undefined}\n >\n {options.map((option) => (\n <Checkbox key={option.value} value={option.value}>\n {option.label}\n </Checkbox>\n ))}\n </CheckboxGroup>\n );\n\n // Mobile sheet: an inline labelled checkbox group (no popover).\n if (narrow) return checkboxes;\n\n return (\n <FilterPopover\n label={label}\n badge={value.length || null}\n isActive={value.length > 0}\n doneLabel={labels.done}\n className={className}\n >\n {checkboxes}\n {value.length > 0 && (\n <div className=\"pt-1\">\n <Button variant=\"link\" onPress={() => setValue(name, [])}>\n {labels.clear}\n </Button>\n </div>\n )}\n </FilterPopover>\n );\n}\n\n// ============================================================================\n// FilterCombobox (API-backed type-ahead single choice)\n// ============================================================================\n\nfunction FilterCombobox({\n name,\n label,\n options,\n onSearch,\n isLoading,\n placeholder,\n className,\n}: FilterComboboxProps): ReactNode {\n const { values, setValue } = useFiltersContext('FilterCombobox');\n const value = typeof values[name] === 'string' ? (values[name] as string) : '';\n\n // Remember selected labels so chips survive options changing during async search.\n const labelCache = useRef<Map<string, string>>(new Map());\n for (const option of options) labelCache.current.set(option.value, option.label);\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: '',\n isActive: (v) => typeof v === 'string' && v !== '',\n toChips: (v) =>\n typeof v === 'string' && v !== ''\n ? [{ id: name, key: name, label: labelCache.current.get(v) ?? v, group: label }]\n : [],\n }),\n [name, label]\n );\n useControlRegistration(name, control);\n\n return (\n <Combobox\n aria-label={label}\n placeholder={placeholder}\n selectedKey={value || null}\n onSelectionChange={(key) => setValue(name, key == null ? '' : String(key))}\n onInputChange={onSearch}\n className={cn('min-w-[14rem]', className)}\n >\n {options.length === 0 && isLoading ? (\n <ComboboxItem id=\"__loading\" isDisabled>\n Loading…\n </ComboboxItem>\n ) : (\n options.map((option) => <ComboboxItem key={option.value} id={option.value}>{option.label}</ComboboxItem>)\n )}\n </Combobox>\n );\n}\n\n// ============================================================================\n// FilterChips (auto-derived removable chips from the registry)\n// ============================================================================\n\nfunction FilterChips({\n clearAllLabel,\n removeChipLabel,\n 'aria-label': ariaLabel,\n className,\n 'data-testid': dataTestId,\n}: FilterChipsProps): ReactNode {\n const { values, setValue, replaceValues, registry, narrow } = useFiltersContext('FilterChips');\n\n const chips: FilterChip[] = [];\n for (const [name, control] of registry.current) {\n chips.push(...control.toChips(values[name]));\n }\n\n const handleRemove = (chip: FilterChip): void => {\n if (chip.optionValue !== undefined) {\n const current = values[chip.key];\n const list = Array.isArray(current) ? current : [];\n setValue(\n chip.key,\n list.filter((v) => v !== chip.optionValue)\n );\n } else {\n const control = registry.current.get(chip.key);\n setValue(chip.key, control ? control.clearedValue : '');\n }\n };\n\n const handleClearAll = (): void => {\n const next: FilterValues = { ...values };\n for (const [name, control] of registry.current) {\n next[name] = control.clearedValue;\n }\n replaceValues(next);\n };\n\n return (\n <AppliedFilters\n chips={chips}\n onRemove={handleRemove}\n onClearAll={handleClearAll}\n clearAllLabel={clearAllLabel}\n removeChipLabel={removeChipLabel}\n scrollable={narrow}\n aria-label={ariaLabel}\n className={className}\n data-testid={dataTestId}\n />\n );\n}\n\nexport {\n Filters,\n FilterSearch,\n FilterSelect,\n FilterMulti,\n FilterToggle,\n FilterWithin,\n FilterCombobox,\n FilterChips,\n};\n","import { z } from 'zod';\nimport type { ReactNode } from 'react';\n\n// ============================================================================\n// Options & values\n// ============================================================================\n\n/** A selectable option for select / multi / within / combobox controls. */\nexport interface FilterOption {\n /** Stable value persisted in the values map + chips. */\n value: string;\n /** Visible label (consumer-translated). */\n label: string;\n}\n\nexport const FilterOptionSchema = z.object({\n value: z.string(),\n label: z.string(),\n});\n\nexport type FilterValue = string | string[] | boolean;\nexport type FilterValues = Record<string, FilterValue>;\n\n// ============================================================================\n// Chips\n// ============================================================================\n\n/**\n * A derived, removable applied-filter chip — pure data (no `onRemove`).\n * `FilterChips` / `AppliedFilters` call back with the chip; the surrounding\n * `Filters` resets the value.\n */\nexport interface FilterChip {\n /** `${name}` for scalar filters, `${name}:${optionValue}` for one multi option. */\n id: string;\n /** The owning control's `name`. */\n key: string;\n /** For `multi`: the specific option this chip represents. */\n optionValue?: string;\n /** Human value, e.g. \"Open\", \"“senior”\", \"Last 7 days\". */\n label: string;\n /** Group label, e.g. the control label / \"Search\". */\n group?: string;\n}\n\n// ============================================================================\n// i18n\n// ============================================================================\n\nexport interface FiltersLabels {\n /** \"Done\" button inside multi-select popovers + the mobile sheet's apply button. */\n done: string;\n /** \"Clear\" link inside a multi-select popover. */\n clear: string;\n /** Mobile (narrow) \"Filters\" trigger button. Required when `narrow` is used. */\n filtersButton?: string;\n /** Mobile sheet footer \"Clear all\" button. Falls back to `clear`. */\n clearAll?: string;\n /** Mobile sheet header close-button aria-label. Falls back to \"Close\". */\n close?: string;\n}\n\n// ============================================================================\n// Root + control props\n// ============================================================================\n\nexport interface FiltersProps {\n /** Current values (controlled). Missing keys fall back to each control's default. */\n values: FilterValues;\n /** Called with the full next values map on any change. */\n onChange: (next: FilterValues) => void;\n /** i18n strings shared by the controls. */\n labels: FiltersLabels;\n /**\n * Narrow (mobile) layout. When `true`, the bar collapses to a \"Filters\" button\n * that opens a bottom-sheet of stacked controls. Measure once at the page level\n * (e.g. `useContainerNarrow`) and pass the same value here and to your table /\n * `TableCardList` switch so they reflow together. Default `false`.\n */\n narrow?: boolean;\n /** The filter controls (`<FilterSearch>`, `<FilterSelect>`, …) and optionally `<FilterChips>`. */\n children: ReactNode;\n /** Region `aria-label`, e.g. \"Filters\". */\n 'aria-label'?: string;\n className?: string;\n 'data-testid'?: string;\n}\n\ninterface BaseControlProps {\n /** Unique key — indexes into the values map and namespaces chip ids. */\n name: string;\n /** Pill / field label (consumer-translated). */\n label: string;\n className?: string;\n}\n\nexport interface FilterSearchProps extends BaseControlProps {\n placeholder?: string;\n /** Chip group label override; defaults to `label`. */\n chipGroup?: string;\n}\n\nexport interface FilterSelectProps extends BaseControlProps {\n options: FilterOption[];\n /** Label for the \"all / none\" radio. Defaults to \"All\". */\n allLabel?: string;\n}\n\nexport interface FilterMultiProps extends BaseControlProps {\n options: FilterOption[];\n}\n\nexport type FilterToggleProps = BaseControlProps;\n\nexport interface FilterWithinProps extends BaseControlProps {\n /** Ordered presets; `presets[0]` is the \"any time\" reset sentinel. */\n presets: FilterOption[];\n}\n\nexport interface FilterComboboxProps extends BaseControlProps {\n /** Current options. For API-backed search, update these in response to `onSearch`. */\n options: FilterOption[];\n /** Called (debounce in the consumer) as the user types — fetch + update `options`. */\n onSearch?: (query: string) => void;\n /** Show a loading state in the menu while options are being fetched. */\n isLoading?: boolean;\n placeholder?: string;\n}\n\nexport interface FilterChipsProps {\n /** Label for the \"Clear all\" control (shown when >1 chip). */\n clearAllLabel: string;\n /** Accessible-name builder for each chip's remove button, e.g. `(l) => \"Remove ${l}\"`. */\n removeChipLabel: (chipLabel: string) => string;\n /** Region `aria-label`, e.g. \"Active filters\". */\n 'aria-label'?: string;\n className?: string;\n 'data-testid'?: string;\n}\n\n// Standalone AppliedFilters (presentational chips, no Filters context needed)\nexport interface AppliedFiltersProps {\n chips: FilterChip[];\n onRemove: (chip: FilterChip) => void;\n onClearAll: () => void;\n clearAllLabel: string;\n removeChipLabel: (chipLabel: string) => string;\n /** Scroll chips horizontally instead of wrapping (mobile). Default `false`. */\n scrollable?: boolean;\n 'aria-label'?: string;\n className?: string;\n 'data-testid'?: string;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/utils/cn.ts","../../../src/styles/interaction-states.ts","../../../src/styles/shared-variants.ts","../../../src/elements/Button/Button.styles.ts","../../../src/elements/ButtonGroup/ButtonGroupContext.tsx","../../../src/elements/ButtonGroup/ButtonGroup.variants.ts","../../../src/elements/Button/Button.tsx","../../../src/elements/TextField/TextField.icons.tsx","../../../src/elements/TextField/TextField.styles.ts","../../../src/elements/TextField/TextField.hooks.ts","../../../src/elements/TextField/TextField.tsx","../../../src/elements/SearchField/SearchField.tsx","../../../src/utils/shouldAnimate.ts","../../../src/hooks/useReducedMotion.ts","../../../src/elements/Switch/Switch.tsx","../../../src/elements/RadioGroup/RadioGroup.tsx","../../../src/elements/CheckboxGroup/CheckboxGroup.tsx","../../../src/utils/browserExtensionOverlay.ts","../../../src/elements/Combobox/Combobox.styles.ts","../../../src/elements/Combobox/Combobox.tsx","../../../src/elements/Select/Select.styles.ts","../../../src/elements/Select/Select.tsx","../../../src/elements/Badge/Badge.tsx","../../../src/elements/Filters/Filters.styles.ts","../../../src/elements/Filters/FilterPopover.tsx","../../../src/elements/Filters/AppliedFilters.tsx","../../../src/elements/Filters/FiltersContext.tsx","../../../src/elements/Filters/Filters.tsx","../../../src/elements/Filters/Filters.types.ts"],"names":["cn","inputs","twMerge","clsx","FOCUS_STYLES","PRESSED_STYLES","HIGH_CONTRAST_FOCUS","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","DISABLED_STYLES","DEFAULT_INTERACTIONS","TEXT_SIZE_SMALL_SCALE","FIELD_HEIGHTS","FIELD_INPUT_SIZES","FIELD_TOUCH_TARGET","buttonOuterVariants","cva","buttonVisualVariants","ButtonGroupContext","createContext","useButtonGroupContext","useContext","ButtonGroupItemContext","useButtonGroupItemContext","buttonGroupItemVariants","Button","memo","forwardRef","className","buttonVisualClassName","variant","size","visualSize","fullWidth","loading","loadingText","shortcut","children","isDisabled","paywall","paywallRedirect","paywallDescription","onPress","props","ref","paywallDescriptionId","useId","groupContext","itemContext","effectiveVariant","effectiveSize","effectiveIsDisabled","isInVerticalGroup","effectiveFullWidth","positionClassName","effectiveVisualSize","jsx","AriaButton","e","renderProps","jsxs","Fragment","Loader2","Zap","EyeIcon","EyeOffIcon","inputVariants","labelVariants","descriptionVariants","errorMessageVariants","successMessageVariants","useExpandOnFocus","expandOnFocus","collapsedWidth","value","defaultValue","userOnFocus","userOnBlur","isFocused","setIsFocused","useState","handleFocus","useCallback","handleBlur","inputWidth","useMemo","useCopyPasteProtection","disableCopyPaste","isShaking","setIsShaking","screenReaderMessage","setScreenReaderMessage","useEffect","handlePaste","usePasswordToggle","type","showPasswordToggle","showPassword","setShowPassword","handlePasswordToggle","prev","actualType","TextFieldLabel","state","AriaLabel","TextFieldInput","AriaInput","TextFieldDescription","AriaText","TextFieldError","AriaFieldError","TextFieldSuccess","TextField","label","labelHint","description","errorMessage","successMessage","isRequired","isReadOnly","isInvalid","isValid","id","autoComplete","pattern","patternDescription","prefix","suffix","prefixSize","suffixSize","isIconHidden","onSubmit","onClear","errorId","generatedId","fieldId","isSearch","searchValue","setSearchValue","isControlledSearch","currentSearchValue","handleSearchChange","newValue","handleSearchClear","handleSearchKeyDown","inputState","labelState","combinedDescription","actualPrefix","Search","inputPadding","basePadding","prefixWidth","suffixWidth","actualSuffix","X","hasInteractiveSuffix","AriaTextField","SearchField","ariaLabel","ariaLabelledBy","shouldAnimate","animated","prefersReducedMotion","QUERY","getInitialState","useReducedMotion","setPrefersReducedMotion","mql","handler","event","cachedAnimate","loadMotionAnimate","m","DEFAULT_SPRING","switchOuterVariants","switchTrackVariants","switchThumbVariants","Switch","springConfig","onChangeProp","doAnimate","thumbRef","useRef","motionReady","animateRef","activeAnimation","fn","isCurrentlySelected","handleChange","isSelected","useMotionThumb","AriaSwitch","_classNameProps","RadioGroupContext","radioGroupVariants","radioItemVariants","radioIndicatorVariants","radioInnerDotVariants","RadioLabel","RadioDescription","RadioComponent","AriaRadio","Radio","RadioGroup","orientation","name","onChange","onFocusChange","ariaLabelledby","ariaDescribedby","dataTestId","restProps","radioGroupId","labelId","descriptionId","describedByParts","computedAriaDescribedBy","AriaRadioGroup","Label","Text","FieldError","CheckboxGroupContext","checkboxGroupVariants","checkboxItemVariants","checkboxIndicatorVariants","checkmarkVariants","CheckmarkIcon","CheckboxLabel","CheckboxDescription","CheckboxComponent","selectedIcon","groupDisabled","effectiveDisabled","renderSelectedIcon","iconClassName","dataSelected","isValidElement","iconElement","cloneElement","AriaCheckbox","Checkbox","dedupeWithWarning","values","componentName","uniqueValues","CheckboxGroup","checkboxGroupId","dedupedValue","dedupedDefaultValue","AriaCheckboxGroup","isExtensionInjectedElement","element","node","depth","tag","root","custom","parent","createInteractOutsideGuard","consumerShouldClose","comboboxVariants","comboboxLabelVariants","comboboxInputVariants","comboboxTriggerWrapperVariants","comboboxButtonVariants","comboboxPopoverVariants","comboboxListBoxVariants","comboboxItemVariants","comboboxDescriptionVariants","comboboxErrorVariants","Combobox","placeholder","allowsCustomValue","menuTrigger","defaultInputValue","inputValue","defaultSelectedKey","selectedKey","onInputChange","onSelectionChange","AriaComboBox","ChevronsUpDown","AriaPopover","AriaListBox","ComboboxItem","textValue","computedTextValue","AriaListBoxItem","Check","selectTriggerVariants","selectItemVariants","selectPopoverVariants","selectSectionVariants","selectErrorVariants","LOADING_SKELETON","_","i","SelectBase","ariaSelectProps","triggerContent","triggerRef","isLoading","emptyStateMessage","childCount","rootClassName","restAriaSelectProps","AriaSelect","ChevronDown","validationErrors","displayError","Popover","ListBox","ListBoxItem","SelectRoot","isOpen","disabledKeys","validate","validationBehavior","onOpenChange","Children","key","SelectValue","MultiSelectRoot","_selectionMode","valueToLabelMap","map","processChildren","nodes","child","SelectItem","itemValue","itemChildren","displayValue","v","keys","message","selectionMode","itemDisabled","CheckSquare","SelectSection","ListBoxSection","SelectHeader","Header","Select","badgeOuterVariants","badgeVisualVariants","iconSizeClasses","Badge","icon","iconPosition","count","visualClasses","multipleElements","renderContent","filtersBarVariants","filterPillVariants","filterPopoverVariants","filterPopoverHeaderVariants","appliedFiltersVariants","filterSheetBackdropVariants","filterSheetVariants","filterSheetHeaderVariants","filterSheetBodyVariants","filterSheetFooterVariants","filterSheetGrabVariants","filterChipVariants","FilterPopover","badge","isActive","doneLabel","align","hasBadge","DialogTrigger","Dialog","close","setRef","AppliedFilters","chips","onRemove","onClearAll","clearAllLabel","removeChipLabel","scrollable","forwardedRef","regionRef","FOCUSABLE","handleRemove","chip","index","region","current","buttons","FiltersContext","useFiltersContext","ctx","Filters","labels","narrow","registry","registryVersion","setRegistryVersion","valuesRef","setValue","replaceValues","next","syncControl","control","n","contextValue","activeCount","clearAll","sheetOpen","setSheetOpen","panelRef","backdropRef","closeSheet","onDown","target","onKey","childArray","isChips","c","FilterChips","chipsChildren","controlChildren","SlidersHorizontal","FocusScope","useControlRegistration","optionsSignature","options","o","optionLabel","FilterSearch","chipGroup","FilterToggle","selected","SELECT_ALL_SENTINEL","FilterSelect","allLabel","sig","option","FilterWithin","presets","sentinel","radios","extra","preset","FilterMulti","optionValue","checkboxes","FilterCombobox","onSearch","labelCache","list","FilterOptionSchema","z"],"mappings":"0rBAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,OAAAA,CAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCIO,IAAMG,EAAAA,CAAe,+GAAA,CAUfC,EAAAA,CAAiB,6BAAA,KA4BjBC,CAAAA,CAAsB,uJAAA,CAMtBC,EAAAA,CAAsB,4FAAA,CAMtBC,EAAAA,CAAwB,+HAAA,CAYxBC,EAAAA,CAAkB,kDAAA,CAWlBC,GAAuB,CAAA,EAAGN,EAAY,CAAA,CAAA,EAAIC,EAAc,CAAA,EAAA,EAAoBC,CAAmB,CAAA,CAAA,EAAIC,EAAmB,CAAA,CAAA,EAAIC,EAAqB,CAAA,CAAA,CCXrJ,IAAMG,EAAAA,CAAwB,CACnC,EAAA,CAAI,SAAA,CACJ,OAAA,CAAS,SAAA,CACT,EAAA,CAAI,WACN,CAAA,CAmCO,IAAMC,EAAAA,CAAgB,CAC3B,EAAA,CAAI,KAAA,CACJ,OAAA,CAAS,OACT,EAAA,CAAI,MACN,CAAA,CAQaC,CAAAA,CAAoB,CAC/B,EAAA,CAAI,CAAA,EAAGD,EAAAA,CA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AAOA,CAAAA,CAAE,MAAA,EAAO,CAChB,KAAA,CAAOA,CAAAA,CAAE,MAAA,EACX,CAAC","file":"index.mjs","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","/**\n * Shared CVA Variant Utilities\n *\n * Common patterns extracted from component variants for consistency and reduced bundle size.\n * Use these constants in CVA definitions to ensure consistent styling across Themis.\n *\n * @see interaction-states.ts for interaction-specific styles (focus, hover, pressed)\n */\n\n// =============================================================================\n// Focus Ring Patterns\n// =============================================================================\n\n/**\n * Focus-within ring (for container elements with focusable children)\n * Use when the container should show focus when any child is focused\n */\nexport const FOCUS_WITHIN_RING = [\n 'focus-within:outline-none',\n 'focus-within:ring-2',\n 'focus-within:ring-[var(--ring)]',\n 'focus-within:ring-offset-2',\n] as const;\n\n/**\n * Focus-visible ring (for directly focusable elements)\n * Use for buttons, inputs, and other interactive elements\n */\nexport const FOCUS_VISIBLE_RING = [\n 'focus-visible:outline-none',\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n] as const;\n\n/**\n * Standard focus ring (for elements using :focus pseudo-class)\n * Prefer focus-visible when possible for better UX\n */\nexport const FOCUS_RING = [\n 'focus:outline-none',\n 'focus:ring-2',\n 'focus:ring-[var(--ring)]',\n] as const;\n\n/**\n * Focus with background change (for segments, cells, menu items)\n */\nexport const FOCUS_HIGHLIGHT = [\n 'focus:outline-none',\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Disabled State Patterns\n// =============================================================================\n\n/**\n * Standard disabled state using disabled attribute\n */\nexport const DISABLED_STANDARD = [\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n] as const;\n\n/**\n * Disabled state using data attribute (React Aria pattern)\n */\nexport const DISABLED_DATA_ATTR = [\n 'data-[disabled]:pointer-events-none',\n 'data-[disabled]:opacity-50',\n 'data-[disabled]:cursor-not-allowed',\n] as const;\n\n// =============================================================================\n// Size-Based Text Variants\n// =============================================================================\n\n/**\n * Small text size scale (xs -> sm -> base)\n */\nexport const TEXT_SIZE_SMALL_SCALE = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n} as const;\n\n/**\n * Medium text size scale (sm -> base -> lg)\n */\nexport const TEXT_SIZE_MEDIUM_SCALE = {\n sm: 'text-sm',\n default: 'text-base',\n lg: 'text-lg',\n} as const;\n\n// =============================================================================\n// Touch Target Utilities\n// =============================================================================\n\n/**\n * WCAG 2.2 AAA minimum touch target (44x44px)\n */\nexport const TOUCH_TARGET_MIN = [\n 'min-h-[44px]',\n 'min-w-[44px]',\n] as const;\n\n/**\n * Common button/cell sizes with touch target compliance\n */\nexport const INTERACTIVE_SIZES = {\n sm: 'h-9 w-9', // 36px - desktop only, NOT AAA compliant\n default: 'h-11 w-11', // 44px - AAA compliant\n lg: 'h-14 w-14', // 56px - AAA compliant, enhanced\n} as const;\n\n/**\n * Height-only sizes for fields and inputs\n */\nexport const FIELD_HEIGHTS = {\n sm: 'h-9', // 36px\n default: 'h-10', // 40px\n lg: 'h-11', // 44px\n} as const;\n\n/**\n * Layer 2: Visual sizing for form field inputs (height + padding + font).\n * Use on the <input>, <select>, or trigger element itself.\n *\n * Components may append additional classes (e.g. gap-* for segmented fields, py-* for text inputs).\n */\nexport const FIELD_INPUT_SIZES = {\n sm: `${FIELD_HEIGHTS.sm} px-2 text-xs`,\n default: `${FIELD_HEIGHTS.default} px-3 text-sm`,\n lg: `${FIELD_HEIGHTS.lg} px-4 text-base`,\n} as const;\n\n/**\n * Layer 1: Invisible touch target wrapper for form fields.\n * Apply to a <label> (or wrapper div) around the input element.\n * The <label> natively routes clicks/taps to the contained input\n * without JavaScript — achieving a 44px touch target while the\n * input stays at its visual height (h-9/h-10/h-11).\n */\nexport const FIELD_TOUCH_TARGET = 'min-h-[44px] flex items-center' as const;\n\n// =============================================================================\n// Message/Feedback Patterns\n// =============================================================================\n\n/**\n * Error message styling\n */\nexport const ERROR_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--destructive-background)]',\n] as const;\n\n/**\n * Success message styling\n */\nexport const SUCCESS_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--success-background)]',\n] as const;\n\n/**\n * Description/helper text styling\n */\nexport const DESCRIPTION_BASE = [\n 'text-[var(--menu-muted)]',\n] as const;\n\n/**\n * Label base styling\n */\nexport const LABEL_BASE = [\n 'font-medium',\n 'text-[var(--content-foreground)]',\n] as const;\n\n/**\n * Required indicator pattern\n */\nexport const REQUIRED_INDICATOR = \"after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]\";\n\n// =============================================================================\n// Animation Patterns\n// =============================================================================\n\n/**\n * Popover/dropdown entry animation\n */\nexport const POPOVER_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n] as const;\n\n/**\n * Popover/dropdown exit animation\n */\nexport const POPOVER_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n] as const;\n\n/**\n * Modal content enter animation (fade + zoom)\n * Uses React Aria data-[entering]/data-[exiting] attributes\n */\nexport const MODAL_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\n/**\n * Modal content exit animation (fade + zoom)\n * Uses React Aria data-[entering]/data-[exiting] attributes\n */\nexport const MODAL_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Modal slide enter animation (fade + slide up)\n */\nexport const MODAL_SLIDE_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:slide-in-from-bottom-4',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\n/**\n * Modal slide exit animation (fade + slide down)\n */\nexport const MODAL_SLIDE_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:slide-out-to-bottom-4',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Directional slide animations for edge-anchored drawers (Modal `position` variant).\n *\n * Unitless `slide-in-from-*` / `slide-out-to-*` translate the full extent of the\n * element (100%), so the drawer slides all the way in from / out to its anchored\n * edge — distinct from `MODAL_SLIDE_*` above, which is the small 1rem nudge used by\n * the centred `slide` animation. No `fade` is paired here: a drawer slides, it\n * does not fade. Honour `prefers-reduced-motion` via REDUCED_MOTION on the element.\n */\nexport const MODAL_SLIDE_IN_LEFT = [\n 'data-[entering]:animate-in',\n 'data-[entering]:slide-in-from-left',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\nexport const MODAL_SLIDE_OUT_LEFT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:slide-out-to-left',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\nexport const MODAL_SLIDE_IN_RIGHT = [\n 'data-[entering]:animate-in',\n 'data-[entering]:slide-in-from-right',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\nexport const MODAL_SLIDE_OUT_RIGHT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:slide-out-to-right',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\nexport const MODAL_SLIDE_IN_TOP = [\n 'data-[entering]:animate-in',\n 'data-[entering]:slide-in-from-top',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\nexport const MODAL_SLIDE_OUT_TOP = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:slide-out-to-top',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\nexport const MODAL_SLIDE_IN_BOTTOM = [\n 'data-[entering]:animate-in',\n 'data-[entering]:slide-in-from-bottom',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\nexport const MODAL_SLIDE_OUT_BOTTOM = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:slide-out-to-bottom',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Modal overlay enter/exit animation (fade only)\n */\nexport const MODAL_OVERLAY_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:duration-200',\n] as const;\n\nexport const MODAL_OVERLAY_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:duration-150',\n] as const;\n\n/**\n * Reduced motion support (WCAG 2.2)\n */\nexport const REDUCED_MOTION = [\n 'motion-reduce:transition-none',\n 'motion-reduce:animate-none',\n] as const;\n\n/**\n * Standard transition for colors\n */\nexport const TRANSITION_COLORS = [\n 'transition-colors',\n 'duration-200',\n] as const;\n\n/**\n * Fast transition for interactions\n */\nexport const TRANSITION_FAST = [\n 'transition-colors',\n 'duration-150',\n] as const;\n\n// =============================================================================\n// Hover State Patterns\n// =============================================================================\n\n/**\n * Accent background on hover (for interactive items)\n */\nexport const HOVER_ACCENT = [\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Helper Functions\n// =============================================================================\n\n/**\n * Combines multiple style arrays into a flat array for CVA base styles\n */\nexport function combineStyles(...styles: (readonly string[] | string)[]): string[] {\n return styles.flatMap(s => Array.isArray(s) ? [...s] : [s]);\n}\n","import { cva } from 'class-variance-authority';\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * Handles WCAG 2.2 AAA touch target requirement\n * Always transparent, centers the visual button inside\n * IMPORTANT: Focus ring stays on Layer 1 for AAA compliance (2.4.13)\n *\n * In vertical ButtonGroups, uses items-stretch so the visual layer (Layer 2)\n * can fill the full touch target height, eliminating gaps between buttons.\n */\nexport const buttonOuterVariants = cva(\n \"inline-flex justify-center min-h-[44px] min-w-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n inVerticalGroup: {\n true: \"items-stretch\",\n false: \"items-center\",\n },\n },\n defaultVariants: {\n fullWidth: false,\n inVerticalGroup: false,\n },\n }\n);\n\n/**\n * Layer 2: Visual button appearance (adjustable size)\n * Provides the visual appearance with configurable size\n * Can be smaller than touch target for use cases like carousel dots\n * NOTE: NO focus-visible styles here - focus ring is on Layer 1\n */\nexport const buttonVisualVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-normal ring-offset-background motion-safe:transition-transform motion-safe:duration-200 motion-safe:[transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer\",\n {\n variants: {\n variant: {\n default:\n \"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] hover:-translate-y-1\",\n destructive:\n \"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] hover:bg-[var(--destructive-background-hover,var(--destructive-background))] motion-safe:hover:btn-warn-shake\",\n outline:\n \"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)]\",\n secondary:\n \"bg-[var(--secondary)] text-[var(--secondary-foreground)] hover:bg-[var(--secondary-hover,var(--secondary))]\",\n ghost:\n \"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]\",\n link: \"text-[var(--text-link)] underline underline-offset-4 hover:bg-[var(--accent)] hover:text-[var(--text-link-hover)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n visualSize: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3 text-xs\",\n lg: \"h-11 rounded-md px-6 text-base\",\n icon: \"h-10 w-10\",\n dot: \"h-5 w-5 rounded-full p-0 min-h-0 min-w-0\",\n },\n paywall: {\n true: \"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n visualSize: \"default\",\n paywall: false,\n },\n }\n);\n\n/**\n * @deprecated Use buttonVisualVariants instead. This alias is kept for backward compatibility.\n */\nexport const buttonVariants = buttonVisualVariants;\n","\"use client\";\n\nimport { createContext, useContext } from 'react';\nimport type {\n ButtonGroupContextValue,\n ButtonGroupItemContextValue,\n} from './ButtonGroup.types';\n\n/**\n * ButtonGroup Context System (Two-Level)\n *\n * Provides a two-level context pattern for ButtonGroup:\n *\n * 1. ButtonGroupContext (group-level):\n * - Provides: orientation, variant, size, isDisabled\n * - Consumed by: Button (for prop inheritance), Separator (for orientation)\n *\n * 2. ButtonGroupItemContext (item-level):\n * - Provides: position ('first' | 'middle' | 'last' | 'only')\n * - Consumed by: Button (for border-radius styling)\n *\n * Both contexts return null when not in a provider, allowing Button\n * to work standalone without any group context.\n *\n * @see plan.md for architecture details\n * @see ButtonGroup.tsx for Provider implementation\n */\n\n// =============================================================================\n// Group-Level Context\n// =============================================================================\n\n/**\n * Context for group-level props (orientation, variant, size, isDisabled)\n * Default value is null to indicate \"not in a group\"\n */\nconst ButtonGroupContext = createContext<ButtonGroupContextValue | null>(null);\n\nButtonGroupContext.displayName = 'ButtonGroupContext';\n\n/**\n * Hook to access group-level context\n * @returns ButtonGroupContextValue if inside a ButtonGroup, null otherwise\n */\nexport function useButtonGroupContext(): ButtonGroupContextValue | null {\n return useContext(ButtonGroupContext);\n}\n\n// =============================================================================\n// Item-Level Context\n// =============================================================================\n\n/**\n * Context for per-button position information\n * Default value is null to indicate \"not wrapped with position context\"\n */\nconst ButtonGroupItemContext =\n createContext<ButtonGroupItemContextValue | null>(null);\n\nButtonGroupItemContext.displayName = 'ButtonGroupItemContext';\n\n/**\n * Hook to access item-level context (position)\n * @returns ButtonGroupItemContextValue if wrapped with position context, null otherwise\n */\nexport function useButtonGroupItemContext(): ButtonGroupItemContextValue | null {\n return useContext(ButtonGroupItemContext);\n}\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroupContext, ButtonGroupItemContext };\n","import { cva } from 'class-variance-authority';\n\n/**\n * ButtonGroup CVA Variants\n *\n * Defines Class Variance Authority (CVA) variants for:\n * - ButtonGroup container (orientation-based layout)\n * - ButtonGroupItem (position-based border-radius)\n * - ButtonGroupSeparator (orientation-based styling)\n *\n * @see plan.md Phase 1: Design & Contracts - CVA Variants\n * @see constitution.md Principle V (Component Quality Standards)\n */\n\n// =============================================================================\n// Container Variants\n// =============================================================================\n\n/**\n * ButtonGroup container variants\n * Controls the layout direction based on orientation\n * Uses gap-0 to ensure buttons are connected (share borders)\n */\nexport const buttonGroupVariants = cva('inline-flex items-center gap-0', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col w-full',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// =============================================================================\n// Item Position Variants\n// =============================================================================\n\n/**\n * ButtonGroupItem position variants\n * Applied to Button's visual layer (Layer 2) for position-aware border-radius\n *\n * Compound variants handle both orientation and position combinations:\n * - Horizontal: left/right borders and radii\n * - Vertical: top/bottom borders and radii\n */\nexport const buttonGroupItemVariants = cva('', {\n variants: {\n orientation: {\n // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)\n horizontal: 'min-w-[44px]',\n // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,\n // eliminating gaps between stacked buttons in vertical orientation\n vertical: 'flex min-h-[44px]',\n },\n position: {\n first: '',\n middle: '',\n last: '',\n only: '', // Single button - no modifications needed\n },\n },\n compoundVariants: [\n // ==========================================================================\n // Horizontal Orientation\n // ==========================================================================\n {\n orientation: 'horizontal',\n position: 'first',\n className: 'rounded-r-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'middle',\n className: 'rounded-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'last',\n className: 'rounded-l-none',\n },\n // ==========================================================================\n // Vertical Orientation\n // Note: w-full is handled by Button's effectiveFullWidth for both layers\n // ==========================================================================\n {\n orientation: 'vertical',\n position: 'first',\n className: 'rounded-b-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'middle',\n className: 'rounded-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'last',\n className: 'rounded-t-none',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n position: 'only',\n },\n});\n\n// =============================================================================\n// Separator Variants\n// =============================================================================\n\n/**\n * ButtonGroupSeparator variants\n * Orientation-aware visual divider between button groups\n */\nexport const buttonGroupSeparatorVariants = cva('bg-[var(--border)]', {\n variants: {\n orientation: {\n horizontal: 'w-px h-6 mx-1',\n vertical: 'h-px w-full my-1',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n","\"use client\";\n\n/**\n * Button Component - 3-Layer Architecture\n * Accessible button with React Aria primitives and CVA styling\n *\n * Architecture:\n * - Layer 1: Touch Target (44x44px WCAG AAA compliant, transparent)\n * - Layer 2: Visual Button (configurable size, colors, borders)\n * - Layer 3: Content & Effects (text, icons, ripple, loading spinner)\n *\n * @see 3layer-plan.md for architecture details\n * @see spec.md FR-029 to FR-037 (Button Component Requirements)\n * @see spec.md FR-009 (WCAG 2.2 AAA - 7:1 contrast ratio)\n * @see spec.md FR-014 (44x44px minimum touch targets)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, useId } from 'react';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { Loader2, Zap } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { ButtonProps } from './Button.types';\nimport { buttonOuterVariants, buttonVisualVariants, buttonVariants } from './Button.styles';\nimport { PRESSED_STYLES, HOVER_STYLES, HIGH_CONTRAST_HOVER, HIGH_CONTRAST_PRESSED } from '../../styles/interaction-states';\nimport {\n useButtonGroupContext,\n useButtonGroupItemContext,\n} from '../ButtonGroup/ButtonGroupContext';\nimport { buttonGroupItemVariants } from '../ButtonGroup/ButtonGroup.variants';\n\n/**\n * Button Component - 3-Layer Architecture\n * Fully accessible button with React Aria and themed styling\n *\n * Layer 1: Touch Target (AriaButton) - 44x44px WCAG AAA compliant\n * Layer 2: Visual Button (span) - configurable appearance\n * Layer 3: Content (children) - text, icons, effects\n */\nconst Button = memo(forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n buttonVisualClassName,\n variant,\n size,\n visualSize,\n fullWidth,\n loading = false,\n loadingText = \"Loading...\",\n shortcut,\n children,\n isDisabled,\n paywall = false,\n paywallRedirect,\n paywallDescription,\n onPress,\n ...props\n },\n ref\n ) => {\n const paywallDescriptionId = useId();\n\n // ==========================================================================\n // ButtonGroup Context Integration\n // ==========================================================================\n\n // Consume group-level context (variant, size, isDisabled, orientation)\n const groupContext = useButtonGroupContext();\n\n // Consume item-level context (position for border-radius styling)\n const itemContext = useButtonGroupItemContext();\n\n // Merge context values with props (props take precedence)\n const effectiveVariant = variant ?? groupContext?.variant ?? 'default';\n const effectiveSize = size ?? groupContext?.size;\n const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;\n\n // In vertical groups, buttons should be full width automatically\n const isInVerticalGroup = groupContext?.orientation === 'vertical';\n const effectiveFullWidth = fullWidth || isInVerticalGroup;\n\n // Position styling for ButtonGroup (only applied when in a group)\n const positionClassName = itemContext\n ? buttonGroupItemVariants({\n orientation: groupContext?.orientation ?? 'horizontal',\n position: itemContext.position,\n })\n : '';\n\n // Default visualSize to size for backward compatibility\n const effectiveVisualSize = visualSize ?? effectiveSize ?? 'default';\n\n // AAA Accessibility: Warn in dev/test if icon/dot variant lacks accessible name\n if (process.env.NODE_ENV !== 'production') {\n if (\n (effectiveVisualSize === 'dot' || effectiveVisualSize === 'icon') &&\n !props['aria-label'] &&\n !children\n ) {\n console.warn(\n '[Button] visualSize=\"dot\" or \"icon\" requires aria-label when no visible text is provided (WCAG 1.1.1)'\n );\n }\n }\n\n /**\n * Handle button press - intercepts action when paywalled\n * If paywalled with redirect URL, opens in new tab\n * Otherwise, calls the normal onPress handler\n */\n const handlePress = (e: Parameters<NonNullable<AriaButtonProps['onPress']>>[0]): void => {\n if (paywall) {\n if (paywallRedirect) {\n window.open(paywallRedirect, '_blank', 'noopener,noreferrer');\n }\n // Don't call onPress when paywalled\n return;\n }\n onPress?.(e);\n };\n\n // Only set isDisabled when we have a reason to disable\n // Otherwise, let slot system control disabled state (e.g., in NumberField)\n const computedIsDisabled = effectiveIsDisabled || loading || undefined;\n\n return (\n <AriaButton\n ref={ref}\n isDisabled={computedIsDisabled}\n aria-disabled={paywall ? true : undefined}\n aria-describedby={paywall ? paywallDescriptionId : undefined}\n onPress={handlePress}\n className={cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className)}\n {...props}\n >\n {(renderProps) => (\n /* Layer 2: Visual Button */\n <span\n className={cn(\n buttonVisualVariants({\n variant: effectiveVariant,\n visualSize: effectiveVisualSize,\n paywall,\n fullWidth: effectiveFullWidth,\n }),\n // Position styling from ButtonGroup context (border-radius adjustments)\n positionClassName,\n buttonVisualClassName,\n // Layer 2 interaction styles (no focus - focus ring is on Layer 1)\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED\n )}\n data-pressed={renderProps.isPressed || undefined}\n >\n {/* Layer 3: Content & Effects */}\n\n {/* FR-033: Loading spinner with screen reader announcement */}\n {/* Uses motion-safe: for WCAG 2.3.3 AAA (Animation from Interactions) */}\n {loading && (\n <>\n <Loader2 className=\"motion-safe:animate-spin\" aria-hidden=\"true\" />\n <span className=\"sr-only\" aria-live=\"polite\">\n {loadingText}\n </span>\n </>\n )}\n\n {/* Hide children during loading */}\n {!loading && children}\n\n {/* Paywall: Lightning bolt icon */}\n {paywall && (\n <Zap\n data-testid=\"zap-icon\"\n aria-hidden=\"true\"\n className=\"ml-1\"\n />\n )}\n\n {/* Paywall: Screen reader description */}\n {paywall && (\n <span id={paywallDescriptionId} className=\"sr-only\">\n Premium feature: {paywallDescription || \"Upgrade required to access this feature\"}\n </span>\n )}\n\n {/* FR-034: Keyboard shortcut display on focus */}\n {renderProps.isFocusVisible && shortcut && (\n <kbd className=\"ml-auto hidden text-xs opacity-60 lg:inline\">\n {shortcut}\n </kbd>\n )}\n\n </span>\n )}\n </AriaButton>\n );\n }\n));\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants, buttonOuterVariants, buttonVisualVariants };\nexport type { ButtonProps } from './Button.types';\n","/**\n * TextField Icon Components\n * SVG icons for password toggle functionality\n *\n * Extracted from TextField.tsx to keep the main component file focused.\n * These are module-level components to avoid re-creating on every render.\n */\n\nimport type { ReactElement } from 'react';\n\n/**\n * Eye icon for \"show password\" state\n * Rendered when the password is currently hidden\n */\nexport const EyeIcon = (): ReactElement => (\n <svg\n data-testid=\"password-toggle-icon-show\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M1 8s3-5 7-5 7 5 7 5-3 5-7 5-7-5-7-5z\" />\n <circle cx=\"8\" cy=\"8\" r=\"2\" />\n </svg>\n);\n\n/**\n * Eye-off icon for \"hide password\" state\n * Rendered when the password is currently visible\n */\nexport const EyeOffIcon = (): ReactElement => (\n <svg\n data-testid=\"password-toggle-icon-hide\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10.5 5.5l-5 5\" />\n <path d=\"M1 8s3-5 7-5c1.5 0 2.8.6 4 1.5M15 8s-1.5 2.5-4 4\" />\n <path d=\"M3 13l2-2m7-7l2-2\" />\n <circle cx=\"8\" cy=\"8\" r=\"2\" />\n </svg>\n);\n","/**\n * TextField CVA Variant Styles\n * Extracted from TextField.tsx for separation of concerns\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements - WCAG 2.2 AAA)\n * @see React Aria TextField: https://react-spectrum.adobe.com/react-aria/TextField.html\n * @see ShadCN Input: https://ui.shadcn.com/docs/components/input\n * @see ShadCN Label: https://ui.shadcn.com/docs/components/label\n */\n\nimport { cva } from 'class-variance-authority';\nimport { FIELD_INPUT_SIZES } from '../../styles';\n\n/**\n * Input variant styles using CVA\n * Adapts ShadCN Input styling with Themis semantic tokens\n */\nexport const inputVariants = cva(\n // Base styles - FR-014: Proper input styling with focus states\n \"flex w-full rounded-md border bg-[var(--content-background)] px-3 py-2 text-sm ring-offset-[var(--content-background)] file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-[var(--content-foreground)] placeholder:text-[var(--menu-muted)] transition-all duration-200\",\n {\n variants: {\n // Size variants (matching Button sizes)\n size: {\n sm: `${FIELD_INPUT_SIZES.sm} py-1`,\n default: `${FIELD_INPUT_SIZES.default} py-2`,\n lg: `${FIELD_INPUT_SIZES.lg} py-3`,\n },\n // State variants\n state: {\n default: \"border-[var(--input-border)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2\",\n error: \"border-[var(--destructive-background)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--destructive-background)] focus-visible:ring-offset-2\",\n success: \"border-[var(--success-background)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--success-ring)] focus-visible:ring-offset-2\",\n disabled: \"cursor-not-allowed opacity-50\",\n readonly: \"cursor-default bg-[var(--content-background)] opacity-70\"\n }\n },\n defaultVariants: {\n size: \"default\",\n state: \"default\"\n }\n }\n);\n\n/**\n * Label variant styles using CVA\n * Adapts ShadCN Label styling with Themis semantic tokens\n */\nexport const labelVariants = cva(\n // Base styles - FR-009: WCAG 2.2 AAA compliance\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n {\n variants: {\n // Labels stay the default content colour even when the field is\n // invalid — the destructive asterisk and the inline error message\n // already convey the error. Only `disabled` carries a distinct style.\n state: {\n default: \"text-[var(--content-foreground)]\",\n disabled: \"opacity-50 cursor-not-allowed\"\n }\n },\n defaultVariants: {\n state: \"default\"\n }\n }\n);\n\n/**\n * Description text variant styles\n */\nexport const descriptionVariants = cva(\n \"text-sm text-[var(--content-foreground)]\"\n);\n\n/**\n * Error message variant styles\n *\n * No mt-* margin: the parent AriaTextField wrapper supplies a `gap-1.5` (6px)\n * flex gap between children, which satisfies the input → hint/error spacing.\n */\nexport const errorMessageVariants = cva(\n \"text-sm text-[var(--destructive-background)] font-medium\"\n);\n\n/**\n * Success message variant styles\n *\n * No mt-* margin: the parent AriaTextField wrapper supplies a `gap-1.5` (6px)\n * flex gap between children, which satisfies the input → hint/error spacing.\n */\nexport const successMessageVariants = cva(\n \"text-sm text-[var(--success-foreground)] font-medium\"\n);\n","/**\n * TextField Custom Hooks\n * Extracted from TextField.tsx for separation of concerns\n *\n * These hooks encapsulate the behavioral logic for:\n * - Expand on focus\n * - Copy/paste protection\n * - Password visibility toggle\n */\n\nimport { useState, useEffect, useCallback, useMemo } from 'react';\nimport type { FocusEvent, ClipboardEvent } from 'react';\n\n/**\n * Hook: useExpandOnFocus\n * Manages the expand-on-focus behavior where an input starts narrow\n * and expands to full width when focused or when it has a value.\n *\n * @param expandOnFocus - Whether expand-on-focus is enabled\n * @param collapsedWidth - CSS width when collapsed (e.g., '200px')\n * @param value - Controlled value (if any)\n * @param defaultValue - Default value (if any)\n * @param userOnFocus - User-provided onFocus handler to call through\n * @param userOnBlur - User-provided onBlur handler to call through\n */\nexport function useExpandOnFocus({\n expandOnFocus,\n collapsedWidth,\n value,\n defaultValue,\n userOnFocus,\n userOnBlur,\n}: {\n expandOnFocus: boolean;\n collapsedWidth: string;\n value: string | undefined;\n defaultValue: string | undefined;\n userOnFocus: ((e: FocusEvent<HTMLInputElement>) => void) | undefined;\n userOnBlur: ((e: FocusEvent<HTMLInputElement>) => void) | undefined;\n}) {\n const [isFocused, setIsFocused] = useState(false);\n\n const handleFocus = useCallback((e: FocusEvent<HTMLInputElement>) => {\n if (expandOnFocus) {\n setIsFocused(true);\n }\n userOnFocus?.(e);\n }, [expandOnFocus, userOnFocus]);\n\n const handleBlur = useCallback((e: FocusEvent<HTMLInputElement>) => {\n if (expandOnFocus) {\n const isEmpty = e.target.value === '';\n if (isEmpty) {\n setIsFocused(false);\n }\n }\n userOnBlur?.(e);\n }, [expandOnFocus, userOnBlur]);\n\n const inputWidth = useMemo(() => {\n if (!expandOnFocus) return undefined;\n\n const hasValue = value !== undefined ? value !== '' : defaultValue !== undefined && defaultValue !== '';\n\n if (isFocused || hasValue) {\n return '100%';\n }\n\n return collapsedWidth;\n }, [expandOnFocus, isFocused, value, defaultValue, collapsedWidth]);\n\n return { handleFocus, handleBlur, inputWidth };\n}\n\n/**\n * Hook: useCopyPasteProtection\n * Manages copy/paste prevention with shake animation and screen reader announcements.\n *\n * @param disableCopyPaste - Whether copy/paste should be disabled\n */\nexport function useCopyPasteProtection({\n disableCopyPaste,\n}: {\n disableCopyPaste: boolean;\n}) {\n const [isShaking, setIsShaking] = useState(false);\n const [screenReaderMessage, setScreenReaderMessage] = useState('');\n\n // Development mode warning for disableCopyPaste\n useEffect(() => {\n if (disableCopyPaste && typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {\n console.warn(\n '[TextField] Copy/paste prevention should only be used for security-critical fields like password confirmation. ' +\n 'This feature can break assistive technology workflows and password managers.'\n );\n }\n }, [disableCopyPaste]);\n\n const handlePaste = useCallback((e: ClipboardEvent<HTMLInputElement>) => {\n if (disableCopyPaste) {\n e.preventDefault();\n\n // Trigger shake animation\n setIsShaking(true);\n\n // Announce to screen readers\n setScreenReaderMessage('Pasting is not allowed in this field. Please type your entry.');\n\n // Remove shake animation and clear message after 250ms\n setTimeout(() => {\n setIsShaking(false);\n setScreenReaderMessage('');\n }, 250);\n }\n }, [disableCopyPaste]);\n\n return { isShaking, screenReaderMessage, handlePaste };\n}\n\n/**\n * Hook: usePasswordToggle\n * Manages password show/hide toggle state and determines the actual input type.\n *\n * @param type - The input type ('text', 'email', 'password', etc.)\n * @param showPasswordToggle - Whether the toggle button should be shown\n */\nexport function usePasswordToggle({\n type,\n showPasswordToggle,\n}: {\n type: string;\n showPasswordToggle: boolean | undefined;\n}) {\n const [showPassword, setShowPassword] = useState(false);\n\n const handlePasswordToggle = useCallback(() => {\n setShowPassword(prev => !prev);\n }, []);\n\n const actualType = useMemo(() => {\n if (type === 'password' && showPasswordToggle && showPassword) {\n return 'text';\n }\n return type;\n }, [type, showPasswordToggle, showPassword]);\n\n return { showPassword, actualType, handlePasswordToggle };\n}\n","\"use client\";\n\n/**\n * TextField Component\n * Accessible text input with React Aria primitives and CVA styling\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements - WCAG 2.2 AAA)\n * @see React Aria TextField: https://react-spectrum.adobe.com/react-aria/TextField.html\n * @see ShadCN Input: https://ui.shadcn.com/docs/components/input\n * @see ShadCN Label: https://ui.shadcn.com/docs/components/label\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport './TextField.css';\nimport { forwardRef, useId, useMemo, useState, useCallback } from 'react';\nimport {\n TextField as AriaTextField,\n Label as AriaLabel,\n Input as AriaInput,\n Text as AriaText,\n FieldError as AriaFieldError,\n} from 'react-aria-components';\nimport { cn } from '../../utils/cn';\nimport { DISABLED_STYLES } from '../../styles/interaction-states';\nimport { FIELD_TOUCH_TARGET } from '../../styles';\nimport type {\n TextFieldProps,\n TextFieldLabelProps,\n TextFieldInputProps,\n TextFieldDescriptionProps,\n TextFieldErrorProps,\n} from './TextField.types';\nimport { Search, X } from 'lucide-react';\nimport { Button } from '../Button';\nimport { EyeIcon, EyeOffIcon } from './TextField.icons';\nimport {\n inputVariants,\n labelVariants,\n descriptionVariants,\n errorMessageVariants,\n successMessageVariants,\n} from './TextField.styles';\nimport { useExpandOnFocus, useCopyPasteProtection, usePasswordToggle } from './TextField.hooks';\n\n// Re-export CVA variants so existing imports from './TextField' continue to work\nexport {\n inputVariants,\n labelVariants,\n descriptionVariants,\n errorMessageVariants,\n successMessageVariants,\n};\n\n/**\n * TextFieldLabel Sub-component\n * Styled label with optional required indicator\n */\nexport const TextFieldLabel = forwardRef<HTMLLabelElement, TextFieldLabelProps>(\n ({ className, state = 'default', children, ...props }, ref) => {\n return (\n <AriaLabel\n ref={ref}\n className={cn(labelVariants({ state }), className)}\n {...props}\n >\n {children}\n </AriaLabel>\n );\n }\n);\n\nTextFieldLabel.displayName = \"TextFieldLabel\";\n\n/**\n * TextFieldInput Sub-component\n * Styled input with size and state variants\n */\nexport const TextFieldInput = forwardRef<HTMLInputElement, TextFieldInputProps>(\n ({ className, size = 'default', state = 'default', ...props }, ref) => {\n return (\n <AriaInput\n ref={ref}\n className={cn(inputVariants({ size, state }), DISABLED_STYLES, className)}\n {...props}\n />\n );\n }\n);\n\nTextFieldInput.displayName = \"TextFieldInput\";\n\n/**\n * TextFieldDescription Sub-component\n * Helper text displayed below the input\n */\nexport const TextFieldDescription = forwardRef<HTMLDivElement, TextFieldDescriptionProps>(\n ({ className, children, ...props }, ref) => {\n return (\n <AriaText\n ref={ref}\n slot=\"description\"\n className={cn(descriptionVariants(), className)}\n {...props}\n >\n {children}\n </AriaText>\n );\n }\n);\n\nTextFieldDescription.displayName = \"TextFieldDescription\";\n\n/**\n * TextFieldError Sub-component\n * Error message displayed when field is invalid\n * Note: We use AriaFieldError with explicit role=\"alert\" for screen reader announcements\n */\nexport const TextFieldError = forwardRef<HTMLDivElement, TextFieldErrorProps>(\n ({ className, children, ...props }, ref) => {\n // AriaFieldError already wires aria-describedby/aria-invalid back to the\n // parent field so screen readers announce the error — no explicit\n // role=\"alert\" needed.\n return (\n <AriaFieldError\n ref={ref}\n {...props}\n className={cn(errorMessageVariants(), className)}\n >\n {children}\n </AriaFieldError>\n );\n }\n);\n\nTextFieldError.displayName = \"TextFieldError\";\n\n/**\n * TextFieldSuccess Sub-component\n * Success message displayed when field is valid\n */\nexport const TextFieldSuccess = forwardRef<HTMLDivElement, TextFieldDescriptionProps>(\n ({ className, children, ...props }, ref) => {\n return (\n <AriaText\n ref={ref}\n slot=\"description\"\n className={cn(successMessageVariants(), className)}\n {...props}\n >\n {children}\n </AriaText>\n );\n }\n);\n\nTextFieldSuccess.displayName = \"TextFieldSuccess\";\n\n/**\n * TextField Component\n * Fully accessible text input with React Aria and themed styling\n *\n * @example\n * <TextField\n * label=\"Email\"\n * description=\"We'll never share your email\"\n * isRequired\n * type=\"email\"\n * />\n */\nexport const TextField = forwardRef<HTMLDivElement, TextFieldProps>(\n (\n {\n className,\n size = 'default',\n label,\n labelHint,\n description,\n errorMessage,\n successMessage,\n type = 'text',\n isRequired = false,\n isReadOnly = false,\n isDisabled = false,\n isInvalid = false,\n isValid = false,\n id,\n autoComplete,\n disableCopyPaste = false,\n pattern,\n patternDescription,\n expandOnFocus = false,\n collapsedWidth = '200px',\n prefix,\n suffix,\n prefixSize = 16,\n suffixSize = 16,\n showPasswordToggle,\n isIconHidden = false,\n onSubmit,\n onClear,\n value,\n defaultValue,\n onFocus: userOnFocus,\n onBlur: userOnBlur,\n ...props\n },\n ref\n ) => {\n // Generate unique IDs for error message linking\n const errorId = useId();\n const generatedId = useId();\n const fieldId = id || generatedId;\n\n // Custom hooks for behavioral logic\n const { handleFocus, handleBlur, inputWidth } = useExpandOnFocus({\n expandOnFocus,\n collapsedWidth,\n value,\n defaultValue,\n userOnFocus,\n userOnBlur,\n });\n\n const { isShaking, screenReaderMessage, handlePaste } = useCopyPasteProtection({\n disableCopyPaste,\n });\n\n const { showPassword, actualType, handlePasswordToggle } = usePasswordToggle({\n type,\n showPasswordToggle,\n });\n\n // ==========================================================================\n // Search functionality (type=\"search\")\n // ==========================================================================\n const isSearch = type === 'search';\n const [searchValue, setSearchValue] = useState(defaultValue ?? '');\n const isControlledSearch = value !== undefined;\n const currentSearchValue = isControlledSearch ? value : searchValue;\n\n const handleSearchChange = useCallback(\n (newValue: string) => {\n if (!isControlledSearch) {\n setSearchValue(newValue);\n }\n (props as { onChange?: (v: string) => void }).onChange?.(newValue);\n },\n [isControlledSearch, props]\n );\n\n const handleSearchClear = useCallback(() => {\n if (!isControlledSearch) {\n setSearchValue('');\n }\n (props as { onChange?: (v: string) => void }).onChange?.('');\n onClear?.();\n }, [isControlledSearch, props, onClear]);\n\n const handleSearchKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && onSubmit) {\n onSubmit(currentSearchValue);\n }\n if (e.key === 'Escape' && currentSearchValue) {\n e.preventDefault();\n handleSearchClear();\n }\n },\n [currentSearchValue, onSubmit, handleSearchClear]\n );\n\n // Determine input state based on props\n const inputState = useMemo(() => {\n if (isDisabled) return 'disabled';\n if (isReadOnly) return 'readonly';\n if (isInvalid) return 'error';\n if (isValid) return 'success';\n return 'default';\n }, [isDisabled, isReadOnly, isInvalid, isValid]);\n\n // Determine label state — labels don't carry an error state any more\n // (the asterisk + error message already convey it).\n const labelState = useMemo(() => {\n if (isDisabled) return 'disabled';\n return 'default';\n }, [isDisabled]);\n\n // Combine description and patternDescription\n const combinedDescription = useMemo(() => {\n if (description && patternDescription) {\n return `${description} ${patternDescription}`;\n }\n return description || patternDescription;\n }, [description, patternDescription]);\n\n // Determine actual prefix (search icon auto-added for type=\"search\")\n const actualPrefix = useMemo(() => {\n if (isSearch && !isIconHidden && !prefix) {\n const iconSize = size === 'sm' ? 'h-3.5 w-3.5' : size === 'lg' ? 'h-5 w-5' : 'h-4 w-4';\n return <Search className={iconSize} />;\n }\n return prefix;\n }, [isSearch, isIconHidden, prefix, size]);\n\n // Calculate dynamic padding for prefix/suffix\n const inputPadding = useMemo(() => {\n const basePadding = { left: 12, right: 12 }; // Default px-3 = 12px\n\n if (actualPrefix) {\n const prefixWidth = typeof actualPrefix === 'string'\n ? actualPrefix.length * 8 + 16\n : prefixSize + 16;\n basePadding.left = prefixWidth;\n }\n\n if (type === 'password' && showPasswordToggle) {\n basePadding.right = 16 + 16;\n } else if (isSearch && currentSearchValue) {\n basePadding.right = 44; // Space for clear button\n } else if (suffix) {\n const suffixWidth = typeof suffix === 'string'\n ? suffix.length * 8 + 16\n : suffixSize + 16;\n basePadding.right = suffixWidth;\n }\n\n return basePadding;\n }, [actualPrefix, prefix, suffix, prefixSize, suffixSize, type, showPasswordToggle, isSearch, currentSearchValue]);\n\n // Determine actual suffix (password toggle / search clear / custom suffix)\n const actualSuffix = useMemo(() => {\n if (type === 'password' && showPasswordToggle) {\n return (\n <Button\n variant=\"ghost\"\n visualSize=\"icon\"\n onPress={handlePasswordToggle}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n className=\"!min-h-0 !min-w-0 h-8 w-8\"\n >\n {showPassword ? <EyeOffIcon /> : <EyeIcon />}\n </Button>\n );\n }\n if (isSearch && currentSearchValue) {\n const iconSize = size === 'sm' ? 'h-3 w-3' : size === 'lg' ? 'h-5 w-5' : 'h-4 w-4';\n return (\n <Button\n variant=\"ghost\"\n visualSize=\"icon\"\n onPress={handleSearchClear}\n aria-label=\"Clear search\"\n className=\"!min-h-0 !min-w-0 h-8 w-8\"\n >\n <X className={iconSize} />\n </Button>\n );\n }\n return suffix;\n }, [type, showPasswordToggle, showPassword, suffix, handlePasswordToggle, isSearch, currentSearchValue, size, handleSearchClear]);\n\n // Whether the suffix is an interactive button (password toggle or search clear)\n const hasInteractiveSuffix = (type === 'password' && showPasswordToggle) || (isSearch && !!currentSearchValue);\n\n return (\n <AriaTextField\n ref={ref}\n className={cn(\"flex flex-col gap-1.5\", className)}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n value={isSearch ? currentSearchValue : value}\n defaultValue={isSearch ? undefined : defaultValue}\n onChange={isSearch ? handleSearchChange : undefined}\n {...props}\n >\n {/* Label with optional hint and required indicator */}\n {label && (\n <AriaLabel className={cn(labelVariants({ state: labelState }), labelHint && \"flex items-baseline justify-between\")}>\n <span>\n {label}\n {isRequired && (\n <span className=\"ml-1 text-[var(--destructive-background)]\" aria-hidden=\"true\">\n <strong>*</strong>\n </span>\n )}\n </span>\n {labelHint && (\n <span className=\"text-xs font-normal text-[var(--muted-foreground)]\">{labelHint}</span>\n )}\n </AriaLabel>\n )}\n\n {/* Description text (helper text) */}\n {combinedDescription && (\n <AriaText slot=\"description\" className={cn(descriptionVariants())}>\n {combinedDescription}\n </AriaText>\n )}\n\n {/* Layer 1: Touch target (44px min) — clicking routes focus to input */}\n {/* Layer 2: Input (visual height h-10) is inside */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={cn(FIELD_TOUCH_TARGET, \"relative cursor-text motion-safe:transition-colors motion-safe:duration-200\")}\n style={{\n width: inputWidth,\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n >\n {/* Prefix */}\n {actualPrefix && (\n <div\n data-testid=\"textfield-prefix\"\n className=\"absolute left-3 flex items-center justify-center pointer-events-none text-[var(--content-foreground)]\"\n aria-hidden=\"true\"\n >\n {actualPrefix}\n </div>\n )}\n\n {/* Input */}\n <AriaInput\n type={actualType}\n id={fieldId}\n className={cn(\n inputVariants({ size, state: inputState }),\n DISABLED_STYLES,\n isShaking && 'shake'\n )}\n style={{\n width: '100%',\n paddingLeft: `${inputPadding.left}px`,\n paddingRight: `${inputPadding.right}px`,\n }}\n autoComplete={autoComplete}\n pattern={pattern}\n onPaste={handlePaste}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={isSearch ? handleSearchKeyDown : undefined}\n aria-required={isRequired ? 'true' : undefined}\n aria-readonly={isReadOnly ? 'true' : undefined}\n aria-errormessage={isInvalid && errorMessage ? errorId : undefined}\n />\n\n {/* Suffix */}\n {actualSuffix && (\n <div\n data-testid=\"textfield-suffix\"\n className={cn(\n \"absolute right-3 flex items-center justify-center text-[var(--content-foreground)]\",\n hasInteractiveSuffix ? \"\" : \"pointer-events-none\"\n )}\n aria-hidden={hasInteractiveSuffix ? undefined : \"true\"}\n >\n {actualSuffix}\n </div>\n )}\n </div>\n\n {/* Success message (shown when valid) */}\n {isValid && successMessage && !isInvalid && (\n <AriaText slot=\"description\" className={cn(successMessageVariants())}>\n {successMessage}\n </AriaText>\n )}\n\n {/* Error message (shown when invalid) - takes precedence over success */}\n {isInvalid && errorMessage && (\n <TextFieldError id={errorId}>\n {errorMessage}\n </TextFieldError>\n )}\n\n {/* Screen reader announcement for paste prevention */}\n {screenReaderMessage && (\n <div className=\"sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {screenReaderMessage}\n </div>\n )}\n </AriaTextField>\n );\n }\n);\n\nTextField.displayName = \"TextField\";\n\nexport { inputVariants as textFieldInputVariants, labelVariants as textFieldLabelVariants };\n","'use client';\n\n/**\n * SearchField Component\n *\n * A specialized search input built on the Themis TextField component.\n * Delegates all rendering and behavior to TextField with type=\"search\",\n * which provides search icon, clear button (Themis Button), and keyboard support.\n *\n * WCAG 2.2 AAA compliant:\n * - 44x44px touch targets on all interactive elements (via Themis Button)\n * - Clear button uses Themis Button three-layer architecture\n * - Escape key clears input\n * - Enter key submits search\n * - role=\"searchbox\" via type=\"search\"\n *\n * @example\n * ```tsx\n * <SearchField\n * label=\"Search\"\n * placeholder=\"Search items...\"\n * onSubmit={(value) => console.log('Search:', value)}\n * />\n * ```\n */\n\nimport { forwardRef } from 'react';\nimport { TextField } from '../TextField/TextField';\nimport type { SearchFieldProps } from './SearchField.types';\n\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (\n {\n label,\n description,\n errorMessage,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref\n ) => {\n // Warn if no accessible label is provided\n if (process.env.NODE_ENV !== 'production') {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n '[SearchField] Either label, aria-label, or aria-labelledby is required for accessibility (WCAG 1.1.1)'\n );\n }\n }\n\n return (\n <TextField\n ref={ref}\n type=\"search\"\n label={label}\n description={errorMessage ? undefined : description}\n errorMessage={errorMessage}\n isInvalid={!!errorMessage}\n aria-label={!label ? ariaLabel : undefined}\n aria-labelledby={ariaLabelledBy}\n {...props}\n />\n );\n }\n);\n\nSearchField.displayName = 'SearchField';\n","/**\n * Determines whether a component should animate.\n *\n * Returns `false` if:\n * - The `animated` prop is explicitly `false`\n * - The user prefers reduced motion\n *\n * @param animated - The component's `animated` prop value (default: `true`)\n * @param prefersReducedMotion - Whether the user prefers reduced motion\n */\nexport function shouldAnimate(\n animated: boolean | undefined,\n prefersReducedMotion: boolean,\n): boolean {\n if (animated === false) return false;\n if (prefersReducedMotion) return false;\n return true;\n}\n","'use client';\n\nimport { useState, useEffect } from 'react';\n\nconst QUERY = '(prefers-reduced-motion: reduce)';\n\nfunction getInitialState(): boolean {\n if (typeof window === 'undefined') return false;\n return window.matchMedia(QUERY).matches;\n}\n\n/**\n * Detects whether the user prefers reduced motion.\n *\n * - SSR-safe (returns `false` on the server)\n * - Reacts to changes in the OS preference\n * - Cleans up the listener on unmount\n */\nexport function useReducedMotion(): boolean {\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(getInitialState);\n\n useEffect(() => {\n const mql = window.matchMedia(QUERY);\n setPrefersReducedMotion(mql.matches);\n\n const handler = (event: MediaQueryListEvent): void => {\n setPrefersReducedMotion(event.matches);\n };\n\n mql.addEventListener('change', handler);\n return () => mql.removeEventListener('change', handler);\n }, []);\n\n return prefersReducedMotion;\n}\n","\"use client\";\n\n/**\n * Switch Component\n * Accessible toggle switch with React Aria primitives and CVA styling.\n * Supports optional spring animation via motion.dev.\n *\n * @see React Aria Switch: https://react-spectrum.adobe.com/react-aria/Switch.html\n * @see ShadCN Switch: https://ui.shadcn.com/docs/components/switch\n * @see spec.md (WCAG 2.2 AAA - 7:1 contrast ratio, 44x44px touch targets)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, useRef, useEffect, useCallback } from 'react';\nimport {\n Switch as AriaSwitch,\n type SwitchProps as AriaSwitchProps,\n} from 'react-aria-components';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { shouldAnimate } from '../../utils/shouldAnimate';\nimport { useReducedMotion } from '../../hooks/useReducedMotion';\nimport { DEFAULT_INTERACTIONS } from '../../styles/interaction-states';\nimport type { AnimatedProps, SpringConfig } from '../../types/animation';\n\n// ---------------------------------------------------------------------------\n// Motion lazy-loader — avoids hard dep on optional peer\n// ---------------------------------------------------------------------------\n\ntype AnimateFn = (\n element: Element,\n keyframes: Record<string, string | number>,\n options?: Record<string, unknown>,\n) => { stop: () => void };\n\nlet cachedAnimate: AnimateFn | null | undefined; // undefined = pending, null = unavailable\n\nfunction loadMotionAnimate(): Promise<AnimateFn | null> {\n if (cachedAnimate !== undefined) return Promise.resolve(cachedAnimate);\n\n return import('motion')\n .then((m) => {\n cachedAnimate = m.animate as unknown as AnimateFn;\n return cachedAnimate;\n })\n .catch(() => {\n cachedAnimate = null;\n return null;\n });\n}\n\n// ---------------------------------------------------------------------------\n// Default spring configuration\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_SPRING: SpringConfig = { stiffness: 500, damping: 30 };\n\n// ---------------------------------------------------------------------------\n// CVA Variants\n// ---------------------------------------------------------------------------\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * This layer handles the WCAG 2.2 AAA touch target requirement\n * Always invisible, centers the visual switch inside\n */\nconst switchOuterVariants = cva(\n // Base styles - WCAG 2.2 AAA: 44x44px minimum touch target\n \"inline-flex shrink-0 cursor-pointer items-center justify-center min-h-[44px] min-w-[44px] disabled:cursor-not-allowed disabled:opacity-50 data-[readonly]:cursor-default\",\n {\n variants: {},\n defaultVariants: {},\n }\n);\n\n/**\n * Layer 2: Visual switch track/background (adjustable size)\n * This layer provides the visual appearance and size flexibility\n * Background color changes based on variant and selection state\n */\nconst switchTrackVariants = cva(\n // Base styles - visual track with transitions and focus states\n \"relative inline-flex shrink-0 items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n {\n variants: {\n variant: {\n // Default variant: Uses primary color when selected\n default:\n \"bg-[var(--border)] data-[selected]:bg-[var(--primary)]\",\n // Destructive variant: Uses destructive/error color when selected\n destructive:\n \"bg-[var(--border)] data-[selected]:bg-[var(--destructive-background)]\",\n },\n size: {\n // Small: h-6 w-10 (visual track size)\n sm: \"h-6 w-10\",\n // Default: h-7 w-12\n default: \"h-7 w-12\",\n // Large: h-8 w-14\n lg: \"h-8 w-14\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n/**\n * Layer 3: Switch thumb (sliding circle)\n * Inner visual element that slides horizontally when switch is selected.\n * When spring animation is active, CSS transition is removed and\n * motion.dev controls the translateX via inline transform.\n */\nconst switchThumbVariants = cva(\n // Base styles: rounded circle with shadow\n \"pointer-events-none absolute left-0.5 rounded-full bg-[var(--content-background)] ring-0\",\n {\n variants: {\n size: {\n // Thumb is slightly smaller than track height for proper padding\n sm: \"h-4 w-4\",\n default: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n animated: {\n // When CSS handles the animation (motion.dev unavailable or disabled)\n false: \"transition-transform data-[selected]:translate-x-full\",\n // When motion.dev handles the animation — no CSS transition\n true: \"\",\n },\n },\n defaultVariants: {\n size: \"default\",\n animated: false,\n },\n }\n);\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport interface SwitchProps\n extends Omit<AriaSwitchProps, 'className' | 'children'>,\n VariantProps<typeof switchTrackVariants>,\n AnimatedProps {\n variant?: 'default' | 'destructive';\n size?: 'sm' | 'default' | 'lg';\n label?: string;\n description?: string;\n className?: string;\n /** Spring physics configuration. Default: { stiffness: 500, damping: 30 } */\n springConfig?: SpringConfig;\n}\n\n/**\n * Switch Component\n * Fully accessible toggle switch with React Aria and themed styling.\n * When `animated` is true (default) and motion.dev is installed,\n * the thumb uses spring physics for a natural bounce effect.\n */\nconst Switch = memo(forwardRef<HTMLLabelElement, SwitchProps>(\n (\n {\n className,\n variant,\n size,\n label,\n description,\n isDisabled,\n isReadOnly,\n animated,\n springConfig = DEFAULT_SPRING,\n onChange: onChangeProp,\n ...props\n },\n ref\n ) => {\n const prefersReducedMotion = useReducedMotion();\n const doAnimate = shouldAnimate(animated, prefersReducedMotion);\n\n const thumbRef = useRef<HTMLDivElement>(null);\n const motionReady = useRef(false);\n const animateRef = useRef<AnimateFn | null>(null);\n const activeAnimation = useRef<{ stop: () => void } | null>(null);\n\n // Preload motion.dev when animation is desired\n useEffect(() => {\n if (!doAnimate) return;\n\n loadMotionAnimate().then((fn) => {\n if (fn) {\n animateRef.current = fn;\n motionReady.current = true;\n\n // Set initial thumb position if already selected (no animation)\n if (thumbRef.current) {\n const isCurrentlySelected = thumbRef.current.hasAttribute('data-selected');\n thumbRef.current.style.transform = isCurrentlySelected\n ? 'translateX(100%)'\n : 'translateX(0)';\n }\n }\n });\n }, [doAnimate]);\n\n const handleChange = useCallback(\n (isSelected: boolean) => {\n // Forward to consumer's onChange\n onChangeProp?.(isSelected);\n\n // Trigger spring animation if motion is ready\n if (doAnimate && motionReady.current && animateRef.current && thumbRef.current) {\n // Stop any in-progress animation\n activeAnimation.current?.stop();\n\n activeAnimation.current = animateRef.current(\n thumbRef.current,\n { x: isSelected ? '100%' : '0%' },\n {\n type: 'spring',\n stiffness: springConfig.stiffness,\n damping: springConfig.damping,\n },\n );\n }\n },\n [doAnimate, springConfig.stiffness, springConfig.damping, onChangeProp],\n );\n\n // Use motion for thumb position when motion.dev is handling it\n const useMotionThumb = doAnimate;\n\n return (\n <AriaSwitch\n ref={ref}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n onChange={handleChange}\n className={(_classNameProps) =>\n cn(\n // `relative` is load-bearing: React Aria renders the real <input>\n // inside a VisuallyHidden span (position:absolute, auto offsets).\n // Without a positioned ancestor its containing block becomes the\n // document, so the input is laid out at its static Y deep in tall\n // scroll content and EXTENDS the page's scroll height — a phantom\n // blank band + a second (window) scrollbar. `relative` confines the\n // hidden input to this switch's box. (The `relative` on the track\n // sub-element is a sibling of the span, so it doesn't help here.)\n \"group relative inline-flex items-center gap-2\",\n isDisabled && \"cursor-not-allowed opacity-50\",\n className\n )\n }\n {...props}\n >\n {(renderProps) => (\n <>\n {/* Layer 1: Transparent outer touch target (44x44px WCAG compliant) */}\n <div\n className={cn(switchOuterVariants())}\n data-selected={renderProps.isSelected || undefined}\n data-readonly={isReadOnly || undefined}\n >\n {/* Layer 2: Visual switch track (adjustable size with variants) */}\n <div\n className={cn(\n switchTrackVariants({ variant, size }),\n DEFAULT_INTERACTIONS\n )}\n data-selected={renderProps.isSelected || undefined}\n >\n {/* Layer 3: Thumb (sliding circle, absolutely positioned) */}\n <div\n ref={thumbRef}\n className={cn(switchThumbVariants({\n size,\n animated: useMotionThumb,\n }))}\n data-selected={renderProps.isSelected || undefined}\n />\n </div>\n </div>\n\n {/* Optional label and description */}\n {(label || description) && (\n <div className=\"flex flex-col\">\n {label && (\n <span className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n </span>\n )}\n {description && (\n <span className=\"text-xs text-[var(--menu-muted)]\">\n {description}\n </span>\n )}\n </div>\n )}\n </>\n )}\n </AriaSwitch>\n );\n }\n));\n\nSwitch.displayName = \"Switch\";\n\nexport { Switch, switchOuterVariants, switchTrackVariants, switchThumbVariants };\n","\"use client\";\n\n/**\n * RadioGroup Component\n * Accessible single-selection radio group with React Aria primitives and CVA styling\n *\n * Key Features:\n * - Bordered container design with explicit 44px+ touch targets\n * - 2 variants: default, destructive (no outline per clarification)\n * - 3 sizes: sm (44px), default (48px), lg (56px)\n * - Arrow keys move focus AND select (WAI-ARIA standard selection-follows-focus)\n * - Error styling on ALL items (cognitive accessibility)\n * - Spring animation for selection indicator\n * - RTL support (indicator auto-flips)\n * - Radio.Label and Radio.Description sub-components\n *\n * @see radiogroup-prd.md (Product Requirements)\n * @see plan.md (11 Key Clarifications)\n * @see React Aria RadioGroup: https://react-spectrum.adobe.com/react-aria/RadioGroup.html\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AAA)\n */\n\nimport {\n forwardRef,\n createContext,\n useContext,\n useId,\n type ReactNode,\n type ForwardedRef,\n} from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n Label,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { FOCUS_STYLES, HIGH_CONTRAST_FOCUS } from '../../styles/interaction-states';\nimport type {\n RadioGroupProps,\n RadioProps,\n RadioLabelProps,\n RadioDescriptionProps,\n RadioGroupVariant,\n RadioGroupSize,\n} from './RadioGroup.types';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface RadioGroupContextValue {\n variant: RadioGroupVariant;\n size: RadioGroupSize;\n isInvalid: boolean;\n}\n\nconst RadioGroupContext = createContext<RadioGroupContextValue>({\n variant: 'default',\n size: 'default',\n isInvalid: false,\n});\n\n// ============================================================================\n// CVA Variants\n// ============================================================================\n\n/**\n * RadioGroup container variants\n * Controls orientation and spacing (gap-2 = 8px per clarification)\n */\nconst radioGroupVariants = cva(\n // Base: flex container\n \"flex\",\n {\n variants: {\n orientation: {\n vertical: \"flex-col gap-2\",\n horizontal: \"flex-row flex-wrap gap-2\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n }\n);\n\n/**\n * Radio item bordered container variants\n * Bordered container design with explicit touch targets\n * All sizes maintain 44px minimum height (WCAG 2.2 AAA)\n * All sizes use rounded-md (6px) per clarification\n */\nconst radioItemVariants = cva(\n // Base: bordered container with flex layout, RTL support.\n // `relative` is load-bearing: React Aria renders the real <input> inside a\n // VisuallyHidden span (position:absolute, auto offsets). Without a positioned\n // ancestor its containing block becomes the document, so the input is laid out\n // at its static Y deep in tall scroll content and EXTENDS the page's scroll\n // height — a phantom blank band + a second (window) scrollbar. `relative`\n // confines the hidden input to this radio item box.\n [\n \"relative flex items-center gap-3 rounded-md border cursor-pointer\",\n \"transition-colors duration-200\",\n \"rtl:flex-row-reverse\", // RTL: indicator flips to right\n // Focus ring on entire container\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: [\n \"border-[var(--border)]\",\n \"data-[hovered]:bg-[var(--accent)]/10\",\n \"data-[selected]:border-[var(--primary)]\",\n \"data-[selected]:bg-[var(--primary)]/10\",\n ].join(\" \"),\n destructive: [\n \"border-[var(--border)]\",\n \"data-[hovered]:bg-[var(--destructive-background)]/10\",\n \"data-[selected]:border-[var(--destructive-background)]\",\n \"data-[selected]:bg-[var(--destructive-background)]/10\",\n ].join(\" \"),\n },\n size: {\n sm: \"min-h-[44px] py-2 px-3 text-sm\",\n default: \"min-h-[48px] py-3 px-4 text-sm\",\n lg: \"min-h-[56px] py-4 px-5 text-base\",\n },\n isDisabled: {\n true: \"opacity-50 cursor-not-allowed\",\n false: \"\",\n },\n isInvalid: {\n // Error: ALL items get destructive border (cognitive accessibility)\n true: \"border-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n isDisabled: false,\n isInvalid: false,\n },\n }\n);\n\n/**\n * Circle indicator (outer ring) variants\n */\nconst radioIndicatorVariants = cva(\n // Base: circle with border, flex-shrink-0 to prevent squishing\n \"flex-shrink-0 rounded-full border-2 flex items-center justify-center transition-colors duration-200\",\n {\n variants: {\n variant: {\n default: [\n \"border-[var(--border)]\",\n \"data-[selected]:border-[var(--primary)]\",\n ].join(\" \"),\n destructive: [\n \"border-[var(--border)]\",\n \"data-[selected]:border-[var(--destructive-background)]\",\n ].join(\" \"),\n },\n size: {\n sm: \"h-4 w-4\",\n default: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n/**\n * Inner dot variants (appears when selected)\n * Spring animation: cubic-bezier(0.34, 1.56, 0.64, 1) with slight overshoot\n */\nconst radioInnerDotVariants = cva(\n // Base: centered dot with spring animation\n [\n \"rounded-full transition-transform duration-200\",\n // Spring animation with overshoot\n \"[transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)]\",\n // Respect reduced motion preference\n \"motion-reduce:transition-none\",\n // Scale from 0 to 1 on selection\n \"scale-0 data-[selected]:scale-100\",\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: \"bg-[var(--primary)]\",\n destructive: \"bg-[var(--destructive-background)]\",\n },\n size: {\n sm: \"h-2 w-2\",\n default: \"h-2.5 w-2.5\",\n lg: \"h-3 w-3\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\n/**\n * Radio.Label - Styled label for radio item content\n */\nfunction RadioLabel({ children, className }: RadioLabelProps): ReactNode {\n return (\n <span className={cn(\"font-medium text-[var(--content-foreground)]\", className)}>\n {children}\n </span>\n );\n}\n\nRadioLabel.displayName = \"Radio.Label\";\n\n/**\n * Radio.Description - Styled description for radio item content (muted)\n */\nfunction RadioDescription({ children, className }: RadioDescriptionProps): ReactNode {\n return (\n <span className={cn(\"text-sm text-[var(--menu-muted)]\", className)}>\n {children}\n </span>\n );\n}\n\nRadioDescription.displayName = \"Radio.Description\";\n\n// ============================================================================\n// Radio Component\n// ============================================================================\n\n/**\n * Radio item component with bordered container design\n */\nfunction RadioComponent({ value, isDisabled, children, className }: RadioProps): ReactNode {\n const { variant, size, isInvalid } = useContext(RadioGroupContext);\n\n return (\n <AriaRadio\n value={value}\n isDisabled={isDisabled}\n className={(renderProps) =>\n cn(\n radioItemVariants({\n variant,\n size,\n isDisabled: renderProps.isDisabled,\n isInvalid,\n }),\n className\n )\n }\n >\n {(renderProps) => (\n <>\n {/* Circle indicator */}\n <div\n className={radioIndicatorVariants({ variant, size })}\n data-selected={renderProps.isSelected || undefined}\n >\n {/* Inner dot with spring animation */}\n <div\n className={radioInnerDotVariants({ variant, size })}\n data-selected={renderProps.isSelected || undefined}\n />\n </div>\n\n {/* Children content (flexible - text, icons, complex layouts) */}\n <div className=\"flex-1 flex flex-col\">\n {children}\n </div>\n </>\n )}\n </AriaRadio>\n );\n}\n\n// Attach sub-components\nconst Radio = Object.assign(RadioComponent, {\n Label: RadioLabel,\n Description: RadioDescription,\n}) as typeof RadioComponent & {\n Label: typeof RadioLabel;\n Description: typeof RadioDescription;\n displayName: string;\n};\n\nRadio.displayName = \"Radio\";\n\n// ============================================================================\n// RadioGroup Component\n// ============================================================================\n\n/**\n * RadioGroup root component\n * Accessible single-selection control with bordered container design\n */\nconst RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup(props: RadioGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n const {\n // Display props\n label,\n description,\n errorMessage,\n // Selection props\n value,\n defaultValue,\n // State props\n isDisabled = false,\n isReadOnly = false,\n isRequired = false,\n isInvalid = false,\n // Layout props\n orientation = 'vertical',\n // Variant props\n variant = 'default',\n size = 'default',\n // Form props\n name,\n // Event handlers\n onChange,\n onFocusChange,\n // Standard props\n className,\n children,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'data-testid': dataTestId,\n ...restProps\n } = props;\n\n // Generate unique IDs for accessibility\n const generatedId = useId();\n const radioGroupId = id ?? generatedId;\n const labelId = `${radioGroupId}-label`;\n const descriptionId = `${radioGroupId}-description`;\n const errorId = `${radioGroupId}-error`;\n\n // Build aria-describedby from description and error\n const describedByParts: string[] = [];\n if (ariaDescribedby) describedByParts.push(ariaDescribedby);\n if (description) describedByParts.push(descriptionId);\n if (isInvalid && errorMessage) describedByParts.push(errorId);\n const computedAriaDescribedBy = describedByParts.length > 0\n ? describedByParts.join(' ')\n : undefined;\n\n return (\n <RadioGroupContext.Provider value={{ variant, size, isInvalid }}>\n <AriaRadioGroup\n ref={ref}\n id={radioGroupId}\n name={name}\n value={value ?? undefined}\n defaultValue={defaultValue ?? undefined}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n isInvalid={isInvalid}\n orientation={orientation}\n onChange={onChange}\n onFocusChange={onFocusChange}\n aria-label={ariaLabel}\n aria-labelledby={label ? labelId : ariaLabelledby}\n aria-describedby={computedAriaDescribedBy}\n data-testid={dataTestId}\n data-orientation={orientation}\n className={cn(\"flex flex-col gap-1.5\", className)}\n {...restProps}\n >\n {/* Label with optional required asterisk */}\n {label && (\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && (\n <span className=\"ml-1 text-[var(--destructive-background)]\" aria-hidden=\"true\">\n *\n </span>\n )}\n </Label>\n )}\n\n {/* Description */}\n {description && (\n <Text\n id={descriptionId}\n slot=\"description\"\n className=\"text-sm text-[var(--menu-muted)]\"\n >\n {description}\n </Text>\n )}\n\n {/* Radio items container with orientation */}\n <div className={radioGroupVariants({ orientation })}>\n {children}\n </div>\n\n {/* Error message with role=\"alert\" for screen reader announcements */}\n {isInvalid && errorMessage && (\n <FieldError\n id={errorId}\n className=\"text-sm text-[var(--destructive-background)]\"\n >\n <span role=\"alert\">{errorMessage}</span>\n </FieldError>\n )}\n </AriaRadioGroup>\n </RadioGroupContext.Provider>\n );\n }\n);\n\nRadioGroup.displayName = \"RadioGroup\";\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nexport {\n RadioGroup,\n Radio,\n radioGroupVariants,\n radioItemVariants,\n radioIndicatorVariants,\n radioInnerDotVariants,\n};\n","\"use client\";\n\n/**\n * CheckboxGroup Component\n * Accessible multi-selection checkbox group with React Aria primitives and CVA styling\n *\n * Key Features:\n * - Bordered container design with explicit 44px+ touch targets\n * - 2 variants: default, destructive (no outline per clarification)\n * - 3 sizes: sm (44px), default (48px), lg (56px)\n * - Tab moves focus between checkboxes, Space toggles (standard checkbox behavior)\n * - Error styling on ALL items (cognitive accessibility)\n * - Spring animation for checkmark indicator\n * - RTL support (indicator auto-flips)\n * - Checkbox.Label and Checkbox.Description sub-components\n * - value: string[] for multi-select (key difference from RadioGroup)\n *\n * @see checkboxgroup-prd.md (Product Requirements)\n * @see plan.md (12 Key Clarifications)\n * @see React Aria CheckboxGroup: https://react-spectrum.adobe.com/react-aria/CheckboxGroup.html\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AAA)\n */\n\nimport {\n forwardRef,\n createContext,\n useContext,\n useId,\n cloneElement,\n isValidElement,\n type ReactNode,\n type ForwardedRef,\n type ReactElement,\n} from 'react';\nimport {\n CheckboxGroup as AriaCheckboxGroup,\n Checkbox as AriaCheckbox,\n Label,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { FOCUS_STYLES, HIGH_CONTRAST_FOCUS } from '../../styles/interaction-states';\nimport type {\n CheckboxGroupProps,\n CheckboxProps,\n CheckboxLabelProps,\n CheckboxDescriptionProps,\n CheckboxGroupVariant,\n CheckboxGroupSize,\n} from './CheckboxGroup.types';\n\n// ============================================================================\n// Context\n// ============================================================================\n\n/**\n * CheckboxGroup context value\n * Includes isDisabled and isReadOnly per clarification (plan.md #10)\n */\ninterface CheckboxGroupContextValue {\n variant: CheckboxGroupVariant;\n size: CheckboxGroupSize;\n isInvalid: boolean;\n isDisabled: boolean;\n isReadOnly: boolean;\n}\n\nconst CheckboxGroupContext = createContext<CheckboxGroupContextValue>({\n variant: 'default',\n size: 'default',\n isInvalid: false,\n isDisabled: false,\n isReadOnly: false,\n});\n\n// ============================================================================\n// CVA Variants\n// ============================================================================\n\n/**\n * CheckboxGroup container variants\n * Controls orientation and spacing (gap-2 = 8px per clarification)\n */\nconst checkboxGroupVariants = cva(\n // Base: flex container\n \"flex\",\n {\n variants: {\n orientation: {\n vertical: \"flex-col gap-2\",\n horizontal: \"flex-row flex-wrap gap-2\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n }\n);\n\n/**\n * Checkbox item bordered container variants\n * Bordered container design with explicit touch targets\n * All sizes maintain 44px minimum height (WCAG 2.2 AAA)\n * All sizes use rounded-md (6px) per clarification\n */\nconst checkboxItemVariants = cva(\n // Base: bordered container with flex layout, RTL support.\n // `relative` is load-bearing: React Aria renders the real <input> inside a\n // VisuallyHidden span (position:absolute, auto offsets). Without a positioned\n // ancestor its containing block becomes the document, so the input is laid out\n // at its static Y deep in tall scroll content and EXTENDS the page's scroll\n // height — a phantom blank band + a second (window) scrollbar. `relative`\n // confines the hidden input to this checkbox item box.\n [\n \"relative flex items-center gap-3 rounded-md border cursor-pointer\",\n \"transition-colors duration-200\",\n \"rtl:flex-row-reverse\", // RTL: indicator flips to right\n // Focus ring on entire container\n FOCUS_STYLES,\n HIGH_CONTRAST_FOCUS,\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: [\n \"border-[var(--border)]\",\n \"data-[hovered]:bg-[var(--accent)]/10\",\n \"data-[selected]:border-[var(--primary)]\",\n \"data-[selected]:bg-[var(--primary)]/10\",\n ].join(\" \"),\n destructive: [\n \"border-[var(--border)]\",\n \"data-[hovered]:bg-[var(--destructive-background)]/10\",\n \"data-[selected]:border-[var(--destructive-background)]\",\n \"data-[selected]:bg-[var(--destructive-background)]/10\",\n ].join(\" \"),\n },\n size: {\n sm: \"min-h-[44px] py-2 px-3 text-sm\",\n default: \"min-h-[48px] py-3 px-4 text-sm\",\n lg: \"min-h-[56px] py-4 px-5 text-base\",\n },\n isDisabled: {\n true: \"opacity-50 cursor-not-allowed\",\n false: \"\",\n },\n isReadOnly: {\n // Subtle visual cue per clarification\n true: \"cursor-default\",\n false: \"\",\n },\n isInvalid: {\n // Error: ALL items get destructive border (cognitive accessibility)\n true: \"border-[var(--destructive-background)]\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n isDisabled: false,\n isReadOnly: false,\n isInvalid: false,\n },\n }\n);\n\n/**\n * Square indicator (checkbox box) variants\n * Uses rounded-sm (2px) for square appearance (unlike RadioGroup's circle)\n */\nconst checkboxIndicatorVariants = cva(\n // Base: square with border, flex-shrink-0 to prevent squishing\n \"flex-shrink-0 rounded-sm border-2 flex items-center justify-center transition-colors duration-200\",\n {\n variants: {\n variant: {\n default: [\n \"border-[var(--border)]\",\n \"data-[selected]:border-[var(--primary)]\",\n \"data-[selected]:bg-[var(--primary)]\",\n ].join(\" \"),\n destructive: [\n \"border-[var(--border)]\",\n \"data-[selected]:border-[var(--destructive-background)]\",\n \"data-[selected]:bg-[var(--destructive-background)]\",\n ].join(\" \"),\n },\n size: {\n sm: \"h-4 w-4\",\n default: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n/**\n * Checkmark SVG variants\n * Spring animation: cubic-bezier(0.34, 1.56, 0.64, 1) with slight overshoot\n */\nconst checkmarkVariants = cva(\n // Base: centered checkmark with spring animation\n [\n \"transition-transform duration-200\",\n // Spring animation with overshoot\n \"[transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)]\",\n // Respect reduced motion preference\n \"motion-reduce:transition-none\",\n // Scale from 0 to 1 on selection\n \"scale-0 data-[selected]:scale-100\",\n ].join(\" \"),\n {\n variants: {\n variant: {\n default: \"text-[var(--primary-foreground)]\",\n destructive: \"text-[var(--destructive-foreground)]\",\n },\n size: {\n sm: \"h-3 w-3\",\n default: \"h-3.5 w-3.5\",\n lg: \"h-4 w-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\n// ============================================================================\n// Icon Components\n// ============================================================================\n\n/**\n * Checkmark SVG icon (default)\n * Used inside the checkbox indicator when selected\n */\nfunction CheckmarkIcon({ className, ...props }: { className?: string; 'data-selected'?: boolean }): ReactNode {\n return (\n <svg\n className={className}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n );\n}\n\n/**\n * Times (X) SVG icon\n * Alternative icon for destructive or exclusion selections\n * @example <Checkbox value=\"exclude\" selectedIcon={<TimesIcon />}>Exclude this item</Checkbox>\n */\nfunction TimesIcon({ className, ...props }: { className?: string; 'data-selected'?: boolean }): ReactNode {\n return (\n <svg\n className={className}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\n/**\n * Checkbox.Label - Styled label for checkbox item content\n */\nfunction CheckboxLabel({ children, className }: CheckboxLabelProps): ReactNode {\n return (\n <span className={cn(\"font-medium text-[var(--content-foreground)]\", className)}>\n {children}\n </span>\n );\n}\n\nCheckboxLabel.displayName = \"Checkbox.Label\";\n\n/**\n * Checkbox.Description - Styled description for checkbox item content (muted)\n */\nfunction CheckboxDescription({ children, className }: CheckboxDescriptionProps): ReactNode {\n return (\n <span className={cn(\"text-sm text-[var(--menu-muted)]\", className)}>\n {children}\n </span>\n );\n}\n\nCheckboxDescription.displayName = \"Checkbox.Description\";\n\n// ============================================================================\n// Checkbox Component\n// ============================================================================\n\n/**\n * Checkbox item component with bordered container design\n */\nfunction CheckboxComponent({ value, isDisabled, children, className, selectedIcon }: CheckboxProps): ReactNode {\n const { variant, size, isInvalid, isDisabled: groupDisabled, isReadOnly } = useContext(CheckboxGroupContext);\n\n // Individual isDisabled OR group isDisabled\n const effectiveDisabled = isDisabled || groupDisabled;\n\n // Render the selected icon - use custom icon if provided, otherwise default CheckmarkIcon\n const renderSelectedIcon = (isSelected: boolean) => {\n const iconClassName = cn(checkmarkVariants({ variant, size }));\n const dataSelected = isSelected || undefined;\n\n if (selectedIcon) {\n // Clone the custom icon element to add our styling classes\n if (isValidElement(selectedIcon)) {\n const iconElement = selectedIcon as ReactElement<{ className?: string; 'data-selected'?: boolean }>;\n return cloneElement(iconElement, {\n className: cn(iconClassName, iconElement.props.className),\n 'data-selected': dataSelected,\n });\n }\n // If it's not a valid element (e.g., just text), wrap it\n return <span className={iconClassName} data-selected={dataSelected}>{selectedIcon}</span>;\n }\n\n // Default: CheckmarkIcon\n return (\n <CheckmarkIcon\n className={iconClassName}\n data-selected={dataSelected}\n />\n );\n };\n\n return (\n <AriaCheckbox\n value={value}\n isDisabled={effectiveDisabled}\n className={(renderProps) =>\n cn(\n checkboxItemVariants({\n variant,\n size,\n isDisabled: renderProps.isDisabled,\n isReadOnly,\n isInvalid,\n }),\n className\n )\n }\n >\n {(renderProps) => (\n <>\n {/* Square indicator */}\n <div\n className={checkboxIndicatorVariants({ variant, size })}\n data-selected={renderProps.isSelected || undefined}\n >\n {/* Icon with spring animation */}\n {renderSelectedIcon(renderProps.isSelected)}\n </div>\n\n {/* Children content (flexible - text, icons, complex layouts) */}\n <div className=\"flex-1 flex flex-col\">\n {children}\n </div>\n </>\n )}\n </AriaCheckbox>\n );\n}\n\n// Attach sub-components\nconst Checkbox = Object.assign(CheckboxComponent, {\n Label: CheckboxLabel,\n Description: CheckboxDescription,\n}) as typeof CheckboxComponent & {\n Label: typeof CheckboxLabel;\n Description: typeof CheckboxDescription;\n displayName: string;\n};\n\nCheckbox.displayName = \"Checkbox\";\n\n// ============================================================================\n// Duplicate Value Warning\n// ============================================================================\n\n/**\n * Deduplicates array and warns in development mode\n * Per clarification: dedupe internally + console.warn in development\n */\nfunction dedupeWithWarning(values: string[] | undefined, componentName: string): string[] | undefined {\n if (!values) return values;\n\n const uniqueValues = [...new Set(values)];\n\n if (process.env.NODE_ENV !== 'production' && uniqueValues.length !== values.length) {\n console.warn(\n `[${componentName}] Received duplicate values in value/defaultValue prop. ` +\n `Original: [${values.join(', ')}], Deduplicated: [${uniqueValues.join(', ')}]. ` +\n `Duplicate values are automatically removed.`\n );\n }\n\n return uniqueValues;\n}\n\n// ============================================================================\n// CheckboxGroup Component\n// ============================================================================\n\n/**\n * CheckboxGroup root component\n * Accessible multi-selection control with bordered container design\n */\nconst CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(\n function CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n const {\n // Display props\n label,\n description,\n errorMessage,\n // Selection props (string[] for multi-select)\n value,\n defaultValue,\n // State props\n isDisabled = false,\n isReadOnly = false,\n isRequired = false,\n isInvalid = false,\n // Layout props\n orientation = 'vertical',\n // Variant props\n variant = 'default',\n size = 'default',\n // Form props\n name,\n // Event handlers\n onChange,\n onFocusChange,\n // Standard props\n className,\n children,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'data-testid': dataTestId,\n ...restProps\n } = props;\n\n // Generate unique IDs for accessibility\n const generatedId = useId();\n const checkboxGroupId = id ?? generatedId;\n const labelId = `${checkboxGroupId}-label`;\n const descriptionId = `${checkboxGroupId}-description`;\n const errorId = `${checkboxGroupId}-error`;\n\n // Build aria-describedby from description and error\n const describedByParts: string[] = [];\n if (ariaDescribedby) describedByParts.push(ariaDescribedby);\n if (description) describedByParts.push(descriptionId);\n if (isInvalid && errorMessage) describedByParts.push(errorId);\n const computedAriaDescribedBy = describedByParts.length > 0\n ? describedByParts.join(' ')\n : undefined;\n\n // Dedupe values with warning in development\n const dedupedValue = dedupeWithWarning(value, 'CheckboxGroup');\n const dedupedDefaultValue = dedupeWithWarning(defaultValue, 'CheckboxGroup');\n\n return (\n <CheckboxGroupContext.Provider value={{ variant, size, isInvalid, isDisabled, isReadOnly }}>\n <AriaCheckboxGroup\n ref={ref}\n id={checkboxGroupId}\n name={name}\n value={dedupedValue}\n defaultValue={dedupedDefaultValue}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n isInvalid={isInvalid}\n onChange={onChange}\n onFocusChange={onFocusChange}\n aria-label={ariaLabel}\n aria-labelledby={label ? labelId : ariaLabelledby}\n aria-describedby={computedAriaDescribedBy}\n aria-orientation={orientation}\n aria-required={isRequired || undefined}\n aria-invalid={isInvalid || undefined}\n data-testid={dataTestId}\n className={cn(\"flex flex-col gap-1.5\", className)}\n {...restProps}\n >\n {/* Label with optional required asterisk */}\n {label && (\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && (\n <span className=\"ml-1 text-[var(--destructive-background)]\" aria-hidden=\"true\">\n *\n </span>\n )}\n </Label>\n )}\n\n {/* Description */}\n {description && (\n <Text\n id={descriptionId}\n slot=\"description\"\n className=\"text-sm text-[var(--menu-muted)]\"\n >\n {description}\n </Text>\n )}\n\n {/* Checkbox items container with orientation */}\n <div className={checkboxGroupVariants({ orientation })}>\n {children}\n </div>\n\n {/* Error message with role=\"alert\" for screen reader announcements */}\n {isInvalid && errorMessage && (\n <FieldError\n id={errorId}\n className=\"text-sm text-[var(--destructive-background)]\"\n >\n <span role=\"alert\">{errorMessage}</span>\n </FieldError>\n )}\n </AriaCheckboxGroup>\n </CheckboxGroupContext.Provider>\n );\n }\n);\n\nCheckboxGroup.displayName = \"CheckboxGroup\";\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nexport {\n CheckboxGroup,\n Checkbox,\n checkboxGroupVariants,\n checkboxItemVariants,\n checkboxIndicatorVariants,\n checkmarkVariants,\n // Icon exports for custom selectedIcon usage\n CheckmarkIcon,\n TimesIcon,\n};\n","/**\n * Detection + dismissal guard for in-page writing-assistant browser extensions\n * (Grammarly, LanguageTool, Wordtune, …).\n *\n * These extensions inject their suggestion UI as elements appended to `<body>`,\n * outside any open overlay's DOM subtree. React Aria's `isDismissable` behaviour\n * treats a click on that injected UI as an \"outside click\" and dismisses the\n * overlay — so clicking a spelling suggestion silently closes the form pop-up\n * and discards the user's in-progress correction.\n *\n * The guard below lets overlays keep open when the interaction lands on an\n * extension-injected node, while every other outside click, Escape, and the\n * close button behave exactly as before.\n */\n\nconst MAX_ANCESTOR_DEPTH = 100;\n\n/**\n * Returns `true` when `element` belongs to an injected in-page writing\n * assistant (Grammarly, LanguageTool, Wordtune, …).\n *\n * UX-ONLY heuristic. This is a deliberately spoofable DOM sniff used solely to\n * keep a form pop-up open when a writing-assistant suggestion is clicked. It is\n * NOT a security/authorization control and must never gate access to data or\n * actions (the frontend is not a security boundary). Pure function — never log\n * the element (it can reference arbitrary DOM / user content).\n */\nexport function isExtensionInjectedElement(element: Element): boolean {\n if (!(element instanceof Element)) return false;\n\n // 1. Known-vendor markers (authoritative). Walk up via parentElement, and\n // climb shadow boundaries via getRootNode().host so detection still finds\n // the <grammarly-extension> host if React Aria's shadowDOM flag is ever\n // enabled (it defaults to false today → the document-level listener\n // already receives the retargeted host, so the parentElement walk alone\n // suffices currently). Depth-bounded as a defensive guard against a\n // crafted/overridden getRootNode/host returning a cycle (which would\n // otherwise hang the tab — a client-side DoS).\n let node: Element | null = element;\n for (let depth = 0; node && depth < MAX_ANCESTOR_DEPTH; depth++) {\n const tag = node.tagName?.toLowerCase() ?? '';\n if (tag.startsWith('grammarly-')) return true; // Grammarly\n if (tag.startsWith('lt-')) return true; // LanguageTool\n if (node.hasAttribute('data-grammarly-shadow-root')) return true;\n\n if (node.parentElement) {\n node = node.parentElement;\n } else {\n const root = node.getRootNode();\n node = root instanceof ShadowRoot ? root.host : null;\n }\n }\n\n // 2. Structural fallback (best-effort, future-proofs the long tail).\n // Extensions inject their UI as a custom element (hyphenated tag name)\n // mounted as a top-level sibling of the React root — i.e. a direct child\n // of <body>/<html>. Our app never renders body-level custom elements, and\n // React Aria portals render plain <div>s, so this stays safe for any\n // future first-party web component nested inside the app tree.\n let custom: Element | null = element;\n while (custom && !custom.tagName.includes('-')) {\n custom = custom.parentElement;\n }\n if (!custom) return false;\n\n const parent = custom.parentElement;\n return parent === document.body || parent === document.documentElement;\n}\n\n/**\n * Builds a `shouldCloseOnInteractOutside` predicate for React Aria overlays\n * that keeps the overlay open when the interaction targets an extension-injected\n * element, while preserving any consumer-supplied predicate.\n *\n * React Aria semantics: the predicate returns `true` ⇒ the overlay should\n * close. So we close only when the element is NOT extension-injected AND the\n * consumer (if any) also agrees it should close.\n */\nexport function createInteractOutsideGuard(\n consumerShouldClose?: (element: Element) => boolean,\n): (element: Element) => boolean {\n return (element: Element): boolean =>\n !isExtensionInjectedElement(element) && (consumerShouldClose?.(element) ?? true);\n}\n","import { cva } from 'class-variance-authority';\nimport { FIELD_INPUT_SIZES, TEXT_SIZE_SMALL_SCALE } from '../../styles';\n\nexport const comboboxVariants = cva(\n 'group flex flex-col gap-1.5 w-full',\n {\n variants: {\n size: {\n sm: '',\n default: '',\n lg: '',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxLabelVariants = cva(\n 'text-[var(--text-primary)] font-medium',\n {\n variants: {\n size: {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxInputVariants = cva(\n [\n 'flex-1 bg-transparent outline-none',\n 'placeholder:text-[var(--muted-foreground)]',\n 'disabled:cursor-not-allowed',\n ],\n {\n variants: {\n size: TEXT_SIZE_SMALL_SCALE,\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxTriggerWrapperVariants = cva(\n [\n 'flex items-center w-full rounded-md border',\n 'bg-[var(--input-background)] text-[var(--content-foreground)]',\n 'border-[var(--input-border)]',\n 'transition-colors duration-[var(--transition-fast)]',\n 'focus-within:ring-2 focus-within:ring-[var(--ring)] focus-within:ring-offset-[var(--ring-offset)]',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n 'data-[invalid]:border-[var(--destructive-background)]',\n ],\n {\n variants: {\n size: {\n sm: `${FIELD_INPUT_SIZES.sm} gap-1`,\n default: `${FIELD_INPUT_SIZES.default} gap-2`,\n lg: `${FIELD_INPUT_SIZES.lg} gap-2`,\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxButtonVariants = cva(\n [\n 'flex items-center justify-end shrink-0',\n 'text-[var(--muted-foreground)]',\n 'hover:text-[var(--text-primary)]',\n 'transition-colors',\n 'focus:outline-none',\n ],\n {\n variants: {\n size: {\n sm: 'h-4 w-4 min-h-[44px] min-w-[44px]',\n default: 'h-5 w-5 min-h-[44px] min-w-[44px]',\n lg: 'h-6 w-6 min-h-[44px] min-w-[44px]',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxPopoverVariants = cva(\n [\n 'w-[var(--trigger-width)] overflow-auto',\n 'rounded-md border border-[var(--border)]',\n 'bg-[var(--content-background)] text-[var(--content-foreground)]',\n 'data-[entering]:motion-safe:animate-in data-[entering]:motion-safe:fade-in-0',\n 'data-[exiting]:motion-safe:animate-out data-[exiting]:motion-safe:fade-out-0',\n ]\n);\n\nexport const comboboxListBoxVariants = cva(\n 'p-1 outline-none max-h-[300px] overflow-auto'\n);\n\nexport const comboboxItemVariants = cva(\n [\n 'flex items-center gap-2 w-full rounded-sm px-2 py-1.5',\n 'text-[var(--content-foreground)]',\n 'cursor-pointer outline-none',\n 'data-[focused]:bg-[var(--accent-background)] data-[focused]:text-[var(--accent-foreground)]',\n 'data-[selected]:font-medium',\n 'data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed',\n ],\n {\n variants: {\n size: {\n sm: 'text-xs min-h-[44px]',\n default: 'text-sm min-h-[44px]',\n lg: 'text-base min-h-[44px]',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxSectionVariants = cva('pt-1');\n\nexport const comboboxSectionHeaderVariants = cva(\n 'px-2 py-1.5 text-xs font-semibold text-[var(--muted-foreground)]'\n);\n\nexport const comboboxDescriptionVariants = cva(\n 'text-[var(--muted-foreground)]',\n {\n variants: {\n size: {\n sm: 'text-xs',\n default: 'text-xs',\n lg: 'text-sm',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n\nexport const comboboxErrorVariants = cva(\n 'text-[var(--destructive-background)]',\n {\n variants: {\n size: {\n sm: 'text-xs',\n default: 'text-xs',\n lg: 'text-sm',\n },\n },\n defaultVariants: { size: 'default' },\n }\n);\n","'use client';\n\nimport { forwardRef, type ReactElement } from 'react';\nimport {\n ComboBox as AriaComboBox,\n Label as AriaLabel,\n Input as AriaInput,\n Button as AriaButton,\n Popover as AriaPopover,\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n ListBoxSection as AriaListBoxSection,\n Header as AriaHeader,\n Text as AriaText,\n} from 'react-aria-components';\nimport { ChevronsUpDown, Check } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport { createInteractOutsideGuard } from '../../utils/browserExtensionOverlay';\nimport { FIELD_TOUCH_TARGET } from '../../styles';\nimport type {\n ComboboxProps,\n ComboboxItemProps,\n ComboboxSectionProps,\n} from './Combobox.types';\nimport {\n comboboxVariants,\n comboboxLabelVariants,\n comboboxInputVariants,\n comboboxTriggerWrapperVariants,\n comboboxButtonVariants,\n comboboxPopoverVariants,\n comboboxListBoxVariants,\n comboboxItemVariants,\n comboboxSectionVariants,\n comboboxSectionHeaderVariants,\n comboboxDescriptionVariants,\n comboboxErrorVariants,\n} from './Combobox.styles';\n\n// ============================================================================\n// Combobox\n// ============================================================================\n\n/**\n * Combobox Component\n *\n * A filterable select/autocomplete component built on React Aria's ComboBox.\n * Supports type-to-filter, keyboard navigation, and optional custom values.\n *\n * @example\n * ```tsx\n * <Combobox label=\"Framework\">\n * <ComboboxItem id=\"react\">React</ComboboxItem>\n * <ComboboxItem id=\"vue\">Vue</ComboboxItem>\n * <ComboboxItem id=\"angular\">Angular</ComboboxItem>\n * </Combobox>\n * ```\n */\nexport const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(\n (\n {\n className,\n size = 'default',\n label,\n description,\n errorMessage,\n isRequired,\n isDisabled,\n isReadOnly,\n placeholder,\n name,\n allowsCustomValue = false,\n menuTrigger = 'input',\n defaultInputValue,\n inputValue,\n defaultSelectedKey,\n selectedKey,\n onInputChange,\n onSelectionChange,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'data-testid': dataTestId,\n ...props\n },\n ref\n ): ReactElement => {\n // Warn if no accessible label\n if (process.env.NODE_ENV !== 'production') {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n '[Combobox] Either label, aria-label, or aria-labelledby is required for accessibility (WCAG 1.1.1)'\n );\n }\n }\n\n return (\n <AriaComboBox\n ref={ref}\n className={cn(comboboxVariants({ size }), className)}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n name={name}\n allowsCustomValue={allowsCustomValue}\n menuTrigger={menuTrigger}\n defaultInputValue={defaultInputValue}\n inputValue={inputValue}\n defaultSelectedKey={defaultSelectedKey}\n selectedKey={selectedKey}\n onInputChange={onInputChange}\n onSelectionChange={onSelectionChange}\n aria-label={!label ? ariaLabel : undefined}\n aria-labelledby={ariaLabelledBy}\n data-testid={dataTestId}\n {...props}\n >\n {label && (\n <AriaLabel className={comboboxLabelVariants({ size })}>\n {label}\n {isRequired && (\n <span className=\"text-[var(--destructive-background)] ml-1\" aria-hidden=\"true\">\n *\n </span>\n )}\n </AriaLabel>\n )}\n\n <div className={cn(FIELD_TOUCH_TARGET, comboboxTriggerWrapperVariants({ size }))}>\n <AriaInput\n className={comboboxInputVariants({ size })}\n placeholder={placeholder}\n />\n <AriaButton className={comboboxButtonVariants({ size })}>\n <ChevronsUpDown className=\"h-4 w-4\" strokeWidth={1.5} aria-hidden=\"true\" />\n </AriaButton>\n </div>\n\n {description && !errorMessage && (\n <AriaText slot=\"description\" className={comboboxDescriptionVariants({ size })}>\n {description}\n </AriaText>\n )}\n\n {errorMessage && (\n <AriaText slot=\"errorMessage\" className={comboboxErrorVariants({ size })}>\n {errorMessage}\n </AriaText>\n )}\n\n <AriaPopover\n shouldCloseOnInteractOutside={createInteractOutsideGuard()}\n className={comboboxPopoverVariants()}\n >\n <AriaListBox className={comboboxListBoxVariants()}>\n {children}\n </AriaListBox>\n </AriaPopover>\n </AriaComboBox>\n );\n }\n);\n\nCombobox.displayName = 'Combobox';\n\n// ============================================================================\n// ComboboxItem\n// ============================================================================\n\nexport function ComboboxItem({\n children,\n className,\n textValue,\n ...props\n}: ComboboxItemProps): ReactElement {\n // Compute textValue from string children if not explicitly provided\n const computedTextValue = textValue || (typeof children === 'string' ? children : undefined);\n\n return (\n <AriaListBoxItem\n className={cn(comboboxItemVariants({ size: 'default' }), className)}\n textValue={computedTextValue}\n {...props}\n >\n {({ isSelected }) => (\n <>\n <span className=\"flex-1\">{children}</span>\n {isSelected && (\n <Check className=\"h-4 w-4 shrink-0 text-[var(--primary)]\" aria-hidden=\"true\" />\n )}\n </>\n )}\n </AriaListBoxItem>\n );\n}\n\nComboboxItem.displayName = 'ComboboxItem';\n\n// ============================================================================\n// ComboboxSection\n// ============================================================================\n\nexport function ComboboxSection({\n header,\n children,\n className,\n}: ComboboxSectionProps): ReactElement {\n return (\n <AriaListBoxSection className={cn(comboboxSectionVariants(), className)}>\n {header && (\n <AriaHeader className={comboboxSectionHeaderVariants()}>\n {header}\n </AriaHeader>\n )}\n {children}\n </AriaListBoxSection>\n );\n}\n\nComboboxSection.displayName = 'ComboboxSection';\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport { FIELD_INPUT_SIZES } from '../../styles';\n\n/**\n * CVA Variants for Select Trigger Button\n *\n * Styles the trigger button that opens the select popover.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectTriggerVariants = cva(\n [\n // Base styles\n 'flex',\n 'w-full',\n 'items-center',\n 'justify-between',\n 'gap-2',\n 'rounded-md',\n 'border',\n 'bg-[var(--content-background)]',\n 'text-[var(--content-foreground)]',\n 'transition-colors',\n 'duration-200',\n 'outline-none',\n // Focus ring (WCAG 2.2 AAA - 7:1 contrast)\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n // Hover state\n 'hover:bg-[var(--accent)]/10',\n // Disabled state\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n // Loading state\n 'data-[loading=true]:cursor-wait',\n // Truncate text\n 'truncate',\n ],\n {\n variants: {\n size: {\n sm: `${FIELD_INPUT_SIZES.sm} pr-1`,\n default: `${FIELD_INPUT_SIZES.default} pr-1.5`,\n lg: `${FIELD_INPUT_SIZES.lg} pr-2`,\n },\n isInvalid: {\n true: 'border-[var(--destructive-background)]',\n false: 'border-[var(--input-border)] hover:border-[var(--input-border)]/80',\n },\n },\n defaultVariants: {\n size: 'default',\n isInvalid: false,\n },\n }\n);\n\n/**\n * CVA Variants for Select Items\n *\n * Styles individual selectable items within the listbox.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectItemVariants = cva(\n [\n // Base styles\n 'relative',\n 'flex',\n 'w-full',\n 'cursor-pointer',\n 'select-none',\n 'items-center',\n 'rounded-sm',\n 'outline-none',\n 'transition-colors',\n // Padding for checkmark icon (left side)\n 'pl-8',\n 'pr-2',\n // Hover state\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n // Focus state\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n // Selected state\n 'data-[selected=true]:bg-[var(--accent)]',\n 'data-[selected=true]:text-[var(--accent-foreground)]',\n // Disabled state\n 'data-[disabled=true]:pointer-events-none',\n 'data-[disabled=true]:opacity-50',\n 'data-[disabled=true]:text-[var(--menu-muted)]',\n ],\n {\n variants: {\n size: {\n sm: `${FIELD_INPUT_SIZES.sm} py-1`,\n default: `${FIELD_INPUT_SIZES.default} py-2`,\n lg: `${FIELD_INPUT_SIZES.lg} py-3`,\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Select Popover\n *\n * Styles the popover container that holds the listbox.\n * Uses menu tokens to match Dropdown styling.\n */\nexport const selectPopoverVariants = cva(\n [\n // Base styles - use menu tokens to match Dropdown styling\n 'z-50',\n 'w-[--trigger-width]',\n 'rounded-md',\n 'border',\n 'border-[var(--menu-border)]',\n 'bg-[var(--menu-background)]',\n 'text-[var(--menu-foreground)]',\n 'outline-none',\n 'overflow-auto',\n // Animations\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n ],\n {\n variants: {\n size: {\n sm: 'max-h-[200px] p-1',\n default: 'max-h-[300px] p-1',\n lg: 'max-h-[400px] p-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Section Headers\n *\n * Styles the non-interactive section header labels within grouped selects.\n */\nexport const selectSectionVariants = cva(\n [\n 'px-2',\n 'py-1.5',\n 'text-xs',\n 'font-semibold',\n 'text-[var(--menu-muted)]',\n 'uppercase',\n 'tracking-wider',\n ],\n {\n variants: {\n size: {\n sm: 'px-2 py-1 text-[10px]',\n default: 'px-2 py-1 text-xs',\n lg: 'px-2 py-1.5 text-xs',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Error Messages\n *\n * Styles the error message displayed below the select trigger.\n */\nexport const selectErrorVariants = cva(\n [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-sm',\n 'font-medium',\n 'text-[var(--destructive-background)]',\n // mt-1 (4px) per design spec \"Input → hint: 4px\"; variants below override for size\n 'mt-1',\n ],\n {\n variants: {\n size: {\n sm: 'text-xs mt-1',\n default: 'text-sm mt-1',\n lg: 'text-base mt-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * Type exports for variant props.\n * Allows TypeScript inference of variant combinations.\n */\nexport type SelectTriggerVariantProps = VariantProps<typeof selectTriggerVariants>;\nexport type SelectItemVariantProps = VariantProps<typeof selectItemVariants>;\nexport type SelectPopoverVariantProps = VariantProps<typeof selectPopoverVariants>;\nexport type SelectSectionVariantProps = VariantProps<typeof selectSectionVariants>;\nexport type SelectErrorVariantProps = VariantProps<typeof selectErrorVariants>;\n","'use client';\n\n/**\n * Select Component - Implementation\n *\n * Accessible select/dropdown component combining React Aria primitives with ShadCN styling.\n * Follows Themis library patterns with compound component structure.\n *\n * Architecture:\n * - SelectBase: Internal component containing shared label, description, trigger, error, and listbox rendering.\n * - SelectRoot: Single selection wrapper (thin layer over SelectBase).\n * - MultiSelectRoot: Multiple selection wrapper with display value logic (thin layer over SelectBase).\n * - SelectItem, SelectSection, SelectHeader: Compound sub-components.\n *\n * @see select-prd.md (Full requirements)\n * @see Select.types.ts (Zod schemas)\n * @see Select.styles.ts (CVA variant definitions)\n * @see plan.md (Implementation plan)\n */\n\nimport {\n forwardRef,\n memo,\n Children,\n useId,\n useMemo,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport {\n Select as AriaSelect,\n Label,\n Button,\n SelectValue,\n Popover,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Header,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { Check, CheckSquare, ChevronDown, Loader2 } from 'lucide-react';\nimport { FIELD_TOUCH_TARGET } from '../../styles';\nimport { cn } from '../../utils/cn';\nimport { createInteractOutsideGuard } from '../../utils/browserExtensionOverlay';\nimport type {\n SelectProps,\n SelectItemProps,\n SelectSectionProps,\n SelectHeaderProps,\n SelectSize,\n} from './Select.types';\nimport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n// Re-export CVA variants so existing imports from './Select' continue to work\nexport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n// Hoisted static JSX — avoids re-creation on every render\nconst LOADING_SKELETON = Array.from({ length: 3 }).map((_, i) => (\n <div\n key={`skeleton-${i}`}\n className=\"h-11 px-4 py-2\"\n >\n <div className=\"h-4 bg-[var(--accent-background)] rounded animate-pulse\" />\n </div>\n));\n\n/**\n * Internal props for SelectBase.\n * Extends the shared props with selection-mode-specific configuration.\n */\ninterface SelectBaseProps {\n /** The AriaSelect props to spread onto the root element */\n ariaSelectProps: Record<string, unknown>;\n /** Content to render inside the trigger button (SelectValue for single, span for multi) */\n triggerContent: ReactNode;\n /** Ref to forward to the trigger button */\n triggerRef: Ref<HTMLButtonElement>;\n /** Label text */\n label: string;\n /** Optional description text */\n description?: string;\n /** Whether the field is required */\n isRequired: boolean;\n /** Whether the field is disabled */\n isDisabled: boolean;\n /** Whether the field is in a loading state */\n isLoading: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Size variant */\n size: SelectSize;\n /** Empty state message override */\n emptyStateMessage?: string;\n /** Child count (pre-computed by parent) */\n childCount: number;\n /** Children to render in the listbox */\n children: ReactNode;\n}\n\n/**\n * SelectBase - Internal shared rendering component\n *\n * Contains the shared rendering logic for label, description, trigger button,\n * error message, and popover/listbox that both SelectRoot and MultiSelectRoot use.\n * This is not exported as part of the public API.\n */\nfunction SelectBase({\n ariaSelectProps,\n triggerContent,\n triggerRef,\n label,\n description,\n isRequired,\n isDisabled,\n isLoading,\n errorMessage,\n size,\n emptyStateMessage,\n childCount,\n children,\n}: SelectBaseProps): ReactElement {\n // Generate unique IDs for accessibility\n const labelId = useId();\n const descriptionId = useId();\n const errorId = useId();\n\n // Determine if invalid based on errorMessage\n const isInvalid = Boolean(errorMessage);\n\n // Stack label, description, trigger and error vertically (matching TextField). Without\n // this the inline <label> and description <span> collapse onto one line, so the helper\n // text reads as part of the label instead of sitting beneath the field.\n const { className: rootClassName, ...restAriaSelectProps } = ariaSelectProps as { className?: string } & Record<string, unknown>;\n\n return (\n <AriaSelect\n {...restAriaSelectProps}\n className={cn('flex flex-col gap-1.5', rootClassName)}\n isInvalid={isInvalid}\n >\n {/* Label */}\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && <span className=\"text-[var(--destructive-background)] ml-1\">*</span>}\n </Label>\n\n {/* Description (if provided) — sits below the label; the root's gap handles spacing. */}\n {description && (\n <Text id={descriptionId} slot=\"description\" className=\"text-sm text-[var(--menu-muted)]\">\n {description}\n </Text>\n )}\n\n {/* Layer 1: Touch target (44px min) */}\n <div className={FIELD_TOUCH_TARGET}>\n {/* Layer 2: Visual trigger button */}\n <Button\n ref={triggerRef}\n className={selectTriggerVariants({ size, isInvalid })}\n aria-labelledby={labelId}\n aria-describedby={description ? descriptionId : errorMessage ? errorId : undefined}\n data-loading={isLoading}\n {...(isRequired && { 'aria-required': 'true' })}\n {...(isLoading && { 'aria-busy': 'true' })}\n {...((isDisabled || isLoading) && { 'aria-disabled': 'true' })}\n >\n {triggerContent}\n\n {/* Loading spinner or chevron icon */}\n {isLoading ? (\n <Loader2 className=\"ml-auto h-4 w-4 shrink-0 animate-spin text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n ) : (\n <ChevronDown className=\"ml-auto h-4 w-4 shrink-0 text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n )}\n </Button>\n </div>\n\n {/* Error Message — text only, no decorative icon. Errors are conveyed\n by the red border on the trigger plus the message text colour;\n a leading icon adds visual noise that the other field types don't\n carry (NumberField, TextField error message, RichTextEditor). */}\n <FieldError id={errorId} className={selectErrorVariants({ size })}>\n {({ validationErrors }) => {\n const displayError = errorMessage || validationErrors.join(' ');\n return displayError ? <>{displayError}</> : null;\n }}\n </FieldError>\n\n {/* Popover with ListBox */}\n <Popover\n shouldCloseOnInteractOutside={createInteractOutsideGuard()}\n className={selectPopoverVariants({ size })}\n >\n <ListBox className=\"outline-none\">\n {/* Loading skeleton (if loading and has children) */}\n {isLoading && childCount > 0 && LOADING_SKELETON}\n\n {/* Items or empty state */}\n {!isLoading && (\n <>\n {children}\n {/* Empty state - render as disabled item so popover can open */}\n {childCount === 0 && (\n <ListBoxItem\n id=\"__empty__\"\n textValue=\"empty\"\n isDisabled\n className=\"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none\"\n >\n <span role=\"status\">\n {emptyStateMessage || 'No options available'}\n </span>\n </ListBoxItem>\n )}\n </>\n )}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n}\n\n/**\n * Select Root Component (Single Selection Only)\n *\n * Main select component with controlled/uncontrolled modes for single selection.\n * For multiple selection, use MultiSelect component.\n * Delegates shared rendering to SelectBase.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst SelectRoot = forwardRef<HTMLButtonElement, Omit<SelectProps, 'selectionMode'>>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items (Decision 22: Large Item Count Handling)\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string,\n defaultValue: defaultValue as string,\n onChange: (key: unknown) => {\n if (onChange) {\n onChange(key as string);\n }\n },\n placeholder,\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={<SelectValue className=\"flex-1 text-left truncate\" />}\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nSelectRoot.displayName = 'Select';\n\n/**\n * MultiSelect Root Component (Multiple Selection)\n *\n * Select component for multiple selection. Uses different API from single Select.\n * Delegates shared rendering to SelectBase, adding multi-select display value logic.\n *\n * @see select-prd.md US-6 (Multiple Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst MultiSelectRoot = forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n selectionMode: _selectionMode = 'multiple',\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n // Build value-to-label map for display (memoized to prevent recreation on every render)\n const valueToLabelMap = useMemo(() => {\n const map = new Map<string, string>();\n const processChildren = (nodes: ReactNode): void => {\n Children.forEach(nodes, (child) => {\n if (isValidElement(child)) {\n const element = child as ReactElement<{ value?: string; children?: ReactNode }>;\n if (element.type === SelectItem || element.props?.value) {\n const itemValue = element.props.value;\n const itemChildren = element.props.children;\n if (itemValue && typeof itemChildren === 'string') {\n map.set(itemValue, itemChildren);\n }\n }\n if (element.props?.children) {\n processChildren(element.props.children);\n }\n }\n });\n };\n processChildren(children);\n return map;\n }, [children]);\n\n // Multi-select display logic (Decision 5: Multi-select threshold)\n // Memoized to prevent recalculation on every render\n const displayValue = useMemo(() => {\n if (!value || !Array.isArray(value) || value.length === 0) {\n return placeholder || '';\n }\n\n if (value.length <= 2) {\n // Show item labels for 1-2 items\n const labels = value.map(v => valueToLabelMap.get(v as string) || v);\n return labels.join(', ');\n }\n\n // Show count for 3+ items\n return `${value.length} items selected`;\n }, [value, valueToLabelMap, placeholder]);\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string[],\n defaultValue: defaultValue as string[],\n onChange: (keys: unknown) => {\n if (onChange) {\n onChange(keys as string[]);\n }\n },\n selectionMode: 'multiple',\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={\n <span className=\"flex-1 text-left truncate\">\n {displayValue}\n </span>\n }\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nMultiSelectRoot.displayName = 'MultiSelect';\n\n/**\n * Select.Item Component\n *\n * Individual selectable item with checkmark icon.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 6 (Left-side checkmark)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nconst SelectItem = memo(function SelectItem({ children, textValue, value, isDisabled = false, className, ...props }: SelectItemProps): ReactElement {\n // Validate textValue for custom children (Decision 23)\n if (!textValue && typeof children !== 'string') {\n const message = 'Select.Item with custom children requires textValue prop for accessibility';\n if (process.env.NODE_ENV === 'development') {\n throw new Error(message);\n } else {\n console.warn(message);\n }\n }\n\n return (\n <ListBoxItem\n id={value}\n textValue={textValue || (typeof children === 'string' ? children : undefined)}\n className={`${selectItemVariants({ size: 'default' })} ${className || ''}`}\n isDisabled={isDisabled}\n {...props}\n >\n {({ isSelected, selectionMode, isDisabled: itemDisabled }) => (\n <>\n {/* Checkmark icon (left side) - Decision 6 */}\n {selectionMode === 'multiple' ? (\n <CheckSquare\n className={`absolute left-2 h-4 w-4 ${isSelected ? 'visible' : 'invisible'}`}\n aria-hidden=\"true\"\n />\n ) : (\n isSelected && <Check className=\"absolute left-2 h-4 w-4\" aria-hidden=\"true\" />\n )}\n <span className={itemDisabled ? 'text-[var(--menu-muted)]' : ''}>\n {children}\n </span>\n </>\n )}\n </ListBoxItem>\n );\n});\n\nSelectItem.displayName = 'SelectItem';\n\n/**\n * Select.Section Component\n *\n * Groups related items with optional header.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectSection({ children, className, ...props }: SelectSectionProps): ReactElement {\n return (\n <ListBoxSection className={`border-t border-[var(--border)] first:border-t-0 ${className || ''}`} {...props}>\n {children}\n </ListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n\n/**\n * Select.Header Component\n *\n * Section header with non-interactive label.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectHeader({ children, className, ...props }: SelectHeaderProps): ReactElement {\n return (\n <Header className={`${selectSectionVariants({ size: 'default' })} ${className || ''}`} {...props}>\n {children}\n </Header>\n );\n}\n\nSelectHeader.displayName = 'SelectHeader';\n\n/**\n * Compound Component Exports\n *\n * Uses Object.assign() for compound components (e.g., Select.Item, Select.Section).\n * Named exports (SelectItem, SelectSection, SelectHeader) are also available below\n * for better tree-shaking. Prefer named exports in new code.\n *\n * @deprecated (v2) The Object.assign compound pattern will be removed in v2.\n * Migrate to named imports: `import { SelectItem, SelectSection, SelectHeader } from '...'`\n *\n * @see GUIDE.mdx (Compound component pattern)\n */\nexport const Select = Object.assign(SelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\nexport const MultiSelect = Object.assign(MultiSelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\n// Named exports for individual components (preferred for tree-shaking)\nexport { SelectRoot, MultiSelectRoot, SelectItem, SelectSection, SelectHeader };\n","\"use client\";\n\n/**\n * Badge Component - 2-Layer Architecture for Actionable Badges\n * Accessible badge with React Aria primitives and CVA styling\n *\n * Architecture:\n * - Static badges: Single span element\n * - Actionable badges (with onPress):\n * - Layer 1: Touch Target (44x44px WCAG AAA compliant, transparent)\n * - Layer 2: Visual Badge (compact size, colors)\n *\n * @see plan.md for architecture details\n * @see badge-prd.md for requirements\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, type ReactElement } from 'react';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport {\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED,\n} from '../../styles/interaction-states';\nimport type { BadgeProps } from './Badge.types';\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * Only used for actionable badges (with onPress)\n * Handles WCAG 2.2 AAA touch target requirement\n * IMPORTANT: Focus ring stays on Layer 1 for AAA compliance (2.4.13)\n */\nexport const badgeOuterVariants = cva(\n [\n 'relative inline-flex items-center justify-center',\n 'min-h-[44px] min-w-[44px]',\n 'focus-visible:outline-none',\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-[var(--page-background)]',\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n ],\n {\n variants: {},\n defaultVariants: {},\n }\n);\n\n/**\n * Layer 2: Visual Badge appearance\n * Used for all badges (both static and actionable)\n * Provides the visual appearance with configurable size and variant\n * NOTE: NO focus-visible styles here - focus ring is on Layer 1\n */\nexport const badgeVisualVariants = cva(\n [\n 'inline-flex items-center justify-center',\n 'gap-1',\n 'rounded-full',\n 'font-medium',\n 'whitespace-nowrap',\n 'transition-colors',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'bg-[var(--primary-action)]',\n 'text-[var(--primary-action-foreground)]',\n 'hover:bg-[var(--primary-action)]/90',\n 'data-[pressed]:bg-[var(--primary-action)]/80',\n ],\n accent: [\n 'bg-[var(--accent-background)]',\n 'text-[var(--accent-foreground)]',\n 'hover:bg-[var(--accent-background)]/90',\n 'data-[pressed]:bg-[var(--accent-background)]/80',\n ],\n destructive: [\n 'bg-[var(--destructive-background)]',\n 'text-[var(--destructive-foreground)]',\n 'hover:bg-[var(--destructive-background)]/90',\n 'data-[pressed]:bg-[var(--destructive-background)]/80',\n ],\n content: [\n 'bg-[var(--accent-background)]',\n 'text-[var(--accent-foreground)]',\n 'hover:bg-[var(--accent-background)]/90',\n 'data-[pressed]:bg-[var(--accent-background)]/80',\n ],\n },\n size: {\n sm: 'h-5 px-2 text-xs',\n default: 'h-6 px-2.5 text-xs',\n lg: 'h-7 px-3 text-sm',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'default',\n },\n }\n);\n\n/**\n * @deprecated Use badgeVisualVariants instead. This alias is kept for backward compatibility.\n */\nexport const badgeVariants = badgeVisualVariants;\n\n// Icon size classes mapped to badge sizes\n// Sizes are proportional to badge height: sm=20px, default=24px, lg=28px\nconst iconSizeClasses: Record<NonNullable<BadgeProps['size']>, string> = {\n sm: '[&_svg]:h-2.5 [&_svg]:w-2.5', // 10px icons for 20px badge\n default: '[&_svg]:h-3 [&_svg]:w-3', // 12px icons for 24px badge\n lg: '[&_svg]:h-3.5 [&_svg]:w-3.5', // 14px icons for 28px badge\n};\n\n/**\n * Badge Component - Accessible badge for labels, tags, and status indicators\n *\n * Features:\n * - WCAG 2.2 AAA compliant (7:1 contrast, 44x44px touch targets for actionable)\n * - 4 semantic variants (primary, accent, destructive, content)\n * - 3 sizes (sm, default, lg)\n * - Icon support with configurable position\n * - Count display (number or string)\n * - Static badges (span) vs actionable badges (button)\n */\nconst Badge = memo(\n forwardRef<HTMLButtonElement | HTMLSpanElement, BadgeProps>(\n (\n {\n className,\n variant = 'primary',\n size = 'default',\n children,\n icon,\n iconPosition = 'start',\n count,\n onPress,\n isDisabled,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'data-testid': dataTestId,\n ...props\n },\n ref\n ): ReactElement => {\n // Visual classes for the badge appearance\n const visualClasses = cn(\n badgeVisualVariants({ variant, size }),\n iconSizeClasses[size],\n className\n );\n\n // Check if we have multiple content elements (need gap styling)\n const hasIcon = !!icon;\n const hasCount = count !== undefined;\n const hasChildren = !!children;\n const multipleElements =\n [hasIcon, hasCount, hasChildren].filter(Boolean).length > 1;\n\n // Content rendering: icon + children + count (all can display together)\n // Only wrap children in span when there are multiple elements (for gap)\n const renderContent = (): ReactElement => (\n <>\n {icon && iconPosition === 'start' && (\n <span className=\"shrink-0\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {children && (multipleElements ? <span>{children}</span> : children)}\n {count !== undefined && (\n <span className=\"font-mono tabular-nums\">{count}</span>\n )}\n {icon && iconPosition === 'end' && (\n <span className=\"shrink-0\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n </>\n );\n\n // Actionable badge (with onPress) - uses 2-layer architecture\n if (onPress) {\n return (\n <AriaButton\n ref={ref as React.Ref<HTMLButtonElement>}\n isDisabled={isDisabled}\n onPress={onPress}\n className={badgeOuterVariants()}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-testid={dataTestId}\n {...(props as Omit<AriaButtonProps, 'className'>)}\n >\n {(renderProps) => (\n <span\n className={cn(\n visualClasses,\n // Interaction styles for visual feedback\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED\n )}\n data-pressed={renderProps.isPressed || undefined}\n >\n {renderContent()}\n </span>\n )}\n </AriaButton>\n );\n }\n\n // Static badge - simple span element\n return (\n <span\n ref={ref as React.Ref<HTMLSpanElement>}\n className={visualClasses}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-testid={dataTestId}\n {...props}\n >\n {renderContent()}\n </span>\n );\n }\n )\n);\n\nBadge.displayName = 'Badge';\n\nexport { Badge };\n","import { cva } from 'class-variance-authority';\n\n/** The filter bar — a horizontal, wrapping row of controls. */\nexport const filtersBarVariants = cva([\n 'flex flex-wrap items-center gap-2',\n]);\n\n/** A filter pill trigger (the button that opens a popover). */\nexport const filterPillVariants = cva([\n 'inline-flex items-center gap-2',\n]);\n\n/** The popover panel surface. */\nexport const filterPopoverVariants = cva([\n 'min-w-[14rem] max-w-[20rem] rounded-md border border-[var(--border)]',\n 'bg-[var(--content-background)] p-2 shadow-md',\n 'motion-safe:data-[entering]:animate-in motion-safe:data-[entering]:fade-in-0',\n 'motion-safe:data-[exiting]:animate-out motion-safe:data-[exiting]:fade-out-0',\n]);\n\n/** The popover header (label + Done). */\nexport const filterPopoverHeaderVariants = cva([\n 'flex items-center justify-between gap-2 px-1 pb-2 mb-1',\n 'border-b border-[var(--border)]',\n]);\n\n/** Chips region. */\nexport const appliedFiltersVariants = cva(['flex items-center gap-2'], {\n variants: {\n // On mobile chips scroll horizontally instead of wrapping.\n scrollable: {\n true: 'flex-nowrap overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&>*]:flex-none',\n false: 'flex-wrap',\n },\n },\n defaultVariants: { scrollable: false },\n});\n\n// ── Mobile bottom-sheet (narrow Filters) ───────────────────────────────────\n\n/** Backdrop behind the bottom-sheet. */\nexport const filterSheetBackdropVariants = cva([\n 'fixed inset-0 z-[80] bg-[rgb(23_23_23_/_0.42)]',\n 'motion-safe:data-[entering]:animate-in motion-safe:data-[entering]:fade-in-0',\n 'motion-safe:data-[exiting]:animate-out motion-safe:data-[exiting]:fade-out-0',\n]);\n\n/** The bottom-sheet panel itself. */\nexport const filterSheetVariants = cva([\n 'fixed inset-x-0 bottom-0 z-[81] flex max-h-[88vh] flex-col',\n 'rounded-t-3xl border-t border-[var(--border)] bg-[var(--content-background)]',\n 'motion-safe:data-[entering]:animate-in motion-safe:data-[entering]:slide-in-from-bottom',\n 'motion-safe:data-[exiting]:animate-out motion-safe:data-[exiting]:slide-out-to-bottom',\n]);\n\nexport const filterSheetHeaderVariants = cva([\n 'flex items-center justify-between gap-2 px-5 py-3 border-b border-[var(--border)] flex-none',\n]);\n\nexport const filterSheetBodyVariants = cva([\n 'flex flex-col gap-5 overflow-auto p-5 flex-1',\n // Every control fills the sheet width (full-width stacked fields on mobile).\n '[&>*]:w-full',\n]);\n\nexport const filterSheetFooterVariants = cva([\n 'flex items-center justify-between gap-3 px-5 pt-3 flex-none',\n 'pb-[calc(0.75rem+env(safe-area-inset-bottom))] border-t border-[var(--border)]',\n]);\n\n/** Grab handle at the top of the sheet. */\nexport const filterSheetGrabVariants = cva([\n 'mx-auto mt-2.5 mb-0.5 h-1.5 w-10 flex-none rounded-full bg-[var(--border)]',\n]);\n\n/** A single removable chip (a button). */\nexport const filterChipVariants = cva([\n 'inline-flex items-center gap-1.5 min-h-[44px] px-3 rounded-full',\n 'border border-[var(--border)] bg-[var(--accent-background)]',\n 'text-sm text-[var(--content-foreground)]',\n 'hover:bg-[var(--accent)] motion-safe:transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2',\n 'cursor-pointer',\n]);\n","'use client';\n\n/**\n * FilterPopover — a NON-MODAL disclosure popover for a single filter control.\n *\n * Built on the React-Aria `DialogTrigger` + `Popover` + `Dialog` precedent (see\n * DatePicker). Crucially NON-modal: there is no `ModalOverlay`, so the page\n * behind stays interactive. React-Aria's `Popover` supplies outside-dismiss,\n * Esc, return-focus-to-trigger and auto-flip; `Dialog` is only a labelled\n * focus-scope (focus moves in on open, Tab is contained, no `aria-modal`).\n *\n * No hand-rolled focus-on-open effect — RAC's `Dialog` autofocus handles it\n * (focusing the checked control of a RadioGroup/CheckboxGroup when present).\n */\n\nimport { type ReactNode } from 'react';\nimport { DialogTrigger, Popover, Dialog } from 'react-aria-components';\nimport { ChevronDown } from 'lucide-react';\nimport { Button } from '../Button';\nimport { Badge } from '../Badge';\nimport { cn } from '../../utils/cn';\nimport { createInteractOutsideGuard } from '../../utils/browserExtensionOverlay';\nimport {\n filterPillVariants,\n filterPopoverVariants,\n filterPopoverHeaderVariants,\n} from './Filters.styles';\n\nexport interface FilterPopoverProps {\n /** Pill label (and the popover's accessible name). */\n label: string;\n /** Badge content (e.g. a count) shown when the filter is active. */\n badge?: string | number | null;\n /** Whether the filter is active (drives the pill's emphasis). */\n isActive?: boolean;\n /**\n * Popover body. Use the function form to receive `close` (single-choice\n * controls call it to close on select).\n */\n children: ReactNode | ((close: () => void) => ReactNode);\n /** Show a \"Done\" button in the header (multi-select). Omit for close-on-select. */\n doneLabel?: string;\n /** Popover alignment relative to the trigger. */\n align?: 'start' | 'end';\n className?: string;\n}\n\nexport function FilterPopover({\n label,\n badge,\n isActive = false,\n children,\n doneLabel,\n align = 'start',\n className,\n}: FilterPopoverProps): ReactNode {\n const hasBadge = badge !== null && badge !== undefined && badge !== '';\n\n return (\n <DialogTrigger>\n <Button\n variant={isActive ? 'secondary' : 'outline'}\n className={cn(filterPillVariants(), className)}\n >\n <span>{label}</span>\n {hasBadge && <Badge size=\"sm\">{String(badge)}</Badge>}\n <ChevronDown aria-hidden=\"true\" className=\"h-4 w-4 opacity-60\" />\n </Button>\n <Popover\n isNonModal\n shouldCloseOnInteractOutside={createInteractOutsideGuard()}\n placement={align === 'end' ? 'bottom end' : 'bottom start'}\n className={filterPopoverVariants()}\n >\n <Dialog aria-label={label} className=\"outline-none\">\n {({ close }) => (\n <>\n {doneLabel && (\n <div className={filterPopoverHeaderVariants()}>\n <span className=\"text-xs font-bold uppercase tracking-wide text-[var(--menu-muted)]\">\n {label}\n </span>\n <Button variant=\"link\" onPress={close}>\n {doneLabel}\n </Button>\n </div>\n )}\n {typeof children === 'function' ? children(close) : children}\n </>\n )}\n </Dialog>\n </Popover>\n </DialogTrigger>\n );\n}\n","'use client';\n\n/**\n * AppliedFilters — the removable applied-filter chips.\n *\n * Pure data in (`chips` from {@link deriveChips}); the consumer turns\n * `onRemove(chip)` into the next values map via {@link removeChip}. On removal\n * focus cascades (next chip → previous → \"Clear all\" → the region) so it never\n * drops to `<body>` (WCAG 2.4.3).\n */\n\nimport { forwardRef, useRef, type Ref } from 'react';\nimport { X } from 'lucide-react';\nimport { Button } from '../Button';\nimport { cn } from '../../utils/cn';\nimport { appliedFiltersVariants } from './Filters.styles';\nimport type { AppliedFiltersProps, FilterChip } from './Filters.types';\n\nfunction setRef<T>(ref: Ref<T> | undefined, value: T | null): void {\n if (typeof ref === 'function') ref(value);\n else if (ref) (ref as { current: T | null }).current = value;\n}\n\nconst AppliedFilters = forwardRef<HTMLDivElement, AppliedFiltersProps>(\n (\n {\n chips,\n onRemove,\n onClearAll,\n clearAllLabel,\n removeChipLabel,\n scrollable = false,\n 'aria-label': ariaLabel = 'Active filters',\n className,\n 'data-testid': dataTestId = 'applied-filters',\n },\n forwardedRef\n ) => {\n const regionRef = useRef<HTMLDivElement | null>(null);\n\n if (chips.length === 0) return null;\n\n const FOCUSABLE = 'button,a[href],input,select,textarea,[tabindex]:not([tabindex=\"-1\"])';\n\n const handleRemove = (chip: FilterChip, index: number): void => {\n const region = regionRef.current;\n const willBeEmpty = chips.length <= 1;\n\n if (willBeEmpty && region) {\n // The region unmounts (renders null) once empty — move focus to the\n // preceding region (the filter bar) BEFORE the removal so it never\n // drops to <body> (WCAG 2.4.3). Falls back to the region itself.\n const prev = region.previousElementSibling as HTMLElement | null;\n const target =\n (prev?.matches(FOCUSABLE) ? prev : prev?.querySelector<HTMLElement>(FOCUSABLE)) ??\n region;\n target.focus();\n onRemove(chip);\n return;\n }\n\n onRemove(chip);\n // After the chip at `index` unmounts, focus the chip now occupying that\n // slot (the former next), else the new last.\n requestAnimationFrame(() => {\n const current = regionRef.current;\n if (!current) return;\n const buttons = current.querySelectorAll<HTMLElement>('[data-chip]');\n if (buttons.length > 0) {\n buttons[Math.min(index, buttons.length - 1)]?.focus();\n } else {\n current.focus();\n }\n });\n };\n\n return (\n <div\n ref={(node) => {\n regionRef.current = node;\n setRef(forwardedRef, node);\n }}\n role=\"region\"\n aria-label={ariaLabel}\n tabIndex={-1}\n className={cn(appliedFiltersVariants({ scrollable }), 'outline-none', className)}\n data-testid={dataTestId}\n >\n {chips.map((chip, index) => (\n <Button\n key={chip.id}\n variant=\"outline\"\n data-chip\n aria-label={removeChipLabel(\n `${chip.group ? `${chip.group} ` : ''}${chip.label}`\n )}\n onPress={() => handleRemove(chip, index)}\n >\n {chip.group && (\n <span className=\"text-xs font-bold uppercase tracking-wide opacity-60\">\n {chip.group}\n </span>\n )}\n <span className=\"font-semibold\">{chip.label}</span>\n <X aria-hidden=\"true\" className=\"h-3.5 w-3.5 opacity-60\" />\n </Button>\n ))}\n {chips.length > 1 && (\n <Button\n variant=\"link\"\n onPress={() => {\n onClearAll();\n requestAnimationFrame(() => regionRef.current?.focus());\n }}\n >\n {clearAllLabel}\n </Button>\n )}\n </div>\n );\n }\n);\n\nAppliedFilters.displayName = 'AppliedFilters';\n\nexport { AppliedFilters };\n","'use client';\n\nimport { createContext, useContext, type MutableRefObject } from 'react';\nimport type {\n FilterValue,\n FilterValues,\n FiltersLabels,\n FilterChip,\n} from './Filters.types';\n\n/**\n * Each control registers how to interpret its value: whether it's active, the\n * chips it produces, and the value that clears it. `FilterChips` reads the\n * registry to derive removable chips without the consumer re-declaring metadata.\n */\nexport interface RegisteredControl {\n name: string;\n isActive: (value: FilterValue | undefined) => boolean;\n toChips: (value: FilterValue | undefined) => FilterChip[];\n clearedValue: FilterValue;\n}\n\nexport interface FiltersContextValue {\n values: FilterValues;\n /**\n * Narrow (mobile) layout: controls render stacked (full-width labelled fields)\n * for the bottom-sheet instead of inline pills.\n */\n narrow: boolean;\n /** Set a single key (spreads the latest values). */\n setValue: (name: string, value: FilterValue) => void;\n /** Replace the whole values map (used by \"Clear all\"). */\n replaceValues: (next: FilterValues) => void;\n labels: FiltersLabels;\n /** Live registry of mounted controls (insertion order ≈ DOM order). */\n registry: MutableRefObject<Map<string, RegisteredControl>>;\n /** Bumps whenever the registry changes — forces chip-consumers to re-read it. */\n registryVersion: number;\n /** Called by a control on mount / meta-change / unmount to refresh chips. */\n syncControl: (name: string, control: RegisteredControl | null) => void;\n}\n\nconst FiltersContext = createContext<FiltersContextValue | null>(null);\n\nexport function useFiltersContext(componentName: string): FiltersContextValue {\n const ctx = useContext(FiltersContext);\n if (!ctx) {\n throw new Error(`<${componentName}> must be rendered inside <Filters>.`);\n }\n return ctx;\n}\n\nexport { FiltersContext };\n","'use client';\n\n/**\n * Filters — a compositional, spec-light filter bar.\n *\n * `<Filters values onChange labels>` owns one controlled values map and shares it\n * via context. Controls are composed as children — `<FilterSearch>`,\n * `<FilterSelect>`, `<FilterMulti>`, `<FilterToggle>`, `<FilterWithin>`,\n * `<FilterCombobox>` (API-backed type-ahead) — plus an optional `<FilterChips>`\n * for removable applied-filter chips. Importing only the controls you use keeps\n * unused ones out of your bundle (named exports, no dot-namespace).\n *\n * Domain-free (labels-as-props), non-modal popovers, WCAG 2.2 AAA (44px targets,\n * focus-managed chip removal, labelled region).\n */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n Children,\n isValidElement,\n type ReactNode,\n} from 'react';\nimport { FocusScope } from 'react-aria';\nimport { SlidersHorizontal, X } from 'lucide-react';\nimport { SearchField } from '../SearchField';\nimport { Switch } from '../Switch';\nimport { RadioGroup, Radio } from '../RadioGroup';\nimport { CheckboxGroup, Checkbox } from '../CheckboxGroup';\nimport { Combobox, ComboboxItem } from '../Combobox';\nimport { Select } from '../Select';\nimport { Button } from '../Button';\nimport { Badge } from '../Badge';\nimport { cn } from '../../utils/cn';\nimport { FilterPopover } from './FilterPopover';\nimport { AppliedFilters } from './AppliedFilters';\nimport {\n FiltersContext,\n useFiltersContext,\n type RegisteredControl,\n} from './FiltersContext';\nimport {\n filtersBarVariants,\n filterPillVariants,\n filterSheetBackdropVariants,\n filterSheetVariants,\n filterSheetHeaderVariants,\n filterSheetBodyVariants,\n filterSheetFooterVariants,\n filterSheetGrabVariants,\n} from './Filters.styles';\nimport type {\n FilterChip,\n FilterOption,\n FilterValue,\n FilterValues,\n FiltersProps,\n FilterSearchProps,\n FilterSelectProps,\n FilterMultiProps,\n FilterToggleProps,\n FilterWithinProps,\n FilterComboboxProps,\n FilterChipsProps,\n} from './Filters.types';\n\n// ============================================================================\n// Root provider\n// ============================================================================\n\nconst Filters = forwardRef<HTMLDivElement, FiltersProps>(\n (\n {\n values,\n onChange,\n labels,\n narrow = false,\n children,\n 'aria-label': ariaLabel = 'Filters',\n className,\n 'data-testid': dataTestId = 'filters',\n },\n ref\n ) => {\n const registry = useRef<Map<string, RegisteredControl>>(new Map());\n const [registryVersion, setRegistryVersion] = useState(0);\n\n const valuesRef = useRef(values);\n valuesRef.current = values;\n\n const setValue = useCallback(\n (name: string, value: FilterValue) => {\n onChange({ ...valuesRef.current, [name]: value });\n },\n [onChange]\n );\n\n const replaceValues = useCallback(\n (next: FilterValues) => onChange(next),\n [onChange]\n );\n\n const syncControl = useCallback(\n (name: string, control: RegisteredControl | null) => {\n if (control) registry.current.set(name, control);\n else registry.current.delete(name);\n setRegistryVersion((n) => n + 1);\n },\n []\n );\n\n const contextValue = useMemo(\n () => ({ values, narrow, setValue, replaceValues, labels, registry, registryVersion, syncControl }),\n [values, narrow, setValue, replaceValues, labels, registryVersion, syncControl]\n );\n\n // Active-filter count (drives the mobile trigger badge). Reads the registry,\n // so it tracks registryVersion + values.\n const activeCount = useMemo(() => {\n let count = 0;\n for (const [name, control] of registry.current) {\n if (control.isActive(values[name])) count += 1;\n }\n return count;\n }, [values, registryVersion]);\n\n const clearAll = (): void => {\n const next: FilterValues = { ...valuesRef.current };\n for (const [name, control] of registry.current) next[name] = control.clearedValue;\n replaceValues(next);\n };\n\n // ── Mobile bottom-sheet state ──────────────────────────────────────────\n const [sheetOpen, setSheetOpen] = useState(false);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const backdropRef = useRef<HTMLDivElement>(null);\n\n const closeSheet = useCallback(() => {\n setSheetOpen(false);\n requestAnimationFrame(() => triggerRef.current?.focus());\n }, []);\n\n // Move focus into the sheet when it opens (the panel is always mounted so\n // the controls register even while closed — display:none, not Activity,\n // which would suspend their effects).\n useEffect(() => {\n if (!sheetOpen) return;\n const FOCUSABLE =\n 'button,a[href],input,select,textarea,[tabindex]:not([tabindex=\"-1\"])';\n panelRef.current?.querySelector<HTMLElement>(FOCUSABLE)?.focus();\n }, [sheetOpen]);\n\n // Dismiss the sheet on Escape or a tap on the backdrop. We match the backdrop\n // element specifically (not \"anything outside the panel\") so that clicks in a\n // control's portalled dropdown — a Select/Combobox listbox renders above the\n // backdrop, outside the panel — don't close the sheet mid-selection.\n useEffect(() => {\n if (!sheetOpen) return;\n const onDown = (e: PointerEvent): void => {\n const target = e.target as Node;\n if (backdropRef.current && backdropRef.current.contains(target)) {\n closeSheet();\n }\n };\n const onKey = (e: globalThis.KeyboardEvent): void => {\n if (e.key === 'Escape') {\n e.preventDefault();\n closeSheet();\n }\n };\n document.addEventListener('pointerdown', onDown, true);\n document.addEventListener('keydown', onKey);\n return () => {\n document.removeEventListener('pointerdown', onDown, true);\n document.removeEventListener('keydown', onKey);\n };\n }, [sheetOpen, closeSheet]);\n\n // Separate the controls from the chips so the bar can lay each out itself —\n // a pill row + chips row on desktop, stacked controls in the sheet + chips\n // under the trigger on mobile. Consumers pass controls + <FilterChips> as\n // direct children (no layout wrapper needed).\n const childArray = Children.toArray(children);\n const isChips = (c: ReactNode): boolean => isValidElement(c) && c.type === FilterChips;\n const chipsChildren = childArray.filter(isChips);\n const controlChildren = childArray.filter((c) => !isChips(c));\n\n if (narrow) {\n return (\n <FiltersContext.Provider value={contextValue}>\n <div\n ref={ref}\n role=\"region\"\n aria-label={ariaLabel}\n className={cn('flex flex-col gap-3', className)}\n data-testid={dataTestId}\n >\n <div>\n <Button\n ref={triggerRef}\n variant=\"outline\"\n className={filterPillVariants()}\n aria-haspopup=\"dialog\"\n aria-expanded={sheetOpen}\n onPress={() => setSheetOpen(true)}\n >\n <SlidersHorizontal aria-hidden=\"true\" className=\"h-4 w-4\" />\n <span>{labels.filtersButton ?? ariaLabel}</span>\n {activeCount > 0 && <Badge size=\"sm\">{String(activeCount)}</Badge>}\n </Button>\n </div>\n\n {sheetOpen && (\n <div ref={backdropRef} className={filterSheetBackdropVariants()} aria-hidden=\"true\" />\n )}\n\n {/* Always mounted (display:none when closed) so the controls keep their\n registration; FocusScope traps Tab while open. */}\n <FocusScope contain={sheetOpen} restoreFocus>\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-modal={sheetOpen || undefined}\n aria-label={ariaLabel}\n className={sheetOpen ? filterSheetVariants() : 'hidden'}\n >\n <span className={filterSheetGrabVariants()} aria-hidden=\"true\" />\n <div className={filterSheetHeaderVariants()}>\n <span className=\"text-lg font-semibold\">\n {labels.filtersButton ?? ariaLabel}\n </span>\n <Button\n variant=\"ghost\"\n visualSize=\"icon\"\n aria-label={labels.close ?? 'Close'}\n onPress={closeSheet}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </div>\n <div className={filterSheetBodyVariants()}>{controlChildren}</div>\n <div className={filterSheetFooterVariants()}>\n <Button variant=\"link\" onPress={clearAll}>\n {labels.clearAll ?? labels.clear}\n </Button>\n <Button variant=\"default\" onPress={closeSheet}>\n {labels.done}\n </Button>\n </div>\n </div>\n </FocusScope>\n\n {chipsChildren}\n </div>\n </FiltersContext.Provider>\n );\n }\n\n return (\n <FiltersContext.Provider value={contextValue}>\n <div\n ref={ref}\n role=\"region\"\n aria-label={ariaLabel}\n className={cn('flex flex-col gap-3', className)}\n data-testid={dataTestId}\n >\n <div className={filtersBarVariants()}>{controlChildren}</div>\n {chipsChildren}\n </div>\n </FiltersContext.Provider>\n );\n }\n);\n\nFilters.displayName = 'Filters';\n\n// ============================================================================\n// Shared registration hook\n// ============================================================================\n\nfunction useControlRegistration(name: string, control: RegisteredControl): void {\n const { syncControl } = useFiltersContext('Filter control');\n useEffect(() => {\n syncControl(name, control);\n return () => syncControl(name, null);\n }, [name, control, syncControl]);\n}\n\nfunction optionsSignature(options: FilterOption[]): string {\n return options.map((o) => `${o.value}\u0000${o.label}`).join('\u0001');\n}\n\nfunction optionLabel(options: FilterOption[], value: string): string {\n return options.find((o) => o.value === value)?.label ?? value;\n}\n\n// ============================================================================\n// FilterSearch\n// ============================================================================\n\nfunction FilterSearch({ name, label, placeholder, chipGroup, className }: FilterSearchProps): ReactNode {\n const { values, setValue } = useFiltersContext('FilterSearch');\n const value = typeof values[name] === 'string' ? (values[name] as string) : '';\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: '',\n isActive: (v) => typeof v === 'string' && v.trim() !== '',\n toChips: (v) =>\n typeof v === 'string' && v.trim() !== ''\n ? [{ id: name, key: name, label: `“${v}”`, group: chipGroup ?? label }]\n : [],\n }),\n [name, label, chipGroup]\n );\n useControlRegistration(name, control);\n\n return (\n <SearchField\n aria-label={label}\n placeholder={placeholder}\n value={value}\n onChange={(next) => setValue(name, next)}\n onClear={() => setValue(name, '')}\n className={cn('min-w-[14rem]', className)}\n />\n );\n}\n\n// ============================================================================\n// FilterToggle\n// ============================================================================\n\nfunction FilterToggle({ name, label, className }: FilterToggleProps): ReactNode {\n const { values, setValue } = useFiltersContext('FilterToggle');\n const value = values[name] === true;\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: false,\n isActive: (v) => v === true,\n toChips: (v) => (v === true ? [{ id: name, key: name, label }] : []),\n }),\n [name, label]\n );\n useControlRegistration(name, control);\n\n return (\n <Switch\n label={label}\n isSelected={value}\n onChange={(selected) => setValue(name, Boolean(selected))}\n className={className}\n />\n );\n}\n\n// ============================================================================\n// FilterSelect (single choice — closes on select)\n// ============================================================================\n\nconst SELECT_ALL_SENTINEL = '__all__';\n\nfunction FilterSelect({ name, label, options, allLabel, className }: FilterSelectProps): ReactNode {\n const { values, setValue, narrow } = useFiltersContext('FilterSelect');\n const value = typeof values[name] === 'string' ? (values[name] as string) : '';\n const sig = optionsSignature(options);\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: '',\n isActive: (v) => typeof v === 'string' && v !== '',\n toChips: (v) =>\n typeof v === 'string' && v !== ''\n ? [{ id: name, key: name, label: optionLabel(options, v), group: label }]\n : [],\n }),\n [name, label, sig]\n );\n useControlRegistration(name, control);\n\n // Mobile sheet: a full-width labelled Select (the \"All\" option clears it).\n if (narrow) {\n return (\n <Select\n label={label}\n value={value === '' ? SELECT_ALL_SENTINEL : value}\n onChange={(next: string | string[]) => {\n const v = Array.isArray(next) ? next[0] : next;\n setValue(name, !v || v === SELECT_ALL_SENTINEL ? '' : v);\n }}\n className={className}\n >\n <Select.Item value={SELECT_ALL_SENTINEL}>{allLabel ?? 'All'}</Select.Item>\n {options.map((option) => (\n <Select.Item key={option.value} value={option.value}>\n {option.label}\n </Select.Item>\n ))}\n </Select>\n );\n }\n\n return (\n <FilterPopover label={label} isActive={value !== ''} className={className}>\n {(close) => (\n <RadioGroup\n aria-label={label}\n value={value}\n onChange={(next) => {\n setValue(name, next);\n close();\n }}\n >\n <Radio value=\"\">{allLabel ?? 'All'}</Radio>\n {options.map((option) => (\n <Radio key={option.value} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </RadioGroup>\n )}\n </FilterPopover>\n );\n}\n\n// ============================================================================\n// FilterWithin (date-recency presets — closes on select)\n// ============================================================================\n\nfunction FilterWithin({ name, label, presets, className }: FilterWithinProps): ReactNode {\n const { values, setValue, narrow } = useFiltersContext('FilterWithin');\n const sentinel = presets[0]?.value ?? '';\n const value = typeof values[name] === 'string' ? (values[name] as string) : sentinel;\n const sig = optionsSignature(presets);\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: sentinel,\n isActive: (v) => typeof v === 'string' && v !== sentinel,\n toChips: (v) =>\n typeof v === 'string' && v !== sentinel\n ? [{ id: name, key: name, label: optionLabel(presets, v), group: label }]\n : [],\n }),\n [name, label, sentinel, sig]\n );\n useControlRegistration(name, control);\n\n const radios = (extra?: () => void) => (\n <RadioGroup\n label={narrow ? label : undefined}\n aria-label={narrow ? undefined : label}\n value={value}\n onChange={(next) => {\n setValue(name, next);\n extra?.();\n }}\n className={narrow ? className : undefined}\n >\n {presets.map((preset) => (\n <Radio key={preset.value} value={preset.value}>\n {preset.label}\n </Radio>\n ))}\n </RadioGroup>\n );\n\n // Mobile sheet: an inline labelled radio group (no popover).\n if (narrow) return radios();\n\n return (\n <FilterPopover label={label} isActive={value !== sentinel} className={className}>\n {(close) => radios(close)}\n </FilterPopover>\n );\n}\n\n// ============================================================================\n// FilterMulti (multiple choice — stays open, badge count, Done)\n// ============================================================================\n\nfunction FilterMulti({ name, label, options, className }: FilterMultiProps): ReactNode {\n const { values, setValue, labels, narrow } = useFiltersContext('FilterMulti');\n const value = Array.isArray(values[name]) ? (values[name] as string[]) : [];\n const sig = optionsSignature(options);\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: [],\n isActive: (v) => Array.isArray(v) && v.length > 0,\n toChips: (v) =>\n Array.isArray(v)\n ? v.map((optionValue) => ({\n id: `${name}:${optionValue}`,\n key: name,\n optionValue,\n label: optionLabel(options, optionValue),\n group: label,\n }))\n : [],\n }),\n [name, label, sig]\n );\n useControlRegistration(name, control);\n\n const checkboxes = (\n <CheckboxGroup\n label={narrow ? label : undefined}\n aria-label={narrow ? undefined : label}\n value={value}\n onChange={(next) => setValue(name, next)}\n className={narrow ? className : undefined}\n >\n {options.map((option) => (\n <Checkbox key={option.value} value={option.value}>\n {option.label}\n </Checkbox>\n ))}\n </CheckboxGroup>\n );\n\n // Mobile sheet: an inline labelled checkbox group (no popover).\n if (narrow) return checkboxes;\n\n return (\n <FilterPopover\n label={label}\n badge={value.length || null}\n isActive={value.length > 0}\n doneLabel={labels.done}\n className={className}\n >\n {checkboxes}\n {value.length > 0 && (\n <div className=\"pt-1\">\n <Button variant=\"link\" onPress={() => setValue(name, [])}>\n {labels.clear}\n </Button>\n </div>\n )}\n </FilterPopover>\n );\n}\n\n// ============================================================================\n// FilterCombobox (API-backed type-ahead single choice)\n// ============================================================================\n\nfunction FilterCombobox({\n name,\n label,\n options,\n onSearch,\n isLoading,\n placeholder,\n className,\n}: FilterComboboxProps): ReactNode {\n const { values, setValue } = useFiltersContext('FilterCombobox');\n const value = typeof values[name] === 'string' ? (values[name] as string) : '';\n\n // Remember selected labels so chips survive options changing during async search.\n const labelCache = useRef<Map<string, string>>(new Map());\n for (const option of options) labelCache.current.set(option.value, option.label);\n\n const control = useMemo<RegisteredControl>(\n () => ({\n name,\n clearedValue: '',\n isActive: (v) => typeof v === 'string' && v !== '',\n toChips: (v) =>\n typeof v === 'string' && v !== ''\n ? [{ id: name, key: name, label: labelCache.current.get(v) ?? v, group: label }]\n : [],\n }),\n [name, label]\n );\n useControlRegistration(name, control);\n\n return (\n <Combobox\n aria-label={label}\n placeholder={placeholder}\n selectedKey={value || null}\n onSelectionChange={(key) => setValue(name, key == null ? '' : String(key))}\n onInputChange={onSearch}\n className={cn('min-w-[14rem]', className)}\n >\n {options.length === 0 && isLoading ? (\n <ComboboxItem id=\"__loading\" isDisabled>\n Loading…\n </ComboboxItem>\n ) : (\n options.map((option) => <ComboboxItem key={option.value} id={option.value}>{option.label}</ComboboxItem>)\n )}\n </Combobox>\n );\n}\n\n// ============================================================================\n// FilterChips (auto-derived removable chips from the registry)\n// ============================================================================\n\nfunction FilterChips({\n clearAllLabel,\n removeChipLabel,\n 'aria-label': ariaLabel,\n className,\n 'data-testid': dataTestId,\n}: FilterChipsProps): ReactNode {\n const { values, setValue, replaceValues, registry, narrow } = useFiltersContext('FilterChips');\n\n const chips: FilterChip[] = [];\n for (const [name, control] of registry.current) {\n chips.push(...control.toChips(values[name]));\n }\n\n const handleRemove = (chip: FilterChip): void => {\n if (chip.optionValue !== undefined) {\n const current = values[chip.key];\n const list = Array.isArray(current) ? current : [];\n setValue(\n chip.key,\n list.filter((v) => v !== chip.optionValue)\n );\n } else {\n const control = registry.current.get(chip.key);\n setValue(chip.key, control ? control.clearedValue : '');\n }\n };\n\n const handleClearAll = (): void => {\n const next: FilterValues = { ...values };\n for (const [name, control] of registry.current) {\n next[name] = control.clearedValue;\n }\n replaceValues(next);\n };\n\n return (\n <AppliedFilters\n chips={chips}\n onRemove={handleRemove}\n onClearAll={handleClearAll}\n clearAllLabel={clearAllLabel}\n removeChipLabel={removeChipLabel}\n scrollable={narrow}\n aria-label={ariaLabel}\n className={className}\n data-testid={dataTestId}\n />\n );\n}\n\nexport {\n Filters,\n FilterSearch,\n FilterSelect,\n FilterMulti,\n FilterToggle,\n FilterWithin,\n FilterCombobox,\n FilterChips,\n};\n","import { z } from 'zod';\nimport type { ReactNode } from 'react';\n\n// ============================================================================\n// Options & values\n// ============================================================================\n\n/** A selectable option for select / multi / within / combobox controls. */\nexport interface FilterOption {\n /** Stable value persisted in the values map + chips. */\n value: string;\n /** Visible label (consumer-translated). */\n label: string;\n}\n\nexport const FilterOptionSchema = z.object({\n value: z.string(),\n label: z.string(),\n});\n\nexport type FilterValue = string | string[] | boolean;\nexport type FilterValues = Record<string, FilterValue>;\n\n// ============================================================================\n// Chips\n// ============================================================================\n\n/**\n * A derived, removable applied-filter chip — pure data (no `onRemove`).\n * `FilterChips` / `AppliedFilters` call back with the chip; the surrounding\n * `Filters` resets the value.\n */\nexport interface FilterChip {\n /** `${name}` for scalar filters, `${name}:${optionValue}` for one multi option. */\n id: string;\n /** The owning control's `name`. */\n key: string;\n /** For `multi`: the specific option this chip represents. */\n optionValue?: string;\n /** Human value, e.g. \"Open\", \"“senior”\", \"Last 7 days\". */\n label: string;\n /** Group label, e.g. the control label / \"Search\". */\n group?: string;\n}\n\n// ============================================================================\n// i18n\n// ============================================================================\n\nexport interface FiltersLabels {\n /** \"Done\" button inside multi-select popovers + the mobile sheet's apply button. */\n done: string;\n /** \"Clear\" link inside a multi-select popover. */\n clear: string;\n /** Mobile (narrow) \"Filters\" trigger button. Required when `narrow` is used. */\n filtersButton?: string;\n /** Mobile sheet footer \"Clear all\" button. Falls back to `clear`. */\n clearAll?: string;\n /** Mobile sheet header close-button aria-label. Falls back to \"Close\". */\n close?: string;\n}\n\n// ============================================================================\n// Root + control props\n// ============================================================================\n\nexport interface FiltersProps {\n /** Current values (controlled). Missing keys fall back to each control's default. */\n values: FilterValues;\n /** Called with the full next values map on any change. */\n onChange: (next: FilterValues) => void;\n /** i18n strings shared by the controls. */\n labels: FiltersLabels;\n /**\n * Narrow (mobile) layout. When `true`, the bar collapses to a \"Filters\" button\n * that opens a bottom-sheet of stacked controls. Measure once at the page level\n * (e.g. `useContainerNarrow`) and pass the same value here and to your table /\n * `TableCardList` switch so they reflow together. Default `false`.\n */\n narrow?: boolean;\n /** The filter controls (`<FilterSearch>`, `<FilterSelect>`, …) and optionally `<FilterChips>`. */\n children: ReactNode;\n /** Region `aria-label`, e.g. \"Filters\". */\n 'aria-label'?: string;\n className?: string;\n 'data-testid'?: string;\n}\n\ninterface BaseControlProps {\n /** Unique key — indexes into the values map and namespaces chip ids. */\n name: string;\n /** Pill / field label (consumer-translated). */\n label: string;\n className?: string;\n}\n\nexport interface FilterSearchProps extends BaseControlProps {\n placeholder?: string;\n /** Chip group label override; defaults to `label`. */\n chipGroup?: string;\n}\n\nexport interface FilterSelectProps extends BaseControlProps {\n options: FilterOption[];\n /** Label for the \"all / none\" radio. Defaults to \"All\". */\n allLabel?: string;\n}\n\nexport interface FilterMultiProps extends BaseControlProps {\n options: FilterOption[];\n}\n\nexport type FilterToggleProps = BaseControlProps;\n\nexport interface FilterWithinProps extends BaseControlProps {\n /** Ordered presets; `presets[0]` is the \"any time\" reset sentinel. */\n presets: FilterOption[];\n}\n\nexport interface FilterComboboxProps extends BaseControlProps {\n /** Current options. For API-backed search, update these in response to `onSearch`. */\n options: FilterOption[];\n /** Called (debounce in the consumer) as the user types — fetch + update `options`. */\n onSearch?: (query: string) => void;\n /** Show a loading state in the menu while options are being fetched. */\n isLoading?: boolean;\n placeholder?: string;\n}\n\nexport interface FilterChipsProps {\n /** Label for the \"Clear all\" control (shown when >1 chip). */\n clearAllLabel: string;\n /** Accessible-name builder for each chip's remove button, e.g. `(l) => \"Remove ${l}\"`. */\n removeChipLabel: (chipLabel: string) => string;\n /** Region `aria-label`, e.g. \"Active filters\". */\n 'aria-label'?: string;\n className?: string;\n 'data-testid'?: string;\n}\n\n// Standalone AppliedFilters (presentational chips, no Filters context needed)\nexport interface AppliedFiltersProps {\n chips: FilterChip[];\n onRemove: (chip: FilterChip) => void;\n onClearAll: () => void;\n clearAllLabel: string;\n removeChipLabel: (chipLabel: string) => string;\n /** Scroll chips horizontally instead of wrapping (mobile). Default `false`. */\n scrollable?: boolean;\n 'aria-label'?: string;\n className?: string;\n 'data-testid'?: string;\n}\n"]}