@rhammy/architect-core 1.0.0

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 (87) hide show
  1. package/CHANGELOG.md +178 -0
  2. package/LICENSE +21 -0
  3. package/README.md +355 -0
  4. package/dist/components/Accordion/Accordion.d.ts +34 -0
  5. package/dist/components/Accordion/Accordion.d.ts.map +1 -0
  6. package/dist/components/Accordion/index.d.ts +3 -0
  7. package/dist/components/Accordion/index.d.ts.map +1 -0
  8. package/dist/components/Button/Button.d.ts +21 -0
  9. package/dist/components/Button/Button.d.ts.map +1 -0
  10. package/dist/components/Button/index.d.ts +3 -0
  11. package/dist/components/Button/index.d.ts.map +1 -0
  12. package/dist/components/Checkbox/Checkbox.d.ts +25 -0
  13. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
  14. package/dist/components/Checkbox/index.d.ts +3 -0
  15. package/dist/components/Checkbox/index.d.ts.map +1 -0
  16. package/dist/components/Dialog/Dialog.d.ts +48 -0
  17. package/dist/components/Dialog/Dialog.d.ts.map +1 -0
  18. package/dist/components/Dialog/index.d.ts +3 -0
  19. package/dist/components/Dialog/index.d.ts.map +1 -0
  20. package/dist/components/Dropdown/Dropdown.d.ts +28 -0
  21. package/dist/components/Dropdown/Dropdown.d.ts.map +1 -0
  22. package/dist/components/Dropdown/index.d.ts +3 -0
  23. package/dist/components/Dropdown/index.d.ts.map +1 -0
  24. package/dist/components/Input/ErrorMessage.d.ts +9 -0
  25. package/dist/components/Input/ErrorMessage.d.ts.map +1 -0
  26. package/dist/components/Input/FormField.d.ts +24 -0
  27. package/dist/components/Input/FormField.d.ts.map +1 -0
  28. package/dist/components/Input/Input.d.ts +27 -0
  29. package/dist/components/Input/Input.d.ts.map +1 -0
  30. package/dist/components/Input/Label.d.ts +13 -0
  31. package/dist/components/Input/Label.d.ts.map +1 -0
  32. package/dist/components/Input/index.d.ts +10 -0
  33. package/dist/components/Input/index.d.ts.map +1 -0
  34. package/dist/components/Radio/Radio.d.ts +36 -0
  35. package/dist/components/Radio/Radio.d.ts.map +1 -0
  36. package/dist/components/Radio/index.d.ts +3 -0
  37. package/dist/components/Radio/index.d.ts.map +1 -0
  38. package/dist/components/Select/Select.d.ts +38 -0
  39. package/dist/components/Select/Select.d.ts.map +1 -0
  40. package/dist/components/Select/index.d.ts +3 -0
  41. package/dist/components/Select/index.d.ts.map +1 -0
  42. package/dist/components/Switch/Switch.d.ts +19 -0
  43. package/dist/components/Switch/Switch.d.ts.map +1 -0
  44. package/dist/components/Switch/index.d.ts +3 -0
  45. package/dist/components/Switch/index.d.ts.map +1 -0
  46. package/dist/components/Tabs/Tabs.d.ts +35 -0
  47. package/dist/components/Tabs/Tabs.d.ts.map +1 -0
  48. package/dist/components/Tabs/index.d.ts +3 -0
  49. package/dist/components/Tabs/index.d.ts.map +1 -0
  50. package/dist/components/Textarea/Textarea.d.ts +25 -0
  51. package/dist/components/Textarea/Textarea.d.ts.map +1 -0
  52. package/dist/components/Textarea/index.d.ts +3 -0
  53. package/dist/components/Textarea/index.d.ts.map +1 -0
  54. package/dist/components/Toast/Toast.d.ts +46 -0
  55. package/dist/components/Toast/Toast.d.ts.map +1 -0
  56. package/dist/components/Toast/index.d.ts +3 -0
  57. package/dist/components/Toast/index.d.ts.map +1 -0
  58. package/dist/components/Tooltip/Tooltip.d.ts +31 -0
  59. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
  60. package/dist/components/Tooltip/index.d.ts +3 -0
  61. package/dist/components/Tooltip/index.d.ts.map +1 -0
  62. package/dist/hooks/useClickOutside.d.ts +4 -0
  63. package/dist/hooks/useClickOutside.d.ts.map +1 -0
  64. package/dist/hooks/useControllableState.d.ts +19 -0
  65. package/dist/hooks/useControllableState.d.ts.map +1 -0
  66. package/dist/hooks/useEscapeKey.d.ts +13 -0
  67. package/dist/hooks/useEscapeKey.d.ts.map +1 -0
  68. package/dist/hooks/useFocusTrap.d.ts +15 -0
  69. package/dist/hooks/useFocusTrap.d.ts.map +1 -0
  70. package/dist/hooks/useId.d.ts +10 -0
  71. package/dist/hooks/useId.d.ts.map +1 -0
  72. package/dist/index.cjs +23 -0
  73. package/dist/index.cjs.map +1 -0
  74. package/dist/index.d.ts +25 -0
  75. package/dist/index.d.ts.map +1 -0
  76. package/dist/index.js +2342 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/style.css +1 -0
  79. package/dist/tests/setup.d.ts +2 -0
  80. package/dist/tests/setup.d.ts.map +1 -0
  81. package/dist/types/index.d.ts +59 -0
  82. package/dist/types/index.d.ts.map +1 -0
  83. package/dist/utils/dom.d.ts +31 -0
  84. package/dist/utils/dom.d.ts.map +1 -0
  85. package/dist/utils/focus.d.ts +26 -0
  86. package/dist/utils/focus.d.ts.map +1 -0
  87. package/package.json +107 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/utils/focus.ts","../src/hooks/useFocusTrap.ts","../src/hooks/useEscapeKey.ts","../src/hooks/useControllableState.ts","../src/hooks/useId.ts","../src/utils/dom.ts","../src/components/Dialog/Dialog.tsx","../src/components/Button/Button.tsx","../src/components/Input/Input.tsx","../src/components/Input/Label.tsx","../src/components/Input/ErrorMessage.tsx","../src/components/Input/FormField.tsx","../src/components/Dropdown/Dropdown.tsx","../src/components/Tabs/Tabs.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Toast/Toast.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Radio/Radio.tsx","../src/hooks/useClickOutside.ts","../src/components/Select/Select.tsx","../src/components/Textarea/Textarea.tsx","../src/components/Switch/Switch.tsx","../src/types/index.ts"],"sourcesContent":["/**\n * Utility functions for managing focus and keyboard navigation\n * These are critical for building accessible components\n */\n\nimport { FocusableElement } from '../types';\n\n/**\n * Get all focusable elements within a container\n * Follows WCAG guidelines for what constitutes a focusable element\n */\nexport function getFocusableElements(\n container: HTMLElement | null\n): FocusableElement[] {\n if (!container) return [];\n\n const selector = [\n 'a[href]',\n 'button:not([disabled])',\n 'textarea:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n ].join(',');\n\n return Array.from(\n container.querySelectorAll<FocusableElement>(selector)\n ).filter((element) => {\n // Filter out hidden elements\n return (\n element.offsetWidth > 0 &&\n element.offsetHeight > 0 &&\n getComputedStyle(element).visibility !== 'hidden'\n );\n });\n}\n\n/**\n * Trap focus within a container\n * Used for modals, dialogs, and other overlay components\n */\nexport function createFocusTrap(container: HTMLElement | null) {\n if (!container) return () => {};\n\n const focusableElements = getFocusableElements(container);\n const firstElement = focusableElements[0];\n const lastElement = focusableElements[focusableElements.length - 1];\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Tab') return;\n\n if (event.shiftKey) {\n // Shift + Tab\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement?.focus();\n }\n } else {\n // Tab\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement?.focus();\n }\n }\n };\n\n container.addEventListener('keydown', handleKeyDown);\n\n // Return cleanup function\n return () => {\n container.removeEventListener('keydown', handleKeyDown);\n };\n}\n\n/**\n * Focus the first focusable element in a container\n */\nexport function focusFirstElement(container: HTMLElement | null): void {\n const focusableElements = getFocusableElements(container);\n focusableElements[0]?.focus();\n}\n\n/**\n * Restore focus to a previously focused element\n * Useful when closing modals or dialogs\n */\nexport function createFocusRestorer() {\n const previouslyFocusedElement = document.activeElement as FocusableElement;\n\n return () => {\n previouslyFocusedElement?.focus();\n };\n}\n\n/**\n * Check if an element is currently focused\n */\nexport function isFocused(element: HTMLElement | null): boolean {\n return element === document.activeElement;\n}\n","/**\n * Custom hook for managing focus trap\n * Used in Dialog, Modal, Dropdown, etc.\n */\n\nimport { useEffect, useRef } from 'react';\nimport { createFocusTrap, focusFirstElement } from '../utils/focus';\n\ninterface UseFocusTrapOptions {\n /** Whether the focus trap is active */\n enabled: boolean;\n /** Whether to auto-focus the first element on mount */\n autoFocus?: boolean;\n /** Whether to restore focus when trap is disabled */\n restoreFocus?: boolean;\n}\n\nexport function useFocusTrap({\n enabled,\n autoFocus = true,\n restoreFocus = true,\n}: UseFocusTrapOptions) {\n const containerRef = useRef<HTMLElement>(null);\n const previouslyFocusedElement = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!enabled) return;\n\n // Store the previously focused element\n previouslyFocusedElement.current = document.activeElement as HTMLElement;\n\n // Auto-focus first element if enabled\n if (autoFocus && containerRef.current) {\n focusFirstElement(containerRef.current);\n }\n\n // Create focus trap\n const cleanup = createFocusTrap(containerRef.current);\n\n return () => {\n cleanup();\n\n // Restore focus if enabled\n if (restoreFocus && previouslyFocusedElement.current) {\n previouslyFocusedElement.current.focus();\n }\n };\n }, [enabled, autoFocus, restoreFocus]);\n\n return containerRef;\n}\n","/**\n * Custom hook for handling Escape key press\n * Common pattern in overlays, modals, dropdowns, etc.\n */\n\nimport { useEffect } from 'react';\n\ninterface UseEscapeKeyOptions {\n /** Whether the escape key handler is active */\n enabled: boolean;\n /** Callback to execute when Escape is pressed */\n onEscape: () => void;\n}\n\nexport function useEscapeKey({ enabled, onEscape }: UseEscapeKeyOptions) {\n useEffect(() => {\n if (!enabled) return;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n onEscape();\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [enabled, onEscape]);\n}\n","/**\n * Custom hook for managing controlled/uncontrolled state\n * Allows components to work in both modes seamlessly\n */\n\nimport { useState, useCallback, useRef, useEffect } from 'react';\n\ninterface UseControllableStateOptions<T> {\n /** Controlled value from props */\n value?: T;\n /** Default value for uncontrolled mode */\n defaultValue?: T;\n /** Callback when value changes */\n onChange?: (value: T) => void;\n}\n\n/**\n * Hook that manages both controlled and uncontrolled state\n * This is a fundamental pattern for flexible component APIs\n */\nexport function useControllableState<T>({\n value: controlledValue,\n defaultValue,\n onChange,\n}: UseControllableStateOptions<T>): [T | undefined, (value: T) => void] {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : uncontrolledValue;\n\n // Track if onChange has been called in this render\n const onChangeRef = useRef(onChange);\n\n useEffect(() => {\n onChangeRef.current = onChange;\n });\n\n const setValue = useCallback(\n (nextValue: T) => {\n if (!isControlled) {\n setUncontrolledValue(nextValue);\n }\n onChangeRef.current?.(nextValue);\n },\n [isControlled]\n );\n\n return [value, setValue];\n}\n","/**\n * Custom hook for generating stable unique IDs\n * Essential for accessibility (aria-labelledby, aria-describedby, etc.)\n */\n\nimport { useId as useReactId } from 'react';\n\n/**\n * Generate a unique ID that persists across renders\n * Uses React 18's useId hook with fallback for older versions\n */\nexport function useId(prefix = 'architect'): string {\n const id = useReactId();\n return `${prefix}-${id}`;\n}\n","/**\n * Utility functions for DOM manipulation and helpers\n */\n\n/**\n * Generate a unique ID for components\n * Useful for associating labels with inputs, etc.\n */\nlet idCounter = 0;\n\nexport function generateId(prefix = 'architect'): string {\n idCounter += 1;\n return `${prefix}-${idCounter}`;\n}\n\n/**\n * Merge multiple class names, filtering out falsy values\n */\nexport function cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(' ');\n}\n\n/**\n * Compose multiple event handlers\n * Useful for merging user-provided handlers with internal ones\n */\nexport function composeEventHandlers<E>(\n userHandler?: (event: E) => void,\n internalHandler?: (event: E) => void\n) {\n return (event: E) => {\n userHandler?.(event);\n if (!(event as any).defaultPrevented) {\n internalHandler?.(event);\n }\n };\n}\n\n/**\n * Compose multiple refs\n * Allows forwarding refs while also using them internally\n */\nexport function composeRefs<T>(\n ...refs: (React.Ref<T> | undefined)[]\n): React.RefCallback<T> {\n return (value: T) => {\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n (ref as React.MutableRefObject<T>).current = value;\n }\n });\n };\n}\n\n/**\n * Check if code is running in a browser environment\n */\nexport const isBrowser = typeof window !== 'undefined';\n\n/**\n * Safely access window object\n */\nexport function getWindow(): Window | undefined {\n return isBrowser ? window : undefined;\n}\n\n/**\n * Safely access document object\n */\nexport function getDocument(): Document | undefined {\n return isBrowser ? document : undefined;\n}\n","/**\n * Dialog Component\n *\n * A fully accessible, headless dialog (modal) component following WAI-ARIA practices.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Focus trapping\n * - Escape key to close\n * - Click outside to close (optional)\n * - Controlled and uncontrolled modes\n * - Proper ARIA attributes\n * - Keyboard navigation\n * - Focus restoration\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/\n */\n\nimport React, { forwardRef, useEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useFocusTrap } from '../../hooks/useFocusTrap';\nimport { useEscapeKey } from '../../hooks/useEscapeKey';\nimport { useControllableState } from '../../hooks/useControllableState';\nimport { useId } from '../../hooks/useId';\nimport { composeEventHandlers, composeRefs, isBrowser } from '../../utils/dom';\nimport { BaseComponentProps, WithChildren } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface DialogProps extends BaseComponentProps, WithChildren {\n /** Whether the dialog is open (controlled) */\n open?: boolean;\n /** Default open state (uncontrolled) */\n defaultOpen?: boolean;\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void;\n /** Callback when dialog is dismissed */\n onDismiss?: () => void;\n /** Whether clicking outside closes the dialog */\n closeOnOutsideClick?: boolean;\n /** Whether pressing Escape closes the dialog */\n closeOnEscape?: boolean;\n /** Where to render the dialog in the DOM */\n container?: Element | null;\n /** Whether to trap focus within the dialog */\n trapFocus?: boolean;\n /** Whether to restore focus when dialog closes */\n restoreFocus?: boolean;\n /** Role attribute for the dialog */\n role?: 'dialog' | 'alertdialog';\n}\n\nexport interface DialogOverlayProps\n extends\n BaseComponentProps,\n WithChildren,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport interface DialogContentProps\n extends\n BaseComponentProps,\n WithChildren,\n React.HTMLAttributes<HTMLDivElement> {\n /** ID of the element that labels this dialog */\n 'aria-labelledby'?: string;\n /** ID of the element that describes this dialog */\n 'aria-describedby'?: string;\n}\n\nexport interface DialogTitleProps\n extends\n BaseComponentProps,\n WithChildren,\n React.HTMLAttributes<HTMLHeadingElement> {\n /** Heading level */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n}\n\nexport interface DialogDescriptionProps\n extends\n BaseComponentProps,\n WithChildren,\n React.HTMLAttributes<HTMLParagraphElement> {}\n\nexport interface DialogCloseProps\n extends\n BaseComponentProps,\n WithChildren,\n React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\n/* --------------------------------- Context --------------------------------- */\n\ninterface DialogContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n titleId: string;\n descriptionId: string;\n closeOnOutsideClick: boolean;\n closeOnEscape: boolean;\n role: 'dialog' | 'alertdialog';\n}\n\nconst DialogContext = React.createContext<DialogContextValue | null>(null);\n\nfunction useDialogContext() {\n const context = React.useContext(DialogContext);\n if (!context) {\n throw new Error('Dialog components must be used within a Dialog');\n }\n return context;\n}\n\n/* --------------------------------- Dialog Root --------------------------------- */\n\nexport const Dialog: React.FC<DialogProps> = ({\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n onDismiss,\n closeOnOutsideClick = true,\n closeOnEscape = true,\n trapFocus: _trapFocus = true,\n restoreFocus: _restoreFocus = true,\n role = 'dialog',\n children,\n}) => {\n const [open, setOpen] = useControllableState({\n value: controlledOpen,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n\n const titleId = useId('dialog-title');\n const descriptionId = useId('dialog-description');\n\n const handleOpenChange = (newOpen: boolean) => {\n setOpen(newOpen);\n if (!newOpen && onDismiss) {\n onDismiss();\n }\n };\n\n // Prevent body scroll when dialog is open\n useEffect(() => {\n if (!open || !isBrowser) return;\n\n const originalOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n\n return () => {\n document.body.style.overflow = originalOverflow;\n };\n }, [open]);\n\n const contextValue: DialogContextValue = {\n open: open ?? false,\n setOpen: handleOpenChange,\n titleId,\n descriptionId,\n closeOnOutsideClick,\n closeOnEscape,\n role,\n };\n\n return (\n <DialogContext.Provider value={contextValue}>\n {children}\n </DialogContext.Provider>\n );\n};\n\nDialog.displayName = 'Dialog';\n\n/* --------------------------------- Dialog Overlay --------------------------------- */\n\nexport const DialogOverlay = forwardRef<HTMLDivElement, DialogOverlayProps>(\n ({ className, onClick, children, ...props }, ref) => {\n const { open, setOpen, closeOnOutsideClick } = useDialogContext();\n\n if (!open || !isBrowser) return null;\n\n const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (closeOnOutsideClick && event.target === event.currentTarget) {\n setOpen(false);\n }\n };\n\n return createPortal(\n <div\n ref={ref}\n className={className}\n onClick={composeEventHandlers(onClick, handleClick)}\n data-state={open ? 'open' : 'closed'}\n {...props}\n >\n {children}\n </div>,\n document.body\n );\n }\n);\n\nDialogOverlay.displayName = 'DialogOverlay';\n\n/* --------------------------------- Dialog Content --------------------------------- */\n\nexport const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>(\n (\n {\n className,\n children,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...props\n },\n ref\n ) => {\n const { open, setOpen, titleId, descriptionId, closeOnEscape, role } =\n useDialogContext();\n\n const focusTrapRef = useFocusTrap({\n enabled: open,\n autoFocus: true,\n restoreFocus: true,\n });\n\n useEscapeKey({\n enabled: open && closeOnEscape,\n onEscape: () => setOpen(false),\n });\n\n if (!open) return null;\n\n return (\n <div\n ref={composeRefs(ref, focusTrapRef)}\n role={role}\n aria-modal=\"true\"\n aria-labelledby={ariaLabelledBy || titleId}\n aria-describedby={ariaDescribedBy || descriptionId}\n className={className}\n data-state={open ? 'open' : 'closed'}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nDialogContent.displayName = 'DialogContent';\n\n/* --------------------------------- Dialog Title --------------------------------- */\n\nexport const DialogTitle = forwardRef<HTMLHeadingElement, DialogTitleProps>(\n ({ className, level = 2, children, ...props }, ref) => {\n const { titleId } = useDialogContext();\n const Tag = `h${level}` as const;\n\n return (\n <Tag ref={ref} id={titleId} className={className} {...props}>\n {children}\n </Tag>\n );\n }\n);\n\nDialogTitle.displayName = 'DialogTitle';\n\n/* --------------------------------- Dialog Description --------------------------------- */\n\nexport const DialogDescription = forwardRef<\n HTMLParagraphElement,\n DialogDescriptionProps\n>(({ className, children, ...props }, ref) => {\n const { descriptionId } = useDialogContext();\n\n return (\n <p ref={ref} id={descriptionId} className={className} {...props}>\n {children}\n </p>\n );\n});\n\nDialogDescription.displayName = 'DialogDescription';\n\n/* --------------------------------- Dialog Close --------------------------------- */\n\nexport const DialogClose = forwardRef<HTMLButtonElement, DialogCloseProps>(\n ({ className, onClick, children, ...props }, ref) => {\n const { setOpen } = useDialogContext();\n\n const handleClick = () => {\n setOpen(false);\n };\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={className}\n onClick={composeEventHandlers(onClick, handleClick)}\n aria-label=\"Close dialog\"\n {...props}\n >\n {children}\n </button>\n );\n }\n);\n\nDialogClose.displayName = 'DialogClose';\n","/**\n * Button Component\n *\n * A fully accessible, polymorphic button component following WAI-ARIA practices.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Polymorphic (can render as different elements)\n * - Loading states with accessible announcements\n * - Disabled states\n * - Icon support (left/right)\n * - Multiple variants (via styling)\n * - Keyboard accessible\n * - Screen reader friendly\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/button/\n */\n\nimport React, { forwardRef, ButtonHTMLAttributes } from 'react';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface ButtonProps\n extends\n BaseComponentProps,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'> {\n /** Whether the button is in a loading state */\n loading?: boolean;\n /** Whether the button is disabled */\n disabled?: boolean;\n /** Icon to display before the button text */\n iconLeft?: React.ReactNode;\n /** Icon to display after the button text */\n iconRight?: React.ReactNode;\n /** Accessible label for loading state (announced to screen readers) */\n loadingText?: string;\n /** Element type to render as (for polymorphic behavior) */\n as?: 'button' | 'a' | 'div';\n /** Button type attribute */\n type?: 'button' | 'submit' | 'reset';\n}\n\n/* --------------------------------- Component --------------------------------- */\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n className,\n loading = false,\n disabled = false,\n iconLeft,\n iconRight,\n loadingText = 'Loading',\n as: Component = 'button',\n type = 'button',\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n onClick,\n ...props\n },\n ref\n ) => {\n // Button is disabled when explicitly disabled or loading\n const isDisabled = disabled || loading;\n\n // Prevent click when disabled or loading\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (isDisabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n };\n\n // Determine ARIA attributes\n const ariaProps = {\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n 'aria-disabled': isDisabled ? true : undefined,\n 'aria-busy': loading ? true : undefined,\n };\n\n // Common props for all button types\n const commonProps = {\n className: cn(className),\n ...ariaProps,\n ...(props as any),\n };\n\n // Render as button element\n if (Component === 'button') {\n return (\n <button\n {...commonProps}\n ref={ref}\n type={type}\n disabled={isDisabled}\n onClick={handleClick}\n data-loading={loading ? 'true' : undefined}\n data-disabled={isDisabled ? 'true' : undefined}\n >\n {loading && (\n <span className=\"button-loader\" aria-hidden=\"true\">\n {/* Loading indicator - consumers can style this */}\n </span>\n )}\n\n {!loading && iconLeft && (\n <span className=\"button-icon-left\" aria-hidden=\"true\">\n {iconLeft}\n </span>\n )}\n\n <span className=\"button-content\">\n {loading ? loadingText : children}\n </span>\n\n {!loading && iconRight && (\n <span className=\"button-icon-right\" aria-hidden=\"true\">\n {iconRight}\n </span>\n )}\n\n {/* Screen reader only text for loading state */}\n {loading && (\n <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {loadingText}\n </span>\n )}\n </button>\n );\n }\n\n // Render as link\n if (Component === 'a') {\n return (\n <a\n {...commonProps}\n ref={ref as any}\n onClick={handleClick as any}\n role=\"button\"\n tabIndex={isDisabled ? -1 : 0}\n data-loading={loading ? 'true' : undefined}\n data-disabled={isDisabled ? 'true' : undefined}\n >\n {loading && (\n <span className=\"button-loader\" aria-hidden=\"true\">\n {/* Loading indicator */}\n </span>\n )}\n\n {!loading && iconLeft && (\n <span className=\"button-icon-left\" aria-hidden=\"true\">\n {iconLeft}\n </span>\n )}\n\n <span className=\"button-content\">\n {loading ? loadingText : children}\n </span>\n\n {!loading && iconRight && (\n <span className=\"button-icon-right\" aria-hidden=\"true\">\n {iconRight}\n </span>\n )}\n\n {loading && (\n <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {loadingText}\n </span>\n )}\n </a>\n );\n }\n\n // Render as div (for custom implementations)\n return (\n <div\n {...commonProps}\n ref={ref as any}\n role=\"button\"\n tabIndex={isDisabled ? -1 : 0}\n onClick={handleClick as any}\n onKeyDown={(e) => {\n // Handle Enter and Space keys\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (!isDisabled) {\n onClick?.(e as any);\n }\n }\n }}\n data-loading={loading ? 'true' : undefined}\n data-disabled={isDisabled ? 'true' : undefined}\n >\n {loading && (\n <span className=\"button-loader\" aria-hidden=\"true\">\n {/* Loading indicator */}\n </span>\n )}\n\n {!loading && iconLeft && (\n <span className=\"button-icon-left\" aria-hidden=\"true\">\n {iconLeft}\n </span>\n )}\n\n <span className=\"button-content\">\n {loading ? loadingText : children}\n </span>\n\n {!loading && iconRight && (\n <span className=\"button-icon-right\" aria-hidden=\"true\">\n {iconRight}\n </span>\n )}\n\n {loading && (\n <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {loadingText}\n </span>\n )}\n </div>\n );\n }\n);\n\nButton.displayName = 'Button';\n","/**\n * Input Component\n *\n * A fully accessible input component following WAI-ARIA practices.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Works with Label and ErrorMessage components\n * - Supports all input types\n * - Invalid state handling\n * - Disabled state\n * - Required field support\n * - Proper ARIA attributes\n * - Auto-generated IDs for accessibility\n * - Icon support (prefix/suffix)\n * - Password visibility toggle\n * - Hide number spinners (optional)\n * - Hide date picker icon (optional)\n * - Click anywhere to open date picker\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/input/\n */\n\nimport React, {\n forwardRef,\n InputHTMLAttributes,\n useRef,\n useCallback,\n} from 'react';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface InputProps\n extends\n BaseComponentProps,\n Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'prefix'> {\n /** Whether the input has an error */\n invalid?: boolean;\n /** ID of the error message element */\n errorId?: string;\n /** ID of the label element */\n labelId?: string;\n /** Icon/content to display before the input */\n prefix?: React.ReactNode;\n /** Icon/content to display after the input */\n suffix?: React.ReactNode;\n /** Hide number input spinners (for type=\"number\") */\n hideNumberSpinners?: boolean;\n /** Hide date/time picker icon (for type=\"date\", \"time\", \"datetime-local\") */\n hideDateIcon?: boolean;\n /** Enable password visibility toggle (for type=\"password\") */\n showPasswordToggle?: boolean;\n /** Wrapper className for the input container */\n wrapperClassName?: string;\n /** Wrapper style for the input container */\n wrapperStyle?: React.CSSProperties;\n}\n\n/* --------------------------------- Component --------------------------------- */\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n invalid = false,\n errorId,\n labelId,\n disabled = false,\n required = false,\n prefix,\n suffix,\n hideNumberSpinners = false,\n hideDateIcon = false,\n showPasswordToggle = false,\n wrapperClassName,\n wrapperStyle,\n type = 'text',\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n onClick,\n onFocus,\n ...props\n },\n ref\n ) => {\n const [showPassword, setShowPassword] = React.useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Combine refs\n const combinedRef = useCallback(\n (node: HTMLInputElement | null) => {\n // Update internal ref\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current =\n node;\n\n // Update forwarded ref\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLInputElement | null>).current =\n node;\n }\n },\n [ref]\n );\n\n // Handle date picker opening\n const handleDatePickerOpen = useCallback(() => {\n const isDateType = ['date', 'time', 'datetime-local'].includes(type);\n if (\n isDateType &&\n inputRef.current &&\n typeof inputRef.current.showPicker === 'function'\n ) {\n try {\n inputRef.current.showPicker();\n } catch (error) {\n // showPicker() might not be supported in all browsers\n console.warn('showPicker() not supported:', error);\n }\n }\n }, [type]);\n\n // Handle click event\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLInputElement>) => {\n if (hideDateIcon && ['date', 'time', 'datetime-local'].includes(type)) {\n handleDatePickerOpen();\n }\n onClick?.(e);\n },\n [hideDateIcon, type, handleDatePickerOpen, onClick]\n );\n\n // Handle focus event\n const handleFocus = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n if (hideDateIcon && ['date', 'time', 'datetime-local'].includes(type)) {\n handleDatePickerOpen();\n }\n onFocus?.(e);\n },\n [hideDateIcon, type, handleDatePickerOpen, onFocus]\n );\n\n // Combine aria-describedby with errorId if present\n const describedBy =\n [ariaDescribedBy, invalid && errorId].filter(Boolean).join(' ') ||\n undefined;\n\n // Use labelId for aria-labelledby if provided\n const labelledBy = ariaLabelledBy || labelId;\n\n // Determine actual input type\n const inputType =\n showPasswordToggle && type === 'password' && showPassword ? 'text' : type;\n\n // Build className with conditional styles\n const inputClassName = cn(\n className,\n hideNumberSpinners && type === 'number' && 'input-hide-spinners',\n hideDateIcon &&\n ['date', 'time', 'datetime-local'].includes(type) &&\n 'input-hide-date-icon'\n );\n\n // If no prefix, suffix, or password toggle, render simple input\n if (!prefix && !suffix && !(showPasswordToggle && type === 'password')) {\n return (\n <input\n ref={combinedRef}\n type={inputType}\n className={inputClassName}\n disabled={disabled}\n required={required}\n aria-invalid={invalid ? 'true' : undefined}\n aria-describedby={describedBy}\n aria-labelledby={labelledBy}\n aria-required={required ? 'true' : undefined}\n data-invalid={invalid ? 'true' : undefined}\n data-disabled={disabled ? 'true' : undefined}\n onClick={handleClick}\n onFocus={handleFocus}\n {...props}\n />\n );\n }\n\n // Render with wrapper for icons/password toggle\n return (\n <div\n className={cn('input-wrapper', wrapperClassName)}\n style={wrapperStyle}\n >\n {prefix && (\n <span className=\"input-prefix\" aria-hidden=\"true\">\n {prefix}\n </span>\n )}\n\n <input\n ref={combinedRef}\n type={inputType}\n className={inputClassName}\n disabled={disabled}\n required={required}\n aria-invalid={invalid ? 'true' : undefined}\n aria-describedby={describedBy}\n aria-labelledby={labelledBy}\n aria-required={required ? 'true' : undefined}\n data-invalid={invalid ? 'true' : undefined}\n data-disabled={disabled ? 'true' : undefined}\n onClick={handleClick}\n onFocus={handleFocus}\n {...props}\n />\n\n {suffix && (\n <span className=\"input-suffix\" aria-hidden=\"true\">\n {suffix}\n </span>\n )}\n\n {showPasswordToggle && type === 'password' && (\n <button\n type=\"button\"\n className=\"input-password-toggle\"\n onClick={() => setShowPassword((prev) => !prev)}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n tabIndex={-1}\n >\n {showPassword ? (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M2 10s3-6 8-6 8 6 8 6-3 6-8 6-8-6-8-6z\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <circle\n cx=\"10\"\n cy=\"10\"\n r=\"3\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ) : (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M14.12 14.12A8 8 0 0 1 2 10s3-6 8-6a8 8 0 0 1 4.12 1.12m2.83 2.83A8 8 0 0 1 18 10s-3 6-8 6a8 8 0 0 1-2.95-.55M1 1l18 18\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )}\n </button>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = 'Input';\n","/**\n * Label Component\n *\n * A fully accessible label component for form fields.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Associates with input via htmlFor\n * - Supports required indicator\n * - Proper semantic HTML\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/input/\n */\n\nimport React, { forwardRef, LabelHTMLAttributes } from 'react';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps, WithChildren } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface LabelProps\n extends\n BaseComponentProps,\n WithChildren,\n LabelHTMLAttributes<HTMLLabelElement> {\n /** Whether the associated field is required */\n required?: boolean;\n /** Custom required indicator (defaults to \"*\") */\n requiredIndicator?: React.ReactNode;\n /** Whether to show the required indicator */\n showRequiredIndicator?: boolean;\n}\n\n/* --------------------------------- Component --------------------------------- */\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(\n (\n {\n children,\n className,\n required = false,\n requiredIndicator = '*',\n showRequiredIndicator = true,\n ...props\n },\n ref\n ) => {\n return (\n <label ref={ref} className={cn(className)} {...props}>\n {children}\n {required && showRequiredIndicator && (\n <span\n className=\"label-required\"\n aria-label=\"required\"\n role=\"presentation\"\n >\n {requiredIndicator}\n </span>\n )}\n </label>\n );\n }\n);\n\nLabel.displayName = 'Label';\n","/**\n * ErrorMessage Component\n *\n * A fully accessible error message component for form fields.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Announced to screen readers via aria-live\n * - Associates with input via ID\n * - Conditional rendering\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/input/\n */\n\nimport { forwardRef, HTMLAttributes } from 'react';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps, WithChildren } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface ErrorMessageProps\n extends\n BaseComponentProps,\n WithChildren,\n HTMLAttributes<HTMLParagraphElement> {\n /** Whether to show the error message */\n show?: boolean;\n}\n\n/* --------------------------------- Component --------------------------------- */\n\nexport const ErrorMessage = forwardRef<HTMLParagraphElement, ErrorMessageProps>(\n ({ children, className, show = true, ...props }, ref) => {\n if (!show || !children) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n className={cn(className)}\n role=\"alert\"\n aria-live=\"polite\"\n {...props}\n >\n {children}\n </p>\n );\n }\n);\n\nErrorMessage.displayName = 'ErrorMessage';\n","/**\n * FormField Component\n *\n * A convenience wrapper that combines Input, Label, and ErrorMessage\n * with proper accessibility relationships.\n *\n * Features:\n * - Auto-generates IDs for accessibility\n * - Connects label, input, and error message\n * - Handles all ARIA attributes\n * - Reduces boilerplate\n */\n\nimport React, { forwardRef } from 'react';\nimport { useId } from '../../hooks/useId';\nimport { Input, InputProps } from './Input';\nimport { Label, LabelProps } from './Label';\nimport { ErrorMessage, ErrorMessageProps } from './ErrorMessage';\nimport { BaseComponentProps } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface FormFieldProps extends BaseComponentProps {\n /** Label text */\n label: React.ReactNode;\n /** Error message */\n error?: React.ReactNode;\n /** Input props */\n inputProps?: Omit<InputProps, 'id' | 'errorId' | 'labelId' | 'invalid'>;\n /** Label props */\n labelProps?: Omit<LabelProps, 'htmlFor' | 'required'>;\n /** Error message props */\n errorProps?: Omit<ErrorMessageProps, 'id' | 'show'>;\n /** Whether the field is required */\n required?: boolean;\n /** Custom ID for the input (auto-generated if not provided) */\n id?: string;\n}\n\n/* --------------------------------- Component --------------------------------- */\n\nexport const FormField = forwardRef<HTMLInputElement, FormFieldProps>(\n (\n {\n label,\n error,\n inputProps,\n labelProps,\n errorProps,\n required = false,\n id: customId,\n className,\n ...props\n },\n ref\n ) => {\n const generatedId = useId('form-field');\n const id = customId || generatedId;\n const errorId = `${id}-error`;\n const labelId = `${id}-label`;\n\n const hasError = Boolean(error);\n\n return (\n <div className={className} {...props}>\n <Label id={labelId} htmlFor={id} required={required} {...labelProps}>\n {label}\n </Label>\n\n <Input\n ref={ref}\n id={id}\n labelId={labelId}\n errorId={errorId}\n invalid={hasError}\n required={required}\n {...inputProps}\n />\n\n <ErrorMessage id={errorId} show={hasError} {...errorProps}>\n {error}\n </ErrorMessage>\n </div>\n );\n }\n);\n\nFormField.displayName = 'FormField';\n","/**\n * Dropdown Component\n *\n * A fully accessible dropdown menu component following WAI-ARIA Menu Button pattern.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Keyboard navigation (Arrow keys, Enter, Escape, Home, End)\n * - Focus management\n * - Click outside to close\n * - Escape to close\n * - Proper ARIA attributes\n * - Portal rendering\n * - Controlled and uncontrolled modes\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/\n */\n\nimport React, {\n createContext,\n useContext,\n useState,\n useRef,\n useCallback,\n useEffect,\n forwardRef,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useId } from '../../hooks/useId';\nimport { useEscapeKey } from '../../hooks/useEscapeKey';\nimport { cn, isBrowser } from '../../utils/dom';\nimport { BaseComponentProps, WithChildren } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\ninterface DropdownContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerId: string;\n menuId: string;\n activeIndex: number;\n setActiveIndex: React.Dispatch<React.SetStateAction<number>>;\n itemsRef: React.MutableRefObject<(HTMLElement | null)[]>;\n}\n\nexport interface DropdownProps extends BaseComponentProps, WithChildren {\n /** Whether the dropdown is open (controlled) */\n open?: boolean;\n /** Default open state (uncontrolled) */\n defaultOpen?: boolean;\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void;\n}\n\nexport interface DropdownTriggerProps\n extends BaseComponentProps, React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport interface DropdownMenuProps extends BaseComponentProps, WithChildren {\n /** Whether to render in a portal */\n portal?: boolean;\n /** Placement of the menu relative to trigger */\n placement?: 'bottom' | 'top';\n}\n\nexport interface DropdownItemProps\n extends\n BaseComponentProps,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'role'> {\n /** Whether the item is disabled */\n disabled?: boolean;\n}\n\n/* --------------------------------- Context --------------------------------- */\n\nconst DropdownContext = createContext<DropdownContextValue | null>(null);\n\nconst useDropdownContext = () => {\n const context = useContext(DropdownContext);\n if (!context) {\n throw new Error('Dropdown components must be used within Dropdown');\n }\n return context;\n};\n\n/* --------------------------------- Main Component --------------------------------- */\n\nexport const Dropdown: React.FC<DropdownProps> = ({\n children,\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n className,\n ...props\n}) => {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : uncontrolledOpen;\n\n const setOpen = useCallback(\n (newOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(newOpen);\n }\n onOpenChange?.(newOpen);\n },\n [isControlled, onOpenChange]\n );\n\n const triggerId = useId('dropdown-trigger');\n const menuId = useId('dropdown-menu');\n const [activeIndex, setActiveIndex] = useState(-1);\n const itemsRef = useRef<(HTMLElement | null)[]>([]);\n\n const value: DropdownContextValue = {\n open,\n setOpen,\n triggerId,\n menuId,\n activeIndex,\n setActiveIndex,\n itemsRef,\n };\n\n return (\n <DropdownContext.Provider value={value}>\n <div className={cn('dropdown', className)} {...props}>\n {children}\n </div>\n </DropdownContext.Provider>\n );\n};\n\n/* --------------------------------- Trigger --------------------------------- */\n\nexport const DropdownTrigger = forwardRef<\n HTMLButtonElement,\n DropdownTriggerProps\n>(({ children, className, onClick, onKeyDown, ...props }, ref) => {\n const { open, setOpen, triggerId, menuId } = useDropdownContext();\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n setOpen(!open);\n onClick?.(e);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n setOpen(true);\n }\n onKeyDown?.(e);\n };\n\n return (\n <button\n ref={ref}\n id={triggerId}\n type=\"button\"\n aria-haspopup=\"true\"\n aria-expanded={open}\n aria-controls={menuId}\n className={cn('dropdown-trigger', className)}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {children}\n </button>\n );\n});\n\nDropdownTrigger.displayName = 'DropdownTrigger';\n\n/* --------------------------------- Menu --------------------------------- */\n\nexport const DropdownMenu = forwardRef<HTMLDivElement, DropdownMenuProps>(\n (\n {\n children,\n className,\n portal = true,\n placement = 'bottom',\n style,\n ...props\n },\n ref\n ) => {\n const { open, setOpen, menuId, triggerId, setActiveIndex, itemsRef } =\n useDropdownContext();\n\n const menuRef = useRef<HTMLDivElement>(null);\n const [position, setPosition] = React.useState({ top: 0, left: 0 });\n\n // Calculate position relative to trigger\n useEffect(() => {\n if (!open || !portal) return;\n\n const updatePosition = () => {\n const trigger = document.getElementById(triggerId);\n const menu = menuRef.current;\n if (!trigger) return;\n\n const triggerRect = trigger.getBoundingClientRect();\n const menuHeight = menu?.offsetHeight || 0;\n\n let top: number;\n if (placement === 'top') {\n top = triggerRect.top + window.scrollY - menuHeight - 4; // 4px gap above\n } else {\n top = triggerRect.bottom + window.scrollY + 4; // 4px gap below\n }\n\n setPosition({\n top,\n left: triggerRect.left + window.scrollX,\n });\n };\n\n updatePosition();\n\n // Update position on scroll or resize\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n\n return () => {\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n };\n }, [open, portal, triggerId, placement]);\n\n // Close on escape\n useEscapeKey({\n enabled: open,\n onEscape: () => setOpen(false),\n });\n\n // Close on click outside\n useEffect(() => {\n if (!open) return;\n\n const handleClickOutside = (e: MouseEvent) => {\n const target = e.target as Node;\n const trigger = document.getElementById(triggerId);\n const menu = menuRef.current;\n\n if (\n menu &&\n !menu.contains(target) &&\n trigger &&\n !trigger.contains(target)\n ) {\n setOpen(false);\n }\n };\n\n document.addEventListener('mousedown', handleClickOutside);\n return () =>\n document.removeEventListener('mousedown', handleClickOutside);\n }, [open, setOpen, triggerId]);\n\n // Keyboard navigation\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n const items = itemsRef.current.filter(\n (item) => item && !item.hasAttribute('disabled')\n );\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n setActiveIndex((prev: number) => {\n const next = prev + 1 >= items.length ? 0 : prev + 1;\n items[next]?.focus();\n return next;\n });\n break;\n\n case 'ArrowUp':\n e.preventDefault();\n setActiveIndex((prev: number) => {\n const next = prev - 1 < 0 ? items.length - 1 : prev - 1;\n items[next]?.focus();\n return next;\n });\n break;\n\n case 'Home':\n e.preventDefault();\n setActiveIndex(0);\n items[0]?.focus();\n break;\n\n case 'End':\n e.preventDefault();\n setActiveIndex(items.length - 1);\n items[items.length - 1]?.focus();\n break;\n\n case 'Escape':\n e.preventDefault();\n setOpen(false);\n document.getElementById(triggerId)?.focus();\n break;\n }\n };\n\n // Focus first item when menu opens\n useEffect(() => {\n if (open) {\n const items = itemsRef.current.filter(\n (item) => item && !item.hasAttribute('disabled')\n );\n if (items.length > 0) {\n setActiveIndex(0);\n // Small delay to ensure menu is rendered\n setTimeout(() => items[0]?.focus(), 0);\n }\n } else {\n setActiveIndex(-1);\n }\n }, [open, setActiveIndex]);\n\n if (!open) return null;\n\n // Merge positioning styles with user-provided styles\n const menuStyle = portal\n ? {\n ...style,\n position: 'absolute' as const,\n top: `${position.top}px`,\n left: `${position.left}px`,\n zIndex: 9999,\n }\n : style;\n\n const menu = (\n <div\n ref={(node) => {\n (menuRef as React.MutableRefObject<HTMLDivElement | null>).current =\n node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current =\n node;\n }\n }}\n id={menuId}\n role=\"menu\"\n aria-labelledby={triggerId}\n className={cn('dropdown-menu', className)}\n style={menuStyle}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {children}\n </div>\n );\n\n if (portal && isBrowser) {\n return createPortal(menu, document.body);\n }\n\n return menu;\n }\n);\n\nDropdownMenu.displayName = 'DropdownMenu';\n\n/* --------------------------------- Item --------------------------------- */\n\nexport const DropdownItem = forwardRef<HTMLButtonElement, DropdownItemProps>(\n ({ children, className, disabled = false, onClick, ...props }, ref) => {\n const { setOpen, itemsRef, activeIndex } = useDropdownContext();\n const itemRef = useRef<HTMLButtonElement>(null);\n const [itemIndex, setItemIndex] = useState(-1);\n\n // Register item in items array\n useEffect(() => {\n const node = itemRef.current;\n if (node) {\n const index = itemsRef.current.length;\n itemsRef.current[index] = node;\n setItemIndex(index);\n\n return () => {\n itemsRef.current[index] = null;\n };\n }\n }, [itemsRef]);\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) return;\n onClick?.(e);\n setOpen(false);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (!disabled) {\n handleClick(e as any);\n }\n }\n };\n\n return (\n <button\n ref={(node) => {\n (\n itemRef as React.MutableRefObject<HTMLButtonElement | null>\n ).current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLButtonElement | null>).current =\n node;\n }\n }}\n type=\"button\"\n role=\"menuitem\"\n tabIndex={-1}\n disabled={disabled}\n aria-disabled={disabled ? 'true' : undefined}\n className={cn('dropdown-item', className)}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n data-active={itemIndex === activeIndex ? 'true' : undefined}\n {...props}\n >\n {children}\n </button>\n );\n }\n);\n\nDropdownItem.displayName = 'DropdownItem';\n\nDropdown.displayName = 'Dropdown';\n","/**\n * Tabs Component\n *\n * A fully accessible tabs component following WAI-ARIA Tabs pattern.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Keyboard navigation (Arrow keys, Home, End)\n * - Automatic and manual activation modes\n * - Controlled and uncontrolled modes\n * - Proper ARIA attributes\n * - Vertical and horizontal orientations\n * - Disabled tabs\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n */\n\nimport React, {\n createContext,\n useContext,\n useState,\n useRef,\n useCallback,\n useEffect,\n forwardRef,\n} from 'react';\nimport { useId } from '../../hooks/useId';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps, WithChildren } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\ntype Orientation = 'horizontal' | 'vertical';\ntype ActivationMode = 'automatic' | 'manual';\n\ninterface TabsContextValue {\n selectedValue: string;\n setSelectedValue: (value: string) => void;\n orientation: Orientation;\n activationMode: ActivationMode;\n tabsId: string;\n registerTab: (value: string, element: HTMLElement) => void;\n unregisterTab: (value: string) => void;\n tabs: Map<string, HTMLElement>;\n}\n\nexport interface TabsProps extends BaseComponentProps, WithChildren {\n /** Currently selected tab value (controlled) */\n value?: string;\n /** Default selected tab value (uncontrolled) */\n defaultValue?: string;\n /** Callback when selected tab changes */\n onValueChange?: (value: string) => void;\n /** Orientation of tabs */\n orientation?: Orientation;\n /** Activation mode - automatic activates on focus, manual requires Enter/Space */\n activationMode?: ActivationMode;\n}\n\nexport interface TabsListProps extends BaseComponentProps, WithChildren {}\n\nexport interface TabsTriggerProps\n extends\n BaseComponentProps,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {\n /** Unique value for this tab */\n value: string;\n /** Whether the tab is disabled */\n disabled?: boolean;\n}\n\nexport interface TabsContentProps extends BaseComponentProps, WithChildren {\n /** Value of the tab this content belongs to */\n value: string;\n}\n\n/* --------------------------------- Context --------------------------------- */\n\nconst TabsContext = createContext<TabsContextValue | null>(null);\n\nconst useTabsContext = () => {\n const context = useContext(TabsContext);\n if (!context) {\n throw new Error('Tabs components must be used within Tabs');\n }\n return context;\n};\n\n/* --------------------------------- Main Component --------------------------------- */\n\nexport const Tabs: React.FC<TabsProps> = ({\n children,\n value: controlledValue,\n defaultValue,\n onValueChange,\n orientation = 'horizontal',\n activationMode = 'automatic',\n className,\n ...props\n}) => {\n const [uncontrolledValue, setUncontrolledValue] = useState(\n defaultValue || ''\n );\n const isControlled = controlledValue !== undefined;\n const selectedValue = isControlled ? controlledValue : uncontrolledValue;\n\n const setSelectedValue = useCallback(\n (newValue: string) => {\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n onValueChange?.(newValue);\n },\n [isControlled, onValueChange]\n );\n\n const tabsId = useId('tabs');\n const tabsRef = useRef<Map<string, HTMLElement>>(new Map());\n\n const registerTab = useCallback((value: string, element: HTMLElement) => {\n tabsRef.current.set(value, element);\n }, []);\n\n const unregisterTab = useCallback((value: string) => {\n tabsRef.current.delete(value);\n }, []);\n\n const value: TabsContextValue = {\n selectedValue,\n setSelectedValue,\n orientation,\n activationMode,\n tabsId,\n registerTab,\n unregisterTab,\n tabs: tabsRef.current,\n };\n\n return (\n <TabsContext.Provider value={value}>\n <div\n className={cn('tabs', className)}\n data-orientation={orientation}\n {...props}\n >\n {children}\n </div>\n </TabsContext.Provider>\n );\n};\n\n/* --------------------------------- TabsList --------------------------------- */\n\nexport const TabsList = forwardRef<HTMLDivElement, TabsListProps>(\n ({ children, className, ...props }, ref) => {\n const { orientation } = useTabsContext();\n\n return (\n <div\n ref={ref}\n role=\"tablist\"\n aria-orientation={orientation}\n className={cn('tabs-list', className)}\n data-orientation={orientation}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nTabsList.displayName = 'TabsList';\n\n/* --------------------------------- TabsTrigger --------------------------------- */\n\nexport const TabsTrigger = forwardRef<HTMLButtonElement, TabsTriggerProps>(\n (\n { children, className, value, disabled = false, onKeyDown, ...props },\n ref\n ) => {\n const {\n selectedValue,\n setSelectedValue,\n orientation,\n activationMode,\n tabsId,\n registerTab,\n unregisterTab,\n tabs,\n } = useTabsContext();\n\n const buttonRef = useRef<HTMLButtonElement>(null);\n const isSelected = selectedValue === value;\n\n // Register/unregister tab\n useEffect(() => {\n const element = buttonRef.current;\n if (element) {\n registerTab(value, element);\n return () => unregisterTab(value);\n }\n }, [value, registerTab, unregisterTab]);\n\n // Set first tab as selected if no default\n useEffect(() => {\n if (!selectedValue && tabs.size > 0) {\n const firstTab = Array.from(tabs.keys())[0];\n if (firstTab === value) {\n setSelectedValue(value);\n }\n }\n }, [selectedValue, value, tabs, setSelectedValue]);\n\n const handleClick = () => {\n if (!disabled) {\n setSelectedValue(value);\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled) return;\n\n const tabValues = Array.from(tabs.keys());\n const enabledTabs = tabValues.filter((v) => {\n const tab = tabs.get(v);\n return tab && !tab.hasAttribute('disabled');\n });\n const currentIndex = enabledTabs.indexOf(value);\n\n let nextIndex = currentIndex;\n\n if (orientation === 'horizontal') {\n if (e.key === 'ArrowLeft') {\n e.preventDefault();\n nextIndex =\n currentIndex - 1 < 0 ? enabledTabs.length - 1 : currentIndex - 1;\n } else if (e.key === 'ArrowRight') {\n e.preventDefault();\n nextIndex =\n currentIndex + 1 >= enabledTabs.length ? 0 : currentIndex + 1;\n }\n } else {\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n nextIndex =\n currentIndex - 1 < 0 ? enabledTabs.length - 1 : currentIndex - 1;\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n nextIndex =\n currentIndex + 1 >= enabledTabs.length ? 0 : currentIndex + 1;\n }\n }\n\n if (e.key === 'Home') {\n e.preventDefault();\n nextIndex = 0;\n } else if (e.key === 'End') {\n e.preventDefault();\n nextIndex = enabledTabs.length - 1;\n }\n\n if (nextIndex !== currentIndex) {\n const nextValue = enabledTabs[nextIndex];\n const nextTab = tabs.get(nextValue);\n\n if (nextTab) {\n nextTab.focus();\n if (activationMode === 'automatic') {\n setSelectedValue(nextValue);\n }\n }\n }\n\n // Manual activation with Enter or Space\n if (activationMode === 'manual' && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n setSelectedValue(value);\n }\n\n onKeyDown?.(e);\n };\n\n return (\n <button\n ref={(node) => {\n (\n buttonRef as React.MutableRefObject<HTMLButtonElement | null>\n ).current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLButtonElement | null>).current =\n node;\n }\n }}\n type=\"button\"\n role=\"tab\"\n id={`${tabsId}-tab-${value}`}\n aria-selected={isSelected}\n aria-controls={`${tabsId}-panel-${value}`}\n tabIndex={isSelected ? 0 : -1}\n disabled={disabled}\n className={cn('tabs-trigger', className)}\n data-state={isSelected ? 'active' : 'inactive'}\n data-orientation={orientation}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {children}\n </button>\n );\n }\n);\n\nTabsTrigger.displayName = 'TabsTrigger';\n\n/* --------------------------------- TabsContent --------------------------------- */\n\nexport const TabsContent = forwardRef<HTMLDivElement, TabsContentProps>(\n ({ children, className, value, ...props }, ref) => {\n const { selectedValue, tabsId } = useTabsContext();\n const isSelected = selectedValue === value;\n\n if (!isSelected) return null;\n\n return (\n <div\n ref={ref}\n role=\"tabpanel\"\n id={`${tabsId}-panel-${value}`}\n aria-labelledby={`${tabsId}-tab-${value}`}\n tabIndex={0}\n className={cn('tabs-content', className)}\n data-state={isSelected ? 'active' : 'inactive'}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nTabsContent.displayName = 'TabsContent';\n\nTabs.displayName = 'Tabs';\n","/**\n * Accordion Component\n *\n * A fully accessible accordion component following WAI-ARIA Accordion pattern.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Keyboard navigation (Arrow keys, Home, End)\n * - Single and multiple expansion modes\n * - Controlled and uncontrolled modes\n * - Proper ARIA attributes\n * - Collapsible sections\n * - Disabled items\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/accordion/\n */\n\nimport React, {\n createContext,\n useContext,\n useState,\n useRef,\n useCallback,\n useEffect,\n forwardRef,\n} from 'react';\nimport { useId } from '../../hooks/useId';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps, WithChildren } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\ntype AccordionType = 'single' | 'multiple';\n\ninterface AccordionContextValue {\n type: AccordionType;\n value: string | string[];\n onValueChange: (value: string) => void;\n collapsible: boolean;\n disabled: boolean;\n accordionId: string;\n}\n\nexport interface AccordionProps extends BaseComponentProps, WithChildren {\n /** Type of accordion - single allows one item open, multiple allows many */\n type?: AccordionType;\n /** Currently open item(s) - string for single, array for multiple (controlled) */\n value?: string | string[];\n /** Default open item(s) (uncontrolled) */\n defaultValue?: string | string[];\n /** Callback when open items change */\n onValueChange?: (value: string | string[]) => void;\n /** Whether items can be collapsed (single type only) */\n collapsible?: boolean;\n /** Whether all items are disabled */\n disabled?: boolean;\n}\n\nexport interface AccordionItemProps extends BaseComponentProps, WithChildren {\n /** Unique value for this item */\n value: string;\n /** Whether this item is disabled */\n disabled?: boolean;\n}\n\nexport interface AccordionTriggerProps\n extends\n BaseComponentProps,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {}\n\nexport interface AccordionContentProps\n extends BaseComponentProps, WithChildren {}\n\n/* --------------------------------- Context --------------------------------- */\n\nconst AccordionContext = createContext<AccordionContextValue | null>(null);\n\nconst useAccordionContext = () => {\n const context = useContext(AccordionContext);\n if (!context) {\n throw new Error('Accordion components must be used within Accordion');\n }\n return context;\n};\n\ninterface AccordionItemContextValue {\n value: string;\n disabled: boolean;\n isOpen: boolean;\n triggerId: string;\n contentId: string;\n}\n\nconst AccordionItemContext = createContext<AccordionItemContextValue | null>(\n null\n);\n\nconst useAccordionItemContext = () => {\n const context = useContext(AccordionItemContext);\n if (!context) {\n throw new Error(\n 'AccordionTrigger and AccordionContent must be used within AccordionItem'\n );\n }\n return context;\n};\n\n/* --------------------------------- Main Component --------------------------------- */\n\nexport const Accordion: React.FC<AccordionProps> = ({\n children,\n type = 'single',\n value: controlledValue,\n defaultValue,\n onValueChange,\n collapsible = false,\n disabled = false,\n className,\n ...props\n}) => {\n const [uncontrolledValue, setUncontrolledValue] = useState<string | string[]>(\n defaultValue || (type === 'single' ? '' : [])\n );\n\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : uncontrolledValue;\n\n const handleValueChange = useCallback(\n (itemValue: string) => {\n let newValue: string | string[];\n\n if (type === 'single') {\n // Single mode\n const currentValue = value as string;\n if (currentValue === itemValue && collapsible) {\n newValue = '';\n } else {\n newValue = itemValue;\n }\n } else {\n // Multiple mode\n const currentValue = (value as string[]) || [];\n if (currentValue.includes(itemValue)) {\n newValue = currentValue.filter((v) => v !== itemValue);\n } else {\n newValue = [...currentValue, itemValue];\n }\n }\n\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n onValueChange?.(newValue);\n },\n [type, value, collapsible, isControlled, onValueChange]\n );\n\n const accordionId = useId('accordion');\n\n const contextValue: AccordionContextValue = {\n type,\n value,\n onValueChange: handleValueChange,\n collapsible,\n disabled,\n accordionId,\n };\n\n return (\n <AccordionContext.Provider value={contextValue}>\n <div className={cn('accordion', className)} {...props}>\n {children}\n </div>\n </AccordionContext.Provider>\n );\n};\n\n/* --------------------------------- AccordionItem --------------------------------- */\n\nexport const AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(\n (\n { children, className, value, disabled: itemDisabled = false, ...props },\n ref\n ) => {\n const {\n type,\n value: accordionValue,\n disabled: accordionDisabled,\n accordionId,\n } = useAccordionContext();\n\n const disabled = accordionDisabled || itemDisabled;\n\n const isOpen =\n type === 'single'\n ? accordionValue === value\n : Array.isArray(accordionValue) && accordionValue.includes(value);\n\n const triggerId = `${accordionId}-trigger-${value}`;\n const contentId = `${accordionId}-content-${value}`;\n\n const itemContextValue: AccordionItemContextValue = {\n value,\n disabled,\n isOpen,\n triggerId,\n contentId,\n };\n\n return (\n <AccordionItemContext.Provider value={itemContextValue}>\n <div\n ref={ref}\n className={cn('accordion-item', className)}\n data-state={isOpen ? 'open' : 'closed'}\n data-disabled={disabled ? 'true' : undefined}\n {...props}\n >\n {children}\n </div>\n </AccordionItemContext.Provider>\n );\n }\n);\n\nAccordionItem.displayName = 'AccordionItem';\n\n/* --------------------------------- AccordionTrigger --------------------------------- */\n\nexport const AccordionTrigger = forwardRef<\n HTMLButtonElement,\n AccordionTriggerProps\n>(({ children, className, ...props }, ref) => {\n const { onValueChange } = useAccordionContext();\n const { value, disabled, isOpen, triggerId, contentId } =\n useAccordionItemContext();\n\n const handleClick = () => {\n if (!disabled) {\n onValueChange(value);\n }\n };\n\n return (\n <h3 className=\"accordion-header\">\n <button\n ref={ref}\n type=\"button\"\n id={triggerId}\n aria-expanded={isOpen}\n aria-controls={contentId}\n disabled={disabled}\n className={cn('accordion-trigger', className)}\n data-state={isOpen ? 'open' : 'closed'}\n onClick={handleClick}\n {...props}\n >\n {children}\n </button>\n </h3>\n );\n});\n\nAccordionTrigger.displayName = 'AccordionTrigger';\n\n/* --------------------------------- AccordionContent --------------------------------- */\n\nexport const AccordionContent = forwardRef<\n HTMLDivElement,\n AccordionContentProps\n>(({ children, className, ...props }, ref) => {\n const { isOpen, triggerId, contentId } = useAccordionItemContext();\n const contentRef = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState<number | undefined>(\n isOpen ? undefined : 0\n );\n\n // Animate height\n useEffect(() => {\n const element = contentRef.current;\n if (!element) return;\n\n if (isOpen) {\n const contentHeight = element.scrollHeight;\n setHeight(contentHeight);\n\n // After animation, set to auto for dynamic content\n const timer = setTimeout(() => {\n setHeight(undefined);\n }, 300); // Match CSS transition duration\n\n return () => clearTimeout(timer);\n } else {\n // Get current height first\n const currentHeight = element.scrollHeight;\n setHeight(currentHeight);\n\n // Force reflow to ensure height is applied\n element.offsetHeight;\n\n // Then animate to 0\n requestAnimationFrame(() => {\n setHeight(0);\n });\n }\n }, [isOpen]);\n\n return (\n <div\n ref={(node) => {\n (contentRef as React.MutableRefObject<HTMLDivElement | null>).current =\n node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n }}\n id={contentId}\n role=\"region\"\n aria-labelledby={triggerId}\n className={cn('accordion-content', className)}\n data-state={isOpen ? 'open' : 'closed'}\n style={{\n height: height !== undefined ? `${height}px` : 'auto',\n overflow: 'hidden',\n transition: 'height 300ms cubic-bezier(0.4, 0, 0.2, 1)',\n }}\n {...props}\n >\n <div className=\"accordion-content-inner\">{children}</div>\n </div>\n );\n});\n\nAccordionContent.displayName = 'AccordionContent';\n\nAccordion.displayName = 'Accordion';\n","/**\n * Tooltip Component\n *\n * A fully accessible tooltip component following WAI-ARIA Tooltip pattern.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Keyboard accessible (hover and focus)\n * - Multiple placements\n * - Delay controls\n * - Portal rendering\n * - Proper ARIA attributes\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/\n */\n\nimport React, {\n createContext,\n useContext,\n useState,\n useRef,\n useEffect,\n forwardRef,\n useCallback,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useId } from '../../hooks/useId';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps, WithChildren } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\ntype TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\ninterface TooltipContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n tooltipId: string;\n triggerRef: React.RefObject<HTMLElement>;\n delayShow: number;\n delayHide: number;\n}\n\nexport interface TooltipProps extends WithChildren {\n /** Delay before showing tooltip (ms) */\n delayShow?: number;\n /** Delay before hiding tooltip (ms) */\n delayHide?: number;\n /** Default open state (uncontrolled) */\n defaultOpen?: boolean;\n /** Controlled open state */\n open?: boolean;\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void;\n}\n\nexport interface TooltipTriggerProps\n extends BaseComponentProps, React.HTMLAttributes<HTMLElement> {\n /** Element to render as trigger */\n asChild?: boolean;\n}\n\nexport interface TooltipContentProps extends BaseComponentProps, WithChildren {\n /** Placement of tooltip relative to trigger */\n placement?: TooltipPlacement;\n /** Whether to render in a portal */\n portal?: boolean;\n}\n\n/* --------------------------------- Context --------------------------------- */\n\nconst TooltipContext = createContext<TooltipContextValue | null>(null);\n\nconst useTooltipContext = () => {\n const context = useContext(TooltipContext);\n if (!context) {\n throw new Error('Tooltip components must be used within Tooltip');\n }\n return context;\n};\n\n/* --------------------------------- Utils --------------------------------- */\n\nconst isBrowser = typeof window !== 'undefined';\n\n/* --------------------------------- Main Component --------------------------------- */\n\nexport const Tooltip: React.FC<TooltipProps> = ({\n children,\n delayShow = 200,\n delayHide = 0,\n defaultOpen = false,\n open: controlledOpen,\n onOpenChange,\n}) => {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : uncontrolledOpen;\n\n const setOpen = useCallback(\n (newOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(newOpen);\n }\n onOpenChange?.(newOpen);\n },\n [isControlled, onOpenChange]\n );\n\n const tooltipId = useId('tooltip');\n const triggerRef = useRef<HTMLElement>(null);\n\n const value: TooltipContextValue = {\n open,\n setOpen,\n tooltipId,\n triggerRef,\n delayShow,\n delayHide,\n };\n\n return (\n <TooltipContext.Provider value={value}>{children}</TooltipContext.Provider>\n );\n};\n\n/* --------------------------------- TooltipTrigger --------------------------------- */\n\nexport const TooltipTrigger = forwardRef<HTMLElement, TooltipTriggerProps>(\n (\n {\n children,\n className,\n asChild = false,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref\n ) => {\n const { setOpen, tooltipId, triggerRef, delayShow, delayHide } =\n useTooltipContext();\n const showTimeoutRef = useRef<NodeJS.Timeout>();\n const hideTimeoutRef = useRef<NodeJS.Timeout>();\n\n const handleMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n clearTimeout(hideTimeoutRef.current);\n showTimeoutRef.current = setTimeout(() => {\n setOpen(true);\n }, delayShow);\n onMouseEnter?.(e);\n },\n [setOpen, delayShow, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n clearTimeout(showTimeoutRef.current);\n hideTimeoutRef.current = setTimeout(() => {\n setOpen(false);\n }, delayHide);\n onMouseLeave?.(e);\n },\n [setOpen, delayHide, onMouseLeave]\n );\n\n const handleFocus = useCallback(\n (e: React.FocusEvent<HTMLElement>) => {\n clearTimeout(hideTimeoutRef.current);\n setOpen(true);\n onFocus?.(e);\n },\n [setOpen, onFocus]\n );\n\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLElement>) => {\n clearTimeout(showTimeoutRef.current);\n setOpen(false);\n onBlur?.(e);\n },\n [setOpen, onBlur]\n );\n\n useEffect(() => {\n return () => {\n clearTimeout(showTimeoutRef.current);\n clearTimeout(hideTimeoutRef.current);\n };\n }, []);\n\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(children as React.ReactElement<any>, {\n ref: (node: HTMLElement) => {\n (triggerRef as React.MutableRefObject<HTMLElement | null>).current =\n node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLElement | null>).current = node;\n }\n },\n 'aria-describedby': tooltipId,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onFocus: handleFocus,\n onBlur: handleBlur,\n });\n }\n\n return (\n <span\n ref={(node) => {\n (triggerRef as React.MutableRefObject<HTMLElement | null>).current =\n node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLElement | null>).current = node;\n }\n }}\n className={cn('tooltip-trigger', className)}\n aria-describedby={tooltipId}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...props}\n >\n {children}\n </span>\n );\n }\n);\n\nTooltipTrigger.displayName = 'TooltipTrigger';\n\n/* --------------------------------- TooltipContent --------------------------------- */\n\nexport const TooltipContent = forwardRef<HTMLDivElement, TooltipContentProps>(\n (\n { children, className, placement = 'top', portal = true, style, ...props },\n ref\n ) => {\n const { open, tooltipId, triggerRef } = useTooltipContext();\n const contentRef = useRef<HTMLDivElement>(null);\n const [position, setPosition] = useState({ top: 0, left: 0 });\n\n // Calculate position\n useEffect(() => {\n if (!open || !portal) return;\n\n const updatePosition = () => {\n const trigger = triggerRef.current;\n const content = contentRef.current;\n if (!trigger || !content) return;\n\n const triggerRect = trigger.getBoundingClientRect();\n const contentRect = content.getBoundingClientRect();\n\n let top = 0;\n let left = 0;\n\n switch (placement) {\n case 'top':\n top = triggerRect.top + window.scrollY - contentRect.height - 8;\n left =\n triggerRect.left +\n window.scrollX +\n triggerRect.width / 2 -\n contentRect.width / 2;\n break;\n case 'bottom':\n top = triggerRect.bottom + window.scrollY + 8;\n left =\n triggerRect.left +\n window.scrollX +\n triggerRect.width / 2 -\n contentRect.width / 2;\n break;\n case 'left':\n top =\n triggerRect.top +\n window.scrollY +\n triggerRect.height / 2 -\n contentRect.height / 2;\n left = triggerRect.left + window.scrollX - contentRect.width - 8;\n break;\n case 'right':\n top =\n triggerRect.top +\n window.scrollY +\n triggerRect.height / 2 -\n contentRect.height / 2;\n left = triggerRect.right + window.scrollX + 8;\n break;\n }\n\n setPosition({ top, left });\n };\n\n updatePosition();\n\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n\n return () => {\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n };\n }, [open, portal, placement, triggerRef]);\n\n if (!open) return null;\n\n const tooltipStyle = portal\n ? {\n ...style,\n position: 'absolute' as const,\n top: `${position.top}px`,\n left: `${position.left}px`,\n zIndex: 9999,\n }\n : style;\n\n const tooltip = (\n <div\n ref={(node) => {\n (\n contentRef as React.MutableRefObject<HTMLDivElement | null>\n ).current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current =\n node;\n }\n }}\n id={tooltipId}\n role=\"tooltip\"\n className={cn('tooltip-content', className)}\n data-placement={placement}\n style={tooltipStyle}\n {...props}\n >\n {children}\n </div>\n );\n\n if (portal && isBrowser) {\n return createPortal(tooltip, document.body);\n }\n\n return tooltip;\n }\n);\n\nTooltipContent.displayName = 'TooltipContent';\n\nTooltip.displayName = 'Tooltip';\n","/**\n * Toast Component\n *\n * A notification system for displaying temporary messages.\n *\n * Features:\n * - Multiple variants (default, success, error, warning, info)\n * - Auto-dismiss with configurable duration\n * - Manual dismiss\n * - Multiple positions\n * - Stacking support\n * - Animations\n * - Accessible (ARIA live regions)\n */\n\nimport React, {\n createContext,\n useContext,\n useState,\n useCallback,\n useEffect,\n forwardRef,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps, WithChildren } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport type ToastVariant = 'default' | 'success' | 'error' | 'warning' | 'info';\nexport type ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\nexport interface Toast {\n id: string;\n title?: string;\n description?: string;\n variant?: ToastVariant;\n duration?: number;\n onDismiss?: () => void;\n}\n\ninterface ToastContextValue {\n toasts: Toast[];\n addToast: (toast: Omit<Toast, 'id'>) => string;\n removeToast: (id: string) => void;\n position: ToastPosition;\n}\n\nexport interface ToastProviderProps extends WithChildren {\n /** Position of toast notifications */\n position?: ToastPosition;\n /** Maximum number of toasts to show */\n maxToasts?: number;\n}\n\nexport interface ToastItemProps extends BaseComponentProps {\n /** Toast data */\n toast: Toast;\n /** Callback when toast is dismissed */\n onDismiss: (id: string) => void;\n}\n\n/* --------------------------------- Context --------------------------------- */\n\nconst ToastContext = createContext<ToastContextValue | null>(null);\n\nexport const useToast = () => {\n const context = useContext(ToastContext);\n if (!context) {\n throw new Error('useToast must be used within ToastProvider');\n }\n return context;\n};\n\n/* --------------------------------- Utils --------------------------------- */\n\nconst isBrowser = typeof window !== 'undefined';\n\nlet toastCount = 0;\nconst generateId = () => `toast-${++toastCount}`;\n\n/* --------------------------------- ToastProvider --------------------------------- */\n\nexport const ToastProvider: React.FC<ToastProviderProps> = ({\n children,\n position = 'bottom-right',\n maxToasts = 5,\n}) => {\n const [toasts, setToasts] = useState<Toast[]>([]);\n\n const addToast = useCallback(\n (toast: Omit<Toast, 'id'>) => {\n const id = generateId();\n const newToast: Toast = {\n ...toast,\n id,\n duration: toast.duration ?? 5000,\n variant: toast.variant ?? 'default',\n };\n\n setToasts((prev) => {\n const updated = [...prev, newToast];\n return updated.slice(-maxToasts);\n });\n\n return id;\n },\n [maxToasts]\n );\n\n const removeToast = useCallback((id: string) => {\n setToasts((prev) => prev.filter((t) => t.id !== id));\n }, []);\n\n const value: ToastContextValue = {\n toasts,\n addToast,\n removeToast,\n position,\n };\n\n return (\n <ToastContext.Provider value={value}>\n {children}\n <ToastContainer />\n </ToastContext.Provider>\n );\n};\n\n/* --------------------------------- ToastContainer --------------------------------- */\n\nconst ToastContainer: React.FC = () => {\n const { toasts, position } = useToast();\n\n if (!isBrowser || toasts.length === 0) return null;\n\n const positionStyles: Record<ToastPosition, React.CSSProperties> = {\n 'top-left': { top: 16, left: 16 },\n 'top-center': { top: 16, left: '50%', transform: 'translateX(-50%)' },\n 'top-right': { top: 16, right: 16 },\n 'bottom-left': { bottom: 16, left: 16 },\n 'bottom-center': { bottom: 16, left: '50%', transform: 'translateX(-50%)' },\n 'bottom-right': { bottom: 16, right: 16 },\n };\n\n return createPortal(\n <div\n className=\"toast-container\"\n style={{\n position: 'fixed',\n zIndex: 10000,\n display: 'flex',\n flexDirection: 'column',\n gap: '8px',\n pointerEvents: 'none',\n ...positionStyles[position],\n }}\n aria-live=\"polite\"\n aria-atomic=\"false\"\n >\n {toasts.map((toast) => (\n <ToastItem key={toast.id} toast={toast} />\n ))}\n </div>,\n document.body\n );\n};\n\n/* --------------------------------- ToastItem --------------------------------- */\n\nconst ToastItem = forwardRef<HTMLDivElement, { toast: Toast }>(\n ({ toast }, ref) => {\n const { removeToast } = useToast();\n const [isExiting, setIsExiting] = useState(false);\n\n useEffect(() => {\n if (toast.duration && toast.duration > 0) {\n const timer = setTimeout(() => {\n handleDismiss();\n }, toast.duration);\n\n return () => clearTimeout(timer);\n }\n }, [toast.duration, toast.id]);\n\n const handleDismiss = () => {\n setIsExiting(true);\n setTimeout(() => {\n removeToast(toast.id);\n toast.onDismiss?.();\n }, 200); // Match animation duration\n };\n\n const variantStyles: Record<ToastVariant, React.CSSProperties> = {\n default: {\n backgroundColor: '#1f2937',\n color: 'white',\n border: '1px solid #374151',\n },\n success: {\n backgroundColor: '#10b981',\n color: 'white',\n border: '1px solid #059669',\n },\n error: {\n backgroundColor: '#ef4444',\n color: 'white',\n border: '1px solid #dc2626',\n },\n warning: {\n backgroundColor: '#f59e0b',\n color: '#1f2937',\n border: '1px solid #d97706',\n },\n info: {\n backgroundColor: '#3b82f6',\n color: 'white',\n border: '1px solid #2563eb',\n },\n };\n\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-live=\"polite\"\n className={cn('toast-item', `toast-${toast.variant}`)}\n data-variant={toast.variant}\n data-exiting={isExiting}\n style={{\n pointerEvents: 'auto',\n minWidth: '300px',\n maxWidth: '500px',\n padding: '16px',\n borderRadius: '8px',\n boxShadow:\n '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',\n display: 'flex',\n alignItems: 'flex-start',\n gap: '12px',\n animation: isExiting\n ? 'toast-exit 200ms ease-out'\n : 'toast-enter 200ms ease-out',\n ...variantStyles[toast.variant || 'default'],\n }}\n >\n <div style={{ flex: 1 }}>\n {toast.title && (\n <div\n style={{\n fontWeight: '600',\n fontSize: '14px',\n marginBottom: toast.description ? '4px' : 0,\n }}\n >\n {toast.title}\n </div>\n )}\n {toast.description && (\n <div style={{ fontSize: '13px', opacity: 0.9 }}>\n {toast.description}\n </div>\n )}\n </div>\n <button\n onClick={handleDismiss}\n aria-label=\"Dismiss notification\"\n style={{\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n padding: '4px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n opacity: 0.7,\n transition: 'opacity 0.2s',\n }}\n onMouseEnter={(e) => (e.currentTarget.style.opacity = '1')}\n onMouseLeave={(e) => (e.currentTarget.style.opacity = '0.7')}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n <path d=\"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z\" />\n </svg>\n </button>\n\n <style>{`\n @keyframes toast-enter {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes toast-exit {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(20px);\n }\n }\n `}</style>\n </div>\n );\n }\n);\n\nToastItem.displayName = 'ToastItem';\n\n/* --------------------------------- Helper Hook --------------------------------- */\n\n/**\n * Hook to show toast notifications\n * Must be used within ToastProvider\n */\nexport const useToastNotification = () => {\n const { addToast } = useToast();\n\n const toast = useCallback(\n (options: Omit<Toast, 'id'>) => {\n return addToast(options);\n },\n [addToast]\n );\n\n const success = useCallback(\n (title: string, description?: string) => {\n return addToast({ title, description, variant: 'success' });\n },\n [addToast]\n );\n\n const error = useCallback(\n (title: string, description?: string) => {\n return addToast({ title, description, variant: 'error' });\n },\n [addToast]\n );\n\n const warning = useCallback(\n (title: string, description?: string) => {\n return addToast({ title, description, variant: 'warning' });\n },\n [addToast]\n );\n\n const info = useCallback(\n (title: string, description?: string) => {\n return addToast({ title, description, variant: 'info' });\n },\n [addToast]\n );\n\n return {\n toast,\n success,\n error,\n warning,\n info,\n };\n};\n","/**\n * Checkbox Component\n *\n * A fully accessible checkbox component following WAI-ARIA practices.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Keyboard accessible\n * - Indeterminate state\n * - Disabled state\n * - Error state\n * - Label integration\n * - Controlled and uncontrolled modes\n */\n\nimport React, { forwardRef, useCallback, InputHTMLAttributes } from 'react';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface CheckboxProps\n extends\n BaseComponentProps,\n Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {\n /** Whether the checkbox is checked */\n checked?: boolean;\n /** Default checked state (uncontrolled) */\n defaultChecked?: boolean;\n /** Whether the checkbox is in an indeterminate state */\n indeterminate?: boolean;\n /** Whether the checkbox is disabled */\n disabled?: boolean;\n /** Whether the checkbox has an error */\n invalid?: boolean;\n /** Label text */\n label?: string;\n /** Helper text */\n helperText?: string;\n /** Error message */\n errorMessage?: string;\n /** Callback when checked state changes */\n onCheckedChange?: (checked: boolean) => void;\n}\n\n/* --------------------------------- Component --------------------------------- */\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n className,\n checked,\n defaultChecked,\n indeterminate = false,\n disabled = false,\n invalid = false,\n label,\n helperText,\n errorMessage,\n onCheckedChange,\n onChange,\n id,\n ...props\n },\n ref\n ) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e);\n onCheckedChange?.(e.target.checked);\n },\n [onChange, onCheckedChange]\n );\n\n // Set indeterminate property on the input element\n const inputRef = React.useRef<HTMLInputElement>(null);\n React.useEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate]);\n\n // Combine refs\n React.useImperativeHandle(ref, () => inputRef.current!);\n\n const checkboxId = id || `checkbox-${React.useId()}`;\n const helperTextId = helperText ? `${checkboxId}-helper` : undefined;\n const errorMessageId = errorMessage ? `${checkboxId}-error` : undefined;\n\n const describedBy =\n [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n return (\n <div className={cn('checkbox-wrapper', className)}>\n <div style={{ display: 'flex', alignItems: 'flex-start', gap: '8px' }}>\n <input\n ref={inputRef}\n type=\"checkbox\"\n id={checkboxId}\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n aria-invalid={invalid}\n aria-describedby={describedBy}\n onChange={handleChange}\n className=\"checkbox-input\"\n data-invalid={invalid ? 'true' : undefined}\n data-indeterminate={indeterminate ? 'true' : undefined}\n {...props}\n />\n {label && (\n <label\n htmlFor={checkboxId}\n className=\"checkbox-label\"\n style={{\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.6 : 1,\n }}\n >\n {label}\n </label>\n )}\n </div>\n\n {helperText && !errorMessage && (\n <div\n id={helperTextId}\n className=\"checkbox-helper-text\"\n style={{\n fontSize: '13px',\n color: '#6b7280',\n marginTop: '4px',\n marginLeft: '28px',\n }}\n >\n {helperText}\n </div>\n )}\n\n {errorMessage && (\n <div\n id={errorMessageId}\n className=\"checkbox-error-message\"\n role=\"alert\"\n style={{\n fontSize: '13px',\n color: '#ef4444',\n marginTop: '4px',\n marginLeft: '28px',\n }}\n >\n {errorMessage}\n </div>\n )}\n </div>\n );\n }\n);\n\nCheckbox.displayName = 'Checkbox';\n","/**\n * Radio Component\n *\n * A fully accessible radio button component following WAI-ARIA practices.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Keyboard navigation (Arrow keys)\n * - RadioGroup for managing radio button groups\n * - Disabled state\n * - Error state\n * - Label integration\n * - Controlled and uncontrolled modes\n */\n\nimport React, {\n createContext,\n useContext,\n forwardRef,\n useCallback,\n InputHTMLAttributes,\n} from 'react';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\ninterface RadioGroupContextValue {\n name: string;\n value?: string;\n disabled?: boolean;\n onChange?: (value: string) => void;\n}\n\nexport interface RadioGroupProps extends BaseComponentProps {\n /** Group name */\n name: string;\n /** Selected value */\n value?: string;\n /** Default selected value (uncontrolled) */\n defaultValue?: string;\n /** Whether the group is disabled */\n disabled?: boolean;\n /** Whether the group has an error */\n invalid?: boolean;\n /** Label for the group */\n label?: string;\n /** Helper text */\n helperText?: string;\n /** Error message */\n errorMessage?: string;\n /** Callback when value changes */\n onValueChange?: (value: string) => void;\n /** Children (Radio components) */\n children: React.ReactNode;\n}\n\nexport interface RadioProps\n extends\n BaseComponentProps,\n Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {\n /** Value of this radio option */\n value: string;\n /** Label text */\n label?: string;\n /** Whether this radio is disabled */\n disabled?: boolean;\n}\n\n/* --------------------------------- Context --------------------------------- */\n\nconst RadioGroupContext = createContext<RadioGroupContextValue | null>(null);\n\nconst useRadioGroup = () => {\n const context = useContext(RadioGroupContext);\n if (!context) {\n throw new Error('Radio must be used within RadioGroup');\n }\n return context;\n};\n\n/* --------------------------------- RadioGroup --------------------------------- */\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n className,\n name,\n value: controlledValue,\n defaultValue,\n disabled = false,\n invalid = false,\n label,\n helperText,\n errorMessage,\n onValueChange,\n children,\n ...props\n },\n ref\n ) => {\n const [uncontrolledValue, setUncontrolledValue] =\n React.useState(defaultValue);\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : uncontrolledValue;\n\n const handleChange = useCallback(\n (newValue: string) => {\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n onValueChange?.(newValue);\n },\n [isControlled, onValueChange]\n );\n\n const groupId = React.useId();\n const helperTextId = helperText ? `${groupId}-helper` : undefined;\n const errorMessageId = errorMessage ? `${groupId}-error` : undefined;\n\n const describedBy =\n [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n const contextValue: RadioGroupContextValue = {\n name,\n value,\n disabled,\n onChange: handleChange,\n };\n\n return (\n <div ref={ref} className={cn('radio-group', className)} {...props}>\n {label && (\n <div\n className=\"radio-group-label\"\n style={{\n fontSize: '14px',\n fontWeight: '500',\n marginBottom: '12px',\n color: disabled ? '#9ca3af' : '#1f2937',\n }}\n >\n {label}\n </div>\n )}\n\n <RadioGroupContext.Provider value={contextValue}>\n <div\n role=\"radiogroup\"\n aria-invalid={invalid}\n aria-describedby={describedBy}\n style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}\n >\n {children}\n </div>\n </RadioGroupContext.Provider>\n\n {helperText && !errorMessage && (\n <div\n id={helperTextId}\n className=\"radio-group-helper-text\"\n style={{\n fontSize: '13px',\n color: '#6b7280',\n marginTop: '8px',\n }}\n >\n {helperText}\n </div>\n )}\n\n {errorMessage && (\n <div\n id={errorMessageId}\n className=\"radio-group-error-message\"\n role=\"alert\"\n style={{\n fontSize: '13px',\n color: '#ef4444',\n marginTop: '8px',\n }}\n >\n {errorMessage}\n </div>\n )}\n </div>\n );\n }\n);\n\nRadioGroup.displayName = 'RadioGroup';\n\n/* --------------------------------- Radio --------------------------------- */\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n { className, value, label, disabled: radioDisabled, onChange, ...props },\n ref\n ) => {\n const group = useRadioGroup();\n const disabled = radioDisabled || group.disabled;\n const checked = group.value === value;\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e);\n group.onChange?.(value);\n },\n [onChange, group, value]\n );\n\n const radioId = `${group.name}-${value}`;\n\n return (\n <div className={cn('radio-wrapper', className)}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <input\n ref={ref}\n type=\"radio\"\n id={radioId}\n name={group.name}\n value={value}\n checked={checked}\n disabled={disabled}\n onChange={handleChange}\n className=\"radio-input\"\n {...props}\n />\n {label && (\n <label\n htmlFor={radioId}\n className=\"radio-label\"\n style={{\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.6 : 1,\n fontSize: '14px',\n }}\n >\n {label}\n </label>\n )}\n </div>\n </div>\n );\n }\n);\n\nRadio.displayName = 'Radio';\n","/**\n * useClickOutside Hook\n *\n * Detects clicks outside of specified elements\n */\n\nimport { useEffect, RefObject } from 'react';\n\nexport function useClickOutside(\n refs: RefObject<HTMLElement>[] | RefObject<HTMLElement>,\n handler: () => void\n): void {\n useEffect(() => {\n const refsArray = Array.isArray(refs) ? refs : [refs];\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const target = event.target as Node;\n\n // Check if click is outside all refs\n const isOutside = refsArray.every(\n (ref) => !ref.current || !ref.current.contains(target)\n );\n\n if (isOutside) {\n handler();\n }\n };\n\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n\n return () => {\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [refs, handler]);\n}\n","/**\n * Select Component\n *\n * A fully accessible select/dropdown component with search functionality.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Keyboard navigation (Arrow keys, Enter, Escape, Home, End)\n * - Search/filter functionality\n * - Multiple selection mode\n * - Disabled state\n * - Error state\n * - Placeholder support\n * - Controlled and uncontrolled modes\n * - Portal rendering\n */\n\nimport React, {\n forwardRef,\n useCallback,\n useState,\n useRef,\n useEffect,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/dom';\nimport { useClickOutside } from '../../hooks/useClickOutside';\nimport { useEscapeKey } from '../../hooks/useEscapeKey';\nimport { BaseComponentProps } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps extends BaseComponentProps {\n /** Available options */\n options: SelectOption[];\n /** Selected value(s) */\n value?: string | string[];\n /** Default value (uncontrolled) */\n defaultValue?: string | string[];\n /** Placeholder text */\n placeholder?: string;\n /** Whether the select is disabled */\n disabled?: boolean;\n /** Whether the select has an error */\n invalid?: boolean;\n /** Whether to allow multiple selections */\n multiple?: boolean;\n /** Whether to show search input */\n searchable?: boolean;\n /** Label text */\n label?: string;\n /** Helper text */\n helperText?: string;\n /** Error message */\n errorMessage?: string;\n /** Callback when value changes */\n onValueChange?: (value: string | string[]) => void;\n /** Custom render for selected value */\n renderValue?: (value: string | string[]) => React.ReactNode;\n}\n\n/* --------------------------------- Utils --------------------------------- */\n\nconst isBrowser = typeof window !== 'undefined';\n\n/* --------------------------------- Component --------------------------------- */\n\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n className,\n options,\n value: controlledValue,\n defaultValue,\n placeholder = 'Select an option',\n disabled = false,\n invalid = false,\n multiple = false,\n searchable = false,\n label,\n helperText,\n errorMessage,\n onValueChange,\n renderValue,\n ...props\n },\n ref\n ) => {\n const [uncontrolledValue, setUncontrolledValue] = useState<\n string | string[]\n >(defaultValue || (multiple ? [] : ''));\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : uncontrolledValue;\n\n const [isOpen, setIsOpen] = useState(false);\n const [searchQuery, setSearchQuery] = useState('');\n const [highlightedIndex, setHighlightedIndex] = useState(0);\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const searchInputRef = useRef<HTMLInputElement>(null);\n\n // Combine refs\n React.useImperativeHandle(ref, () => triggerRef.current!);\n\n // Click outside to close\n useClickOutside([triggerRef, dropdownRef], () => setIsOpen(false));\n\n // Escape to close\n useEscapeKey({ enabled: isOpen, onEscape: () => setIsOpen(false) });\n\n // Filter options based on search\n const filteredOptions = searchable\n ? options.filter((option) =>\n option.label.toLowerCase().includes(searchQuery.toLowerCase())\n )\n : options;\n\n // Focus search input when opened\n useEffect(() => {\n if (isOpen && searchable && searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, [isOpen, searchable]);\n\n // Reset search when closed\n useEffect(() => {\n if (!isOpen) {\n setSearchQuery('');\n setHighlightedIndex(0);\n }\n }, [isOpen]);\n\n const handleValueChange = useCallback(\n (newValue: string | string[]) => {\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n onValueChange?.(newValue);\n },\n [isControlled, onValueChange]\n );\n\n const handleSelect = useCallback(\n (optionValue: string) => {\n if (multiple) {\n const currentValue = (value as string[]) || [];\n const newValue = currentValue.includes(optionValue)\n ? currentValue.filter((v) => v !== optionValue)\n : [...currentValue, optionValue];\n handleValueChange(newValue);\n } else {\n handleValueChange(optionValue);\n setIsOpen(false);\n }\n },\n [multiple, value, handleValueChange]\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) return;\n\n switch (e.key) {\n case 'Enter':\n case ' ':\n if (!isOpen) {\n e.preventDefault();\n setIsOpen(true);\n } else if (!searchable) {\n e.preventDefault();\n const option = filteredOptions[highlightedIndex];\n if (option && !option.disabled) {\n handleSelect(option.value);\n }\n }\n break;\n\n case 'ArrowDown':\n e.preventDefault();\n if (!isOpen) {\n setIsOpen(true);\n } else {\n setHighlightedIndex((prev) =>\n prev < filteredOptions.length - 1 ? prev + 1 : prev\n );\n }\n break;\n\n case 'ArrowUp':\n e.preventDefault();\n if (isOpen) {\n setHighlightedIndex((prev) => (prev > 0 ? prev - 1 : prev));\n }\n break;\n\n case 'Home':\n if (isOpen) {\n e.preventDefault();\n setHighlightedIndex(0);\n }\n break;\n\n case 'End':\n if (isOpen) {\n e.preventDefault();\n setHighlightedIndex(filteredOptions.length - 1);\n }\n break;\n\n case 'Escape':\n if (isOpen) {\n e.preventDefault();\n setIsOpen(false);\n }\n break;\n }\n },\n [\n disabled,\n isOpen,\n searchable,\n highlightedIndex,\n filteredOptions,\n handleSelect,\n ]\n );\n\n const getDisplayValue = () => {\n if (renderValue) {\n return renderValue(value);\n }\n\n if (multiple) {\n const selectedOptions = options.filter((opt) =>\n (value as string[]).includes(opt.value)\n );\n return selectedOptions.length > 0\n ? selectedOptions.map((opt) => opt.label).join(', ')\n : placeholder;\n }\n\n const selectedOption = options.find((opt) => opt.value === value);\n return selectedOption ? selectedOption.label : placeholder;\n };\n\n const isSelected = (optionValue: string) => {\n if (multiple) {\n return (value as string[]).includes(optionValue);\n }\n return value === optionValue;\n };\n\n const selectId = React.useId();\n const helperTextId = helperText ? `${selectId}-helper` : undefined;\n const errorMessageId = errorMessage ? `${selectId}-error` : undefined;\n const describedBy =\n [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n return (\n <div className={cn('select-wrapper', className)}>\n {label && (\n <label\n htmlFor={selectId}\n className=\"select-label\"\n style={{\n display: 'block',\n fontSize: '14px',\n fontWeight: '500',\n marginBottom: '8px',\n color: disabled ? '#9ca3af' : '#1f2937',\n }}\n >\n {label}\n </label>\n )}\n\n <button\n ref={triggerRef}\n id={selectId}\n type=\"button\"\n role=\"combobox\"\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-controls={`${selectId}-listbox`}\n aria-invalid={invalid}\n aria-describedby={describedBy}\n disabled={disabled}\n onClick={() => !disabled && setIsOpen(!isOpen)}\n onKeyDown={handleKeyDown}\n className=\"select-trigger\"\n data-invalid={invalid ? 'true' : undefined}\n style={{\n width: '100%',\n padding: '8px 12px',\n fontSize: '14px',\n textAlign: 'left',\n backgroundColor: disabled ? '#f3f4f6' : 'white',\n border: `1px solid ${invalid ? '#ef4444' : '#d1d5db'}`,\n borderRadius: '6px',\n cursor: disabled ? 'not-allowed' : 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: '8px',\n }}\n {...props}\n >\n <span\n style={{\n flex: 1,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n >\n {getDisplayValue()}\n </span>\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n style={{\n transition: 'transform 0.2s',\n transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)',\n }}\n >\n <path\n d=\"M4 6l4 4 4-4\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n fill=\"none\"\n />\n </svg>\n </button>\n\n {isOpen &&\n isBrowser &&\n createPortal(\n <SelectDropdown\n ref={dropdownRef}\n id={`${selectId}-listbox`}\n triggerRef={triggerRef}\n options={filteredOptions}\n searchable={searchable}\n searchQuery={searchQuery}\n onSearchChange={setSearchQuery}\n searchInputRef={searchInputRef}\n highlightedIndex={highlightedIndex}\n onSelect={handleSelect}\n isSelected={isSelected}\n multiple={multiple}\n />,\n document.body\n )}\n\n {helperText && !errorMessage && (\n <div\n id={helperTextId}\n className=\"select-helper-text\"\n style={{\n fontSize: '13px',\n color: '#6b7280',\n marginTop: '4px',\n }}\n >\n {helperText}\n </div>\n )}\n\n {errorMessage && (\n <div\n id={errorMessageId}\n className=\"select-error-message\"\n role=\"alert\"\n style={{\n fontSize: '13px',\n color: '#ef4444',\n marginTop: '4px',\n }}\n >\n {errorMessage}\n </div>\n )}\n </div>\n );\n }\n);\n\nSelect.displayName = 'Select';\n\n/* --------------------------------- SelectDropdown --------------------------------- */\n\ninterface SelectDropdownProps {\n id: string;\n triggerRef: React.RefObject<HTMLButtonElement>;\n options: SelectOption[];\n searchable: boolean;\n searchQuery: string;\n onSearchChange: (query: string) => void;\n searchInputRef: React.RefObject<HTMLInputElement>;\n highlightedIndex: number;\n onSelect: (value: string) => void;\n isSelected: (value: string) => boolean;\n multiple: boolean;\n}\n\nconst SelectDropdown = forwardRef<HTMLDivElement, SelectDropdownProps>(\n (\n {\n id,\n triggerRef,\n options,\n searchable,\n searchQuery,\n onSearchChange,\n searchInputRef,\n highlightedIndex,\n onSelect,\n isSelected,\n multiple,\n },\n ref\n ) => {\n const [position, setPosition] = useState({ top: 0, left: 0, width: 0 });\n\n useEffect(() => {\n const updatePosition = () => {\n if (!triggerRef.current) return;\n\n const triggerRect = triggerRef.current.getBoundingClientRect();\n setPosition({\n top: triggerRect.bottom + window.scrollY + 4,\n left: triggerRect.left + window.scrollX,\n width: triggerRect.width,\n });\n };\n\n updatePosition();\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n\n return () => {\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n };\n }, [triggerRef]);\n\n return (\n <div\n ref={ref}\n id={id}\n role=\"listbox\"\n aria-multiselectable={multiple}\n className=\"select-dropdown\"\n style={{\n position: 'absolute',\n top: `${position.top}px`,\n left: `${position.left}px`,\n width: `${position.width}px`,\n maxHeight: '300px',\n backgroundColor: 'white',\n border: '1px solid #d1d5db',\n borderRadius: '6px',\n boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',\n zIndex: 10000,\n overflow: 'auto',\n }}\n >\n {searchable && (\n <div style={{ padding: '8px', borderBottom: '1px solid #e5e7eb' }}>\n <input\n ref={searchInputRef}\n type=\"text\"\n placeholder=\"Search...\"\n value={searchQuery}\n onChange={(e) => onSearchChange(e.target.value)}\n style={{\n width: '100%',\n padding: '6px 8px',\n fontSize: '14px',\n border: '1px solid #d1d5db',\n borderRadius: '4px',\n }}\n />\n </div>\n )}\n\n <div style={{ padding: '4px' }}>\n {options.length === 0 ? (\n <div\n style={{\n padding: '8px 12px',\n fontSize: '14px',\n color: '#6b7280',\n }}\n >\n No options found\n </div>\n ) : (\n options.map((option, index) => (\n <div\n key={option.value}\n role=\"option\"\n aria-selected={isSelected(option.value)}\n aria-disabled={option.disabled}\n onClick={() => !option.disabled && onSelect(option.value)}\n style={{\n padding: '8px 12px',\n fontSize: '14px',\n cursor: option.disabled ? 'not-allowed' : 'pointer',\n backgroundColor:\n index === highlightedIndex\n ? '#f3f4f6'\n : isSelected(option.value)\n ? '#eff6ff'\n : 'transparent',\n color: option.disabled ? '#9ca3af' : '#1f2937',\n borderRadius: '4px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }}\n >\n <span>{option.label}</span>\n {isSelected(option.value) && (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n >\n <path d=\"M13.5 3.5L6 11 2.5 7.5l1-1L6 9l6.5-6.5 1 1z\" />\n </svg>\n )}\n </div>\n ))\n )}\n </div>\n </div>\n );\n }\n);\n\nSelectDropdown.displayName = 'SelectDropdown';\n","/**\n * Textarea Component\n *\n * A fully accessible textarea component.\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Auto-resize option\n * - Character count\n * - Error state\n * - Disabled state\n * - Label integration\n */\n\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n TextareaHTMLAttributes,\n} from 'react';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface TextareaProps\n extends\n BaseComponentProps,\n Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {\n /** Label text */\n label?: string;\n /** Helper text */\n helperText?: string;\n /** Error message */\n errorMessage?: string;\n /** Whether the textarea has an error */\n invalid?: boolean;\n /** Maximum character count */\n maxLength?: number;\n /** Show character count */\n showCount?: boolean;\n /** Auto-resize to fit content */\n autoResize?: boolean;\n /** Minimum rows when auto-resizing */\n minRows?: number;\n /** Maximum rows when auto-resizing */\n maxRows?: number;\n}\n\n/* --------------------------------- Component --------------------------------- */\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n className,\n label,\n helperText,\n errorMessage,\n invalid = false,\n disabled = false,\n maxLength,\n showCount = false,\n autoResize = false,\n minRows = 3,\n maxRows,\n value,\n onChange,\n id,\n ...props\n },\n ref\n ) => {\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [charCount, setCharCount] = React.useState(0);\n\n // Combine refs\n React.useImperativeHandle(ref, () => textareaRef.current!);\n\n // Auto-resize functionality\n const updateHeight = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoResize) return;\n\n // Reset height to auto to get the correct scrollHeight\n textarea.style.height = 'auto';\n\n const lineHeight = parseInt(getComputedStyle(textarea).lineHeight);\n const minHeight = minRows * lineHeight;\n const maxHeight = maxRows ? maxRows * lineHeight : Infinity;\n\n const newHeight = Math.min(\n Math.max(textarea.scrollHeight, minHeight),\n maxHeight\n );\n textarea.style.height = `${newHeight}px`;\n }, [autoResize, minRows, maxRows]);\n\n useEffect(() => {\n if (autoResize) {\n updateHeight();\n }\n }, [value, autoResize, updateHeight]);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setCharCount(e.target.value.length);\n onChange?.(e);\n\n if (autoResize) {\n updateHeight();\n }\n },\n [onChange, autoResize, updateHeight]\n );\n\n useEffect(() => {\n if (value !== undefined) {\n setCharCount(String(value).length);\n }\n }, [value]);\n\n const textareaId = id || React.useId();\n const helperTextId = helperText ? `${textareaId}-helper` : undefined;\n const errorMessageId = errorMessage ? `${textareaId}-error` : undefined;\n const describedBy =\n [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n return (\n <div className={cn('textarea-wrapper', className)}>\n {label && (\n <label\n htmlFor={textareaId}\n className=\"textarea-label\"\n style={{\n display: 'block',\n fontSize: '14px',\n fontWeight: '500',\n marginBottom: '8px',\n color: disabled ? '#9ca3af' : '#1f2937',\n }}\n >\n {label}\n </label>\n )}\n\n <textarea\n ref={textareaRef}\n id={textareaId}\n disabled={disabled}\n aria-invalid={invalid}\n aria-describedby={describedBy}\n maxLength={maxLength}\n value={value}\n onChange={handleChange}\n className=\"textarea-input\"\n data-invalid={invalid ? 'true' : undefined}\n style={{\n width: '100%',\n padding: '8px 12px',\n fontSize: '14px',\n lineHeight: '1.5',\n backgroundColor: disabled ? '#f3f4f6' : 'white',\n border: `1px solid ${invalid ? '#ef4444' : '#d1d5db'}`,\n borderRadius: '6px',\n resize: autoResize ? 'none' : 'vertical',\n fontFamily: 'inherit',\n }}\n {...props}\n />\n\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n marginTop: '4px',\n }}\n >\n <div style={{ flex: 1 }}>\n {helperText && !errorMessage && (\n <div\n id={helperTextId}\n className=\"textarea-helper-text\"\n style={{\n fontSize: '13px',\n color: '#6b7280',\n }}\n >\n {helperText}\n </div>\n )}\n\n {errorMessage && (\n <div\n id={errorMessageId}\n className=\"textarea-error-message\"\n role=\"alert\"\n style={{\n fontSize: '13px',\n color: '#ef4444',\n }}\n >\n {errorMessage}\n </div>\n )}\n </div>\n\n {showCount && maxLength && (\n <div\n className=\"textarea-count\"\n style={{\n fontSize: '13px',\n color: charCount > maxLength ? '#ef4444' : '#6b7280',\n marginLeft: '8px',\n }}\n >\n {charCount}/{maxLength}\n </div>\n )}\n </div>\n </div>\n );\n }\n);\n\nTextarea.displayName = 'Textarea';\n","/**\n * Switch Component\n *\n * A toggle switch component (like iOS switches).\n *\n * Features:\n * - WCAG 2.1 compliant\n * - Keyboard accessible (Space to toggle)\n * - Disabled state\n * - Label integration\n * - Controlled and uncontrolled modes\n * - Smooth animations\n */\n\nimport React, { forwardRef, useCallback, InputHTMLAttributes } from 'react';\nimport { cn } from '../../utils/dom';\nimport { BaseComponentProps } from '../../types';\n\n/* --------------------------------- Types --------------------------------- */\n\nexport interface SwitchProps\n extends\n BaseComponentProps,\n Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {\n /** Whether the switch is checked */\n checked?: boolean;\n /** Default checked state (uncontrolled) */\n defaultChecked?: boolean;\n /** Whether the switch is disabled */\n disabled?: boolean;\n /** Label text */\n label?: string;\n /** Helper text */\n helperText?: string;\n /** Callback when checked state changes */\n onCheckedChange?: (checked: boolean) => void;\n}\n\n/* --------------------------------- Component --------------------------------- */\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n className,\n checked,\n defaultChecked,\n disabled = false,\n label,\n helperText,\n onCheckedChange,\n onChange,\n id,\n ...props\n },\n ref\n ) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e);\n onCheckedChange?.(e.target.checked);\n },\n [onChange, onCheckedChange]\n );\n\n const switchId = id || React.useId();\n const helperTextId = helperText ? `${switchId}-helper` : undefined;\n\n return (\n <div className={cn('switch-wrapper', className)}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>\n <label\n htmlFor={switchId}\n className=\"switch-container\"\n style={{\n position: 'relative',\n display: 'inline-block',\n width: '44px',\n height: '24px',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.6 : 1,\n }}\n >\n <input\n ref={ref}\n type=\"checkbox\"\n id={switchId}\n role=\"switch\"\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n aria-describedby={helperTextId}\n onChange={handleChange}\n className=\"switch-input\"\n style={{\n opacity: 0,\n width: 0,\n height: 0,\n position: 'absolute',\n }}\n {...props}\n />\n <span\n className=\"switch-slider\"\n data-checked={checked}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: checked ? '#0066FF' : '#d1d5db',\n borderRadius: '24px',\n transition: 'background-color 0.2s',\n }}\n >\n <span\n className=\"switch-thumb\"\n style={{\n position: 'absolute',\n top: '2px',\n left: checked ? '22px' : '2px',\n width: '20px',\n height: '20px',\n backgroundColor: 'white',\n borderRadius: '50%',\n transition: 'left 0.2s',\n boxShadow: '0 2px 4px rgba(0, 0, 0, 0.2)',\n }}\n />\n </span>\n </label>\n\n {label && (\n <label\n htmlFor={switchId}\n className=\"switch-label\"\n style={{\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.6 : 1,\n fontSize: '14px',\n userSelect: 'none',\n }}\n >\n {label}\n </label>\n )}\n </div>\n\n {helperText && (\n <div\n id={helperTextId}\n className=\"switch-helper-text\"\n style={{\n fontSize: '13px',\n color: '#6b7280',\n marginTop: '4px',\n marginLeft: '56px',\n }}\n >\n {helperText}\n </div>\n )}\n </div>\n );\n }\n);\n\nSwitch.displayName = 'Switch';\n","/**\n * Common TypeScript types and interfaces used across components\n */\n\nimport { ReactNode, AriaAttributes } from 'react';\n\n/**\n * Base props that all components should support\n */\nexport interface BaseComponentProps extends AriaAttributes {\n /** Unique identifier for the component */\n id?: string;\n /** Additional CSS class names */\n className?: string;\n /** Inline styles (use sparingly in headless components) */\n style?: React.CSSProperties;\n /** Data attributes for testing */\n 'data-testid'?: string;\n}\n\n/**\n * Props for components that can have children\n */\nexport interface WithChildren {\n children?: ReactNode;\n}\n\n/**\n * Render prop pattern for maximum flexibility\n */\nexport type RenderProp<T = Record<string, unknown>> = (props: T) => ReactNode;\n\n/**\n * Polymorphic component props\n * Allows components to be rendered as different HTML elements\n */\nexport type PolymorphicComponentProps<\n E extends React.ElementType,\n P = Record<string, unknown>,\n> = P &\n Omit<React.ComponentPropsWithoutRef<E>, keyof P> & {\n as?: E;\n };\n\n/**\n * Focus management types\n */\nexport interface FocusableElement extends HTMLElement {\n focus(options?: FocusOptions): void;\n}\n\n/**\n * Keyboard event handler type\n */\nexport type KeyboardEventHandler = (event: React.KeyboardEvent) => void;\n\n/**\n * Common keyboard keys used in components\n */\nexport const Keys = {\n Enter: 'Enter',\n Space: ' ',\n Escape: 'Escape',\n ArrowUp: 'ArrowUp',\n ArrowDown: 'ArrowDown',\n ArrowLeft: 'ArrowLeft',\n ArrowRight: 'ArrowRight',\n Tab: 'Tab',\n Home: 'Home',\n End: 'End',\n} as const;\n\nexport type KeyType = (typeof Keys)[keyof typeof Keys];\n"],"names":["getFocusableElements","container","selector","element","createFocusTrap","focusableElements","firstElement","lastElement","handleKeyDown","event","focusFirstElement","_a","createFocusRestorer","previouslyFocusedElement","isFocused","useFocusTrap","enabled","autoFocus","restoreFocus","containerRef","useRef","useEffect","cleanup","useEscapeKey","onEscape","useControllableState","controlledValue","defaultValue","onChange","uncontrolledValue","setUncontrolledValue","useState","isControlled","value","onChangeRef","setValue","useCallback","nextValue","useId","prefix","id","useReactId","idCounter","generateId","cn","classes","composeEventHandlers","userHandler","internalHandler","composeRefs","refs","ref","isBrowser","getWindow","getDocument","DialogContext","React","useDialogContext","context","Dialog","controlledOpen","defaultOpen","onOpenChange","onDismiss","closeOnOutsideClick","closeOnEscape","_trapFocus","_restoreFocus","role","children","open","setOpen","titleId","descriptionId","handleOpenChange","newOpen","originalOverflow","contextValue","DialogOverlay","forwardRef","className","onClick","props","createPortal","jsx","DialogContent","ariaLabelledBy","ariaDescribedBy","focusTrapRef","DialogTitle","level","Tag","DialogDescription","DialogClose","Button","loading","disabled","iconLeft","iconRight","loadingText","Component","type","ariaLabel","isDisabled","handleClick","ariaProps","commonProps","jsxs","e","Input","invalid","errorId","labelId","required","suffix","hideNumberSpinners","hideDateIcon","showPasswordToggle","wrapperClassName","wrapperStyle","onFocus","showPassword","setShowPassword","inputRef","combinedRef","node","handleDatePickerOpen","error","handleFocus","describedBy","labelledBy","inputType","inputClassName","prev","Label","requiredIndicator","showRequiredIndicator","ErrorMessage","show","FormField","label","inputProps","labelProps","errorProps","customId","generatedId","hasError","DropdownContext","createContext","useDropdownContext","useContext","Dropdown","uncontrolledOpen","setUncontrolledOpen","triggerId","menuId","activeIndex","setActiveIndex","itemsRef","DropdownTrigger","onKeyDown","DropdownMenu","portal","placement","style","menuRef","position","setPosition","updatePosition","trigger","menu","triggerRect","menuHeight","top","handleClickOutside","target","items","item","next","_b","_c","menuStyle","DropdownItem","itemRef","itemIndex","setItemIndex","index","TabsContext","useTabsContext","Tabs","onValueChange","orientation","activationMode","selectedValue","setSelectedValue","newValue","tabsId","tabsRef","registerTab","unregisterTab","TabsList","TabsTrigger","tabs","buttonRef","isSelected","enabledTabs","v","tab","currentIndex","nextIndex","nextTab","TabsContent","AccordionContext","useAccordionContext","AccordionItemContext","useAccordionItemContext","Accordion","collapsible","handleValueChange","itemValue","currentValue","accordionId","AccordionItem","itemDisabled","accordionValue","accordionDisabled","isOpen","contentId","itemContextValue","AccordionTrigger","AccordionContent","contentRef","height","setHeight","contentHeight","timer","currentHeight","TooltipContext","useTooltipContext","Tooltip","delayShow","delayHide","tooltipId","triggerRef","TooltipTrigger","asChild","onMouseEnter","onMouseLeave","onBlur","showTimeoutRef","hideTimeoutRef","handleMouseEnter","handleMouseLeave","handleBlur","TooltipContent","content","contentRect","left","tooltipStyle","tooltip","ToastContext","useToast","toastCount","ToastProvider","maxToasts","toasts","setToasts","addToast","toast","newToast","removeToast","t","ToastContainer","ToastItem","isExiting","setIsExiting","handleDismiss","variantStyles","useToastNotification","options","success","title","description","warning","info","Checkbox","checked","defaultChecked","indeterminate","helperText","errorMessage","onCheckedChange","handleChange","checkboxId","helperTextId","errorMessageId","RadioGroupContext","useRadioGroup","RadioGroup","name","groupId","Radio","radioDisabled","group","radioId","useClickOutside","handler","refsArray","listener","Select","placeholder","multiple","searchable","renderValue","setIsOpen","searchQuery","setSearchQuery","highlightedIndex","setHighlightedIndex","dropdownRef","searchInputRef","filteredOptions","option","handleSelect","optionValue","getDisplayValue","selectedOptions","opt","selectedOption","selectId","SelectDropdown","onSearchChange","onSelect","Textarea","maxLength","showCount","autoResize","minRows","maxRows","textareaRef","charCount","setCharCount","updateHeight","textarea","lineHeight","minHeight","maxHeight","newHeight","textareaId","Switch","switchId","Keys"],"mappings":";;;AAWO,SAASA,GACdC,GACoB;AACpB,MAAI,CAACA,EAAW,QAAO,CAAA;AAEvB,QAAMC,IAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAEV,SAAO,MAAM;AAAA,IACXD,EAAU,iBAAmCC,CAAQ;AAAA,EAAA,EACrD,OAAO,CAACC,MAGNA,EAAQ,cAAc,KACtBA,E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,sBAAA;AAAA,oBACb;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,QAGDlJ,KACC,gBAAAxD;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,SAAS0Q;AAAA,YACT,WAAU;AAAA,YACV,OAAO;AAAA,cACL,QAAQ9P,IAAW,gBAAgB;AAAA,cACnC,SAASA,IAAW,MAAM;AAAA,cAC1B,UAAU;AAAA,cACV,YAAY;AAAA,YAAA;AAAA,YAGb,UAAA4C;AAAA,UAAA;AAAA,QAAA;AAAA,MACH,GAEJ;AAAA,MAECqJ,KACC,gBAAA7M;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAIkN;AAAA,UACJ,WAAU;AAAA,UACV,OAAO;AAAA,YACL,UAAU;AAAA,YACV,OAAO;AAAA,YACP,WAAW;AAAA,YACX,YAAY;AAAA,UAAA;AAAA,UAGb,UAAAL;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,GAEJ;AAAA,EAEJ;AACF;AAEA4D,GAAO,cAAc;AC5Gd,MAAME,KAAO;AAAA,EAClB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AACP;"}
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .input-hide-spinners::-webkit-inner-spin-button,.input-hide-spinners::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.input-hide-spinners{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.input-hide-date-icon::-webkit-calendar-picker-indicator{opacity:0;display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input-hide-date-icon::-webkit-date-and-time-value{text-align:left}.input-wrapper{display:flex;align-items:center;gap:8px;position:relative}.input-wrapper input{flex:1;min-width:0;border:none!important;outline:none!important;padding:0;background:transparent}.input-wrapper input:focus{border:none!important;outline:none!important;box-shadow:none!important}.input-prefix,.input-suffix{display:flex;align-items:center;justify-content:center;flex-shrink:0}.input-password-toggle{display:flex;align-items:center;justify-content:center;flex-shrink:0;background:none;border:none;cursor:pointer;padding:0;color:inherit;opacity:.6;transition:opacity .2s}.input-password-toggle:hover{opacity:1}.input-password-toggle:focus{outline:none;opacity:1}.input-password-toggle:focus-visible{outline:2px solid currentColor;outline-offset:2px;border-radius:4px}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/tests/setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { ReactNode, AriaAttributes } from 'react';
2
+
3
+ /**
4
+ * Base props that all components should support
5
+ */
6
+ export interface BaseComponentProps extends AriaAttributes {
7
+ /** Unique identifier for the component */
8
+ id?: string;
9
+ /** Additional CSS class names */
10
+ className?: string;
11
+ /** Inline styles (use sparingly in headless components) */
12
+ style?: React.CSSProperties;
13
+ /** Data attributes for testing */
14
+ 'data-testid'?: string;
15
+ }
16
+ /**
17
+ * Props for components that can have children
18
+ */
19
+ export interface WithChildren {
20
+ children?: ReactNode;
21
+ }
22
+ /**
23
+ * Render prop pattern for maximum flexibility
24
+ */
25
+ export type RenderProp<T = Record<string, unknown>> = (props: T) => ReactNode;
26
+ /**
27
+ * Polymorphic component props
28
+ * Allows components to be rendered as different HTML elements
29
+ */
30
+ export type PolymorphicComponentProps<E extends React.ElementType, P = Record<string, unknown>> = P & Omit<React.ComponentPropsWithoutRef<E>, keyof P> & {
31
+ as?: E;
32
+ };
33
+ /**
34
+ * Focus management types
35
+ */
36
+ export interface FocusableElement extends HTMLElement {
37
+ focus(options?: FocusOptions): void;
38
+ }
39
+ /**
40
+ * Keyboard event handler type
41
+ */
42
+ export type KeyboardEventHandler = (event: React.KeyboardEvent) => void;
43
+ /**
44
+ * Common keyboard keys used in components
45
+ */
46
+ export declare const Keys: {
47
+ readonly Enter: "Enter";
48
+ readonly Space: " ";
49
+ readonly Escape: "Escape";
50
+ readonly ArrowUp: "ArrowUp";
51
+ readonly ArrowDown: "ArrowDown";
52
+ readonly ArrowLeft: "ArrowLeft";
53
+ readonly ArrowRight: "ArrowRight";
54
+ readonly Tab: "Tab";
55
+ readonly Home: "Home";
56
+ readonly End: "End";
57
+ };
58
+ export type KeyType = (typeof Keys)[keyof typeof Keys];
59
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAC;AAE9E;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CACnC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC3B,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACzB,CAAC,GACH,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG;IACjD,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;CAWP,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,OAAO,IAAI,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Utility functions for DOM manipulation and helpers
3
+ */
4
+ export declare function generateId(prefix?: string): string;
5
+ /**
6
+ * Merge multiple class names, filtering out falsy values
7
+ */
8
+ export declare function cn(...classes: (string | undefined | null | false)[]): string;
9
+ /**
10
+ * Compose multiple event handlers
11
+ * Useful for merging user-provided handlers with internal ones
12
+ */
13
+ export declare function composeEventHandlers<E>(userHandler?: (event: E) => void, internalHandler?: (event: E) => void): (event: E) => void;
14
+ /**
15
+ * Compose multiple refs
16
+ * Allows forwarding refs while also using them internally
17
+ */
18
+ export declare function composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T>;
19
+ /**
20
+ * Check if code is running in a browser environment
21
+ */
22
+ export declare const isBrowser: boolean;
23
+ /**
24
+ * Safely access window object
25
+ */
26
+ export declare function getWindow(): Window | undefined;
27
+ /**
28
+ * Safely access document object
29
+ */
30
+ export declare function getDocument(): Document | undefined;
31
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,wBAAgB,UAAU,CAAC,MAAM,SAAc,GAAG,MAAM,CAGvD;AAED;;GAEG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,MAAM,CAE5E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAChC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,IAE5B,OAAO,CAAC,UAMjB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,GACpC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAUtB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,SAAgC,CAAC;AAEvD;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAE9C;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,GAAG,SAAS,CAElD"}