siesa-ui-kit 1.0.11 → 1.0.13

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 (101) hide show
  1. package/dist/components/Button/icons.d.ts +6 -5
  2. package/dist/components/Button/icons.d.ts.map +1 -1
  3. package/dist/components/Dropdown/Dropdown.d.ts +68 -9
  4. package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
  5. package/dist/components/Dropdown/Dropdown.types.d.ts +18 -0
  6. package/dist/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  7. package/dist/components/Dropdown/icons.d.ts +3 -0
  8. package/dist/components/Dropdown/icons.d.ts.map +1 -1
  9. package/dist/components/DropdownItemCollapsible/DropdownItemCollapsible.d.ts.map +1 -1
  10. package/dist/components/DropdownItemCollapsible/DropdownItemCollapsible.types.d.ts +21 -0
  11. package/dist/components/DropdownItemCollapsible/DropdownItemCollapsible.types.d.ts.map +1 -1
  12. package/dist/components/LookupField/LookupField.d.ts +6 -0
  13. package/dist/components/LookupField/LookupField.d.ts.map +1 -0
  14. package/dist/components/LookupField/LookupField.types.d.ts +274 -0
  15. package/dist/components/LookupField/LookupField.types.d.ts.map +1 -0
  16. package/dist/components/LookupField/__stories__/DocComponents.d.ts +37 -0
  17. package/dist/components/LookupField/__stories__/DocComponents.d.ts.map +1 -0
  18. package/dist/components/LookupField/__stories__/mocks/browser.d.ts +2 -0
  19. package/dist/components/LookupField/__stories__/mocks/browser.d.ts.map +1 -0
  20. package/dist/components/LookupField/__stories__/mocks/data.d.ts +38 -0
  21. package/dist/components/LookupField/__stories__/mocks/data.d.ts.map +1 -0
  22. package/dist/components/LookupField/__stories__/mocks/handlers.d.ts +3 -0
  23. package/dist/components/LookupField/__stories__/mocks/handlers.d.ts.map +1 -0
  24. package/dist/components/LookupField/hooks/index.d.ts +10 -0
  25. package/dist/components/LookupField/hooks/index.d.ts.map +1 -0
  26. package/dist/components/LookupField/hooks/useClickOutside.d.ts +11 -0
  27. package/dist/components/LookupField/hooks/useClickOutside.d.ts.map +1 -0
  28. package/dist/components/LookupField/hooks/useDebouncedSearch.d.ts +2 -0
  29. package/dist/components/LookupField/hooks/useDebouncedSearch.d.ts.map +1 -0
  30. package/dist/components/LookupField/hooks/useFloatingDropdown.d.ts +38 -0
  31. package/dist/components/LookupField/hooks/useFloatingDropdown.d.ts.map +1 -0
  32. package/dist/components/LookupField/hooks/useKeyboardNavigation.d.ts +16 -0
  33. package/dist/components/LookupField/hooks/useKeyboardNavigation.d.ts.map +1 -0
  34. package/dist/components/LookupField/hooks/useTranslationSafe.d.ts +9 -0
  35. package/dist/components/LookupField/hooks/useTranslationSafe.d.ts.map +1 -0
  36. package/dist/components/LookupField/hooks/useVirtualList.d.ts +40 -0
  37. package/dist/components/LookupField/hooks/useVirtualList.d.ts.map +1 -0
  38. package/dist/components/LookupField/index.d.ts +7 -0
  39. package/dist/components/LookupField/index.d.ts.map +1 -0
  40. package/dist/components/LookupField/parts/LiveRegion.d.ts +6 -0
  41. package/dist/components/LookupField/parts/LiveRegion.d.ts.map +1 -0
  42. package/dist/components/LookupField/parts/SearchInput.d.ts +11 -0
  43. package/dist/components/LookupField/parts/SearchInput.d.ts.map +1 -0
  44. package/dist/components/LookupField/services/api.d.ts +23 -0
  45. package/dist/components/LookupField/services/api.d.ts.map +1 -0
  46. package/dist/components/LookupField/services/api.types.d.ts +74 -0
  47. package/dist/components/LookupField/services/api.types.d.ts.map +1 -0
  48. package/dist/components/LookupField/services/index.d.ts +4 -0
  49. package/dist/components/LookupField/services/index.d.ts.map +1 -0
  50. package/dist/components/LookupField/types/filter.types.d.ts +51 -0
  51. package/dist/components/LookupField/types/filter.types.d.ts.map +1 -0
  52. package/dist/components/LookupField/utils/cn.d.ts +3 -0
  53. package/dist/components/LookupField/utils/cn.d.ts.map +1 -0
  54. package/dist/components/LookupField/utils/filterBuilder.d.ts +35 -0
  55. package/dist/components/LookupField/utils/filterBuilder.d.ts.map +1 -0
  56. package/dist/components/LookupField/utils/index.d.ts +4 -0
  57. package/dist/components/LookupField/utils/index.d.ts.map +1 -0
  58. package/dist/components/LookupField/utils/templateInterpolation.d.ts +13 -0
  59. package/dist/components/LookupField/utils/templateInterpolation.d.ts.map +1 -0
  60. package/dist/components/Navbar/Navbar.d.ts.map +1 -1
  61. package/dist/components/Navbar/Navbar.types.d.ts +46 -1
  62. package/dist/components/Navbar/Navbar.types.d.ts.map +1 -1
  63. package/dist/components/NavigationRailGroup/NavigationRailGroup.d.ts +122 -0
  64. package/dist/components/NavigationRailGroup/NavigationRailGroup.d.ts.map +1 -0
  65. package/dist/components/NavigationRailGroup/NavigationRailGroup.types.d.ts +139 -0
  66. package/dist/components/NavigationRailGroup/NavigationRailGroup.types.d.ts.map +1 -0
  67. package/dist/components/NavigationRailGroup/icons.d.ts +33 -0
  68. package/dist/components/NavigationRailGroup/icons.d.ts.map +1 -0
  69. package/dist/components/NavigationRailGroup/index.d.ts +4 -0
  70. package/dist/components/NavigationRailGroup/index.d.ts.map +1 -0
  71. package/dist/components/NavigationRailItem/NavigationRailItem.d.ts.map +1 -1
  72. package/dist/components/NavigationRailItem/NavigationRailItem.types.d.ts +14 -0
  73. package/dist/components/NavigationRailItem/NavigationRailItem.types.d.ts.map +1 -1
  74. package/dist/components/NavigationRailTypes/NavigationRailTypes.d.ts.map +1 -1
  75. package/dist/components/NavigationRailTypes/NavigationRailTypes.types.d.ts +49 -0
  76. package/dist/components/NavigationRailTypes/NavigationRailTypes.types.d.ts.map +1 -1
  77. package/dist/components/NavigationRailTypes/icons.d.ts +15 -29
  78. package/dist/components/NavigationRailTypes/icons.d.ts.map +1 -1
  79. package/dist/components/Select/Select.d.ts.map +1 -1
  80. package/dist/components/Select/icons.d.ts +6 -2
  81. package/dist/components/Select/icons.d.ts.map +1 -1
  82. package/dist/index.d.ts +38 -0
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/siesa-ui-kit.cjs +489 -238
  85. package/dist/siesa-ui-kit.cjs.map +1 -1
  86. package/dist/siesa-ui-kit.mjs +12302 -1519
  87. package/dist/siesa-ui-kit.mjs.map +1 -1
  88. package/dist/style.css +1 -1
  89. package/dist/views/LayoutBase/LayoutBase.d.ts +73 -0
  90. package/dist/views/LayoutBase/LayoutBase.d.ts.map +1 -0
  91. package/dist/views/LayoutBase/LayoutBase.types.d.ts +99 -0
  92. package/dist/views/LayoutBase/LayoutBase.types.d.ts.map +1 -0
  93. package/dist/views/LayoutBase/index.d.ts +3 -0
  94. package/dist/views/LayoutBase/index.d.ts.map +1 -0
  95. package/dist/views/ListView/ListView.d.ts +18 -12
  96. package/dist/views/ListView/ListView.d.ts.map +1 -1
  97. package/dist/views/ListView/ListView.types.d.ts +31 -94
  98. package/dist/views/ListView/ListView.types.d.ts.map +1 -1
  99. package/dist/views/ListView/index.d.ts +1 -1
  100. package/dist/views/ListView/index.d.ts.map +1 -1
  101. package/package.json +20 -1
@@ -1 +1 @@
1
- {"version":3,"file":"siesa-ui-kit.mjs","sources":["../src/components/Button/Button.tsx","../src/components/Input/Input.tsx","../src/components/Textarea/Textarea.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Radio/Radio.tsx","../src/components/Switch/Switch.tsx","../src/components/Avatar/Avatar.tsx","../src/components/Divider/Divider.tsx","../src/components/DescriptionList/DescriptionList.tsx","../src/components/Alert/Alert.tsx","../src/components/Badge/Badge.tsx","../src/components/Quantity/Quantity.tsx","../src/components/Dropdown/icons.tsx","../src/components/Dropdown/Dropdown.tsx","../src/components/Notification/Notification.tsx","../src/components/Pagination/icons.tsx","../src/components/Pagination/Pagination.tsx","../src/components/Select/icons.tsx","../src/components/Select/Select.tsx","../src/components/Table/Table.tsx","../src/components/Tabs/Tabs.tsx","../src/components/Navbar/icons.tsx","../src/components/Navbar/Navbar.tsx","../src/components/NavigationBar/NavigationBar.tsx","../src/components/POSConvention/icons.tsx","../src/components/POSConvention/POSConvention.tsx","../src/components/POSLocationButton/icons.tsx","../src/components/POSLocationButton/POSLocationButton.tsx","../src/components/POSNumberButton/POSNumberButton.tsx","../src/components/POSProductButton/POSProductButton.tsx","../src/components/POSProductCard/icons.tsx","../src/components/POSProductCard/POSProductCard.tsx","../src/components/POSProductSidebarItems/icons.tsx","../src/components/POSProductSidebarItems/POSProductSidebarItems.tsx","../src/components/POSTable/POSTable.tsx","../src/context/ThemeContext.tsx"],"sourcesContent":["import React from 'react';\nimport type { ButtonProps, ButtonType } from './Button.types';\n\n/**\n * Componente Button del sistema de diseño Siesa\n *\n * Implementación pixel-perfect basada en Figma (node 4001-17240)\n * con soporte completo para todos los estados, tamaños y variantes.\n *\n * **Variantes (type):**\n * - `default`: Botón primario con fondo sólido (#0e79fd) y borde (#3c9bf6)\n * - Sombra interna para efecto de profundidad\n * - Usar para acciones principales (Guardar, Enviar, Confirmar)\n * - `outline-solid`: Botón secundario con borde (#93d1fd) y shadow-xs\n * - Usar para acciones secundarias (Cancelar, Volver)\n * - `plain`: Botón terciario sin borde visible\n * - Hover overlay sutil\n * - Usar para acciones sutiles (Cerrar, Ver más, Links)\n *\n * **Tamaños (size):**\n * - `xs` (24px): Espacios muy compactos, inline actions. Padding: 8px h, 4px v\n * - `sm` (28px): Barras de herramientas, acciones secundarias. Padding: 8px h, 4px v\n * - `base` (32px): Tamaño estándar para la mayoría de casos. Padding: 10px h, 6px v\n * - `l` (36px): Botones destacados, CTAs. Padding: 12px h, 8px v\n * - `xl` (40px): Heroes, landing pages. Padding: 16px h, 8px v\n *\n * **Estados:**\n * - `default`: Estado normal con colores base\n * - `hover`: Overlay visual sutil (bg-primary-custom-500 para default)\n * - `focus`: Focus ring de 4px (#60b6fa) con offset de 2px (#dbeefe)\n * - `active`: Scale animation (scale-95) para feedback táctil\n * - `disabled`: Opacity 50% con pointer-events-none\n *\n * **Badges de notificación:**\n * - `badge`: Muestra un dot de notificación en la esquina superior derecha\n * - `badgeCount`: Muestra un badge con número (99+ para >99)\n * - `badgeColor`: Color del badge (por defecto: red - #b91c1c)\n *\n * **Especificaciones de Figma:**\n * - Border radius: 6px (rounded-md)\n * - Tipografía: Label Small (14px Bold) para sm/base/l/xl, Label Tiny (12px Bold) para xs\n * - Iconos: 16x16px en todos los tamaños\n * - Gap entre elementos: 8px (xs/sm/base), 12px (l/xl)\n *\n * **Dark Mode:**\n * Los botones invierten colores en dark mode:\n * - Default: fondo celeste claro (#bfe2fe), texto azul (#0e79fd), borde celeste (#93d1fd)\n * - Outline: texto celeste (#93d1fd), borde azul (#0f6ae3)\n * - Plain: texto celeste (#93d1fd), hover overlay blanco 20%\n * - Focus ring adaptativo con offset oscuro\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/shadows.md - Sistema de sombras (shadow-button-inset, shadow-sm)\n * @see docs/typography.md - Sistema tipográfico (Label Small/Tiny)\n * @see docs/spacing.md - Sistema de espaciado\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4001-17240 - Diseño Figma\n *\n * @example\n * ```tsx\n * // Botón primario con icono\n * <Button type=\"default\" size=\"base\" leftIcon={<SaveIcon />}>\n * Guardar\n * </Button>\n *\n * // Botón secundario\n * <Button type=\"outline\" size=\"base\">\n * Cancelar\n * </Button>\n *\n * // Botón solo icono para barra de herramientas\n * <Button type=\"plain\" size=\"sm\" iconOnly leftIcon={<CloseIcon />} ariaLabel=\"Cerrar\" />\n *\n * // Botón con badge de notificación (dot)\n * <Button type=\"default\" size=\"base\" badge>\n * Notificaciones\n * </Button>\n *\n * // Botón con badge contador\n * <Button type=\"default\" size=\"base\" badgeCount={5} badgeColor=\"red\">\n * Mensajes\n * </Button>\n * ```\n */\nexport const Button: React.FC<ButtonProps> = ({\n type = 'default',\n size = 'base',\n iconOnly = false,\n leftIcon,\n rightIcon,\n children,\n disabled = false,\n className = '',\n onClick,\n htmlType = 'button',\n fullWidth = false,\n ariaLabel,\n badge = false,\n badgeCount,\n badgeColor = 'red',\n ...rest\n}) => {\n // ===== CLASES DE TAMAÑO =====\n const sizeClasses = {\n xs: iconOnly ? 'h-6 w-6 p-1' : 'h-6 py-1 px-2 gap-2',\n sm: iconOnly ? 'h-7 w-7 p-1.5' : 'h-7 py-1 px-2 gap-2',\n base: iconOnly ? 'h-8 w-8 p-2' : 'h-8 py-1.5 px-2.5 gap-2',\n l: iconOnly ? 'h-9 w-9 p-2.5' : 'h-9 py-2 px-3 gap-3',\n xl: iconOnly ? 'h-10 w-10 p-3' : 'h-10 py-2 px-4 gap-3',\n };\n\n // ===== CLASES DE TAMAÑO DE ICONO =====\n const iconSizeClasses = {\n xs: 'w-4 h-4',\n sm: 'w-4 h-4',\n base: 'w-4 h-4',\n l: 'w-4 h-4',\n xl: 'w-4 h-4',\n };\n\n // ===== CLASES DE TAMAÑO DE TEXTO =====\n // Usando el sistema de tipografía Label del design system (typography.md)\n const textSizeClasses = {\n xs: 'text-xs', // Label Tiny - 12px\n sm: 'text-sm', // Label Small - 14px\n base: 'text-sm', // Label Small - 14px (default para base)\n l: 'text-sm', // Label Small - 14px (corregido según Figma)\n xl: 'text-sm', // Label Small - 14px (corregido según Figma)\n };\n\n // ===== CLASES DE TIPO (Default, Outline, Plain) =====\n // Especificaciones de Figma node 4001-17240\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n // Dark mode: Los botones invierten colores (fondo claro, texto oscuro)\n // - Light: fondo #0e79fd (azul), texto #eff8ff (blanco)\n // - Dark: fondo #bfe2fe (celeste claro), texto #0e79fd (azul)\n const typeClasses: Record<ButtonType, string> = {\n default: `\n bg-primary-custom-600\n text-primary-inverse-content\n border\n border-primary-inverse-border\n shadow-button-inset\n hover:bg-primary-custom-500\n active:scale-95\n transition-all\n duration-150\n dark:bg-dark-bg-inverse\n dark:text-dark-content-inverse\n dark:border-dark-border-inverse\n dark:hover:bg-dark-bg-inverse/90\n `,\n outline: `\n bg-transparent\n text-primary-custom-600\n border\n border-primary-custom-300\n shadow-xs\n hover:bg-primary-custom-100\n active:scale-95\n transition-all\n duration-150\n dark:text-dark-content-custom\n dark:border-dark-border-custom\n dark:hover:bg-dark-bg-custom/20\n `,\n 'outline-solid': `\n bg-transparent\n text-primary-custom-600\n border\n border-primary-custom-300\n shadow-xs\n hover:bg-primary-custom-100\n active:scale-95\n transition-all\n duration-150\n dark:text-dark-content-custom\n dark:border-dark-border-custom\n dark:hover:bg-dark-bg-custom/20\n `,\n plain: `\n bg-transparent\n text-primary-custom-600\n border\n border-transparent\n hover:bg-hover-overlay\n active:scale-95\n transition-all\n duration-150\n dark:text-dark-content-custom\n dark:hover:bg-hover-overlay-dark\n `,\n };\n\n // ===== CLASES BASE =====\n // Especificaciones de Figma: Focus ring = 4px spread primary-custom-400 + 2px offset primary-custom-100\n // Dark mode: Focus ring adaptativo con offset oscuro\n const baseClasses = `\n inline-flex\n items-center\n justify-center\n rounded-md\n font-bold\n whitespace-nowrap\n focus:outline-hidden\n focus:ring-4\n focus:ring-primary-custom-400\n focus:ring-offset-2\n focus:ring-offset-primary-custom-100\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n disabled:opacity-50\n disabled:cursor-not-allowed\n disabled:pointer-events-none\n `;\n\n // ===== CLASE FULL WIDTH =====\n const widthClass = fullWidth ? 'w-full' : '';\n\n // ===== COMBINAR TODAS LAS CLASES =====\n const buttonClasses = [\n baseClasses,\n sizeClasses[size],\n typeClasses[type],\n widthClass,\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== RENDERIZAR ICONO =====\n const renderIcon = (icon: React.ReactNode) => {\n if (!icon) return null;\n return (\n <span className={`inline-flex items-center justify-center ${iconSizeClasses[size]}`}>\n {icon}\n </span>\n );\n };\n\n // ===== RENDERIZAR CONTENIDO =====\n const renderContent = () => {\n // Si es iconOnly, solo mostrar leftIcon\n if (iconOnly) {\n return renderIcon(leftIcon);\n }\n\n // Si tiene texto y/o iconos\n return (\n <>\n {leftIcon && renderIcon(leftIcon)}\n {children && <span className={textSizeClasses[size]}>{children}</span>}\n {rightIcon && renderIcon(rightIcon)}\n </>\n );\n };\n\n // ===== MAPA DE COLORES DE BADGE =====\n // Basado en el componente Badge existente\n const badgeColorClasses: Record<string, { bg: string; text: string }> = {\n zinc: { bg: 'bg-zinc-600', text: 'text-white' },\n red: { bg: 'bg-red-700', text: 'text-white' },\n orange: { bg: 'bg-orange-700', text: 'text-white' },\n amber: { bg: 'bg-amber-700', text: 'text-white' },\n yellow: { bg: 'bg-yellow-700', text: 'text-white' },\n lime: { bg: 'bg-lime-700', text: 'text-white' },\n green: { bg: 'bg-green-700', text: 'text-white' },\n emerald: { bg: 'bg-emerald-700', text: 'text-white' },\n teal: { bg: 'bg-teal-700', text: 'text-white' },\n cyan: { bg: 'bg-cyan-700', text: 'text-white' },\n sky: { bg: 'bg-sky-700', text: 'text-white' },\n blue: { bg: 'bg-blue-700', text: 'text-white' },\n indigo: { bg: 'bg-indigo-700', text: 'text-white' },\n violet: { bg: 'bg-violet-700', text: 'text-white' },\n purple: { bg: 'bg-purple-700', text: 'text-white' },\n fuchsia: { bg: 'bg-fuchsia-700', text: 'text-white' },\n pink: { bg: 'bg-pink-700', text: 'text-white' },\n rose: { bg: 'bg-rose-700', text: 'text-white' },\n primary: { bg: 'bg-primary-custom-600', text: 'text-white' },\n secondary: { bg: 'bg-zinc-600', text: 'text-white' },\n tertiary: { bg: 'bg-zinc-600', text: 'text-white' },\n };\n\n const badgeColors = badgeColorClasses[badgeColor] || badgeColorClasses.red;\n\n // ===== RENDERIZAR BADGE =====\n const renderBadge = () => {\n // Si no hay badge ni badgeCount, no renderizar nada\n if (!badge && badgeCount === undefined) return null;\n\n // Si hay badgeCount, renderizar badge con número\n if (badgeCount !== undefined) {\n return (\n <span\n className={`\n absolute\n -top-1\n -right-1\n flex\n items-center\n justify-center\n min-w-[16px]\n h-4\n px-1\n rounded-full\n text-[10px]\n font-bold\n leading-none\n ${badgeColors.bg}\n ${badgeColors.text}\n pointer-events-none\n `.trim().replace(/\\s+/g, ' ')}\n aria-label={`${badgeCount} notificaciones`}\n >\n {badgeCount > 99 ? '99+' : badgeCount}\n </span>\n );\n }\n\n // Si solo hay badge (sin número), renderizar dot\n return (\n <span\n className={`\n absolute\n -top-1\n -right-1\n w-2\n h-2\n rounded-full\n ${badgeColors.bg}\n pointer-events-none\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Notificación\"\n />\n );\n };\n\n return (\n <button\n type={htmlType}\n className={`${buttonClasses} ${(badge || badgeCount !== undefined) ? 'relative' : ''}`}\n disabled={disabled}\n onClick={onClick}\n aria-label={ariaLabel}\n {...rest}\n >\n {renderContent()}\n {renderBadge()}\n </button>\n );\n};\n","import React, { forwardRef, cloneElement } from 'react';\nimport type { InputProps } from './Input.types';\n\n/**\n * Input - Componente de campo de entrada del sistema de diseño Siesa\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Tokens de color consistentes con la documentación\n * - Sombra base para inputs con focus\n * - Estados hover, focus, disabled y error completos\n * - Typography: Paragraph Regular para texto, Label Bold para labels\n *\n * Campo de entrada de texto con soporte para:\n * - Estados: default, hover, focus, filled, disabled\n * - Validación con mensajes de error\n * - Iconos izquierdo y derecho\n * - Label y helper text\n * - Dark mode completo\n * - Accesibilidad completa\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/shadows.md - Sistema de sombras\n * @see docs/typography.md - Sistema tipográfico (Paragraph, Label)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Input\n * label=\"Email\"\n * placeholder=\"tu@email.com\"\n * leftIcon={<EnvelopeIcon />}\n * helperText=\"Ingresa tu correo electrónico\"\n * />\n * ```\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n label,\n labelSecondary,\n helperText,\n error = false,\n errorMessage,\n leftIcon,\n rightIcon,\n fullWidth = false,\n className = '',\n disabled = false,\n id,\n ...props\n },\n ref\n ) => {\n // Generar ID único si no se proporciona\n const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;\n\n // ===== CLASES BASE DEL INPUT =====\n // Usando el sistema tipográfico Paragraph Regular (14px = text-sm)\n // Border radius rounded-md (6px) consistente con Button\n const baseInputClasses = `\n w-full\n px-3\n py-1.5\n text-sm\n leading-6\n font-normal\n text-content-primary\n bg-bg-primary\n border\n border-border-primary\n rounded-md\n outline-hidden\n transition-all\n duration-150\n placeholder:text-content-tertiary\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n dark:text-dark-content-primary\n dark:placeholder:text-dark-content-tertiary\n `;\n\n // ===== CLASES PARA ESTADOS INTERACTIVOS =====\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n // Focus rings adaptativos siguiendo el patrón de Button\n const interactiveClasses = !disabled\n ? `\n hover:border-primary-custom-600\n focus:border-primary-custom-600\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:hover:border-dark-border-custom\n dark:focus:border-dark-border-custom\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n `\n : `\n opacity-50\n cursor-not-allowed\n bg-bg-secondary\n dark:bg-dark-bg-secondary\n `;\n\n // ===== CLASES PARA ESTADO DE ERROR =====\n // Los colores de error son los mismos en light y dark mode\n const errorClasses = error\n ? `\n border-error-border!\n focus:ring-error-border/30!\n focus:ring-offset-2!\n dark:border-error-border!\n dark:focus:ring-error-border/30!\n dark:focus:ring-offset-dark-bg-primary!\n `\n : '';\n\n // ===== CLASES DEL CONTENEDOR =====\n const containerClasses = fullWidth ? 'w-full' : 'w-[265px]';\n\n // ===== RENDERIZAR ICONOS =====\n // Clonar iconos con estilos apropiados y dark mode completo\n const renderIcon = (icon: React.ReactElement | undefined) => {\n if (!icon) return null;\n const existingClassName = (icon.props as any).className || '';\n return cloneElement(icon as React.ReactElement<any>, {\n className: `w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary ${existingClassName}`,\n });\n };\n\n return (\n <div className={`flex flex-col gap-2 ${containerClasses} ${className}`}>\n {/* Label */}\n {label && (\n <label\n htmlFor={inputId}\n className=\"flex items-center w-full font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n <span className=\"flex-1\">{label}</span>\n {labelSecondary && (\n <span className=\"text-xs leading-4 text-primary-custom-600 dark:text-primary-custom-600\">\n {labelSecondary}\n </span>\n )}\n </label>\n )}\n\n {/* Input Container */}\n <div className=\"relative flex items-center\">\n {/* Left Icon */}\n {leftIcon && (\n <div className=\"absolute left-3 pointer-events-none\">\n {renderIcon(leftIcon)}\n </div>\n )}\n\n {/* Input Field */}\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n className={`\n ${baseInputClasses}\n ${interactiveClasses}\n ${errorClasses}\n ${leftIcon ? 'pl-9' : ''}\n ${rightIcon ? 'pr-9' : ''}\n `.trim().replace(/\\s+/g, ' ')}\n {...props}\n />\n\n {/* Right Icon */}\n {rightIcon && (\n <div className=\"absolute right-3 pointer-events-none\">\n {renderIcon(rightIcon)}\n </div>\n )}\n </div>\n\n {/* Helper Text or Error Message */}\n {(helperText || errorMessage) && (\n <p\n className={`\n text-xs\n leading-5\n ${\n error\n ? 'text-error-content dark:text-error-content'\n : 'text-content-tertiary dark:text-dark-content-tertiary'\n }\n `.trim().replace(/\\s+/g, ' ')}\n >\n {error && errorMessage ? errorMessage : helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = 'Input';\n","import { forwardRef } from 'react';\nimport type { TextareaProps } from './Textarea.types';\n\n/**\n * Textarea - Componente de área de texto del sistema de diseño Siesa\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Tokens de color consistentes con la documentación\n * - Estados hover, focus, disabled y error completos\n * - Typography: Paragraph Base (16px) para texto\n *\n * Campo de entrada de texto multi-línea con soporte para:\n * - Estados: default, hover, focus, filled, disabled\n * - Validación con mensajes de error\n * - Label, description y helper text\n * - Resize vertical, horizontal, both o none\n * - Dark mode completo\n * - Accesibilidad completa\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/shadows.md - Sistema de sombras\n * @see docs/typography.md - Sistema tipográfico (Paragraph, Label)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Textarea\n * label=\"About\"\n * description=\"Tell us about yourself\"\n * placeholder=\"Write a few sentences...\"\n * helperText=\"Minimum 50 characters\"\n * />\n * ```\n */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n label,\n description,\n helperText,\n error = false,\n errorMessage,\n fullWidth = false,\n resize = 'vertical',\n className = '',\n disabled = false,\n id,\n rows = 4,\n ...props\n },\n ref\n ) => {\n // Generar ID único si no se proporciona\n const textareaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;\n\n // ===== CLASES BASE DEL TEXTAREA =====\n // Usando el sistema tipográfico Paragraph Base (16px = text-base)\n // Border radius rounded-lg (8px) según especificaciones de Figma\n // Padding: px-3 (12px) izquierda, pr-1.5 (6px) derecha para el indicador de resize\n const baseTextareaClasses = `\n w-full\n px-3\n pr-1.5\n py-1.5\n text-base\n leading-6\n font-normal\n bg-bg-primary\n border\n border-border-primary\n rounded-lg\n outline-hidden\n transition-all\n duration-150\n placeholder:text-content-tertiary\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n dark:text-dark-content-primary\n dark:placeholder:text-dark-content-tertiary\n `;\n\n // ===== CLASES PARA ESTADOS INTERACTIVOS =====\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n // Hover: borde más opaco (zinc-400) según especificaciones de Figma\n // Focus: solo border-2 sin ring, según especificaciones de Figma\n const interactiveClasses = !disabled\n ? `\n hover:border-zinc-400\n focus:border-2\n focus:border-primary-custom-600\n dark:hover:border-zinc-500\n dark:focus:border-2\n dark:focus:border-dark-border-custom\n `\n : `\n opacity-50\n cursor-not-allowed\n bg-bg-secondary\n dark:bg-dark-bg-secondary\n `;\n\n // ===== CLASES PARA ESTADO DE ERROR =====\n // Los colores de error son los mismos en light y dark mode\n // Focus en error: solo border-2 sin ring, según especificaciones de Figma\n const errorClasses = error\n ? `\n border-error-border!\n focus:border-2!\n focus:border-error-border!\n dark:border-error-border!\n dark:focus:border-2!\n dark:focus:border-error-border!\n `\n : '';\n\n // ===== CLASES DE RESIZE =====\n const resizeClasses =\n resize === 'none'\n ? 'resize-none'\n : resize === 'vertical'\n ? 'resize-y'\n : resize === 'horizontal'\n ? 'resize-x'\n : 'resize';\n\n // ===== CLASES DEL CONTENEDOR =====\n // Ancho por defecto: 312px (según especificaciones de Figma)\n const containerClasses = fullWidth ? 'w-full' : 'w-[312px]';\n\n return (\n <div className={`flex flex-col gap-2 ${containerClasses} ${className}`}>\n {/* Label and Description */}\n {(label || description) && (\n <div className=\"flex flex-col gap-1 w-full\">\n {label && (\n <label\n htmlFor={textareaId}\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n {label}\n </label>\n )}\n {description && (\n <p className=\"text-sm leading-5 text-content-secondary dark:text-dark-content-secondary\">\n {description}\n </p>\n )}\n </div>\n )}\n\n {/* Textarea Field */}\n <textarea\n ref={ref}\n id={textareaId}\n disabled={disabled}\n rows={rows}\n className={`\n ${baseTextareaClasses}\n ${interactiveClasses}\n ${errorClasses}\n ${resizeClasses}\n `.trim().replace(/\\s+/g, ' ')}\n {...props}\n />\n\n {/* Helper Text or Error Message */}\n {(helperText || errorMessage) && (\n <p\n className={`\n text-sm\n leading-5\n text-content-tertiary\n dark:text-dark-content-tertiary\n `.trim().replace(/\\s+/g, ' ')}\n >\n {error && errorMessage ? errorMessage : helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nTextarea.displayName = 'Textarea';\n","import { forwardRef, useEffect, useRef } from 'react';\nimport type { CheckboxProps } from './Checkbox.types';\n\n/**\n * Checkbox del sistema de diseño Siesa\n *\n * Componente de checkbox con soporte completo para estados interactivos,\n * indeterminate, y dark mode pixel-perfect según especificaciones de Figma.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Sombra button-inset para estado checked\n * - Type safety con TypeScript estricto\n * - Accesibilidad con input nativo y ARIA\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label/Paragraph)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Checkbox\n * label=\"Show on Events Page\"\n * description=\"Make this event visible on your profile\"\n * checked={true}\n * onChange={(e) => console.log(e.target.checked)}\n * />\n * ```\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n label,\n description,\n checked = false,\n indeterminate = false,\n disabled = false,\n className = '',\n id,\n onChange,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const combinedRef = (ref as any) || inputRef;\n\n // Generar ID único si no se proporciona\n const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;\n\n // Manejar el estado indeterminate\n useEffect(() => {\n if (combinedRef.current) {\n combinedRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate, combinedRef]);\n\n // ===== CLASES BASE DEL CHECKBOX =====\n const baseCheckboxClasses = `\n w-4\n h-4\n rounded\n border\n border-border-primary\n bg-bg-primary\n transition-all\n duration-150\n flex\n items-center\n justify-center\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n `;\n\n // ===== CLASES PARA ESTADOS INTERACTIVOS =====\n const interactiveClasses = !disabled\n ? (checked || indeterminate)\n ? `\n peer-hover:border-[#50a5f7]\n peer-focus:ring-2\n peer-focus:ring-primary-custom-400/20\n peer-focus:border-primary-custom-600\n dark:peer-hover:border-[#50a5f7]\n dark:peer-focus:border-dark-border-custom\n dark:peer-focus:ring-dark-border-custom/20\n `\n : `\n peer-hover:border-[#b6b6b9]\n peer-focus:ring-2\n peer-focus:ring-primary-custom-400/20\n peer-focus:border-primary-custom-600\n dark:peer-hover:border-[#b6b6b9]\n dark:peer-focus:border-dark-border-custom\n dark:peer-focus:ring-dark-border-custom/20\n `\n : `\n opacity-50\n cursor-not-allowed\n `;\n\n // ===== CLASES PARA ESTADO CHECKED/INDETERMINATE =====\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n const checkedClasses = checked || indeterminate\n ? `\n bg-primary-custom-600!\n border-primary-custom-500!\n shadow-button-inset\n dark:bg-dark-bg-inverse!\n dark:border-dark-bg-inverse!\n `\n : '';\n\n // ===== COMBINAR TODAS LAS CLASES DEL CHECKBOX =====\n const checkboxClasses = [\n baseCheckboxClasses,\n interactiveClasses,\n checkedClasses,\n disabled ? 'cursor-not-allowed' : 'cursor-pointer',\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div className={`inline-flex gap-3 items-start ${className}`}>\n {/* Checkbox Input Container */}\n <div className=\"flex items-center justify-center h-5 w-4 shrink-0\">\n {/* Native Input (hidden but accessible) */}\n <input\n ref={combinedRef}\n type=\"checkbox\"\n id={checkboxId}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n className=\"peer sr-only\"\n {...props}\n />\n\n {/* Custom Checkbox Visual */}\n <label htmlFor={checkboxId} className={checkboxClasses}>\n {/* Check Icon - Usar primary-inverse-content para consistencia */}\n {checked && !indeterminate && (\n <svg\n className=\"w-3 h-3 text-primary-inverse-content pointer-events-none\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M10 3L4.5 8.5L2 6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )}\n\n {/* Indeterminate Icon (minus) - Usar primary-inverse-content */}\n {indeterminate && (\n <svg\n className=\"w-3 h-3 text-primary-inverse-content pointer-events-none\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 6H10\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n )}\n </label>\n </div>\n\n {/* Label and Description */}\n {(label || description) && (\n <label\n htmlFor={checkboxId}\n className={`flex-1 flex flex-col gap-1 text-sm leading-5 ${\n disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'\n }`}\n >\n {/* Label - Label/Small (14px, Bold) */}\n {label && (\n <span className=\"font-bold text-content-primary dark:text-dark-content-primary\">\n {label}\n </span>\n )}\n {/* Description - Paragraph/Small (14px, Regular) */}\n {description && (\n <span className=\"font-normal text-content-secondary dark:text-content-secondary\">\n {description}\n </span>\n )}\n </label>\n )}\n </div>\n );\n }\n);\n\nCheckbox.displayName = 'Checkbox';\n","import { forwardRef } from 'react';\nimport type { RadioProps } from './Radio.types';\n\n/**\n * Radio - Componente de radio button del sistema de diseño Siesa\n *\n * Campo de selección única diseñado para cumplir con las especificaciones\n * de Figma con soporte completo para dark mode y accesibilidad.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con keyboard navigation y ARIA\n * - Inner shadow en estado checked según especificaciones Figma\n *\n * Estados soportados:\n * - Default, Hover, Focus, Disabled\n * - Checked / Unchecked\n * - Label y description opcionales\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Radio simple\n * <Radio\n * label=\"Allow tickets to be resold\"\n * description=\"Customers can resell or transfer their tickets\"\n * value=\"resell\"\n * name=\"ticketOptions\"\n * checked={true}\n * onChange={(e) => console.log(e.target.checked)}\n * />\n *\n * // Radio group\n * <div>\n * <Radio label=\"Option 1\" name=\"group\" value=\"1\" checked={selected === \"1\"} onChange={handleChange} />\n * <Radio label=\"Option 2\" name=\"group\" value=\"2\" checked={selected === \"2\"} onChange={handleChange} />\n * </div>\n * ```\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n {\n label,\n description,\n checked = false,\n disabled = false,\n className = '',\n id,\n onChange,\n value,\n name,\n ...props\n },\n ref\n ) => {\n // Generar ID único si no se proporciona\n const radioId = id || `radio-${Math.random().toString(36).substr(2, 9)}`;\n\n // ===== CLASES BASE DEL RADIO BUTTON =====\n const baseRadioClasses = `\n w-4\n h-4\n rounded-full\n border\n border-border-primary\n bg-bg-primary\n transition-all\n duration-150\n flex\n items-center\n justify-center\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n `;\n\n // ===== CLASES PARA ESTADOS INTERACTIVOS =====\n const interactiveClasses = !disabled\n ? `\n peer-hover:border-primary-custom-600\n peer-focus:ring-2\n peer-focus:ring-primary-custom-400\n peer-focus:border-primary-custom-600\n dark:peer-hover:border-dark-border-custom\n dark:peer-focus:ring-dark-border-custom\n dark:peer-focus:border-dark-border-custom\n `\n : `\n opacity-50\n cursor-not-allowed\n `;\n\n // ===== CLASES PARA CHECKED STATE =====\n // Según Figma: bg #0e79fd, border #3c9bf6, inner shadow\n const checkedClasses = checked\n ? `\n bg-primary-custom-600!\n border-primary-inverse-border!\n shadow-button-inset\n dark:bg-dark-bg-inverse!\n dark:border-dark-bg-inverse!\n `\n : '';\n\n return (\n <div className={`flex gap-3 items-start ${className}`}>\n {/* Radio Input Container */}\n <div className=\"flex items-center justify-center h-5 w-4 shrink-0\">\n {/* Native Input (hidden but accessible) */}\n <input\n ref={ref}\n type=\"radio\"\n id={radioId}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n value={value}\n name={name}\n className=\"peer sr-only\"\n {...props}\n />\n\n {/* Custom Radio Visual */}\n <label\n htmlFor={radioId}\n className={`\n ${baseRadioClasses}\n ${interactiveClasses}\n ${checkedClasses}\n ${disabled ? 'cursor-not-allowed' : 'cursor-pointer'}\n `.trim().replace(/\\s+/g, ' ')}\n >\n {/* Inner Circle (checked state) - 6px white dot según Figma */}\n {checked && (\n <div className=\"w-1.5 h-1.5 bg-white rounded-full dark:bg-dark-content-inverse\" />\n )}\n </label>\n </div>\n\n {/* Label and Description */}\n {(label || description) && (\n <label\n htmlFor={radioId}\n className={`flex-1 flex flex-col gap-1 text-sm leading-5 ${\n disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'\n }`}\n >\n {label && (\n <span className=\"font-bold text-content-primary dark:text-dark-content-primary\">\n {label}\n </span>\n )}\n {description && (\n <span className=\"font-normal text-content-secondary dark:text-content-secondary\">\n {description}\n </span>\n )}\n </label>\n )}\n </div>\n );\n }\n);\n\nRadio.displayName = 'Radio';\n","import { forwardRef } from 'react';\nimport type { SwitchProps } from './Switch.types';\n\n/**\n * Switch - Componente de switch del sistema de diseño Siesa\n *\n * Campo de activación/desactivación con soporte para:\n * - Estados: default, hover, focus, disabled\n * - On, off\n * - Label y description opcionales\n * - Posición del label: leading (izquierda) o trailing (derecha)\n * - Animación suave de transición\n * - Dark mode completo\n * - Accesibilidad completa\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Focus ring con shadow especial según Figma\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Label a la izquierda (default)\n * <Switch\n * label=\"Permitir inserción\"\n * description=\"Permite que otros inserten los detalles de tu evento.\"\n * checked={true}\n * onChange={(e) => console.log(e.target.checked)}\n * />\n *\n * // Label a la derecha\n * <Switch\n * label=\"Activar notificaciones\"\n * labelPosition=\"trailing\"\n * checked={false}\n * onChange={(e) => console.log(e.target.checked)}\n * />\n * ```\n */\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n label,\n description,\n labelPosition = 'leading',\n checked = false,\n disabled = false,\n className = '',\n id,\n onChange,\n ariaLabel,\n ...props\n },\n ref\n ) => {\n // Generar ID único si no se proporciona\n const switchId = id || `switch-${Math.random().toString(36).substr(2, 9)}`;\n\n // ===== CLASES BASE DEL TRACK =====\n const baseTrackClasses = `\n w-8\n h-5\n rounded-xl\n border\n overflow-hidden\n relative\n transition-all\n duration-200\n `;\n\n // ===== CLASES DE ESTADO DEL TRACK =====\n const getTrackStateClasses = () => {\n if (disabled) {\n return checked\n ? `\n bg-primary-custom-600\n border-primary-inverse-border\n opacity-50\n cursor-not-allowed\n dark:bg-primary-custom-600\n dark:border-primary-inverse-border\n `\n : `\n bg-[#fafafa]\n border-border-primary\n opacity-50\n cursor-not-allowed\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n `;\n }\n\n return checked\n ? `\n bg-primary-custom-600\n border-primary-inverse-border\n cursor-pointer\n peer-hover:border-[#307cc5]\n peer-focus:shadow-[0px_0px_0px_2px_#dbeefe,0px_1px_2px_0px_rgba(0,0,0,0.05),0px_0px_0px_4px_#60b6fa]\n dark:bg-primary-custom-600\n dark:border-primary-inverse-border\n dark:peer-hover:border-[#307cc5]\n dark:peer-focus:shadow-[0px_0px_0px_2px_#dbeefe,0px_1px_2px_0px_rgba(0,0,0,0.05),0px_0px_0px_4px_#60b6fa]\n `\n : `\n bg-[#fafafa]\n border-border-primary\n cursor-pointer\n peer-hover:border-[#b6b6b9]\n peer-focus:shadow-[0px_0px_0px_2px_#dbeefe,0px_1px_2px_0px_rgba(0,0,0,0.05),0px_0px_0px_4px_#60b6fa]\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n dark:peer-hover:border-[#b6b6b9]\n dark:peer-focus:shadow-[0px_0px_0px_2px_#dbeefe,0px_1px_2px_0px_rgba(0,0,0,0.05),0px_0px_0px_4px_#60b6fa]\n `;\n };\n\n // ===== CLASES DEL BOTÓN (CÍRCULO) =====\n const getButtonClasses = () => {\n const baseButtonClasses = `\n absolute\n w-4\n h-4\n bg-white\n rounded-[10px]\n border\n top-1/2\n -translate-y-1/2\n transition-all\n duration-200\n `;\n\n // Posición: OFF = left-px (1px), ON = left-[13px]\n const positionClass = checked ? 'left-[13px]' : 'left-px';\n\n if (disabled) {\n const borderClass = checked\n ? 'border-primary-inverse-border dark:border-primary-inverse-border'\n : 'border-border-primary dark:border-dark-border-primary';\n return `${baseButtonClasses} ${positionClass} ${borderClass}`;\n }\n\n const borderClass = checked\n ? `\n border-primary-inverse-border\n peer-hover:border-[#307cc5]\n dark:border-primary-inverse-border\n dark:peer-hover:border-[#307cc5]\n `\n : `\n border-border-primary\n peer-hover:border-[#b6b6b9]\n dark:border-dark-border-primary\n dark:peer-hover:border-[#b6b6b9]\n `;\n\n return `${baseButtonClasses} ${positionClass} ${borderClass}`;\n };\n\n // ===== COMBINAR CLASES =====\n const trackClasses = [\n baseTrackClasses,\n getTrackStateClasses(),\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n const buttonClasses = getButtonClasses()\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== COMPONENTES REUTILIZABLES =====\n const LabelContent = (label || description) ? (\n <label\n htmlFor={switchId}\n className={`flex-1 flex flex-col gap-1 text-sm leading-5 ${\n disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'\n }`}\n >\n {label && (\n <span className=\"font-bold text-content-primary dark:text-dark-content-primary\">\n {label}\n </span>\n )}\n {description && (\n <span className=\"font-normal text-content-secondary dark:text-content-secondary\">\n {description}\n </span>\n )}\n </label>\n ) : null;\n\n const SwitchInput = (\n <div className=\"flex items-center justify-center shrink-0\">\n {/* Native Input (hidden but accessible) */}\n <input\n ref={ref}\n type=\"checkbox\"\n id={switchId}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n className=\"peer sr-only\"\n aria-label={ariaLabel || label}\n {...props}\n />\n\n {/* Custom Switch Visual */}\n <label\n htmlFor={switchId}\n className={trackClasses}\n aria-hidden=\"true\"\n >\n {/* Button (sliding circle) */}\n <div className={buttonClasses} />\n </label>\n </div>\n );\n\n return (\n <div className={`flex gap-2 items-center w-[344px] ${className}`}>\n {labelPosition === 'leading' ? (\n <>\n {LabelContent}\n {SwitchInput}\n </>\n ) : (\n <>\n {SwitchInput}\n {LabelContent}\n </>\n )}\n </div>\n );\n }\n);\n\nSwitch.displayName = 'Switch';\n","import { forwardRef } from 'react';\nimport type { AvatarProps } from './Avatar.types';\n\n/**\n * Avatar - Componente de avatar del sistema de diseño Siesa\n *\n * Componente para mostrar imágenes de usuario o iniciales con soporte para:\n * - Tamaños: 4 (20px), 6 (24px), 8 (32px), 10 (40px)\n * - Tipos: circular (completamente redondo) y rounded (esquinas redondeadas)\n * - Imagen o iniciales\n * - Dark mode completo\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Tipografía adaptativa según tamaño\n * - Type safety con TypeScript estricto\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Con imagen\n * <Avatar\n * src=\"/path/to/image.jpg\"\n * alt=\"John Doe\"\n * size=\"10\"\n * type=\"circular\"\n * />\n *\n * // Con iniciales\n * <Avatar\n * initials=\"JD\"\n * size=\"10\"\n * type=\"circular\"\n * />\n * ```\n */\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>(\n (\n {\n size = '10',\n type = 'circular',\n src,\n alt = '',\n initials,\n className = '',\n ...props\n },\n ref\n ) => {\n // ===== CLASES DE TAMAÑO =====\n // Tamaño del contenedor del avatar\n const containerSizeClasses = {\n '4': 'w-5 h-5',\n '6': 'w-6 h-6',\n '8': 'w-8 h-8',\n '10': 'w-10 h-10',\n };\n\n // ===== CLASES DE TEXTO =====\n // Tamaño de texto para iniciales (basado en sistema tipográfico)\n const textSizeClasses = {\n '4': 'text-xs', // 12px - Paragraph Tiny\n '6': 'text-xs', // 12px - Paragraph Tiny\n '8': 'text-sm', // 14px - Paragraph Small\n '10': 'text-base', // 16px - Paragraph Base\n };\n\n // ===== CLASES DE TIPO (Forma) =====\n const typeClasses = {\n circular: 'rounded-full',\n rounded: 'rounded-md',\n };\n\n // ===== CLASES BASE =====\n const baseClasses = `\n relative\n inline-flex\n items-center\n justify-center\n overflow-hidden\n ${containerSizeClasses[size]}\n ${typeClasses[type]}\n `;\n\n // Si hay imagen, mostrarla\n if (src) {\n return (\n <div\n ref={ref}\n className={`${baseClasses} ${className}`.trim().replace(/\\s+/g, ' ')}\n >\n <img\n src={src}\n alt={alt}\n className=\"w-full h-full object-cover\"\n {...(props as any)}\n />\n </div>\n );\n }\n\n // Si hay iniciales, mostrarlas\n if (initials) {\n return (\n <div\n ref={ref}\n className={`\n ${baseClasses}\n ${textSizeClasses[size]}\n bg-content-primary\n text-white\n font-normal\n dark:bg-dark-bg-inverse\n dark:text-dark-content-inverse\n ${className}\n `.trim().replace(/\\s+/g, ' ')}\n >\n <span className=\"leading-none\">{initials}</span>\n </div>\n );\n }\n\n // Fallback: avatar vacío\n return (\n <div\n ref={ref}\n className={`\n ${baseClasses}\n bg-background-secondary\n dark:bg-dark-bg-primary\n ${className}\n `.trim().replace(/\\s+/g, ' ')}\n />\n );\n }\n);\n\nAvatar.displayName = 'Avatar';\n","import { forwardRef } from 'react';\nimport type { DividerProps } from './Divider.types';\n\n/**\n * Divider del sistema de diseño Siesa\n *\n * Línea horizontal de 1px para separar contenido visual o semánticamente.\n * Implementa dos variantes con soporte completo de dark mode.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Componente semántico usando elemento <hr>\n *\n * @see docs/colors.md - Sistema de colores (border-primary, border-secondary)\n * @see docs/spacing.md - Sistema de espaciado (altura de 1px)\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4096-8445 - Especificaciones Figma\n *\n * @example\n * ```tsx\n * // Default divider (más visible)\n * <Divider />\n * <Divider type=\"default\" />\n *\n * // Soft divider (más sutil)\n * <Divider type=\"soft\" />\n *\n * // Con clases personalizadas\n * <Divider className=\"my-6\" />\n * ```\n */\nexport const Divider = forwardRef<HTMLHRElement, DividerProps>(\n (\n {\n type = 'default',\n className = '',\n ...props\n },\n ref\n ) => {\n // ===== CLASES DE TIPO =====\n // Orden de modificadores: {dark}:{utility}\n const typeClasses = {\n // Default: Línea más visible para separaciones claras\n // Light: border-primary (#e4e4e7)\n // Dark: dark-border-primary (#71717a)\n default: 'bg-border-primary dark:bg-dark-border-primary',\n\n // Soft: Línea más sutil para separaciones suaves\n // Light: border-secondary (#f4f4f5 - muy claro)\n // Dark: gray-700 (#374151 - gris medio-oscuro, más sutil que dark-border-primary)\n soft: 'bg-border-secondary dark:bg-gray-700',\n };\n\n // ===== CLASES BASE =====\n const baseClasses = 'w-full h-px border-0';\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [\n baseClasses,\n typeClasses[type],\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <hr\n ref={ref}\n className={finalClasses}\n {...props}\n />\n );\n }\n);\n\nDivider.displayName = 'Divider';\n","import { forwardRef } from 'react';\nimport type { DescriptionListProps } from './DescriptionList.types';\n\n/**\n * DescriptionList del sistema de diseño Siesa\n *\n * Componente para mostrar información estructurada en formato clave-valor (term/details).\n * Layout de dos columnas con separador inferior entre items.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Layout flexible y responsive\n * - Tipografía del sistema (Paragraph/Small - 14px)\n *\n * @see docs/colors.md - Sistema de colores (content-primary, content-secondary)\n * @see docs/typography.md - Sistema tipográfico (Paragraph/Small)\n * @see docs/spacing.md - Sistema de espaciado (padding, gaps)\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4103-8449 - Especificaciones Figma\n *\n * @example\n * ```tsx\n * // Item básico\n * <DescriptionList\n * term=\"Customer\"\n * details=\"Jhonatan Diaz\"\n * />\n *\n * // Lista completa\n * <div>\n * <DescriptionList term=\"Event\" details=\"Bear Hug: Live in Concert\" />\n * <DescriptionList term=\"Amount\" details=\"$120,000 COP\" />\n * <DescriptionList term=\"Fee\" details=\"$20,000 COP\" />\n * </div>\n * ```\n */\nexport const DescriptionList = forwardRef<HTMLDivElement, DescriptionListProps>(\n (\n {\n term,\n details,\n className = '',\n ...props\n },\n ref\n ) => {\n // ===== CLASES BASE =====\n const baseClasses = `\n flex\n flex-wrap\n gap-1\n items-start\n py-2.5\n border-b\n border-border-secondary\n dark:border-gray-700\n `;\n\n // ===== CLASES DE COLUMNA =====\n // Cada columna ocupa el 50% del espacio disponible (flex-1)\n // con un ancho mínimo de 180px para mantener legibilidad\n const columnClasses = 'flex-1 min-w-[180px]';\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [baseClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div ref={ref} className={finalClasses} {...props}>\n {/* Term Column (izquierda) */}\n {/* Light: content-secondary (#a1a1aa) */}\n {/* Dark: gray-400 (#9ca3af - gris medio claro para mantener contraste) */}\n <div className={columnClasses}>\n <p className=\"text-sm leading-5 text-content-secondary dark:text-gray-400 font-normal\">\n {term}\n </p>\n </div>\n\n {/* Details Column (derecha) */}\n {/* Light: content-primary (#18181b) */}\n {/* Dark: dark-content-primary (#ffffff) */}\n <div className={columnClasses}>\n <p className=\"text-sm leading-5 text-content-primary dark:text-dark-content-primary font-normal\">\n {details}\n </p>\n </div>\n </div>\n );\n }\n);\n\nDescriptionList.displayName = 'DescriptionList';\n","import { forwardRef } from 'react';\nimport type { AlertProps } from './Alert.types';\nimport { Button } from '../Button/Button';\n\n/**\n * Alert - Componente de alerta/diálogo del sistema de diseño Siesa\n *\n * Componente modal para confirmaciones con soporte para:\n * - Título y descripción\n * - Contenido personalizado (children)\n * - Botones de acción personalizados o por defecto\n * - Dark mode\n *\n * @example\n * ```tsx\n * <Alert\n * title=\"Are you sure you want to refund this payment?\"\n * description=\"The refund will be reflected in 2 to 3 business days.\"\n * onCancel={() => console.log('Cancelled')}\n * onConfirm={() => console.log('Confirmed')}\n * confirmText=\"Refund\"\n * />\n * ```\n */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n title,\n description,\n children,\n actions,\n onCancel,\n onConfirm,\n cancelText = 'Cancelar',\n confirmText = 'Confirmar',\n className = '',\n ...props\n },\n ref\n ) => {\n // Si se proveen actions personalizadas, usarlas. Si no, usar botones por defecto\n const actionButtons = actions || (\n <>\n {onCancel && (\n <Button type=\"plain\" size=\"base\" onClick={onCancel}>\n {cancelText}\n </Button>\n )}\n {onConfirm && (\n <Button type=\"default\" size=\"base\" onClick={onConfirm}>\n {confirmText}\n </Button>\n )}\n </>\n );\n\n return (\n <div\n ref={ref}\n className={`\n w-[512px]\n bg-white\n dark:bg-dark-bg-primary\n border\n border-border-primary\n dark:border-dark-border-primary\n rounded-xl\n ${className}\n `.trim().replace(/\\s+/g, ' ')}\n {...props}\n >\n {/* Content Container */}\n <div className=\"p-6 flex flex-col gap-4\">\n {/* Text Section */}\n <div className=\"flex flex-col gap-3\">\n {/* Title */}\n <p className=\"text-sm leading-5 font-bold text-content-primary dark:text-dark-content-primary\">\n {title}\n </p>\n\n {/* Description (optional) */}\n {description && (\n <p className=\"text-sm leading-5 font-normal text-content-tertiary dark:text-content-tertiary\">\n {description}\n </p>\n )}\n </div>\n\n {/* Body Content (optional) */}\n {children && (\n <div className=\"flex flex-col gap-3\">\n {children}\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex flex-wrap gap-3 items-center justify-end\">\n {actionButtons}\n </div>\n </div>\n </div>\n );\n }\n);\n\nAlert.displayName = 'Alert';\n","import { forwardRef, cloneElement } from 'react';\nimport type { BadgeProps, BadgeColor } from './Badge.types';\n\n/**\n * Badge del sistema de diseño Siesa\n *\n * Componente para mostrar etiquetas con múltiples variantes de color.\n * Los badges mantienen sus colores vibrantes en light y dark mode para\n * garantizar visibilidad y consistencia visual.\n *\n * Características implementadas:\n * - 21 variantes de color (zinc, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, primary, secondary, tertiary)\n * - Icono opcional a la izquierda (12x12px)\n * - Contador/notification badge opcional\n * - Estados hover con transiciones suaves\n * - Los colores se mantienen vibrantes en dark mode (según diseño Figma)\n * - Tipografía: Label Tiny (12px Bold)\n *\n * Mejores prácticas implementadas:\n * - Tokens de color de Tailwind estándar para badges\n * - Font-family explícita (SiesaBT via font-sans)\n * - Transiciones suaves (duration-200)\n * - Estructura clara y mantenible\n *\n * @see docs/typography.md - Sistema tipográfico (Label Tiny)\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4130-9382\n *\n * @example\n * ```tsx\n * // Badge simple\n * <Badge color=\"blue\" label=\"Label\" />\n *\n * // Badge con icono\n * <Badge color=\"green\" label=\"Success\" leftIcon={<CheckIcon />} />\n *\n * // Badge con contador\n * <Badge color=\"red\" label=\"Errors\" count={5} />\n *\n * // Badge completo\n * <Badge color=\"primary\" label=\"Messages\" leftIcon={<MailIcon />} count={12} />\n * ```\n */\nexport const Badge = forwardRef<HTMLDivElement, BadgeProps>(\n (\n {\n color = 'zinc',\n leftIcon,\n label,\n count,\n className = '',\n ...props\n },\n ref\n ) => {\n // Map de colores - En dark mode mantienen los mismos colores vibrantes según Figma\n const colorClasses: Record<BadgeColor, { bg: string; text: string; hover: string; notificationBg: string; notificationText: string }> = {\n zinc: {\n bg: 'bg-zinc-100',\n text: 'text-zinc-600',\n hover: 'hover:bg-zinc-200',\n notificationBg: 'bg-zinc-600',\n notificationText: 'text-zinc-100',\n },\n red: {\n bg: 'bg-red-100',\n text: 'text-red-700',\n hover: 'hover:bg-red-200',\n notificationBg: 'bg-red-700',\n notificationText: 'text-red-100',\n },\n orange: {\n bg: 'bg-orange-100',\n text: 'text-orange-700',\n hover: 'hover:bg-orange-200',\n notificationBg: 'bg-orange-700',\n notificationText: 'text-orange-100',\n },\n amber: {\n bg: 'bg-amber-100',\n text: 'text-amber-700',\n hover: 'hover:bg-amber-200',\n notificationBg: 'bg-amber-700',\n notificationText: 'text-amber-100',\n },\n yellow: {\n bg: 'bg-yellow-100',\n text: 'text-yellow-700',\n hover: 'hover:bg-yellow-200',\n notificationBg: 'bg-yellow-700',\n notificationText: 'text-yellow-100',\n },\n lime: {\n bg: 'bg-lime-100',\n text: 'text-lime-700',\n hover: 'hover:bg-lime-200',\n notificationBg: 'bg-lime-700',\n notificationText: 'text-lime-100',\n },\n green: {\n bg: 'bg-green-100',\n text: 'text-green-700',\n hover: 'hover:bg-green-200',\n notificationBg: 'bg-green-700',\n notificationText: 'text-green-100',\n },\n emerald: {\n bg: 'bg-emerald-100',\n text: 'text-emerald-700',\n hover: 'hover:bg-emerald-200',\n notificationBg: 'bg-emerald-700',\n notificationText: 'text-emerald-100',\n },\n teal: {\n bg: 'bg-teal-100',\n text: 'text-teal-700',\n hover: 'hover:bg-teal-200',\n notificationBg: 'bg-teal-700',\n notificationText: 'text-teal-100',\n },\n cyan: {\n bg: 'bg-cyan-100',\n text: 'text-cyan-700',\n hover: 'hover:bg-cyan-200',\n notificationBg: 'bg-cyan-700',\n notificationText: 'text-cyan-100',\n },\n sky: {\n bg: 'bg-sky-100',\n text: 'text-sky-700',\n hover: 'hover:bg-sky-200',\n notificationBg: 'bg-sky-700',\n notificationText: 'text-sky-100',\n },\n blue: {\n bg: 'bg-blue-100',\n text: 'text-blue-700',\n hover: 'hover:bg-blue-200',\n notificationBg: 'bg-blue-700',\n notificationText: 'text-blue-100',\n },\n indigo: {\n bg: 'bg-indigo-100',\n text: 'text-indigo-700',\n hover: 'hover:bg-indigo-200',\n notificationBg: 'bg-indigo-700',\n notificationText: 'text-indigo-100',\n },\n violet: {\n bg: 'bg-violet-100',\n text: 'text-violet-700',\n hover: 'hover:bg-violet-200',\n notificationBg: 'bg-violet-700',\n notificationText: 'text-violet-100',\n },\n purple: {\n bg: 'bg-purple-100',\n text: 'text-purple-700',\n hover: 'hover:bg-purple-200',\n notificationBg: 'bg-purple-700',\n notificationText: 'text-purple-100',\n },\n fuchsia: {\n bg: 'bg-fuchsia-100',\n text: 'text-fuchsia-700',\n hover: 'hover:bg-fuchsia-200',\n notificationBg: 'bg-fuchsia-700',\n notificationText: 'text-fuchsia-100',\n },\n pink: {\n bg: 'bg-pink-100',\n text: 'text-pink-700',\n hover: 'hover:bg-pink-200',\n notificationBg: 'bg-pink-700',\n notificationText: 'text-pink-100',\n },\n rose: {\n bg: 'bg-rose-100',\n text: 'text-rose-700',\n hover: 'hover:bg-rose-200',\n notificationBg: 'bg-rose-700',\n notificationText: 'text-rose-100',\n },\n primary: {\n bg: 'bg-primary-custom-100',\n text: 'text-primary-custom-600',\n hover: 'hover:bg-primary-custom-200',\n notificationBg: 'bg-primary-custom-600',\n notificationText: 'text-primary-custom-100',\n },\n secondary: {\n bg: 'bg-zinc-100',\n text: 'text-zinc-600',\n hover: 'hover:bg-zinc-200',\n notificationBg: 'bg-zinc-600',\n notificationText: 'text-zinc-100',\n },\n tertiary: {\n bg: 'bg-zinc-100',\n text: 'text-zinc-600',\n hover: 'hover:bg-zinc-200',\n notificationBg: 'bg-zinc-600',\n notificationText: 'text-zinc-100',\n },\n };\n\n const colors = colorClasses[color];\n\n // Renderizar icono con tamaño correcto (12x12)\n const renderIcon = (icon: React.ReactElement) => {\n const existingClassName = (icon.props as any).className || '';\n return cloneElement(icon as React.ReactElement<any>, {\n className: `w-3 h-3 ${existingClassName}`.trim(),\n });\n };\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [\n 'inline-flex',\n 'items-center',\n 'gap-1',\n 'px-1.5',\n 'py-1',\n 'rounded-md',\n 'font-sans',\n colors.bg,\n colors.hover,\n 'transition-colors',\n 'duration-200',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div\n ref={ref}\n className={finalClasses}\n {...props}\n >\n {/* Icono izquierdo */}\n {leftIcon && (\n <div className={`flex items-center justify-center ${colors.text}`}>\n {renderIcon(leftIcon)}\n </div>\n )}\n\n {/* Label del badge */}\n <span className={`font-sans text-xs leading-4 ${colors.text}`}>\n {label}\n </span>\n\n {/* Notification badge (contador) */}\n {count !== undefined && (\n <div\n className={`\n h-3\n flex\n items-center\n justify-center\n px-0.5\n rounded-xs\n min-w-[12px]\n ${colors.notificationBg}\n `.trim().replace(/\\s+/g, ' ')}\n >\n <span className={`font-sans text-xs leading-4 ${colors.notificationText}`}>\n {count}\n </span>\n </div>\n )}\n </div>\n );\n }\n);\n\nBadge.displayName = 'Badge';\n","import { forwardRef, useState, useEffect } from 'react';\nimport type { QuantityProps } from './Quantity.types';\n\n/**\n * Quantity - Componente de cantidad del sistema de diseño Siesa\n *\n * Componente para seleccionar cantidades con soporte para:\n * - Botones de incremento/decremento\n * - Valores mínimo y máximo\n * - Label opcional con link\n * - Texto de ayuda opcional\n * - Estado de error\n * - Estado deshabilitado\n * - Dark mode completo\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Focus rings adaptativos para light y dark mode\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Quantity\n * label=\"Cantidad\"\n * value={5}\n * min={0}\n * max={10}\n * onChange={(value) => console.log(value)}\n * />\n * ```\n */\nexport const Quantity = forwardRef<HTMLDivElement, QuantityProps>(\n (\n {\n value: controlledValue,\n defaultValue = 0,\n onChange,\n min = 0,\n max,\n label,\n linkText,\n onLinkClick,\n helperText,\n error = false,\n disabled = false,\n className = '',\n ...props\n },\n ref\n ) => {\n // Estado interno para valor no controlado\n const [internalValue, setInternalValue] = useState(defaultValue);\n const isControlled = controlledValue !== undefined;\n const currentValue = isControlled ? controlledValue : internalValue;\n\n // Sincronizar valor interno con defaultValue cuando cambia\n useEffect(() => {\n if (!isControlled) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue, isControlled]);\n\n // Handler para cambio de valor\n const handleValueChange = (newValue: number) => {\n // Aplicar restricciones de min/max\n let clampedValue = newValue;\n if (min !== undefined && clampedValue < min) {\n clampedValue = min;\n }\n if (max !== undefined && clampedValue > max) {\n clampedValue = max;\n }\n\n // Actualizar estado interno si no está controlado\n if (!isControlled) {\n setInternalValue(clampedValue);\n }\n\n // Llamar onChange si existe\n onChange?.(clampedValue);\n };\n\n // Handlers para botones\n const handleDecrement = () => {\n if (disabled) return;\n handleValueChange(currentValue - 1);\n };\n\n const handleIncrement = () => {\n if (disabled) return;\n handleValueChange(currentValue + 1);\n };\n\n // Verificar si los botones deben estar deshabilitados\n const isDecrementDisabled = disabled || (min !== undefined && currentValue <= min);\n const isIncrementDisabled = disabled || (max !== undefined && currentValue >= max);\n\n // Iconos SVG inline\n const MinusIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M3 8H13\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n\n const PlusIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M8 3V13M3 8H13\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n\n // Clases para el estado (usando especificaciones exactas de Figma)\n const borderClass = error\n ? 'border-error-border dark:border-error-border'\n : 'border-border-primary dark:border-dark-border-primary';\n\n const hoverClass = !disabled && !error\n ? 'hover:border-[#f9f9f9] dark:hover:border-[#f9f9f9]'\n : '';\n\n const focusClass = !disabled && !error\n ? 'focus-within:border-2 focus-within:border-[#329cff] dark:focus-within:border-[#329cff]'\n : '';\n\n return (\n <div\n ref={ref}\n className={`flex flex-col gap-2 ${className}`.trim()}\n {...props}\n >\n {/* Label con link opcional */}\n {label && (\n <div className=\"flex items-center justify-between\">\n <label className=\"text-sm leading-5 font-bold text-content-primary dark:text-dark-content-primary\">\n {label}\n </label>\n {linkText && (\n <button\n type=\"button\"\n onClick={onLinkClick}\n disabled={disabled}\n className={`\n text-xs leading-4\n text-primary-custom-600\n hover:underline\n dark:text-primary-custom-600\n ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}\n transition-colors\n duration-200\n `.trim().replace(/\\s+/g, ' ')}\n >\n {linkText}\n </button>\n )}\n </div>\n )}\n\n {/* Input con botones */}\n <div\n className={`\n flex\n items-center\n gap-2\n px-3\n py-1.5\n bg-white\n dark:bg-dark-bg-primary\n border\n ${borderClass}\n ${hoverClass}\n ${focusClass}\n rounded-lg\n transition-colors\n duration-200\n ${disabled ? 'opacity-50 cursor-not-allowed' : ''}\n `.trim().replace(/\\s+/g, ' ')}\n >\n {/* Botón decrementar */}\n <button\n type=\"button\"\n onClick={handleDecrement}\n disabled={isDecrementDisabled}\n className={`\n flex\n items-center\n justify-center\n w-4\n h-4\n ${isDecrementDisabled\n ? 'text-content-tertiary dark:text-content-tertiary cursor-not-allowed'\n : 'text-content-primary dark:text-dark-content-primary hover:text-content-secondary dark:hover:text-content-secondary cursor-pointer'\n }\n transition-colors\n duration-200\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Decrementar\"\n >\n <MinusIcon />\n </button>\n\n {/* Valor actual */}\n <div className=\"flex-1 text-center\">\n <span\n className={`\n text-base leading-6\n ${currentValue === 0\n ? 'text-content-tertiary dark:text-content-tertiary'\n : 'text-content-primary dark:text-dark-content-primary'\n }\n `.trim().replace(/\\s+/g, ' ')}\n >\n {currentValue}\n </span>\n </div>\n\n {/* Botón incrementar */}\n <button\n type=\"button\"\n onClick={handleIncrement}\n disabled={isIncrementDisabled}\n className={`\n flex\n items-center\n justify-center\n w-4\n h-4\n ${isIncrementDisabled\n ? 'text-content-tertiary dark:text-content-tertiary cursor-not-allowed'\n : 'text-content-primary dark:text-dark-content-primary hover:text-content-secondary dark:hover:text-content-secondary cursor-pointer'\n }\n transition-colors\n duration-200\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Incrementar\"\n >\n <PlusIcon />\n </button>\n </div>\n\n {/* Helper text */}\n {helperText && (\n <p\n className={`\n text-sm leading-5\n ${error\n ? 'text-error-content dark:text-error-content'\n : 'text-content-tertiary dark:text-content-tertiary'\n }\n `.trim().replace(/\\s+/g, ' ')}\n >\n {helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nQuantity.displayName = 'Quantity';\n","/**\n * Iconos para el componente Dropdown\n * Usando heroicons-micro según especificaciones de Figma\n */\n\nexport const ChevronDownIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const CogIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M6.455 1.45A.5.5 0 0 1 6.952 1h2.096a.5.5 0 0 1 .497.45l.186 1.858a4.996 4.996 0 0 1 1.466.848l1.703-.769a.5.5 0 0 1 .639.206l1.047 1.814a.5.5 0 0 1-.14.656l-1.517 1.09a5.026 5.026 0 0 1 0 1.694l1.516 1.09a.5.5 0 0 1 .141.656l-1.047 1.814a.5.5 0 0 1-.639.206l-1.703-.768c-.433.36-.928.649-1.466.847l-.186 1.858a.5.5 0 0 1-.497.45H6.952a.5.5 0 0 1-.497-.45l-.186-1.858a4.993 4.993 0 0 1-1.466-.848l-1.703.769a.5.5 0 0 1-.639-.206l-1.047-1.814a.5.5 0 0 1 .14-.656l1.517-1.09a5.033 5.033 0 0 1 0-1.694l-1.516-1.09a.5.5 0 0 1-.141-.656L2.461 3.39a.5.5 0 0 1 .639-.206l1.703.768c.433-.36.928-.649 1.466-.847l.186-1.858ZM8 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const UserIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path d=\"M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM12.735 14c.618 0 1.093-.561.872-1.139a6.002 6.002 0 0 0-11.215 0c-.22.578.254 1.139.872 1.139h9.47Z\" />\n </svg>\n);\n\nexport const BellIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12 5a4 4 0 0 0-8 0v2.379a1.5 1.5 0 0 1-.44 1.06L2.294 9.707a1 1 0 0 0-.293.707V11a1 1 0 0 0 1 1h2a3 3 0 1 0 6 0h2a1 1 0 0 0 1-1v-.586a1 1 0 0 0-.293-.707L12.44 8.44A1.5 1.5 0 0 1 12 7.38V5Zm-5.5 7a1.5 1.5 0 0 0 3 0h-3Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const CreditCardIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path d=\"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z\" />\n <path d=\"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z\" />\n </svg>\n);\n","import React, { useState, useRef, useEffect, useCallback } from 'react';\nimport type {\n DropdownProps,\n DropdownItemProps,\n DropdownHeadingProps,\n DropdownDividerProps,\n} from './Dropdown.types';\nimport { ChevronDownIcon } from './icons';\n\ntype MenuPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';\n\n/**\n * Componente Dropdown del sistema de diseño Siesa\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels y keyboard navigation\n * - Cierre automático al hacer click fuera\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n *\n * @example\n * ```tsx\n * <Dropdown\n * placeholder=\"Options\"\n * items={[\n * { children: 'Account', icon: <UserIcon /> },\n * { children: 'Settings', icon: <CogIcon /> },\n * { isDivider: true },\n * { children: 'Logout' },\n * ]}\n * />\n * ```\n */\nexport const Dropdown: React.FC<DropdownProps> = ({\n variant = 'default',\n children,\n items,\n open: controlledOpen,\n onOpenChange,\n disabled = false,\n className = '',\n menuClassName = '',\n ariaLabel,\n placeholder = 'Options',\n}) => {\n const [internalOpen, setInternalOpen] = useState(false);\n const [menuPosition, setMenuPosition] = useState<MenuPosition>('bottom-left');\n const dropdownRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n\n // Determinar si es controlado o no controlado\n const isControlled = controlledOpen !== undefined;\n const isOpen = isControlled ? controlledOpen : internalOpen;\n\n // Calcular la posición óptima del menú basándose en el espacio disponible\n const calculateMenuPosition = useCallback(() => {\n if (!dropdownRef.current) return;\n\n const triggerRect = dropdownRef.current.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n // Estimación del tamaño del menú (min-width: 182px, altura aproximada)\n const menuWidth = 200;\n const menuHeight = 250;\n\n // Verificar espacio disponible\n const spaceBelow = viewportHeight - triggerRect.bottom;\n const spaceAbove = triggerRect.top;\n const spaceRight = viewportWidth - triggerRect.left;\n const spaceLeft = triggerRect.right;\n\n // Determinar posición vertical\n const openAbove = spaceBelow < menuHeight && spaceAbove > spaceBelow;\n\n // Determinar posición horizontal\n const openLeft = spaceRight < menuWidth && spaceLeft > spaceRight;\n\n if (openAbove && openLeft) {\n setMenuPosition('top-right');\n } else if (openAbove) {\n setMenuPosition('top-left');\n } else if (openLeft) {\n setMenuPosition('bottom-right');\n } else {\n setMenuPosition('bottom-left');\n }\n }, []);\n\n // Función para cambiar el estado\n const handleToggle = () => {\n if (disabled) return;\n\n const newOpen = !isOpen;\n\n // Calcular posición antes de abrir\n if (newOpen) {\n calculateMenuPosition();\n }\n\n if (!isControlled) {\n setInternalOpen(newOpen);\n }\n\n onOpenChange?.(newOpen);\n };\n\n // Cerrar al hacer click fuera\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {\n if (!isControlled) {\n setInternalOpen(false);\n }\n onOpenChange?.(false);\n }\n };\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }\n }, [isOpen, isControlled, onOpenChange]);\n\n // Cerrar al presionar Escape\n useEffect(() => {\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && isOpen) {\n if (!isControlled) {\n setInternalOpen(false);\n }\n onOpenChange?.(false);\n }\n };\n\n if (isOpen) {\n document.addEventListener('keydown', handleEscape);\n return () => {\n document.removeEventListener('keydown', handleEscape);\n };\n }\n }, [isOpen, isControlled, onOpenChange]);\n\n // Handler para item click\n const handleItemClick = (item: DropdownItemProps) => {\n if (item.disabled || item.isDivider || item.isHeading) return;\n\n // Ejecutar el onClick del item\n if (item.onClick) {\n item.onClick({} as React.MouseEvent<HTMLButtonElement>);\n }\n\n // Cerrar el dropdown\n if (!isControlled) {\n setInternalOpen(false);\n }\n onOpenChange?.(false);\n };\n\n // ===== CLASES DEL TRIGGER BUTTON =====\n const triggerClasses = [\n // Base\n 'inline-flex',\n 'items-center',\n 'justify-center',\n 'rounded-lg',\n 'font-bold',\n 'text-sm',\n 'whitespace-nowrap',\n 'transition-all',\n 'duration-150',\n\n // Variant-specific sizing\n variant === 'icon-only' ? 'w-9 h-9' : 'gap-3 px-3 py-2',\n\n // Colores y estados (Light Mode)\n 'bg-bg-primary',\n 'text-content-secondary',\n 'border',\n 'border-border-primary',\n 'hover:bg-background-secondary',\n 'active:scale-95',\n\n // Dark Mode\n 'dark:bg-dark-bg-primary',\n 'dark:text-dark-content-primary',\n 'dark:border-dark-border-primary',\n 'dark:hover:bg-dark-bg-secondary',\n\n // Focus ring\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'focus:ring-offset-2',\n 'dark:focus:ring-dark-border-custom',\n 'dark:focus:ring-offset-dark-bg-primary',\n\n // Disabled\n disabled && 'opacity-50',\n disabled && 'cursor-not-allowed',\n disabled && 'pointer-events-none',\n\n // Custom classes\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // Clases de posición basadas en el cálculo\n const positionClasses: Record<MenuPosition, string> = {\n 'bottom-left': 'top-full left-0 mt-2',\n 'bottom-right': 'top-full right-0 mt-2',\n 'top-left': 'bottom-full left-0 mb-2',\n 'top-right': 'bottom-full right-0 mb-2',\n };\n\n // ===== CLASES DEL MENU =====\n const menuClasses = [\n // Base\n 'absolute',\n positionClasses[menuPosition],\n 'min-w-[182px]',\n 'rounded-xl',\n 'p-1',\n 'border',\n 'z-50',\n\n // Colores (Light Mode)\n 'bg-background-secondary',\n 'border-border-primary',\n\n // Dark Mode\n 'dark:bg-dark-bg-primary',\n 'dark:border-dark-border-primary',\n\n // Shadow\n 'shadow-menu',\n\n // Custom classes\n menuClassName,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div ref={dropdownRef} className=\"relative inline-block\">\n {/* Trigger Button */}\n <button\n type=\"button\"\n className={triggerClasses}\n onClick={handleToggle}\n disabled={disabled}\n aria-label={ariaLabel || (variant === 'icon-only' ? 'Abrir menú' : undefined)}\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n >\n {variant === 'default' && <span>{children || placeholder}</span>}\n <ChevronDownIcon />\n </button>\n\n {/* Dropdown Menu */}\n {isOpen && (\n <div ref={menuRef} className={menuClasses}>\n {items.map((item, index) => {\n if (item.isDivider) {\n return <DropdownDivider key={index} className={item.className} />;\n }\n\n if (item.isHeading) {\n return (\n <DropdownHeading key={index} className={item.className}>\n {item.children}\n </DropdownHeading>\n );\n }\n\n return (\n <DropdownItem\n key={index}\n {...item}\n onClick={() => handleItemClick(item)}\n />\n );\n })}\n </div>\n )}\n </div>\n );\n};\n\n/**\n * Componente DropdownItem\n * Item individual dentro del menú dropdown\n *\n * @example\n * ```tsx\n * <DropdownItem icon={<UserIcon />} shortcut=\"⌘ P\">\n * Profile\n * </DropdownItem>\n * ```\n */\nexport const DropdownItem: React.FC<DropdownItemProps> = ({\n children,\n icon,\n description,\n shortcut,\n disabled = false,\n selected = false,\n onClick,\n className = '',\n}) => {\n // ===== CLASES DEL ITEM =====\n const itemClasses = [\n // Base\n 'flex',\n 'items-center',\n 'gap-3',\n 'px-4',\n 'py-2',\n 'rounded-lg',\n 'text-sm',\n 'w-full',\n 'text-left',\n 'transition-colors',\n 'duration-150',\n\n // Colores y estados (Light Mode)\n 'text-content-primary',\n !disabled && 'hover:bg-bg-primary',\n selected && 'bg-bg-primary',\n\n // Dark Mode\n 'dark:text-dark-content-primary',\n !disabled && 'dark:hover:bg-dark-bg-secondary',\n selected && 'dark:bg-dark-bg-secondary',\n\n // Disabled\n disabled && 'opacity-50',\n disabled && 'cursor-not-allowed',\n !disabled && 'cursor-pointer',\n\n // Custom classes\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type=\"button\"\n className={itemClasses}\n onClick={onClick}\n disabled={disabled}\n >\n {/* Icon */}\n {icon && (\n <span className=\"inline-flex items-center justify-center w-4 h-4 text-content-secondary dark:text-dark-content-secondary\">\n {icon}\n </span>\n )}\n\n {/* Content */}\n <div className=\"flex-1 min-w-0\">\n {/* Label */}\n <div className=\"text-content-primary dark:text-dark-content-primary\">\n {children}\n </div>\n\n {/* Description */}\n {description && (\n <div className=\"text-xs text-content-secondary dark:text-dark-content-secondary mt-0.5\">\n {description}\n </div>\n )}\n </div>\n\n {/* Shortcut */}\n {shortcut && (\n <span className=\"text-xs text-content-secondary dark:text-dark-content-secondary ml-auto whitespace-nowrap\">\n {shortcut}\n </span>\n )}\n </button>\n );\n};\n\n/**\n * Componente DropdownHeading\n * Encabezado de sección dentro del menú dropdown\n *\n * @example\n * ```tsx\n * <DropdownHeading>My events</DropdownHeading>\n * ```\n */\nexport const DropdownHeading: React.FC<DropdownHeadingProps> = ({\n children,\n className = '',\n}) => {\n // ===== CLASES DEL HEADING =====\n const headingClasses = [\n // Base\n 'px-4',\n 'py-1',\n 'text-xs',\n 'font-normal',\n\n // Colores\n 'text-content-tertiary',\n\n // Dark Mode\n 'dark:text-dark-content-tertiary',\n\n // Custom classes\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return <div className={headingClasses}>{children}</div>;\n};\n\n/**\n * Componente DropdownDivider\n * Separador visual entre items del menú dropdown\n *\n * @example\n * ```tsx\n * <DropdownDivider />\n * ```\n */\nexport const DropdownDivider: React.FC<DropdownDividerProps> = ({\n className = '',\n}) => {\n // ===== CLASES DEL DIVIDER =====\n const dividerClasses = [\n // Base\n 'px-4',\n 'py-1',\n\n // Custom classes\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div className={dividerClasses}>\n <div className=\"h-px bg-border-primary dark:bg-dark-border-primary\" />\n </div>\n );\n};\n","import React from 'react';\nimport type { NotificationProps } from './Notification.types';\n\n/**\n * Componente Notification del sistema de diseño Siesa\n *\n * Badge de notificación para indicar alertas, mensajes o notificaciones pendientes.\n * Puede mostrar un punto simple o un contador numérico con límite automático a 99+.\n *\n * **Especificaciones de Figma:**\n * - Badge con número: 27px × 13px (aprox), Label/XXSmall (10px Bold, line-height 12px)\n * - Badge simple (dot): 13px × 13px\n * - Color: `content-extensions-red` (#b91c1c) por defecto\n * - Border radius: Pill (rounded-full)\n * - Padding: 4px horizontal\n *\n * **Variantes:**\n * - Sin count: Muestra punto circular (dot)\n * - Con count: Muestra badge con número (máximo 99+)\n *\n * **Uso típico:**\n * - Como overlay en iconos o botones\n * - En elementos de menú o navegación\n * - Standalone para indicar estado\n *\n * @see docs/colors.md - Sistema de colores (token content-extensions-red)\n * @see docs/typography.md - Sistema tipográfico (Label/XXSmall)\n * @see src/components/Button/Button.tsx - Referencia de badges en botones\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4310-22651\n *\n * @example\n * ```tsx\n * // Badge simple (punto)\n * <Notification />\n *\n * // Badge con número\n * <Notification count={5} />\n *\n * // Badge con muchos (muestra 99+)\n * <Notification count={150} />\n *\n * // Con color personalizado\n * <Notification count={3} color=\"green\" />\n *\n * // Como overlay en botón\n * <button className=\"relative\">\n * <BellIcon />\n * <Notification count={5} className=\"absolute -top-1 -right-1\" />\n * </button>\n * ```\n */\nexport const Notification: React.FC<NotificationProps> = ({\n count,\n color = 'red',\n className = '',\n ariaLabel,\n}) => {\n // ===== MAPA DE COLORES =====\n // Sistema de colores consistente con Button y Badge\n const colorClasses: Record<string, { bg: string; text: string }> = {\n zinc: { bg: 'bg-zinc-600', text: 'text-white' },\n red: { bg: 'bg-content-extensions-red', text: 'text-white' },\n orange: { bg: 'bg-orange-700', text: 'text-white' },\n amber: { bg: 'bg-amber-700', text: 'text-white' },\n yellow: { bg: 'bg-yellow-700', text: 'text-white' },\n lime: { bg: 'bg-lime-700', text: 'text-white' },\n green: { bg: 'bg-green-700', text: 'text-white' },\n emerald: { bg: 'bg-emerald-700', text: 'text-white' },\n teal: { bg: 'bg-teal-700', text: 'text-white' },\n cyan: { bg: 'bg-cyan-700', text: 'text-white' },\n sky: { bg: 'bg-sky-700', text: 'text-white' },\n blue: { bg: 'bg-blue-700', text: 'text-white' },\n indigo: { bg: 'bg-indigo-700', text: 'text-white' },\n violet: { bg: 'bg-violet-700', text: 'text-white' },\n purple: { bg: 'bg-purple-700', text: 'text-white' },\n fuchsia: { bg: 'bg-fuchsia-700', text: 'text-white' },\n pink: { bg: 'bg-pink-700', text: 'text-white' },\n rose: { bg: 'bg-rose-700', text: 'text-white' },\n primary: { bg: 'bg-primary-custom-600', text: 'text-white' },\n secondary: { bg: 'bg-zinc-600', text: 'text-white' },\n tertiary: { bg: 'bg-zinc-600', text: 'text-white' },\n };\n\n const colors = colorClasses[color] || colorClasses.red;\n\n // ===== ARIA LABEL DINÁMICO =====\n const dynamicAriaLabel = ariaLabel ||\n (count !== undefined && count > 0\n ? `${count} notificaci${count === 1 ? 'ón' : 'ones'}`\n : 'Notificación pendiente');\n\n // ===== BADGE CON NÚMERO =====\n if (count !== undefined && count > 0) {\n const displayCount = count > 99 ? '99+' : count.toString();\n\n return (\n <span\n className={`\n inline-flex\n items-center\n justify-center\n min-w-[16px]\n h-4\n px-1\n rounded-full\n text-[10px]\n font-bold\n leading-none\n ${colors.bg}\n ${colors.text}\n pointer-events-none\n dark:${colors.bg}\n dark:${colors.text}\n ${className}\n `\n .trim()\n .replace(/\\s+/g, ' ')}\n role=\"status\"\n aria-label={dynamicAriaLabel}\n >\n {displayCount}\n </span>\n );\n }\n\n // ===== BADGE SIMPLE (DOT) =====\n return (\n <span\n className={`\n inline-block\n w-2\n h-2\n rounded-full\n ${colors.bg}\n pointer-events-none\n dark:${colors.bg}\n ${className}\n `\n .trim()\n .replace(/\\s+/g, ' ')}\n role=\"status\"\n aria-label={dynamicAriaLabel}\n />\n );\n};\n","import React from 'react';\n\n/**\n * Icono de flecha izquierda (ChevronLeft)\n * Usado en el botón \"Back\"\n * Heroicons Micro (16x16px)\n */\nexport const ArrowLeftIcon: React.FC<{ className?: string }> = ({ className = '' }) => {\n return (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M9.78 4.22a.75.75 0 0 1 0 1.06L7.06 8l2.72 2.72a.75.75 0 1 1-1.06 1.06L5.47 8.53a.75.75 0 0 1 0-1.06l3.25-3.25a.75.75 0 0 1 1.06 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n};\n\n/**\n * Icono de flecha derecha (ChevronRight)\n * Usado en el botón \"Next\"\n * Heroicons Micro (16x16px)\n */\nexport const ArrowRightIcon: React.FC<{ className?: string }> = ({ className = '' }) => {\n return (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M6.22 4.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1 0 1.06l-3.25 3.25a.75.75 0 0 1-1.06-1.06L8.94 8 6.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n};\n","import React, { useMemo } from 'react';\nimport type { PaginationProps, PageButtonProps } from './Pagination.types';\nimport { ArrowLeftIcon, ArrowRightIcon } from './icons';\n\n/**\n * Componente Pagination del sistema de diseño Siesa\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n * - Algoritmo de paginación inteligente\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label Small)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Pagination\n * currentPage={1}\n * totalPages={66}\n * onPageChange={(page) => console.log(page)}\n * />\n * ```\n */\nexport const Pagination: React.FC<PaginationProps> = ({\n currentPage = 1,\n totalPages,\n onPageChange,\n backText = 'Atrás',\n nextText = 'Siguiente',\n siblingCount = 1,\n showBackButton = true,\n showNextButton = true,\n className = '',\n ariaLabel = 'Paginación',\n}) => {\n /**\n * Genera el array de páginas a mostrar\n * Algoritmo: [1] ... [currentPage-1] [currentPage] [currentPage+1] ... [totalPages]\n */\n const paginationRange = useMemo(() => {\n const totalNumbers = siblingCount * 2 + 3; // Página actual + siblings + primera + última\n const totalBlocks = totalNumbers + 2; // + 2 separadores \"...\"\n\n // Si el total de páginas es menor que el total de bloques, mostrar todas\n if (totalPages <= totalBlocks) {\n return Array.from({ length: totalPages }, (_, i) => i + 1);\n }\n\n const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);\n const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);\n\n const shouldShowLeftDots = leftSiblingIndex > 2;\n const shouldShowRightDots = rightSiblingIndex < totalPages - 1;\n\n const firstPageIndex = 1;\n const lastPageIndex = totalPages;\n\n // No mostrar dots a la izquierda\n if (!shouldShowLeftDots && shouldShowRightDots) {\n const leftItemCount = 3 + 2 * siblingCount;\n const leftRange = Array.from({ length: leftItemCount }, (_, i) => i + 1);\n return [...leftRange, '...', totalPages];\n }\n\n // No mostrar dots a la derecha\n if (shouldShowLeftDots && !shouldShowRightDots) {\n const rightItemCount = 3 + 2 * siblingCount;\n const rightRange = Array.from(\n { length: rightItemCount },\n (_, i) => totalPages - rightItemCount + i + 1\n );\n return [firstPageIndex, '...', ...rightRange];\n }\n\n // Mostrar ambos dots\n if (shouldShowLeftDots && shouldShowRightDots) {\n const middleRange = Array.from(\n { length: rightSiblingIndex - leftSiblingIndex + 1 },\n (_, i) => leftSiblingIndex + i\n );\n return [firstPageIndex, '...', ...middleRange, '...', lastPageIndex];\n }\n\n return [];\n }, [currentPage, totalPages, siblingCount]);\n\n /**\n * Handler para cambio de página\n */\n const handlePageChange = (page: number) => {\n if (page >= 1 && page <= totalPages && page !== currentPage) {\n onPageChange?.(page);\n }\n };\n\n /**\n * Componente interno: Botón de página\n */\n const PageButton: React.FC<PageButtonProps> = ({\n page,\n isActive = false,\n disabled = false,\n onClick,\n ariaLabel: buttonAriaLabel,\n }) => {\n const isDots = page === '...';\n\n // ===== CLASES BASE =====\n const baseClasses = `\n inline-flex\n items-center\n justify-center\n gap-3\n px-3\n py-2\n rounded-md\n font-bold\n text-sm\n whitespace-nowrap\n transition-all\n duration-150\n `;\n\n // ===== CLASES DE ESTADO =====\n const stateClasses = isDots\n ? `\n text-primary-custom-600\n dark:text-primary-custom-600\n cursor-default\n pointer-events-none\n `\n : isActive\n ? `\n bg-primary-custom-100\n text-primary-custom-600\n dark:bg-primary-custom-100\n dark:text-primary-custom-600\n `\n : `\n text-primary-custom-600\n hover:bg-primary-custom-100\n active:scale-95\n dark:text-primary-custom-600\n dark:hover:bg-primary-custom-100\n dark:active:scale-95\n `;\n\n // ===== CLASES DE DISABLED =====\n const disabledClasses = disabled\n ? `\n opacity-50\n cursor-not-allowed\n pointer-events-none\n `\n : '';\n\n // ===== COMBINAR CLASES =====\n const buttonClasses = [baseClasses, stateClasses, disabledClasses]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type=\"button\"\n className={buttonClasses}\n onClick={onClick}\n disabled={disabled || isDots}\n aria-label={buttonAriaLabel}\n aria-current={isActive ? 'page' : undefined}\n >\n {page}\n </button>\n );\n };\n\n // ===== CLASES DEL CONTAINER =====\n const containerClasses = `\n inline-flex\n items-center\n justify-between\n gap-0\n ${className}\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <nav className={containerClasses} aria-label={ariaLabel} role=\"navigation\">\n {/* ===== BOTÓN BACK ===== */}\n {showBackButton && (\n <button\n type=\"button\"\n className={`\n inline-flex\n items-center\n justify-center\n gap-3\n px-3\n py-2\n rounded-md\n font-bold\n text-sm\n text-primary-custom-600\n hover:bg-primary-custom-100\n active:scale-95\n dark:text-primary-custom-600\n dark:hover:bg-primary-custom-100\n dark:active:scale-95\n transition-all\n duration-150\n ${currentPage === 1 ? 'opacity-50 cursor-not-allowed pointer-events-none' : ''}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n onClick={() => handlePageChange(currentPage - 1)}\n disabled={currentPage === 1}\n aria-label={`${backText} page`}\n >\n <ArrowLeftIcon className=\"w-4 h-4\" />\n {backText}\n </button>\n )}\n\n {/* ===== NÚMEROS DE PÁGINA ===== */}\n <div className=\"inline-flex items-center\">\n {paginationRange.map((page, index) => (\n <PageButton\n key={`${page}-${index}`}\n page={page}\n isActive={page === currentPage}\n onClick={() => typeof page === 'number' && handlePageChange(page)}\n ariaLabel={\n typeof page === 'number' ? `Go to page ${page}` : `Page ${page}`\n }\n />\n ))}\n </div>\n\n {/* ===== BOTÓN NEXT ===== */}\n {showNextButton && (\n <button\n type=\"button\"\n className={`\n inline-flex\n items-center\n justify-center\n gap-3\n px-3\n py-2\n rounded-md\n font-bold\n text-sm\n text-primary-custom-600\n hover:bg-primary-custom-100\n active:scale-95\n dark:text-primary-custom-600\n dark:hover:bg-primary-custom-100\n dark:active:scale-95\n transition-all\n duration-150\n ${\n currentPage === totalPages\n ? 'opacity-50 cursor-not-allowed pointer-events-none'\n : ''\n }\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n onClick={() => handlePageChange(currentPage + 1)}\n disabled={currentPage === totalPages}\n aria-label={`${nextText} page`}\n >\n {nextText}\n <ArrowRightIcon className=\"w-4 h-4\" />\n </button>\n )}\n </nav>\n );\n};\n","import React from 'react';\n\n/**\n * Icono ChevronUpDown para el trigger del Select\n * Heroicons Micro (16x16px)\n */\nexport const ChevronUpDownIcon: React.FC<{ className?: string }> = ({ className = '' }) => {\n return (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M5.22 10.22a.75.75 0 0 1 1.06 0L8 11.94l1.72-1.72a.75.75 0 1 1 1.06 1.06l-2.25 2.25a.75.75 0 0 1-1.06 0l-2.25-2.25a.75.75 0 0 1 0-1.06ZM10.78 5.78a.75.75 0 0 1-1.06 0L8 4.06 6.28 5.78a.75.75 0 0 1-1.06-1.06l2.25-2.25a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1 0 1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n};\n\n/**\n * Icono Check para los items seleccionados del menu\n * Heroicons Micro (16x16px)\n */\nexport const CheckIcon: React.FC<{ className?: string }> = ({ className = '' }) => {\n return (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n};\n","import React, { useState, useRef, useEffect } from 'react';\nimport type { SelectProps, SelectOption } from './Select.types';\nimport { ChevronUpDownIcon, CheckIcon } from './icons';\n\n/**\n * Select - Componente de selección (dropdown) del sistema de diseño Siesa\n *\n * Componente Select personalizado con menú desplegable para seleccionar opciones\n * de una lista. Incluye navegación por teclado, click outside y dark mode completo.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels y keyboard navigation\n * - Click outside para cerrar el menú\n * - Soporte de teclado (Enter, Escape, Arrow Up/Down)\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Select\n * options={[\n * { value: '1', label: 'Option 1' },\n * { value: '2', label: 'Option 2' },\n * ]}\n * value={selectedValue}\n * onChange={setSelectedValue}\n * placeholder=\"Select an option\"\n * label=\"Choose one\"\n * />\n * ```\n */\nexport const Select: React.FC<SelectProps> = ({\n options = [],\n value,\n defaultValue,\n placeholder = 'Seleccionar...',\n disabled = false,\n error = false,\n label,\n description,\n showLabel = true,\n showDescription = true,\n menuHeader,\n onChange,\n className = '',\n triggerClassName = '',\n menuClassName = '',\n ariaLabel,\n id,\n name,\n required = false,\n menuPosition = 'bottom',\n fullWidth = false,\n}) => {\n // ===== ESTADO Y REFS =====\n const [isOpen, setIsOpen] = useState(false);\n const [selectedValue, setSelectedValue] = useState<string | number | undefined>(\n value !== undefined ? value : defaultValue\n );\n const [focusedIndex, setFocusedIndex] = useState(-1);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n\n // ===== SINCRONIZAR VALOR CONTROLADO =====\n useEffect(() => {\n if (value !== undefined) {\n setSelectedValue(value);\n }\n }, [value]);\n\n // ===== CERRAR AL HACER CLICK FUERA =====\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setIsOpen(false);\n }\n };\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }\n }, [isOpen]);\n\n // ===== KEYBOARD NAVIGATION =====\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (!isOpen) return;\n\n switch (event.key) {\n case 'Escape':\n setIsOpen(false);\n triggerRef.current?.focus();\n break;\n case 'ArrowDown':\n event.preventDefault();\n setFocusedIndex((prev) => (prev < options.length - 1 ? prev + 1 : 0));\n break;\n case 'ArrowUp':\n event.preventDefault();\n setFocusedIndex((prev) => (prev > 0 ? prev - 1 : options.length - 1));\n break;\n case 'Enter':\n event.preventDefault();\n if (focusedIndex >= 0 && focusedIndex < options.length) {\n handleSelect(options[focusedIndex]);\n }\n break;\n }\n };\n\n if (isOpen) {\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [isOpen, focusedIndex, options]);\n\n // ===== HELPERS =====\n const selectedOption = options.find((opt) => opt.value === selectedValue);\n\n const toggleMenu = () => {\n if (!disabled) {\n setIsOpen(!isOpen);\n setFocusedIndex(-1);\n }\n };\n\n const handleSelect = (option: SelectOption) => {\n if (option.disabled) return;\n\n setSelectedValue(option.value);\n setIsOpen(false);\n onChange?.(option.value);\n\n setTimeout(() => {\n triggerRef.current?.focus();\n }, 0);\n };\n\n // ===== CLASES BASE DEL TRIGGER =====\n // Usando el sistema tipográfico Paragraph Regular (14px = text-sm)\n // Border radius rounded-lg (8px) consistente con especificaciones\n // Gap de 12px (gap-3) entre texto e icono según Figma\n const baseTriggerClasses = `\n inline-flex\n items-center\n justify-between\n gap-3\n w-full\n px-3\n py-2\n text-sm\n font-normal\n leading-5\n rounded-lg\n border\n transition-all\n duration-150\n `;\n\n // ===== CLASES DE WIDTH =====\n const widthClasses = fullWidth ? 'w-full' : 'min-w-[200px]';\n\n // ===== CLASES PARA ESTADOS DEL TRIGGER =====\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n const triggerStateClasses = error\n ? `\n border-error-border\n bg-error-bg\n text-content-primary\n dark:border-error-border\n dark:bg-error-bg\n dark:text-dark-content-primary\n `\n : `\n bg-bg-primary\n border-border-primary\n text-content-primary\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n dark:text-dark-content-primary\n `;\n\n // ===== CLASES PARA HOVER DEL TRIGGER =====\n // Hover overlay rgba(0,0,0,0.024) según Figma\n const triggerHoverClasses =\n !disabled && !error\n ? `\n hover:bg-[rgba(255,255,255,1)]\n hover:bg-[linear-gradient(90deg,rgba(0,0,0,0.024)_0%,rgba(0,0,0,0.024)_100%)]\n dark:hover:bg-[rgba(17,45,87,1)]\n dark:hover:bg-[linear-gradient(90deg,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0.1)_100%)]\n `\n : '';\n\n // ===== CLASES PARA FOCUS DEL TRIGGER =====\n // Focus rings adaptativos siguiendo el patrón de otros componentes\n const triggerFocusClasses = !disabled\n ? `\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n `\n : '';\n\n // ===== CLASES PARA DISABLED DEL TRIGGER =====\n const triggerDisabledClasses = disabled\n ? `\n opacity-50\n cursor-not-allowed\n `\n : '';\n\n // ===== COMBINAR CLASES DEL TRIGGER =====\n const finalTriggerClasses = [\n baseTriggerClasses,\n widthClasses,\n triggerStateClasses,\n triggerHoverClasses,\n triggerFocusClasses,\n triggerDisabledClasses,\n triggerClassName,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES BASE DEL MENU =====\n // Según Figma: altura fija 160px (h-40), sin borde visible (border-0),\n // spacing de 4px desde trigger (mt-1), sin shadow prominente\n const baseMenuClasses = `\n absolute\n z-50\n w-full\n min-w-[200px]\n max-h-40\n overflow-y-auto\n p-1\n rounded-md\n border-0\n transition-all\n duration-150\n `;\n\n // ===== CLASES DE POSICIÓN DEL MENU =====\n // Figma muestra 4px de separación, usando mt-1 en lugar de mt-2\n const menuPositionClasses = menuPosition === 'top' ? 'bottom-full mb-1' : 'top-full mt-1';\n\n // ===== CLASES DE COLOR DEL MENU =====\n // Background secundario según Figma, sin borde prominente\n const menuColorClasses = `\n bg-background-secondary\n dark:bg-dark-bg-primary\n `;\n\n // ===== CLASES DE VISIBILIDAD DEL MENU =====\n const menuVisibilityClasses = isOpen ? 'opacity-100 visible' : 'opacity-0 invisible';\n\n // ===== COMBINAR CLASES DEL MENU =====\n const finalMenuClasses = [\n baseMenuClasses,\n menuPositionClasses,\n menuColorClasses,\n menuVisibilityClasses,\n menuClassName,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES BASE DEL MENU ITEM =====\n // CRÍTICO: Figma especifica text-[10px] leading-[12px] (Label XXSmall)\n // NO usar text-xs que es 12px - debe ser exactamente 10px según diseño\n const baseMenuItemClasses = `\n flex\n items-center\n cursor-pointer\n rounded-md\n transition-all\n duration-150\n pl-2\n pr-2.5\n py-0.5\n gap-0.5\n text-[10px]\n leading-[12px]\n font-bold\n `;\n\n // ===== FUNCIÓN PARA OBTENER CLASES DE MENU ITEM =====\n const getMenuItemClasses = (option: SelectOption, index: number) => {\n const isSelected = option.value === selectedValue;\n const isFocused = index === focusedIndex;\n\n // Estados de color\n const colorClasses =\n isSelected && !isFocused\n ? 'text-content-primary dark:text-dark-content-primary'\n : isFocused || (isSelected && isFocused)\n ? 'bg-primary-custom-600 text-primary-inverse-content dark:bg-primary-custom-600 dark:text-primary-inverse-content'\n : 'text-content-primary dark:text-dark-content-primary';\n\n // Hover\n const hoverClasses = !option.disabled\n ? 'hover:bg-primary-custom-600 hover:text-primary-inverse-content dark:hover:bg-primary-custom-600 dark:hover:text-primary-inverse-content'\n : '';\n\n // Disabled\n const disabledClasses = option.disabled ? 'opacity-50 cursor-not-allowed' : '';\n\n return [baseMenuItemClasses, colorClasses, hoverClasses, disabledClasses]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n };\n\n // ===== CLASES DEL ICONO DEL TRIGGER =====\n const iconClasses = [\n 'shrink-0',\n 'w-4',\n 'h-4',\n 'transition-transform',\n 'duration-150',\n isOpen && 'rotate-180',\n disabled ? 'text-content-tertiary dark:text-content-tertiary' : 'text-content-secondary dark:text-content-secondary',\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL CHECK ICON =====\n const checkIconClasses = 'shrink-0 w-4 h-4';\n\n // ===== RENDERIZAR COMPONENTE =====\n return (\n <div className={`relative ${fullWidth ? 'w-full' : ''} ${className}`} ref={containerRef}>\n {/* Label and Description - Según Figma, van ANTES del trigger con gap-1 (4px) */}\n {(showLabel && label) || (showDescription && description) ? (\n <div className=\"flex flex-col gap-1 mb-1 w-full\">\n {/* Label - Label Small (14px bold) */}\n {showLabel && label && (\n <label\n htmlFor={id}\n className=\"text-sm font-bold leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n {label}\n {required && <span className=\"ml-1 text-error-content\">*</span>}\n </label>\n )}\n\n {/* Description - Paragraph Small (14px regular) */}\n {showDescription && description && (\n <p className=\"text-sm font-normal leading-5 text-content-tertiary dark:text-content-tertiary\">\n {description}\n </p>\n )}\n </div>\n ) : null}\n\n {/* Trigger Button */}\n <button\n ref={triggerRef}\n type=\"button\"\n className={finalTriggerClasses}\n onClick={toggleMenu}\n disabled={disabled}\n aria-label={ariaLabel || label}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen}\n id={id}\n >\n {/* Selected value or placeholder */}\n <span\n className={\n selectedOption ? '' : 'text-content-secondary dark:text-content-secondary'\n }\n >\n {selectedOption ? selectedOption.label : placeholder}\n </span>\n\n {/* Chevron icon */}\n <ChevronUpDownIcon className={iconClasses} />\n </button>\n\n {/* Hidden input for forms */}\n {name && (\n <input\n type=\"hidden\"\n name={name}\n value={selectedValue !== undefined ? String(selectedValue) : ''}\n />\n )}\n\n {/* Menu */}\n {isOpen && (\n <div ref={menuRef} className={finalMenuClasses} role=\"listbox\">\n {/* Menu Header - Opcional según Figma */}\n {menuHeader && (\n <div className=\"flex items-center gap-0.5 px-6 py-0.5 rounded-[5px]\">\n <span className=\"text-[10px] font-bold leading-[12px] text-content-tertiary dark:text-content-tertiary\">\n {menuHeader}\n </span>\n </div>\n )}\n\n {/* Empty state */}\n {options.length === 0 && (\n <div className=\"px-2 py-1.5 text-[10px] leading-[12px] text-content-secondary dark:text-content-secondary\">\n No hay opciones disponibles\n </div>\n )}\n\n {/* Options */}\n {options.map((option, index) => (\n <div\n key={option.value}\n className={getMenuItemClasses(option, index)}\n onClick={() => handleSelect(option)}\n onMouseEnter={() => setFocusedIndex(index)}\n role=\"option\"\n aria-selected={option.value === selectedValue}\n aria-disabled={option.disabled}\n >\n {/* Check icon for selected item */}\n <div className=\"w-4 flex items-center justify-center\">\n {option.value === selectedValue && <CheckIcon className={checkIconClasses} />}\n </div>\n\n {/* Custom icon if provided */}\n {option.icon && <span className=\"shrink-0 w-4 h-4\">{option.icon}</span>}\n\n {/* Label */}\n <span className=\"flex-1 text-left\">{option.label}</span>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport type {\n TableProps,\n TableHeaderProps,\n TableCellProps,\n SortDirection,\n PaginationProps,\n} from './Table.types';\n\n/**\n * Iconos para sort\n */\nconst ChevronUpIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"transition-transform\"\n >\n <path\n d=\"M12 10L8 6L4 10\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nconst ChevronDownIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"transition-transform\"\n >\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * Iconos para paginación\n */\nconst ArrowLeftIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14 8H2M2 8L6.5 3.5M2 8L6.5 12.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nconst ArrowRightIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 8H14M14 8L9.5 3.5M14 8L9.5 12.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * TableHeader - Componente para el header de una columna\n */\nconst TableHeader = <T,>({\n column,\n sortable,\n sorted,\n sortDirection,\n onSort,\n}: TableHeaderProps<T>) => {\n // Clases base del header\n const baseClasses = `\n flex\n items-center\n gap-3\n px-6\n py-2.5\n min-h-[40px]\n border-b\n border-border-primary\n dark:border-dark-border-primary\n transition-colors\n duration-150\n `;\n\n // Clases según sortable\n const sortableClasses = sortable\n ? `\n cursor-pointer\n hover:bg-background-secondary\n dark:hover:bg-dark-bg-primary/50\n select-none\n `\n : '';\n\n // Clases de alineación\n const alignClasses = {\n left: 'justify-start',\n center: 'justify-center',\n right: 'justify-end',\n };\n\n const combinedClasses = [baseClasses, sortableClasses, alignClasses[column.align || 'left']]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div\n className={combinedClasses}\n onClick={sortable ? onSort : undefined}\n role={sortable ? 'button' : undefined}\n tabIndex={sortable ? 0 : undefined}\n onKeyDown={\n sortable\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onSort();\n }\n }\n : undefined\n }\n style={{ width: column.width }}\n >\n {/* Texto del header */}\n <span\n className=\"\n text-sm\n font-bold\n text-content-secondary\n dark:text-content-secondary\n text-ellipsis\n overflow-hidden\n whitespace-nowrap\n \"\n >\n {column.header}\n </span>\n\n {/* Iconos de sort */}\n {sortable && (\n <span className=\"shrink-0 text-content-secondary dark:text-content-secondary\">\n {sorted && sortDirection === 'asc' && <ChevronUpIcon />}\n {sorted && sortDirection === 'desc' && <ChevronDownIcon />}\n {!sorted && (\n <div className=\"w-4 h-4\" />\n )}\n </span>\n )}\n </div>\n );\n};\n\n/**\n * TableCell - Componente para una celda de datos\n */\nconst TableCell: React.FC<TableCellProps & { isStriped?: boolean; rowIndex?: number }> = ({\n children,\n align = 'left',\n width,\n isStriped = false,\n rowIndex = 0,\n}) => {\n // Clases de alineación\n const alignClasses = {\n left: 'justify-start text-left',\n center: 'justify-center text-center',\n right: 'justify-end text-right',\n };\n\n // Fondo zebra striping (filas pares tienen fondo)\n const stripedBg = isStriped && rowIndex % 2 === 1\n ? 'bg-background-secondary dark:bg-dark-bg-primary/30'\n : '';\n\n return (\n <div\n className={`\n flex\n flex-col\n ${alignClasses[align]}\n px-6\n py-4\n min-h-[56px]\n border-b\n border-border-secondary\n dark:border-dark-border-primary\n ${stripedBg}\n `}\n style={{ width }}\n >\n <span\n className=\"\n text-sm\n text-content-primary\n dark:text-dark-content-primary\n text-ellipsis\n overflow-hidden\n w-full\n \"\n >\n {children}\n </span>\n </div>\n );\n};\n\n\n/**\n * Pagination - Componente de paginación\n */\nconst Pagination: React.FC<PaginationProps> = ({\n currentPage,\n totalPages,\n onPageChange,\n previousLabel = 'Anterior',\n nextLabel = 'Siguiente',\n}) => {\n // Generar array de números de página para mostrar\n const getPageNumbers = () => {\n const pages: (number | string)[] = [];\n const maxVisible = 7; // Máximo de botones visibles\n\n if (totalPages <= maxVisible) {\n // Si hay pocas páginas, mostrar todas\n for (let i = 1; i <= totalPages; i++) {\n pages.push(i);\n }\n } else {\n // Lógica para mostrar: 1 2 3 ... 65 66\n pages.push(1);\n\n if (currentPage <= 3) {\n pages.push(2, 3);\n } else if (currentPage >= totalPages - 2) {\n pages.push('...');\n pages.push(totalPages - 2, totalPages - 1);\n } else {\n pages.push('...');\n pages.push(currentPage);\n pages.push('...');\n }\n\n if (totalPages > 1) {\n pages.push(totalPages);\n }\n }\n\n return pages;\n };\n\n const pageNumbers = getPageNumbers();\n\n return (\n <div className=\"flex items-center justify-between w-full h-9\">\n {/* Botón Anterior */}\n <button\n onClick={() => currentPage > 1 && onPageChange(currentPage - 1)}\n disabled={currentPage === 1}\n className=\"\n flex\n items-center\n gap-3\n px-3\n py-2\n rounded-md\n text-sm\n font-bold\n text-primary-custom-600\n dark:text-primary-custom-600\n hover:bg-blue-50\n dark:hover:bg-blue-900/20\n disabled:opacity-50\n disabled:cursor-not-allowed\n transition-colors\n duration-150\n \"\n >\n <ArrowLeftIcon />\n <span>{previousLabel}</span>\n </button>\n\n {/* Números de página */}\n <div className=\"flex items-center gap-0\">\n {pageNumbers.map((page, index) => {\n if (page === '...') {\n return (\n <div\n key={`ellipsis-${index}`}\n className=\"\n flex\n items-center\n justify-center\n px-3\n py-2\n text-sm\n font-bold\n text-primary-custom-600\n dark:text-primary-custom-600\n \"\n >\n {page}\n </div>\n );\n }\n\n const isActive = page === currentPage;\n\n return (\n <button\n key={page}\n onClick={() => onPageChange(page as number)}\n className={`\n flex\n items-center\n justify-center\n px-3\n py-2\n rounded-md\n text-sm\n font-bold\n text-primary-custom-600\n dark:text-primary-custom-600\n transition-colors\n duration-150\n ${\n isActive\n ? 'bg-blue-100 dark:bg-blue-900/30'\n : 'hover:bg-blue-50 dark:hover:bg-blue-900/20'\n }\n `}\n >\n {page}\n </button>\n );\n })}\n </div>\n\n {/* Botón Siguiente */}\n <button\n onClick={() => currentPage < totalPages && onPageChange(currentPage + 1)}\n disabled={currentPage === totalPages}\n className=\"\n flex\n items-center\n gap-3\n px-3\n py-2\n rounded-md\n text-sm\n font-bold\n text-primary-custom-600\n dark:text-primary-custom-600\n hover:bg-blue-50\n dark:hover:bg-blue-900/20\n disabled:opacity-50\n disabled:cursor-not-allowed\n transition-colors\n duration-150\n \"\n >\n <span>{nextLabel}</span>\n <ArrowRightIcon />\n </button>\n </div>\n );\n};\n\n/**\n * Table - Componente principal de tabla\n *\n * Características implementadas:\n * - Definición de columnas flexible con accessor y render custom\n * - Sorting en columnas (controlado o no controlado)\n * - Variantes: basic, fullWidth, striped, grid\n * - Dark mode completo en todos los estados\n * - Estados de loading y empty\n * - Filas clickeables\n * - Accesibilidad con roles y keyboard navigation\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto y generics\n * - Accesibilidad con ARIA labels y keyboard support\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label/Small para headers, Paragraph/Small para cells)\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n *\n * @example\n * ```tsx\n * // Uso básico\n * <Table\n * title=\"Usuarios\"\n * columns={[\n * { header: 'Nombre', accessor: 'name' },\n * { header: 'Email', accessor: 'email' },\n * { header: 'Rol', accessor: 'role', sortable: true },\n * ]}\n * data={users}\n * />\n *\n * // Con render custom\n * <Table\n * columns={[\n * {\n * header: 'Estado',\n * accessor: 'status',\n * render: (value) => (\n * <Badge color={value === 'active' ? 'green' : 'red'}>\n * {value}\n * </Badge>\n * ),\n * },\n * ]}\n * data={data}\n * />\n *\n * // Variante striped\n * <Table\n * variant=\"striped\"\n * columns={columns}\n * data={data}\n * />\n * ```\n */\nexport const Table = <T extends Record<string, any>>({\n title,\n columns,\n data,\n variant = 'basic',\n showBorder = true,\n showShadow = true,\n // onRowClick, // TODO: Implement row click functionality\n onSort,\n sortColumn: externalSortColumn,\n sortDirection: externalSortDirection,\n fullWidth = false,\n emptyMessage = 'No hay datos disponibles',\n loading = false,\n loadingRows = 5,\n pagination,\n className = '',\n id,\n}: TableProps<T>) => {\n // ===== ESTADO INTERNO DE SORT =====\n const [internalSortColumn, setInternalSortColumn] = useState<keyof T | string | null>(null);\n const [internalSortDirection, setInternalSortDirection] = useState<SortDirection>(null);\n\n // Usar sort externo si está controlado, sino usar interno\n const sortColumn = externalSortColumn !== undefined ? externalSortColumn : internalSortColumn;\n const sortDirection = externalSortDirection !== undefined ? externalSortDirection : internalSortDirection;\n\n // ===== MANEJAR SORT =====\n const handleSort = (columnAccessor: keyof T | string) => {\n let newDirection: SortDirection = 'asc';\n\n // Si ya está ordenado por esta columna, cambiar dirección\n if (sortColumn === columnAccessor) {\n if (sortDirection === 'asc') {\n newDirection = 'desc';\n } else if (sortDirection === 'desc') {\n newDirection = null;\n }\n }\n\n // Si sort es controlado, llamar callback\n if (onSort) {\n onSort(columnAccessor, newDirection);\n } else {\n // Sino, actualizar estado interno\n setInternalSortColumn(newDirection ? columnAccessor : null);\n setInternalSortDirection(newDirection);\n }\n };\n\n // ===== OBTENER VALOR DE CELDA =====\n const getCellValue = (row: T, accessor: keyof T | ((row: T) => any)) => {\n if (typeof accessor === 'function') {\n return accessor(row);\n }\n return row[accessor];\n };\n\n // ===== CLASES DEL CONTAINER =====\n const containerBaseClasses = `\n flex\n flex-col\n gap-4\n bg-white\n dark:bg-dark-bg-primary\n rounded-xl\n transition-all\n duration-150\n `;\n\n const containerBorderClasses = showBorder\n ? 'border border-border-primary dark:border-dark-border-primary'\n : '';\n\n const containerShadowClasses = showShadow ? 'shadow-base' : '';\n\n const containerPaddingClasses = 'p-8';\n\n const containerWidthClasses = fullWidth || variant === 'fullWidth' ? 'w-full' : '';\n\n const containerClasses = [\n containerBaseClasses,\n containerBorderClasses,\n containerShadowClasses,\n containerPaddingClasses,\n containerWidthClasses,\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DE LA TABLA =====\n const tableGridClasses = variant === 'grid'\n ? `\n border\n border-border-primary\n dark:border-dark-border-primary\n rounded-lg\n overflow-hidden\n `\n : '';\n\n // ===== RENDER =====\n return (\n <div className={containerClasses} id={id}>\n {/* Título opcional */}\n {title && (\n <div className=\"flex items-center justify-center w-full\">\n <h3\n className=\"\n text-base\n font-bold\n text-content-primary\n dark:text-dark-content-primary\n text-ellipsis\n overflow-hidden\n whitespace-nowrap\n \"\n >\n {title}\n </h3>\n </div>\n )}\n\n {/* Tabla */}\n <div className={`flex w-full overflow-x-auto ${tableGridClasses}`}>\n {/* Columnas */}\n {columns.map((column, colIndex) => {\n const accessor = typeof column.accessor === 'function'\n ? `column_${colIndex}`\n : String(column.accessor);\n\n return (\n <div key={accessor} className=\"flex flex-col flex-1 min-w-0\">\n {/* Header de la columna */}\n <TableHeader\n column={column}\n sortable={column.sortable || false}\n sorted={sortColumn === accessor}\n sortDirection={sortColumn === accessor ? sortDirection : null}\n onSort={() => handleSort(accessor)}\n />\n\n {/* Loading skeleton */}\n {loading && (\n <>\n {Array.from({ length: loadingRows }).map((_, rowIndex) => (\n <TableCell\n key={`loading-${rowIndex}`}\n align={column.align}\n width={column.width}\n isStriped={variant === 'striped'}\n rowIndex={rowIndex}\n >\n <div\n className=\"\n h-4\n bg-background-secondary\n dark:bg-dark-border-primary\n rounded\n animate-pulse\n \"\n />\n </TableCell>\n ))}\n </>\n )}\n\n {/* Datos reales */}\n {!loading && data.length > 0 && (\n <>\n {data.map((row, rowIndex) => {\n const value = getCellValue(row, column.accessor);\n const content = column.render\n ? column.render(value, row, rowIndex)\n : value;\n\n return (\n <TableCell\n key={rowIndex}\n align={column.align}\n width={column.width}\n isStriped={variant === 'striped'}\n rowIndex={rowIndex}\n >\n {content}\n </TableCell>\n );\n })}\n </>\n )}\n\n {/* Estado empty */}\n {!loading && data.length === 0 && colIndex === 0 && (\n <div\n className=\"\n flex\n items-center\n justify-center\n px-6\n py-12\n text-sm\n text-content-secondary\n dark:text-content-secondary\n \"\n style={{ gridColumn: `1 / ${columns.length + 1}` }}\n >\n {emptyMessage}\n </div>\n )}\n </div>\n );\n })}\n </div>\n\n {/* Paginación */}\n {pagination && (\n <Pagination\n currentPage={pagination.currentPage}\n totalPages={pagination.totalPages}\n onPageChange={pagination.onPageChange}\n previousLabel={pagination.previousLabel}\n nextLabel={pagination.nextLabel}\n />\n )}\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport type { TabProps, TabsProps } from './Tabs.types';\n\n/**\n * Componente Tab individual del sistema de diseño Siesa\n *\n * Representa un único tab dentro de un grupo de tabs. Incluye soporte para:\n * - Estado activo/inactivo con indicador visual (línea inferior)\n * - Icono opcional a la izquierda del texto\n * - Badge de notificación con contador\n * - Estados hover, focus y disabled\n * - Dark mode completo\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Tab\n * label=\"Inicio\"\n * active={true}\n * icon={<HomeIcon />}\n * badge={3}\n * onClick={() => setActiveTab('home')}\n * />\n * ```\n */\nexport const Tab: React.FC<TabProps> = ({\n label,\n active = false,\n icon,\n badge,\n disabled = false,\n onClick,\n className = '',\n ariaLabel,\n}) => {\n // ===== CLASES BASE DEL BOTÓN =====\n // El contenedor es relativo para posicionar el indicador absoluto\n const baseClasses = `\n relative\n flex\n flex-col\n items-center\n cursor-pointer\n outline-hidden\n transition-all\n duration-150\n p-0\n border-0\n bg-transparent\n `;\n\n // ===== CLASES DE FOCUS =====\n // El focus outline se desactiva aquí, el shadow se aplica al Content div\n const focusClasses = '';\n\n // ===== CLASES DE DISABLED =====\n const disabledClasses = disabled\n ? 'opacity-50 cursor-not-allowed pointer-events-none'\n : '';\n\n // ===== CLASES DEL CONTENIDO INTERIOR =====\n // El hover y focus background se aplica aquí\n const contentBaseClasses = `\n flex\n items-center\n justify-center\n gap-1\n p-2\n rounded-lg\n overflow-hidden\n transition-all\n duration-150\n w-full\n `;\n\n // ===== CLASES DE ESTADO HOVER Y FOCUS PARA CONTENIDO =====\n // Light: bg-[rgba(0,0,0,0.03)], Dark: bg-white/5\n // Según Figma, tanto hover como focus tienen el background overlay\n // El shadow de focus también se aplica aquí (al Content div), no al botón\n const contentStateClasses = disabled\n ? ''\n : `\n group-hover:bg-[rgba(0,0,0,0.03)]\n group-focus-visible:bg-[rgba(0,0,0,0.03)]\n group-focus-visible:shadow-[0px_0px_0px_2px_#dbeefe,0px_1px_2px_0px_rgba(0,0,0,0.05),0px_0px_0px_4px_#60b6fa]\n dark:group-hover:bg-white/5\n dark:group-focus-visible:bg-white/5\n dark:group-focus-visible:shadow-[0px_0px_0px_2px_#1e3a5f,0px_1px_2px_0px_rgba(0,0,0,0.05),0px_0px_0px_4px_#0f6ae3]\n `;\n\n // ===== CLASES DE TEXTO =====\n // Activo: primary-custom-600 (#0e79fd), Inactivo: content-primary (#18181b)\n const textClasses = active\n ? `\n text-primary-custom-600\n dark:text-primary-custom-600\n `\n : `\n text-content-primary\n dark:text-dark-content-primary\n `;\n\n // ===== CLASES DE ICONO =====\n // El icono hereda el color del texto\n const iconClasses = `\n w-3\n h-3\n shrink-0\n `;\n\n // ===== CLASES DEL BADGE =====\n // Activo: bg-primary-custom-600 (#0e79fd), Inactivo: bg-content-primary (#18181b)\n const badgeClasses = active\n ? `\n bg-primary-custom-600\n dark:bg-primary-custom-600\n `\n : `\n bg-content-primary\n dark:bg-dark-content-primary\n `;\n\n // ===== CLASES DEL INDICADOR INFERIOR =====\n // Solo visible cuando está activo, 2px de alto, rounded-full\n // Posicionado al fondo del contenedor de Tabs (alineado con el border)\n const indicatorClasses = active\n ? `\n absolute\n -bottom-2.5\n left-0\n right-0\n h-0.5\n rounded-full\n bg-primary-custom-600\n dark:bg-primary-custom-600\n z-10\n `\n : 'hidden';\n\n // ===== COMBINAR CLASES DEL BOTÓN =====\n const finalClasses = [\n baseClasses,\n focusClasses,\n disabledClasses,\n 'group', // Para usar group-hover y group-focus-visible\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== COMBINAR CLASES DEL CONTENIDO =====\n const contentFinalClasses = [\n contentBaseClasses,\n contentStateClasses,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={active}\n aria-disabled={disabled}\n aria-label={ariaLabel || label}\n tabIndex={disabled ? -1 : 0}\n className={finalClasses}\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n >\n {/* Contenido del Tab */}\n <div className={contentFinalClasses}>\n {/* Icono (opcional) */}\n {icon && (\n <span className={`${iconClasses} ${textClasses}`.trim()}>\n {icon}\n </span>\n )}\n\n {/* Texto */}\n <span\n className={`\n text-sm\n font-bold\n leading-5\n whitespace-nowrap\n ${textClasses}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {label}\n </span>\n\n {/* Badge de notificación (opcional) */}\n {badge !== undefined && badge > 0 && (\n <span\n className={`\n flex\n items-center\n justify-center\n h-3\n min-w-[12px]\n px-0.5\n rounded-xs\n text-xs\n font-normal\n leading-4\n text-primary-inverse-content\n dark:text-dark-bg-primary\n ${badgeClasses}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n aria-label={`${badge} notificaciones`}\n >\n {badge > 99 ? '99+' : badge}\n </span>\n )}\n </div>\n\n {/* Indicador inferior (línea activa) */}\n <div className={indicatorClasses} />\n </button>\n );\n};\n\n/**\n * Componente Tabs contenedor del sistema de diseño Siesa\n *\n * Agrupa múltiples tabs permitiendo navegación entre diferentes secciones.\n * Soporta modo controlado (con activeId y onChange) y no controlado (con defaultActiveId).\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA roles y keyboard navigation\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Modo controlado\n * const [activeTab, setActiveTab] = useState('home');\n *\n * <Tabs\n * items={[\n * { id: 'home', label: 'Inicio', icon: <HomeIcon /> },\n * { id: 'profile', label: 'Perfil', badge: 3 },\n * { id: 'settings', label: 'Configuración' },\n * ]}\n * activeId={activeTab}\n * onChange={setActiveTab}\n * />\n *\n * // Modo no controlado\n * <Tabs\n * items={[...]}\n * defaultActiveId=\"home\"\n * />\n * ```\n */\nexport const Tabs: React.FC<TabsProps> = ({\n items,\n activeId,\n defaultActiveId,\n onChange,\n className = '',\n fullWidth = false,\n size = 'base',\n showBorder = true,\n}) => {\n // Estado interno para modo no controlado\n const [internalActiveId, setInternalActiveId] = useState(\n defaultActiveId || (items.length > 0 ? items[0].id : '')\n );\n\n // Determinar si es controlado o no controlado\n const isControlled = activeId !== undefined;\n const currentActiveId = isControlled ? activeId : internalActiveId;\n\n // Handler para cambio de tab\n const handleTabClick = (id: string) => {\n if (!isControlled) {\n setInternalActiveId(id);\n }\n onChange?.(id);\n };\n\n // ===== CLASES DE TAMAÑO =====\n const sizeClasses = {\n sm: 'gap-0',\n base: 'gap-1',\n lg: 'gap-2',\n };\n\n // ===== CLASES DEL CONTENEDOR =====\n // El padding-bottom (pb-2.5 = 10px) deja espacio para el indicador del tab activo\n // El border-b se dibuja debajo del padding, alineándose con el indicador\n const containerClasses = `\n flex\n items-end\n pb-2.5\n ${sizeClasses[size]}\n ${fullWidth ? 'w-full' : ''}\n ${showBorder ? 'border-b border-border-primary dark:border-dark-border-primary' : ''}\n `;\n\n // ===== CLASES FULL WIDTH PARA ITEMS =====\n const itemWidthClass = fullWidth ? 'flex-1' : '';\n\n const finalClasses = [\n containerClasses,\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div\n role=\"tablist\"\n aria-label=\"Pestañas de navegación\"\n className={finalClasses}\n >\n {items.map((item) => (\n <Tab\n key={item.id}\n label={item.label}\n active={currentActiveId === item.id}\n icon={item.icon}\n badge={item.badge}\n disabled={item.disabled}\n onClick={() => handleTabClick(item.id)}\n className={itemWidthClass}\n />\n ))}\n </div>\n );\n};\n","/**\n * Iconos para el componente Navbar\n * Basados en Heroicons Micro (16x16px)\n */\n\nexport const ShoppingCartIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path d=\"M1.75 1.002a.75.75 0 1 0 0 1.5h1.035l1.38 5.514a2.75 2.75 0 0 0 2.658 2.048h5.355a2.75 2.75 0 0 0 2.658-2.048l.9-3.597a.75.75 0 0 0-.728-.919H4.655l-.22-.88A.75.75 0 0 0 3.71 2H1.75ZM5 13a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM11.5 13a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z\" />\n </svg>\n);\n\nexport const BellIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12 5a4 4 0 0 0-8 0v2.379a1.5 1.5 0 0 1-.44 1.06L2.294 9.707a1 1 0 0 0-.293.707V11a1 1 0 0 0 1 1h2a3 3 0 1 0 6 0h2a1 1 0 0 0 1-1v-.586a1 1 0 0 0-.293-.707L12.44 8.44A1.5 1.5 0 0 1 12 7.38V5Zm-5.5 7a1.5 1.5 0 0 0 3 0h-3Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const MagnifyingGlassIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const ChevronDownIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const ExclamationTriangleIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M6.701 2.25c.577-1 2.02-1 2.598 0l5.196 9a1.5 1.5 0 0 1-1.299 2.25H2.804a1.5 1.5 0 0 1-1.3-2.25l5.197-9ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 1 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 7.25a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const NotificationDot = () => (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"4\" cy=\"4\" r=\"4\" fill=\"currentColor\" />\n </svg>\n);\n\nexport const ArrowLeftStartOnRectangleIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M14 4.75A2.75 2.75 0 0 0 11.25 2h-3A2.75 2.75 0 0 0 5.5 4.75v.5a.75.75 0 0 0 1.5 0v-.5c0-.69.56-1.25 1.25-1.25h3c.69 0 1.25.56 1.25 1.25v6.5c0 .69-.56 1.25-1.25 1.25h-3c-.69 0-1.25-.56-1.25-1.25v-.5a.75.75 0 0 0-1.5 0v.5A2.75 2.75 0 0 0 8.25 14h3A2.75 2.75 0 0 0 14 11.25v-6.5Zm-9.47.47a.75.75 0 0 0-1.06 0L1.22 7.47a.75.75 0 0 0 0 1.06l2.25 2.25a.75.75 0 1 0 1.06-1.06l-.97-.97h5.69a.75.75 0 0 0 0-1.5H3.56l.97-.97a.75.75 0 0 0 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { NavbarProps } from './Navbar.types';\nimport { Badge } from '../Badge/Badge';\nimport {\n ShoppingCartIcon,\n BellIcon,\n MagnifyingGlassIcon,\n ChevronDownIcon,\n ExclamationTriangleIcon,\n ArrowLeftStartOnRectangleIcon,\n} from './icons';\n\n/**\n * Componente Navbar del sistema de diseño Siesa\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * Barra de navegación principal con soporte completo para responsive y dark mode.\n * Incluye logo, nombre de producto, badge de ambiente, botones de acción y dropdown de usuario.\n *\n * **Variantes de dispositivo:**\n * - `responsive`: Se adapta automáticamente al viewport (por defecto)\n * - `desktop`: Versión completa (1360x64px) con todos los elementos\n * - `tablet`: Versión tablet (1024x64px) con elementos reducidos\n * - `mobile`: Versión simplificada (428x40px) con logo icono y avatar circular\n *\n * **Elementos incluidos:**\n * - Botón de navegación (solo desktop/tablet) - Usa shadow-button-inset\n * - Logo del negocio (solo desktop/tablet)\n * - Dividers verticales (solo desktop/tablet)\n * - Logo Siesa (completo en desktop/tablet, icono en mobile)\n * - Nombre del producto (solo desktop/tablet) - Heading/Tiny (20px Bold)\n * - Badge de ambiente con icono de advertencia (yellow)\n * - Botones de acción (search solo mobile, cart, notifications)\n * - Dropdown de usuario con avatar, nombre y email\n * - Logo Siesa trailing (solo desktop)\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación (NO colores hardcodeados)\n * - Focus rings adaptativos para light y dark mode\n * - Type safety con TypeScript estricto\n * - Responsive design con breakpoints md: y lg:\n * - Tipografía del sistema: Heading/Tiny, Paragraph/Small, Paragraph/Tiny\n * - Spacing del sistema (4px, 8px, 12px, 16px, 32px)\n *\n * @see docs/colors.md - Sistema de colores y tokens dark mode\n * @see docs/typography.md - Sistema tipográfico (Heading, Paragraph)\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras (button-inset)\n *\n * @example\n * ```tsx\n * <Navbar\n * productName=\"Mi Producto\"\n * environmentBadge=\"Ambiente de Pruebas\"\n * userDropdown={{\n * avatar: \"/path/to/avatar.jpg\",\n * name: \"Juan Pérez\",\n * email: \"juan@ejemplo.com\",\n * }}\n * notifications={{\n * cart: 99,\n * bell: true,\n * }}\n * onNavigationClick={() => router.back()}\n * onCartClick={() => openCart()}\n * onNotificationsClick={() => openNotifications()}\n * />\n * ```\n */\nexport const Navbar: React.FC<NavbarProps> = ({\n logo,\n productName = 'Nombre Producto',\n environmentBadge,\n userDropdown,\n actions,\n notifications,\n className = '',\n variant = 'responsive',\n hideActionButtons = false,\n leadingAction,\n siesaLogo,\n showBusinessLogo = false,\n showSiesaLogoLeading = true,\n showSiesaLogoTrailing = false,\n onNavigationClick,\n onSearchClick,\n onCartClick,\n onNotificationsClick,\n}) => {\n // ===== CLASES COMUNES PARA BOTONES DE ACCIÓN =====\n const actionButtonClasses = `\n box-border\n flex\n flex-col\n items-center\n justify-center\n p-1\n relative\n rounded-md\n shrink-0\n text-primary-custom-600\n hover:bg-background-secondary\n active:scale-95\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:text-primary-custom-600\n dark:hover:bg-dark-bg-secondary\n dark:active:scale-95\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n transition-all\n duration-150\n `;\n\n // ===== CLASES PARA BOTÓN DE NAVEGACIÓN PRIMARIO =====\n const navigationButtonClasses = `\n bg-primary-custom-600\n text-primary-inverse-content\n border\n border-primary-custom-600\n shadow-button-inset\n hover:bg-primary-custom-500\n active:scale-95\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:bg-dark-bg-inverse\n dark:text-dark-content-inverse\n dark:border-dark-bg-inverse\n dark:hover:bg-dark-bg-inverse/90\n dark:active:scale-95\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n box-border\n flex\n flex-col\n items-center\n justify-center\n p-3\n relative\n rounded-md\n shrink-0\n transition-all\n duration-150\n `;\n\n // ===== HELPER: Es mobile (variante o responsive en mobile breakpoint) =====\n const isMobile = variant === 'mobile';\n const isDesktop = variant === 'desktop';\n const isTablet = variant === 'tablet';\n const isResponsive = variant === 'responsive';\n\n // ===== BOTÓN DE NAVEGACIÓN =====\n const NavigationButton = () => {\n if (isMobile) return null;\n\n const buttonContent = (\n <div className=\"overflow-hidden relative shrink-0 w-4 h-4\">\n <ArrowLeftStartOnRectangleIcon />\n </div>\n );\n\n if (isDesktop || isTablet) {\n return (\n <button\n className={navigationButtonClasses}\n aria-label=\"Volver\"\n onClick={onNavigationClick}\n >\n {buttonContent}\n </button>\n );\n }\n\n // Responsive: Solo visible en md: y superiores\n return (\n <button\n className={`hidden md:flex ${navigationButtonClasses}`}\n aria-label=\"Volver\"\n onClick={onNavigationClick}\n >\n {buttonContent}\n </button>\n );\n };\n\n // ===== BUSINESS LOGO (Logo del cliente/producto) =====\n // Solo se muestra si showBusinessLogo es true\n const BusinessLogo = () => {\n if (isMobile || !showBusinessLogo) return null;\n\n const logoContent = (\n <img\n src=\"/,Business Logo.png\"\n alt=\"Business Logo\"\n className=\"w-full h-full object-contain\"\n />\n );\n\n if (isDesktop) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[168px] h-[30px]\">\n {logoContent}\n </div>\n );\n }\n\n if (isTablet) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[140px] h-[25px]\">\n {logoContent}\n </div>\n );\n }\n\n // Responsive: Visible en md: con tamaño desktop, lg: con tamaño completo\n return (\n <div className=\"hidden md:block overflow-hidden relative shrink-0 w-[140px] lg:w-[168px] h-[25px] lg:h-[30px]\">\n {logoContent}\n </div>\n );\n };\n\n // ===== SIESA LOGO (Logo de Siesa - Leading) =====\n // Se controla con showSiesaLogoLeading\n // En mobile siempre se muestra el icono de Siesa en leading\n const SiesaLogoLeading = () => {\n const logoFull = (\n <img\n src=\"/.Siesa Logo.png\"\n alt=\"Siesa\"\n className=\"w-full h-full object-contain\"\n />\n );\n\n const logoMobile = (\n <img\n src=\"/siesa_logo_mobile.png\"\n alt=\"Siesa\"\n className=\"w-full h-full object-contain\"\n />\n );\n\n // En mobile siempre se muestra el icono de Siesa\n if (isMobile) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[30px] h-[30px]\">\n {logoMobile}\n </div>\n );\n }\n\n // En desktop/tablet: Se controla con showSiesaLogoLeading\n if (!showSiesaLogoLeading) return null;\n\n if (isDesktop) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[120px] h-[30px]\">\n {logoFull}\n </div>\n );\n }\n\n if (isTablet) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[100px] h-[25px]\">\n {logoFull}\n </div>\n );\n }\n\n // Responsive\n return (\n <>\n {/* Mobile: Logo icono (30x30) - siempre visible */}\n <div className=\"md:hidden overflow-hidden relative shrink-0 w-[30px] h-[30px]\">\n {logoMobile}\n </div>\n {/* Tablet/Desktop: Se controla con showSiesaLogoLeading */}\n {showSiesaLogoLeading && (\n <>\n {/* Tablet: Logo completo (100x25) */}\n <div className=\"hidden md:block lg:hidden overflow-hidden relative shrink-0 w-[100px] h-[25px]\">\n {logoFull}\n </div>\n {/* Desktop: Logo completo (120x30) */}\n <div className=\"hidden lg:block overflow-hidden relative shrink-0 w-[120px] h-[30px]\">\n {logoFull}\n </div>\n </>\n )}\n </>\n );\n };\n\n // ===== SIESA LOGO (Trailing) =====\n // Se controla con showSiesaLogoTrailing\n const SiesaLogoTrailing = () => {\n // Se controla con showSiesaLogoTrailing\n if (!showSiesaLogoTrailing || isMobile) return null;\n\n const logoFull = (\n <img\n src=\"/.Siesa Logo.png\"\n alt=\"Siesa\"\n className=\"w-full h-full object-contain\"\n />\n );\n\n if (isDesktop) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[120px] h-[30px]\">\n {logoFull}\n </div>\n );\n }\n\n if (isTablet) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[100px] h-[25px]\">\n {logoFull}\n </div>\n );\n }\n\n // Responsive: Visible en md: (tablet y desktop)\n return (\n <>\n {/* Tablet: Logo completo (100x25) */}\n <div className=\"hidden md:block lg:hidden overflow-hidden relative shrink-0 w-[100px] h-[25px]\">\n {logoFull}\n </div>\n {/* Desktop: Logo completo (120x30) */}\n <div className=\"hidden lg:block overflow-hidden relative shrink-0 w-[120px] h-[30px]\">\n {logoFull}\n </div>\n </>\n );\n };\n\n // ===== DIVIDER COMPONENT =====\n const Divider = ({ responsive = true }: { responsive?: boolean }) => {\n const dividerContent = (\n <div className=\"grow shrink-0 w-px min-h-px bg-border-primary dark:bg-dark-border-primary\" />\n );\n\n if (isMobile) return null;\n\n if (isDesktop || isTablet) {\n return (\n <div className=\"flex flex-col gap-2 h-8 items-start px-0 py-1 relative shrink-0\">\n {dividerContent}\n </div>\n );\n }\n\n // Responsive\n if (responsive) {\n return (\n <div className=\"hidden md:flex flex-col gap-2 h-8 items-start px-0 py-1 relative shrink-0\">\n {dividerContent}\n </div>\n );\n }\n\n return null;\n };\n\n // ===== PRODUCT NAME =====\n const ProductName = () => {\n if (isMobile || !productName) return null;\n\n const nameContent = (\n <p className=\"font-bold leading-7 text-xl text-content-primary dark:text-dark-content-primary tracking-[-0.5px] whitespace-nowrap\">\n {productName}\n </p>\n );\n\n if (isDesktop || isTablet) {\n return nameContent;\n }\n\n // Responsive: Solo visible en md:\n return (\n <p className=\"hidden md:block font-bold leading-7 text-xl text-content-primary dark:text-dark-content-primary tracking-[-0.5px] whitespace-nowrap\">\n {productName}\n </p>\n );\n };\n\n // ===== ENVIRONMENT BADGE =====\n const EnvironmentBadge = () => {\n if (!environmentBadge) return null;\n\n if (isMobile) {\n return (\n <Badge\n color=\"yellow\"\n leftIcon={<ExclamationTriangleIcon />}\n label=\"Pruebas\"\n />\n );\n }\n\n if (isDesktop || isTablet) {\n return (\n <Badge\n color=\"yellow\"\n leftIcon={<ExclamationTriangleIcon />}\n label={environmentBadge}\n />\n );\n }\n\n // Responsive: Mostrar badge corto en mobile, completo en desktop\n return (\n <>\n <div className=\"md:hidden\">\n <Badge\n color=\"yellow\"\n leftIcon={<ExclamationTriangleIcon />}\n label=\"Pruebas\"\n />\n </div>\n <div className=\"hidden md:block\">\n <Badge\n color=\"yellow\"\n leftIcon={<ExclamationTriangleIcon />}\n label={environmentBadge}\n />\n </div>\n </>\n );\n };\n\n // ===== SEARCH BUTTON (Solo mobile) =====\n const SearchButton = () => {\n if (hideActionButtons) return null;\n\n if (isMobile) {\n return (\n <button\n className={actionButtonClasses}\n aria-label=\"Buscar\"\n onClick={onSearchClick}\n >\n <div className=\"overflow-hidden relative shrink-0 w-4 h-4\">\n <MagnifyingGlassIcon />\n </div>\n </button>\n );\n }\n\n if (isResponsive) {\n return (\n <button\n className={`md:hidden ${actionButtonClasses}`}\n aria-label=\"Buscar\"\n onClick={onSearchClick}\n >\n <div className=\"overflow-hidden relative shrink-0 w-4 h-4\">\n <MagnifyingGlassIcon />\n </div>\n </button>\n );\n }\n\n return null;\n };\n\n // ===== CART BUTTON =====\n const CartButton = () => {\n if (hideActionButtons) return null;\n\n return (\n <div className=\"relative\">\n <button\n className={actionButtonClasses}\n aria-label=\"Carrito de compras\"\n onClick={onCartClick}\n >\n <div className=\"overflow-hidden relative shrink-0 w-4 h-4\">\n <ShoppingCartIcon />\n </div>\n </button>\n {/* Badge de notificación con número */}\n {notifications?.cart !== undefined && notifications.cart > 0 && (\n <div className=\"absolute bg-error-content dark:bg-error-content flex flex-col gap-2.5 h-4 items-center justify-center left-[calc(50%+8px)] px-1 py-0 rounded-full top-[calc(50%-8px)] -translate-x-1/2 -translate-y-1/2 pointer-events-none min-w-[16px]\">\n <p className=\"font-bold leading-3 text-[10px] text-white text-center whitespace-nowrap\">\n {notifications.cart > 99 ? '+99' : notifications.cart}\n </p>\n </div>\n )}\n </div>\n );\n };\n\n // ===== NOTIFICATIONS BUTTON =====\n const NotificationsButton = () => {\n if (hideActionButtons) return null;\n\n return (\n <div className=\"relative\">\n <button\n className={actionButtonClasses}\n aria-label=\"Notificaciones\"\n onClick={onNotificationsClick}\n >\n <div className=\"overflow-hidden relative shrink-0 w-4 h-4\">\n <BellIcon />\n </div>\n </button>\n {/* Badge de notificación dot */}\n {notifications?.bell && (\n <div className=\"absolute w-2 h-2 bg-error-content dark:bg-error-content rounded-full left-[calc(50%+4px)] top-[calc(50%-8px)] -translate-x-1/2 pointer-events-none\" />\n )}\n </div>\n );\n };\n\n // ===== USER DROPDOWN =====\n const UserDropdown = () => {\n if (!userDropdown) return null;\n\n const dropdownButtonClasses = `\n box-border\n flex\n items-center\n justify-center\n overflow-hidden\n p-0\n relative\n shrink-0\n hover:bg-background-secondary\n active:scale-95\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:hover:bg-dark-bg-secondary\n dark:active:scale-95\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n rounded-lg\n transition-all\n duration-150\n `;\n\n // Mobile: Solo avatar circular\n if (isMobile) {\n return (\n <button\n className={dropdownButtonClasses}\n onClick={userDropdown.onMenuClick}\n aria-label=\"Menú de usuario\"\n >\n <div className=\"relative rounded-full shrink-0 w-8 h-8\">\n <img\n alt={userDropdown.name}\n className=\"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-full w-full h-full\"\n src={userDropdown.avatar}\n />\n </div>\n </button>\n );\n }\n\n // Desktop/Tablet: Avatar + info + chevron\n const renderFullDropdown = () => (\n <button\n className={dropdownButtonClasses}\n onClick={userDropdown.onMenuClick}\n aria-label=\"Menú de usuario\"\n >\n <div className=\"box-border flex gap-3 items-center justify-center overflow-hidden px-3 py-2 relative rounded-lg shrink-0\">\n <div className=\"flex gap-3 items-center justify-center relative shrink-0\">\n {/* Avatar */}\n <div className=\"flex items-center justify-center relative shrink-0\">\n <div className=\"relative rounded-md shrink-0 w-10 h-10\">\n <img\n alt={userDropdown.name}\n className=\"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-md w-full h-full\"\n src={userDropdown.avatar}\n />\n </div>\n </div>\n {/* Nombre y email/rol */}\n <div className=\"flex flex-col gap-0.5 items-start justify-center relative shrink-0 w-[123px]\">\n <p className=\"leading-5 relative shrink-0 text-sm text-content-primary dark:text-dark-content-primary whitespace-nowrap font-normal\">\n {userDropdown.name}\n </p>\n {(userDropdown.email || userDropdown.role) && (\n <p className=\"leading-4 min-w-full relative shrink-0 text-xs text-content-secondary dark:text-content-secondary w-min whitespace-nowrap overflow-hidden text-ellipsis\">\n {userDropdown.email || userDropdown.role}\n </p>\n )}\n </div>\n </div>\n {/* Chevron down icon */}\n <div className=\"overflow-hidden relative shrink-0 w-5 h-5 text-content-secondary dark:text-content-secondary\">\n <ChevronDownIcon />\n </div>\n </div>\n </button>\n );\n\n if (isDesktop || isTablet) {\n return renderFullDropdown();\n }\n\n // Responsive\n return (\n <>\n {/* Mobile: Solo avatar circular */}\n <button\n className={`md:hidden ${dropdownButtonClasses}`}\n onClick={userDropdown.onMenuClick}\n aria-label=\"Menú de usuario\"\n >\n <div className=\"relative rounded-full shrink-0 w-8 h-8\">\n <img\n alt={userDropdown.name}\n className=\"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-full w-full h-full\"\n src={userDropdown.avatar}\n />\n </div>\n </button>\n {/* Desktop/Tablet: Avatar + info + chevron */}\n <button\n className={`hidden md:flex ${dropdownButtonClasses}`}\n onClick={userDropdown.onMenuClick}\n aria-label=\"Menú de usuario\"\n >\n <div className=\"box-border flex gap-3 items-center justify-center overflow-hidden px-3 py-2 relative rounded-lg shrink-0\">\n <div className=\"flex gap-3 items-center justify-center relative shrink-0\">\n {/* Avatar */}\n <div className=\"flex items-center justify-center relative shrink-0\">\n <div className=\"relative rounded-md shrink-0 w-10 h-10\">\n <img\n alt={userDropdown.name}\n className=\"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-md w-full h-full\"\n src={userDropdown.avatar}\n />\n </div>\n </div>\n {/* Nombre y email/rol */}\n <div className=\"flex flex-col gap-0.5 items-start justify-center relative shrink-0 w-[123px]\">\n <p className=\"leading-5 relative shrink-0 text-sm text-content-primary dark:text-dark-content-primary whitespace-nowrap font-normal\">\n {userDropdown.name}\n </p>\n {(userDropdown.email || userDropdown.role) && (\n <p className=\"leading-4 min-w-full relative shrink-0 text-xs text-content-secondary dark:text-content-secondary w-min whitespace-nowrap overflow-hidden text-ellipsis\">\n {userDropdown.email || userDropdown.role}\n </p>\n )}\n </div>\n </div>\n {/* Chevron down icon */}\n <div className=\"overflow-hidden relative shrink-0 w-5 h-5 text-content-secondary dark:text-content-secondary\">\n <ChevronDownIcon />\n </div>\n </div>\n </button>\n </>\n );\n };\n\n // ===== CLASES BASE DEL NAVBAR =====\n const baseClasses = `\n box-border\n flex\n gap-8\n items-center\n px-4\n py-1\n relative\n w-full\n bg-background-primary\n dark:bg-dark-bg-primary\n `;\n\n // ===== CLASES PARA VARIANTES DE ALTURA =====\n const variantClasses = {\n responsive: 'h-[40px] md:h-16',\n desktop: 'h-16',\n tablet: 'h-16',\n mobile: 'h-[40px]',\n };\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [baseClasses, variantClasses[variant], className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <nav className={finalClasses}>\n {/* ===== SECCIÓN LEADING (IZQUIERDA) ===== */}\n <div className=\"flex gap-4 items-center relative shrink-0\">\n {/* Botón de navegación o acción leading personalizada (solo desktop/tablet) */}\n {!isMobile && (leadingAction || <NavigationButton />)}\n\n {/* Business Logo (logo del cliente) - solo cuando showBusinessLogo=true */}\n {logo || <BusinessLogo />}\n\n {/* Divider después de Business Logo - Solo cuando hay Business Logo Y hay Siesa Logo en leading */}\n {showBusinessLogo && showSiesaLogoLeading && !isMobile && <Divider />}\n\n {/* Siesa Logo en leading - Se controla con showSiesaLogoLeading */}\n {siesaLogo || <SiesaLogoLeading />}\n\n {/* Divider antes del nombre - Solo cuando hay Siesa Logo en leading y nombre de producto */}\n {productName && showSiesaLogoLeading && !isMobile && <Divider />}\n\n {/* Nombre del Producto - Solo desktop/tablet */}\n <ProductName />\n </div>\n\n {/* ===== SECCIÓN TRAILING (DERECHA) ===== */}\n <div className=\"flex gap-4 items-center justify-end grow min-h-px min-w-px relative shrink-0\">\n {/* Badge de Ambiente */}\n <EnvironmentBadge />\n\n {/* Botón de búsqueda - Solo mobile */}\n <SearchButton />\n\n {/* Botón de carrito de compras */}\n <CartButton />\n\n {/* Botón de notificaciones */}\n <NotificationsButton />\n\n {/* Divider antes del dropdown - Solo desktop/tablet */}\n {userDropdown && !hideActionButtons && <Divider />}\n\n {/* Dropdown de usuario */}\n <UserDropdown />\n\n {/* Divider antes del logo Siesa trailing - Solo cuando showSiesaLogoTrailing=true */}\n {showSiesaLogoTrailing && userDropdown && !isMobile && <Divider />}\n\n {/* Logo Siesa trailing - Solo desktop */}\n <SiesaLogoTrailing />\n\n {/* Actions adicionales */}\n {actions && <div className=\"flex gap-2 items-center\">{actions}</div>}\n </div>\n </nav>\n );\n};\n","import React from 'react';\nimport type { NavigationBarProps, NavigationBarItem } from './NavigationBar.types';\n\n/**\n * NavigationBar del sistema de diseño Siesa\n *\n * **Componente de navegación inferior (Bottom Navigation Bar) para móvil.**\n * Permite al usuario navegar entre vistas principales de la aplicación.\n * Diseñado para contener 3-5 ítems de navegación.\n *\n * **🔄 Navegación Responsive:**\n * El NavigationRail (navegación lateral vertical) se convierte en NavigationBar\n * (navegación inferior horizontal) cuando la pantalla es móvil. Esta es una\n * práctica recomendada de UX para aprovechar mejor el espacio en diferentes\n * dispositivos:\n * - **Desktop/Tablet**: Usar NavigationRail (lateral)\n * - **Mobile**: Usar NavigationBar (inferior)\n *\n * **Características:**\n * - Soporta hasta 5 ítems de navegación (recomendado: 3-5)\n * - Cada ítem tiene icono + label\n * - Indicador visual de ítem activo (fondo azul claro)\n * - Estados: active, hover, disabled\n * - Dark mode completo\n * - Accesibilidad con ARIA labels\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Tipografía Label XXSmall (10px Bold) según sistema de diseño\n * - Iconos de 16x16px según especificaciones de Figma\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label XXSmall)\n * @see docs/spacing.md - Sistema de espaciado\n * @see NavigationRail - Componente de navegación lateral para desktop\n *\n * @example\n * ```tsx\n * const items = [\n * { id: 'home', icon: <HomeIcon />, label: 'Inicio', active: true },\n * { id: 'search', icon: <SearchIcon />, label: 'Buscar' },\n * { id: 'profile', icon: <ProfileIcon />, label: 'Perfil' },\n * ];\n *\n * <NavigationBar\n * items={items}\n * activeItemId=\"home\"\n * onItemClick={(id) => console.log('Clicked:', id)}\n * />\n * ```\n *\n * @example\n * // Patrón responsive: NavigationRail en desktop, NavigationBar en mobile\n * ```tsx\n * function ResponsiveNav() {\n * return (\n * <>\n * // NavigationRail para desktop/tablet\n * <div className=\"hidden md:block\">\n * <NavigationRail items={items} />\n * </div>\n *\n * // NavigationBar para móvil\n * <div className=\"md:hidden fixed bottom-0 left-0 right-0 z-50\">\n * <NavigationBar items={items} />\n * </div>\n * </>\n * );\n * }\n * ```\n */\nexport const NavigationBar: React.FC<NavigationBarProps> = ({\n items,\n activeItemId,\n onItemClick,\n className = '',\n ariaLabel = 'Navegación Principal',\n}) => {\n // ===== VALIDACIÓN: Máximo 5 ítems =====\n if (items.length > 5) {\n console.warn('NavigationBar: Se recomienda un máximo de 5 ítems para mejor UX');\n }\n\n // ===== HANDLER DE CLICK =====\n const handleItemClick = (item: NavigationBarItem) => {\n if (item.disabled) return;\n\n // Llamar onClick del ítem individual si existe\n if (item.onClick) {\n item.onClick(item.id);\n }\n\n // Llamar onItemClick global si existe\n if (onItemClick) {\n onItemClick(item.id);\n }\n };\n\n // ===== RENDERIZAR ÍTEM =====\n const renderItem = (item: NavigationBarItem) => {\n const isActive = item.active || item.id === activeItemId;\n\n // ===== CLASES DEL CONTENEDOR DEL ÍTEM =====\n const itemContainerClasses = `\n flex-1\n flex\n flex-col\n items-center\n gap-1\n px-0.5\n py-0\n min-w-0\n cursor-pointer\n transition-all\n duration-150\n ${item.disabled ? 'opacity-50 cursor-not-allowed pointer-events-none' : ''}\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL ICON CONTAINER =====\n // Fondo azul claro cuando está activo (rgb(219, 238, 254) = #dbeefe = primary-custom-100)\n // En dark mode usa el mismo color opaco según Figma\n const iconContainerClasses = `\n flex\n items-center\n justify-center\n px-4\n py-1\n rounded-full\n overflow-hidden\n transition-all\n duration-150\n ${\n isActive\n ? 'bg-primary-custom-100 dark:bg-primary-custom-100'\n : 'bg-transparent hover:bg-hover-overlay dark:hover:bg-hover-overlay-dark'\n }\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL LABEL =====\n // Label XXSmall: 10px Bold, line-height 12px (según typography.md y Figma)\n const labelClasses = `\n font-['SiesaBT:Bold',sans-serif]\n text-[10px]\n leading-[12px]\n font-bold\n text-center\n w-full\n min-w-0\n text-content-primary\n dark:text-dark-content-primary\n transition-colors\n duration-150\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL ICONO =====\n // Iconos de 16x16px según Figma\n const iconClasses = `\n w-4\n h-4\n shrink-0\n text-content-primary\n dark:text-dark-content-primary\n transition-colors\n duration-150\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n key={item.id}\n type=\"button\"\n className={itemContainerClasses}\n onClick={() => handleItemClick(item)}\n disabled={item.disabled}\n aria-label={item.ariaLabel || item.label}\n aria-current={isActive ? 'page' : undefined}\n >\n {/* Icon Container */}\n <div className={iconContainerClasses}>\n <span className={iconClasses}>{item.icon}</span>\n </div>\n\n {/* Label */}\n <span className={labelClasses}>{item.label}</span>\n </button>\n );\n };\n\n // ===== CLASES DEL CONTENEDOR PRINCIPAL =====\n const containerClasses = `\n bg-bg-primary\n dark:bg-dark-bg-primary\n p-4\n w-full\n transition-colors\n duration-150\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL MENU (Contenedor de ítems) =====\n const menuClasses = `\n flex\n items-start\n justify-center\n w-full\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL DESTINATIONS (Contenedor con gap) =====\n const destinationsClasses = `\n flex-1\n flex\n items-start\n gap-2\n min-h-0\n min-w-0\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <nav\n className={`${containerClasses} ${className}`.trim()}\n role=\"navigation\"\n aria-label={ariaLabel}\n >\n <div className={menuClasses}>\n <div className={destinationsClasses}>\n {items.map((item) => renderItem(item))}\n </div>\n </div>\n </nav>\n );\n};\n","import React from 'react';\n\n/**\n * Icono de convención para POSConvention\n *\n * Círculo SVG de 16x16px con colores diferentes para Light y Dark mode.\n * Basado en especificaciones de Figma:\n * - Light mode: node-id 4418-40139\n * - Dark mode: node-id 4418-40349\n *\n * Usa dos círculos superpuestos con clases CSS para alternar entre modos.\n *\n * @param lightColor - Color hexadecimal para Light mode\n * @param darkColor - Color hexadecimal para Dark mode\n * @param className - Clases CSS adicionales (opcional)\n */\nexport const ConventionIcon: React.FC<{\n lightColor: string;\n darkColor: string;\n className?: string;\n}> = ({ lightColor, darkColor, className = '' }) => (\n <svg\n className={`w-4 h-4 shrink-0 ${className}`.trim()}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n {/* Círculo para Light mode - visible por defecto, oculto en dark */}\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"8\"\n fill={lightColor}\n className=\"dark:hidden\"\n />\n {/* Círculo para Dark mode - oculto por defecto, visible en dark */}\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"8\"\n fill={darkColor}\n className=\"hidden dark:block\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { POSConventionProps } from './POSConvention.types';\nimport { ConventionIcon } from './icons';\n\n/**\n * POSConvention - Componente de leyenda/convención para estados de mesas POS\n *\n * Muestra un indicador circular de color con su respectiva etiqueta según el diseño de Figma.\n * Se usa típicamente para crear leyendas que explican el significado de colores en el sistema POS.\n *\n * **Colores según Figma (node-id: 4418-40139):**\n *\n * | Estado | Light Mode | Dark Mode |\n * |--------|------------|-----------|\n * | Available | #0e79fd (azul) | #93d1fd (azul claro) |\n * | Occupied | #af460e (naranja) | #f5a927 (amarillo) |\n * | Reserved | #7e22ce (morado) | #c084fc (morado claro) |\n * | Out of Service | #3f3f46 (gris) | #a1a1aa (gris claro) |\n *\n * **Dimensiones según Figma:**\n * - Icono: 16x16px (círculo con fill)\n * - Texto: 12px (Paragraph/Tiny - text-xs)\n * - Gap: 4px (gap-1)\n * - Line-height: 16px (leading-4)\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Colores exactos de Figma para Light y Dark mode\n * - Type safety con TypeScript estricto\n * - Accesibilidad con aria-label\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Paragraph Tiny)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Indicador de disponible\n * <POSConvention status=\"available\" />\n *\n * // Indicador de ocupada\n * <POSConvention status=\"occupied\" />\n *\n * // Leyenda completa en contenedor\n * <div className=\"p-5 rounded-lg border border-dashed border-primary-custom-300\">\n * <div className=\"flex flex-col gap-9\">\n * <POSConvention status=\"available\" />\n * <POSConvention status=\"occupied\" />\n * <POSConvention status=\"reserved\" />\n * <POSConvention status=\"outOfService\" />\n * </div>\n * </div>\n * ```\n */\nexport const POSConvention: React.FC<POSConventionProps> = ({\n status = 'available',\n className = '',\n}) => {\n // ===== CONFIGURACIÓN DE COLORES Y LABELS SEGÚN FIGMA =====\n // Colores extraídos del nodo 4418-40139 (Light) y 4418-40349 (Dark) de Figma\n // Variables de Figma: contentCustomPrimary, contentYellow, contentPurple, contentZinc\n const conventionConfig = {\n available: {\n lightColor: '#0e79fd', // Azul - contentCustomPrimary Light\n darkColor: '#93d1fd', // Azul claro - contentCustomPrimary Dark\n label: 'Disponible',\n },\n occupied: {\n lightColor: '#af460e', // Naranja - contentOrange Light\n darkColor: '#f5a927', // Amarillo - contentYellow Dark\n label: 'Ocupada',\n },\n reserved: {\n lightColor: '#7e22ce', // Morado - contentPurple Light\n darkColor: '#c084fc', // Morado claro - contentPurple Dark\n label: 'Reservada',\n },\n outOfService: {\n lightColor: '#3f3f46', // Gris - contentZinc Light (zinc-700)\n darkColor: '#a1a1aa', // Gris claro - contentZinc Dark (zinc-400)\n label: 'Fuera de Servicio',\n },\n };\n\n const config = conventionConfig[status];\n\n // ===== CLASES BASE =====\n const baseClasses = `\n inline-flex\n items-center\n gap-1\n shrink-0\n `;\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [baseClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div\n className={finalClasses}\n role=\"presentation\"\n aria-label={`Estado: ${config.label}`}\n >\n {/* Icono circular 16x16 con colores para Light y Dark mode */}\n <ConventionIcon lightColor={config.lightColor} darkColor={config.darkColor} />\n\n {/* Label de texto según Figma: Paragraph/Tiny 12px */}\n {/* Light: contentPrimary #18181b, Dark: contentPrimary #f4f4f5 */}\n <span\n className={`\n text-xs\n leading-4\n font-normal\n text-content-primary\n dark:text-dark-content-primary\n whitespace-nowrap\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {config.label}\n </span>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * Icono Check (✓) para estado Available\n * Tamaño: 12x12px\n */\nexport const CheckIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M10 3L4.5 8.5L2 6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * Icono X Mark para estado Occupied\n * Tamaño: 12x12px\n */\nexport const XMarkIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M9 3L3 9M3 3L9 9\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * Icono Calendar para estado Reserved\n * Tamaño: 12x12px\n */\nexport const CalendarIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M10.5 5H1.5M8.5 1V3M3.5 1V3M3.25 11H8.75C9.57843 11 10.25 10.3284 10.25 9.5V3.5C10.25 2.67157 9.57843 2 8.75 2H3.25C2.42157 2 1.75 2.67157 1.75 3.5V9.5C1.75 10.3284 2.42157 11 3.25 11Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * Icono No Symbol (Prohibido) para estado Out of Service\n * Tamaño: 12x12px\n */\nexport const NoSymbolIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M10.5 6C10.5 8.48528 8.48528 10.5 6 10.5C3.51472 10.5 1.5 8.48528 1.5 6C1.5 3.51472 3.51472 1.5 6 1.5C8.48528 1.5 10.5 3.51472 10.5 6Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M9.18198 2.81802L2.81802 9.18198\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\n\n/**\n * Icono de Usuario/Personas para mostrar capacidad\n * Tamaño: 13x10px (según especificaciones de Figma)\n */\nexport const UsersIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"13\"\n height=\"10\"\n viewBox=\"0 0 13 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M9.25 9V8C9.25 6.89543 8.35457 6 7.25 6H2.75C1.64543 6 0.75 6.89543 0.75 8V9M12.25 9V8C12.25 6.89543 11.3546 6 10.25 6H9.75M7 2.5C7 3.60457 6.10457 4.5 5 4.5C3.89543 4.5 3 3.60457 3 2.5C3 1.39543 3.89543 0.5 5 0.5C6.10457 0.5 7 1.39543 7 2.5ZM10 2C10 2.82843 9.32843 3.5 8.5 3.5C7.67157 3.5 7 2.82843 7 2C7 1.17157 7.67157 0.5 8.5 0.5C9.32843 0.5 10 1.17157 10 2Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { POSLocationButtonProps } from './POSLocationButton.types';\nimport { CheckIcon, XMarkIcon, CalendarIcon, NoSymbolIcon, UsersIcon } from './icons';\n\n/**\n * POSLocationButton del sistema de diseño Siesa\n *\n * Botón especializado para punto de venta (POS) que muestra el estado de disponibilidad\n * de una ubicación física (mesa, salón, terraza, etc.) con indicadores visuales claros.\n *\n * **Estados de disponibilidad (status):**\n * - `available`: Disponible (verde/lime) con icono ✓\n * - `occupied`: Ocupada (naranja/yellow) con icono ✗\n * - `reserved`: Reservada (morado/purple) con icono 📅\n * - `outOfService`: Fuera de servicio (gris/zinc) con icono 🚫\n *\n * **Estados visuales (state):**\n * - `enabled`: Estado normal con fondo blanco/dark\n * - `actived`: Estado seleccionado con fondo coloreado\n *\n * **Características:**\n * - Ancho flexible: por defecto ocupa el 100% del contenedor (fullWidth=true)\n * - Altura fija: 68px (optimizado para interfaces POS)\n * - Muestra nombre de ubicación y capacidad (ej: \"1/8 mesas\")\n * - Badge visual con icono y texto del estado\n * - Dark mode completo en todos los estados\n * - Focus ring adaptativo\n * - Transiciones suaves\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Ubicación disponible\n * <POSLocationButton\n * locationName=\"Antejardín\"\n * status=\"available\"\n * capacity={{ current: 1, total: 8 }}\n * onClick={() => console.log('Seleccionado')}\n * />\n *\n * // Ubicación ocupada y seleccionada\n * <POSLocationButton\n * locationName=\"Terraza\"\n * status=\"occupied\"\n * state=\"actived\"\n * capacity={{ current: 5, total: 8 }}\n * />\n *\n * // Ubicación reservada\n * <POSLocationButton\n * locationName=\"Salón Principal\"\n * status=\"reserved\"\n * capacity={{ current: 3, total: 12 }}\n * />\n *\n * // Fuera de servicio\n * <POSLocationButton\n * locationName=\"Bar\"\n * status=\"outOfService\"\n * disabled\n * />\n * ```\n */\nexport const POSLocationButton: React.FC<POSLocationButtonProps> = ({\n locationName,\n status = 'available',\n state = 'enabled',\n capacity,\n onClick,\n disabled = false,\n className = '',\n ariaLabel,\n fullWidth = true,\n}) => {\n // ===== CONFIGURACIÓN DE COLORES POR STATUS =====\n // Mapeo de colores según especificaciones de Figma (pixel-perfect)\n const statusConfig = {\n available: {\n // Azul Primary Custom (según Figma: #0e79fd)\n textColor: 'text-primary-custom-600 dark:text-primary-custom-600',\n badgeBg: 'bg-primary-custom-100 dark:bg-blue-900/30',\n badgeText: 'text-primary-custom-600 dark:text-blue-400',\n activedBg: 'bg-primary-custom-100 dark:bg-blue-900/30',\n icon: CheckIcon,\n badgeLabel: 'Disponible',\n },\n occupied: {\n // Naranja/Yellow (según Figma: #af460e para texto, #fcedc9 para fondo)\n textColor: 'text-[#af460e] dark:text-orange-400',\n badgeBg: 'bg-[#fcedc9] dark:bg-yellow-900/30',\n badgeText: 'text-[#af460e] dark:text-orange-400',\n activedBg: 'bg-[#fcedc9] dark:bg-yellow-900/30',\n icon: XMarkIcon,\n badgeLabel: 'Ocupada',\n },\n reserved: {\n // Morado/Purple (según Figma: #7e22ce para texto, #f3e8ff para fondo)\n textColor: 'text-[#7e22ce] dark:text-fuchsia-400',\n badgeBg: 'bg-[#f3e8ff] dark:bg-purple-900/30',\n badgeText: 'text-[#7e22ce] dark:text-purple-400',\n activedBg: 'bg-[#f3e8ff] dark:bg-purple-900/30',\n icon: CalendarIcon,\n badgeLabel: 'Reservada',\n },\n outOfService: {\n // Gris/Zinc (según Figma: #3f3f46 para texto, #f4f4f5 para fondo)\n textColor: 'text-[#3f3f46] dark:text-zinc-400',\n badgeBg: 'bg-[#f4f4f5] dark:bg-zinc-800/30',\n badgeText: 'text-content-tertiary dark:text-zinc-400',\n activedBg: 'bg-[#f4f4f5] dark:bg-zinc-800/30',\n icon: NoSymbolIcon,\n badgeLabel: 'F. de Servicio',\n },\n };\n\n const config = statusConfig[status];\n const StatusIcon = config.icon;\n\n // ===== CLASES DE FONDO SEGÚN STATE =====\n const backgroundClasses =\n state === 'actived'\n ? config.activedBg // Fondo coloreado cuando está activo\n : 'bg-white dark:bg-dark-bg-primary'; // Fondo blanco/dark cuando está enabled\n\n // ===== CLASES DE ANCHO =====\n const widthClasses = fullWidth ? 'w-full' : 'w-[189px]';\n\n // ===== CLASES BASE =====\n const baseClasses = `\n flex\n flex-col\n items-stretch\n justify-between\n ${widthClasses}\n h-[68px]\n p-2\n rounded-lg\n cursor-pointer\n transition-all\n duration-150\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n hover:shadow-md\n active:scale-[0.98]\n disabled:opacity-50\n disabled:cursor-not-allowed\n disabled:pointer-events-none\n `;\n\n // ===== COMBINAR CLASES =====\n const buttonClasses = [baseClasses, backgroundClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== FORMATEAR TEXTO DE CAPACIDAD =====\n const capacityText = capacity\n ? `${capacity.current}/${capacity.total} mesas`\n : null;\n\n return (\n <button\n className={buttonClasses}\n onClick={onClick}\n disabled={disabled}\n aria-label={ariaLabel || `${locationName} - ${config.badgeLabel}`}\n type=\"button\"\n >\n {/* ===== TÍTULO (Nombre de ubicación) ===== */}\n <div\n className={`\n text-base\n font-bold\n leading-6\n ${config.textColor}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {locationName}\n </div>\n\n {/* ===== CONTENIDO (Capacidad + Badge) ===== */}\n <div className=\"flex items-center justify-between\">\n {/* Capacidad (izquierda) */}\n {capacityText && (\n <div className=\"flex items-center gap-1\">\n <UsersIcon className={config.textColor} />\n <span\n className={`\n text-[10px]\n leading-[12px]\n ${config.textColor}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {capacityText}\n </span>\n </div>\n )}\n\n {/* Badge (derecha) */}\n <div\n className={`\n inline-flex\n items-center\n gap-1\n px-1.5\n py-1\n rounded-md\n ${config.badgeBg}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n <StatusIcon className={config.badgeText} />\n <span\n className={`\n text-xs\n leading-4\n ${config.badgeText}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {config.badgeLabel}\n </span>\n </div>\n </div>\n </button>\n );\n};\n","import React from 'react';\nimport type { POSNumberButtonProps } from './POSNumberButton.types';\n\n/**\n * Componente POSNumberButton del sistema de diseño Siesa\n * Botón numérico especializado para sistemas POS (Point of Sale)\n *\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * **Características principales:**\n * - Diseñado para pantallas táctiles y POS\n * - Tipografía Display Tiny (48px Bold) para números grandes\n * - Tres tamaños: Small (40x40), Medium (65x65), Large (80x80)\n * - Opción de borde visible o sin borde\n * - Estados: Default, Hover, Active, Disabled\n * - Touch-friendly: active:scale-95 para feedback táctil\n *\n * **Variantes:**\n * - `border=false`: Botón sin borde, hover cambia a primary\n * - `border=true`: Botón con borde, hover resalta el borde\n *\n * **Tamaños:**\n * - `s` (40x40px): Compacto, para teclados numéricos pequeños\n * - `m` (65x65px): Mediano, tamaño intermedio\n * - `l` (80x80px): Grande, tamaño por defecto para POS\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n * - Feedback visual inmediato con active:scale-95\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Display Tiny)\n * @see docs/spacing.md - Sistema de espaciado\n * @see src/components/Button/Button.tsx - Componente Button de referencia\n *\n * @example\n * ```tsx\n * // Botón numérico grande (POS)\n * <POSNumberButton size=\"l\">1</POSNumberButton>\n *\n * // Botón con borde\n * <POSNumberButton size=\"l\" border>2</POSNumberButton>\n *\n * // Botón compacto\n * <POSNumberButton size=\"s\">3</POSNumberButton>\n *\n * // Teclado numérico completo\n * <div className=\"grid grid-cols-3 gap-2\">\n * {[1, 2, 3, 4, 5, 6, 7, 8, 9].map((num) => (\n * <POSNumberButton key={num} size=\"m\" onClick={() => handleInput(num)}>\n * {num}\n * </POSNumberButton>\n * ))}\n * </div>\n * ```\n */\nexport const POSNumberButton: React.FC<POSNumberButtonProps> = ({\n size = 'l',\n border = false,\n children,\n disabled = false,\n className = '',\n onClick,\n ariaLabel,\n htmlType = 'button',\n ...rest\n}) => {\n // ===== CLASES DE TAMAÑO =====\n // Basado en especificaciones de Figma: L=80x80, M=65x65, S=40x40\n const sizeClasses = {\n s: 'w-10 h-10', // 40x40px\n m: 'w-[65px] h-[65px]', // 65x65px\n l: 'w-20 h-20', // 80x80px\n };\n\n // ===== CLASES DE TEXTO =====\n // Display Tiny (48px Bold) según typography.md → text-5xl\n // Para tamaño small, reducimos a text-2xl (24px)\n const textSizeClasses = {\n s: 'text-2xl', // 24px para botones pequeños\n m: 'text-5xl', // 48px Display Tiny\n l: 'text-5xl', // 48px Display Tiny\n };\n\n // ===== CLASES DE ESTADO (Sin Borde) =====\n const noBorderStateClasses = `\n bg-white\n text-content-primary\n hover:bg-primary-custom-600\n hover:text-primary-inverse-content\n active:bg-primary-custom-600\n active:text-primary-inverse-content\n active:scale-95\n dark:bg-dark-bg-primary\n dark:text-dark-content-primary\n dark:hover:bg-dark-bg-inverse\n dark:hover:text-dark-content-inverse\n dark:active:bg-dark-bg-inverse\n dark:active:text-dark-content-inverse\n dark:active:scale-95\n `;\n\n // ===== CLASES DE ESTADO (Con Borde) =====\n const withBorderStateClasses = `\n bg-white\n text-content-primary\n border\n border-border-primary\n hover:bg-primary-custom-600\n hover:text-primary-inverse-content\n hover:border-primary-inverse-border\n active:bg-primary-custom-600\n active:text-primary-inverse-content\n active:border-primary-inverse-border\n active:scale-95\n dark:bg-dark-bg-primary\n dark:text-dark-content-primary\n dark:border-dark-border-primary\n dark:hover:bg-dark-bg-inverse\n dark:hover:text-dark-content-inverse\n dark:hover:border-primary-inverse-border\n dark:active:bg-dark-bg-inverse\n dark:active:text-dark-content-inverse\n dark:active:border-primary-inverse-border\n dark:active:scale-95\n `;\n\n // ===== CLASES BASE =====\n const baseClasses = `\n inline-flex\n items-center\n justify-center\n rounded-lg\n font-bold\n tracking-tighter\n whitespace-nowrap\n cursor-pointer\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n disabled:opacity-50\n disabled:cursor-not-allowed\n disabled:pointer-events-none\n transition-all\n duration-150\n `;\n\n // ===== COMBINAR TODAS LAS CLASES =====\n const buttonClasses = [\n baseClasses,\n sizeClasses[size],\n textSizeClasses[size],\n border ? withBorderStateClasses : noBorderStateClasses,\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type={htmlType}\n className={buttonClasses}\n disabled={disabled}\n onClick={onClick}\n aria-label={ariaLabel || `Número ${children}`}\n {...rest}\n >\n {children}\n </button>\n );\n};\n","import React from 'react';\nimport type { POSProductButtonProps } from './POSProductButton.types';\n\n/**\n * Componente POSProductButton del sistema de diseño Siesa\n *\n * Botón especializado para sistemas POS que combina una imagen de producto\n * con un label descriptivo. Diseñado para selección rápida de productos.\n *\n * **Estados disponibles:**\n * - `default`: Estado normal con fondo blanco\n * - `active`: Estado seleccionado con fondo azul claro y texto azul\n * - `disabled`: Estado deshabilitado con opacidad reducida\n *\n * **Características:**\n * - Imagen con aspect ratio 158:80 (proporción de Figma)\n * - Label con tipografía Label Small (14px Bold)\n * - Soporte completo de dark mode\n * - Estados hover, active y focus\n * - Transiciones suaves\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Tokens de color consistentes con la documentación\n * - Estados hover y active completos\n * - Tipografía Label Small (14px Bold) según sistema de diseño\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label)\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/border-radius.md - Border radius\n *\n * @example\n * ```tsx\n * // Botón de producto normal\n * <POSProductButton\n * image=\"/images/parrilla.jpg\"\n * label=\"A la parrilla\"\n * onClick={() => console.log('Producto seleccionado')}\n * />\n *\n * // Botón de producto activo/seleccionado\n * <POSProductButton\n * image=\"/images/parrilla.jpg\"\n * label=\"A la parrilla\"\n * active={true}\n * />\n *\n * // Botón de producto deshabilitado\n * <POSProductButton\n * image=\"/images/parrilla.jpg\"\n * label=\"A la parrilla\"\n * disabled={true}\n * />\n * ```\n */\nexport const POSProductButton: React.FC<POSProductButtonProps> = ({\n image,\n label,\n active = false,\n disabled = false,\n onClick,\n className = '',\n ariaLabel,\n}) => {\n // ===== CLASES BASE =====\n const baseClasses = `\n flex\n flex-col\n gap-2\n p-3\n rounded-lg\n font-bold\n text-sm\n transition-all\n duration-150\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n `;\n\n // ===== CLASES DE ESTADO =====\n const stateClasses = disabled\n ? `\n bg-white\n text-content-primary\n opacity-55\n cursor-not-allowed\n pointer-events-none\n dark:bg-dark-bg-primary\n dark:text-dark-content-primary\n `\n : active\n ? `\n bg-primary-custom-100\n text-primary-custom-600\n cursor-pointer\n hover:bg-primary-custom-100\n active:scale-95\n dark:bg-primary-custom-100/20\n dark:text-primary-custom-600\n dark:hover:bg-primary-custom-100/30\n dark:active:scale-95\n `\n : `\n bg-white\n text-content-primary\n cursor-pointer\n hover:bg-background-secondary\n active:scale-95\n dark:bg-dark-bg-primary\n dark:text-dark-content-primary\n dark:hover:bg-dark-bg-primary/80\n dark:active:scale-95\n `;\n\n // ===== COMBINAR TODAS LAS CLASES =====\n const buttonClasses = [baseClasses, stateClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type=\"button\"\n className={buttonClasses}\n disabled={disabled}\n onClick={onClick}\n aria-label={ariaLabel || label}\n aria-pressed={active}\n >\n {/* Imagen del producto */}\n <div className=\"aspect-158/80 w-full rounded-lg overflow-hidden\">\n <img\n src={image}\n alt={label}\n className=\"w-full h-full object-cover\"\n />\n </div>\n\n {/* Label del producto */}\n <div className=\"w-full text-left leading-5\">\n {label}\n </div>\n </button>\n );\n};\n","import React from 'react';\n\n/**\n * Icono Plus (heroicons-micro/plus)\n * Usado en el botón \"Agregar\" del POSProductCard\n * Tamaño: 16x16px según especificación de Figma\n */\nexport const PlusIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n aria-hidden=\"true\"\n >\n <path\n d=\"M8 3V13M3 8H13\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { POSProductCardProps } from './POSProductCard.types';\nimport { Button } from '../Button';\nimport { PlusIcon } from './icons';\n\n/**\n * Componente POSProductCard del sistema de diseño Siesa\n *\n * Card especializado para sistemas POS que muestra información de producto\n * con imagen, nombre, precio y botón de agregar. Diseñado para catálogos\n * de productos y selección rápida en punto de venta.\n *\n * **Estados disponibles:**\n * - `enabled`: Estado normal\n * - Light: fondo blanco (#ffffff), texto negro (#18181b)\n * - Dark: fondo oscuro (#18181b), texto claro (#f4f4f5)\n * - `active`: Estado seleccionado\n * - Light: fondo azul claro (#dbeefe), texto azul (#0e79fd)\n * - Dark: fondo azul oscuro (#112d57), texto celeste (#93d1fd)\n * - `disabled`: Estado deshabilitado con opacidad reducida\n *\n * **Características:**\n * - Imagen de producto con aspect ratio fijo y rounded-lg\n * - Nombre del producto con tipografía Label Small (14px Bold)\n * - Precio con tipografía Heading Small (24px Bold) y letter-spacing -2.5%\n * - Botón \"Agregar\" reutiliza el componente Button del sistema\n * - Soporte completo de dark mode pixel-perfect\n * - Transiciones suaves\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Tokens de color consistentes con Figma\n * - Estados hover y active completos\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4368-31336 - Diseño Figma\n *\n * @example\n * ```tsx\n * // Card de producto normal\n * <POSProductCard\n * image=\"/images/caprese.jpg\"\n * productName=\"Ensalada Caprese\"\n * price=\"$ 40.000\"\n * onAddClick={() => console.log('Producto agregado')}\n * />\n *\n * // Card de producto activo/seleccionado\n * <POSProductCard\n * image=\"/images/caprese.jpg\"\n * productName=\"Ensalada Caprese\"\n * price=\"$ 40.000\"\n * active={true}\n * />\n *\n * // Card de producto deshabilitado\n * <POSProductCard\n * image=\"/images/caprese.jpg\"\n * productName=\"Ensalada Caprese\"\n * price=\"$ 40.000\"\n * disabled={true}\n * />\n * ```\n */\nexport const POSProductCard: React.FC<POSProductCardProps> = ({\n image,\n productName,\n price,\n buttonText = 'Agregar',\n active = false,\n disabled = false,\n onAddClick,\n onCardClick,\n className = '',\n ariaLabel,\n}) => {\n // ===== CLASES BASE DEL CARD =====\n const baseClasses = `\n flex\n flex-col\n gap-2\n p-3\n rounded-lg\n w-[170px]\n transition-all\n duration-150\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n `;\n\n // ===== CLASES DE ESTADO DEL CARD =====\n // Light: enabled=#ffffff, active=#dbeefe\n // Dark: enabled=#18181b, active=#112d57\n const stateClasses = disabled\n ? `\n bg-white\n opacity-55\n cursor-not-allowed\n dark:bg-dark-bg-primary\n `\n : active\n ? `\n bg-primary-custom-100\n cursor-pointer\n dark:bg-dark-bg-custom\n `\n : `\n bg-white\n cursor-pointer\n dark:bg-dark-bg-primary\n `;\n\n // ===== CLASES DE TEXTO SEGÚN ESTADO =====\n // Light: enabled=#18181b, active=#0e79fd\n // Dark: enabled=#f4f4f5, active=#93d1fd\n const textClasses = disabled\n ? `\n text-content-primary\n dark:text-dark-content-primary\n `\n : active\n ? `\n text-primary-custom-600\n dark:text-dark-content-custom\n `\n : `\n text-content-primary\n dark:text-dark-content-primary\n `;\n\n // ===== COMBINAR CLASES DEL CARD =====\n const cardClasses = [baseClasses, stateClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== HANDLER DEL CLICK EN EL CARD =====\n const handleCardClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (disabled) return;\n // Solo propagar si no se hizo clic en el botón\n if ((event.target as HTMLElement).closest('button')) return;\n onCardClick?.(event);\n };\n\n // ===== HANDLER DEL CLICK EN EL BOTÓN =====\n const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n if (disabled) return;\n onAddClick?.(event);\n };\n\n return (\n <div\n className={cardClasses}\n onClick={handleCardClick}\n role=\"article\"\n aria-label={ariaLabel || `${productName} - ${price}`}\n tabIndex={disabled ? -1 : 0}\n >\n {/* Sección de información del producto */}\n <div className=\"flex flex-col gap-3 w-full\">\n {/* Imagen del producto */}\n <div className=\"h-[88px] w-full rounded-lg overflow-hidden\">\n <img\n src={image}\n alt={productName}\n className=\"w-full h-full object-cover\"\n />\n </div>\n\n {/* Datos del producto (nombre y precio) */}\n <div className={`flex flex-col w-full font-bold ${textClasses}`.trim().replace(/\\s+/g, ' ')}>\n {/* Nombre del producto - Label Small (14px) */}\n <div className=\"text-sm leading-5\">\n {productName}\n </div>\n\n {/* Precio - Heading Small (24px) con letter-spacing -2.5% (tracking-tighter) */}\n <div className=\"text-2xl leading-8 tracking-tighter\">\n {price}\n </div>\n </div>\n </div>\n\n {/* Botón Agregar - Reutiliza el componente Button del sistema */}\n <Button\n type=\"default\"\n size=\"sm\"\n leftIcon={<PlusIcon className=\"w-4 h-4\" />}\n onClick={handleButtonClick}\n disabled={disabled}\n fullWidth\n ariaLabel={`${buttonText} ${productName}`}\n >\n {buttonText}\n </Button>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * TrashIcon - Icono de papelera para eliminar items\n * Basado en Heroicons Micro (16x16px)\n */\nexport const TrashIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { POSProductSidebarItemsProps } from './POSProductSidebarItems.types';\nimport { Quantity } from '../Quantity/Quantity';\nimport { TrashIcon } from './icons';\n\n/**\n * POSProductSidebarItems - Componente de item de producto para sidebar POS\n *\n * Componente pixel-perfect basado en Figma (node 4507-28013) para mostrar\n * productos en el sidebar de un sistema POS con soporte completo para dark mode.\n *\n * **Características:**\n * - Badge de categoría con 19 colores configurables\n * - Referencia del producto (text-[10px]/leading-3)\n * - Precio total (text-xs/font-bold)\n * - Nombre del producto (text-xs/font-bold)\n * - Descripción con items opcionales (fondo terciario)\n * - Control de cantidad integrado (Quantity component)\n * - Botón de eliminar con color de error\n *\n * **Especificaciones de Figma:**\n * - Ancho base: 272px\n * - Spacing: gap-1 (4px) entre elementos del producto, gap-2 (8px) entre secciones\n * - Badge: rounded-md (6px), px-1.5, py-1, text-xs/leading-4\n * - Description section: bg-background-tertiary, p-2, rounded-lg\n * - Delete icon: 24x24px, color red-700\n *\n * **Dark Mode:**\n * Los colores se adaptan automáticamente en dark mode:\n * - Textos principales: text-content-primary → dark:text-dark-content-primary\n * - Description background: bg-background-tertiary → dark:bg-zinc-700\n * - Badge colores: Mantienen contraste en ambos modos\n * - Delete button: text-red-700 → dark:text-red-500\n *\n * **Orden de modificadores:** {responsive}:{dark}:{state}:{utility}\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4507-28013 - Diseño Figma\n *\n * @example\n * ```tsx\n * <POSProductSidebarItems\n * categoryLabel=\"Entradas\"\n * productRef=\"00147258369\"\n * price=\"$ 40,000.00\"\n * productName=\"Nombre producto\"\n * descriptionItems={[\n * { description: \"Papas limón mediana\", price: \"$ 40,000.00\" },\n * { description: \"Papas limón mediana\", price: \"$ 40,000.00\" },\n * ]}\n * quantity={0}\n * onQuantityChange={(qty) => console.log(qty)}\n * onDelete={() => console.log('Eliminar')}\n * />\n * ```\n */\nexport const POSProductSidebarItems: React.FC<POSProductSidebarItemsProps> = ({\n categoryLabel,\n categoryColor = 'lime',\n productRef,\n price,\n productName,\n descriptionItems = [],\n showDescription = true,\n quantity = 0,\n minQuantity = 0,\n maxQuantity,\n onQuantityChange,\n onDelete,\n disabled = false,\n className = '',\n deleteIcon,\n}) => {\n // ===== MAPA DE COLORES PARA BADGES =====\n // Basado en Figma node 4507-28432: bg lime-100 (#ecfccb) y text lime-700 (#4d7c0f)\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n const categoryColorClasses: Record<string, { bg: string; text: string }> = {\n lime: {\n bg: 'bg-lime-100 dark:bg-lime-900/40',\n text: 'text-lime-700 dark:text-lime-300'\n },\n red: {\n bg: 'bg-red-100 dark:bg-red-900/40',\n text: 'text-red-700 dark:text-red-300'\n },\n orange: {\n bg: 'bg-orange-100 dark:bg-orange-900/40',\n text: 'text-orange-700 dark:text-orange-300'\n },\n amber: {\n bg: 'bg-amber-100 dark:bg-amber-900/40',\n text: 'text-amber-700 dark:text-amber-300'\n },\n yellow: {\n bg: 'bg-yellow-100 dark:bg-yellow-900/40',\n text: 'text-yellow-700 dark:text-yellow-300'\n },\n green: {\n bg: 'bg-green-100 dark:bg-green-900/40',\n text: 'text-green-700 dark:text-green-300'\n },\n emerald: {\n bg: 'bg-emerald-100 dark:bg-emerald-900/40',\n text: 'text-emerald-700 dark:text-emerald-300'\n },\n teal: {\n bg: 'bg-teal-100 dark:bg-teal-900/40',\n text: 'text-teal-700 dark:text-teal-300'\n },\n cyan: {\n bg: 'bg-cyan-100 dark:bg-cyan-900/40',\n text: 'text-cyan-700 dark:text-cyan-300'\n },\n sky: {\n bg: 'bg-sky-100 dark:bg-sky-900/40',\n text: 'text-sky-700 dark:text-sky-300'\n },\n blue: {\n bg: 'bg-blue-100 dark:bg-blue-900/40',\n text: 'text-blue-700 dark:text-blue-300'\n },\n indigo: {\n bg: 'bg-indigo-100 dark:bg-indigo-900/40',\n text: 'text-indigo-700 dark:text-indigo-300'\n },\n violet: {\n bg: 'bg-violet-100 dark:bg-violet-900/40',\n text: 'text-violet-700 dark:text-violet-300'\n },\n purple: {\n bg: 'bg-purple-100 dark:bg-purple-900/40',\n text: 'text-purple-700 dark:text-purple-300'\n },\n fuchsia: {\n bg: 'bg-fuchsia-100 dark:bg-fuchsia-900/40',\n text: 'text-fuchsia-700 dark:text-fuchsia-300'\n },\n pink: {\n bg: 'bg-pink-100 dark:bg-pink-900/40',\n text: 'text-pink-700 dark:text-pink-300'\n },\n rose: {\n bg: 'bg-rose-100 dark:bg-rose-900/40',\n text: 'text-rose-700 dark:text-rose-300'\n },\n zinc: {\n bg: 'bg-zinc-100 dark:bg-zinc-800/50',\n text: 'text-zinc-600 dark:text-zinc-300'\n },\n primary: {\n bg: 'bg-primary-custom-100 dark:bg-primary-custom-600/30',\n text: 'text-primary-custom-600 dark:text-primary-custom-300'\n },\n };\n\n const colors = categoryColorClasses[categoryColor] || categoryColorClasses.lime;\n\n // Handler para cambio de cantidad\n const handleQuantityChange = (newQuantity: number) => {\n if (!disabled && onQuantityChange) {\n onQuantityChange(newQuantity);\n }\n };\n\n // Handler para eliminar\n const handleDelete = () => {\n if (!disabled && onDelete) {\n onDelete();\n }\n };\n\n return (\n <div\n className={`\n flex\n flex-col\n gap-2\n w-full\n ${disabled ? 'opacity-50 pointer-events-none' : ''}\n ${className}\n `.trim().replace(/\\s+/g, ' ')}\n data-component=\"POSProductSidebarItems\"\n >\n {/* ===== BODY SECTION ===== */}\n <div className=\"flex flex-col gap-2 w-full\">\n {/* ===== PRODUCT INFO ===== */}\n <div className=\"flex flex-col gap-1 w-full\">\n {/* Row: Badge + Ref + Price - Figma node 4507:28398 */}\n <div className=\"flex items-center gap-1 w-full\">\n {/* Col: Badge + Ref - Figma node 4507:28399 */}\n <div className=\"flex items-center gap-2 flex-1 min-w-0\">\n {/* Category Badge - Figma node 4507:28432 */}\n <div\n className={`\n inline-flex\n items-center\n px-1.5\n py-1\n rounded-md\n transition-colors\n duration-150\n ${colors.bg}\n `.trim().replace(/\\s+/g, ' ')}\n >\n <span\n className={`\n text-xs\n leading-4\n font-normal\n text-center\n whitespace-nowrap\n ${colors.text}\n `.trim().replace(/\\s+/g, ' ')}\n >\n {categoryLabel}\n </span>\n </div>\n\n {/* Product Reference - Figma node 4507:28401 - Paragraph/XXSmall 10px */}\n <span className=\"text-[10px] leading-3 font-normal text-content-primary dark:text-dark-content-primary whitespace-nowrap\">\n {productRef}\n </span>\n </div>\n\n {/* Col: Price - Figma node 4507:28450 - Label/Tiny 12px Bold */}\n <div className=\"flex items-center shrink-0\">\n <span className=\"text-xs leading-4 font-bold text-content-primary dark:text-dark-content-primary whitespace-nowrap text-right\">\n {price}\n </span>\n </div>\n </div>\n\n {/* Row: Product Name - Figma node 4507:28404 - Label/Tiny 12px Bold */}\n <div className=\"flex items-start w-full\">\n <span className=\"text-xs leading-4 font-bold text-content-primary dark:text-dark-content-primary flex-1 min-w-0\">\n {productName}\n </span>\n </div>\n </div>\n\n {/* ===== DESCRIPTION SECTION ===== */}\n {/* Figma node 4507:28405 - Background tertiary con items de descripción */}\n {showDescription && descriptionItems.length > 0 && (\n <div\n className={`\n flex\n flex-col\n gap-2\n p-2\n rounded-lg\n bg-background-secondary\n dark:bg-zinc-700\n w-full\n transition-colors\n duration-150\n `.trim().replace(/\\s+/g, ' ')}\n >\n {descriptionItems.map((item, index) => (\n <div\n key={index}\n className=\"flex items-center gap-1 w-full\"\n >\n {/* Description text - Figma Body/Small 12px Regular */}\n <span className=\"flex-1 min-w-0 text-xs leading-3 font-normal text-content-primary dark:text-dark-content-primary\">\n {item.description}\n </span>\n {/* Price - Figma Body/Small Bold 12px */}\n <span className=\"text-xs leading-3 font-bold text-content-primary dark:text-dark-content-primary whitespace-nowrap text-right shrink-0\">\n {item.price}\n </span>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* ===== ACTIONS SECTION ===== */}\n {/* Figma node 4507:28412 - Quantity control + Delete button */}\n <div className=\"flex items-center justify-between w-full\">\n {/* Quantity Control - Figma width: 118px */}\n <div className=\"w-[118px]\">\n <Quantity\n value={quantity}\n min={minQuantity}\n max={maxQuantity}\n onChange={handleQuantityChange}\n disabled={disabled}\n />\n </div>\n\n {/* Delete Button - Figma node 4514:28258 - 24x24px, color red-700 (#b91c1c) */}\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={disabled}\n className={`\n flex\n items-center\n justify-center\n w-6\n h-6\n rounded-md\n text-red-700\n dark:text-red-500\n hover:text-red-800\n dark:hover:text-red-400\n hover:bg-red-50\n dark:hover:bg-red-900/20\n focus:outline-hidden\n focus:ring-2\n focus:ring-red-500/50\n dark:focus:ring-red-400/50\n focus:ring-offset-1\n focus:ring-offset-white\n dark:focus:ring-offset-dark-bg-primary\n active:scale-95\n transition-all\n duration-150\n ${disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'}\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Eliminar producto\"\n >\n {deleteIcon || <TrashIcon className=\"w-[18px] h-[21px]\" />}\n </button>\n </div>\n </div>\n );\n};\n\nPOSProductSidebarItems.displayName = 'POSProductSidebarItems';\n","import React from 'react';\nimport type { POSTableProps } from './POSTable.types';\n\n/**\n * POSTable - Sistema de visualización de mesas de restaurante\n *\n * Componente para mostrar mesas de restaurante con diferentes estados\n * (disponible, ocupada, reservada) y configuraciones de sillas según diseño de Figma.\n *\n * ⚠️ IMPORTANTE - COLORES PERSONALIZADOS DEL CLIENTE:\n * Este componente usa colores específicos hardcodeados según el diseño del cliente.\n * Estos NO son tokens del sistema de diseño general, sino colores únicos para POSTable.\n * Esta es una EXCEPCIÓN JUSTIFICADA similar a los iconos personalizados de POSTable.\n *\n * ESPECIFICACIONES PIXEL-PERFECT DE FIGMA:\n *\n * Colores exactos (ESPECÍFICOS DEL CLIENTE):\n *\n * LIGHT MODE:\n * - Available (Azul): #0e79fd (border, mesa, silla, texto) - Azul primario del sistema\n * - Available Active: Bg #dbeefe + Border #bce4ff (cuando isActive=true)\n * - Busy (Naranja): #af460e (border, mesa, silla, texto)\n * - Busy Active: Bg #fed7aa + Border #fed7aa (cuando isActive=true)\n * - Reserved (Púrpura): #7e22ce (border, mesa, silla, texto)\n * - Reserved Active: Bg #e9d5ff + Border #e9d5ff (cuando isActive=true)\n *\n * DARK MODE (colores más brillantes para mejor visibilidad):\n * - Available (Azul claro): #93d1fd (border, mesa, silla, texto)\n * - Available Active: Bg #1e3a5f + Border #1e3a5f (cuando isActive=true)\n * - Busy (Naranja/Amarillo): #f5a927 (border, mesa, silla, texto)\n * - Busy Active: Bg #5c3a1e + Border #5c3a1e (cuando isActive=true)\n * - Reserved (Púrpura claro): #c084fc (border, mesa, silla, texto)\n * - Reserved Active: Bg #3b1f5c + Border #3b1f5c (cuando isActive=true)\n *\n * - Texto del label: Mismo color del estado (está FUERA de la mesa según Figma)\n *\n * Dimensiones exactas:\n * - Container: 160x160px, border-radius: 8px, border: 2px\n * - Inner container: 134x134px, gap: 4px\n * - Mesa Square: 64x64px, border-radius: 4px\n * - Mesa Circle: 64x64px, border-radius: 9999px\n * - Mesa Rectangle: 80x64px, border-radius: 4px\n * - Mesa Oval: 80x64px, border-radius: 24px\n * - Silla: 28x22px, border-radius: 4px\n * - Silla Respaldo (top): 28x16px (72.73% height)\n * - Silla Asiento (bottom): 24x14px (85.71% width, 63.64% height)\n * - Gap: 4px entre todos los elementos\n *\n * Tipografía:\n * - Label: 10px / 12px line-height, weight: 400, font: SiesaBT\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Valores exactos de Figma con notación [px]\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <POSTable\n * tableNumber=\"12\"\n * status=\"available\"\n * shape=\"square\"\n * chairs={4}\n * onClick={() => console.log('Mesa seleccionada')}\n * />\n * ```\n */\nexport const POSTable: React.FC<POSTableProps> = ({\n tableNumber,\n status = 'available',\n shape = 'square',\n chairs = 4,\n showChairs = true,\n isActive = false,\n onClick,\n className = '',\n disabled = false,\n children,\n}) => {\n // ===== COLORES POR ESTADO (VALORES EXACTOS DE FIGMA) =====\n // ⚠️ NOTA: Estos colores son ESPECÍFICOS del cliente (excepción justificada)\n // NO son tokens del sistema general de diseño\n // Light Mode: #0e79fd (azul primario), #af460e (naranja), #7e22ce (púrpura)\n // Dark Mode: #93d1fd (azul claro), #f5a927 (naranja/amarillo), #c084fc (púrpura claro)\n const statusColors = {\n available: {\n // Enabled state - Light: #0e79fd (azul primario del sistema), Dark: #93d1fd\n border: 'border-[#0e79fd]',\n borderDark: 'dark:border-[#93d1fd]',\n bgEnabled: 'bg-transparent',\n bgEnabledDark: 'dark:bg-transparent',\n // Actived state - Light: Bg #dbeefe + Border #bce4ff según Figma\n bgActive: 'bg-primary-custom-100',\n bgActiveDark: 'dark:bg-[#1e3a5f]',\n borderActive: 'border-[#bce4ff]',\n borderActiveDark: 'dark:border-[#1e3a5f]',\n // Table and chairs - Light: #0e79fd, Dark: #93d1fd\n table: 'bg-[#0e79fd]',\n tableDark: 'dark:bg-[#93d1fd]',\n chair: 'bg-[#0e79fd]',\n chairDark: 'dark:bg-[#93d1fd]',\n // Text (mismo color del estado - label está FUERA de la mesa según Figma)\n text: 'text-[#0e79fd]',\n textDark: 'dark:text-[#93d1fd]',\n // Focus ring\n focusRing: 'focus:ring-[#93d1fd]',\n focusRingDark: 'dark:focus:ring-[#0e79fd]',\n },\n busy: {\n // Enabled state - Light: #af460e, Dark: #f5a927\n border: 'border-[#af460e]',\n borderDark: 'dark:border-[#f5a927]',\n bgEnabled: 'bg-transparent',\n bgEnabledDark: 'dark:bg-transparent',\n // Actived state\n bgActive: 'bg-[#fed7aa]',\n bgActiveDark: 'dark:bg-[#5c3a1e]',\n borderActive: 'border-[#fed7aa]',\n borderActiveDark: 'dark:border-[#5c3a1e]',\n // Table and chairs - Light: #af460e, Dark: #f5a927\n table: 'bg-[#af460e]',\n tableDark: 'dark:bg-[#f5a927]',\n chair: 'bg-[#af460e]',\n chairDark: 'dark:bg-[#f5a927]',\n // Text (mismo color del estado - label está FUERA de la mesa según Figma)\n text: 'text-[#af460e]',\n textDark: 'dark:text-[#f5a927]',\n // Focus ring\n focusRing: 'focus:ring-[#f5a927]',\n focusRingDark: 'dark:focus:ring-[#af460e]',\n },\n reserved: {\n // Enabled state - Light: #7e22ce, Dark: #c084fc\n border: 'border-[#7e22ce]',\n borderDark: 'dark:border-[#c084fc]',\n bgEnabled: 'bg-transparent',\n bgEnabledDark: 'dark:bg-transparent',\n // Actived state\n bgActive: 'bg-[#e9d5ff]',\n bgActiveDark: 'dark:bg-[#3b1f5c]',\n borderActive: 'border-[#e9d5ff]',\n borderActiveDark: 'dark:border-[#3b1f5c]',\n // Table and chairs - Light: #7e22ce, Dark: #c084fc\n table: 'bg-[#7e22ce]',\n tableDark: 'dark:bg-[#c084fc]',\n chair: 'bg-[#7e22ce]',\n chairDark: 'dark:bg-[#c084fc]',\n // Text (mismo color del estado - label está FUERA de la mesa según Figma)\n text: 'text-[#7e22ce]',\n textDark: 'dark:text-[#c084fc]',\n // Focus ring\n focusRing: 'focus:ring-[#c084fc]',\n focusRingDark: 'dark:focus:ring-[#7e22ce]',\n },\n };\n\n // ===== CLASES DE FORMA (ESPECIFICACIONES EXACTAS DE FIGMA) =====\n const shapeClasses = {\n square: {\n container: 'rounded-[4px]',\n table: 'w-[64px] h-[64px] rounded-[4px]',\n },\n circle: {\n container: 'rounded-[9999px]',\n table: 'w-[64px] h-[64px] rounded-[9999px]',\n },\n rectangle: {\n container: 'rounded-[4px]',\n table: 'w-[80px] h-[64px] rounded-[4px]',\n },\n oval: {\n container: 'rounded-3xl',\n table: 'w-[80px] h-[64px] rounded-3xl',\n },\n };\n\n // ===== COMPONENTE SILLA (ESPECIFICACIONES EXACTAS DE FIGMA) =====\n const Chair: React.FC<{ rotation: number }> = ({ rotation }) => (\n <div\n className=\"w-[28px] h-[22px]\"\n style={{ transform: `rotate(${rotation}deg)` }}\n aria-hidden=\"true\"\n >\n {/* Respaldo (parte superior) - 72.73% height */}\n <div\n className={`\n absolute\n top-0\n left-0\n right-0\n h-[16px]\n rounded-t-[4px]\n ${statusColors[status].chair}\n ${statusColors[status].chairDark}\n `}\n />\n {/* Asiento (parte inferior) - 85.71% width, 63.64% height */}\n <div\n className={`\n absolute\n bottom-0\n left-[7.14%]\n right-[7.14%]\n h-[14px]\n rounded-b-[4px]\n ${statusColors[status].chair}\n ${statusColors[status].chairDark}\n `}\n />\n </div>\n );\n\n // ===== HANDLER DE CLICK =====\n const handleClick = () => {\n if (!disabled && onClick) {\n onClick();\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if ((e.key === 'Enter' || e.key === ' ') && !disabled && onClick) {\n e.preventDefault();\n onClick();\n }\n };\n\n // ===== CLASES DEL CONTAINER (160x160px según Figma) =====\n const containerClasses = [\n // Dimensiones exactas del container\n 'w-[160px]',\n 'h-[160px]',\n 'shrink-0',\n\n // Estructura\n 'relative',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'p-0',\n\n // Borde (2px según Figma)\n 'border-2',\n 'box-border',\n\n // Border radius (8px según Figma)\n 'rounded-[8px]',\n\n // Colores del borde y fondo según estado\n isActive ? statusColors[status].borderActive : statusColors[status].border,\n isActive ? statusColors[status].borderActiveDark : statusColors[status].borderDark,\n isActive ? statusColors[status].bgActive : statusColors[status].bgEnabled,\n isActive ? statusColors[status].bgActiveDark : statusColors[status].bgEnabledDark,\n\n // Focus rings adaptativos (siguiendo patrón de Button)\n 'focus:outline-hidden',\n 'focus:ring-2',\n statusColors[status].focusRing,\n statusColors[status].focusRingDark,\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-dark-bg-primary',\n\n // Transiciones\n 'transition-all',\n 'duration-150',\n\n // Interactividad\n onClick && !disabled ? 'cursor-pointer' : '',\n onClick && !disabled ? 'hover:scale-105' : '',\n onClick && !disabled ? 'active:scale-95' : '',\n disabled ? 'opacity-50 cursor-not-allowed' : '',\n\n // Clases adicionales\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== RENDER =====\n return (\n <button\n className={containerClasses}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n type=\"button\"\n aria-label={`Mesa ${tableNumber} - ${\n status === 'available' ? 'Disponible' : status === 'busy' ? 'Ocupada' : 'Reservada'\n }`}\n >\n {/* INNER CONTAINER (134x134px según Figma) */}\n <div className=\"flex flex-col gap-[4px] items-center justify-center w-[134px] h-[134px] shrink-0\">\n {/* FILA DE SILLAS SUPERIORES */}\n {showChairs && (chairs === 2 || chairs === 4 || chairs === 6 || chairs === 8) && (\n <div className=\"flex gap-[4px] items-center justify-center shrink-0\">\n {chairs >= 6 && (\n <>\n <Chair rotation={0} />\n <Chair rotation={0} />\n </>\n )}\n {chairs === 2 && <Chair rotation={0} />}\n {chairs === 4 && <Chair rotation={0} />}\n </div>\n )}\n\n {/* FILA CENTRAL CON MESA Y SILLAS LATERALES */}\n <div className=\"flex gap-[4px] items-center justify-center shrink-0\">\n {/* COLUMNA IZQUIERDA - SILLAS */}\n {showChairs && (chairs === 4 || chairs === 6 || chairs === 8) && (\n <div className=\"flex flex-col gap-[4px] items-start justify-center shrink-0\">\n {chairs >= 8 && (\n <>\n <Chair rotation={270} />\n <Chair rotation={270} />\n </>\n )}\n {(chairs === 4 || chairs === 6) && <Chair rotation={270} />}\n </div>\n )}\n\n {/* MESA (sin label - el label va fuera según Figma) */}\n <div className=\"flex flex-col gap-[4px] items-start justify-center shrink-0\">\n <div className=\"flex items-center shrink-0\">\n <div\n className={`\n ${shapeClasses[shape].table}\n ${statusColors[status].table}\n ${statusColors[status].tableDark}\n shrink-0\n `}\n />\n </div>\n </div>\n\n {/* COLUMNA DERECHA - SILLAS */}\n {showChairs && (chairs === 4 || chairs === 6 || chairs === 8) && (\n <div className=\"flex flex-col gap-[4px] items-start justify-center shrink-0\">\n {chairs >= 8 && (\n <>\n <Chair rotation={90} />\n <Chair rotation={90} />\n </>\n )}\n {(chairs === 4 || chairs === 6) && <Chair rotation={90} />}\n </div>\n )}\n </div>\n\n {/* FILA DE SILLAS INFERIORES */}\n {showChairs && (chairs === 2 || chairs === 4 || chairs === 6 || chairs === 8) && (\n <div className=\"flex gap-[4px] items-center justify-center shrink-0\">\n {chairs >= 6 && (\n <>\n <Chair rotation={180} />\n <Chair rotation={180} />\n </>\n )}\n {chairs === 2 && <Chair rotation={180} />}\n {chairs === 4 && <Chair rotation={180} />}\n </div>\n )}\n </div>\n\n {/* LABEL DE NÚMERO DE MESA - Debajo del conjunto mesa+sillas según Figma */}\n <div\n className={`\n flex\n flex-col\n justify-center\n leading-0\n not-italic\n text-ellipsis\n overflow-hidden\n min-w-full\n text-center\n whitespace-nowrap\n shrink-0\n text-[10px]\n font-normal\n ${statusColors[status].text}\n ${statusColors[status].textDark}\n `}\n >\n <p className=\"leading-[12px] text-ellipsis overflow-hidden\">\n Mesa {tableNumber}\n </p>\n {children}\n </div>\n </button>\n );\n};\n","import React, { createContext, useContext, useEffect, useState } from 'react';\n\nexport type Theme = 'light' | 'dark';\n\ninterface ThemeContextType {\n theme: Theme;\n toggleTheme: () => void;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n defaultTheme?: Theme;\n}\n\n/**\n * ThemeProvider - Proveedor de contexto para el tema de la aplicación\n *\n * Maneja el estado del tema (light/dark) y lo persiste en localStorage.\n * Aplica la clase 'dark' al elemento HTML root cuando el tema es dark.\n *\n * @example\n * ```tsx\n * <ThemeProvider defaultTheme=\"light\">\n * <App />\n * </ThemeProvider>\n * ```\n */\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n children,\n defaultTheme = 'light'\n}) => {\n const [theme, setThemeState] = useState<Theme>(() => {\n // Intenta obtener el tema del localStorage\n if (typeof window !== 'undefined') {\n const savedTheme = localStorage.getItem('siesa-ui-theme') as Theme;\n return savedTheme || defaultTheme;\n }\n return defaultTheme;\n });\n\n useEffect(() => {\n // Aplica o remueve la clase 'dark' del elemento root\n const root = window.document.documentElement;\n\n if (theme === 'dark') {\n root.classList.add('dark');\n } else {\n root.classList.remove('dark');\n }\n\n // Guarda el tema en localStorage\n localStorage.setItem('siesa-ui-theme', theme);\n }, [theme]);\n\n const toggleTheme = () => {\n setThemeState((prev) => (prev === 'light' ? 'dark' : 'light'));\n };\n\n const setTheme = (newTheme: Theme) => {\n setThemeState(newTheme);\n };\n\n return (\n <ThemeContext.Provider value={{ theme, toggleTheme, setTheme }}>\n {children}\n </ThemeContext.Provider>\n );\n};\n\n/**\n * useTheme - Hook para acceder al contexto del tema\n *\n * @returns {ThemeContextType} Objeto con el tema actual y funciones para modificarlo\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { theme, toggleTheme } = useTheme();\n *\n * return (\n * <button onClick={toggleTheme}>\n * Tema actual: {theme}\n * </button>\n * );\n * }\n * ```\n */\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n\n if (context === undefined) {\n throw new Error('useTheme debe ser usado dentro de un ThemeProvider');\n }\n\n return context;\n};\n"],"names":["Button","type","size","iconOnly","leftIcon","rightIcon","children","disabled","className","onClick","htmlType","fullWidth","ariaLabel","badge","badgeCount","badgeColor","rest","sizeClasses","iconSizeClasses","textSizeClasses","typeClasses","baseClasses","widthClass","buttonClasses","renderIcon","icon","jsx","renderContent","jsxs","Fragment","badgeColorClasses","badgeColors","renderBadge","Input","forwardRef","label","labelSecondary","helperText","error","errorMessage","id","props","ref","inputId","baseInputClasses","interactiveClasses","errorClasses","containerClasses","existingClassName","cloneElement","Textarea","description","resize","rows","textareaId","baseTextareaClasses","resizeClasses","Checkbox","checked","indeterminate","onChange","inputRef","useRef","combinedRef","checkboxId","useEffect","checkboxClasses","Radio","value","name","radioId","baseRadioClasses","checkedClasses","Switch","labelPosition","switchId","baseTrackClasses","getTrackStateClasses","getButtonClasses","baseButtonClasses","positionClass","trackClasses","LabelContent","SwitchInput","Avatar","src","alt","initials","containerSizeClasses","Divider","finalClasses","DescriptionList","term","details","columnClasses","Alert","title","actions","onCancel","onConfirm","cancelText","confirmText","actionButtons","Badge","color","count","colors","Quantity","controlledValue","defaultValue","min","max","linkText","onLinkClick","internalValue","setInternalValue","useState","isControlled","currentValue","handleValueChange","newValue","clampedValue","handleDecrement","handleIncrement","isDecrementDisabled","isIncrementDisabled","MinusIcon","PlusIcon","borderClass","hoverClass","focusClass","ChevronDownIcon","Dropdown","variant","items","controlledOpen","onOpenChange","menuClassName","placeholder","internalOpen","setInternalOpen","menuPosition","setMenuPosition","dropdownRef","menuRef","isOpen","calculateMenuPosition","useCallback","triggerRect","viewportWidth","viewportHeight","menuWidth","menuHeight","spaceBelow","spaceAbove","spaceRight","spaceLeft","openAbove","openLeft","handleToggle","newOpen","handleClickOutside","event","handleEscape","handleItemClick","item","triggerClasses","menuClasses","index","DropdownDivider","DropdownHeading","DropdownItem","shortcut","selected","itemClasses","headingClasses","dividerClasses","Notification","colorClasses","dynamicAriaLabel","displayCount","ArrowLeftIcon","ArrowRightIcon","Pagination","currentPage","totalPages","onPageChange","backText","nextText","siblingCount","showBackButton","showNextButton","paginationRange","useMemo","totalBlocks","_","i","leftSiblingIndex","rightSiblingIndex","shouldShowLeftDots","shouldShowRightDots","firstPageIndex","lastPageIndex","leftItemCount","rightItemCount","rightRange","middleRange","handlePageChange","page","PageButton","isActive","buttonAriaLabel","isDots","ChevronUpDownIcon","CheckIcon","Select","options","showLabel","showDescription","menuHeader","triggerClassName","required","setIsOpen","selectedValue","setSelectedValue","focusedIndex","setFocusedIndex","containerRef","triggerRef","handleKeyDown","prev","handleSelect","selectedOption","opt","toggleMenu","option","finalTriggerClasses","finalMenuClasses","baseMenuItemClasses","getMenuItemClasses","isSelected","isFocused","hoverClasses","disabledClasses","iconClasses","checkIconClasses","ChevronUpIcon","TableHeader","column","sortable","sorted","sortDirection","onSort","combinedClasses","e","TableCell","align","width","isStriped","rowIndex","alignClasses","stripedBg","previousLabel","nextLabel","pageNumbers","pages","Table","columns","data","showBorder","showShadow","externalSortColumn","externalSortDirection","emptyMessage","loading","loadingRows","pagination","internalSortColumn","setInternalSortColumn","internalSortDirection","setInternalSortDirection","sortColumn","handleSort","columnAccessor","newDirection","getCellValue","row","accessor","colIndex","content","Tab","active","contentBaseClasses","contentStateClasses","textClasses","badgeClasses","indicatorClasses","contentFinalClasses","Tabs","activeId","defaultActiveId","internalActiveId","setInternalActiveId","currentActiveId","handleTabClick","itemWidthClass","ShoppingCartIcon","BellIcon","MagnifyingGlassIcon","ExclamationTriangleIcon","ArrowLeftStartOnRectangleIcon","Navbar","logo","productName","environmentBadge","userDropdown","notifications","hideActionButtons","leadingAction","siesaLogo","showBusinessLogo","showSiesaLogoLeading","showSiesaLogoTrailing","onNavigationClick","onSearchClick","onCartClick","onNotificationsClick","actionButtonClasses","navigationButtonClasses","isMobile","isDesktop","isTablet","isResponsive","NavigationButton","buttonContent","BusinessLogo","logoContent","SiesaLogoLeading","logoFull","logoMobile","SiesaLogoTrailing","responsive","dividerContent","ProductName","nameContent","EnvironmentBadge","SearchButton","CartButton","NotificationsButton","UserDropdown","dropdownButtonClasses","renderFullDropdown","NavigationBar","activeItemId","onItemClick","renderItem","itemContainerClasses","iconContainerClasses","labelClasses","destinationsClasses","ConventionIcon","lightColor","darkColor","POSConvention","status","config","XMarkIcon","CalendarIcon","NoSymbolIcon","UsersIcon","POSLocationButton","locationName","state","capacity","StatusIcon","backgroundClasses","capacityText","POSNumberButton","border","POSProductButton","image","POSProductCard","price","buttonText","onAddClick","onCardClick","stateClasses","cardClasses","handleCardClick","handleButtonClick","TrashIcon","POSProductSidebarItems","categoryLabel","categoryColor","productRef","descriptionItems","quantity","minQuantity","maxQuantity","onQuantityChange","onDelete","deleteIcon","categoryColorClasses","handleQuantityChange","newQuantity","handleDelete","POSTable","tableNumber","shape","chairs","showChairs","statusColors","shapeClasses","Chair","rotation","handleClick","ThemeContext","createContext","ThemeProvider","defaultTheme","theme","setThemeState","root","toggleTheme","setTheme","newTheme","useTheme","context","useContext"],"mappings":";;AAmFO,MAAMA,IAAgC,CAAC;AAAA,EAC5C,MAA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/Y,EAACsY,GAAa,UAAb,EAAsB,OAAO,EAAE,OAAAI,GAAO,aAAAG,GAAa,UAAAC,KACjD,UAAAla,GACH;AAEJ,GAoBaoa,KAAW,MAAwB;AAC9C,QAAMC,IAAUC,GAAWZ,EAAY;AAEvC,MAAIW,MAAY;AACd,UAAM,IAAI,MAAM,oDAAoD;AAGtE,SAAOA;AACT;"}
1
+ {"version":3,"file":"siesa-ui-kit.mjs","sources":["../src/components/Button/Button.tsx","../src/components/Input/Input.tsx","../src/components/Textarea/Textarea.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Radio/Radio.tsx","../src/components/Switch/Switch.tsx","../src/components/Avatar/Avatar.tsx","../src/components/Divider/Divider.tsx","../src/components/DescriptionList/DescriptionList.tsx","../src/components/Alert/Alert.tsx","../src/components/Badge/Badge.tsx","../src/components/Quantity/Quantity.tsx","../src/components/NavigationRailItem/NavigationRailItem.tsx","../src/components/Dropdown/icons.tsx","../src/components/Dropdown/Dropdown.tsx","../src/components/DropdownItemCollapsible/icons.tsx","../src/components/DropdownItemCollapsible/DropdownItemCollapsible.tsx","../src/components/DropdownItemHeading/icons.tsx","../src/components/DropdownItemHeading/DropdownItemHeading.tsx","../src/components/Notification/Notification.tsx","../src/components/Pagination/icons.tsx","../src/components/Pagination/Pagination.tsx","../node_modules/@heroicons/react/24/outline/esm/CheckIcon.js","../node_modules/@heroicons/react/24/outline/esm/ChevronUpDownIcon.js","../node_modules/@heroicons/react/24/outline/esm/ClockIcon.js","../src/components/Select/icons.tsx","../src/components/Select/Select.tsx","../src/components/NavigationRail/NavigationRail.tsx","../src/components/NavigationRailPanel/NavigationRailPanel.tsx","../node_modules/@heroicons/react/20/solid/esm/ChevronLeftIcon.js","../node_modules/@heroicons/react/20/solid/esm/ChevronRightIcon.js","../node_modules/@heroicons/react/20/solid/esm/MagnifyingGlassIcon.js","../src/components/NavigationRailTypes/icons.tsx","../src/components/NavigationRailTypes/NavigationRailTypes.tsx","../src/components/NavigationRailGroup/icons.tsx","../src/components/NavigationRailGroup/NavigationRailGroup.tsx","../src/components/Table/Table.tsx","../src/components/Tabs/Tabs.tsx","../src/components/Navbar/icons.tsx","../src/components/Navbar/Navbar.tsx","../src/components/NavigationBar/NavigationBar.tsx","../src/components/POSConvention/icons.tsx","../src/components/POSConvention/POSConvention.tsx","../src/components/POSLocationButton/icons.tsx","../src/components/POSLocationButton/POSLocationButton.tsx","../src/components/POSNumberButton/POSNumberButton.tsx","../src/components/POSProductButton/POSProductButton.tsx","../src/components/POSProductCard/icons.tsx","../src/components/POSProductCard/POSProductCard.tsx","../src/components/POSProductSidebarItems/icons.tsx","../src/components/POSProductSidebarItems/POSProductSidebarItems.tsx","../src/components/POSTable/POSTable.tsx","../src/components/LoginView/icons.tsx","../src/components/LoginView/LoginView.tsx","../src/components/SignUpView/icons.tsx","../src/components/SignUpView/SignUpView.tsx","../node_modules/lucide-react/dist/esm/shared/src/utils.js","../node_modules/lucide-react/dist/esm/defaultAttributes.js","../node_modules/lucide-react/dist/esm/Icon.js","../node_modules/lucide-react/dist/esm/createLucideIcon.js","../node_modules/lucide-react/dist/esm/icons/chevron-down.js","../node_modules/lucide-react/dist/esm/icons/loader-circle.js","../node_modules/lucide-react/dist/esm/icons/search.js","../node_modules/lucide-react/dist/esm/icons/x.js","../node_modules/clsx/dist/clsx.mjs","../node_modules/tailwind-merge/dist/bundle-mjs.mjs","../src/components/LookupField/utils/cn.ts","../src/components/LookupField/utils/templateInterpolation.ts","../src/components/LookupField/utils/filterBuilder.ts","../src/components/LookupField/hooks/useDebouncedSearch.ts","../src/components/LookupField/hooks/useKeyboardNavigation.ts","../node_modules/react-i18next/dist/es/utils.js","../node_modules/react-i18next/dist/es/unescape.js","../node_modules/react-i18next/dist/es/defaults.js","../node_modules/react-i18next/dist/es/i18nInstance.js","../node_modules/react-i18next/dist/es/context.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../node_modules/use-sync-external-store/shim/index.js","../node_modules/react-i18next/dist/es/useTranslation.js","../src/components/LookupField/hooks/useTranslationSafe.ts","../src/components/LookupField/hooks/useClickOutside.ts","../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs","../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","../node_modules/@floating-ui/react/dist/floating-ui.react.mjs","../src/components/LookupField/hooks/useFloatingDropdown.ts","../node_modules/@tanstack/virtual-core/dist/esm/utils.js","../node_modules/@tanstack/virtual-core/dist/esm/index.js","../node_modules/@tanstack/react-virtual/dist/esm/index.js","../src/components/LookupField/hooks/useVirtualList.ts","../src/components/LookupField/parts/SearchInput.tsx","../src/components/LookupField/parts/LiveRegion.tsx","../src/components/LookupField/LookupField.tsx","../src/components/LookupField/services/api.types.ts","../src/components/LookupField/services/api.ts","../src/views/LayoutBase/LayoutBase.tsx","../src/views/ListView/icons.tsx","../src/views/ListView/ListView.tsx","../src/views/LoginView/icons.tsx","../src/views/LoginView/LoginView.tsx","../src/views/ProductsView/icons.tsx","../src/views/ProductsView/ProductsView.tsx","../src/views/RecoverPasswordView/icons.tsx","../src/views/RecoverPasswordView/RecoverPasswordView.tsx","../src/views/SignUpView/icons.tsx","../src/views/SignUpView/SignUpView.tsx","../src/views/TableLayoutView/icons.tsx","../src/views/TableLayoutView/TableLayoutView.tsx","../src/context/ThemeContext.tsx"],"sourcesContent":["import React from 'react';\nimport type { ButtonProps, ButtonType } from './Button.types';\n\n/**\n * Componente Button del sistema de diseño Siesa\n *\n * Implementación pixel-perfect basada en Figma (node 4001-17240)\n * con soporte completo para todos los estados, tamaños y variantes.\n *\n * **Variantes (type):**\n * - `default`: Botón primario con fondo sólido (#0e79fd) y borde (#3c9bf6)\n * - Sombra interna para efecto de profundidad\n * - Usar para acciones principales (Guardar, Enviar, Confirmar)\n * - `outline-solid`: Botón secundario con borde (#93d1fd) y shadow-xs\n * - Usar para acciones secundarias (Cancelar, Volver)\n * - `plain`: Botón terciario sin borde visible\n * - Hover overlay sutil\n * - Usar para acciones sutiles (Cerrar, Ver más, Links)\n *\n * **Tamaños (size):**\n * - `xs` (24px): Espacios muy compactos, inline actions. Padding: 8px h, 4px v\n * - `sm` (28px): Barras de herramientas, acciones secundarias. Padding: 8px h, 4px v\n * - `base` (32px): Tamaño estándar para la mayoría de casos. Padding: 10px h, 6px v\n * - `l` (36px): Botones destacados, CTAs. Padding: 12px h, 8px v\n * - `xl` (40px): Heroes, landing pages. Padding: 16px h, 8px v\n *\n * **Estados:**\n * - `default`: Estado normal con colores base\n * - `hover`: Overlay visual sutil (bg-primary-custom-500 para default)\n * - `focus`: Focus ring de 4px (#60b6fa) con offset de 2px (#dbeefe)\n * - `active`: Scale animation (scale-95) para feedback táctil\n * - `disabled`: Opacity 50% con pointer-events-none\n *\n * **Badges de notificación:**\n * - `badge`: Muestra un dot de notificación en la esquina superior derecha\n * - `badgeCount`: Muestra un badge con número (99+ para >99)\n * - `badgeColor`: Color del badge (por defecto: red - #b91c1c)\n *\n * **Especificaciones de Figma:**\n * - Border radius: 6px (rounded-md)\n * - Tipografía: Label Small (14px Bold) para sm/base/l/xl, Label Tiny (12px Bold) para xs\n * - Iconos: 16x16px en todos los tamaños\n * - Gap entre elementos: 8px (xs/sm/base), 12px (l/xl)\n *\n * **Dark Mode:**\n * Los botones invierten colores en dark mode:\n * - Default: fondo celeste claro (#bfe2fe), texto azul (#0e79fd), borde celeste (#93d1fd)\n * - Outline: texto celeste (#93d1fd), borde azul (#0f6ae3)\n * - Plain: texto celeste (#93d1fd), hover overlay blanco 20%\n * - Focus ring adaptativo con offset oscuro\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/shadows.md - Sistema de sombras (shadow-button-inset, shadow-sm)\n * @see docs/typography.md - Sistema tipográfico (Label Small/Tiny)\n * @see docs/spacing.md - Sistema de espaciado\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4001-17240 - Diseño Figma\n *\n * @example\n * ```tsx\n * // Botón primario con icono\n * <Button type=\"default\" size=\"base\" leftIcon={<SaveIcon />}>\n * Guardar\n * </Button>\n *\n * // Botón secundario\n * <Button type=\"outline\" size=\"base\">\n * Cancelar\n * </Button>\n *\n * // Botón solo icono para barra de herramientas\n * <Button type=\"plain\" size=\"sm\" iconOnly leftIcon={<CloseIcon />} ariaLabel=\"Cerrar\" />\n *\n * // Botón con badge de notificación (dot)\n * <Button type=\"default\" size=\"base\" badge>\n * Notificaciones\n * </Button>\n *\n * // Botón con badge contador\n * <Button type=\"default\" size=\"base\" badgeCount={5} badgeColor=\"red\">\n * Mensajes\n * </Button>\n * ```\n */\nexport const Button: React.FC<ButtonProps> = ({\n type = 'default',\n size = 'base',\n iconOnly = false,\n leftIcon,\n rightIcon,\n children,\n disabled = false,\n className = '',\n onClick,\n htmlType = 'button',\n fullWidth = false,\n ariaLabel,\n badge = false,\n badgeCount,\n badgeColor = 'red',\n ...rest\n}) => {\n // ===== CLASES DE TAMAÑO =====\n const sizeClasses = {\n xs: iconOnly ? 'h-6 w-6 p-1' : 'h-6 py-1 px-2 gap-2',\n sm: iconOnly ? 'h-7 w-7 p-1.5' : 'h-7 py-1 px-2 gap-2',\n base: iconOnly ? 'h-8 w-8 p-2' : 'h-8 py-1.5 px-2.5 gap-2',\n l: iconOnly ? 'h-9 w-9 p-2.5' : 'h-9 py-2 px-3 gap-3',\n xl: iconOnly ? 'h-10 w-10 p-3' : 'h-10 py-2 px-4 gap-3',\n };\n\n // ===== CLASES DE TAMAÑO DE ICONO =====\n const iconSizeClasses = {\n xs: 'w-4 h-4',\n sm: 'w-4 h-4',\n base: 'w-4 h-4',\n l: 'w-4 h-4',\n xl: 'w-4 h-4',\n };\n\n // ===== CLASES DE TAMAÑO DE TEXTO =====\n // Usando el sistema de tipografía Label del design system (typography.md)\n const textSizeClasses = {\n xs: 'text-xs', // Label Tiny - 12px\n sm: 'text-sm', // Label Small - 14px\n base: 'text-sm', // Label Small - 14px (default para base)\n l: 'text-sm', // Label Small - 14px (corregido según Figma)\n xl: 'text-sm', // Label Small - 14px (corregido según Figma)\n };\n\n // ===== CLASES DE TIPO (Default, Outline, Plain) =====\n // Especificaciones de Figma node 4001-17240\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n // Dark mode: Los botones invierten colores (fondo claro, texto oscuro)\n // - Light: fondo #0e79fd (azul), texto #eff8ff (blanco)\n // - Dark: fondo #bfe2fe (celeste claro), texto #0e79fd (azul)\n const typeClasses: Record<ButtonType, string> = {\n default: `\n bg-primary-custom-600\n text-primary-inverse-content\n border\n border-primary-inverse-border\n shadow-button-inset\n hover:bg-primary-custom-500\n active:scale-95\n transition-all\n duration-150\n dark:bg-dark-bg-inverse\n dark:text-dark-content-inverse\n dark:border-dark-border-inverse\n dark:hover:bg-dark-bg-inverse/90\n `,\n outline: `\n bg-transparent\n text-primary-custom-600\n border\n border-primary-custom-300\n shadow-xs\n hover:bg-primary-custom-100\n active:scale-95\n transition-all\n duration-150\n dark:text-dark-content-custom\n dark:border-dark-border-custom\n dark:hover:bg-dark-bg-custom/20\n `,\n 'outline-solid': `\n bg-transparent\n text-primary-custom-600\n border\n border-primary-custom-300\n shadow-xs\n hover:bg-primary-custom-100\n active:scale-95\n transition-all\n duration-150\n dark:text-dark-content-custom\n dark:border-dark-border-custom\n dark:hover:bg-dark-bg-custom/20\n `,\n plain: `\n bg-transparent\n text-primary-custom-600\n border\n border-transparent\n hover:bg-hover-overlay\n active:scale-95\n transition-all\n duration-150\n dark:text-dark-content-custom\n dark:hover:bg-hover-overlay-dark\n `,\n };\n\n // ===== CLASES BASE =====\n // Especificaciones de Figma: Focus ring = 4px spread primary-custom-400 + 2px offset primary-custom-100\n // Dark mode: Focus ring adaptativo con offset oscuro\n const baseClasses = `\n inline-flex\n items-center\n justify-center\n rounded-md\n font-bold\n whitespace-nowrap\n focus:outline-hidden\n focus:ring-4\n focus:ring-primary-custom-400\n focus:ring-offset-2\n focus:ring-offset-primary-custom-100\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n disabled:opacity-50\n disabled:cursor-not-allowed\n disabled:pointer-events-none\n `;\n\n // ===== CLASE FULL WIDTH =====\n const widthClass = fullWidth ? 'w-full' : '';\n\n // ===== COMBINAR TODAS LAS CLASES =====\n const buttonClasses = [\n baseClasses,\n sizeClasses[size],\n typeClasses[type],\n widthClass,\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== RENDERIZAR ICONO =====\n const renderIcon = (icon: React.ReactNode) => {\n if (!icon) return null;\n return (\n <span className={`inline-flex items-center justify-center ${iconSizeClasses[size]}`}>\n {icon}\n </span>\n );\n };\n\n // ===== RENDERIZAR CONTENIDO =====\n const renderContent = () => {\n // Si es iconOnly, solo mostrar leftIcon\n if (iconOnly) {\n return renderIcon(leftIcon);\n }\n\n // Si tiene texto y/o iconos\n return (\n <>\n {leftIcon && renderIcon(leftIcon)}\n {children && <span className={textSizeClasses[size]}>{children}</span>}\n {rightIcon && renderIcon(rightIcon)}\n </>\n );\n };\n\n // ===== MAPA DE COLORES DE BADGE =====\n // Basado en el componente Badge existente\n const badgeColorClasses: Record<string, { bg: string; text: string }> = {\n zinc: { bg: 'bg-zinc-600', text: 'text-white' },\n red: { bg: 'bg-red-700', text: 'text-white' },\n orange: { bg: 'bg-orange-700', text: 'text-white' },\n amber: { bg: 'bg-amber-700', text: 'text-white' },\n yellow: { bg: 'bg-yellow-700', text: 'text-white' },\n lime: { bg: 'bg-lime-700', text: 'text-white' },\n green: { bg: 'bg-green-700', text: 'text-white' },\n emerald: { bg: 'bg-emerald-700', text: 'text-white' },\n teal: { bg: 'bg-teal-700', text: 'text-white' },\n cyan: { bg: 'bg-cyan-700', text: 'text-white' },\n sky: { bg: 'bg-sky-700', text: 'text-white' },\n blue: { bg: 'bg-blue-700', text: 'text-white' },\n indigo: { bg: 'bg-indigo-700', text: 'text-white' },\n violet: { bg: 'bg-violet-700', text: 'text-white' },\n purple: { bg: 'bg-purple-700', text: 'text-white' },\n fuchsia: { bg: 'bg-fuchsia-700', text: 'text-white' },\n pink: { bg: 'bg-pink-700', text: 'text-white' },\n rose: { bg: 'bg-rose-700', text: 'text-white' },\n primary: { bg: 'bg-primary-custom-600', text: 'text-white' },\n secondary: { bg: 'bg-zinc-600', text: 'text-white' },\n tertiary: { bg: 'bg-zinc-600', text: 'text-white' },\n };\n\n const badgeColors = badgeColorClasses[badgeColor] || badgeColorClasses.red;\n\n // ===== RENDERIZAR BADGE =====\n const renderBadge = () => {\n // Si no hay badge ni badgeCount, no renderizar nada\n if (!badge && badgeCount === undefined) return null;\n\n // Si hay badgeCount, renderizar badge con número\n if (badgeCount !== undefined) {\n return (\n <span\n className={`\n absolute\n -top-1\n -right-1\n flex\n items-center\n justify-center\n min-w-[16px]\n h-4\n px-1\n rounded-full\n text-[10px]\n font-bold\n leading-none\n ${badgeColors.bg}\n ${badgeColors.text}\n pointer-events-none\n `.trim().replace(/\\s+/g, ' ')}\n aria-label={`${badgeCount} notificaciones`}\n >\n {badgeCount > 99 ? '99+' : badgeCount}\n </span>\n );\n }\n\n // Si solo hay badge (sin número), renderizar dot\n return (\n <span\n className={`\n absolute\n -top-1\n -right-1\n w-2\n h-2\n rounded-full\n ${badgeColors.bg}\n pointer-events-none\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Notificación\"\n />\n );\n };\n\n return (\n <button\n type={htmlType}\n className={`${buttonClasses} ${(badge || badgeCount !== undefined) ? 'relative' : ''}`}\n disabled={disabled}\n onClick={onClick}\n aria-label={ariaLabel}\n {...rest}\n >\n {renderContent()}\n {renderBadge()}\n </button>\n );\n};\n","import React, { forwardRef, cloneElement } from 'react';\nimport type { InputProps } from './Input.types';\n\n/**\n * Input - Componente de campo de entrada del sistema de diseño Siesa\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Tokens de color consistentes con la documentación\n * - Sombra base para inputs con focus\n * - Estados hover, focus, disabled y error completos\n * - Typography: Paragraph Regular para texto, Label Bold para labels\n *\n * Campo de entrada de texto con soporte para:\n * - Estados: default, hover, focus, filled, disabled\n * - Validación con mensajes de error\n * - Iconos izquierdo y derecho\n * - Label y helper text\n * - Dark mode completo\n * - Accesibilidad completa\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/shadows.md - Sistema de sombras\n * @see docs/typography.md - Sistema tipográfico (Paragraph, Label)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Input\n * label=\"Email\"\n * placeholder=\"tu@email.com\"\n * leftIcon={<EnvelopeIcon />}\n * helperText=\"Ingresa tu correo electrónico\"\n * />\n * ```\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n label,\n labelSecondary,\n helperText,\n error = false,\n errorMessage,\n leftIcon,\n rightIcon,\n fullWidth = false,\n className = '',\n disabled = false,\n id,\n ...props\n },\n ref\n ) => {\n // Generar ID único si no se proporciona\n const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;\n\n // ===== CLASES BASE DEL INPUT =====\n // Usando el sistema tipográfico Paragraph Regular (14px = text-sm)\n // Border radius rounded-md (6px) consistente con Button\n const baseInputClasses = `\n w-full\n px-3\n py-1.5\n text-sm\n leading-6\n font-normal\n text-content-primary\n bg-bg-primary\n border\n border-border-primary\n rounded-md\n outline-hidden\n transition-all\n duration-150\n placeholder:text-content-tertiary\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n dark:text-dark-content-primary\n dark:placeholder:text-dark-content-tertiary\n `;\n\n // ===== CLASES PARA ESTADOS INTERACTIVOS =====\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n // Focus rings adaptativos siguiendo el patrón de Button\n const interactiveClasses = !disabled\n ? `\n hover:border-primary-custom-600\n focus:border-primary-custom-600\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:hover:border-dark-border-custom\n dark:focus:border-dark-border-custom\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n `\n : `\n opacity-50\n cursor-not-allowed\n bg-bg-secondary\n dark:bg-dark-bg-secondary\n `;\n\n // ===== CLASES PARA ESTADO DE ERROR =====\n // Los colores de error son los mismos en light y dark mode\n const errorClasses = error\n ? `\n border-error-border!\n focus:ring-error-border/30!\n focus:ring-offset-2!\n dark:border-error-border!\n dark:focus:ring-error-border/30!\n dark:focus:ring-offset-dark-bg-primary!\n `\n : '';\n\n // ===== CLASES DEL CONTENEDOR =====\n const containerClasses = fullWidth ? 'w-full' : 'w-[265px]';\n\n // ===== RENDERIZAR ICONOS =====\n // Clonar iconos con estilos apropiados y dark mode completo\n const renderIcon = (icon: React.ReactElement | undefined) => {\n if (!icon) return null;\n const existingClassName = (icon.props as any).className || '';\n return cloneElement(icon as React.ReactElement<any>, {\n className: `w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary ${existingClassName}`,\n });\n };\n\n return (\n <div className={`flex flex-col gap-2 ${containerClasses} ${className}`}>\n {/* Label */}\n {label && (\n <label\n htmlFor={inputId}\n className=\"flex items-center w-full font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n <span className=\"flex-1\">{label}</span>\n {labelSecondary && (\n <span className=\"text-xs leading-4 text-primary-custom-600 dark:text-primary-custom-600\">\n {labelSecondary}\n </span>\n )}\n </label>\n )}\n\n {/* Input Container */}\n <div className=\"relative flex items-center\">\n {/* Left Icon */}\n {leftIcon && (\n <div className=\"absolute left-3 pointer-events-none\">\n {renderIcon(leftIcon)}\n </div>\n )}\n\n {/* Input Field */}\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n className={`\n ${baseInputClasses}\n ${interactiveClasses}\n ${errorClasses}\n ${leftIcon ? 'pl-9' : ''}\n ${rightIcon ? 'pr-9' : ''}\n `.trim().replace(/\\s+/g, ' ')}\n {...props}\n />\n\n {/* Right Icon */}\n {rightIcon && (\n <div className=\"absolute right-3 pointer-events-none\">\n {renderIcon(rightIcon)}\n </div>\n )}\n </div>\n\n {/* Helper Text or Error Message */}\n {(helperText || errorMessage) && (\n <p\n className={`\n text-xs\n leading-5\n ${\n error\n ? 'text-error-content dark:text-error-content'\n : 'text-content-tertiary dark:text-dark-content-tertiary'\n }\n `.trim().replace(/\\s+/g, ' ')}\n >\n {error && errorMessage ? errorMessage : helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = 'Input';\n","import { forwardRef } from 'react';\nimport type { TextareaProps } from './Textarea.types';\n\n/**\n * Textarea - Componente de área de texto del sistema de diseño Siesa\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Tokens de color consistentes con la documentación\n * - Estados hover, focus, disabled y error completos\n * - Typography: Paragraph Base (16px) para texto\n *\n * Campo de entrada de texto multi-línea con soporte para:\n * - Estados: default, hover, focus, filled, disabled\n * - Validación con mensajes de error\n * - Label, description y helper text\n * - Resize vertical, horizontal, both o none\n * - Dark mode completo\n * - Accesibilidad completa\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/shadows.md - Sistema de sombras\n * @see docs/typography.md - Sistema tipográfico (Paragraph, Label)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Textarea\n * label=\"About\"\n * description=\"Tell us about yourself\"\n * placeholder=\"Write a few sentences...\"\n * helperText=\"Minimum 50 characters\"\n * />\n * ```\n */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n label,\n description,\n helperText,\n error = false,\n errorMessage,\n fullWidth = false,\n resize = 'vertical',\n className = '',\n disabled = false,\n id,\n rows = 4,\n ...props\n },\n ref\n ) => {\n // Generar ID único si no se proporciona\n const textareaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;\n\n // ===== CLASES BASE DEL TEXTAREA =====\n // Usando el sistema tipográfico Paragraph Base (16px = text-base)\n // Border radius rounded-lg (8px) según especificaciones de Figma\n // Padding: px-3 (12px) izquierda, pr-1.5 (6px) derecha para el indicador de resize\n const baseTextareaClasses = `\n w-full\n px-3\n pr-1.5\n py-1.5\n text-base\n leading-6\n font-normal\n bg-bg-primary\n border\n border-border-primary\n rounded-lg\n outline-hidden\n transition-all\n duration-150\n placeholder:text-content-tertiary\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n dark:text-dark-content-primary\n dark:placeholder:text-dark-content-tertiary\n `;\n\n // ===== CLASES PARA ESTADOS INTERACTIVOS =====\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n // Hover: borde más opaco (zinc-400) según especificaciones de Figma\n // Focus: solo border-2 sin ring, según especificaciones de Figma\n const interactiveClasses = !disabled\n ? `\n hover:border-zinc-400\n focus:border-2\n focus:border-primary-custom-600\n dark:hover:border-zinc-500\n dark:focus:border-2\n dark:focus:border-dark-border-custom\n `\n : `\n opacity-50\n cursor-not-allowed\n bg-bg-secondary\n dark:bg-dark-bg-secondary\n `;\n\n // ===== CLASES PARA ESTADO DE ERROR =====\n // Los colores de error son los mismos en light y dark mode\n // Focus en error: solo border-2 sin ring, según especificaciones de Figma\n const errorClasses = error\n ? `\n border-error-border!\n focus:border-2!\n focus:border-error-border!\n dark:border-error-border!\n dark:focus:border-2!\n dark:focus:border-error-border!\n `\n : '';\n\n // ===== CLASES DE RESIZE =====\n const resizeClasses =\n resize === 'none'\n ? 'resize-none'\n : resize === 'vertical'\n ? 'resize-y'\n : resize === 'horizontal'\n ? 'resize-x'\n : 'resize';\n\n // ===== CLASES DEL CONTENEDOR =====\n // Ancho por defecto: 312px (según especificaciones de Figma)\n const containerClasses = fullWidth ? 'w-full' : 'w-[312px]';\n\n return (\n <div className={`flex flex-col gap-2 ${containerClasses} ${className}`}>\n {/* Label and Description */}\n {(label || description) && (\n <div className=\"flex flex-col gap-1 w-full\">\n {label && (\n <label\n htmlFor={textareaId}\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n {label}\n </label>\n )}\n {description && (\n <p className=\"text-sm leading-5 text-content-secondary dark:text-dark-content-secondary\">\n {description}\n </p>\n )}\n </div>\n )}\n\n {/* Textarea Field */}\n <textarea\n ref={ref}\n id={textareaId}\n disabled={disabled}\n rows={rows}\n className={`\n ${baseTextareaClasses}\n ${interactiveClasses}\n ${errorClasses}\n ${resizeClasses}\n `.trim().replace(/\\s+/g, ' ')}\n {...props}\n />\n\n {/* Helper Text or Error Message */}\n {(helperText || errorMessage) && (\n <p\n className={`\n text-sm\n leading-5\n text-content-tertiary\n dark:text-dark-content-tertiary\n `.trim().replace(/\\s+/g, ' ')}\n >\n {error && errorMessage ? errorMessage : helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nTextarea.displayName = 'Textarea';\n","import { forwardRef, useEffect, useRef } from 'react';\nimport type { CheckboxProps } from './Checkbox.types';\n\n/**\n * Checkbox del sistema de diseño Siesa\n *\n * Componente de checkbox con soporte completo para estados interactivos,\n * indeterminate, y dark mode pixel-perfect según especificaciones de Figma.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Sombra button-inset para estado checked\n * - Type safety con TypeScript estricto\n * - Accesibilidad con input nativo y ARIA\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label/Paragraph)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Checkbox\n * label=\"Show on Events Page\"\n * description=\"Make this event visible on your profile\"\n * checked={true}\n * onChange={(e) => console.log(e.target.checked)}\n * />\n * ```\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n label,\n description,\n checked = false,\n indeterminate = false,\n disabled = false,\n className = '',\n id,\n onChange,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const combinedRef = (ref as any) || inputRef;\n\n // Generar ID único si no se proporciona\n const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;\n\n // Manejar el estado indeterminate\n useEffect(() => {\n if (combinedRef.current) {\n combinedRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate, combinedRef]);\n\n // ===== CLASES BASE DEL CHECKBOX =====\n const baseCheckboxClasses = `\n w-4\n h-4\n rounded\n border\n border-border-primary\n bg-bg-primary\n transition-all\n duration-150\n flex\n items-center\n justify-center\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n `;\n\n // ===== CLASES PARA ESTADOS INTERACTIVOS =====\n const interactiveClasses = !disabled\n ? (checked || indeterminate)\n ? `\n peer-hover:border-[#50a5f7]\n peer-focus:ring-2\n peer-focus:ring-primary-custom-400/20\n peer-focus:border-primary-custom-600\n dark:peer-hover:border-[#50a5f7]\n dark:peer-focus:border-dark-border-custom\n dark:peer-focus:ring-dark-border-custom/20\n `\n : `\n peer-hover:border-[#b6b6b9]\n peer-focus:ring-2\n peer-focus:ring-primary-custom-400/20\n peer-focus:border-primary-custom-600\n dark:peer-hover:border-[#b6b6b9]\n dark:peer-focus:border-dark-border-custom\n dark:peer-focus:ring-dark-border-custom/20\n `\n : `\n opacity-50\n cursor-not-allowed\n `;\n\n // ===== CLASES PARA ESTADO CHECKED/INDETERMINATE =====\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n const checkedClasses = checked || indeterminate\n ? `\n bg-primary-custom-600!\n border-primary-custom-500!\n shadow-button-inset\n dark:bg-dark-bg-inverse!\n dark:border-dark-bg-inverse!\n `\n : '';\n\n // ===== COMBINAR TODAS LAS CLASES DEL CHECKBOX =====\n const checkboxClasses = [\n baseCheckboxClasses,\n interactiveClasses,\n checkedClasses,\n disabled ? 'cursor-not-allowed' : 'cursor-pointer',\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div className={`inline-flex gap-3 items-start ${className}`}>\n {/* Checkbox Input Container */}\n <div className=\"flex items-center justify-center h-5 w-4 shrink-0\">\n {/* Native Input (hidden but accessible) */}\n <input\n ref={combinedRef}\n type=\"checkbox\"\n id={checkboxId}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n className=\"peer sr-only\"\n {...props}\n />\n\n {/* Custom Checkbox Visual */}\n <label htmlFor={checkboxId} className={checkboxClasses}>\n {/* Check Icon - Usar primary-inverse-content para consistencia */}\n {checked && !indeterminate && (\n <svg\n className=\"w-3 h-3 text-primary-inverse-content pointer-events-none\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M10 3L4.5 8.5L2 6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )}\n\n {/* Indeterminate Icon (minus) - Usar primary-inverse-content */}\n {indeterminate && (\n <svg\n className=\"w-3 h-3 text-primary-inverse-content pointer-events-none\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 6H10\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n )}\n </label>\n </div>\n\n {/* Label and Description */}\n {(label || description) && (\n <label\n htmlFor={checkboxId}\n className={`flex-1 flex flex-col gap-1 text-sm leading-5 ${\n disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'\n }`}\n >\n {/* Label - Label/Small (14px, Bold) */}\n {label && (\n <span className=\"font-bold text-content-primary dark:text-dark-content-primary\">\n {label}\n </span>\n )}\n {/* Description - Paragraph/Small (14px, Regular) */}\n {description && (\n <span className=\"font-normal text-content-secondary dark:text-content-secondary\">\n {description}\n </span>\n )}\n </label>\n )}\n </div>\n );\n }\n);\n\nCheckbox.displayName = 'Checkbox';\n","import { forwardRef } from 'react';\nimport type { RadioProps } from './Radio.types';\n\n/**\n * Radio - Componente de radio button del sistema de diseño Siesa\n *\n * Campo de selección única diseñado para cumplir con las especificaciones\n * de Figma con soporte completo para dark mode y accesibilidad.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con keyboard navigation y ARIA\n * - Inner shadow en estado checked según especificaciones Figma\n *\n * Estados soportados:\n * - Default, Hover, Focus, Disabled\n * - Checked / Unchecked\n * - Label y description opcionales\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Radio simple\n * <Radio\n * label=\"Allow tickets to be resold\"\n * description=\"Customers can resell or transfer their tickets\"\n * value=\"resell\"\n * name=\"ticketOptions\"\n * checked={true}\n * onChange={(e) => console.log(e.target.checked)}\n * />\n *\n * // Radio group\n * <div>\n * <Radio label=\"Option 1\" name=\"group\" value=\"1\" checked={selected === \"1\"} onChange={handleChange} />\n * <Radio label=\"Option 2\" name=\"group\" value=\"2\" checked={selected === \"2\"} onChange={handleChange} />\n * </div>\n * ```\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n {\n label,\n description,\n checked = false,\n disabled = false,\n className = '',\n id,\n onChange,\n value,\n name,\n ...props\n },\n ref\n ) => {\n // Generar ID único si no se proporciona\n const radioId = id || `radio-${Math.random().toString(36).substr(2, 9)}`;\n\n // ===== CLASES BASE DEL RADIO BUTTON =====\n const baseRadioClasses = `\n w-4\n h-4\n rounded-full\n border\n border-border-primary\n bg-bg-primary\n transition-all\n duration-150\n flex\n items-center\n justify-center\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n `;\n\n // ===== CLASES PARA ESTADOS INTERACTIVOS =====\n const interactiveClasses = !disabled\n ? `\n peer-hover:border-primary-custom-600\n peer-focus:ring-2\n peer-focus:ring-primary-custom-400\n peer-focus:border-primary-custom-600\n dark:peer-hover:border-dark-border-custom\n dark:peer-focus:ring-dark-border-custom\n dark:peer-focus:border-dark-border-custom\n `\n : `\n opacity-50\n cursor-not-allowed\n `;\n\n // ===== CLASES PARA CHECKED STATE =====\n // Según Figma: bg #0e79fd, border #3c9bf6, inner shadow\n const checkedClasses = checked\n ? `\n bg-primary-custom-600!\n border-primary-inverse-border!\n shadow-button-inset\n dark:bg-dark-bg-inverse!\n dark:border-dark-bg-inverse!\n `\n : '';\n\n return (\n <div className={`flex gap-3 items-start ${className}`}>\n {/* Radio Input Container */}\n <div className=\"flex items-center justify-center h-5 w-4 shrink-0\">\n {/* Native Input (hidden but accessible) */}\n <input\n ref={ref}\n type=\"radio\"\n id={radioId}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n value={value}\n name={name}\n className=\"peer sr-only\"\n {...props}\n />\n\n {/* Custom Radio Visual */}\n <label\n htmlFor={radioId}\n className={`\n ${baseRadioClasses}\n ${interactiveClasses}\n ${checkedClasses}\n ${disabled ? 'cursor-not-allowed' : 'cursor-pointer'}\n `.trim().replace(/\\s+/g, ' ')}\n >\n {/* Inner Circle (checked state) - 6px white dot según Figma */}\n {checked && (\n <div className=\"w-1.5 h-1.5 bg-white rounded-full dark:bg-dark-content-inverse\" />\n )}\n </label>\n </div>\n\n {/* Label and Description */}\n {(label || description) && (\n <label\n htmlFor={radioId}\n className={`flex-1 flex flex-col gap-1 text-sm leading-5 ${\n disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'\n }`}\n >\n {label && (\n <span className=\"font-bold text-content-primary dark:text-dark-content-primary\">\n {label}\n </span>\n )}\n {description && (\n <span className=\"font-normal text-content-secondary dark:text-content-secondary\">\n {description}\n </span>\n )}\n </label>\n )}\n </div>\n );\n }\n);\n\nRadio.displayName = 'Radio';\n","import { forwardRef } from 'react';\nimport type { SwitchProps } from './Switch.types';\n\n/**\n * Switch - Componente de switch del sistema de diseño Siesa\n *\n * Campo de activación/desactivación con soporte para:\n * - Estados: default, hover, focus, disabled\n * - On, off\n * - Label y description opcionales\n * - Posición del label: leading (izquierda) o trailing (derecha)\n * - Animación suave de transición\n * - Dark mode completo\n * - Accesibilidad completa\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Focus ring con shadow especial según Figma\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Label a la izquierda (default)\n * <Switch\n * label=\"Permitir inserción\"\n * description=\"Permite que otros inserten los detalles de tu evento.\"\n * checked={true}\n * onChange={(e) => console.log(e.target.checked)}\n * />\n *\n * // Label a la derecha\n * <Switch\n * label=\"Activar notificaciones\"\n * labelPosition=\"trailing\"\n * checked={false}\n * onChange={(e) => console.log(e.target.checked)}\n * />\n * ```\n */\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n label,\n description,\n labelPosition = 'leading',\n checked = false,\n disabled = false,\n className = '',\n id,\n onChange,\n ariaLabel,\n ...props\n },\n ref\n ) => {\n // Generar ID único si no se proporciona\n const switchId = id || `switch-${Math.random().toString(36).substr(2, 9)}`;\n\n // ===== CLASES BASE DEL TRACK =====\n const baseTrackClasses = `\n w-8\n h-5\n rounded-xl\n border\n overflow-hidden\n relative\n transition-all\n duration-200\n `;\n\n // ===== CLASES DE ESTADO DEL TRACK =====\n const getTrackStateClasses = () => {\n if (disabled) {\n return checked\n ? `\n bg-primary-custom-600\n border-primary-inverse-border\n opacity-50\n cursor-not-allowed\n dark:bg-primary-custom-600\n dark:border-primary-inverse-border\n `\n : `\n bg-[#fafafa]\n border-border-primary\n opacity-50\n cursor-not-allowed\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n `;\n }\n\n return checked\n ? `\n bg-primary-custom-600\n border-primary-inverse-border\n cursor-pointer\n peer-hover:border-[#307cc5]\n peer-focus:shadow-lg\n dark:bg-primary-custom-600\n dark:border-primary-inverse-border\n dark:peer-hover:border-[#307cc5]\n dark:peer-focus:shadow-lg\n `\n : `\n bg-[#fafafa]\n border-border-primary\n cursor-pointer\n peer-hover:border-[#b6b6b9]\n peer-focus:shadow-lg\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n dark:peer-hover:border-[#b6b6b9]\n dark:peer-focus:shadow-lg\n `;\n };\n\n // ===== CLASES DEL BOTÓN (CÍRCULO) =====\n const getButtonClasses = () => {\n const baseButtonClasses = `\n absolute\n w-4\n h-4\n bg-white\n rounded-[10px]\n border\n top-1/2\n -translate-y-1/2\n transition-all\n duration-200\n `;\n\n // Posición: OFF = left-px (1px), ON = left-[13px]\n const positionClass = checked ? 'left-[13px]' : 'left-px';\n\n if (disabled) {\n const borderClass = checked\n ? 'border-primary-inverse-border dark:border-primary-inverse-border'\n : 'border-border-primary dark:border-dark-border-primary';\n return `${baseButtonClasses} ${positionClass} ${borderClass}`;\n }\n\n const borderClass = checked\n ? `\n border-primary-inverse-border\n peer-hover:border-[#307cc5]\n dark:border-primary-inverse-border\n dark:peer-hover:border-[#307cc5]\n `\n : `\n border-border-primary\n peer-hover:border-[#b6b6b9]\n dark:border-dark-border-primary\n dark:peer-hover:border-[#b6b6b9]\n `;\n\n return `${baseButtonClasses} ${positionClass} ${borderClass}`;\n };\n\n // ===== COMBINAR CLASES =====\n const trackClasses = [\n baseTrackClasses,\n getTrackStateClasses(),\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n const buttonClasses = getButtonClasses()\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== COMPONENTES REUTILIZABLES =====\n const LabelContent = (label || description) ? (\n <label\n htmlFor={switchId}\n className={`flex-1 flex flex-col gap-1 text-sm leading-5 ${\n disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'\n }`}\n >\n {label && (\n <span className=\"font-bold text-content-primary dark:text-dark-content-primary\">\n {label}\n </span>\n )}\n {description && (\n <span className=\"font-normal text-content-secondary dark:text-content-secondary\">\n {description}\n </span>\n )}\n </label>\n ) : null;\n\n const SwitchInput = (\n <div className=\"flex items-center justify-center shrink-0\">\n {/* Native Input (hidden but accessible) */}\n <input\n ref={ref}\n type=\"checkbox\"\n id={switchId}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n className=\"peer sr-only\"\n aria-label={ariaLabel || label}\n {...props}\n />\n\n {/* Custom Switch Visual */}\n <label\n htmlFor={switchId}\n className={trackClasses}\n aria-hidden=\"true\"\n >\n {/* Button (sliding circle) */}\n <div className={buttonClasses} />\n </label>\n </div>\n );\n\n return (\n <div className={`flex gap-2 items-center w-[344px] ${className}`}>\n {labelPosition === 'leading' ? (\n <>\n {LabelContent}\n {SwitchInput}\n </>\n ) : (\n <>\n {SwitchInput}\n {LabelContent}\n </>\n )}\n </div>\n );\n }\n);\n\nSwitch.displayName = 'Switch';\n","import { forwardRef } from 'react';\nimport type { AvatarProps } from './Avatar.types';\n\n/**\n * Avatar - Componente de avatar del sistema de diseño Siesa\n *\n * Componente para mostrar imágenes de usuario o iniciales con soporte para:\n * - Tamaños: 4 (20px), 6 (24px), 8 (32px), 10 (40px)\n * - Tipos: circular (completamente redondo) y rounded (esquinas redondeadas)\n * - Imagen o iniciales\n * - Dark mode completo\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Tipografía adaptativa según tamaño\n * - Type safety con TypeScript estricto\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Con imagen\n * <Avatar\n * src=\"/path/to/image.jpg\"\n * alt=\"John Doe\"\n * size=\"10\"\n * type=\"circular\"\n * />\n *\n * // Con iniciales\n * <Avatar\n * initials=\"JD\"\n * size=\"10\"\n * type=\"circular\"\n * />\n * ```\n */\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>(\n (\n {\n size = '10',\n type = 'circular',\n src,\n alt = '',\n initials,\n className = '',\n ...props\n },\n ref\n ) => {\n // ===== CLASES DE TAMAÑO =====\n // Tamaño del contenedor del avatar\n const containerSizeClasses = {\n '4': 'w-5 h-5',\n '6': 'w-6 h-6',\n '8': 'w-8 h-8',\n '10': 'w-10 h-10',\n };\n\n // ===== CLASES DE TEXTO =====\n // Tamaño de texto para iniciales (basado en sistema tipográfico)\n const textSizeClasses = {\n '4': 'text-xs', // 12px - Paragraph Tiny\n '6': 'text-xs', // 12px - Paragraph Tiny\n '8': 'text-sm', // 14px - Paragraph Small\n '10': 'text-base', // 16px - Paragraph Base\n };\n\n // ===== CLASES DE TIPO (Forma) =====\n const typeClasses = {\n circular: 'rounded-full',\n rounded: 'rounded-md',\n };\n\n // ===== CLASES BASE =====\n const baseClasses = `\n relative\n inline-flex\n items-center\n justify-center\n overflow-hidden\n ${containerSizeClasses[size]}\n ${typeClasses[type]}\n `;\n\n // Si hay imagen, mostrarla\n if (src) {\n return (\n <div\n ref={ref}\n className={`${baseClasses} ${className}`.trim().replace(/\\s+/g, ' ')}\n >\n <img\n src={src}\n alt={alt}\n className=\"w-full h-full object-cover\"\n {...(props as any)}\n />\n </div>\n );\n }\n\n // Si hay iniciales, mostrarlas\n if (initials) {\n return (\n <div\n ref={ref}\n className={`\n ${baseClasses}\n ${textSizeClasses[size]}\n bg-content-primary\n text-white\n font-normal\n dark:bg-dark-bg-inverse\n dark:text-dark-content-inverse\n ${className}\n `.trim().replace(/\\s+/g, ' ')}\n >\n <span className=\"leading-none\">{initials}</span>\n </div>\n );\n }\n\n // Fallback: avatar vacío\n return (\n <div\n ref={ref}\n className={`\n ${baseClasses}\n bg-background-secondary\n dark:bg-dark-bg-primary\n ${className}\n `.trim().replace(/\\s+/g, ' ')}\n />\n );\n }\n);\n\nAvatar.displayName = 'Avatar';\n","import { forwardRef } from 'react';\nimport type { DividerProps } from './Divider.types';\n\n/**\n * Divider del sistema de diseño Siesa\n *\n * Línea horizontal de 1px para separar contenido visual o semánticamente.\n * Implementa dos variantes con soporte completo de dark mode.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Componente semántico usando elemento <hr>\n *\n * @see docs/colors.md - Sistema de colores (border-primary, border-secondary)\n * @see docs/spacing.md - Sistema de espaciado (altura de 1px)\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4096-8445 - Especificaciones Figma\n *\n * @example\n * ```tsx\n * // Default divider (más visible)\n * <Divider />\n * <Divider type=\"default\" />\n *\n * // Soft divider (más sutil)\n * <Divider type=\"soft\" />\n *\n * // Con clases personalizadas\n * <Divider className=\"my-6\" />\n * ```\n */\nexport const Divider = forwardRef<HTMLHRElement, DividerProps>(\n (\n {\n type = 'default',\n className = '',\n ...props\n },\n ref\n ) => {\n // ===== CLASES DE TIPO =====\n // Orden de modificadores: {dark}:{utility}\n const typeClasses = {\n // Default: Línea más visible para separaciones claras\n // Light: border-primary (#e4e4e7)\n // Dark: dark-border-primary (#71717a)\n default: 'bg-border-primary dark:bg-dark-border-primary',\n\n // Soft: Línea más sutil para separaciones suaves\n // Light: border-secondary (#f4f4f5 - muy claro)\n // Dark: gray-700 (#374151 - gris medio-oscuro, más sutil que dark-border-primary)\n soft: 'bg-border-secondary dark:bg-gray-700',\n };\n\n // ===== CLASES BASE =====\n const baseClasses = 'w-full h-px border-0';\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [\n baseClasses,\n typeClasses[type],\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <hr\n ref={ref}\n className={finalClasses}\n {...props}\n />\n );\n }\n);\n\nDivider.displayName = 'Divider';\n","import { forwardRef } from 'react';\nimport type { DescriptionListProps } from './DescriptionList.types';\n\n/**\n * DescriptionList del sistema de diseño Siesa\n *\n * Componente para mostrar información estructurada en formato clave-valor (term/details).\n * Layout de dos columnas con separador inferior entre items.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Layout flexible y responsive\n * - Tipografía del sistema (Paragraph/Small - 14px)\n *\n * @see docs/colors.md - Sistema de colores (content-primary, content-secondary)\n * @see docs/typography.md - Sistema tipográfico (Paragraph/Small)\n * @see docs/spacing.md - Sistema de espaciado (padding, gaps)\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4103-8449 - Especificaciones Figma\n *\n * @example\n * ```tsx\n * // Item básico\n * <DescriptionList\n * term=\"Customer\"\n * details=\"Jhonatan Diaz\"\n * />\n *\n * // Lista completa\n * <div>\n * <DescriptionList term=\"Event\" details=\"Bear Hug: Live in Concert\" />\n * <DescriptionList term=\"Amount\" details=\"$120,000 COP\" />\n * <DescriptionList term=\"Fee\" details=\"$20,000 COP\" />\n * </div>\n * ```\n */\nexport const DescriptionList = forwardRef<HTMLDivElement, DescriptionListProps>(\n (\n {\n term,\n details,\n className = '',\n ...props\n },\n ref\n ) => {\n // ===== CLASES BASE =====\n const baseClasses = `\n flex\n flex-wrap\n gap-1\n items-start\n py-2.5\n border-b\n border-border-secondary\n dark:border-gray-700\n `;\n\n // ===== CLASES DE COLUMNA =====\n // Cada columna ocupa el 50% del espacio disponible (flex-1)\n // con un ancho mínimo de 180px para mantener legibilidad\n const columnClasses = 'flex-1 min-w-[180px]';\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [baseClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div ref={ref} className={finalClasses} {...props}>\n {/* Term Column (izquierda) */}\n {/* Light: content-secondary (#a1a1aa) */}\n {/* Dark: gray-400 (#9ca3af - gris medio claro para mantener contraste) */}\n <div className={columnClasses}>\n <p className=\"text-sm leading-5 text-content-secondary dark:text-gray-400 font-normal\">\n {term}\n </p>\n </div>\n\n {/* Details Column (derecha) */}\n {/* Light: content-primary (#18181b) */}\n {/* Dark: dark-content-primary (#ffffff) */}\n <div className={columnClasses}>\n <p className=\"text-sm leading-5 text-content-primary dark:text-dark-content-primary font-normal\">\n {details}\n </p>\n </div>\n </div>\n );\n }\n);\n\nDescriptionList.displayName = 'DescriptionList';\n","import { forwardRef } from 'react';\nimport type { AlertProps } from './Alert.types';\nimport { Button } from '../Button/Button';\n\n/**\n * Alert - Componente de alerta/diálogo del sistema de diseño Siesa\n *\n * Componente modal para confirmaciones con soporte para:\n * - Título y descripción\n * - Contenido personalizado (children)\n * - Botones de acción personalizados o por defecto\n * - Dark mode\n *\n * @example\n * ```tsx\n * <Alert\n * title=\"Are you sure you want to refund this payment?\"\n * description=\"The refund will be reflected in 2 to 3 business days.\"\n * onCancel={() => console.log('Cancelled')}\n * onConfirm={() => console.log('Confirmed')}\n * confirmText=\"Refund\"\n * />\n * ```\n */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n title,\n description,\n children,\n actions,\n onCancel,\n onConfirm,\n cancelText = 'Cancelar',\n confirmText = 'Confirmar',\n className = '',\n ...props\n },\n ref\n ) => {\n // Si se proveen actions personalizadas, usarlas. Si no, usar botones por defecto\n const actionButtons = actions || (\n <>\n {onCancel && (\n <Button type=\"plain\" size=\"base\" onClick={onCancel}>\n {cancelText}\n </Button>\n )}\n {onConfirm && (\n <Button type=\"default\" size=\"base\" onClick={onConfirm}>\n {confirmText}\n </Button>\n )}\n </>\n );\n\n return (\n <div\n ref={ref}\n className={`\n w-[512px]\n bg-white\n dark:bg-dark-bg-primary\n border\n border-border-primary\n dark:border-dark-border-primary\n rounded-xl\n ${className}\n `.trim().replace(/\\s+/g, ' ')}\n {...props}\n >\n {/* Content Container */}\n <div className=\"p-6 flex flex-col gap-4\">\n {/* Text Section */}\n <div className=\"flex flex-col gap-3\">\n {/* Title */}\n <p className=\"text-sm leading-5 font-bold text-content-primary dark:text-dark-content-primary\">\n {title}\n </p>\n\n {/* Description (optional) */}\n {description && (\n <p className=\"text-sm leading-5 font-normal text-content-tertiary dark:text-content-tertiary\">\n {description}\n </p>\n )}\n </div>\n\n {/* Body Content (optional) */}\n {children && (\n <div className=\"flex flex-col gap-3\">\n {children}\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex flex-wrap gap-3 items-center justify-end\">\n {actionButtons}\n </div>\n </div>\n </div>\n );\n }\n);\n\nAlert.displayName = 'Alert';\n","import { forwardRef, cloneElement } from 'react';\nimport type { BadgeProps, BadgeColor } from './Badge.types';\n\n/**\n * Badge del sistema de diseño Siesa\n *\n * Componente para mostrar etiquetas con múltiples variantes de color.\n * Los badges mantienen sus colores vibrantes en light y dark mode para\n * garantizar visibilidad y consistencia visual.\n *\n * Características implementadas:\n * - 21 variantes de color (zinc, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, primary, secondary, tertiary)\n * - Icono opcional a la izquierda (12x12px)\n * - Contador/notification badge opcional\n * - Estados hover con transiciones suaves\n * - Los colores se mantienen vibrantes en dark mode (según diseño Figma)\n * - Tipografía: Label Tiny (12px Bold)\n *\n * Mejores prácticas implementadas:\n * - Tokens de color de Tailwind estándar para badges\n * - Font-family explícita (SiesaBT via font-sans)\n * - Transiciones suaves (duration-200)\n * - Estructura clara y mantenible\n *\n * @see docs/typography.md - Sistema tipográfico (Label Tiny)\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4130-9382\n *\n * @example\n * ```tsx\n * // Badge simple\n * <Badge color=\"blue\" label=\"Label\" />\n *\n * // Badge con icono\n * <Badge color=\"green\" label=\"Success\" leftIcon={<CheckIcon />} />\n *\n * // Badge con contador\n * <Badge color=\"red\" label=\"Errors\" count={5} />\n *\n * // Badge completo\n * <Badge color=\"primary\" label=\"Messages\" leftIcon={<MailIcon />} count={12} />\n * ```\n */\nexport const Badge = forwardRef<HTMLDivElement, BadgeProps>(\n (\n {\n color = 'zinc',\n leftIcon,\n label,\n count,\n className = '',\n ...props\n },\n ref\n ) => {\n // Map de colores - En dark mode mantienen los mismos colores vibrantes según Figma\n const colorClasses: Record<BadgeColor, { bg: string; text: string; hover: string; notificationBg: string; notificationText: string }> = {\n zinc: {\n bg: 'bg-zinc-100',\n text: 'text-zinc-600',\n hover: 'hover:bg-zinc-200',\n notificationBg: 'bg-zinc-600',\n notificationText: 'text-zinc-100',\n },\n red: {\n bg: 'bg-red-100',\n text: 'text-red-700',\n hover: 'hover:bg-red-200',\n notificationBg: 'bg-red-700',\n notificationText: 'text-red-100',\n },\n orange: {\n bg: 'bg-orange-100',\n text: 'text-orange-700',\n hover: 'hover:bg-orange-200',\n notificationBg: 'bg-orange-700',\n notificationText: 'text-orange-100',\n },\n amber: {\n bg: 'bg-amber-100',\n text: 'text-amber-700',\n hover: 'hover:bg-amber-200',\n notificationBg: 'bg-amber-700',\n notificationText: 'text-amber-100',\n },\n yellow: {\n bg: 'bg-yellow-100',\n text: 'text-yellow-700',\n hover: 'hover:bg-yellow-200',\n notificationBg: 'bg-yellow-700',\n notificationText: 'text-yellow-100',\n },\n lime: {\n bg: 'bg-lime-100',\n text: 'text-lime-700',\n hover: 'hover:bg-lime-200',\n notificationBg: 'bg-lime-700',\n notificationText: 'text-lime-100',\n },\n green: {\n bg: 'bg-green-100',\n text: 'text-green-700',\n hover: 'hover:bg-green-200',\n notificationBg: 'bg-green-700',\n notificationText: 'text-green-100',\n },\n emerald: {\n bg: 'bg-emerald-100',\n text: 'text-emerald-700',\n hover: 'hover:bg-emerald-200',\n notificationBg: 'bg-emerald-700',\n notificationText: 'text-emerald-100',\n },\n teal: {\n bg: 'bg-teal-100',\n text: 'text-teal-700',\n hover: 'hover:bg-teal-200',\n notificationBg: 'bg-teal-700',\n notificationText: 'text-teal-100',\n },\n cyan: {\n bg: 'bg-cyan-100',\n text: 'text-cyan-700',\n hover: 'hover:bg-cyan-200',\n notificationBg: 'bg-cyan-700',\n notificationText: 'text-cyan-100',\n },\n sky: {\n bg: 'bg-sky-100',\n text: 'text-sky-700',\n hover: 'hover:bg-sky-200',\n notificationBg: 'bg-sky-700',\n notificationText: 'text-sky-100',\n },\n blue: {\n bg: 'bg-blue-100',\n text: 'text-blue-700',\n hover: 'hover:bg-blue-200',\n notificationBg: 'bg-blue-700',\n notificationText: 'text-blue-100',\n },\n indigo: {\n bg: 'bg-indigo-100',\n text: 'text-indigo-700',\n hover: 'hover:bg-indigo-200',\n notificationBg: 'bg-indigo-700',\n notificationText: 'text-indigo-100',\n },\n violet: {\n bg: 'bg-violet-100',\n text: 'text-violet-700',\n hover: 'hover:bg-violet-200',\n notificationBg: 'bg-violet-700',\n notificationText: 'text-violet-100',\n },\n purple: {\n bg: 'bg-purple-100',\n text: 'text-purple-700',\n hover: 'hover:bg-purple-200',\n notificationBg: 'bg-purple-700',\n notificationText: 'text-purple-100',\n },\n fuchsia: {\n bg: 'bg-fuchsia-100',\n text: 'text-fuchsia-700',\n hover: 'hover:bg-fuchsia-200',\n notificationBg: 'bg-fuchsia-700',\n notificationText: 'text-fuchsia-100',\n },\n pink: {\n bg: 'bg-pink-100',\n text: 'text-pink-700',\n hover: 'hover:bg-pink-200',\n notificationBg: 'bg-pink-700',\n notificationText: 'text-pink-100',\n },\n rose: {\n bg: 'bg-rose-100',\n text: 'text-rose-700',\n hover: 'hover:bg-rose-200',\n notificationBg: 'bg-rose-700',\n notificationText: 'text-rose-100',\n },\n primary: {\n bg: 'bg-primary-custom-100',\n text: 'text-primary-custom-600',\n hover: 'hover:bg-primary-custom-200',\n notificationBg: 'bg-primary-custom-600',\n notificationText: 'text-primary-custom-100',\n },\n secondary: {\n bg: 'bg-zinc-100',\n text: 'text-zinc-600',\n hover: 'hover:bg-zinc-200',\n notificationBg: 'bg-zinc-600',\n notificationText: 'text-zinc-100',\n },\n tertiary: {\n bg: 'bg-zinc-100',\n text: 'text-zinc-600',\n hover: 'hover:bg-zinc-200',\n notificationBg: 'bg-zinc-600',\n notificationText: 'text-zinc-100',\n },\n };\n\n const colors = colorClasses[color];\n\n // Renderizar icono con tamaño correcto (12x12)\n const renderIcon = (icon: React.ReactElement) => {\n const existingClassName = (icon.props as any).className || '';\n return cloneElement(icon as React.ReactElement<any>, {\n className: `w-3 h-3 ${existingClassName}`.trim(),\n });\n };\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [\n 'inline-flex',\n 'items-center',\n 'gap-1',\n 'px-1.5',\n 'py-1',\n 'rounded-md',\n 'font-sans',\n colors.bg,\n colors.hover,\n 'transition-colors',\n 'duration-200',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div\n ref={ref}\n className={finalClasses}\n {...props}\n >\n {/* Icono izquierdo */}\n {leftIcon && (\n <div className={`flex items-center justify-center ${colors.text}`}>\n {renderIcon(leftIcon)}\n </div>\n )}\n\n {/* Label del badge */}\n <span className={`font-sans text-xs leading-4 ${colors.text}`}>\n {label}\n </span>\n\n {/* Notification badge (contador) */}\n {count !== undefined && (\n <div\n className={`\n h-3\n flex\n items-center\n justify-center\n px-0.5\n rounded-xs\n min-w-[12px]\n ${colors.notificationBg}\n `.trim().replace(/\\s+/g, ' ')}\n >\n <span className={`font-sans text-xs leading-4 ${colors.notificationText}`}>\n {count}\n </span>\n </div>\n )}\n </div>\n );\n }\n);\n\nBadge.displayName = 'Badge';\n","import { forwardRef, useState, useEffect } from 'react';\nimport type { QuantityProps } from './Quantity.types';\n\n/**\n * Quantity - Componente de cantidad del sistema de diseño Siesa\n *\n * Componente para seleccionar cantidades con soporte para:\n * - Botones de incremento/decremento\n * - Valores mínimo y máximo\n * - Label opcional con link\n * - Texto de ayuda opcional\n * - Estado de error\n * - Estado deshabilitado\n * - Dark mode completo\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Focus rings adaptativos para light y dark mode\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Quantity\n * label=\"Cantidad\"\n * value={5}\n * min={0}\n * max={10}\n * onChange={(value) => console.log(value)}\n * />\n * ```\n */\nexport const Quantity = forwardRef<HTMLDivElement, QuantityProps>(\n (\n {\n value: controlledValue,\n defaultValue = 0,\n onChange,\n min = 0,\n max,\n label,\n linkText,\n onLinkClick,\n helperText,\n error = false,\n disabled = false,\n className = '',\n ...props\n },\n ref\n ) => {\n // Estado interno para valor no controlado\n const [internalValue, setInternalValue] = useState(defaultValue);\n const isControlled = controlledValue !== undefined;\n const currentValue = isControlled ? controlledValue : internalValue;\n\n // Sincronizar valor interno con defaultValue cuando cambia\n useEffect(() => {\n if (!isControlled) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue, isControlled]);\n\n // Handler para cambio de valor\n const handleValueChange = (newValue: number) => {\n // Aplicar restricciones de min/max\n let clampedValue = newValue;\n if (min !== undefined && clampedValue < min) {\n clampedValue = min;\n }\n if (max !== undefined && clampedValue > max) {\n clampedValue = max;\n }\n\n // Actualizar estado interno si no está controlado\n if (!isControlled) {\n setInternalValue(clampedValue);\n }\n\n // Llamar onChange si existe\n onChange?.(clampedValue);\n };\n\n // Handlers para botones\n const handleDecrement = () => {\n if (disabled) return;\n handleValueChange(currentValue - 1);\n };\n\n const handleIncrement = () => {\n if (disabled) return;\n handleValueChange(currentValue + 1);\n };\n\n // Verificar si los botones deben estar deshabilitados\n const isDecrementDisabled = disabled || (min !== undefined && currentValue <= min);\n const isIncrementDisabled = disabled || (max !== undefined && currentValue >= max);\n\n // Iconos SVG inline\n const MinusIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M3 8H13\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n\n const PlusIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M8 3V13M3 8H13\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n\n // Clases para el estado (usando especificaciones exactas de Figma)\n const borderClass = error\n ? 'border-error-border dark:border-error-border'\n : 'border-border-primary dark:border-dark-border-primary';\n\n const hoverClass = !disabled && !error\n ? 'hover:border-[#f9f9f9] dark:hover:border-[#f9f9f9]'\n : '';\n\n const focusClass = !disabled && !error\n ? 'focus-within:border-2 focus-within:border-[#329cff] dark:focus-within:border-[#329cff]'\n : '';\n\n return (\n <div\n ref={ref}\n className={`flex flex-col gap-2 ${className}`.trim()}\n {...props}\n >\n {/* Label con link opcional */}\n {label && (\n <div className=\"flex items-center justify-between\">\n <label className=\"text-sm leading-5 font-bold text-content-primary dark:text-dark-content-primary\">\n {label}\n </label>\n {linkText && (\n <button\n type=\"button\"\n onClick={onLinkClick}\n disabled={disabled}\n className={`\n text-xs leading-4\n text-primary-custom-600\n hover:underline\n dark:text-primary-custom-600\n ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}\n transition-colors\n duration-200\n `.trim().replace(/\\s+/g, ' ')}\n >\n {linkText}\n </button>\n )}\n </div>\n )}\n\n {/* Input con botones */}\n <div\n className={`\n flex\n items-center\n gap-2\n px-3\n py-1.5\n bg-white\n dark:bg-dark-bg-primary\n border\n ${borderClass}\n ${hoverClass}\n ${focusClass}\n rounded-lg\n transition-colors\n duration-200\n ${disabled ? 'opacity-50 cursor-not-allowed' : ''}\n `.trim().replace(/\\s+/g, ' ')}\n >\n {/* Botón decrementar */}\n <button\n type=\"button\"\n onClick={handleDecrement}\n disabled={isDecrementDisabled}\n className={`\n flex\n items-center\n justify-center\n w-4\n h-4\n ${isDecrementDisabled\n ? 'text-content-tertiary dark:text-content-tertiary cursor-not-allowed'\n : 'text-content-primary dark:text-dark-content-primary hover:text-content-secondary dark:hover:text-content-secondary cursor-pointer'\n }\n transition-colors\n duration-200\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Decrementar\"\n >\n <MinusIcon />\n </button>\n\n {/* Valor actual */}\n <div className=\"flex-1 text-center\">\n <span\n className={`\n text-base leading-6\n ${currentValue === 0\n ? 'text-content-tertiary dark:text-content-tertiary'\n : 'text-content-primary dark:text-dark-content-primary'\n }\n `.trim().replace(/\\s+/g, ' ')}\n >\n {currentValue}\n </span>\n </div>\n\n {/* Botón incrementar */}\n <button\n type=\"button\"\n onClick={handleIncrement}\n disabled={isIncrementDisabled}\n className={`\n flex\n items-center\n justify-center\n w-4\n h-4\n ${isIncrementDisabled\n ? 'text-content-tertiary dark:text-content-tertiary cursor-not-allowed'\n : 'text-content-primary dark:text-dark-content-primary hover:text-content-secondary dark:hover:text-content-secondary cursor-pointer'\n }\n transition-colors\n duration-200\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Incrementar\"\n >\n <PlusIcon />\n </button>\n </div>\n\n {/* Helper text */}\n {helperText && (\n <p\n className={`\n text-sm leading-5\n ${error\n ? 'text-error-content dark:text-error-content'\n : 'text-content-tertiary dark:text-content-tertiary'\n }\n `.trim().replace(/\\s+/g, ' ')}\n >\n {helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nQuantity.displayName = 'Quantity';\n","import React from 'react';\nimport type { NavigationRailItemProps } from './NavigationRailItem.types';\n\n/**\n * NavigationRailItem - Componente independiente para items de NavigationRail\n *\n * Item individual de navegación vertical (rail) para aplicaciones. Proporciona\n * un punto de acceso a destinos mediante un icono, label opcional y badges.\n *\n * **Características principales:**\n * - Ancho fijo de 56px según Figma\n * - Estados completos: normal, hover, selected, focus, disabled\n * - Badges de notificación con contador opcional\n * - Tipografía Label XXSmall (10px Bold) según sistema de diseño\n * - Dark mode completo con estrategia 'class'\n * - Focus rings adaptativos para accesibilidad\n * - Soporte para iconos 16x16px\n *\n * **Especificaciones de Figma (node 4294-22931):**\n * - Ancho: 56px (w-14)\n * - Icon container: 32px altura, px-4 py-1, rounded-full\n * - Label: 10px Bold, leading 12px (Label XXSmall)\n * - Gap: 4px (gap-1)\n * - Badge: 13x13px, posición absolute\n *\n * **Estados visuales (según Figma):**\n * - **Enabled**: Icon transparent, label text-content-primary\n * - **Hover**: Icon container bg-primary-custom-100 (#dbeefe), icon text-primary-custom-600\n * - **Selected**: Icon container bg-primary-custom-100 con overlay, icon text-primary-custom-600\n * - **Focus**: Focus ring 2px (#60b6fa) con offset 2px (#dbeefe), sombras combinadas\n * - **Disabled**: Opacity 55%, no interactivo\n *\n * **Dark Mode:**\n * - Background: dark-bg-primary\n * - Hover icon container: dark-bg-primary/20\n * - Selected icon container: dark-primary-custom-600/30\n * - Icon colors: dark-content-primary, dark-white on selected\n * - Focus ring: dark-border-custom\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Tokens de color consistentes con documentación\n * - Accesibilidad ARIA completa\n * - Focus visible para keyboard navigation\n * - Badge positioning absoluto para no afectar layout\n *\n * @see docs/colors.md - Sistema de colores (primary-custom, dark-*, content-*)\n * @see docs/typography.md - Tipografía (Label XXSmall)\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras y focus rings\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4294-22931\n *\n * @example\n * ```tsx\n * // Item básico\n * <NavigationRailItem\n * id=\"home\"\n * icon={<HomeIcon />}\n * label=\"Inicio\"\n * selected={true}\n * onClick={() => navigate('/')}\n * />\n *\n * // Con badge de notificación\n * <NavigationRailItem\n * id=\"notifications\"\n * icon={<BellIcon />}\n * label=\"Notificaciones\"\n * badgeCount={5}\n * onClick={() => navigate('/notifications')}\n * />\n *\n * // Item deshabilitado\n * <NavigationRailItem\n * id=\"premium\"\n * icon={<StarIcon />}\n * label=\"Premium\"\n * disabled={true}\n * />\n *\n * // Solo icono (sin label)\n * <NavigationRailItem\n * id=\"home\"\n * icon={<HomeIcon />}\n * label=\"Inicio\"\n * showLabelText={false}\n * />\n * ```\n */\nexport const NavigationRailItem: React.FC<NavigationRailItemProps> = ({\n icon,\n label,\n selected = false,\n disabled = false,\n badge = false,\n badgeCount,\n onClick,\n onMouseEnter,\n onMouseLeave,\n ariaLabel,\n id,\n showLabelText = true,\n showIcon = true,\n className = '',\n}) => {\n // ===== CLASES DEL ICON CONTAINER =====\n // Según Figma node 4294-22931, el icon container tiene comportamiento diferente\n // según el estado:\n // - Enabled: bg-transparent, hover:bg-primary-custom-100\n // - Hover: bg-primary-custom-100\n // - Selected: bg-primary-custom-100 con overlay (rgba(0,0,0,0.024))\n // - Focus: bg-primary-custom-100 con focus ring y sombras\n // - Disabled: opacidad 55%\n const iconContainerClasses = [\n // Base layout\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'px-4', // 16px horizontal según Figma\n 'py-1', // 4px vertical según Figma\n 'rounded-full',\n 'overflow-hidden',\n 'shrink-0',\n\n // Estados - Background\n selected\n ? // Selected: bg-primary-custom-100 con overlay\n 'bg-primary-custom-100 dark:bg-primary-custom-600/30'\n : // Default/Hover: transparent → hover:bg-primary-custom-100\n 'bg-transparent hover:bg-primary-custom-100 dark:hover:bg-primary-custom-600/20',\n\n // Transiciones\n 'transition-colors',\n 'duration-150',\n ].join(' ');\n\n // ===== CLASES DEL ICONO =====\n // Tamaño fijo 16x16px según Figma\n // Colores según estado:\n // - Default: text-content-primary\n // - Hover: text-primary-custom-600\n // - Selected: text-primary-custom-600\n // - Disabled: text-content-tertiary\n // Dark mode: invierte colores\n const iconClasses = [\n 'w-4', // 16px\n 'h-4', // 16px\n 'shrink-0',\n\n // Colores según estado\n selected\n ? // Selected: primary-custom-600 (azul oscuro)\n 'text-primary-custom-600 dark:text-white'\n : disabled\n ? // Disabled: content-tertiary\n 'text-content-tertiary dark:text-content-tertiary'\n : // Default/Hover: content-primary → hover:primary-custom-600\n 'text-content-primary hover:text-primary-custom-600 dark:text-dark-content-primary dark:hover:text-white',\n\n 'transition-colors',\n 'duration-150',\n ].join(' ');\n\n // ===== CLASES DEL LABEL =====\n // Tipografía: Label XXSmall (10px Bold, leading 12px) según Figma\n // Color: text-content-primary, dark:text-dark-content-primary\n const labelClasses = [\n // Tipografía: Label XXSmall (10px Bold)\n 'text-xs', // 12px en lugar de text-[10px]\n 'leading-3', // 12px\n 'font-bold',\n 'text-center',\n 'w-full',\n 'min-w-full',\n\n // Colores\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n\n // Para multiline labels, agregar truncate o text-nowrap si es necesario\n 'wrap-break-word',\n ].join(' ');\n\n // ===== CLASES DEL CONTENEDOR PRINCIPAL =====\n // Según Figma: ancho 56px, flex-col, gap-1, items-center\n const containerClasses = [\n 'relative',\n 'flex',\n 'flex-col',\n 'items-center',\n 'gap-1', // 4px según Figma\n 'px-0.5', // 2px horizontal según Figma\n 'py-0',\n 'w-14', // 56px según Figma\n 'shrink-0',\n\n // Interactividad\n disabled\n ? 'cursor-not-allowed opacity-55 pointer-events-none'\n : 'cursor-pointer',\n\n // Focus visible (accesibilidad)\n 'focus:outline-hidden',\n 'focus-visible:ring-2',\n 'focus-visible:ring-primary-custom-400', // 4px ring\n 'focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-primary-custom-100', // offset #dbeefe según Figma\n 'dark:focus-visible:ring-dark-border-custom',\n 'dark:focus-visible:ring-offset-dark-bg-primary',\n\n // Focus sombras adicionales según Figma:\n 'focus-visible:shadow-lg',\n 'dark:focus-visible:shadow-2xl',\n\n 'rounded-lg',\n\n // Clases personalizadas\n className,\n ].join(' ');\n\n // ===== RENDERIZAR BADGE =====\n const renderBadge = () => {\n if (!badge && badgeCount === undefined) return null;\n\n // Badge con número\n if (badgeCount !== undefined) {\n return (\n <span\n className=\"\n absolute\n -top-0.5\n left-8\n flex\n items-center\n justify-center\n min-w-3\n h-3\n px-1\n rounded-full\n text-xs\n font-bold\n leading-none\n bg-red-700\n text-white\n dark:bg-red-700\n dark:text-white\n pointer-events-none\n select-none\n \"\n aria-label={`${badgeCount} notificaciones`}\n data-badge\n >\n {badgeCount > 99 ? '99+' : badgeCount}\n </span>\n );\n }\n\n // Badge dot simple\n return (\n <span\n className=\"\n absolute\n -top-0.5\n left-8\n w-3\n h-3\n rounded-full\n bg-red-700\n dark:bg-red-700\n pointer-events-none\n select-none\n \"\n aria-label=\"Notificación\"\n data-badge\n />\n );\n };\n\n return (\n <button\n type=\"button\"\n className={containerClasses}\n disabled={disabled}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n aria-label={ariaLabel || label}\n aria-current={selected ? 'page' : undefined}\n aria-disabled={disabled}\n data-item-id={id}\n data-testid={`navigation-rail-item-${id}`}\n >\n {/* Icon Container */}\n {showIcon && (\n <div className={iconContainerClasses}>\n <span className={iconClasses}>\n {icon}\n </span>\n </div>\n )}\n\n {/* Label */}\n {showLabelText && (\n <p className={labelClasses}>\n {label}\n </p>\n )}\n\n {/* Badge */}\n {renderBadge()}\n </button>\n );\n};\n\nNavigationRailItem.displayName = 'NavigationRailItem';\n","/**\n * Iconos para el componente Dropdown\n * Usando heroicons-micro según especificaciones de Figma\n */\n\nexport const ChevronDownIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const CogIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M6.455 1.45A.5.5 0 0 1 6.952 1h2.096a.5.5 0 0 1 .497.45l.186 1.858a4.996 4.996 0 0 1 1.466.848l1.703-.769a.5.5 0 0 1 .639.206l1.047 1.814a.5.5 0 0 1-.14.656l-1.517 1.09a5.026 5.026 0 0 1 0 1.694l1.516 1.09a.5.5 0 0 1 .141.656l-1.047 1.814a.5.5 0 0 1-.639.206l-1.703-.768c-.433.36-.928.649-1.466.847l-.186 1.858a.5.5 0 0 1-.497.45H6.952a.5.5 0 0 1-.497-.45l-.186-1.858a4.993 4.993 0 0 1-1.466-.848l-1.703.769a.5.5 0 0 1-.639-.206l-1.047-1.814a.5.5 0 0 1 .14-.656l1.517-1.09a5.033 5.033 0 0 1 0-1.694l-1.516-1.09a.5.5 0 0 1-.141-.656L2.461 3.39a.5.5 0 0 1 .639-.206l1.703.768c.433-.36.928-.649 1.466-.847l.186-1.858ZM8 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const UserIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path d=\"M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM12.735 14c.618 0 1.093-.561.872-1.139a6.002 6.002 0 0 0-11.215 0c-.22.578.254 1.139.872 1.139h9.47Z\" />\n </svg>\n);\n\nexport const BellIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12 5a4 4 0 0 0-8 0v2.379a1.5 1.5 0 0 1-.44 1.06L2.294 9.707a1 1 0 0 0-.293.707V11a1 1 0 0 0 1 1h2a3 3 0 1 0 6 0h2a1 1 0 0 0 1-1v-.586a1 1 0 0 0-.293-.707L12.44 8.44A1.5 1.5 0 0 1 12 7.38V5Zm-5.5 7a1.5 1.5 0 0 0 3 0h-3Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const CreditCardIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path d=\"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z\" />\n <path d=\"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z\" />\n </svg>\n);\n\nexport const MoonIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M9.598 1.591a.749.749 0 0 1 .785-.175 7.001 7.001 0 1 1-8.967 8.967.75.75 0 0 1 .961-.96 5.5 5.5 0 0 0 7.046-7.046.75.75 0 0 1 .175-.786Zm1.616 1.945a7 7 0 0 1-7.678 7.678 5.499 5.499 0 1 0 7.678-7.678Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const DocumentTextIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4 2a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 4 14h8a1.5 1.5 0 0 0 1.5-1.5V6.621a1.5 1.5 0 0 0-.44-1.06L9.94 2.439A1.5 1.5 0 0 0 8.878 2H4Zm4 9.5a.75.75 0 0 1-.75-.75V9.5a.75.75 0 0 1 1.5 0v1.25a.75.75 0 0 1-.75.75Zm-2.5-4.5A.75.75 0 0 0 5 7v.25a.75.75 0 0 0 1.5 0V7Zm4 0a.75.75 0 0 0-.5.75v.25a.75.75 0 0 0 1.5 0V7.5a.75.75 0 0 0-.5-.75Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const ArrowRightStartOnRectangleIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4 2a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 4 14h3a.5.5 0 0 0 0-1H4a.5.5 0 0 1-.5-.5v-9A.5.5 0 0 1 4 3h3a.5.5 0 0 0 0-1H4Zm7.53 4.22a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.75.75 0 1 1-1.06-1.06l.72-.72H8.5a.75.75 0 0 1 0-1.5h3.75l-.72-.72a.75.75 0 0 1 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n","import React, { useState, useRef, useEffect, useCallback } from 'react';\nimport type {\n DropdownProps,\n DropdownItemProps,\n DropdownHeadingProps,\n DropdownDividerProps,\n} from './Dropdown.types';\nimport { ChevronDownIcon } from './icons';\n\ntype MenuPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';\n\n/**\n * Componente Dropdown del sistema de diseño Siesa\n *\n * Menú desplegable implementado pixel-perfect según especificaciones de Figma (node 4194-15135).\n * Soporta múltiples tipos de items: básicos, con iconos, con descripciones, con shortcuts, con headings y dividers.\n *\n * **Especificaciones de Figma:**\n * - Trigger button: bg-white, border-border-primary, rounded-lg (8px), gap-2 (8px)\n * - Menu: bg-background-secondary (#f4f4f5), shadow-lg, rounded-lg (8px), padding 4px, min-width 182px\n * - Items: padding 16px horizontal, 8px vertical, rounded-lg, gap-3 (12px)\n * - Typography: Label/Small (14px Bold) para trigger, Paragraph/Small (14px Regular) para items\n * - Typography: Paragraph/Tiny (12px Regular) para headings y descripciones\n *\n * **Variantes:**\n * - `default`: Botón con texto + icono chevron\n * - `icon-only`: Solo icono chevron (36x36px) - ideal para espacios reducidos\n *\n * **Estados del trigger:**\n * - Default: bg-white, text-content-secondary, border-border-primary\n * - Hover: bg-background-secondary (#fafafa)\n * - Focus: ring-2 ring-primary-custom-400 con offset-2\n * - Disabled: opacity-50 con pointer-events-none\n *\n * **Estados de items:**\n * - Default: text-content-primary\n * - Hover: bg-background-secondary (#fafafa)\n * - Selected: bg-primary-custom-100 (light) / bg-primary-custom-600/20 (dark)\n *\n * **Dark Mode:**\n * - Trigger: dark:bg-dark-bg-primary, dark:hover:bg-gray-800\n * - Menu: bg-background-secondary → dark:bg-dark-bg-primary\n * - Items hover: dark:hover:bg-gray-800\n * - Shadow: shadow-lg funciona en ambos modos\n *\n * **Funcionalidad:**\n * - Cierre automático al hacer click fuera del dropdown\n * - Cierre con tecla Escape\n * - Modo controlado/no controlado (prop `open` + `onOpenChange`)\n * - Callback `onClick` por item individual\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels (aria-haspopup, aria-expanded)\n * - Keyboard navigation (Escape para cerrar)\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label/Small, Paragraph/Small, Paragraph/Tiny)\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras (shadow-lg)\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4194-15135 - Diseño Figma\n *\n * @example\n * ```tsx\n * // Dropdown básico\n * <Dropdown\n * placeholder=\"Opciones\"\n * items={[\n * { children: 'Cuenta', icon: <UserIcon /> },\n * { children: 'Configuración', icon: <CogIcon /> },\n * { isDivider: true },\n * { children: 'Cerrar sesión' },\n * ]}\n * />\n *\n * // Dropdown con headings y descripciones\n * <Dropdown\n * placeholder=\"Menú\"\n * items={[\n * { isHeading: true, children: 'Cuenta' },\n * { children: 'Perfil', icon: <UserIcon />, description: 'Administra tu perfil' },\n * { isDivider: true },\n * { children: 'Deshacer', shortcut: '⌘ Z' },\n * ]}\n * />\n *\n * // Dropdown solo icono\n * <Dropdown variant=\"icon-only\" items={[...]} />\n *\n * // Dropdown controlado\n * <Dropdown\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * items={[...]}\n * />\n * ```\n */\nexport const Dropdown: React.FC<DropdownProps> = ({\n variant = 'default',\n children,\n items,\n open: controlledOpen,\n onOpenChange,\n disabled = false,\n className = '',\n menuClassName = '',\n ariaLabel,\n placeholder = 'Options',\n renderTrigger,\n}) => {\n const [internalOpen, setInternalOpen] = useState(false);\n const [menuPosition, setMenuPosition] = useState<MenuPosition>('bottom-left');\n const dropdownRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n\n // Determinar si es controlado o no controlado\n const isControlled = controlledOpen !== undefined;\n const isOpen = isControlled ? controlledOpen : internalOpen;\n\n // Calcular la posición óptima del menú basándose en el espacio disponible\n const calculateMenuPosition = useCallback(() => {\n if (!dropdownRef.current) return;\n\n const triggerRect = dropdownRef.current.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n // Estimación del tamaño del menú (min-width: 182px, altura aproximada)\n const menuWidth = 200;\n const menuHeight = 250;\n\n // Verificar espacio disponible\n const spaceBelow = viewportHeight - triggerRect.bottom;\n const spaceAbove = triggerRect.top;\n const spaceRight = viewportWidth - triggerRect.left;\n const spaceLeft = triggerRect.right;\n\n // Determinar posición vertical\n const openAbove = spaceBelow < menuHeight && spaceAbove > spaceBelow;\n\n // Determinar posición horizontal\n const openLeft = spaceRight < menuWidth && spaceLeft > spaceRight;\n\n if (openAbove && openLeft) {\n setMenuPosition('top-right');\n } else if (openAbove) {\n setMenuPosition('top-left');\n } else if (openLeft) {\n setMenuPosition('bottom-right');\n } else {\n setMenuPosition('bottom-left');\n }\n }, []);\n\n // Función para cambiar el estado\n const handleToggle = () => {\n if (disabled) return;\n\n const newOpen = !isOpen;\n\n // Calcular posición antes de abrir\n if (newOpen) {\n calculateMenuPosition();\n }\n\n if (!isControlled) {\n setInternalOpen(newOpen);\n }\n\n onOpenChange?.(newOpen);\n };\n\n // Cerrar al hacer click fuera\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {\n if (!isControlled) {\n setInternalOpen(false);\n }\n onOpenChange?.(false);\n }\n };\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }\n }, [isOpen, isControlled, onOpenChange]);\n\n // Cerrar al presionar Escape\n useEffect(() => {\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && isOpen) {\n if (!isControlled) {\n setInternalOpen(false);\n }\n onOpenChange?.(false);\n }\n };\n\n if (isOpen) {\n document.addEventListener('keydown', handleEscape);\n return () => {\n document.removeEventListener('keydown', handleEscape);\n };\n }\n }, [isOpen, isControlled, onOpenChange]);\n\n // Handler para item click\n const handleItemClick = (item: DropdownItemProps) => {\n if (item.disabled || item.isDivider || item.isHeading) return;\n\n // Ejecutar el onClick del item\n if (item.onClick) {\n item.onClick({} as React.MouseEvent<HTMLButtonElement>);\n }\n\n // Cerrar el dropdown\n if (!isControlled) {\n setInternalOpen(false);\n }\n onOpenChange?.(false);\n };\n\n // ===== CLASES DEL TRIGGER BUTTON =====\n const triggerClasses = [\n // Base\n 'inline-flex',\n 'items-center',\n 'justify-center',\n 'rounded-lg',\n 'font-bold',\n 'text-sm',\n 'whitespace-nowrap',\n 'transition-all',\n 'duration-150',\n\n // Variant-specific sizing\n variant === 'icon-only' ? 'w-9 h-9' : 'gap-2 px-3 py-2',\n\n // Colores y estados (Light Mode)\n 'bg-white',\n 'text-content-secondary',\n 'border',\n 'border-border-primary',\n 'hover:bg-background-secondary',\n\n // Dark Mode\n 'dark:bg-dark-bg-primary',\n 'dark:text-dark-content-primary',\n 'dark:border-dark-border-primary',\n 'dark:hover:bg-dark-bg-secondary',\n\n // Focus ring\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'focus:ring-offset-2',\n 'dark:focus:ring-dark-border-custom',\n 'dark:focus:ring-offset-dark-bg-primary',\n\n // Disabled\n disabled && 'opacity-50',\n disabled && 'cursor-not-allowed',\n disabled && 'pointer-events-none',\n\n // Custom classes\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // Clases de posición basadas en el cálculo\n const positionClasses: Record<MenuPosition, string> = {\n 'bottom-left': 'top-full left-0 mt-2',\n 'bottom-right': 'top-full right-0 mt-2',\n 'top-left': 'bottom-full left-0 mb-2',\n 'top-right': 'bottom-full right-0 mb-2',\n };\n\n // ===== CLASES DEL MENU =====\n const menuClasses = [\n // Base\n 'absolute',\n positionClasses[menuPosition],\n 'min-w-[182px]',\n 'rounded-lg',\n 'p-1',\n 'border',\n 'z-50',\n\n // Colores (Light Mode)\n 'bg-background-secondary',\n 'border-border-primary',\n\n // Dark Mode\n 'dark:bg-dark-bg-primary',\n 'dark:border-dark-border-primary',\n\n // Shadow\n 'shadow-lg',\n\n // Custom classes\n menuClassName,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div ref={dropdownRef} className=\"relative inline-block\">\n {/* Trigger Button */}\n {renderTrigger ? (\n // Custom trigger renderizado por el usuario\n <div onClick={handleToggle} role=\"button\" tabIndex={disabled ? -1 : 0}>\n {renderTrigger(isOpen)}\n </div>\n ) : (\n // Trigger por defecto\n <button\n type=\"button\"\n className={triggerClasses}\n onClick={handleToggle}\n disabled={disabled}\n aria-label={ariaLabel || (variant === 'icon-only' ? 'Abrir menú' : undefined)}\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n >\n {variant === 'default' && <span>{children || placeholder}</span>}\n <ChevronDownIcon />\n </button>\n )}\n\n {/* Dropdown Menu */}\n {isOpen && (\n <div ref={menuRef} className={menuClasses}>\n {items.map((item, index) => {\n if (item.isDivider) {\n return <DropdownDivider key={index} className={item.className} />;\n }\n\n if (item.isHeading) {\n return (\n <DropdownHeading key={index} className={item.className}>\n {item.children}\n </DropdownHeading>\n );\n }\n\n return (\n <DropdownItem\n key={index}\n {...item}\n onClick={() => handleItemClick(item)}\n />\n );\n })}\n </div>\n )}\n </div>\n );\n};\n\n/**\n * Componente DropdownItem\n * Item individual dentro del menú dropdown\n *\n * @example\n * ```tsx\n * <DropdownItem icon={<UserIcon />} shortcut=\"⌘ P\">\n * Profile\n * </DropdownItem>\n * ```\n */\nexport const DropdownItem: React.FC<DropdownItemProps> = ({\n children,\n icon,\n description,\n shortcut,\n disabled = false,\n selected = false,\n onClick,\n className = '',\n}) => {\n // ===== CLASES DEL ITEM =====\n const itemClasses = [\n // Base\n 'flex',\n 'items-center',\n 'gap-3',\n 'px-4',\n 'py-2',\n 'rounded-lg',\n 'text-sm',\n 'font-normal',\n 'w-full',\n 'text-left',\n\n // Colores y estados (Light Mode)\n 'text-content-primary',\n !disabled && 'hover:bg-bg-primary',\n selected && 'bg-bg-primary',\n\n // Dark Mode\n 'dark:text-dark-content-primary',\n !disabled && 'dark:hover:bg-dark-bg-secondary',\n selected && 'dark:bg-dark-bg-secondary',\n\n // Disabled\n disabled && 'opacity-50',\n disabled && 'cursor-not-allowed',\n !disabled && 'cursor-pointer',\n\n // Custom classes\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type=\"button\"\n className={itemClasses}\n onClick={onClick}\n disabled={disabled}\n >\n {/* Icon */}\n {icon && (\n <span className=\"inline-flex items-center justify-center w-4 h-4 text-content-secondary dark:text-dark-content-secondary\">\n {icon}\n </span>\n )}\n\n {/* Content */}\n <div className=\"flex-1 min-w-0\">\n {/* Label */}\n <div className=\"text-content-primary dark:text-dark-content-primary\">\n {children}\n </div>\n\n {/* Description */}\n {description && (\n <div className=\"text-xs text-content-secondary dark:text-dark-content-secondary mt-0.5\">\n {description}\n </div>\n )}\n </div>\n\n {/* Shortcut */}\n {shortcut && (\n <span className=\"text-xs text-content-secondary dark:text-dark-content-secondary ml-auto whitespace-nowrap\">\n {shortcut}\n </span>\n )}\n </button>\n );\n};\n\n/**\n * Componente DropdownHeading\n * Encabezado de sección dentro del menú dropdown\n *\n * @example\n * ```tsx\n * <DropdownHeading>My events</DropdownHeading>\n * ```\n */\nexport const DropdownHeading: React.FC<DropdownHeadingProps> = ({\n children,\n className = '',\n}) => {\n // ===== CLASES DEL HEADING =====\n const headingClasses = [\n // Base\n 'px-4',\n 'py-1',\n 'text-xs',\n 'font-normal',\n\n // Colores\n 'text-content-tertiary',\n\n // Dark Mode\n 'dark:text-dark-content-tertiary',\n\n // Custom classes\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return <div className={headingClasses}>{children}</div>;\n};\n\n/**\n * Componente DropdownDivider\n * Separador visual entre items del menú dropdown\n *\n * @example\n * ```tsx\n * <DropdownDivider />\n * ```\n */\nexport const DropdownDivider: React.FC<DropdownDividerProps> = ({\n className = '',\n}) => {\n // ===== CLASES DEL DIVIDER =====\n const dividerClasses = [\n // Base\n 'px-4',\n 'py-1',\n\n // Custom classes\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div className={dividerClasses}>\n <div className=\"h-px bg-border-primary dark:bg-dark-border-primary\" />\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * Icono ChevronDown para el toggle del colapsable\n * Diseño basado en heroicons-micro/chevron-down\n * Tamaño: 16x16px\n *\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=6135-34374\n */\nexport const ChevronDownIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * Icono de usuario placeholder para ejemplos en stories\n * Tamaño: 16x16px\n */\nexport const UserIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M8 8C9.10457 8 10 7.10457 10 6C10 4.89543 9.10457 4 8 4C6.89543 4 6 4.89543 6 6C6 7.10457 6.89543 8 8 8Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M4.5 13C4.5 11.3431 6.13401 10 8 10C9.86599 10 11.5 11.3431 11.5 13\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n","import React, { useState } from 'react';\nimport type {\n DropdownItemCollapsibleProps,\n DropdownItemCollapsibleChildProps,\n} from './DropdownItemCollapsible.types';\nimport { ChevronDownIcon } from './icons';\nimport { Badge } from '../Badge/Badge';\n\n/**\n * Componente DropdownItemCollapsible del sistema de diseño Siesa\n *\n * Item colapsable para uso dentro de Dropdowns que permite agrupar\n * items relacionados en secciones expandibles.\n *\n * **Características:**\n * - Soporte completo para expandir/colapsar\n * - Iconos personalizables en header y children\n * - Items anidados indentados automáticamente\n * - Dark mode completo con inversión de colores\n * - Estados: default, hover, active, disabled\n * - Focus rings adaptativos\n * - Animación suave de rotación del chevron\n *\n * **Estados visuales:**\n * - `collapsed`: Muestra solo el header con chevron apuntando down\n * - `expanded`: Muestra header y lista de items anidados\n * - `disabled`: Opacidad 50%, sin interacción\n * - `hover`: Fondo de hover sutil, color primario del icono\n * - `active`: Item anidado seleccionado con fondo custom-primary\n *\n * **Espaciado según Figma:**\n * - Header padding: px-4 py-2 (16px horizontal, 8px vertical)\n * - Item anidado padding: pl-6 pr-4 py-2 (24px left, 16px right, 8px vertical)\n * - Gap entre elementos: gap-3 (12px)\n * - Gap interno (icon + text): gap-3 (12px)\n * - Indent entre niveles: 8px adicional por nivel\n * - Divisor: borde top de 1px con spacing-0.5 (2px) arriba\n * - Sección heading: pt-3 pb-1 px-0 (12px top, 4px bottom, sin horizontal)\n *\n * **Tipografía:**\n * - Header: Paragraph/Small (14px, Regular, line-height 20px) - text-content-primary\n * - Items anidados: Paragraph/Small (14px, Regular, line-height 20px) - text-content-primary\n * - Heading: Paragraph/Tiny (12px, Regular, line-height 16px) - text-content-tertiary\n *\n * **Colores (Light Mode):**\n * - Header text: content-primary (#18181b)\n * - Header icon: content-secondary (#a1a1aa)\n * - Header hover: bg-background-custom-primary (#dbeefe)\n * - Header text hover: content-custom-primary (#0e79fd)\n * - Item text: content-primary (#18181b)\n * - Item hover: bg-transparent (sin fondo)\n * - Divider: border-border-primary (#e4e4e7)\n * - Heading text: content-tertiary (#71717a)\n *\n * **Colores (Dark Mode):**\n * - Header text: content-primary/dark (#fafafa)\n * - Header icon: content-secondary/dark (#a1a1aa)\n * - Header hover: bg-background-custom-primary/dark (#0e5ab0)\n * - Header text hover: content-custom-primary/dark (#bfe2fe)\n * - Item text: content-primary/dark (#fafafa)\n * - Divider: border-border-primary/dark (#3f3f46)\n * - Heading text: content-tertiary/dark (#a1a1aa)\n *\n * **Border radius:**\n * - Todos los items: rounded-lg (8px)\n *\n * **Sombras:**\n * - Ninguna (usado dentro de dropdowns)\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=6135-34374\n *\n * @example\n * ```tsx\n * // Item colapsable simple\n * <DropdownItemCollapsible\n * label=\"Users\"\n * icon={<UserIcon />}\n * children={[\n * { label: \"Active Users\", icon: <CheckIcon /> },\n * { label: \"Inactive Users\", icon: <CloseIcon /> },\n * ]}\n * />\n *\n * // Con encabezado de sección\n * <DropdownItemCollapsible\n * label=\"Customers\"\n * icon={<BuildingIcon />}\n * showHeading={true}\n * headingLabel=\"SECTION 1\"\n * children={[...]}\n * />\n *\n * // Item no colapsable (actúa como botón normal)\n * <DropdownItemCollapsible\n * label=\"Single Item\"\n * icon={<StarIcon />}\n * isCollapsible={false}\n * onClick={() => console.log('clicked')}\n * />\n * ```\n */\nexport const DropdownItemCollapsible: React.FC<DropdownItemCollapsibleProps> = ({\n label,\n icon,\n children = [],\n defaultOpen = false,\n disabled = false,\n onOpenChange,\n onClick,\n isCollapsible = children.length > 0,\n showHeading = false,\n headingLabel,\n showDivider = true,\n selected = false,\n badge = false,\n badgeCount,\n badgeColor = 'red',\n className = '',\n}) => {\n const [isOpen, setIsOpen] = useState(defaultOpen);\n\n const handleToggle = () => {\n if (disabled || !isCollapsible) return;\n\n const newOpen = !isOpen;\n setIsOpen(newOpen);\n onOpenChange?.(newOpen);\n };\n\n const handleHeaderClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) return;\n\n if (isCollapsible) {\n handleToggle();\n } else {\n onClick?.(e);\n }\n };\n\n const handleChildClick = (child: DropdownItemCollapsibleChildProps) => (\n e: React.MouseEvent<HTMLDivElement>,\n ) => {\n if (child.disabled) return;\n child.onClick?.(e);\n };\n\n return (\n <div className={`flex flex-col gap-0.5 w-full ${className}`}>\n {/* Section Heading */}\n {showHeading && headingLabel && (\n <div className=\"flex flex-col gap-0 items-start pb-1 pt-3 px-0 w-full\">\n <p className=\"font-['Inter:Regular',sans-serif] font-normal leading-4 not-italic text-xs text-content-tertiary dark:text-content-tertiary w-full\">\n {headingLabel}\n </p>\n </div>\n )}\n\n {/* Header Button */}\n <button\n onClick={handleHeaderClick}\n disabled={disabled}\n className={[\n // Base\n 'flex items-center gap-3 px-4 py-2 w-full',\n 'rounded-lg cursor-pointer',\n 'transition-all duration-150',\n\n // Colores y estados (Light Mode)\n selected && !disabled && 'bg-primary-custom-100 text-primary-custom-600',\n !selected && !disabled && 'text-content-primary',\n !disabled && 'hover:bg-primary-custom-100',\n !disabled && 'hover:text-primary-custom-600',\n\n // Dark Mode\n selected && !disabled && 'dark:bg-dark-bg-custom dark:text-dark-content-custom',\n !selected && !disabled && 'dark:text-content-primary',\n !disabled && 'dark:hover:bg-dark-bg-custom',\n !disabled && 'dark:hover:text-dark-content-custom',\n\n // Focus ring\n !disabled && 'focus:outline-hidden',\n !disabled && 'focus:ring-2',\n !disabled && 'focus:ring-offset-2',\n !disabled && 'focus:ring-primary-custom-400',\n !disabled && 'focus:ring-offset-bg-primary',\n !disabled && 'dark:focus:ring-offset-dark-bg-primary',\n\n // Disabled\n disabled && 'opacity-50',\n disabled && 'cursor-not-allowed',\n ]\n .filter(Boolean)\n .join(' ')}\n aria-expanded={isOpen && isCollapsible}\n aria-disabled={disabled}\n >\n {/* Icon Wrapper */}\n {icon && (\n <div className=\"flex items-center justify-center w-4 h-4 shrink-0 text-content-secondary dark:text-content-secondary\">\n {icon}\n </div>\n )}\n\n {/* Content Wrapper */}\n <div className=\"flex flex-1 flex-col items-start justify-center gap-0.5\">\n <p className=\"font-['Inter:Regular',sans-serif] font-normal leading-5 not-italic text-sm text-left\">\n {label}\n </p>\n </div>\n\n {/* Badge */}\n {(badge || badgeCount) && (\n <div className=\"flex items-center justify-center shrink-0\">\n {badgeCount ? (\n <div className=\"flex items-center justify-center px-1.5 py-0.5 rounded-full bg-red-500 dark:bg-red-600 text-white text-xs font-bold min-w-6 h-6\">\n {badgeCount > 99 ? '99+' : badgeCount}\n </div>\n ) : (\n <div className=\"w-2 h-2 rounded-full bg-red-500 dark:bg-red-600 shrink-0\" />\n )}\n </div>\n )}\n\n {/* Chevron (solo visible si es colapsable) */}\n {isCollapsible && (\n <div\n className={[\n 'flex items-center justify-center w-4 h-4 shrink-0',\n 'text-content-secondary dark:text-content-secondary',\n 'transition-transform duration-200',\n isOpen ? 'rotate-180' : 'rotate-0',\n ].join(' ')}\n >\n <ChevronDownIcon className=\"w-4 h-4\" />\n </div>\n )}\n </button>\n\n {/* Divider */}\n {showDivider && <div className=\"w-full h-px bg-border-primary dark:bg-dark-border-primary\" />}\n\n {/* Children Container (expanded) */}\n {isOpen && isCollapsible && children.length > 0 && (\n <div className=\"flex flex-col gap-0.5 w-full py-2 px-0\">\n {children.map((child, index) => (\n <div\n key={index}\n onClick={handleChildClick(child)}\n className={[\n // Base\n 'flex gap-3 items-center pl-6 pr-4 py-2 w-full',\n 'rounded-lg cursor-pointer',\n 'transition-all duration-150',\n\n // Colores y estados (Light Mode)\n !child.disabled && 'text-content-primary',\n !child.disabled && 'hover:bg-primary-custom-100',\n !child.disabled && 'hover:text-primary-custom-600',\n\n // Dark Mode\n !child.disabled && 'dark:text-content-primary',\n !child.disabled && 'dark:hover:bg-dark-bg-custom',\n !child.disabled && 'dark:hover:text-dark-content-custom',\n\n // Focus ring\n !child.disabled && 'focus:outline-hidden',\n !child.disabled && 'focus:ring-2',\n !child.disabled && 'focus:ring-offset-2',\n !child.disabled && 'focus:ring-primary-custom-400',\n !child.disabled && 'focus:ring-offset-bg-primary',\n !child.disabled && 'dark:focus:ring-offset-dark-bg-primary',\n\n // Disabled\n child.disabled && 'opacity-50',\n child.disabled && 'cursor-not-allowed',\n\n // Custom classes\n child.className,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {/* Child Icon Wrapper */}\n {child.icon && (\n <div className=\"flex items-center justify-center w-4 h-4 shrink-0 text-content-secondary dark:text-content-secondary\">\n {child.icon}\n </div>\n )}\n\n {/* Child Content Wrapper */}\n <div className=\"flex flex-1 flex-col items-start justify-center gap-0.5\">\n <p className=\"font-['Inter:Regular',sans-serif] font-normal leading-5 not-italic text-sm text-left\">\n {child.label}\n </p>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n};\n\nexport default DropdownItemCollapsible;\n","/**\n * Iconos para el componente DropdownItemHeading\n * Usando heroicons-micro según especificaciones de Figma\n * \n * Los iconos se pueden pasar como strings al componente:\n * - 'cog-6-tooth': Icono de engranaje\n * - 'check': Icono de check\n * - 'x': Icono de cerrar\n * - 'chevron-down': Icono de chevron hacia abajo\n * \n * @see DropdownItemHeading.tsx para ver cómo se usan\n */\n\nimport React from 'react';\n\ninterface IconProps {\n className?: string;\n}\n\n/**\n * Icono Cog (heroicons-micro/cog-6-tooth)\n * Usado como icono por defecto en DropdownItemHeading\n * Tamaño: 16x16px\n */\nexport const CogIcon = ({ className = 'w-4 h-4' }: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className={className}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M6.455 1.45A.5.5 0 0 1 6.952 1h2.096a.5.5 0 0 1 .497.45l.186 1.858a4.996 4.996 0 0 1 1.466.848l1.703-.769a.5.5 0 0 1 .639.206l1.047 1.814a.5.5 0 0 1-.14.656l-1.517 1.09a5.026 5.026 0 0 1 0 1.694l1.516 1.09a.5.5 0 0 1 .141.656l-1.047 1.814a.5.5 0 0 1-.639.206l-1.703-.768c-.433.36-.928.649-1.466.847l-.186 1.858a.5.5 0 0 1-.497.45H6.952a.5.5 0 0 1-.497-.45l-.186-1.858a4.993 4.993 0 0 1-1.466-.848l-1.703.769a.5.5 0 0 1-.639-.206l-1.047-1.814a.5.5 0 0 1 .14-.656l1.517-1.09a5.033 5.033 0 0 1 0-1.694l-1.516-1.09a.5.5 0 0 1-.141-.656L2.461 3.39a.5.5 0 0 1 .639-.206l1.703.768c.433-.36.928-.649 1.466-.847l.186-1.858ZM8 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Icono Check (heroicons-micro/check)\n */\nexport const CheckIcon = ({ className = 'w-4 h-4' }: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className={className}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 1 1-1.06-1.06L12.69 4.22a.75.75 0 0 1 1.06 0Z\"\n clipRule=\"evenodd\"\n />\n <path\n fillRule=\"evenodd\"\n d=\"M2.22 9.28a.75.75 0 0 0 0 1.06l2.5 2.5a.75.75 0 1 0 1.06-1.06l-2.5-2.5a.75.75 0 0 0-1.06 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Icono X (heroicons-micro/x-mark)\n */\nexport const XIcon = ({ className = 'w-4 h-4' }: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className={className}\n >\n <path d=\"M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z\" />\n </svg>\n);\n\n/**\n * Icono ChevronDown (heroicons-micro/chevron-down)\n */\nexport const ChevronDownIcon = ({ className = 'w-4 h-4' }: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className={className}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Mapeo de nombres de iconos a componentes\n * Permite usar strings para referenciar iconos\n */\nexport const iconMap: Record<string, React.FC<IconProps>> = {\n 'cog-6-tooth': CogIcon,\n 'check': CheckIcon,\n 'x': XIcon,\n 'chevron-down': ChevronDownIcon,\n};\n\n/**\n * Obtener un icono por su nombre\n * @param iconName - Nombre del icono (ej: 'cog-6-tooth', 'check', 'x', 'chevron-down')\n * @param className - Clases CSS adicionales\n * @returns Componente del icono o null si no existe\n */\nexport const getIcon = (\n iconName: string | null | undefined,\n className?: string\n): React.ReactNode => {\n if (!iconName) return null;\n\n const IconComponent = iconMap[iconName];\n if (!IconComponent) {\n console.warn(`Icon \"${iconName}\" not found in iconMap`);\n return null;\n }\n\n return <IconComponent className={className} />;\n};\n","import React from 'react';\nimport type { DropdownItemHeadingProps } from './DropdownItemHeading.types';\nimport { getIcon } from './icons';\n\n/**\n * Componente DropdownItemHeading del sistema de diseño Siesa\n *\n * Implementación pixel-perfect basada en Figma (node 6135:32539)\n * para encabezados en menús dropdown con icono, label, descripción y acción.\n *\n * **Estructura:**\n * - Icon Wrapper: Opcional, icono de 16x16px\n * - Content Wrapper: Label + Description (flexible)\n * - Action Wrapper: Opcional, texto de acción en la derecha\n *\n * **Dimensiones:**\n * - Altura flexible (contenido vertical)\n * - Width mínimo: 224px\n * - Padding: 8px vertical, 16px horizontal\n * - Border radius: 8px (rounded-lg)\n *\n * **Tipografía:**\n * - Label: Label/Small (14px Bold) - content-primary\n * - Description: Paragraph/Tiny (12px Regular) - content-secondary\n * - Action: Paragraph/XXSmall (10px Regular) - content-secondary\n *\n * **Dark Mode:**\n * - Label: #18181b (light) → #bfe2fe (dark)\n * - Description: #a1a1aa (light) → #93d1fd (dark)\n * - Icon: #0e79fd (light) → #bfe2fe (dark)\n * - Action: #a1a1aa (light) → #93d1fd (dark)\n *\n * **Estados:**\n * - Default: Sin hover/focus\n * - Hover: Overlay sutil (managed by parent Dropdown)\n * - Disabled: Opacity 50% (managed by parent Dropdown)\n *\n * **Especificaciones de Figma:**\n * - Gap entre elementos: 12px\n * - Gap entre label y description: 2px\n * - Rounded: 8px (rounded-lg)\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label/Small, Paragraph/Tiny)\n * @see docs/spacing.md - Sistema de espaciado\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=6135-32539 - Diseño Figma\n *\n * @example\n * ```tsx\n * // Con icono, label, descripción y acción\n * <DropdownItemHeading\n * label=\"Settings\"\n * description=\"Configure your preferences\"\n * showDescription={true}\n * icon={<SettingsIcon />}\n * showIcon={true}\n * actionLabel=\"Clear\"\n * showAction={true}\n * onActionClick={handleClear}\n * />\n *\n * // Solo label y descripción (sin icono ni acción)\n * <DropdownItemHeading\n * label=\"My Account\"\n * description=\"user@example.com\"\n * showDescription={true}\n * />\n *\n * // Solo label\n * <DropdownItemHeading\n * label=\"Quick Actions\"\n * showDescription={false}\n * />\n * ```\n */\nexport const DropdownItemHeading: React.FC<DropdownItemHeadingProps> = ({\n label = 'Label',\n description,\n showDescription = true,\n iconName = 'cog-6-tooth',\n showIcon = true,\n actionLabel,\n showAction = false,\n onActionClick,\n className = '',\n ...rest\n}) => {\n\n return (\n <div\n className={`\n flex\n gap-3\n items-center\n px-4\n py-2\n rounded-lg\n w-56\n ${className}\n `}\n data-testid=\"dropdown-item-heading\"\n {...rest}\n >\n {/* ===== ICON WRAPPER ===== */}\n {showIcon && iconName && (\n <div\n className=\"\n flex\n items-center\n justify-center\n shrink-0\n w-4\n h-4\n \"\n data-testid=\"icon-wrapper\"\n >\n <div className=\"text-primary-custom-600 dark:text-dark-content-inverse\">\n {getIcon(iconName, 'w-4 h-4')}\n </div>\n </div>\n )}\n\n {/* ===== CONTENT WRAPPER ===== */}\n <div\n className=\"\n flex\n flex-1\n flex-col\n gap-0.5\n items-start\n justify-center\n min-w-0\n \"\n data-testid=\"content-wrapper\"\n >\n {/* Label */}\n <p\n className=\"\n font-bold\n text-sm\n leading-5\n text-content-primary\n dark:text-dark-content-inverse\n whitespace-nowrap\n overflow-hidden\n text-ellipsis\n \"\n data-testid=\"label\"\n >\n {label}\n </p>\n\n {/* Description */}\n {showDescription && description && (\n <p\n className=\"\n font-normal\n text-xs\n leading-4\n text-content-secondary\n dark:text-dark-border-inverse\n w-full\n whitespace-pre-wrap\n overflow-hidden\n text-ellipsis\n \"\n data-testid=\"description\"\n >\n {description}\n </p>\n )}\n </div>\n\n {/* ===== ACTION WRAPPER ===== */}\n {showAction && actionLabel && (\n <div\n className=\"\n flex\n items-center\n justify-center\n shrink-0\n cursor-pointer\n hover:opacity-80\n transition-opacity\n duration-150\n \"\n data-testid=\"action-wrapper\"\n onClick={onActionClick}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onActionClick?.(e as any);\n }\n }}\n >\n <p\n className=\"\n font-normal\n text-xs\n leading-3\n text-content-secondary\n dark:text-dark-border-inverse\n whitespace-nowrap\n \"\n data-testid=\"action-label\"\n >\n {actionLabel}\n </p>\n </div>\n )}\n </div>\n );\n};\n\nDropdownItemHeading.displayName = 'DropdownItemHeading';\n","import React from 'react';\nimport type { NotificationProps } from './Notification.types';\n\n/**\n * Componente Notification del sistema de diseño Siesa\n *\n * Badge de notificación para indicar alertas, mensajes o notificaciones pendientes.\n * Puede mostrar un punto simple o un contador numérico con límite automático a 99+.\n *\n * **Especificaciones de Figma:**\n * - Badge con número: 27px × 13px (aprox), Label/XXSmall (10px Bold, line-height 12px)\n * - Badge simple (dot): 13px × 13px\n * - Color: `content-extensions-red` (#b91c1c) por defecto\n * - Border radius: Pill (rounded-full)\n * - Padding: 4px horizontal\n *\n * **Variantes:**\n * - Sin count: Muestra punto circular (dot)\n * - Con count: Muestra badge con número (máximo 99+)\n *\n * **Uso típico:**\n * - Como overlay en iconos o botones\n * - En elementos de menú o navegación\n * - Standalone para indicar estado\n *\n * @see docs/colors.md - Sistema de colores (token content-extensions-red)\n * @see docs/typography.md - Sistema tipográfico (Label/XXSmall)\n * @see src/components/Button/Button.tsx - Referencia de badges en botones\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4310-22651\n *\n * @example\n * ```tsx\n * // Badge simple (punto)\n * <Notification />\n *\n * // Badge con número\n * <Notification count={5} />\n *\n * // Badge con muchos (muestra 99+)\n * <Notification count={150} />\n *\n * // Con color personalizado\n * <Notification count={3} color=\"green\" />\n *\n * // Como overlay en botón\n * <button className=\"relative\">\n * <BellIcon />\n * <Notification count={5} className=\"absolute -top-1 -right-1\" />\n * </button>\n * ```\n */\nexport const Notification: React.FC<NotificationProps> = ({\n count,\n color = 'red',\n className = '',\n ariaLabel,\n}) => {\n // ===== MAPA DE COLORES =====\n // Sistema de colores consistente con Button y Badge\n const colorClasses: Record<string, { bg: string; text: string }> = {\n zinc: { bg: 'bg-zinc-600', text: 'text-white' },\n red: { bg: 'bg-content-extensions-red', text: 'text-white' },\n orange: { bg: 'bg-orange-700', text: 'text-white' },\n amber: { bg: 'bg-amber-700', text: 'text-white' },\n yellow: { bg: 'bg-yellow-700', text: 'text-white' },\n lime: { bg: 'bg-lime-700', text: 'text-white' },\n green: { bg: 'bg-green-700', text: 'text-white' },\n emerald: { bg: 'bg-emerald-700', text: 'text-white' },\n teal: { bg: 'bg-teal-700', text: 'text-white' },\n cyan: { bg: 'bg-cyan-700', text: 'text-white' },\n sky: { bg: 'bg-sky-700', text: 'text-white' },\n blue: { bg: 'bg-blue-700', text: 'text-white' },\n indigo: { bg: 'bg-indigo-700', text: 'text-white' },\n violet: { bg: 'bg-violet-700', text: 'text-white' },\n purple: { bg: 'bg-purple-700', text: 'text-white' },\n fuchsia: { bg: 'bg-fuchsia-700', text: 'text-white' },\n pink: { bg: 'bg-pink-700', text: 'text-white' },\n rose: { bg: 'bg-rose-700', text: 'text-white' },\n primary: { bg: 'bg-primary-custom-600', text: 'text-white' },\n secondary: { bg: 'bg-zinc-600', text: 'text-white' },\n tertiary: { bg: 'bg-zinc-600', text: 'text-white' },\n };\n\n const colors = colorClasses[color] || colorClasses.red;\n\n // ===== ARIA LABEL DINÁMICO =====\n const dynamicAriaLabel = ariaLabel ||\n (count !== undefined && count > 0\n ? `${count} notificaci${count === 1 ? 'ón' : 'ones'}`\n : 'Notificación pendiente');\n\n // ===== BADGE CON NÚMERO =====\n if (count !== undefined && count > 0) {\n const displayCount = count > 99 ? '99+' : count.toString();\n\n return (\n <span\n className={`\n inline-flex\n items-center\n justify-center\n min-w-[16px]\n h-4\n px-1\n rounded-full\n text-[10px]\n font-bold\n leading-none\n ${colors.bg}\n ${colors.text}\n pointer-events-none\n dark:${colors.bg}\n dark:${colors.text}\n ${className}\n `\n .trim()\n .replace(/\\s+/g, ' ')}\n role=\"status\"\n aria-label={dynamicAriaLabel}\n >\n {displayCount}\n </span>\n );\n }\n\n // ===== BADGE SIMPLE (DOT) =====\n return (\n <span\n className={`\n inline-block\n w-2\n h-2\n rounded-full\n ${colors.bg}\n pointer-events-none\n dark:${colors.bg}\n ${className}\n `\n .trim()\n .replace(/\\s+/g, ' ')}\n role=\"status\"\n aria-label={dynamicAriaLabel}\n />\n );\n};\n","import React from 'react';\n\n/**\n * Icono de flecha izquierda (ChevronLeft)\n * Usado en el botón \"Back\"\n * Heroicons Micro (16x16px)\n */\nexport const ArrowLeftIcon: React.FC<{ className?: string }> = ({ className = '' }) => {\n return (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M9.78 4.22a.75.75 0 0 1 0 1.06L7.06 8l2.72 2.72a.75.75 0 1 1-1.06 1.06L5.47 8.53a.75.75 0 0 1 0-1.06l3.25-3.25a.75.75 0 0 1 1.06 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n};\n\n/**\n * Icono de flecha derecha (ChevronRight)\n * Usado en el botón \"Next\"\n * Heroicons Micro (16x16px)\n */\nexport const ArrowRightIcon: React.FC<{ className?: string }> = ({ className = '' }) => {\n return (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M6.22 4.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1 0 1.06l-3.25 3.25a.75.75 0 0 1-1.06-1.06L8.94 8 6.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n};\n","import React, { useMemo } from 'react';\nimport type { PaginationProps, PageButtonProps } from './Pagination.types';\nimport { ArrowLeftIcon, ArrowRightIcon } from './icons';\n\n/**\n * Componente Pagination del sistema de diseño Siesa\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n * - Algoritmo de paginación inteligente\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label Small)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Pagination\n * currentPage={1}\n * totalPages={66}\n * onPageChange={(page) => console.log(page)}\n * />\n * ```\n */\nexport const Pagination: React.FC<PaginationProps> = ({\n currentPage = 1,\n totalPages,\n onPageChange,\n backText = 'Atrás',\n nextText = 'Siguiente',\n siblingCount = 1,\n showBackButton = true,\n showNextButton = true,\n className = '',\n ariaLabel = 'Paginación',\n}) => {\n /**\n * Genera el array de páginas a mostrar\n * Algoritmo: [1] ... [currentPage-1] [currentPage] [currentPage+1] ... [totalPages]\n */\n const paginationRange = useMemo(() => {\n const totalNumbers = siblingCount * 2 + 3; // Página actual + siblings + primera + última\n const totalBlocks = totalNumbers + 2; // + 2 separadores \"...\"\n\n // Si el total de páginas es menor que el total de bloques, mostrar todas\n if (totalPages <= totalBlocks) {\n return Array.from({ length: totalPages }, (_, i) => i + 1);\n }\n\n const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);\n const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);\n\n const shouldShowLeftDots = leftSiblingIndex > 2;\n const shouldShowRightDots = rightSiblingIndex < totalPages - 1;\n\n const firstPageIndex = 1;\n const lastPageIndex = totalPages;\n\n // No mostrar dots a la izquierda\n if (!shouldShowLeftDots && shouldShowRightDots) {\n const leftItemCount = 3 + 2 * siblingCount;\n const leftRange = Array.from({ length: leftItemCount }, (_, i) => i + 1);\n return [...leftRange, '...', totalPages];\n }\n\n // No mostrar dots a la derecha\n if (shouldShowLeftDots && !shouldShowRightDots) {\n const rightItemCount = 3 + 2 * siblingCount;\n const rightRange = Array.from(\n { length: rightItemCount },\n (_, i) => totalPages - rightItemCount + i + 1\n );\n return [firstPageIndex, '...', ...rightRange];\n }\n\n // Mostrar ambos dots\n if (shouldShowLeftDots && shouldShowRightDots) {\n const middleRange = Array.from(\n { length: rightSiblingIndex - leftSiblingIndex + 1 },\n (_, i) => leftSiblingIndex + i\n );\n return [firstPageIndex, '...', ...middleRange, '...', lastPageIndex];\n }\n\n return [];\n }, [currentPage, totalPages, siblingCount]);\n\n /**\n * Handler para cambio de página\n */\n const handlePageChange = (page: number) => {\n if (page >= 1 && page <= totalPages && page !== currentPage) {\n onPageChange?.(page);\n }\n };\n\n /**\n * Componente interno: Botón de página\n */\n const PageButton: React.FC<PageButtonProps> = ({\n page,\n isActive = false,\n disabled = false,\n onClick,\n ariaLabel: buttonAriaLabel,\n }) => {\n const isDots = page === '...';\n\n // ===== CLASES BASE =====\n const baseClasses = `\n inline-flex\n items-center\n justify-center\n gap-3\n px-3\n py-2\n rounded-md\n font-bold\n text-sm\n whitespace-nowrap\n transition-all\n duration-150\n `;\n\n // ===== CLASES DE ESTADO =====\n const stateClasses = isDots\n ? `\n text-primary-custom-600\n dark:text-primary-custom-600\n cursor-default\n pointer-events-none\n `\n : isActive\n ? `\n bg-primary-custom-100\n text-primary-custom-600\n dark:bg-primary-custom-100\n dark:text-primary-custom-600\n `\n : `\n text-primary-custom-600\n hover:bg-primary-custom-100\n active:scale-95\n dark:text-primary-custom-600\n dark:hover:bg-primary-custom-100\n dark:active:scale-95\n `;\n\n // ===== CLASES DE DISABLED =====\n const disabledClasses = disabled\n ? `\n opacity-50\n cursor-not-allowed\n pointer-events-none\n `\n : '';\n\n // ===== COMBINAR CLASES =====\n const buttonClasses = [baseClasses, stateClasses, disabledClasses]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type=\"button\"\n className={buttonClasses}\n onClick={onClick}\n disabled={disabled || isDots}\n aria-label={buttonAriaLabel}\n aria-current={isActive ? 'page' : undefined}\n >\n {page}\n </button>\n );\n };\n\n // ===== CLASES DEL CONTAINER =====\n const containerClasses = `\n inline-flex\n items-center\n justify-between\n gap-0\n ${className}\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <nav className={containerClasses} aria-label={ariaLabel} role=\"navigation\">\n {/* ===== BOTÓN BACK ===== */}\n {showBackButton && (\n <button\n type=\"button\"\n className={`\n inline-flex\n items-center\n justify-center\n gap-3\n px-3\n py-2\n rounded-md\n font-bold\n text-sm\n text-primary-custom-600\n hover:bg-primary-custom-100\n active:scale-95\n dark:text-primary-custom-600\n dark:hover:bg-primary-custom-100\n dark:active:scale-95\n transition-all\n duration-150\n ${currentPage === 1 ? 'opacity-50 cursor-not-allowed pointer-events-none' : ''}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n onClick={() => handlePageChange(currentPage - 1)}\n disabled={currentPage === 1}\n aria-label={`${backText} page`}\n >\n <ArrowLeftIcon className=\"w-4 h-4\" />\n {backText}\n </button>\n )}\n\n {/* ===== NÚMEROS DE PÁGINA ===== */}\n <div className=\"inline-flex items-center\">\n {paginationRange.map((page, index) => (\n <PageButton\n key={`${page}-${index}`}\n page={page}\n isActive={page === currentPage}\n onClick={() => typeof page === 'number' && handlePageChange(page)}\n ariaLabel={\n typeof page === 'number' ? `Go to page ${page}` : `Page ${page}`\n }\n />\n ))}\n </div>\n\n {/* ===== BOTÓN NEXT ===== */}\n {showNextButton && (\n <button\n type=\"button\"\n className={`\n inline-flex\n items-center\n justify-center\n gap-3\n px-3\n py-2\n rounded-md\n font-bold\n text-sm\n text-primary-custom-600\n hover:bg-primary-custom-100\n active:scale-95\n dark:text-primary-custom-600\n dark:hover:bg-primary-custom-100\n dark:active:scale-95\n transition-all\n duration-150\n ${\n currentPage === totalPages\n ? 'opacity-50 cursor-not-allowed pointer-events-none'\n : ''\n }\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n onClick={() => handlePageChange(currentPage + 1)}\n disabled={currentPage === totalPages}\n aria-label={`${nextText} page`}\n >\n {nextText}\n <ArrowRightIcon className=\"w-4 h-4\" />\n </button>\n )}\n </nav>\n );\n};\n","import * as React from \"react\";\nfunction CheckIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"m4.5 12.75 6 6 9-13.5\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(CheckIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction ChevronUpDownIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ChevronUpDownIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction ClockIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ClockIcon);\nexport default ForwardRef;","import React from 'react';\nimport {\n ChevronUpDownIcon as HeroChevronUpDown,\n CheckIcon as HeroCheck\n} from '@heroicons/react/24/outline';\n\n/**\n * Icono ChevronUpDown para el trigger del Select\n * Basado en Heroicons 24/outline (24x24px)\n *\n * @see https://heroicons.com/\n */\nexport const ChevronUpDownIcon: React.FC<{ className?: string }> = ({ className = 'size-5' }) => (\n <HeroChevronUpDown className={className} aria-hidden=\"true\" />\n);\n\n/**\n * Icono Check para los items seleccionados del menu\n * Basado en Heroicons 24/outline (24x24px)\n *\n * @see https://heroicons.com/\n */\nexport const CheckIcon: React.FC<{ className?: string }> = ({ className = 'size-4' }) => (\n <HeroCheck className={className} aria-hidden=\"true\" />\n);\n","import React, { useState, useRef, useEffect } from 'react';\nimport type { SelectProps, SelectOption } from './Select.types';\nimport { ChevronUpDownIcon, CheckIcon } from './icons';\n\n/**\n * Select - Componente de selección (dropdown) del sistema de diseño Siesa\n *\n * Componente Select personalizado con menú desplegable para seleccionar opciones\n * de una lista. Incluye navegación por teclado, click outside y dark mode completo.\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels y keyboard navigation\n * - Click outside para cerrar el menú\n * - Soporte de teclado (Enter, Escape, Arrow Up/Down)\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Select\n * options={[\n * { value: '1', label: 'Option 1' },\n * { value: '2', label: 'Option 2' },\n * ]}\n * value={selectedValue}\n * onChange={setSelectedValue}\n * placeholder=\"Select an option\"\n * label=\"Choose one\"\n * />\n * ```\n */\nexport const Select: React.FC<SelectProps> = ({\n options = [],\n value,\n defaultValue,\n placeholder = 'Seleccionar...',\n disabled = false,\n error = false,\n label,\n description,\n showLabel = true,\n showDescription = true,\n menuHeader,\n onChange,\n className = '',\n triggerClassName = '',\n menuClassName = '',\n ariaLabel,\n id,\n name,\n required = false,\n menuPosition = 'bottom',\n fullWidth = false,\n}) => {\n // ===== ESTADO Y REFS =====\n const [isOpen, setIsOpen] = useState(false);\n const [selectedValue, setSelectedValue] = useState<string | number | undefined>(\n value !== undefined ? value : defaultValue\n );\n const [focusedIndex, setFocusedIndex] = useState(-1);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n\n // ===== SINCRONIZAR VALOR CONTROLADO =====\n useEffect(() => {\n if (value !== undefined) {\n setSelectedValue(value);\n }\n }, [value]);\n\n // ===== CERRAR AL HACER CLICK FUERA =====\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setIsOpen(false);\n }\n };\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }\n }, [isOpen]);\n\n // ===== KEYBOARD NAVIGATION =====\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (!isOpen) return;\n\n switch (event.key) {\n case 'Escape':\n setIsOpen(false);\n triggerRef.current?.focus();\n break;\n case 'ArrowDown':\n event.preventDefault();\n setFocusedIndex((prev) => (prev < options.length - 1 ? prev + 1 : 0));\n break;\n case 'ArrowUp':\n event.preventDefault();\n setFocusedIndex((prev) => (prev > 0 ? prev - 1 : options.length - 1));\n break;\n case 'Enter':\n event.preventDefault();\n if (focusedIndex >= 0 && focusedIndex < options.length) {\n handleSelect(options[focusedIndex]);\n }\n break;\n }\n };\n\n if (isOpen) {\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [isOpen, focusedIndex, options]);\n\n // ===== HELPERS =====\n const selectedOption = options.find((opt) => opt.value === selectedValue);\n\n const toggleMenu = () => {\n if (!disabled) {\n setIsOpen(!isOpen);\n setFocusedIndex(-1);\n }\n };\n\n const handleSelect = (option: SelectOption) => {\n if (option.disabled) return;\n\n setSelectedValue(option.value);\n setIsOpen(false);\n onChange?.(option.value);\n\n setTimeout(() => {\n triggerRef.current?.focus();\n }, 0);\n };\n\n // ===== CLASES BASE DEL TRIGGER =====\n // Usando el sistema tipográfico Paragraph Regular (14px = text-sm)\n // Border radius rounded-lg (8px) consistente con especificaciones\n // Gap de 12px (gap-3) entre texto e icono según Figma\n const baseTriggerClasses = `\n inline-flex\n items-center\n justify-between\n gap-3\n w-full\n px-3\n py-2\n text-sm\n font-normal\n leading-5\n rounded-lg\n border\n transition-all\n duration-150\n `;\n\n // ===== CLASES DE WIDTH =====\n const widthClasses = fullWidth ? 'w-full' : 'min-w-[200px]';\n\n // ===== CLASES PARA ESTADOS DEL TRIGGER =====\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n const triggerStateClasses = error\n ? `\n border-error-border\n bg-error-bg\n text-content-primary\n dark:border-error-border\n dark:bg-error-bg\n dark:text-dark-content-primary\n `\n : `\n bg-bg-primary\n border-border-primary\n text-content-primary\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n dark:text-dark-content-primary\n `;\n\n // ===== CLASES PARA HOVER DEL TRIGGER =====\n // Hover: border más claro según Figma (#f9f9f9)\n const triggerHoverClasses =\n !disabled && !error\n ? `\n hover:border-[#f9f9f9]\n dark:hover:border-[#3a3a3f]\n `\n : '';\n\n // ===== CLASES PARA FOCUS DEL TRIGGER =====\n // Focus: border-2 con color específico #329cff según Figma\n const triggerFocusClasses = !disabled\n ? `\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n `\n : '';\n\n // ===== CLASES PARA DISABLED DEL TRIGGER =====\n const triggerDisabledClasses = disabled\n ? `\n opacity-50\n cursor-not-allowed\n `\n : '';\n\n // ===== COMBINAR CLASES DEL TRIGGER =====\n const finalTriggerClasses = [\n baseTriggerClasses,\n widthClasses,\n triggerStateClasses,\n triggerHoverClasses,\n triggerFocusClasses,\n triggerDisabledClasses,\n triggerClassName,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES BASE DEL MENU =====\n // Según Figma: altura fija 160px (h-40), border secundario,\n // spacing de 4px desde trigger (mt-1), shadow-lg para elevación\n const baseMenuClasses = `\n absolute\n z-50\n w-full\n min-w-[200px]\n max-h-40\n overflow-y-auto\n p-1\n rounded-md\n border\n shadow-lg\n transition-all\n duration-150\n `;\n\n // ===== CLASES DE POSICIÓN DEL MENU =====\n // Figma muestra 4px de separación, usando mt-1 en lugar de mt-2\n const menuPositionClasses = menuPosition === 'top' ? 'bottom-full mb-1' : 'top-full mt-1';\n\n // ===== CLASES DE COLOR DEL MENU =====\n // Background secundario según Figma con border secundario\n const menuColorClasses = `\n bg-background-secondary\n border-border-secondary\n dark:bg-dark-bg-primary\n dark:border-dark-border-primary\n `;\n\n // ===== CLASES DE VISIBILIDAD DEL MENU =====\n const menuVisibilityClasses = isOpen ? 'opacity-100 visible' : 'opacity-0 invisible';\n\n // ===== COMBINAR CLASES DEL MENU =====\n const finalMenuClasses = [\n baseMenuClasses,\n menuPositionClasses,\n menuColorClasses,\n menuVisibilityClasses,\n menuClassName,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES BASE DEL MENU ITEM =====\n // CRÍTICO: Figma especifica text-[10px] leading-[12px] (Label XXSmall)\n // Gap de 2px (gap-0.5) entre elementos según Figma\n const baseMenuItemClasses = `\n flex\n items-center\n cursor-pointer\n rounded-md\n transition-all\n duration-150\n pl-2\n pr-2.5\n py-0.5\n gap-0.5\n text-[10px]\n leading-[12px]\n font-bold\n `;\n\n // ===== FUNCIÓN PARA OBTENER CLASES DE MENU ITEM =====\n const getMenuItemClasses = (option: SelectOption, index: number) => {\n const isSelected = option.value === selectedValue;\n const isFocused = index === focusedIndex;\n\n // Estados de color según Figma:\n // - Default: text-content-primary\n // - Hover: bg-primary-custom-600 + text-primary-inverse-content\n // - Selected: muestra check icon, mismo text color que default\n const colorClasses =\n isFocused || (isSelected && isFocused)\n ? 'bg-primary-custom-600 text-primary-inverse-content dark:bg-primary-custom-600 dark:text-primary-inverse-content'\n : 'text-content-primary dark:text-dark-content-primary';\n\n // Hover: fondo azul primario con texto blanco\n const hoverClasses = !option.disabled\n ? 'hover:bg-primary-custom-600 hover:text-primary-inverse-content dark:hover:bg-primary-custom-600 dark:hover:text-primary-inverse-content'\n : '';\n\n // Disabled\n const disabledClasses = option.disabled ? 'opacity-50 cursor-not-allowed' : '';\n\n return [baseMenuItemClasses, colorClasses, hoverClasses, disabledClasses]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n };\n\n // ===== CLASES DEL ICONO DEL TRIGGER =====\n // Chevron icon 20x20px (size-5) según sistema Heroicons\n const iconClasses = [\n 'shrink-0',\n 'w-4',\n 'h-4',\n 'transition-transform',\n 'duration-150',\n isOpen && 'rotate-180',\n disabled ? 'text-content-tertiary dark:text-content-tertiary' : 'text-content-secondary dark:text-content-secondary',\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL CHECK ICON =====\n const checkIconClasses = 'shrink-0 w-4 h-4';\n\n // ===== RENDERIZAR COMPONENTE =====\n return (\n <div className={`relative ${fullWidth ? 'w-full' : ''} ${className}`} ref={containerRef}>\n {/* Label and Description - Según Figma, van ANTES del trigger con gap-1 (4px) */}\n {(showLabel && label) || (showDescription && description) ? (\n <div className=\"flex flex-col gap-1 mb-1 w-full\">\n {/* Label - Label Small (14px bold) */}\n {showLabel && label && (\n <label\n htmlFor={id}\n className=\"text-sm font-bold leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n {label}\n {required && <span className=\"ml-1 text-error-content\">*</span>}\n </label>\n )}\n\n {/* Description - Paragraph Small (14px regular) */}\n {showDescription && description && (\n <p className=\"text-sm font-normal leading-5 text-content-tertiary dark:text-content-tertiary\">\n {description}\n </p>\n )}\n </div>\n ) : null}\n\n {/* Trigger Button */}\n <button\n ref={triggerRef}\n type=\"button\"\n className={finalTriggerClasses}\n onClick={toggleMenu}\n disabled={disabled}\n aria-label={ariaLabel || label}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen}\n id={id}\n >\n {/* Selected value or placeholder */}\n <span\n className={\n selectedOption ? '' : 'text-content-secondary dark:text-content-secondary'\n }\n >\n {selectedOption ? selectedOption.label : placeholder}\n </span>\n\n {/* Chevron icon */}\n <ChevronUpDownIcon className={iconClasses} />\n </button>\n\n {/* Hidden input for forms */}\n {name && (\n <input\n type=\"hidden\"\n name={name}\n value={selectedValue !== undefined ? String(selectedValue) : ''}\n />\n )}\n\n {/* Menu */}\n {isOpen && (\n <div ref={menuRef} className={finalMenuClasses} role=\"listbox\">\n {/* Menu Header - Opcional según Figma */}\n {menuHeader && (\n <div className=\"flex items-center gap-0.5 px-6 py-0.5 rounded-[5px]\">\n <span className=\"text-[10px] font-bold leading-[12px] text-content-tertiary dark:text-content-tertiary\">\n {menuHeader}\n </span>\n </div>\n )}\n\n {/* Empty state */}\n {options.length === 0 && (\n <div className=\"px-2 py-1.5 text-[10px] leading-[12px] text-content-secondary dark:text-content-secondary\">\n No hay opciones disponibles\n </div>\n )}\n\n {/* Options */}\n {options.map((option, index) => (\n <div\n key={option.value}\n className={getMenuItemClasses(option, index)}\n onClick={() => handleSelect(option)}\n onMouseEnter={() => setFocusedIndex(index)}\n role=\"option\"\n aria-selected={option.value === selectedValue}\n aria-disabled={option.disabled}\n >\n {/* Check icon for selected item */}\n <div className=\"w-4 flex items-center justify-center\">\n {option.value === selectedValue && <CheckIcon className={checkIconClasses} />}\n </div>\n\n {/* Custom icon if provided */}\n {option.icon && <span className=\"shrink-0 w-4 h-4\">{option.icon}</span>}\n\n {/* Label */}\n <span className=\"flex-1 text-left\">{option.label}</span>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n};\n","import React from 'react';\nimport type { NavigationRailProps, NavigationRailItemProps } from './NavigationRail.types';\n\n/**\n * NavigationRail del sistema de diseño Siesa\n *\n * Componente de navegación vertical (rail) para aplicaciones. Proporciona acceso\n * rápido a destinos principales mediante iconos y labels opcionales.\n *\n * **Características:**\n * - Ancho fijo de 80px para navegación compacta\n * - Soporte para FAB (Floating Action Button) en la parte superior\n * - Estados: normal, hover, selected, disabled\n * - Badges de notificación con contador opcional\n * - Alineación flexible: top, center, bottom\n * - Dark mode completo\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Tipografía Label XXSmall (10px Bold) según sistema de diseño\n * - Estados interactivos completos (hover, focus, active)\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label XXSmall)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Navigation Rail básico\n * <NavigationRail\n * items={[\n * { id: 'home', icon: <HomeIcon />, label: 'Inicio', selected: true },\n * { id: 'search', icon: <SearchIcon />, label: 'Buscar' },\n * { id: 'notifications', icon: <BellIcon />, label: 'Notificaciones', badgeCount: 5 },\n * ]}\n * alignment=\"top\"\n * />\n *\n * // Con FAB button\n * <NavigationRail\n * showFab\n * fabIcon={<PlusIcon />}\n * onFabClick={() => console.log('Create new')}\n * items={[...]}\n * />\n * ```\n */\n\n/**\n * NavigationRailItem - Componente interno para items individuales\n */\nconst NavigationRailItem: React.FC<NavigationRailItemProps> = ({\n icon,\n label,\n selected = false,\n disabled = false,\n badge = false,\n badgeCount,\n onClick,\n ariaLabel,\n id,\n}) => {\n // ===== CLASES DEL ICON CONTAINER =====\n // Estado selected usa background con overlay según Figma\n const iconContainerClasses = [\n // Base\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'px-4',\n 'py-1',\n 'rounded-full',\n 'overflow-hidden',\n 'shrink-0',\n\n // Estados\n selected\n ? // Selected: bg-primary-custom-100 con overlay de rgba(0,0,0,0.024)\n 'bg-primary-custom-100 dark:bg-primary-custom-600/30'\n : // Default/Hover: transparent → hover:bg-primary-custom-100\n 'bg-transparent hover:bg-primary-custom-100 dark:hover:bg-primary-custom-600/20',\n\n // Transiciones\n 'transition-colors',\n 'duration-150',\n ].join(' ');\n\n // ===== CLASES DEL ICONO =====\n const iconClasses = [\n 'w-4',\n 'h-4',\n 'shrink-0',\n\n // Colores según estado\n selected || !disabled\n ? // Selected o habilitado con hover: content-primary → hover:primary-custom-600\n selected\n ? 'text-primary-custom-600 dark:text-white'\n : 'text-content-primary hover:text-primary-custom-600 dark:text-dark-content-primary dark:hover:text-white'\n : // Disabled\n 'text-content-tertiary dark:text-content-tertiary',\n\n 'transition-colors',\n 'duration-150',\n ].join(' ');\n\n // ===== CLASES DEL LABEL =====\n const labelClasses = [\n // Tipografía: Label XXSmall (10px Bold, leading 12px)\n 'text-[10px]',\n 'leading-3',\n 'font-bold',\n 'text-center',\n 'w-full',\n 'min-w-full',\n\n // Colores\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ');\n\n // ===== CLASES DEL CONTENEDOR PRINCIPAL =====\n const containerClasses = [\n 'relative',\n 'flex',\n 'flex-col',\n 'items-center',\n 'gap-1',\n 'px-0.5',\n 'py-0',\n 'w-14', // 56px según Figma\n 'shrink-0',\n\n // Interactividad\n disabled\n ? 'cursor-not-allowed opacity-50 pointer-events-none'\n : 'cursor-pointer',\n\n // Focus\n 'focus:outline-hidden',\n 'focus-visible:ring-2',\n 'focus-visible:ring-primary-custom-400',\n 'focus-visible:ring-offset-2',\n 'dark:focus-visible:ring-dark-border-custom',\n 'dark:focus-visible:ring-offset-dark-bg-primary',\n 'rounded-lg',\n ].join(' ');\n\n // ===== RENDERIZAR BADGE =====\n const renderBadge = () => {\n if (!badge && badgeCount === undefined) return null;\n\n // Badge con número\n if (badgeCount !== undefined) {\n return (\n <span\n className=\"\n absolute\n -top-0.5\n left-[34px]\n flex\n items-center\n justify-center\n min-w-[13px]\n h-[13px]\n px-1\n rounded-full\n text-[10px]\n font-bold\n leading-none\n bg-red-700\n text-white\n dark:bg-red-700\n dark:text-white\n pointer-events-none\n \"\n aria-label={`${badgeCount} notificaciones`}\n >\n {badgeCount > 99 ? '99+' : badgeCount}\n </span>\n );\n }\n\n // Badge dot simple\n return (\n <span\n className=\"\n absolute\n -top-0.5\n left-[34px]\n w-[13px]\n h-[13px]\n rounded-full\n bg-red-700\n dark:bg-red-700\n pointer-events-none\n \"\n aria-label=\"Notificación\"\n />\n );\n };\n\n return (\n <button\n type=\"button\"\n className={containerClasses}\n disabled={disabled}\n onClick={onClick}\n aria-label={ariaLabel || label}\n aria-current={selected ? 'page' : undefined}\n data-item-id={id}\n >\n {/* Icon Container */}\n <div className={iconContainerClasses}>\n <span className={iconClasses}>\n {icon}\n </span>\n </div>\n\n {/* Label */}\n <p className={labelClasses}>\n {label}\n </p>\n\n {/* Badge */}\n {renderBadge()}\n </button>\n );\n};\n\n/**\n * NavigationRail - Componente principal\n */\nexport const NavigationRail: React.FC<NavigationRailProps> = ({\n items,\n alignment = 'top',\n showFab = false,\n fabIcon,\n onFabClick,\n fabAriaLabel = 'Crear nuevo',\n className = '',\n selectedId,\n onItemSelect,\n}) => {\n // ===== CLASES DEL CONTENEDOR PRINCIPAL =====\n const containerClasses = [\n // Layout\n 'flex',\n 'flex-col',\n 'items-center',\n 'relative',\n\n // Tamaño fijo según Figma\n 'w-20', // 80px\n 'h-full',\n\n // Fondo y bordes\n 'bg-white',\n 'dark:bg-dark-bg-primary',\n 'border-r',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n\n className,\n ].join(' ');\n\n // ===== CLASES DEL WRAPPER CON PADDING =====\n // Según Figma, cada alineación funciona diferente:\n // - top: flujo normal desde arriba\n // - center: wrapper con grow y items absolutamente centrados\n // - bottom: wrapper con grow y items con justify-end\n const wrapperClasses = [\n 'flex',\n 'flex-col',\n 'items-center',\n 'gap-10', // 40px entre FAB y items según Figma\n 'w-20', // 80px\n 'pb-10', // 40px padding bottom según Figma\n 'pt-2', // 8px padding top según Figma\n\n // Para center y bottom, el wrapper debe crecer para ocupar espacio\n alignment !== 'top' && 'grow',\n alignment !== 'top' && 'basis-0',\n alignment !== 'top' && 'min-h-0',\n ].filter(Boolean).join(' ');\n\n // ===== CLASES DEL CONTENEDOR DE ITEMS =====\n // Para cada alineación, los items se posicionan diferente\n const getItemsContainerClasses = () => {\n const baseClasses = [\n 'flex',\n 'flex-col',\n 'items-center',\n 'gap-3', // 12px según Figma\n 'w-20', // 80px\n ];\n\n if (alignment === 'top') {\n return [...baseClasses, 'shrink-0'].join(' ');\n }\n\n if (alignment === 'center') {\n // Items absolutamente centrados según Figma\n return [\n ...baseClasses,\n 'absolute',\n 'left-1/2',\n 'top-1/2',\n '-translate-x-1/2',\n '-translate-y-1/2',\n ].join(' ');\n }\n\n if (alignment === 'bottom') {\n // Items al final con grow y justify-end según Figma\n return [\n ...baseClasses,\n 'grow',\n 'basis-0',\n 'min-h-0',\n 'justify-end',\n 'shrink-0',\n ].join(' ');\n }\n\n return baseClasses.join(' ');\n };\n\n const itemsContainerClasses = getItemsContainerClasses();\n\n // ===== CLASES DEL FAB BUTTON =====\n const fabClasses = [\n // Layout\n 'flex',\n 'items-center',\n 'justify-center',\n 'p-3', // 12px padding según Figma\n 'shrink-0',\n\n // Estilo\n 'rounded-md',\n 'bg-primary-custom-600',\n 'text-primary-inverse-content',\n 'border',\n 'border-primary-custom-600',\n 'shadow-button-inset',\n\n // Estados\n 'hover:bg-primary-custom-500',\n 'active:scale-95',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'focus:ring-offset-2',\n\n // Dark mode\n 'dark:bg-dark-bg-inverse',\n 'dark:text-dark-content-inverse',\n 'dark:border-dark-bg-inverse',\n 'dark:hover:bg-dark-bg-inverse/90',\n 'dark:focus:ring-dark-border-custom',\n 'dark:focus:ring-offset-dark-bg-primary',\n\n // Transiciones\n 'transition-all',\n 'duration-150',\n ].join(' ');\n\n // ===== MANEJAR SELECCIÓN DE ITEM =====\n const handleItemClick = (item: NavigationRailItemProps) => {\n if (item.disabled) return;\n\n if (item.onClick) {\n item.onClick();\n }\n\n if (onItemSelect && item.id) {\n onItemSelect(item.id);\n }\n };\n\n return (\n <nav className={containerClasses} aria-label=\"Navegación principal\">\n <div className={wrapperClasses}>\n {/* FAB Button (opcional) */}\n {showFab && (\n <div className=\"flex items-start gap-2.5 shrink-0\">\n <button\n type=\"button\"\n className={fabClasses}\n onClick={onFabClick}\n aria-label={fabAriaLabel}\n >\n <span className=\"w-4 h-4 flex items-center justify-center\">\n {fabIcon}\n </span>\n </button>\n </div>\n )}\n\n {/* Navigation Items */}\n <div className={itemsContainerClasses}>\n {items.map((item, index) => (\n <NavigationRailItem\n key={item.id || index}\n {...item}\n selected={item.selected || (selectedId !== undefined && item.id === selectedId)}\n onClick={() => handleItemClick(item)}\n />\n ))}\n </div>\n </div>\n </nav>\n );\n};\n","import React, { useState } from 'react';\nimport type { NavigationRailPanelProps } from './NavigationRailPanel.types';\nimport { DropdownItemHeading } from '../DropdownItemHeading';\nimport { DropdownItemCollapsible } from '../DropdownItemCollapsible';\nimport { Input } from '../Input';\nimport { Divider } from '../Divider/Divider';\n\n/**\n * Componente NavigationRailPanel del sistema de diseño Siesa\n *\n * Panel de navegación vertical (rail) que puede contener múltiples secciones\n * de items, búsqueda y encabezados. Se usa típicamente en aplicaciones con\n * navegación compleja que requieren una estructura jerárquica.\n *\n * **Estructura principal:**\n * 1. Encabezado (DropdownItemHeading) - Opcional\n * 2. Input de búsqueda - Opcional\n * 3. Divisor - Siempre presente después de búsqueda/encabezado\n * 4. Body con secciones de items:\n * - Heading de sección (Paragraph/Tiny, content-tertiary)\n * - Items colapsables (DropdownItemCollapsible) o simples\n * - Divisor entre secciones\n *\n * **Dimensiones según Figma:**\n * - Altura: Variable (por defecto 900px)\n * - Ancho del panel: 248px (con padding 12px)\n * - Ancho de contenido: 224px\n * - Padding del panel: 12px\n * - Padding del body: 12px\n * - Border: 1px left (border-primary)\n * - Border radius: 0px (es un panel recto)\n *\n * **Tipografía:**\n * - Heading (DropdownItemHeading): Label/Small (14px Bold)\n * - Section heading: Paragraph/Tiny (12px Regular) - content-tertiary\n * - Items: Paragraph/Small (14px Regular)\n *\n * **Colores (Light Mode):**\n * - Background: #ffffff (white)\n * - Border: #e4e4e7 (border-primary)\n * - Heading text: #18181b (content-primary)\n * - Section heading: #71717a (content-tertiary)\n * - Item text: #18181b (content-primary)\n * - Icon color: #a1a1aa (content-secondary)\n *\n * **Colores (Dark Mode):**\n * - Background: #18181b (dark bg)\n * - Border: #3f3f46 (border-primary/dark)\n * - Heading text: #fafafa (content-primary/dark)\n * - Section heading: #a1a1aa (content-tertiary/dark)\n * - Item text: #fafafa (content-primary/dark)\n * - Icon color: #a1a1aa (content-secondary/dark)\n *\n * **Estados:**\n * - Default: Sin interacción\n * - Hover: Items con hover overlay sutil\n * - Focus: Focus ring adaptativo\n * - Disabled: Opacidad 50%\n * - Active (items colapsables): Expanded state\n *\n * **Espaciado interno:**\n * - Gap entre section heading e items: 0.5 (2px)\n * - Gap entre items: 0.5 (2px)\n * - Gap entre elemento y contenido: 3 (12px)\n * - Padding vertical section heading: pt-3 pb-1 (12px top, 4px bottom)\n * - Padding items: py-2 px-4 (8px vertical, 16px horizontal)\n *\n * **Scroll:**\n * - El body es scrolleable verticalmente (overflow-y-auto)\n * - El encabezado y búsqueda se mantienen fijos en el tope\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n * @see ../DropdownItemHeading - Componente reutilizado para encabezado\n * @see ../DropdownItemCollapsible - Componente reutilizado para items colapsables\n * @see ../Input - Componente reutilizado para búsqueda\n * @see ../Divider - Componente reutilizado para separadores\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=6134-34415 - Diseño Figma\n *\n * @example\n * ```tsx\n * // Ejemplo simple con secciones\n * <NavigationRailPanel\n * height={900}\n * showHeading={true}\n * heading={{\n * label: 'Settings',\n * description: 'Configure your preferences',\n * iconName: 'cog-6-tooth',\n * actionLabel: 'Clear',\n * showAction: true,\n * }}\n * showSearch={true}\n * search={{\n * placeholder: 'Buscar módulo',\n * }}\n * sections={[\n * {\n * heading: 'Section 1',\n * items: [\n * { label: 'Item 1', isCollapsible: true, children: [...] },\n * { label: 'Item 2', isCollapsible: false },\n * ],\n * },\n * {\n * heading: 'Section 2',\n * items: [\n * { label: 'Item 3' },\n * ],\n * },\n * ]}\n * />\n *\n * // Ejemplo con items simples sin secciones\n * <NavigationRailPanel\n * showHeading={false}\n * showSearch={true}\n * items={[\n * { label: 'Dashboard', icon: <DashboardIcon /> },\n * { label: 'Users', icon: <UserIcon /> },\n * { label: 'Settings', icon: <SettingsIcon /> },\n * ]}\n * />\n * ```\n */\nexport const NavigationRailPanel: React.FC<NavigationRailPanelProps> = ({\n height = 900,\n width = 248,\n showHeading = true,\n heading,\n showSearch = true,\n search,\n sections,\n items,\n className = '',\n panelClassName = '',\n}) => {\n const [searchValue, setSearchValue] = useState(search?.value || '');\n\n const handleSearchChange = (value: string) => {\n setSearchValue(value);\n search?.onChange?.(value);\n };\n\n // Construir clase de altura dinámicamente\n const containerStyle = {\n height: typeof height === 'number' ? `${height}px` : height,\n };\n\n const panelStyle = {\n width: typeof width === 'number' ? `${width}px` : width,\n };\n\n return (\n <div\n className={`flex items-start relative ${className}`}\n style={containerStyle}\n data-testid=\"navigation-rail-panel-container\"\n >\n <div\n className={`bg-bg-primary dark:bg-dark-bg-primary border-border-primary dark:border-dark-border-primary border-b-0 border-l border-r border-solid border-t-0 flex flex-col h-full items-start overflow-clip relative shrink-0 ${panelClassName}`}\n style={panelStyle}\n data-testid=\"navigation-rail-panel\"\n >\n {/* Encabezado (DropdownItemHeading) */}\n {showHeading && heading && (\n <div className=\"flex flex-col items-start p-3 relative shrink-0 w-full\">\n <DropdownItemHeading\n label={heading.label}\n description={heading.description}\n showDescription={heading.showDescription !== false}\n iconName={heading.iconName}\n showIcon={true}\n actionLabel={heading.actionLabel}\n showAction={heading.showAction}\n onActionClick={heading.onActionClick}\n className=\"w-full\"\n />\n </div>\n )}\n\n {/* Input de búsqueda */}\n {showSearch && (\n <div\n className=\"flex flex-col items-start p-3 relative shrink-0 w-full\"\n data-testid=\"navigation-rail-search\"\n >\n <Input\n placeholder={search?.placeholder || 'Buscar módulo'}\n value={searchValue}\n onChange={(e) => handleSearchChange(e.target.value)}\n className=\"w-full\"\n />\n </div>\n )}\n\n {/* Divisor */}\n <Divider className=\"w-full\" />\n\n {/* Body con items */}\n <div\n className=\"flex flex-1 flex-col gap-0.5 items-start min-h-px min-w-px p-3 relative shrink-0 overflow-y-auto w-full\"\n data-testid=\"navigation-rail-body\"\n >\n {/* Renderizar secciones */}\n {sections && sections.length > 0\n ? sections.map((section, sectionIndex) => (\n <div key={`section-${sectionIndex}`} className=\"w-full\">\n {/* Section Heading */}\n {section.heading && (\n <div\n className=\"flex flex-col gap-0 items-start pb-1 pt-3 px-0 relative shrink-0 w-full\"\n data-testid={`section-heading-${sectionIndex}`}\n >\n <p className=\"font-['Inter:Regular',sans-serif] font-normal text-xs leading-4 not-italic relative shrink-0 text-content-tertiary dark:text-content-tertiary w-full whitespace-pre-wrap\">\n {section.heading}\n </p>\n </div>\n )}\n\n {/* Section Items */}\n <div\n className=\"flex flex-col gap-0.5 items-start relative shrink-0 w-full\"\n data-testid={`section-items-${sectionIndex}`}\n >\n {section.items.map((item, itemIndex) => (\n <NavigationRailPanelItem\n key={`item-${sectionIndex}-${itemIndex}`}\n item={item}\n />\n ))}\n </div>\n\n {/* Section Divider */}\n {section.showDivider !== false && sectionIndex < sections.length - 1 && (\n <Divider className=\"mt-3 w-full\" />\n )}\n </div>\n ))\n : null}\n\n {/* Renderizar items simples (sin secciones) */}\n {items && items.length > 0 && !sections\n ? items.map((item, itemIndex) => (\n <NavigationRailPanelItem\n key={`item-${itemIndex}`}\n item={item}\n />\n ))\n : null}\n </div>\n </div>\n </div>\n );\n};\n\n/**\n * Componente interno para renderizar un item del NavigationRailPanel\n * Puede ser un item simple o colapsable\n */\ninterface NavigationRailPanelItemComponentProps {\n item: NonNullable<NavigationRailPanelProps['items']>[0];\n}\n\nconst NavigationRailPanelItem: React.FC<NavigationRailPanelItemComponentProps> = ({ item }) => {\n if (item.isCollapsible) {\n return (\n <DropdownItemCollapsible\n label={item.label}\n icon={item.icon}\n children={item.children}\n defaultOpen={item.defaultOpen}\n disabled={item.disabled}\n onClick={item.onClick}\n onOpenChange={item.onOpenChange}\n className={item.className}\n showDivider={false}\n showHeading={false}\n />\n );\n }\n\n return (\n <button\n onClick={item.onClick}\n disabled={item.disabled}\n className={[\n // Base\n 'flex items-center gap-3 px-4 py-2 w-full',\n 'rounded-lg cursor-pointer',\n 'transition-colors duration-150',\n\n // Colores y estados (Light Mode)\n !item.disabled && 'text-content-primary',\n !item.disabled && 'hover:bg-primary-custom-100',\n\n // Dark Mode\n !item.disabled && 'dark:text-content-primary',\n !item.disabled && 'dark:hover:bg-dark-bg-custom',\n\n // Focus ring\n !item.disabled && 'focus:outline-hidden',\n !item.disabled && 'focus:ring-2',\n !item.disabled && 'focus:ring-offset-2',\n !item.disabled && 'focus:ring-primary-custom-400',\n !item.disabled && 'focus:ring-offset-bg-primary',\n !item.disabled && 'dark:focus:ring-offset-dark-bg-primary',\n\n // Disabled\n item.disabled && 'opacity-50',\n item.disabled && 'cursor-not-allowed',\n\n item.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-testid={`navigation-rail-item-${item.label}`}\n aria-disabled={item.disabled}\n >\n {item.icon && (\n <div className=\"flex items-center justify-center w-4 h-4 shrink-0 text-content-secondary dark:text-content-secondary\">\n {item.icon}\n </div>\n )}\n <p className=\"font-['Inter:Regular',sans-serif] text-sm font-normal leading-5 not-italic relative shrink-0 text-left\">\n {item.label}\n </p>\n </button>\n );\n};\n","import * as React from \"react\";\nfunction ChevronLeftIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ChevronLeftIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction ChevronRightIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ChevronRightIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction MagnifyingGlassIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(MagnifyingGlassIcon);\nexport default ForwardRef;","import React from 'react';\n// Importamos de 24/outline solo para el ClockIcon\nimport { ClockIcon as HeroClockOutline } from '@heroicons/react/24/outline';\n\n// Importamos de 20/solid para los demás\nimport {\n ChevronRightIcon as HeroChevronRight,\n ChevronLeftIcon as HeroChevronLeft,\n MagnifyingGlassIcon as HeroSearch,\n HomeIcon as HeroHome,\n UsersIcon as HeroUsers,\n Cog6ToothIcon as HeroSettings,\n} from '@heroicons/react/20/solid';\n\n/**\n * Props comunes para los iconos\n */\ninterface IconProps {\n className?: string;\n}\n\n/**\n * Icono Chevron Right (apunta hacia la derecha)\n * Usado en el botón de collapse\n */\nexport const ChevronRightIcon: React.FC<IconProps> = ({ className = 'size-5' }) => (\n <HeroChevronRight className={className} aria-hidden=\"true\" />\n);\n\n/**\n * Icono Chevron Left (apunta hacia la izquierda)\n * Usado en el botón de expand\n */\nexport const ChevronLeftIcon: React.FC<IconProps> = ({ className = 'size-5' }) => (\n <HeroChevronLeft className={className} aria-hidden=\"true\" />\n);\n\n/**\n * Icono Clock (reloj) - Estilo OUTLINE 24\n * Usado en el botón \"Recientes\"\n */\nexport const ClockIcon: React.FC<IconProps> = ({ className = 'size-5' }) => (\n <HeroClockOutline className={className} aria-hidden=\"true\" />\n);\n\n/**\n * Icono Magnifying Glass (búsqueda)\n * Usado en el botón de búsqueda\n */\nexport const MagnifyingGlassIcon: React.FC<IconProps> = ({ className = 'size-5' }) => (\n <HeroSearch className={className} aria-hidden=\"true\" />\n);\n\n/**\n * Icono Home\n * Ejemplo para items de navegación\n */\nexport const HomeIcon: React.FC<IconProps> = ({ className = 'size-5' }) => (\n <HeroHome className={className} aria-hidden=\"true\" />\n);\n\n/**\n * Icono Users\n * Ejemplo para items de navegación\n */\nexport const UsersIcon: React.FC<IconProps> = ({ className = 'size-5' }) => (\n <HeroUsers className={className} aria-hidden=\"true\" />\n);\n\n/**\n * Icono Settings\n * Ejemplo para items de navegación\n */\nexport const SettingsIcon: React.FC<IconProps> = ({ className = 'size-5' }) => (\n <HeroSettings className={className} aria-hidden=\"true\" />\n);\n","import React, { useState } from 'react';\nimport type { NavigationRailTypesProps, NavigationRailItem } from './NavigationRailTypes.types';\nimport { ChevronRightIcon, ChevronLeftIcon, ClockIcon, MagnifyingGlassIcon } from './icons';\nimport { Button } from '../Button/Button';\nimport { Divider } from '../Divider/Divider';\nimport { DropdownItemCollapsible } from '../DropdownItemCollapsible/DropdownItemCollapsible';\nimport { NavigationRailItem as NavigationRailItemComponent } from '../NavigationRailItem/NavigationRailItem';\nimport { Input } from '../Input/Input';\n\n/**\n * Componente NavigationRailTypes del sistema de diseño Siesa\n *\n * Barra de navegación lateral que permite dos modos visuales:\n * - **Collapsed (Colapsado)**: 80px width, solo iconos con botón de búsqueda\n * - **Expanded (Expandido)**: 215px width, con labels y búsqueda integrada\n *\n * **Características:**\n * - Dos modos: collapsed e expanded (toggle con botón \"Colapsar\")\n * - Soporta items con badges de notificación\n * - Items colapsables para agrupar navegación relacionada\n * - Botón \"Recientes\" en footer\n * - Búsqueda integrada (solo en modo expanded)\n * - Dark mode completo\n * - Focus rings adaptativos\n *\n * **Especificaciones de Figma:**\n * - Collapsed: 80px width, items con height 44px + gap 12px\n * - Expanded: 215px width, items reutilizan DropdownItemCollapsible\n * - Icono search: 16x16px, azul (#0e79fd)\n * - Borde derecho: 1px solid #e4e4e7 (collapsed)\n * - Borde izquierdo: 1px solid #e4e4e7 (expanded)\n * - Height total: 900px (scroll si necesario)\n *\n * **Estructura:**\n * 1. Header (Search en expanded) - altura variable\n * 2. Menu & Destinations - flex 1 con items scrollables\n * 3. Footer - Actions con divider y botones\n *\n * **Estados de Items:**\n * - `default`: Text color content-primary\n * - `hover`: Fondo hover-overlay, icon color content-custom-primary\n * - `active`: Fondo custom-primary, text color custom-primary\n * - `disabled`: Opacity 50%, sin interacción\n *\n * **Colores (Light Mode):**\n * - Background: background-primary (#ffffff)\n * - Borders: border-primary (#e4e4e7)\n * - Text: content-primary (#18181b)\n * - Icons: content-secondary (#a1a1aa)\n * - Icon hover: content-custom-primary (#0e79fd)\n * - Divider: border-primary (#e4e4e7)\n * - Search input: bg-primary, border-primary, placeholder: content-tertiary\n *\n * **Colores (Dark Mode):**\n * - Background: background-primary/dark (#09090b)\n * - Borders: border-primary/dark (#3f3f46)\n * - Text: content-primary/dark (#fafafa)\n * - Icons: content-secondary/dark (#a1a1aa)\n * - Icon hover: content-custom-primary/dark (#bfe2fe)\n * - Divider: border-primary/dark (#3f3f46)\n *\n * **Tipografía:**\n * - Items labels: Paragraph/Small (14px, Regular, line-height 20px)\n * - Heading: Paragraph/Tiny (12px, Regular, line-height 16px) - si aplica\n * - Button labels: Label Small (14px, Bold)\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado (gap-3, px-4, py-2, etc)\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=6135-36219\n *\n * @example\n * ```tsx\n * const navItems: NavigationRailItem[] = [\n * {\n * id: 'home',\n * label: 'Home',\n * icon: <HomeIcon />,\n * active: true,\n * onClick: () => navigate('/home'),\n * },\n * {\n * id: 'users',\n * label: 'Users',\n * icon: <UsersIcon />,\n * badge: true,\n * onClick: () => navigate('/users'),\n * },\n * ];\n *\n * const [isCollapsed, setIsCollapsed] = useState(true);\n *\n * <NavigationRailTypes\n * collapsed={isCollapsed}\n * items={navItems}\n * showRecentButton={true}\n * onCollapsedChange={setIsCollapsed}\n * onItemClick={(index, item) => console.log('Selected:', item.id)}\n * />\n * ```\n *\n * @see NavigationRailTypes.types.ts - Props e interfaces\n */\nexport const NavigationRailTypes = React.forwardRef<\n HTMLDivElement,\n NavigationRailTypesProps\n>(\n (\n {\n collapsed = true,\n items = [],\n showRecentButton = true,\n showSearchButton = true,\n onCollapsedChange,\n onItemClick,\n onItemHover,\n className,\n labels = {},\n },\n ref\n ) => {\n const [searchQuery, setSearchQuery] = useState('');\n\n // Labels con valores por defecto\n const finalLabels = {\n searchButton: labels.searchButton ?? 'Search',\n searchPlaceholder: labels.searchPlaceholder ?? 'Buscar módulo',\n recentButton: labels.recentButton ?? 'Recientes',\n collapseButton: labels.collapseButton ?? 'Colapsar',\n expandButton: labels.expandButton ?? 'Expandir',\n };\n\n const handleCollapsedToggle = () => {\n onCollapsedChange?.(!collapsed);\n };\n\n const handleItemClick = (index: number, item: NavigationRailItem) => {\n item.onClick?.(new Event('click') as any);\n onItemClick?.(index, item);\n };\n\n const handleItemHover = (index: number, item: NavigationRailItem) => {\n onItemHover?.(index, item);\n };\n\n return (\n <div\n ref={ref}\n className={`\n ${collapsed ? 'w-[80px]' : 'w-[215px]'}\n h-full\n bg-background-primary dark:bg-background-primary\n ${collapsed ? 'border-r border-border-primary dark:border-border-primary' : 'border-l border-r border-border-primary dark:border-border-primary'}\n border-solid\n flex flex-col\n items-center\n relative\n transition-all duration-300\n ${className || ''}\n `}\n >\n {/* Sección de búsqueda - solo en modo expandido */}\n {!collapsed && (\n <div className=\"w-full flex flex-col gap-3 px-3 py-3 relative shrink-0\">\n <Input\n placeholder={finalLabels.searchPlaceholder}\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n leftIcon={<MagnifyingGlassIcon className=\"size-4 text-content-secondary dark:text-content-secondary\" />}\n fullWidth\n />\n <Divider className=\"w-full\" />\n </div>\n )}\n\n {/* Main content - Menu & Destinations */}\n <div\n className={`\n flex-1 flex flex-col\n items-center min-h-px min-w-px\n relative shrink-0\n px-0\n ${collapsed\n ? 'gap-7 py-2 w-[80px]'\n : 'gap-0.5 p-3 w-full bg-background-primary dark:bg-background-primary border-l dark:border-border-primary border-border-primary border-solid'\n }\n `}\n >\n {/* Botón Search en collapsed */}\n {collapsed && showSearchButton && (\n <Button\n type=\"default\"\n size=\"xl\"\n iconOnly\n leftIcon={<MagnifyingGlassIcon className=\"overflow-clip relative shrink-0 size-4 text-primary-inverse-content dark:text-primary-inverse-content\" />}\n ariaLabel={finalLabels.searchButton}\n />\n )}\n\n {/* Items container */}\n <div\n className={`\n flex flex-col items-center min-h-px min-w-px\n relative shrink-0\n flex-1\n overflow-hidden\n ${collapsed\n ? 'gap-3 leading-none w-[80px]'\n : 'gap-0.5 p-3 w-full'\n }\n `}\n >\n {items.length === 0 ? (\n // Items de demo/ejemplo\n <>\n {collapsed &&\n Array.from({ length: 4 }).map((_, idx) => (\n <NavigationRailItemComponent\n key={`demo-collapsed-${idx}`}\n id={`demo-collapsed-${idx}`}\n label=\"Item\"\n icon={\n <svg\n className=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M3 12a9 9 0 1118 0 9 9 0 01-18 0z\"\n />\n </svg>\n }\n showLabelText={false}\n />\n ))}\n\n {!collapsed &&\n Array.from({ length: 6 }).map((_, idx) => (\n <DropdownItemCollapsible\n key={`demo-expanded-${idx}`}\n label=\"Item\"\n showDivider={false}\n showHeading={false}\n />\n ))}\n </>\n ) : collapsed ? (\n // Items reales - collapsed mode\n <>\n {items.map((item, idx) => (\n <NavigationRailItemComponent\n key={item.id}\n id={item.id}\n label={item.label}\n icon={item.icon}\n selected={item.active}\n disabled={item.disabled}\n badge={item.badge}\n badgeCount={item.badgeCount}\n ariaLabel={item.ariaLabel}\n showLabelText={false}\n onClick={() => handleItemClick(idx, item)}\n onMouseEnter={() => handleItemHover(idx, item)}\n onMouseLeave={item.onMouseLeave}\n />\n ))}\n </>\n ) : (\n // Items reales - expanded mode\n <>\n {items.map((item, idx) => {\n const isCollapsible = (item as any).children && (item as any).children.length > 0;\n return (\n <div key={item.id} className=\"w-full\">\n <DropdownItemCollapsible\n label={item.label}\n icon={item.icon}\n selected={item.active}\n disabled={item.disabled}\n badge={item.badge}\n badgeCount={item.badgeCount}\n badgeColor={item.badgeColor as any}\n showDivider={false}\n showHeading={false}\n isCollapsible={isCollapsible}\n defaultOpen={(item as any).defaultOpen}\n children={isCollapsible ? (item as any).children : undefined}\n onClick={() => handleItemClick(idx, item)}\n />\n </div>\n );\n })}\n </>\n )}\n </div>\n\n {/* Footer - Actions */}\n <div className={`w-full flex flex-col gap-3 items-center relative shrink-0 ${!collapsed ? 'px-3' : ''}`}>\n <Divider className=\"w-full\" />\n\n <div\n className={`\n flex flex-col gap-3 relative shrink-0 w-full\n ${collapsed ? 'items-stretch px-3' : 'items-stretch'}\n `}\n >\n {/* Botón Recientes */}\n {showRecentButton && collapsed && (\n <Button\n type=\"outline\"\n size=\"base\"\n fullWidth\n leftIcon={<ClockIcon className=\"size-4 text-primary-custom-600 dark:text-primary-custom-600\" />}\n ariaLabel={finalLabels.recentButton}\n />\n )}\n\n {showRecentButton && !collapsed && (\n <Button\n type=\"outline\"\n size=\"base\"\n leftIcon={<ClockIcon className=\"size-4 text-primary-custom-600 dark:text-primary-custom-600\" />}\n fullWidth\n >\n {finalLabels.recentButton}\n </Button>\n )}\n\n {/* Botón Colapsar/Expandir */}\n {collapsed ? (\n <Button\n type=\"plain\"\n size=\"base\"\n fullWidth\n leftIcon={<ChevronRightIcon className=\"overflow-clip relative shrink-0 size-4 text-background-inverse-custom-primary dark:text-background-inverse-custom-primary\" />}\n onClick={handleCollapsedToggle}\n ariaLabel={finalLabels.expandButton}\n />\n ) : (\n <Button\n type=\"outline\"\n size=\"base\"\n leftIcon={<ChevronLeftIcon className=\"overflow-clip relative shrink-0 size-4 text-content-custom-primary dark:text-content-custom-primary\" />}\n onClick={handleCollapsedToggle}\n fullWidth\n >\n {finalLabels.collapseButton}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n }\n);\n\nNavigationRailTypes.displayName = 'NavigationRailTypes';\n\nexport default NavigationRailTypes;\n","import React from 'react';\n// Importamos de 24/outline solo para el ClockIcon\nimport { ClockIcon as HeroClockOutline } from '@heroicons/react/24/outline';\n\n// Importamos de 20/solid para los demás iconos\nimport {\n MagnifyingGlassIcon as HeroMagnifyingGlass,\n ChevronRightIcon as HeroChevronRight,\n ChevronLeftIcon as HeroChevronLeft,\n Cog6ToothIcon as HeroCog6Tooth,\n ShoppingCartIcon as HeroShoppingCart,\n CubeIcon as HeroCube,\n DocumentIcon as HeroDocument,\n} from '@heroicons/react/20/solid';\n\n/**\n * Iconos estándar para NavigationRailGroup\n * Basados en Heroicons 20x20 solid (excepto ClockIcon que es 24x24 outline)\n * Consistente con NavigationRailTypes\n *\n * @see docs/icons.md - Sistema de iconos del proyecto\n */\n\nexport const MagnifyingGlassIcon: React.FC<{ className?: string }> = ({ className = 'size-4' }) => (\n <HeroMagnifyingGlass className={className} aria-hidden=\"true\" />\n);\n\nexport const ChevronRightIcon: React.FC<{ className?: string }> = ({ className = 'size-4' }) => (\n <HeroChevronRight className={className} aria-hidden=\"true\" />\n);\n\nexport const ChevronLeftIcon: React.FC<{ className?: string }> = ({ className = 'size-4' }) => (\n <HeroChevronLeft className={className} aria-hidden=\"true\" />\n);\n\nexport const Cog6ToothIcon: React.FC<{ className?: string }> = ({ className = 'size-4' }) => (\n <HeroCog6Tooth className={className} aria-hidden=\"true\" />\n);\n\nexport const ShoppingCartIcon: React.FC<{ className?: string }> = ({ className = 'size-4' }) => (\n <HeroShoppingCart className={className} aria-hidden=\"true\" />\n);\n\nexport const CubeIcon: React.FC<{ className?: string }> = ({ className = 'size-4' }) => (\n <HeroCube className={className} aria-hidden=\"true\" />\n);\n\nexport const DocumentIcon: React.FC<{ className?: string }> = ({ className = 'size-4' }) => (\n <HeroDocument className={className} aria-hidden=\"true\" />\n);\n\nexport const ClockIcon: React.FC<{ className?: string }> = ({ className = 'size-4' }) => (\n <HeroClockOutline className={className} aria-hidden=\"true\" />\n);\n","import React, { useState, useRef, useEffect } from 'react';\nimport type {\n NavigationRailGroupProps,\n NavigationRailGroupMenuItem,\n} from './NavigationRailGroup.types';\nimport { NavigationRailTypes } from '../NavigationRailTypes/NavigationRailTypes';\nimport { NavigationRailPanel } from '../NavigationRailPanel/NavigationRailPanel';\nimport { MagnifyingGlassIcon } from './icons';\n\n/**\n * NavigationRailGroup del sistema de diseño Siesa\n *\n * Componente de navegación lateral agrupado que combina NavigationRailTypes\n * y NavigationRailPanel para crear una experiencia de navegación completa\n * con múltiples estados:\n *\n * - **Collapsed**: Barra compacta de 80px con solo iconos\n * - **Expanded**: Barra expandida de 215px con labels\n * - **Hover**: Panel lateral con submenú del item (se muestra al hacer hover)\n * - **Searcher**: Panel lateral con búsqueda y recientes\n *\n * **Características:**\n * - Reutiliza NavigationRailTypes para la barra lateral principal\n * - Reutiliza NavigationRailPanel para los paneles de hover y búsqueda\n * - Gestión de estado integrada (collapsed, expanded, hover, searcher)\n * - Dark mode completo en todos los elementos\n * - Focus rings adaptativos\n * - Transiciones suaves entre estados\n *\n * **Especificaciones de Figma:**\n * - NavigationRailTypes: 80px (collapsed) / 215px (expanded)\n * - NavigationRailPanel: 248px width, altura variable\n * - Posición panel: left 80px desde el rail\n * - Transiciones: 300ms ease-in-out\n *\n * **Estructura:**\n * ```\n * ┌────────────────────────────────────┐\n * │ NavigationRailGroup │\n * │ ┌──────────┬─────────────────┐ │\n * │ │ Rail │ Panel │ │\n * │ │ Types │ (hover/search) │ │\n * │ │ (base) │ (opcional) │ │\n * │ └──────────┴─────────────────┘ │\n * └────────────────────────────────────┘\n * ```\n *\n * **Estados de Items:**\n * - `default`: Sin interacción\n * - `hover`: Muestra panel con submenú (si tiene children)\n * - `active`: Item seleccionado, fondo custom-primary\n * - `disabled`: Opacity 50%, sin interacción\n *\n * **Colores (Light Mode):**\n * - Background rail: #ffffff (bg-primary)\n * - Background panel: #ffffff (bg-primary)\n * - Borders: #e4e4e7 (border-primary)\n * - Text: #18181b (content-primary)\n * - Icons: #a1a1aa (content-secondary)\n * - Search button: #0e79fd (primary-custom-600)\n *\n * **Colores (Dark Mode):**\n * - Background rail: #18181b (dark-bg-primary)\n * - Background panel: #18181b (dark-bg-primary)\n * - Borders: #71717a (dark-border-primary)\n * - Text: #f4f4f5 (dark-content-primary)\n * - Icons: #a1a1aa (content-secondary)\n *\n * **Tipografía:**\n * - Items: Paragraph/Small (14px Regular, line-height 20px)\n * - Panel heading: Label/Small (14px Bold)\n * - Section headings: Paragraph/Tiny (12px Regular)\n *\n * **Implementación de Estados:**\n * - `collapsed` + hover en item → state='hover' + muestra panel\n * - `collapsed` + click en search → state='searcher' + muestra panel búsqueda\n * - `expanded` → NavigationRailTypes expandido con Input integrado\n * - Click en \"Colapsar\" → vuelve a collapsed\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see ../NavigationRailTypes - Componente reutilizado para barra lateral\n * @see ../NavigationRailPanel - Componente reutilizado para paneles\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=6146-34487\n *\n * @example\n * ```tsx\n * // Uso básico en modo collapsed\n * const items = [\n * {\n * id: 'admin',\n * label: 'Administración',\n * icon: <Cog6ToothIcon />,\n * isCollapsible: true,\n * children: [\n * { id: 'users', label: 'Usuarios' },\n * { id: 'roles', label: 'Roles' },\n * ],\n * },\n * {\n * id: 'sales',\n * label: 'Ventas',\n * icon: <ShoppingCartIcon />,\n * },\n * ];\n *\n * <NavigationRailGroup\n * state=\"collapsed\"\n * items={items}\n * onItemClick={(item) => console.log('Clicked:', item.label)}\n * onItemHover={(item) => console.log('Hover:', item.label)}\n * />\n *\n * // Uso con control de estado externo\n * const [state, setState] = useState('collapsed');\n *\n * <NavigationRailGroup\n * state={state}\n * items={items}\n * onStateChange={setState}\n * />\n * ```\n *\n * @see NavigationRailGroup.types.ts - Props e interfaces\n */\nexport const NavigationRailGroup = React.forwardRef<\n HTMLDivElement,\n NavigationRailGroupProps\n>(\n (\n {\n state = 'collapsed',\n items = [],\n onStateChange,\n onItemClick,\n onItemHover,\n labels = {},\n className,\n showSearchButton = true,\n },\n ref\n ) => {\n // Estado local para controlar el panel\n const [showPanel, setShowPanel] = useState(false);\n const [panelType, setPanelType] = useState<'hover' | 'searcher'>('hover');\n const [hoveredItem, setHoveredItem] = useState<NavigationRailGroupMenuItem | null>(null);\n \n // Ref para manejar el timeout de ocultación del panel\n const hideTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n // Labels con valores por defecto\n const finalLabels = {\n searchPlaceholder: labels.searchPlaceholder ?? 'Buscar módulo',\n collapseButton: labels.collapseButton ?? 'Colapsar',\n recentSection: labels.recentSection ?? 'Recientes',\n frequentSection: labels.frequentSection ?? 'Opciones frecuentes',\n };\n\n // Controlar el estado collapsed/expanded\n const isCollapsed = state === 'collapsed' || state === 'hover' || state === 'searcher';\n\n // Cleanup del timeout al desmontar el componente\n useEffect(() => {\n return () => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n }\n };\n }, []);\n\n // Manejar cambio de estado collapsed/expanded\n const handleCollapsedChange = (collapsed: boolean) => {\n const newState = collapsed ? 'collapsed' : 'expanded';\n onStateChange?.(newState);\n };\n\n // Manejar click en item\n const handleItemClick = (index: number) => {\n const commercialItem = items[index];\n if (commercialItem) {\n onItemClick?.(commercialItem);\n }\n };\n\n // Manejar hover en item desde NavigationRailTypes\n const handleItemHoverFromRail = (index: number) => {\n const commercialItem = items[index];\n if (commercialItem && isCollapsed) {\n handleItemHover(commercialItem);\n }\n };\n\n // Manejar hover en item (solo en modo collapsed)\n const handleItemHover = (item: NavigationRailGroupMenuItem) => {\n if (isCollapsed && item.isCollapsible && item.children) {\n // Cancelar cualquier timeout pendiente\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n \n setHoveredItem(item);\n setPanelType('hover');\n setShowPanel(true);\n onItemHover?.(item);\n }\n };\n\n // Manejar cuando el cursor sale de un item\n const handleItemMouseLeave = () => {\n // Programar ocultación del panel con delay para permitir transición al panel\n if (isCollapsed && panelType === 'hover') {\n hideTimeoutRef.current = setTimeout(() => {\n setShowPanel(false);\n setHoveredItem(null);\n }, 150); // Delay de 150ms para permitir transición suave\n }\n };\n\n // Manejar cuando el cursor entra al panel\n const handlePanelMouseEnter = () => {\n // Cancelar la ocultación programada\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n };\n\n // Manejar cuando el cursor sale del panel\n const handlePanelMouseLeave = () => {\n if (isCollapsed && panelType === 'hover') {\n setShowPanel(false);\n setHoveredItem(null);\n }\n };\n\n // Manejar click en botón de búsqueda\n\n\n // Convertir items a formato NavigationRailTypes\n const railItems = items.map((item) => ({\n id: item.id,\n label: item.label,\n icon: item.icon,\n active: item.active,\n disabled: item.disabled,\n badge: item.badge,\n badgeCount: item.badgeCount,\n children: item.children,\n defaultOpen: item.defaultOpen,\n onClick: () => {\n item.onClick?.();\n },\n onMouseLeave: () => handleItemMouseLeave(), // Corregir la llamada\n }));\n\n return (\n <div\n ref={ref}\n className={`relative flex items-start h-full ${className || ''}`}\n data-testid=\"navigation-rail-group\"\n >\n {/* NavigationRailTypes - Barra lateral principal */}\n <NavigationRailTypes\n collapsed={isCollapsed}\n items={railItems}\n showRecentButton={false}\n showSearchButton={showSearchButton}\n onCollapsedChange={handleCollapsedChange}\n onItemClick={handleItemClick}\n onItemHover={handleItemHoverFromRail}\n labels={{\n searchButton: finalLabels.searchPlaceholder,\n searchPlaceholder: finalLabels.searchPlaceholder,\n collapseButton: finalLabels.collapseButton,\n }}\n />\n\n {/* NavigationRailPanel - Panel lateral (hover o searcher) */}\n {showPanel && isCollapsed && (\n <div \n className=\"absolute left-[80px] top-0 z-10 h-full\"\n onMouseEnter={handlePanelMouseEnter}\n onMouseLeave={handlePanelMouseLeave}\n >\n <NavigationRailPanel\n height=\"100%\"\n width={248}\n showHeading={panelType === 'hover' && hoveredItem !== null}\n heading={\n panelType === 'hover' && hoveredItem\n ? {\n label: hoveredItem.label,\n iconName: 'cog-6-tooth',\n showDescription: false,\n showAction: false,\n }\n : undefined\n }\n showSearch={panelType === 'searcher'}\n search={{\n placeholder: finalLabels.searchPlaceholder,\n }}\n sections={\n panelType === 'hover' && hoveredItem?.children\n ? [\n {\n items: hoveredItem.children.map((child) => ({\n label: child.label,\n icon: child.icon,\n onClick: child.onClick,\n disabled: child.disabled,\n })),\n },\n ]\n : panelType === 'searcher'\n ? [\n {\n heading: finalLabels.recentSection,\n items: [\n {\n label: 'Configuración',\n icon: <MagnifyingGlassIcon className=\"size-4\" />,\n },\n ],\n },\n {\n heading: finalLabels.frequentSection,\n items: [\n {\n label: 'Item',\n },\n ],\n },\n ]\n : []\n }\n />\n </div>\n )}\n </div>\n );\n }\n);\n\nNavigationRailGroup.displayName = 'NavigationRailGroup';\n\nexport default NavigationRailGroup;\n","import React, { useState } from 'react';\nimport type {\n TableProps,\n TableHeaderProps,\n TableCellProps,\n SortDirection,\n PaginationProps,\n} from './Table.types';\n\n/**\n * Iconos para sort\n */\nconst ChevronUpIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"transition-transform\"\n >\n <path\n d=\"M12 10L8 6L4 10\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nconst ChevronDownIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"transition-transform\"\n >\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * Iconos para paginación\n */\nconst ArrowLeftIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14 8H2M2 8L6.5 3.5M2 8L6.5 12.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nconst ArrowRightIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 8H14M14 8L9.5 3.5M14 8L9.5 12.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * TableHeader - Componente para el header de una columna\n */\nconst TableHeader = <T,>({\n column,\n sortable,\n sorted,\n sortDirection,\n onSort,\n}: TableHeaderProps<T>) => {\n // Clases base del header\n const baseClasses = `\n flex\n items-center\n gap-3\n px-6\n py-2.5\n min-h-[40px]\n border-b\n border-border-primary\n dark:border-dark-border-primary\n transition-colors\n duration-150\n `;\n\n // Clases según sortable\n const sortableClasses = sortable\n ? `\n cursor-pointer\n hover:bg-background-secondary\n dark:hover:bg-dark-bg-primary/50\n select-none\n `\n : '';\n\n // Clases de alineación\n const alignClasses = {\n left: 'justify-start',\n center: 'justify-center',\n right: 'justify-end',\n };\n\n const combinedClasses = [baseClasses, sortableClasses, alignClasses[column.align || 'left']]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div\n className={combinedClasses}\n onClick={sortable ? onSort : undefined}\n role={sortable ? 'button' : undefined}\n tabIndex={sortable ? 0 : undefined}\n onKeyDown={\n sortable\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onSort();\n }\n }\n : undefined\n }\n style={{ width: column.width }}\n >\n {/* Texto del header */}\n <span\n className=\"\n text-sm\n font-bold\n text-content-secondary\n dark:text-content-secondary\n text-ellipsis\n overflow-hidden\n whitespace-nowrap\n \"\n >\n {column.header}\n </span>\n\n {/* Iconos de sort */}\n {sortable && (\n <span className=\"shrink-0 text-content-secondary dark:text-content-secondary\">\n {sorted && sortDirection === 'asc' && <ChevronUpIcon />}\n {sorted && sortDirection === 'desc' && <ChevronDownIcon />}\n {!sorted && (\n <div className=\"w-4 h-4\" />\n )}\n </span>\n )}\n </div>\n );\n};\n\n/**\n * TableCell - Componente para una celda de datos\n */\nconst TableCell: React.FC<TableCellProps & { isStriped?: boolean; rowIndex?: number }> = ({\n children,\n align = 'left',\n width,\n isStriped = false,\n rowIndex = 0,\n}) => {\n // Clases de alineación\n const alignClasses = {\n left: 'justify-start text-left',\n center: 'justify-center text-center',\n right: 'justify-end text-right',\n };\n\n // Fondo zebra striping (filas pares tienen fondo)\n const stripedBg = isStriped && rowIndex % 2 === 1\n ? 'bg-background-secondary dark:bg-dark-bg-primary/30'\n : '';\n\n return (\n <div\n className={`\n flex\n flex-col\n ${alignClasses[align]}\n px-6\n py-4\n min-h-[56px]\n border-b\n border-border-secondary\n dark:border-dark-border-primary\n ${stripedBg}\n `}\n style={{ width }}\n >\n <span\n className=\"\n text-sm\n text-content-primary\n dark:text-dark-content-primary\n text-ellipsis\n overflow-hidden\n w-full\n \"\n >\n {children}\n </span>\n </div>\n );\n};\n\n\n/**\n * Pagination - Componente de paginación\n */\nconst Pagination: React.FC<PaginationProps> = ({\n currentPage,\n totalPages,\n onPageChange,\n previousLabel = 'Anterior',\n nextLabel = 'Siguiente',\n}) => {\n // Generar array de números de página para mostrar\n const getPageNumbers = () => {\n const pages: (number | string)[] = [];\n const maxVisible = 7; // Máximo de botones visibles\n\n if (totalPages <= maxVisible) {\n // Si hay pocas páginas, mostrar todas\n for (let i = 1; i <= totalPages; i++) {\n pages.push(i);\n }\n } else {\n // Lógica para mostrar: 1 2 3 ... 65 66\n pages.push(1);\n\n if (currentPage <= 3) {\n pages.push(2, 3);\n } else if (currentPage >= totalPages - 2) {\n pages.push('...');\n pages.push(totalPages - 2, totalPages - 1);\n } else {\n pages.push('...');\n pages.push(currentPage);\n pages.push('...');\n }\n\n if (totalPages > 1) {\n pages.push(totalPages);\n }\n }\n\n return pages;\n };\n\n const pageNumbers = getPageNumbers();\n\n return (\n <div className=\"flex items-center justify-between w-full h-9\">\n {/* Botón Anterior */}\n <button\n onClick={() => currentPage > 1 && onPageChange(currentPage - 1)}\n disabled={currentPage === 1}\n className=\"\n flex\n items-center\n gap-3\n px-3\n py-2\n rounded-md\n text-sm\n font-bold\n text-primary-custom-600\n dark:text-primary-custom-600\n hover:bg-blue-50\n dark:hover:bg-blue-900/20\n disabled:opacity-50\n disabled:cursor-not-allowed\n transition-colors\n duration-150\n \"\n >\n <ArrowLeftIcon />\n <span>{previousLabel}</span>\n </button>\n\n {/* Números de página */}\n <div className=\"flex items-center gap-0\">\n {pageNumbers.map((page, index) => {\n if (page === '...') {\n return (\n <div\n key={`ellipsis-${index}`}\n className=\"\n flex\n items-center\n justify-center\n px-3\n py-2\n text-sm\n font-bold\n text-primary-custom-600\n dark:text-primary-custom-600\n \"\n >\n {page}\n </div>\n );\n }\n\n const isActive = page === currentPage;\n\n return (\n <button\n key={page}\n onClick={() => onPageChange(page as number)}\n className={`\n flex\n items-center\n justify-center\n px-3\n py-2\n rounded-md\n text-sm\n font-bold\n text-primary-custom-600\n dark:text-primary-custom-600\n transition-colors\n duration-150\n ${\n isActive\n ? 'bg-blue-100 dark:bg-blue-900/30'\n : 'hover:bg-blue-50 dark:hover:bg-blue-900/20'\n }\n `}\n >\n {page}\n </button>\n );\n })}\n </div>\n\n {/* Botón Siguiente */}\n <button\n onClick={() => currentPage < totalPages && onPageChange(currentPage + 1)}\n disabled={currentPage === totalPages}\n className=\"\n flex\n items-center\n gap-3\n px-3\n py-2\n rounded-md\n text-sm\n font-bold\n text-primary-custom-600\n dark:text-primary-custom-600\n hover:bg-blue-50\n dark:hover:bg-blue-900/20\n disabled:opacity-50\n disabled:cursor-not-allowed\n transition-colors\n duration-150\n \"\n >\n <span>{nextLabel}</span>\n <ArrowRightIcon />\n </button>\n </div>\n );\n};\n\n/**\n * Table - Componente principal de tabla\n *\n * Características implementadas:\n * - Definición de columnas flexible con accessor y render custom\n * - Sorting en columnas (controlado o no controlado)\n * - Variantes: basic, fullWidth, striped, grid\n * - Dark mode completo en todos los estados\n * - Estados de loading y empty\n * - Filas clickeables\n * - Accesibilidad con roles y keyboard navigation\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto y generics\n * - Accesibilidad con ARIA labels y keyboard support\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label/Small para headers, Paragraph/Small para cells)\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n *\n * @example\n * ```tsx\n * // Uso básico\n * <Table\n * title=\"Usuarios\"\n * columns={[\n * { header: 'Nombre', accessor: 'name' },\n * { header: 'Email', accessor: 'email' },\n * { header: 'Rol', accessor: 'role', sortable: true },\n * ]}\n * data={users}\n * />\n *\n * // Con render custom\n * <Table\n * columns={[\n * {\n * header: 'Estado',\n * accessor: 'status',\n * render: (value) => (\n * <Badge color={value === 'active' ? 'green' : 'red'}>\n * {value}\n * </Badge>\n * ),\n * },\n * ]}\n * data={data}\n * />\n *\n * // Variante striped\n * <Table\n * variant=\"striped\"\n * columns={columns}\n * data={data}\n * />\n * ```\n */\nexport const Table = <T extends Record<string, any>>({\n title,\n columns,\n data,\n variant = 'basic',\n showBorder = true,\n showShadow = true,\n // onRowClick, // TODO: Implement row click functionality\n onSort,\n sortColumn: externalSortColumn,\n sortDirection: externalSortDirection,\n fullWidth = false,\n emptyMessage = 'No hay datos disponibles',\n loading = false,\n loadingRows = 5,\n pagination,\n className = '',\n id,\n}: TableProps<T>) => {\n // ===== ESTADO INTERNO DE SORT =====\n const [internalSortColumn, setInternalSortColumn] = useState<keyof T | string | null>(null);\n const [internalSortDirection, setInternalSortDirection] = useState<SortDirection>(null);\n\n // Usar sort externo si está controlado, sino usar interno\n const sortColumn = externalSortColumn !== undefined ? externalSortColumn : internalSortColumn;\n const sortDirection = externalSortDirection !== undefined ? externalSortDirection : internalSortDirection;\n\n // ===== MANEJAR SORT =====\n const handleSort = (columnAccessor: keyof T | string) => {\n let newDirection: SortDirection = 'asc';\n\n // Si ya está ordenado por esta columna, cambiar dirección\n if (sortColumn === columnAccessor) {\n if (sortDirection === 'asc') {\n newDirection = 'desc';\n } else if (sortDirection === 'desc') {\n newDirection = null;\n }\n }\n\n // Si sort es controlado, llamar callback\n if (onSort) {\n onSort(columnAccessor, newDirection);\n } else {\n // Sino, actualizar estado interno\n setInternalSortColumn(newDirection ? columnAccessor : null);\n setInternalSortDirection(newDirection);\n }\n };\n\n // ===== OBTENER VALOR DE CELDA =====\n const getCellValue = (row: T, accessor: keyof T | ((row: T) => any)) => {\n if (typeof accessor === 'function') {\n return accessor(row);\n }\n return row[accessor];\n };\n\n // ===== CLASES DEL CONTAINER =====\n const containerBaseClasses = `\n flex\n flex-col\n gap-4\n bg-white\n dark:bg-dark-bg-primary\n rounded-xl\n transition-all\n duration-150\n `;\n\n const containerBorderClasses = showBorder\n ? 'border border-border-primary dark:border-dark-border-primary'\n : '';\n\n const containerShadowClasses = showShadow ? 'shadow-base' : '';\n\n const containerPaddingClasses = 'p-8';\n\n const containerWidthClasses = fullWidth || variant === 'fullWidth' ? 'w-full' : '';\n\n const containerClasses = [\n containerBaseClasses,\n containerBorderClasses,\n containerShadowClasses,\n containerPaddingClasses,\n containerWidthClasses,\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DE LA TABLA =====\n const tableGridClasses = variant === 'grid'\n ? `\n border\n border-border-primary\n dark:border-dark-border-primary\n rounded-lg\n overflow-hidden\n `\n : '';\n\n // ===== RENDER =====\n return (\n <div className={containerClasses} id={id}>\n {/* Título opcional */}\n {title && (\n <div className=\"flex items-center justify-center w-full\">\n <h3\n className=\"\n text-base\n font-bold\n text-content-primary\n dark:text-dark-content-primary\n text-ellipsis\n overflow-hidden\n whitespace-nowrap\n \"\n >\n {title}\n </h3>\n </div>\n )}\n\n {/* Tabla */}\n <div className={`flex w-full overflow-x-auto ${tableGridClasses}`}>\n {/* Columnas */}\n {columns.map((column, colIndex) => {\n const accessor = typeof column.accessor === 'function'\n ? `column_${colIndex}`\n : String(column.accessor);\n\n return (\n <div key={accessor} className=\"flex flex-col flex-1 min-w-0\">\n {/* Header de la columna */}\n <TableHeader\n column={column}\n sortable={column.sortable || false}\n sorted={sortColumn === accessor}\n sortDirection={sortColumn === accessor ? sortDirection : null}\n onSort={() => handleSort(accessor)}\n />\n\n {/* Loading skeleton */}\n {loading && (\n <>\n {Array.from({ length: loadingRows }).map((_, rowIndex) => (\n <TableCell\n key={`loading-${rowIndex}`}\n align={column.align}\n width={column.width}\n isStriped={variant === 'striped'}\n rowIndex={rowIndex}\n >\n <div\n className=\"\n h-4\n bg-background-secondary\n dark:bg-dark-border-primary\n rounded\n animate-pulse\n \"\n />\n </TableCell>\n ))}\n </>\n )}\n\n {/* Datos reales */}\n {!loading && data.length > 0 && (\n <>\n {data.map((row, rowIndex) => {\n const value = getCellValue(row, column.accessor);\n const content = column.render\n ? column.render(value, row, rowIndex)\n : value;\n\n return (\n <TableCell\n key={rowIndex}\n align={column.align}\n width={column.width}\n isStriped={variant === 'striped'}\n rowIndex={rowIndex}\n >\n {content}\n </TableCell>\n );\n })}\n </>\n )}\n\n {/* Estado empty */}\n {!loading && data.length === 0 && colIndex === 0 && (\n <div\n className=\"\n flex\n items-center\n justify-center\n px-6\n py-12\n text-sm\n text-content-secondary\n dark:text-content-secondary\n \"\n style={{ gridColumn: `1 / ${columns.length + 1}` }}\n >\n {emptyMessage}\n </div>\n )}\n </div>\n );\n })}\n </div>\n\n {/* Paginación */}\n {pagination && (\n <Pagination\n currentPage={pagination.currentPage}\n totalPages={pagination.totalPages}\n onPageChange={pagination.onPageChange}\n previousLabel={pagination.previousLabel}\n nextLabel={pagination.nextLabel}\n />\n )}\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport type { TabProps, TabsProps } from './Tabs.types';\n\n/**\n * Componente Tab individual del sistema de diseño Siesa\n *\n * Representa un único tab dentro de un grupo de tabs. Incluye soporte para:\n * - Estado activo/inactivo con indicador visual (línea inferior)\n * - Icono opcional a la izquierda del texto\n * - Badge de notificación con contador\n * - Estados hover, focus y disabled\n * - Dark mode completo\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <Tab\n * label=\"Inicio\"\n * active={true}\n * icon={<HomeIcon />}\n * badge={3}\n * onClick={() => setActiveTab('home')}\n * />\n * ```\n */\nexport const Tab: React.FC<TabProps> = ({\n label,\n active = false,\n icon,\n badge,\n disabled = false,\n onClick,\n className = '',\n ariaLabel,\n}) => {\n // ===== CLASES BASE DEL BOTÓN =====\n // El contenedor es relativo para posicionar el indicador absoluto\n const baseClasses = `\n relative\n flex\n flex-col\n items-center\n cursor-pointer\n outline-hidden\n transition-all\n duration-150\n p-0\n border-0\n bg-transparent\n `;\n\n // ===== CLASES DE FOCUS =====\n // El focus outline se desactiva aquí, el shadow se aplica al Content div\n const focusClasses = '';\n\n // ===== CLASES DE DISABLED =====\n const disabledClasses = disabled\n ? 'opacity-50 cursor-not-allowed pointer-events-none'\n : '';\n\n // ===== CLASES DEL CONTENIDO INTERIOR =====\n // El hover y focus background se aplica aquí\n const contentBaseClasses = `\n flex\n items-center\n justify-center\n gap-1\n p-2\n rounded-lg\n overflow-hidden\n transition-all\n duration-150\n w-full\n `;\n\n // ===== CLASES DE ESTADO HOVER Y FOCUS PARA CONTENIDO =====\n // Light: bg-[rgba(0,0,0,0.03)], Dark: bg-white/5\n // Según Figma, tanto hover como focus tienen el background overlay\n // El shadow de focus también se aplica aquí (al Content div), no al botón\n const contentStateClasses = disabled\n ? ''\n : `\n group-hover:bg-[rgba(0,0,0,0.03)]\n group-focus-visible:bg-[rgba(0,0,0,0.03)]\n group-focus-visible:shadow-lg\n dark:group-hover:bg-white/5\n dark:group-focus-visible:bg-white/5\n dark:group-focus-visible:shadow-2xl\n `;\n\n // ===== CLASES DE TEXTO =====\n // Activo: primary-custom-600 (#0e79fd), Inactivo: content-primary (#18181b)\n const textClasses = active\n ? `\n text-primary-custom-600\n dark:text-primary-custom-600\n `\n : `\n text-content-primary\n dark:text-dark-content-primary\n `;\n\n // ===== CLASES DE ICONO =====\n // El icono hereda el color del texto\n const iconClasses = `\n w-3\n h-3\n shrink-0\n `;\n\n // ===== CLASES DEL BADGE =====\n // Activo: bg-primary-custom-600 (#0e79fd), Inactivo: bg-content-primary (#18181b)\n const badgeClasses = active\n ? `\n bg-primary-custom-600\n dark:bg-primary-custom-600\n `\n : `\n bg-content-primary\n dark:bg-dark-content-primary\n `;\n\n // ===== CLASES DEL INDICADOR INFERIOR =====\n // Solo visible cuando está activo, 2px de alto, rounded-full\n // Posicionado al fondo del contenedor de Tabs (alineado con el border)\n const indicatorClasses = active\n ? `\n absolute\n -bottom-2.5\n left-0\n right-0\n h-0.5\n rounded-full\n bg-primary-custom-600\n dark:bg-primary-custom-600\n z-10\n `\n : 'hidden';\n\n // ===== COMBINAR CLASES DEL BOTÓN =====\n const finalClasses = [\n baseClasses,\n focusClasses,\n disabledClasses,\n 'group', // Para usar group-hover y group-focus-visible\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== COMBINAR CLASES DEL CONTENIDO =====\n const contentFinalClasses = [\n contentBaseClasses,\n contentStateClasses,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={active}\n aria-disabled={disabled}\n aria-label={ariaLabel || label}\n tabIndex={disabled ? -1 : 0}\n className={finalClasses}\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n >\n {/* Contenido del Tab */}\n <div className={contentFinalClasses}>\n {/* Icono (opcional) */}\n {icon && (\n <span className={`${iconClasses} ${textClasses}`.trim()}>\n {icon}\n </span>\n )}\n\n {/* Texto */}\n <span\n className={`\n text-sm\n font-bold\n leading-5\n whitespace-nowrap\n ${textClasses}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {label}\n </span>\n\n {/* Badge de notificación (opcional) */}\n {badge !== undefined && badge > 0 && (\n <span\n className={`\n flex\n items-center\n justify-center\n h-3\n min-w-[12px]\n px-0.5\n rounded-xs\n text-xs\n font-normal\n leading-4\n text-primary-inverse-content\n dark:text-dark-bg-primary\n ${badgeClasses}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n aria-label={`${badge} notificaciones`}\n >\n {badge > 99 ? '99+' : badge}\n </span>\n )}\n </div>\n\n {/* Indicador inferior (línea activa) */}\n <div className={indicatorClasses} />\n </button>\n );\n};\n\n/**\n * Componente Tabs contenedor del sistema de diseño Siesa\n *\n * Agrupa múltiples tabs permitiendo navegación entre diferentes secciones.\n * Soporta modo controlado (con activeId y onChange) y no controlado (con defaultActiveId).\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA roles y keyboard navigation\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Modo controlado\n * const [activeTab, setActiveTab] = useState('home');\n *\n * <Tabs\n * items={[\n * { id: 'home', label: 'Inicio', icon: <HomeIcon /> },\n * { id: 'profile', label: 'Perfil', badge: 3 },\n * { id: 'settings', label: 'Configuración' },\n * ]}\n * activeId={activeTab}\n * onChange={setActiveTab}\n * />\n *\n * // Modo no controlado\n * <Tabs\n * items={[...]}\n * defaultActiveId=\"home\"\n * />\n * ```\n */\nexport const Tabs: React.FC<TabsProps> = ({\n items,\n activeId,\n defaultActiveId,\n onChange,\n className = '',\n fullWidth = false,\n size = 'base',\n showBorder = true,\n}) => {\n // Estado interno para modo no controlado\n const [internalActiveId, setInternalActiveId] = useState(\n defaultActiveId || (items.length > 0 ? items[0].id : '')\n );\n\n // Determinar si es controlado o no controlado\n const isControlled = activeId !== undefined;\n const currentActiveId = isControlled ? activeId : internalActiveId;\n\n // Handler para cambio de tab\n const handleTabClick = (id: string) => {\n if (!isControlled) {\n setInternalActiveId(id);\n }\n onChange?.(id);\n };\n\n // ===== CLASES DE TAMAÑO =====\n const sizeClasses = {\n sm: 'gap-0',\n base: 'gap-1',\n lg: 'gap-2',\n };\n\n // ===== CLASES DEL CONTENEDOR =====\n // El padding-bottom (pb-2.5 = 10px) deja espacio para el indicador del tab activo\n // El border-b se dibuja debajo del padding, alineándose con el indicador\n const containerClasses = `\n flex\n items-end\n pb-2.5\n ${sizeClasses[size]}\n ${fullWidth ? 'w-full' : ''}\n ${showBorder ? 'border-b border-border-primary dark:border-dark-border-primary' : ''}\n `;\n\n // ===== CLASES FULL WIDTH PARA ITEMS =====\n const itemWidthClass = fullWidth ? 'flex-1' : '';\n\n const finalClasses = [\n containerClasses,\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div\n role=\"tablist\"\n aria-label=\"Pestañas de navegación\"\n className={finalClasses}\n >\n {items.map((item) => (\n <Tab\n key={item.id}\n label={item.label}\n active={currentActiveId === item.id}\n icon={item.icon}\n badge={item.badge}\n disabled={item.disabled}\n onClick={() => handleTabClick(item.id)}\n className={itemWidthClass}\n />\n ))}\n </div>\n );\n};\n","/**\n * Iconos para el componente Navbar\n * Basados en Heroicons Micro (16x16px)\n */\n\nexport const ShoppingCartIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path d=\"M1.75 1.002a.75.75 0 1 0 0 1.5h1.035l1.38 5.514a2.75 2.75 0 0 0 2.658 2.048h5.355a2.75 2.75 0 0 0 2.658-2.048l.9-3.597a.75.75 0 0 0-.728-.919H4.655l-.22-.88A.75.75 0 0 0 3.71 2H1.75ZM5 13a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM11.5 13a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z\" />\n </svg>\n);\n\nexport const BellIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12 5a4 4 0 0 0-8 0v2.379a1.5 1.5 0 0 1-.44 1.06L2.294 9.707a1 1 0 0 0-.293.707V11a1 1 0 0 0 1 1h2a3 3 0 1 0 6 0h2a1 1 0 0 0 1-1v-.586a1 1 0 0 0-.293-.707L12.44 8.44A1.5 1.5 0 0 1 12 7.38V5Zm-5.5 7a1.5 1.5 0 0 0 3 0h-3Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const MagnifyingGlassIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const ChevronDownIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const ExclamationTriangleIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M6.701 2.25c.577-1 2.02-1 2.598 0l5.196 9a1.5 1.5 0 0 1-1.299 2.25H2.804a1.5 1.5 0 0 1-1.3-2.25l5.197-9ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 1 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 7.25a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const NotificationDot = () => (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"4\" cy=\"4\" r=\"4\" fill=\"currentColor\" />\n </svg>\n);\n\nexport const ArrowLeftStartOnRectangleIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M14 4.75A2.75 2.75 0 0 0 11.25 2h-3A2.75 2.75 0 0 0 5.5 4.75v.5a.75.75 0 0 0 1.5 0v-.5c0-.69.56-1.25 1.25-1.25h3c.69 0 1.25.56 1.25 1.25v6.5c0 .69-.56 1.25-1.25 1.25h-3c-.69 0-1.25-.56-1.25-1.25v-.5a.75.75 0 0 0-1.5 0v.5A2.75 2.75 0 0 0 8.25 14h3A2.75 2.75 0 0 0 14 11.25v-6.5Zm-9.47.47a.75.75 0 0 0-1.06 0L1.22 7.47a.75.75 0 0 0 0 1.06l2.25 2.25a.75.75 0 1 0 1.06-1.06l-.97-.97h5.69a.75.75 0 0 0 0-1.5H3.56l.97-.97a.75.75 0 0 0 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { NavbarProps } from './Navbar.types';\nimport { Badge } from '../Badge/Badge';\nimport { Dropdown } from '../Dropdown/Dropdown';\nimport { Button } from '../Button/Button';\nimport {\n ShoppingCartIcon,\n BellIcon,\n MagnifyingGlassIcon,\n ChevronDownIcon,\n ExclamationTriangleIcon,\n ArrowLeftStartOnRectangleIcon,\n} from './icons';\n\n/**\n * Componente Navbar del sistema de diseño Siesa\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * Barra de navegación principal con soporte completo para responsive y dark mode.\n * Incluye logo, nombre de producto, badge de ambiente, botones de acción y dropdown de usuario.\n *\n * **Variantes de dispositivo:**\n * - `responsive`: Se adapta automáticamente al viewport (por defecto)\n * - `desktop`: Versión completa (1360x64px) con todos los elementos\n * - `tablet`: Versión tablet (1024x64px) con elementos reducidos\n * - `mobile`: Versión simplificada (428x40px) con logo icono y avatar circular\n *\n * **Elementos incluidos:**\n * - Botón de navegación (solo desktop/tablet) - Usa shadow-button-inset\n * - Logo del negocio (solo desktop/tablet)\n * - Dividers verticales (solo desktop/tablet)\n * - Logo Siesa (completo en desktop/tablet, icono en mobile)\n * - Nombre del producto (solo desktop/tablet) - Heading/Tiny (20px Bold)\n * - Badge de ambiente con icono de advertencia (yellow)\n * - Botones de acción (search solo mobile, cart, notifications)\n * - Dropdown de usuario con avatar, nombre y email\n * - Logo Siesa trailing (solo desktop)\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación (NO colores hardcodeados)\n * - Focus rings adaptativos para light y dark mode\n * - Type safety con TypeScript estricto\n * - Responsive design con breakpoints md: y lg:\n * - Tipografía del sistema: Heading/Tiny, Paragraph/Small, Paragraph/Tiny\n * - Spacing del sistema (4px, 8px, 12px, 16px, 32px)\n *\n * @see docs/colors.md - Sistema de colores y tokens dark mode\n * @see docs/typography.md - Sistema tipográfico (Heading, Paragraph)\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras (button-inset)\n *\n * @example\n * ```tsx\n * <Navbar\n * productName=\"Mi Producto\"\n * environmentBadge=\"Ambiente de Pruebas\"\n * userDropdown={{\n * avatar: \"/path/to/avatar.jpg\",\n * name: \"Juan Pérez\",\n * email: \"juan@ejemplo.com\",\n * }}\n * notifications={{\n * cart: 99,\n * bell: true,\n * }}\n * onNavigationClick={() => router.back()}\n * onCartClick={() => openCart()}\n * onNotificationsClick={() => openNotifications()}\n * />\n * ```\n */\nexport const Navbar: React.FC<NavbarProps> = ({\n logo,\n productName = 'Nombre Producto',\n environmentBadge,\n userDropdown,\n actions,\n notifications,\n className = '',\n variant = 'responsive',\n hideActionButtons = false,\n showNavigationButton = false,\n navigationButtonProps = {},\n leadingAction,\n siesaLogo,\n showBusinessLogo = false,\n showSiesaLogoLeading = true,\n showSiesaLogoTrailing = false,\n onNavigationClick,\n onSearchClick,\n onCartClick,\n onNotificationsClick,\n}) => {\n // ===== CLASES COMUNES PARA BOTONES DE ACCIÓN =====\n const actionButtonClasses = `\n box-border\n flex\n flex-col\n items-center\n justify-center\n p-1\n relative\n rounded-md\n shrink-0\n text-primary-custom-600\n hover:bg-background-secondary\n active:scale-95\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:text-primary-custom-600\n dark:hover:bg-dark-bg-secondary\n dark:active:scale-95\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n transition-all\n duration-150\n `;\n\n // ===== CLASES PARA BOTÓN DE NAVEGACIÓN PRIMARIO =====\n const navigationButtonClasses = `\n bg-primary-custom-600\n text-primary-inverse-content\n border\n border-primary-custom-600\n shadow-button-inset\n hover:bg-primary-custom-500\n active:scale-95\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:bg-dark-bg-inverse\n dark:text-dark-content-inverse\n dark:border-dark-bg-inverse\n dark:hover:bg-dark-bg-inverse/90\n dark:active:scale-95\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n box-border\n flex\n flex-col\n items-center\n justify-center\n p-3\n relative\n rounded-md\n shrink-0\n transition-all\n duration-150\n `;\n\n // ===== HELPER: Es mobile (variante o responsive en mobile breakpoint) =====\n const isMobile = variant === 'mobile';\n const isDesktop = variant === 'desktop';\n const isTablet = variant === 'tablet';\n const isResponsive = variant === 'responsive';\n\n // ===== BOTÓN DE NAVEGACIÓN =====\n const NavigationButton = () => {\n if (isMobile || !showNavigationButton) return null;\n\n const defaultButtonProps = {\n type: 'default' as const,\n size: 'base' as const,\n iconOnly: true,\n leftIcon: <ArrowLeftStartOnRectangleIcon />,\n ariaLabel: 'Volver',\n onClick: onNavigationClick,\n ...navigationButtonProps, // Permite sobrescribir las props por defecto\n };\n\n if (isDesktop || isTablet) {\n return <Button {...defaultButtonProps} />;\n }\n\n // Responsive: Solo visible en md: y superiores\n return (\n <div className=\"hidden md:block\">\n <Button {...defaultButtonProps} />\n </div>\n );\n };\n\n // ===== BUSINESS LOGO (Logo del cliente/producto) =====\n // Solo se muestra si showBusinessLogo es true\n const BusinessLogo = () => {\n if (isMobile || !showBusinessLogo) return null;\n\n const logoContent = (\n <img\n src=\"/,Business Logo.png\"\n alt=\"Business Logo\"\n className=\"w-full h-full object-contain\"\n />\n );\n\n if (isDesktop) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[168px] h-[30px]\">\n {logoContent}\n </div>\n );\n }\n\n if (isTablet) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[140px] h-[25px]\">\n {logoContent}\n </div>\n );\n }\n\n // Responsive: Visible en md: con tamaño desktop, lg: con tamaño completo\n return (\n <div className=\"hidden md:block overflow-hidden relative shrink-0 w-[140px] lg:w-[168px] h-[25px] lg:h-[30px]\">\n {logoContent}\n </div>\n );\n };\n\n // ===== SIESA LOGO (Logo de Siesa - Leading) =====\n // Se controla con showSiesaLogoLeading\n // En mobile siempre se muestra el icono de Siesa en leading\n const SiesaLogoLeading = () => {\n const logoFull = (\n <img\n src=\"/.Siesa Logo.png\"\n alt=\"Siesa\"\n className=\"w-full h-full object-contain\"\n />\n );\n\n const logoMobile = (\n <img\n src=\"/siesa_logo_mobile.png\"\n alt=\"Siesa\"\n className=\"w-full h-full object-contain\"\n />\n );\n\n // En mobile siempre se muestra el icono de Siesa\n if (isMobile) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[30px] h-[30px]\">\n {logoMobile}\n </div>\n );\n }\n\n // En desktop/tablet: Se controla con showSiesaLogoLeading\n if (!showSiesaLogoLeading) return null;\n\n if (isDesktop) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[120px] h-[30px]\">\n {logoFull}\n </div>\n );\n }\n\n if (isTablet) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[100px] h-[25px]\">\n {logoFull}\n </div>\n );\n }\n\n // Responsive\n return (\n <>\n {/* Mobile: Logo icono (30x30) - siempre visible */}\n <div className=\"md:hidden overflow-hidden relative shrink-0 w-[30px] h-[30px]\">\n {logoMobile}\n </div>\n {/* Tablet/Desktop: Se controla con showSiesaLogoLeading */}\n {showSiesaLogoLeading && (\n <>\n {/* Tablet: Logo completo (100x25) */}\n <div className=\"hidden md:block lg:hidden overflow-hidden relative shrink-0 w-[100px] h-[25px]\">\n {logoFull}\n </div>\n {/* Desktop: Logo completo (120x30) */}\n <div className=\"hidden lg:block overflow-hidden relative shrink-0 w-[120px] h-[30px]\">\n {logoFull}\n </div>\n </>\n )}\n </>\n );\n };\n\n // ===== SIESA LOGO (Trailing) =====\n // Se controla con showSiesaLogoTrailing\n const SiesaLogoTrailing = () => {\n // Se controla con showSiesaLogoTrailing\n if (!showSiesaLogoTrailing || isMobile) return null;\n\n const logoFull = (\n <img\n src=\"/.Siesa Logo.png\"\n alt=\"Siesa\"\n className=\"w-full h-full object-contain\"\n />\n );\n\n if (isDesktop) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[120px] h-[30px]\">\n {logoFull}\n </div>\n );\n }\n\n if (isTablet) {\n return (\n <div className=\"overflow-hidden relative shrink-0 w-[100px] h-[25px]\">\n {logoFull}\n </div>\n );\n }\n\n // Responsive: Visible en md: (tablet y desktop)\n return (\n <>\n {/* Tablet: Logo completo (100x25) */}\n <div className=\"hidden md:block lg:hidden overflow-hidden relative shrink-0 w-[100px] h-[25px]\">\n {logoFull}\n </div>\n {/* Desktop: Logo completo (120x30) */}\n <div className=\"hidden lg:block overflow-hidden relative shrink-0 w-[120px] h-[30px]\">\n {logoFull}\n </div>\n </>\n );\n };\n\n // ===== DIVIDER COMPONENT =====\n const Divider = ({ responsive = true }: { responsive?: boolean }) => {\n const dividerContent = (\n <div className=\"grow shrink-0 w-px min-h-px bg-border-primary dark:bg-dark-border-primary\" />\n );\n\n if (isMobile) return null;\n\n if (isDesktop || isTablet) {\n return (\n <div className=\"flex flex-col gap-2 h-8 items-start px-0 py-1 relative shrink-0\">\n {dividerContent}\n </div>\n );\n }\n\n // Responsive\n if (responsive) {\n return (\n <div className=\"hidden md:flex flex-col gap-2 h-8 items-start px-0 py-1 relative shrink-0\">\n {dividerContent}\n </div>\n );\n }\n\n return null;\n };\n\n // ===== PRODUCT NAME =====\n const ProductName = () => {\n if (isMobile || !productName) return null;\n\n const nameContent = (\n <p className=\"font-bold leading-7 text-xl text-content-primary dark:text-dark-content-primary tracking-[-0.5px] whitespace-nowrap\">\n {productName}\n </p>\n );\n\n if (isDesktop || isTablet) {\n return nameContent;\n }\n\n // Responsive: Solo visible en md:\n return (\n <p className=\"hidden md:block font-bold leading-7 text-xl text-content-primary dark:text-dark-content-primary tracking-[-0.5px] whitespace-nowrap\">\n {productName}\n </p>\n );\n };\n\n // ===== ENVIRONMENT BADGE =====\n const EnvironmentBadge = () => {\n if (!environmentBadge) return null;\n\n if (isMobile) {\n return (\n <Badge\n color=\"yellow\"\n leftIcon={<ExclamationTriangleIcon />}\n label=\"Pruebas\"\n />\n );\n }\n\n if (isDesktop || isTablet) {\n return (\n <Badge\n color=\"yellow\"\n leftIcon={<ExclamationTriangleIcon />}\n label={environmentBadge}\n />\n );\n }\n\n // Responsive: Mostrar badge corto en mobile, completo en desktop\n return (\n <>\n <div className=\"md:hidden\">\n <Badge\n color=\"yellow\"\n leftIcon={<ExclamationTriangleIcon />}\n label=\"Pruebas\"\n />\n </div>\n <div className=\"hidden md:block\">\n <Badge\n color=\"yellow\"\n leftIcon={<ExclamationTriangleIcon />}\n label={environmentBadge}\n />\n </div>\n </>\n );\n };\n\n // ===== SEARCH BUTTON (Solo mobile) =====\n const SearchButton = () => {\n if (hideActionButtons) return null;\n\n if (isMobile) {\n return (\n <button\n className={actionButtonClasses}\n aria-label=\"Buscar\"\n onClick={onSearchClick}\n >\n <div className=\"overflow-hidden relative shrink-0 w-4 h-4\">\n <MagnifyingGlassIcon />\n </div>\n </button>\n );\n }\n\n if (isResponsive) {\n return (\n <button\n className={`md:hidden ${actionButtonClasses}`}\n aria-label=\"Buscar\"\n onClick={onSearchClick}\n >\n <div className=\"overflow-hidden relative shrink-0 w-4 h-4\">\n <MagnifyingGlassIcon />\n </div>\n </button>\n );\n }\n\n return null;\n };\n\n // ===== CART BUTTON =====\n const CartButton = () => {\n if (hideActionButtons) return null;\n\n return (\n <div className=\"relative\">\n <button\n className={actionButtonClasses}\n aria-label=\"Carrito de compras\"\n onClick={onCartClick}\n >\n <div className=\"overflow-hidden relative shrink-0 w-4 h-4\">\n <ShoppingCartIcon />\n </div>\n </button>\n {/* Badge de notificación con número */}\n {notifications?.cart !== undefined && notifications.cart > 0 && (\n <div className=\"absolute bg-error-content dark:bg-error-content flex flex-col gap-2.5 h-4 items-center justify-center left-[calc(50%+8px)] px-1 py-0 rounded-full top-[calc(50%-8px)] -translate-x-1/2 -translate-y-1/2 pointer-events-none min-w-[16px]\">\n <p className=\"font-bold leading-3 text-[10px] text-white text-center whitespace-nowrap\">\n {notifications.cart > 99 ? '+99' : notifications.cart}\n </p>\n </div>\n )}\n </div>\n );\n };\n\n // ===== NOTIFICATIONS BUTTON =====\n const NotificationsButton = () => {\n if (hideActionButtons) return null;\n\n return (\n <div className=\"relative\">\n <button\n className={actionButtonClasses}\n aria-label=\"Notificaciones\"\n onClick={onNotificationsClick}\n >\n <div className=\"overflow-hidden relative shrink-0 w-4 h-4\">\n <BellIcon />\n </div>\n </button>\n {/* Badge de notificación dot */}\n {notifications?.bell && (\n <div className=\"absolute w-2 h-2 bg-error-content dark:bg-error-content rounded-full left-[calc(50%+4px)] top-[calc(50%-8px)] -translate-x-1/2 pointer-events-none\" />\n )}\n </div>\n );\n };\n\n // ===== USER DROPDOWN =====\n const UserDropdown = () => {\n if (!userDropdown) return null;\n\n // Items del menú de usuario\n const userMenuItems = userDropdown.menuItems || [\n {\n children: 'Account',\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path d=\"M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM12.735 14c.618 0 1.093-.561.872-1.139a6.002 6.002 0 0 0-11.215 0c-.22.578.254 1.139.872 1.139h9.47Z\" />\n </svg>\n ),\n onClick: userDropdown.onAccountClick,\n },\n {\n children: 'Notifications',\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12 5a4 4 0 0 0-8 0v2.379a1.5 1.5 0 0 1-.44 1.06L2.294 9.707a1 1 0 0 0-.293.707V11a1 1 0 0 0 1 1h2a3 3 0 1 0 6 0h2a1 1 0 0 0 1-1v-.586a1 1 0 0 0-.293-.707L12.44 8.44A1.5 1.5 0 0 1 12 7.38V5Zm-5.5 7a1.5 1.5 0 0 0 3 0h-3Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n onClick: userDropdown.onNotificationsClick,\n },\n {\n children: 'Billing',\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4 2a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 4 14h8a1.5 1.5 0 0 0 1.5-1.5V6.621a1.5 1.5 0 0 0-.44-1.06L9.94 2.439A1.5 1.5 0 0 0 8.878 2H4Zm4 9.5a.75.75 0 0 1-.75-.75V8.06l-.72.72a.75.75 0 0 1-1.06-1.06l2-2a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-.72-.72v2.69a.75.75 0 0 1-.75.75Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n onClick: userDropdown.onBillingClick,\n },\n { isDivider: true },\n {\n children: 'Dark mode',\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path d=\"M14.438 10.148c.19-.425-.321-.787-.748-.601A5.5 5.5 0 0 1 6.453 2.31c.186-.427-.176-.938-.6-.748a6.501 6.501 0 1 0 8.585 8.586Z\" />\n </svg>\n ),\n onClick: userDropdown.onDarkModeClick,\n },\n { isDivider: true },\n {\n children: 'Sign Out',\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M14 4.75A2.75 2.75 0 0 0 11.25 2h-3A2.75 2.75 0 0 0 5.5 4.75v.5a.75.75 0 0 0 1.5 0v-.5c0-.69.56-1.25 1.25-1.25h3c.69 0 1.25.56 1.25 1.25v6.5c0 .69-.56 1.25-1.25 1.25h-3c-.69 0-1.25-.56-1.25-1.25v-.5a.75.75 0 0 0-1.5 0v.5A2.75 2.75 0 0 0 8.25 14h3A2.75 2.75 0 0 0 14 11.25v-6.5Zm-9.47.47a.75.75 0 0 0-1.06 0L1.22 7.47a.75.75 0 0 0 0 1.06l2.25 2.25a.75.75 0 1 0 1.06-1.06l-.97-.97h5.69a.75.75 0 0 0 0-1.5H3.56l.97-.97a.75.75 0 0 0 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n onClick: userDropdown.onSignOutClick,\n },\n ];\n\n // Mobile: Solo avatar circular con dropdown\n if (isMobile) {\n return (\n <Dropdown\n items={userMenuItems}\n renderTrigger={(isOpen) => (\n <button\n className={`\n box-border\n flex\n items-center\n justify-center\n overflow-hidden\n p-0\n relative\n shrink-0\n hover:bg-background-secondary\n focus:outline-none\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:hover:bg-dark-bg-secondary\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n rounded-lg\n transition-all\n duration-150\n ${isOpen ? 'bg-background-secondary dark:bg-dark-bg-secondary' : ''}\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Menú de usuario\"\n >\n <div className=\"relative rounded-full shrink-0 w-8 h-8\">\n <img\n alt={userDropdown.name}\n className=\"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-full w-full h-full\"\n src={userDropdown.avatar}\n />\n </div>\n </button>\n )}\n />\n );\n }\n\n // Desktop/Tablet: Avatar + info + chevron con dropdown\n const renderFullDropdown = () => (\n <Dropdown\n items={userMenuItems}\n renderTrigger={(isOpen) => (\n <button\n className={`\n box-border\n flex\n items-center\n justify-center\n overflow-hidden\n p-0\n relative\n shrink-0\n hover:bg-background-secondary\n focus:outline-none\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:hover:bg-dark-bg-secondary\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n rounded-lg\n transition-all\n duration-150\n ${isOpen ? 'bg-background-secondary dark:bg-dark-bg-secondary' : ''}\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Menú de usuario\"\n >\n <div className=\"box-border flex gap-3 items-center justify-center overflow-hidden px-3 py-2 relative rounded-lg shrink-0\">\n <div className=\"flex gap-3 items-center justify-center relative shrink-0\">\n {/* Avatar */}\n <div className=\"flex items-center justify-center relative shrink-0\">\n <div className=\"relative rounded-md shrink-0 w-10 h-10\">\n <img\n alt={userDropdown.name}\n className=\"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-md w-full h-full\"\n src={userDropdown.avatar}\n />\n </div>\n </div>\n {/* Nombre y email/rol */}\n <div className=\"flex flex-col gap-0.5 items-start justify-center relative shrink-0 w-[123px]\">\n <p className=\"leading-5 relative shrink-0 text-sm text-content-primary dark:text-dark-content-primary whitespace-nowrap font-normal\">\n {userDropdown.name}\n </p>\n {(userDropdown.email || userDropdown.role) && (\n <p className=\"leading-4 min-w-full relative shrink-0 text-xs text-content-secondary dark:text-content-secondary w-min whitespace-nowrap overflow-hidden text-ellipsis\">\n {userDropdown.email || userDropdown.role}\n </p>\n )}\n </div>\n </div>\n {/* Chevron down icon */}\n <div className=\"overflow-hidden relative shrink-0 w-5 h-5 text-content-secondary dark:text-content-secondary\">\n <ChevronDownIcon />\n </div>\n </div>\n </button>\n )}\n />\n );\n\n if (isDesktop || isTablet) {\n return renderFullDropdown();\n }\n\n // Responsive\n return (\n <>\n {/* Mobile: Solo avatar circular con dropdown */}\n <div className=\"md:hidden\">\n <Dropdown\n items={userMenuItems}\n renderTrigger={(isOpen) => (\n <button\n className={`\n box-border\n flex\n items-center\n justify-center\n overflow-hidden\n p-0\n relative\n shrink-0\n hover:bg-background-secondary\n focus:outline-none\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:hover:bg-dark-bg-secondary\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n rounded-lg\n transition-all\n duration-150\n ${isOpen ? 'bg-background-secondary dark:bg-dark-bg-secondary' : ''}\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Menú de usuario\"\n >\n <div className=\"relative rounded-full shrink-0 w-8 h-8\">\n <img\n alt={userDropdown.name}\n className=\"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-full w-full h-full\"\n src={userDropdown.avatar}\n />\n </div>\n </button>\n )}\n />\n </div>\n {/* Desktop/Tablet: Avatar + info + chevron con dropdown */}\n <div className=\"hidden md:flex\">\n <Dropdown\n items={userMenuItems}\n renderTrigger={(isOpen) => (\n <button\n className={`\n box-border\n flex\n items-center\n justify-center\n overflow-hidden\n p-0\n relative\n shrink-0\n hover:bg-background-secondary\n focus:outline-none\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:hover:bg-dark-bg-secondary\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n rounded-lg\n transition-all\n duration-150\n ${isOpen ? 'bg-background-secondary dark:bg-dark-bg-secondary' : ''}\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Menú de usuario\"\n >\n <div className=\"box-border flex gap-3 items-center justify-center overflow-hidden px-3 py-2 relative rounded-lg shrink-0\">\n <div className=\"flex gap-3 items-center justify-center relative shrink-0\">\n {/* Avatar */}\n <div className=\"flex items-center justify-center relative shrink-0\">\n <div className=\"relative rounded-md shrink-0 w-10 h-10\">\n <img\n alt={userDropdown.name}\n className=\"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-md w-full h-full\"\n src={userDropdown.avatar}\n />\n </div>\n </div>\n {/* Nombre y email/rol */}\n <div className=\"flex flex-col gap-0.5 items-start justify-center relative shrink-0 w-[123px]\">\n <p className=\"leading-5 relative shrink-0 text-sm text-content-primary dark:text-dark-content-primary whitespace-nowrap font-normal\">\n {userDropdown.name}\n </p>\n {(userDropdown.email || userDropdown.role) && (\n <p className=\"leading-4 min-w-full relative shrink-0 text-xs text-content-secondary dark:text-content-secondary w-min whitespace-nowrap overflow-hidden text-ellipsis\">\n {userDropdown.email || userDropdown.role}\n </p>\n )}\n </div>\n </div>\n {/* Chevron down icon */}\n <div className=\"overflow-hidden relative shrink-0 w-5 h-5 text-content-secondary dark:text-content-secondary\">\n <ChevronDownIcon />\n </div>\n </div>\n </button>\n )}\n />\n </div>\n </>\n );\n };\n\n // ===== CLASES BASE DEL NAVBAR =====\n const baseClasses = `\n box-border\n flex\n gap-8\n items-center\n px-4\n py-1\n relative\n w-full\n bg-background-primary\n dark:bg-dark-bg-primary\n `;\n\n // ===== CLASES PARA VARIANTES DE ALTURA =====\n const variantClasses = {\n responsive: 'h-[40px] md:h-16',\n desktop: 'h-16',\n tablet: 'h-16',\n mobile: 'h-[40px]',\n };\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [baseClasses, variantClasses[variant], className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <nav className={finalClasses}>\n {/* ===== SECCIÓN LEADING (IZQUIERDA) ===== */}\n <div className=\"flex gap-4 items-center relative shrink-0\">\n {/* Botón de navegación o acción leading personalizada (solo desktop/tablet) */}\n {!isMobile && (leadingAction || (showNavigationButton && <NavigationButton />))}\n\n {/* Business Logo (logo del cliente) - solo cuando showBusinessLogo=true */}\n {logo || <BusinessLogo />}\n\n {/* Divider después de Business Logo - Solo cuando hay Business Logo Y hay Siesa Logo en leading */}\n {showBusinessLogo && showSiesaLogoLeading && !isMobile && <Divider />}\n\n {/* Siesa Logo en leading - Se controla con showSiesaLogoLeading */}\n {siesaLogo || <SiesaLogoLeading />}\n\n {/* Divider antes del nombre - Solo cuando hay Siesa Logo en leading y nombre de producto */}\n {productName && showSiesaLogoLeading && !isMobile && <Divider />}\n\n {/* Nombre del Producto - Solo desktop/tablet */}\n <ProductName />\n </div>\n\n {/* ===== SECCIÓN TRAILING (DERECHA) ===== */}\n <div className=\"flex gap-4 items-center justify-end grow min-h-px min-w-px relative shrink-0\">\n {/* Badge de Ambiente */}\n <EnvironmentBadge />\n\n {/* Botón de búsqueda - Solo mobile */}\n <SearchButton />\n\n {/* Botón de carrito de compras */}\n <CartButton />\n\n {/* Botón de notificaciones */}\n <NotificationsButton />\n\n {/* Divider antes del dropdown - Solo desktop/tablet */}\n {userDropdown && !hideActionButtons && <Divider />}\n\n {/* Dropdown de usuario */}\n <UserDropdown />\n\n {/* Divider antes del logo Siesa trailing - Solo cuando showSiesaLogoTrailing=true */}\n {showSiesaLogoTrailing && userDropdown && !isMobile && <Divider />}\n\n {/* Logo Siesa trailing - Solo desktop */}\n <SiesaLogoTrailing />\n\n {/* Actions adicionales */}\n {actions && <div className=\"flex gap-2 items-center\">{actions}</div>}\n </div>\n </nav>\n );\n};\n","import React from 'react';\nimport type { NavigationBarProps, NavigationBarItem } from './NavigationBar.types';\n\n/**\n * NavigationBar del sistema de diseño Siesa\n *\n * **Componente de navegación inferior (Bottom Navigation Bar) para móvil.**\n * Permite al usuario navegar entre vistas principales de la aplicación.\n * Diseñado para contener 3-5 ítems de navegación.\n *\n * **🔄 Navegación Responsive:**\n * El NavigationRail (navegación lateral vertical) se convierte en NavigationBar\n * (navegación inferior horizontal) cuando la pantalla es móvil. Esta es una\n * práctica recomendada de UX para aprovechar mejor el espacio en diferentes\n * dispositivos:\n * - **Desktop/Tablet**: Usar NavigationRail (lateral)\n * - **Mobile**: Usar NavigationBar (inferior)\n *\n * **Características:**\n * - Soporta hasta 5 ítems de navegación (recomendado: 3-5)\n * - Cada ítem tiene icono + label\n * - Indicador visual de ítem activo (fondo azul claro)\n * - Estados: active, hover, disabled\n * - Dark mode completo\n * - Accesibilidad con ARIA labels\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Tipografía Label XXSmall (10px Bold) según sistema de diseño\n * - Iconos de 16x16px según especificaciones de Figma\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label XXSmall)\n * @see docs/spacing.md - Sistema de espaciado\n * @see NavigationRail - Componente de navegación lateral para desktop\n *\n * @example\n * ```tsx\n * const items = [\n * { id: 'home', icon: <HomeIcon />, label: 'Inicio', active: true },\n * { id: 'search', icon: <SearchIcon />, label: 'Buscar' },\n * { id: 'profile', icon: <ProfileIcon />, label: 'Perfil' },\n * ];\n *\n * <NavigationBar\n * items={items}\n * activeItemId=\"home\"\n * onItemClick={(id) => console.log('Clicked:', id)}\n * />\n * ```\n *\n * @example\n * // Patrón responsive: NavigationRail en desktop, NavigationBar en mobile\n * ```tsx\n * function ResponsiveNav() {\n * return (\n * <>\n * // NavigationRail para desktop/tablet\n * <div className=\"hidden md:block\">\n * <NavigationRail items={items} />\n * </div>\n *\n * // NavigationBar para móvil\n * <div className=\"md:hidden fixed bottom-0 left-0 right-0 z-50\">\n * <NavigationBar items={items} />\n * </div>\n * </>\n * );\n * }\n * ```\n */\nexport const NavigationBar: React.FC<NavigationBarProps> = ({\n items,\n activeItemId,\n onItemClick,\n className = '',\n ariaLabel = 'Navegación Principal',\n}) => {\n // ===== VALIDACIÓN: Máximo 5 ítems =====\n if (items.length > 5) {\n console.warn('NavigationBar: Se recomienda un máximo de 5 ítems para mejor UX');\n }\n\n // ===== HANDLER DE CLICK =====\n const handleItemClick = (item: NavigationBarItem) => {\n if (item.disabled) return;\n\n // Llamar onClick del ítem individual si existe\n if (item.onClick) {\n item.onClick(item.id);\n }\n\n // Llamar onItemClick global si existe\n if (onItemClick) {\n onItemClick(item.id);\n }\n };\n\n // ===== RENDERIZAR ÍTEM =====\n const renderItem = (item: NavigationBarItem) => {\n const isActive = item.active || item.id === activeItemId;\n\n // ===== CLASES DEL CONTENEDOR DEL ÍTEM =====\n const itemContainerClasses = `\n flex-1\n flex\n flex-col\n items-center\n gap-1\n px-0.5\n py-0\n min-w-0\n cursor-pointer\n transition-all\n duration-150\n ${item.disabled ? 'opacity-50 cursor-not-allowed pointer-events-none' : ''}\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL ICON CONTAINER =====\n // Fondo azul claro cuando está activo (rgb(219, 238, 254) = #dbeefe = primary-custom-100)\n // En dark mode usa el mismo color opaco según Figma\n const iconContainerClasses = `\n flex\n items-center\n justify-center\n px-4\n py-1\n rounded-full\n overflow-hidden\n transition-all\n duration-150\n ${\n isActive\n ? 'bg-primary-custom-100 dark:bg-primary-custom-100'\n : 'bg-transparent hover:bg-hover-overlay dark:hover:bg-hover-overlay-dark'\n }\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL LABEL =====\n // Label XXSmall: 10px Bold, line-height 12px (según typography.md y Figma)\n const labelClasses = `\n font-['SiesaBT:Bold',sans-serif]\n text-[10px]\n leading-[12px]\n font-bold\n text-center\n w-full\n min-w-0\n text-content-primary\n dark:text-dark-content-primary\n transition-colors\n duration-150\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL ICONO =====\n // Iconos de 16x16px según Figma\n const iconClasses = `\n w-4\n h-4\n shrink-0\n text-content-primary\n dark:text-dark-content-primary\n transition-colors\n duration-150\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n key={item.id}\n type=\"button\"\n className={itemContainerClasses}\n onClick={() => handleItemClick(item)}\n disabled={item.disabled}\n aria-label={item.ariaLabel || item.label}\n aria-current={isActive ? 'page' : undefined}\n >\n {/* Icon Container */}\n <div className={iconContainerClasses}>\n <span className={iconClasses}>{item.icon}</span>\n </div>\n\n {/* Label */}\n <span className={labelClasses}>{item.label}</span>\n </button>\n );\n };\n\n // ===== CLASES DEL CONTENEDOR PRINCIPAL =====\n const containerClasses = `\n bg-bg-primary\n dark:bg-dark-bg-primary\n p-4\n w-full\n transition-colors\n duration-150\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL MENU (Contenedor de ítems) =====\n const menuClasses = `\n flex\n items-start\n justify-center\n w-full\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== CLASES DEL DESTINATIONS (Contenedor con gap) =====\n const destinationsClasses = `\n flex-1\n flex\n items-start\n gap-2\n min-h-0\n min-w-0\n `\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <nav\n className={`${containerClasses} ${className}`.trim()}\n role=\"navigation\"\n aria-label={ariaLabel}\n >\n <div className={menuClasses}>\n <div className={destinationsClasses}>\n {items.map((item) => renderItem(item))}\n </div>\n </div>\n </nav>\n );\n};\n","import React from 'react';\n\n/**\n * Icono de convención para POSConvention\n *\n * Círculo SVG de 16x16px con colores diferentes para Light y Dark mode.\n * Basado en especificaciones de Figma:\n * - Light mode: node-id 4418-40139\n * - Dark mode: node-id 4418-40349\n *\n * Usa dos círculos superpuestos con clases CSS para alternar entre modos.\n *\n * @param lightColor - Color hexadecimal para Light mode\n * @param darkColor - Color hexadecimal para Dark mode\n * @param className - Clases CSS adicionales (opcional)\n */\nexport const ConventionIcon: React.FC<{\n lightColor: string;\n darkColor: string;\n className?: string;\n}> = ({ lightColor, darkColor, className = '' }) => (\n <svg\n className={`w-4 h-4 shrink-0 ${className}`.trim()}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n {/* Círculo para Light mode - visible por defecto, oculto en dark */}\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"8\"\n fill={lightColor}\n className=\"dark:hidden\"\n />\n {/* Círculo para Dark mode - oculto por defecto, visible en dark */}\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"8\"\n fill={darkColor}\n className=\"hidden dark:block\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { POSConventionProps } from './POSConvention.types';\nimport { ConventionIcon } from './icons';\n\n/**\n * POSConvention - Componente de leyenda/convención para estados de mesas POS\n *\n * Muestra un indicador circular de color con su respectiva etiqueta según el diseño de Figma.\n * Se usa típicamente para crear leyendas que explican el significado de colores en el sistema POS.\n *\n * **Colores según Figma (node-id: 4418-40139):**\n *\n * | Estado | Light Mode | Dark Mode |\n * |--------|------------|-----------|\n * | Available | #0e79fd (azul) | #93d1fd (azul claro) |\n * | Occupied | #af460e (naranja) | #f5a927 (amarillo) |\n * | Reserved | #7e22ce (morado) | #c084fc (morado claro) |\n * | Out of Service | #3f3f46 (gris) | #a1a1aa (gris claro) |\n *\n * **Dimensiones según Figma:**\n * - Icono: 16x16px (círculo con fill)\n * - Texto: 12px (Paragraph/Tiny - text-xs)\n * - Gap: 4px (gap-1)\n * - Line-height: 16px (leading-4)\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Colores exactos de Figma para Light y Dark mode\n * - Type safety con TypeScript estricto\n * - Accesibilidad con aria-label\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Paragraph Tiny)\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Indicador de disponible\n * <POSConvention status=\"available\" />\n *\n * // Indicador de ocupada\n * <POSConvention status=\"occupied\" />\n *\n * // Leyenda completa en contenedor\n * <div className=\"p-5 rounded-lg border border-dashed border-primary-custom-300\">\n * <div className=\"flex flex-col gap-9\">\n * <POSConvention status=\"available\" />\n * <POSConvention status=\"occupied\" />\n * <POSConvention status=\"reserved\" />\n * <POSConvention status=\"outOfService\" />\n * </div>\n * </div>\n * ```\n */\nexport const POSConvention: React.FC<POSConventionProps> = ({\n status = 'available',\n className = '',\n}) => {\n // ===== CONFIGURACIÓN DE COLORES Y LABELS SEGÚN FIGMA =====\n // Colores extraídos del nodo 4418-40139 (Light) y 4418-40349 (Dark) de Figma\n // Variables de Figma: contentCustomPrimary, contentYellow, contentPurple, contentZinc\n const conventionConfig = {\n available: {\n lightColor: '#0e79fd', // Azul - contentCustomPrimary Light\n darkColor: '#93d1fd', // Azul claro - contentCustomPrimary Dark\n label: 'Disponible',\n },\n occupied: {\n lightColor: '#af460e', // Naranja - contentOrange Light\n darkColor: '#f5a927', // Amarillo - contentYellow Dark\n label: 'Ocupada',\n },\n reserved: {\n lightColor: '#7e22ce', // Morado - contentPurple Light\n darkColor: '#c084fc', // Morado claro - contentPurple Dark\n label: 'Reservada',\n },\n outOfService: {\n lightColor: '#3f3f46', // Gris - contentZinc Light (zinc-700)\n darkColor: '#a1a1aa', // Gris claro - contentZinc Dark (zinc-400)\n label: 'Fuera de Servicio',\n },\n };\n\n const config = conventionConfig[status];\n\n // ===== CLASES BASE =====\n const baseClasses = `\n inline-flex\n items-center\n gap-1\n shrink-0\n `;\n\n // ===== COMBINAR CLASES =====\n const finalClasses = [baseClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <div\n className={finalClasses}\n role=\"presentation\"\n aria-label={`Estado: ${config.label}`}\n >\n {/* Icono circular 16x16 con colores para Light y Dark mode */}\n <ConventionIcon lightColor={config.lightColor} darkColor={config.darkColor} />\n\n {/* Label de texto según Figma: Paragraph/Tiny 12px */}\n {/* Light: contentPrimary #18181b, Dark: contentPrimary #f4f4f5 */}\n <span\n className={`\n text-xs\n leading-4\n font-normal\n text-content-primary\n dark:text-dark-content-primary\n whitespace-nowrap\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {config.label}\n </span>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * Icono Check (✓) para estado Available\n * Tamaño: 12x12px\n */\nexport const CheckIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M10 3L4.5 8.5L2 6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * Icono X Mark para estado Occupied\n * Tamaño: 12x12px\n */\nexport const XMarkIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M9 3L3 9M3 3L9 9\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * Icono Calendar para estado Reserved\n * Tamaño: 12x12px\n */\nexport const CalendarIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M10.5 5H1.5M8.5 1V3M3.5 1V3M3.25 11H8.75C9.57843 11 10.25 10.3284 10.25 9.5V3.5C10.25 2.67157 9.57843 2 8.75 2H3.25C2.42157 2 1.75 2.67157 1.75 3.5V9.5C1.75 10.3284 2.42157 11 3.25 11Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/**\n * Icono No Symbol (Prohibido) para estado Out of Service\n * Tamaño: 12x12px\n */\nexport const NoSymbolIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M10.5 6C10.5 8.48528 8.48528 10.5 6 10.5C3.51472 10.5 1.5 8.48528 1.5 6C1.5 3.51472 3.51472 1.5 6 1.5C8.48528 1.5 10.5 3.51472 10.5 6Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M9.18198 2.81802L2.81802 9.18198\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\n\n/**\n * Icono de Usuario/Personas para mostrar capacidad\n * Tamaño: 13x10px (según especificaciones de Figma)\n */\nexport const UsersIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"13\"\n height=\"10\"\n viewBox=\"0 0 13 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M9.25 9V8C9.25 6.89543 8.35457 6 7.25 6H2.75C1.64543 6 0.75 6.89543 0.75 8V9M12.25 9V8C12.25 6.89543 11.3546 6 10.25 6H9.75M7 2.5C7 3.60457 6.10457 4.5 5 4.5C3.89543 4.5 3 3.60457 3 2.5C3 1.39543 3.89543 0.5 5 0.5C6.10457 0.5 7 1.39543 7 2.5ZM10 2C10 2.82843 9.32843 3.5 8.5 3.5C7.67157 3.5 7 2.82843 7 2C7 1.17157 7.67157 0.5 8.5 0.5C9.32843 0.5 10 1.17157 10 2Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { POSLocationButtonProps } from './POSLocationButton.types';\nimport { CheckIcon, XMarkIcon, CalendarIcon, NoSymbolIcon, UsersIcon } from './icons';\n\n/**\n * POSLocationButton del sistema de diseño Siesa\n *\n * Botón especializado para punto de venta (POS) que muestra el estado de disponibilidad\n * de una ubicación física (mesa, salón, terraza, etc.) con indicadores visuales claros.\n *\n * **Estados de disponibilidad (status):**\n * - `available`: Disponible (verde/lime) con icono ✓\n * - `occupied`: Ocupada (naranja/yellow) con icono ✗\n * - `reserved`: Reservada (morado/purple) con icono 📅\n * - `outOfService`: Fuera de servicio (gris/zinc) con icono 🚫\n *\n * **Estados visuales (state):**\n * - `enabled`: Estado normal con fondo blanco/dark\n * - `actived`: Estado seleccionado con fondo coloreado\n *\n * **Características:**\n * - Ancho flexible: por defecto ocupa el 100% del contenedor (fullWidth=true)\n * - Altura fija: 68px (optimizado para interfaces POS)\n * - Muestra nombre de ubicación y capacidad (ej: \"1/8 mesas\")\n * - Badge visual con icono y texto del estado\n * - Dark mode completo en todos los estados\n * - Focus ring adaptativo\n * - Transiciones suaves\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * // Ubicación disponible\n * <POSLocationButton\n * locationName=\"Antejardín\"\n * status=\"available\"\n * capacity={{ current: 1, total: 8 }}\n * onClick={() => console.log('Seleccionado')}\n * />\n *\n * // Ubicación ocupada y seleccionada\n * <POSLocationButton\n * locationName=\"Terraza\"\n * status=\"occupied\"\n * state=\"actived\"\n * capacity={{ current: 5, total: 8 }}\n * />\n *\n * // Ubicación reservada\n * <POSLocationButton\n * locationName=\"Salón Principal\"\n * status=\"reserved\"\n * capacity={{ current: 3, total: 12 }}\n * />\n *\n * // Fuera de servicio\n * <POSLocationButton\n * locationName=\"Bar\"\n * status=\"outOfService\"\n * disabled\n * />\n * ```\n */\nexport const POSLocationButton: React.FC<POSLocationButtonProps> = ({\n locationName,\n status = 'available',\n state = 'enabled',\n capacity,\n onClick,\n disabled = false,\n className = '',\n ariaLabel,\n fullWidth = true,\n}) => {\n // ===== CONFIGURACIÓN DE COLORES POR STATUS =====\n // Mapeo de colores según especificaciones de Figma (pixel-perfect)\n const statusConfig = {\n available: {\n // Azul Primary Custom (según Figma: #0e79fd)\n textColor: 'text-primary-custom-600 dark:text-primary-custom-600',\n badgeBg: 'bg-primary-custom-100 dark:bg-blue-900/30',\n badgeText: 'text-primary-custom-600 dark:text-blue-400',\n activedBg: 'bg-primary-custom-100 dark:bg-blue-900/30',\n icon: CheckIcon,\n badgeLabel: 'Disponible',\n },\n occupied: {\n // Naranja/Yellow (según Figma: #af460e para texto, #fcedc9 para fondo)\n textColor: 'text-[#af460e] dark:text-orange-400',\n badgeBg: 'bg-[#fcedc9] dark:bg-yellow-900/30',\n badgeText: 'text-[#af460e] dark:text-orange-400',\n activedBg: 'bg-[#fcedc9] dark:bg-yellow-900/30',\n icon: XMarkIcon,\n badgeLabel: 'Ocupada',\n },\n reserved: {\n // Morado/Purple (según Figma: #7e22ce para texto, #f3e8ff para fondo)\n textColor: 'text-[#7e22ce] dark:text-fuchsia-400',\n badgeBg: 'bg-[#f3e8ff] dark:bg-purple-900/30',\n badgeText: 'text-[#7e22ce] dark:text-purple-400',\n activedBg: 'bg-[#f3e8ff] dark:bg-purple-900/30',\n icon: CalendarIcon,\n badgeLabel: 'Reservada',\n },\n outOfService: {\n // Gris/Zinc (según Figma: #3f3f46 para texto, #f4f4f5 para fondo)\n textColor: 'text-[#3f3f46] dark:text-zinc-400',\n badgeBg: 'bg-[#f4f4f5] dark:bg-zinc-800/30',\n badgeText: 'text-content-tertiary dark:text-zinc-400',\n activedBg: 'bg-[#f4f4f5] dark:bg-zinc-800/30',\n icon: NoSymbolIcon,\n badgeLabel: 'F. de Servicio',\n },\n };\n\n const config = statusConfig[status];\n const StatusIcon = config.icon;\n\n // ===== CLASES DE FONDO SEGÚN STATE =====\n const backgroundClasses =\n state === 'actived'\n ? config.activedBg // Fondo coloreado cuando está activo\n : 'bg-white dark:bg-dark-bg-primary'; // Fondo blanco/dark cuando está enabled\n\n // ===== CLASES DE ANCHO =====\n const widthClasses = fullWidth ? 'w-full' : 'w-[189px]';\n\n // ===== CLASES BASE =====\n const baseClasses = `\n flex\n flex-col\n items-stretch\n justify-between\n ${widthClasses}\n h-[68px]\n p-2\n rounded-lg\n cursor-pointer\n transition-all\n duration-150\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n hover:shadow-md\n active:scale-[0.98]\n disabled:opacity-50\n disabled:cursor-not-allowed\n disabled:pointer-events-none\n `;\n\n // ===== COMBINAR CLASES =====\n const buttonClasses = [baseClasses, backgroundClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== FORMATEAR TEXTO DE CAPACIDAD =====\n const capacityText = capacity\n ? `${capacity.current}/${capacity.total} mesas`\n : null;\n\n return (\n <button\n className={buttonClasses}\n onClick={onClick}\n disabled={disabled}\n aria-label={ariaLabel || `${locationName} - ${config.badgeLabel}`}\n type=\"button\"\n >\n {/* ===== TÍTULO (Nombre de ubicación) ===== */}\n <div\n className={`\n text-base\n font-bold\n leading-6\n ${config.textColor}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {locationName}\n </div>\n\n {/* ===== CONTENIDO (Capacidad + Badge) ===== */}\n <div className=\"flex items-center justify-between\">\n {/* Capacidad (izquierda) */}\n {capacityText && (\n <div className=\"flex items-center gap-1\">\n <UsersIcon className={config.textColor} />\n <span\n className={`\n text-[10px]\n leading-[12px]\n ${config.textColor}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {capacityText}\n </span>\n </div>\n )}\n\n {/* Badge (derecha) */}\n <div\n className={`\n inline-flex\n items-center\n gap-1\n px-1.5\n py-1\n rounded-md\n ${config.badgeBg}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n <StatusIcon className={config.badgeText} />\n <span\n className={`\n text-xs\n leading-4\n ${config.badgeText}\n `\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {config.badgeLabel}\n </span>\n </div>\n </div>\n </button>\n );\n};\n","import React from 'react';\nimport type { POSNumberButtonProps } from './POSNumberButton.types';\n\n/**\n * Componente POSNumberButton del sistema de diseño Siesa\n * Botón numérico especializado para sistemas POS (Point of Sale)\n *\n * Basado en especificaciones de Figma con Tailwind CSS\n *\n * **Características principales:**\n * - Diseñado para pantallas táctiles y POS\n * - Tipografía Display Tiny (48px Bold) para números grandes\n * - Tres tamaños: Small (40x40), Medium (65x65), Large (80x80)\n * - Opción de borde visible o sin borde\n * - Estados: Default, Hover, Active, Disabled\n * - Touch-friendly: active:scale-95 para feedback táctil\n *\n * **Variantes:**\n * - `border=false`: Botón sin borde, hover cambia a primary\n * - `border=true`: Botón con borde, hover resalta el borde\n *\n * **Tamaños:**\n * - `s` (40x40px): Compacto, para teclados numéricos pequeños\n * - `m` (65x65px): Mediano, tamaño intermedio\n * - `l` (80x80px): Grande, tamaño por defecto para POS\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n * - Feedback visual inmediato con active:scale-95\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Display Tiny)\n * @see docs/spacing.md - Sistema de espaciado\n * @see src/components/Button/Button.tsx - Componente Button de referencia\n *\n * @example\n * ```tsx\n * // Botón numérico grande (POS)\n * <POSNumberButton size=\"l\">1</POSNumberButton>\n *\n * // Botón con borde\n * <POSNumberButton size=\"l\" border>2</POSNumberButton>\n *\n * // Botón compacto\n * <POSNumberButton size=\"s\">3</POSNumberButton>\n *\n * // Teclado numérico completo\n * <div className=\"grid grid-cols-3 gap-2\">\n * {[1, 2, 3, 4, 5, 6, 7, 8, 9].map((num) => (\n * <POSNumberButton key={num} size=\"m\" onClick={() => handleInput(num)}>\n * {num}\n * </POSNumberButton>\n * ))}\n * </div>\n * ```\n */\nexport const POSNumberButton: React.FC<POSNumberButtonProps> = ({\n size = 'l',\n border = false,\n children,\n disabled = false,\n className = '',\n onClick,\n ariaLabel,\n htmlType = 'button',\n ...rest\n}) => {\n // ===== CLASES DE TAMAÑO =====\n // Basado en especificaciones de Figma: L=80x80, M=65x65, S=40x40\n const sizeClasses = {\n s: 'w-10 h-10', // 40x40px\n m: 'w-[65px] h-[65px]', // 65x65px\n l: 'w-20 h-20', // 80x80px\n };\n\n // ===== CLASES DE TEXTO =====\n // Display Tiny (48px Bold) según typography.md → text-5xl\n // Para tamaño small, reducimos a text-2xl (24px)\n const textSizeClasses = {\n s: 'text-2xl', // 24px para botones pequeños\n m: 'text-5xl', // 48px Display Tiny\n l: 'text-5xl', // 48px Display Tiny\n };\n\n // ===== CLASES DE ESTADO (Sin Borde) =====\n const noBorderStateClasses = `\n bg-white\n text-content-primary\n hover:bg-primary-custom-600\n hover:text-primary-inverse-content\n active:bg-primary-custom-600\n active:text-primary-inverse-content\n active:scale-95\n dark:bg-dark-bg-primary\n dark:text-dark-content-primary\n dark:hover:bg-dark-bg-inverse\n dark:hover:text-dark-content-inverse\n dark:active:bg-dark-bg-inverse\n dark:active:text-dark-content-inverse\n dark:active:scale-95\n `;\n\n // ===== CLASES DE ESTADO (Con Borde) =====\n const withBorderStateClasses = `\n bg-white\n text-content-primary\n border\n border-border-primary\n hover:bg-primary-custom-600\n hover:text-primary-inverse-content\n hover:border-primary-inverse-border\n active:bg-primary-custom-600\n active:text-primary-inverse-content\n active:border-primary-inverse-border\n active:scale-95\n dark:bg-dark-bg-primary\n dark:text-dark-content-primary\n dark:border-dark-border-primary\n dark:hover:bg-dark-bg-inverse\n dark:hover:text-dark-content-inverse\n dark:hover:border-primary-inverse-border\n dark:active:bg-dark-bg-inverse\n dark:active:text-dark-content-inverse\n dark:active:border-primary-inverse-border\n dark:active:scale-95\n `;\n\n // ===== CLASES BASE =====\n const baseClasses = `\n inline-flex\n items-center\n justify-center\n rounded-lg\n font-bold\n tracking-tighter\n whitespace-nowrap\n cursor-pointer\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n disabled:opacity-50\n disabled:cursor-not-allowed\n disabled:pointer-events-none\n transition-all\n duration-150\n `;\n\n // ===== COMBINAR TODAS LAS CLASES =====\n const buttonClasses = [\n baseClasses,\n sizeClasses[size],\n textSizeClasses[size],\n border ? withBorderStateClasses : noBorderStateClasses,\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type={htmlType}\n className={buttonClasses}\n disabled={disabled}\n onClick={onClick}\n aria-label={ariaLabel || `Número ${children}`}\n {...rest}\n >\n {children}\n </button>\n );\n};\n","import React from 'react';\nimport type { POSProductButtonProps } from './POSProductButton.types';\n\n/**\n * Componente POSProductButton del sistema de diseño Siesa\n *\n * Botón especializado para sistemas POS que combina una imagen de producto\n * con un label descriptivo. Diseñado para selección rápida de productos.\n *\n * **Estados disponibles:**\n * - `default`: Estado normal con fondo blanco\n * - `active`: Estado seleccionado con fondo azul claro y texto azul\n * - `disabled`: Estado deshabilitado con opacidad reducida\n *\n * **Características:**\n * - Imagen con aspect ratio 158:80 (proporción de Figma)\n * - Label con tipografía Label Small (14px Bold)\n * - Soporte completo de dark mode\n * - Estados hover, active y focus\n * - Transiciones suaves\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Tokens de color consistentes con la documentación\n * - Estados hover y active completos\n * - Tipografía Label Small (14px Bold) según sistema de diseño\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico (Label)\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/border-radius.md - Border radius\n *\n * @example\n * ```tsx\n * // Botón de producto normal\n * <POSProductButton\n * image=\"/images/parrilla.jpg\"\n * label=\"A la parrilla\"\n * onClick={() => console.log('Producto seleccionado')}\n * />\n *\n * // Botón de producto activo/seleccionado\n * <POSProductButton\n * image=\"/images/parrilla.jpg\"\n * label=\"A la parrilla\"\n * active={true}\n * />\n *\n * // Botón de producto deshabilitado\n * <POSProductButton\n * image=\"/images/parrilla.jpg\"\n * label=\"A la parrilla\"\n * disabled={true}\n * />\n * ```\n */\nexport const POSProductButton: React.FC<POSProductButtonProps> = ({\n image,\n label,\n active = false,\n disabled = false,\n onClick,\n className = '',\n ariaLabel,\n}) => {\n // ===== CLASES BASE =====\n const baseClasses = `\n flex\n flex-col\n gap-2\n p-3\n rounded-lg\n font-bold\n text-sm\n transition-all\n duration-150\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n `;\n\n // ===== CLASES DE ESTADO =====\n const stateClasses = disabled\n ? `\n bg-white\n text-content-primary\n opacity-55\n cursor-not-allowed\n pointer-events-none\n dark:bg-dark-bg-primary\n dark:text-dark-content-primary\n `\n : active\n ? `\n bg-primary-custom-100\n text-primary-custom-600\n cursor-pointer\n hover:bg-primary-custom-100\n active:scale-95\n dark:bg-primary-custom-100/20\n dark:text-primary-custom-600\n dark:hover:bg-primary-custom-100/30\n dark:active:scale-95\n `\n : `\n bg-white\n text-content-primary\n cursor-pointer\n hover:bg-background-secondary\n active:scale-95\n dark:bg-dark-bg-primary\n dark:text-dark-content-primary\n dark:hover:bg-dark-bg-primary/80\n dark:active:scale-95\n `;\n\n // ===== COMBINAR TODAS LAS CLASES =====\n const buttonClasses = [baseClasses, stateClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return (\n <button\n type=\"button\"\n className={buttonClasses}\n disabled={disabled}\n onClick={onClick}\n aria-label={ariaLabel || label}\n aria-pressed={active}\n >\n {/* Imagen del producto */}\n <div className=\"aspect-158/80 w-full rounded-lg overflow-hidden\">\n <img\n src={image}\n alt={label}\n className=\"w-full h-full object-cover\"\n />\n </div>\n\n {/* Label del producto */}\n <div className=\"w-full text-left leading-5\">\n {label}\n </div>\n </button>\n );\n};\n","import React from 'react';\n\n/**\n * Icono Plus (heroicons-micro/plus)\n * Usado en el botón \"Agregar\" del POSProductCard\n * Tamaño: 16x16px según especificación de Figma\n */\nexport const PlusIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n aria-hidden=\"true\"\n >\n <path\n d=\"M8 3V13M3 8H13\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { POSProductCardProps } from './POSProductCard.types';\nimport { Button } from '../Button';\nimport { PlusIcon } from './icons';\n\n/**\n * Componente POSProductCard del sistema de diseño Siesa\n *\n * Card especializado para sistemas POS que muestra información de producto\n * con imagen, nombre, precio y botón de agregar. Diseñado para catálogos\n * de productos y selección rápida en punto de venta.\n *\n * **Estados disponibles:**\n * - `enabled`: Estado normal\n * - Light: fondo blanco (#ffffff), texto negro (#18181b)\n * - Dark: fondo oscuro (#18181b), texto claro (#f4f4f5)\n * - `active`: Estado seleccionado\n * - Light: fondo azul claro (#dbeefe), texto azul (#0e79fd)\n * - Dark: fondo azul oscuro (#112d57), texto celeste (#93d1fd)\n * - `disabled`: Estado deshabilitado con opacidad reducida\n *\n * **Características:**\n * - Imagen de producto con aspect ratio fijo y rounded-lg\n * - Nombre del producto con tipografía Label Small (14px Bold)\n * - Precio con tipografía Heading Small (24px Bold) y letter-spacing -2.5%\n * - Botón \"Agregar\" reutiliza el componente Button del sistema\n * - Soporte completo de dark mode pixel-perfect\n * - Transiciones suaves\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Tokens de color consistentes con Figma\n * - Estados hover y active completos\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4368-31336 - Diseño Figma\n *\n * @example\n * ```tsx\n * // Card de producto normal\n * <POSProductCard\n * image=\"/images/caprese.jpg\"\n * productName=\"Ensalada Caprese\"\n * price=\"$ 40.000\"\n * onAddClick={() => console.log('Producto agregado')}\n * />\n *\n * // Card de producto activo/seleccionado\n * <POSProductCard\n * image=\"/images/caprese.jpg\"\n * productName=\"Ensalada Caprese\"\n * price=\"$ 40.000\"\n * active={true}\n * />\n *\n * // Card de producto deshabilitado\n * <POSProductCard\n * image=\"/images/caprese.jpg\"\n * productName=\"Ensalada Caprese\"\n * price=\"$ 40.000\"\n * disabled={true}\n * />\n * ```\n */\nexport const POSProductCard: React.FC<POSProductCardProps> = ({\n image,\n productName,\n price,\n buttonText = 'Agregar',\n active = false,\n disabled = false,\n onAddClick,\n onCardClick,\n className = '',\n ariaLabel,\n}) => {\n // ===== CLASES BASE DEL CARD =====\n const baseClasses = `\n flex\n flex-col\n gap-2\n p-3\n rounded-lg\n w-[170px]\n transition-all\n duration-150\n focus:outline-hidden\n focus:ring-2\n focus:ring-primary-custom-400\n focus:ring-offset-2\n dark:focus:ring-dark-border-custom\n dark:focus:ring-offset-dark-bg-primary\n `;\n\n // ===== CLASES DE ESTADO DEL CARD =====\n // Light: enabled=#ffffff, active=#dbeefe\n // Dark: enabled=#18181b, active=#112d57\n const stateClasses = disabled\n ? `\n bg-white\n opacity-55\n cursor-not-allowed\n dark:bg-dark-bg-primary\n `\n : active\n ? `\n bg-primary-custom-100\n cursor-pointer\n dark:bg-dark-bg-custom\n `\n : `\n bg-white\n cursor-pointer\n dark:bg-dark-bg-primary\n `;\n\n // ===== CLASES DE TEXTO SEGÚN ESTADO =====\n // Light: enabled=#18181b, active=#0e79fd\n // Dark: enabled=#f4f4f5, active=#93d1fd\n const textClasses = disabled\n ? `\n text-content-primary\n dark:text-dark-content-primary\n `\n : active\n ? `\n text-primary-custom-600\n dark:text-dark-content-custom\n `\n : `\n text-content-primary\n dark:text-dark-content-primary\n `;\n\n // ===== COMBINAR CLASES DEL CARD =====\n const cardClasses = [baseClasses, stateClasses, className]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== HANDLER DEL CLICK EN EL CARD =====\n const handleCardClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (disabled) return;\n // Solo propagar si no se hizo clic en el botón\n if ((event.target as HTMLElement).closest('button')) return;\n onCardClick?.(event);\n };\n\n // ===== HANDLER DEL CLICK EN EL BOTÓN =====\n const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n if (disabled) return;\n onAddClick?.(event);\n };\n\n return (\n <div\n className={cardClasses}\n onClick={handleCardClick}\n role=\"article\"\n aria-label={ariaLabel || `${productName} - ${price}`}\n tabIndex={disabled ? -1 : 0}\n >\n {/* Sección de información del producto */}\n <div className=\"flex flex-col gap-3 w-full\">\n {/* Imagen del producto */}\n <div className=\"h-[88px] w-full rounded-lg overflow-hidden\">\n <img\n src={image}\n alt={productName}\n className=\"w-full h-full object-cover\"\n />\n </div>\n\n {/* Datos del producto (nombre y precio) */}\n <div className={`flex flex-col w-full font-bold ${textClasses}`.trim().replace(/\\s+/g, ' ')}>\n {/* Nombre del producto - Label Small (14px) */}\n <div className=\"text-sm leading-5\">\n {productName}\n </div>\n\n {/* Precio - Heading Small (24px) con letter-spacing -2.5% (tracking-tighter) */}\n <div className=\"text-2xl leading-8 tracking-tighter\">\n {price}\n </div>\n </div>\n </div>\n\n {/* Botón Agregar - Reutiliza el componente Button del sistema */}\n <Button\n type=\"default\"\n size=\"sm\"\n leftIcon={<PlusIcon className=\"w-4 h-4\" />}\n onClick={handleButtonClick}\n disabled={disabled}\n fullWidth\n ariaLabel={`${buttonText} ${productName}`}\n >\n {buttonText}\n </Button>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * TrashIcon - Icono de papelera para eliminar items\n * Basado en Heroicons Micro (16x16px)\n */\nexport const TrashIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { POSProductSidebarItemsProps } from './POSProductSidebarItems.types';\nimport { Quantity } from '../Quantity/Quantity';\nimport { TrashIcon } from './icons';\n\n/**\n * POSProductSidebarItems - Componente de item de producto para sidebar POS\n *\n * Componente pixel-perfect basado en Figma (node 4507-28013) para mostrar\n * productos en el sidebar de un sistema POS con soporte completo para dark mode.\n *\n * **Características:**\n * - Badge de categoría con 19 colores configurables\n * - Referencia del producto (text-[10px]/leading-3)\n * - Precio total (text-xs/font-bold)\n * - Nombre del producto (text-xs/font-bold)\n * - Descripción con items opcionales (fondo terciario)\n * - Control de cantidad integrado (Quantity component)\n * - Botón de eliminar con color de error\n *\n * **Especificaciones de Figma:**\n * - Ancho base: 272px\n * - Spacing: gap-1 (4px) entre elementos del producto, gap-2 (8px) entre secciones\n * - Badge: rounded-md (6px), px-1.5, py-1, text-xs/leading-4\n * - Description section: bg-background-tertiary, p-2, rounded-lg\n * - Delete icon: 24x24px, color red-700\n *\n * **Dark Mode:**\n * Los colores se adaptan automáticamente en dark mode:\n * - Textos principales: text-content-primary → dark:text-dark-content-primary\n * - Description background: bg-background-tertiary → dark:bg-zinc-700\n * - Badge colores: Mantienen contraste en ambos modos\n * - Delete button: text-red-700 → dark:text-red-500\n *\n * **Orden de modificadores:** {responsive}:{dark}:{state}:{utility}\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=4507-28013 - Diseño Figma\n *\n * @example\n * ```tsx\n * <POSProductSidebarItems\n * categoryLabel=\"Entradas\"\n * productRef=\"00147258369\"\n * price=\"$ 40,000.00\"\n * productName=\"Nombre producto\"\n * descriptionItems={[\n * { description: \"Papas limón mediana\", price: \"$ 40,000.00\" },\n * { description: \"Papas limón mediana\", price: \"$ 40,000.00\" },\n * ]}\n * quantity={0}\n * onQuantityChange={(qty) => console.log(qty)}\n * onDelete={() => console.log('Eliminar')}\n * />\n * ```\n */\nexport const POSProductSidebarItems: React.FC<POSProductSidebarItemsProps> = ({\n categoryLabel,\n categoryColor = 'lime',\n productRef,\n price,\n productName,\n descriptionItems = [],\n showDescription = true,\n quantity = 0,\n minQuantity = 0,\n maxQuantity,\n onQuantityChange,\n onDelete,\n disabled = false,\n className = '',\n deleteIcon,\n}) => {\n // ===== MAPA DE COLORES PARA BADGES =====\n // Basado en Figma node 4507-28432: bg lime-100 (#ecfccb) y text lime-700 (#4d7c0f)\n // Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n const categoryColorClasses: Record<string, { bg: string; text: string }> = {\n lime: {\n bg: 'bg-lime-100 dark:bg-lime-900/40',\n text: 'text-lime-700 dark:text-lime-300'\n },\n red: {\n bg: 'bg-red-100 dark:bg-red-900/40',\n text: 'text-red-700 dark:text-red-300'\n },\n orange: {\n bg: 'bg-orange-100 dark:bg-orange-900/40',\n text: 'text-orange-700 dark:text-orange-300'\n },\n amber: {\n bg: 'bg-amber-100 dark:bg-amber-900/40',\n text: 'text-amber-700 dark:text-amber-300'\n },\n yellow: {\n bg: 'bg-yellow-100 dark:bg-yellow-900/40',\n text: 'text-yellow-700 dark:text-yellow-300'\n },\n green: {\n bg: 'bg-green-100 dark:bg-green-900/40',\n text: 'text-green-700 dark:text-green-300'\n },\n emerald: {\n bg: 'bg-emerald-100 dark:bg-emerald-900/40',\n text: 'text-emerald-700 dark:text-emerald-300'\n },\n teal: {\n bg: 'bg-teal-100 dark:bg-teal-900/40',\n text: 'text-teal-700 dark:text-teal-300'\n },\n cyan: {\n bg: 'bg-cyan-100 dark:bg-cyan-900/40',\n text: 'text-cyan-700 dark:text-cyan-300'\n },\n sky: {\n bg: 'bg-sky-100 dark:bg-sky-900/40',\n text: 'text-sky-700 dark:text-sky-300'\n },\n blue: {\n bg: 'bg-blue-100 dark:bg-blue-900/40',\n text: 'text-blue-700 dark:text-blue-300'\n },\n indigo: {\n bg: 'bg-indigo-100 dark:bg-indigo-900/40',\n text: 'text-indigo-700 dark:text-indigo-300'\n },\n violet: {\n bg: 'bg-violet-100 dark:bg-violet-900/40',\n text: 'text-violet-700 dark:text-violet-300'\n },\n purple: {\n bg: 'bg-purple-100 dark:bg-purple-900/40',\n text: 'text-purple-700 dark:text-purple-300'\n },\n fuchsia: {\n bg: 'bg-fuchsia-100 dark:bg-fuchsia-900/40',\n text: 'text-fuchsia-700 dark:text-fuchsia-300'\n },\n pink: {\n bg: 'bg-pink-100 dark:bg-pink-900/40',\n text: 'text-pink-700 dark:text-pink-300'\n },\n rose: {\n bg: 'bg-rose-100 dark:bg-rose-900/40',\n text: 'text-rose-700 dark:text-rose-300'\n },\n zinc: {\n bg: 'bg-zinc-100 dark:bg-zinc-800/50',\n text: 'text-zinc-600 dark:text-zinc-300'\n },\n primary: {\n bg: 'bg-primary-custom-100 dark:bg-primary-custom-600/30',\n text: 'text-primary-custom-600 dark:text-primary-custom-300'\n },\n };\n\n const colors = categoryColorClasses[categoryColor] || categoryColorClasses.lime;\n\n // Handler para cambio de cantidad\n const handleQuantityChange = (newQuantity: number) => {\n if (!disabled && onQuantityChange) {\n onQuantityChange(newQuantity);\n }\n };\n\n // Handler para eliminar\n const handleDelete = () => {\n if (!disabled && onDelete) {\n onDelete();\n }\n };\n\n return (\n <div\n className={`\n flex\n flex-col\n gap-2\n w-full\n ${disabled ? 'opacity-50 pointer-events-none' : ''}\n ${className}\n `.trim().replace(/\\s+/g, ' ')}\n data-component=\"POSProductSidebarItems\"\n >\n {/* ===== BODY SECTION ===== */}\n <div className=\"flex flex-col gap-2 w-full\">\n {/* ===== PRODUCT INFO ===== */}\n <div className=\"flex flex-col gap-1 w-full\">\n {/* Row: Badge + Ref + Price - Figma node 4507:28398 */}\n <div className=\"flex items-center gap-1 w-full\">\n {/* Col: Badge + Ref - Figma node 4507:28399 */}\n <div className=\"flex items-center gap-2 flex-1 min-w-0\">\n {/* Category Badge - Figma node 4507:28432 */}\n <div\n className={`\n inline-flex\n items-center\n px-1.5\n py-1\n rounded-md\n transition-colors\n duration-150\n ${colors.bg}\n `.trim().replace(/\\s+/g, ' ')}\n >\n <span\n className={`\n text-xs\n leading-4\n font-normal\n text-center\n whitespace-nowrap\n ${colors.text}\n `.trim().replace(/\\s+/g, ' ')}\n >\n {categoryLabel}\n </span>\n </div>\n\n {/* Product Reference - Figma node 4507:28401 - Paragraph/XXSmall 10px */}\n <span className=\"text-[10px] leading-3 font-normal text-content-primary dark:text-dark-content-primary whitespace-nowrap\">\n {productRef}\n </span>\n </div>\n\n {/* Col: Price - Figma node 4507:28450 - Label/Tiny 12px Bold */}\n <div className=\"flex items-center shrink-0\">\n <span className=\"text-xs leading-4 font-bold text-content-primary dark:text-dark-content-primary whitespace-nowrap text-right\">\n {price}\n </span>\n </div>\n </div>\n\n {/* Row: Product Name - Figma node 4507:28404 - Label/Tiny 12px Bold */}\n <div className=\"flex items-start w-full\">\n <span className=\"text-xs leading-4 font-bold text-content-primary dark:text-dark-content-primary flex-1 min-w-0\">\n {productName}\n </span>\n </div>\n </div>\n\n {/* ===== DESCRIPTION SECTION ===== */}\n {/* Figma node 4507:28405 - Background tertiary con items de descripción */}\n {showDescription && descriptionItems.length > 0 && (\n <div\n className={`\n flex\n flex-col\n gap-2\n p-2\n rounded-lg\n bg-background-secondary\n dark:bg-zinc-700\n w-full\n transition-colors\n duration-150\n `.trim().replace(/\\s+/g, ' ')}\n >\n {descriptionItems.map((item, index) => (\n <div\n key={index}\n className=\"flex items-center gap-1 w-full\"\n >\n {/* Description text - Figma Body/Small 12px Regular */}\n <span className=\"flex-1 min-w-0 text-xs leading-3 font-normal text-content-primary dark:text-dark-content-primary\">\n {item.description}\n </span>\n {/* Price - Figma Body/Small Bold 12px */}\n <span className=\"text-xs leading-3 font-bold text-content-primary dark:text-dark-content-primary whitespace-nowrap text-right shrink-0\">\n {item.price}\n </span>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* ===== ACTIONS SECTION ===== */}\n {/* Figma node 4507:28412 - Quantity control + Delete button */}\n <div className=\"flex items-center justify-between w-full\">\n {/* Quantity Control - Figma width: 118px */}\n <div className=\"w-[118px]\">\n <Quantity\n value={quantity}\n min={minQuantity}\n max={maxQuantity}\n onChange={handleQuantityChange}\n disabled={disabled}\n />\n </div>\n\n {/* Delete Button - Figma node 4514:28258 - 24x24px, color red-700 (#b91c1c) */}\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={disabled}\n className={`\n flex\n items-center\n justify-center\n w-6\n h-6\n rounded-md\n text-red-700\n dark:text-red-500\n hover:text-red-800\n dark:hover:text-red-400\n hover:bg-red-50\n dark:hover:bg-red-900/20\n focus:outline-hidden\n focus:ring-2\n focus:ring-red-500/50\n dark:focus:ring-red-400/50\n focus:ring-offset-1\n focus:ring-offset-white\n dark:focus:ring-offset-dark-bg-primary\n active:scale-95\n transition-all\n duration-150\n ${disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'}\n `.trim().replace(/\\s+/g, ' ')}\n aria-label=\"Eliminar producto\"\n >\n {deleteIcon || <TrashIcon className=\"w-[18px] h-[21px]\" />}\n </button>\n </div>\n </div>\n );\n};\n\nPOSProductSidebarItems.displayName = 'POSProductSidebarItems';\n","import React from 'react';\nimport type { POSTableProps } from './POSTable.types';\n\n/**\n * POSTable - Sistema de visualización de mesas de restaurante\n *\n * Componente para mostrar mesas de restaurante con diferentes estados\n * (disponible, ocupada, reservada) y configuraciones de sillas según diseño de Figma.\n *\n * ⚠️ IMPORTANTE - COLORES PERSONALIZADOS DEL CLIENTE:\n * Este componente usa colores específicos hardcodeados según el diseño del cliente.\n * Estos NO son tokens del sistema de diseño general, sino colores únicos para POSTable.\n * Esta es una EXCEPCIÓN JUSTIFICADA similar a los iconos personalizados de POSTable.\n *\n * ESPECIFICACIONES PIXEL-PERFECT DE FIGMA:\n *\n * Colores exactos (ESPECÍFICOS DEL CLIENTE):\n *\n * LIGHT MODE:\n * - Available (Azul): #0e79fd (border, mesa, silla, texto) - Azul primario del sistema\n * - Available Active: Bg #dbeefe + Border #bce4ff (cuando isActive=true)\n * - Busy (Naranja): #af460e (border, mesa, silla, texto)\n * - Busy Active: Bg #fed7aa + Border #fed7aa (cuando isActive=true)\n * - Reserved (Púrpura): #7e22ce (border, mesa, silla, texto)\n * - Reserved Active: Bg #e9d5ff + Border #e9d5ff (cuando isActive=true)\n *\n * DARK MODE (colores más brillantes para mejor visibilidad):\n * - Available (Azul claro): #93d1fd (border, mesa, silla, texto)\n * - Available Active: Bg #1e3a5f + Border #1e3a5f (cuando isActive=true)\n * - Busy (Naranja/Amarillo): #f5a927 (border, mesa, silla, texto)\n * - Busy Active: Bg #5c3a1e + Border #5c3a1e (cuando isActive=true)\n * - Reserved (Púrpura claro): #c084fc (border, mesa, silla, texto)\n * - Reserved Active: Bg #3b1f5c + Border #3b1f5c (cuando isActive=true)\n *\n * - Texto del label: Mismo color del estado (está FUERA de la mesa según Figma)\n *\n * Dimensiones exactas:\n * - Container: 160x160px, border-radius: 8px, border: 2px\n * - Inner container: 134x134px, gap: 4px\n * - Mesa Square: 64x64px, border-radius: 4px\n * - Mesa Circle: 64x64px, border-radius: 9999px\n * - Mesa Rectangle: 80x64px, border-radius: 4px\n * - Mesa Oval: 80x64px, border-radius: 24px\n * - Silla: 28x22px, border-radius: 4px\n * - Silla Respaldo (top): 28x16px (72.73% height)\n * - Silla Asiento (bottom): 24x14px (85.71% width, 63.64% height)\n * - Gap: 4px entre todos los elementos\n *\n * Tipografía:\n * - Label: 10px / 12px line-height, weight: 400, font: SiesaBT\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Focus rings adaptativos para light y dark mode\n * - Valores exactos de Figma con notación [px]\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n *\n * @example\n * ```tsx\n * <POSTable\n * tableNumber=\"12\"\n * status=\"available\"\n * shape=\"square\"\n * chairs={4}\n * onClick={() => console.log('Mesa seleccionada')}\n * />\n * ```\n */\nexport const POSTable: React.FC<POSTableProps> = ({\n tableNumber,\n status = 'available',\n shape = 'square',\n chairs = 4,\n showChairs = true,\n isActive = false,\n onClick,\n className = '',\n disabled = false,\n children,\n}) => {\n // ===== COLORES POR ESTADO (VALORES EXACTOS DE FIGMA) =====\n // ⚠️ NOTA: Estos colores son ESPECÍFICOS del cliente (excepción justificada)\n // NO son tokens del sistema general de diseño\n // Light Mode: #0e79fd (azul primario), #af460e (naranja), #7e22ce (púrpura)\n // Dark Mode: #93d1fd (azul claro), #f5a927 (naranja/amarillo), #c084fc (púrpura claro)\n const statusColors = {\n available: {\n // Enabled state - Light: #0e79fd (azul primario del sistema), Dark: #93d1fd\n border: 'border-[#0e79fd]',\n borderDark: 'dark:border-[#93d1fd]',\n bgEnabled: 'bg-transparent',\n bgEnabledDark: 'dark:bg-transparent',\n // Actived state - Light: Bg #dbeefe + Border #bce4ff según Figma\n bgActive: 'bg-primary-custom-100',\n bgActiveDark: 'dark:bg-[#1e3a5f]',\n borderActive: 'border-[#bce4ff]',\n borderActiveDark: 'dark:border-[#1e3a5f]',\n // Table and chairs - Light: #0e79fd, Dark: #93d1fd\n table: 'bg-[#0e79fd]',\n tableDark: 'dark:bg-[#93d1fd]',\n chair: 'bg-[#0e79fd]',\n chairDark: 'dark:bg-[#93d1fd]',\n // Text (mismo color del estado - label está FUERA de la mesa según Figma)\n text: 'text-[#0e79fd]',\n textDark: 'dark:text-[#93d1fd]',\n // Focus ring\n focusRing: 'focus:ring-[#93d1fd]',\n focusRingDark: 'dark:focus:ring-[#0e79fd]',\n },\n busy: {\n // Enabled state - Light: #af460e, Dark: #f5a927\n border: 'border-[#af460e]',\n borderDark: 'dark:border-[#f5a927]',\n bgEnabled: 'bg-transparent',\n bgEnabledDark: 'dark:bg-transparent',\n // Actived state\n bgActive: 'bg-[#fed7aa]',\n bgActiveDark: 'dark:bg-[#5c3a1e]',\n borderActive: 'border-[#fed7aa]',\n borderActiveDark: 'dark:border-[#5c3a1e]',\n // Table and chairs - Light: #af460e, Dark: #f5a927\n table: 'bg-[#af460e]',\n tableDark: 'dark:bg-[#f5a927]',\n chair: 'bg-[#af460e]',\n chairDark: 'dark:bg-[#f5a927]',\n // Text (mismo color del estado - label está FUERA de la mesa según Figma)\n text: 'text-[#af460e]',\n textDark: 'dark:text-[#f5a927]',\n // Focus ring\n focusRing: 'focus:ring-[#f5a927]',\n focusRingDark: 'dark:focus:ring-[#af460e]',\n },\n reserved: {\n // Enabled state - Light: #7e22ce, Dark: #c084fc\n border: 'border-[#7e22ce]',\n borderDark: 'dark:border-[#c084fc]',\n bgEnabled: 'bg-transparent',\n bgEnabledDark: 'dark:bg-transparent',\n // Actived state\n bgActive: 'bg-[#e9d5ff]',\n bgActiveDark: 'dark:bg-[#3b1f5c]',\n borderActive: 'border-[#e9d5ff]',\n borderActiveDark: 'dark:border-[#3b1f5c]',\n // Table and chairs - Light: #7e22ce, Dark: #c084fc\n table: 'bg-[#7e22ce]',\n tableDark: 'dark:bg-[#c084fc]',\n chair: 'bg-[#7e22ce]',\n chairDark: 'dark:bg-[#c084fc]',\n // Text (mismo color del estado - label está FUERA de la mesa según Figma)\n text: 'text-[#7e22ce]',\n textDark: 'dark:text-[#c084fc]',\n // Focus ring\n focusRing: 'focus:ring-[#c084fc]',\n focusRingDark: 'dark:focus:ring-[#7e22ce]',\n },\n };\n\n // ===== CLASES DE FORMA (ESPECIFICACIONES EXACTAS DE FIGMA) =====\n const shapeClasses = {\n square: {\n container: 'rounded-[4px]',\n table: 'w-[64px] h-[64px] rounded-[4px]',\n },\n circle: {\n container: 'rounded-[9999px]',\n table: 'w-[64px] h-[64px] rounded-[9999px]',\n },\n rectangle: {\n container: 'rounded-[4px]',\n table: 'w-[80px] h-[64px] rounded-[4px]',\n },\n oval: {\n container: 'rounded-3xl',\n table: 'w-[80px] h-[64px] rounded-3xl',\n },\n };\n\n // ===== COMPONENTE SILLA (ESPECIFICACIONES EXACTAS DE FIGMA) =====\n const Chair: React.FC<{ rotation: number }> = ({ rotation }) => (\n <div\n className=\"w-[28px] h-[22px]\"\n style={{ transform: `rotate(${rotation}deg)` }}\n aria-hidden=\"true\"\n >\n {/* Respaldo (parte superior) - 72.73% height */}\n <div\n className={`\n absolute\n top-0\n left-0\n right-0\n h-[16px]\n rounded-t-[4px]\n ${statusColors[status].chair}\n ${statusColors[status].chairDark}\n `}\n />\n {/* Asiento (parte inferior) - 85.71% width, 63.64% height */}\n <div\n className={`\n absolute\n bottom-0\n left-[7.14%]\n right-[7.14%]\n h-[14px]\n rounded-b-[4px]\n ${statusColors[status].chair}\n ${statusColors[status].chairDark}\n `}\n />\n </div>\n );\n\n // ===== HANDLER DE CLICK =====\n const handleClick = () => {\n if (!disabled && onClick) {\n onClick();\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if ((e.key === 'Enter' || e.key === ' ') && !disabled && onClick) {\n e.preventDefault();\n onClick();\n }\n };\n\n // ===== CLASES DEL CONTAINER (160x160px según Figma) =====\n const containerClasses = [\n // Dimensiones exactas del container\n 'w-[160px]',\n 'h-[160px]',\n 'shrink-0',\n\n // Estructura\n 'relative',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'p-0',\n\n // Borde (2px según Figma)\n 'border-2',\n 'box-border',\n\n // Border radius (8px según Figma)\n 'rounded-[8px]',\n\n // Colores del borde y fondo según estado\n isActive ? statusColors[status].borderActive : statusColors[status].border,\n isActive ? statusColors[status].borderActiveDark : statusColors[status].borderDark,\n isActive ? statusColors[status].bgActive : statusColors[status].bgEnabled,\n isActive ? statusColors[status].bgActiveDark : statusColors[status].bgEnabledDark,\n\n // Focus rings adaptativos (siguiendo patrón de Button)\n 'focus:outline-hidden',\n 'focus:ring-2',\n statusColors[status].focusRing,\n statusColors[status].focusRingDark,\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-dark-bg-primary',\n\n // Transiciones\n 'transition-all',\n 'duration-150',\n\n // Interactividad\n onClick && !disabled ? 'cursor-pointer' : '',\n onClick && !disabled ? 'hover:scale-105' : '',\n onClick && !disabled ? 'active:scale-95' : '',\n disabled ? 'opacity-50 cursor-not-allowed' : '',\n\n // Clases adicionales\n className,\n ]\n .filter(Boolean)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n // ===== RENDER =====\n return (\n <button\n className={containerClasses}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n type=\"button\"\n aria-label={`Mesa ${tableNumber} - ${\n status === 'available' ? 'Disponible' : status === 'busy' ? 'Ocupada' : 'Reservada'\n }`}\n >\n {/* INNER CONTAINER (134x134px según Figma) */}\n <div className=\"flex flex-col gap-[4px] items-center justify-center w-[134px] h-[134px] shrink-0\">\n {/* FILA DE SILLAS SUPERIORES */}\n {showChairs && (chairs === 2 || chairs === 4 || chairs === 6 || chairs === 8) && (\n <div className=\"flex gap-[4px] items-center justify-center shrink-0\">\n {chairs >= 6 && (\n <>\n <Chair rotation={0} />\n <Chair rotation={0} />\n </>\n )}\n {chairs === 2 && <Chair rotation={0} />}\n {chairs === 4 && <Chair rotation={0} />}\n </div>\n )}\n\n {/* FILA CENTRAL CON MESA Y SILLAS LATERALES */}\n <div className=\"flex gap-[4px] items-center justify-center shrink-0\">\n {/* COLUMNA IZQUIERDA - SILLAS */}\n {showChairs && (chairs === 4 || chairs === 6 || chairs === 8) && (\n <div className=\"flex flex-col gap-[4px] items-start justify-center shrink-0\">\n {chairs >= 8 && (\n <>\n <Chair rotation={270} />\n <Chair rotation={270} />\n </>\n )}\n {(chairs === 4 || chairs === 6) && <Chair rotation={270} />}\n </div>\n )}\n\n {/* MESA (sin label - el label va fuera según Figma) */}\n <div className=\"flex flex-col gap-[4px] items-start justify-center shrink-0\">\n <div className=\"flex items-center shrink-0\">\n <div\n className={`\n ${shapeClasses[shape].table}\n ${statusColors[status].table}\n ${statusColors[status].tableDark}\n shrink-0\n `}\n />\n </div>\n </div>\n\n {/* COLUMNA DERECHA - SILLAS */}\n {showChairs && (chairs === 4 || chairs === 6 || chairs === 8) && (\n <div className=\"flex flex-col gap-[4px] items-start justify-center shrink-0\">\n {chairs >= 8 && (\n <>\n <Chair rotation={90} />\n <Chair rotation={90} />\n </>\n )}\n {(chairs === 4 || chairs === 6) && <Chair rotation={90} />}\n </div>\n )}\n </div>\n\n {/* FILA DE SILLAS INFERIORES */}\n {showChairs && (chairs === 2 || chairs === 4 || chairs === 6 || chairs === 8) && (\n <div className=\"flex gap-[4px] items-center justify-center shrink-0\">\n {chairs >= 6 && (\n <>\n <Chair rotation={180} />\n <Chair rotation={180} />\n </>\n )}\n {chairs === 2 && <Chair rotation={180} />}\n {chairs === 4 && <Chair rotation={180} />}\n </div>\n )}\n </div>\n\n {/* LABEL DE NÚMERO DE MESA - Debajo del conjunto mesa+sillas según Figma */}\n <div\n className={`\n flex\n flex-col\n justify-center\n leading-0\n not-italic\n text-ellipsis\n overflow-hidden\n min-w-full\n text-center\n whitespace-nowrap\n shrink-0\n text-[10px]\n font-normal\n ${statusColors[status].text}\n ${statusColors[status].textDark}\n `}\n >\n <p className=\"leading-[12px] text-ellipsis overflow-hidden\">\n Mesa {tableNumber}\n </p>\n {children}\n </div>\n </button>\n );\n};\n","import React from 'react';\n\n/**\n * Icono de sobre (envelope) para el input de email\n */\nexport const EnvelopeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z\" />\n <path d=\"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z\" />\n </svg>\n);\n\n/**\n * Icono de candado cerrado (lock) para el input de contraseña\n */\nexport const LockClosedIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Icono de ojo (eye) para mostrar/ocultar contraseña\n */\nexport const EyeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\" />\n <path\n fillRule=\"evenodd\"\n d=\"M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .56A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Logo de Siesa\n */\nexport const SiesaLogo: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n width=\"200\"\n height=\"50\"\n viewBox=\"0 0 200 50\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n {/* Símbolo de Siesa (cuadrados azules) */}\n <rect x=\"0\" y=\"0\" width=\"15\" height=\"20\" fill=\"#0e79fd\" />\n <rect x=\"0\" y=\"30\" width=\"10\" height=\"20\" fill=\"#0e79fd\" />\n <rect x=\"20\" y=\"0\" width=\"15\" height=\"20\" fill=\"#0e79fd\" />\n <rect x=\"30\" y=\"30\" width=\"10\" height=\"20\" fill=\"#0e79fd\" />\n\n {/* Texto \"Siesa\" */}\n <text\n x=\"68\"\n y=\"35\"\n fontFamily=\"SiesaBT, sans-serif\"\n fontSize=\"32\"\n fontWeight=\"400\"\n fill=\"#0e79fd\"\n >\n Siesa\n </text>\n </svg>\n);\n","import React, { useState } from 'react';\nimport type { FormEvent } from 'react';\nimport type { LoginViewProps } from './LoginView.types';\nimport { EnvelopeIcon, LockClosedIcon, EyeIcon } from './icons';\n\n/**\n * LoginView - Vista de inicio de sesión del sistema Siesa\n *\n * Vista completa de login con formulario de autenticación que incluye:\n * - Logo de Siesa\n * - Campos de email y contraseña\n * - Opción de \"olvidé mi contraseña\"\n * - Link para crear cuenta nueva\n * - Fondo decorativo opcional\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels y manejo de formulario semántico\n * - Validación de email básica\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n *\n * @example\n * ```tsx\n * <LoginView\n * onSubmit={(email, password) => console.log('Login', email, password)}\n * onForgotPassword={() => console.log('Forgot password')}\n * onSignUp={() => console.log('Sign up')}\n * />\n * ```\n */\nexport const LoginView: React.FC<LoginViewProps> = ({\n onSubmit,\n onForgotPassword,\n onSignUp,\n isLoading = false,\n errorMessage,\n className = '',\n showBackground = true,\n variant = 'responsive',\n}) => {\n // ===== ESTADO LOCAL =====\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [showPassword, setShowPassword] = useState(false);\n const [emailError, setEmailError] = useState('');\n\n // ===== HANDLERS =====\n const handleSubmit = (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n\n // Validación básica de email\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(email)) {\n setEmailError('Por favor ingresa un email válido');\n return;\n }\n\n setEmailError('');\n onSubmit?.(email, password);\n };\n\n const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEmail(e.target.value);\n if (emailError) setEmailError('');\n };\n\n const togglePasswordVisibility = () => {\n setShowPassword(!showPassword);\n };\n\n return (\n <div\n className={[\n 'relative',\n 'min-h-screen',\n 'w-full',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'box-border',\n // Mobile: sin padding en el wrapper (el padding está en el contenedor)\n 'p-0',\n // Desktop: padding para centrar el card\n 'md:p-4',\n className,\n ].join(' ')}\n >\n {/* ===== FONDO DECORATIVO ===== */}\n {showBackground && (\n <div className=\"absolute inset-0 pointer-events-none\" aria-hidden=\"true\">\n <div className=\"absolute inset-0 bg-primary-custom-100 dark:bg-dark-bg-custom\" />\n <img\n src=\"/bg_siesa.png\"\n alt=\"\"\n className=\"absolute inset-0 w-full h-full object-cover opacity-10\"\n />\n </div>\n )}\n\n {/* ===== CONTENEDOR PRINCIPAL ===== */}\n <div\n className={[\n // Clases base comunes\n 'relative',\n 'box-border',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'gap-4',\n 'p-16',\n 'shrink-0',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n\n // Clases específicas según variant\n ...(variant === 'mobile' ? [\n // Forzar mobile: sin efectos de card\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n ] : variant === 'desktop' ? [\n // Forzar desktop: con efectos de card\n 'w-[400px]',\n 'h-auto',\n 'rounded-2xl',\n 'shadow-lg',\n 'dark:shadow-2xl',\n 'overflow-clip',\n 'border',\n 'border-transparent',\n 'dark:border-dark-border-primary',\n ] : [\n // Responsive: cambia según viewport\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n 'md:w-[400px]',\n 'md:h-auto',\n 'md:rounded-2xl',\n 'md:shadow-lg',\n 'md:dark:shadow-2xl',\n 'md:overflow-clip',\n 'md:border',\n 'md:border-transparent',\n 'md:dark:border-dark-border-primary',\n ]),\n ].join(' ')}\n >\n {/* ===== LOGO ===== */}\n <div className=\"w-full flex flex-col items-center pb-4\">\n <img\n src=\"/.Siesa Logo.png\"\n alt=\"Siesa\"\n className=\"w-[200px] h-[50px] object-contain\"\n />\n </div>\n\n {/* ===== HEADING ===== */}\n <div className=\"w-full text-center\">\n <h1\n className={[\n 'text-[20px]',\n 'leading-[28px]',\n 'font-bold',\n 'tracking-[-0.5px]',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Iniciar Sesión\n </h1>\n <p\n className={[\n 'text-[12px]',\n 'leading-[16px]',\n 'font-normal',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Inicia sesión ingresando con tu correo electrónico y contraseña.\n </p>\n </div>\n\n {/* ===== MENSAJE DE ERROR GENERAL ===== */}\n {errorMessage && (\n <div\n className={[\n 'w-full',\n 'p-3',\n 'bg-error-bg',\n 'dark:bg-error-bg',\n 'border',\n 'border-error-border',\n 'dark:border-error-border',\n 'rounded-md',\n 'text-error-content',\n 'dark:text-error-content',\n 'text-sm',\n ].join(' ')}\n role=\"alert\"\n >\n {errorMessage}\n </div>\n )}\n\n {/* ===== FORMULARIO ===== */}\n <form onSubmit={handleSubmit} className=\"w-full flex flex-col gap-2\">\n {/* Email Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <label\n htmlFor=\"email-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Correo Electrónico <span className=\"text-red-600\">*</span>\n </label>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <EnvelopeIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"email-input\"\n type=\"email\"\n placeholder=\"ejemplo@miempresa.com\"\n value={email}\n onChange={handleEmailChange}\n disabled={isLoading}\n required\n autoComplete=\"email\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-3',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n emailError ? 'border-error-border!' : '',\n ].filter(Boolean).join(' ')}\n />\n </div>\n {emailError && (\n <p className=\"text-xs text-error-content dark:text-error-content\">\n {emailError}\n </p>\n )}\n </div>\n\n {/* Password Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <div className=\"flex items-center justify-between\">\n <label\n htmlFor=\"password-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Contraseña <span className=\"text-red-600\">*</span>\n </label>\n <button\n type=\"button\"\n onClick={onForgotPassword}\n className=\"text-[12px] leading-4 font-bold text-primary-custom-600 dark:text-[#93d1fd] hover:underline transition-all duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-[#93d1fd] rounded-sm px-1\"\n >\n Olvidé mi Contraseña\n </button>\n </div>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <LockClosedIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"password-input\"\n type={showPassword ? 'text' : 'password'}\n placeholder=\"••••••••\"\n value={password}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.target.value)}\n disabled={isLoading}\n required\n autoComplete=\"current-password\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-10',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n ].join(' ')}\n />\n <button\n type=\"button\"\n onClick={togglePasswordVisibility}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 opacity-50 hover:opacity-100 text-content-tertiary dark:text-dark-content-tertiary transition-opacity duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-dark-border-custom rounded-sm p-1\"\n aria-label={showPassword ? 'Ocultar contraseña' : 'Mostrar contraseña'}\n >\n <EyeIcon className=\"w-4 h-4\" />\n </button>\n </div>\n </div>\n\n {/* Submit Button */}\n <button\n type=\"submit\"\n disabled={isLoading || !email || !password}\n className={[\n 'relative',\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-primary-inverse-content',\n 'dark:text-[#0e79fd]',\n 'bg-[#0e79fd]',\n 'dark:bg-dark-bg-inverse',\n 'border',\n 'border-[#3c9bf6]',\n 'dark:border-[#93d1fd]',\n 'rounded-md',\n 'shadow-button-inset',\n 'hover:bg-primary-custom-500',\n 'dark:hover:bg-[#93d1fd]',\n 'active:scale-95',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n 'disabled:opacity-50',\n 'disabled:cursor-not-allowed',\n ].join(' ')}\n >\n {isLoading ? 'Iniciando sesión...' : 'Iniciar Sesión'}\n </button>\n </form>\n\n {/* ===== SIGN UP LINK ===== */}\n <button\n type=\"button\"\n onClick={onSignUp}\n className={[\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-[#0e79fd]',\n 'dark:text-[#93d1fd]',\n 'hover:bg-primary-custom-100',\n 'dark:hover:bg-[#93d1fd]/10',\n 'rounded-md',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n ].join(' ')}\n >\n ¿No tienes una cuenta?\n </button>\n </div>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * Icono de círculo de usuario para el input de nombre\n */\nexport const UserCircleIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0Zm-5-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 9c-1.825 0-3.422.977-4.295 2.437A5.49 5.49 0 0 0 8 13.5a5.49 5.49 0 0 0 4.294-2.063A4.997 4.997 0 0 0 8 9Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Icono de sobre (envelope) para el input de email\n */\nexport const EnvelopeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z\" />\n <path d=\"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z\" />\n </svg>\n);\n\n/**\n * Icono de candado cerrado (lock) para el input de contraseña\n */\nexport const LockClosedIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Icono de ojo (eye) para mostrar/ocultar contraseña\n */\nexport const EyeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\" />\n <path\n fillRule=\"evenodd\"\n d=\"M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .56A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n","import React, { useState } from 'react';\nimport type { FormEvent } from 'react';\nimport type { SignUpViewProps } from './SignUpView.types';\nimport { UserCircleIcon, EnvelopeIcon, LockClosedIcon, EyeIcon } from './icons';\n\n/**\n * SignUpView - Vista de registro del sistema Siesa\n *\n * Vista completa de registro con formulario que incluye:\n * - Logo de Siesa\n * - Campos de nombre, email y contraseña\n * - Botón de registro\n * - Link para iniciar sesión\n * - Texto de términos y condiciones\n * - Fondo decorativo opcional\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels y manejo de formulario semántico\n * - Validación de email básica\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n *\n * @example\n * ```tsx\n * <SignUpView\n * onSubmit={(name, email, password) => console.log('Sign up', name, email, password)}\n * onSignIn={() => console.log('Go to sign in')}\n * onTermsClick={() => console.log('View terms')}\n * onPrivacyClick={() => console.log('View privacy')}\n * />\n * ```\n */\nexport const SignUpView: React.FC<SignUpViewProps> = ({\n onSubmit,\n onSignIn,\n onTermsClick,\n onPrivacyClick,\n isLoading = false,\n errorMessage,\n className = '',\n showBackground = true,\n variant = 'responsive',\n}) => {\n // ===== ESTADO LOCAL =====\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [showPassword, setShowPassword] = useState(false);\n const [emailError, setEmailError] = useState('');\n\n // ===== HANDLERS =====\n const handleSubmit = (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n\n // Validación básica de email\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(email)) {\n setEmailError('Por favor ingresa un email válido');\n return;\n }\n\n setEmailError('');\n onSubmit?.(name, email, password);\n };\n\n const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEmail(e.target.value);\n if (emailError) setEmailError('');\n };\n\n const togglePasswordVisibility = () => {\n setShowPassword(!showPassword);\n };\n\n return (\n <div\n className={[\n 'relative',\n 'min-h-screen',\n 'w-full',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'box-border',\n // Mobile: sin padding en el wrapper\n 'p-0',\n // Desktop: padding para centrar el card\n 'md:p-4',\n className,\n ].join(' ')}\n >\n {/* ===== FONDO DECORATIVO ===== */}\n {showBackground && (\n <div className=\"absolute inset-0 pointer-events-none\" aria-hidden=\"true\">\n <div className=\"absolute inset-0 bg-primary-custom-100 dark:bg-dark-bg-custom\" />\n <img\n src=\"/bg_siesa.png\"\n alt=\"\"\n className=\"absolute inset-0 w-full h-full object-cover opacity-10\"\n />\n </div>\n )}\n\n {/* ===== CONTENEDOR PRINCIPAL ===== */}\n <div\n className={[\n // Clases base comunes\n 'relative',\n 'box-border',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'gap-4',\n 'p-16',\n 'shrink-0',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n\n // Clases específicas según variant\n ...(variant === 'mobile' ? [\n // Forzar mobile: sin efectos de card\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n ] : variant === 'desktop' ? [\n // Forzar desktop: con efectos de card\n 'w-[400px]',\n 'h-auto',\n 'rounded-2xl',\n 'shadow-lg',\n 'dark:shadow-2xl',\n 'overflow-clip',\n 'border',\n 'border-transparent',\n 'dark:border-dark-border-primary',\n ] : [\n // Responsive: cambia según viewport\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n 'md:w-[400px]',\n 'md:h-auto',\n 'md:rounded-2xl',\n 'md:shadow-lg',\n 'md:dark:shadow-2xl',\n 'md:overflow-clip',\n 'md:border',\n 'md:border-transparent',\n 'md:dark:border-dark-border-primary',\n ]),\n ].join(' ')}\n >\n {/* ===== LOGO ===== */}\n <div className=\"w-full flex flex-col items-center pb-4\">\n <img\n src=\"/.Siesa Logo.png\"\n alt=\"Siesa\"\n className=\"w-[200px] h-[50px] object-contain\"\n />\n </div>\n\n {/* ===== HEADING ===== */}\n <div className=\"w-full text-center\">\n <h1\n className={[\n 'text-[20px]',\n 'leading-[28px]',\n 'font-bold',\n 'tracking-[-0.5px]',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Crear Cuenta\n </h1>\n <p\n className={[\n 'text-[12px]',\n 'leading-[16px]',\n 'font-normal',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Ingresa todos los datos para crear tu cuenta.\n </p>\n </div>\n\n {/* ===== MENSAJE DE ERROR GENERAL ===== */}\n {errorMessage && (\n <div\n className={[\n 'w-full',\n 'p-3',\n 'bg-error-bg',\n 'dark:bg-error-bg',\n 'border',\n 'border-error-border',\n 'dark:border-error-border',\n 'rounded-md',\n 'text-error-content',\n 'dark:text-error-content',\n 'text-sm',\n ].join(' ')}\n role=\"alert\"\n >\n {errorMessage}\n </div>\n )}\n\n {/* ===== FORMULARIO ===== */}\n <form onSubmit={handleSubmit} className=\"w-full flex flex-col gap-2\">\n {/* Name Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <label\n htmlFor=\"name-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Nombre <span className=\"text-red-600\">*</span>\n </label>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <UserCircleIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"name-input\"\n type=\"text\"\n placeholder=\"Juan Pérez\"\n value={name}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setName(e.target.value)}\n disabled={isLoading}\n required\n autoComplete=\"name\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-3',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n ].join(' ')}\n />\n </div>\n </div>\n\n {/* Email Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <label\n htmlFor=\"email-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Correo Electrónico <span className=\"text-red-600\">*</span>\n </label>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <EnvelopeIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"email-input\"\n type=\"email\"\n placeholder=\"ejemplo@miempresa.com\"\n value={email}\n onChange={handleEmailChange}\n disabled={isLoading}\n required\n autoComplete=\"email\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-3',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n emailError ? 'border-error-border!' : '',\n ].filter(Boolean).join(' ')}\n />\n </div>\n {emailError && (\n <p className=\"text-xs text-error-content dark:text-error-content\">\n {emailError}\n </p>\n )}\n </div>\n\n {/* Password Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <label\n htmlFor=\"password-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Contraseña <span className=\"text-red-600\">*</span>\n </label>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <LockClosedIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"password-input\"\n type={showPassword ? 'text' : 'password'}\n placeholder=\"••••••••\"\n value={password}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.target.value)}\n disabled={isLoading}\n required\n autoComplete=\"new-password\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-10',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n ].join(' ')}\n />\n <button\n type=\"button\"\n onClick={togglePasswordVisibility}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 opacity-50 hover:opacity-100 text-content-tertiary dark:text-dark-content-tertiary transition-opacity duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-dark-border-custom rounded-sm p-1\"\n aria-label={showPassword ? 'Ocultar contraseña' : 'Mostrar contraseña'}\n >\n <EyeIcon className=\"w-4 h-4\" />\n </button>\n </div>\n </div>\n\n {/* Submit Button */}\n <button\n type=\"submit\"\n disabled={isLoading || !name || !email || !password}\n className={[\n 'relative',\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-primary-inverse-content',\n 'dark:text-[#0e79fd]',\n 'bg-[#0e79fd]',\n 'dark:bg-dark-bg-inverse',\n 'border',\n 'border-[#3c9bf6]',\n 'dark:border-[#93d1fd]',\n 'rounded-md',\n 'shadow-button-inset',\n 'hover:bg-primary-custom-500',\n 'dark:hover:bg-[#93d1fd]',\n 'active:scale-95',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n 'disabled:opacity-50',\n 'disabled:cursor-not-allowed',\n ].join(' ')}\n >\n {isLoading ? 'Registrando...' : 'Registrarse'}\n </button>\n </form>\n\n {/* ===== SIGN IN LINK ===== */}\n <button\n type=\"button\"\n onClick={onSignIn}\n className={[\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-[#0e79fd]',\n 'dark:text-[#93d1fd]',\n 'hover:bg-primary-custom-100',\n 'dark:hover:bg-[#93d1fd]/10',\n 'rounded-md',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n ].join(' ')}\n >\n Ya tengo una cuenta\n </button>\n\n {/* ===== TÉRMINOS Y CONDICIONES ===== */}\n <div className=\"w-full text-center\">\n <p\n className={[\n 'text-[12px]',\n 'leading-[16px]',\n 'font-normal',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Al registrarse, estás aceptando nuestras{' '}\n <button\n type=\"button\"\n onClick={onTermsClick}\n className=\"text-[#0e79fd] dark:text-[#93d1fd] underline hover:no-underline focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-[#93d1fd] rounded-sm\"\n >\n Condiciones de Uso\n </button>\n {' '}y nuestras{' '}\n <button\n type=\"button\"\n onClick={onPrivacyClick}\n className=\"text-[#0e79fd] dark:text-[#93d1fd] underline hover:no-underline focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-[#93d1fd] rounded-sm\"\n >\n Políticas de Privacidad\n </button>\n .\n </p>\n </div>\n </div>\n </div>\n );\n};\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\nconst toCamelCase = (string) => string.replace(\n /^([A-Z])|[\\s-_]+(\\w)/g,\n (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()\n);\nconst toPascalCase = (string) => {\n const camelCase = toCamelCase(string);\n return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n};\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n}).join(\" \").trim();\nconst hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith(\"aria-\") || prop === \"role\" || prop === \"title\") {\n return true;\n }\n }\n};\n\nexport { hasA11yProp, mergeClasses, toCamelCase, toKebabCase, toPascalCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { mergeClasses, hasA11yProp } from './shared/src/utils.js';\n\nconst Icon = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n iconNode,\n ...rest\n }, ref) => createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: mergeClasses(\"lucide\", className),\n ...!children && !hasA11yProp(rest) && { \"aria-hidden\": \"true\" },\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n )\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses, toKebabCase, toPascalCase } from './shared/src/utils.js';\nimport Icon from './Icon.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(\n `lucide-${toKebabCase(toPascalCase(iconName))}`,\n `lucide-${iconName}`,\n className\n ),\n ...props\n })\n );\n Component.displayName = toPascalCase(iconName);\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]];\nconst ChevronDown = createLucideIcon(\"chevron-down\", __iconNode);\n\nexport { __iconNode, ChevronDown as default };\n//# sourceMappingURL=chevron-down.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]];\nconst LoaderCircle = createLucideIcon(\"loader-circle\", __iconNode);\n\nexport { __iconNode, LoaderCircle as default };\n//# sourceMappingURL=loader-circle.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m21 21-4.34-4.34\", key: \"14j7rj\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }]\n];\nconst Search = createLucideIcon(\"search\", __iconNode);\n\nexport { __iconNode, Search as default };\n//# sourceMappingURL=search.js.map\n","/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n];\nconst X = createLucideIcon(\"x\", __iconNode);\n\nexport { __iconNode, X as default };\n//# sourceMappingURL=x.js.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","/**\n * Concatenates two arrays faster than the array spread operator.\n */\nconst concatArrays = (array1, array2) => {\n // Pre-allocate for better V8 optimization\n const combinedArray = new Array(array1.length + array2.length);\n for (let i = 0; i < array1.length; i++) {\n combinedArray[i] = array1[i];\n }\n for (let i = 0; i < array2.length; i++) {\n combinedArray[array1.length + i] = array2[i];\n }\n return combinedArray;\n};\n\n// Factory function ensures consistent object shapes\nconst createClassValidatorObject = (classGroupId, validator) => ({\n classGroupId,\n validator\n});\n// Factory ensures consistent ClassPartObject shape\nconst createClassPartObject = (nextPart = new Map(), validators = null, classGroupId) => ({\n nextPart,\n validators,\n classGroupId\n});\nconst CLASS_PART_SEPARATOR = '-';\nconst EMPTY_CONFLICTS = [];\n// I use two dots here because one dot is used as prefix for class groups in plugins\nconst ARBITRARY_PROPERTY_PREFIX = 'arbitrary..';\nconst createClassGroupUtils = config => {\n const classMap = createClassMap(config);\n const {\n conflictingClassGroups,\n conflictingClassGroupModifiers\n } = config;\n const getClassGroupId = className => {\n if (className.startsWith('[') && className.endsWith(']')) {\n return getGroupIdForArbitraryProperty(className);\n }\n const classParts = className.split(CLASS_PART_SEPARATOR);\n // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and skip it.\n const startIndex = classParts[0] === '' && classParts.length > 1 ? 1 : 0;\n return getGroupRecursive(classParts, startIndex, classMap);\n };\n const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {\n if (hasPostfixModifier) {\n const modifierConflicts = conflictingClassGroupModifiers[classGroupId];\n const baseConflicts = conflictingClassGroups[classGroupId];\n if (modifierConflicts) {\n if (baseConflicts) {\n // Merge base conflicts with modifier conflicts\n return concatArrays(baseConflicts, modifierConflicts);\n }\n // Only modifier conflicts\n return modifierConflicts;\n }\n // Fall back to without postfix if no modifier conflicts\n return baseConflicts || EMPTY_CONFLICTS;\n }\n return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;\n };\n return {\n getClassGroupId,\n getConflictingClassGroupIds\n };\n};\nconst getGroupRecursive = (classParts, startIndex, classPartObject) => {\n const classPathsLength = classParts.length - startIndex;\n if (classPathsLength === 0) {\n return classPartObject.classGroupId;\n }\n const currentClassPart = classParts[startIndex];\n const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);\n if (nextClassPartObject) {\n const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);\n if (result) return result;\n }\n const validators = classPartObject.validators;\n if (validators === null) {\n return undefined;\n }\n // Build classRest string efficiently by joining from startIndex onwards\n const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);\n const validatorsLength = validators.length;\n for (let i = 0; i < validatorsLength; i++) {\n const validatorObj = validators[i];\n if (validatorObj.validator(classRest)) {\n return validatorObj.classGroupId;\n }\n }\n return undefined;\n};\n/**\n * Get the class group ID for an arbitrary property.\n *\n * @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.\n */\nconst getGroupIdForArbitraryProperty = className => className.slice(1, -1).indexOf(':') === -1 ? undefined : (() => {\n const content = className.slice(1, -1);\n const colonIndex = content.indexOf(':');\n const property = content.slice(0, colonIndex);\n return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined;\n})();\n/**\n * Exported for testing only\n */\nconst createClassMap = config => {\n const {\n theme,\n classGroups\n } = config;\n return processClassGroups(classGroups, theme);\n};\n// Split into separate functions to maintain monomorphic call sites\nconst processClassGroups = (classGroups, theme) => {\n const classMap = createClassPartObject();\n for (const classGroupId in classGroups) {\n const group = classGroups[classGroupId];\n processClassesRecursively(group, classMap, classGroupId, theme);\n }\n return classMap;\n};\nconst processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {\n const len = classGroup.length;\n for (let i = 0; i < len; i++) {\n const classDefinition = classGroup[i];\n processClassDefinition(classDefinition, classPartObject, classGroupId, theme);\n }\n};\n// Split into separate functions for each type to maintain monomorphic call sites\nconst processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {\n if (typeof classDefinition === 'string') {\n processStringDefinition(classDefinition, classPartObject, classGroupId);\n return;\n }\n if (typeof classDefinition === 'function') {\n processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);\n return;\n }\n processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);\n};\nconst processStringDefinition = (classDefinition, classPartObject, classGroupId) => {\n const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);\n classPartObjectToEdit.classGroupId = classGroupId;\n};\nconst processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {\n if (isThemeGetter(classDefinition)) {\n processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);\n return;\n }\n if (classPartObject.validators === null) {\n classPartObject.validators = [];\n }\n classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));\n};\nconst processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {\n const entries = Object.entries(classDefinition);\n const len = entries.length;\n for (let i = 0; i < len; i++) {\n const [key, value] = entries[i];\n processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);\n }\n};\nconst getPart = (classPartObject, path) => {\n let current = classPartObject;\n const parts = path.split(CLASS_PART_SEPARATOR);\n const len = parts.length;\n for (let i = 0; i < len; i++) {\n const part = parts[i];\n let next = current.nextPart.get(part);\n if (!next) {\n next = createClassPartObject();\n current.nextPart.set(part, next);\n }\n current = next;\n }\n return current;\n};\n// Type guard maintains monomorphic check\nconst isThemeGetter = func => 'isThemeGetter' in func && func.isThemeGetter === true;\n\n// LRU cache implementation using plain objects for simplicity\nconst createLruCache = maxCacheSize => {\n if (maxCacheSize < 1) {\n return {\n get: () => undefined,\n set: () => {}\n };\n }\n let cacheSize = 0;\n let cache = Object.create(null);\n let previousCache = Object.create(null);\n const update = (key, value) => {\n cache[key] = value;\n cacheSize++;\n if (cacheSize > maxCacheSize) {\n cacheSize = 0;\n previousCache = cache;\n cache = Object.create(null);\n }\n };\n return {\n get(key) {\n let value = cache[key];\n if (value !== undefined) {\n return value;\n }\n if ((value = previousCache[key]) !== undefined) {\n update(key, value);\n return value;\n }\n },\n set(key, value) {\n if (key in cache) {\n cache[key] = value;\n } else {\n update(key, value);\n }\n }\n };\n};\nconst IMPORTANT_MODIFIER = '!';\nconst MODIFIER_SEPARATOR = ':';\nconst EMPTY_MODIFIERS = [];\n// Pre-allocated result object shape for consistency\nconst createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition,\n isExternal\n});\nconst createParseClassName = config => {\n const {\n prefix,\n experimentalParseClassName\n } = config;\n /**\n * Parse class name into parts.\n *\n * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js\n */\n let parseClassName = className => {\n // Use simple array with push for better performance\n const modifiers = [];\n let bracketDepth = 0;\n let parenDepth = 0;\n let modifierStart = 0;\n let postfixModifierPosition;\n const len = className.length;\n for (let index = 0; index < len; index++) {\n const currentCharacter = className[index];\n if (bracketDepth === 0 && parenDepth === 0) {\n if (currentCharacter === MODIFIER_SEPARATOR) {\n modifiers.push(className.slice(modifierStart, index));\n modifierStart = index + 1;\n continue;\n }\n if (currentCharacter === '/') {\n postfixModifierPosition = index;\n continue;\n }\n }\n if (currentCharacter === '[') bracketDepth++;else if (currentCharacter === ']') bracketDepth--;else if (currentCharacter === '(') parenDepth++;else if (currentCharacter === ')') parenDepth--;\n }\n const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);\n // Inline important modifier check\n let baseClassName = baseClassNameWithImportantModifier;\n let hasImportantModifier = false;\n if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {\n baseClassName = baseClassNameWithImportantModifier.slice(0, -1);\n hasImportantModifier = true;\n } else if (\n /**\n * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.\n * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864\n */\n baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {\n baseClassName = baseClassNameWithImportantModifier.slice(1);\n hasImportantModifier = true;\n }\n const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;\n return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);\n };\n if (prefix) {\n const fullPrefix = prefix + MODIFIER_SEPARATOR;\n const parseClassNameOriginal = parseClassName;\n parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, undefined, true);\n }\n if (experimentalParseClassName) {\n const parseClassNameOriginal = parseClassName;\n parseClassName = className => experimentalParseClassName({\n className,\n parseClassName: parseClassNameOriginal\n });\n }\n return parseClassName;\n};\n\n/**\n * Sorts modifiers according to following schema:\n * - Predefined modifiers are sorted alphabetically\n * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it\n */\nconst createSortModifiers = config => {\n // Pre-compute weights for all known modifiers for O(1) comparison\n const modifierWeights = new Map();\n // Assign weights to sensitive modifiers (highest priority, but preserve order)\n config.orderSensitiveModifiers.forEach((mod, index) => {\n modifierWeights.set(mod, 1000000 + index); // High weights for sensitive mods\n });\n return modifiers => {\n const result = [];\n let currentSegment = [];\n // Process modifiers in one pass\n for (let i = 0; i < modifiers.length; i++) {\n const modifier = modifiers[i];\n // Check if modifier is sensitive (starts with '[' or in orderSensitiveModifiers)\n const isArbitrary = modifier[0] === '[';\n const isOrderSensitive = modifierWeights.has(modifier);\n if (isArbitrary || isOrderSensitive) {\n // Sort and flush current segment alphabetically\n if (currentSegment.length > 0) {\n currentSegment.sort();\n result.push(...currentSegment);\n currentSegment = [];\n }\n result.push(modifier);\n } else {\n // Regular modifier - add to current segment for batch sorting\n currentSegment.push(modifier);\n }\n }\n // Sort and add any remaining segment items\n if (currentSegment.length > 0) {\n currentSegment.sort();\n result.push(...currentSegment);\n }\n return result;\n };\n};\nconst createConfigUtils = config => ({\n cache: createLruCache(config.cacheSize),\n parseClassName: createParseClassName(config),\n sortModifiers: createSortModifiers(config),\n ...createClassGroupUtils(config)\n});\nconst SPLIT_CLASSES_REGEX = /\\s+/;\nconst mergeClassList = (classList, configUtils) => {\n const {\n parseClassName,\n getClassGroupId,\n getConflictingClassGroupIds,\n sortModifiers\n } = configUtils;\n /**\n * Set of classGroupIds in following format:\n * `{importantModifier}{variantModifiers}{classGroupId}`\n * @example 'float'\n * @example 'hover:focus:bg-color'\n * @example 'md:!pr'\n */\n const classGroupsInConflict = [];\n const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);\n let result = '';\n for (let index = classNames.length - 1; index >= 0; index -= 1) {\n const originalClassName = classNames[index];\n const {\n isExternal,\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n } = parseClassName(originalClassName);\n if (isExternal) {\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n let hasPostfixModifier = !!maybePostfixModifierPosition;\n let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);\n if (!classGroupId) {\n if (!hasPostfixModifier) {\n // Not a Tailwind class\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n classGroupId = getClassGroupId(baseClassName);\n if (!classGroupId) {\n // Not a Tailwind class\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n hasPostfixModifier = false;\n }\n // Fast path: skip sorting for empty or single modifier\n const variantModifier = modifiers.length === 0 ? '' : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(':');\n const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;\n const classId = modifierId + classGroupId;\n if (classGroupsInConflict.indexOf(classId) > -1) {\n // Tailwind class omitted due to conflict\n continue;\n }\n classGroupsInConflict.push(classId);\n const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);\n for (let i = 0; i < conflictGroups.length; ++i) {\n const group = conflictGroups[i];\n classGroupsInConflict.push(modifierId + group);\n }\n // Tailwind class not in conflict\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n }\n return result;\n};\n\n/**\n * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.\n *\n * Specifically:\n * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js\n * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts\n *\n * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)\n */\nconst twJoin = (...classLists) => {\n let index = 0;\n let argument;\n let resolvedValue;\n let string = '';\n while (index < classLists.length) {\n if (argument = classLists[index++]) {\n if (resolvedValue = toValue(argument)) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n};\nconst toValue = mix => {\n // Fast path for strings\n if (typeof mix === 'string') {\n return mix;\n }\n let resolvedValue;\n let string = '';\n for (let k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if (resolvedValue = toValue(mix[k])) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n};\nconst createTailwindMerge = (createConfigFirst, ...createConfigRest) => {\n let configUtils;\n let cacheGet;\n let cacheSet;\n let functionToCall;\n const initTailwindMerge = classList => {\n const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());\n configUtils = createConfigUtils(config);\n cacheGet = configUtils.cache.get;\n cacheSet = configUtils.cache.set;\n functionToCall = tailwindMerge;\n return tailwindMerge(classList);\n };\n const tailwindMerge = classList => {\n const cachedResult = cacheGet(classList);\n if (cachedResult) {\n return cachedResult;\n }\n const result = mergeClassList(classList, configUtils);\n cacheSet(classList, result);\n return result;\n };\n functionToCall = initTailwindMerge;\n return (...args) => functionToCall(twJoin(...args));\n};\nconst fallbackThemeArr = [];\nconst fromTheme = key => {\n const themeGetter = theme => theme[key] || fallbackThemeArr;\n themeGetter.isThemeGetter = true;\n return themeGetter;\n};\nconst arbitraryValueRegex = /^\\[(?:(\\w[\\w-]*):)?(.+)\\]$/i;\nconst arbitraryVariableRegex = /^\\((?:(\\w[\\w-]*):)?(.+)\\)$/i;\nconst fractionRegex = /^\\d+\\/\\d+$/;\nconst tshirtUnitRegex = /^(\\d+(\\.\\d+)?)?(xs|sm|md|lg|xl)$/;\nconst lengthUnitRegex = /\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\b(calc|min|max|clamp)\\(.+\\)|^0$/;\nconst colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\\(.+\\)$/;\n// Shadow always begins with x and y offset separated by underscore optionally prepended by inset\nconst shadowRegex = /^(inset_)?-?((\\d+)?\\.?(\\d+)[a-z]+|0)_-?((\\d+)?\\.?(\\d+)[a-z]+|0)/;\nconst imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\(.+\\)$/;\nconst isFraction = value => fractionRegex.test(value);\nconst isNumber = value => !!value && !Number.isNaN(Number(value));\nconst isInteger = value => !!value && Number.isInteger(Number(value));\nconst isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1));\nconst isTshirtSize = value => tshirtUnitRegex.test(value);\nconst isAny = () => true;\nconst isLengthOnly = value =>\n// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.\n// For example, `hsl(0 0% 0%)` would be classified as a length without this check.\n// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.\nlengthUnitRegex.test(value) && !colorFunctionRegex.test(value);\nconst isNever = () => false;\nconst isShadow = value => shadowRegex.test(value);\nconst isImage = value => imageRegex.test(value);\nconst isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value);\nconst isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever);\nconst isArbitraryValue = value => arbitraryValueRegex.test(value);\nconst isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);\nconst isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);\nconst isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);\nconst isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);\nconst isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);\nconst isArbitraryVariable = value => arbitraryVariableRegex.test(value);\nconst isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);\nconst isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);\nconst isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition);\nconst isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);\nconst isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage);\nconst isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true);\n// Helpers\nconst getIsArbitraryValue = (value, testLabel, testValue) => {\n const result = arbitraryValueRegex.exec(value);\n if (result) {\n if (result[1]) {\n return testLabel(result[1]);\n }\n return testValue(result[2]);\n }\n return false;\n};\nconst getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {\n const result = arbitraryVariableRegex.exec(value);\n if (result) {\n if (result[1]) {\n return testLabel(result[1]);\n }\n return shouldMatchNoLabel;\n }\n return false;\n};\n// Labels\nconst isLabelPosition = label => label === 'position' || label === 'percentage';\nconst isLabelImage = label => label === 'image' || label === 'url';\nconst isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size';\nconst isLabelLength = label => label === 'length';\nconst isLabelNumber = label => label === 'number';\nconst isLabelFamilyName = label => label === 'family-name';\nconst isLabelShadow = label => label === 'shadow';\nconst validators = /*#__PURE__*/Object.defineProperty({\n __proto__: null,\n isAny,\n isAnyNonArbitrary,\n isArbitraryImage,\n isArbitraryLength,\n isArbitraryNumber,\n isArbitraryPosition,\n isArbitraryShadow,\n isArbitrarySize,\n isArbitraryValue,\n isArbitraryVariable,\n isArbitraryVariableFamilyName,\n isArbitraryVariableImage,\n isArbitraryVariableLength,\n isArbitraryVariablePosition,\n isArbitraryVariableShadow,\n isArbitraryVariableSize,\n isFraction,\n isInteger,\n isNumber,\n isPercent,\n isTshirtSize\n}, Symbol.toStringTag, {\n value: 'Module'\n});\nconst getDefaultConfig = () => {\n /**\n * Theme getters for theme variable namespaces\n * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces\n */\n /***/\n const themeColor = fromTheme('color');\n const themeFont = fromTheme('font');\n const themeText = fromTheme('text');\n const themeFontWeight = fromTheme('font-weight');\n const themeTracking = fromTheme('tracking');\n const themeLeading = fromTheme('leading');\n const themeBreakpoint = fromTheme('breakpoint');\n const themeContainer = fromTheme('container');\n const themeSpacing = fromTheme('spacing');\n const themeRadius = fromTheme('radius');\n const themeShadow = fromTheme('shadow');\n const themeInsetShadow = fromTheme('inset-shadow');\n const themeTextShadow = fromTheme('text-shadow');\n const themeDropShadow = fromTheme('drop-shadow');\n const themeBlur = fromTheme('blur');\n const themePerspective = fromTheme('perspective');\n const themeAspect = fromTheme('aspect');\n const themeEase = fromTheme('ease');\n const themeAnimate = fromTheme('animate');\n /**\n * Helpers to avoid repeating the same scales\n *\n * We use functions that create a new array every time they're called instead of static arrays.\n * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config.\n */\n /***/\n const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];\n const scalePosition = () => ['center', 'top', 'bottom', 'left', 'right', 'top-left',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'left-top', 'top-right',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'right-top', 'bottom-right',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'right-bottom', 'bottom-left',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'left-bottom'];\n const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];\n const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];\n const scaleOverscroll = () => ['auto', 'contain', 'none'];\n const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];\n const scaleInset = () => [isFraction, 'full', 'auto', ...scaleUnambiguousSpacing()];\n const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue];\n const scaleGridColRowStartAndEnd = () => ['auto', {\n span: ['full', isInteger, isArbitraryVariable, isArbitraryValue]\n }, isInteger, isArbitraryVariable, isArbitraryValue];\n const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue];\n const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue];\n const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline', 'center-safe', 'end-safe'];\n const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe'];\n const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];\n const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];\n const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];\n const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {\n position: [isArbitraryVariable, isArbitraryValue]\n }];\n const scaleBgRepeat = () => ['no-repeat', {\n repeat: ['', 'x', 'y', 'space', 'round']\n }];\n const scaleBgSize = () => ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize, {\n size: [isArbitraryVariable, isArbitraryValue]\n }];\n const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];\n const scaleRadius = () => [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue];\n const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];\n const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];\n const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];\n const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];\n const scaleBlur = () => [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];\n const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleTranslate = () => [isFraction, 'full', ...scaleUnambiguousSpacing()];\n return {\n cacheSize: 500,\n theme: {\n animate: ['spin', 'ping', 'pulse', 'bounce'],\n aspect: ['video'],\n blur: [isTshirtSize],\n breakpoint: [isTshirtSize],\n color: [isAny],\n container: [isTshirtSize],\n 'drop-shadow': [isTshirtSize],\n ease: ['in', 'out', 'in-out'],\n font: [isAnyNonArbitrary],\n 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'],\n 'inset-shadow': [isTshirtSize],\n leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'],\n perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'],\n radius: [isTshirtSize],\n shadow: [isTshirtSize],\n spacing: ['px', isNumber],\n text: [isTshirtSize],\n 'text-shadow': [isTshirtSize],\n tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest']\n },\n classGroups: {\n // --------------\n // --- Layout ---\n // --------------\n /**\n * Aspect Ratio\n * @see https://tailwindcss.com/docs/aspect-ratio\n */\n aspect: [{\n aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]\n }],\n /**\n * Container\n * @see https://tailwindcss.com/docs/container\n * @deprecated since Tailwind CSS v4.0.0\n */\n container: ['container'],\n /**\n * Columns\n * @see https://tailwindcss.com/docs/columns\n */\n columns: [{\n columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]\n }],\n /**\n * Break After\n * @see https://tailwindcss.com/docs/break-after\n */\n 'break-after': [{\n 'break-after': scaleBreak()\n }],\n /**\n * Break Before\n * @see https://tailwindcss.com/docs/break-before\n */\n 'break-before': [{\n 'break-before': scaleBreak()\n }],\n /**\n * Break Inside\n * @see https://tailwindcss.com/docs/break-inside\n */\n 'break-inside': [{\n 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']\n }],\n /**\n * Box Decoration Break\n * @see https://tailwindcss.com/docs/box-decoration-break\n */\n 'box-decoration': [{\n 'box-decoration': ['slice', 'clone']\n }],\n /**\n * Box Sizing\n * @see https://tailwindcss.com/docs/box-sizing\n */\n box: [{\n box: ['border', 'content']\n }],\n /**\n * Display\n * @see https://tailwindcss.com/docs/display\n */\n display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],\n /**\n * Screen Reader Only\n * @see https://tailwindcss.com/docs/display#screen-reader-only\n */\n sr: ['sr-only', 'not-sr-only'],\n /**\n * Floats\n * @see https://tailwindcss.com/docs/float\n */\n float: [{\n float: ['right', 'left', 'none', 'start', 'end']\n }],\n /**\n * Clear\n * @see https://tailwindcss.com/docs/clear\n */\n clear: [{\n clear: ['left', 'right', 'both', 'none', 'start', 'end']\n }],\n /**\n * Isolation\n * @see https://tailwindcss.com/docs/isolation\n */\n isolation: ['isolate', 'isolation-auto'],\n /**\n * Object Fit\n * @see https://tailwindcss.com/docs/object-fit\n */\n 'object-fit': [{\n object: ['contain', 'cover', 'fill', 'none', 'scale-down']\n }],\n /**\n * Object Position\n * @see https://tailwindcss.com/docs/object-position\n */\n 'object-position': [{\n object: scalePositionWithArbitrary()\n }],\n /**\n * Overflow\n * @see https://tailwindcss.com/docs/overflow\n */\n overflow: [{\n overflow: scaleOverflow()\n }],\n /**\n * Overflow X\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-x': [{\n 'overflow-x': scaleOverflow()\n }],\n /**\n * Overflow Y\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-y': [{\n 'overflow-y': scaleOverflow()\n }],\n /**\n * Overscroll Behavior\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n overscroll: [{\n overscroll: scaleOverscroll()\n }],\n /**\n * Overscroll Behavior X\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-x': [{\n 'overscroll-x': scaleOverscroll()\n }],\n /**\n * Overscroll Behavior Y\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-y': [{\n 'overscroll-y': scaleOverscroll()\n }],\n /**\n * Position\n * @see https://tailwindcss.com/docs/position\n */\n position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],\n /**\n * Top / Right / Bottom / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n inset: [{\n inset: scaleInset()\n }],\n /**\n * Right / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-x': [{\n 'inset-x': scaleInset()\n }],\n /**\n * Top / Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-y': [{\n 'inset-y': scaleInset()\n }],\n /**\n * Start\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n start: [{\n start: scaleInset()\n }],\n /**\n * End\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n end: [{\n end: scaleInset()\n }],\n /**\n * Top\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n top: [{\n top: scaleInset()\n }],\n /**\n * Right\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n right: [{\n right: scaleInset()\n }],\n /**\n * Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n bottom: [{\n bottom: scaleInset()\n }],\n /**\n * Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n left: [{\n left: scaleInset()\n }],\n /**\n * Visibility\n * @see https://tailwindcss.com/docs/visibility\n */\n visibility: ['visible', 'invisible', 'collapse'],\n /**\n * Z-Index\n * @see https://tailwindcss.com/docs/z-index\n */\n z: [{\n z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]\n }],\n // ------------------------\n // --- Flexbox and Grid ---\n // ------------------------\n /**\n * Flex Basis\n * @see https://tailwindcss.com/docs/flex-basis\n */\n basis: [{\n basis: [isFraction, 'full', 'auto', themeContainer, ...scaleUnambiguousSpacing()]\n }],\n /**\n * Flex Direction\n * @see https://tailwindcss.com/docs/flex-direction\n */\n 'flex-direction': [{\n flex: ['row', 'row-reverse', 'col', 'col-reverse']\n }],\n /**\n * Flex Wrap\n * @see https://tailwindcss.com/docs/flex-wrap\n */\n 'flex-wrap': [{\n flex: ['nowrap', 'wrap', 'wrap-reverse']\n }],\n /**\n * Flex\n * @see https://tailwindcss.com/docs/flex\n */\n flex: [{\n flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue]\n }],\n /**\n * Flex Grow\n * @see https://tailwindcss.com/docs/flex-grow\n */\n grow: [{\n grow: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Flex Shrink\n * @see https://tailwindcss.com/docs/flex-shrink\n */\n shrink: [{\n shrink: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Order\n * @see https://tailwindcss.com/docs/order\n */\n order: [{\n order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Grid Template Columns\n * @see https://tailwindcss.com/docs/grid-template-columns\n */\n 'grid-cols': [{\n 'grid-cols': scaleGridTemplateColsRows()\n }],\n /**\n * Grid Column Start / End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start-end': [{\n col: scaleGridColRowStartAndEnd()\n }],\n /**\n * Grid Column Start\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start': [{\n 'col-start': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Column End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-end': [{\n 'col-end': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Template Rows\n * @see https://tailwindcss.com/docs/grid-template-rows\n */\n 'grid-rows': [{\n 'grid-rows': scaleGridTemplateColsRows()\n }],\n /**\n * Grid Row Start / End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start-end': [{\n row: scaleGridColRowStartAndEnd()\n }],\n /**\n * Grid Row Start\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start': [{\n 'row-start': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Row End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-end': [{\n 'row-end': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Auto Flow\n * @see https://tailwindcss.com/docs/grid-auto-flow\n */\n 'grid-flow': [{\n 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']\n }],\n /**\n * Grid Auto Columns\n * @see https://tailwindcss.com/docs/grid-auto-columns\n */\n 'auto-cols': [{\n 'auto-cols': scaleGridAutoColsRows()\n }],\n /**\n * Grid Auto Rows\n * @see https://tailwindcss.com/docs/grid-auto-rows\n */\n 'auto-rows': [{\n 'auto-rows': scaleGridAutoColsRows()\n }],\n /**\n * Gap\n * @see https://tailwindcss.com/docs/gap\n */\n gap: [{\n gap: scaleUnambiguousSpacing()\n }],\n /**\n * Gap X\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-x': [{\n 'gap-x': scaleUnambiguousSpacing()\n }],\n /**\n * Gap Y\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-y': [{\n 'gap-y': scaleUnambiguousSpacing()\n }],\n /**\n * Justify Content\n * @see https://tailwindcss.com/docs/justify-content\n */\n 'justify-content': [{\n justify: [...scaleAlignPrimaryAxis(), 'normal']\n }],\n /**\n * Justify Items\n * @see https://tailwindcss.com/docs/justify-items\n */\n 'justify-items': [{\n 'justify-items': [...scaleAlignSecondaryAxis(), 'normal']\n }],\n /**\n * Justify Self\n * @see https://tailwindcss.com/docs/justify-self\n */\n 'justify-self': [{\n 'justify-self': ['auto', ...scaleAlignSecondaryAxis()]\n }],\n /**\n * Align Content\n * @see https://tailwindcss.com/docs/align-content\n */\n 'align-content': [{\n content: ['normal', ...scaleAlignPrimaryAxis()]\n }],\n /**\n * Align Items\n * @see https://tailwindcss.com/docs/align-items\n */\n 'align-items': [{\n items: [...scaleAlignSecondaryAxis(), {\n baseline: ['', 'last']\n }]\n }],\n /**\n * Align Self\n * @see https://tailwindcss.com/docs/align-self\n */\n 'align-self': [{\n self: ['auto', ...scaleAlignSecondaryAxis(), {\n baseline: ['', 'last']\n }]\n }],\n /**\n * Place Content\n * @see https://tailwindcss.com/docs/place-content\n */\n 'place-content': [{\n 'place-content': scaleAlignPrimaryAxis()\n }],\n /**\n * Place Items\n * @see https://tailwindcss.com/docs/place-items\n */\n 'place-items': [{\n 'place-items': [...scaleAlignSecondaryAxis(), 'baseline']\n }],\n /**\n * Place Self\n * @see https://tailwindcss.com/docs/place-self\n */\n 'place-self': [{\n 'place-self': ['auto', ...scaleAlignSecondaryAxis()]\n }],\n // Spacing\n /**\n * Padding\n * @see https://tailwindcss.com/docs/padding\n */\n p: [{\n p: scaleUnambiguousSpacing()\n }],\n /**\n * Padding X\n * @see https://tailwindcss.com/docs/padding\n */\n px: [{\n px: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Y\n * @see https://tailwindcss.com/docs/padding\n */\n py: [{\n py: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Start\n * @see https://tailwindcss.com/docs/padding\n */\n ps: [{\n ps: scaleUnambiguousSpacing()\n }],\n /**\n * Padding End\n * @see https://tailwindcss.com/docs/padding\n */\n pe: [{\n pe: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Top\n * @see https://tailwindcss.com/docs/padding\n */\n pt: [{\n pt: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Right\n * @see https://tailwindcss.com/docs/padding\n */\n pr: [{\n pr: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Bottom\n * @see https://tailwindcss.com/docs/padding\n */\n pb: [{\n pb: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Left\n * @see https://tailwindcss.com/docs/padding\n */\n pl: [{\n pl: scaleUnambiguousSpacing()\n }],\n /**\n * Margin\n * @see https://tailwindcss.com/docs/margin\n */\n m: [{\n m: scaleMargin()\n }],\n /**\n * Margin X\n * @see https://tailwindcss.com/docs/margin\n */\n mx: [{\n mx: scaleMargin()\n }],\n /**\n * Margin Y\n * @see https://tailwindcss.com/docs/margin\n */\n my: [{\n my: scaleMargin()\n }],\n /**\n * Margin Start\n * @see https://tailwindcss.com/docs/margin\n */\n ms: [{\n ms: scaleMargin()\n }],\n /**\n * Margin End\n * @see https://tailwindcss.com/docs/margin\n */\n me: [{\n me: scaleMargin()\n }],\n /**\n * Margin Top\n * @see https://tailwindcss.com/docs/margin\n */\n mt: [{\n mt: scaleMargin()\n }],\n /**\n * Margin Right\n * @see https://tailwindcss.com/docs/margin\n */\n mr: [{\n mr: scaleMargin()\n }],\n /**\n * Margin Bottom\n * @see https://tailwindcss.com/docs/margin\n */\n mb: [{\n mb: scaleMargin()\n }],\n /**\n * Margin Left\n * @see https://tailwindcss.com/docs/margin\n */\n ml: [{\n ml: scaleMargin()\n }],\n /**\n * Space Between X\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-x': [{\n 'space-x': scaleUnambiguousSpacing()\n }],\n /**\n * Space Between X Reverse\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-x-reverse': ['space-x-reverse'],\n /**\n * Space Between Y\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-y': [{\n 'space-y': scaleUnambiguousSpacing()\n }],\n /**\n * Space Between Y Reverse\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-y-reverse': ['space-y-reverse'],\n // --------------\n // --- Sizing ---\n // --------------\n /**\n * Size\n * @see https://tailwindcss.com/docs/width#setting-both-width-and-height\n */\n size: [{\n size: scaleSizing()\n }],\n /**\n * Width\n * @see https://tailwindcss.com/docs/width\n */\n w: [{\n w: [themeContainer, 'screen', ...scaleSizing()]\n }],\n /**\n * Min-Width\n * @see https://tailwindcss.com/docs/min-width\n */\n 'min-w': [{\n 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n 'none', ...scaleSizing()]\n }],\n /**\n * Max-Width\n * @see https://tailwindcss.com/docs/max-width\n */\n 'max-w': [{\n 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n {\n screen: [themeBreakpoint]\n }, ...scaleSizing()]\n }],\n /**\n * Height\n * @see https://tailwindcss.com/docs/height\n */\n h: [{\n h: ['screen', 'lh', ...scaleSizing()]\n }],\n /**\n * Min-Height\n * @see https://tailwindcss.com/docs/min-height\n */\n 'min-h': [{\n 'min-h': ['screen', 'lh', 'none', ...scaleSizing()]\n }],\n /**\n * Max-Height\n * @see https://tailwindcss.com/docs/max-height\n */\n 'max-h': [{\n 'max-h': ['screen', 'lh', ...scaleSizing()]\n }],\n // ------------------\n // --- Typography ---\n // ------------------\n /**\n * Font Size\n * @see https://tailwindcss.com/docs/font-size\n */\n 'font-size': [{\n text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength]\n }],\n /**\n * Font Smoothing\n * @see https://tailwindcss.com/docs/font-smoothing\n */\n 'font-smoothing': ['antialiased', 'subpixel-antialiased'],\n /**\n * Font Style\n * @see https://tailwindcss.com/docs/font-style\n */\n 'font-style': ['italic', 'not-italic'],\n /**\n * Font Weight\n * @see https://tailwindcss.com/docs/font-weight\n */\n 'font-weight': [{\n font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]\n }],\n /**\n * Font Stretch\n * @see https://tailwindcss.com/docs/font-stretch\n */\n 'font-stretch': [{\n 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue]\n }],\n /**\n * Font Family\n * @see https://tailwindcss.com/docs/font-family\n */\n 'font-family': [{\n font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]\n }],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-normal': ['normal-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-ordinal': ['ordinal'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-slashed-zero': ['slashed-zero'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-figure': ['lining-nums', 'oldstyle-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-spacing': ['proportional-nums', 'tabular-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'],\n /**\n * Letter Spacing\n * @see https://tailwindcss.com/docs/letter-spacing\n */\n tracking: [{\n tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Line Clamp\n * @see https://tailwindcss.com/docs/line-clamp\n */\n 'line-clamp': [{\n 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber]\n }],\n /**\n * Line Height\n * @see https://tailwindcss.com/docs/line-height\n */\n leading: [{\n leading: [/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n themeLeading, ...scaleUnambiguousSpacing()]\n }],\n /**\n * List Style Image\n * @see https://tailwindcss.com/docs/list-style-image\n */\n 'list-image': [{\n 'list-image': ['none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * List Style Position\n * @see https://tailwindcss.com/docs/list-style-position\n */\n 'list-style-position': [{\n list: ['inside', 'outside']\n }],\n /**\n * List Style Type\n * @see https://tailwindcss.com/docs/list-style-type\n */\n 'list-style-type': [{\n list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Text Alignment\n * @see https://tailwindcss.com/docs/text-align\n */\n 'text-alignment': [{\n text: ['left', 'center', 'right', 'justify', 'start', 'end']\n }],\n /**\n * Placeholder Color\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://v3.tailwindcss.com/docs/placeholder-color\n */\n 'placeholder-color': [{\n placeholder: scaleColor()\n }],\n /**\n * Text Color\n * @see https://tailwindcss.com/docs/text-color\n */\n 'text-color': [{\n text: scaleColor()\n }],\n /**\n * Text Decoration\n * @see https://tailwindcss.com/docs/text-decoration\n */\n 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],\n /**\n * Text Decoration Style\n * @see https://tailwindcss.com/docs/text-decoration-style\n */\n 'text-decoration-style': [{\n decoration: [...scaleLineStyle(), 'wavy']\n }],\n /**\n * Text Decoration Thickness\n * @see https://tailwindcss.com/docs/text-decoration-thickness\n */\n 'text-decoration-thickness': [{\n decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength]\n }],\n /**\n * Text Decoration Color\n * @see https://tailwindcss.com/docs/text-decoration-color\n */\n 'text-decoration-color': [{\n decoration: scaleColor()\n }],\n /**\n * Text Underline Offset\n * @see https://tailwindcss.com/docs/text-underline-offset\n */\n 'underline-offset': [{\n 'underline-offset': [isNumber, 'auto', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Text Transform\n * @see https://tailwindcss.com/docs/text-transform\n */\n 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],\n /**\n * Text Overflow\n * @see https://tailwindcss.com/docs/text-overflow\n */\n 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],\n /**\n * Text Wrap\n * @see https://tailwindcss.com/docs/text-wrap\n */\n 'text-wrap': [{\n text: ['wrap', 'nowrap', 'balance', 'pretty']\n }],\n /**\n * Text Indent\n * @see https://tailwindcss.com/docs/text-indent\n */\n indent: [{\n indent: scaleUnambiguousSpacing()\n }],\n /**\n * Vertical Alignment\n * @see https://tailwindcss.com/docs/vertical-align\n */\n 'vertical-align': [{\n align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Whitespace\n * @see https://tailwindcss.com/docs/whitespace\n */\n whitespace: [{\n whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']\n }],\n /**\n * Word Break\n * @see https://tailwindcss.com/docs/word-break\n */\n break: [{\n break: ['normal', 'words', 'all', 'keep']\n }],\n /**\n * Overflow Wrap\n * @see https://tailwindcss.com/docs/overflow-wrap\n */\n wrap: [{\n wrap: ['break-word', 'anywhere', 'normal']\n }],\n /**\n * Hyphens\n * @see https://tailwindcss.com/docs/hyphens\n */\n hyphens: [{\n hyphens: ['none', 'manual', 'auto']\n }],\n /**\n * Content\n * @see https://tailwindcss.com/docs/content\n */\n content: [{\n content: ['none', isArbitraryVariable, isArbitraryValue]\n }],\n // -------------------\n // --- Backgrounds ---\n // -------------------\n /**\n * Background Attachment\n * @see https://tailwindcss.com/docs/background-attachment\n */\n 'bg-attachment': [{\n bg: ['fixed', 'local', 'scroll']\n }],\n /**\n * Background Clip\n * @see https://tailwindcss.com/docs/background-clip\n */\n 'bg-clip': [{\n 'bg-clip': ['border', 'padding', 'content', 'text']\n }],\n /**\n * Background Origin\n * @see https://tailwindcss.com/docs/background-origin\n */\n 'bg-origin': [{\n 'bg-origin': ['border', 'padding', 'content']\n }],\n /**\n * Background Position\n * @see https://tailwindcss.com/docs/background-position\n */\n 'bg-position': [{\n bg: scaleBgPosition()\n }],\n /**\n * Background Repeat\n * @see https://tailwindcss.com/docs/background-repeat\n */\n 'bg-repeat': [{\n bg: scaleBgRepeat()\n }],\n /**\n * Background Size\n * @see https://tailwindcss.com/docs/background-size\n */\n 'bg-size': [{\n bg: scaleBgSize()\n }],\n /**\n * Background Image\n * @see https://tailwindcss.com/docs/background-image\n */\n 'bg-image': [{\n bg: ['none', {\n linear: [{\n to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']\n }, isInteger, isArbitraryVariable, isArbitraryValue],\n radial: ['', isArbitraryVariable, isArbitraryValue],\n conic: [isInteger, isArbitraryVariable, isArbitraryValue]\n }, isArbitraryVariableImage, isArbitraryImage]\n }],\n /**\n * Background Color\n * @see https://tailwindcss.com/docs/background-color\n */\n 'bg-color': [{\n bg: scaleColor()\n }],\n /**\n * Gradient Color Stops From Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from-pos': [{\n from: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops Via Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via-pos': [{\n via: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops To Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to-pos': [{\n to: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops From\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from': [{\n from: scaleColor()\n }],\n /**\n * Gradient Color Stops Via\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via': [{\n via: scaleColor()\n }],\n /**\n * Gradient Color Stops To\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to': [{\n to: scaleColor()\n }],\n // ---------------\n // --- Borders ---\n // ---------------\n /**\n * Border Radius\n * @see https://tailwindcss.com/docs/border-radius\n */\n rounded: [{\n rounded: scaleRadius()\n }],\n /**\n * Border Radius Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-s': [{\n 'rounded-s': scaleRadius()\n }],\n /**\n * Border Radius End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-e': [{\n 'rounded-e': scaleRadius()\n }],\n /**\n * Border Radius Top\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-t': [{\n 'rounded-t': scaleRadius()\n }],\n /**\n * Border Radius Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-r': [{\n 'rounded-r': scaleRadius()\n }],\n /**\n * Border Radius Bottom\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-b': [{\n 'rounded-b': scaleRadius()\n }],\n /**\n * Border Radius Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-l': [{\n 'rounded-l': scaleRadius()\n }],\n /**\n * Border Radius Start Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ss': [{\n 'rounded-ss': scaleRadius()\n }],\n /**\n * Border Radius Start End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-se': [{\n 'rounded-se': scaleRadius()\n }],\n /**\n * Border Radius End End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ee': [{\n 'rounded-ee': scaleRadius()\n }],\n /**\n * Border Radius End Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-es': [{\n 'rounded-es': scaleRadius()\n }],\n /**\n * Border Radius Top Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tl': [{\n 'rounded-tl': scaleRadius()\n }],\n /**\n * Border Radius Top Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tr': [{\n 'rounded-tr': scaleRadius()\n }],\n /**\n * Border Radius Bottom Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-br': [{\n 'rounded-br': scaleRadius()\n }],\n /**\n * Border Radius Bottom Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-bl': [{\n 'rounded-bl': scaleRadius()\n }],\n /**\n * Border Width\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w': [{\n border: scaleBorderWidth()\n }],\n /**\n * Border Width X\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-x': [{\n 'border-x': scaleBorderWidth()\n }],\n /**\n * Border Width Y\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-y': [{\n 'border-y': scaleBorderWidth()\n }],\n /**\n * Border Width Start\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-s': [{\n 'border-s': scaleBorderWidth()\n }],\n /**\n * Border Width End\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-e': [{\n 'border-e': scaleBorderWidth()\n }],\n /**\n * Border Width Top\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-t': [{\n 'border-t': scaleBorderWidth()\n }],\n /**\n * Border Width Right\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-r': [{\n 'border-r': scaleBorderWidth()\n }],\n /**\n * Border Width Bottom\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-b': [{\n 'border-b': scaleBorderWidth()\n }],\n /**\n * Border Width Left\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-l': [{\n 'border-l': scaleBorderWidth()\n }],\n /**\n * Divide Width X\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-x': [{\n 'divide-x': scaleBorderWidth()\n }],\n /**\n * Divide Width X Reverse\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-x-reverse': ['divide-x-reverse'],\n /**\n * Divide Width Y\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-y': [{\n 'divide-y': scaleBorderWidth()\n }],\n /**\n * Divide Width Y Reverse\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-y-reverse': ['divide-y-reverse'],\n /**\n * Border Style\n * @see https://tailwindcss.com/docs/border-style\n */\n 'border-style': [{\n border: [...scaleLineStyle(), 'hidden', 'none']\n }],\n /**\n * Divide Style\n * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style\n */\n 'divide-style': [{\n divide: [...scaleLineStyle(), 'hidden', 'none']\n }],\n /**\n * Border Color\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color': [{\n border: scaleColor()\n }],\n /**\n * Border Color X\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-x': [{\n 'border-x': scaleColor()\n }],\n /**\n * Border Color Y\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-y': [{\n 'border-y': scaleColor()\n }],\n /**\n * Border Color S\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-s': [{\n 'border-s': scaleColor()\n }],\n /**\n * Border Color E\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-e': [{\n 'border-e': scaleColor()\n }],\n /**\n * Border Color Top\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-t': [{\n 'border-t': scaleColor()\n }],\n /**\n * Border Color Right\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-r': [{\n 'border-r': scaleColor()\n }],\n /**\n * Border Color Bottom\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-b': [{\n 'border-b': scaleColor()\n }],\n /**\n * Border Color Left\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-l': [{\n 'border-l': scaleColor()\n }],\n /**\n * Divide Color\n * @see https://tailwindcss.com/docs/divide-color\n */\n 'divide-color': [{\n divide: scaleColor()\n }],\n /**\n * Outline Style\n * @see https://tailwindcss.com/docs/outline-style\n */\n 'outline-style': [{\n outline: [...scaleLineStyle(), 'none', 'hidden']\n }],\n /**\n * Outline Offset\n * @see https://tailwindcss.com/docs/outline-offset\n */\n 'outline-offset': [{\n 'outline-offset': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Outline Width\n * @see https://tailwindcss.com/docs/outline-width\n */\n 'outline-w': [{\n outline: ['', isNumber, isArbitraryVariableLength, isArbitraryLength]\n }],\n /**\n * Outline Color\n * @see https://tailwindcss.com/docs/outline-color\n */\n 'outline-color': [{\n outline: scaleColor()\n }],\n // ---------------\n // --- Effects ---\n // ---------------\n /**\n * Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow\n */\n shadow: [{\n shadow: [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color\n */\n 'shadow-color': [{\n shadow: scaleColor()\n }],\n /**\n * Inset Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow\n */\n 'inset-shadow': [{\n 'inset-shadow': ['none', themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Inset Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color\n */\n 'inset-shadow-color': [{\n 'inset-shadow': scaleColor()\n }],\n /**\n * Ring Width\n * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring\n */\n 'ring-w': [{\n ring: scaleBorderWidth()\n }],\n /**\n * Ring Width Inset\n * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-w-inset': ['ring-inset'],\n /**\n * Ring Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color\n */\n 'ring-color': [{\n ring: scaleColor()\n }],\n /**\n * Ring Offset Width\n * @see https://v3.tailwindcss.com/docs/ring-offset-width\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-offset-w': [{\n 'ring-offset': [isNumber, isArbitraryLength]\n }],\n /**\n * Ring Offset Color\n * @see https://v3.tailwindcss.com/docs/ring-offset-color\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-offset-color': [{\n 'ring-offset': scaleColor()\n }],\n /**\n * Inset Ring Width\n * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring\n */\n 'inset-ring-w': [{\n 'inset-ring': scaleBorderWidth()\n }],\n /**\n * Inset Ring Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color\n */\n 'inset-ring-color': [{\n 'inset-ring': scaleColor()\n }],\n /**\n * Text Shadow\n * @see https://tailwindcss.com/docs/text-shadow\n */\n 'text-shadow': [{\n 'text-shadow': ['none', themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Text Shadow Color\n * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color\n */\n 'text-shadow-color': [{\n 'text-shadow': scaleColor()\n }],\n /**\n * Opacity\n * @see https://tailwindcss.com/docs/opacity\n */\n opacity: [{\n opacity: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Mix Blend Mode\n * @see https://tailwindcss.com/docs/mix-blend-mode\n */\n 'mix-blend': [{\n 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter']\n }],\n /**\n * Background Blend Mode\n * @see https://tailwindcss.com/docs/background-blend-mode\n */\n 'bg-blend': [{\n 'bg-blend': scaleBlendMode()\n }],\n /**\n * Mask Clip\n * @see https://tailwindcss.com/docs/mask-clip\n */\n 'mask-clip': [{\n 'mask-clip': ['border', 'padding', 'content', 'fill', 'stroke', 'view']\n }, 'mask-no-clip'],\n /**\n * Mask Composite\n * @see https://tailwindcss.com/docs/mask-composite\n */\n 'mask-composite': [{\n mask: ['add', 'subtract', 'intersect', 'exclude']\n }],\n /**\n * Mask Image\n * @see https://tailwindcss.com/docs/mask-image\n */\n 'mask-image-linear-pos': [{\n 'mask-linear': [isNumber]\n }],\n 'mask-image-linear-from-pos': [{\n 'mask-linear-from': scaleMaskImagePosition()\n }],\n 'mask-image-linear-to-pos': [{\n 'mask-linear-to': scaleMaskImagePosition()\n }],\n 'mask-image-linear-from-color': [{\n 'mask-linear-from': scaleColor()\n }],\n 'mask-image-linear-to-color': [{\n 'mask-linear-to': scaleColor()\n }],\n 'mask-image-t-from-pos': [{\n 'mask-t-from': scaleMaskImagePosition()\n }],\n 'mask-image-t-to-pos': [{\n 'mask-t-to': scaleMaskImagePosition()\n }],\n 'mask-image-t-from-color': [{\n 'mask-t-from': scaleColor()\n }],\n 'mask-image-t-to-color': [{\n 'mask-t-to': scaleColor()\n }],\n 'mask-image-r-from-pos': [{\n 'mask-r-from': scaleMaskImagePosition()\n }],\n 'mask-image-r-to-pos': [{\n 'mask-r-to': scaleMaskImagePosition()\n }],\n 'mask-image-r-from-color': [{\n 'mask-r-from': scaleColor()\n }],\n 'mask-image-r-to-color': [{\n 'mask-r-to': scaleColor()\n }],\n 'mask-image-b-from-pos': [{\n 'mask-b-from': scaleMaskImagePosition()\n }],\n 'mask-image-b-to-pos': [{\n 'mask-b-to': scaleMaskImagePosition()\n }],\n 'mask-image-b-from-color': [{\n 'mask-b-from': scaleColor()\n }],\n 'mask-image-b-to-color': [{\n 'mask-b-to': scaleColor()\n }],\n 'mask-image-l-from-pos': [{\n 'mask-l-from': scaleMaskImagePosition()\n }],\n 'mask-image-l-to-pos': [{\n 'mask-l-to': scaleMaskImagePosition()\n }],\n 'mask-image-l-from-color': [{\n 'mask-l-from': scaleColor()\n }],\n 'mask-image-l-to-color': [{\n 'mask-l-to': scaleColor()\n }],\n 'mask-image-x-from-pos': [{\n 'mask-x-from': scaleMaskImagePosition()\n }],\n 'mask-image-x-to-pos': [{\n 'mask-x-to': scaleMaskImagePosition()\n }],\n 'mask-image-x-from-color': [{\n 'mask-x-from': scaleColor()\n }],\n 'mask-image-x-to-color': [{\n 'mask-x-to': scaleColor()\n }],\n 'mask-image-y-from-pos': [{\n 'mask-y-from': scaleMaskImagePosition()\n }],\n 'mask-image-y-to-pos': [{\n 'mask-y-to': scaleMaskImagePosition()\n }],\n 'mask-image-y-from-color': [{\n 'mask-y-from': scaleColor()\n }],\n 'mask-image-y-to-color': [{\n 'mask-y-to': scaleColor()\n }],\n 'mask-image-radial': [{\n 'mask-radial': [isArbitraryVariable, isArbitraryValue]\n }],\n 'mask-image-radial-from-pos': [{\n 'mask-radial-from': scaleMaskImagePosition()\n }],\n 'mask-image-radial-to-pos': [{\n 'mask-radial-to': scaleMaskImagePosition()\n }],\n 'mask-image-radial-from-color': [{\n 'mask-radial-from': scaleColor()\n }],\n 'mask-image-radial-to-color': [{\n 'mask-radial-to': scaleColor()\n }],\n 'mask-image-radial-shape': [{\n 'mask-radial': ['circle', 'ellipse']\n }],\n 'mask-image-radial-size': [{\n 'mask-radial': [{\n closest: ['side', 'corner'],\n farthest: ['side', 'corner']\n }]\n }],\n 'mask-image-radial-pos': [{\n 'mask-radial-at': scalePosition()\n }],\n 'mask-image-conic-pos': [{\n 'mask-conic': [isNumber]\n }],\n 'mask-image-conic-from-pos': [{\n 'mask-conic-from': scaleMaskImagePosition()\n }],\n 'mask-image-conic-to-pos': [{\n 'mask-conic-to': scaleMaskImagePosition()\n }],\n 'mask-image-conic-from-color': [{\n 'mask-conic-from': scaleColor()\n }],\n 'mask-image-conic-to-color': [{\n 'mask-conic-to': scaleColor()\n }],\n /**\n * Mask Mode\n * @see https://tailwindcss.com/docs/mask-mode\n */\n 'mask-mode': [{\n mask: ['alpha', 'luminance', 'match']\n }],\n /**\n * Mask Origin\n * @see https://tailwindcss.com/docs/mask-origin\n */\n 'mask-origin': [{\n 'mask-origin': ['border', 'padding', 'content', 'fill', 'stroke', 'view']\n }],\n /**\n * Mask Position\n * @see https://tailwindcss.com/docs/mask-position\n */\n 'mask-position': [{\n mask: scaleBgPosition()\n }],\n /**\n * Mask Repeat\n * @see https://tailwindcss.com/docs/mask-repeat\n */\n 'mask-repeat': [{\n mask: scaleBgRepeat()\n }],\n /**\n * Mask Size\n * @see https://tailwindcss.com/docs/mask-size\n */\n 'mask-size': [{\n mask: scaleBgSize()\n }],\n /**\n * Mask Type\n * @see https://tailwindcss.com/docs/mask-type\n */\n 'mask-type': [{\n 'mask-type': ['alpha', 'luminance']\n }],\n /**\n * Mask Image\n * @see https://tailwindcss.com/docs/mask-image\n */\n 'mask-image': [{\n mask: ['none', isArbitraryVariable, isArbitraryValue]\n }],\n // ---------------\n // --- Filters ---\n // ---------------\n /**\n * Filter\n * @see https://tailwindcss.com/docs/filter\n */\n filter: [{\n filter: [\n // Deprecated since Tailwind CSS v3.0.0\n '', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Blur\n * @see https://tailwindcss.com/docs/blur\n */\n blur: [{\n blur: scaleBlur()\n }],\n /**\n * Brightness\n * @see https://tailwindcss.com/docs/brightness\n */\n brightness: [{\n brightness: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Contrast\n * @see https://tailwindcss.com/docs/contrast\n */\n contrast: [{\n contrast: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Drop Shadow\n * @see https://tailwindcss.com/docs/drop-shadow\n */\n 'drop-shadow': [{\n 'drop-shadow': [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Drop Shadow Color\n * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color\n */\n 'drop-shadow-color': [{\n 'drop-shadow': scaleColor()\n }],\n /**\n * Grayscale\n * @see https://tailwindcss.com/docs/grayscale\n */\n grayscale: [{\n grayscale: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Hue Rotate\n * @see https://tailwindcss.com/docs/hue-rotate\n */\n 'hue-rotate': [{\n 'hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Invert\n * @see https://tailwindcss.com/docs/invert\n */\n invert: [{\n invert: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Saturate\n * @see https://tailwindcss.com/docs/saturate\n */\n saturate: [{\n saturate: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Sepia\n * @see https://tailwindcss.com/docs/sepia\n */\n sepia: [{\n sepia: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Filter\n * @see https://tailwindcss.com/docs/backdrop-filter\n */\n 'backdrop-filter': [{\n 'backdrop-filter': [\n // Deprecated since Tailwind CSS v3.0.0\n '', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Blur\n * @see https://tailwindcss.com/docs/backdrop-blur\n */\n 'backdrop-blur': [{\n 'backdrop-blur': scaleBlur()\n }],\n /**\n * Backdrop Brightness\n * @see https://tailwindcss.com/docs/backdrop-brightness\n */\n 'backdrop-brightness': [{\n 'backdrop-brightness': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Contrast\n * @see https://tailwindcss.com/docs/backdrop-contrast\n */\n 'backdrop-contrast': [{\n 'backdrop-contrast': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Grayscale\n * @see https://tailwindcss.com/docs/backdrop-grayscale\n */\n 'backdrop-grayscale': [{\n 'backdrop-grayscale': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Hue Rotate\n * @see https://tailwindcss.com/docs/backdrop-hue-rotate\n */\n 'backdrop-hue-rotate': [{\n 'backdrop-hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Invert\n * @see https://tailwindcss.com/docs/backdrop-invert\n */\n 'backdrop-invert': [{\n 'backdrop-invert': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Opacity\n * @see https://tailwindcss.com/docs/backdrop-opacity\n */\n 'backdrop-opacity': [{\n 'backdrop-opacity': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Saturate\n * @see https://tailwindcss.com/docs/backdrop-saturate\n */\n 'backdrop-saturate': [{\n 'backdrop-saturate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Sepia\n * @see https://tailwindcss.com/docs/backdrop-sepia\n */\n 'backdrop-sepia': [{\n 'backdrop-sepia': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n // --------------\n // --- Tables ---\n // --------------\n /**\n * Border Collapse\n * @see https://tailwindcss.com/docs/border-collapse\n */\n 'border-collapse': [{\n border: ['collapse', 'separate']\n }],\n /**\n * Border Spacing\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing': [{\n 'border-spacing': scaleUnambiguousSpacing()\n }],\n /**\n * Border Spacing X\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-x': [{\n 'border-spacing-x': scaleUnambiguousSpacing()\n }],\n /**\n * Border Spacing Y\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-y': [{\n 'border-spacing-y': scaleUnambiguousSpacing()\n }],\n /**\n * Table Layout\n * @see https://tailwindcss.com/docs/table-layout\n */\n 'table-layout': [{\n table: ['auto', 'fixed']\n }],\n /**\n * Caption Side\n * @see https://tailwindcss.com/docs/caption-side\n */\n caption: [{\n caption: ['top', 'bottom']\n }],\n // ---------------------------------\n // --- Transitions and Animation ---\n // ---------------------------------\n /**\n * Transition Property\n * @see https://tailwindcss.com/docs/transition-property\n */\n transition: [{\n transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Behavior\n * @see https://tailwindcss.com/docs/transition-behavior\n */\n 'transition-behavior': [{\n transition: ['normal', 'discrete']\n }],\n /**\n * Transition Duration\n * @see https://tailwindcss.com/docs/transition-duration\n */\n duration: [{\n duration: [isNumber, 'initial', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Timing Function\n * @see https://tailwindcss.com/docs/transition-timing-function\n */\n ease: [{\n ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Delay\n * @see https://tailwindcss.com/docs/transition-delay\n */\n delay: [{\n delay: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Animation\n * @see https://tailwindcss.com/docs/animation\n */\n animate: [{\n animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue]\n }],\n // ------------------\n // --- Transforms ---\n // ------------------\n /**\n * Backface Visibility\n * @see https://tailwindcss.com/docs/backface-visibility\n */\n backface: [{\n backface: ['hidden', 'visible']\n }],\n /**\n * Perspective\n * @see https://tailwindcss.com/docs/perspective\n */\n perspective: [{\n perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Perspective Origin\n * @see https://tailwindcss.com/docs/perspective-origin\n */\n 'perspective-origin': [{\n 'perspective-origin': scalePositionWithArbitrary()\n }],\n /**\n * Rotate\n * @see https://tailwindcss.com/docs/rotate\n */\n rotate: [{\n rotate: scaleRotate()\n }],\n /**\n * Rotate X\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-x': [{\n 'rotate-x': scaleRotate()\n }],\n /**\n * Rotate Y\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-y': [{\n 'rotate-y': scaleRotate()\n }],\n /**\n * Rotate Z\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-z': [{\n 'rotate-z': scaleRotate()\n }],\n /**\n * Scale\n * @see https://tailwindcss.com/docs/scale\n */\n scale: [{\n scale: scaleScale()\n }],\n /**\n * Scale X\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-x': [{\n 'scale-x': scaleScale()\n }],\n /**\n * Scale Y\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-y': [{\n 'scale-y': scaleScale()\n }],\n /**\n * Scale Z\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-z': [{\n 'scale-z': scaleScale()\n }],\n /**\n * Scale 3D\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-3d': ['scale-3d'],\n /**\n * Skew\n * @see https://tailwindcss.com/docs/skew\n */\n skew: [{\n skew: scaleSkew()\n }],\n /**\n * Skew X\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-x': [{\n 'skew-x': scaleSkew()\n }],\n /**\n * Skew Y\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-y': [{\n 'skew-y': scaleSkew()\n }],\n /**\n * Transform\n * @see https://tailwindcss.com/docs/transform\n */\n transform: [{\n transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu']\n }],\n /**\n * Transform Origin\n * @see https://tailwindcss.com/docs/transform-origin\n */\n 'transform-origin': [{\n origin: scalePositionWithArbitrary()\n }],\n /**\n * Transform Style\n * @see https://tailwindcss.com/docs/transform-style\n */\n 'transform-style': [{\n transform: ['3d', 'flat']\n }],\n /**\n * Translate\n * @see https://tailwindcss.com/docs/translate\n */\n translate: [{\n translate: scaleTranslate()\n }],\n /**\n * Translate X\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-x': [{\n 'translate-x': scaleTranslate()\n }],\n /**\n * Translate Y\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-y': [{\n 'translate-y': scaleTranslate()\n }],\n /**\n * Translate Z\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-z': [{\n 'translate-z': scaleTranslate()\n }],\n /**\n * Translate None\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-none': ['translate-none'],\n // ---------------------\n // --- Interactivity ---\n // ---------------------\n /**\n * Accent Color\n * @see https://tailwindcss.com/docs/accent-color\n */\n accent: [{\n accent: scaleColor()\n }],\n /**\n * Appearance\n * @see https://tailwindcss.com/docs/appearance\n */\n appearance: [{\n appearance: ['none', 'auto']\n }],\n /**\n * Caret Color\n * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities\n */\n 'caret-color': [{\n caret: scaleColor()\n }],\n /**\n * Color Scheme\n * @see https://tailwindcss.com/docs/color-scheme\n */\n 'color-scheme': [{\n scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light']\n }],\n /**\n * Cursor\n * @see https://tailwindcss.com/docs/cursor\n */\n cursor: [{\n cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Field Sizing\n * @see https://tailwindcss.com/docs/field-sizing\n */\n 'field-sizing': [{\n 'field-sizing': ['fixed', 'content']\n }],\n /**\n * Pointer Events\n * @see https://tailwindcss.com/docs/pointer-events\n */\n 'pointer-events': [{\n 'pointer-events': ['auto', 'none']\n }],\n /**\n * Resize\n * @see https://tailwindcss.com/docs/resize\n */\n resize: [{\n resize: ['none', '', 'y', 'x']\n }],\n /**\n * Scroll Behavior\n * @see https://tailwindcss.com/docs/scroll-behavior\n */\n 'scroll-behavior': [{\n scroll: ['auto', 'smooth']\n }],\n /**\n * Scroll Margin\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-m': [{\n 'scroll-m': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin X\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mx': [{\n 'scroll-mx': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Y\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-my': [{\n 'scroll-my': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Start\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ms': [{\n 'scroll-ms': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin End\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-me': [{\n 'scroll-me': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Top\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mt': [{\n 'scroll-mt': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Right\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mr': [{\n 'scroll-mr': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Bottom\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mb': [{\n 'scroll-mb': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Left\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ml': [{\n 'scroll-ml': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-p': [{\n 'scroll-p': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding X\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-px': [{\n 'scroll-px': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Y\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-py': [{\n 'scroll-py': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Start\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-ps': [{\n 'scroll-ps': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding End\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pe': [{\n 'scroll-pe': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Top\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pt': [{\n 'scroll-pt': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Right\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pr': [{\n 'scroll-pr': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Bottom\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pb': [{\n 'scroll-pb': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Left\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pl': [{\n 'scroll-pl': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Snap Align\n * @see https://tailwindcss.com/docs/scroll-snap-align\n */\n 'snap-align': [{\n snap: ['start', 'end', 'center', 'align-none']\n }],\n /**\n * Scroll Snap Stop\n * @see https://tailwindcss.com/docs/scroll-snap-stop\n */\n 'snap-stop': [{\n snap: ['normal', 'always']\n }],\n /**\n * Scroll Snap Type\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-type': [{\n snap: ['none', 'x', 'y', 'both']\n }],\n /**\n * Scroll Snap Type Strictness\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-strictness': [{\n snap: ['mandatory', 'proximity']\n }],\n /**\n * Touch Action\n * @see https://tailwindcss.com/docs/touch-action\n */\n touch: [{\n touch: ['auto', 'none', 'manipulation']\n }],\n /**\n * Touch Action X\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-x': [{\n 'touch-pan': ['x', 'left', 'right']\n }],\n /**\n * Touch Action Y\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-y': [{\n 'touch-pan': ['y', 'up', 'down']\n }],\n /**\n * Touch Action Pinch Zoom\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-pz': ['touch-pinch-zoom'],\n /**\n * User Select\n * @see https://tailwindcss.com/docs/user-select\n */\n select: [{\n select: ['none', 'text', 'all', 'auto']\n }],\n /**\n * Will Change\n * @see https://tailwindcss.com/docs/will-change\n */\n 'will-change': [{\n 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue]\n }],\n // -----------\n // --- SVG ---\n // -----------\n /**\n * Fill\n * @see https://tailwindcss.com/docs/fill\n */\n fill: [{\n fill: ['none', ...scaleColor()]\n }],\n /**\n * Stroke Width\n * @see https://tailwindcss.com/docs/stroke-width\n */\n 'stroke-w': [{\n stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]\n }],\n /**\n * Stroke\n * @see https://tailwindcss.com/docs/stroke\n */\n stroke: [{\n stroke: ['none', ...scaleColor()]\n }],\n // ---------------------\n // --- Accessibility ---\n // ---------------------\n /**\n * Forced Color Adjust\n * @see https://tailwindcss.com/docs/forced-color-adjust\n */\n 'forced-color-adjust': [{\n 'forced-color-adjust': ['auto', 'none']\n }]\n },\n conflictingClassGroups: {\n overflow: ['overflow-x', 'overflow-y'],\n overscroll: ['overscroll-x', 'overscroll-y'],\n inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],\n 'inset-x': ['right', 'left'],\n 'inset-y': ['top', 'bottom'],\n flex: ['basis', 'grow', 'shrink'],\n gap: ['gap-x', 'gap-y'],\n p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],\n px: ['pr', 'pl'],\n py: ['pt', 'pb'],\n m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],\n mx: ['mr', 'ml'],\n my: ['mt', 'mb'],\n size: ['w', 'h'],\n 'font-size': ['leading'],\n 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],\n 'fvn-ordinal': ['fvn-normal'],\n 'fvn-slashed-zero': ['fvn-normal'],\n 'fvn-figure': ['fvn-normal'],\n 'fvn-spacing': ['fvn-normal'],\n 'fvn-fraction': ['fvn-normal'],\n 'line-clamp': ['display', 'overflow'],\n rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],\n 'rounded-s': ['rounded-ss', 'rounded-es'],\n 'rounded-e': ['rounded-se', 'rounded-ee'],\n 'rounded-t': ['rounded-tl', 'rounded-tr'],\n 'rounded-r': ['rounded-tr', 'rounded-br'],\n 'rounded-b': ['rounded-br', 'rounded-bl'],\n 'rounded-l': ['rounded-tl', 'rounded-bl'],\n 'border-spacing': ['border-spacing-x', 'border-spacing-y'],\n 'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],\n 'border-w-x': ['border-w-r', 'border-w-l'],\n 'border-w-y': ['border-w-t', 'border-w-b'],\n 'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],\n 'border-color-x': ['border-color-r', 'border-color-l'],\n 'border-color-y': ['border-color-t', 'border-color-b'],\n translate: ['translate-x', 'translate-y', 'translate-none'],\n 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],\n 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],\n 'scroll-mx': ['scroll-mr', 'scroll-ml'],\n 'scroll-my': ['scroll-mt', 'scroll-mb'],\n 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],\n 'scroll-px': ['scroll-pr', 'scroll-pl'],\n 'scroll-py': ['scroll-pt', 'scroll-pb'],\n touch: ['touch-x', 'touch-y', 'touch-pz'],\n 'touch-x': ['touch'],\n 'touch-y': ['touch'],\n 'touch-pz': ['touch']\n },\n conflictingClassGroupModifiers: {\n 'font-size': ['leading']\n },\n orderSensitiveModifiers: ['*', '**', 'after', 'backdrop', 'before', 'details-content', 'file', 'first-letter', 'first-line', 'marker', 'placeholder', 'selection']\n };\n};\n\n/**\n * @param baseConfig Config where other config will be merged into. This object will be mutated.\n * @param configExtension Partial config to merge into the `baseConfig`.\n */\nconst mergeConfigs = (baseConfig, {\n cacheSize,\n prefix,\n experimentalParseClassName,\n extend = {},\n override = {}\n}) => {\n overrideProperty(baseConfig, 'cacheSize', cacheSize);\n overrideProperty(baseConfig, 'prefix', prefix);\n overrideProperty(baseConfig, 'experimentalParseClassName', experimentalParseClassName);\n overrideConfigProperties(baseConfig.theme, override.theme);\n overrideConfigProperties(baseConfig.classGroups, override.classGroups);\n overrideConfigProperties(baseConfig.conflictingClassGroups, override.conflictingClassGroups);\n overrideConfigProperties(baseConfig.conflictingClassGroupModifiers, override.conflictingClassGroupModifiers);\n overrideProperty(baseConfig, 'orderSensitiveModifiers', override.orderSensitiveModifiers);\n mergeConfigProperties(baseConfig.theme, extend.theme);\n mergeConfigProperties(baseConfig.classGroups, extend.classGroups);\n mergeConfigProperties(baseConfig.conflictingClassGroups, extend.conflictingClassGroups);\n mergeConfigProperties(baseConfig.conflictingClassGroupModifiers, extend.conflictingClassGroupModifiers);\n mergeArrayProperties(baseConfig, extend, 'orderSensitiveModifiers');\n return baseConfig;\n};\nconst overrideProperty = (baseObject, overrideKey, overrideValue) => {\n if (overrideValue !== undefined) {\n baseObject[overrideKey] = overrideValue;\n }\n};\nconst overrideConfigProperties = (baseObject, overrideObject) => {\n if (overrideObject) {\n for (const key in overrideObject) {\n overrideProperty(baseObject, key, overrideObject[key]);\n }\n }\n};\nconst mergeConfigProperties = (baseObject, mergeObject) => {\n if (mergeObject) {\n for (const key in mergeObject) {\n mergeArrayProperties(baseObject, mergeObject, key);\n }\n }\n};\nconst mergeArrayProperties = (baseObject, mergeObject, key) => {\n const mergeValue = mergeObject[key];\n if (mergeValue !== undefined) {\n baseObject[key] = baseObject[key] ? baseObject[key].concat(mergeValue) : mergeValue;\n }\n};\nconst extendTailwindMerge = (configExtension, ...createConfig) => typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);\nconst twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);\nexport { createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, twMerge, validators };\n//# sourceMappingURL=bundle-mjs.mjs.map\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs))\n}\n","/**\n * Interpolates a template string with record field values.\n *\n * @example\n * interpolateTemplate(\"{codigo} - {nombre}\", { codigo: \"C001\", nombre: \"Acme\" })\n * // Returns: \"C001 - Acme\"\n *\n * @param template - Template string with {fieldName} placeholders\n * @param record - Record object with field values\n * @returns Interpolated string with placeholders replaced by values\n */\nexport function interpolateTemplate<TRecord extends Record<string, unknown>>(\n template: string,\n record: TRecord\n): string {\n return template.replace(/\\{(\\w+)\\}/g, (_, fieldName) => {\n const value = record[fieldName]\n return value !== undefined && value !== null ? String(value) : ''\n })\n}\n","import type { FilterExpression, SimpleFilter } from '../types/filter.types'\n\n/**\n * Type guard to check if filter is already in expressive format\n * @param filter - Filter to check\n * @returns true if filter is FilterExpression (array of arrays)\n */\nexport function isExpressiveFilter(filter: unknown): filter is FilterExpression {\n return Array.isArray(filter) && filter.every(Array.isArray)\n}\n\n/**\n * Converts simple filter object to expressive format\n * Each key-value pair becomes a separate AND condition\n *\n * @example\n * buildExpressiveFilter({ activo: true, tipo: \"A\" })\n * // Returns: [[{ activo: true }], [{ tipo: \"A\" }]]\n *\n * @param simpleFilter - Simple filter object\n * @returns Expressive filter format\n */\nexport function buildExpressiveFilter(simpleFilter: SimpleFilter): FilterExpression {\n return Object.entries(simpleFilter).map(([key, value]) => [{ [key]: value }])\n}\n\n/**\n * Normalizes filter input to expressive format\n * Passes through expressive filters unchanged, converts simple filters\n *\n * @param filters - Simple or expressive filter (or undefined)\n * @returns Expressive filter format or undefined\n */\nexport function normalizeFilters(\n filters?: SimpleFilter | FilterExpression\n): FilterExpression | undefined {\n if (!filters) return undefined\n if (isExpressiveFilter(filters)) return filters\n return buildExpressiveFilter(filters as SimpleFilter)\n}\n\n/**\n * Merges multiple filter expressions with AND logic\n *\n * @param filters - Array of filter expressions to merge\n * @returns Combined filter expression\n */\nexport function mergeFilters(...filters: (FilterExpression | undefined)[]): FilterExpression {\n return filters.filter(Boolean).flat() as FilterExpression\n}\n","import { useEffect, useState } from 'react'\n\nconst DEBOUNCE_MS = 300\n\nexport function useDebouncedSearch(value: string, delay: number = DEBOUNCE_MS): string {\n const [debouncedValue, setDebouncedValue] = useState(value)\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedValue(value)\n }, delay)\n\n return () => {\n clearTimeout(timer)\n }\n }, [value, delay])\n\n return debouncedValue\n}\n","import { useCallback, useState } from 'react'\n\nexport interface UseKeyboardNavigationOptions<TRecord> {\n records: TRecord[]\n isOpen: boolean\n onSelect: (record: TRecord) => void\n onClose: () => void\n onEscape: () => void\n onClear: () => void\n searchQuery: string\n}\n\nexport interface UseKeyboardNavigationResult {\n highlightedIndex: number\n setHighlightedIndex: (index: number) => void\n handleKeyDown: (event: React.KeyboardEvent) => void\n}\n\nexport function useKeyboardNavigation<TRecord>(\n options: UseKeyboardNavigationOptions<TRecord>\n): UseKeyboardNavigationResult {\n const { records, isOpen, onSelect, onClose, onEscape, onClear, searchQuery } = options\n const [highlightedIndex, setHighlightedIndex] = useState(-1)\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (!isOpen) return\n\n switch (event.key) {\n case 'ArrowDown': {\n event.preventDefault()\n if (records.length === 0) return\n setHighlightedIndex((prev) => {\n // Wrap from last to first, or increment\n if (prev >= records.length - 1) return 0\n return prev + 1\n })\n break\n }\n\n case 'ArrowUp': {\n event.preventDefault()\n if (records.length === 0) return\n setHighlightedIndex((prev) => {\n // Wrap from first to last, or decrement\n if (prev <= 0) return records.length - 1\n return prev - 1\n })\n break\n }\n\n case 'Home': {\n event.preventDefault()\n if (records.length === 0) return\n setHighlightedIndex(0)\n break\n }\n\n case 'End': {\n event.preventDefault()\n if (records.length === 0) return\n setHighlightedIndex(records.length - 1)\n break\n }\n\n case 'Enter': {\n event.preventDefault()\n if (highlightedIndex >= 0 && highlightedIndex < records.length) {\n onSelect(records[highlightedIndex])\n }\n break\n }\n\n case 'Escape': {\n event.preventDefault()\n onEscape()\n break\n }\n\n case 'Backspace': {\n // Only clear selection if search input is empty\n if (searchQuery === '') {\n onClear()\n }\n // Don't prevent default - allow normal backspace behavior in input\n break\n }\n\n case 'Tab': {\n // Close dropdown but don't prevent default - allow focus to move to next element\n onClose()\n break\n }\n\n default:\n break\n }\n },\n [isOpen, records, highlightedIndex, onSelect, onClose, onEscape, onClear, searchQuery]\n )\n\n return {\n highlightedIndex,\n setHighlightedIndex,\n handleKeyDown,\n }\n}\n","export const warn = (i18n, code, msg, rest) => {\n const args = [msg, {\n code,\n ...(rest || {})\n }];\n if (i18n?.services?.logger?.forward) {\n return i18n.services.logger.forward(args, 'warn', 'react-i18next::', true);\n }\n if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;\n if (i18n?.services?.logger?.warn) {\n i18n.services.logger.warn(...args);\n } else if (console?.warn) {\n console.warn(...args);\n }\n};\nconst alreadyWarned = {};\nexport const warnOnce = (i18n, code, msg, rest) => {\n if (isString(msg) && alreadyWarned[msg]) return;\n if (isString(msg)) alreadyWarned[msg] = new Date();\n warn(i18n, code, msg, rest);\n};\nconst loadedClb = (i18n, cb) => () => {\n if (i18n.isInitialized) {\n cb();\n } else {\n const initialized = () => {\n setTimeout(() => {\n i18n.off('initialized', initialized);\n }, 0);\n cb();\n };\n i18n.on('initialized', initialized);\n }\n};\nexport const loadNamespaces = (i18n, ns, cb) => {\n i18n.loadNamespaces(ns, loadedClb(i18n, cb));\n};\nexport const loadLanguages = (i18n, lng, ns, cb) => {\n if (isString(ns)) ns = [ns];\n if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);\n ns.forEach(n => {\n if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);\n });\n i18n.loadLanguages(lng, loadedClb(i18n, cb));\n};\nexport const hasLoadedNamespace = (ns, i18n, options = {}) => {\n if (!i18n.languages || !i18n.languages.length) {\n warnOnce(i18n, 'NO_LANGUAGES', 'i18n.languages were undefined or empty', {\n languages: i18n.languages\n });\n return true;\n }\n return i18n.hasLoadedNamespace(ns, {\n lng: options.lng,\n precheck: (i18nInstance, loadNotPending) => {\n if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;\n }\n });\n};\nexport const getDisplayName = Component => Component.displayName || Component.name || (isString(Component) && Component.length > 0 ? Component : 'Unknown');\nexport const isString = obj => typeof obj === 'string';\nexport const isObject = obj => typeof obj === 'object' && obj !== null;","const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;\nconst htmlEntities = {\n '&amp;': '&',\n '&#38;': '&',\n '&lt;': '<',\n '&#60;': '<',\n '&gt;': '>',\n '&#62;': '>',\n '&apos;': \"'\",\n '&#39;': \"'\",\n '&quot;': '\"',\n '&#34;': '\"',\n '&nbsp;': ' ',\n '&#160;': ' ',\n '&copy;': '©',\n '&#169;': '©',\n '&reg;': '®',\n '&#174;': '®',\n '&hellip;': '…',\n '&#8230;': '…',\n '&#x2F;': '/',\n '&#47;': '/'\n};\nconst unescapeHtmlEntity = m => htmlEntities[m];\nexport const unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity);","import { unescape } from './unescape.js';\nlet defaultOptions = {\n bindI18n: 'languageChanged',\n bindI18nStore: '',\n transEmptyNodeValue: '',\n transSupportBasicHtmlNodes: true,\n transWrapTextNodes: '',\n transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],\n useSuspense: true,\n unescape,\n transDefaultProps: undefined\n};\nexport const setDefaults = (options = {}) => {\n defaultOptions = {\n ...defaultOptions,\n ...options\n };\n};\nexport const getDefaults = () => defaultOptions;","let i18nInstance;\nexport const setI18n = instance => {\n i18nInstance = instance;\n};\nexport const getI18n = () => i18nInstance;","import { createContext } from 'react';\nimport { getDefaults, setDefaults } from './defaults.js';\nimport { getI18n, setI18n } from './i18nInstance.js';\nimport { initReactI18next } from './initReactI18next.js';\nexport { getDefaults, setDefaults, getI18n, setI18n, initReactI18next };\nexport const I18nContext = createContext();\nexport class ReportNamespaces {\n constructor() {\n this.usedNamespaces = {};\n }\n addUsedNamespaces(namespaces) {\n namespaces.forEach(ns => {\n if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;\n });\n }\n getUsedNamespaces() {\n return Object.keys(this.usedNamespaces);\n }\n}\nexport const composeInitialProps = ForComponent => async ctx => {\n const componentsInitialProps = (await ForComponent.getInitialProps?.(ctx)) ?? {};\n const i18nInitialProps = getInitialProps();\n return {\n ...componentsInitialProps,\n ...i18nInitialProps\n };\n};\nexport const getInitialProps = () => {\n const i18n = getI18n();\n const namespaces = i18n.reportNamespaces?.getUsedNamespaces() ?? [];\n const ret = {};\n const initialI18nStore = {};\n i18n.languages.forEach(l => {\n initialI18nStore[l] = {};\n namespaces.forEach(ns => {\n initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};\n });\n });\n ret.initialI18nStore = initialI18nStore;\n ret.initialLanguage = i18n.language;\n return ret;\n};","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","import { useContext, useCallback, useMemo, useEffect, useRef, useState } from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { getI18n, getDefaults, ReportNamespaces, I18nContext } from './context.js';\nimport { warnOnce, loadNamespaces, loadLanguages, hasLoadedNamespace, isString, isObject } from './utils.js';\nconst notReadyT = (k, optsOrDefaultValue) => {\n if (isString(optsOrDefaultValue)) return optsOrDefaultValue;\n if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;\n return Array.isArray(k) ? k[k.length - 1] : k;\n};\nconst notReadySnapshot = {\n t: notReadyT,\n ready: false\n};\nconst dummySubscribe = () => () => {};\nexport const useTranslation = (ns, props = {}) => {\n const {\n i18n: i18nFromProps\n } = props;\n const {\n i18n: i18nFromContext,\n defaultNS: defaultNSFromContext\n } = useContext(I18nContext) || {};\n const i18n = i18nFromProps || i18nFromContext || getI18n();\n if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();\n if (!i18n) {\n warnOnce(i18n, 'NO_I18NEXT_INSTANCE', 'useTranslation: You will need to pass in an i18next instance by using initReactI18next');\n }\n const i18nOptions = useMemo(() => ({\n ...getDefaults(),\n ...i18n?.options?.react,\n ...props\n }), [i18n, props]);\n const {\n useSuspense,\n keyPrefix\n } = i18nOptions;\n const nsOrContext = ns || defaultNSFromContext || i18n?.options?.defaultNS;\n const unstableNamespaces = isString(nsOrContext) ? [nsOrContext] : nsOrContext || ['translation'];\n const namespaces = useMemo(() => unstableNamespaces, unstableNamespaces);\n i18n?.reportNamespaces?.addUsedNamespaces?.(namespaces);\n const revisionRef = useRef(0);\n const subscribe = useCallback(callback => {\n if (!i18n) return dummySubscribe;\n const {\n bindI18n,\n bindI18nStore\n } = i18nOptions;\n const wrappedCallback = () => {\n revisionRef.current += 1;\n callback();\n };\n if (bindI18n) i18n.on(bindI18n, wrappedCallback);\n if (bindI18nStore) i18n.store.on(bindI18nStore, wrappedCallback);\n return () => {\n if (bindI18n) bindI18n.split(' ').forEach(e => i18n.off(e, wrappedCallback));\n if (bindI18nStore) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, wrappedCallback));\n };\n }, [i18n, i18nOptions]);\n const snapshotRef = useRef();\n const getSnapshot = useCallback(() => {\n if (!i18n) {\n return notReadySnapshot;\n }\n const calculatedReady = !!(i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));\n const currentLng = props.lng || i18n.language;\n const currentRevision = revisionRef.current;\n const lastSnapshot = snapshotRef.current;\n if (lastSnapshot && lastSnapshot.ready === calculatedReady && lastSnapshot.lng === currentLng && lastSnapshot.keyPrefix === keyPrefix && lastSnapshot.revision === currentRevision) {\n return lastSnapshot;\n }\n const calculatedT = i18n.getFixedT(currentLng, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);\n const newSnapshot = {\n t: calculatedT,\n ready: calculatedReady,\n lng: currentLng,\n keyPrefix,\n revision: currentRevision\n };\n snapshotRef.current = newSnapshot;\n return newSnapshot;\n }, [i18n, namespaces, keyPrefix, i18nOptions, props.lng]);\n const [loadCount, setLoadCount] = useState(0);\n const {\n t,\n ready\n } = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n useEffect(() => {\n if (i18n && !ready && !useSuspense) {\n const onLoaded = () => setLoadCount(c => c + 1);\n if (props.lng) {\n loadLanguages(i18n, props.lng, namespaces, onLoaded);\n } else {\n loadNamespaces(i18n, namespaces, onLoaded);\n }\n }\n }, [i18n, props.lng, namespaces, ready, useSuspense, loadCount]);\n const finalI18n = i18n || {};\n const wrapperRef = useRef(null);\n const wrapperLangRef = useRef();\n const createI18nWrapper = original => {\n const descriptors = Object.getOwnPropertyDescriptors(original);\n if (descriptors.__original) delete descriptors.__original;\n const wrapper = Object.create(Object.getPrototypeOf(original), descriptors);\n if (!Object.prototype.hasOwnProperty.call(wrapper, '__original')) {\n try {\n Object.defineProperty(wrapper, '__original', {\n value: original,\n writable: false,\n enumerable: false,\n configurable: false\n });\n } catch (_) {}\n }\n return wrapper;\n };\n const ret = useMemo(() => {\n const original = finalI18n;\n const lang = original?.language;\n let i18nWrapper = original;\n if (original) {\n if (wrapperRef.current && wrapperRef.current.__original === original) {\n if (wrapperLangRef.current !== lang) {\n i18nWrapper = createI18nWrapper(original);\n wrapperRef.current = i18nWrapper;\n wrapperLangRef.current = lang;\n } else {\n i18nWrapper = wrapperRef.current;\n }\n } else {\n i18nWrapper = createI18nWrapper(original);\n wrapperRef.current = i18nWrapper;\n wrapperLangRef.current = lang;\n }\n }\n const arr = [t, i18nWrapper, ready];\n arr.t = t;\n arr.i18n = i18nWrapper;\n arr.ready = ready;\n return arr;\n }, [t, finalI18n, ready, finalI18n.resolvedLanguage, finalI18n.language, finalI18n.languages]);\n if (i18n && useSuspense && !ready) {\n throw new Promise(resolve => {\n const onLoaded = () => resolve();\n if (props.lng) {\n loadLanguages(i18n, props.lng, namespaces, onLoaded);\n } else {\n loadNamespaces(i18n, namespaces, onLoaded);\n }\n });\n }\n return ret;\n};","import { useTranslation } from 'react-i18next'\n\nconst FALLBACK_STRINGS: Record<string, string> = {\n placeholder: 'Select...',\n searchPlaceholder: 'Search...',\n noResults: 'No results found',\n loading: 'Loading...',\n minChars: 'Type at least {{count}} characters',\n error: 'An error occurred',\n notFound: '[Record not found]',\n clear: 'Clear selection',\n open: 'Open dropdown',\n close: 'Close dropdown',\n 'announcements.loading': 'Loading results',\n 'announcements.noResults': 'No results found',\n 'announcements.cleared': 'Selection cleared',\n 'announcements.opened': 'Dropdown opened, {{count}} results available',\n 'announcements.closed': 'Dropdown closed',\n 'announcements.selected': '{{value}} selected',\n 'announcements.resultsLoaded': '{{count}} results loaded',\n 'validation.required': 'This field is required',\n 'validation.requiredIndicator': '*',\n}\n\nfunction interpolate(template: string, params?: Record<string, unknown>): string {\n if (!params) return template\n return template.replace(/\\{\\{(\\w+)\\}\\}/g, (_, key) => String(params[key] ?? ''))\n}\n\ntype TFunction = (key: string, params?: Record<string, unknown>) => string\n\ninterface UseTranslationSafeResult {\n t: TFunction\n i18n: ReturnType<typeof useTranslation>['i18n'] | null\n}\n\nexport function useTranslationSafe(): UseTranslationSafeResult {\n try {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const { t: i18nT, i18n } = useTranslation('lookupField')\n // If i18n is not initialized, fall back\n if (!i18n.isInitialized) {\n throw new Error('i18n not initialized')\n }\n return {\n t: (key: string, params?: Record<string, unknown>) =>\n params ? i18nT(key, params as Record<string, string | number>) : i18nT(key),\n i18n,\n }\n } catch {\n // Return fallback t function when i18next is not available\n const fallbackT: TFunction = (key: string, params?: Record<string, unknown>) => {\n const template = FALLBACK_STRINGS[key] ?? key\n return interpolate(template, params)\n }\n return { t: fallbackT, i18n: null }\n }\n}\n","import { type RefObject, useCallback, useEffect } from 'react'\n\n/**\n * Hook to detect clicks outside a referenced element.\n * Uses mousedown for immediate detection.\n *\n * @param ref - Reference to the element to monitor\n * @param handler - Callback when click outside occurs\n * @param enabled - Whether the hook is active (default: true)\n */\nexport function useClickOutside<T extends HTMLElement>(\n ref: RefObject<T | null>,\n handler: (event: MouseEvent) => void,\n enabled: boolean = true\n): void {\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (ref.current && !ref.current.contains(event.target as Node)) {\n handler(event)\n }\n },\n [ref, handler]\n )\n\n useEffect(() => {\n if (!enabled) return\n\n // Use mousedown for immediate detection (before click completes)\n document.addEventListener('mousedown', handleClickOutside)\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [handleClickOutside, enabled])\n}\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nconst invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);\n}\nconst tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);\nfunction isTableElement(element) {\n return tableElements.has(getNodeName(element));\n}\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction isTopLayer(element) {\n return topLayerSelectors.some(selector => {\n try {\n return element.matches(selector);\n } catch (_e) {\n return false;\n }\n });\n}\nconst transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];\nconst willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];\nconst containValues = ['paint', 'layout', 'strict', 'content'];\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nconst lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);\nfunction isLastTraversableNode(node) {\n return lastTraversableNodeNames.has(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nconst yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);\nfunction getSideAxis(placement) {\n return yAxisSides.has(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { isShadowRoot, isHTMLElement } from '@floating-ui/utils/dom';\nimport * as React from 'react';\nimport { useLayoutEffect } from 'react';\nimport { floor } from '@floating-ui/utils';\nimport { tabbable } from 'tabbable';\n\n// Avoid Chrome DevTools blue warning.\nfunction getPlatform() {\n const uaData = navigator.userAgentData;\n if (uaData != null && uaData.platform) {\n return uaData.platform;\n }\n return navigator.platform;\n}\nfunction getUserAgent() {\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n return uaData.brands.map(_ref => {\n let {\n brand,\n version\n } = _ref;\n return brand + \"/\" + version;\n }).join(' ');\n }\n return navigator.userAgent;\n}\nfunction isSafari() {\n // Chrome DevTools does not complain about navigator.vendor\n return /apple/i.test(navigator.vendor);\n}\nfunction isAndroid() {\n const re = /android/i;\n return re.test(getPlatform()) || re.test(getUserAgent());\n}\nfunction isMac() {\n return getPlatform().toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;\n}\nfunction isJSDOM() {\n return getUserAgent().includes('jsdom/');\n}\n\nconst FOCUSABLE_ATTRIBUTE = 'data-floating-ui-focusable';\nconst TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nconst ARROW_LEFT = 'ArrowLeft';\nconst ARROW_RIGHT = 'ArrowRight';\nconst ARROW_UP = 'ArrowUp';\nconst ARROW_DOWN = 'ArrowDown';\n\nfunction activeElement(doc) {\n let activeElement = doc.activeElement;\n while (((_activeElement = activeElement) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) {\n var _activeElement;\n activeElement = activeElement.shadowRoot.activeElement;\n }\n return activeElement;\n}\nfunction contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n }\n\n // then fallback to custom implementation with Shadow DOM support\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) {\n return true;\n }\n // @ts-ignore\n next = next.parentNode || next.host;\n }\n }\n\n // Give up, the result is false\n return false;\n}\nfunction getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support\n // `composedPath()`, but browsers without shadow DOM don't.\n return event.target;\n}\nfunction isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const e = event;\n return e.target != null && node.contains(e.target);\n}\nfunction isRootElement(element) {\n return element.matches('html,body');\n}\nfunction getDocument(node) {\n return (node == null ? void 0 : node.ownerDocument) || document;\n}\nfunction isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\nfunction isTypeableCombobox(element) {\n if (!element) return false;\n return element.getAttribute('role') === 'combobox' && isTypeableElement(element);\n}\nfunction matchesFocusVisible(element) {\n // We don't want to block focus from working with `visibleOnly`\n // (JSDOM doesn't match `:focus-visible` when the element has `:focus`)\n if (!element || isJSDOM()) return true;\n try {\n return element.matches(':focus-visible');\n } catch (_e) {\n return true;\n }\n}\nfunction getFloatingFocusElement(floatingElement) {\n if (!floatingElement) {\n return null;\n }\n // Try to find the element that has `{...getFloatingProps()}` spread on it.\n // This indicates the floating element is acting as a positioning wrapper, and\n // so focus should be managed on the child element with the event handlers and\n // aria props.\n return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(\"[\" + FOCUSABLE_ATTRIBUTE + \"]\") || floatingElement;\n}\n\nfunction getNodeChildren(nodes, id, onlyOpenChildren) {\n if (onlyOpenChildren === void 0) {\n onlyOpenChildren = true;\n }\n const directChildren = nodes.filter(node => {\n var _node$context;\n return node.parentId === id && (!onlyOpenChildren || ((_node$context = node.context) == null ? void 0 : _node$context.open));\n });\n return directChildren.flatMap(child => [child, ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);\n}\nfunction getDeepestNode(nodes, id) {\n let deepestNodeId;\n let maxDepth = -1;\n function findDeepest(nodeId, depth) {\n if (depth > maxDepth) {\n deepestNodeId = nodeId;\n maxDepth = depth;\n }\n const children = getNodeChildren(nodes, nodeId);\n children.forEach(child => {\n findDeepest(child.id, depth + 1);\n });\n }\n findDeepest(id, 0);\n return nodes.find(node => node.id === deepestNodeId);\n}\nfunction getNodeAncestors(nodes, id) {\n var _nodes$find;\n let allAncestors = [];\n let currentParentId = (_nodes$find = nodes.find(node => node.id === id)) == null ? void 0 : _nodes$find.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode == null ? void 0 : currentNode.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}\n\nfunction stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nfunction isReactEvent(event) {\n return 'nativeEvent' in event;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/utils/src/isVirtualEvent.ts\nfunction isVirtualClick(event) {\n // FIXME: Firefox is now emitting a deprecation warning for `mozInputSource`.\n // Try to find a workaround for this. `react-aria` source still has the check.\n if (event.mozInputSource === 0 && event.isTrusted) {\n return true;\n }\n if (isAndroid() && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nfunction isVirtualPointerEvent(event) {\n if (isJSDOM()) return false;\n return !isAndroid() && event.width === 0 && event.height === 0 || isAndroid() && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||\n // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';\n}\nfunction isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\n\nvar isClient = typeof document !== 'undefined';\n\nvar noop = function noop() {};\nvar index = isClient ? useLayoutEffect : noop;\n\n// https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\nconst SafeReact = {\n ...React\n};\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect = useInsertionEffect || (fn => fn());\nfunction useEffectEvent(callback) {\n const ref = React.useRef(() => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error('Cannot call an event handler while rendering.');\n }\n });\n useSafeInsertionEffect(() => {\n ref.current = callback;\n });\n return React.useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return ref.current == null ? void 0 : ref.current(...args);\n }, []);\n}\n\nfunction isDifferentGridRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\nfunction isIndexOutOfListBounds(listRef, index) {\n return index < 0 || index >= listRef.current.length;\n}\nfunction getMinListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef, {\n disabledIndices\n });\n}\nfunction getMaxListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\nfunction findNonDisabledListIndex(listRef, _temp) {\n let {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n } = _temp === void 0 ? {} : _temp;\n let index = startingIndex;\n do {\n index += decrement ? -amount : amount;\n } while (index >= 0 && index <= listRef.current.length - 1 && isListIndexDisabled(listRef, index, disabledIndices));\n return index;\n}\nfunction getGridNavigatedIndex(listRef, _ref) {\n let {\n event,\n orientation,\n loop,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n prevIndex,\n stopEvent: stop = false\n } = _ref;\n let nextIndex = prevIndex;\n if (event.key === ARROW_UP) {\n stop && stopEvent(event);\n if (prevIndex === -1) {\n nextIndex = maxIndex;\n } else {\n nextIndex = findNonDisabledListIndex(listRef, {\n startingIndex: nextIndex,\n amount: cols,\n decrement: true,\n disabledIndices\n });\n if (loop && (prevIndex - cols < minIndex || nextIndex < 0)) {\n const col = prevIndex % cols;\n const maxCol = maxIndex % cols;\n const offset = maxIndex - (maxCol - col);\n if (maxCol === col) {\n nextIndex = maxIndex;\n } else {\n nextIndex = maxCol > col ? offset : offset - cols;\n }\n }\n }\n if (isIndexOutOfListBounds(listRef, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === ARROW_DOWN) {\n stop && stopEvent(event);\n if (prevIndex === -1) {\n nextIndex = minIndex;\n } else {\n nextIndex = findNonDisabledListIndex(listRef, {\n startingIndex: prevIndex,\n amount: cols,\n disabledIndices\n });\n if (loop && prevIndex + cols > maxIndex) {\n nextIndex = findNonDisabledListIndex(listRef, {\n startingIndex: prevIndex % cols - cols,\n amount: cols,\n disabledIndices\n });\n }\n }\n if (isIndexOutOfListBounds(listRef, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n\n // Remains on the same row/column.\n if (orientation === 'both') {\n const prevRow = floor(prevIndex / cols);\n if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {\n stop && stopEvent(event);\n if (prevIndex % cols !== cols - 1) {\n nextIndex = findNonDisabledListIndex(listRef, {\n startingIndex: prevIndex,\n disabledIndices\n });\n if (loop && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n } else if (loop) {\n nextIndex = findNonDisabledListIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {\n stop && stopEvent(event);\n if (prevIndex % cols !== 0) {\n nextIndex = findNonDisabledListIndex(listRef, {\n startingIndex: prevIndex,\n decrement: true,\n disabledIndices\n });\n if (loop && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(listRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n } else if (loop) {\n nextIndex = findNonDisabledListIndex(listRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n const lastRow = floor(maxIndex / cols) === prevRow;\n if (isIndexOutOfListBounds(listRef, nextIndex)) {\n if (loop && lastRow) {\n nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n } else {\n nextIndex = prevIndex;\n }\n }\n }\n return nextIndex;\n}\n\n/** For each cell index, gets the item index that occupies that cell */\nfunction createGridCellMap(sizes, cols, dense) {\n const cellMap = [];\n let startIndex = 0;\n sizes.forEach((_ref2, index) => {\n let {\n width,\n height\n } = _ref2;\n if (width > cols) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\"[Floating UI]: Invalid grid - item width at index \" + index + \" is greater than grid columns\");\n }\n }\n let itemPlaced = false;\n if (dense) {\n startIndex = 0;\n }\n while (!itemPlaced) {\n const targetCells = [];\n for (let i = 0; i < width; i++) {\n for (let j = 0; j < height; j++) {\n targetCells.push(startIndex + i + j * cols);\n }\n }\n if (startIndex % cols + width <= cols && targetCells.every(cell => cellMap[cell] == null)) {\n targetCells.forEach(cell => {\n cellMap[cell] = index;\n });\n itemPlaced = true;\n } else {\n startIndex++;\n }\n }\n });\n\n // convert into a non-sparse array\n return [...cellMap];\n}\n\n/** Gets cell index of an item's corner or -1 when index is -1. */\nfunction getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {\n if (index === -1) return -1;\n const firstCellIndex = cellMap.indexOf(index);\n const sizeItem = sizes[index];\n switch (corner) {\n case 'tl':\n return firstCellIndex;\n case 'tr':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + sizeItem.width - 1;\n case 'bl':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + (sizeItem.height - 1) * cols;\n case 'br':\n return cellMap.lastIndexOf(index);\n }\n}\n\n/** Gets all cell indices that correspond to the specified indices */\nfunction getGridCellIndices(indices, cellMap) {\n return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);\n}\nfunction isListIndexDisabled(listRef, index, disabledIndices) {\n if (typeof disabledIndices === 'function') {\n return disabledIndices(index);\n } else if (disabledIndices) {\n return disabledIndices.includes(index);\n }\n const element = listRef.current[index];\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}\n\nconst getTabbableOptions = () => ({\n getShadowRoot: true,\n displayCheck:\n // JSDOM does not support the `tabbable` library. To solve this we can\n // check if `ResizeObserver` is a real function (not polyfilled), which\n // determines if the current environment is JSDOM-like.\n typeof ResizeObserver === 'function' && ResizeObserver.toString().includes('[native code]') ? 'full' : 'none'\n});\nfunction getTabbableIn(container, dir) {\n const list = tabbable(container, getTabbableOptions());\n const len = list.length;\n if (len === 0) return;\n const active = activeElement(getDocument(container));\n const index = list.indexOf(active);\n const nextIndex = index === -1 ? dir === 1 ? 0 : len - 1 : index + dir;\n return list[nextIndex];\n}\nfunction getNextTabbable(referenceElement) {\n return getTabbableIn(getDocument(referenceElement).body, 1) || referenceElement;\n}\nfunction getPreviousTabbable(referenceElement) {\n return getTabbableIn(getDocument(referenceElement).body, -1) || referenceElement;\n}\nfunction isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nfunction disableFocusInside(container) {\n const tabbableElements = tabbable(container, getTabbableOptions());\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nfunction enableFocusInside(container) {\n const elements = container.querySelectorAll('[data-tabindex]');\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}\n\nexport { activeElement, contains, createGridCellMap, disableFocusInside, enableFocusInside, findNonDisabledListIndex, getDeepestNode, getDocument, getFloatingFocusElement, getGridCellIndexOfCorner, getGridCellIndices, getGridNavigatedIndex, getMaxListIndex, getMinListIndex, getNextTabbable, getNodeAncestors, getNodeChildren, getPlatform, getPreviousTabbable, getTabbableOptions, getTarget, getUserAgent, isAndroid, isDifferentGridRow, isEventTargetWithin, isIndexOutOfListBounds, isJSDOM, isListIndexDisabled, isMac, isMouseLikePointerType, isOutsideEvent, isReactEvent, isRootElement, isSafari, isTypeableCombobox, isTypeableElement, isVirtualClick, isVirtualPointerEvent, matchesFocusVisible, stopEvent, useEffectEvent, useLatestRef, index as useModernLayoutEffect };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nconst absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { computePosition, arrow as arrow$2, autoPlacement as autoPlacement$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1 } from '@floating-ui/dom';\nexport { autoUpdate, computePosition, detectOverflow, getOverflowAncestors, platform } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar isClient = typeof document !== 'undefined';\n\nvar noop = function noop() {};\nvar index = isClient ? useLayoutEffect : noop;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction getDPR(element) {\n if (typeof window === 'undefined') {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\n\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React.useState(null);\n const [_floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const openRef = useLatestRef(open);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n // The floating element's position may be recomputed while it's closed\n // but still mounted (such as when transitioning out). To ensure\n // `isPositioned` will be `false` initially on the next open, avoid\n // setting it to `true` when `open === false` (must be specified).\n isPositioned: openRef.current !== false\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef, openRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...(getDPR(elements.floating) >= 1.5 && {\n willChange: 'transform'\n })\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow$1 = options => {\n function isRef(value) {\n return {}.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(state) {\n const {\n element,\n padding\n } = typeof options === 'function' ? options(state) : options;\n if (element && isRef(element)) {\n if (element.current != null) {\n return arrow$2({\n element: element.current,\n padding\n }).fn(state);\n }\n return {};\n }\n if (element) {\n return arrow$2({\n element,\n padding\n }).fn(state);\n }\n return {};\n }\n };\n};\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = (options, deps) => ({\n ...offset$1(options),\n options: [options, deps]\n});\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = (options, deps) => ({\n ...shift$1(options),\n options: [options, deps]\n});\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = (options, deps) => ({\n ...limitShift$1(options),\n options: [options, deps]\n});\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = (options, deps) => ({\n ...flip$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = (options, deps) => ({\n ...size$1(options),\n options: [options, deps]\n});\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = (options, deps) => ({\n ...autoPlacement$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = (options, deps) => ({\n ...hide$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = (options, deps) => ({\n ...inline$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = (options, deps) => ({\n ...arrow$1(options),\n options: [options, deps]\n});\n\nexport { arrow, autoPlacement, flip, hide, inline, limitShift, offset, shift, size, useFloating };\n","import * as React from 'react';\nimport { useModernLayoutEffect, useEffectEvent, getMinListIndex, getMaxListIndex, createGridCellMap, isListIndexDisabled, getGridNavigatedIndex, getGridCellIndexOfCorner, getGridCellIndices, findNonDisabledListIndex, isIndexOutOfListBounds, useLatestRef, getDocument as getDocument$1, isMouseLikePointerType, contains as contains$1, isSafari, enableFocusInside, isOutsideEvent, getPreviousTabbable, getNextTabbable, disableFocusInside, isTypeableCombobox, getFloatingFocusElement, getTabbableOptions, getNodeAncestors, activeElement, getNodeChildren as getNodeChildren$1, stopEvent, getTarget as getTarget$1, isVirtualClick, isVirtualPointerEvent, getPlatform, isTypeableElement, isReactEvent, isRootElement, isEventTargetWithin, matchesFocusVisible, isMac, getDeepestNode, getUserAgent } from '@floating-ui/react/utils';\nimport { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport { getComputedStyle, isElement, isShadowRoot, getNodeName, isNode, isHTMLElement, getWindow, isLastTraversableNode, getParentNode, isWebKit } from '@floating-ui/utils/dom';\nimport { tabbable, isTabbable, focusable } from 'tabbable';\nimport * as ReactDOM from 'react-dom';\nimport { getOverflowAncestors, useFloating as useFloating$1, offset, detectOverflow } from '@floating-ui/react-dom';\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size } from '@floating-ui/react-dom';\nimport { evaluate, max, round, min } from '@floating-ui/utils';\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n * @see https://floating-ui.com/docs/react-utils#usemergerefs\n */\nfunction useMergeRefs(refs) {\n const cleanupRef = React.useRef(undefined);\n const refEffect = React.useCallback(instance => {\n const cleanups = refs.map(ref => {\n if (ref == null) {\n return;\n }\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return typeof refCleanup === 'function' ? refCleanup : () => {\n refCallback(null);\n };\n }\n ref.current = instance;\n return () => {\n ref.current = null;\n };\n });\n return () => {\n cleanups.forEach(refCleanup => refCleanup == null ? void 0 : refCleanup());\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return value => {\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n if (value != null) {\n cleanupRef.current = refEffect(value);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}\n\nfunction sortByDocumentPosition(a, b) {\n const position = a.compareDocumentPosition(b);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return -1;\n }\n if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {\n return 1;\n }\n return 0;\n}\nconst FloatingListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n map: /*#__PURE__*/new Map(),\n elementsRef: {\n current: []\n }\n});\n/**\n * Provides context for a list of items within the floating element.\n * @see https://floating-ui.com/docs/FloatingList\n */\nfunction FloatingList(props) {\n const {\n children,\n elementsRef,\n labelsRef\n } = props;\n const [nodes, setNodes] = React.useState(() => new Set());\n const register = React.useCallback(node => {\n setNodes(prevSet => new Set(prevSet).add(node));\n }, []);\n const unregister = React.useCallback(node => {\n setNodes(prevSet => {\n const set = new Set(prevSet);\n set.delete(node);\n return set;\n });\n }, []);\n const map = React.useMemo(() => {\n const newMap = new Map();\n const sortedNodes = Array.from(nodes.keys()).sort(sortByDocumentPosition);\n sortedNodes.forEach((node, index) => {\n newMap.set(node, index);\n });\n return newMap;\n }, [nodes]);\n return /*#__PURE__*/jsx(FloatingListContext.Provider, {\n value: React.useMemo(() => ({\n register,\n unregister,\n map,\n elementsRef,\n labelsRef\n }), [register, unregister, map, elementsRef, labelsRef]),\n children: children\n });\n}\n/**\n * Used to register a list item and its index (DOM position) in the\n * `FloatingList`.\n * @see https://floating-ui.com/docs/FloatingList#uselistitem\n */\nfunction useListItem(props) {\n if (props === void 0) {\n props = {};\n }\n const {\n label\n } = props;\n const {\n register,\n unregister,\n map,\n elementsRef,\n labelsRef\n } = React.useContext(FloatingListContext);\n const [index, setIndex] = React.useState(null);\n const componentRef = React.useRef(null);\n const ref = React.useCallback(node => {\n componentRef.current = node;\n if (index !== null) {\n elementsRef.current[index] = node;\n if (labelsRef) {\n var _node$textContent;\n const isLabelDefined = label !== undefined;\n labelsRef.current[index] = isLabelDefined ? label : (_node$textContent = node == null ? void 0 : node.textContent) != null ? _node$textContent : null;\n }\n }\n }, [index, elementsRef, labelsRef, label]);\n useModernLayoutEffect(() => {\n const node = componentRef.current;\n if (node) {\n register(node);\n return () => {\n unregister(node);\n };\n }\n }, [register, unregister]);\n useModernLayoutEffect(() => {\n const index = componentRef.current ? map.get(componentRef.current) : null;\n if (index != null) {\n setIndex(index);\n }\n }, [map]);\n return React.useMemo(() => ({\n ref,\n index: index == null ? -1 : index\n }), [index, ref]);\n}\n\nconst FOCUSABLE_ATTRIBUTE = 'data-floating-ui-focusable';\nconst ACTIVE_KEY = 'active';\nconst SELECTED_KEY = 'selected';\nconst ARROW_LEFT = 'ArrowLeft';\nconst ARROW_RIGHT = 'ArrowRight';\nconst ARROW_UP = 'ArrowUp';\nconst ARROW_DOWN = 'ArrowDown';\n\nfunction renderJsx(render, computedProps) {\n if (typeof render === 'function') {\n return render(computedProps);\n }\n if (render) {\n return /*#__PURE__*/React.cloneElement(render, computedProps);\n }\n return /*#__PURE__*/jsx(\"div\", {\n ...computedProps\n });\n}\nconst CompositeContext = /*#__PURE__*/React.createContext({\n activeIndex: 0,\n onNavigate: () => {}\n});\nconst horizontalKeys = [ARROW_LEFT, ARROW_RIGHT];\nconst verticalKeys = [ARROW_UP, ARROW_DOWN];\nconst allKeys = [...horizontalKeys, ...verticalKeys];\n\n/**\n * Creates a single tab stop whose items are navigated by arrow keys, which\n * provides list navigation outside of floating element contexts.\n *\n * This is useful to enable navigation of a list of items that aren’t part of a\n * floating element. A menubar is an example of a composite, with each reference\n * element being an item.\n * @see https://floating-ui.com/docs/Composite\n */\nconst Composite = /*#__PURE__*/React.forwardRef(function Composite(props, forwardedRef) {\n const {\n render,\n orientation = 'both',\n loop = true,\n rtl = false,\n cols = 1,\n disabledIndices,\n activeIndex: externalActiveIndex,\n onNavigate: externalSetActiveIndex,\n itemSizes,\n dense = false,\n ...domProps\n } = props;\n const [internalActiveIndex, internalSetActiveIndex] = React.useState(0);\n const activeIndex = externalActiveIndex != null ? externalActiveIndex : internalActiveIndex;\n const onNavigate = useEffectEvent(externalSetActiveIndex != null ? externalSetActiveIndex : internalSetActiveIndex);\n const elementsRef = React.useRef([]);\n const renderElementProps = render && typeof render !== 'function' ? render.props : {};\n const contextValue = React.useMemo(() => ({\n activeIndex,\n onNavigate\n }), [activeIndex, onNavigate]);\n const isGrid = cols > 1;\n function handleKeyDown(event) {\n if (!allKeys.includes(event.key)) return;\n let nextIndex = activeIndex;\n const minIndex = getMinListIndex(elementsRef, disabledIndices);\n const maxIndex = getMaxListIndex(elementsRef, disabledIndices);\n const horizontalEndKey = rtl ? ARROW_LEFT : ARROW_RIGHT;\n const horizontalStartKey = rtl ? ARROW_RIGHT : ARROW_LEFT;\n if (isGrid) {\n const sizes = itemSizes || Array.from({\n length: elementsRef.current.length\n }, () => ({\n width: 1,\n height: 1\n }));\n // To calculate movements on the grid, we use hypothetical cell indices\n // as if every item was 1x1, then convert back to real indices.\n const cellMap = createGridCellMap(sizes, cols, dense);\n const minGridIndex = cellMap.findIndex(index => index != null && !isListIndexDisabled(elementsRef, index, disabledIndices));\n // last enabled index\n const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(elementsRef, index, disabledIndices) ? cellIndex : foundIndex, -1);\n const maybeNextIndex = cellMap[getGridNavigatedIndex({\n current: cellMap.map(itemIndex => itemIndex ? elementsRef.current[itemIndex] : null)\n }, {\n event,\n orientation,\n loop,\n rtl,\n cols,\n // treat undefined (empty grid spaces) as disabled indices so we\n // don't end up in them\n disabledIndices: getGridCellIndices([...((typeof disabledIndices !== 'function' ? disabledIndices : null) || elementsRef.current.map((_, index) => isListIndexDisabled(elementsRef, index, disabledIndices) ? index : undefined)), undefined], cellMap),\n minIndex: minGridIndex,\n maxIndex: maxGridIndex,\n prevIndex: getGridCellIndexOfCorner(activeIndex > maxIndex ? minIndex : activeIndex, sizes, cellMap, cols,\n // use a corner matching the edge closest to the direction we're\n // moving in so we don't end up in the same item. Prefer\n // top/left over bottom/right.\n event.key === ARROW_DOWN ? 'bl' : event.key === horizontalEndKey ? 'tr' : 'tl')\n })];\n if (maybeNextIndex != null) {\n nextIndex = maybeNextIndex;\n }\n }\n const toEndKeys = {\n horizontal: [horizontalEndKey],\n vertical: [ARROW_DOWN],\n both: [horizontalEndKey, ARROW_DOWN]\n }[orientation];\n const toStartKeys = {\n horizontal: [horizontalStartKey],\n vertical: [ARROW_UP],\n both: [horizontalStartKey, ARROW_UP]\n }[orientation];\n const preventedKeys = isGrid ? allKeys : {\n horizontal: horizontalKeys,\n vertical: verticalKeys,\n both: allKeys\n }[orientation];\n if (nextIndex === activeIndex && [...toEndKeys, ...toStartKeys].includes(event.key)) {\n if (loop && nextIndex === maxIndex && toEndKeys.includes(event.key)) {\n nextIndex = minIndex;\n } else if (loop && nextIndex === minIndex && toStartKeys.includes(event.key)) {\n nextIndex = maxIndex;\n } else {\n nextIndex = findNonDisabledListIndex(elementsRef, {\n startingIndex: nextIndex,\n decrement: toStartKeys.includes(event.key),\n disabledIndices\n });\n }\n }\n if (nextIndex !== activeIndex && !isIndexOutOfListBounds(elementsRef, nextIndex)) {\n var _elementsRef$current$;\n event.stopPropagation();\n if (preventedKeys.includes(event.key)) {\n event.preventDefault();\n }\n onNavigate(nextIndex);\n (_elementsRef$current$ = elementsRef.current[nextIndex]) == null || _elementsRef$current$.focus();\n }\n }\n const computedProps = {\n ...domProps,\n ...renderElementProps,\n ref: forwardedRef,\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n onKeyDown(e) {\n domProps.onKeyDown == null || domProps.onKeyDown(e);\n renderElementProps.onKeyDown == null || renderElementProps.onKeyDown(e);\n handleKeyDown(e);\n }\n };\n return /*#__PURE__*/jsx(CompositeContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/jsx(FloatingList, {\n elementsRef: elementsRef,\n children: renderJsx(render, computedProps)\n })\n });\n});\n/**\n * @see https://floating-ui.com/docs/Composite\n */\nconst CompositeItem = /*#__PURE__*/React.forwardRef(function CompositeItem(props, forwardedRef) {\n const {\n render,\n ...domProps\n } = props;\n const renderElementProps = render && typeof render !== 'function' ? render.props : {};\n const {\n activeIndex,\n onNavigate\n } = React.useContext(CompositeContext);\n const {\n ref,\n index\n } = useListItem();\n const mergedRef = useMergeRefs([ref, forwardedRef, renderElementProps.ref]);\n const isActive = activeIndex === index;\n const computedProps = {\n ...domProps,\n ...renderElementProps,\n ref: mergedRef,\n tabIndex: isActive ? 0 : -1,\n 'data-active': isActive ? '' : undefined,\n onFocus(e) {\n domProps.onFocus == null || domProps.onFocus(e);\n renderElementProps.onFocus == null || renderElementProps.onFocus(e);\n onNavigate(index);\n }\n };\n return renderJsx(render, computedProps);\n});\n\n// https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\nconst SafeReact = {\n ...React\n};\n\nlet serverHandoffComplete = false;\nlet count = 0;\nconst genId = () => // Ensure the id is unique with multiple independent versions of Floating UI\n// on <React 18\n\"floating-ui-\" + Math.random().toString(36).slice(2, 6) + count++;\nfunction useFloatingId() {\n const [id, setId] = React.useState(() => serverHandoffComplete ? genId() : undefined);\n useModernLayoutEffect(() => {\n if (id == null) {\n setId(genId());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n React.useEffect(() => {\n serverHandoffComplete = true;\n }, []);\n return id;\n}\nconst useReactId = SafeReact.useId;\n\n/**\n * Uses React 18's built-in `useId()` when available, or falls back to a\n * slightly less performant (requiring a double render) implementation for\n * earlier React versions.\n * @see https://floating-ui.com/docs/react-utils#useid\n */\nconst useId = useReactId || useFloatingId;\n\nlet devMessageSet;\nif (process.env.NODE_ENV !== \"production\") {\n devMessageSet = /*#__PURE__*/new Set();\n}\nfunction warn() {\n var _devMessageSet;\n for (var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++) {\n messages[_key] = arguments[_key];\n }\n const message = \"Floating UI: \" + messages.join(' ');\n if (!((_devMessageSet = devMessageSet) != null && _devMessageSet.has(message))) {\n var _devMessageSet2;\n (_devMessageSet2 = devMessageSet) == null || _devMessageSet2.add(message);\n console.warn(message);\n }\n}\nfunction error() {\n var _devMessageSet3;\n for (var _len2 = arguments.length, messages = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n messages[_key2] = arguments[_key2];\n }\n const message = \"Floating UI: \" + messages.join(' ');\n if (!((_devMessageSet3 = devMessageSet) != null && _devMessageSet3.has(message))) {\n var _devMessageSet4;\n (_devMessageSet4 = devMessageSet) == null || _devMessageSet4.add(message);\n console.error(message);\n }\n}\n\n/**\n * Renders a pointing arrow triangle.\n * @see https://floating-ui.com/docs/FloatingArrow\n */\nconst FloatingArrow = /*#__PURE__*/React.forwardRef(function FloatingArrow(props, ref) {\n const {\n context: {\n placement,\n elements: {\n floating\n },\n middlewareData: {\n arrow,\n shift\n }\n },\n width = 14,\n height = 7,\n tipRadius = 0,\n strokeWidth = 0,\n staticOffset,\n stroke,\n d,\n style: {\n transform,\n ...restStyle\n } = {},\n ...rest\n } = props;\n if (process.env.NODE_ENV !== \"production\") {\n if (!ref) {\n warn('The `ref` prop is required for `FloatingArrow`.');\n }\n }\n const clipPathId = useId();\n const [isRTL, setIsRTL] = React.useState(false);\n\n // https://github.com/floating-ui/floating-ui/issues/2932\n useModernLayoutEffect(() => {\n if (!floating) return;\n const isRTL = getComputedStyle(floating).direction === 'rtl';\n if (isRTL) {\n setIsRTL(true);\n }\n }, [floating]);\n if (!floating) {\n return null;\n }\n const [side, alignment] = placement.split('-');\n const isVerticalSide = side === 'top' || side === 'bottom';\n let computedStaticOffset = staticOffset;\n if (isVerticalSide && shift != null && shift.x || !isVerticalSide && shift != null && shift.y) {\n computedStaticOffset = null;\n }\n\n // Strokes must be double the border width, this ensures the stroke's width\n // works as you'd expect.\n const computedStrokeWidth = strokeWidth * 2;\n const halfStrokeWidth = computedStrokeWidth / 2;\n const svgX = width / 2 * (tipRadius / -8 + 1);\n const svgY = height / 2 * tipRadius / 4;\n const isCustomShape = !!d;\n const yOffsetProp = computedStaticOffset && alignment === 'end' ? 'bottom' : 'top';\n let xOffsetProp = computedStaticOffset && alignment === 'end' ? 'right' : 'left';\n if (computedStaticOffset && isRTL) {\n xOffsetProp = alignment === 'end' ? 'left' : 'right';\n }\n const arrowX = (arrow == null ? void 0 : arrow.x) != null ? computedStaticOffset || arrow.x : '';\n const arrowY = (arrow == null ? void 0 : arrow.y) != null ? computedStaticOffset || arrow.y : '';\n const dValue = d || 'M0,0' + (\" H\" + width) + (\" L\" + (width - svgX) + \",\" + (height - svgY)) + (\" Q\" + width / 2 + \",\" + height + \" \" + svgX + \",\" + (height - svgY)) + ' Z';\n const rotation = {\n top: isCustomShape ? 'rotate(180deg)' : '',\n left: isCustomShape ? 'rotate(90deg)' : 'rotate(-90deg)',\n bottom: isCustomShape ? '' : 'rotate(180deg)',\n right: isCustomShape ? 'rotate(-90deg)' : 'rotate(90deg)'\n }[side];\n return /*#__PURE__*/jsxs(\"svg\", {\n ...rest,\n \"aria-hidden\": true,\n ref: ref,\n width: isCustomShape ? width : width + computedStrokeWidth,\n height: width,\n viewBox: \"0 0 \" + width + \" \" + (height > width ? height : width),\n style: {\n position: 'absolute',\n pointerEvents: 'none',\n [xOffsetProp]: arrowX,\n [yOffsetProp]: arrowY,\n [side]: isVerticalSide || isCustomShape ? '100%' : \"calc(100% - \" + computedStrokeWidth / 2 + \"px)\",\n transform: [rotation, transform].filter(t => !!t).join(' '),\n ...restStyle\n },\n children: [computedStrokeWidth > 0 && /*#__PURE__*/jsx(\"path\", {\n clipPath: \"url(#\" + clipPathId + \")\",\n fill: \"none\",\n stroke: stroke\n // Account for the stroke on the fill path rendered below.\n ,\n strokeWidth: computedStrokeWidth + (d ? 0 : 1),\n d: dValue\n }), /*#__PURE__*/jsx(\"path\", {\n stroke: computedStrokeWidth && !d ? rest.fill : 'none',\n d: dValue\n }), /*#__PURE__*/jsx(\"clipPath\", {\n id: clipPathId,\n children: /*#__PURE__*/jsx(\"rect\", {\n x: -halfStrokeWidth,\n y: halfStrokeWidth * (isCustomShape ? -1 : 1),\n width: width + computedStrokeWidth,\n height: width\n })\n })]\n });\n});\n\nfunction createEventEmitter() {\n const map = new Map();\n return {\n emit(event, data) {\n var _map$get;\n (_map$get = map.get(event)) == null || _map$get.forEach(listener => listener(data));\n },\n on(event, listener) {\n if (!map.has(event)) {\n map.set(event, new Set());\n }\n map.get(event).add(listener);\n },\n off(event, listener) {\n var _map$get2;\n (_map$get2 = map.get(event)) == null || _map$get2.delete(listener);\n }\n };\n}\n\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the parent node id for nested floating elements, if available.\n * Returns `null` for top-level floating elements.\n */\nconst useFloatingParentNodeId = () => {\n var _React$useContext;\n return ((_React$useContext = React.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;\n};\n\n/**\n * Returns the nearest floating tree context, if available.\n */\nconst useFloatingTree = () => React.useContext(FloatingTreeContext);\n\n/**\n * Registers a node into the `FloatingTree`, returning its id.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nfunction useFloatingNodeId(customParentId) {\n const id = useId();\n const tree = useFloatingTree();\n const reactParentId = useFloatingParentNodeId();\n const parentId = customParentId || reactParentId;\n useModernLayoutEffect(() => {\n if (!id) return;\n const node = {\n id,\n parentId\n };\n tree == null || tree.addNode(node);\n return () => {\n tree == null || tree.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n}\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nfunction FloatingNode(props) {\n const {\n children,\n id\n } = props;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/jsx(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId]),\n children: children\n });\n}\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM.\n * This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:\n * - The `bubbles` option in the `useDismiss()` Hook\n * - Nested virtual list navigation\n * - Nested floating elements that each open on hover\n * - Custom communication between parent and child floating elements\n * @see https://floating-ui.com/docs/FloatingTree\n */\nfunction FloatingTree(props) {\n const {\n children\n } = props;\n const nodesRef = React.useRef([]);\n const addNode = React.useCallback(node => {\n nodesRef.current = [...nodesRef.current, node];\n }, []);\n const removeNode = React.useCallback(node => {\n nodesRef.current = nodesRef.current.filter(n => n !== node);\n }, []);\n const [events] = React.useState(() => createEventEmitter());\n return /*#__PURE__*/jsx(FloatingTreeContext.Provider, {\n value: React.useMemo(() => ({\n nodesRef,\n addNode,\n removeNode,\n events\n }), [addNode, removeNode, events]),\n children: children\n });\n}\n\nfunction createAttribute(name) {\n return \"data-floating-ui-\" + name;\n}\n\nfunction clearTimeoutIfSet(timeoutRef) {\n if (timeoutRef.current !== -1) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = -1;\n }\n}\n\nconst safePolygonIdentifier = /*#__PURE__*/createAttribute('safe-polygon');\nfunction getDelay(value, prop, pointerType) {\n if (pointerType && !isMouseLikePointerType(pointerType)) {\n return 0;\n }\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'function') {\n const result = value();\n if (typeof result === 'number') {\n return result;\n }\n return result == null ? void 0 : result[prop];\n }\n return value == null ? void 0 : value[prop];\n}\nfunction getRestMs(value) {\n if (typeof value === 'function') {\n return value();\n }\n return value;\n}\n/**\n * Opens the floating element while hovering over the reference element, like\n * CSS `:hover`.\n * @see https://floating-ui.com/docs/useHover\n */\nfunction useHover(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n dataRef,\n events,\n elements\n } = context;\n const {\n enabled = true,\n delay = 0,\n handleClose = null,\n mouseOnly = false,\n restMs = 0,\n move = true\n } = props;\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n const handleCloseRef = useLatestRef(handleClose);\n const delayRef = useLatestRef(delay);\n const openRef = useLatestRef(open);\n const restMsRef = useLatestRef(restMs);\n const pointerTypeRef = React.useRef();\n const timeoutRef = React.useRef(-1);\n const handlerRef = React.useRef();\n const restTimeoutRef = React.useRef(-1);\n const blockMouseMoveRef = React.useRef(true);\n const performedPointerEventsMutationRef = React.useRef(false);\n const unbindMouseMoveRef = React.useRef(() => {});\n const restTimeoutPendingRef = React.useRef(false);\n const isHoverOpen = useEffectEvent(() => {\n var _dataRef$current$open;\n const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;\n return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';\n });\n\n // When closing before opening, clear the delay timeouts to cancel it\n // from showing.\n React.useEffect(() => {\n if (!enabled) return;\n function onOpenChange(_ref) {\n let {\n open\n } = _ref;\n if (!open) {\n clearTimeoutIfSet(timeoutRef);\n clearTimeoutIfSet(restTimeoutRef);\n blockMouseMoveRef.current = true;\n restTimeoutPendingRef.current = false;\n }\n }\n events.on('openchange', onOpenChange);\n return () => {\n events.off('openchange', onOpenChange);\n };\n }, [enabled, events]);\n React.useEffect(() => {\n if (!enabled) return;\n if (!handleCloseRef.current) return;\n if (!open) return;\n function onLeave(event) {\n if (isHoverOpen()) {\n onOpenChange(false, event, 'hover');\n }\n }\n const html = getDocument$1(elements.floating).documentElement;\n html.addEventListener('mouseleave', onLeave);\n return () => {\n html.removeEventListener('mouseleave', onLeave);\n };\n }, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);\n const closeWithDelay = React.useCallback(function (event, runElseBranch, reason) {\n if (runElseBranch === void 0) {\n runElseBranch = true;\n }\n if (reason === void 0) {\n reason = 'hover';\n }\n const closeDelay = getDelay(delayRef.current, 'close', pointerTypeRef.current);\n if (closeDelay && !handlerRef.current) {\n clearTimeoutIfSet(timeoutRef);\n timeoutRef.current = window.setTimeout(() => onOpenChange(false, event, reason), closeDelay);\n } else if (runElseBranch) {\n clearTimeoutIfSet(timeoutRef);\n onOpenChange(false, event, reason);\n }\n }, [delayRef, onOpenChange]);\n const cleanupMouseMoveHandler = useEffectEvent(() => {\n unbindMouseMoveRef.current();\n handlerRef.current = undefined;\n });\n const clearPointerEvents = useEffectEvent(() => {\n if (performedPointerEventsMutationRef.current) {\n const body = getDocument$1(elements.floating).body;\n body.style.pointerEvents = '';\n body.removeAttribute(safePolygonIdentifier);\n performedPointerEventsMutationRef.current = false;\n }\n });\n const isClickLikeOpenEvent = useEffectEvent(() => {\n return dataRef.current.openEvent ? ['click', 'mousedown'].includes(dataRef.current.openEvent.type) : false;\n });\n\n // Registering the mouse events on the reference directly to bypass React's\n // delegation system. If the cursor was on a disabled element and then entered\n // the reference (no gap), `mouseenter` doesn't fire in the delegation system.\n React.useEffect(() => {\n if (!enabled) return;\n function onReferenceMouseEnter(event) {\n clearTimeoutIfSet(timeoutRef);\n blockMouseMoveRef.current = false;\n if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current) || getRestMs(restMsRef.current) > 0 && !getDelay(delayRef.current, 'open')) {\n return;\n }\n const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);\n if (openDelay) {\n timeoutRef.current = window.setTimeout(() => {\n if (!openRef.current) {\n onOpenChange(true, event, 'hover');\n }\n }, openDelay);\n } else if (!open) {\n onOpenChange(true, event, 'hover');\n }\n }\n function onReferenceMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n clearPointerEvents();\n return;\n }\n unbindMouseMoveRef.current();\n const doc = getDocument$1(elements.floating);\n clearTimeoutIfSet(restTimeoutRef);\n restTimeoutPendingRef.current = false;\n if (handleCloseRef.current && dataRef.current.floatingContext) {\n // Prevent clearing `onScrollMouseLeave` timeout.\n if (!open) {\n clearTimeoutIfSet(timeoutRef);\n }\n handlerRef.current = handleCloseRef.current({\n ...dataRef.current.floatingContext,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n if (!isClickLikeOpenEvent()) {\n closeWithDelay(event, true, 'safe-polygon');\n }\n }\n });\n const handler = handlerRef.current;\n doc.addEventListener('mousemove', handler);\n unbindMouseMoveRef.current = () => {\n doc.removeEventListener('mousemove', handler);\n };\n return;\n }\n\n // Allow interactivity without `safePolygon` on touch devices. With a\n // pointer, a short close delay is an alternative, so it should work\n // consistently.\n const shouldClose = pointerTypeRef.current === 'touch' ? !contains$1(elements.floating, event.relatedTarget) : true;\n if (shouldClose) {\n closeWithDelay(event);\n }\n }\n\n // Ensure the floating element closes after scrolling even if the pointer\n // did not move.\n // https://github.com/floating-ui/floating-ui/discussions/1692\n function onScrollMouseLeave(event) {\n if (isClickLikeOpenEvent()) return;\n if (!dataRef.current.floatingContext) return;\n handleCloseRef.current == null || handleCloseRef.current({\n ...dataRef.current.floatingContext,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n if (!isClickLikeOpenEvent()) {\n closeWithDelay(event);\n }\n }\n })(event);\n }\n function onFloatingMouseEnter() {\n clearTimeoutIfSet(timeoutRef);\n }\n function onFloatingMouseLeave(event) {\n if (!isClickLikeOpenEvent()) {\n closeWithDelay(event, false);\n }\n }\n if (isElement(elements.domReference)) {\n const reference = elements.domReference;\n const floating = elements.floating;\n if (open) {\n reference.addEventListener('mouseleave', onScrollMouseLeave);\n }\n if (move) {\n reference.addEventListener('mousemove', onReferenceMouseEnter, {\n once: true\n });\n }\n reference.addEventListener('mouseenter', onReferenceMouseEnter);\n reference.addEventListener('mouseleave', onReferenceMouseLeave);\n if (floating) {\n floating.addEventListener('mouseleave', onScrollMouseLeave);\n floating.addEventListener('mouseenter', onFloatingMouseEnter);\n floating.addEventListener('mouseleave', onFloatingMouseLeave);\n }\n return () => {\n if (open) {\n reference.removeEventListener('mouseleave', onScrollMouseLeave);\n }\n if (move) {\n reference.removeEventListener('mousemove', onReferenceMouseEnter);\n }\n reference.removeEventListener('mouseenter', onReferenceMouseEnter);\n reference.removeEventListener('mouseleave', onReferenceMouseLeave);\n if (floating) {\n floating.removeEventListener('mouseleave', onScrollMouseLeave);\n floating.removeEventListener('mouseenter', onFloatingMouseEnter);\n floating.removeEventListener('mouseleave', onFloatingMouseLeave);\n }\n };\n }\n }, [elements, enabled, context, mouseOnly, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef, isClickLikeOpenEvent, restMsRef]);\n\n // Block pointer-events of every element other than the reference and floating\n // while the floating element is open and has a `handleClose` handler. Also\n // handles nested floating elements.\n // https://github.com/floating-ui/floating-ui/issues/1722\n useModernLayoutEffect(() => {\n var _handleCloseRef$curre;\n if (!enabled) return;\n if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && (_handleCloseRef$curre = _handleCloseRef$curre.__options) != null && _handleCloseRef$curre.blockPointerEvents && isHoverOpen()) {\n performedPointerEventsMutationRef.current = true;\n const floatingEl = elements.floating;\n if (isElement(elements.domReference) && floatingEl) {\n var _tree$nodesRef$curren;\n const body = getDocument$1(elements.floating).body;\n body.setAttribute(safePolygonIdentifier, '');\n const ref = elements.domReference;\n const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating;\n if (parentFloating) {\n parentFloating.style.pointerEvents = '';\n }\n body.style.pointerEvents = 'none';\n ref.style.pointerEvents = 'auto';\n floatingEl.style.pointerEvents = 'auto';\n return () => {\n body.style.pointerEvents = '';\n ref.style.pointerEvents = '';\n floatingEl.style.pointerEvents = '';\n };\n }\n }\n }, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]);\n useModernLayoutEffect(() => {\n if (!open) {\n pointerTypeRef.current = undefined;\n restTimeoutPendingRef.current = false;\n cleanupMouseMoveHandler();\n clearPointerEvents();\n }\n }, [open, cleanupMouseMoveHandler, clearPointerEvents]);\n React.useEffect(() => {\n return () => {\n cleanupMouseMoveHandler();\n clearTimeoutIfSet(timeoutRef);\n clearTimeoutIfSet(restTimeoutRef);\n clearPointerEvents();\n };\n }, [enabled, elements.domReference, cleanupMouseMoveHandler, clearPointerEvents]);\n const reference = React.useMemo(() => {\n function setPointerRef(event) {\n pointerTypeRef.current = event.pointerType;\n }\n return {\n onPointerDown: setPointerRef,\n onPointerEnter: setPointerRef,\n onMouseMove(event) {\n const {\n nativeEvent\n } = event;\n function handleMouseMove() {\n if (!blockMouseMoveRef.current && !openRef.current) {\n onOpenChange(true, nativeEvent, 'hover');\n }\n }\n if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) {\n return;\n }\n if (open || getRestMs(restMsRef.current) === 0) {\n return;\n }\n\n // Ignore insignificant movements to account for tremors.\n if (restTimeoutPendingRef.current && event.movementX ** 2 + event.movementY ** 2 < 2) {\n return;\n }\n clearTimeoutIfSet(restTimeoutRef);\n if (pointerTypeRef.current === 'touch') {\n handleMouseMove();\n } else {\n restTimeoutPendingRef.current = true;\n restTimeoutRef.current = window.setTimeout(handleMouseMove, getRestMs(restMsRef.current));\n }\n }\n };\n }, [mouseOnly, onOpenChange, open, openRef, restMsRef]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nconst NOOP = () => {};\nconst FloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n delay: 0,\n initialDelay: 0,\n timeoutMs: 0,\n currentId: null,\n setCurrentId: NOOP,\n setState: NOOP,\n isInstantPhase: false\n});\n\n/**\n * @deprecated\n * Use the return value of `useDelayGroup()` instead.\n */\nconst useDelayGroupContext = () => React.useContext(FloatingDelayGroupContext);\n/**\n * Provides context for a group of floating elements that should share a\n * `delay`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\nfunction FloatingDelayGroup(props) {\n const {\n children,\n delay,\n timeoutMs = 0\n } = props;\n const [state, setState] = React.useReducer((prev, next) => ({\n ...prev,\n ...next\n }), {\n delay,\n timeoutMs,\n initialDelay: delay,\n currentId: null,\n isInstantPhase: false\n });\n const initialCurrentIdRef = React.useRef(null);\n const setCurrentId = React.useCallback(currentId => {\n setState({\n currentId\n });\n }, []);\n useModernLayoutEffect(() => {\n if (state.currentId) {\n if (initialCurrentIdRef.current === null) {\n initialCurrentIdRef.current = state.currentId;\n } else if (!state.isInstantPhase) {\n setState({\n isInstantPhase: true\n });\n }\n } else {\n if (state.isInstantPhase) {\n setState({\n isInstantPhase: false\n });\n }\n initialCurrentIdRef.current = null;\n }\n }, [state.currentId, state.isInstantPhase]);\n return /*#__PURE__*/jsx(FloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({\n ...state,\n setState,\n setCurrentId\n }), [state, setCurrentId]),\n children: children\n });\n}\n/**\n * Enables grouping when called inside a component that's a child of a\n * `FloatingDelayGroup`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\nfunction useDelayGroup(context, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n open,\n onOpenChange,\n floatingId\n } = context;\n const {\n id: optionId,\n enabled = true\n } = options;\n const id = optionId != null ? optionId : floatingId;\n const groupContext = useDelayGroupContext();\n const {\n currentId,\n setCurrentId,\n initialDelay,\n setState,\n timeoutMs\n } = groupContext;\n useModernLayoutEffect(() => {\n if (!enabled) return;\n if (!currentId) return;\n setState({\n delay: {\n open: 1,\n close: getDelay(initialDelay, 'close')\n }\n });\n if (currentId !== id) {\n onOpenChange(false);\n }\n }, [enabled, id, onOpenChange, setState, currentId, initialDelay]);\n useModernLayoutEffect(() => {\n function unset() {\n onOpenChange(false);\n setState({\n delay: initialDelay,\n currentId: null\n });\n }\n if (!enabled) return;\n if (!currentId) return;\n if (!open && currentId === id) {\n if (timeoutMs) {\n const timeout = window.setTimeout(unset, timeoutMs);\n return () => {\n clearTimeout(timeout);\n };\n }\n unset();\n }\n }, [enabled, open, setState, currentId, id, onOpenChange, initialDelay, timeoutMs]);\n useModernLayoutEffect(() => {\n if (!enabled) return;\n if (setCurrentId === NOOP || !open) return;\n setCurrentId(id);\n }, [enabled, open, setCurrentId, id]);\n return groupContext;\n}\n\nconst NextFloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n hasProvider: false,\n timeoutMs: 0,\n delayRef: {\n current: 0\n },\n initialDelayRef: {\n current: 0\n },\n timeoutIdRef: {\n current: -1\n },\n currentIdRef: {\n current: null\n },\n currentContextRef: {\n current: null\n }\n});\n/**\n * Experimental next version of `FloatingDelayGroup` to become the default\n * in the future. This component is not yet stable.\n * Provides context for a group of floating elements that should share a\n * `delay`. Unlike `FloatingDelayGroup`, `useNextDelayGroup` with this\n * component does not cause a re-render of unrelated consumers of the\n * context when the delay changes.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\nfunction NextFloatingDelayGroup(props) {\n const {\n children,\n delay,\n timeoutMs = 0\n } = props;\n const delayRef = React.useRef(delay);\n const initialDelayRef = React.useRef(delay);\n const currentIdRef = React.useRef(null);\n const currentContextRef = React.useRef(null);\n const timeoutIdRef = React.useRef(-1);\n return /*#__PURE__*/jsx(NextFloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({\n hasProvider: true,\n delayRef,\n initialDelayRef,\n currentIdRef,\n timeoutMs,\n currentContextRef,\n timeoutIdRef\n }), [timeoutMs]),\n children: children\n });\n}\n/**\n * Enables grouping when called inside a component that's a child of a\n * `NextFloatingDelayGroup`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\nfunction useNextDelayGroup(context, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n open,\n onOpenChange,\n floatingId\n } = context;\n const {\n enabled = true\n } = options;\n const groupContext = React.useContext(NextFloatingDelayGroupContext);\n const {\n currentIdRef,\n delayRef,\n timeoutMs,\n initialDelayRef,\n currentContextRef,\n hasProvider,\n timeoutIdRef\n } = groupContext;\n const [isInstantPhase, setIsInstantPhase] = React.useState(false);\n useModernLayoutEffect(() => {\n function unset() {\n var _currentContextRef$cu;\n setIsInstantPhase(false);\n (_currentContextRef$cu = currentContextRef.current) == null || _currentContextRef$cu.setIsInstantPhase(false);\n currentIdRef.current = null;\n currentContextRef.current = null;\n delayRef.current = initialDelayRef.current;\n }\n if (!enabled) return;\n if (!currentIdRef.current) return;\n if (!open && currentIdRef.current === floatingId) {\n setIsInstantPhase(false);\n if (timeoutMs) {\n timeoutIdRef.current = window.setTimeout(unset, timeoutMs);\n return () => {\n clearTimeout(timeoutIdRef.current);\n };\n }\n unset();\n }\n }, [enabled, open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeoutIdRef]);\n useModernLayoutEffect(() => {\n if (!enabled) return;\n if (!open) return;\n const prevContext = currentContextRef.current;\n const prevId = currentIdRef.current;\n currentContextRef.current = {\n onOpenChange,\n setIsInstantPhase\n };\n currentIdRef.current = floatingId;\n delayRef.current = {\n open: 0,\n close: getDelay(initialDelayRef.current, 'close')\n };\n if (prevId !== null && prevId !== floatingId) {\n clearTimeoutIfSet(timeoutIdRef);\n setIsInstantPhase(true);\n prevContext == null || prevContext.setIsInstantPhase(true);\n prevContext == null || prevContext.onOpenChange(false);\n } else {\n setIsInstantPhase(false);\n prevContext == null || prevContext.setIsInstantPhase(false);\n }\n }, [enabled, open, floatingId, onOpenChange, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeoutIdRef]);\n useModernLayoutEffect(() => {\n return () => {\n currentContextRef.current = null;\n };\n }, [currentContextRef]);\n return React.useMemo(() => ({\n hasProvider,\n delayRef,\n isInstantPhase\n }), [hasProvider, delayRef, isInstantPhase]);\n}\n\nlet rafId = 0;\nfunction enqueueFocus(el, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n preventScroll = false,\n cancelPrevious = true,\n sync = false\n } = options;\n cancelPrevious && cancelAnimationFrame(rafId);\n const exec = () => el == null ? void 0 : el.focus({\n preventScroll\n });\n if (sync) {\n exec();\n } else {\n rafId = requestAnimationFrame(exec);\n }\n}\n\nfunction contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n }\n\n // then fallback to custom implementation with Shadow DOM support\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) {\n return true;\n }\n // @ts-ignore\n next = next.parentNode || next.host;\n }\n }\n\n // Give up, the result is false\n return false;\n}\nfunction getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support\n // `composedPath()`, but browsers without shadow DOM don't.\n return event.target;\n}\nfunction getDocument(node) {\n return (node == null ? void 0 : node.ownerDocument) || document;\n}\n\n// Modified to add conditional `aria-hidden` support:\n// https://github.com/theKashey/aria-hidden/blob/9220c8f4a4fd35f63bee5510a9f41a37264382d4/src/index.ts\nconst counters = {\n inert: /*#__PURE__*/new WeakMap(),\n 'aria-hidden': /*#__PURE__*/new WeakMap(),\n none: /*#__PURE__*/new WeakMap()\n};\nfunction getCounterMap(control) {\n if (control === 'inert') return counters.inert;\n if (control === 'aria-hidden') return counters['aria-hidden'];\n return counters.none;\n}\nlet uncontrolledElementsSet = /*#__PURE__*/new WeakSet();\nlet markerMap = {};\nlet lockCount$1 = 0;\nconst supportsInert = () => typeof HTMLElement !== 'undefined' && 'inert' in HTMLElement.prototype;\nconst unwrapHost = node => node && (node.host || unwrapHost(node.parentNode));\nconst correctElements = (parent, targets) => targets.map(target => {\n if (parent.contains(target)) {\n return target;\n }\n const correctedTarget = unwrapHost(target);\n if (parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n return null;\n}).filter(x => x != null);\nfunction applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert) {\n const markerName = 'data-floating-ui-inert';\n const controlAttribute = inert ? 'inert' : ariaHidden ? 'aria-hidden' : null;\n const avoidElements = correctElements(body, uncorrectedAvoidElements);\n const elementsToKeep = new Set();\n const elementsToStop = new Set(avoidElements);\n const hiddenElements = [];\n if (!markerMap[markerName]) {\n markerMap[markerName] = new WeakMap();\n }\n const markerCounter = markerMap[markerName];\n avoidElements.forEach(keep);\n deep(body);\n elementsToKeep.clear();\n function keep(el) {\n if (!el || elementsToKeep.has(el)) {\n return;\n }\n elementsToKeep.add(el);\n el.parentNode && keep(el.parentNode);\n }\n function deep(parent) {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n [].forEach.call(parent.children, node => {\n if (getNodeName(node) === 'script') return;\n if (elementsToKeep.has(node)) {\n deep(node);\n } else {\n const attr = controlAttribute ? node.getAttribute(controlAttribute) : null;\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterMap = getCounterMap(controlAttribute);\n const counterValue = (counterMap.get(node) || 0) + 1;\n const markerValue = (markerCounter.get(node) || 0) + 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenElements.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledElementsSet.add(node);\n }\n if (markerValue === 1) {\n node.setAttribute(markerName, '');\n }\n if (!alreadyHidden && controlAttribute) {\n node.setAttribute(controlAttribute, controlAttribute === 'inert' ? '' : 'true');\n }\n }\n });\n }\n lockCount$1++;\n return () => {\n hiddenElements.forEach(element => {\n const counterMap = getCounterMap(controlAttribute);\n const currentCounterValue = counterMap.get(element) || 0;\n const counterValue = currentCounterValue - 1;\n const markerValue = (markerCounter.get(element) || 0) - 1;\n counterMap.set(element, counterValue);\n markerCounter.set(element, markerValue);\n if (!counterValue) {\n if (!uncontrolledElementsSet.has(element) && controlAttribute) {\n element.removeAttribute(controlAttribute);\n }\n uncontrolledElementsSet.delete(element);\n }\n if (!markerValue) {\n element.removeAttribute(markerName);\n }\n });\n lockCount$1--;\n if (!lockCount$1) {\n counters.inert = new WeakMap();\n counters['aria-hidden'] = new WeakMap();\n counters.none = new WeakMap();\n uncontrolledElementsSet = new WeakSet();\n markerMap = {};\n }\n };\n}\nfunction markOthers(avoidElements, ariaHidden, inert) {\n if (ariaHidden === void 0) {\n ariaHidden = false;\n }\n if (inert === void 0) {\n inert = false;\n }\n const body = getDocument(avoidElements[0]).body;\n return applyAttributeToOthers(avoidElements.concat(Array.from(body.querySelectorAll('[aria-live],[role=\"status\"],output'))), body, ariaHidden, inert);\n}\n\nconst HIDDEN_STYLES = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'fixed',\n whiteSpace: 'nowrap',\n width: '1px',\n top: 0,\n left: 0\n};\nconst FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const [role, setRole] = React.useState();\n useModernLayoutEffect(() => {\n if (isSafari()) {\n // Unlike other screen readers such as NVDA and JAWS, the virtual cursor\n // on VoiceOver does trigger the onFocus event, so we can use the focus\n // trap element. On Safari, only buttons trigger the onFocus event.\n // NB: \"group\" role in the Sandbox no longer appears to work, must be a\n // button role.\n setRole('button');\n }\n }, []);\n const restProps = {\n ref,\n tabIndex: 0,\n // Role is only for VoiceOver\n role,\n 'aria-hidden': role ? undefined : true,\n [createAttribute('focus-guard')]: '',\n style: HIDDEN_STYLES\n };\n return /*#__PURE__*/jsx(\"span\", {\n ...props,\n ...restProps\n });\n});\n\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nconst attr = /*#__PURE__*/createAttribute('portal');\n/**\n * @see https://floating-ui.com/docs/FloatingPortal#usefloatingportalnode\n */\nfunction useFloatingPortalNode(props) {\n if (props === void 0) {\n props = {};\n }\n const {\n id,\n root\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const [portalNode, setPortalNode] = React.useState(null);\n const portalNodeRef = React.useRef(null);\n useModernLayoutEffect(() => {\n return () => {\n portalNode == null || portalNode.remove();\n // Allow the subsequent layout effects to create a new node on updates.\n // The portal node will still be cleaned up on unmount.\n // https://github.com/floating-ui/floating-ui/issues/2454\n queueMicrotask(() => {\n portalNodeRef.current = null;\n });\n };\n }, [portalNode]);\n useModernLayoutEffect(() => {\n // Wait for the uniqueId to be generated before creating the portal node in\n // React <18 (using `useFloatingId` instead of the native `useId`).\n // https://github.com/floating-ui/floating-ui/issues/2778\n if (!uniqueId) return;\n if (portalNodeRef.current) return;\n const existingIdRoot = id ? document.getElementById(id) : null;\n if (!existingIdRoot) return;\n const subRoot = document.createElement('div');\n subRoot.id = uniqueId;\n subRoot.setAttribute(attr, '');\n existingIdRoot.appendChild(subRoot);\n portalNodeRef.current = subRoot;\n setPortalNode(subRoot);\n }, [id, uniqueId]);\n useModernLayoutEffect(() => {\n // Wait for the root to exist before creating the portal node. The root must\n // be stored in state, not a ref, for this to work reactively.\n if (root === null) return;\n if (!uniqueId) return;\n if (portalNodeRef.current) return;\n let container = root || (portalContext == null ? void 0 : portalContext.portalNode);\n if (container && !isNode(container)) container = container.current;\n container = container || document.body;\n let idWrapper = null;\n if (id) {\n idWrapper = document.createElement('div');\n idWrapper.id = id;\n container.appendChild(idWrapper);\n }\n const subRoot = document.createElement('div');\n subRoot.id = uniqueId;\n subRoot.setAttribute(attr, '');\n container = idWrapper || container;\n container.appendChild(subRoot);\n portalNodeRef.current = subRoot;\n setPortalNode(subRoot);\n }, [id, root, uniqueId, portalContext]);\n return portalNode;\n}\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n */\nfunction FloatingPortal(props) {\n const {\n children,\n id,\n root,\n preserveTabOrder = true\n } = props;\n const portalNode = useFloatingPortalNode({\n id,\n root\n });\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const modal = focusManagerState == null ? void 0 : focusManagerState.modal;\n const open = focusManagerState == null ? void 0 : focusManagerState.open;\n const shouldRenderGuards =\n // The FocusManager and therefore floating element are currently open/\n // rendered.\n !!focusManagerState &&\n // Guards are only for non-modal focus management.\n !focusManagerState.modal &&\n // Don't render if unmount is transitioning.\n focusManagerState.open && preserveTabOrder && !!(root || portalNode);\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || !preserveTabOrder || modal) {\n return;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && isOutsideEvent(event)) {\n const focusing = event.type === 'focusin';\n const manageFocus = focusing ? enableFocusInside : disableFocusInside;\n manageFocus(portalNode);\n }\n }\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n portalNode.addEventListener('focusin', onFocus, true);\n portalNode.addEventListener('focusout', onFocus, true);\n return () => {\n portalNode.removeEventListener('focusin', onFocus, true);\n portalNode.removeEventListener('focusout', onFocus, true);\n };\n }, [portalNode, preserveTabOrder, modal]);\n React.useEffect(() => {\n if (!portalNode) return;\n if (open) return;\n enableFocusInside(portalNode);\n }, [open, portalNode]);\n return /*#__PURE__*/jsxs(PortalContext.Provider, {\n value: React.useMemo(() => ({\n preserveTabOrder,\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [preserveTabOrder, portalNode]),\n children: [shouldRenderGuards && portalNode && /*#__PURE__*/jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _beforeInsideRef$curr;\n (_beforeInsideRef$curr = beforeInsideRef.current) == null || _beforeInsideRef$curr.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable == null || prevTabbable.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/jsx(\"span\", {\n \"aria-owns\": portalNode.id,\n style: HIDDEN_STYLES\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _afterInsideRef$curre;\n (_afterInsideRef$curre = afterInsideRef.current) == null || _afterInsideRef$curre.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable == null || nextTabbable.focus();\n (focusManagerState == null ? void 0 : focusManagerState.closeOnFocusOut) && (focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false, event.nativeEvent, 'focus-out'));\n }\n }\n })]\n });\n}\nconst usePortalContext = () => React.useContext(PortalContext);\n\nfunction useLiteMergeRefs(refs) {\n return React.useMemo(() => {\n return value => {\n refs.forEach(ref => {\n if (ref) {\n ref.current = value;\n }\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}\n\nconst LIST_LIMIT = 20;\nlet previouslyFocusedElements = [];\nfunction clearDisconnectedPreviouslyFocusedElements() {\n previouslyFocusedElements = previouslyFocusedElements.filter(el => el.isConnected);\n}\nfunction addPreviouslyFocusedElement(element) {\n clearDisconnectedPreviouslyFocusedElements();\n if (element && getNodeName(element) !== 'body') {\n previouslyFocusedElements.push(element);\n if (previouslyFocusedElements.length > LIST_LIMIT) {\n previouslyFocusedElements = previouslyFocusedElements.slice(-20);\n }\n }\n}\nfunction getPreviouslyFocusedElement() {\n clearDisconnectedPreviouslyFocusedElements();\n return previouslyFocusedElements[previouslyFocusedElements.length - 1];\n}\nfunction getFirstTabbableElement(container) {\n const tabbableOptions = getTabbableOptions();\n if (isTabbable(container, tabbableOptions)) {\n return container;\n }\n return tabbable(container, tabbableOptions)[0] || container;\n}\nfunction handleTabIndex(floatingFocusElement, orderRef) {\n var _floatingFocusElement;\n if (!orderRef.current.includes('floating') && !((_floatingFocusElement = floatingFocusElement.getAttribute('role')) != null && _floatingFocusElement.includes('dialog'))) {\n return;\n }\n const options = getTabbableOptions();\n const focusableElements = focusable(floatingFocusElement, options);\n const tabbableContent = focusableElements.filter(element => {\n const dataTabIndex = element.getAttribute('data-tabindex') || '';\n return isTabbable(element, options) || element.hasAttribute('data-tabindex') && !dataTabIndex.startsWith('-');\n });\n const tabIndex = floatingFocusElement.getAttribute('tabindex');\n if (orderRef.current.includes('floating') || tabbableContent.length === 0) {\n if (tabIndex !== '0') {\n floatingFocusElement.setAttribute('tabindex', '0');\n }\n } else if (tabIndex !== '-1' || floatingFocusElement.hasAttribute('data-tabindex') && floatingFocusElement.getAttribute('data-tabindex') !== '-1') {\n floatingFocusElement.setAttribute('tabindex', '-1');\n floatingFocusElement.setAttribute('data-tabindex', '-1');\n }\n}\nconst VisuallyHiddenDismiss = /*#__PURE__*/React.forwardRef(function VisuallyHiddenDismiss(props, ref) {\n return /*#__PURE__*/jsx(\"button\", {\n ...props,\n type: \"button\",\n ref: ref,\n tabIndex: -1,\n style: HIDDEN_STYLES\n });\n});\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n */\nfunction FloatingFocusManager(props) {\n const {\n context,\n children,\n disabled = false,\n order = ['content'],\n guards: _guards = true,\n initialFocus = 0,\n returnFocus = true,\n restoreFocus = false,\n modal = true,\n visuallyHiddenDismiss = false,\n closeOnFocusOut = true,\n outsideElementsInert = false,\n getInsideElements: _getInsideElements = () => []\n } = props;\n const {\n open,\n onOpenChange,\n events,\n dataRef,\n elements: {\n domReference,\n floating\n }\n } = context;\n const getNodeId = useEffectEvent(() => {\n var _dataRef$current$floa;\n return (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId;\n });\n const getInsideElements = useEffectEvent(_getInsideElements);\n const ignoreInitialFocus = typeof initialFocus === 'number' && initialFocus < 0;\n // If the reference is a combobox and is typeable (e.g. input/textarea),\n // there are different focus semantics. The guards should not be rendered, but\n // aria-hidden should be applied to all nodes still. Further, the visually\n // hidden dismiss button should only appear at the end of the list, not the\n // start.\n const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;\n\n // Force the guards to be rendered if the `inert` attribute is not supported.\n const inertSupported = supportsInert();\n const guards = inertSupported ? _guards : true;\n const useInert = !guards || inertSupported && outsideElementsInert;\n const orderRef = useLatestRef(order);\n const initialFocusRef = useLatestRef(initialFocus);\n const returnFocusRef = useLatestRef(returnFocus);\n const tree = useFloatingTree();\n const portalContext = usePortalContext();\n const startDismissButtonRef = React.useRef(null);\n const endDismissButtonRef = React.useRef(null);\n const preventReturnFocusRef = React.useRef(false);\n const isPointerDownRef = React.useRef(false);\n const tabbableIndexRef = React.useRef(-1);\n const blurTimeoutRef = React.useRef(-1);\n const isInsidePortal = portalContext != null;\n const floatingFocusElement = getFloatingFocusElement(floating);\n const getTabbableContent = useEffectEvent(function (container) {\n if (container === void 0) {\n container = floatingFocusElement;\n }\n return container ? tabbable(container, getTabbableOptions()) : [];\n });\n const getTabbableElements = useEffectEvent(container => {\n const content = getTabbableContent(container);\n return orderRef.current.map(type => {\n if (domReference && type === 'reference') {\n return domReference;\n }\n if (floatingFocusElement && type === 'floating') {\n return floatingFocusElement;\n }\n return content;\n }).filter(Boolean).flat();\n });\n React.useEffect(() => {\n if (disabled) return;\n if (!modal) return;\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (contains$1(floatingFocusElement, activeElement(getDocument$1(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {\n stopEvent(event);\n }\n const els = getTabbableElements();\n const target = getTarget$1(event);\n if (orderRef.current[0] === 'reference' && target === domReference) {\n stopEvent(event);\n if (event.shiftKey) {\n enqueueFocus(els[els.length - 1]);\n } else {\n enqueueFocus(els[1]);\n }\n }\n if (orderRef.current[1] === 'floating' && target === floatingFocusElement && event.shiftKey) {\n stopEvent(event);\n enqueueFocus(els[0]);\n }\n }\n }\n const doc = getDocument$1(floatingFocusElement);\n doc.addEventListener('keydown', onKeyDown);\n return () => {\n doc.removeEventListener('keydown', onKeyDown);\n };\n }, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent, getTabbableElements]);\n React.useEffect(() => {\n if (disabled) return;\n if (!floating) return;\n function handleFocusIn(event) {\n const target = getTarget$1(event);\n const tabbableContent = getTabbableContent();\n const tabbableIndex = tabbableContent.indexOf(target);\n if (tabbableIndex !== -1) {\n tabbableIndexRef.current = tabbableIndex;\n }\n }\n floating.addEventListener('focusin', handleFocusIn);\n return () => {\n floating.removeEventListener('focusin', handleFocusIn);\n };\n }, [disabled, floating, getTabbableContent]);\n React.useEffect(() => {\n if (disabled) return;\n if (!closeOnFocusOut) return;\n\n // In Safari, buttons lose focus when pressing them.\n function handlePointerDown() {\n isPointerDownRef.current = true;\n setTimeout(() => {\n isPointerDownRef.current = false;\n });\n }\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n const currentTarget = event.currentTarget;\n const target = getTarget$1(event);\n queueMicrotask(() => {\n const nodeId = getNodeId();\n const movedToUnrelatedNode = !(contains$1(domReference, relatedTarget) || contains$1(floating, relatedTarget) || contains$1(relatedTarget, floating) || contains$1(portalContext == null ? void 0 : portalContext.portalNode, relatedTarget) || relatedTarget != null && relatedTarget.hasAttribute(createAttribute('focus-guard')) || tree && (getNodeChildren$1(tree.nodesRef.current, nodeId).find(node => {\n var _node$context, _node$context2;\n return contains$1((_node$context = node.context) == null ? void 0 : _node$context.elements.floating, relatedTarget) || contains$1((_node$context2 = node.context) == null ? void 0 : _node$context2.elements.domReference, relatedTarget);\n }) || getNodeAncestors(tree.nodesRef.current, nodeId).find(node => {\n var _node$context3, _node$context4, _node$context5;\n return [(_node$context3 = node.context) == null ? void 0 : _node$context3.elements.floating, getFloatingFocusElement((_node$context4 = node.context) == null ? void 0 : _node$context4.elements.floating)].includes(relatedTarget) || ((_node$context5 = node.context) == null ? void 0 : _node$context5.elements.domReference) === relatedTarget;\n })));\n if (currentTarget === domReference && floatingFocusElement) {\n handleTabIndex(floatingFocusElement, orderRef);\n }\n\n // Restore focus to the previous tabbable element index to prevent\n // focus from being lost outside the floating tree.\n if (restoreFocus && currentTarget !== domReference && !(target != null && target.isConnected) && activeElement(getDocument$1(floatingFocusElement)) === getDocument$1(floatingFocusElement).body) {\n // Let `FloatingPortal` effect knows that focus is still inside the\n // floating tree.\n if (isHTMLElement(floatingFocusElement)) {\n floatingFocusElement.focus();\n }\n const prevTabbableIndex = tabbableIndexRef.current;\n const tabbableContent = getTabbableContent();\n const nodeToFocus = tabbableContent[prevTabbableIndex] || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;\n if (isHTMLElement(nodeToFocus)) {\n nodeToFocus.focus();\n }\n }\n\n // https://github.com/floating-ui/floating-ui/issues/3060\n if (dataRef.current.insideReactTree) {\n dataRef.current.insideReactTree = false;\n return;\n }\n\n // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current &&\n // Fix React 18 Strict Mode returnFocus due to double rendering.\n relatedTarget !== getPreviouslyFocusedElement()) {\n preventReturnFocusRef.current = true;\n onOpenChange(false, event, 'focus-out');\n }\n });\n }\n const shouldHandleBlurCapture = Boolean(!tree && portalContext);\n function markInsideReactTree() {\n clearTimeoutIfSet(blurTimeoutRef);\n dataRef.current.insideReactTree = true;\n blurTimeoutRef.current = window.setTimeout(() => {\n dataRef.current.insideReactTree = false;\n });\n }\n if (floating && isHTMLElement(domReference)) {\n domReference.addEventListener('focusout', handleFocusOutside);\n domReference.addEventListener('pointerdown', handlePointerDown);\n floating.addEventListener('focusout', handleFocusOutside);\n if (shouldHandleBlurCapture) {\n floating.addEventListener('focusout', markInsideReactTree, true);\n }\n return () => {\n domReference.removeEventListener('focusout', handleFocusOutside);\n domReference.removeEventListener('pointerdown', handlePointerDown);\n floating.removeEventListener('focusout', handleFocusOutside);\n if (shouldHandleBlurCapture) {\n floating.removeEventListener('focusout', markInsideReactTree, true);\n }\n };\n }\n }, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, onOpenChange, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, orderRef, dataRef]);\n const beforeGuardRef = React.useRef(null);\n const afterGuardRef = React.useRef(null);\n const mergedBeforeGuardRef = useLiteMergeRefs([beforeGuardRef, portalContext == null ? void 0 : portalContext.beforeInsideRef]);\n const mergedAfterGuardRef = useLiteMergeRefs([afterGuardRef, portalContext == null ? void 0 : portalContext.afterInsideRef]);\n React.useEffect(() => {\n var _portalContext$portal, _ancestors$find;\n if (disabled) return;\n if (!floating) return;\n\n // Don't hide portals nested within the parent portal.\n const portalNodes = Array.from((portalContext == null || (_portalContext$portal = portalContext.portalNode) == null ? void 0 : _portalContext$portal.querySelectorAll(\"[\" + createAttribute('portal') + \"]\")) || []);\n const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];\n const rootAncestorComboboxDomReference = (_ancestors$find = ancestors.find(node => {\n var _node$context6;\n return isTypeableCombobox(((_node$context6 = node.context) == null ? void 0 : _node$context6.elements.domReference) || null);\n })) == null || (_ancestors$find = _ancestors$find.context) == null ? void 0 : _ancestors$find.elements.domReference;\n const insideElements = [floating, rootAncestorComboboxDomReference, ...portalNodes, ...getInsideElements(), startDismissButtonRef.current, endDismissButtonRef.current, beforeGuardRef.current, afterGuardRef.current, portalContext == null ? void 0 : portalContext.beforeOutsideRef.current, portalContext == null ? void 0 : portalContext.afterOutsideRef.current, orderRef.current.includes('reference') || isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);\n const cleanup = modal || isUntrappedTypeableCombobox ? markOthers(insideElements, !useInert, useInert) : markOthers(insideElements);\n return () => {\n cleanup();\n };\n }, [disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, guards, useInert, tree, getNodeId, getInsideElements]);\n useModernLayoutEffect(() => {\n if (disabled || !isHTMLElement(floatingFocusElement)) return;\n const doc = getDocument$1(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n\n // Wait for any layout effect state setters to execute to set `tabIndex`.\n queueMicrotask(() => {\n const focusableElements = getTabbableElements(floatingFocusElement);\n const initialFocusValue = initialFocusRef.current;\n const elToFocus = (typeof initialFocusValue === 'number' ? focusableElements[initialFocusValue] : initialFocusValue.current) || floatingFocusElement;\n const focusAlreadyInsideFloatingEl = contains$1(floatingFocusElement, previouslyFocusedElement);\n if (!ignoreInitialFocus && !focusAlreadyInsideFloatingEl && open) {\n enqueueFocus(elToFocus, {\n preventScroll: elToFocus === floatingFocusElement\n });\n }\n });\n }, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableElements, initialFocusRef]);\n useModernLayoutEffect(() => {\n if (disabled || !floatingFocusElement) return;\n const doc = getDocument$1(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n addPreviouslyFocusedElement(previouslyFocusedElement);\n\n // Dismissing via outside press should always ignore `returnFocus` to\n // prevent unwanted scrolling.\n function onOpenChange(_ref) {\n let {\n reason,\n event,\n nested\n } = _ref;\n if (['hover', 'safe-polygon'].includes(reason) && event.type === 'mouseleave') {\n preventReturnFocusRef.current = true;\n }\n if (reason !== 'outside-press') return;\n if (nested) {\n preventReturnFocusRef.current = false;\n } else if (isVirtualClick(event) || isVirtualPointerEvent(event)) {\n preventReturnFocusRef.current = false;\n } else {\n let isPreventScrollSupported = false;\n document.createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n if (isPreventScrollSupported) {\n preventReturnFocusRef.current = false;\n } else {\n preventReturnFocusRef.current = true;\n }\n }\n }\n events.on('openchange', onOpenChange);\n const fallbackEl = doc.createElement('span');\n fallbackEl.setAttribute('tabindex', '-1');\n fallbackEl.setAttribute('aria-hidden', 'true');\n Object.assign(fallbackEl.style, HIDDEN_STYLES);\n if (isInsidePortal && domReference) {\n domReference.insertAdjacentElement('afterend', fallbackEl);\n }\n function getReturnElement() {\n if (typeof returnFocusRef.current === 'boolean') {\n const el = domReference || getPreviouslyFocusedElement();\n return el && el.isConnected ? el : fallbackEl;\n }\n return returnFocusRef.current.current || fallbackEl;\n }\n return () => {\n events.off('openchange', onOpenChange);\n const activeEl = activeElement(doc);\n const isFocusInsideFloatingTree = contains$1(floating, activeEl) || tree && getNodeChildren$1(tree.nodesRef.current, getNodeId(), false).some(node => {\n var _node$context7;\n return contains$1((_node$context7 = node.context) == null ? void 0 : _node$context7.elements.floating, activeEl);\n });\n const returnElement = getReturnElement();\n queueMicrotask(() => {\n // This is `returnElement`, if it's tabbable, or its first tabbable child.\n const tabbableReturnElement = getFirstTabbableElement(returnElement);\n if (\n // eslint-disable-next-line react-hooks/exhaustive-deps\n returnFocusRef.current && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && (\n // If the focus moved somewhere else after mount, avoid returning focus\n // since it likely entered a different element which should be\n // respected: https://github.com/floating-ui/floating-ui/issues/2607\n tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {\n tabbableReturnElement.focus({\n preventScroll: true\n });\n }\n fallbackEl.remove();\n });\n };\n }, [disabled, floating, floatingFocusElement, returnFocusRef, dataRef, events, tree, isInsidePortal, domReference, getNodeId]);\n React.useEffect(() => {\n // The `returnFocus` cleanup behavior is inside a microtask; ensure we\n // wait for it to complete before resetting the flag.\n queueMicrotask(() => {\n preventReturnFocusRef.current = false;\n });\n return () => {\n queueMicrotask(clearDisconnectedPreviouslyFocusedElements);\n };\n }, [disabled]);\n\n // Synchronize the `context` & `modal` value to the FloatingPortal context.\n // It will decide whether or not it needs to render its own guards.\n useModernLayoutEffect(() => {\n if (disabled) return;\n if (!portalContext) return;\n portalContext.setFocusManagerState({\n modal,\n closeOnFocusOut,\n open,\n onOpenChange,\n domReference\n });\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [disabled, portalContext, modal, open, onOpenChange, closeOnFocusOut, domReference]);\n useModernLayoutEffect(() => {\n if (disabled) return;\n if (!floatingFocusElement) return;\n handleTabIndex(floatingFocusElement, orderRef);\n }, [disabled, floatingFocusElement, orderRef]);\n function renderDismissButton(location) {\n if (disabled || !visuallyHiddenDismiss || !modal) {\n return null;\n }\n return /*#__PURE__*/jsx(VisuallyHiddenDismiss, {\n ref: location === 'start' ? startDismissButtonRef : endDismissButtonRef,\n onClick: event => onOpenChange(false, event.nativeEvent),\n children: typeof visuallyHiddenDismiss === 'string' ? visuallyHiddenDismiss : 'Dismiss'\n });\n }\n const shouldRenderGuards = !disabled && guards && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);\n return /*#__PURE__*/jsxs(Fragment, {\n children: [shouldRenderGuards && /*#__PURE__*/jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedBeforeGuardRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableElements();\n enqueueFocus(order[0] === 'reference' ? els[0] : els[els.length - 1]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n preventReturnFocusRef.current = false;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable == null || nextTabbable.focus();\n } else {\n var _portalContext$before;\n (_portalContext$before = portalContext.beforeOutsideRef.current) == null || _portalContext$before.focus();\n }\n }\n }\n }), !isUntrappedTypeableCombobox && renderDismissButton('start'), children, renderDismissButton('end'), shouldRenderGuards && /*#__PURE__*/jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedAfterGuardRef,\n onFocus: event => {\n if (modal) {\n enqueueFocus(getTabbableElements()[0]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n if (closeOnFocusOut) {\n preventReturnFocusRef.current = true;\n }\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable == null || prevTabbable.focus();\n } else {\n var _portalContext$afterO;\n (_portalContext$afterO = portalContext.afterOutsideRef.current) == null || _portalContext$afterO.focus();\n }\n }\n }\n })]\n });\n}\n\nlet lockCount = 0;\nconst scrollbarProperty = '--floating-ui-scrollbar-width';\nfunction enableScrollLock() {\n const platform = getPlatform();\n const isIOS = /iP(hone|ad|od)|iOS/.test(platform) ||\n // iPads can claim to be MacIntel\n platform === 'MacIntel' && navigator.maxTouchPoints > 1;\n const bodyStyle = document.body.style;\n // RTL <body> scrollbar\n const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;\n const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.scrollX;\n const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.scrollY;\n bodyStyle.overflow = 'hidden';\n bodyStyle.setProperty(scrollbarProperty, scrollbarWidth + \"px\");\n if (scrollbarWidth) {\n bodyStyle[paddingProp] = scrollbarWidth + \"px\";\n }\n\n // Only iOS doesn't respect `overflow: hidden` on document.body, and this\n // technique has fewer side effects.\n if (isIOS) {\n var _window$visualViewpor, _window$visualViewpor2;\n // iOS 12 does not support `visualViewport`.\n const offsetLeft = ((_window$visualViewpor = window.visualViewport) == null ? void 0 : _window$visualViewpor.offsetLeft) || 0;\n const offsetTop = ((_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetTop) || 0;\n Object.assign(bodyStyle, {\n position: 'fixed',\n top: -(scrollY - Math.floor(offsetTop)) + \"px\",\n left: -(scrollX - Math.floor(offsetLeft)) + \"px\",\n right: '0'\n });\n }\n return () => {\n Object.assign(bodyStyle, {\n overflow: '',\n [paddingProp]: ''\n });\n bodyStyle.removeProperty(scrollbarProperty);\n if (isIOS) {\n Object.assign(bodyStyle, {\n position: '',\n top: '',\n left: '',\n right: ''\n });\n window.scrollTo(scrollX, scrollY);\n }\n };\n}\nlet cleanup = () => {};\n\n/**\n * Provides base styling for a fixed overlay element to dim content or block\n * pointer events behind a floating element.\n * It's a regular `<div>`, so it can be styled via any CSS solution you prefer.\n * @see https://floating-ui.com/docs/FloatingOverlay\n */\nconst FloatingOverlay = /*#__PURE__*/React.forwardRef(function FloatingOverlay(props, ref) {\n const {\n lockScroll = false,\n ...rest\n } = props;\n useModernLayoutEffect(() => {\n if (!lockScroll) return;\n lockCount++;\n if (lockCount === 1) {\n cleanup = enableScrollLock();\n }\n return () => {\n lockCount--;\n if (lockCount === 0) {\n cleanup();\n }\n };\n }, [lockScroll]);\n return /*#__PURE__*/jsx(\"div\", {\n ref: ref,\n ...rest,\n style: {\n position: 'fixed',\n overflow: 'auto',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...rest.style\n }\n });\n});\n\nfunction isButtonTarget(event) {\n return isHTMLElement(event.target) && event.target.tagName === 'BUTTON';\n}\nfunction isAnchorTarget(event) {\n return isHTMLElement(event.target) && event.target.tagName === 'A';\n}\nfunction isSpaceIgnored(element) {\n return isTypeableElement(element);\n}\n/**\n * Opens or closes the floating element when clicking the reference element.\n * @see https://floating-ui.com/docs/useClick\n */\nfunction useClick(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n dataRef,\n elements: {\n domReference\n }\n } = context;\n const {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n keyboardHandlers = true,\n stickIfOpen = true\n } = props;\n const pointerTypeRef = React.useRef();\n const didKeyDownRef = React.useRef(false);\n const reference = React.useMemo(() => ({\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onMouseDown(event) {\n const pointerType = pointerTypeRef.current;\n\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0) return;\n if (eventOption === 'click') return;\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;\n if (open && toggle && (dataRef.current.openEvent && stickIfOpen ? dataRef.current.openEvent.type === 'mousedown' : true)) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n // Prevent stealing focus from the floating element\n event.preventDefault();\n onOpenChange(true, event.nativeEvent, 'click');\n }\n },\n onClick(event) {\n const pointerType = pointerTypeRef.current;\n if (eventOption === 'mousedown' && pointerTypeRef.current) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;\n if (open && toggle && (dataRef.current.openEvent && stickIfOpen ? dataRef.current.openEvent.type === 'click' : true)) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n onOpenChange(true, event.nativeEvent, 'click');\n }\n },\n onKeyDown(event) {\n pointerTypeRef.current = undefined;\n if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event)) {\n return;\n }\n if (event.key === ' ' && !isSpaceIgnored(domReference)) {\n // Prevent scrolling\n event.preventDefault();\n didKeyDownRef.current = true;\n }\n if (isAnchorTarget(event)) {\n return;\n }\n if (event.key === 'Enter') {\n if (open && toggle) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n onOpenChange(true, event.nativeEvent, 'click');\n }\n }\n },\n onKeyUp(event) {\n if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event) || isSpaceIgnored(domReference)) {\n return;\n }\n if (event.key === ' ' && didKeyDownRef.current) {\n didKeyDownRef.current = false;\n if (open && toggle) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n onOpenChange(true, event.nativeEvent, 'click');\n }\n }\n }\n }), [dataRef, domReference, eventOption, ignoreMouse, keyboardHandlers, onOpenChange, open, stickIfOpen, toggle]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nfunction createVirtualElement(domElement, data) {\n let offsetX = null;\n let offsetY = null;\n let isAutoUpdateEvent = false;\n return {\n contextElement: domElement || undefined,\n getBoundingClientRect() {\n var _data$dataRef$current;\n const domRect = (domElement == null ? void 0 : domElement.getBoundingClientRect()) || {\n width: 0,\n height: 0,\n x: 0,\n y: 0\n };\n const isXAxis = data.axis === 'x' || data.axis === 'both';\n const isYAxis = data.axis === 'y' || data.axis === 'both';\n const canTrackCursorOnAutoUpdate = ['mouseenter', 'mousemove'].includes(((_data$dataRef$current = data.dataRef.current.openEvent) == null ? void 0 : _data$dataRef$current.type) || '') && data.pointerType !== 'touch';\n let width = domRect.width;\n let height = domRect.height;\n let x = domRect.x;\n let y = domRect.y;\n if (offsetX == null && data.x && isXAxis) {\n offsetX = domRect.x - data.x;\n }\n if (offsetY == null && data.y && isYAxis) {\n offsetY = domRect.y - data.y;\n }\n x -= offsetX || 0;\n y -= offsetY || 0;\n width = 0;\n height = 0;\n if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {\n width = data.axis === 'y' ? domRect.width : 0;\n height = data.axis === 'x' ? domRect.height : 0;\n x = isXAxis && data.x != null ? data.x : x;\n y = isYAxis && data.y != null ? data.y : y;\n } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) {\n height = data.axis === 'x' ? domRect.height : height;\n width = data.axis === 'y' ? domRect.width : width;\n }\n isAutoUpdateEvent = true;\n return {\n width,\n height,\n x,\n y,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x\n };\n }\n };\n}\nfunction isMouseBasedEvent(event) {\n return event != null && event.clientX != null;\n}\n/**\n * Positions the floating element relative to a client point (in the viewport),\n * such as the mouse position. By default, it follows the mouse cursor.\n * @see https://floating-ui.com/docs/useClientPoint\n */\nfunction useClientPoint(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n dataRef,\n elements: {\n floating,\n domReference\n },\n refs\n } = context;\n const {\n enabled = true,\n axis = 'both',\n x = null,\n y = null\n } = props;\n const initialRef = React.useRef(false);\n const cleanupListenerRef = React.useRef(null);\n const [pointerType, setPointerType] = React.useState();\n const [reactive, setReactive] = React.useState([]);\n const setReference = useEffectEvent((x, y) => {\n if (initialRef.current) return;\n\n // Prevent setting if the open event was not a mouse-like one\n // (e.g. focus to open, then hover over the reference element).\n // Only apply if the event exists.\n if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {\n return;\n }\n refs.setPositionReference(createVirtualElement(domReference, {\n x,\n y,\n axis,\n dataRef,\n pointerType\n }));\n });\n const handleReferenceEnterOrMove = useEffectEvent(event => {\n if (x != null || y != null) return;\n if (!open) {\n setReference(event.clientX, event.clientY);\n } else if (!cleanupListenerRef.current) {\n // If there's no cleanup, there's no listener, but we want to ensure\n // we add the listener if the cursor landed on the floating element and\n // then back on the reference (i.e. it's interactive).\n setReactive([]);\n }\n });\n\n // If the pointer is a mouse-like pointer, we want to continue following the\n // mouse even if the floating element is transitioning out. On touch\n // devices, this is undesirable because the floating element will move to\n // the dismissal touch point.\n const openCheck = isMouseLikePointerType(pointerType) ? floating : open;\n const addListener = React.useCallback(() => {\n // Explicitly specified `x`/`y` coordinates shouldn't add a listener.\n if (!openCheck || !enabled || x != null || y != null) return;\n const win = getWindow(floating);\n function handleMouseMove(event) {\n const target = getTarget$1(event);\n if (!contains$1(floating, target)) {\n setReference(event.clientX, event.clientY);\n } else {\n win.removeEventListener('mousemove', handleMouseMove);\n cleanupListenerRef.current = null;\n }\n }\n if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {\n win.addEventListener('mousemove', handleMouseMove);\n const cleanup = () => {\n win.removeEventListener('mousemove', handleMouseMove);\n cleanupListenerRef.current = null;\n };\n cleanupListenerRef.current = cleanup;\n return cleanup;\n }\n refs.setPositionReference(domReference);\n }, [openCheck, enabled, x, y, floating, dataRef, refs, domReference, setReference]);\n React.useEffect(() => {\n return addListener();\n }, [addListener, reactive]);\n React.useEffect(() => {\n if (enabled && !floating) {\n initialRef.current = false;\n }\n }, [enabled, floating]);\n React.useEffect(() => {\n if (!enabled && open) {\n initialRef.current = true;\n }\n }, [enabled, open]);\n useModernLayoutEffect(() => {\n if (enabled && (x != null || y != null)) {\n initialRef.current = false;\n setReference(x, y);\n }\n }, [enabled, x, y, setReference]);\n const reference = React.useMemo(() => {\n function setPointerTypeRef(_ref) {\n let {\n pointerType\n } = _ref;\n setPointerType(pointerType);\n }\n return {\n onPointerDown: setPointerTypeRef,\n onPointerEnter: setPointerTypeRef,\n onMouseMove: handleReferenceEnterOrMove,\n onMouseEnter: handleReferenceEnterOrMove\n };\n }, [handleReferenceEnterOrMove]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nconst bubbleHandlerKeys = {\n pointerdown: 'onPointerDown',\n mousedown: 'onMouseDown',\n click: 'onClick'\n};\nconst captureHandlerKeys = {\n pointerdown: 'onPointerDownCapture',\n mousedown: 'onMouseDownCapture',\n click: 'onClickCapture'\n};\nconst normalizeProp = normalizable => {\n var _normalizable$escapeK, _normalizable$outside;\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : (_normalizable$escapeK = normalizable == null ? void 0 : normalizable.escapeKey) != null ? _normalizable$escapeK : false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : (_normalizable$outside = normalizable == null ? void 0 : normalizable.outsidePress) != null ? _normalizable$outside : true\n };\n};\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nfunction useDismiss(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n elements,\n dataRef\n } = context;\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: unstable_outsidePress = true,\n outsidePressEvent = 'pointerdown',\n referencePress = false,\n referencePressEvent = 'pointerdown',\n ancestorScroll = false,\n bubbles,\n capture\n } = props;\n const tree = useFloatingTree();\n const outsidePressFn = useEffectEvent(typeof unstable_outsidePress === 'function' ? unstable_outsidePress : () => false);\n const outsidePress = typeof unstable_outsidePress === 'function' ? outsidePressFn : unstable_outsidePress;\n const endedOrStartedInsideRef = React.useRef(false);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const {\n escapeKey: escapeKeyCapture,\n outsidePress: outsidePressCapture\n } = normalizeProp(capture);\n const isComposingRef = React.useRef(false);\n const closeOnEscapeKeyDown = useEffectEvent(event => {\n var _dataRef$current$floa;\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element.\n if (isComposingRef.current) {\n return;\n }\n const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId;\n const children = tree ? getNodeChildren$1(tree.nodesRef.current, nodeId) : [];\n if (!escapeKeyBubbles) {\n event.stopPropagation();\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context;\n if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n }\n onOpenChange(false, isReactEvent(event) ? event.nativeEvent : event, 'escape-key');\n });\n const closeOnEscapeKeyDownCapture = useEffectEvent(event => {\n var _getTarget2;\n const callback = () => {\n var _getTarget;\n closeOnEscapeKeyDown(event);\n (_getTarget = getTarget$1(event)) == null || _getTarget.removeEventListener('keydown', callback);\n };\n (_getTarget2 = getTarget$1(event)) == null || _getTarget2.addEventListener('keydown', callback);\n });\n const closeOnPressOutside = useEffectEvent(event => {\n var _dataRef$current$floa2;\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = dataRef.current.insideReactTree;\n dataRef.current.insideReactTree = false;\n\n // When click outside is lazy (`click` event), handle dragging.\n // Don't close if:\n // - The click started inside the floating element.\n // - The click ended inside the floating element.\n const endedOrStartedInside = endedOrStartedInsideRef.current;\n endedOrStartedInsideRef.current = false;\n if (outsidePressEvent === 'click' && endedOrStartedInside) {\n return;\n }\n if (insideReactTree) {\n return;\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n const target = getTarget$1(event);\n const inertSelector = \"[\" + createAttribute('inert') + \"]\";\n const markers = getDocument$1(elements.floating).querySelectorAll(inertSelector);\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains$1(target, elements.floating) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n Array.from(markers).every(marker => !contains$1(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n if (isHTMLElement(target) && floating) {\n const lastTraversableNode = isLastTraversableNode(target);\n const style = getComputedStyle(target);\n const scrollRe = /auto|scroll/;\n const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);\n const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);\n const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n const isRTL = style.direction === 'rtl';\n\n // Check click position relative to scrollbar.\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);\n const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;\n if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {\n return;\n }\n }\n const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId;\n const targetIsInsideChildren = tree && getNodeChildren$1(tree.nodesRef.current, nodeId).some(node => {\n var _node$context;\n return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);\n });\n if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) {\n return;\n }\n const children = tree ? getNodeChildren$1(tree.nodesRef.current, nodeId) : [];\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context2;\n if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n onOpenChange(false, event, 'outside-press');\n });\n const closeOnPressOutsideCapture = useEffectEvent(event => {\n var _getTarget4;\n const callback = () => {\n var _getTarget3;\n closeOnPressOutside(event);\n (_getTarget3 = getTarget$1(event)) == null || _getTarget3.removeEventListener(outsidePressEvent, callback);\n };\n (_getTarget4 = getTarget$1(event)) == null || _getTarget4.addEventListener(outsidePressEvent, callback);\n });\n React.useEffect(() => {\n if (!open || !enabled) {\n return;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n let compositionTimeout = -1;\n function onScroll(event) {\n onOpenChange(false, event, 'ancestor-scroll');\n }\n function handleCompositionStart() {\n window.clearTimeout(compositionTimeout);\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n compositionTimeout = window.setTimeout(() => {\n isComposingRef.current = false;\n },\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n isWebKit() ? 5 : 0);\n }\n const doc = getDocument$1(elements.floating);\n if (escapeKey) {\n doc.addEventListener('keydown', escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);\n doc.addEventListener('compositionstart', handleCompositionStart);\n doc.addEventListener('compositionend', handleCompositionEnd);\n }\n outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);\n let ancestors = [];\n if (ancestorScroll) {\n if (isElement(elements.domReference)) {\n ancestors = getOverflowAncestors(elements.domReference);\n }\n if (isElement(elements.floating)) {\n ancestors = ancestors.concat(getOverflowAncestors(elements.floating));\n }\n if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) {\n ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement));\n }\n }\n\n // Ignore the visual viewport for scrolling dismissal (allow pinch-zoom)\n ancestors = ancestors.filter(ancestor => {\n var _doc$defaultView;\n return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);\n });\n ancestors.forEach(ancestor => {\n ancestor.addEventListener('scroll', onScroll, {\n passive: true\n });\n });\n return () => {\n if (escapeKey) {\n doc.removeEventListener('keydown', escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);\n doc.removeEventListener('compositionstart', handleCompositionStart);\n doc.removeEventListener('compositionend', handleCompositionEnd);\n }\n outsidePress && doc.removeEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);\n ancestors.forEach(ancestor => {\n ancestor.removeEventListener('scroll', onScroll);\n });\n window.clearTimeout(compositionTimeout);\n };\n }, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);\n React.useEffect(() => {\n dataRef.current.insideReactTree = false;\n }, [dataRef, outsidePress, outsidePressEvent]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n ...(referencePress && {\n [bubbleHandlerKeys[referencePressEvent]]: event => {\n onOpenChange(false, event.nativeEvent, 'reference-press');\n },\n ...(referencePressEvent !== 'click' && {\n onClick(event) {\n onOpenChange(false, event.nativeEvent, 'reference-press');\n }\n })\n })\n }), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onMouseDown() {\n endedOrStartedInsideRef.current = true;\n },\n onMouseUp() {\n endedOrStartedInsideRef.current = true;\n },\n [captureHandlerKeys[outsidePressEvent]]: () => {\n dataRef.current.insideReactTree = true;\n }\n }), [closeOnEscapeKeyDown, outsidePressEvent, dataRef]);\n return React.useMemo(() => enabled ? {\n reference,\n floating\n } : {}, [enabled, reference, floating]);\n}\n\nfunction useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange: onOpenChangeProp,\n elements: elementsProp\n } = options;\n const floatingId = useId();\n const dataRef = React.useRef({});\n const [events] = React.useState(() => createEventEmitter());\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== \"production\") {\n const optionDomReference = elementsProp.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `refs.setPositionReference()`', 'instead.');\n }\n }\n const [positionReference, setPositionReference] = React.useState(elementsProp.reference);\n const onOpenChange = useEffectEvent((open, event, reason) => {\n dataRef.current.openEvent = open ? event : undefined;\n events.emit('openchange', {\n open,\n event,\n reason,\n nested\n });\n onOpenChangeProp == null || onOpenChangeProp(open, event, reason);\n });\n const refs = React.useMemo(() => ({\n setPositionReference\n }), []);\n const elements = React.useMemo(() => ({\n reference: positionReference || elementsProp.reference || null,\n floating: elementsProp.floating || null,\n domReference: elementsProp.reference\n }), [positionReference, elementsProp.reference, elementsProp.floating]);\n return React.useMemo(() => ({\n dataRef,\n open,\n onOpenChange,\n elements,\n events,\n floatingId,\n refs\n }), [open, onOpenChange, elements, events, floatingId, refs]);\n}\n\n/**\n * Provides data to position a floating element and context to add interactions.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n nodeId\n } = options;\n const internalRootContext = useFloatingRootContext({\n ...options,\n elements: {\n reference: null,\n floating: null,\n ...options.elements\n }\n });\n const rootContext = options.rootContext || internalRootContext;\n const computedElements = rootContext.elements;\n const [_domReference, setDomReference] = React.useState(null);\n const [positionReference, _setPositionReference] = React.useState(null);\n const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;\n const domReference = optionDomReference || _domReference;\n const domReferenceRef = React.useRef(null);\n const tree = useFloatingTree();\n useModernLayoutEffect(() => {\n if (domReference) {\n domReferenceRef.current = domReference;\n }\n }, [domReference]);\n const position = useFloating$1({\n ...options,\n elements: {\n ...computedElements,\n ...(positionReference && {\n reference: positionReference\n })\n }\n });\n const setPositionReference = React.useCallback(node => {\n const computedPositionReference = isElement(node) ? {\n getBoundingClientRect: () => node.getBoundingClientRect(),\n getClientRects: () => node.getClientRects(),\n contextElement: node\n } : node;\n // Store the positionReference in state if the DOM reference is specified externally via the\n // `elements.reference` option. This ensures that it won't be overridden on future renders.\n _setPositionReference(computedPositionReference);\n position.refs.setReference(computedPositionReference);\n }, [position.refs]);\n const setReference = React.useCallback(node => {\n if (isElement(node) || node === null) {\n domReferenceRef.current = node;\n setDomReference(node);\n }\n\n // Backwards-compatibility for passing a virtual element to `reference`\n // after it has set the DOM reference.\n if (isElement(position.refs.reference.current) || position.refs.reference.current === null ||\n // Don't allow setting virtual elements using the old technique back to\n // `null` to support `positionReference` + an unstable `reference`\n // callback ref.\n node !== null && !isElement(node)) {\n position.refs.setReference(node);\n }\n }, [position.refs]);\n const refs = React.useMemo(() => ({\n ...position.refs,\n setReference,\n setPositionReference,\n domReference: domReferenceRef\n }), [position.refs, setReference, setPositionReference]);\n const elements = React.useMemo(() => ({\n ...position.elements,\n domReference: domReference\n }), [position.elements, domReference]);\n const context = React.useMemo(() => ({\n ...position,\n ...rootContext,\n refs,\n elements,\n nodeId\n }), [position, refs, elements, nodeId, rootContext]);\n useModernLayoutEffect(() => {\n rootContext.dataRef.current.floatingContext = context;\n const node = tree == null ? void 0 : tree.nodesRef.current.find(node => node.id === nodeId);\n if (node) {\n node.context = context;\n }\n });\n return React.useMemo(() => ({\n ...position,\n context,\n refs,\n elements\n }), [position, refs, elements, context]);\n}\n\nfunction isMacSafari() {\n return isMac() && isSafari();\n}\n/**\n * Opens the floating element while the reference element has focus, like CSS\n * `:focus`.\n * @see https://floating-ui.com/docs/useFocus\n */\nfunction useFocus(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n events,\n dataRef,\n elements\n } = context;\n const {\n enabled = true,\n visibleOnly = true\n } = props;\n const blockFocusRef = React.useRef(false);\n const timeoutRef = React.useRef(-1);\n const keyboardModalityRef = React.useRef(true);\n React.useEffect(() => {\n if (!enabled) return;\n const win = getWindow(elements.domReference);\n\n // If the reference was focused and the user left the tab/window, and the\n // floating element was not open, the focus should be blocked when they\n // return to the tab/window.\n function onBlur() {\n if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument$1(elements.domReference))) {\n blockFocusRef.current = true;\n }\n }\n function onKeyDown() {\n keyboardModalityRef.current = true;\n }\n function onPointerDown() {\n keyboardModalityRef.current = false;\n }\n win.addEventListener('blur', onBlur);\n if (isMacSafari()) {\n win.addEventListener('keydown', onKeyDown, true);\n win.addEventListener('pointerdown', onPointerDown, true);\n }\n return () => {\n win.removeEventListener('blur', onBlur);\n if (isMacSafari()) {\n win.removeEventListener('keydown', onKeyDown, true);\n win.removeEventListener('pointerdown', onPointerDown, true);\n }\n };\n }, [elements.domReference, open, enabled]);\n React.useEffect(() => {\n if (!enabled) return;\n function onOpenChange(_ref) {\n let {\n reason\n } = _ref;\n if (reason === 'reference-press' || reason === 'escape-key') {\n blockFocusRef.current = true;\n }\n }\n events.on('openchange', onOpenChange);\n return () => {\n events.off('openchange', onOpenChange);\n };\n }, [events, enabled]);\n React.useEffect(() => {\n return () => {\n clearTimeoutIfSet(timeoutRef);\n };\n }, []);\n const reference = React.useMemo(() => ({\n onMouseLeave() {\n blockFocusRef.current = false;\n },\n onFocus(event) {\n if (blockFocusRef.current) return;\n const target = getTarget$1(event.nativeEvent);\n if (visibleOnly && isElement(target)) {\n // Safari fails to match `:focus-visible` if focus was initially\n // outside the document.\n if (isMacSafari() && !event.relatedTarget) {\n if (!keyboardModalityRef.current && !isTypeableElement(target)) {\n return;\n }\n } else if (!matchesFocusVisible(target)) {\n return;\n }\n }\n onOpenChange(true, event.nativeEvent, 'focus');\n },\n onBlur(event) {\n blockFocusRef.current = false;\n const relatedTarget = event.relatedTarget;\n const nativeEvent = event.nativeEvent;\n\n // Hit the non-modal focus management portal guard. Focus will be\n // moved into the floating element immediately after.\n const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';\n\n // Wait for the window blur listener to fire.\n timeoutRef.current = window.setTimeout(() => {\n var _dataRef$current$floa;\n const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document);\n\n // Focus left the page, keep it open.\n if (!relatedTarget && activeEl === elements.domReference) return;\n\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n // We can not rely on relatedTarget to point to the correct element\n // as it will only point to the shadow host of the newly focused element\n // and not the element that actually has received focus if it is located\n // inside a shadow root.\n if (contains$1((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains$1(elements.domReference, activeEl) || movedToFocusGuard) {\n return;\n }\n onOpenChange(false, nativeEvent, 'focus');\n });\n }\n }), [dataRef, elements.domReference, onOpenChange, visibleOnly]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nfunction mergeProps(userProps, propsList, elementKey) {\n const map = new Map();\n const isItem = elementKey === 'item';\n let domUserProps = userProps;\n if (isItem && userProps) {\n const {\n [ACTIVE_KEY]: _,\n [SELECTED_KEY]: __,\n ...validProps\n } = userProps;\n domUserProps = validProps;\n }\n return {\n ...(elementKey === 'floating' && {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n }),\n ...domUserProps,\n ...propsList.map(value => {\n const propsOrGetProps = value ? value[elementKey] : null;\n if (typeof propsOrGetProps === 'function') {\n return userProps ? propsOrGetProps(userProps) : null;\n }\n return propsOrGetProps;\n }).concat(userProps).reduce((acc, props) => {\n if (!props) {\n return acc;\n }\n Object.entries(props).forEach(_ref => {\n let [key, value] = _ref;\n if (isItem && [ACTIVE_KEY, SELECTED_KEY].includes(key)) {\n return;\n }\n if (key.indexOf('on') === 0) {\n if (!map.has(key)) {\n map.set(key, []);\n }\n if (typeof value === 'function') {\n var _map$get;\n (_map$get = map.get(key)) == null || _map$get.push(value);\n acc[key] = function () {\n var _map$get2;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.map(fn => fn(...args)).find(val => val !== undefined);\n };\n }\n } else {\n acc[key] = value;\n }\n });\n return acc;\n }, {})\n };\n}\n/**\n * Merges an array of interaction hooks' props into prop getters, allowing\n * event handler functions to be composed together without overwriting one\n * another.\n * @see https://floating-ui.com/docs/useInteractions\n */\nfunction useInteractions(propsList) {\n if (propsList === void 0) {\n propsList = [];\n }\n const referenceDeps = propsList.map(key => key == null ? void 0 : key.reference);\n const floatingDeps = propsList.map(key => key == null ? void 0 : key.floating);\n const itemDeps = propsList.map(key => key == null ? void 0 : key.item);\n const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n referenceDeps);\n const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n floatingDeps);\n const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n itemDeps);\n return React.useMemo(() => ({\n getReferenceProps,\n getFloatingProps,\n getItemProps\n }), [getReferenceProps, getFloatingProps, getItemProps]);\n}\n\nconst ESCAPE = 'Escape';\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key === ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl, cols) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n if (orientation === 'both' || orientation === 'horizontal' && cols && cols > 1) {\n return key === ESCAPE;\n }\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nfunction useListNavigation(context, props) {\n const {\n open,\n onOpenChange,\n elements,\n floatingId\n } = context;\n const {\n listRef,\n activeIndex,\n onNavigate: unstable_onNavigate = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loop = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n parentOrientation,\n cols = 1,\n scrollItemIntoView = true,\n virtualItemRef,\n itemSizes,\n dense = false\n } = props;\n if (process.env.NODE_ENV !== \"production\") {\n if (allowEscape) {\n if (!loop) {\n warn('`useListNavigation` looping must be enabled to allow escaping.');\n }\n if (!virtual) {\n warn('`useListNavigation` must be virtual to allow escaping.');\n }\n }\n if (orientation === 'vertical' && cols > 1) {\n warn('In grid list navigation mode (`cols` > 1), the `orientation` should', 'be either \"horizontal\" or \"both\".');\n }\n }\n const floatingFocusElement = getFloatingFocusElement(elements.floating);\n const floatingFocusElementRef = useLatestRef(floatingFocusElement);\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree();\n useModernLayoutEffect(() => {\n context.dataRef.current.orientation = orientation;\n }, [context, orientation]);\n const onNavigate = useEffectEvent(() => {\n unstable_onNavigate(indexRef.current === -1 ? null : indexRef.current);\n });\n const typeableComboboxReference = isTypeableCombobox(elements.domReference);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex != null ? selectedIndex : -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const previousOnNavigateRef = React.useRef(onNavigate);\n const previousMountedRef = React.useRef(!!elements.floating);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocusRef = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const disabledIndicesRef = useLatestRef(disabledIndices);\n const latestOpenRef = useLatestRef(open);\n const scrollItemIntoViewRef = useLatestRef(scrollItemIntoView);\n const selectedIndexRef = useLatestRef(selectedIndex);\n const [activeId, setActiveId] = React.useState();\n const [virtualId, setVirtualId] = React.useState();\n const focusItem = useEffectEvent(() => {\n function runFocus(item) {\n if (virtual) {\n var _item$id;\n if ((_item$id = item.id) != null && _item$id.endsWith('-fui-option')) {\n item.id = floatingId + \"-\" + Math.random().toString(16).slice(2, 10);\n }\n setActiveId(item.id);\n tree == null || tree.events.emit('virtualfocus', item);\n if (virtualItemRef) {\n virtualItemRef.current = item;\n }\n } else {\n enqueueFocus(item, {\n sync: forceSyncFocusRef.current,\n preventScroll: true\n });\n }\n }\n const initialItem = listRef.current[indexRef.current];\n const forceScrollIntoView = forceScrollIntoViewRef.current;\n if (initialItem) {\n runFocus(initialItem);\n }\n const scheduler = forceSyncFocusRef.current ? v => v() : requestAnimationFrame;\n scheduler(() => {\n const waitedItem = listRef.current[indexRef.current] || initialItem;\n if (!waitedItem) return;\n if (!initialItem) {\n runFocus(waitedItem);\n }\n const scrollIntoViewOptions = scrollItemIntoViewRef.current;\n const shouldScrollIntoView = scrollIntoViewOptions && item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n waitedItem.scrollIntoView == null || waitedItem.scrollIntoView(typeof scrollIntoViewOptions === 'boolean' ? {\n block: 'nearest',\n inline: 'nearest'\n } : scrollIntoViewOptions);\n }\n });\n });\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n useModernLayoutEffect(() => {\n if (!enabled) return;\n if (open && elements.floating) {\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n indexRef.current = selectedIndex;\n onNavigate();\n }\n } else if (previousMountedRef.current) {\n // Since the user can specify `onNavigate` conditionally\n // (onNavigate: open ? setActiveIndex : setSelectedIndex),\n // we store and call the previous function.\n indexRef.current = -1;\n previousOnNavigateRef.current();\n }\n }, [enabled, open, elements.floating, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n useModernLayoutEffect(() => {\n if (!enabled) return;\n if (!open) return;\n if (!elements.floating) return;\n if (activeIndex == null) {\n forceSyncFocusRef.current = false;\n if (selectedIndexRef.current != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem();\n }\n\n // Initial sync.\n if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? requestAnimationFrame : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs++;\n } else {\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinListIndex(listRef, disabledIndicesRef.current) : getMaxListIndex(listRef, disabledIndicesRef.current);\n keyRef.current = null;\n onNavigate();\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfListBounds(listRef, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem();\n forceScrollIntoViewRef.current = false;\n }\n }, [enabled, open, elements.floating, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, disabledIndicesRef]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n useModernLayoutEffect(() => {\n var _nodes$find;\n if (!enabled || elements.floating || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = (_nodes$find = nodes.find(node => node.id === parentId)) == null || (_nodes$find = _nodes$find.context) == null ? void 0 : _nodes$find.elements.floating;\n const activeEl = activeElement(getDocument$1(elements.floating));\n const treeContainsActiveEl = nodes.some(node => node.context && contains$1(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, elements.floating, tree, parentId, virtual]);\n useModernLayoutEffect(() => {\n if (!enabled) return;\n if (!tree) return;\n if (!virtual) return;\n if (parentId) return;\n function handleVirtualFocus(item) {\n setVirtualId(item.id);\n if (virtualItemRef) {\n virtualItemRef.current = item;\n }\n }\n tree.events.on('virtualfocus', handleVirtualFocus);\n return () => {\n tree.events.off('virtualfocus', handleVirtualFocus);\n };\n }, [enabled, tree, virtual, parentId, virtualItemRef]);\n useModernLayoutEffect(() => {\n previousOnNavigateRef.current = onNavigate;\n previousOpenRef.current = open;\n previousMountedRef.current = !!elements.floating;\n });\n useModernLayoutEffect(() => {\n if (!open) {\n keyRef.current = null;\n focusItemOnOpenRef.current = focusItemOnOpen;\n }\n }, [open, focusItemOnOpen]);\n const hasActiveIndex = activeIndex != null;\n const item = React.useMemo(() => {\n function syncCurrentTarget(currentTarget) {\n if (!latestOpenRef.current) return;\n const index = listRef.current.indexOf(currentTarget);\n if (index !== -1 && indexRef.current !== index) {\n indexRef.current = index;\n onNavigate();\n }\n }\n const props = {\n onFocus(_ref) {\n let {\n currentTarget\n } = _ref;\n forceSyncFocusRef.current = true;\n syncCurrentTarget(currentTarget);\n },\n onClick: _ref2 => {\n let {\n currentTarget\n } = _ref2;\n return currentTarget.focus({\n preventScroll: true\n });\n },\n // Safari\n onMouseMove(_ref3) {\n let {\n currentTarget\n } = _ref3;\n forceSyncFocusRef.current = true;\n forceScrollIntoViewRef.current = false;\n if (focusItemOnHover) {\n syncCurrentTarget(currentTarget);\n }\n },\n onPointerLeave(_ref4) {\n let {\n pointerType\n } = _ref4;\n if (!isPointerModalityRef.current || pointerType === 'touch') {\n return;\n }\n forceSyncFocusRef.current = true;\n if (!focusItemOnHover) {\n return;\n }\n indexRef.current = -1;\n onNavigate();\n if (!virtual) {\n var _floatingFocusElement;\n (_floatingFocusElement = floatingFocusElementRef.current) == null || _floatingFocusElement.focus({\n preventScroll: true\n });\n }\n }\n };\n return props;\n }, [latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, virtual]);\n const getParentOrientation = React.useCallback(() => {\n var _tree$nodesRef$curren;\n return parentOrientation != null ? parentOrientation : tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.dataRef) == null ? void 0 : _tree$nodesRef$curren.current.orientation;\n }, [parentId, tree, parentOrientation]);\n const commonOnKeyDown = useEffectEvent(event => {\n isPointerModalityRef.current = false;\n forceSyncFocusRef.current = true;\n\n // When composing a character, Chrome fires ArrowDown twice. Firefox/Safari\n // don't appear to suffer from this. `event.isComposing` is avoided due to\n // Safari not supporting it properly (although it's not needed in the first\n // place for Safari, just avoiding any possible issues).\n if (event.which === 229) {\n return;\n }\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, cols)) {\n // If the nested list's close key is also the parent navigation key,\n // let the parent navigate. Otherwise, stop propagating the event.\n if (!isMainOrientationKey(event.key, getParentOrientation())) {\n stopEvent(event);\n }\n onOpenChange(false, event.nativeEvent, 'list-navigation');\n if (isHTMLElement(elements.domReference)) {\n if (virtual) {\n tree == null || tree.events.emit('virtualfocus', elements.domReference);\n } else {\n elements.domReference.focus();\n }\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinListIndex(listRef, disabledIndices);\n const maxIndex = getMaxListIndex(listRef, disabledIndices);\n if (!typeableComboboxReference) {\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate();\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate();\n }\n }\n\n // Grid navigation.\n if (cols > 1) {\n const sizes = itemSizes || Array.from({\n length: listRef.current.length\n }, () => ({\n width: 1,\n height: 1\n }));\n // To calculate movements on the grid, we use hypothetical cell indices\n // as if every item was 1x1, then convert back to real indices.\n const cellMap = createGridCellMap(sizes, cols, dense);\n const minGridIndex = cellMap.findIndex(index => index != null && !isListIndexDisabled(listRef, index, disabledIndices));\n // last enabled index\n const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(listRef, index, disabledIndices) ? cellIndex : foundIndex, -1);\n const index = cellMap[getGridNavigatedIndex({\n current: cellMap.map(itemIndex => itemIndex != null ? listRef.current[itemIndex] : null)\n }, {\n event,\n orientation,\n loop,\n rtl,\n cols,\n // treat undefined (empty grid spaces) as disabled indices so we\n // don't end up in them\n disabledIndices: getGridCellIndices([...((typeof disabledIndices !== 'function' ? disabledIndices : null) || listRef.current.map((_, index) => isListIndexDisabled(listRef, index, disabledIndices) ? index : undefined)), undefined], cellMap),\n minIndex: minGridIndex,\n maxIndex: maxGridIndex,\n prevIndex: getGridCellIndexOfCorner(indexRef.current > maxIndex ? minIndex : indexRef.current, sizes, cellMap, cols,\n // use a corner matching the edge closest to the direction\n // we're moving in so we don't end up in the same item. Prefer\n // top/left over bottom/right.\n event.key === ARROW_DOWN ? 'bl' : event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT) ? 'tr' : 'tl'),\n stopEvent: true\n })];\n if (index != null) {\n indexRef.current = index;\n onNavigate();\n }\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate();\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loop) {\n indexRef.current = currentIndex >= maxIndex ? allowEscape && currentIndex !== listRef.current.length ? -1 : minIndex : findNonDisabledListIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n });\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledListIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else {\n if (loop) {\n indexRef.current = currentIndex <= minIndex ? allowEscape && currentIndex !== -1 ? listRef.current.length : maxIndex : findNonDisabledListIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledListIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n }\n if (isIndexOutOfListBounds(listRef, indexRef.current)) {\n indexRef.current = -1;\n }\n onNavigate();\n }\n });\n const ariaActiveDescendantProp = React.useMemo(() => {\n return virtual && open && hasActiveIndex && {\n 'aria-activedescendant': virtualId || activeId\n };\n }, [virtual, open, hasActiveIndex, virtualId, activeId]);\n const floating = React.useMemo(() => {\n return {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(!typeableComboboxReference ? ariaActiveDescendantProp : {}),\n onKeyDown: commonOnKeyDown,\n onPointerMove() {\n isPointerModalityRef.current = true;\n }\n };\n }, [ariaActiveDescendantProp, commonOnKeyDown, orientation, typeableComboboxReference]);\n const reference = React.useMemo(() => {\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n return {\n ...ariaActiveDescendantProp,\n onKeyDown(event) {\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.startsWith('Arrow');\n const isHomeOrEndKey = ['Home', 'End'].includes(event.key);\n const isMoveKey = isArrowKey || isHomeOrEndKey;\n const isCrossOpenKey = isCrossOrientationOpenKey(event.key, orientation, rtl);\n const isCrossCloseKey = isCrossOrientationCloseKey(event.key, orientation, rtl, cols);\n const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);\n const isMainKey = isMainOrientationKey(event.key, orientation);\n const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && open) {\n const rootNode = tree == null ? void 0 : tree.nodesRef.current.find(node => node.parentId == null);\n const deepestNode = tree && rootNode ? getDeepestNode(tree.nodesRef.current, rootNode.id) : null;\n if (isMoveKey && deepestNode && virtualItemRef) {\n const eventObject = new KeyboardEvent('keydown', {\n key: event.key,\n bubbles: true\n });\n if (isCrossOpenKey || isCrossCloseKey) {\n var _deepestNode$context, _deepestNode$context2;\n const isCurrentTarget = ((_deepestNode$context = deepestNode.context) == null ? void 0 : _deepestNode$context.elements.domReference) === event.currentTarget;\n const dispatchItem = isCrossCloseKey && !isCurrentTarget ? (_deepestNode$context2 = deepestNode.context) == null ? void 0 : _deepestNode$context2.elements.domReference : isCrossOpenKey ? listRef.current.find(item => (item == null ? void 0 : item.id) === activeId) : null;\n if (dispatchItem) {\n stopEvent(event);\n dispatchItem.dispatchEvent(eventObject);\n setVirtualId(undefined);\n }\n }\n if ((isMainKey || isHomeOrEndKey) && deepestNode.context) {\n if (deepestNode.context.open && deepestNode.parentId && event.currentTarget !== deepestNode.context.elements.domReference) {\n var _deepestNode$context$;\n stopEvent(event);\n (_deepestNode$context$ = deepestNode.context.elements.domReference) == null || _deepestNode$context$.dispatchEvent(eventObject);\n return;\n }\n }\n }\n return commonOnKeyDown(event);\n }\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!open && !openOnArrowKeyDown && isArrowKey) {\n return;\n }\n if (isNavigationKey) {\n const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());\n keyRef.current = nested && isParentMainKey ? null : event.key;\n }\n if (nested) {\n if (isParentCrossOpenKey) {\n stopEvent(event);\n if (open) {\n indexRef.current = getMinListIndex(listRef, disabledIndicesRef.current);\n onNavigate();\n } else {\n onOpenChange(true, event.nativeEvent, 'list-navigation');\n }\n }\n return;\n }\n if (isMainKey) {\n if (selectedIndex != null) {\n indexRef.current = selectedIndex;\n }\n stopEvent(event);\n if (!open && openOnArrowKeyDown) {\n onOpenChange(true, event.nativeEvent, 'list-navigation');\n } else {\n commonOnKeyDown(event);\n }\n if (open) {\n onNavigate();\n }\n }\n },\n onFocus() {\n if (open && !virtual) {\n indexRef.current = -1;\n onNavigate();\n }\n },\n onPointerDown: checkVirtualPointer,\n onPointerEnter: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n };\n }, [activeId, ariaActiveDescendantProp, cols, commonOnKeyDown, disabledIndicesRef, focusItemOnOpen, listRef, nested, onNavigate, onOpenChange, open, openOnArrowKeyDown, orientation, getParentOrientation, rtl, selectedIndex, tree, virtual, virtualItemRef]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item\n } : {}, [enabled, reference, floating, item]);\n}\n\nconst componentRoleToAriaRoleMap = /*#__PURE__*/new Map([['select', 'listbox'], ['combobox', 'listbox'], ['label', false]]);\n\n/**\n * Adds base screen reader props to the reference and floating elements for a\n * given floating element `role`.\n * @see https://floating-ui.com/docs/useRole\n */\nfunction useRole(context, props) {\n var _elements$domReferenc, _componentRoleToAriaR;\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n elements,\n floatingId: defaultFloatingId\n } = context;\n const {\n enabled = true,\n role = 'dialog'\n } = props;\n const defaultReferenceId = useId();\n const referenceId = ((_elements$domReferenc = elements.domReference) == null ? void 0 : _elements$domReferenc.id) || defaultReferenceId;\n const floatingId = React.useMemo(() => {\n var _getFloatingFocusElem;\n return ((_getFloatingFocusElem = getFloatingFocusElement(elements.floating)) == null ? void 0 : _getFloatingFocusElem.id) || defaultFloatingId;\n }, [elements.floating, defaultFloatingId]);\n const ariaRole = (_componentRoleToAriaR = componentRoleToAriaRoleMap.get(role)) != null ? _componentRoleToAriaR : role;\n const parentId = useFloatingParentNodeId();\n const isNested = parentId != null;\n const reference = React.useMemo(() => {\n if (ariaRole === 'tooltip' || role === 'label') {\n return {\n [\"aria-\" + (role === 'label' ? 'labelledby' : 'describedby')]: open ? floatingId : undefined\n };\n }\n return {\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': ariaRole === 'alertdialog' ? 'dialog' : ariaRole,\n 'aria-controls': open ? floatingId : undefined,\n ...(ariaRole === 'listbox' && {\n role: 'combobox'\n }),\n ...(ariaRole === 'menu' && {\n id: referenceId\n }),\n ...(ariaRole === 'menu' && isNested && {\n role: 'menuitem'\n }),\n ...(role === 'select' && {\n 'aria-autocomplete': 'none'\n }),\n ...(role === 'combobox' && {\n 'aria-autocomplete': 'list'\n })\n };\n }, [ariaRole, floatingId, isNested, open, referenceId, role]);\n const floating = React.useMemo(() => {\n const floatingProps = {\n id: floatingId,\n ...(ariaRole && {\n role: ariaRole\n })\n };\n if (ariaRole === 'tooltip' || role === 'label') {\n return floatingProps;\n }\n return {\n ...floatingProps,\n ...(ariaRole === 'menu' && {\n 'aria-labelledby': referenceId\n })\n };\n }, [ariaRole, floatingId, referenceId, role]);\n const item = React.useCallback(_ref => {\n let {\n active,\n selected\n } = _ref;\n const commonProps = {\n role: 'option',\n ...(active && {\n id: floatingId + \"-fui-option\"\n })\n };\n\n // For `menu`, we are unable to tell if the item is a `menuitemradio`\n // or `menuitemcheckbox`. For backwards-compatibility reasons, also\n // avoid defaulting to `menuitem` as it may overwrite custom role props.\n switch (role) {\n case 'select':\n case 'combobox':\n return {\n ...commonProps,\n 'aria-selected': selected\n };\n }\n return {};\n }, [floatingId, role]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item\n } : {}, [enabled, reference, floating, item]);\n}\n\n// Converts a JS style key like `backgroundColor` to a CSS transition-property\n// like `background-color`.\nconst camelCaseToKebabCase = str => str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());\nfunction execWithArgsOrReturn(valueOrFn, args) {\n return typeof valueOrFn === 'function' ? valueOrFn(args) : valueOrFn;\n}\nfunction useDelayUnmount(open, durationMs) {\n const [isMounted, setIsMounted] = React.useState(open);\n if (open && !isMounted) {\n setIsMounted(true);\n }\n React.useEffect(() => {\n if (!open && isMounted) {\n const timeout = setTimeout(() => setIsMounted(false), durationMs);\n return () => clearTimeout(timeout);\n }\n }, [open, isMounted, durationMs]);\n return isMounted;\n}\n/**\n * Provides a status string to apply CSS transitions to a floating element,\n * correctly handling placement-aware transitions.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstatus\n */\nfunction useTransitionStatus(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n elements: {\n floating\n }\n } = context;\n const {\n duration = 250\n } = props;\n const isNumberDuration = typeof duration === 'number';\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n const [status, setStatus] = React.useState('unmounted');\n const isMounted = useDelayUnmount(open, closeDuration);\n if (!isMounted && status === 'close') {\n setStatus('unmounted');\n }\n useModernLayoutEffect(() => {\n if (!floating) return;\n if (open) {\n setStatus('initial');\n const frame = requestAnimationFrame(() => {\n // Ensure it opens before paint. With `FloatingDelayGroup`,\n // this avoids a flicker when moving between floating elements\n // to ensure one is always open with no missing frames.\n ReactDOM.flushSync(() => {\n setStatus('open');\n });\n });\n return () => {\n cancelAnimationFrame(frame);\n };\n }\n setStatus('close');\n }, [open, floating]);\n return {\n isMounted,\n status\n };\n}\n/**\n * Provides styles to apply CSS transitions to a floating element, correctly\n * handling placement-aware transitions. Wrapper around `useTransitionStatus`.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstyles\n */\nfunction useTransitionStyles(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n initial: unstable_initial = {\n opacity: 0\n },\n open: unstable_open,\n close: unstable_close,\n common: unstable_common,\n duration = 250\n } = props;\n const placement = context.placement;\n const side = placement.split('-')[0];\n const fnArgs = React.useMemo(() => ({\n side,\n placement\n }), [side, placement]);\n const isNumberDuration = typeof duration === 'number';\n const openDuration = (isNumberDuration ? duration : duration.open) || 0;\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n const [styles, setStyles] = React.useState(() => ({\n ...execWithArgsOrReturn(unstable_common, fnArgs),\n ...execWithArgsOrReturn(unstable_initial, fnArgs)\n }));\n const {\n isMounted,\n status\n } = useTransitionStatus(context, {\n duration\n });\n const initialRef = useLatestRef(unstable_initial);\n const openRef = useLatestRef(unstable_open);\n const closeRef = useLatestRef(unstable_close);\n const commonRef = useLatestRef(unstable_common);\n useModernLayoutEffect(() => {\n const initialStyles = execWithArgsOrReturn(initialRef.current, fnArgs);\n const closeStyles = execWithArgsOrReturn(closeRef.current, fnArgs);\n const commonStyles = execWithArgsOrReturn(commonRef.current, fnArgs);\n const openStyles = execWithArgsOrReturn(openRef.current, fnArgs) || Object.keys(initialStyles).reduce((acc, key) => {\n acc[key] = '';\n return acc;\n }, {});\n if (status === 'initial') {\n setStyles(styles => ({\n transitionProperty: styles.transitionProperty,\n ...commonStyles,\n ...initialStyles\n }));\n }\n if (status === 'open') {\n setStyles({\n transitionProperty: Object.keys(openStyles).map(camelCaseToKebabCase).join(','),\n transitionDuration: openDuration + \"ms\",\n ...commonStyles,\n ...openStyles\n });\n }\n if (status === 'close') {\n const styles = closeStyles || initialStyles;\n setStyles({\n transitionProperty: Object.keys(styles).map(camelCaseToKebabCase).join(','),\n transitionDuration: closeDuration + \"ms\",\n ...commonStyles,\n ...styles\n });\n }\n }, [closeDuration, closeRef, initialRef, openRef, commonRef, openDuration, status, fnArgs]);\n return {\n isMounted,\n styles\n };\n}\n\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nfunction useTypeahead(context, props) {\n var _ref;\n const {\n open,\n dataRef\n } = context;\n const {\n listRef,\n activeIndex,\n onMatch: unstable_onMatch,\n onTypingChange: unstable_onTypingChange,\n enabled = true,\n findMatch = null,\n resetMs = 750,\n ignoreKeys = [],\n selectedIndex = null\n } = props;\n const timeoutIdRef = React.useRef(-1);\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef((_ref = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref : -1);\n const matchIndexRef = React.useRef(null);\n const onMatch = useEffectEvent(unstable_onMatch);\n const onTypingChange = useEffectEvent(unstable_onTypingChange);\n const findMatchRef = useLatestRef(findMatch);\n const ignoreKeysRef = useLatestRef(ignoreKeys);\n useModernLayoutEffect(() => {\n if (open) {\n clearTimeoutIfSet(timeoutIdRef);\n matchIndexRef.current = null;\n stringRef.current = '';\n }\n }, [open]);\n useModernLayoutEffect(() => {\n // Sync arrow key navigation but not typeahead navigation.\n if (open && stringRef.current === '') {\n var _ref2;\n prevIndexRef.current = (_ref2 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref2 : -1;\n }\n }, [open, selectedIndex, activeIndex]);\n const setTypingChange = useEffectEvent(value => {\n if (value) {\n if (!dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange(value);\n }\n } else {\n if (dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange(value);\n }\n }\n });\n const onKeyDown = useEffectEvent(event => {\n function getMatchingIndex(list, orderedList, string) {\n const str = findMatchRef.current ? findMatchRef.current(orderedList, string) : orderedList.find(text => (text == null ? void 0 : text.toLocaleLowerCase().indexOf(string.toLocaleLowerCase())) === 0);\n return str ? list.indexOf(str) : -1;\n }\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, listContent, stringRef.current) === -1) {\n setTypingChange(false);\n } else if (event.key === ' ') {\n stopEvent(event);\n }\n }\n if (listContent == null || ignoreKeysRef.current.includes(event.key) ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n setTypingChange(true);\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too.\n const allowRapidSuccessionOfFirstLetter = listContent.every(text => {\n var _text$, _text$2;\n return text ? ((_text$ = text[0]) == null ? void 0 : _text$.toLocaleLowerCase()) !== ((_text$2 = text[1]) == null ? void 0 : _text$2.toLocaleLowerCase()) : true;\n });\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n clearTimeoutIfSet(timeoutIdRef);\n timeoutIdRef.current = window.setTimeout(() => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n setTypingChange(false);\n }, resetMs);\n const prevIndex = prevIndexRef.current;\n const index = getMatchingIndex(listContent, [...listContent.slice((prevIndex || 0) + 1), ...listContent.slice(0, (prevIndex || 0) + 1)], stringRef.current);\n if (index !== -1) {\n onMatch(index);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n setTypingChange(false);\n }\n });\n const reference = React.useMemo(() => ({\n onKeyDown\n }), [onKeyDown]);\n const floating = React.useMemo(() => {\n return {\n onKeyDown,\n onKeyUp(event) {\n if (event.key === ' ') {\n setTypingChange(false);\n }\n }\n };\n }, [onKeyDown, setTypingChange]);\n return React.useMemo(() => enabled ? {\n reference,\n floating\n } : {}, [enabled, reference, floating]);\n}\n\nfunction getArgsWithCustomFloatingHeight(state, height) {\n return {\n ...state,\n rects: {\n ...state.rects,\n floating: {\n ...state.rects.floating,\n height\n }\n }\n };\n}\n/**\n * Positions the floating element such that an inner element inside of it is\n * anchored to the reference element.\n * @see https://floating-ui.com/docs/inner\n * @deprecated\n */\nconst inner = props => ({\n name: 'inner',\n options: props,\n async fn(state) {\n const {\n listRef,\n overflowRef,\n onFallbackChange,\n offset: innerOffset = 0,\n index = 0,\n minItemsVisible = 4,\n referenceOverflowThreshold = 0,\n scrollRef,\n ...detectOverflowOptions\n } = evaluate(props, state);\n const {\n rects,\n elements: {\n floating\n }\n } = state;\n const item = listRef.current[index];\n const scrollEl = (scrollRef == null ? void 0 : scrollRef.current) || floating;\n\n // Valid combinations:\n // 1. Floating element is the scrollRef and has a border (default)\n // 2. Floating element is not the scrollRef, floating element has a border\n // 3. Floating element is not the scrollRef, scrollRef has a border\n // Floating > {...getFloatingProps()} wrapper > scrollRef > items is not\n // allowed as VoiceOver doesn't work.\n const clientTop = floating.clientTop || scrollEl.clientTop;\n const floatingIsBordered = floating.clientTop !== 0;\n const scrollElIsBordered = scrollEl.clientTop !== 0;\n const floatingIsScrollEl = floating === scrollEl;\n if (process.env.NODE_ENV !== \"production\") {\n if (!state.placement.startsWith('bottom')) {\n warn('`placement` side must be \"bottom\" when using the `inner`', 'middleware.');\n }\n }\n if (!item) {\n return {};\n }\n const nextArgs = {\n ...state,\n ...(await offset(-item.offsetTop - floating.clientTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(state))\n };\n const overflow = await detectOverflow(getArgsWithCustomFloatingHeight(nextArgs, scrollEl.scrollHeight + clientTop + floating.clientTop), detectOverflowOptions);\n const refOverflow = await detectOverflow(nextArgs, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const diffY = max(0, overflow.top);\n const nextY = nextArgs.y + diffY;\n const isScrollable = scrollEl.scrollHeight > scrollEl.clientHeight;\n const rounder = isScrollable ? v => v : round;\n const maxHeight = rounder(max(0, scrollEl.scrollHeight + (floatingIsBordered && floatingIsScrollEl || scrollElIsBordered ? clientTop * 2 : 0) - diffY - max(0, overflow.bottom)));\n scrollEl.style.maxHeight = maxHeight + \"px\";\n scrollEl.scrollTop = diffY;\n\n // There is not enough space, fallback to standard anchored positioning\n if (onFallbackChange) {\n const shouldFallback = scrollEl.offsetHeight < item.offsetHeight * min(minItemsVisible, listRef.current.length) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold;\n ReactDOM.flushSync(() => onFallbackChange(shouldFallback));\n }\n if (overflowRef) {\n overflowRef.current = await detectOverflow(getArgsWithCustomFloatingHeight({\n ...nextArgs,\n y: nextY\n }, scrollEl.offsetHeight + clientTop + floating.clientTop), detectOverflowOptions);\n }\n return {\n y: nextY\n };\n }\n});\n/**\n * Changes the `inner` middleware's `offset` upon a `wheel` event to\n * expand the floating element's height, revealing more list items.\n * @see https://floating-ui.com/docs/inner\n * @deprecated\n */\nfunction useInnerOffset(context, props) {\n const {\n open,\n elements\n } = context;\n const {\n enabled = true,\n overflowRef,\n scrollRef,\n onChange: unstable_onChange\n } = props;\n const onChange = useEffectEvent(unstable_onChange);\n const controlledScrollingRef = React.useRef(false);\n const prevScrollTopRef = React.useRef(null);\n const initialOverflowRef = React.useRef(null);\n React.useEffect(() => {\n if (!enabled) return;\n function onWheel(e) {\n if (e.ctrlKey || !el || overflowRef.current == null) {\n return;\n }\n const dY = e.deltaY;\n const isAtTop = overflowRef.current.top >= -0.5;\n const isAtBottom = overflowRef.current.bottom >= -0.5;\n const remainingScroll = el.scrollHeight - el.clientHeight;\n const sign = dY < 0 ? -1 : 1;\n const method = dY < 0 ? 'max' : 'min';\n if (el.scrollHeight <= el.clientHeight) {\n return;\n }\n if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {\n e.preventDefault();\n ReactDOM.flushSync(() => {\n onChange(d => d + Math[method](dY, remainingScroll * sign));\n });\n } else if (/firefox/i.test(getUserAgent())) {\n // Needed to propagate scrolling during momentum scrolling phase once\n // it gets limited by the boundary. UX improvement, not critical.\n el.scrollTop += dY;\n }\n }\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (open && el) {\n el.addEventListener('wheel', onWheel);\n\n // Wait for the position to be ready.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n if (overflowRef.current != null) {\n initialOverflowRef.current = {\n ...overflowRef.current\n };\n }\n });\n return () => {\n prevScrollTopRef.current = null;\n initialOverflowRef.current = null;\n el.removeEventListener('wheel', onWheel);\n };\n }\n }, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);\n const floating = React.useMemo(() => ({\n onKeyDown() {\n controlledScrollingRef.current = true;\n },\n onWheel() {\n controlledScrollingRef.current = false;\n },\n onPointerMove() {\n controlledScrollingRef.current = false;\n },\n onScroll() {\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (!overflowRef.current || !el || !controlledScrollingRef.current) {\n return;\n }\n if (prevScrollTopRef.current !== null) {\n const scrollDiff = el.scrollTop - prevScrollTopRef.current;\n if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {\n ReactDOM.flushSync(() => onChange(d => d + scrollDiff));\n }\n }\n\n // [Firefox] Wait for the height change to have been applied.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n });\n }\n }), [elements.floating, onChange, overflowRef, scrollRef]);\n return React.useMemo(() => enabled ? {\n floating\n } : {}, [enabled, floating]);\n}\n\nfunction getNodeChildren(nodes, id, onlyOpenChildren) {\n if (onlyOpenChildren === void 0) {\n onlyOpenChildren = true;\n }\n const directChildren = nodes.filter(node => {\n var _node$context;\n return node.parentId === id && (!onlyOpenChildren || ((_node$context = node.context) == null ? void 0 : _node$context.open));\n });\n return directChildren.flatMap(child => [child, ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);\n}\n\nfunction isPointInPolygon(point, polygon) {\n const [x, y] = point;\n let isInside = false;\n const length = polygon.length;\n for (let i = 0, j = length - 1; i < length; j = i++) {\n const [xi, yi] = polygon[i] || [0, 0];\n const [xj, yj] = polygon[j] || [0, 0];\n const intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\nfunction isInside(point, rect) {\n return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n}\n/**\n * Generates a safe polygon area that the user can traverse without closing the\n * floating element once leaving the reference element.\n * @see https://floating-ui.com/docs/useHover#safepolygon\n */\nfunction safePolygon(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n buffer = 0.5,\n blockPointerEvents = false,\n requireIntent = true\n } = options;\n const timeoutRef = {\n current: -1\n };\n let hasLanded = false;\n let lastX = null;\n let lastY = null;\n let lastCursorTime = typeof performance !== 'undefined' ? performance.now() : 0;\n function getCursorSpeed(x, y) {\n const currentTime = performance.now();\n const elapsedTime = currentTime - lastCursorTime;\n if (lastX === null || lastY === null || elapsedTime === 0) {\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return null;\n }\n const deltaX = x - lastX;\n const deltaY = y - lastY;\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n const speed = distance / elapsedTime; // px / ms\n\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return speed;\n }\n const fn = _ref => {\n let {\n x,\n y,\n placement,\n elements,\n onClose,\n nodeId,\n tree\n } = _ref;\n return function onMouseMove(event) {\n function close() {\n clearTimeoutIfSet(timeoutRef);\n onClose();\n }\n clearTimeoutIfSet(timeoutRef);\n if (!elements.domReference || !elements.floating || placement == null || x == null || y == null) {\n return;\n }\n const {\n clientX,\n clientY\n } = event;\n const clientPoint = [clientX, clientY];\n const target = getTarget(event);\n const isLeave = event.type === 'mouseleave';\n const isOverFloatingEl = contains(elements.floating, target);\n const isOverReferenceEl = contains(elements.domReference, target);\n const refRect = elements.domReference.getBoundingClientRect();\n const rect = elements.floating.getBoundingClientRect();\n const side = placement.split('-')[0];\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;\n const isOverReferenceRect = isInside(clientPoint, refRect);\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n const left = (isFloatingWider ? refRect : rect).left;\n const right = (isFloatingWider ? refRect : rect).right;\n const top = (isFloatingTaller ? refRect : rect).top;\n const bottom = (isFloatingTaller ? refRect : rect).bottom;\n if (isOverFloatingEl) {\n hasLanded = true;\n if (!isLeave) {\n return;\n }\n }\n if (isOverReferenceEl) {\n hasLanded = false;\n }\n if (isOverReferenceEl && !isLeave) {\n hasLanded = true;\n return;\n }\n\n // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n if (isLeave && isElement(event.relatedTarget) && contains(elements.floating, event.relatedTarget)) {\n return;\n }\n\n // If any nested child is open, abort.\n if (tree && getNodeChildren(tree.nodesRef.current, nodeId).length) {\n return;\n }\n\n // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n return close();\n }\n\n // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n let rectPoly = [];\n switch (side) {\n case 'top':\n rectPoly = [[left, refRect.top + 1], [left, rect.bottom - 1], [right, rect.bottom - 1], [right, refRect.top + 1]];\n break;\n case 'bottom':\n rectPoly = [[left, rect.top + 1], [left, refRect.bottom - 1], [right, refRect.bottom - 1], [right, rect.top + 1]];\n break;\n case 'left':\n rectPoly = [[rect.right - 1, bottom], [rect.right - 1, top], [refRect.left + 1, top], [refRect.left + 1, bottom]];\n break;\n case 'right':\n rectPoly = [[refRect.right - 1, bottom], [refRect.right - 1, top], [rect.left + 1, top], [rect.left + 1, bottom]];\n break;\n }\n function getPolygon(_ref2) {\n let [x, y] = _ref2;\n switch (side) {\n case 'top':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'bottom':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'left':\n {\n const cursorPointOne = [x + buffer + 1, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x + buffer + 1, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];\n return [...commonPoints, cursorPointOne, cursorPointTwo];\n }\n case 'right':\n {\n const cursorPointOne = [x - buffer, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x - buffer, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n }\n }\n if (isPointInPolygon([clientX, clientY], rectPoly)) {\n return;\n }\n if (hasLanded && !isOverReferenceRect) {\n return close();\n }\n if (!isLeave && requireIntent) {\n const cursorSpeed = getCursorSpeed(event.clientX, event.clientY);\n const cursorSpeedThreshold = 0.1;\n if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) {\n return close();\n }\n }\n if (!isPointInPolygon([clientX, clientY], getPolygon([x, y]))) {\n close();\n } else if (!hasLanded && requireIntent) {\n timeoutRef.current = window.setTimeout(close, 40);\n }\n };\n };\n fn.__options = {\n blockPointerEvents\n };\n return fn;\n}\n\nexport { Composite, CompositeItem, FloatingArrow, FloatingDelayGroup, FloatingFocusManager, FloatingList, FloatingNode, FloatingOverlay, FloatingPortal, FloatingTree, NextFloatingDelayGroup, inner, safePolygon, useClick, useClientPoint, useDelayGroup, useDelayGroupContext, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingPortalNode, useFloatingRootContext, useFloatingTree, useFocus, useHover, useId, useInnerOffset, useInteractions, useListItem, useListNavigation, useMergeRefs, useNextDelayGroup, useRole, useTransitionStatus, useTransitionStyles, useTypeahead };\n","import { autoUpdate, flip, offset, type Placement, size, useFloating } from '@floating-ui/react'\n\nexport interface UseFloatingDropdownOptions {\n placement?: Placement\n offsetPx?: number\n enabled?: boolean\n}\n\n/**\n * Hook for dropdown positioning using @floating-ui/react.\n * Handles viewport boundary detection and auto-positioning.\n */\nexport function useFloatingDropdown({\n placement = 'bottom-start',\n offsetPx = 4,\n enabled = true,\n}: UseFloatingDropdownOptions = {}) {\n const { refs, floatingStyles, context } = useFloating({\n placement,\n middleware: [\n offset(offsetPx),\n flip({\n fallbackAxisSideDirection: 'end',\n padding: 8,\n }),\n size({\n apply({ rects, elements }) {\n // Match dropdown width to trigger width\n Object.assign(elements.floating.style, {\n minWidth: `${rects.reference.width}px`,\n })\n },\n padding: 8,\n }),\n ],\n whileElementsMounted: enabled ? autoUpdate : undefined,\n })\n\n return {\n refs,\n floatingStyles,\n context,\n }\n}\n","function memo(getDeps, fn, opts) {\n let deps = opts.initialDeps ?? [];\n let result;\n let isInitial = true;\n function memoizedFunction() {\n var _a, _b, _c;\n let depTime;\n if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();\n const newDeps = getDeps();\n const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);\n if (!depsChanged) {\n return result;\n }\n deps = newDeps;\n let resultTime;\n if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();\n result = fn(...newDeps);\n if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {\n const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;\n const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;\n const resultFpsPercentage = resultEndTime / 16;\n const pad = (str, num) => {\n str = String(str);\n while (str.length < num) {\n str = \" \" + str;\n }\n return str;\n };\n console.info(\n `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,\n `\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(\n 0,\n Math.min(120 - 120 * resultFpsPercentage, 120)\n )}deg 100% 31%);`,\n opts == null ? void 0 : opts.key\n );\n }\n if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {\n opts.onChange(result);\n }\n isInitial = false;\n return result;\n }\n memoizedFunction.updateDeps = (newDeps) => {\n deps = newDeps;\n };\n return memoizedFunction;\n}\nfunction notUndefined(value, msg) {\n if (value === void 0) {\n throw new Error(`Unexpected undefined${msg ? `: ${msg}` : \"\"}`);\n } else {\n return value;\n }\n}\nconst approxEqual = (a, b) => Math.abs(a - b) < 1.01;\nconst debounce = (targetWindow, fn, ms) => {\n let timeoutId;\n return function(...args) {\n targetWindow.clearTimeout(timeoutId);\n timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);\n };\n};\nexport {\n approxEqual,\n debounce,\n memo,\n notUndefined\n};\n//# sourceMappingURL=utils.js.map\n","import { debounce, memo, notUndefined, approxEqual } from \"./utils.js\";\nconst getRect = (element) => {\n const { offsetWidth, offsetHeight } = element;\n return { width: offsetWidth, height: offsetHeight };\n};\nconst defaultKeyExtractor = (index) => index;\nconst defaultRangeExtractor = (range) => {\n const start = Math.max(range.startIndex - range.overscan, 0);\n const end = Math.min(range.endIndex + range.overscan, range.count - 1);\n const arr = [];\n for (let i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n};\nconst observeElementRect = (instance, cb) => {\n const element = instance.scrollElement;\n if (!element) {\n return;\n }\n const targetWindow = instance.targetWindow;\n if (!targetWindow) {\n return;\n }\n const handler = (rect) => {\n const { width, height } = rect;\n cb({ width: Math.round(width), height: Math.round(height) });\n };\n handler(getRect(element));\n if (!targetWindow.ResizeObserver) {\n return () => {\n };\n }\n const observer = new targetWindow.ResizeObserver((entries) => {\n const run = () => {\n const entry = entries[0];\n if (entry == null ? void 0 : entry.borderBoxSize) {\n const box = entry.borderBoxSize[0];\n if (box) {\n handler({ width: box.inlineSize, height: box.blockSize });\n return;\n }\n }\n handler(getRect(element));\n };\n instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();\n });\n observer.observe(element, { box: \"border-box\" });\n return () => {\n observer.unobserve(element);\n };\n};\nconst addEventListenerOptions = {\n passive: true\n};\nconst observeWindowRect = (instance, cb) => {\n const element = instance.scrollElement;\n if (!element) {\n return;\n }\n const handler = () => {\n cb({ width: element.innerWidth, height: element.innerHeight });\n };\n handler();\n element.addEventListener(\"resize\", handler, addEventListenerOptions);\n return () => {\n element.removeEventListener(\"resize\", handler);\n };\n};\nconst supportsScrollend = typeof window == \"undefined\" ? true : \"onscrollend\" in window;\nconst observeElementOffset = (instance, cb) => {\n const element = instance.scrollElement;\n if (!element) {\n return;\n }\n const targetWindow = instance.targetWindow;\n if (!targetWindow) {\n return;\n }\n let offset = 0;\n const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : debounce(\n targetWindow,\n () => {\n cb(offset, false);\n },\n instance.options.isScrollingResetDelay\n );\n const createHandler = (isScrolling) => () => {\n const { horizontal, isRtl } = instance.options;\n offset = horizontal ? element[\"scrollLeft\"] * (isRtl && -1 || 1) : element[\"scrollTop\"];\n fallback();\n cb(offset, isScrolling);\n };\n const handler = createHandler(true);\n const endHandler = createHandler(false);\n element.addEventListener(\"scroll\", handler, addEventListenerOptions);\n const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;\n if (registerScrollendEvent) {\n element.addEventListener(\"scrollend\", endHandler, addEventListenerOptions);\n }\n return () => {\n element.removeEventListener(\"scroll\", handler);\n if (registerScrollendEvent) {\n element.removeEventListener(\"scrollend\", endHandler);\n }\n };\n};\nconst observeWindowOffset = (instance, cb) => {\n const element = instance.scrollElement;\n if (!element) {\n return;\n }\n const targetWindow = instance.targetWindow;\n if (!targetWindow) {\n return;\n }\n let offset = 0;\n const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : debounce(\n targetWindow,\n () => {\n cb(offset, false);\n },\n instance.options.isScrollingResetDelay\n );\n const createHandler = (isScrolling) => () => {\n offset = element[instance.options.horizontal ? \"scrollX\" : \"scrollY\"];\n fallback();\n cb(offset, isScrolling);\n };\n const handler = createHandler(true);\n const endHandler = createHandler(false);\n element.addEventListener(\"scroll\", handler, addEventListenerOptions);\n const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;\n if (registerScrollendEvent) {\n element.addEventListener(\"scrollend\", endHandler, addEventListenerOptions);\n }\n return () => {\n element.removeEventListener(\"scroll\", handler);\n if (registerScrollendEvent) {\n element.removeEventListener(\"scrollend\", endHandler);\n }\n };\n};\nconst measureElement = (element, entry, instance) => {\n if (entry == null ? void 0 : entry.borderBoxSize) {\n const box = entry.borderBoxSize[0];\n if (box) {\n const size = Math.round(\n box[instance.options.horizontal ? \"inlineSize\" : \"blockSize\"]\n );\n return size;\n }\n }\n return element[instance.options.horizontal ? \"offsetWidth\" : \"offsetHeight\"];\n};\nconst windowScroll = (offset, {\n adjustments = 0,\n behavior\n}, instance) => {\n var _a, _b;\n const toOffset = offset + adjustments;\n (_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {\n [instance.options.horizontal ? \"left\" : \"top\"]: toOffset,\n behavior\n });\n};\nconst elementScroll = (offset, {\n adjustments = 0,\n behavior\n}, instance) => {\n var _a, _b;\n const toOffset = offset + adjustments;\n (_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {\n [instance.options.horizontal ? \"left\" : \"top\"]: toOffset,\n behavior\n });\n};\nclass Virtualizer {\n constructor(opts) {\n this.unsubs = [];\n this.scrollElement = null;\n this.targetWindow = null;\n this.isScrolling = false;\n this.currentScrollToIndex = null;\n this.measurementsCache = [];\n this.itemSizeCache = /* @__PURE__ */ new Map();\n this.laneAssignments = /* @__PURE__ */ new Map();\n this.pendingMeasuredCacheIndexes = [];\n this.prevLanes = void 0;\n this.lanesChangedFlag = false;\n this.lanesSettling = false;\n this.scrollRect = null;\n this.scrollOffset = null;\n this.scrollDirection = null;\n this.scrollAdjustments = 0;\n this.elementsCache = /* @__PURE__ */ new Map();\n this.observer = /* @__PURE__ */ (() => {\n let _ro = null;\n const get = () => {\n if (_ro) {\n return _ro;\n }\n if (!this.targetWindow || !this.targetWindow.ResizeObserver) {\n return null;\n }\n return _ro = new this.targetWindow.ResizeObserver((entries) => {\n entries.forEach((entry) => {\n const run = () => {\n this._measureElement(entry.target, entry);\n };\n this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();\n });\n });\n };\n return {\n disconnect: () => {\n var _a;\n (_a = get()) == null ? void 0 : _a.disconnect();\n _ro = null;\n },\n observe: (target) => {\n var _a;\n return (_a = get()) == null ? void 0 : _a.observe(target, { box: \"border-box\" });\n },\n unobserve: (target) => {\n var _a;\n return (_a = get()) == null ? void 0 : _a.unobserve(target);\n }\n };\n })();\n this.range = null;\n this.setOptions = (opts2) => {\n Object.entries(opts2).forEach(([key, value]) => {\n if (typeof value === \"undefined\") delete opts2[key];\n });\n this.options = {\n debug: false,\n initialOffset: 0,\n overscan: 1,\n paddingStart: 0,\n paddingEnd: 0,\n scrollPaddingStart: 0,\n scrollPaddingEnd: 0,\n horizontal: false,\n getItemKey: defaultKeyExtractor,\n rangeExtractor: defaultRangeExtractor,\n onChange: () => {\n },\n measureElement,\n initialRect: { width: 0, height: 0 },\n scrollMargin: 0,\n gap: 0,\n indexAttribute: \"data-index\",\n initialMeasurementsCache: [],\n lanes: 1,\n isScrollingResetDelay: 150,\n enabled: true,\n isRtl: false,\n useScrollendEvent: false,\n useAnimationFrameWithResizeObserver: false,\n ...opts2\n };\n };\n this.notify = (sync) => {\n var _a, _b;\n (_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync);\n };\n this.maybeNotify = memo(\n () => {\n this.calculateRange();\n return [\n this.isScrolling,\n this.range ? this.range.startIndex : null,\n this.range ? this.range.endIndex : null\n ];\n },\n (isScrolling) => {\n this.notify(isScrolling);\n },\n {\n key: process.env.NODE_ENV !== \"production\" && \"maybeNotify\",\n debug: () => this.options.debug,\n initialDeps: [\n this.isScrolling,\n this.range ? this.range.startIndex : null,\n this.range ? this.range.endIndex : null\n ]\n }\n );\n this.cleanup = () => {\n this.unsubs.filter(Boolean).forEach((d) => d());\n this.unsubs = [];\n this.observer.disconnect();\n this.scrollElement = null;\n this.targetWindow = null;\n };\n this._didMount = () => {\n return () => {\n this.cleanup();\n };\n };\n this._willUpdate = () => {\n var _a;\n const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;\n if (this.scrollElement !== scrollElement) {\n this.cleanup();\n if (!scrollElement) {\n this.maybeNotify();\n return;\n }\n this.scrollElement = scrollElement;\n if (this.scrollElement && \"ownerDocument\" in this.scrollElement) {\n this.targetWindow = this.scrollElement.ownerDocument.defaultView;\n } else {\n this.targetWindow = ((_a = this.scrollElement) == null ? void 0 : _a.window) ?? null;\n }\n this.elementsCache.forEach((cached) => {\n this.observer.observe(cached);\n });\n this.unsubs.push(\n this.options.observeElementRect(this, (rect) => {\n this.scrollRect = rect;\n this.maybeNotify();\n })\n );\n this.unsubs.push(\n this.options.observeElementOffset(this, (offset, isScrolling) => {\n this.scrollAdjustments = 0;\n this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? \"forward\" : \"backward\" : null;\n this.scrollOffset = offset;\n this.isScrolling = isScrolling;\n this.maybeNotify();\n })\n );\n this._scrollToOffset(this.getScrollOffset(), {\n adjustments: void 0,\n behavior: void 0\n });\n }\n };\n this.getSize = () => {\n if (!this.options.enabled) {\n this.scrollRect = null;\n return 0;\n }\n this.scrollRect = this.scrollRect ?? this.options.initialRect;\n return this.scrollRect[this.options.horizontal ? \"width\" : \"height\"];\n };\n this.getScrollOffset = () => {\n if (!this.options.enabled) {\n this.scrollOffset = null;\n return 0;\n }\n this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === \"function\" ? this.options.initialOffset() : this.options.initialOffset);\n return this.scrollOffset;\n };\n this.getFurthestMeasurement = (measurements, index) => {\n const furthestMeasurementsFound = /* @__PURE__ */ new Map();\n const furthestMeasurements = /* @__PURE__ */ new Map();\n for (let m = index - 1; m >= 0; m--) {\n const measurement = measurements[m];\n if (furthestMeasurementsFound.has(measurement.lane)) {\n continue;\n }\n const previousFurthestMeasurement = furthestMeasurements.get(\n measurement.lane\n );\n if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {\n furthestMeasurements.set(measurement.lane, measurement);\n } else if (measurement.end < previousFurthestMeasurement.end) {\n furthestMeasurementsFound.set(measurement.lane, true);\n }\n if (furthestMeasurementsFound.size === this.options.lanes) {\n break;\n }\n }\n return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {\n if (a.end === b.end) {\n return a.index - b.index;\n }\n return a.end - b.end;\n })[0] : void 0;\n };\n this.getMeasurementOptions = memo(\n () => [\n this.options.count,\n this.options.paddingStart,\n this.options.scrollMargin,\n this.options.getItemKey,\n this.options.enabled,\n this.options.lanes\n ],\n (count, paddingStart, scrollMargin, getItemKey, enabled, lanes) => {\n const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes;\n if (lanesChanged) {\n this.lanesChangedFlag = true;\n }\n this.prevLanes = lanes;\n this.pendingMeasuredCacheIndexes = [];\n return {\n count,\n paddingStart,\n scrollMargin,\n getItemKey,\n enabled,\n lanes\n };\n },\n {\n key: false\n }\n );\n this.getMeasurements = memo(\n () => [this.getMeasurementOptions(), this.itemSizeCache],\n ({ count, paddingStart, scrollMargin, getItemKey, enabled, lanes }, itemSizeCache) => {\n if (!enabled) {\n this.measurementsCache = [];\n this.itemSizeCache.clear();\n this.laneAssignments.clear();\n return [];\n }\n if (this.laneAssignments.size > count) {\n for (const index of this.laneAssignments.keys()) {\n if (index >= count) {\n this.laneAssignments.delete(index);\n }\n }\n }\n if (this.lanesChangedFlag) {\n this.lanesChangedFlag = false;\n this.lanesSettling = true;\n this.measurementsCache = [];\n this.itemSizeCache.clear();\n this.laneAssignments.clear();\n this.pendingMeasuredCacheIndexes = [];\n }\n if (this.measurementsCache.length === 0 && !this.lanesSettling) {\n this.measurementsCache = this.options.initialMeasurementsCache;\n this.measurementsCache.forEach((item) => {\n this.itemSizeCache.set(item.key, item.size);\n });\n }\n const min = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;\n this.pendingMeasuredCacheIndexes = [];\n if (this.lanesSettling && this.measurementsCache.length === count) {\n this.lanesSettling = false;\n }\n const measurements = this.measurementsCache.slice(0, min);\n const laneLastIndex = new Array(lanes).fill(\n void 0\n );\n for (let m = 0; m < min; m++) {\n const item = measurements[m];\n if (item) {\n laneLastIndex[item.lane] = m;\n }\n }\n for (let i = min; i < count; i++) {\n const key = getItemKey(i);\n const cachedLane = this.laneAssignments.get(i);\n let lane;\n let start;\n if (cachedLane !== void 0 && this.options.lanes > 1) {\n lane = cachedLane;\n const prevIndex = laneLastIndex[lane];\n const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;\n start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin;\n } else {\n const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);\n start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;\n lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;\n if (this.options.lanes > 1) {\n this.laneAssignments.set(i, lane);\n }\n }\n const measuredSize = itemSizeCache.get(key);\n const size = typeof measuredSize === \"number\" ? measuredSize : this.options.estimateSize(i);\n const end = start + size;\n measurements[i] = {\n index: i,\n start,\n size,\n end,\n key,\n lane\n };\n laneLastIndex[lane] = i;\n }\n this.measurementsCache = measurements;\n return measurements;\n },\n {\n key: process.env.NODE_ENV !== \"production\" && \"getMeasurements\",\n debug: () => this.options.debug\n }\n );\n this.calculateRange = memo(\n () => [\n this.getMeasurements(),\n this.getSize(),\n this.getScrollOffset(),\n this.options.lanes\n ],\n (measurements, outerSize, scrollOffset, lanes) => {\n return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({\n measurements,\n outerSize,\n scrollOffset,\n lanes\n }) : null;\n },\n {\n key: process.env.NODE_ENV !== \"production\" && \"calculateRange\",\n debug: () => this.options.debug\n }\n );\n this.getVirtualIndexes = memo(\n () => {\n let startIndex = null;\n let endIndex = null;\n const range = this.calculateRange();\n if (range) {\n startIndex = range.startIndex;\n endIndex = range.endIndex;\n }\n this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]);\n return [\n this.options.rangeExtractor,\n this.options.overscan,\n this.options.count,\n startIndex,\n endIndex\n ];\n },\n (rangeExtractor, overscan, count, startIndex, endIndex) => {\n return startIndex === null || endIndex === null ? [] : rangeExtractor({\n startIndex,\n endIndex,\n overscan,\n count\n });\n },\n {\n key: process.env.NODE_ENV !== \"production\" && \"getVirtualIndexes\",\n debug: () => this.options.debug\n }\n );\n this.indexFromElement = (node) => {\n const attributeName = this.options.indexAttribute;\n const indexStr = node.getAttribute(attributeName);\n if (!indexStr) {\n console.warn(\n `Missing attribute name '${attributeName}={index}' on measured element.`\n );\n return -1;\n }\n return parseInt(indexStr, 10);\n };\n this._measureElement = (node, entry) => {\n const index = this.indexFromElement(node);\n const item = this.measurementsCache[index];\n if (!item) {\n return;\n }\n const key = item.key;\n const prevNode = this.elementsCache.get(key);\n if (prevNode !== node) {\n if (prevNode) {\n this.observer.unobserve(prevNode);\n }\n this.observer.observe(node);\n this.elementsCache.set(key, node);\n }\n if (node.isConnected) {\n this.resizeItem(index, this.options.measureElement(node, entry, this));\n }\n };\n this.resizeItem = (index, size) => {\n const item = this.measurementsCache[index];\n if (!item) {\n return;\n }\n const itemSize = this.itemSizeCache.get(item.key) ?? item.size;\n const delta = size - itemSize;\n if (delta !== 0) {\n if (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.getScrollOffset() + this.scrollAdjustments) {\n if (process.env.NODE_ENV !== \"production\" && this.options.debug) {\n console.info(\"correction\", delta);\n }\n this._scrollToOffset(this.getScrollOffset(), {\n adjustments: this.scrollAdjustments += delta,\n behavior: void 0\n });\n }\n this.pendingMeasuredCacheIndexes.push(item.index);\n this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));\n this.notify(false);\n }\n };\n this.measureElement = (node) => {\n if (!node) {\n this.elementsCache.forEach((cached, key) => {\n if (!cached.isConnected) {\n this.observer.unobserve(cached);\n this.elementsCache.delete(key);\n }\n });\n return;\n }\n this._measureElement(node, void 0);\n };\n this.getVirtualItems = memo(\n () => [this.getVirtualIndexes(), this.getMeasurements()],\n (indexes, measurements) => {\n const virtualItems = [];\n for (let k = 0, len = indexes.length; k < len; k++) {\n const i = indexes[k];\n const measurement = measurements[i];\n virtualItems.push(measurement);\n }\n return virtualItems;\n },\n {\n key: process.env.NODE_ENV !== \"production\" && \"getVirtualItems\",\n debug: () => this.options.debug\n }\n );\n this.getVirtualItemForOffset = (offset) => {\n const measurements = this.getMeasurements();\n if (measurements.length === 0) {\n return void 0;\n }\n return notUndefined(\n measurements[findNearestBinarySearch(\n 0,\n measurements.length - 1,\n (index) => notUndefined(measurements[index]).start,\n offset\n )]\n );\n };\n this.getMaxScrollOffset = () => {\n if (!this.scrollElement) return 0;\n if (\"scrollHeight\" in this.scrollElement) {\n return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;\n } else {\n const doc = this.scrollElement.document.documentElement;\n return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight;\n }\n };\n this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {\n if (!this.scrollElement) return 0;\n const size = this.getSize();\n const scrollOffset = this.getScrollOffset();\n if (align === \"auto\") {\n align = toOffset >= scrollOffset + size ? \"end\" : \"start\";\n }\n if (align === \"center\") {\n toOffset += (itemSize - size) / 2;\n } else if (align === \"end\") {\n toOffset -= size;\n }\n const maxOffset = this.getMaxScrollOffset();\n return Math.max(Math.min(maxOffset, toOffset), 0);\n };\n this.getOffsetForIndex = (index, align = \"auto\") => {\n index = Math.max(0, Math.min(index, this.options.count - 1));\n const item = this.measurementsCache[index];\n if (!item) {\n return void 0;\n }\n const size = this.getSize();\n const scrollOffset = this.getScrollOffset();\n if (align === \"auto\") {\n if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {\n align = \"end\";\n } else if (item.start <= scrollOffset + this.options.scrollPaddingStart) {\n align = \"start\";\n } else {\n return [scrollOffset, align];\n }\n }\n if (align === \"end\" && index === this.options.count - 1) {\n return [this.getMaxScrollOffset(), align];\n }\n const toOffset = align === \"end\" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;\n return [\n this.getOffsetForAlignment(toOffset, align, item.size),\n align\n ];\n };\n this.isDynamicMode = () => this.elementsCache.size > 0;\n this.scrollToOffset = (toOffset, { align = \"start\", behavior } = {}) => {\n if (behavior === \"smooth\" && this.isDynamicMode()) {\n console.warn(\n \"The `smooth` scroll behavior is not fully supported with dynamic size.\"\n );\n }\n this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), {\n adjustments: void 0,\n behavior\n });\n };\n this.scrollToIndex = (index, { align: initialAlign = \"auto\", behavior } = {}) => {\n if (behavior === \"smooth\" && this.isDynamicMode()) {\n console.warn(\n \"The `smooth` scroll behavior is not fully supported with dynamic size.\"\n );\n }\n index = Math.max(0, Math.min(index, this.options.count - 1));\n this.currentScrollToIndex = index;\n let attempts = 0;\n const maxAttempts = 10;\n const tryScroll = (currentAlign) => {\n if (!this.targetWindow) return;\n const offsetInfo = this.getOffsetForIndex(index, currentAlign);\n if (!offsetInfo) {\n console.warn(\"Failed to get offset for index:\", index);\n return;\n }\n const [offset, align] = offsetInfo;\n this._scrollToOffset(offset, { adjustments: void 0, behavior });\n this.targetWindow.requestAnimationFrame(() => {\n const verify = () => {\n if (this.currentScrollToIndex !== index) return;\n const currentOffset = this.getScrollOffset();\n const afterInfo = this.getOffsetForIndex(index, align);\n if (!afterInfo) {\n console.warn(\"Failed to get offset for index:\", index);\n return;\n }\n if (!approxEqual(afterInfo[0], currentOffset)) {\n scheduleRetry(align);\n }\n };\n if (this.isDynamicMode()) {\n this.targetWindow.requestAnimationFrame(verify);\n } else {\n verify();\n }\n });\n };\n const scheduleRetry = (align) => {\n if (!this.targetWindow) return;\n if (this.currentScrollToIndex !== index) return;\n attempts++;\n if (attempts < maxAttempts) {\n if (process.env.NODE_ENV !== \"production\" && this.options.debug) {\n console.info(\"Schedule retry\", attempts, maxAttempts);\n }\n this.targetWindow.requestAnimationFrame(() => tryScroll(align));\n } else {\n console.warn(\n `Failed to scroll to index ${index} after ${maxAttempts} attempts.`\n );\n }\n };\n tryScroll(initialAlign);\n };\n this.scrollBy = (delta, { behavior } = {}) => {\n if (behavior === \"smooth\" && this.isDynamicMode()) {\n console.warn(\n \"The `smooth` scroll behavior is not fully supported with dynamic size.\"\n );\n }\n this._scrollToOffset(this.getScrollOffset() + delta, {\n adjustments: void 0,\n behavior\n });\n };\n this.getTotalSize = () => {\n var _a;\n const measurements = this.getMeasurements();\n let end;\n if (measurements.length === 0) {\n end = this.options.paddingStart;\n } else if (this.options.lanes === 1) {\n end = ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0;\n } else {\n const endByLane = Array(this.options.lanes).fill(null);\n let endIndex = measurements.length - 1;\n while (endIndex >= 0 && endByLane.some((val) => val === null)) {\n const item = measurements[endIndex];\n if (endByLane[item.lane] === null) {\n endByLane[item.lane] = item.end;\n }\n endIndex--;\n }\n end = Math.max(...endByLane.filter((val) => val !== null));\n }\n return Math.max(\n end - this.options.scrollMargin + this.options.paddingEnd,\n 0\n );\n };\n this._scrollToOffset = (offset, {\n adjustments,\n behavior\n }) => {\n this.options.scrollToFn(offset, { behavior, adjustments }, this);\n };\n this.measure = () => {\n this.itemSizeCache = /* @__PURE__ */ new Map();\n this.laneAssignments = /* @__PURE__ */ new Map();\n this.notify(false);\n };\n this.setOptions(opts);\n }\n}\nconst findNearestBinarySearch = (low, high, getCurrentValue, value) => {\n while (low <= high) {\n const middle = (low + high) / 2 | 0;\n const currentValue = getCurrentValue(middle);\n if (currentValue < value) {\n low = middle + 1;\n } else if (currentValue > value) {\n high = middle - 1;\n } else {\n return middle;\n }\n }\n if (low > 0) {\n return low - 1;\n } else {\n return 0;\n }\n};\nfunction calculateRange({\n measurements,\n outerSize,\n scrollOffset,\n lanes\n}) {\n const lastIndex = measurements.length - 1;\n const getOffset = (index) => measurements[index].start;\n if (measurements.length <= lanes) {\n return {\n startIndex: 0,\n endIndex: lastIndex\n };\n }\n let startIndex = findNearestBinarySearch(\n 0,\n lastIndex,\n getOffset,\n scrollOffset\n );\n let endIndex = startIndex;\n if (lanes === 1) {\n while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {\n endIndex++;\n }\n } else if (lanes > 1) {\n const endPerLane = Array(lanes).fill(0);\n while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {\n const item = measurements[endIndex];\n endPerLane[item.lane] = item.end;\n endIndex++;\n }\n const startPerLane = Array(lanes).fill(scrollOffset + outerSize);\n while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) {\n const item = measurements[startIndex];\n startPerLane[item.lane] = item.start;\n startIndex--;\n }\n startIndex = Math.max(0, startIndex - startIndex % lanes);\n endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));\n }\n return { startIndex, endIndex };\n}\nexport {\n Virtualizer,\n approxEqual,\n debounce,\n defaultKeyExtractor,\n defaultRangeExtractor,\n elementScroll,\n measureElement,\n memo,\n notUndefined,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll\n};\n//# sourceMappingURL=index.js.map\n","import * as React from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { Virtualizer, elementScroll, observeElementOffset, observeElementRect, windowScroll, observeWindowOffset, observeWindowRect } from \"@tanstack/virtual-core\";\nexport * from \"@tanstack/virtual-core\";\nconst useIsomorphicLayoutEffect = typeof document !== \"undefined\" ? React.useLayoutEffect : React.useEffect;\nfunction useVirtualizerBase({\n useFlushSync = true,\n ...options\n}) {\n const rerender = React.useReducer(() => ({}), {})[1];\n const resolvedOptions = {\n ...options,\n onChange: (instance2, sync) => {\n var _a;\n if (useFlushSync && sync) {\n flushSync(rerender);\n } else {\n rerender();\n }\n (_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync);\n }\n };\n const [instance] = React.useState(\n () => new Virtualizer(resolvedOptions)\n );\n instance.setOptions(resolvedOptions);\n useIsomorphicLayoutEffect(() => {\n return instance._didMount();\n }, []);\n useIsomorphicLayoutEffect(() => {\n return instance._willUpdate();\n });\n return instance;\n}\nfunction useVirtualizer(options) {\n return useVirtualizerBase({\n observeElementRect,\n observeElementOffset,\n scrollToFn: elementScroll,\n ...options\n });\n}\nfunction useWindowVirtualizer(options) {\n return useVirtualizerBase({\n getScrollElement: () => typeof document !== \"undefined\" ? window : null,\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () => typeof document !== \"undefined\" ? window.scrollY : 0,\n ...options\n });\n}\nexport {\n useVirtualizer,\n useWindowVirtualizer\n};\n//# sourceMappingURL=index.js.map\n","import { useVirtualizer, type VirtualItem } from '@tanstack/react-virtual'\nimport { type RefObject, useCallback } from 'react'\n\n/** Default height for each option item in pixels */\nconst DEFAULT_OPTION_HEIGHT_PX = 36\n\n/** Number of extra items to render above/below viewport for smooth scrolling */\nconst DEFAULT_OVERSCAN = 5\n\nexport interface UseVirtualListOptions {\n /** Total number of items in the list */\n count: number\n /** Reference to the scrollable container element */\n parentRef: RefObject<HTMLElement | null>\n /** Height of each item in pixels (default: 36) */\n estimateSize?: number\n /** Number of extra items to render above/below viewport (default: 5) */\n overscan?: number\n /** Enable/disable virtualization (default: true) */\n enabled?: boolean\n}\n\nexport interface UseVirtualListResult {\n /** Array of virtual items currently visible (plus overscan) */\n virtualItems: VirtualItem[]\n /** Total height of all items for scrollbar sizing */\n totalSize: number\n /** Scroll to a specific item index */\n scrollToIndex: (index: number, options?: { align?: 'start' | 'center' | 'end' | 'auto' }) => void\n /** Measure element at index (for dynamic heights if needed) */\n measureElement: (element: HTMLElement | null) => void\n}\n\n/**\n * Hook for virtualizing a list of items, rendering only visible items in the DOM.\n * Wraps @tanstack/react-virtual with project-specific defaults.\n *\n * @example\n * ```tsx\n * const { virtualItems, totalSize } = useVirtualList({\n * count: records.length,\n * parentRef: scrollContainerRef,\n * })\n * ```\n */\nexport function useVirtualList({\n count,\n parentRef,\n estimateSize = DEFAULT_OPTION_HEIGHT_PX,\n overscan = DEFAULT_OVERSCAN,\n enabled = true,\n}: UseVirtualListOptions): UseVirtualListResult {\n const virtualizer = useVirtualizer({\n count: enabled ? count : 0,\n getScrollElement: () => parentRef.current,\n estimateSize: useCallback(() => estimateSize, [estimateSize]),\n overscan,\n })\n\n return {\n virtualItems: virtualizer.getVirtualItems(),\n totalSize: virtualizer.getTotalSize(),\n scrollToIndex: virtualizer.scrollToIndex,\n measureElement: virtualizer.measureElement,\n }\n}\n","import { forwardRef, useCallback } from 'react'\nimport { Search, X } from 'lucide-react'\nimport { cn } from '../utils/cn'\n\ninterface SearchInputProps {\n value: string\n onChange: (value: string) => void\n placeholder?: string\n className?: string\n listboxId?: string\n activeDescendantId?: string\n}\n\nexport const SearchInput = forwardRef<HTMLInputElement, SearchInputProps>(function SearchInput(\n { value, onChange, placeholder = 'Search...', className, listboxId, activeDescendantId },\n ref\n) {\n const handleClear = useCallback(() => {\n onChange('')\n }, [onChange])\n\n return (\n <div className={cn('lookup-field__search-container', className)}>\n <Search className=\"lookup-field__search-icon\" />\n <input\n ref={ref}\n type=\"text\"\n className=\"lookup-field__search\"\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={placeholder}\n aria-label={placeholder}\n aria-autocomplete=\"list\"\n aria-controls={listboxId}\n aria-activedescendant={activeDescendantId}\n />\n {value && (\n <button\n type=\"button\"\n className=\"lookup-field__search-clear\"\n onClick={handleClear}\n aria-label=\"Clear search\"\n tabIndex={-1}\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n )\n})\n","interface LiveRegionProps {\n message: string\n}\n\nexport function LiveRegion({ message }: LiveRegionProps) {\n return (\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" className=\"lookup-field__live-region\">\n {message}\n </div>\n )\n}\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { ChevronDown, Loader2, X } from 'lucide-react'\nimport { cn, interpolateTemplate, normalizeFilters } from './utils'\nimport type { FilterExpression } from './types/filter.types'\nimport {\n useClickOutside,\n useDebouncedSearch,\n useFloatingDropdown,\n useKeyboardNavigation,\n useTranslationSafe,\n useVirtualList,\n} from './hooks'\nimport { SearchInput } from './parts/SearchInput'\nimport { LiveRegion } from './parts/LiveRegion'\nimport type { LookupFieldProps, LookupFieldRef, LookupRecord } from './LookupField.types'\nimport './LookupField.css'\n\nconst DEFAULT_PAGE_SIZE = 10\nconst SCROLL_THRESHOLD_PX = 50\nconst DEFAULT_MIN_CHARS = 1\n\nfunction LookupFieldInner<TRecord extends LookupRecord = LookupRecord>(\n {\n entity,\n label,\n displayFields,\n value,\n onChange,\n fetcher,\n clearable = true,\n placeholder,\n className,\n pageSize = DEFAULT_PAGE_SIZE,\n onError,\n searchFields,\n minChars = DEFAULT_MIN_CHARS,\n displayValue,\n displayTemplate,\n renderSelected,\n filters,\n getFilters,\n dependencies,\n orderBy,\n bindFields,\n readOnly = false,\n disabled = false,\n error = false,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n onReady,\n onInvalidValue,\n noResultsText,\n searchPlaceholder,\n required = false,\n showRequiredIndicator,\n validateOnBlur = true,\n onValidationChange,\n }: LookupFieldProps<TRecord>,\n ref: React.Ref<LookupFieldRef<TRecord>>\n) {\n const { t } = useTranslationSafe()\n\n // Compute effective orderBy with default (AC: 2)\n const effectiveOrderBy = useMemo(\n () =>\n orderBy ?? {\n field: displayFields[0] as string,\n direction: 'asc' as const,\n },\n [orderBy, displayFields]\n )\n\n const id = useId()\n const [isOpen, setIsOpen] = useState(false)\n const [isLoading, setIsLoading] = useState(false)\n const [apiError, setApiError] = useState<Error | null>(null)\n const [records, setRecords] = useState<TRecord[]>([])\n const [selectedRecord, setSelectedRecord] = useState<TRecord | null>(null)\n const [currentPage, setCurrentPage] = useState(1)\n const [hasMorePages, setHasMorePages] = useState(true)\n const [isLoadingMore, setIsLoadingMore] = useState(false)\n const abortControllerRef = useRef<AbortController | null>(null)\n const previousRecordRef = useRef<TRecord | null>(null)\n const previousDependenciesRef = useRef(JSON.stringify(dependencies ?? []))\n const optionsRef = useRef<HTMLDivElement>(null)\n const searchInputRef = useRef<HTMLInputElement>(null)\n const triggerRef = useRef<HTMLButtonElement | null>(null)\n const [searchQuery, setSearchQuery] = useState('')\n const debouncedSearchQuery = useDebouncedSearch(searchQuery)\n const [announcement, setAnnouncement] = useState('')\n\n // Refs for onReady callback (Task 6) [UPDATED v0.4 - removed totalRecordsRef]\n const hasCalledOnReadyRef = useRef(false)\n\n // Ref to track selectedRecord for imperative methods (always up-to-date)\n const selectedRecordRef = useRef<TRecord | null>(null)\n // Keep ref in sync with state\n selectedRecordRef.current = selectedRecord\n\n // Refs for focus tracking (Tasks 4, 5)\n const componentRef = useRef<HTMLDivElement>(null)\n const isFocusWithinRef = useRef(false)\n const onInvalidValueRef = useRef(onInvalidValue)\n\n // Keep onInvalidValue ref in sync\n useEffect(() => {\n onInvalidValueRef.current = onInvalidValue\n }, [onInvalidValue])\n\n // Click outside detection - close dropdown when clicking outside (AC: 4, Story 2.11)\n // Note: mousedown fires BEFORE focus changes, so we need to manually trigger onBlur\n // if focus was within the component when clicking outside\n const handleClickOutside = useCallback(() => {\n if (isOpen) {\n // Trigger onBlur if focus was within (mousedown preempts natural blur)\n if (isFocusWithinRef.current) {\n isFocusWithinRef.current = false\n onBlurProp?.(selectedRecordRef.current)\n }\n setIsOpen(false)\n setSearchQuery('')\n }\n }, [isOpen, onBlurProp])\n\n useClickOutside(componentRef, handleClickOutside, isOpen)\n\n // Floating UI positioning (AC: 8, Story 2.11)\n const { refs: floatingRefs, floatingStyles } = useFloatingDropdown({\n enabled: isOpen,\n })\n\n // Virtualization for large lists (Story 2.13, AC: 1, 8)\n const { virtualItems, totalSize } = useVirtualList({\n count: records.length,\n parentRef: optionsRef,\n enabled: isOpen && records.length > 0,\n })\n\n // State for invalid value detection (Task 7)\n const [isInvalidValue, setIsInvalidValue] = useState(false)\n\n // State for required field validation (Story 2.12)\n const [validationError, setValidationError] = useState(false)\n\n // Navigation context cache state (Story 2.13, AC: 2, 7)\n const [cachedRecords, setCachedRecords] = useState<TRecord[]>([])\n const [cachedScrollPosition, setCachedScrollPosition] = useState<number>(0)\n const [cachedCurrentPage, setCachedCurrentPage] = useState<number>(1)\n const [cacheValid, setCacheValid] = useState<boolean>(false)\n const cachedSearchQueryRef = useRef<string>('')\n // Ref to prevent fetchMoreRecords during cache restoration (fixes duplicate records bug)\n const isRestoringCacheRef = useRef<boolean>(false)\n // Ref to track current page immediately (state updates are async)\n const currentPageRef = useRef<number>(1)\n\n // Compute combined error state: external error OR internal validation error\n const showError = error || validationError\n\n // Compute effective showRequiredIndicator (defaults to required prop value)\n const effectiveShowRequiredIndicator = showRequiredIndicator ?? required\n\n // Ref for onValidationChange to avoid stale closures\n const onValidationChangeRef = useRef(onValidationChange)\n useEffect(() => {\n onValidationChangeRef.current = onValidationChange\n }, [onValidationChange])\n\n // Compute effective filters (getFilters takes precedence over static filters)\n const getEffectiveFilters = useCallback((): FilterExpression | undefined => {\n if (getFilters) {\n return normalizeFilters(getFilters())\n }\n return normalizeFilters(filters)\n }, [filters, getFilters])\n\n const fetchRecords = useCallback(\n async (search: string = '') => {\n // Cancel any pending request\n if (abortControllerRef.current) {\n abortControllerRef.current.abort()\n }\n\n const controller = new AbortController()\n abortControllerRef.current = controller\n\n try {\n setIsLoading(true)\n setApiError(null)\n setAnnouncement(t('announcements.loading'))\n\n const effectiveFilters = getEffectiveFilters()\n\n // Combine fields with deduplication: Id + displayFields + bindFields (PascalCase standard)\n const allFields = [...new Set(['Id', ...displayFields, ...(bindFields ?? [])])]\n\n const response = await fetcher<TRecord>(entity, {\n fields: allFields,\n search: search.length >= minChars ? search : '',\n searchFields: searchFields ?? displayFields,\n page: 1,\n pageSize,\n filters: effectiveFilters,\n orderBy: effectiveOrderBy,\n })\n\n // Check if request was aborted\n if (controller.signal.aborted) return\n\n setRecords(response.data)\n\n // Call onReady after first successful data load (AC: 4 - fires only once) [UPDATED v0.4 - removed totalRecords]\n if (!hasCalledOnReadyRef.current && onReady) {\n hasCalledOnReadyRef.current = true\n // Delay slightly to ensure imperativeRef is up to date\n setTimeout(() => {\n onReady({ firstPageLoaded: true }, imperativeRef)\n }, 0)\n }\n\n // Announce results loaded or no results (AC: 7)\n if (response.data.length === 0) {\n setAnnouncement(t('announcements.noResults'))\n } else {\n setAnnouncement(t('announcements.opened', { count: response.data.length }))\n }\n\n // Detect end of data on initial load (AC: 5)\n if (response.data.length < pageSize) {\n setHasMorePages(false)\n }\n } catch (err) {\n // Don't set error state for aborted requests\n if (err instanceof Error && err.name === 'AbortError') return\n\n const fetchError = err instanceof Error ? err : new Error('Unknown error')\n setApiError(fetchError)\n onError?.(fetchError)\n } finally {\n if (!controller.signal.aborted) {\n setIsLoading(false)\n }\n }\n },\n // Note: imperativeRef is accessed via closure, not dependency, to avoid circular dep\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n entity,\n displayFields,\n bindFields,\n searchFields,\n pageSize,\n minChars,\n onError,\n onReady,\n getEffectiveFilters,\n effectiveOrderBy,\n fetcher,\n ]\n )\n\n const fetchMoreRecords = useCallback(\n async (search: string = '') => {\n // Skip if currently restoring cache (prevents duplicate records bug)\n if (isRestoringCacheRef.current) return\n if (isLoadingMore || !hasMorePages) return\n // Use ref instead of state to get current page (state updates are async)\n const actualCurrentPage = currentPageRef.current\n\n try {\n setIsLoadingMore(true)\n setAnnouncement(t('announcements.loadingMore'))\n\n const effectiveFilters = getEffectiveFilters()\n const nextPage = actualCurrentPage + 1\n\n // Combine fields with deduplication: Id + displayFields + bindFields (PascalCase standard)\n const allFields = [...new Set(['Id', ...displayFields, ...(bindFields ?? [])])]\n\n const response = await fetcher<TRecord>(entity, {\n fields: allFields,\n search: search.length >= minChars ? search : '',\n searchFields: searchFields ?? displayFields,\n page: nextPage,\n pageSize,\n filters: effectiveFilters,\n orderBy: effectiveOrderBy,\n })\n\n // Append new records to existing list (AC: 4)\n setRecords((prev) => [...prev, ...response.data])\n currentPageRef.current = nextPage\n setCurrentPage(nextPage)\n\n // Announce loaded count\n setAnnouncement(t('announcements.resultsLoaded', { count: response.data.length }))\n\n // Detect end of data (AC: 5)\n if (response.data.length < pageSize) {\n setHasMorePages(false)\n }\n } catch (err) {\n if (err instanceof Error && err.name === 'AbortError') return\n const error = err instanceof Error ? err : new Error('Unknown error')\n onError?.(error)\n } finally {\n setIsLoadingMore(false)\n }\n },\n [\n entity,\n displayFields,\n bindFields,\n searchFields,\n pageSize,\n minChars,\n // Note: currentPage removed - using currentPageRef instead for immediate updates\n isLoadingMore,\n hasMorePages,\n onError,\n getEffectiveFilters,\n effectiveOrderBy,\n fetcher,\n t,\n ]\n )\n\n // Helper to fetch a single record by ID (for setValue and invalid value detection)\n const fetchAndSetRecordById = useCallback(\n async (recordId: string): Promise<TRecord | null> => {\n try {\n const allFields = [...new Set(['Id', ...displayFields, ...(bindFields ?? [])])]\n console.log('[LookupField] fetchAndSetRecordById:', { recordId, entity, allFields })\n const response = await fetcher<TRecord>(entity, {\n fields: allFields,\n filters: [[{ Id: recordId }]],\n page: 1,\n pageSize: 1,\n })\n console.log('[LookupField] fetchAndSetRecordById response:', response)\n return response.data[0] ?? null\n } catch (err) {\n console.error('[LookupField] fetchAndSetRecordById error:', err)\n return null\n }\n },\n [entity, displayFields, bindFields, fetcher]\n )\n\n // Validation function for required field (Story 2.12, AC: 4, 6, 10; Story 2.14, AC: 1)\n // Used by both blur validation and imperative validate() method\n const performValidation = useCallback((): boolean => {\n // Skip validation for disabled or readOnly - can't interact, so always valid\n if (disabled || readOnly) {\n setValidationError(false)\n onValidationChangeRef.current?.(true)\n return true\n }\n\n // Check if required and no selection\n if (required && !selectedRecordRef.current) {\n setValidationError(true)\n onValidationChangeRef.current?.(false)\n return false\n }\n\n // Valid - clear any existing validation error\n setValidationError(false)\n onValidationChangeRef.current?.(true)\n return true\n }, [required, readOnly, disabled])\n\n const handleScroll = useCallback(() => {\n const container = optionsRef.current\n if (!container) return\n\n // Skip if already loading or no more pages\n if (isLoadingMore || !hasMorePages) return\n\n const { scrollTop, scrollHeight, clientHeight } = container\n const isNearBottom = scrollHeight - scrollTop - clientHeight < SCROLL_THRESHOLD_PX\n\n if (isNearBottom) {\n fetchMoreRecords(debouncedSearchQuery)\n }\n }, [isLoadingMore, hasMorePages, fetchMoreRecords, debouncedSearchQuery])\n\n // Auto-focus search input when dropdown opens\n useEffect(() => {\n if (isOpen && searchInputRef.current) {\n searchInputRef.current.focus()\n }\n }, [isOpen])\n\n // Fetch when debounced search changes or dropdown opens (Story 2.13: cache restore)\n useEffect(() => {\n if (isOpen) {\n // Only fetch if search is empty or has >= minChars\n if (debouncedSearchQuery.length === 0 || debouncedSearchQuery.length >= minChars) {\n // Check if we can restore from cache (Story 2.13, AC: 3, 10)\n const canRestoreFromCache =\n cacheValid &&\n cachedSearchQueryRef.current === debouncedSearchQuery &&\n cachedRecords.length > 0\n\n if (canRestoreFromCache) {\n // Restore from cache instead of fetching\n // Set flag to prevent fetchMoreRecords from being called during scroll restoration\n isRestoringCacheRef.current = true\n setRecords(cachedRecords)\n currentPageRef.current = cachedCurrentPage\n setCurrentPage(cachedCurrentPage)\n setHasMorePages(true) // Assume there might be more pages\n // Restore scroll position after render, then clear the restoring flag\n requestAnimationFrame(() => {\n if (optionsRef.current) {\n optionsRef.current.scrollTop = cachedScrollPosition\n }\n // Clear flag after scroll position is restored (use setTimeout to ensure scroll event has been processed)\n setTimeout(() => {\n isRestoringCacheRef.current = false\n }, 0)\n })\n } else {\n // Fresh fetch - reset pagination state\n currentPageRef.current = 1\n setCurrentPage(1)\n setHasMorePages(true)\n setRecords([])\n fetchRecords(debouncedSearchQuery)\n }\n }\n }\n }, [\n isOpen,\n debouncedSearchQuery,\n fetchRecords,\n minChars,\n cacheValid,\n cachedRecords,\n cachedCurrentPage,\n cachedScrollPosition,\n ])\n\n // Reset search and pagination when dropdown closes\n useEffect(() => {\n if (!isOpen) {\n setSearchQuery('')\n currentPageRef.current = 1\n setCurrentPage(1)\n setHasMorePages(true)\n setIsLoadingMore(false)\n }\n\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort()\n }\n }\n }, [isOpen])\n\n // Track previous value to detect value prop changes (initialized to undefined to detect initial value)\n const previousValueRef = useRef<string | null | undefined>(undefined)\n\n // Ref for fetchAndSetRecordById to avoid effect re-runs\n const fetchAndSetRecordByIdRef = useRef(fetchAndSetRecordById)\n fetchAndSetRecordByIdRef.current = fetchAndSetRecordById\n\n // Request ID to handle React 18 Strict Mode and race conditions\n const valueSyncRequestIdRef = useRef(0)\n\n // Sync external value prop with internal selectedRecord state (controlled mode)\n // Only depends on value - uses refs for callbacks to avoid re-runs\n useEffect(() => {\n // On first run, previousValueRef is undefined, so we should process the initial value\n const isInitialRun = previousValueRef.current === undefined\n const valueChanged = isInitialRun || previousValueRef.current !== value\n previousValueRef.current = value\n\n // Skip sync for uncontrolled mode (value is null)\n if (value === null) {\n setIsInvalidValue(false)\n return\n }\n\n // If value didn't change, skip\n if (!valueChanged) {\n return\n }\n\n // Increment request ID to invalidate any pending requests\n const currentRequestId = ++valueSyncRequestIdRef.current\n\n fetchAndSetRecordByIdRef.current(value).then((record) => {\n const isStale = valueSyncRequestIdRef.current !== currentRequestId\n if (isStale) return\n if (record) {\n setSelectedRecord(record)\n setIsInvalidValue(false)\n } else {\n // Record not found - invalid value\n setIsInvalidValue(true)\n setSelectedRecord(null)\n onInvalidValueRef.current?.(value)\n }\n })\n }, [value])\n\n // Dependencies-based reload (AC: 7, 8)\n const dependenciesKey = JSON.stringify(dependencies ?? [])\n useEffect(() => {\n if (previousDependenciesRef.current !== dependenciesKey) {\n previousDependenciesRef.current = dependenciesKey\n\n // Abort any pending requests to prevent race conditions\n if (abortControllerRef.current) {\n abortControllerRef.current.abort()\n }\n\n // Invalidate cache on dependencies change (Story 2.13, AC: 6)\n setCacheValid(false)\n\n // Reset state on dependency change\n setRecords([])\n setSelectedRecord(null)\n currentPageRef.current = 1\n setCurrentPage(1)\n setHasMorePages(true)\n setIsOpen(false)\n setSearchQuery('')\n // Note: Don't trigger fetch here - it will happen when dropdown opens\n }\n }, [dependenciesKey])\n\n // Invalidate cache on filters change (Story 2.13, AC: 4)\n const filtersKey = JSON.stringify(filters ?? [])\n const previousFiltersRef = useRef(filtersKey)\n useEffect(() => {\n if (previousFiltersRef.current !== filtersKey) {\n previousFiltersRef.current = filtersKey\n setCacheValid(false)\n }\n }, [filtersKey])\n\n /**\n * Gets display text for the selected value in the trigger.\n * Implements priority order: renderSelected > displayTemplate > displayValue > all displayFields concatenated\n */\n const getSelectedDisplay = useCallback(\n (record: TRecord): string => {\n // Priority 1: renderSelected function\n if (renderSelected) {\n return renderSelected(record)\n }\n\n // Priority 2: displayTemplate with interpolation\n if (displayTemplate) {\n return interpolateTemplate(displayTemplate, record)\n }\n\n // Priority 3: single displayValue field\n if (displayValue) {\n const value = record[displayValue]\n return value !== undefined && value !== null ? String(value) : ''\n }\n\n // Default: concatenate all displayFields separated by \" - \"\n return displayFields\n .map((field) => {\n const value = record[field]\n return value !== undefined && value !== null ? String(value) : ''\n })\n .join(' - ')\n },\n [renderSelected, displayTemplate, displayValue, displayFields]\n )\n\n const handleTriggerClick = () => {\n if (disabled) return // Check disabled FIRST (Story 2.14, AC: 8)\n if (readOnly) return\n setIsOpen((prev) => !prev)\n }\n\n /**\n * Gets display text for dropdown option items.\n * Always uses displayFields (separated by \" - \") regardless of display props.\n */\n const getOptionDisplay = (record: TRecord): string => {\n return displayFields.map((field) => String(record[field] ?? '')).join(' - ')\n }\n\n const handleSelectRecord = (record: TRecord) => {\n previousRecordRef.current = selectedRecord\n setSelectedRecord(record)\n selectedRecordRef.current = record // Update ref immediately for blur callbacks\n setIsInvalidValue(false) // Clear invalid state on valid selection\n\n // Clear validation error on selection (Story 2.12, AC: 9)\n if (validationError) {\n setValidationError(false)\n onValidationChangeRef.current?.(true)\n }\n\n // Save navigation context cache before closing (Story 2.13, AC: 2, 3)\n setCachedRecords(records)\n setCachedScrollPosition(optionsRef.current?.scrollTop ?? 0)\n setCachedCurrentPage(currentPage)\n cachedSearchQueryRef.current = searchQuery\n setCacheValid(true)\n\n onChange(record, previousRecordRef.current)\n setSearchQuery('')\n setIsOpen(false)\n setApiError(null)\n // Return focus to trigger after selection (fixes Tab behavior)\n // Set flag to prevent handleTriggerFocus from reopening dropdown\n justSelectedRef.current = true\n triggerRef.current?.focus()\n // Announce selection\n const displayText = getSelectedDisplay(record)\n setAnnouncement(t('announcements.selected', { value: displayText }))\n }\n\n const handleClear = (event: React.MouseEvent) => {\n event.stopPropagation()\n previousRecordRef.current = selectedRecord\n setSelectedRecord(null)\n selectedRecordRef.current = null // Update ref immediately\n setIsInvalidValue(false)\n onChange(null, previousRecordRef.current)\n setAnnouncement(t('announcements.cleared'))\n }\n\n // Keyboard-triggered clear (no event needed)\n const handleKeyboardClear = useCallback(() => {\n if (!selectedRecordRef.current && !isInvalidValue) return\n previousRecordRef.current = selectedRecordRef.current\n setSelectedRecord(null)\n selectedRecordRef.current = null // Update ref immediately\n setIsInvalidValue(false)\n onChange(null, previousRecordRef.current)\n setAnnouncement(t('announcements.cleared'))\n }, [isInvalidValue, onChange, t])\n\n // Close handler for keyboard navigation (Tab)\n // Finds the next tabbable element outside the component and focuses it\n const handleClose = useCallback(() => {\n // Set flag to prevent trigger from reopening dropdown when it receives focus during Tab navigation\n isTabNavigatingRef.current = true\n\n // Close the dropdown\n setIsOpen(false)\n setSearchQuery('')\n setAnnouncement(t('announcements.closed'))\n\n // Find and focus the next tabbable element after the component\n // This ensures Tab navigation works correctly even when the dropdown is unmounted\n // Use setTimeout to ensure this runs after React's state update and re-render\n setTimeout(() => {\n if (!componentRef.current) return\n\n // Get all tabbable elements in the document (in DOM order)\n const tabbableSelector =\n 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n const allTabbable = Array.from(document.querySelectorAll<HTMLElement>(tabbableSelector))\n\n // Find the index of our component's trigger button in the tab order\n const componentIndex = allTabbable.findIndex((el) => componentRef.current?.contains(el))\n\n // Find the first tabbable element AFTER the component (not inside it)\n let nextElement: HTMLElement | null = null\n for (let i = componentIndex + 1; i < allTabbable.length; i++) {\n if (!componentRef.current?.contains(allTabbable[i])) {\n nextElement = allTabbable[i]\n break\n }\n }\n\n if (nextElement) {\n nextElement.focus()\n }\n }, 0)\n }, [t])\n\n // Escape handler - close AND return focus to trigger\n const handleEscapeClose = useCallback(() => {\n setIsOpen(false)\n setSearchQuery('')\n setAnnouncement(t('announcements.closed'))\n triggerRef.current?.focus()\n }, [t])\n\n // Imperative clear (no event needed, for ref.clear())\n const handleImperativeClear = useCallback(() => {\n previousRecordRef.current = selectedRecordRef.current\n setSelectedRecord(null)\n setIsInvalidValue(false)\n onChange(null, previousRecordRef.current)\n setAnnouncement(t('announcements.cleared'))\n }, [onChange, t])\n\n // Create imperative ref object (uses refs to always get latest values)\n const imperativeRef = useMemo<LookupFieldRef<TRecord>>(\n () => ({\n clear: handleImperativeClear,\n focus: () => triggerRef.current?.focus(),\n reload: () => fetchRecords(debouncedSearchQuery),\n getValue: () => selectedRecordRef.current,\n setValue: async (recordId: string) => {\n const record = await fetchAndSetRecordById(recordId)\n if (record) {\n previousRecordRef.current = selectedRecordRef.current\n setSelectedRecord(record)\n setIsInvalidValue(false)\n onChange(record, previousRecordRef.current)\n } else {\n // Record not found - set invalid state and notify\n setIsInvalidValue(true)\n setSelectedRecord(null)\n onInvalidValue?.(recordId)\n }\n },\n open: () => setIsOpen(true),\n close: () => setIsOpen(false),\n validate: performValidation,\n }),\n [\n handleImperativeClear,\n fetchRecords,\n debouncedSearchQuery,\n fetchAndSetRecordById,\n onChange,\n onInvalidValue,\n performValidation,\n ]\n )\n\n // Expose ref to parent\n useImperativeHandle(ref, () => imperativeRef, [imperativeRef])\n\n // Keyboard navigation hook\n const { highlightedIndex, setHighlightedIndex, handleKeyDown } = useKeyboardNavigation({\n records,\n isOpen,\n onSelect: handleSelectRecord,\n onClose: handleClose,\n onEscape: handleEscapeClose,\n onClear: handleKeyboardClear,\n searchQuery,\n })\n\n // Reset highlightedIndex when dropdown opens or records change\n useEffect(() => {\n if (isOpen) {\n setHighlightedIndex(-1)\n }\n }, [isOpen, records, setHighlightedIndex])\n\n // Scroll highlighted option into view\n useEffect(() => {\n if (highlightedIndex >= 0 && optionsRef.current) {\n const highlightedOption = optionsRef.current.querySelector(\n `[data-index=\"${highlightedIndex}\"]`\n ) as HTMLElement\n if (highlightedOption?.scrollIntoView) {\n highlightedOption.scrollIntoView({ block: 'nearest', behavior: 'smooth' })\n }\n }\n }, [highlightedIndex])\n\n // Track if focus came from mouse click (to distinguish Tab vs Click)\n const wasClickedRef = useRef(false)\n // Track if focus is from programmatic selection (to prevent dropdown reopening)\n const justSelectedRef = useRef(false)\n // Track if Tab navigation is in progress (to prevent dropdown reopening)\n const isTabNavigatingRef = useRef(false)\n\n const handleTriggerMouseDown = () => {\n wasClickedRef.current = true\n }\n\n // Handle keydown on trigger (when dropdown is closed)\n const handleTriggerKeyDown = (event: React.KeyboardEvent) => {\n // Block keyboard when disabled (Story 2.14, AC: 6)\n if (disabled) return\n // Only handle when dropdown is closed\n if (isOpen) return\n\n // Backspace clears selection when clearable is enabled, not readOnly, and there's a value\n if (event.key === 'Backspace' && clearable && !readOnly && (selectedRecord || isInvalidValue)) {\n event.preventDefault()\n handleKeyboardClear()\n }\n }\n\n // Handle focus on trigger to open dropdown (Tab key behavior - AC1)\n const handleTriggerFocus = () => {\n if (disabled) return // Block focus handling when disabled (Story 2.14)\n if (readOnly) return\n // Skip opening if focus came from programmatic selection\n if (justSelectedRef.current) {\n justSelectedRef.current = false\n return\n }\n // Skip opening if Tab navigation is closing the dropdown\n if (isTabNavigatingRef.current) {\n isTabNavigatingRef.current = false\n return\n }\n // Only open on keyboard focus (Tab), not on click-focus\n if (wasClickedRef.current) {\n wasClickedRef.current = false\n return\n }\n if (!isOpen) {\n setIsOpen(true)\n }\n }\n\n // Handle component-level focus (fires once when focus enters component)\n const handleComponentFocus = useCallback(() => {\n // Skip focus callbacks when disabled (Story 2.14, AC: 1)\n if (disabled) return\n // Only fire onFocus if focus is entering the component (not moving within)\n if (!isFocusWithinRef.current) {\n isFocusWithinRef.current = true\n // Use ref to get latest selectedRecord (avoids stale closure)\n onFocusProp?.(selectedRecordRef.current)\n }\n }, [onFocusProp, disabled])\n\n // Handle component-level blur (fires once when focus leaves component entirely)\n const handleComponentBlur = useCallback(\n (event: React.FocusEvent) => {\n // Skip blur callbacks when disabled (Story 2.14, AC: 1)\n if (disabled) return\n\n // Check if focus is moving outside the component\n const relatedTarget = event.relatedTarget as Node | null\n const isLeavingComponent = !componentRef.current?.contains(relatedTarget)\n\n if (isLeavingComponent) {\n isFocusWithinRef.current = false\n\n // Perform validation on blur if enabled (Story 2.12, AC: 3, 4, 10)\n if (validateOnBlur && !readOnly) {\n performValidation()\n }\n\n // Use ref to get latest selectedRecord (avoids stale closure)\n onBlurProp?.(selectedRecordRef.current)\n }\n },\n [onBlurProp, validateOnBlur, readOnly, disabled, performValidation]\n )\n\n const renderDropdownContent = () => {\n // Show min chars message when user has typed but fewer than minChars\n if (searchQuery.length > 0 && searchQuery.length < minChars) {\n return <div className=\"lookup-field__empty\">{t('minChars', { count: minChars })}</div>\n }\n\n if (isLoading) {\n return (\n <div className=\"lookup-field__loading\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n <span>{t('loading')}</span>\n </div>\n )\n }\n\n if (apiError) {\n return <div className=\"lookup-field__error\">{t('error')}</div>\n }\n\n if (records.length === 0) {\n return <div className=\"lookup-field__empty\">{noResultsText ?? t('noResults')}</div>\n }\n\n // Fallback to non-virtualized rendering when virtualizer can't calculate items\n // (happens in test environments where container has no dimensions)\n const useVirtualizedRendering = virtualItems.length > 0\n\n return (\n <div ref={optionsRef} className=\"lookup-field__options\" onScroll={handleScroll}>\n {useVirtualizedRendering ? (\n // Virtualized list container (Story 2.13, AC: 1, 8)\n <div\n style={{\n height: `${totalSize}px`,\n width: '100%',\n position: 'relative',\n }}\n >\n {virtualItems.map((virtualItem) => {\n const record = records[virtualItem.index]\n const index = virtualItem.index\n return (\n <div\n key={record.Id}\n id={`${id}-option-${record.Id}`}\n data-index={index}\n className={cn(\n 'lookup-field__option',\n index === highlightedIndex && 'lookup-field__option--highlighted'\n )}\n role=\"option\"\n aria-selected={selectedRecord?.Id === record.Id}\n onClick={() => handleSelectRecord(record)}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: `${virtualItem.size}px`,\n transform: `translateY(${virtualItem.start}px)`,\n }}\n >\n {getOptionDisplay(record)}\n </div>\n )\n })}\n </div>\n ) : (\n // Non-virtualized fallback for test environments\n records.map((record, index) => (\n <div\n key={record.Id}\n id={`${id}-option-${record.Id}`}\n data-index={index}\n className={cn(\n 'lookup-field__option',\n index === highlightedIndex && 'lookup-field__option--highlighted'\n )}\n role=\"option\"\n aria-selected={selectedRecord?.Id === record.Id}\n onClick={() => handleSelectRecord(record)}\n >\n {getOptionDisplay(record)}\n </div>\n ))\n )}\n {/* Loading more spinner at bottom (AC: 3) */}\n {isLoadingMore && (\n <div className=\"lookup-field__loading-more\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n {/* No end indicator per FR30 (AC: 6) */}\n </div>\n )\n }\n\n return (\n <div\n ref={componentRef}\n className={cn(\n 'lookup-field',\n disabled && 'lookup-field--disabled',\n readOnly && 'lookup-field--readonly',\n showError && 'lookup-field--error',\n className\n )}\n role=\"combobox\"\n aria-expanded={!disabled && isOpen}\n aria-haspopup=\"listbox\"\n aria-labelledby={`${id}-label`}\n aria-controls={isOpen ? `${id}-listbox` : undefined}\n aria-disabled={disabled || undefined}\n aria-readonly={(!disabled && readOnly) || undefined}\n aria-invalid={showError || undefined}\n aria-required={required || undefined}\n onKeyDown={disabled ? undefined : handleKeyDown}\n onFocus={handleComponentFocus}\n onBlur={handleComponentBlur}\n >\n <LiveRegion message={announcement} />\n <label id={`${id}-label`} htmlFor={id} className=\"lookup-field__label\">\n {label}\n {effectiveShowRequiredIndicator && (\n <span className=\"lookup-field__required-indicator\">\n {t('validation.requiredIndicator')}\n </span>\n )}\n </label>\n <button\n ref={(node) => {\n // Combine refs: triggerRef for internal use, floatingRefs.setReference for positioning\n triggerRef.current = node\n floatingRefs.setReference(node)\n }}\n id={id}\n type=\"button\"\n className=\"lookup-field__trigger\"\n onClick={handleTriggerClick}\n onMouseDown={handleTriggerMouseDown}\n onKeyDown={handleTriggerKeyDown}\n onFocus={handleTriggerFocus}\n disabled={disabled}\n tabIndex={disabled ? -1 : 0}\n >\n <span className=\"lookup-field__selected-text\">\n {isInvalidValue\n ? t('notFound')\n : selectedRecord\n ? getSelectedDisplay(selectedRecord)\n : (placeholder ?? t('placeholder'))}\n </span>\n <ChevronDown\n className={cn('lookup-field__chevron', isOpen && 'lookup-field__chevron--open')}\n aria-hidden=\"true\"\n />\n {clearable && selectedRecord && !readOnly && !disabled && (\n <X className=\"lookup-field__clear\" onClick={handleClear} aria-label=\"Clear selection\" />\n )}\n </button>\n {isOpen && (\n <div\n ref={floatingRefs.setFloating}\n style={floatingStyles}\n className=\"lookup-field__dropdown\"\n >\n <SearchInput\n ref={searchInputRef}\n value={searchQuery}\n onChange={setSearchQuery}\n placeholder={searchPlaceholder ?? t('searchPlaceholder')}\n listboxId={`${id}-listbox`}\n activeDescendantId={\n highlightedIndex >= 0 && records[highlightedIndex]\n ? `${id}-option-${records[highlightedIndex].Id}`\n : undefined\n }\n />\n <div id={`${id}-listbox`} role=\"listbox\" aria-label={label}>\n {renderDropdownContent()}\n </div>\n </div>\n )}\n </div>\n )\n}\n\n// Export with forwardRef for generic component support\nexport const LookupField = forwardRef(LookupFieldInner) as <\n TRecord extends LookupRecord = LookupRecord,\n>(\n props: LookupFieldProps<TRecord> & { ref?: React.Ref<LookupFieldRef<TRecord>> }\n) => React.ReactElement\n\n// Set displayName for debugging\n;(LookupField as React.FC).displayName = 'LookupField'\n","import type { FilterExpression } from '../types/filter.types'\n\n/**\n * Custom fetcher function type for HTTP requests (FR29, FR31).\n * Receives the entity name and request, returns the search response.\n * Gives full control over URL construction, HTTP client, headers, etc.\n *\n * @example\n * // Using fetch with custom URL and auth\n * const fetcher: Fetcher = async (entity, request) => {\n * const response = await fetch(`/api/v2/${entity}/search`, {\n * method: 'POST',\n * headers: {\n * 'Content-Type': 'application/json',\n * 'Authorization': `Bearer ${getToken()}`,\n * },\n * body: JSON.stringify(request),\n * })\n * if (!response.ok) throw new Error(`API Error: ${response.status}`)\n * return response.json()\n * }\n *\n * @example\n * // Using axios\n * const fetcher: Fetcher = async (entity, request) => {\n * const { data } = await axios.post(`/api/${entity}/search`, request)\n * return data\n * }\n *\n * @example\n * // Using the createFetcher helper for simple cases\n * import { createFetcher } from 'siesa-ui-kit'\n * const fetcher = createFetcher('/api')\n */\nexport type Fetcher = <TRecord = Record<string, unknown>>(\n entity: string,\n request: SearchRequest\n) => Promise<SearchResponse<TRecord>>\n\n/** Sort configuration for API requests (FR17) */\nexport interface OrderBy {\n /** Field name to sort by */\n field: string\n /** Sort direction */\n direction: 'asc' | 'desc'\n}\n\n/** Request body for search API calls */\nexport interface SearchRequest {\n /** Fields to return in the response (always includes 'Id' - PascalCase standard) */\n fields: string[]\n /** Search text (empty for initial load) */\n search?: string\n /** Fields to search against (defaults to displayFields) */\n searchFields?: string[]\n /** Page number (1-indexed) */\n page: number\n /** Records per page */\n pageSize: number\n /** Filter conditions in expressive format */\n filters?: FilterExpression\n /** Sort order for results */\n orderBy?: OrderBy\n}\n\n/** Response body from search API calls [UPDATED v0.4 - removed total] */\nexport interface SearchResponse<TRecord> {\n /** Array of matching records */\n data: TRecord[]\n /** Current page number */\n page: number\n /** Page size used */\n pageSize: number\n}\n\n/** Error thrown when API request fails */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly statusText: string\n ) {\n super(message)\n this.name = 'ApiError'\n }\n}\n","import type { Fetcher, SearchRequest, SearchResponse } from './api.types'\nimport { ApiError } from './api.types'\n\nconst DEFAULT_HEADERS: Record<string, string> = {\n 'Content-Type': 'application/json',\n}\n\n/**\n * Creates a standard fetcher function for a given base URL.\n * Use this helper for simple cases where you just need to specify the API base URL.\n *\n * @param baseUrl - Base URL for the API (e.g., '/api', 'https://api.example.com')\n * @returns A fetcher function compatible with LookupField\n *\n * @example\n * // Simple usage\n * const fetcher = createFetcher('/api')\n * <LookupField entity=\"customers\" fetcher={fetcher} />\n *\n * @example\n * // With authentication - wrap createFetcher or create custom fetcher\n * const fetcher = createFetcher('/api', {\n * headers: { Authorization: `Bearer ${token}` }\n * })\n */\nexport function createFetcher(\n baseUrl: string,\n options?: { headers?: Record<string, string> }\n): Fetcher {\n const headers = { ...DEFAULT_HEADERS, ...options?.headers }\n\n return async <TRecord>(\n entity: string,\n request: SearchRequest\n ): Promise<SearchResponse<TRecord>> => {\n const url = `${baseUrl}/${entity}/search`\n\n // Ensure 'Id' is always included in fields (FR20) - PascalCase standard\n const fields = request.fields.includes('Id') ? request.fields : ['Id', ...request.fields]\n\n const response = await fetch(url, {\n method: 'POST',\n headers,\n body: JSON.stringify({ ...request, fields }),\n })\n\n if (!response.ok) {\n throw new ApiError(\n `API Error: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText\n )\n }\n\n return response.json()\n }\n}\n","import React, { useState } from 'react';\nimport { Navbar } from '../../components/Navbar';\nimport { NavigationRailGroup } from '../../components/NavigationRailGroup';\nimport type { LayoutBaseProps } from './LayoutBase.types';\n\n/**\n * LayoutBase - Layout base del sistema Siesa\n *\n * Layout reutilizable que implementa la estructura base con NavigationRail\n * lateral, Navbar superior y área de contenido dinámico. Diseñado para ser\n * usado como wrapper en diferentes vistas de la aplicación.\n *\n * **Composición:**\n * - Navbar: Barra superior con logo Siesa, título del producto y dropdown de usuario\n * - NavigationRailGroup: Rail de navegación lateral con iconos y búsqueda\n * - Área de contenido: Contenido dinámico pasado como children\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Responsive design mobile-first con breakpoints md:, lg:, xl:\n * - Composición con componentes del sistema (NO reimplementación)\n * - Type safety con TypeScript estricto\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see src/components/Navbar - Componente Navbar reutilizado\n * @see src/components/NavigationRailGroup - Componente NavigationRail reutilizado\n *\n * @example\n * ```tsx\n * // Uso básico\n * <LayoutBase\n * productName=\"Mi Aplicación\"\n * siesaLogoPath=\"/images/logos/Siesa_Logosimbolo_Blanco.svg\"\n * siesaLogoWidth=\"100px\"\n * siesaLogoHeight=\"40px\"\n * userDropdown={{\n * avatar: '/avatar.jpg',\n * name: 'Carlos',\n * email: 'carlos@siesa.com',\n * }}\n * navigationItems={navigationItems}\n * >\n * <div>Mi contenido personalizado</div>\n * </LayoutBase>\n *\n * // Uso avanzado con props pass-through\n * <LayoutBase\n * productName=\"Sistema Avanzado\"\n * navbarProps={{\n * showNavigationButton: true,\n * environmentBadge: \"Desarrollo\",\n * navigationButtonProps: { type: 'outline', size: 'l' },\n * notifications: { cart: 5, bell: true },\n * onCartClick: () => openCart(),\n * onNotificationsClick: () => openNotifications(),\n * }}\n * navigationRailProps={{\n * showSearchButton: true,\n * labels: { \n * searchPlaceholder: \"Buscar módulos...\",\n * collapseButton: \"Minimizar\"\n * },\n * onItemClick: (item) => handleNavigation(item),\n * onItemHover: (item) => showPreview(item),\n * }}\n * >\n * <div>Contenido con funcionalidad completa</div>\n * </LayoutBase>\n * ```\n */\nexport const LayoutBase: React.FC<LayoutBaseProps> = ({\n productName = 'Mi Aplicación',\n siesaLogoPath,\n siesaLogoWidth,\n siesaLogoHeight,\n userDropdown,\n navigationItems,\n children,\n className = '',\n contentClassName = '',\n navbarProps = {},\n navigationRailProps = {},\n}) => {\n // Estado local para el NavigationRail\n const [navState, setNavState] = useState<'collapsed' | 'expanded' | 'hover' | 'searcher'>('collapsed');\n\n // Handler para cambio de estado del NavigationRail\n const handleNavStateChange = (state: 'collapsed' | 'expanded' | 'hover' | 'searcher' | undefined) => {\n if (state) {\n setNavState(state);\n }\n };\n\n return (\n <div\n className={[\n // ===== BASE CONTAINER =====\n 'h-screen', // Altura fija de pantalla completa\n 'w-full',\n 'bg-white', // Fondo blanco para Navbar y NavigationRail\n 'dark:bg-dark-bg-primary',\n 'flex',\n 'flex-col',\n 'overflow-hidden', // Prevenir scroll en contenedor principal\n className,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {/* ===== NAVBAR ===== */}\n <Navbar\n productName={productName}\n userDropdown={userDropdown}\n hideActionButtons\n showSiesaLogoLeading\n showBusinessLogo={false}\n siesaLogo={\n siesaLogoPath ? (\n <img \n src={siesaLogoPath} \n alt=\"Siesa\" \n className=\"object-contain\"\n style={{\n width: siesaLogoWidth || '100%',\n height: siesaLogoHeight || '100%',\n }}\n />\n ) : undefined\n }\n className=\"bg-white dark:bg-dark-bg-primary\"\n {...navbarProps}\n />\n\n {/* ===== LAYOUT: NAVIGATION RAIL + CONTENT ===== */}\n <div className=\"flex flex-1 overflow-hidden\">\n {/* ===== NAVIGATION RAIL ===== */}\n <NavigationRailGroup\n state={navState}\n items={navigationItems}\n showSearchButton={false}\n onStateChange={handleNavStateChange}\n {...navigationRailProps}\n />\n\n {/* ===== CONTENT AREA ===== */}\n <div\n className={[\n 'flex-1',\n 'overflow-y-auto',\n 'bg-gray-50',\n 'dark:bg-dark-bg-primary',\n contentClassName,\n ]\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim()}\n >\n {children}\n </div>\n </div>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * Iconos para ListView del sistema de diseño Siesa\n * Basados en Heroicons Micro (16x16)\n */\n\nexport const HomeIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M8.543 2.232a.75.75 0 0 0-1.085 0l-5.25 5.5A.75.75 0 0 0 2.75 9H4v4a1 1 0 0 0 1 1h1.5a.5.5 0 0 0 .5-.5v-2a1 1 0 0 1 1-1h.5a1 1 0 0 1 1 1v2a.5.5 0 0 0 .5.5H12a1 1 0 0 0 1-1V9h1.25a.75.75 0 0 0 .543-1.268l-5.25-5.5Z\" />\n </svg>\n);\n\nexport const GlobeAltIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0ZM5.37 2.822a6.493 6.493 0 0 0-2.818 3.428h2.103c.088-.907.254-1.778.494-2.595a8.932 8.932 0 0 1 .221-.833ZM1.5 8c0 .522.062 1.03.179 1.516l.135.484h2.49a16.15 16.15 0 0 1 0-4H1.815L1.68 6.484A6.533 6.533 0 0 0 1.5 8Zm.552 2.75A6.493 6.493 0 0 0 5.37 14.18a8.932 8.932 0 0 1-.221-.833 13.2 13.2 0 0 1-.494-2.595H2.552Zm4.058 0c.083.78.23 1.497.429 2.128.197.622.423 1.07.649 1.357.225.286.401.265.312.265.089 0 .265.021.49-.265.226-.287.452-.735.649-1.357.199-.631.346-1.348.429-2.128H6.11Zm4.234 0a13.198 13.198 0 0 1-.494 2.595 8.938 8.938 0 0 1-.22.833 6.493 6.493 0 0 0 2.817-3.428h-2.103Zm2.104-2h-2.48a16.15 16.15 0 0 0 0-4h2.48l.135.484A6.538 6.538 0 0 1 14.5 8a6.538 6.538 0 0 1-.179 1.516l-.135.484h.162Zm-2.818-4.928c.167.251.394.699.221.833.24.817.406 1.688.494 2.595h2.103a6.493 6.493 0 0 0-2.818-3.428ZM9.89 6h-3.78c.083-.78.23-1.497.429-2.128.197-.622.423-1.07.649-1.357.225-.286.401-.265.312-.265.089 0 .265-.021.49.265.226.287.452.735.649 1.357.199.631.346 1.348.429 2.128Zm-4.234 0H3.553a6.493 6.493 0 0 1 2.818-3.428 8.932 8.932 0 0 0-.221.833c-.24.817-.406 1.688-.494 2.595Zm.144 2a14.65 14.65 0 0 0 0 4h4.4a14.65 14.65 0 0 0 0-4H5.8Z\" />\n </svg>\n);\n\nexport const DocumentTextIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V6.414A2 2 0 0 0 13.414 5L10 1.586A2 2 0 0 0 8.586 1H4Zm1 5a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5Zm-.5 2.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5Zm.5 1.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1H5Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const CloudIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M1 9.5A3.5 3.5 0 0 0 4.5 13H12a3 3 0 0 0 .917-5.857 2.503 2.503 0 0 0-3.198-3.019 3.5 3.5 0 0 0-6.628 2.171A3.5 3.5 0 0 0 1 9.5Z\" />\n </svg>\n);\n\nexport const SquaresPlusIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2 4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4ZM10 4a2 2 0 0 1 2-2h.5a.5.5 0 0 1 0 1H12a1 1 0 0 0-1 1v.5a.5.5 0 0 1-1 0V4ZM2 12a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v2ZM10.5 8a.5.5 0 0 0-.5.5V10H8.5a.5.5 0 0 0 0 1H10v1.5a.5.5 0 0 0 1 0V11h1.5a.5.5 0 0 0 0-1H11V8.5a.5.5 0 0 0-.5-.5Z\" />\n </svg>\n);\n\nexport const MagnifyingGlassIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const PlusIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z\" />\n </svg>\n);\n\nexport const ListBulletIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M2.5 4a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1ZM4.75 3.25a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5ZM4 8a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-8.5A.75.75 0 0 1 4 8Zm.75 3.25a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5ZM3 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-.5 4.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const FunnelIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M14 2H2c-.55 0-.95.538-.75 1.032l3 7.5c.127.318.44.528.783.528h5.934c.343 0 .656-.21.783-.528l3-7.5C14.95 2.538 14.55 2 14 2Z\" />\n <path d=\"M6 12.25v1.25a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-1.25H6Z\" />\n </svg>\n);\n\nexport const DocumentCheckIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V6.414A2 2 0 0 0 13.414 5L10 1.586A2 2 0 0 0 8.586 1H4Zm6.78 5.28a.75.75 0 1 0-1.06-1.06L7 8.94 5.78 7.72a.75.75 0 0 0-1.06 1.06l1.75 1.75a.75.75 0 0 0 1.06 0l3.25-3.25Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const DocumentMinusIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V6.414A2 2 0 0 0 13.414 5L10 1.586A2 2 0 0 0 8.586 1H4Zm1 6.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5H5Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const DocumentArrowUpIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V6.414A2 2 0 0 0 13.414 5L10 1.586A2 2 0 0 0 8.586 1H4Zm4.53 4.22a.75.75 0 0 0-1.06 0L5.22 8.47a.75.75 0 1 0 1.06 1.06l.97-.97v2.69a.75.75 0 0 0 1.5 0V8.56l.97.97a.75.75 0 1 0 1.06-1.06L8.53 6.22Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const BellIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12 5a4 4 0 0 0-8 0v2.379c0 .398-.158.779-.44 1.06L2.294 9.707a1 1 0 0 0 .707 1.707h9.998a1 1 0 0 0 .707-1.707l-1.266-1.268A1.5 1.5 0 0 1 12 7.379V5ZM6.268 13.682a.75.75 0 0 0 1.04.199 1.496 1.496 0 0 0 1.385 0 .75.75 0 1 0-.839-1.244.003.003 0 0 1-.004.003.003.003 0 0 1-.004-.003.75.75 0 0 0-1.244.199.75.75 0 0 0 .666.846Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const ChevronDownIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const ArrowLongLeftIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M14 8a.75.75 0 0 1-.75.75H3.81l2.72 2.72a.75.75 0 1 1-1.06 1.06l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06L3.81 7.25h9.44A.75.75 0 0 1 14 8Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const ArrowLongRightIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M2 8a.75.75 0 0 1 .75-.75h9.44l-2.72-2.72a.75.75 0 0 1 1.06-1.06l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 1 1-1.06-1.06l2.72-2.72H2.75A.75.75 0 0 1 2 8Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const EllipsisHorizontalIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2 8a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM6.5 8a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM12.5 6.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z\" />\n </svg>\n);\n\nexport const EnvelopeIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z\" />\n <path d=\"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z\" />\n </svg>\n);\n","import React, { useState } from 'react';\nimport type { ListViewProps } from './ListView.types';\nimport { Badge } from '../../components/Badge/Badge';\nimport { Navbar } from '../../components/Navbar/Navbar';\nimport { NavigationRailGroup } from '../../components/NavigationRailGroup/NavigationRailGroup';\nimport { Button } from '../../components/Button/Button';\nimport { Table } from '../../components/Table/Table';\nimport { Input } from '../../components/Input/Input';\nimport { Select } from '../../components/Select/Select';\nimport type { TableColumn } from '../../components/Table/Table.types';\nimport {\n HomeIcon,\n GlobeAltIcon,\n DocumentTextIcon,\n CloudIcon,\n SquaresPlusIcon,\n MagnifyingGlassIcon,\n PlusIcon,\n ListBulletIcon,\n FunnelIcon,\n ChevronDownIcon,\n EnvelopeIcon,\n} from './icons';\n\n/**\n * ListView - Vista de lista completa del sistema de diseño Siesa\n *\n * Vista completa que compone los siguientes componentes del sistema:\n * - NavigationRailGroup: Barra lateral de navegación con panel expandible\n * - Navbar: Barra superior con logo, título, notificaciones y dropdown de usuario\n * - Badge: Filtros rápidos con badges de colores\n * - Table: Tabla de datos con sorting y paginación integrada\n * - Button: Botones de acción (Crear, Auditoría, Filtrar)\n * - Input: Buscador integrado\n * - Select: Dropdown de opciones de vista\n *\n * Mejores prácticas implementadas:\n * - REUSO DE COMPONENTES: Usa componentes del sistema, NUNCA reimplementa\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n * - Responsive design (mobile-first)\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see src/components/NavigationRailGroup - Componente de navegación lateral\n * @see src/components/Navbar - Componente de barra superior\n * @see src/components/Table - Componente de tabla con paginación\n * @see src/components/Button - Componente de botón\n * @see src/components/Badge - Componente de badge\n *\n * @example\n * ```tsx\n * <ListView\n * title=\"List View\"\n * tableTitle=\"Usuarios\"\n * columns={columns}\n * data={users}\n * userDropdown={{\n * avatar: '/avatar.jpg',\n * name: 'John Doe',\n * role: 'Administrador',\n * }}\n * pagination={{\n * currentPage: 1,\n * totalPages: 10,\n * onPageChange: (page) => console.log(page),\n * }}\n * />\n * ```\n */\nexport const ListView = <T extends Record<string, any>>({\n title = 'List View',\n navbarProductName = 'SB Commercial',\n tableTitle = 'Usuarios',\n columns,\n data,\n navigationItems,\n quickFilters,\n actionButtons,\n userDropdown,\n notifications,\n environmentBadge,\n showNavigationRail = true,\n navigationRailState = 'collapsed',\n onNavigationRailStateChange,\n onNavItemClick,\n onSearch,\n searchPlaceholder = 'Buscar',\n onSort,\n sortColumn: externalSortColumn,\n sortDirection: externalSortDirection,\n pagination,\n loading = false,\n loadingRows = 5,\n emptyMessage = 'No hay datos disponibles',\n className = '',\n onNotificationsClick,\n viewOptions,\n selectedViewOption,\n onViewOptionChange,\n}: ListViewProps<T>) => {\n // ===== ESTADO INTERNO =====\n const [searchValue, setSearchValue] = useState('');\n const [showViewDropdown, setShowViewDropdown] = useState(false);\n\n // ===== NAVIGATION ITEMS DEFAULT =====\n const defaultNavigationItems = navigationItems || [\n {\n id: 'home',\n icon: <HomeIcon className=\"w-4 h-4\" />,\n label: 'Inicio',\n active: true,\n },\n {\n id: 'option1',\n icon: <GlobeAltIcon className=\"w-4 h-4\" />,\n label: 'Opción 1',\n },\n {\n id: 'option2',\n icon: <DocumentTextIcon className=\"w-4 h-4\" />,\n label: 'Opción 2',\n },\n {\n id: 'option3',\n icon: <CloudIcon className=\"w-4 h-4\" />,\n label: 'Opción 3',\n },\n {\n id: 'more',\n icon: <SquaresPlusIcon className=\"w-4 h-4\" />,\n label: 'Ver más...',\n },\n ];\n\n // ===== QUICK FILTERS DEFAULT =====\n const defaultQuickFilters = quickFilters || [\n {\n id: 'paid',\n label: 'Facturas Pagadas',\n color: 'lime' as const,\n },\n {\n id: 'pending',\n label: 'Facturas Pendientes por Pago',\n color: 'rose' as const,\n },\n {\n id: 'orders',\n label: 'Órdenes de Compra',\n color: 'sky' as const,\n },\n ];\n\n // ===== ACTION BUTTONS DEFAULT =====\n const defaultActionButtons = actionButtons || [\n {\n id: 'audit',\n label: 'Auditoría',\n leftIcon: <ListBulletIcon className=\"w-4 h-4\" />,\n type: 'default' as const,\n onClick: () => {},\n },\n {\n id: 'filter',\n label: 'Filtrar',\n leftIcon: <FunnelIcon className=\"w-4 h-4\" />,\n type: 'default' as const,\n onClick: () => {},\n },\n {\n id: 'create',\n label: 'Crear',\n leftIcon: <PlusIcon className=\"w-4 h-4\" />,\n type: 'default' as const,\n onClick: () => {},\n },\n ];\n\n // ===== HANDLERS =====\n const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {\n setSearchValue(e.target.value);\n onSearch?.(e.target.value);\n };\n\n // ===== CONVERTIR COLUMNAS AL FORMATO DE TABLE =====\n const tableColumns: TableColumn<T>[] = columns.map((col) => ({\n header: col.header,\n accessor: col.accessor,\n sortable: col.sortable,\n render: col.render,\n align: col.align,\n width: col.width,\n }));\n\n return (\n <div\n className={[\n 'bg-background-secondary',\n 'dark:bg-dark-bg-primary',\n 'flex',\n 'w-full',\n 'h-full',\n 'min-h-screen',\n className,\n ].join(' ')}\n >\n {/* ===== NAVIGATION RAIL GROUP ===== */}\n {showNavigationRail && (\n <NavigationRailGroup\n state={navigationRailState}\n items={defaultNavigationItems}\n onStateChange={onNavigationRailStateChange}\n onItemClick={onNavItemClick}\n showSearchButton={true}\n />\n )}\n\n {/* ===== CONTENEDOR PRINCIPAL ===== */}\n <div className=\"flex flex-col flex-1 overflow-hidden\">\n {/* ===== NAVBAR ===== */}\n <Navbar\n productName={navbarProductName}\n environmentBadge={environmentBadge}\n userDropdown={userDropdown}\n notifications={notifications}\n hideActionButtons={false}\n onNotificationsClick={onNotificationsClick}\n className=\"bg-background-secondary dark:bg-dark-bg-primary\"\n />\n\n {/* ===== QUICK FILTERS BAR ===== */}\n <div className=\"flex items-center gap-2 px-4 py-2 w-full bg-background-secondary dark:bg-dark-bg-primary\">\n {defaultQuickFilters.map((filter) => (\n <Badge\n key={filter.id}\n color={filter.color}\n label={filter.label}\n leftIcon={filter.icon}\n />\n ))}\n </div>\n\n {/* ===== BODY ===== */}\n <div className=\"flex flex-1 overflow-hidden bg-background-secondary dark:bg-dark-bg-primary\">\n <div className=\"flex flex-col gap-4 flex-1 bg-white dark:bg-dark-bg-primary p-4 rounded-tl-3xl overflow-hidden\">\n {/* Header Row */}\n <div className=\"flex items-center justify-between w-full\">\n <h2 className=\"font-bold text-xl leading-7 tracking-[-0.5px] text-content-primary dark:text-dark-content-primary\">\n {title}\n </h2>\n\n {/* Action Buttons */}\n <div className=\"flex items-center gap-2\">\n {defaultActionButtons.map((btn) => (\n <Button\n key={btn.id}\n type={btn.type}\n size=\"sm\"\n leftIcon={btn.leftIcon}\n onClick={btn.onClick}\n >\n {btn.label}\n </Button>\n ))}\n </div>\n </div>\n\n {/* ===== TABLE CONTAINER ===== */}\n <div className=\"flex flex-col gap-4 flex-1 bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-xl p-8 overflow-hidden\">\n {/* Table Header */}\n <div className=\"flex items-center gap-4 w-full\">\n <h3 className=\"flex-1 font-bold text-base leading-6 text-content-primary dark:text-dark-content-primary overflow-hidden text-ellipsis whitespace-nowrap\">\n {tableTitle}\n </h3>\n <Input\n placeholder={searchPlaceholder}\n leftIcon={<EnvelopeIcon className=\"w-4 h-4\" />}\n value={searchValue}\n onChange={handleSearch}\n className=\"w-[200px]\"\n />\n {/* View Dropdown */}\n {viewOptions && (\n <div className=\"relative\">\n <button\n onClick={() => setShowViewDropdown(!showViewDropdown)}\n className=\"flex items-center gap-3 px-3 py-2 bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg shadow-xs hover:bg-background-secondary dark:hover:bg-dark-bg-secondary transition-colors\"\n >\n <span className=\"font-bold text-sm text-content-secondary dark:text-content-secondary\">\n Ver\n </span>\n <ChevronDownIcon className=\"w-5 h-5 text-content-secondary dark:text-content-secondary\" />\n </button>\n {showViewDropdown && (\n <div className=\"absolute top-full right-0 mt-1 bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg shadow-lg z-10 min-w-[150px]\">\n {viewOptions.map((option) => (\n <button\n key={option.id}\n onClick={() => {\n onViewOptionChange?.(option.id);\n setShowViewDropdown(false);\n }}\n className={[\n 'block',\n 'w-full',\n 'px-4',\n 'py-2',\n 'text-left',\n 'text-sm',\n 'hover:bg-background-secondary',\n 'dark:hover:bg-dark-bg-secondary',\n selectedViewOption === option.id\n ? 'bg-primary-custom-100 dark:bg-primary-custom-600/20'\n : '',\n ].join(' ')}\n >\n {option.label}\n </button>\n ))}\n </div>\n )}\n </div>\n )}\n </div>\n\n {/* ===== TABLE ===== */}\n <Table\n columns={tableColumns}\n data={data}\n variant=\"grid\"\n showBorder={false}\n showShadow={false}\n loading={loading}\n loadingRows={loadingRows}\n emptyMessage={emptyMessage}\n onSort={onSort}\n sortColumn={externalSortColumn}\n sortDirection={externalSortDirection}\n pagination={pagination}\n className=\"flex-1\"\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * Icono de sobre (envelope) para el input de email\n */\nexport const EnvelopeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z\" />\n <path d=\"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z\" />\n </svg>\n);\n\n/**\n * Icono de candado cerrado (lock) para el input de contraseña\n */\nexport const LockClosedIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Icono de ojo (eye) para mostrar/ocultar contraseña\n */\nexport const EyeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\" />\n <path\n fillRule=\"evenodd\"\n d=\"M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .56A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Logo de Siesa\n */\nexport const SiesaLogo: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n width=\"200\"\n height=\"50\"\n viewBox=\"0 0 200 50\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n {/* Símbolo de Siesa (cuadrados azules) */}\n <rect x=\"0\" y=\"0\" width=\"15\" height=\"20\" fill=\"#0e79fd\" />\n <rect x=\"0\" y=\"30\" width=\"10\" height=\"20\" fill=\"#0e79fd\" />\n <rect x=\"20\" y=\"0\" width=\"15\" height=\"20\" fill=\"#0e79fd\" />\n <rect x=\"30\" y=\"30\" width=\"10\" height=\"20\" fill=\"#0e79fd\" />\n\n {/* Texto \"Siesa\" */}\n <text\n x=\"68\"\n y=\"35\"\n fontFamily=\"SiesaBT, sans-serif\"\n fontSize=\"32\"\n fontWeight=\"400\"\n fill=\"#0e79fd\"\n >\n Siesa\n </text>\n </svg>\n);\n","import React, { useState } from 'react';\nimport type { FormEvent } from 'react';\nimport type { LoginViewProps } from './LoginView.types';\nimport { EnvelopeIcon, LockClosedIcon, EyeIcon } from './icons';\n\n/**\n * LoginView - Vista de inicio de sesión del sistema Siesa\n *\n * Vista completa de login con formulario de autenticación que incluye:\n * - Logo de Siesa\n * - Campos de email y contraseña\n * - Opción de \"olvidé mi contraseña\"\n * - Link para crear cuenta nueva\n * - Fondo decorativo opcional\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels y manejo de formulario semántico\n * - Validación de email básica\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n *\n * @example\n * ```tsx\n * <LoginView\n * onSubmit={(email, password) => console.log('Login', email, password)}\n * onForgotPassword={() => console.log('Forgot password')}\n * onSignUp={() => console.log('Sign up')}\n * />\n * ```\n */\nexport const LoginView: React.FC<LoginViewProps> = ({\n onSubmit,\n onForgotPassword,\n onSignUp,\n isLoading = false,\n errorMessage,\n className = '',\n showBackground = true,\n variant = 'responsive',\n}) => {\n // ===== ESTADO LOCAL =====\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [showPassword, setShowPassword] = useState(false);\n const [emailError, setEmailError] = useState('');\n\n // ===== HANDLERS =====\n const handleSubmit = (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n\n // Validación básica de email\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(email)) {\n setEmailError('Por favor ingresa un email válido');\n return;\n }\n\n setEmailError('');\n onSubmit?.(email, password);\n };\n\n const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEmail(e.target.value);\n if (emailError) setEmailError('');\n };\n\n const togglePasswordVisibility = () => {\n setShowPassword(!showPassword);\n };\n\n return (\n <div\n className={[\n 'relative',\n 'min-h-screen',\n 'w-full',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'box-border',\n // Mobile: sin padding en el wrapper (el padding está en el contenedor)\n 'p-0',\n // Desktop: padding para centrar el card\n 'md:p-4',\n className,\n ].join(' ')}\n >\n {/* ===== FONDO DECORATIVO ===== */}\n {showBackground && (\n <div className=\"absolute inset-0 pointer-events-none\" aria-hidden=\"true\">\n <div className=\"absolute inset-0 bg-primary-custom-100 dark:bg-dark-bg-custom\" />\n <img\n src=\"/bg_siesa.png\"\n alt=\"\"\n className=\"absolute inset-0 w-full h-full object-cover opacity-10\"\n />\n </div>\n )}\n\n {/* ===== CONTENEDOR PRINCIPAL ===== */}\n <div\n className={[\n // Clases base comunes\n 'relative',\n 'box-border',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'gap-4',\n 'p-16',\n 'shrink-0',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n\n // Clases específicas según variant\n ...(variant === 'mobile' ? [\n // Forzar mobile: sin efectos de card\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n ] : variant === 'desktop' ? [\n // Forzar desktop: con efectos de card\n 'w-[400px]',\n 'h-auto',\n 'rounded-2xl',\n 'shadow-lg',\n 'dark:shadow-2xl',\n 'overflow-clip',\n 'border',\n 'border-transparent',\n 'dark:border-dark-border-primary',\n ] : [\n // Responsive: cambia según viewport\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n 'md:w-[400px]',\n 'md:h-auto',\n 'md:rounded-2xl',\n 'md:shadow-lg',\n 'md:dark:shadow-2xl',\n 'md:overflow-clip',\n 'md:border',\n 'md:border-transparent',\n 'md:dark:border-dark-border-primary',\n ]),\n ].join(' ')}\n >\n {/* ===== LOGO ===== */}\n <div className=\"w-full flex flex-col items-center pb-4\">\n <img\n src=\"/.Siesa Logo.png\"\n alt=\"Siesa\"\n className=\"w-[200px] h-[50px] object-contain\"\n />\n </div>\n\n {/* ===== HEADING ===== */}\n <div className=\"w-full text-center\">\n <h1\n className={[\n 'text-[20px]',\n 'leading-[28px]',\n 'font-bold',\n 'tracking-[-0.5px]',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Iniciar Sesión\n </h1>\n <p\n className={[\n 'text-[12px]',\n 'leading-[16px]',\n 'font-normal',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Inicia sesión ingresando con tu correo electrónico y contraseña.\n </p>\n </div>\n\n {/* ===== MENSAJE DE ERROR GENERAL ===== */}\n {errorMessage && (\n <div\n className={[\n 'w-full',\n 'p-3',\n 'bg-error-bg',\n 'dark:bg-error-bg',\n 'border',\n 'border-error-border',\n 'dark:border-error-border',\n 'rounded-md',\n 'text-error-content',\n 'dark:text-error-content',\n 'text-sm',\n ].join(' ')}\n role=\"alert\"\n >\n {errorMessage}\n </div>\n )}\n\n {/* ===== FORMULARIO ===== */}\n <form onSubmit={handleSubmit} className=\"w-full flex flex-col gap-2\">\n {/* Email Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <label\n htmlFor=\"email-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Correo Electrónico <span className=\"text-red-600\">*</span>\n </label>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <EnvelopeIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"email-input\"\n type=\"email\"\n placeholder=\"ejemplo@miempresa.com\"\n value={email}\n onChange={handleEmailChange}\n disabled={isLoading}\n required\n autoComplete=\"email\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-3',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n emailError ? 'border-error-border!' : '',\n ].filter(Boolean).join(' ')}\n />\n </div>\n {emailError && (\n <p className=\"text-xs text-error-content dark:text-error-content\">\n {emailError}\n </p>\n )}\n </div>\n\n {/* Password Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <div className=\"flex items-center justify-between\">\n <label\n htmlFor=\"password-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Contraseña <span className=\"text-red-600\">*</span>\n </label>\n <button\n type=\"button\"\n onClick={onForgotPassword}\n className=\"text-[12px] leading-4 font-bold text-primary-custom-600 dark:text-[#93d1fd] hover:underline transition-all duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-[#93d1fd] rounded-sm px-1\"\n >\n Olvidé mi Contraseña\n </button>\n </div>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <LockClosedIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"password-input\"\n type={showPassword ? 'text' : 'password'}\n placeholder=\"••••••••\"\n value={password}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.target.value)}\n disabled={isLoading}\n required\n autoComplete=\"current-password\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-10',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n ].join(' ')}\n />\n <button\n type=\"button\"\n onClick={togglePasswordVisibility}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 opacity-50 hover:opacity-100 text-content-tertiary dark:text-dark-content-tertiary transition-opacity duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-dark-border-custom rounded-sm p-1\"\n aria-label={showPassword ? 'Ocultar contraseña' : 'Mostrar contraseña'}\n >\n <EyeIcon className=\"w-4 h-4\" />\n </button>\n </div>\n </div>\n\n {/* Submit Button */}\n <button\n type=\"submit\"\n disabled={isLoading || !email || !password}\n className={[\n 'relative',\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-primary-inverse-content',\n 'dark:text-[#0e79fd]',\n 'bg-[#0e79fd]',\n 'dark:bg-dark-bg-inverse',\n 'border',\n 'border-[#3c9bf6]',\n 'dark:border-[#93d1fd]',\n 'rounded-md',\n 'shadow-button-inset',\n 'hover:bg-primary-custom-500',\n 'dark:hover:bg-[#93d1fd]',\n 'active:scale-95',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n 'disabled:opacity-50',\n 'disabled:cursor-not-allowed',\n ].join(' ')}\n >\n {isLoading ? 'Iniciando sesión...' : 'Iniciar Sesión'}\n </button>\n </form>\n\n {/* ===== SIGN UP LINK ===== */}\n <button\n type=\"button\"\n onClick={onSignUp}\n className={[\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-[#0e79fd]',\n 'dark:text-[#93d1fd]',\n 'hover:bg-primary-custom-100',\n 'dark:hover:bg-[#93d1fd]/10',\n 'rounded-md',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n ].join(' ')}\n >\n ¿No tienes una cuenta?\n </button>\n </div>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * Iconos para ProductsView\n * Basados en Heroicons Micro (16x16px)\n */\n\nexport const ArrowLeftIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M14 8a.75.75 0 0 1-.75.75H4.56l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 1.06L4.56 7.25h8.69A.75.75 0 0 1 14 8Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const CheckIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n","import React from 'react';\nimport type { ProductsViewProps } from './ProductsView.types';\nimport { Button } from '../../components/Button';\nimport { POSProductButton } from '../../components/POSProductButton';\nimport { POSProductCard } from '../../components/POSProductCard';\nimport { POSProductSidebarItems } from '../../components/POSProductSidebarItems';\nimport { Divider } from '../../components/Divider/Divider';\nimport { Navbar } from '../../components/Navbar';\nimport {\n ArrowLeftIcon,\n CheckIcon,\n} from './icons';\n\n/**\n * ProductsView - Vista de selección de productos para sistema POS\n *\n * Vista completa para sistemas POS que permite:\n * - Seleccionar categorías de productos\n * - Ver y agregar productos al pedido\n * - Gestionar items del pedido (cantidad, eliminar)\n * - Ver resumen con subtotal, impuestos y total\n * - Confirmar pedido\n *\n * **Composición:**\n * - Navbar superior con navegación y usuario\n * - Área de contenido con 3 columnas:\n * - Columna 1: Sidebar de categorías (POSProductButton)\n * - Columna 2: Grid de productos (POSProductCard)\n * - Columna 3: Sidebar de pedido (POSProductSidebarItems)\n *\n * **Responsive:**\n * - Mobile (< 768px): Layout vertical adaptativo\n * - Desktop (≥ 768px): Layout de 3 columnas según Figma\n *\n * **Dark Mode:**\n * - Soporte completo con tokens del sistema\n * - Fondos, textos y bordes adaptativos\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Responsive design con breakpoints\n * - Composición con componentes del sistema\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see src/components/POSProductButton - Botón de categoría\n * @see src/components/POSProductCard - Card de producto\n * @see src/components/POSProductSidebarItems - Item de pedido\n *\n * @example\n * ```tsx\n * <ProductsView\n * tableTitle=\"Mesa 1\"\n * categories={categories}\n * products={products}\n * orderItems={orderItems}\n * onAddProduct={(id) => console.log('Agregar', id)}\n * onConfirmOrder={() => console.log('Confirmar')}\n * />\n * ```\n */\nexport const ProductsView: React.FC<ProductsViewProps> = ({\n tableTitle = 'Mesa 1',\n changeTableLabel = 'Cambiar Mesa',\n menusTitle = 'Menús',\n menus = [\n { id: '1', label: 'Corral' },\n { id: '2', label: 'Burguer One' },\n { id: '3', label: 'Andrés Carne de Res' },\n { id: '4', label: 'Aceites' },\n { id: '5', label: 'Kiosco Mac' },\n { id: '6', label: 'Kiosco Qbano' },\n { id: '7', label: 'Premier Dinning' },\n ],\n selectedMenuId = '1',\n onMenuSelect,\n onChangeTable,\n categoryTitle = 'Categoría',\n categories = [],\n selectedCategoryId,\n onCategorySelect,\n productsTitle = 'Productos',\n products = [],\n onAddProduct,\n activeTab = 'products',\n onTabChange,\n orderItems = [],\n onOrderItemQuantityChange,\n onOrderItemDelete,\n subtotal = '40,000.00',\n taxes = '40,000.00',\n total = '40,000.00',\n confirmLabel = 'Confirmar Pedido',\n onConfirmOrder,\n isLoading = false,\n errorMessage,\n userAvatar,\n userName = 'Jhonnatan Diaz',\n userRole = 'Administrador',\n businessLogo,\n siesaLogo,\n className = '',\n}) => {\n return (\n <div\n className={`\n min-h-screen\n w-full\n bg-background-secondary\n dark:bg-dark-bg-primary\n flex\n flex-col\n ${className}\n `.trim().replace(/\\s+/g, ' ')}\n >\n {/* ===== NAVBAR ===== */}\n <Navbar\n logo={\n businessLogo && (\n <div className=\"h-[30px] w-[168px] overflow-hidden\">\n {typeof businessLogo === 'string' ? (\n <img src={businessLogo} alt=\"Business Logo\" className=\"h-full w-full object-contain\" />\n ) : (\n businessLogo\n )}\n </div>\n )\n }\n productName=\"\"\n userDropdown={\n userAvatar\n ? {\n avatar: userAvatar,\n name: userName,\n role: userRole,\n }\n : undefined\n }\n hideActionButtons\n siesaLogo={\n siesaLogo && (\n <div className=\"h-[30px] w-[120px] overflow-hidden\">\n {typeof siesaLogo === 'string' ? (\n <img src={siesaLogo} alt=\"Siesa Logo\" className=\"h-full w-full object-contain\" />\n ) : (\n siesaLogo\n )}\n </div>\n )\n }\n variant=\"desktop\"\n className=\"bg-background-secondary dark:bg-dark-bg-primary\"\n />\n\n {/* ===== CONTAINER ===== */}\n <div className=\"flex flex-1 w-full overflow-hidden\">\n {/* ===== ROW PRINCIPAL ===== */}\n <div className=\"flex flex-1 w-full overflow-hidden\">\n {/* ===== COLUMNA 1: ÁREA DE CONTENIDO (Menu + Body) ===== */}\n <div\n className=\"\n flex-1\n flex\n flex-col\n gap-4\n p-4\n bg-white\n dark:bg-dark-bg-primary\n rounded-tl-3xl\n rounded-tr-3xl\n overflow-hidden\n \"\n >\n {/* Menu de navegación */}\n <div className=\"flex items-center gap-4 w-full\">\n {/* Cambiar Mesa Button */}\n <div className=\"shrink-0\">\n <Button\n type=\"default\"\n leftIcon={<ArrowLeftIcon className=\"w-4 h-4\" />}\n onClick={onChangeTable}\n ariaLabel={changeTableLabel}\n >\n {changeTableLabel}\n </Button>\n </div>\n\n {/* Divider */}\n <div className=\"h-8 w-px bg-border-primary dark:bg-dark-border-primary shrink-0\" />\n\n {/* Título Menús */}\n <div className=\"shrink-0\">\n <h2 className=\"text-xl font-bold leading-7 tracking-tight text-content-primary dark:text-dark-content-primary\">\n {menusTitle}\n </h2>\n </div>\n\n {/* Botones de menús con scroll horizontal */}\n <div className=\"flex-1 flex gap-2 overflow-x-auto overflow-y-hidden\">\n {menus.map((menu) => (\n <Button\n key={menu.id}\n type={selectedMenuId === menu.id ? 'default' : 'outline-solid'}\n onClick={() => onMenuSelect?.(menu.id)}\n >\n {menu.label}\n </Button>\n ))}\n </div>\n </div>\n\n {/* Body: Categorías + Productos */}\n <div\n className=\"\n flex-1\n flex\n gap-0\n bg-background-secondary\n dark:bg-dark-bg-primary/50\n rounded-xl\n overflow-hidden\n \"\n >\n {/* ===== SIDEBAR IZQUIERDO: CATEGORÍAS ===== */}\n <div className=\"w-[213px] p-4 border-b border-border-primary dark:border-dark-border-primary\">\n <div className=\"flex flex-col gap-4 h-full\">\n {/* Título */}\n <div className=\"flex items-center justify-center w-full\">\n <h3 className=\"text-xl font-bold leading-6 text-content-primary dark:text-dark-content-primary\">\n {categoryTitle}\n </h3>\n </div>\n\n {/* Lista de categorías con scroll */}\n <div className=\"flex-1 flex flex-col gap-2 overflow-x-hidden overflow-y-auto\">\n {categories.map((category) => (\n <POSProductButton\n key={category.id}\n image={category.image}\n label={category.label}\n active={selectedCategoryId === category.id}\n onClick={() => onCategorySelect?.(category.id)}\n />\n ))}\n </div>\n </div>\n </div>\n\n {/* ===== CONTENIDO PRINCIPAL: PRODUCTOS ===== */}\n <div className=\"flex-1 p-4 border-l border-b border-border-primary dark:border-dark-border-primary\">\n <div className=\"flex flex-col gap-4 h-full\">\n {/* Título */}\n <div className=\"flex items-center justify-center w-full\">\n <h3 className=\"text-xl font-bold leading-6 text-content-primary dark:text-dark-content-primary\">\n {productsTitle}\n </h3>\n </div>\n\n {/* Grid de productos con scroll - Flexbox centrado con max-width para 4 columnas (170px * 4 + 8px * 3 = 704px) */}\n <div className=\"flex-1 overflow-x-hidden overflow-y-auto\">\n <div className=\"flex flex-col items-center justify-start min-h-full w-full\">\n <div className=\"flex flex-wrap gap-2 justify-center max-w-[704px]\">\n {products.map((product) => (\n <POSProductCard\n key={product.id}\n image={product.image}\n productName={product.name}\n price={product.price}\n onAddClick={() => onAddProduct?.(product.id)}\n />\n ))}\n </div>\n </div>\n\n {/* Estado vacío */}\n {products.length === 0 && (\n <div className=\"flex items-center justify-center h-full\">\n <p className=\"text-content-secondary dark:text-content-secondary\">\n No hay productos disponibles\n </p>\n </div>\n )}\n\n {/* Estado de carga */}\n {isLoading && (\n <div className=\"flex items-center justify-center h-full\">\n <p className=\"text-content-secondary dark:text-content-secondary\">\n Cargando productos...\n </p>\n </div>\n )}\n\n {/* Estado de error */}\n {errorMessage && (\n <div className=\"flex items-center justify-center h-full\">\n <p className=\"text-red-600 dark:text-red-400\">\n {errorMessage}\n </p>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* ===== COLUMNA 2: SIDEBAR DERECHO (Pedido) ===== */}\n <div className=\"w-[304px] p-4 flex flex-col gap-0 h-full overflow-hidden\">\n <div className=\"flex flex-col h-full relative\">\n {/* Heading */}\n <div className=\"border-b border-border-primary dark:border-dark-border-primary pb-4 z-10\">\n <h2 className=\"text-xl font-bold leading-7 tracking-tight text-content-primary dark:text-dark-content-primary\">\n {tableTitle}\n </h2>\n </div>\n\n {/* Tabs */}\n <div className=\"flex items-start py-2.5 z-10\">\n <button\n className={`\n flex-1\n flex\n flex-col\n items-center\n p-2\n rounded-lg\n transition-colors\n duration-150\n ${activeTab === 'products' ? 'relative' : ''}\n `}\n onClick={() => onTabChange?.('products')}\n >\n <span\n className={`\n text-sm\n font-bold\n leading-5\n ${activeTab === 'products'\n ? 'text-primary-custom-600 dark:text-primary-custom-600'\n : 'text-content-primary dark:text-dark-content-primary'\n }\n `}\n >\n Productos\n </span>\n {activeTab === 'products' && (\n <div className=\"absolute -bottom-2.5 left-0 right-0 h-0.5 bg-primary-custom-600 dark:bg-primary-custom-600 rounded-full\" />\n )}\n </button>\n\n <button\n className={`\n flex-1\n flex\n flex-col\n items-center\n p-2\n rounded-lg\n transition-colors\n duration-150\n ${activeTab === 'client' ? 'relative' : ''}\n `}\n onClick={() => onTabChange?.('client')}\n >\n <span\n className={`\n text-sm\n font-bold\n leading-5\n ${activeTab === 'client'\n ? 'text-primary-custom-600 dark:text-primary-custom-600'\n : 'text-content-primary dark:text-dark-content-primary'\n }\n `}\n >\n Cliente\n </span>\n {activeTab === 'client' && (\n <div className=\"absolute -bottom-2.5 left-0 right-0 h-0.5 bg-primary-custom-600 dark:bg-primary-custom-600 rounded-full\" />\n )}\n </button>\n </div>\n\n {/* Body: Lista de items del pedido */}\n <div\n className=\"\n flex-1\n flex\n flex-col\n gap-2\n p-4\n bg-white\n dark:bg-dark-bg-primary\n rounded-bl-lg\n rounded-br-lg\n overflow-x-hidden\n overflow-y-auto\n z-10\n \"\n >\n {orderItems.map((item, index) => (\n <React.Fragment key={item.productId}>\n <POSProductSidebarItems\n categoryLabel={item.categoryLabel}\n categoryColor={item.categoryColor}\n productRef={item.productRef}\n price={item.price}\n productName={item.productName}\n descriptionItems={item.descriptionItems}\n showDescription={!!item.descriptionItems && item.descriptionItems.length > 0}\n quantity={item.quantity}\n onQuantityChange={(qty) => onOrderItemQuantityChange?.(item.productId, qty)}\n onDelete={() => onOrderItemDelete?.(item.productId)}\n />\n {index < orderItems.length - 1 && <Divider />}\n </React.Fragment>\n ))}\n\n {/* Estado vacío */}\n {orderItems.length === 0 && (\n <div className=\"flex items-center justify-center h-full\">\n <p className=\"text-content-secondary dark:text-content-secondary text-center\">\n No hay productos en el pedido\n </p>\n </div>\n )}\n </div>\n\n {/* Footer: Resumen y botón confirmar */}\n <div className=\"flex flex-col gap-4 pt-4 z-10\">\n {/* Resumen de precios */}\n <div className=\"flex flex-col gap-2\">\n {/* Subtotal */}\n <div className=\"flex items-start text-base font-bold leading-6 text-content-primary dark:text-dark-content-primary\">\n <div className=\"flex-1\">Subtotal</div>\n <div className=\"flex-1 text-right\">{subtotal}</div>\n </div>\n\n {/* Impuestos */}\n <div className=\"flex items-start text-base font-bold leading-6 text-content-primary dark:text-dark-content-primary\">\n <div className=\"flex-1\">Impuestos</div>\n <div className=\"flex-1 text-right\">{taxes}</div>\n </div>\n\n {/* Divider */}\n <Divider />\n\n {/* Total */}\n <div className=\"flex items-start text-lg font-bold leading-7 text-content-primary dark:text-dark-content-primary\">\n <div className=\"flex-1\">Total</div>\n <div className=\"flex-1 text-right\">{total}</div>\n </div>\n </div>\n\n {/* Botón confirmar */}\n <div className=\"flex gap-2 w-full\">\n <Button\n type=\"default\"\n leftIcon={<CheckIcon className=\"w-4 h-4\" />}\n onClick={onConfirmOrder}\n fullWidth\n disabled={orderItems.length === 0 || isLoading}\n >\n {confirmLabel}\n </Button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nProductsView.displayName = 'ProductsView';\n","import React from 'react';\n\n/**\n * Icono de sobre (envelope) para el campo de email\n * @see https://heroicons.com/\n */\nexport const EnvelopeIcon: React.FC<{ className?: string }> = ({ className = 'w-4 h-4' }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className={className}\n >\n <path d=\"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z\" />\n <path d=\"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z\" />\n </svg>\n);\n","import React, { useState } from 'react';\nimport type { FormEvent } from 'react';\nimport type { RecoverPasswordViewProps } from './RecoverPasswordView.types';\nimport { EnvelopeIcon } from './icons';\n\n/**\n * RecoverPasswordView - Vista de recuperación de contraseña del sistema Siesa\n *\n * Vista completa para restablecer contraseña que incluye:\n * - Logo de Siesa\n * - Campo de email para enviar instrucciones\n * - Botón para regresar al login\n * - Fondo decorativo opcional\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels y manejo de formulario semántico\n * - Validación de email básica\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n *\n * @example\n * ```tsx\n * <RecoverPasswordView\n * onSubmit={(email) => console.log('Recover password for', email)}\n * onBackToLogin={() => console.log('Back to login')}\n * />\n * ```\n */\nexport const RecoverPasswordView: React.FC<RecoverPasswordViewProps> = ({\n onSubmit,\n onBackToLogin,\n isLoading = false,\n errorMessage,\n successMessage,\n className = '',\n showBackground = true,\n variant = 'responsive',\n}) => {\n // ===== ESTADO LOCAL =====\n const [email, setEmail] = useState('');\n const [emailError, setEmailError] = useState('');\n\n // ===== HANDLERS =====\n const handleSubmit = (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n\n // Validación básica de email\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(email)) {\n setEmailError('Por favor ingresa un email válido');\n return;\n }\n\n setEmailError('');\n onSubmit?.(email);\n };\n\n const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEmail(e.target.value);\n if (emailError) setEmailError('');\n };\n\n return (\n <div\n className={[\n 'relative',\n 'min-h-screen',\n 'w-full',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'box-border',\n // Mobile: sin padding en el wrapper (el padding está en el contenedor)\n 'p-0',\n // Desktop: padding para centrar el card\n 'md:p-4',\n className,\n ].join(' ')}\n >\n {/* ===== FONDO DECORATIVO (solo desktop) ===== */}\n {showBackground && (\n <div className=\"hidden md:block absolute inset-0 pointer-events-none\" aria-hidden=\"true\">\n <div className=\"absolute inset-0 bg-primary-custom-100 dark:bg-dark-bg-custom\" />\n <img\n src=\"/bg_siesa.jpg\"\n alt=\"\"\n className=\"absolute inset-0 w-full h-full object-cover opacity-10\"\n />\n </div>\n )}\n\n {/* ===== CONTENEDOR PRINCIPAL ===== */}\n <div\n className={[\n // Clases base comunes\n 'relative',\n 'box-border',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'gap-4',\n 'p-16',\n 'shrink-0',\n 'bg-bg-primary',\n 'dark:bg-zinc-700',\n\n // Clases específicas según variant\n ...(variant === 'mobile' ? [\n // Forzar mobile: sin efectos de card\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n ] : variant === 'desktop' ? [\n // Forzar desktop: con efectos de card\n 'w-[400px]',\n 'h-auto',\n 'rounded-2xl',\n 'shadow-lg',\n 'dark:shadow-2xl',\n 'overflow-clip',\n 'border',\n 'border-transparent',\n 'dark:border-dark-border-primary',\n ] : [\n // Responsive: cambia según viewport\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n 'md:w-[400px]',\n 'md:h-auto',\n 'md:rounded-2xl',\n 'md:shadow-lg',\n 'md:dark:shadow-2xl',\n 'md:overflow-clip',\n 'md:border',\n 'md:border-transparent',\n 'md:dark:border-dark-border-primary',\n ]),\n ].join(' ')}\n >\n {/* ===== LOGO ===== */}\n <div className=\"w-full flex flex-col items-center pb-4\">\n <img\n src=\"/.Siesa Logo.png\"\n alt=\"Siesa\"\n className=\"w-[200px] h-[50px] object-contain\"\n />\n </div>\n\n {/* ===== HEADING ===== */}\n <div className=\"w-full text-center\">\n <h1\n className={[\n 'text-[20px]',\n 'leading-[28px]',\n 'font-bold',\n 'tracking-[-0.5px]',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Restablecer Contraseña\n </h1>\n <p\n className={[\n 'text-[12px]',\n 'leading-[16px]',\n 'font-normal',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Reestablece tu contraseña ingresando con tu correo electrónico.\n </p>\n </div>\n\n {/* ===== MENSAJE DE ERROR GENERAL ===== */}\n {errorMessage && (\n <div\n className={[\n 'w-full',\n 'p-3',\n 'bg-error-bg',\n 'dark:bg-error-bg',\n 'border',\n 'border-error-border',\n 'dark:border-error-border',\n 'rounded-md',\n 'text-error-content',\n 'dark:text-error-content',\n 'text-sm',\n ].join(' ')}\n role=\"alert\"\n >\n {errorMessage}\n </div>\n )}\n\n {/* ===== MENSAJE DE ÉXITO ===== */}\n {successMessage && (\n <div\n className={[\n 'w-full',\n 'p-3',\n 'bg-[#d1fae5]',\n 'dark:bg-[#064e3b]',\n 'border',\n 'border-[#a7f3d0]',\n 'dark:border-[#065f46]',\n 'rounded-md',\n 'text-[#065f46]',\n 'dark:text-[#a7f3d0]',\n 'text-sm',\n ].join(' ')}\n role=\"status\"\n >\n {successMessage}\n </div>\n )}\n\n {/* ===== FORMULARIO ===== */}\n <form onSubmit={handleSubmit} className=\"w-full flex flex-col gap-2\">\n {/* Email Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <label\n htmlFor=\"email-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Correo Electrónico <span className=\"text-red-600\">*</span>\n </label>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <EnvelopeIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"email-input\"\n type=\"email\"\n placeholder=\"ejemplo@miempresa.com\"\n value={email}\n onChange={handleEmailChange}\n disabled={isLoading}\n required\n autoComplete=\"email\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-3',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-zinc-700',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n emailError ? 'border-error-border!' : '',\n ].filter(Boolean).join(' ')}\n />\n </div>\n {emailError && (\n <p className=\"text-xs text-error-content dark:text-error-content\">\n {emailError}\n </p>\n )}\n </div>\n\n {/* Submit Button */}\n <button\n type=\"submit\"\n disabled={isLoading || !email}\n className={[\n 'relative',\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-primary-inverse-content',\n 'dark:text-[#0e79fd]',\n 'bg-[#0e79fd]',\n 'dark:bg-dark-bg-inverse',\n 'border',\n 'border-[#3c9bf6]',\n 'dark:border-[#93d1fd]',\n 'rounded-md',\n 'shadow-button-inset',\n 'hover:bg-primary-custom-500',\n 'dark:hover:bg-[#93d1fd]',\n 'active:scale-95',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n 'disabled:opacity-50',\n 'disabled:cursor-not-allowed',\n ].join(' ')}\n >\n {isLoading ? 'Enviando...' : 'Reestablecer Contraseña'}\n </button>\n </form>\n\n {/* ===== BACK TO LOGIN BUTTON ===== */}\n <button\n type=\"button\"\n onClick={onBackToLogin}\n className={[\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-[#0e79fd]',\n 'dark:text-[#93d1fd]',\n 'bg-transparent',\n 'border',\n 'border-[#93d1fd]',\n 'dark:border-[#93d1fd]',\n 'rounded-md',\n 'hover:bg-primary-custom-100',\n 'dark:hover:bg-[#93d1fd]/10',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n ].join(' ')}\n >\n Iniciar Sesión\n </button>\n </div>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * Icono de círculo de usuario para el input de nombre\n */\nexport const UserCircleIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0Zm-5-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 9c-1.825 0-3.422.977-4.295 2.437A5.49 5.49 0 0 0 8 13.5a5.49 5.49 0 0 0 4.294-2.063A4.997 4.997 0 0 0 8 9Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Icono de sobre (envelope) para el input de email\n */\nexport const EnvelopeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z\" />\n <path d=\"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z\" />\n </svg>\n);\n\n/**\n * Icono de candado cerrado (lock) para el input de contraseña\n */\nexport const LockClosedIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n/**\n * Icono de ojo (eye) para mostrar/ocultar contraseña\n */\nexport const EyeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\" />\n <path\n fillRule=\"evenodd\"\n d=\"M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .56A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n","import React, { useState } from 'react';\nimport type { FormEvent } from 'react';\nimport type { SignUpViewProps } from './SignUpView.types';\nimport { UserCircleIcon, EnvelopeIcon, LockClosedIcon, EyeIcon } from './icons';\n\n/**\n * SignUpView - Vista de registro del sistema Siesa\n *\n * Vista completa de registro con formulario que incluye:\n * - Logo de Siesa\n * - Campos de nombre, email y contraseña\n * - Botón de registro\n * - Link para iniciar sesión\n * - Texto de términos y condiciones\n * - Fondo decorativo opcional\n *\n * Mejores prácticas implementadas:\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels y manejo de formulario semántico\n * - Validación de email básica\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n *\n * @example\n * ```tsx\n * <SignUpView\n * onSubmit={(name, email, password) => console.log('Sign up', name, email, password)}\n * onSignIn={() => console.log('Go to sign in')}\n * onTermsClick={() => console.log('View terms')}\n * onPrivacyClick={() => console.log('View privacy')}\n * />\n * ```\n */\nexport const SignUpView: React.FC<SignUpViewProps> = ({\n onSubmit,\n onSignIn,\n onTermsClick,\n onPrivacyClick,\n isLoading = false,\n errorMessage,\n className = '',\n showBackground = true,\n variant = 'responsive',\n}) => {\n // ===== ESTADO LOCAL =====\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [showPassword, setShowPassword] = useState(false);\n const [emailError, setEmailError] = useState('');\n\n // ===== HANDLERS =====\n const handleSubmit = (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n\n // Validación básica de email\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(email)) {\n setEmailError('Por favor ingresa un email válido');\n return;\n }\n\n setEmailError('');\n onSubmit?.(name, email, password);\n };\n\n const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEmail(e.target.value);\n if (emailError) setEmailError('');\n };\n\n const togglePasswordVisibility = () => {\n setShowPassword(!showPassword);\n };\n\n return (\n <div\n className={[\n 'relative',\n 'min-h-screen',\n 'w-full',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'box-border',\n // Mobile: sin padding en el wrapper\n 'p-0',\n // Desktop: padding para centrar el card\n 'md:p-4',\n className,\n ].join(' ')}\n >\n {/* ===== FONDO DECORATIVO ===== */}\n {showBackground && (\n <div className=\"absolute inset-0 pointer-events-none\" aria-hidden=\"true\">\n <div className=\"absolute inset-0 bg-primary-custom-100 dark:bg-dark-bg-custom\" />\n <img\n src=\"/bg_siesa.png\"\n alt=\"\"\n className=\"absolute inset-0 w-full h-full object-cover opacity-10\"\n />\n </div>\n )}\n\n {/* ===== CONTENEDOR PRINCIPAL ===== */}\n <div\n className={[\n // Clases base comunes\n 'relative',\n 'box-border',\n 'flex',\n 'flex-col',\n 'items-center',\n 'justify-center',\n 'gap-4',\n 'p-16',\n 'shrink-0',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n\n // Clases específicas según variant\n ...(variant === 'mobile' ? [\n // Forzar mobile: sin efectos de card\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n ] : variant === 'desktop' ? [\n // Forzar desktop: con efectos de card\n 'w-[400px]',\n 'h-auto',\n 'rounded-2xl',\n 'shadow-lg',\n 'dark:shadow-2xl',\n 'overflow-clip',\n 'border',\n 'border-transparent',\n 'dark:border-dark-border-primary',\n ] : [\n // Responsive: cambia según viewport\n 'w-full',\n 'h-full',\n 'shadow-none',\n 'rounded-none',\n 'border-0',\n 'md:w-[400px]',\n 'md:h-auto',\n 'md:rounded-2xl',\n 'md:shadow-lg',\n 'md:dark:shadow-2xl',\n 'md:overflow-clip',\n 'md:border',\n 'md:border-transparent',\n 'md:dark:border-dark-border-primary',\n ]),\n ].join(' ')}\n >\n {/* ===== LOGO ===== */}\n <div className=\"w-full flex flex-col items-center pb-4\">\n <img\n src=\"/.Siesa Logo.png\"\n alt=\"Siesa\"\n className=\"w-[200px] h-[50px] object-contain\"\n />\n </div>\n\n {/* ===== HEADING ===== */}\n <div className=\"w-full text-center\">\n <h1\n className={[\n 'text-[20px]',\n 'leading-[28px]',\n 'font-bold',\n 'tracking-[-0.5px]',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Crear Cuenta\n </h1>\n <p\n className={[\n 'text-[12px]',\n 'leading-[16px]',\n 'font-normal',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Ingresa todos los datos para crear tu cuenta.\n </p>\n </div>\n\n {/* ===== MENSAJE DE ERROR GENERAL ===== */}\n {errorMessage && (\n <div\n className={[\n 'w-full',\n 'p-3',\n 'bg-error-bg',\n 'dark:bg-error-bg',\n 'border',\n 'border-error-border',\n 'dark:border-error-border',\n 'rounded-md',\n 'text-error-content',\n 'dark:text-error-content',\n 'text-sm',\n ].join(' ')}\n role=\"alert\"\n >\n {errorMessage}\n </div>\n )}\n\n {/* ===== FORMULARIO ===== */}\n <form onSubmit={handleSubmit} className=\"w-full flex flex-col gap-2\">\n {/* Name Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <label\n htmlFor=\"name-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Nombre <span className=\"text-red-600\">*</span>\n </label>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <UserCircleIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"name-input\"\n type=\"text\"\n placeholder=\"Juan Pérez\"\n value={name}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setName(e.target.value)}\n disabled={isLoading}\n required\n autoComplete=\"name\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-3',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n ].join(' ')}\n />\n </div>\n </div>\n\n {/* Email Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <label\n htmlFor=\"email-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Correo Electrónico <span className=\"text-red-600\">*</span>\n </label>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <EnvelopeIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"email-input\"\n type=\"email\"\n placeholder=\"ejemplo@miempresa.com\"\n value={email}\n onChange={handleEmailChange}\n disabled={isLoading}\n required\n autoComplete=\"email\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-3',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n emailError ? 'border-error-border!' : '',\n ].filter(Boolean).join(' ')}\n />\n </div>\n {emailError && (\n <p className=\"text-xs text-error-content dark:text-error-content\">\n {emailError}\n </p>\n )}\n </div>\n\n {/* Password Input */}\n <div className=\"flex flex-col gap-2 w-full\">\n <label\n htmlFor=\"password-input\"\n className=\"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary\"\n >\n Contraseña <span className=\"text-red-600\">*</span>\n </label>\n <div className=\"relative\">\n <div className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\">\n <LockClosedIcon className=\"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary\" />\n </div>\n <input\n id=\"password-input\"\n type={showPassword ? 'text' : 'password'}\n placeholder=\"••••••••\"\n value={password}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.target.value)}\n disabled={isLoading}\n required\n autoComplete=\"new-password\"\n className={[\n 'w-full',\n 'pl-9',\n 'pr-10',\n 'py-1.5',\n 'text-base',\n 'leading-6',\n 'bg-bg-primary',\n 'dark:bg-dark-bg-primary',\n 'border',\n 'border-border-primary',\n 'dark:border-dark-border-primary',\n 'rounded-lg',\n 'placeholder:text-content-tertiary',\n 'dark:placeholder:text-dark-content-tertiary',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'focus:outline-hidden',\n 'focus:border-primary-custom-600',\n 'dark:focus:border-dark-border-custom',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-dark-border-custom',\n 'transition-all',\n 'duration-150',\n ].join(' ')}\n />\n <button\n type=\"button\"\n onClick={togglePasswordVisibility}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 opacity-50 hover:opacity-100 text-content-tertiary dark:text-dark-content-tertiary transition-opacity duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-dark-border-custom rounded-sm p-1\"\n aria-label={showPassword ? 'Ocultar contraseña' : 'Mostrar contraseña'}\n >\n <EyeIcon className=\"w-4 h-4\" />\n </button>\n </div>\n </div>\n\n {/* Submit Button */}\n <button\n type=\"submit\"\n disabled={isLoading || !name || !email || !password}\n className={[\n 'relative',\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-primary-inverse-content',\n 'dark:text-[#0e79fd]',\n 'bg-[#0e79fd]',\n 'dark:bg-dark-bg-inverse',\n 'border',\n 'border-[#3c9bf6]',\n 'dark:border-[#93d1fd]',\n 'rounded-md',\n 'shadow-button-inset',\n 'hover:bg-primary-custom-500',\n 'dark:hover:bg-[#93d1fd]',\n 'active:scale-95',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n 'disabled:opacity-50',\n 'disabled:cursor-not-allowed',\n ].join(' ')}\n >\n {isLoading ? 'Registrando...' : 'Registrarse'}\n </button>\n </form>\n\n {/* ===== SIGN IN LINK ===== */}\n <button\n type=\"button\"\n onClick={onSignIn}\n className={[\n 'w-full',\n 'px-2.5',\n 'py-1.5',\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'font-bold',\n 'text-sm',\n 'leading-5',\n 'text-[#0e79fd]',\n 'dark:text-[#93d1fd]',\n 'hover:bg-primary-custom-100',\n 'dark:hover:bg-[#93d1fd]/10',\n 'rounded-md',\n 'transition-all',\n 'duration-150',\n 'focus:outline-hidden',\n 'focus:ring-2',\n 'focus:ring-primary-custom-400',\n 'dark:focus:ring-[#93d1fd]',\n 'focus:ring-offset-2',\n 'dark:focus:ring-offset-[#3f3f46]',\n ].join(' ')}\n >\n Ya tengo una cuenta\n </button>\n\n {/* ===== TÉRMINOS Y CONDICIONES ===== */}\n <div className=\"w-full text-center\">\n <p\n className={[\n 'text-[12px]',\n 'leading-[16px]',\n 'font-normal',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Al registrarse, estás aceptando nuestras{' '}\n <button\n type=\"button\"\n onClick={onTermsClick}\n className=\"text-[#0e79fd] dark:text-[#93d1fd] underline hover:no-underline focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-[#93d1fd] rounded-sm\"\n >\n Condiciones de Uso\n </button>\n {' '}y nuestras{' '}\n <button\n type=\"button\"\n onClick={onPrivacyClick}\n className=\"text-[#0e79fd] dark:text-[#93d1fd] underline hover:no-underline focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-[#93d1fd] rounded-sm\"\n >\n Políticas de Privacidad\n </button>\n .\n </p>\n </div>\n </div>\n </div>\n );\n};\n","import React from 'react';\n\n/**\n * Iconos para TableLayoutView\n * Basados en Heroicons Micro (16x16px)\n */\n\n// Icono Plus (heroicons-micro/plus)\nexport const PlusIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z\" />\n </svg>\n);\n\n// Icono Arrows Pointing In (heroicons-micro/arrows-pointing-in)\nexport const ArrowsPointingInIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M2.22 2.22a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-.72-.72v2.69a.75.75 0 0 1-1.5 0V2.5c0-.69.56-1.25 1.25-1.25h4.75a.75.75 0 0 1 0 1.5H4.81l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06ZM9 2.75a.75.75 0 0 1 .75-.75h4.75C15.19 2 15.75 2.56 15.75 3.25v4.75a.75.75 0 0 1-1.5 0V5.31l-.72.72a.75.75 0 1 1-1.06-1.06l2-2a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-.72-.72V8a.75.75 0 0 1-1.5 0V3.5H9.75A.75.75 0 0 1 9 2.75ZM2.75 9a.75.75 0 0 1 .75.75v2.69l.72-.72a.75.75 0 1 1 1.06 1.06l-2 2a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 1 1 1.06-1.06l.72.72V9.75c0-.41.34-.75.75-.75Zm10.5 0a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-4.75c-.69 0-1.25-.56-1.25-1.25V9.75a.75.75 0 0 1 .75-.75Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n// Icono Arrows Pointing Out (heroicons-micro/arrows-pointing-out)\nexport const ArrowsPointingOutIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M2.75 2a.75.75 0 0 0-.75.75v3.5a.75.75 0 0 0 1.5 0V3.81l2.47 2.47a.75.75 0 1 0 1.06-1.06L4.56 2.75h2.69a.75.75 0 0 0 0-1.5h-4.5ZM9 2.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-2.69l2.47 2.47a.75.75 0 1 1-1.06 1.06L10.5 4.56v2.69a.75.75 0 0 1-1.5 0v-4.5ZM2.75 9a.75.75 0 0 1 .75.75v2.69l2.47-2.47a.75.75 0 1 1 1.06 1.06L4.56 13.5h2.69a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75v-4.5a.75.75 0 0 1 .75-.75Zm10.5 0a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75h-4.5a.75.75 0 0 1 0-1.5h2.69l-2.47-2.47a.75.75 0 1 1 1.06-1.06l2.47 2.47V9.75a.75.75 0 0 1 .75-.75Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n// Icono Arrow Right End On Rectangle (heroicons-micro/arrow-right-end-on-rectangle)\nexport const ArrowRightEndOnRectangleIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M2 4.75A2.75 2.75 0 0 1 4.75 2h3a2.75 2.75 0 0 1 2.75 2.75v.5a.75.75 0 0 1-1.5 0v-.5c0-.69-.56-1.25-1.25-1.25h-3c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h3c.69 0 1.25-.56 1.25-1.25v-.5a.75.75 0 0 1 1.5 0v.5A2.75 2.75 0 0 1 7.75 14h-3A2.75 2.75 0 0 1 2 11.25v-6.5Zm10.58 2.96-1.72-1.72a.75.75 0 1 1 1.06-1.06l2.78 2.78c.3.29.3.76 0 1.06l-2.78 2.78a.75.75 0 1 1-1.06-1.06l1.72-1.72H7.25a.75.75 0 0 1 0-1.5h5.33Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n// Icono Arrows Right Left (heroicons-micro/arrows-right-left)\nexport const ArrowsRightLeftIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M13.78 10.47a.75.75 0 0 1 0 1.06l-2.25 2.25a.75.75 0 1 1-1.06-1.06l.97-.97H5.75a.75.75 0 0 1 0-1.5h5.69l-.97-.97a.75.75 0 0 1 1.06-1.06l2.25 2.25ZM2.22 5.53a.75.75 0 0 1 0-1.06l2.25-2.25a.75.75 0 0 1 1.06 1.06l-.97.97h5.69a.75.75 0 0 1 0 1.5H4.56l.97.97a.75.75 0 1 1-1.06 1.06L2.22 5.53Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\n// Icono Rectangle Group (heroicons-micro/rectangle-group)\nexport const RectangleGroupIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M2.5 3.5h3v3h-3v-3ZM6.5 2a.5.5 0 0 0-.5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 0-.5-.5h-4ZM2.5 10.5h3v3h-3v-3ZM6.5 9a.5.5 0 0 0-.5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 0-.5-.5h-4ZM10.5 3.5h3v3h-3v-3ZM13.5 2h-3a.5.5 0 0 0-.5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 0-.5-.5h-.5ZM10.5 10.5h3v3h-3v-3Z\" />\n </svg>\n);\n\n// Icono X Mark (heroicons-micro/x-mark)\nexport const XMarkIcon: React.FC<{ className?: string }> = ({ className = '' }) => (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z\" />\n </svg>\n);\n","import React from 'react';\nimport type { TableLayoutViewProps } from './TableLayoutView.types';\nimport { Navbar } from '../../components/Navbar/Navbar';\nimport { POSLocationButton } from '../../components/POSLocationButton/POSLocationButton';\nimport { POSTable } from '../../components/POSTable/POSTable';\nimport { POSConvention } from '../../components/POSConvention/POSConvention';\nimport { POSNumberButton } from '../../components/POSNumberButton/POSNumberButton';\nimport { Switch } from '../../components/Switch/Switch';\nimport { Button } from '../../components/Button/Button';\nimport {\n PlusIcon,\n ArrowsPointingInIcon,\n ArrowsPointingOutIcon,\n ArrowRightEndOnRectangleIcon,\n ArrowsRightLeftIcon,\n RectangleGroupIcon,\n XMarkIcon,\n} from './icons';\n\n/**\n * TableLayoutView - Vista de layout de mesas para restaurante (POS)\n *\n * Vista completa pixel-perfect según especificaciones de Figma que incluye:\n * - Navbar superior con usuario y acciones\n * - Sidebar izquierdo con lista de salones/ubicaciones\n * - Área central con grid de mesas y controles\n * - Sidebar derecho con selector de cantidad de personas\n * - Leyenda de convenciones al pie del área central\n *\n * **Layout responsive:**\n * - Mobile: Columnas apiladas verticalmente\n * - Desktop: 3 columnas (sidebar izq 245px + centro flex + sidebar der 304px)\n *\n * **Mejores prácticas implementadas:**\n * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}\n * - Dark mode con estrategia 'class' (darkMode: 'class')\n * - Tokens de color consistentes con la documentación\n * - Type safety con TypeScript estricto\n * - Accesibilidad con ARIA labels\n * - Mobile-first responsive design\n *\n * @see docs/colors.md - Sistema de colores\n * @see docs/typography.md - Sistema tipográfico\n * @see docs/spacing.md - Sistema de espaciado\n * @see docs/shadows.md - Sistema de sombras\n *\n * @example\n * ```tsx\n * <TableLayoutView\n * locations={[\n * { id: '1', name: 'Antejardín', status: 'available', capacity: { current: 1, total: 8 } },\n * { id: '2', name: 'Terraza', status: 'occupied', capacity: { current: 8, total: 8 } },\n * ]}\n * tables={[\n * { tableNumber: '01', status: 'available', shape: 'square', chairs: 8, isActive: true },\n * { tableNumber: '02', status: 'available', shape: 'circle', chairs: 2 },\n * ]}\n * onTableSelect={(tableNum) => console.log('Mesa seleccionada:', tableNum)}\n * />\n * ```\n */\nexport const TableLayoutView: React.FC<TableLayoutViewProps> = ({\n locations = [],\n activeLocationId,\n tables = [],\n tablesTitle = 'Mesas de Antejardín',\n showPeopleCountPanel = false,\n selectedTable,\n onLocationSelect,\n onTableSelect,\n onCreateTables,\n onMergeTables,\n onSplitTables,\n onPeopleCountSelect,\n onAssignTable,\n onTransferTable,\n onSetCutlery,\n onClosePeoplePanel,\n onTableSwitchChange,\n isLoading = false,\n errorMessage,\n tableLayout = 'grid',\n className = '',\n userInfo,\n}) => {\n // ===== RENDER NAVBAR =====\n const renderNavbar = () => (\n <div className=\"w-full shrink-0\">\n <Navbar\n variant=\"desktop\"\n productName=\"\"\n userDropdown={\n userInfo\n ? {\n avatar: userInfo.avatar,\n name: userInfo.name,\n email: userInfo.role,\n onMenuClick: () => { },\n }\n : undefined\n }\n />\n </div>\n );\n\n // ===== RENDER SIDEBAR IZQUIERDO (SALONES) =====\n const renderLocationsSidebar = () => (\n <div\n className={[\n 'w-full',\n 'md:w-[245px]',\n 'h-auto',\n 'md:h-full',\n 'shrink-0',\n 'flex',\n 'flex-col',\n 'gap-2.5',\n 'p-4',\n 'overflow-auto',\n ].join(' ')}\n >\n {/* Título */}\n <div className=\"w-full\">\n <h2\n className={[\n 'text-xl',\n 'leading-7',\n 'font-bold',\n 'tracking-[-0.5px]',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Salones\n </h2>\n </div>\n\n {/* Lista de ubicaciones */}\n <div className=\"flex flex-col gap-2 w-full\">\n {isLoading ? (\n <div className=\"text-content-secondary dark:text-content-secondary text-sm\">\n Cargando salones...\n </div>\n ) : locations.length === 0 ? (\n <div className=\"text-content-secondary dark:text-content-secondary text-sm\">\n No hay salones disponibles\n </div>\n ) : (\n locations.map((location) => (\n <POSLocationButton\n key={location.id}\n locationName={location.name}\n status={location.status}\n state={location.id === activeLocationId ? 'actived' : 'enabled'}\n capacity={location.capacity}\n onClick={() => onLocationSelect?.(location.id)}\n />\n ))\n )}\n </div>\n </div>\n );\n\n // ===== RENDER ÁREA CENTRAL (MESAS) =====\n const renderTablesArea = () => (\n <div\n className={[\n 'flex-1',\n 'min-w-0',\n 'flex',\n 'flex-col',\n 'gap-4',\n 'p-4',\n 'bg-white',\n 'dark:bg-dark-bg-primary',\n 'rounded-tl-3xl',\n 'rounded-tr-3xl',\n 'overflow-auto',\n ].join(' ')}\n >\n {/* Header con título y botones */}\n <div className=\"flex flex-col md:flex-row gap-4 items-start md:items-center justify-between w-full\">\n {/* Título */}\n <h2\n className={[\n 'text-xl',\n 'leading-7',\n 'font-bold',\n 'tracking-[-0.5px]',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n 'flex-1',\n ].join(' ')}\n >\n {tablesTitle}\n </h2>\n\n {/* Botones de acción */}\n <div className=\"flex gap-2 flex-wrap\">\n <Button\n type=\"default\"\n size=\"sm\"\n leftIcon={<PlusIcon />}\n onClick={onCreateTables}\n >\n Crear Mesas\n </Button>\n <Button\n type=\"default\"\n size=\"sm\"\n leftIcon={<ArrowsPointingInIcon />}\n onClick={onMergeTables}\n >\n Unir Mesas\n </Button>\n <Button\n type=\"default\"\n size=\"sm\"\n leftIcon={<ArrowsPointingOutIcon />}\n onClick={onSplitTables}\n >\n Separar Mesas\n </Button>\n </div>\n </div>\n\n {/* Área de mesas */}\n <div\n className={[\n 'flex-1',\n 'bg-background-secondary',\n 'dark:bg-dark-bg-secondary',\n 'rounded-xl',\n 'p-4',\n 'overflow-auto',\n 'min-h-[400px]',\n ].join(' ')}\n >\n {isLoading ? (\n <div className=\"flex items-center justify-center h-full text-content-secondary dark:text-content-secondary\">\n Cargando mesas...\n </div>\n ) : errorMessage ? (\n <div className=\"flex items-center justify-center h-full text-error-content dark:text-error-content\">\n {errorMessage}\n </div>\n ) : tables.length === 0 ? (\n <div className=\"flex items-center justify-center h-full text-content-secondary dark:text-content-secondary\">\n No hay mesas en esta ubicación\n </div>\n ) : tableLayout === 'grid' ? (\n /* Layout Flexbox centrado con ancho máximo restringido para 4 columnas (160px * 4 + 8px * 3 = 664px) */\n <div className=\"flex flex-col items-center justify-center min-h-full w-full p-4\">\n <div className=\"flex flex-wrap gap-2 justify-center max-w-[664px]\">\n {tables.map((table) => (\n <POSTable\n key={table.tableNumber}\n tableNumber={table.tableNumber}\n status={table.status}\n shape={table.shape}\n chairs={table.chairs}\n isActive={table.isActive}\n onClick={() => onTableSelect?.(table.tableNumber)}\n />\n ))}\n </div>\n </div>\n ) : (\n /* Layout libre con posicionamiento absoluto */\n <div className=\"relative w-full h-full min-h-[400px]\">\n {tables.map((table) => (\n <div\n key={table.tableNumber}\n className=\"absolute\"\n style={\n table.position\n ? {\n left: `${table.position.x}%`,\n top: `${table.position.y}%`,\n transform: 'translate(-50%, -50%)',\n }\n : undefined\n }\n >\n <POSTable\n tableNumber={table.tableNumber}\n status={table.status}\n shape={table.shape}\n chairs={table.chairs}\n isActive={table.isActive}\n onClick={() => onTableSelect?.(table.tableNumber)}\n />\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Leyenda de convenciones */}\n <div className=\"flex flex-wrap gap-4 items-center w-full\">\n <POSConvention status=\"available\" />\n <POSConvention status=\"occupied\" />\n <POSConvention status=\"reserved\" />\n <POSConvention status=\"outOfService\" />\n </div>\n </div>\n );\n\n // ===== RENDER SIDEBAR DERECHO (SELECTOR DE PERSONAS) =====\n const renderPeopleCountSidebar = () => {\n if (!showPeopleCountPanel) return null;\n\n return (\n <div\n className={[\n 'w-full',\n 'md:w-[304px]',\n 'shrink-0',\n 'flex',\n 'flex-col',\n 'p-4',\n 'overflow-hidden',\n ].join(' ')}\n >\n {/* Header con switch y botón cerrar */}\n <div className=\"flex items-center justify-between w-full pb-4 border-b border-border-primary dark:border-dark-border-primary shrink-0\">\n <Switch\n label={selectedTable?.locationName || 'Ubicación'}\n description={selectedTable?.tableName || 'Mesa'}\n labelPosition=\"trailing\"\n checked={false}\n onChange={(e) => onTableSwitchChange?.(e.target.checked)}\n />\n <button\n className={[\n 'p-2',\n 'rounded-md',\n 'border',\n 'border-primary-custom-300',\n 'text-primary-custom-600',\n 'hover:bg-background-secondary',\n 'dark:border-dark-border-custom',\n 'dark:hover:bg-dark-bg-primary',\n 'transition-colors',\n ].join(' ')}\n onClick={onClosePeoplePanel}\n aria-label=\"Cerrar panel\"\n >\n <XMarkIcon className=\"w-4 h-4\" />\n </button>\n </div>\n\n {/* Body - Título, descripción y teclado numérico */}\n <div className=\"flex flex-col gap-2 w-full flex-1 overflow-auto pt-4\">\n {/* Título y descripción */}\n <div className=\"flex flex-col gap-1 w-full\">\n <h3\n className={[\n 'text-xl',\n 'leading-7',\n 'font-bold',\n 'tracking-[-0.5px]',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Tomar pedido\n </h3>\n <p\n className={[\n 'text-sm',\n 'leading-5',\n 'text-content-primary',\n 'dark:text-dark-content-primary',\n ].join(' ')}\n >\n Selecciona la cantidad de personas\n </p>\n </div>\n\n {/* Teclado numérico 3x3 */}\n <div className=\"grid grid-cols-3 gap-2 w-full mt-2\">\n {[1, 2, 3, 4, 5, 6, 7, 8].map((num) => (\n <POSNumberButton\n key={num}\n size=\"l\"\n border\n onClick={() => onPeopleCountSelect?.(num)}\n >\n {num}\n </POSNumberButton>\n ))}\n </div>\n </div>\n\n {/* Footer - Botones de acción FIJADOS AL BOTTOM con border-top */}\n <div className=\"flex flex-col gap-4 w-full pt-4 mt-auto shrink-0 grow-0 basis-auto border-t border-border-primary dark:border-dark-border-primary\">\n <Button\n type=\"default\"\n size=\"sm\"\n fullWidth\n leftIcon={<ArrowRightEndOnRectangleIcon />}\n onClick={onAssignTable}\n >\n Asignar\n </Button>\n <div className=\"flex gap-2 w-full\">\n <Button\n type=\"outline\"\n size=\"sm\"\n fullWidth\n leftIcon={<ArrowsRightLeftIcon />}\n onClick={onTransferTable}\n >\n Transferir\n </Button>\n <Button\n type=\"outline\"\n size=\"sm\"\n fullWidth\n leftIcon={<RectangleGroupIcon />}\n onClick={onSetCutlery}\n >\n Cubiertos\n </Button>\n </div>\n </div>\n </div>\n );\n };\n\n // ===== RENDER PRINCIPAL =====\n return (\n <div\n className={[\n 'flex',\n 'flex-col',\n 'w-full',\n 'min-h-screen',\n 'bg-background-secondary',\n 'dark:bg-dark-bg-primary',\n className,\n ].join(' ')}\n >\n {/* Navbar */}\n {renderNavbar()}\n\n {/* Contenedor principal con sidebars y área central */}\n <div className=\"flex flex-1 w-full overflow-hidden\">\n {/* Sidebar izquierdo - Salones */}\n {renderLocationsSidebar()}\n\n {/* Área central - Mesas */}\n {renderTablesArea()}\n\n {/* Sidebar derecho - Selector de personas (condicional) */}\n {renderPeopleCountSidebar()}\n </div>\n </div>\n );\n};\n","import React, { createContext, useContext, useEffect, useState } from 'react';\n\nexport type Theme = 'light' | 'dark';\n\ninterface ThemeContextType {\n theme: Theme;\n toggleTheme: () => void;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n defaultTheme?: Theme;\n}\n\n/**\n * ThemeProvider - Proveedor de contexto para el tema de la aplicación\n *\n * Maneja el estado del tema (light/dark) y lo persiste en localStorage.\n * Aplica la clase 'dark' al elemento HTML root cuando el tema es dark.\n *\n * @example\n * ```tsx\n * <ThemeProvider defaultTheme=\"light\">\n * <App />\n * </ThemeProvider>\n * ```\n */\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n children,\n defaultTheme = 'light'\n}) => {\n const [theme, setThemeState] = useState<Theme>(() => {\n // Intenta obtener el tema del localStorage\n if (typeof window !== 'undefined') {\n const savedTheme = localStorage.getItem('siesa-ui-theme') as Theme;\n return savedTheme || defaultTheme;\n }\n return defaultTheme;\n });\n\n useEffect(() => {\n // Aplica o remueve la clase 'dark' del elemento root\n const root = window.document.documentElement;\n\n if (theme === 'dark') {\n root.classList.add('dark');\n } else {\n root.classList.remove('dark');\n }\n\n // Guarda el tema en localStorage\n localStorage.setItem('siesa-ui-theme', theme);\n }, [theme]);\n\n const toggleTheme = () => {\n setThemeState((prev) => (prev === 'light' ? 'dark' : 'light'));\n };\n\n const setTheme = (newTheme: Theme) => {\n setThemeState(newTheme);\n };\n\n return (\n <ThemeContext.Provider value={{ theme, toggleTheme, setTheme }}>\n {children}\n </ThemeContext.Provider>\n );\n};\n\n/**\n * useTheme - Hook para acceder al contexto del tema\n *\n * @returns {ThemeContextType} Objeto con el tema actual y funciones para modificarlo\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { theme, toggleTheme } = useTheme();\n *\n * return (\n * <button onClick={toggleTheme}>\n * Tema actual: {theme}\n * </button>\n * );\n * }\n * ```\n */\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n\n if (context === undefined) {\n throw new Error('useTheme debe ser usado dentro de un ThemeProvider');\n }\n\n return context;\n};\n"],"names":["Button","type","size","iconOnly","leftIcon","rightIcon","children","disabled","className","onClick","htmlType","fullWidth","ariaLabel","badge","badgeCount","badgeColor","rest","sizeClasses","iconSizeClasses","textSizeClasses","typeClasses","baseClasses","widthClass","buttonClasses","renderIcon","icon","jsx","renderContent","jsxs","Fragment","badgeColorClasses","badgeColors","renderBadge","Input","forwardRef","label","labelSecondary","helperText","error","errorMessage","id","props","ref","inputId","baseInputClasses","interactiveClasses","errorClasses","containerClasses","existingClassName","cloneElement","Textarea","description","resize","rows","textareaId","baseTextareaClasses","resizeClasses","Checkbox","checked","indeterminate","onChange","inputRef","useRef","combinedRef","checkboxId","useEffect","checkboxClasses","Radio","value","name","radioId","baseRadioClasses","checkedClasses","Switch","labelPosition","switchId","baseTrackClasses","getTrackStateClasses","getButtonClasses","baseButtonClasses","positionClass","trackClasses","LabelContent","SwitchInput","Avatar","src","alt","initials","containerSizeClasses","Divider","finalClasses","DescriptionList","term","details","columnClasses","Alert","title","actions","onCancel","onConfirm","cancelText","confirmText","actionButtons","Badge","color","count","colors","Quantity","controlledValue","defaultValue","min","max","linkText","onLinkClick","internalValue","setInternalValue","useState","isControlled","currentValue","handleValueChange","newValue","clampedValue","handleDecrement","handleIncrement","isDecrementDisabled","isIncrementDisabled","MinusIcon","PlusIcon","borderClass","hoverClass","focusClass","NavigationRailItem","selected","onMouseEnter","onMouseLeave","showLabelText","showIcon","iconContainerClasses","iconClasses","labelClasses","ChevronDownIcon","Dropdown","variant","items","controlledOpen","onOpenChange","menuClassName","placeholder","renderTrigger","internalOpen","setInternalOpen","menuPosition","setMenuPosition","dropdownRef","menuRef","isOpen","calculateMenuPosition","useCallback","triggerRect","viewportWidth","viewportHeight","menuWidth","menuHeight","spaceBelow","spaceAbove","spaceRight","spaceLeft","openAbove","openLeft","handleToggle","newOpen","handleClickOutside","event","handleEscape","handleItemClick","item","triggerClasses","menuClasses","index","DropdownDivider","DropdownHeading","DropdownItem","shortcut","itemClasses","headingClasses","dividerClasses","DropdownItemCollapsible","defaultOpen","isCollapsible","showHeading","headingLabel","showDivider","setIsOpen","handleHeaderClick","e","handleChildClick","child","CogIcon","CheckIcon","XIcon","iconMap","getIcon","iconName","IconComponent","DropdownItemHeading","showDescription","actionLabel","showAction","onActionClick","Notification","colorClasses","dynamicAriaLabel","displayCount","ArrowLeftIcon","ArrowRightIcon","Pagination","currentPage","totalPages","onPageChange","backText","nextText","siblingCount","showBackButton","showNextButton","paginationRange","useMemo","totalBlocks","_","i","leftSiblingIndex","rightSiblingIndex","shouldShowLeftDots","shouldShowRightDots","firstPageIndex","lastPageIndex","leftItemCount","rightItemCount","rightRange","middleRange","handlePageChange","page","PageButton","isActive","buttonAriaLabel","isDots","titleId","svgRef","React","ForwardRef","ChevronUpDownIcon","ClockIcon","HeroChevronUpDown","HeroCheck","Select","options","showLabel","menuHeader","triggerClassName","required","selectedValue","setSelectedValue","focusedIndex","setFocusedIndex","containerRef","triggerRef","handleKeyDown","prev","handleSelect","selectedOption","opt","toggleMenu","option","finalTriggerClasses","finalMenuClasses","baseMenuItemClasses","getMenuItemClasses","isSelected","isFocused","hoverClasses","disabledClasses","checkIconClasses","NavigationRail","alignment","showFab","fabIcon","onFabClick","fabAriaLabel","selectedId","onItemSelect","wrapperClasses","itemsContainerClasses","fabClasses","NavigationRailPanel","height","width","heading","showSearch","search","sections","panelClassName","searchValue","setSearchValue","handleSearchChange","containerStyle","panelStyle","section","sectionIndex","itemIndex","NavigationRailPanelItem","ChevronLeftIcon","ChevronRightIcon","MagnifyingGlassIcon","HeroChevronRight","HeroChevronLeft","HeroClockOutline","HeroSearch","NavigationRailTypes","collapsed","showRecentButton","showSearchButton","onCollapsedChange","onItemClick","onItemHover","labels","searchQuery","setSearchQuery","finalLabels","handleCollapsedToggle","handleItemHover","idx","NavigationRailItemComponent","HeroMagnifyingGlass","NavigationRailGroup","state","onStateChange","showPanel","setShowPanel","panelType","setPanelType","hoveredItem","setHoveredItem","hideTimeoutRef","isCollapsed","handleCollapsedChange","commercialItem","handleItemHoverFromRail","handleItemMouseLeave","handlePanelMouseEnter","handlePanelMouseLeave","railItems","ChevronUpIcon","TableHeader","column","sortable","sorted","sortDirection","onSort","combinedClasses","TableCell","align","isStriped","rowIndex","alignClasses","stripedBg","previousLabel","nextLabel","pageNumbers","pages","Table","columns","data","showBorder","showShadow","externalSortColumn","externalSortDirection","emptyMessage","loading","loadingRows","pagination","internalSortColumn","setInternalSortColumn","internalSortDirection","setInternalSortDirection","sortColumn","handleSort","columnAccessor","newDirection","getCellValue","row","accessor","colIndex","content","Tab","active","contentBaseClasses","contentStateClasses","textClasses","badgeClasses","indicatorClasses","contentFinalClasses","Tabs","activeId","defaultActiveId","internalActiveId","setInternalActiveId","currentActiveId","handleTabClick","itemWidthClass","ShoppingCartIcon","BellIcon","ExclamationTriangleIcon","ArrowLeftStartOnRectangleIcon","Navbar","logo","productName","environmentBadge","userDropdown","notifications","hideActionButtons","showNavigationButton","navigationButtonProps","leadingAction","siesaLogo","showBusinessLogo","showSiesaLogoLeading","showSiesaLogoTrailing","onNavigationClick","onSearchClick","onCartClick","onNotificationsClick","actionButtonClasses","isMobile","isDesktop","isTablet","isResponsive","NavigationButton","defaultButtonProps","BusinessLogo","logoContent","SiesaLogoLeading","logoFull","logoMobile","SiesaLogoTrailing","responsive","dividerContent","ProductName","nameContent","EnvironmentBadge","SearchButton","CartButton","NotificationsButton","UserDropdown","userMenuItems","renderFullDropdown","NavigationBar","activeItemId","renderItem","itemContainerClasses","destinationsClasses","ConventionIcon","lightColor","darkColor","POSConvention","status","config","XMarkIcon","CalendarIcon","NoSymbolIcon","UsersIcon","POSLocationButton","locationName","capacity","StatusIcon","backgroundClasses","capacityText","POSNumberButton","border","POSProductButton","image","POSProductCard","price","buttonText","onAddClick","onCardClick","stateClasses","cardClasses","handleCardClick","handleButtonClick","TrashIcon","POSProductSidebarItems","categoryLabel","categoryColor","productRef","descriptionItems","quantity","minQuantity","maxQuantity","onQuantityChange","onDelete","deleteIcon","categoryColorClasses","handleQuantityChange","newQuantity","handleDelete","POSTable","tableNumber","shape","chairs","showChairs","statusColors","shapeClasses","Chair","rotation","handleClick","EnvelopeIcon","LockClosedIcon","EyeIcon","LoginView","onSubmit","onForgotPassword","onSignUp","isLoading","showBackground","email","setEmail","password","setPassword","showPassword","setShowPassword","emailError","setEmailError","handleSubmit","handleEmailChange","togglePasswordVisibility","UserCircleIcon","SignUpView","onSignIn","onTermsClick","onPrivacyClick","setName","toKebabCase","string","toCamelCase","match","p1","p2","toPascalCase","camelCase","mergeClasses","classes","array","hasA11yProp","prop","defaultAttributes","Icon","strokeWidth","absoluteStrokeWidth","iconNode","createElement","tag","attrs","createLucideIcon","Component","__iconNode","ChevronDown","LoaderCircle","Search","X","r","t","f","n","o","clsx","concatArrays","array1","array2","combinedArray","createClassValidatorObject","classGroupId","validator","createClassPartObject","nextPart","validators","CLASS_PART_SEPARATOR","EMPTY_CONFLICTS","ARBITRARY_PROPERTY_PREFIX","createClassGroupUtils","classMap","createClassMap","conflictingClassGroups","conflictingClassGroupModifiers","getGroupIdForArbitraryProperty","classParts","startIndex","getGroupRecursive","hasPostfixModifier","modifierConflicts","baseConflicts","classPartObject","currentClassPart","nextClassPartObject","result","classRest","validatorsLength","validatorObj","colonIndex","property","theme","classGroups","processClassGroups","group","processClassesRecursively","classGroup","len","classDefinition","processClassDefinition","processStringDefinition","processFunctionDefinition","processObjectDefinition","classPartObjectToEdit","getPart","isThemeGetter","entries","key","path","current","parts","part","next","func","createLruCache","maxCacheSize","cacheSize","cache","previousCache","update","IMPORTANT_MODIFIER","MODIFIER_SEPARATOR","EMPTY_MODIFIERS","createResultObject","modifiers","hasImportantModifier","baseClassName","maybePostfixModifierPosition","isExternal","createParseClassName","prefix","experimentalParseClassName","parseClassName","bracketDepth","parenDepth","modifierStart","postfixModifierPosition","currentCharacter","baseClassNameWithImportantModifier","fullPrefix","parseClassNameOriginal","createSortModifiers","modifierWeights","mod","currentSegment","modifier","isArbitrary","isOrderSensitive","createConfigUtils","SPLIT_CLASSES_REGEX","mergeClassList","classList","configUtils","getClassGroupId","getConflictingClassGroupIds","sortModifiers","classGroupsInConflict","classNames","originalClassName","variantModifier","modifierId","classId","conflictGroups","twJoin","classLists","argument","resolvedValue","toValue","mix","k","createTailwindMerge","createConfigFirst","createConfigRest","cacheGet","cacheSet","functionToCall","initTailwindMerge","previousConfig","createConfigCurrent","tailwindMerge","cachedResult","args","fallbackThemeArr","fromTheme","themeGetter","arbitraryValueRegex","arbitraryVariableRegex","fractionRegex","tshirtUnitRegex","lengthUnitRegex","colorFunctionRegex","shadowRegex","imageRegex","isFraction","isNumber","isInteger","isPercent","isTshirtSize","isAny","isLengthOnly","isNever","isShadow","isImage","isAnyNonArbitrary","isArbitraryValue","isArbitraryVariable","isArbitrarySize","getIsArbitraryValue","isLabelSize","isArbitraryLength","isLabelLength","isArbitraryNumber","isLabelNumber","isArbitraryPosition","isLabelPosition","isArbitraryImage","isLabelImage","isArbitraryShadow","isLabelShadow","isArbitraryVariableLength","getIsArbitraryVariable","isArbitraryVariableFamilyName","isLabelFamilyName","isArbitraryVariablePosition","isArbitraryVariableSize","isArbitraryVariableImage","isArbitraryVariableShadow","testLabel","testValue","shouldMatchNoLabel","getDefaultConfig","themeColor","themeFont","themeText","themeFontWeight","themeTracking","themeLeading","themeBreakpoint","themeContainer","themeSpacing","themeRadius","themeShadow","themeInsetShadow","themeTextShadow","themeDropShadow","themeBlur","themePerspective","themeAspect","themeEase","themeAnimate","scaleBreak","scalePosition","scalePositionWithArbitrary","scaleOverflow","scaleOverscroll","scaleUnambiguousSpacing","scaleInset","scaleGridTemplateColsRows","scaleGridColRowStartAndEnd","scaleGridColRowStartOrEnd","scaleGridAutoColsRows","scaleAlignPrimaryAxis","scaleAlignSecondaryAxis","scaleMargin","scaleSizing","scaleColor","scaleBgPosition","scaleBgRepeat","scaleBgSize","scaleGradientStopPosition","scaleRadius","scaleBorderWidth","scaleLineStyle","scaleBlendMode","scaleMaskImagePosition","scaleBlur","scaleRotate","scaleScale","scaleSkew","scaleTranslate","twMerge","cn","inputs","interpolateTemplate","template","record","fieldName","isExpressiveFilter","filter","buildExpressiveFilter","simpleFilter","normalizeFilters","filters","mergeFilters","DEBOUNCE_MS","useDebouncedSearch","delay","debouncedValue","setDebouncedValue","timer","useKeyboardNavigation","records","onSelect","onClose","onEscape","onClear","highlightedIndex","setHighlightedIndex","warn","i18n","code","msg","isString","alreadyWarned","warnOnce","loadedClb","cb","initialized","loadNamespaces","ns","loadLanguages","lng","hasLoadedNamespace","i18nInstance","loadNotPending","obj","isObject","matchHtmlEntity","htmlEntities","unescapeHtmlEntity","m","unescape","text","defaultOptions","getDefaults","getI18n","I18nContext","createContext","ReportNamespaces","namespaces","require$$0","is","x","y","objectIs","useLayoutEffect","useDebugValue","useSyncExternalStore$2","subscribe","getSnapshot","_useState","inst","forceUpdate","checkIfSnapshotChanged","latestGetSnapshot","nextValue","useSyncExternalStore$1","shim","useSyncExternalStoreShim_production","didWarnOld18Alpha","didWarnUncachedGetSnapshot","cachedValue","useSyncExternalStoreShim_development","shimModule","require$$1","notReadyT","optsOrDefaultValue","notReadySnapshot","dummySubscribe","useTranslation","i18nFromProps","i18nFromContext","defaultNSFromContext","useContext","i18nOptions","useSuspense","keyPrefix","nsOrContext","unstableNamespaces","revisionRef","callback","bindI18n","bindI18nStore","wrappedCallback","snapshotRef","calculatedReady","currentLng","currentRevision","lastSnapshot","newSnapshot","loadCount","setLoadCount","ready","useSyncExternalStore","onLoaded","c","finalI18n","wrapperRef","wrapperLangRef","createI18nWrapper","original","descriptors","wrapper","ret","lang","i18nWrapper","arr","resolve","FALLBACK_STRINGS","interpolate","params","useTranslationSafe","i18nT","useClickOutside","handler","enabled","hasWindow","getNodeName","node","isNode","getWindow","_node$ownerDocument","getDocumentElement","_ref","isElement","isHTMLElement","isShadowRoot","invalidOverflowDisplayValues","isOverflowElement","element","overflow","overflowX","overflowY","display","getComputedStyle","tableElements","isTableElement","topLayerSelectors","isTopLayer","selector","transformProperties","willChangeValues","containValues","isContainingBlock","elementOrCss","webkit","isWebKit","css","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","lastTraversableNodeNames","getNodeScroll","getNearestOverflowAncestor","parentNode","getOverflowAncestors","list","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","frameElement","getFrameElement","round","floor","createCoords","v","oppositeSideMap","oppositeAlignmentMap","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","yAxisSides","getSideAxis","getAlignmentAxis","getAlignmentSides","rects","rtl","alignmentAxis","length","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getSideList","side","isStart","getOppositeAxisPlacements","flipAlignment","direction","expandPaddingObject","padding","getPaddingObject","rectToClientRect","rect","isClient","noop","SafeReact","useInsertionEffect","useSafeInsertionEffect","fn","useEffectEvent","_len","_key","computeCoordsFromPlacement","reference","floating","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","computePosition","strategy","middleware","platform","validMiddleware","statefulPlacement","middlewareData","resetCount","nextX","nextY","reset","detectOverflow","_await$platform$isEle","elements","boundary","rootBoundary","elementContext","altBoundary","paddingObject","clippingClientRect","offsetParent","offsetScale","elementClientRect","flip","_middlewareData$arrow","_middlewareData$flip","initialPlacement","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","detectOverflowOptions","initialSideAxis","isBasePlacement","fallbackPlacements","hasFallbackAxisSideDirection","placements","overflows","overflowsData","sides","_middlewareData$flip2","_overflowsData$filter","nextIndex","nextPlacement","d","resetPlacement","a","b","_overflowsData$filter2","currentSideAxis","acc","originSides","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","offset","_middlewareData$offse","diffCoords","_state$middlewareData","_state$middlewareData2","apply","isYAxis","heightSide","widthSide","maximumClippingHeight","maximumClippingWidth","overflowAvailableHeight","overflowAvailableWidth","noShift","availableHeight","availableWidth","xMin","xMax","yMin","yMax","nextDimensions","getCssDimensions","getComputedStyle$1","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","getScale","domElement","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","left","top","getWindowScrollBarX","leftScroll","getHTMLOffset","documentElement","scroll","htmlRect","convertOffsetParentRelativeRectToViewportRelativeRect","topLayer","offsets","isOffsetParentAnElement","offsetRect","htmlOffset","getClientRects","getDocumentRect","html","body","SCROLLBAR_MAX","getViewportRect","visualViewport","visualViewportBased","windowScrollbarX","doc","bodyStyles","bodyMarginInline","clippingStableScrollbarWidth","absoluteOrFixed","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","hasFixedPositionAncestor","stopNode","getClippingElementAncestors","el","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","ancestor","getClippingRect","clippingAncestors","firstClippingAncestor","clippingRect","accRect","getDimensions","getRectRelativeToOffsetParent","setLeftRTLScrollbarOffset","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","getOffsetParent","svgOffsetParent","getElementRects","getOffsetParentFn","getDimensionsFn","floatingDimensions","isRTL","rectsAreEqual","observeMove","onMove","io","timeoutId","root","cleanup","_io","refresh","skip","threshold","elementRectForRootMargin","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","ratio","autoUpdate","ancestorScroll","ancestorResize","elementResize","layoutShift","animationFrame","referenceEl","ancestors","cleanupIo","reobserveFrame","resizeObserver","firstEntry","_resizeObserver","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset$1","flip$1","size$1","mergedOptions","platformWithCache","computePosition$1","deepEqual","keys","getDPR","roundByDPR","dpr","useLatestRef","useFloating","externalReference","externalFloating","transform","whileElementsMounted","open","setData","latestMiddleware","setLatestMiddleware","_reference","_setReference","_floating","_setFloating","setReference","referenceRef","setFloating","floatingRef","floatingEl","dataRef","hasWhileElementsMounted","whileElementsMountedRef","platformRef","openRef","fullData","isMountedRef","ReactDOM","refs","floatingStyles","initialStyles","deps","serverHandoffComplete","genId","useFloatingId","setId","useModernLayoutEffect","useReactId","useId","devMessageSet","_devMessageSet3","_len2","messages","_key2","message","_devMessageSet4","createEventEmitter","map","_map$get","listener","_map$get2","FloatingNodeContext","FloatingTreeContext","useFloatingParentNodeId","_React$useContext","useFloatingTree","useFloatingRootContext","onOpenChangeProp","elementsProp","floatingId","events","nested","optionDomReference","positionReference","setPositionReference","reason","nodeId","internalRootContext","rootContext","computedElements","_domReference","setDomReference","_setPositionReference","domReference","domReferenceRef","tree","position","useFloating$1","computedPositionReference","context","useFloatingDropdown","offsetPx","memo","getDeps","opts","isInitial","memoizedFunction","_a","_b","_c","depTime","newDeps","dep","resultTime","depEndTime","resultEndTime","resultFpsPercentage","pad","str","num","notUndefined","approxEqual","debounce","targetWindow","ms","getRect","defaultKeyExtractor","defaultRangeExtractor","range","start","end","observeElementRect","instance","observer","run","entry","box","addEventListenerOptions","supportsScrollend","observeElementOffset","fallback","createHandler","isScrolling","horizontal","isRtl","endHandler","registerScrollendEvent","measureElement","elementScroll","adjustments","behavior","toOffset","Virtualizer","_ro","get","target","opts2","sync","scrollElement","cached","measurements","furthestMeasurementsFound","furthestMeasurements","measurement","previousFurthestMeasurement","paddingStart","scrollMargin","getItemKey","lanes","itemSizeCache","laneLastIndex","cachedLane","lane","prevIndex","prevInLane","furthestMeasurement","measuredSize","outerSize","scrollOffset","calculateRange","endIndex","rangeExtractor","overscan","attributeName","indexStr","prevNode","itemSize","delta","indexes","virtualItems","findNearestBinarySearch","maxOffset","initialAlign","attempts","maxAttempts","tryScroll","currentAlign","offsetInfo","verify","currentOffset","afterInfo","scheduleRetry","endByLane","val","low","high","getCurrentValue","middle","lastIndex","getOffset","endPerLane","pos","startPerLane","useIsomorphicLayoutEffect","useVirtualizerBase","useFlushSync","rerender","resolvedOptions","instance2","flushSync","useVirtualizer","DEFAULT_OPTION_HEIGHT_PX","DEFAULT_OVERSCAN","useVirtualList","parentRef","estimateSize","virtualizer","SearchInput","listboxId","activeDescendantId","handleClear","LiveRegion","DEFAULT_PAGE_SIZE","SCROLL_THRESHOLD_PX","DEFAULT_MIN_CHARS","LookupFieldInner","entity","displayFields","fetcher","clearable","pageSize","onError","searchFields","minChars","displayValue","displayTemplate","renderSelected","getFilters","dependencies","orderBy","bindFields","readOnly","onFocusProp","onBlurProp","onReady","onInvalidValue","noResultsText","searchPlaceholder","showRequiredIndicator","validateOnBlur","onValidationChange","effectiveOrderBy","setIsLoading","apiError","setApiError","setRecords","selectedRecord","setSelectedRecord","setCurrentPage","hasMorePages","setHasMorePages","isLoadingMore","setIsLoadingMore","abortControllerRef","previousRecordRef","previousDependenciesRef","optionsRef","searchInputRef","debouncedSearchQuery","announcement","setAnnouncement","hasCalledOnReadyRef","selectedRecordRef","componentRef","isFocusWithinRef","onInvalidValueRef","floatingRefs","totalSize","isInvalidValue","setIsInvalidValue","validationError","setValidationError","cachedRecords","setCachedRecords","cachedScrollPosition","setCachedScrollPosition","cachedCurrentPage","setCachedCurrentPage","cacheValid","setCacheValid","cachedSearchQueryRef","isRestoringCacheRef","currentPageRef","showError","effectiveShowRequiredIndicator","onValidationChangeRef","getEffectiveFilters","fetchRecords","controller","effectiveFilters","allFields","response","imperativeRef","err","fetchError","fetchMoreRecords","actualCurrentPage","nextPage","fetchAndSetRecordById","recordId","performValidation","handleScroll","container","scrollTop","scrollHeight","clientHeight","previousValueRef","fetchAndSetRecordByIdRef","valueSyncRequestIdRef","valueChanged","currentRequestId","dependenciesKey","filtersKey","previousFiltersRef","getSelectedDisplay","field","handleTriggerClick","getOptionDisplay","handleSelectRecord","justSelectedRef","displayText","handleKeyboardClear","handleClose","isTabNavigatingRef","allTabbable","componentIndex","nextElement","handleEscapeClose","handleImperativeClear","useImperativeHandle","highlightedOption","wasClickedRef","handleTriggerMouseDown","handleTriggerKeyDown","handleTriggerFocus","handleComponentFocus","handleComponentBlur","relatedTarget","renderDropdownContent","Loader2","useVirtualizedRendering","virtualItem","LookupField","ApiError","statusText","DEFAULT_HEADERS","createFetcher","baseUrl","headers","request","url","fields","LayoutBase","siesaLogoPath","siesaLogoWidth","siesaLogoHeight","navigationItems","contentClassName","navbarProps","navigationRailProps","navState","setNavState","handleNavStateChange","HomeIcon","GlobeAltIcon","DocumentTextIcon","CloudIcon","SquaresPlusIcon","ListBulletIcon","FunnelIcon","ListView","navbarProductName","tableTitle","quickFilters","showNavigationRail","navigationRailState","onNavigationRailStateChange","onNavItemClick","onSearch","viewOptions","selectedViewOption","onViewOptionChange","showViewDropdown","setShowViewDropdown","defaultNavigationItems","defaultQuickFilters","defaultActionButtons","handleSearch","tableColumns","col","btn","ProductsView","changeTableLabel","menusTitle","menus","selectedMenuId","onMenuSelect","onChangeTable","categoryTitle","categories","selectedCategoryId","onCategorySelect","productsTitle","products","onAddProduct","activeTab","onTabChange","orderItems","onOrderItemQuantityChange","onOrderItemDelete","subtotal","taxes","total","confirmLabel","onConfirmOrder","userAvatar","userName","userRole","businessLogo","menu","category","product","qty","RecoverPasswordView","onBackToLogin","successMessage","ArrowsPointingInIcon","ArrowsPointingOutIcon","ArrowRightEndOnRectangleIcon","ArrowsRightLeftIcon","RectangleGroupIcon","TableLayoutView","locations","activeLocationId","tables","tablesTitle","showPeopleCountPanel","selectedTable","onLocationSelect","onTableSelect","onCreateTables","onMergeTables","onSplitTables","onPeopleCountSelect","onAssignTable","onTransferTable","onSetCutlery","onClosePeoplePanel","onTableSwitchChange","tableLayout","userInfo","renderNavbar","renderLocationsSidebar","location","renderTablesArea","table","renderPeopleCountSidebar","ThemeContext","ThemeProvider","defaultThe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