@proyecto-viviana/solidaria-components 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -272
- package/dist/ActionBar.d.ts +21 -13
- package/dist/ActionBar.d.ts.map +1 -1
- package/dist/ActionGroup.d.ts +8 -8
- package/dist/ActionGroup.d.ts.map +1 -1
- package/dist/Alert.d.ts +5 -5
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Autocomplete.d.ts +5 -5
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Breadcrumbs.d.ts +18 -7
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Button.d.ts +24 -5
- package/dist/Button.d.ts.map +1 -1
- package/dist/Calendar.d.ts +38 -7
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Checkbox.d.ts +32 -7
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Collection.d.ts +19 -14
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Color.d.ts +103 -14
- package/dist/Color.d.ts.map +1 -1
- package/dist/ColorEditor.d.ts +6 -6
- package/dist/ColorEditor.d.ts.map +1 -1
- package/dist/ComboBox.d.ts +85 -19
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ContextualHelpTrigger.d.ts +2 -2
- package/dist/ContextualHelpTrigger.d.ts.map +1 -1
- package/dist/DateField.d.ts +8 -6
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DatePicker.d.ts +53 -22
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DateRangePickerContext.d.ts +30 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -0
- package/dist/Dialog.d.ts +5 -5
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Disclosure.d.ts +23 -5
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/DragAndDrop.d.ts +6 -6
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragPreview.d.ts +2 -2
- package/dist/DragPreview.d.ts.map +1 -1
- package/dist/DropZone.d.ts +4 -4
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/FieldError.d.ts +9 -5
- package/dist/FieldError.d.ts.map +1 -1
- package/dist/FileTrigger.d.ts +3 -3
- package/dist/FileTrigger.d.ts.map +1 -1
- package/dist/Focusable.d.ts +2 -2
- package/dist/Focusable.d.ts.map +1 -1
- package/dist/Form.d.ts +18 -4
- package/dist/Form.d.ts.map +1 -1
- package/dist/GridList.d.ts +32 -12
- package/dist/GridList.d.ts.map +1 -1
- package/dist/HiddenDateInput.d.ts +26 -0
- package/dist/HiddenDateInput.d.ts.map +1 -0
- package/dist/HiddenTimeInput.d.ts +25 -0
- package/dist/HiddenTimeInput.d.ts.map +1 -0
- package/dist/Icon.d.ts +5 -5
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Keyboard.d.ts +1 -1
- package/dist/Landmark.d.ts +3 -3
- package/dist/Landmark.d.ts.map +1 -1
- package/dist/Link.d.ts +10 -4
- package/dist/Link.d.ts.map +1 -1
- package/dist/ListBox.d.ts +32 -12
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListDropTargetDelegate.d.ts +6 -6
- package/dist/ListDropTargetDelegate.d.ts.map +1 -1
- package/dist/Menu.d.ts +65 -14
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Meter.d.ts +3 -3
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Modal.d.ts +5 -5
- package/dist/Modal.d.ts.map +1 -1
- package/dist/NumberField.d.ts +8 -12
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/Popover.d.ts +28 -5
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Pressable.d.ts +2 -2
- package/dist/Pressable.d.ts.map +1 -1
- package/dist/ProgressBar.d.ts +5 -3
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/RadioGroup.d.ts +43 -9
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RangeCalendar.d.ts +34 -7
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RouterProvider.d.ts +2 -2
- package/dist/RouterProvider.d.ts.map +1 -1
- package/dist/SearchField.d.ts +23 -20
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/Select.d.ts +41 -11
- package/dist/Select.d.ts.map +1 -1
- package/dist/SelectionIndicator.d.ts +3 -3
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/Separator.d.ts +9 -3
- package/dist/Separator.d.ts.map +1 -1
- package/dist/SharedElementTransition.d.ts +6 -4
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/Slider.d.ts +12 -8
- package/dist/Slider.d.ts.map +1 -1
- package/dist/StepList.d.ts +90 -0
- package/dist/StepList.d.ts.map +1 -0
- package/dist/Switch.d.ts +11 -5
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Table.d.ts +187 -23
- package/dist/Table.d.ts.map +1 -1
- package/dist/Tabs.d.ts +45 -9
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/TagGroup.d.ts +12 -10
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/Text.d.ts +2 -2
- package/dist/TextField.d.ts +15 -11
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TimeField.d.ts +6 -6
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/Toast.d.ts +29 -14
- package/dist/Toast.d.ts.map +1 -1
- package/dist/ToggleButton.d.ts +11 -5
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.d.ts +7 -7
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/Toolbar.d.ts +7 -3
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Tooltip.d.ts +50 -8
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tree.d.ts +66 -17
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Virtualizer.d.ts +12 -12
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/VirtualizerLayouts.d.ts +2 -2
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.d.ts +1 -1
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/contexts.d.ts +5 -1
- package/dist/contexts.d.ts.map +1 -1
- package/dist/index.d.ts +73 -71
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23247 -18564
- package/dist/index.js.map +1 -1
- package/dist/index.jsx +18110 -0
- package/dist/index.jsx.map +1 -0
- package/dist/useDragAndDrop.d.ts +13 -13
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/virtualizer/Layout.d.ts +1 -1
- package/dist/virtualizer/Layout.d.ts.map +1 -1
- package/package.json +31 -32
- package/src/ActionBar.tsx +75 -72
- package/src/ActionGroup.tsx +53 -61
- package/src/Alert.tsx +17 -42
- package/src/Autocomplete.tsx +39 -44
- package/src/Breadcrumbs.tsx +149 -80
- package/src/Button.tsx +267 -70
- package/src/Calendar.tsx +218 -138
- package/src/Checkbox.tsx +413 -121
- package/src/Collection.tsx +67 -58
- package/src/Color.tsx +803 -380
- package/src/ColorEditor.tsx +131 -149
- package/src/ComboBox.tsx +414 -249
- package/src/ContextualHelpTrigger.tsx +86 -74
- package/src/DateField.tsx +185 -91
- package/src/DatePicker.tsx +524 -213
- package/src/DateRangePickerContext.tsx +44 -0
- package/src/Dialog.tsx +156 -118
- package/src/Disclosure.tsx +127 -80
- package/src/DragAndDrop.tsx +60 -54
- package/src/DragPreview.tsx +13 -11
- package/src/DropZone.tsx +42 -22
- package/src/FieldError.tsx +45 -23
- package/src/FileTrigger.tsx +19 -19
- package/src/Focusable.tsx +21 -24
- package/src/Form.tsx +71 -16
- package/src/GridList.tsx +273 -197
- package/src/HiddenDateInput.tsx +153 -0
- package/src/HiddenTimeInput.tsx +133 -0
- package/src/Icon.tsx +22 -43
- package/src/Keyboard.tsx +3 -3
- package/src/Landmark.tsx +37 -63
- package/src/Link.tsx +125 -75
- package/src/ListBox.tsx +332 -233
- package/src/ListDropTargetDelegate.ts +81 -80
- package/src/Menu.tsx +1023 -274
- package/src/Meter.tsx +38 -56
- package/src/Modal.tsx +243 -175
- package/src/NumberField.tsx +139 -143
- package/src/Popover.tsx +386 -233
- package/src/Pressable.tsx +21 -21
- package/src/ProgressBar.tsx +48 -57
- package/src/RadioGroup.tsx +524 -122
- package/src/RangeCalendar.tsx +157 -90
- package/src/RouterProvider.tsx +30 -47
- package/src/SearchField.tsx +362 -143
- package/src/Select.tsx +656 -233
- package/src/SelectionIndicator.tsx +18 -15
- package/src/Separator.tsx +47 -49
- package/src/SharedElementTransition.tsx +103 -97
- package/src/Slider.tsx +138 -98
- package/src/StepList.tsx +272 -0
- package/src/Switch.tsx +93 -46
- package/src/Table.tsx +1308 -342
- package/src/Tabs.tsx +324 -103
- package/src/TagGroup.tsx +139 -126
- package/src/Text.tsx +3 -3
- package/src/TextField.tsx +389 -79
- package/src/TimeField.tsx +136 -76
- package/src/Toast.tsx +209 -157
- package/src/ToggleButton.tsx +47 -37
- package/src/ToggleButtonGroup.tsx +39 -34
- package/src/Toolbar.tsx +54 -69
- package/src/Tooltip.tsx +387 -119
- package/src/Tree.tsx +651 -368
- package/src/Virtualizer.tsx +208 -180
- package/src/VirtualizerLayouts.ts +45 -30
- package/src/VisuallyHidden.tsx +19 -19
- package/src/contexts.ts +29 -37
- package/src/index.ts +110 -195
- package/src/useDragAndDrop.ts +87 -71
- package/src/utils.tsx +40 -55
- package/src/virtualizer/Layout.ts +14 -22
- package/dist/index.ssr.js +0 -16996
- package/dist/index.ssr.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.jsx","names":["mergeProps","clamp","getSafeRange","assignRef","mergeProps","mergeProps","assignRef","mergeProps","assignRef","FormValidationContext","assignRef","withFormValidationBehavior","mergeProps","assignRef","mergeProps","withFormValidationBehavior","eventWithCurrentTarget","clearDelegatedTextEntryHandlers","mergeProps","assignRef","assignRef","AriaCollectionBuilder","AriaCollection","assignRef","assignRef","mergeProps","assignRef","mergeProps","assignRef","mergeProps","assignRef","tab","assignRef","resolveChildren","mergeProps","withFormValidationBehavior","mergeProps","mergeProps","clamp","assignRef","mergeProps","assignRef","mergeProps","assignRef","assignRef","accessValue","withFormValidationBehavior","withFormValidationBehavior","assignRef","mergeProps","isFocusVisible","isGlobalFocusVisible","assignRef","mergeProps","assignRef","mergeProps","mergeProps","getColorChannels","resolveChildren","resolveChildren"],"sources":["../src/utils.tsx","../src/VisuallyHidden.tsx","../src/contexts.ts","../src/ProgressBar.tsx","../src/Button.tsx","../src/Switch.tsx","../src/ToggleButtonGroup.tsx","../src/ToggleButton.tsx","../src/Form.tsx","../src/Checkbox.tsx","../src/FieldError.tsx","../src/SharedElementTransition.tsx","../src/SelectionIndicator.tsx","../src/RadioGroup.tsx","../src/TextField.tsx","../src/Text.tsx","../src/RouterProvider.tsx","../src/Link.tsx","../src/Keyboard.tsx","../src/FileTrigger.tsx","../src/DropZone.tsx","../src/virtualizer/Layout.ts","../src/Collection.tsx","../src/VirtualizerLayouts.ts","../src/Virtualizer.tsx","../src/Separator.tsx","../src/Toolbar.tsx","../src/Autocomplete.tsx","../src/DragAndDrop.tsx","../src/ListBox.tsx","../src/Menu.tsx","../src/Select.tsx","../src/Tabs.tsx","../src/DragPreview.tsx","../src/ListDropTargetDelegate.ts","../src/useDragAndDrop.ts","../src/Breadcrumbs.tsx","../src/NumberField.tsx","../src/SearchField.tsx","../src/Slider.tsx","../src/Tooltip.tsx","../src/ComboBox.tsx","../src/Dialog.tsx","../src/Modal.tsx","../src/Popover.tsx","../src/Toast.tsx","../src/Disclosure.tsx","../src/Meter.tsx","../src/TagGroup.tsx","../src/Calendar.tsx","../src/RangeCalendar.tsx","../src/HiddenDateInput.tsx","../src/DateRangePickerContext.tsx","../src/DateField.tsx","../src/HiddenTimeInput.tsx","../src/TimeField.tsx","../src/DatePicker.tsx","../src/Table.tsx","../src/GridList.tsx","../src/Tree.tsx","../src/Color.tsx","../src/ContextualHelpTrigger.tsx","../src/ColorEditor.tsx","../src/StepList.tsx","../src/Landmark.tsx","../src/ActionBar.tsx","../src/ActionGroup.tsx","../src/Alert.tsx","../src/Icon.tsx","../src/Focusable.tsx","../src/Pressable.tsx"],"sourcesContent":["/**\n * Utility functions for solidaria-components\n * Port of react-aria-components/src/utils.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n type FlowComponent,\n type ParentComponent,\n createContext,\n useContext,\n createMemo,\n createSignal,\n onMount,\n Show,\n} from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\n\n/**\n * Render props pattern - children can be a function that receives state\n */\nexport type RenderChildren<T> = JSX.Element | ((renderProps: T) => JSX.Element);\n\n/**\n * Class name can be a string or a function that computes based on state\n */\nexport type ClassNameOrFunction<T> = string | ((renderProps: T) => string);\n\n/**\n * Style can be an object or a function that computes based on state\n */\nexport type StyleOrFunction<T> = JSX.CSSProperties | ((renderProps: T) => JSX.CSSProperties);\n\n/**\n * Common render props interface\n */\nexport interface RenderPropsBase<T> {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<T>;\n /** The CSS className for the element. A function may be provided to compute the class based on state. */\n class?: ClassNameOrFunction<T>;\n /** The inline style for the element. A function may be provided to compute the style based on state. */\n style?: StyleOrFunction<T>;\n}\n\n/**\n * Slot props for named slots\n */\nexport interface SlotProps {\n /** A slot name for the component. */\n slot?: string;\n}\n\nexport const DEFAULT_SLOT = \"default\";\n\n/**\n * Return type for useRenderProps\n */\nexport interface RenderPropsResult<T> {\n /** Accessor for class - safe to call anytime */\n class: Accessor<string>;\n /** Accessor for style - safe to call anytime */\n style: Accessor<JSX.CSSProperties | undefined>;\n /**\n * Render the children. This is a function that returns JSX, NOT a getter.\n * For SSR compatibility, this should be called within the JSX tree.\n *\n * Usage in components:\n * {renderProps.renderChildren()}\n *\n * Or if you need the raw children/function:\n * {renderProps.renderChildren()}\n */\n renderChildren: () => JSX.Element;\n /** The raw children prop (function or JSX) - use renderChildren() in most cases */\n children: RenderChildren<T> | undefined;\n /** The render props values accessor */\n values: Accessor<T>;\n}\n\n/**\n * Resolves render props (children, class, style) based on component state.\n *\n * For SSR compatibility, children are NOT evaluated eagerly. Instead:\n * - Use `renderChildren()` to render children with current values\n * - Or access `children` directly if you need the raw prop\n *\n * This avoids the getter pattern that causes SSR hydration mismatches.\n */\nexport function useRenderProps<T extends object>(\n props: RenderPropsBase<T> & { defaultClassName?: string },\n values: Accessor<T>,\n): RenderPropsResult<T> {\n // Don't destructure children — access lazily to avoid eager evaluation\n // that would trigger child component creation before context providers mount.\n const { class: className, style, defaultClassName = \"\" } = props;\n\n // Compute class and style eagerly (they don't depend on context)\n const computedClass = createMemo(() => {\n const currentValues = values();\n return typeof className === \"function\"\n ? className(currentValues)\n : (className ?? defaultClassName);\n });\n\n const computedStyle = createMemo(() => {\n const currentValues = values();\n return typeof style === \"function\" ? style(currentValues) : style;\n });\n\n // Return object with explicit function for rendering children\n // Children are accessed lazily during render (inside context providers)\n return {\n class: computedClass,\n style: computedStyle,\n renderChildren: () => {\n const currentValues = values();\n const children = props.children;\n return typeof children === \"function\" ? children(currentValues) : children;\n },\n get children() {\n return props.children;\n },\n values,\n };\n}\n\nexport function composeRenderProps<T extends object>(\n base: RenderPropsBase<T> | undefined,\n override: RenderPropsBase<T> | undefined,\n): RenderPropsBase<T> {\n if (!base) return override ?? {};\n if (!override) return base;\n return {\n children: override.children ?? base.children,\n class: override.class ?? base.class,\n style: override.style ?? base.style,\n };\n}\n\n/**\n * Context value that can be null or the actual value\n */\nexport type ContextValue<T> = T | null;\n\n/**\n * Creates a context with props and ref merging support\n */\nexport function createSlottedContext<T>() {\n return createContext<T | null>(null);\n}\n\n/**\n * Use context with null check\n */\nexport function useSlottedContext<T>(\n context: ReturnType<typeof createContext<T | null>>,\n): T | null {\n return useContext(context);\n}\n\nexport function useContextProps<TProps extends object, TRef>(\n props: TProps,\n ref: TRef,\n context?: ContextValue<Partial<TProps>>,\n): [TProps, TRef] {\n if (!context) return [props, ref];\n return [{ ...(context as TProps), ...props }, ref];\n}\n\nexport const Provider: ParentComponent<{\n values: Array<[ReturnType<typeof createContext<unknown>>, unknown]>;\n}> = (props) => {\n return props.children;\n};\n\n/**\n * Converts boolean state values to data attributes\n */\nexport function dataAttr(value: boolean | undefined): \"\" | undefined {\n return value ? \"\" : undefined;\n}\n\n/**\n * Creates data attributes from render props\n */\nexport function createDataAttributes<T extends Record<string, boolean | string | undefined>>(\n values: T,\n): Record<string, string | undefined> {\n const result: Record<string, string | undefined> = {};\n\n for (const [key, value] of Object.entries(values)) {\n if (typeof value === \"boolean\") {\n result[`data-${camelToKebab(key)}`] = value ? \"\" : undefined;\n } else if (value !== undefined) {\n result[`data-${camelToKebab(key)}`] = value;\n }\n }\n\n return result;\n}\n\nfunction camelToKebab(str: string): string {\n return str.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n}\n\n/**\n * Remove data attributes from props (for internal use)\n */\nexport function removeDataAttributes<T extends Record<string, unknown>>(props: T): T {\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(props)) {\n if (!key.startsWith(\"data-\")) {\n result[key] = value;\n }\n }\n\n return result as T;\n}\n\n/**\n * Filter DOM props - keep only valid DOM attributes.\n *\n * @param props - Component props to filter\n * @param options - Options for filtering (global: include global attrs)\n * @returns Object containing only valid DOM props. Use type parameter R to specify return type.\n */\nexport function filterDOMProps<R extends object = Record<string, unknown>>(\n props: object,\n options: { global?: boolean } = {},\n): R {\n const { global = false } = options;\n const result: Record<string, unknown> = {};\n\n const globalAttrs = new Set([\n \"id\",\n \"class\",\n \"style\",\n \"tabIndex\",\n \"role\",\n \"title\",\n \"lang\",\n \"dir\",\n \"hidden\",\n \"draggable\",\n \"accessKey\",\n \"contentEditable\",\n \"spellcheck\",\n ]);\n\n const ariaAttrs = /^aria-/;\n const dataAttrs = /^data-/;\n const eventHandlers = /^on[A-Z]/;\n\n for (const key in props) {\n if (\n Object.prototype.hasOwnProperty.call(props, key) &&\n ((global && globalAttrs.has(key)) ||\n ariaAttrs.test(key) ||\n dataAttrs.test(key) ||\n eventHandlers.test(key))\n ) {\n result[key] = (props as Record<string, unknown>)[key];\n }\n }\n\n return result as R;\n}\n\nexport interface ClientOnlyProps {\n /** The children to render only on the client */\n children: JSX.Element;\n /** Optional fallback to render during SSR and initial hydration */\n fallback?: JSX.Element;\n}\n\n/**\n * ClientOnly component - renders children only on the client side.\n *\n * During SSR, renders the fallback (or nothing).\n * During hydration, renders the same fallback to match SSR.\n * After hydration completes, switches to render children.\n *\n * This is useful for components that rely on browser APIs or\n * have different server/client output.\n *\n * @example\n * ```tsx\n * <ClientOnly fallback={<div>Loading...</div>}>\n * <Calendar />\n * </ClientOnly>\n * ```\n */\nexport const ClientOnly: FlowComponent<ClientOnlyProps> = (props) => {\n // On server, always render fallback\n if (isServer) {\n return <>{props.fallback}</>;\n }\n\n // On client, track if we've hydrated\n const [isHydrated, setIsHydrated] = createSignal(false);\n\n // onMount runs after hydration is complete\n onMount(() => {\n setIsHydrated(true);\n });\n\n return (\n <Show when={isHydrated()} fallback={props.fallback}>\n {props.children}\n </Show>\n );\n};\n\n/**\n * Returns true only on the client after hydration is complete.\n * Can be used to conditionally render client-only content.\n *\n * @example\n * ```tsx\n * const hydrated = useIsHydrated();\n * return (\n * <Show when={hydrated()} fallback={<Placeholder />}>\n * <ClientOnlyComponent />\n * </Show>\n * );\n * ```\n */\nexport function useIsHydrated(): Accessor<boolean> {\n // On server, always return false\n if (isServer) {\n return () => false;\n }\n\n // On client, start false and switch to true after animation frame\n // This ensures we're past the hydration phase\n const [isHydrated, setIsHydrated] = createSignal(false);\n\n // Use requestAnimationFrame to ensure we're past hydration\n // onMount may not fire during hydration for matching DOM\n requestAnimationFrame(() => {\n setIsHydrated(true);\n });\n\n return isHydrated;\n}\n","/**\n * VisuallyHidden component for solidaria-components\n *\n * Hides content visually but keeps it accessible to screen readers.\n * Port of react-aria's VisuallyHidden.\n */\n\nimport { type JSX, type ParentProps, splitProps } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { createVisuallyHidden, mergeProps } from \"@proyecto-viviana/solidaria\";\n\nexport interface VisuallyHiddenProps extends ParentProps, JSX.HTMLAttributes<HTMLElement> {\n /** The element type to render. @default 'span' */\n elementType?: keyof JSX.IntrinsicElements;\n /** Whether the element should be focusable when focused. */\n isFocusable?: boolean;\n /** Inline style object merged with visually hidden styles. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * VisuallyHidden hides its children visually, while keeping content visible to screen readers.\n */\nexport function VisuallyHidden(props: VisuallyHiddenProps): JSX.Element {\n // Split children so the getter is not read once through `{...mergedProps()}`\n // and again during explicit rendering. Hydration code is sensitive to that.\n const [local, others] = splitProps(props, [\"elementType\", \"isFocusable\", \"style\", \"children\"]);\n const { visuallyHiddenProps } = createVisuallyHidden(() => ({\n style: local.style,\n isFocusable: local.isFocusable,\n }));\n\n const mergedProps = () =>\n mergeProps<Record<string, unknown>>(\n others as unknown as Record<string, unknown>,\n visuallyHiddenProps() as unknown as Record<string, unknown>,\n );\n\n // elementType is read once (structural, not reactive). The default `span` is\n // rendered as a static element rather than via `<Dynamic>`: a reactive\n // `<Dynamic>` desyncs Solid's hydration markers, leaving the registry dirty so\n // a later sibling re-render throws \"template is not a function\" in prod (and a\n // hard hydration crash under solid-refresh in dev). `<Dynamic>` is reserved for\n // an explicit custom elementType.\n const tag = local.elementType ?? \"span\";\n if (tag === \"span\") {\n return <span {...mergedProps()}>{local.children}</span>;\n }\n return (\n <Dynamic component={tag} {...mergedProps()}>\n {local.children}\n </Dynamic>\n );\n}\n","/**\n * Shared contexts for overlay components.\n *\n * These are separated to avoid circular dependencies between\n * Dialog, Modal, Popover, and Button components.\n */\n\nimport { createContext, useContext } from \"solid-js\";\nimport type { OverlayTriggerState as StatelyOverlayTriggerState } from \"@proyecto-viviana/solid-stately\";\n\nexport interface OverlayTriggerState {\n isOpen: boolean;\n open: () => void;\n close: () => void;\n toggle: () => void;\n}\n\nexport const OverlayTriggerStateContext = createContext<OverlayTriggerState | null>(null);\n\n/**\n * Hook to access the overlay trigger state from context.\n */\nexport function useOverlayTriggerState(): OverlayTriggerState | null {\n return useContext(OverlayTriggerStateContext);\n}\n\nexport interface DialogTriggerContextValue {\n state: StatelyOverlayTriggerState;\n triggerRef: () => HTMLElement | null;\n setTriggerRef: (el: HTMLElement | null) => void;\n triggerId: string;\n triggerProps?: Record<string, unknown>;\n overlayProps?: Record<string, unknown>;\n}\n\nexport const DialogTriggerContext = createContext<DialogTriggerContextValue | null>(null);\n\n/**\n * Hook to access the dialog trigger state from context.\n */\nexport function useDialogTrigger(): DialogTriggerContextValue | null {\n return useContext(DialogTriggerContext);\n}\n\nexport interface PopoverTriggerContextValue {\n state: {\n isOpen: () => boolean;\n open: () => void;\n close: () => void;\n toggle: () => void;\n };\n triggerRef: () => HTMLElement | null;\n setTriggerRef: (el: HTMLElement | null) => void;\n triggerId: string;\n triggerProps?: Record<string, unknown>;\n overlayProps?: Record<string, unknown>;\n trigger: string;\n}\n\nexport const PopoverTriggerContext = createContext<PopoverTriggerContextValue | null>(null);\n\n/**\n * Hook to access the popover trigger state from context.\n */\nexport function usePopoverTrigger(): PopoverTriggerContextValue | null {\n return useContext(PopoverTriggerContext);\n}\n","/**\n * ProgressBar component for solidaria-components\n *\n * Pre-wired headless progress bar component that combines aria hooks.\n * Port of react-aria-components/src/ProgressBar.tsx\n */\n\nimport { type JSX, createContext, createMemo, mergeProps, splitProps, useContext } from \"solid-js\";\nimport { createProgressBar, type AriaProgressBarProps } from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface ProgressBarRenderProps {\n /** The value as a percentage between the minimum and maximum (0-100). */\n percentage: number | undefined;\n /** A formatted version of the value. */\n valueText: string | undefined;\n /** Whether the progress bar is indeterminate. */\n isIndeterminate: boolean;\n}\n\nexport interface ProgressBarProps extends AriaProgressBarProps, SlotProps {\n /** The element id. */\n id?: string;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<ProgressBarRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ProgressBarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ProgressBarRenderProps>;\n}\n\nexport const ProgressBarContext = createContext<ProgressBarProps | null>(null);\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction getSafeRange(min: number, max: number): number {\n const range = max - min;\n return Number.isFinite(range) && range > 0 ? range : 1;\n}\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n *\n * @example\n * ```tsx\n * <ProgressBar value={50}>\n * {({ percentage, valueText }) => (\n * <>\n * <Label>Loading...</Label>\n * <span>{valueText}</span>\n * <div class=\"bar\" style={{ width: `${percentage}%` }} />\n * </>\n * )}\n * </ProgressBar>\n * ```\n */\nexport function ProgressBar(props: ProgressBarProps): JSX.Element {\n const contextProps = useContext(ProgressBarContext);\n const mergedProps = contextProps ? mergeProps(contextProps, props) : props;\n const [local, ariaProps] = splitProps(mergedProps, [\"children\", \"class\", \"style\", \"slot\"]);\n\n const value = () => ariaProps.value ?? 0;\n const minValue = () => ariaProps.minValue ?? 0;\n const maxValue = () => ariaProps.maxValue ?? 100;\n const isIndeterminate = () => ariaProps.isIndeterminate ?? false;\n\n const progressAria = createProgressBar({\n get id() {\n return ariaProps.id;\n },\n get value() {\n return ariaProps.value;\n },\n get minValue() {\n return ariaProps.minValue;\n },\n get maxValue() {\n return ariaProps.maxValue;\n },\n get valueLabel() {\n return ariaProps.valueLabel;\n },\n get isIndeterminate() {\n return ariaProps.isIndeterminate;\n },\n get formatOptions() {\n return ariaProps.formatOptions;\n },\n get label() {\n return ariaProps.label;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n });\n\n const percentage = createMemo(() => {\n if (isIndeterminate()) {\n return undefined;\n }\n const clampedValue = clamp(value(), minValue(), maxValue());\n return ((clampedValue - minValue()) / getSafeRange(minValue(), maxValue())) * 100;\n });\n\n const valueText = createMemo(() => {\n return progressAria.progressBarProps[\"aria-valuetext\"] as string | undefined;\n });\n\n const renderValues = createMemo<ProgressBarRenderProps>(() => ({\n percentage: percentage(),\n valueText: valueText(),\n isIndeterminate: isIndeterminate(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ProgressBar\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n return (\n <div\n {...domProps()}\n {...progressAria.progressBarProps}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n","/**\n * Button component for solidaria-components\n *\n * A pre-wired headless button that combines state + aria hooks.\n * Port of react-aria-components/src/Button.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport {\n announce,\n createButton,\n createFocusRing,\n createHover,\n createId,\n mergeProps,\n type AriaButtonProps,\n type HoverEvent,\n type PressEvent,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { DialogTriggerContext, PopoverTriggerContext } from \"./contexts\";\nimport { ProgressBarContext } from \"./ProgressBar\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nfunction createLiveButtonRenderProps(values: () => ButtonRenderProps): ButtonRenderProps {\n return {\n get isHovered() {\n return values().isHovered;\n },\n get isPressed() {\n return values().isPressed;\n },\n get isFocused() {\n return values().isFocused;\n },\n get isFocusVisible() {\n return values().isFocusVisible;\n },\n get isDisabled() {\n return values().isDisabled;\n },\n get isPending() {\n return values().isPending;\n },\n };\n}\n\nfunction createLiveCustomRootProps(\n getProps: () => JSX.ButtonHTMLAttributes<HTMLButtonElement>,\n getChildren: () => JSX.Element,\n ref: (el: HTMLButtonElement) => void,\n): JSX.ButtonHTMLAttributes<HTMLButtonElement> {\n const props = {} as JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n const keys = new Set([...Object.keys(getProps()), \"children\", \"ref\"]);\n\n for (const key of keys) {\n Object.defineProperty(props, key, {\n enumerable: true,\n configurable: true,\n get() {\n if (key === \"children\") {\n return getChildren();\n }\n if (key === \"ref\") {\n return ref;\n }\n return (getProps() as Record<string, unknown>)[key];\n },\n });\n }\n\n return props;\n}\n\nexport interface ButtonRenderProps {\n /** Whether the button is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the button is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the button is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the button is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n /** Whether the button is currently in a pending state. */\n isPending: boolean;\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<ButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ButtonRenderProps>;\n /** Custom renderer for the outer button element. */\n render?: (\n props: JSX.ButtonHTMLAttributes<HTMLButtonElement>,\n renderProps: ButtonRenderProps,\n ) => JSX.Element;\n /** Ref for the underlying button element. */\n ref?: RefLike<HTMLButtonElement>;\n /** Whether the button is in a pending state. */\n isPending?: boolean;\n /** Keeps pending buttons focusable by using aria-disabled without a native disabled attribute. */\n isPendingFocusable?: boolean;\n /** Handler called when hover starts. */\n onHoverStart?: (e: HoverEvent) => void;\n /** Handler called when hover ends. */\n onHoverEnd?: (e: HoverEvent) => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n}\n\nexport interface ButtonContextValue extends ButtonProps {\n slots?: Record<string, ButtonProps>;\n}\n\nexport const ButtonContext = createContext<ButtonContextValue | null>(null);\n\n/**\n * A button allows a user to perform an action.\n *\n * This is a headless component that provides accessibility and state management.\n * Style it using the render props pattern or data attributes.\n *\n * @example\n * ```tsx\n * <Button onPress={() => alert('Pressed!')}>\n * {({ isPressed, isHovered }) => (\n * <span class={isPressed ? 'bg-blue-700' : isHovered ? 'bg-blue-600' : 'bg-blue-500'}>\n * Click me\n * </span>\n * )}\n * </Button>\n * ```\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const contextProps = useContext(ButtonContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<ButtonProps>(() => {\n if (!contextProps) return {};\n const { slots: _slots, ...rest } = contextProps;\n return rest;\n });\n const mergedProps = (\n contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props\n ) as ButtonProps;\n\n const [local, ariaProps] = splitProps(mergedProps, [\n \"children\",\n \"class\",\n \"style\",\n \"render\",\n \"ref\",\n \"slot\",\n \"isPending\",\n \"isPendingFocusable\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n\n // Check if inside a DialogTrigger or PopoverTrigger - if so, toggle on press\n // NOTE: Context is captured at component creation time. For Buttons inside a Modal,\n // the Modal provides OverlayTriggerStateContext, but due to SolidJS's eager JSX evaluation,\n // components inside Modal children are created before the Modal's Show renders.\n // So we can't reliably use context here to determine if we're inside a Modal.\n const dialogTriggerContext = useContext(DialogTriggerContext);\n const popoverTriggerContext = useContext(PopoverTriggerContext);\n\n // Helper to resolve isDisabled (handles both boolean and Accessor<boolean>)\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return disabled();\n }\n return !!disabled;\n };\n\n const resolvePending = (): boolean => !!local.isPending;\n const isPendingFocusable = () => local.isPendingFocusable !== false;\n\n const [resolvedButtonEl, setResolvedButtonEl] = createSignal<HTMLButtonElement | null>(null);\n const buttonId = createId((ariaProps as Record<string, unknown>).id as string | undefined);\n const progressId = createId();\n\n // Explicit trigger ownership: a button toggles overlays only when it is the\n // registered trigger element for the surrounding trigger context.\n const isDialogTrigger = () =>\n !!dialogTriggerContext &&\n !!resolvedButtonEl() &&\n dialogTriggerContext.triggerRef() === resolvedButtonEl();\n const isPopoverTrigger = () =>\n !!popoverTriggerContext &&\n !!resolvedButtonEl() &&\n popoverTriggerContext.triggerRef() === resolvedButtonEl();\n\n const handlePress = (e: PressEvent) => {\n if (resolvePending()) {\n return;\n }\n if (typeof ariaProps.onPress === \"function\") {\n ariaProps.onPress(e);\n }\n // Toggle only when this exact button is the registered trigger element.\n if (isDialogTrigger()) {\n dialogTriggerContext!.state.toggle();\n }\n if (isPopoverTrigger()) {\n popoverTriggerContext!.state.toggle();\n }\n };\n\n const buttonAria = createButton({\n ...ariaProps,\n onPress: handlePress,\n get onPressStart() {\n return resolvePending() ? undefined : ariaProps.onPressStart;\n },\n get onPressEnd() {\n return resolvePending() ? undefined : ariaProps.onPressEnd;\n },\n get onPressUp() {\n return resolvePending() ? undefined : ariaProps.onPressUp;\n },\n get onPressChange() {\n return resolvePending() ? undefined : ariaProps.onPressChange;\n },\n get onClick() {\n return resolvePending() ? undefined : ariaProps.onClick;\n },\n get isDisabled() {\n return resolveDisabled() || resolvePending();\n },\n });\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled() || resolvePending();\n },\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n });\n\n const renderValues = createMemo<ButtonRenderProps>(() => ({\n isHovered: isHovered(),\n isPressed: buttonAria.isPressed() && !resolvePending(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isPending: resolvePending(),\n }));\n\n const renderProps = useRenderProps(\n {\n // Use merged children so ButtonContext can supply slot/default content.\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Button\",\n },\n renderValues,\n );\n\n // Remove onClick from DOM props - it's already handled by createPress\n // This matches React Aria Components behavior (Button.tsx line 144: delete DOMProps.onClick)\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n // onClick is handled by createPress, not passed directly to DOM\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n const buttonPropsRef = (buttonAria.buttonProps as Record<string, unknown>).ref as\n | ((el: HTMLElement) => void)\n | undefined;\n const focusPropsRef = (focusProps as Record<string, unknown>).ref as\n | ((el: HTMLElement) => void)\n | undefined;\n const hoverPropsRef = (hoverProps as Record<string, unknown>).ref as\n | ((el: HTMLElement) => void)\n | undefined;\n\n const cleanButtonProps = () => {\n const { ref: _ref1, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref3, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const ariaLabelledBy = createMemo(() => {\n const labelledBy = cleanButtonProps()[\"aria-labelledby\"] as string | undefined;\n if (!resolvePending()) {\n return labelledBy;\n }\n\n if (labelledBy) {\n return `${labelledBy} ${progressId}`;\n }\n\n if (cleanButtonProps()[\"aria-label\"]) {\n return `${buttonId} ${progressId}`;\n }\n\n return labelledBy;\n });\n\n const handleRef = (el: HTMLButtonElement) => {\n setResolvedButtonEl(el);\n assignRef(local.ref, el);\n\n buttonPropsRef?.(el);\n focusPropsRef?.(el);\n hoverPropsRef?.(el);\n\n // Register trigger ownership for surrounding trigger contexts.\n if (dialogTriggerContext?.setTriggerRef) {\n if (!el.id) {\n el.id = dialogTriggerContext.triggerId;\n }\n dialogTriggerContext.setTriggerRef(el);\n }\n if (popoverTriggerContext?.setTriggerRef) {\n popoverTriggerContext.setTriggerRef(el);\n }\n };\n const buttonType = () =>\n (buttonAria.buttonProps as Record<string, unknown>).type === \"submit\" && resolvePending()\n ? \"button\"\n : ((buttonAria.buttonProps as Record<string, unknown>).type as\n | \"button\"\n | \"submit\"\n | \"reset\"\n | undefined);\n const triggerAriaProps = () => {\n const dialogTriggerProps = dialogTriggerContext?.triggerProps;\n if (dialogTriggerProps && isDialogTrigger()) {\n const next: Record<string, unknown> = {};\n for (const name of [\"aria-haspopup\", \"aria-expanded\", \"aria-controls\"]) {\n if (dialogTriggerProps[name] != null) {\n next[name] = dialogTriggerProps[name];\n }\n }\n return next;\n }\n\n const triggerProps = popoverTriggerContext?.triggerProps;\n if (!triggerProps || !isPopoverTrigger()) {\n return {};\n }\n\n const next: Record<string, unknown> = {};\n for (const name of [\"aria-haspopup\", \"aria-expanded\", \"aria-controls\"]) {\n if (triggerProps[name] != null) {\n next[name] = triggerProps[name];\n }\n }\n return next;\n };\n const disablePendingInteractions = (props: Record<string, unknown>) => {\n if (!resolvePending()) {\n return props;\n }\n\n const next = { ...props };\n for (const key of Object.keys(next)) {\n if (key.startsWith(\"on\") && !key.includes(\"Focus\") && !key.includes(\"Blur\")) {\n next[key] = undefined;\n }\n }\n next.href = undefined;\n next.target = undefined;\n return next;\n };\n const dataState = (value: boolean) => (value ? \"true\" : undefined);\n const buttonChildren = () => renderProps.renderChildren();\n const buttonContent = () => (\n <ProgressBarContext.Provider value={{ id: progressId }}>\n {buttonChildren()}\n </ProgressBarContext.Provider>\n );\n let wasPending = resolvePending();\n createEffect(() => {\n const pending = resolvePending();\n const message = { \"aria-labelledby\": ariaLabelledBy() || buttonId };\n\n if (!wasPending && isFocused() && pending) {\n announce(message, \"assertive\");\n } else if (wasPending && isFocused() && !pending) {\n announce(message, \"assertive\");\n }\n\n wasPending = pending;\n });\n const rootProps = () =>\n ({\n ...domProps(),\n ...disablePendingInteractions(cleanButtonProps()),\n ...triggerAriaProps(),\n ...cleanFocusProps(),\n ...cleanHoverProps(),\n type: buttonType(),\n id: buttonId,\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n disabled: resolvePending() && isPendingFocusable() ? undefined : cleanButtonProps().disabled,\n \"aria-labelledby\": ariaLabelledBy(),\n \"aria-disabled\": resolvePending()\n ? \"true\"\n : (cleanButtonProps()[\"aria-disabled\"] ?? ariaProps[\"aria-disabled\"]),\n \"data-pressed\": dataState(buttonAria.isPressed() && !resolvePending()),\n \"data-hovered\": dataState(isHovered()),\n \"data-focused\": dataState(isFocused()),\n \"data-focus-visible\": dataState(isFocusVisible()),\n \"data-disabled\": dataState(resolveDisabled()),\n \"data-pending\": dataState(resolvePending()),\n }) as JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n const customRootProps = createLiveCustomRootProps(rootProps, buttonContent, handleRef);\n const customRenderValues = createLiveButtonRenderProps(renderValues);\n\n return local.render ? (\n local.render(customRootProps, customRenderValues)\n ) : (\n <button\n ref={handleRef}\n {...rootProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n attr:data-pressed={(rootProps() as Record<string, unknown>)[\"data-pressed\"] as string}\n attr:data-hovered={(rootProps() as Record<string, unknown>)[\"data-hovered\"] as string}\n attr:data-focused={(rootProps() as Record<string, unknown>)[\"data-focused\"] as string}\n attr:data-focus-visible={\n (rootProps() as Record<string, unknown>)[\"data-focus-visible\"] as string\n }\n attr:data-disabled={(rootProps() as Record<string, unknown>)[\"data-disabled\"] as string}\n attr:data-pending={(rootProps() as Record<string, unknown>)[\"data-pending\"] as string}\n >\n {buttonContent()}\n </button>\n );\n}\n","/**\n * ToggleSwitch component for solidaria-components\n *\n * A pre-wired headless switch that combines state + aria hooks.\n * Port of react-aria-components/src/Switch.tsx\n *\n * Named \"ToggleSwitch\" to avoid conflict with SolidJS's built-in Switch component.\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n untrack,\n Show,\n} from \"solid-js\";\nimport {\n createSwitch,\n createFocusRing,\n createHover,\n type AriaSwitchProps,\n} from \"@proyecto-viviana/solidaria\";\nimport { createToggleState, type ToggleState } from \"@proyecto-viviana/solid-stately\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface ToggleSwitchRenderProps {\n /** Whether the switch is selected. */\n isSelected: boolean;\n /** Whether the switch is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the switch is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the switch is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the switch is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the switch is disabled. */\n isDisabled: boolean;\n /** Whether the switch is read only. */\n isReadOnly: boolean;\n /** Whether the switch is invalid. */\n isInvalid: boolean;\n /** State of the switch. */\n state: ToggleState;\n}\n\nexport interface ToggleSwitchProps extends Omit<AriaSwitchProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<ToggleSwitchRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToggleSwitchRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToggleSwitchRenderProps>;\n /** A description for the switch. */\n description?: JSX.Element;\n /** An error message for the switch. */\n errorMessage?: JSX.Element;\n}\n\nexport const ToggleSwitchContext = createContext<ToggleSwitchProps | null>(null);\n\n/**\n * A switch allows a user to turn a setting on or off.\n *\n * This is a headless component that provides accessibility and state management.\n * Style it using the render props pattern or data attributes.\n *\n * Named \"ToggleSwitch\" to avoid conflict with SolidJS's built-in Switch component.\n *\n * @example\n * ```tsx\n * <ToggleSwitch>\n * {({ isSelected }) => (\n * <>\n * <span class={`switch-track ${isSelected ? 'bg-blue-500' : 'bg-gray-300'}`}>\n * <span class={`switch-thumb ${isSelected ? 'translate-x-5' : 'translate-x-0'}`} />\n * </span>\n * <span>Enable notifications</span>\n * </>\n * )}\n * </ToggleSwitch>\n * ```\n */\nexport function ToggleSwitch(props: ToggleSwitchProps): JSX.Element {\n const [inputElement, setInputElement] = createSignal<HTMLInputElement | null>(null);\n\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"description\",\n \"errorMessage\",\n ]);\n const descriptionId = createUniqueId();\n const errorMessageId = createUniqueId();\n\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createToggleState(() => ({\n isSelected: ariaProps.isSelected,\n defaultSelected: ariaProps.defaultSelected,\n onChange: ariaProps.onChange,\n isReadOnly: ariaProps.isReadOnly,\n }));\n\n const switchAria = createSwitch(\n () => ({\n ...ariaProps,\n children: typeof props.children === \"function\" ? true : props.children,\n }),\n state,\n inputElement,\n );\n const describedBy = () => {\n const ids = [\n ariaProps[\"aria-describedby\"],\n local.description ? descriptionId : undefined,\n switchAria.isInvalid && local.errorMessage ? errorMessageId : undefined,\n ].filter(Boolean);\n return ids.length ? ids.join(\" \") : undefined;\n };\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ariaProps.isDisabled || ariaProps.isReadOnly;\n },\n });\n\n const renderValues = createMemo<ToggleSwitchRenderProps>(() => ({\n isSelected: switchAria.isSelected(),\n isHovered: isHovered(),\n isPressed: switchAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: switchAria.isDisabled,\n isReadOnly: switchAria.isReadOnly,\n isInvalid: switchAria.isInvalid,\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ToggleSwitch\",\n },\n renderValues,\n );\n const childRenderValues: ToggleSwitchRenderProps = {\n get isSelected() {\n return switchAria.isSelected();\n },\n get isHovered() {\n return isHovered();\n },\n get isPressed() {\n return switchAria.isPressed();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return switchAria.isDisabled;\n },\n get isReadOnly() {\n return switchAria.isReadOnly;\n },\n get isInvalid() {\n return switchAria.isInvalid;\n },\n get state() {\n return state;\n },\n };\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n const cleanLabelProps = () => {\n const { ref: _ref1, ...rest } = switchAria.labelProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanInputProps = () => {\n const { ref: _ref3, ...rest } = switchAria.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref4, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n // Resolve the render-prop children ONCE (untracked) — see TextField. Re-invoking\n // it on a reactive update re-clones its templates and, mid-hydration, throws a\n // Hydration Mismatch. The children keep fine-grained reactivity via the\n // childRenderValues getters + <Show>s.\n const switchChildren = untrack(() => {\n const children = props.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n });\n\n return (\n <label\n {...domProps()}\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={switchAria.isSelected() || undefined}\n data-pressed={switchAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={switchAria.isDisabled || undefined}\n data-readonly={switchAria.isReadOnly || undefined}\n >\n <VisuallyHidden>\n <input\n ref={setInputElement}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n aria-describedby={describedBy()}\n />\n </VisuallyHidden>\n {switchChildren}\n <Show when={local.description}>\n <span id={descriptionId} slot=\"description\">\n {local.description}\n </span>\n </Show>\n <Show when={switchAria.isInvalid && local.errorMessage}>\n <span id={errorMessageId} slot=\"errorMessage\">\n {local.errorMessage}\n </span>\n </Show>\n </label>\n );\n}\n","/**\n * ToggleButtonGroup component for solidaria-components.\n *\n * Groups toggle buttons with single/multiple selection state.\n * Parity target: react-aria-components/src/ToggleButtonGroup.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext } from \"solid-js\";\nimport { createToggleButtonGroup, mergeProps } from \"@proyecto-viviana/solidaria\";\nimport {\n createToggleGroupState,\n type Key,\n type ToggleGroupState,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type RenderChildren,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface ToggleButtonGroupRenderProps {\n orientation: \"horizontal\" | \"vertical\";\n isDisabled: boolean;\n state: ToggleGroupState;\n}\n\nexport interface ToggleButtonGroupProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"children\" | \"class\" | \"style\" | \"onSelectionChange\">,\n SlotProps {\n selectionMode?: \"single\" | \"multiple\";\n disallowEmptySelection?: boolean;\n selectedKeys?: Iterable<Key>;\n defaultSelectedKeys?: Iterable<Key>;\n onSelectionChange?: (keys: Set<Key>) => void;\n orientation?: \"horizontal\" | \"vertical\";\n isDisabled?: boolean;\n children?: RenderChildren<ToggleButtonGroupRenderProps>;\n class?: ClassNameOrFunction<ToggleButtonGroupRenderProps>;\n style?: StyleOrFunction<ToggleButtonGroupRenderProps>;\n}\n\nexport const ToggleButtonGroupContext = createContext<ToggleButtonGroupProps | null>(null);\nexport const ToggleButtonGroupStateContext = createContext<ToggleGroupState | null>(null);\nexport const ToggleGroupStateContext = ToggleButtonGroupStateContext;\nexport type ToggleButtonGroupStateContextValue = ToggleGroupState;\n\nexport function ToggleButtonGroup(props: ToggleButtonGroupProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"selectionMode\",\n \"disallowEmptySelection\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"orientation\",\n \"isDisabled\",\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n \"slot\",\n \"aria-label\",\n \"aria-labelledby\",\n ]);\n\n const state = createToggleGroupState(() => ({\n selectionMode: local.selectionMode,\n disallowEmptySelection: local.disallowEmptySelection,\n selectedKeys: local.selectedKeys,\n defaultSelectedKeys: local.defaultSelectedKeys,\n onSelectionChange: local.onSelectionChange,\n isDisabled: !!local.isDisabled,\n }));\n\n const { groupProps } = createToggleButtonGroup(\n {\n get orientation() {\n return local.orientation;\n },\n get isDisabled() {\n return !!local.isDisabled;\n },\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return local[\"aria-labelledby\"];\n },\n },\n state,\n );\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ToggleButtonGroup\",\n },\n () => ({\n orientation: local.orientation ?? \"horizontal\",\n isDisabled: !!local.isDisabled,\n state,\n }),\n );\n\n const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n const mergedGroupProps = createMemo(() =>\n mergeProps(filteredDomProps(), groupProps as Record<string, unknown>),\n );\n\n return (\n <div\n {...(mergedGroupProps() as JSX.HTMLAttributes<HTMLDivElement>)}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-orientation={local.orientation ?? \"horizontal\"}\n data-disabled={local.isDisabled || undefined}\n ref={(el) => {\n if (!local.ref) return;\n if (typeof local.ref === \"function\") {\n local.ref(el);\n }\n }}\n >\n <ToggleButtonGroupContext.Provider value={props}>\n <ToggleButtonGroupStateContext.Provider value={state}>\n {renderProps.renderChildren()}\n </ToggleButtonGroupStateContext.Provider>\n </ToggleButtonGroupContext.Provider>\n </div>\n );\n}\n\nexport function useToggleButtonGroupStateContext(): ToggleGroupState | null {\n return useContext(ToggleButtonGroupStateContext);\n}\n","/**\n * ToggleButton component for solidaria-components\n *\n * A pre-wired headless toggle button that combines pressed + selected state.\n * Port direction: react-aria-components/src/ToggleButton.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext } from \"solid-js\";\nimport {\n createToggleButton,\n createToggleButtonGroupItem,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaToggleButtonProps,\n} from \"@proyecto-viviana/solidaria\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { useToggleButtonGroupStateContext } from \"./ToggleButtonGroup\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ToggleButtonRenderProps {\n isHovered: boolean;\n isPressed: boolean;\n isFocused: boolean;\n isFocusVisible: boolean;\n isDisabled: boolean;\n isSelected: boolean;\n}\n\nexport interface ToggleButtonProps extends Omit<AriaToggleButtonProps, \"children\">, SlotProps {\n /** Key used when inside ToggleButtonGroup selection state. */\n toggleKey?: Key;\n /** Preferred group key prop, parity with RAC item id usage. */\n id?: Key;\n children?: RenderChildren<ToggleButtonRenderProps>;\n class?: ClassNameOrFunction<ToggleButtonRenderProps>;\n style?: StyleOrFunction<ToggleButtonRenderProps>;\n /** Ref for the underlying button element. */\n ref?: RefLike<HTMLButtonElement>;\n}\n\nexport const ToggleButtonContext = createContext<ToggleButtonProps | null>(null);\n\nfunction resolveDisabledValue(isDisabled: AriaToggleButtonProps[\"isDisabled\"]): boolean {\n if (typeof isDisabled === \"function\") {\n return isDisabled();\n }\n return !!isDisabled;\n}\n\nexport function ToggleButton(props: ToggleButtonProps): JSX.Element {\n const contextProps = useContext(ToggleButtonContext);\n const mergedProps = (contextProps ? mergeProps(contextProps, props) : props) as ToggleButtonProps;\n\n const [local, ariaProps] = splitProps(mergedProps, [\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n \"slot\",\n \"toggleKey\",\n \"id\",\n ]);\n const groupState = useToggleButtonGroupStateContext();\n const groupKey = local.id ?? local.toggleKey;\n const standaloneAriaProps = mergeProps<AriaToggleButtonProps>(ariaProps, {\n get id() {\n return local.id;\n },\n });\n\n const toggleAria =\n groupState && groupKey != null\n ? createToggleButtonGroupItem(\n {\n ...ariaProps,\n id: groupKey,\n },\n groupState,\n )\n : createToggleButton(standaloneAriaProps);\n\n const isDisabled = () => resolveDisabledValue(ariaProps.isDisabled) || !!groupState?.isDisabled;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const renderValues = createMemo<ToggleButtonRenderProps>(() => ({\n isHovered: isHovered(),\n isPressed: toggleAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: isDisabled(),\n isSelected: toggleAria.isSelected(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ToggleButton\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).onClick;\n delete (filtered as Record<string, unknown>).id;\n return filtered;\n });\n\n const cleanButtonProps = () => {\n const { ref: _ref1, ...rest } = toggleAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref3, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <button\n {...domProps()}\n {...cleanButtonProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n ref={(el) => assignRef(local.ref, el)}\n slot={local.slot}\n data-pressed={toggleAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={isDisabled() || undefined}\n data-selected={toggleAria.isSelected() || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n );\n}\n","/**\n * Form primitive for solidaria-components.\n *\n * Provides form-level validation behavior and server validation context.\n * Port direction: react-aria-components/src/Form.tsx\n */\n\nimport { type JSX, createContext, splitProps } from \"solid-js\";\nimport {\n FormValidationContext,\n type ValidationErrors,\n type ValidationBehavior,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type RenderChildren,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface FormRenderProps {\n validationBehavior: ValidationBehavior;\n}\n\nexport interface FormProps\n extends\n Omit<JSX.FormHTMLAttributes<HTMLFormElement>, \"children\" | \"class\" | \"style\" | \"ref\">,\n SlotProps {\n /** Server-side validation errors keyed by field name. */\n validationErrors?: ValidationErrors;\n /** Validation behavior mode. */\n validationBehavior?: ValidationBehavior;\n /** Character encodings accepted by the server. React-style alias for Solid's `accept-charset`. */\n acceptCharset?: string;\n /** Browser auto-capitalization hint. React-style alias for Solid's `autocapitalize`. */\n autoCapitalize?: JSX.HTMLAttributes<HTMLFormElement>[\"autoCapitalize\"];\n /** Browser autocomplete behavior. React-style alias for Solid's `autocomplete`. */\n autoComplete?: JSX.FormHTMLAttributes<HTMLFormElement>[\"autocomplete\"];\n /** Form encoding type. React-style alias for Solid's `enctype`. */\n encType?: JSX.FormHTMLAttributes<HTMLFormElement>[\"enctype\"];\n /** The children of the component. */\n children?: RenderChildren<FormRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<FormRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<FormRenderProps>;\n /** Ref for the underlying form element. */\n ref?: RefLike<HTMLFormElement>;\n}\n\nexport const FormContext = createContext<FormProps | null>(null);\n\nconst formDOMPropNames = new Set([\n \"accept-charset\",\n \"acceptCharset\",\n \"action\",\n \"autocapitalize\",\n \"autoCapitalize\",\n \"autocomplete\",\n \"autoComplete\",\n \"encoding\",\n \"enctype\",\n \"encType\",\n \"method\",\n \"name\",\n \"rel\",\n \"target\",\n]);\n\nfunction filterFormDOMProps(props: object): Record<string, unknown> {\n const filtered = filterDOMProps<Record<string, unknown>>(props, { global: true });\n\n for (const key in props) {\n if (Object.prototype.hasOwnProperty.call(props, key) && formDOMPropNames.has(key)) {\n filtered[key] = (props as Record<string, unknown>)[key];\n }\n }\n\n return filtered;\n}\n\nexport function Form(props: FormProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"validationErrors\",\n \"validationBehavior\",\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n \"slot\",\n ]);\n\n const validationBehavior: ValidationBehavior = local.validationBehavior ?? \"native\";\n const errors = local.validationErrors ?? {};\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Form\",\n },\n () => ({\n validationBehavior,\n }),\n );\n\n const filteredDomProps = filterFormDOMProps(domProps);\n\n return (\n <form\n {...filteredDomProps}\n ref={(el) => assignRef(local.ref, el)}\n noValidate={validationBehavior !== \"native\"}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n >\n <FormContext.Provider value={{ ...props, validationBehavior }}>\n <FormValidationContext.Provider value={errors}>\n {renderProps.renderChildren()}\n </FormValidationContext.Provider>\n </FormContext.Provider>\n </form>\n );\n}\n","/**\n * Checkbox and CheckboxGroup components for solidaria-components\n *\n * Pre-wired headless checkbox components that combine state + aria hooks.\n * Port of react-aria-components/src/Checkbox.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n useContext,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n Show,\n} from \"solid-js\";\nimport {\n createCheckbox,\n createCheckboxGroup,\n createCheckboxGroupItem,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaCheckboxProps,\n type AriaCheckboxGroupProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createToggleState,\n createCheckboxGroupState,\n type CheckboxGroupState,\n} from \"@proyecto-viviana/solid-stately\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { FormContext, type FormProps } from \"./Form\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface CheckboxGroupRenderProps {\n /** Whether the checkbox group is disabled. */\n isDisabled: boolean;\n /** Whether the checkbox group is read only. */\n isReadOnly: boolean;\n /** Whether the checkbox group is required. */\n isRequired: boolean;\n /** Whether the checkbox group is invalid. */\n isInvalid: boolean;\n /** State of the checkbox group. */\n state: CheckboxGroupState;\n}\n\nexport interface CheckboxRenderProps {\n /** Whether the checkbox is selected. */\n isSelected: boolean;\n /** Whether the checkbox is indeterminate. */\n isIndeterminate: boolean;\n /** Whether the checkbox is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the checkbox is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the checkbox is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the checkbox is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the checkbox is disabled. */\n isDisabled: boolean;\n /** Whether the checkbox is read only. */\n isReadOnly: boolean;\n /** Whether the checkbox is invalid. */\n isInvalid: boolean;\n /** Whether the checkbox is required. */\n isRequired: boolean;\n}\n\nexport interface CheckboxGroupProps\n extends Omit<AriaCheckboxGroupProps, \"children\" | \"label\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<CheckboxGroupRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CheckboxGroupRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CheckboxGroupRenderProps>;\n /** Ref for the checkbox group root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<CheckboxRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CheckboxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CheckboxRenderProps>;\n /** Custom renderer for the outer label element. */\n render?: (\n props: JSX.LabelHTMLAttributes<HTMLLabelElement>,\n renderProps: CheckboxRenderProps,\n ) => JSX.Element;\n /** Ref for the outer label element. */\n ref?: RefLike<HTMLLabelElement>;\n /** Ref for the underlying input element. */\n inputRef?: RefLike<HTMLInputElement>;\n /** Whether the checkbox is indeterminate. */\n isIndeterminate?: boolean;\n /** A description for the checkbox. */\n description?: JSX.Element;\n /** An error message for the checkbox. */\n errorMessage?: JSX.Element;\n /** Handler called when hover starts. */\n onHoverStart?: () => void;\n /** Handler called when hover ends. */\n onHoverEnd?: () => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n}\n\nexport const CheckboxGroupContext = createContext<CheckboxGroupProps | null>(null);\nexport const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);\nexport interface CheckboxContextValue extends CheckboxProps {\n slots?: Record<string, CheckboxProps>;\n}\nexport const CheckboxContext = createContext<CheckboxContextValue | null>(null);\n\ntype PropsWithValidationBehavior = {\n validationBehavior?: \"aria\" | \"native\";\n};\n\nfunction withFormValidationBehavior<T extends PropsWithValidationBehavior>(\n props: T,\n formContext: FormProps | null,\n): T {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\n/**\n * A checkbox group allows a user to select multiple items from a list of options.\n *\n * @example\n * ```tsx\n * <CheckboxGroup>\n * <Checkbox value=\"one\">Option 1</Checkbox>\n * <Checkbox value=\"two\">Option 2</Checkbox>\n * </CheckboxGroup>\n * ```\n */\nexport function CheckboxGroup(props: CheckboxGroupProps): JSX.Element {\n const formContext = useContext(FormContext);\n const mergedProps = withFormValidationBehavior(props, formContext);\n const [local, ariaProps] = splitProps(mergedProps, [\n \"class\",\n \"style\",\n \"slot\",\n \"ref\",\n \"description\",\n \"errorMessage\",\n \"children\",\n ]);\n\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createCheckboxGroupState(() => ({\n value: ariaProps.value,\n defaultValue: ariaProps.defaultValue,\n onChange: ariaProps.onChange,\n isDisabled: ariaProps.isDisabled,\n isReadOnly: ariaProps.isReadOnly,\n isRequired: ariaProps.isRequired,\n isInvalid: ariaProps.isInvalid,\n validationState: ariaProps.validationState,\n validate: ariaProps.validate,\n validationBehavior: ariaProps.validationBehavior,\n name: ariaProps.name,\n }));\n\n const groupAria = createCheckboxGroup(\n () => ({\n ...ariaProps,\n description: local.description,\n errorMessage: local.errorMessage,\n }),\n state,\n );\n\n const renderValues = createMemo<CheckboxGroupRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: ariaProps.isRequired ?? false,\n isInvalid: groupAria.isInvalid,\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-CheckboxGroup\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = groupAria.groupProps as Record<string, unknown>;\n return rest;\n };\n const setGroupRef = (el: HTMLDivElement) => {\n assignRef(local.ref, el);\n };\n const groupDescribedBy = () => {\n const ids = [\n (cleanGroupProps() as { \"aria-describedby\"?: string })[\"aria-describedby\"],\n local.description ? groupAria.descriptionProps.id : undefined,\n groupAria.isInvalid && local.errorMessage ? groupAria.errorMessageProps.id : undefined,\n ]\n .filter(Boolean)\n .join(\" \")\n .split(\" \")\n .filter(Boolean);\n return ids.length ? Array.from(new Set(ids)).join(\" \") : undefined;\n };\n\n const GroupChildren = () => {\n const childRenderValues: CheckboxGroupRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isReadOnly() {\n return state.isReadOnly;\n },\n get isRequired() {\n return state.isRequired();\n },\n get isInvalid() {\n return groupAria.isInvalid;\n },\n get state() {\n return state;\n },\n };\n const renderedChildren = createMemo(() => {\n const children = local.children;\n if (typeof children === \"function\") {\n return children.length > 0\n ? children(childRenderValues)\n : (children as unknown as () => JSX.Element)();\n }\n return children;\n });\n\n return <>{renderedChildren()}</>;\n };\n\n return (\n <CheckboxGroupStateContext.Provider value={state}>\n <div\n {...domProps()}\n {...cleanGroupProps()}\n ref={setGroupRef}\n aria-describedby={groupDescribedBy()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-invalid={groupAria.isInvalid || undefined}\n >\n <GroupChildren />\n <Show when={local.description}>\n <div {...(groupAria.descriptionProps as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {local.description}\n </div>\n </Show>\n <Show when={groupAria.isInvalid && local.errorMessage}>\n <div {...(groupAria.errorMessageProps as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {local.errorMessage}\n </div>\n </Show>\n </div>\n </CheckboxGroupStateContext.Provider>\n );\n}\n\n/**\n * A checkbox allows a user to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n *\n * @example\n * ```tsx\n * <Checkbox>\n * {({ isSelected }) => (\n * <>\n * <span class={`checkbox ${isSelected ? 'checked' : ''}`}>\n * {isSelected && '✓'}\n * </span>\n * <span>Accept terms</span>\n * </>\n * )}\n * </Checkbox>\n * ```\n */\nexport function Checkbox(props: CheckboxProps): JSX.Element {\n const [inputElement, setInputElement] = createSignal<HTMLInputElement | null>(null);\n const formContext = useContext(FormContext);\n const contextProps = useContext(CheckboxContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<CheckboxProps>(() => {\n if (!contextProps) return {};\n const { slots: _slots, ...rest } = contextProps;\n return rest;\n });\n const mergedProps = contextProps\n ? (mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) as CheckboxProps)\n : props;\n const propsWithFormBehavior = withFormValidationBehavior(mergedProps, formContext);\n const inputRefs = createMemo(\n () =>\n [contextBaseProps().inputRef, contextSlotProps?.inputRef, props.inputRef].filter(\n Boolean,\n ) as RefLike<HTMLInputElement>[],\n );\n\n const [local, ariaProps] = splitProps(propsWithFormBehavior, [\n \"class\",\n \"style\",\n \"render\",\n \"ref\",\n \"inputRef\",\n \"slot\",\n \"isIndeterminate\",\n \"description\",\n \"errorMessage\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n const descriptionId = createUniqueId();\n const errorMessageId = createUniqueId();\n\n const inputAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n const groupState = useContext(CheckboxGroupStateContext);\n\n let isSelected: Accessor<boolean>;\n let isPressed: Accessor<boolean>;\n let isDisabled: Accessor<boolean>;\n let isReadOnly: Accessor<boolean>;\n let isInvalid: Accessor<boolean>;\n let labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n let inputProps: () => JSX.InputHTMLAttributes<HTMLInputElement>;\n\n if (groupState) {\n const itemAria = createCheckboxGroupItem(\n () => ({\n ...inputAriaProps(),\n value: inputAriaProps().value ?? \"\",\n children: typeof mergedProps.children === \"function\" ? true : mergedProps.children,\n }),\n groupState,\n inputElement,\n );\n isSelected = itemAria.isSelected;\n isPressed = itemAria.isPressed;\n labelProps = itemAria.labelProps;\n inputProps = () => itemAria.inputProps;\n } else {\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createToggleState(() => ({\n isSelected: ariaProps.isSelected,\n defaultSelected: ariaProps.defaultSelected,\n onChange: ariaProps.onChange,\n isReadOnly: ariaProps.isReadOnly,\n }));\n\n const checkboxAria = createCheckbox(\n () => ({\n ...inputAriaProps(),\n isIndeterminate: local.isIndeterminate,\n children: typeof mergedProps.children === \"function\" ? true : mergedProps.children,\n }),\n state,\n inputElement,\n );\n isSelected = checkboxAria.isSelected;\n isPressed = checkboxAria.isPressed;\n labelProps = checkboxAria.labelProps;\n inputProps = () => checkboxAria.inputProps;\n }\n isDisabled = () => inputProps().disabled === true;\n isReadOnly = () => inputProps()[\"aria-readonly\"] === true;\n isInvalid = () => inputProps()[\"aria-invalid\"] === true;\n const describedBy = () => {\n const ids = [\n ariaProps[\"aria-describedby\"],\n local.description ? descriptionId : undefined,\n isInvalid() && local.errorMessage ? errorMessageId : undefined,\n ].filter(Boolean);\n return ids.length ? ids.join(\" \") : undefined;\n };\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled() || isReadOnly();\n },\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n });\n\n const renderValues = createMemo<CheckboxRenderProps>(() => ({\n isSelected: isSelected(),\n isIndeterminate: local.isIndeterminate ?? false,\n isHovered: isHovered(),\n isPressed: isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: isDisabled(),\n isReadOnly: isReadOnly(),\n isInvalid: isInvalid(),\n isRequired: ariaProps.isRequired ?? false,\n }));\n\n const renderProps = useRenderProps(\n {\n children: mergedProps.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Checkbox\",\n },\n renderValues,\n );\n const childRenderValues: CheckboxRenderProps = {\n get isSelected() {\n return isSelected();\n },\n get isIndeterminate() {\n return local.isIndeterminate ?? false;\n },\n get isHovered() {\n return isHovered();\n },\n get isPressed() {\n return isPressed();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return isDisabled();\n },\n get isReadOnly() {\n return isReadOnly();\n },\n get isInvalid() {\n return isInvalid();\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n };\n const checkboxChildren = () => {\n const children = mergedProps.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n const cleanLabelProps = () => {\n const { ref: _ref1, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanInputProps = () => {\n const {\n ref: _ref3,\n onFocus: _onFocus,\n onBlur: _onBlur,\n ...rest\n } = inputProps() as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const {\n ref: _ref4,\n onFocus: _onFocus,\n onBlur: _onBlur,\n ...rest\n } = focusProps as Record<string, unknown>;\n return rest;\n };\n const handleInputFocus: JSX.EventHandler<HTMLInputElement, FocusEvent> = (event) => {\n (\n inputProps() as unknown as { onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onFocus?.(event);\n (\n focusProps as unknown as { onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onFocus?.(event);\n };\n const handleInputBlur: JSX.EventHandler<HTMLInputElement, FocusEvent> = (event) => {\n (\n inputProps() as unknown as { onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onBlur?.(event);\n (focusProps as unknown as { onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent> }).onBlur?.(\n event,\n );\n };\n const setLabelRef = (el: HTMLLabelElement) => {\n assignRef(local.ref, el);\n };\n const setInputRef = (el: HTMLInputElement) => {\n setInputElement(el);\n for (const ref of inputRefs()) {\n assignRef(ref, el);\n }\n };\n const hiddenInput = (\n <VisuallyHidden>\n <input\n ref={setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n aria-describedby={describedBy()}\n />\n </VisuallyHidden>\n );\n const labelChildren = () => (\n <>\n {hiddenInput}\n {checkboxChildren()}\n <Show when={local.description}>\n <span id={descriptionId} slot=\"description\">\n {local.description}\n </span>\n </Show>\n <Show when={isInvalid() && local.errorMessage}>\n <span id={errorMessageId} slot=\"errorMessage\">\n {local.errorMessage}\n </span>\n </Show>\n </>\n );\n const rootProps = createMemo(\n () =>\n ({\n ...domProps(),\n ...cleanLabelProps(),\n ...cleanHoverProps(),\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-selected\": isSelected() || undefined,\n \"data-indeterminate\": local.isIndeterminate || undefined,\n \"data-pressed\": isPressed() || undefined,\n \"data-hovered\": isHovered() || undefined,\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": isFocusVisible() || undefined,\n \"data-disabled\": isDisabled() || undefined,\n \"data-readonly\": isReadOnly() || undefined,\n \"data-invalid\": isInvalid() || undefined,\n \"data-required\": ariaProps.isRequired || undefined,\n }) as JSX.LabelHTMLAttributes<HTMLLabelElement>,\n );\n const customRootProps = () =>\n ({\n ...rootProps(),\n ref: setLabelRef,\n children: labelChildren(),\n }) as JSX.LabelHTMLAttributes<HTMLLabelElement>;\n\n return local.render ? (\n local.render(customRootProps(), renderValues())\n ) : (\n <label\n {...domProps()}\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n ref={setLabelRef}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-selected={isSelected() || undefined}\n data-indeterminate={local.isIndeterminate || undefined}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={isDisabled() || undefined}\n data-readonly={isReadOnly() || undefined}\n data-invalid={isInvalid() || undefined}\n data-required={ariaProps.isRequired || undefined}\n >\n {labelChildren()}\n </label>\n );\n}\n","/**\n * FieldError primitive for solidaria-components.\n *\n * Displays validation errors for a field from context or explicit validation prop.\n * Port direction: react-aria-components/src/FieldError.tsx\n */\n\nimport { type JSX, Show, createContext, createMemo, splitProps, useContext } from \"solid-js\";\nimport { DEFAULT_VALIDATION_RESULT, type ValidationResult } from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type RenderChildren,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport type FieldErrorRenderProps = ValidationResult;\n\nexport interface FieldErrorContextValue {\n validation: ValidationResult | null;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n}\n\nexport interface FieldErrorProps\n extends Omit<JSX.HTMLAttributes<HTMLElement>, \"children\" | \"class\" | \"style\">, SlotProps {\n /** Validation result. Falls back to context when omitted. */\n validation?: ValidationResult | null;\n /** The children of the component. */\n children?: RenderChildren<FieldErrorRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<FieldErrorRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<FieldErrorRenderProps>;\n}\n\nexport const FieldErrorContext = createContext<ValidationResult | FieldErrorContextValue | null>(\n null,\n);\n\nexport function FieldError(props: FieldErrorProps): JSX.Element | null {\n const contextValue = useContext(FieldErrorContext);\n const contextValidation = () => {\n if (contextValue && \"validation\" in contextValue) {\n return contextValue.validation;\n }\n return contextValue;\n };\n const contextErrorMessageProps = () => {\n if (contextValue && \"validation\" in contextValue) {\n return contextValue.errorMessageProps ?? {};\n }\n return {};\n };\n const [local, domProps] = splitProps(props, [\"validation\", \"children\", \"class\", \"style\", \"slot\"]);\n\n const validation = createMemo<ValidationResult | null>(\n () => local.validation ?? contextValidation(),\n );\n\n const renderProps = useRenderProps(\n {\n children:\n local.children ?? ((currentValidation) => currentValidation.validationErrors.join(\" \")),\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-FieldError\",\n },\n () => validation() ?? DEFAULT_VALIDATION_RESULT,\n );\n\n const filteredDomProps = filterDOMProps(domProps, { global: true });\n const children = () => renderProps.renderChildren();\n\n return (\n <Show when={validation()?.isInvalid && children()}>\n <div\n {...(contextErrorMessageProps() as unknown as JSX.HTMLAttributes<HTMLDivElement>)}\n {...(filteredDomProps as JSX.HTMLAttributes<HTMLDivElement>)}\n slot={local.slot ?? \"errorMessage\"}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n {children()}\n </div>\n </Show>\n );\n}\n","/**\n * SharedElementTransition primitives for solidaria-components.\n *\n * Provides FLIP-based shared element animations when elements move between\n * parents within a scope. Captures geometry snapshots on unmount and applies\n * transition animations on mount.\n *\n * Parity target: react-aria-components/src/SharedElementTransition.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n useContext,\n Show,\n on,\n} from \"solid-js\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type RenderChildren,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype SharedElementLifecycle = \"hidden\" | \"entering\" | \"visible\" | \"exiting\";\n\n/** Safe wrapper — jsdom doesn't implement the Web Animations API. */\nfunction getAnimations(el: HTMLElement): Animation[] {\n return typeof el.getAnimations === \"function\" ? el.getAnimations() : [];\n}\n\ninterface Snapshot {\n rect: DOMRect;\n style: [string, string][];\n}\n\ninterface SharedElementScope {\n snapshots: { [name: string]: Snapshot };\n}\n\nconst SharedElementContext = createContext<SharedElementScope | null>(null);\n\nexport function useHasSharedElementTransitionScope(): boolean {\n return useContext(SharedElementContext) != null;\n}\n\nexport interface SharedElementTransitionProps {\n children?: JSX.Element;\n}\n\n/**\n * A scope for SharedElements, which animate between parents.\n */\nexport function SharedElementTransition(props: SharedElementTransitionProps): JSX.Element {\n const scope: SharedElementScope = {\n snapshots: {},\n };\n\n return (\n <SharedElementContext.Provider value={scope}>{props.children}</SharedElementContext.Provider>\n );\n}\n\nexport interface SharedElementRenderProps {\n isEntering: boolean;\n isExiting: boolean;\n}\n\nexport interface SharedElementPropsBase extends Omit<\n JSX.HTMLAttributes<HTMLDivElement>,\n \"children\" | \"class\" | \"style\" | \"ref\"\n> {\n children?: RenderChildren<SharedElementRenderProps>;\n class?: ClassNameOrFunction<SharedElementRenderProps>;\n style?: StyleOrFunction<SharedElementRenderProps>;\n}\n\nexport interface SharedElementProps extends SharedElementPropsBase {\n name: string;\n isVisible?: boolean;\n ref?: ((el: HTMLDivElement) => void) | { current?: HTMLDivElement };\n}\n\n/**\n * An element that animates between its old and new position when moving\n * between parents within a SharedElementTransition scope.\n */\nexport function SharedElement(props: SharedElementProps): JSX.Element | null {\n const scope = useContext(SharedElementContext);\n if (!scope) {\n throw new Error(\"<SharedElement> must be rendered inside a <SharedElementTransition>\");\n }\n\n const [local, domProps] = splitProps(props, [\n \"name\",\n \"isVisible\",\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n ]);\n\n const [lifecycle, setLifecycle] = createSignal<SharedElementLifecycle>(\n local.isVisible === false ? \"hidden\" : \"visible\",\n );\n\n let elementRef: HTMLDivElement | undefined;\n let frame: number | undefined;\n\n const setRef = (el: HTMLDivElement) => {\n elementRef = el;\n // Forward ref to consumer\n const userRef = local.ref;\n if (typeof userRef === \"function\") {\n userRef(el);\n } else if (userRef !== undefined) {\n userRef.current = el;\n }\n };\n\n // Handle visibility transitions with FLIP animation\n createEffect(\n on(\n () => local.isVisible !== false,\n (isVisible) => {\n const name = local.name;\n const element = elementRef;\n\n if (frame != null) {\n cancelAnimationFrame(frame);\n frame = undefined;\n }\n\n if (isVisible && element) {\n const prevSnapshot = scope.snapshots[name];\n\n if (prevSnapshot) {\n // FLIP: Element is transitioning from a previous instance.\n setLifecycle(\"visible\");\n const animations = getAnimations(element);\n\n // Set properties to animate from.\n const values = prevSnapshot.style.map(([property, prevValue]) => {\n const value = element.style.getPropertyValue(property);\n if (property === \"translate\") {\n const prevRect = prevSnapshot.rect;\n const currentRect = element.getBoundingClientRect();\n const deltaX = prevRect.left - currentRect.left;\n const deltaY = prevRect.top - currentRect.top;\n element.style.setProperty(\"translate\", `${deltaX}px ${deltaY}px`);\n } else {\n element.style.setProperty(property, prevValue);\n }\n return [property, value] as [string, string];\n });\n\n // Cancel any new animations triggered by these properties.\n for (const a of getAnimations(element)) {\n if (!animations.includes(a)) {\n a.cancel();\n }\n }\n\n // Remove overrides after one frame to animate to the current values.\n frame = requestAnimationFrame(() => {\n frame = undefined;\n for (const [property, value] of values) {\n element.style.setProperty(property, value);\n }\n });\n\n delete scope.snapshots[name];\n } else {\n // No previous instance exists, apply the entering state.\n queueMicrotask(() => setLifecycle(\"entering\"));\n frame = requestAnimationFrame(() => {\n frame = undefined;\n setLifecycle(\"visible\");\n });\n }\n } else if (!isVisible && element) {\n // Wait a microtask to check if a snapshot still exists (meaning no new\n // SharedElement consumed it), then enter exiting state.\n queueMicrotask(() => {\n if (scope.snapshots[name]) {\n delete scope.snapshots[name];\n setLifecycle(\"exiting\");\n // Wait for animations to finish before hiding.\n Promise.all(getAnimations(element).map((a) => a.finished))\n .then(() => setLifecycle(\"hidden\"))\n .catch(() => {});\n } else {\n // Snapshot was consumed by another instance, unmount immediately.\n setLifecycle(\"hidden\");\n }\n });\n } else if (isVisible) {\n // Element not yet in DOM, entering fresh\n setLifecycle(\"entering\");\n frame = requestAnimationFrame(() => {\n frame = undefined;\n setLifecycle(\"visible\");\n });\n }\n },\n ),\n );\n\n // Capture snapshot on cleanup (unmount)\n onCleanup(() => {\n if (frame != null) {\n cancelAnimationFrame(frame);\n }\n\n const element = elementRef;\n if (element && element.isConnected && !element.hasAttribute(\"data-exiting\")) {\n // Store a snapshot of the rectangle and computed style for transitioning properties.\n const style = window.getComputedStyle(element);\n if (style.transitionProperty !== \"none\") {\n const transitionProperty = style.transitionProperty.split(/\\s*,\\s*/);\n scope.snapshots[local.name] = {\n rect: element.getBoundingClientRect(),\n style: transitionProperty.map((property) => [property, style.getPropertyValue(property)]),\n };\n }\n }\n });\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SharedElement\",\n },\n () => ({\n isEntering: lifecycle() === \"entering\",\n isExiting: lifecycle() === \"exiting\",\n }),\n );\n\n const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n\n return (\n <Show when={lifecycle() !== \"hidden\"}>\n <div\n ref={setRef}\n {...filteredDomProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={lifecycle() === \"entering\" || undefined}\n data-exiting={lifecycle() === \"exiting\" || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </Show>\n );\n}\n","/**\n * Shared SelectionIndicator primitive for selected collection items.\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext, Show } from \"solid-js\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n} from \"./utils\";\nimport { SharedElement, useHasSharedElementTransitionScope } from \"./SharedElementTransition\";\n\nexport interface SelectionIndicatorContextValue {\n isSelected: () => boolean;\n}\n\nexport const SelectionIndicatorContext = createContext<SelectionIndicatorContextValue | null>(null);\n\nexport interface SelectionIndicatorRenderProps {\n /** Whether the parent item is selected. */\n isSelected: boolean;\n}\n\nexport interface SelectionIndicatorProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLSpanElement>, \"class\" | \"style\" | \"children\"> {\n /** Optional controlled selected state override. */\n isSelected?: boolean;\n /** Whether to keep mounted when not selected. */\n shouldForceMount?: boolean;\n /** The children content. */\n children?: RenderChildren<SelectionIndicatorRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectionIndicatorRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectionIndicatorRenderProps>;\n}\n\n/**\n * SelectionIndicator renders when its parent item is selected.\n */\nexport function SelectionIndicator(props: SelectionIndicatorProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"isSelected\",\n \"shouldForceMount\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n ]);\n\n const context = useContext(SelectionIndicatorContext);\n const hasSharedElementScope = useHasSharedElementTransitionScope();\n const isSelected = () => local.isSelected ?? context?.isSelected() ?? false;\n const isVisible = () => local.shouldForceMount || isSelected();\n\n const renderValues = createMemo<SelectionIndicatorRenderProps>(() => ({\n isSelected: isSelected(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SelectionIndicator\",\n },\n renderValues,\n );\n\n const sharedElementProps = createMemo(() => {\n const { ref: _ref, ...rest } = domProps as JSX.HTMLAttributes<HTMLSpanElement> & {\n ref?: unknown;\n };\n return rest;\n });\n\n if (hasSharedElementScope) {\n return (\n <SharedElement\n {...sharedElementProps()}\n name=\"SelectionIndicator\"\n isVisible={isVisible()}\n aria-hidden=\"true\"\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={isSelected() || undefined}\n >\n {renderProps.renderChildren()}\n </SharedElement>\n );\n }\n\n return (\n <Show when={isVisible()}>\n <span\n {...domProps}\n aria-hidden=\"true\"\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={isSelected() || undefined}\n >\n {renderProps.renderChildren()}\n </span>\n </Show>\n );\n}\n","/**\n * RadioGroup and Radio components for solidaria-components\n *\n * Pre-wired headless radio components that combine state + aria hooks.\n * Port of react-aria-components/src/RadioGroup.tsx\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport {\n createRadio,\n createRadioGroup,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaRadioProps,\n type AriaRadioGroupProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRadioGroupState,\n VALID_VALIDITY_STATE,\n type RadioGroupState,\n type RadioGroupProps as RadioGroupStateProps,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nconst validValidation: ValidationResult = {\n isInvalid: false,\n validationDetails: VALID_VALIDITY_STATE,\n validationErrors: [],\n};\n\nfunction getNativeValidation(input: HTMLInputElement): ValidationResult {\n return {\n isInvalid: !input.validity.valid,\n validationDetails: {\n badInput: input.validity.badInput,\n customError: input.validity.customError,\n patternMismatch: input.validity.patternMismatch,\n rangeOverflow: input.validity.rangeOverflow,\n rangeUnderflow: input.validity.rangeUnderflow,\n stepMismatch: input.validity.stepMismatch,\n tooLong: input.validity.tooLong,\n tooShort: input.validity.tooShort,\n typeMismatch: input.validity.typeMismatch,\n valueMissing: input.validity.valueMissing,\n valid: input.validity.valid,\n },\n validationErrors: input.validationMessage ? [input.validationMessage] : [],\n };\n}\n\nexport type Orientation = \"horizontal\" | \"vertical\";\n\nexport interface RadioGroupRenderProps {\n /** The orientation of the radio group. */\n orientation: Orientation;\n /** Whether the radio group is disabled. */\n isDisabled: boolean;\n /** Whether the radio group is read only. */\n isReadOnly: boolean;\n /** Whether the radio group is required. */\n isRequired: boolean;\n /** Whether the radio group is invalid. */\n isInvalid: boolean;\n /** State of the radio group. */\n state: RadioGroupState;\n}\n\nexport interface RadioRenderProps {\n /** Whether the radio is selected. */\n isSelected: boolean;\n /** Whether the radio is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the radio is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the radio is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the radio is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the radio is disabled. */\n isDisabled: boolean;\n /** Whether the radio is read only. */\n isReadOnly: boolean;\n /** Whether the radio is invalid. */\n isInvalid: boolean;\n /** Whether the radio is required. */\n isRequired: boolean;\n}\n\nexport interface RadioGroupProps\n extends\n Omit<AriaRadioGroupProps, \"children\" | \"label\" | \"description\" | \"errorMessage\">,\n Pick<\n RadioGroupStateProps,\n \"value\" | \"defaultValue\" | \"onChange\" | \"validationState\" | \"validate\"\n >,\n SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RadioGroupRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RadioGroupRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RadioGroupRenderProps>;\n /** Custom renderer for the outer radio group element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLDivElement>,\n renderProps: RadioGroupRenderProps,\n ) => JSX.Element;\n /** Ref for the radio group element. */\n ref?: RefLike<HTMLDivElement>;\n /** A description for the radio group. */\n description?: JSX.Element;\n /** An error message for the radio group. */\n errorMessage?: JSX.Element;\n}\n\nexport interface RadioProps extends Omit<AriaRadioProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RadioRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RadioRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RadioRenderProps>;\n /** Custom renderer for the outer radio label element. */\n render?: (\n props: JSX.LabelHTMLAttributes<HTMLLabelElement>,\n renderProps: RadioRenderProps,\n ) => JSX.Element;\n /** Ref for the outer label element. */\n ref?: RefLike<HTMLLabelElement>;\n /** Ref for the underlying input element. */\n inputRef?: RefLike<HTMLInputElement>;\n /** A description for the radio. */\n description?: JSX.Element;\n /** An error message for the radio. */\n errorMessage?: JSX.Element;\n /** Handler called when hover starts. */\n onHoverStart?: () => void;\n /** Handler called when hover ends. */\n onHoverEnd?: () => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n}\n\nexport interface RadioGroupContextValue extends RadioGroupProps {\n slots?: Record<string, RadioGroupProps>;\n}\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\nexport interface RadioContextValue extends RadioProps {\n slots?: Record<string, RadioProps>;\n}\nexport const RadioContext = createContext<RadioContextValue | null>(null);\n\n/**\n * A radio group allows a user to select a single item from a list of mutually exclusive options.\n *\n * @example\n * ```tsx\n * <RadioGroup>\n * <Radio value=\"one\">Option 1</Radio>\n * <Radio value=\"two\">Option 2</Radio>\n * </RadioGroup>\n * ```\n */\nexport function RadioGroup(props: ParentProps<RadioGroupProps>): JSX.Element {\n const contextProps = useContext(RadioGroupContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<RadioGroupProps>(() => {\n if (!contextProps) return {};\n const { slots: _slots, ...rest } = contextProps;\n return rest;\n });\n const mergedProps = contextProps\n ? (mergeProps(\n contextBaseProps(),\n contextSlotProps ?? {},\n props,\n ) as ParentProps<RadioGroupProps>)\n : props;\n const [local, ariaProps] = splitProps(mergedProps, [\"class\", \"style\", \"render\", \"ref\", \"slot\"]);\n\n const state = createRadioGroupState(() => ({\n value: mergedProps.value,\n defaultValue: mergedProps.defaultValue,\n onChange: mergedProps.onChange,\n isDisabled: mergedProps.isDisabled,\n isReadOnly: mergedProps.isReadOnly,\n isRequired: mergedProps.isRequired,\n isInvalid: mergedProps.isInvalid,\n validationState: mergedProps.validationState,\n validate: mergedProps.validate,\n validationBehavior: mergedProps.validationBehavior,\n name: mergedProps.name,\n form: mergedProps.form,\n }));\n\n // Create radio group aria props\n const groupAria = createRadioGroup(\n () => ({\n ...ariaProps,\n description: mergedProps.description,\n errorMessage: mergedProps.errorMessage,\n }),\n state,\n );\n const isInvalid = createMemo(() => state.isInvalid);\n const validation = createMemo(() => state.displayValidation());\n const fallbackErrorMessageId = createUniqueId();\n const errorMessageId = () => groupAria.errorMessageProps.id ?? fallbackErrorMessageId;\n\n const renderValues = createMemo<RadioGroupRenderProps>(() => ({\n orientation: (ariaProps.orientation as Orientation) ?? \"vertical\",\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: isInvalid(),\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RadioGroup\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = groupAria.radioGroupProps as Record<string, unknown>;\n return rest;\n };\n const handleGroupFocusIn: JSX.EventHandler<HTMLDivElement, FocusEvent> = (event) => {\n (\n groupAria.radioGroupProps as unknown as {\n onFocus?: JSX.EventHandler<HTMLDivElement, FocusEvent>;\n }\n ).onFocus?.(event);\n };\n const handleGroupFocusOut: JSX.EventHandler<HTMLDivElement, FocusEvent> = (event) => {\n (\n groupAria.radioGroupProps as unknown as {\n onBlur?: JSX.EventHandler<HTMLDivElement, FocusEvent>;\n }\n ).onBlur?.(event);\n };\n const handleGroupInvalidCapture: JSX.EventHandler<HTMLDivElement, Event> = (event) => {\n const target = event.target;\n if (!(target instanceof HTMLInputElement) || target.type !== \"radio\") {\n return;\n }\n\n state.updateValidation(getNativeValidation(target));\n state.commitValidation();\n target.focus();\n event.preventDefault();\n };\n const handleGroupChangeCapture: JSX.EventHandler<HTMLDivElement, Event> = (event) => {\n const target = event.target;\n if (!(target instanceof HTMLInputElement) || target.type !== \"radio\") {\n return;\n }\n\n state.updateValidation(target.validity.valid ? validValidation : getNativeValidation(target));\n state.commitValidation();\n };\n const setGroupRef = (el: HTMLDivElement) => {\n assignRef(local.ref, el);\n };\n const groupDescribedBy = () => {\n const ids = [\n (cleanGroupProps() as { \"aria-describedby\"?: string })[\"aria-describedby\"],\n mergedProps.description ? groupAria.descriptionProps.id : undefined,\n isInvalid() && (mergedProps.errorMessage || validation().validationErrors.length > 0)\n ? errorMessageId()\n : undefined,\n ]\n .filter(Boolean)\n .join(\" \")\n .split(\" \")\n .filter(Boolean);\n return ids.length ? Array.from(new Set(ids)).join(\" \") : undefined;\n };\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return validation();\n },\n get errorMessageProps() {\n return {\n ...groupAria.errorMessageProps,\n id: errorMessageId(),\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n\n const GroupChildren = () => {\n const childRenderValues: RadioGroupRenderProps = {\n get orientation() {\n return (ariaProps.orientation as Orientation) ?? \"vertical\";\n },\n get isDisabled() {\n return state.isDisabled;\n },\n get isReadOnly() {\n return state.isReadOnly;\n },\n get isRequired() {\n return state.isRequired;\n },\n get isInvalid() {\n return isInvalid();\n },\n get state() {\n return state;\n },\n };\n const renderedChildren = createMemo(() => {\n const children = props.children;\n if (typeof children === \"function\") {\n return children.length > 0\n ? children(childRenderValues)\n : (children as unknown as () => JSX.Element)();\n }\n return children;\n });\n\n return (\n <>\n {renderedChildren()}\n <Show when={mergedProps.description}>\n <div {...(groupAria.descriptionProps as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {mergedProps.description}\n </div>\n </Show>\n <Show when={isInvalid() && mergedProps.errorMessage}>\n <div {...(groupAria.errorMessageProps as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {mergedProps.errorMessage}\n </div>\n </Show>\n </>\n );\n };\n const groupEventProps = {\n onInvalidCapture: handleGroupInvalidCapture,\n onChangeCapture: handleGroupChangeCapture,\n } as unknown as JSX.HTMLAttributes<HTMLDivElement>;\n const customRootProps = () =>\n ({\n ...domProps(),\n ...cleanGroupProps(),\n ...groupEventProps,\n ref: setGroupRef,\n onFocusIn: handleGroupFocusIn,\n onFocusOut: handleGroupFocusOut,\n \"aria-describedby\": groupDescribedBy(),\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-orientation\": ariaProps.orientation ?? \"vertical\",\n \"data-disabled\": state.isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-required\": state.isRequired || undefined,\n \"data-invalid\": isInvalid() || undefined,\n children: <GroupChildren />,\n }) as unknown as JSX.HTMLAttributes<HTMLDivElement>;\n\n return (\n <RadioGroupStateContext.Provider value={state}>\n <FieldErrorContext.Provider value={fieldErrorContext}>\n {local.render ? (\n local.render(customRootProps(), renderValues())\n ) : (\n <div\n {...domProps()}\n {...cleanGroupProps()}\n {...groupEventProps}\n ref={setGroupRef}\n onFocusIn={handleGroupFocusIn}\n onFocusOut={handleGroupFocusOut}\n aria-describedby={groupDescribedBy()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-orientation={ariaProps.orientation ?? \"vertical\"}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={state.isRequired || undefined}\n data-invalid={isInvalid() || undefined}\n >\n <GroupChildren />\n </div>\n )}\n </FieldErrorContext.Provider>\n </RadioGroupStateContext.Provider>\n );\n}\n\n/**\n * Internal Radio implementation that has access to RadioGroupStateContext.\n * This is rendered inside the RadioGroup's context provider.\n */\nfunction RadioImpl(props: { radioProps: RadioProps; state: RadioGroupState }): JSX.Element {\n const [inputElement, setInputElement] = createSignal<HTMLInputElement | null>(null);\n const { state } = props;\n const contextProps = useContext(RadioContext);\n const contextSlotProps = contextProps?.slots?.[props.radioProps.slot ?? \"default\"];\n const contextBaseProps = createMemo<RadioProps>(() => {\n if (!contextProps) return {} as RadioProps;\n const { slots: _slots, ...rest } = contextProps;\n return rest as RadioProps;\n });\n const radioProps = contextProps\n ? (mergeProps(contextBaseProps(), contextSlotProps ?? {}, props.radioProps) as RadioProps)\n : props.radioProps;\n const inputRefs = createMemo(\n () =>\n [contextBaseProps().inputRef, contextSlotProps?.inputRef, props.radioProps.inputRef].filter(\n Boolean,\n ) as RefLike<HTMLInputElement>[],\n );\n\n const [local, ariaProps] = splitProps(radioProps, [\n \"class\",\n \"style\",\n \"render\",\n \"ref\",\n \"inputRef\",\n \"slot\",\n \"description\",\n \"errorMessage\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n const descriptionId = createUniqueId();\n const errorMessageId = createUniqueId();\n const describedBy = () => {\n const ids = [\n ariaProps[\"aria-describedby\"],\n local.description ? descriptionId : undefined,\n state.isInvalid && local.errorMessage ? errorMessageId : undefined,\n ].filter(Boolean);\n return ids.length ? ids.join(\" \") : undefined;\n };\n const inputAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n // Create radio aria props\n const radioAria = createRadio(\n () => ({\n ...inputAriaProps(),\n \"aria-describedby\": describedBy(),\n children: typeof radioProps.children === \"function\" ? true : radioProps.children,\n }),\n state,\n inputElement,\n );\n\n // Create focus ring\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return radioAria.isDisabled || state.isReadOnly;\n },\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n });\n\n const renderValues = createMemo<RadioRenderProps>(() => ({\n isSelected: radioAria.isSelected(),\n isHovered: isHovered(),\n isPressed: radioAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: radioAria.isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired,\n }));\n\n const renderProps = useRenderProps(\n {\n children: radioProps.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Radio\",\n },\n renderValues,\n );\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: radioAria.isSelected,\n }));\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n const cleanLabelProps = () => {\n const { ref: _ref1, ...rest } = radioAria.labelProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanInputProps = () => {\n const {\n ref: _ref3,\n onFocus: _onFocus,\n onBlur: _onBlur,\n ...rest\n } = radioAria.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const {\n ref: _ref4,\n onFocus: _onFocus,\n onBlur: _onBlur,\n ...rest\n } = focusProps as Record<string, unknown>;\n return rest;\n };\n const handleInputFocus: JSX.EventHandler<HTMLInputElement, FocusEvent> = (event) => {\n (\n radioAria.inputProps as unknown as {\n onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent>;\n }\n ).onFocus?.(event);\n (\n focusProps as unknown as { onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onFocus?.(event);\n };\n const handleInputBlur: JSX.EventHandler<HTMLInputElement, FocusEvent> = (event) => {\n (\n radioAria.inputProps as unknown as { onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onBlur?.(event);\n (focusProps as unknown as { onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent> }).onBlur?.(\n event,\n );\n };\n const handleLabelClick: JSX.EventHandler<HTMLLabelElement, MouseEvent> = (event) => {\n (ariaProps as unknown as { onClickCapture?: (event: MouseEvent) => void }).onClickCapture?.(\n event as unknown as MouseEvent,\n );\n (\n radioAria.labelProps as unknown as {\n onClick?: JSX.EventHandler<HTMLLabelElement, MouseEvent>;\n }\n ).onClick?.(event);\n };\n const handleLabelClickCapture: JSX.EventHandler<HTMLLabelElement, MouseEvent> = (event) => {\n (ariaProps as unknown as { onClickCapture?: (event: MouseEvent) => void }).onClickCapture?.(\n event as unknown as MouseEvent,\n );\n };\n const handleInputClick: JSX.EventHandler<HTMLInputElement, MouseEvent> = (event) => {\n (\n radioAria.inputProps as unknown as {\n onClick?: JSX.EventHandler<HTMLInputElement, MouseEvent>;\n }\n ).onClick?.(event);\n };\n const handleInputInvalid: JSX.EventHandler<HTMLInputElement, Event> = (event) => {\n state.updateValidation(getNativeValidation(event.currentTarget));\n state.commitValidation();\n event.currentTarget.focus();\n event.preventDefault();\n };\n const handleInputChange: JSX.EventHandler<HTMLInputElement, Event> = (event) => {\n (\n radioAria.inputProps as unknown as { onChange?: JSX.EventHandler<HTMLInputElement, Event> }\n ).onChange?.(event);\n state.updateValidation(\n event.currentTarget.validity.valid\n ? validValidation\n : getNativeValidation(event.currentTarget),\n );\n state.commitValidation();\n };\n const setLabelRef = (el: HTMLLabelElement) => {\n assignRef(local.ref, el);\n };\n const setInputRef = (el: HTMLInputElement) => {\n setInputElement(el);\n el.addEventListener(\"invalid\", (event) => {\n state.updateValidation(getNativeValidation(el));\n state.commitValidation();\n el.focus();\n event.preventDefault();\n });\n el.addEventListener(\"change\", () => {\n state.updateValidation(el.validity.valid ? validValidation : getNativeValidation(el));\n state.commitValidation();\n });\n for (const ref of inputRefs()) {\n assignRef(ref, el);\n }\n };\n const hiddenInput = (\n <VisuallyHidden>\n <input\n ref={setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n onInvalid={handleInputInvalid}\n onChange={handleInputChange}\n onClick={handleInputClick}\n />\n </VisuallyHidden>\n );\n const labelChildren = () => (\n <>\n {hiddenInput}\n {renderProps.renderChildren()}\n <Show when={local.description}>\n <span id={descriptionId} slot=\"description\">\n {local.description}\n </span>\n </Show>\n <Show when={state.isInvalid && local.errorMessage}>\n <span id={errorMessageId} slot=\"errorMessage\">\n {local.errorMessage}\n </span>\n </Show>\n </>\n );\n const customLabelProps = () =>\n ({\n ...domProps(),\n ...cleanLabelProps(),\n ...cleanHoverProps(),\n ref: setLabelRef,\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n onClick: handleLabelClick,\n onClickCapture: handleLabelClickCapture,\n \"data-selected\": radioAria.isSelected() || undefined,\n \"data-pressed\": radioAria.isPressed() || undefined,\n \"data-hovered\": isHovered() || undefined,\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": isFocusVisible() || undefined,\n \"data-disabled\": radioAria.isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-invalid\": state.isInvalid || undefined,\n \"data-required\": state.isRequired || undefined,\n children: labelChildren(),\n }) as unknown as JSX.LabelHTMLAttributes<HTMLLabelElement>;\n const labelCaptureProps = {\n onClickCapture: handleLabelClickCapture,\n } as unknown as JSX.LabelHTMLAttributes<HTMLLabelElement>;\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n {local.render ? (\n local.render(customLabelProps(), renderValues())\n ) : (\n <label\n {...domProps()}\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n ref={setLabelRef}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n onClick={handleLabelClick}\n {...labelCaptureProps}\n data-selected={radioAria.isSelected() || undefined}\n data-pressed={radioAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={radioAria.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}\n >\n {labelChildren()}\n </label>\n )}\n </SelectionIndicatorContext.Provider>\n );\n}\n\n/**\n * A radio represents an individual option within a radio group.\n *\n * @example\n * ```tsx\n * <Radio value=\"option1\">\n * {({ isSelected }) => (\n * <>\n * <span class={`radio ${isSelected ? 'selected' : ''}`}>\n * {isSelected && '●'}\n * </span>\n * <span>Option 1</span>\n * </>\n * )}\n * </Radio>\n * ```\n */\nexport function Radio(props: RadioProps): JSX.Element {\n // Get context - will be null if not inside RadioGroup\n // The context is accessed reactively to work with solid-refresh HMR\n const getState = createMemo(() => useContext(RadioGroupStateContext));\n\n return (\n <Show when={getState()} fallback={null} keyed>\n {(state) => <RadioImpl radioProps={props} state={state} />}\n </Show>\n );\n}\n","/**\n * TextField component for solidaria-components\n *\n * A pre-wired headless text field that combines state + aria hooks.\n * Port of react-aria-components/src/TextField.tsx\n */\n\nimport {\n type JSX,\n createContext,\n useContext,\n createMemo,\n createSignal,\n createEffect,\n onCleanup,\n onMount,\n splitProps,\n untrack,\n} from \"solid-js\";\nimport {\n createTextField,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaTextFieldProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createTextFieldState,\n VALID_VALIDITY_STATE,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface TextFieldRenderProps {\n /** Whether the text field is disabled. */\n isDisabled: boolean;\n /** Whether the value is invalid. */\n isInvalid: boolean;\n /** Whether the text field is read only. */\n isReadOnly: boolean;\n /** Whether the text field is required. */\n isRequired: boolean;\n /** Whether the text field is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the text field is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the text field is keyboard focused. */\n isFocusVisible: boolean;\n}\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<TextFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TextFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TextFieldRenderProps>;\n /** Custom renderer for the outer text field element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLDivElement>,\n renderProps: TextFieldRenderProps,\n ) => JSX.Element;\n}\n\nexport interface TextFieldContextValue {\n labelProps?: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n inputProps?: JSX.InputHTMLAttributes<HTMLInputElement>;\n descriptionProps?: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n isInvalid?: boolean;\n slots?: Record<string, TextFieldProps>;\n inputId?: string;\n}\n\nexport const TextFieldContext = createContext<TextFieldContextValue | null>(null);\nexport const LabelContext = TextFieldContext;\nexport const InputContext = TextFieldContext;\nexport const TextAreaContext = TextFieldContext;\nexport const FieldInputContext = TextFieldContext;\n\nfunction withFormValidationBehavior(\n props: TextFieldProps,\n formContext: FormProps | null,\n): TextFieldProps {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nexport interface LabelProps extends JSX.LabelHTMLAttributes<HTMLLabelElement> {\n children?: JSX.Element;\n}\n\n/**\n * A label element that automatically wires up to the parent TextField context.\n * This enables the proper htmlFor/id relationship between label and input.\n */\nexport function Label(props: LabelProps): JSX.Element {\n const context = useContext(TextFieldContext);\n\n // Merge context labelProps with local props (local props take precedence)\n const mergedProps = () => {\n if (context) {\n const { ref: _ref, ...contextLabelProps } = (context.labelProps ?? {}) as Record<\n string,\n unknown\n >;\n const merged = {\n ...contextLabelProps,\n ...(context.inputId ? { for: context.inputId } : {}),\n ...props,\n } as Record<string, unknown>;\n if (merged.class == null) {\n merged.class = \"solidaria-Label\";\n }\n return merged;\n }\n return props.class == null ? { ...props, class: \"solidaria-Label\" } : props;\n };\n\n return <label {...mergedProps()}>{props.children}</label>;\n}\n\nexport interface InputProps extends Omit<JSX.InputHTMLAttributes<HTMLInputElement>, \"children\"> {}\n\nfunction eventWithCurrentTarget<T extends HTMLElement>(event: Event, element: T): Event {\n return new Proxy(event, {\n get(target, property, receiver) {\n if (property === \"target\" || property === \"currentTarget\") {\n return element;\n }\n\n const value = Reflect.get(target, property, receiver);\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n}\n\nfunction clearDelegatedTextEntryHandlers(element: HTMLElement) {\n const delegatedElement = element as HTMLElement & {\n $$input?: unknown;\n $$change?: unknown;\n };\n delete delegatedElement.$$input;\n delete delegatedElement.$$change;\n}\n\n/**\n * An input element that automatically wires up to the parent TextField context.\n * This enables focus tracking, validation, and accessibility props to flow from\n * the TextField to the actual input element.\n */\nexport function Input(props: InputProps): JSX.Element {\n const context = useContext(TextFieldContext);\n let inputElement: HTMLInputElement | undefined;\n\n // Merge context inputProps with local props (local props take precedence)\n const mergedProps = () => {\n if (context) {\n // Remove ref from context props to avoid conflicts\n const { ref: _ref, ...contextInputProps } = (context.inputProps ?? {}) as Record<\n string,\n unknown\n >;\n const merged = { ...contextInputProps, ...props } as Record<string, unknown>;\n if (merged.class == null) {\n merged.class = \"solidaria-Input\";\n }\n return merged;\n }\n return props.class == null ? { ...props, class: \"solidaria-Input\" } : props;\n };\n\n onMount(() => {\n const element = inputElement;\n if (!element) {\n return;\n }\n\n const inputHandler = (event: Event) => {\n const handler = mergedProps().onInput as\n | JSX.EventHandler<HTMLInputElement, InputEvent>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as InputEvent & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n const changeHandler = (event: Event) => {\n const handler = mergedProps().onChange as\n | JSX.EventHandler<HTMLInputElement, Event>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as Event & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n\n element.addEventListener(\"input\", inputHandler);\n element.addEventListener(\"change\", changeHandler);\n clearDelegatedTextEntryHandlers(element);\n onCleanup(() => {\n element.removeEventListener(\"input\", inputHandler);\n element.removeEventListener(\"change\", changeHandler);\n });\n });\n\n return (\n <input\n {...mergedProps()}\n ref={(element) => {\n inputElement = element;\n const ref = props.ref;\n if (typeof ref === \"function\") {\n ref(element);\n }\n }}\n />\n );\n}\n\nexport interface TextAreaProps extends Omit<\n JSX.TextareaHTMLAttributes<HTMLTextAreaElement>,\n \"children\"\n> {}\n\n/**\n * A textarea element that automatically wires up to the parent TextField context.\n * This enables focus tracking, validation, and accessibility props to flow from\n * the TextField to the actual textarea element.\n */\nexport function TextArea(props: TextAreaProps): JSX.Element {\n const context = useContext(TextFieldContext);\n let textAreaElement: HTMLTextAreaElement | undefined;\n\n // Merge context inputProps with local props (local props take precedence)\n // Note: TextArea uses inputProps from context since it's an input variant\n const mergedProps = () => {\n if (context) {\n const {\n ref: _ref,\n type: _type,\n ...contextInputProps\n } = (context.inputProps ?? {}) as Record<string, unknown>;\n const merged = { ...contextInputProps, ...props } as Record<string, unknown>;\n if (merged.class == null) {\n merged.class = \"solidaria-TextArea\";\n }\n return merged;\n }\n return props.class == null ? { ...props, class: \"solidaria-TextArea\" } : props;\n };\n\n onMount(() => {\n const element = textAreaElement;\n if (!element) {\n return;\n }\n\n const inputHandler = (event: Event) => {\n const handler = mergedProps().onInput as\n | JSX.EventHandler<HTMLTextAreaElement, InputEvent>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as InputEvent & {\n currentTarget: HTMLTextAreaElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n const changeHandler = (event: Event) => {\n const handler = mergedProps().onChange as\n | JSX.EventHandler<HTMLTextAreaElement, Event>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as Event & {\n currentTarget: HTMLTextAreaElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n\n element.addEventListener(\"input\", inputHandler);\n element.addEventListener(\"change\", changeHandler);\n clearDelegatedTextEntryHandlers(element);\n onCleanup(() => {\n element.removeEventListener(\"input\", inputHandler);\n element.removeEventListener(\"change\", changeHandler);\n });\n });\n\n return (\n <textarea\n {...mergedProps()}\n ref={(element) => {\n textAreaElement = element;\n const ref = props.ref;\n if (typeof ref === \"function\") {\n ref(element);\n }\n }}\n />\n );\n}\n\n/**\n * A text field allows a user to enter a plain text value with a keyboard.\n *\n * This is a headless component that provides accessibility and state management.\n * Style it using the render props pattern or data attributes.\n *\n * @example\n * ```tsx\n * <TextField>\n * {({ isInvalid }) => (\n * <>\n * <Label>Email</Label>\n * <Input class={isInvalid ? 'border-red-500' : 'border-gray-300'} />\n * </>\n * )}\n * </TextField>\n * ```\n */\nexport function TextField(props: TextFieldProps): JSX.Element {\n const formContext = useContext(FormContext);\n const contextProps = useContext(TextFieldContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<TextFieldProps>(() => {\n if (!contextProps) return {};\n const {\n labelProps: _labelProps,\n inputProps: _inputProps,\n descriptionProps: _descriptionProps,\n errorMessageProps: _errorMessageProps,\n isInvalid: _isInvalid,\n slots: _slots,\n ...rest\n } = contextProps;\n return rest as TextFieldProps;\n });\n const baseProps = (\n contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props\n ) as TextFieldProps;\n const mergedProps = withFormValidationBehavior(baseProps, formContext);\n\n const [local, ariaProps] = splitProps(mergedProps, [\n \"children\",\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n ]);\n\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createTextFieldState({\n get value() {\n return ariaProps.value;\n },\n get defaultValue() {\n return ariaProps.defaultValue;\n },\n get onChange() {\n return ariaProps.onChange;\n },\n });\n\n const inputAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n const textFieldAria = createTextField(() => ({\n ...inputAriaProps(),\n value: state.value(),\n onChange: state.setValue,\n }));\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n });\n\n const renderValues = createMemo<TextFieldRenderProps>(() => ({\n isDisabled: ariaProps.isDisabled || false,\n isInvalid: textFieldAria.isInvalid,\n isReadOnly: ariaProps.isReadOnly || false,\n isRequired: ariaProps.isRequired || false,\n isHovered: isHovered(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TextField\",\n },\n renderValues,\n );\n const childRenderValues: TextFieldRenderProps = {\n get isDisabled() {\n return ariaProps.isDisabled || false;\n },\n get isInvalid() {\n return textFieldAria.isInvalid;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly || false;\n },\n get isRequired() {\n return ariaProps.isRequired || false;\n },\n get isHovered() {\n return isHovered();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n };\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n return filtered;\n });\n\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n // Context value for sub-components.\n // Use property getters so sub-components always read the latest aria/focus state.\n const fieldValidation = createMemo<ValidationResult>(() => {\n const isInvalid = textFieldAria.isInvalid;\n const errorMessage = ariaProps.errorMessage;\n const validationErrors = isInvalid && typeof errorMessage === \"string\" ? [errorMessage] : [];\n\n return {\n isInvalid,\n validationErrors,\n validationDetails: isInvalid\n ? { ...VALID_VALIDITY_STATE, customError: true, valid: false }\n : VALID_VALIDITY_STATE,\n };\n });\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return fieldValidation();\n },\n get errorMessageProps() {\n return textFieldAria.errorMessageProps as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n const contextValue: TextFieldContextValue = {\n get labelProps() {\n return textFieldAria.labelProps as JSX.LabelHTMLAttributes<HTMLLabelElement>;\n },\n get inputProps() {\n return mergeProps(\n textFieldAria.inputProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n get descriptionProps() {\n return textFieldAria.descriptionProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get errorMessageProps() {\n return textFieldAria.errorMessageProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get isInvalid() {\n return textFieldAria.isInvalid;\n },\n // Deterministic at render (createTextField generates it via createUniqueId),\n // so the Label's `for` is stable across SSR + hydration. A signal set from an\n // onMount effect would flip undefined->id post-mount and re-execute the Label\n // template — crashing hydration if the re-run lands mid-hydration (dev).\n get inputId() {\n return (textFieldAria.inputProps as { id?: string }).id;\n },\n };\n // Resolve the render-prop children ONCE (untracked). Re-invoking it on a\n // reactive update re-clones its templates; if that lands mid-hydration it\n // throws a Hydration Mismatch (worst in dev, where slow unbundled modules widen\n // the hydration window). The children carry their own fine-grained reactivity\n // (render-value getters + <Show>s), so they update without being re-created.\n const fieldChildren = untrack(() => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n });\n const rootProps = () =>\n ({\n ...domProps(),\n ...cleanHoverProps(),\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-disabled\": ariaProps.isDisabled || undefined,\n \"data-invalid\": textFieldAria.isInvalid || undefined,\n \"data-readonly\": ariaProps.isReadOnly || undefined,\n \"data-required\": ariaProps.isRequired || undefined,\n \"data-hovered\": isHovered() || undefined,\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": isFocusVisible() || undefined,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n const customRootProps = () =>\n ({\n ...rootProps(),\n children: fieldChildren,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n\n return (\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <TextFieldContext.Provider value={contextValue}>\n {local.render ? (\n local.render(customRootProps(), renderValues())\n ) : (\n <div {...rootProps()}>{fieldChildren}</div>\n )}\n </TextFieldContext.Provider>\n </FieldErrorContext.Provider>\n );\n}\n","import { type JSX, createContext } from \"solid-js\";\nimport type { SlotProps } from \"./utils\";\n\nexport interface TextProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport const TextContext = createContext<null>(null);\n\nexport function Text(props: TextProps): JSX.Element {\n return (\n <span class={props.class ?? \"solidaria-Text\"} style={props.style}>\n {props.children}\n </span>\n );\n}\n","/**\n * RouterProvider for solidaria-components\n *\n * A context provider for client-side router integration.\n * SolidJS apps typically use TanStack Router or SolidRouter directly;\n * this provides API compatibility with React Aria's RouterProvider.\n */\n\nimport { type JSX, createContext, useContext } from \"solid-js\";\n\nexport interface RouterClickModifiers {\n metaKey?: boolean;\n ctrlKey?: boolean;\n altKey?: boolean;\n shiftKey?: boolean;\n}\n\nexport interface RouterContextValue {\n /** Whether the router is a native browser router (no client-side navigation). */\n isNative: boolean;\n /** Navigate to a given href. */\n navigate: (href: string, routerOptions?: RouterOptions) => void;\n /** Open a link target with router-aware navigation behavior. */\n open: (\n target: Element,\n modifiers: RouterClickModifiers,\n href: string,\n routerOptions?: RouterOptions,\n ) => void;\n /** Transform an href for the router. */\n useHref: (href: string) => string;\n}\n\nexport interface RouterOptions {\n /** Whether to replace the current history entry. */\n replace?: boolean;\n /** Additional router-specific options. */\n [key: string]: unknown;\n}\n\nexport interface RouterProviderProps {\n /** A function that performs client-side navigation. */\n navigate: (href: string, routerOptions?: RouterOptions) => void;\n /** An optional function that transforms hrefs. */\n useHref?: (href: string) => string;\n /** Children to render. */\n children: JSX.Element;\n}\n\nconst defaultRouter: RouterContextValue = {\n isNative: true,\n navigate: () => {},\n open: (target, modifiers) => {\n openSyntheticLink(target, modifiers);\n },\n useHref: (href: string) => href,\n};\n\nexport const RouterContext = createContext<RouterContextValue>(defaultRouter);\n\nexport interface LinkDOMProps {\n href?: string;\n target?: string;\n rel?: string;\n download?: string | boolean;\n ping?: string;\n referrerPolicy?:\n | \"\"\n | \"no-referrer\"\n | \"no-referrer-when-downgrade\"\n | \"origin\"\n | \"origin-when-cross-origin\"\n | \"same-origin\"\n | \"strict-origin\"\n | \"strict-origin-when-cross-origin\"\n | \"unsafe-url\";\n}\n\nexport function shouldClientNavigate(\n link: HTMLAnchorElement,\n modifiers: RouterClickModifiers,\n): boolean {\n const target = link.getAttribute(\"target\");\n const sameOrigin = typeof location === \"undefined\" ? true : link.origin === location.origin;\n return (\n (!target || target === \"_self\") &&\n sameOrigin &&\n !link.hasAttribute(\"download\") &&\n !modifiers.metaKey &&\n !modifiers.ctrlKey &&\n !modifiers.altKey &&\n !modifiers.shiftKey\n );\n}\n\nexport function openLink(target: HTMLAnchorElement, modifiers: RouterClickModifiers): void {\n const event = new MouseEvent(\"click\", {\n metaKey: modifiers.metaKey,\n ctrlKey: modifiers.ctrlKey,\n altKey: modifiers.altKey,\n shiftKey: modifiers.shiftKey,\n detail: 1,\n bubbles: true,\n cancelable: true,\n });\n target.dispatchEvent(event);\n}\n\nfunction getSyntheticLink(target: Element, open: (link: HTMLAnchorElement) => void): void {\n if (target instanceof HTMLAnchorElement) {\n open(target);\n return;\n }\n\n const href = target.getAttribute(\"data-href\");\n if (!href) {\n return;\n }\n\n const link = document.createElement(\"a\");\n link.href = href;\n\n const targetValue = target.getAttribute(\"data-target\");\n if (targetValue) link.target = targetValue;\n\n const rel = target.getAttribute(\"data-rel\");\n if (rel) link.rel = rel;\n\n const download = target.getAttribute(\"data-download\");\n if (download) link.download = download;\n\n const ping = target.getAttribute(\"data-ping\");\n if (ping) link.ping = ping;\n\n const referrerPolicy = target.getAttribute(\"data-referrer-policy\");\n if (referrerPolicy) {\n link.referrerPolicy = referrerPolicy;\n }\n\n target.appendChild(link);\n open(link);\n target.removeChild(link);\n}\n\nfunction openSyntheticLink(target: Element, modifiers: RouterClickModifiers): void {\n getSyntheticLink(target, (link) => openLink(link, modifiers));\n}\n\nexport function useLinkProps(props?: LinkDOMProps): LinkDOMProps {\n const router = useRouter();\n const href = props?.href ?? \"\";\n return {\n href: props?.href ? router.useHref(href) : undefined,\n target: props?.target,\n rel: props?.rel,\n download: props?.download,\n ping: props?.ping,\n referrerPolicy: props?.referrerPolicy,\n };\n}\n\nexport function handleLinkClick(\n event: MouseEvent,\n router: RouterContextValue,\n href: string | undefined,\n routerOptions?: RouterOptions,\n): void {\n if (\n !router.isNative &&\n event.currentTarget instanceof HTMLAnchorElement &&\n event.currentTarget.href &&\n !event.defaultPrevented &&\n href &&\n shouldClientNavigate(event.currentTarget, event)\n ) {\n event.preventDefault();\n router.open(event.currentTarget, event, href, routerOptions);\n }\n}\n\n/**\n * A RouterProvider accepts a `navigate` function from a client-side router,\n * and provides it to all nested solidaria links to enable client-side navigation.\n *\n * @example\n * ```tsx\n * import { useNavigate } from '@solidjs/router';\n *\n * function App() {\n * const navigate = useNavigate();\n * return (\n * <RouterProvider navigate={navigate}>\n * <Link href=\"/about\">About</Link>\n * </RouterProvider>\n * );\n * }\n * ```\n */\nexport function RouterProvider(props: RouterProviderProps): JSX.Element {\n const ctx: RouterContextValue = {\n isNative: false,\n navigate: props.navigate,\n open: (target, modifiers, href, routerOptions) => {\n getSyntheticLink(target, (link) => {\n if (shouldClientNavigate(link, modifiers)) {\n props.navigate(href, routerOptions);\n } else {\n openLink(link, modifiers);\n }\n });\n },\n useHref: props.useHref ?? ((href: string) => href),\n };\n\n return <RouterContext.Provider value={ctx}>{props.children}</RouterContext.Provider>;\n}\n\n/**\n * Returns the current router context value.\n */\nexport function useRouter(): RouterContextValue {\n return useContext(RouterContext);\n}\n","/**\n * Link component for solidaria-components\n *\n * Pre-wired headless link component that combines aria hooks.\n * Port of react-aria-components/src/Link.tsx\n */\n\nimport { type JSX, type ParentProps, createContext, createMemo, splitProps } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport {\n createLink,\n createFocusRing,\n createHover,\n type AriaLinkProps,\n type HoverEvents,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { handleLinkClick, useRouter } from \"./RouterProvider\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface LinkRenderProps {\n /** Whether the link is the current item within a list. */\n isCurrent: boolean;\n /** Whether the link is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the link is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the link is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the link is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the link is disabled. */\n isDisabled: boolean;\n}\n\nexport interface LinkProps extends Omit<AriaLinkProps, \"elementType\">, HoverEvents, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<LinkRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<LinkRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<LinkRenderProps>;\n /** Ref for the underlying link element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport const LinkContext = createContext<LinkProps | null>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n *\n * @example\n * ```tsx\n * <Link href=\"https://example.com\">Visit Example</Link>\n *\n * // With render props\n * <Link href=\"/about\">\n * {({ isHovered, isFocusVisible }) => (\n * <span class={isHovered ? 'underline' : ''}>\n * About Us\n * </span>\n * )}\n * </Link>\n * ```\n */\nexport function Link(props: ParentProps<LinkProps>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n \"slot\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n const router = useRouter();\n const resolvedHref = createMemo(() =>\n ariaProps.href ? router.useHref(ariaProps.href) : undefined,\n );\n\n const elementType = () => {\n if (ariaProps.href && !ariaProps.isDisabled) {\n return \"a\";\n }\n return \"span\";\n };\n\n const linkAria = createLink({\n get elementType() {\n return elementType();\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get href() {\n return resolvedHref();\n },\n get hrefLang() {\n return ariaProps.hrefLang;\n },\n get target() {\n return ariaProps.target;\n },\n get rel() {\n return ariaProps.rel;\n },\n get download() {\n return ariaProps.download;\n },\n get ping() {\n return ariaProps.ping;\n },\n get referrerPolicy() {\n return ariaProps.referrerPolicy;\n },\n get onPress() {\n return ariaProps.onPress;\n },\n get onPressStart() {\n return ariaProps.onPressStart;\n },\n get onPressEnd() {\n return ariaProps.onPressEnd;\n },\n get onPressUp() {\n return ariaProps.onPressUp;\n },\n get onPressChange() {\n return ariaProps.onPressChange;\n },\n get onClick() {\n return ariaProps.onClick;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get \"aria-current\"() {\n return ariaProps[\"aria-current\"];\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n });\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get onHoverStart() {\n return local.onHoverStart;\n },\n get onHoverEnd() {\n return local.onHoverEnd;\n },\n get onHoverChange() {\n return local.onHoverChange;\n },\n });\n\n const renderValues = createMemo<LinkRenderProps>(() => ({\n isCurrent: !!ariaProps[\"aria-current\"],\n isHovered: isHovered(),\n isPressed: linkAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: ariaProps.isDisabled ?? false,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Link\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n const cleanLinkProps = () => {\n const { ref: _ref1, ...rest } = linkAria.linkProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const onLinkClick = (event: MouseEvent) => {\n const onClick = cleanLinkProps().onClick as ((event: MouseEvent) => void) | undefined;\n onClick?.(event);\n handleLinkClick(event, router, ariaProps.href, ariaProps.routerOptions);\n };\n\n return (\n <Dynamic\n component={elementType()}\n {...domProps()}\n {...cleanLinkProps()}\n {...cleanHoverProps()}\n {...cleanFocusProps()}\n ref={(element: HTMLElement) => {\n assignRef(local.ref, element);\n }}\n onClick={onLinkClick}\n class={renderProps.class()}\n style={renderProps.style()}\n data-hovered={isHovered() || undefined}\n data-pressed={linkAria.isPressed() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-current={!!ariaProps[\"aria-current\"] || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </Dynamic>\n );\n}\n","/**\n * Keyboard primitive for solidaria-components.\n *\n * Displays keyboard key hints with semantic <kbd> markup.\n * Port direction: react-aria-components/src/Keyboard.tsx\n */\n\nimport { type JSX, createContext, splitProps, useContext } from \"solid-js\";\n\nexport interface KeyboardProps extends JSX.HTMLAttributes<HTMLElement> {\n children?: JSX.Element;\n}\n\nexport const KeyboardContext = createContext<KeyboardProps | null>(null);\n\nexport function Keyboard(props: KeyboardProps): JSX.Element {\n const context = useContext(KeyboardContext);\n const merged = () => ({ ...context, ...props });\n const [local, domProps] = splitProps(merged(), [\"children\"]);\n\n return (\n <kbd dir=\"ltr\" {...domProps}>\n {local.children}\n </kbd>\n );\n}\n","/**\n * FileTrigger primitive for solidaria-components.\n *\n * Opens the native file picker from any pressable child.\n * Parity target: react-aria-components/src/FileTrigger.tsx\n */\n\nimport { type JSX, createSignal, splitProps } from \"solid-js\";\nimport { createPress, type PressEvent } from \"@proyecto-viviana/solidaria\";\n\nexport interface FileTriggerProps extends Omit<\n JSX.InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"onChange\" | \"children\" | \"onSelect\"\n> {\n /** Mime types accepted by the file picker. */\n acceptedFileTypes?: ReadonlyArray<string>;\n /** Whether multiple files can be selected. */\n allowsMultiple?: boolean;\n /** Default camera capture mode for mobile devices. */\n defaultCamera?: \"user\" | \"environment\";\n /** Enables directory selection in supported browsers. */\n acceptDirectory?: boolean;\n /** Called when user selection changes. */\n onSelect?: (files: FileList | null) => void;\n /** Trigger content (typically a button). */\n children?: JSX.Element;\n}\n\n/**\n * A FileTrigger allows a user to access the file system using a custom trigger.\n */\nexport function FileTrigger(props: FileTriggerProps): JSX.Element {\n const [local, inputProps] = splitProps(props, [\n \"acceptedFileTypes\",\n \"allowsMultiple\",\n \"defaultCamera\",\n \"acceptDirectory\",\n \"onSelect\",\n \"children\",\n \"disabled\",\n ]);\n\n const [inputRef, setInputRef] = createSignal<HTMLInputElement | null>(null);\n\n const openFilePicker = () => {\n const input = inputRef();\n if (!input) return;\n if (input.value) input.value = \"\";\n input.click();\n };\n\n const { pressProps } = createPress({\n get isDisabled() {\n return !!local.disabled;\n },\n onPress: (_e: PressEvent) => {\n openFilePicker();\n },\n });\n\n const onInputChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n local.onSelect?.(e.currentTarget.files);\n };\n\n return (\n <>\n <span {...pressProps}>{local.children}</span>\n <input\n {...inputProps}\n ref={setInputRef}\n type=\"file\"\n style={{ display: \"none\" }}\n accept={local.acceptedFileTypes?.join(\",\")}\n multiple={local.allowsMultiple}\n capture={local.defaultCamera}\n disabled={local.disabled}\n // @ts-expect-error Non-standard attribute supported by WebKit browsers.\n webkitdirectory={local.acceptDirectory ? \"\" : undefined}\n onChange={onInputChange}\n />\n </>\n );\n}\n","/**\n * DropZone primitive for solidaria-components.\n *\n * A drop target area for drag and drop operations.\n * Parity target: react-aria-components/src/DropZone.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n createSignal,\n mergeProps,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport {\n createDrop,\n createFocusRing,\n createHover,\n readFromDataTransfer,\n type HoverEvents,\n type AriaDropOptions,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type RenderChildren,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\nexport interface DropZoneRenderProps {\n isHovered: boolean;\n isFocused: boolean;\n isFocusVisible: boolean;\n isDropTarget: boolean;\n isDisabled: boolean;\n}\n\nexport interface DropZoneProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"children\" | \"class\" | \"style\" | \"onDrop\">,\n Omit<AriaDropOptions, \"hasDropButton\">,\n HoverEvents,\n SlotProps {\n children?: RenderChildren<DropZoneRenderProps>;\n class?: ClassNameOrFunction<DropZoneRenderProps>;\n style?: StyleOrFunction<DropZoneRenderProps>;\n}\n\nexport const DropZoneContext = createContext<DropZoneProps | null>(null);\nconst DEFAULT_DROPZONE_LABEL = \"Drop files\";\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n 'input:not([disabled]):not([type=\"hidden\"])',\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n].join(\",\");\n\nfunction isFocusableElement(target: Element): boolean {\n return target instanceof HTMLElement && target.matches(FOCUSABLE_SELECTOR);\n}\n\n/**\n * A drop zone is an area into which one or multiple objects can be dropped.\n */\nexport function DropZone(props: DropZoneProps): JSX.Element {\n const contextProps = useContext(DropZoneContext);\n const mergedProps = mergeProps(contextProps ?? {}, props);\n const [local, dropProps, hoverEventProps, domProps] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"aria-label\", \"aria-labelledby\"],\n [\n \"getDropOperation\",\n \"getDropOperationForPoint\",\n \"onDropEnter\",\n \"onDropMove\",\n \"onDropActivate\",\n \"onDropExit\",\n \"onDrop\",\n \"isDisabled\",\n ],\n [\"onHoverStart\", \"onHoverEnd\", \"onHoverChange\"],\n );\n\n const [dropZoneRef, setDropZoneRef] = createSignal<HTMLDivElement | null>(null);\n const [dropButtonRef, setDropButtonRef] = createSignal<HTMLButtonElement | null>(null);\n\n const dropAria = createDrop(() => ({\n getDropOperation: dropProps.getDropOperation,\n getDropOperationForPoint: dropProps.getDropOperationForPoint,\n onDropEnter: dropProps.onDropEnter,\n onDropMove: dropProps.onDropMove,\n onDropActivate: dropProps.onDropActivate,\n onDropExit: dropProps.onDropExit,\n onDrop: dropProps.onDrop,\n hasDropButton: true,\n isDisabled: dropProps.isDisabled,\n }));\n\n const { isHovered, hoverProps } = createHover(() => ({\n isDisabled: dropProps.isDisabled,\n onHoverStart: hoverEventProps.onHoverStart,\n onHoverEnd: hoverEventProps.onHoverEnd,\n onHoverChange: hoverEventProps.onHoverChange,\n }));\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const renderValues = createMemo<DropZoneRenderProps>(() => ({\n isHovered: isHovered(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDropTarget: dropAria.isDropTarget,\n isDisabled: !!dropProps.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-DropZone\",\n },\n renderValues,\n );\n\n const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n\n const cleanDropProps = () => {\n const { ref: _ref, ...rest } = dropAria.dropProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanDropButtonProps = () => {\n const { ref: _ref, ...rest } = dropAria.dropButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const onRootClick: JSX.EventHandler<HTMLDivElement, MouseEvent> = (e) => {\n const onClick = (filteredDomProps() as JSX.HTMLAttributes<HTMLDivElement>).onClick as\n | JSX.EventHandler<HTMLDivElement, MouseEvent>\n | undefined;\n onClick?.(e);\n if (e.defaultPrevented || dropProps.isDisabled) {\n return;\n }\n\n const root = dropZoneRef();\n const hiddenButton = dropButtonRef();\n if (!root || !hiddenButton) {\n return;\n }\n\n let target: Element | null = e.target instanceof Element ? e.target : root;\n while (target && root.contains(target)) {\n if (isFocusableElement(target)) {\n return;\n }\n if (target === root) {\n hiddenButton.focus();\n return;\n }\n target = target.parentElement;\n }\n };\n\n const onHiddenButtonPaste: JSX.EventHandler<HTMLButtonElement, ClipboardEvent> = (e) => {\n if (dropProps.isDisabled || !e.clipboardData) {\n return;\n }\n\n const items = readFromDataTransfer(e.clipboardData);\n if (items.length === 0) {\n return;\n }\n\n e.preventDefault();\n dropProps.onDrop?.({\n type: \"drop\",\n x: 0,\n y: 0,\n items,\n dropOperation: \"copy\",\n });\n };\n\n const dropButtonAriaLabel = createMemo(\n () => local[\"aria-label\"] ?? (!local[\"aria-labelledby\"] ? DEFAULT_DROPZONE_LABEL : undefined),\n );\n\n return (\n <div\n ref={setDropZoneRef}\n {...filteredDomProps()}\n {...cleanDropProps()}\n {...cleanHoverProps()}\n onClick={onRootClick}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-drop-target={dropAria.isDropTarget || undefined}\n data-disabled={dropProps.isDisabled || undefined}\n >\n <VisuallyHidden>\n <button\n ref={setDropButtonRef}\n {...cleanDropButtonProps()}\n {...cleanFocusProps()}\n aria-label={dropButtonAriaLabel()}\n aria-labelledby={local[\"aria-labelledby\"]}\n onPaste={onHiddenButtonPaste}\n />\n </VisuallyHidden>\n {renderProps.renderChildren()}\n </div>\n );\n}\n","import type { Key } from \"@proyecto-viviana/solid-stately\";\n\nexport interface InvalidationContext<O = unknown> {\n contentChanged?: boolean;\n offsetChanged?: boolean;\n sizeChanged?: boolean;\n itemSizeChanged?: boolean;\n layoutOptionsChanged?: boolean;\n layoutOptions?: O;\n}\n\nexport class Point {\n constructor(\n public x = 0,\n public y = 0,\n ) {}\n copy(): Point {\n return new Point(this.x, this.y);\n }\n equals(point: Point): boolean {\n return this.x === point.x && this.y === point.y;\n }\n isOrigin(): boolean {\n return this.x === 0 && this.y === 0;\n }\n}\n\nexport class Size {\n width: number;\n height: number;\n\n constructor(width = 0, height = 0) {\n this.width = Math.max(0, width);\n this.height = Math.max(0, height);\n }\n\n copy(): Size {\n return new Size(this.width, this.height);\n }\n\n equals(other: Size): boolean {\n return this.width === other.width && this.height === other.height;\n }\n\n get area(): number {\n return this.width * this.height;\n }\n}\n\nexport class Rect {\n constructor(\n public x = 0,\n public y = 0,\n public width = 0,\n public height = 0,\n ) {}\n\n get maxX(): number {\n return this.x + this.width;\n }\n\n get maxY(): number {\n return this.y + this.height;\n }\n\n get area(): number {\n return this.width * this.height;\n }\n\n get topLeft(): Point {\n return new Point(this.x, this.y);\n }\n\n get topRight(): Point {\n return new Point(this.maxX, this.y);\n }\n\n get bottomLeft(): Point {\n return new Point(this.x, this.maxY);\n }\n\n get bottomRight(): Point {\n return new Point(this.maxX, this.maxY);\n }\n\n intersects(rect: Rect): boolean {\n return this.x <= rect.maxX && rect.x <= this.maxX && this.y <= rect.maxY && rect.y <= this.maxY;\n }\n\n containsRect(rect: Rect): boolean {\n return this.x <= rect.x && this.y <= rect.y && this.maxX >= rect.maxX && this.maxY >= rect.maxY;\n }\n\n containsPoint(point: Point): boolean {\n return this.x <= point.x && this.y <= point.y && this.maxX >= point.x && this.maxY >= point.y;\n }\n\n union(other: Rect): Rect {\n const x = Math.min(this.x, other.x);\n const y = Math.min(this.y, other.y);\n const width = Math.max(this.maxX, other.maxX) - x;\n const height = Math.max(this.maxY, other.maxY) - y;\n return new Rect(x, y, width, height);\n }\n\n intersection(other: Rect): Rect {\n if (!this.intersects(other)) {\n return new Rect(0, 0, 0, 0);\n }\n const x = Math.max(this.x, other.x);\n const y = Math.max(this.y, other.y);\n const width = Math.min(this.maxX, other.maxX) - x;\n const height = Math.min(this.maxY, other.maxY) - y;\n return new Rect(x, y, width, height);\n }\n\n copy(): Rect {\n return new Rect(this.x, this.y, this.width, this.height);\n }\n\n equals(rect: Rect): boolean {\n return (\n this.x === rect.x &&\n this.y === rect.y &&\n this.width === rect.width &&\n this.height === rect.height\n );\n }\n}\n\nexport class LayoutInfo {\n parentKey: Key | null = null;\n content: unknown = null;\n estimatedSize = false;\n isSticky = false;\n opacity = 1;\n transform: string | null = null;\n zIndex = 0;\n allowOverflow = false;\n\n constructor(\n public type: string,\n public key: Key,\n public rect: Rect,\n ) {}\n\n copy(): LayoutInfo {\n const copy = new LayoutInfo(this.type, this.key, this.rect.copy());\n copy.parentKey = this.parentKey;\n copy.content = this.content;\n copy.estimatedSize = this.estimatedSize;\n copy.isSticky = this.isSticky;\n copy.opacity = this.opacity;\n copy.transform = this.transform;\n copy.zIndex = this.zIndex;\n copy.allowOverflow = this.allowOverflow;\n return copy;\n }\n}\n\ninterface VirtualizerLike {\n visibleRect: Rect;\n}\n\nexport abstract class Layout<T extends object = object, O = unknown> {\n virtualizer: VirtualizerLike | null = null;\n\n abstract getVisibleLayoutInfos(rect: Rect): LayoutInfo[];\n abstract getLayoutInfo(key: Key): LayoutInfo | null;\n abstract getContentSize(): Size;\n\n shouldInvalidate(newRect: Rect, oldRect: Rect): boolean {\n return newRect.width !== oldRect.width || newRect.height !== oldRect.height;\n }\n\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return newOptions !== oldOptions;\n }\n\n update(_context: InvalidationContext<O>): void {}\n\n updateItemSize?(_key: Key, _size: Size): boolean;\n getDropTargetLayoutInfo?(_target: unknown): LayoutInfo | null;\n\n protected getItemRect(key: Key): Rect | null {\n return this.getLayoutInfo(key)?.rect ?? null;\n }\n\n getVisibleRect(): Rect {\n return this.virtualizer?.visibleRect ?? new Rect();\n }\n}\n","/**\n * Collection composition primitives for solidaria-components.\n *\n * Foundational parity layer for React Spectrum-style composition:\n * Section / Header / Group.\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext, For } from \"solid-js\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport type { DragTypes, DropOperation, DropTarget } from \"@proyecto-viviana/solid-stately\";\nimport {\n Collection as AriaCollection,\n CollectionBuilder as AriaCollectionBuilder,\n createLeafComponent,\n createBranchComponent,\n type CollectionProps as AriaCollectionProps,\n type CollectionBuilderProps as AriaCollectionBuilderProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface CollectionPrimitiveRenderProps {\n /** Whether the primitive has visible children content. */\n hasChildren: boolean;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") ref(el);\n else ref.current = el;\n}\n\nexport interface CollectionDropTargetDelegate {\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n getDropOperation(\n target: DropTarget,\n types: DragTypes,\n allowedOperations: DropOperation[],\n ): DropOperation;\n getKeyboardNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n getKeyboardPageNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n}\n\nexport interface CollectionRendererContextValue<T> {\n /** Render function used by collection parents to render each item node. */\n renderItem: (item: T) => JSX.Element;\n /** Whether collection rendering is currently virtualized. */\n isVirtualized?: boolean;\n /** Optional layout delegate used by virtualized renderers. */\n layoutDelegate?: unknown;\n /** Optional drop target delegate used by DnD-aware collection paths. */\n dropTargetDelegate?: CollectionDropTargetDelegate;\n /** Optional drop indicator renderer for DnD-aware collection paths. */\n renderDropIndicator?: (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ) => JSX.Element | undefined;\n}\n\nexport type CollectionEntry<T> = T | CollectionSection<T>;\n\nexport interface CollectionSection<T> {\n /** Optional unique key for the section wrapper. */\n key?: Key;\n /** Optional section header title. */\n title?: JSX.Element;\n /** Optional aria-label for section grouping. */\n \"aria-label\"?: string;\n /** Items contained in the section. */\n items: T[];\n}\n\nexport interface SectionProps extends SlotProps {\n /** Section contents, usually Header + Group/items. */\n children?: JSX.Element;\n /** Ref for the section element. */\n ref?: RefLike<HTMLDivElement>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CollectionPrimitiveRenderProps>;\n}\n\nexport interface HeaderProps extends SlotProps {\n /** Header contents, usually section title text. */\n children?: JSX.Element;\n /** Optional heading level when rendered as a heading role. */\n \"aria-level\"?: number;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CollectionPrimitiveRenderProps>;\n}\n\nexport interface GroupProps extends SlotProps {\n /** Group contents, usually section items. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CollectionPrimitiveRenderProps>;\n}\n\ninterface SectionContextValue {\n name: string;\n render: (props: SectionProps, className?: string) => JSX.Element;\n}\n\nexport interface CollectionBranchProps<T> {\n collection: Iterable<T>;\n parent?: unknown;\n renderDropIndicator?: (target: {\n type: \"item\";\n key: Key;\n dropPosition: \"before\" | \"after\" | \"on\";\n }) => JSX.Element | undefined;\n}\n\nexport interface CollectionRootProps<T> {\n collection: Iterable<T>;\n persistedKeys?: Set<Key> | null;\n renderDropIndicator?: (target: {\n type: \"item\";\n key: Key;\n dropPosition: \"before\" | \"after\" | \"on\";\n }) => JSX.Element | undefined;\n}\n\nexport interface CollectionRenderer<T = unknown> {\n isVirtualized?: boolean;\n layoutDelegate?: unknown;\n dropTargetDelegate?: CollectionDropTargetDelegate;\n CollectionRoot: (props: CollectionRootProps<T>) => JSX.Element;\n CollectionBranch: (props: CollectionBranchProps<T>) => JSX.Element;\n}\n\nexport const CollectionRendererContext =\n createContext<CollectionRendererContextValue<unknown> | null>(null);\nexport const SelectableCollectionContext = CollectionRendererContext;\nexport const SectionContext = createContext<SectionContextValue | null>(null);\nexport const GroupContext = createContext<Partial<GroupProps> | null>(null);\nexport const HeaderContext = createContext<Partial<HeaderProps> | null>(null);\nexport const HeadingContext = createContext<Partial<HeaderProps> | null>(null);\n\nexport function useCollectionRenderer<T>(): CollectionRendererContextValue<T> | null {\n return useContext(CollectionRendererContext) as CollectionRendererContextValue<T> | null;\n}\n\nexport function isCollectionSection<T>(entry: CollectionEntry<T>): entry is CollectionSection<T> {\n return (\n typeof entry === \"object\" &&\n entry !== null &&\n Array.isArray((entry as CollectionSection<T>).items)\n );\n}\n\nexport function flattenCollectionEntries<T>(entries: CollectionEntry<T>[]): T[] {\n const flattened: T[] = [];\n for (const entry of entries) {\n if (isCollectionSection(entry)) flattened.push(...entry.items);\n else flattened.push(entry);\n }\n return flattened;\n}\n\nfunction renderCollectionItems<T>(\n collection: Iterable<T>,\n renderDropIndicator?: (target: {\n type: \"item\";\n key: Key;\n dropPosition: \"before\" | \"after\" | \"on\";\n }) => JSX.Element | undefined,\n): JSX.Element {\n const items = Array.from(collection);\n return (\n <For each={items}>\n {(item, index) => {\n const node = item as { type?: unknown; key?: Key };\n if (node.type === \"content\") {\n // Content rows are rendered by their owning item/section branch.\n return <></>;\n }\n const key = node.key ?? index();\n return (\n <>\n {renderDropIndicator?.({ type: \"item\", key, dropPosition: \"before\" })}\n {item as unknown as JSX.Element}\n {renderDropIndicator?.({ type: \"item\", key, dropPosition: \"after\" })}\n </>\n );\n }}\n </For>\n );\n}\n\nexport const DefaultCollectionRenderer: CollectionRenderer<unknown> = {\n CollectionRoot(props) {\n return renderCollectionItems(props.collection, props.renderDropIndicator);\n },\n CollectionBranch(props) {\n return renderCollectionItems(props.collection, props.renderDropIndicator);\n },\n};\n\nexport function CollectionBuilder<T>(props: AriaCollectionBuilderProps<T>): unknown {\n return AriaCollectionBuilder(props);\n}\n\nexport function Collection<T>(props: AriaCollectionProps<T>): unknown {\n return AriaCollection(props);\n}\n\nexport { createLeafComponent, createBranchComponent };\n\n/**\n * A semantic section wrapper for grouped collection content.\n */\nexport function Section(props: SectionProps): JSX.Element {\n const sectionContext = useContext(SectionContext);\n if (sectionContext) {\n const nodeEnv = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env\n ?.NODE_ENV;\n if (nodeEnv !== \"production\") {\n console.warn(`<Section> is deprecated. Please use <${sectionContext.name}> instead.`);\n }\n return sectionContext.render(props, \"solidaria-Section\");\n }\n\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\", \"slot\", \"ref\"]);\n\n const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({\n hasChildren: local.children != null,\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Section\",\n },\n renderValues,\n );\n\n const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n\n return (\n <div\n ref={(el) => assignRef(local.ref, el)}\n {...filteredDomProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-section\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * A header/title primitive for collection sections.\n */\nexport function Header(props: HeaderProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\", \"slot\"]);\n\n const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({\n hasChildren: local.children != null,\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Header\",\n },\n renderValues,\n );\n\n const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n\n return (\n <div\n {...filteredDomProps()}\n role=\"heading\"\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-header\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * A grouping primitive for section item containers.\n */\nexport function Group(props: GroupProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\", \"slot\"]);\n\n const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({\n hasChildren: local.children != null,\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Group\",\n },\n renderValues,\n );\n\n const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n\n return (\n <div\n {...filteredDomProps()}\n role=\"group\"\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-group\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n","/**\n * Layout primitives for solidaria-components Virtualizer.\n *\n * These are lightweight parity contracts inspired by RAC virtualizer layout APIs.\n */\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface Size {\n width: number;\n height: number;\n}\n\nexport interface LayoutInfo {\n key: string | number;\n index: number;\n rect: Rect;\n}\n\nexport interface VirtualizerVisibleRange {\n start: number;\n end: number;\n offsetTop: number;\n offsetBottom: number;\n}\n\nexport interface VirtualizerRangeContext {\n itemCount: number;\n scrollOffset: number;\n viewportSize: number;\n overscan: number;\n viewportWidth?: number;\n}\n\nexport interface DefaultVirtualizerLayoutOptions {\n itemSize?: number;\n overscan?: number;\n viewportSize?: number;\n}\n\nexport interface GridLayoutOptions extends DefaultVirtualizerLayoutOptions {\n rowHeight?: number;\n columnCount?: number;\n viewportWidth?: number;\n}\n\nexport interface WaterfallLayoutOptions extends GridLayoutOptions {\n minColumnWidth?: number;\n viewportWidth?: number;\n gap?: number;\n}\n\nexport interface VirtualizerLayoutInfoContext {\n viewportWidth: number;\n}\n\nexport interface VirtualizerDropTarget {\n type: \"item\" | \"root\";\n index: number;\n position: \"before\" | \"on\" | \"after\";\n key?: string | number;\n parentKey?: string | number | null;\n level?: number;\n}\n\nfunction clampRange(\n itemCount: number,\n start: number,\n end: number,\n itemSize: number,\n): VirtualizerVisibleRange {\n const safeStart = Math.max(0, Math.min(start, itemCount));\n const safeEnd = Math.max(safeStart, Math.min(end, itemCount));\n return {\n start: safeStart,\n end: safeEnd,\n offsetTop: safeStart * itemSize,\n offsetBottom: Math.max(0, (itemCount - safeEnd) * itemSize),\n };\n}\n\nexport function calculateLinearVisibleRange(\n itemCount: number,\n scrollOffset: number,\n viewportSize: number,\n itemSize: number,\n overscan: number,\n): VirtualizerVisibleRange {\n if (itemCount <= 0) return { start: 0, end: 0, offsetTop: 0, offsetBottom: 0 };\n const safeItemSize = Math.max(1, itemSize);\n const safeViewport = Math.max(1, viewportSize);\n const safeOverscan = Math.max(0, overscan);\n const start = Math.floor(scrollOffset / safeItemSize) - safeOverscan;\n const visibleCount = Math.ceil(safeViewport / safeItemSize) + safeOverscan * 2;\n return clampRange(itemCount, start, start + visibleCount, safeItemSize);\n}\n\nexport class ListLayout {\n getVisibleRange(\n ctx: VirtualizerRangeContext,\n options?: DefaultVirtualizerLayoutOptions,\n ): VirtualizerVisibleRange {\n return calculateLinearVisibleRange(\n ctx.itemCount,\n ctx.scrollOffset,\n ctx.viewportSize,\n options?.itemSize ?? 40,\n options?.overscan ?? ctx.overscan,\n );\n }\n\n getLayoutInfo(\n index: number,\n context: VirtualizerLayoutInfoContext,\n options?: DefaultVirtualizerLayoutOptions,\n ): LayoutInfo {\n const itemHeight = Math.max(1, options?.itemSize ?? 40);\n return {\n key: String(index),\n index,\n rect: {\n x: 0,\n y: index * itemHeight,\n width: Math.max(0, context.viewportWidth),\n height: itemHeight,\n },\n };\n }\n\n getDropTargetFromPoint(\n point: Point,\n itemCount: number,\n options?: DefaultVirtualizerLayoutOptions,\n ): VirtualizerDropTarget | null {\n if (itemCount <= 0) return { type: \"root\", index: -1, position: \"on\" };\n const itemHeight = Math.max(1, options?.itemSize ?? 40);\n if (point.y < 0) {\n return { type: \"item\", index: 0, position: \"before\" };\n }\n const totalHeight = itemCount * itemHeight;\n if (point.y >= totalHeight) {\n return { type: \"item\", index: itemCount - 1, position: \"after\" };\n }\n const rawIndex = Math.floor(point.y / itemHeight);\n const index = Math.max(0, Math.min(rawIndex, itemCount - 1));\n const offsetWithinItem = Math.max(0, point.y - index * itemHeight);\n const threshold = itemHeight / 3;\n const position: VirtualizerDropTarget[\"position\"] =\n offsetWithinItem < threshold ? \"before\" : offsetWithinItem > threshold * 2 ? \"after\" : \"on\";\n return { type: \"item\", index, position };\n }\n}\n\nexport class TableLayout extends ListLayout {}\n\nexport class GridLayout {\n getVisibleRange(\n ctx: VirtualizerRangeContext,\n options?: GridLayoutOptions,\n ): VirtualizerVisibleRange {\n if (ctx.itemCount <= 0) return { start: 0, end: 0, offsetTop: 0, offsetBottom: 0 };\n const rowHeight = Math.max(1, options?.rowHeight ?? options?.itemSize ?? 40);\n const columns = Math.max(1, options?.columnCount ?? 1);\n const safeViewport = Math.max(1, ctx.viewportSize);\n const safeOverscan = Math.max(0, options?.overscan ?? ctx.overscan);\n\n const startRow = Math.max(0, Math.floor(ctx.scrollOffset / rowHeight) - safeOverscan);\n const visibleRows = Math.ceil(safeViewport / rowHeight) + safeOverscan * 2;\n const endRow = startRow + visibleRows;\n\n const start = startRow * columns;\n const end = Math.min(ctx.itemCount, endRow * columns);\n\n const totalRows = Math.ceil(ctx.itemCount / columns);\n const clampedStartRow = Math.floor(start / columns);\n const renderedRows = Math.ceil((end - start) / columns);\n const offsetTop = clampedStartRow * rowHeight;\n const offsetBottom = Math.max(0, (totalRows - clampedStartRow - renderedRows) * rowHeight);\n\n return { start, end, offsetTop, offsetBottom };\n }\n\n getLayoutInfo(\n index: number,\n context: VirtualizerLayoutInfoContext,\n options?: GridLayoutOptions,\n ): LayoutInfo {\n const rowHeight = Math.max(1, options?.rowHeight ?? options?.itemSize ?? 40);\n const columns = Math.max(1, options?.columnCount ?? 1);\n const row = Math.floor(index / columns);\n const col = index % columns;\n const width = Math.max(1, context.viewportWidth);\n const cellWidth = Math.floor(width / columns);\n return {\n key: String(index),\n index,\n rect: {\n x: col * cellWidth,\n y: row * rowHeight,\n width: cellWidth,\n height: rowHeight,\n },\n };\n }\n\n getDropTargetFromPoint(\n point: Point,\n itemCount: number,\n options?: GridLayoutOptions,\n ): VirtualizerDropTarget | null {\n if (itemCount <= 0) return { type: \"root\", index: -1, position: \"on\" };\n const rowHeight = Math.max(1, options?.rowHeight ?? options?.itemSize ?? 40);\n const columns = Math.max(1, options?.columnCount ?? 1);\n const totalRows = Math.ceil(itemCount / columns);\n const totalHeight = totalRows * rowHeight;\n if (point.y < 0) {\n return { type: \"item\", index: 0, position: \"before\" };\n }\n if (point.y >= totalHeight) {\n return { type: \"item\", index: itemCount - 1, position: \"after\" };\n }\n const width = Math.max(1, options?.viewportWidth ?? 320);\n const cellWidth = width / columns;\n const row = Math.max(0, Math.floor(point.y / rowHeight));\n const col = Math.max(0, Math.min(columns - 1, Math.floor(Math.max(0, point.x) / cellWidth)));\n const index = Math.max(0, Math.min(itemCount - 1, row * columns + col));\n const withinRow = Math.max(0, point.y - row * rowHeight);\n const threshold = rowHeight / 3;\n const position: VirtualizerDropTarget[\"position\"] =\n withinRow < threshold ? \"before\" : withinRow > threshold * 2 ? \"after\" : \"on\";\n return { type: \"item\", index, position };\n }\n}\n\nexport class WaterfallLayout extends GridLayout {\n override getVisibleRange(\n ctx: VirtualizerRangeContext,\n options?: WaterfallLayoutOptions,\n ): VirtualizerVisibleRange {\n const width = Math.max(1, options?.viewportWidth ?? 320);\n const minColumnWidth = Math.max(1, options?.minColumnWidth ?? 200);\n const gap = Math.max(0, options?.gap ?? 0);\n const columnCount = Math.max(1, Math.floor((width + gap) / (minColumnWidth + gap)));\n return super.getVisibleRange(ctx, { ...options, columnCount });\n }\n\n override getLayoutInfo(\n index: number,\n context: VirtualizerLayoutInfoContext,\n options?: WaterfallLayoutOptions,\n ): LayoutInfo {\n const width = Math.max(1, options?.viewportWidth ?? context.viewportWidth);\n const minColumnWidth = Math.max(1, options?.minColumnWidth ?? 200);\n const gap = Math.max(0, options?.gap ?? 0);\n const columnCount = Math.max(1, Math.floor((width + gap) / (minColumnWidth + gap)));\n return super.getLayoutInfo(index, context, { ...options, columnCount });\n }\n\n override getDropTargetFromPoint(\n point: Point,\n itemCount: number,\n options?: WaterfallLayoutOptions,\n ): VirtualizerDropTarget | null {\n const width = Math.max(1, options?.viewportWidth ?? 320);\n const minColumnWidth = Math.max(1, options?.minColumnWidth ?? 200);\n const gap = Math.max(0, options?.gap ?? 0);\n const columnCount = Math.max(1, Math.floor((width + gap) / (minColumnWidth + gap)));\n return super.getDropTargetFromPoint(point, itemCount, { ...options, columnCount });\n }\n}\n","/**\n * Virtualizer primitive for solidaria-components.\n *\n * Phase 1 parity: provides RAC-like API and context contract with\n * a safe non-virtualized fallback render path.\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n createSignal,\n onCleanup,\n onMount,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport type {\n DragTypes,\n DropOperation,\n DropTarget,\n ItemDropTarget,\n} from \"@proyecto-viviana/solid-stately\";\nimport { CollectionRendererContext, type CollectionRendererContextValue } from \"./Collection\";\nimport { filterDOMProps } from \"./utils\";\nimport {\n GridLayout,\n ListLayout,\n TableLayout,\n WaterfallLayout,\n calculateLinearVisibleRange,\n type DefaultVirtualizerLayoutOptions,\n type GridLayoutOptions,\n type LayoutInfo,\n type Point,\n type Rect,\n type Size,\n type VirtualizerRangeContext,\n type VirtualizerLayoutInfoContext,\n type VirtualizerDropTarget,\n type VirtualizerVisibleRange,\n type WaterfallLayoutOptions,\n} from \"./VirtualizerLayouts\";\n\nexport interface LayoutOptionsDelegate<O> {\n useLayoutOptions?(): O;\n}\n\nexport interface VirtualizerLayout<O = unknown> extends LayoutOptionsDelegate<O> {\n getVisibleRange?(context: VirtualizerRangeContext, options?: O): VirtualizerVisibleRange;\n getLayoutInfo?(index: number, context: VirtualizerLayoutInfoContext, options?: O): LayoutInfo;\n getDropTargetFromPoint?(\n point: Point,\n itemCount: number,\n options?: O,\n ): VirtualizerDropTarget | null;\n}\n\nexport interface VirtualizerLayoutClass<O> {\n new (): VirtualizerLayout<O>;\n}\n\nexport type VirtualizerKeyboardNavigationOverride = (\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n) => DropTarget | null;\n\nexport interface VirtualizerContextValue<O = unknown> {\n layout: VirtualizerLayout<O>;\n layoutOptions?: O;\n isVirtualized: boolean;\n getVisibleRange: (itemCount: number) => VirtualizerVisibleRange;\n getLayoutInfo: (index: number) => LayoutInfo;\n getDropTargetFromPoint: (point: Point, itemCount: number) => VirtualizerDropTarget | null;\n setDropTargetResolver: (resolver: VirtualizerDropTargetResolver | undefined) => void;\n setDropTargetItemCountResolver: (resolver: (() => number) | undefined) => void;\n setDropTargetIndexResolver: (\n resolver: ((key: string | number) => number | null) | undefined,\n ) => void;\n setDropOperationResolver: (resolver: VirtualizerDropOperationResolver | undefined) => void;\n setKeyboardNavigationOverride: (\n override: VirtualizerKeyboardNavigationOverride | undefined,\n ) => void;\n getBaseKeyboardNavigationTarget: VirtualizerKeyboardNavigationOverride;\n}\n\nexport type VirtualizerDropTargetResolver = (\n target: VirtualizerDropTarget,\n) => VirtualizerDropTarget;\nexport type VirtualizerDropOperationResolver = (\n target: DropTarget,\n types: DragTypes,\n allowedOperations: DropOperation[],\n) => DropOperation;\n\nexport const VirtualizerContext = createContext<VirtualizerContextValue<unknown> | null>(null);\n\nexport function useVirtualizerContext<O>(): VirtualizerContextValue<O> | null {\n return useContext(VirtualizerContext) as VirtualizerContextValue<O> | null;\n}\n\nexport interface VirtualizerProps<O> extends Omit<\n JSX.HTMLAttributes<HTMLDivElement>,\n \"children\" | \"class\" | \"style\"\n> {\n /** The child collection to virtualize (e.g. ListBox, GridList, or Table). */\n children: JSX.Element;\n /** Layout object or constructor for layout behavior and options delegation. */\n layout: VirtualizerLayoutClass<O> | VirtualizerLayout<O>;\n /** Layout options consumed by the layout implementation. */\n layoutOptions?: O;\n /** Optional renderer for collection drop indicators in virtualized flows. */\n renderDropIndicator?: (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ) => JSX.Element | undefined;\n /** Optional operation resolver for collection drop target operations. */\n getDropOperation?: VirtualizerDropOperationResolver;\n class?: string;\n style?: string | JSX.CSSProperties;\n}\n\nfunction getObjectValue<T extends object, K extends keyof T>(\n value: T | undefined,\n key: K,\n): T[K] | undefined {\n return value?.[key];\n}\n\nfunction isSameRange(a: VirtualizerVisibleRange, b: VirtualizerVisibleRange): boolean {\n return (\n a.start === b.start &&\n a.end === b.end &&\n a.offsetTop === b.offsetTop &&\n a.offsetBottom === b.offsetBottom\n );\n}\n\nfunction isSameLayoutInfo(a: LayoutInfo, b: LayoutInfo): boolean {\n return (\n a.key === b.key &&\n a.index === b.index &&\n a.rect.x === b.rect.x &&\n a.rect.y === b.rect.y &&\n a.rect.width === b.rect.width &&\n a.rect.height === b.rect.height\n );\n}\n\n/**\n * A Virtualizer renders collection content under a virtualized layout contract.\n * Current implementation supports fixed-size visible range virtualization.\n */\nexport function Virtualizer<O>(props: VirtualizerProps<O>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"children\",\n \"layout\",\n \"layoutOptions\",\n \"renderDropIndicator\",\n \"getDropOperation\",\n \"class\",\n \"style\",\n ]);\n const [scrollOffset, setScrollOffset] = createSignal(0);\n const [measuredViewportSize, setMeasuredViewportSize] = createSignal(0);\n const [measuredViewportWidth, setMeasuredViewportWidth] = createSignal(0);\n const [dropTargetResolver, setDropTargetResolver] = createSignal<\n VirtualizerDropTargetResolver | undefined\n >(undefined);\n const [dropTargetItemCountResolver, setDropTargetItemCountResolver] = createSignal<\n (() => number) | undefined\n >(undefined);\n const [dropTargetIndexResolver, setDropTargetIndexResolver] = createSignal<\n ((key: string | number) => number | null) | undefined\n >(undefined);\n const [dropOperationResolver, setDropOperationResolver] = createSignal<\n VirtualizerDropOperationResolver | undefined\n >(undefined);\n const [keyboardNavigationOverride, setKeyboardNavigationOverride] = createSignal<\n VirtualizerKeyboardNavigationOverride | undefined\n >(undefined);\n let containerRef: HTMLDivElement | undefined;\n const fallbackLayout = new ListLayout();\n const visibleRangeCache = new Map<number, VirtualizerVisibleRange>();\n const layoutInfoCache = new Map<number, LayoutInfo>();\n\n const layout = createMemo<VirtualizerLayout<O>>(() => {\n if (typeof local.layout === \"function\") {\n return new local.layout();\n }\n return local.layout;\n });\n const resolvedLayout = createMemo<VirtualizerLayout<O>>(() => {\n return layout() ?? (new ListLayout() as VirtualizerLayout<O>);\n });\n\n const resolvedLayoutOptions = createMemo<O | undefined>(() => {\n const fromLayout = resolvedLayout().useLayoutOptions?.();\n if (local.layoutOptions && fromLayout) {\n return { ...local.layoutOptions, ...fromLayout };\n }\n return local.layoutOptions ?? fromLayout;\n });\n\n const virtualOptions = createMemo(\n () => resolvedLayoutOptions() as DefaultVirtualizerLayoutOptions | undefined,\n );\n const layoutOptionsWithViewport = createMemo(() => {\n const options = resolvedLayoutOptions();\n if (options && typeof options === \"object\") {\n return {\n ...(options as Record<string, unknown>),\n viewportWidth: measuredViewportWidth(),\n } as O;\n }\n return { viewportWidth: measuredViewportWidth() } as O;\n });\n const itemSize = createMemo(() => getObjectValue(virtualOptions(), \"itemSize\") ?? 40);\n const overscan = createMemo(() => getObjectValue(virtualOptions(), \"overscan\") ?? 2);\n const viewportSize = createMemo(\n () => getObjectValue(virtualOptions(), \"viewportSize\") ?? measuredViewportSize() ?? 0,\n );\n\n const getVisibleRange = (itemCount: number): VirtualizerVisibleRange => {\n const ctx: VirtualizerRangeContext = {\n itemCount,\n scrollOffset: scrollOffset(),\n viewportSize: viewportSize(),\n overscan: overscan(),\n viewportWidth: measuredViewportWidth(),\n };\n const layoutResult = resolvedLayout().getVisibleRange?.(ctx, layoutOptionsWithViewport());\n const nextRange =\n layoutResult ??\n calculateLinearVisibleRange(\n itemCount,\n ctx.scrollOffset,\n ctx.viewportSize,\n itemSize(),\n ctx.overscan,\n );\n const cachedRange = visibleRangeCache.get(itemCount);\n if (cachedRange && isSameRange(cachedRange, nextRange)) {\n return cachedRange;\n }\n visibleRangeCache.set(itemCount, nextRange);\n return nextRange;\n };\n const getLayoutInfo = (index: number): LayoutInfo => {\n const ctx: VirtualizerLayoutInfoContext = {\n viewportWidth: measuredViewportWidth(),\n };\n const layoutResult = resolvedLayout().getLayoutInfo?.(index, ctx, layoutOptionsWithViewport());\n const nextInfo = layoutResult ?? {\n key: String(index),\n index,\n rect: {\n x: 0,\n y: index * itemSize(),\n width: Math.max(0, measuredViewportWidth()),\n height: itemSize(),\n },\n };\n const cachedInfo = layoutInfoCache.get(index);\n if (cachedInfo && isSameLayoutInfo(cachedInfo, nextInfo)) {\n return cachedInfo;\n }\n layoutInfoCache.set(index, nextInfo);\n return nextInfo;\n };\n const getDropTargetFromPoint = (\n point: Point,\n itemCount: number,\n ): VirtualizerDropTarget | null => {\n const target =\n resolvedLayout().getDropTargetFromPoint?.(point, itemCount, layoutOptionsWithViewport()) ??\n fallbackLayout.getDropTargetFromPoint(point, itemCount, virtualOptions());\n if (!target) return null;\n const resolver = dropTargetResolver();\n return resolver ? resolver(target) : target;\n };\n const assignDropTargetResolver = (resolver: VirtualizerDropTargetResolver | undefined): void => {\n setDropTargetResolver(() => resolver);\n };\n const assignDropTargetItemCountResolver = (resolver: (() => number) | undefined): void => {\n setDropTargetItemCountResolver(() => resolver);\n };\n const assignDropTargetIndexResolver = (\n resolver: ((key: string | number) => number | null) | undefined,\n ): void => {\n setDropTargetIndexResolver(() => resolver);\n };\n const assignDropOperationResolver = (\n resolver: VirtualizerDropOperationResolver | undefined,\n ): void => {\n setDropOperationResolver(() => resolver);\n };\n const assignKeyboardNavigationOverride = (\n override: VirtualizerKeyboardNavigationOverride | undefined,\n ): void => {\n setKeyboardNavigationOverride(() => override);\n };\n const toCollectionDropTarget = (target: VirtualizerDropTarget): DropTarget => {\n if (target.type === \"root\") return { type: \"root\" };\n const key = target.key ?? target.index;\n return {\n type: \"item\",\n key,\n dropPosition: target.position,\n } as ItemDropTarget;\n };\n const getCollectionDropTargetFromPoint = (\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null => {\n const itemCount = dropTargetItemCountResolver()?.() ?? 0;\n const virtualTarget = getDropTargetFromPoint({ x, y }, itemCount);\n if (!virtualTarget) return null;\n const mappedTarget = toCollectionDropTarget(virtualTarget);\n if (isValidDropTarget(mappedTarget)) return mappedTarget;\n if (mappedTarget.type === \"item\") {\n const alternatePositions: Array<\"before\" | \"after\" | \"on\"> =\n mappedTarget.dropPosition === \"on\"\n ? [\"before\", \"after\"]\n : mappedTarget.dropPosition === \"before\"\n ? [\"on\", \"after\"]\n : [\"on\", \"before\"];\n for (const position of alternatePositions) {\n const alternateTarget: DropTarget = {\n ...mappedTarget,\n dropPosition: position,\n };\n if (isValidDropTarget(alternateTarget)) return alternateTarget;\n }\n const rootTarget: DropTarget = { type: \"root\" };\n if (isValidDropTarget(rootTarget)) return rootTarget;\n }\n return null;\n };\n const getCollectionDropOperation = (\n target: DropTarget,\n types: DragTypes,\n allowedOperations: DropOperation[],\n ): DropOperation => {\n const resolver = dropOperationResolver() ?? local.getDropOperation;\n if (resolver) return resolver(target, types, allowedOperations);\n if (allowedOperations.length === 0) return \"cancel\";\n if (target.type === \"root\") {\n if (allowedOperations.includes(\"copy\")) return \"copy\";\n if (allowedOperations.includes(\"move\")) return \"move\";\n } else if (target.dropPosition === \"on\") {\n if (allowedOperations.includes(\"copy\")) return \"copy\";\n if (allowedOperations.includes(\"move\")) return \"move\";\n } else {\n if (allowedOperations.includes(\"move\")) return \"move\";\n if (allowedOperations.includes(\"copy\")) return \"copy\";\n }\n if (allowedOperations.includes(\"link\")) return \"link\";\n return allowedOperations.find((operation) => operation !== \"cancel\") ?? \"cancel\";\n };\n const getBaseKeyboardNavigationTarget = (\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null => {\n const itemCount = dropTargetItemCountResolver()?.() ?? 0;\n if (itemCount <= 0) {\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n }\n\n const resolveCurrentIndex = (currentTarget: DropTarget | null): number | null => {\n if (!currentTarget || currentTarget.type === \"root\") return null;\n const resolver = dropTargetIndexResolver();\n if (resolver) {\n const fromResolver = resolver(currentTarget.key);\n if (fromResolver != null && fromResolver >= 0 && fromResolver < itemCount)\n return fromResolver;\n return null;\n }\n if (\n typeof currentTarget.key === \"number\" &&\n currentTarget.key >= 0 &&\n currentTarget.key < itemCount\n ) {\n return currentTarget.key;\n }\n return null;\n };\n const getCurrentIndex = (currentTarget: DropTarget | null): number => {\n if (!currentTarget || currentTarget.type === \"root\") {\n return direction === \"next\" ? -1 : itemCount;\n }\n const resolvedIndex = resolveCurrentIndex(currentTarget);\n if (resolvedIndex != null) return resolvedIndex;\n return direction === \"next\" ? -1 : itemCount;\n };\n const tryCurrentItemTransition = (currentTarget: DropTarget | null): DropTarget | null => {\n if (!currentTarget || currentTarget.type !== \"item\") return null;\n const tryPosition = (position: \"before\" | \"on\" | \"after\"): DropTarget | null => {\n if (currentTarget.dropPosition === position) return null;\n const nextTarget: DropTarget = {\n type: \"item\",\n key: currentTarget.key,\n dropPosition: position,\n };\n return isValidDropTarget(nextTarget) ? nextTarget : null;\n };\n\n if (direction === \"next\") {\n if (currentTarget.dropPosition === \"before\") {\n return tryPosition(\"on\") ?? tryPosition(\"after\");\n }\n if (currentTarget.dropPosition === \"on\") {\n return tryPosition(\"after\");\n }\n } else {\n if (currentTarget.dropPosition === \"after\") {\n return tryPosition(\"on\") ?? tryPosition(\"before\");\n }\n if (currentTarget.dropPosition === \"on\") {\n return tryPosition(\"before\");\n }\n }\n\n return null;\n };\n const scanFromIndex = (\n startIndex: number,\n step: number,\n directionForInsertion: \"next\" | \"previous\",\n ): DropTarget | null => {\n for (let index = startIndex; index >= 0 && index < itemCount; index += step) {\n const onTarget = tryTarget(index, \"on\");\n if (onTarget) return onTarget;\n\n const insertionOrder: Array<\"before\" | \"after\"> =\n directionForInsertion === \"next\" ? [\"before\", \"after\"] : [\"after\", \"before\"];\n for (const position of insertionOrder) {\n const insertionTarget = tryTarget(index, position);\n if (insertionTarget) return insertionTarget;\n }\n }\n return null;\n };\n const findNavigationTarget = (currentIndex: number, step = 1): DropTarget | null => {\n const delta = direction === \"next\" ? 1 : -1;\n const stepSize = Math.max(1, step);\n const nextStart = currentIndex + delta * stepSize;\n const clampedStart = Math.max(0, Math.min(itemCount - 1, nextStart));\n if (nextStart < 0 || nextStart >= itemCount) {\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n }\n const primaryTarget = scanFromIndex(clampedStart, delta, direction);\n if (primaryTarget) return primaryTarget;\n const oppositeDirection: \"next\" | \"previous\" = direction === \"next\" ? \"previous\" : \"next\";\n const oppositeTarget = scanFromIndex(clampedStart - delta, -delta, oppositeDirection);\n if (oppositeTarget) return oppositeTarget;\n\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n };\n const tryTarget = (index: number, position: \"on\" | \"before\" | \"after\"): DropTarget | null => {\n const layoutInfo = getLayoutInfo(index);\n const virtualTarget = getDropTargetFromPoint(\n {\n x: layoutInfo.rect.x + 1,\n y: layoutInfo.rect.y + layoutInfo.rect.height / 2,\n },\n itemCount,\n );\n if (!virtualTarget || virtualTarget.type === \"root\") return null;\n const nextTarget = toCollectionDropTarget({ ...virtualTarget, position });\n return isValidDropTarget(nextTarget) ? nextTarget : null;\n };\n const tryBoundaryTarget = (boundaryDirection: \"next\" | \"previous\"): DropTarget | null => {\n const boundaryIndex = boundaryDirection === \"next\" ? 0 : itemCount - 1;\n const boundaryOrder: Array<\"before\" | \"on\" | \"after\"> =\n boundaryDirection === \"next\" ? [\"before\", \"on\", \"after\"] : [\"after\", \"on\", \"before\"];\n for (const position of boundaryOrder) {\n const candidate = tryTarget(boundaryIndex, position);\n if (candidate) return candidate;\n }\n return null;\n };\n const directTransition =\n resolveCurrentIndex(target) != null ? tryCurrentItemTransition(target) : null;\n if (directTransition) return directTransition;\n if (!target || target.type === \"root\") {\n const boundaryTarget = tryBoundaryTarget(direction);\n if (boundaryTarget) return boundaryTarget;\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n }\n const currentIndex = getCurrentIndex(target);\n const nextStart = currentIndex + (direction === \"next\" ? 1 : -1);\n if (nextStart < 0 || nextStart >= itemCount) {\n const rootTarget: DropTarget = { type: \"root\" };\n if (isValidDropTarget(rootTarget)) return rootTarget;\n const wrappedBoundary = tryBoundaryTarget(direction);\n if (wrappedBoundary) return wrappedBoundary;\n return null;\n }\n return findNavigationTarget(currentIndex, 1);\n };\n const getKeyboardNavigationTarget = (\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null => {\n // If a collection component (e.g. Tree) has installed a keyboard navigation override,\n // delegate to it. This enables collection-aware navigation (tree branch traversal, etc.).\n const override = keyboardNavigationOverride();\n if (override) {\n return override(target, direction, isValidDropTarget);\n }\n return getBaseKeyboardNavigationTarget(target, direction, isValidDropTarget);\n };\n const getKeyboardPageNavigationTarget = (\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null => {\n const itemCount = dropTargetItemCountResolver()?.() ?? 0;\n if (itemCount <= 0) {\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n }\n if (!target || target.type === \"root\") {\n const startIndex = direction === \"next\" ? 0 : itemCount - 1;\n const delta = direction === \"next\" ? 1 : -1;\n const boundaryOrder: Array<\"before\" | \"on\" | \"after\"> =\n direction === \"next\" ? [\"before\", \"on\", \"after\"] : [\"after\", \"on\", \"before\"];\n for (let index = startIndex; index >= 0 && index < itemCount; index += delta) {\n const layoutInfo = getLayoutInfo(index);\n const virtualTarget = getDropTargetFromPoint(\n {\n x: layoutInfo.rect.x + 1,\n y: layoutInfo.rect.y + layoutInfo.rect.height / 2,\n },\n itemCount,\n );\n if (!virtualTarget || virtualTarget.type === \"root\") continue;\n for (const position of boundaryOrder) {\n const candidate = toCollectionDropTarget({ ...virtualTarget, position });\n if (isValidDropTarget(candidate)) return candidate;\n }\n }\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n }\n const resolver = dropTargetIndexResolver();\n const resolvedIndex = resolver?.(target.key);\n const currentIndex =\n resolvedIndex != null\n ? resolvedIndex\n : resolver\n ? direction === \"next\"\n ? -1\n : itemCount\n : typeof target.key === \"number\"\n ? target.key\n : direction === \"next\"\n ? -1\n : itemCount;\n const pageSize = Math.max(1, Math.floor(viewportSize() / Math.max(1, itemSize())));\n const delta = direction === \"next\" ? 1 : -1;\n const nextStart = currentIndex + delta * pageSize;\n const clampedStart = Math.max(0, Math.min(itemCount - 1, nextStart));\n const tryTarget = (index: number, position: \"on\" | \"before\" | \"after\"): DropTarget | null => {\n const layoutInfo = getLayoutInfo(index);\n const virtualTarget = getDropTargetFromPoint(\n {\n x: layoutInfo.rect.x + 1,\n y: layoutInfo.rect.y + layoutInfo.rect.height / 2,\n },\n itemCount,\n );\n if (!virtualTarget || virtualTarget.type === \"root\") return null;\n const nextTarget = toCollectionDropTarget({ ...virtualTarget, position });\n return isValidDropTarget(nextTarget) ? nextTarget : null;\n };\n const scanFromIndex = (startIndex: number, step: number): DropTarget | null => {\n const insertionOrder: Array<\"before\" | \"after\"> =\n step > 0 ? [\"before\", \"after\"] : [\"after\", \"before\"];\n for (let index = startIndex; index >= 0 && index < itemCount; index += step) {\n const onTarget = tryTarget(index, \"on\");\n if (onTarget) return onTarget;\n for (const position of insertionOrder) {\n const insertionTarget = tryTarget(index, position);\n if (insertionTarget) return insertionTarget;\n }\n }\n return null;\n };\n if (nextStart < 0 || nextStart >= itemCount) {\n if (direction === \"next\") {\n const endBoundaryTarget =\n tryTarget(itemCount - 1, \"after\") ??\n tryTarget(itemCount - 1, \"on\") ??\n tryTarget(itemCount - 1, \"before\");\n if (endBoundaryTarget) return endBoundaryTarget;\n const backwardFallback = scanFromIndex(itemCount - 1, -1);\n if (backwardFallback) return backwardFallback;\n } else {\n if (currentIndex <= 0) {\n const rootTarget: DropTarget = { type: \"root\" };\n if (isValidDropTarget(rootTarget)) return rootTarget;\n }\n const startBoundaryTarget =\n tryTarget(0, \"before\") ?? tryTarget(0, \"on\") ?? tryTarget(0, \"after\");\n if (startBoundaryTarget) return startBoundaryTarget;\n const forwardFallback = scanFromIndex(0, 1);\n if (forwardFallback) return forwardFallback;\n }\n\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n }\n const primaryTarget = scanFromIndex(clampedStart, delta);\n if (primaryTarget) return primaryTarget;\n const oppositeTarget = scanFromIndex(clampedStart - delta, -delta);\n if (oppositeTarget) return oppositeTarget;\n\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n };\n\n const contextValue = createMemo<VirtualizerContextValue<O>>(() => ({\n layout: resolvedLayout(),\n layoutOptions: resolvedLayoutOptions(),\n isVirtualized: true,\n getVisibleRange,\n getLayoutInfo,\n getDropTargetFromPoint,\n setDropTargetResolver: assignDropTargetResolver,\n setDropTargetItemCountResolver: assignDropTargetItemCountResolver,\n setDropTargetIndexResolver: assignDropTargetIndexResolver,\n setDropOperationResolver: assignDropOperationResolver,\n setKeyboardNavigationOverride: assignKeyboardNavigationOverride,\n getBaseKeyboardNavigationTarget,\n }));\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n renderItem: (item) => item as JSX.Element,\n isVirtualized: true,\n layoutDelegate: resolvedLayout(),\n dropTargetDelegate: {\n getDropTargetFromPoint: getCollectionDropTargetFromPoint,\n getDropOperation: getCollectionDropOperation,\n getKeyboardNavigationTarget,\n getKeyboardPageNavigationTarget,\n },\n renderDropIndicator: local.renderDropIndicator,\n }));\n\n const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n\n const updateViewportSize = () => {\n if (!containerRef) return;\n const nextHeight = containerRef.clientHeight;\n const nextWidth = containerRef.clientWidth;\n if (nextHeight !== measuredViewportSize()) setMeasuredViewportSize(nextHeight);\n if (nextWidth !== measuredViewportWidth()) setMeasuredViewportWidth(nextWidth);\n };\n\n onMount(() => {\n updateViewportSize();\n const handleResize = () => updateViewportSize();\n window.addEventListener(\"resize\", handleResize);\n const resizeObserver =\n typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(() => updateViewportSize()) : null;\n if (containerRef && resizeObserver) {\n resizeObserver.observe(containerRef);\n }\n onCleanup(() => {\n window.removeEventListener(\"resize\", handleResize);\n resizeObserver?.disconnect();\n });\n });\n\n let scrollFrame: number | undefined;\n onCleanup(() => {\n if (scrollFrame != null) cancelAnimationFrame(scrollFrame);\n });\n\n return (\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <VirtualizerContext.Provider value={contextValue()}>\n <div\n {...filteredDomProps()}\n ref={(el) => {\n containerRef = el;\n }}\n class={local.class}\n style={local.style}\n data-virtualizer\n onScroll={(e) => {\n const target = e.currentTarget as HTMLDivElement;\n if (scrollFrame != null) cancelAnimationFrame(scrollFrame);\n scrollFrame = requestAnimationFrame(() => {\n scrollFrame = undefined;\n if (target.scrollTop !== scrollOffset()) setScrollOffset(target.scrollTop);\n updateViewportSize();\n });\n }}\n >\n {local.children}\n </div>\n </VirtualizerContext.Provider>\n </CollectionRendererContext.Provider>\n );\n}\n\nexport { ListLayout, GridLayout, WaterfallLayout, TableLayout };\n\nexport type {\n VirtualizerVisibleRange,\n VirtualizerRangeContext,\n DefaultVirtualizerLayoutOptions,\n GridLayoutOptions,\n WaterfallLayoutOptions,\n VirtualizerDropTarget,\n LayoutInfo,\n Rect,\n Size,\n Point,\n};\n","/**\n * Separator component for solidaria-components\n *\n * Pre-wired headless separator component that combines aria hooks.\n * Port of react-aria-components/src/Separator.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport {\n createSeparator,\n type AriaSeparatorProps,\n type Orientation,\n} from \"@proyecto-viviana/solidaria\";\nimport { type SlotProps, filterDOMProps } from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface SeparatorRenderProps {\n /** The orientation of the separator. */\n orientation: Orientation;\n}\n\nexport interface SeparatorProps extends AriaSeparatorProps, SlotProps {\n /** The CSS className for the element. A function may be provided to receive render props. */\n class?: string | ((renderProps: SeparatorRenderProps) => string);\n /** The inline style for the element. A function may be provided to receive render props. */\n style?: JSX.CSSProperties | ((renderProps: SeparatorRenderProps) => JSX.CSSProperties);\n /** Ref for the underlying separator element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport const SeparatorContext = createContext<SeparatorProps | null>(null);\n\n/**\n * A separator is a visual divider between two groups of content,\n * e.g. groups of menu items or sections of a page.\n *\n * @example\n * ```tsx\n * <Separator />\n *\n * // Vertical separator\n * <Separator orientation=\"vertical\" />\n *\n * // Custom element type\n * <Separator elementType=\"div\" />\n * ```\n */\nexport function Separator(props: SeparatorProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"ref\", \"slot\"]);\n\n const elementType = createMemo(() => {\n let element = ariaProps.elementType || \"hr\";\n // If vertical and using hr, switch to div since hr is inherently horizontal\n if (element === \"hr\" && ariaProps.orientation === \"vertical\") {\n element = \"div\";\n }\n return element;\n });\n\n const separatorAria = createSeparator({\n get orientation() {\n return ariaProps.orientation;\n },\n get elementType() {\n return ariaProps.elementType;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n get id() {\n return ariaProps.id;\n },\n });\n\n const renderValues = createMemo<SeparatorRenderProps>(() => ({\n orientation: ariaProps.orientation ?? \"horizontal\",\n }));\n\n const resolvedClass = createMemo(() => {\n const cls = local.class;\n if (typeof cls === \"function\") {\n return cls(renderValues());\n }\n return cls ?? \"solidaria-Separator\";\n });\n\n const resolvedStyle = createMemo(() => {\n const style = local.style;\n if (typeof style === \"function\") {\n return style(renderValues());\n }\n return style;\n });\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n return (\n <Dynamic\n component={elementType()}\n {...domProps()}\n {...separatorAria.separatorProps}\n ref={(el: HTMLElement) => assignRef(local.ref, el)}\n class={resolvedClass()}\n style={resolvedStyle()}\n slot={local.slot}\n />\n );\n}\n","/**\n * Toolbar component for solidaria-components\n *\n * Pre-wired headless toolbar component that combines aria hooks.\n * Port of react-aria-components/src/Toolbar.tsx\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n createMemo,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport {\n createToolbar,\n type AriaToolbarProps,\n type Orientation,\n} from \"@proyecto-viviana/solidaria\";\nimport { type SlotProps, filterDOMProps } from \"./utils\";\n\nexport interface ToolbarRenderProps {\n /** The orientation of the toolbar. */\n orientation: Orientation;\n}\n\nexport interface ToolbarProps extends AriaToolbarProps, ParentProps, SlotProps {\n /** The CSS className for the element. A function may be provided to receive render props. */\n class?: string | ((renderProps: ToolbarRenderProps) => string);\n /** The inline style for the element. A function may be provided to receive render props. */\n style?: JSX.CSSProperties | ((renderProps: ToolbarRenderProps) => JSX.CSSProperties);\n /** Additional data-* attributes. */\n [key: `data-${string}`]: string | undefined;\n /** Ref for the toolbar element. */\n ref?: ((el: HTMLDivElement) => void) | { current?: HTMLDivElement | null };\n}\n\nexport interface ToolbarContextValue {\n slots?: {\n [name: string]: Record<string, unknown>;\n };\n}\n\nexport const ToolbarContext = createContext<ToolbarContextValue | null>(null);\n\n/**\n * A toolbar is a container for a set of interactive controls,\n * such as buttons, checkboxes, or links, with arrow key navigation.\n *\n * @example\n * ```tsx\n * <Toolbar aria-label=\"Text formatting\">\n * <Button>Bold</Button>\n * <Button>Italic</Button>\n * <Button>Underline</Button>\n * </Toolbar>\n *\n * // With render props\n * <Toolbar orientation=\"vertical\">\n * {({ orientation }) => (\n * <div data-orientation={orientation}>\n * <Button>Cut</Button>\n * <Button>Copy</Button>\n * <Button>Paste</Button>\n * </div>\n * )}\n * </Toolbar>\n * ```\n */\nexport function Toolbar(props: ToolbarProps): JSX.Element {\n const [local, ariaProps, domProps] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"children\", \"ref\"],\n [\"orientation\", \"aria-label\", \"aria-labelledby\"],\n );\n\n const ctx = useContext(ToolbarContext);\n const slotProps = () => {\n if (ctx?.slots && local.slot) {\n return ctx.slots[local.slot] || {};\n }\n return {};\n };\n\n const { toolbarProps, orientation } = createToolbar({\n get orientation() {\n return ariaProps.orientation;\n },\n get \"aria-label\"() {\n return (\n (ariaProps[\"aria-label\"] as string | undefined) ??\n (slotProps()[\"aria-label\"] as string | undefined)\n );\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"] as string | undefined;\n },\n });\n\n const renderValues = createMemo<ToolbarRenderProps>(() => ({\n orientation: orientation(),\n }));\n\n const resolvedClass = createMemo(() => {\n const cls = local.class;\n if (typeof cls === \"function\") {\n return cls(renderValues());\n }\n return cls ?? \"solidaria-Toolbar\";\n });\n\n const resolvedStyle = createMemo(() => {\n const style = local.style;\n if (typeof style === \"function\") {\n return style(renderValues());\n }\n return style;\n });\n\n const resolvedChildren = createMemo(() => {\n const children = props.children;\n if (typeof children === \"function\") {\n return (children as (props: ToolbarRenderProps) => JSX.Element)(renderValues());\n }\n return children;\n });\n\n const filteredDOMProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n\n return (\n <div\n {...filteredDOMProps()}\n {...toolbarProps}\n class={resolvedClass()}\n style={resolvedStyle()}\n slot={local.slot}\n data-orientation={orientation()}\n ref={(el) => {\n if (!local.ref) return;\n if (typeof local.ref === \"function\") {\n local.ref(el);\n } else {\n local.ref.current = el;\n }\n }}\n >\n {resolvedChildren()}\n </div>\n );\n}\n","/**\n * Autocomplete component for solidaria-components\n *\n * Provides autocomplete functionality by wrapping a text input\n * with a filterable collection (ListBox/Menu).\n *\n * Port of react-aria-components/src/Autocomplete.tsx\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n useContext,\n createMemo,\n splitProps,\n createSignal,\n} from \"solid-js\";\nimport {\n createAutocomplete,\n type AriaAutocompleteOptions,\n type AutocompleteInputProps,\n type CollectionOptions,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createAutocompleteState,\n type AutocompleteState,\n type AutocompleteStateOptions,\n} from \"@proyecto-viviana/solid-stately\";\nimport { type SlotProps } from \"./utils\";\n\nexport interface AutocompleteProps<T = unknown>\n extends\n Omit<AutocompleteStateOptions, \"children\">,\n Omit<AriaAutocompleteOptions<T>, \"inputRef\" | \"collectionRef\">,\n ParentProps,\n SlotProps {}\n\nexport interface AutocompleteContextValue {\n inputProps: AutocompleteInputProps;\n inputRef: (el: HTMLInputElement) => void;\n}\n\nexport interface AutocompleteCollectionContextValue {\n collectionProps: CollectionOptions;\n collectionRef: (el: HTMLElement) => void;\n filter?: (textValue: string) => boolean;\n}\n\nexport const AutocompleteContext = createContext<AutocompleteContextValue | null>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\nexport const AutocompleteCollectionContext =\n createContext<AutocompleteCollectionContextValue | null>(null);\n\n/**\n * Hook to consume autocomplete input context.\n * Use this in your input component (TextField/SearchField) to get the autocomplete props.\n */\nexport function useAutocompleteInput() {\n return useContext(AutocompleteContext);\n}\n\n/**\n * Hook to consume autocomplete state context.\n */\nexport function useAutocompleteState() {\n return useContext(AutocompleteStateContext);\n}\n\n/**\n * Hook to consume autocomplete collection context.\n * Use this in your collection component (ListBox/Menu) to get the autocomplete props.\n */\nexport function useAutocompleteCollection() {\n return useContext(AutocompleteCollectionContext);\n}\n\n/**\n * An autocomplete allows users to search or filter a list of suggestions.\n * It wraps a text input and a collection component (ListBox or Menu),\n * providing keyboard navigation and filtering capabilities.\n *\n * @example\n * ```tsx\n * // Basic usage with SearchField and ListBox\n * <Autocomplete\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * <SearchField aria-label=\"Search\">\n * <Input />\n * </SearchField>\n * <ListBox aria-label=\"Suggestions\">\n * <ListBoxItem>Option 1</ListBoxItem>\n * <ListBoxItem>Option 2</ListBoxItem>\n * <ListBoxItem>Option 3</ListBoxItem>\n * </ListBox>\n * </Autocomplete>\n *\n * // Controlled input value\n * const [value, setValue] = createSignal('');\n * <Autocomplete\n * inputValue={value()}\n * onInputChange={setValue}\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * {/* ... *\\/}\n * </Autocomplete>\n * ```\n */\nexport function Autocomplete<T = unknown>(props: AutocompleteProps<T>): JSX.Element {\n const [stateProps, ariaProps, local] = splitProps(\n props,\n [\"inputValue\", \"defaultInputValue\", \"onInputChange\"],\n [\n \"filter\",\n \"disableAutoFocusFirst\",\n \"disableVirtualFocus\",\n \"collectionId\",\n \"collectionAriaLabel\",\n ],\n );\n\n const state = createAutocompleteState(stateProps);\n\n // Create refs\n let inputRef: HTMLInputElement | undefined;\n let collectionRef: HTMLElement | undefined;\n\n // Create autocomplete aria\n const autocomplete = createAutocomplete<T>(\n {\n ...ariaProps,\n inputRef: () => inputRef,\n collectionRef: () => collectionRef,\n },\n state,\n );\n\n // Input context value\n const inputContextValue = createMemo<AutocompleteContextValue>(() => ({\n inputProps: autocomplete.inputProps,\n inputRef: (el: HTMLInputElement) => {\n inputRef = el;\n },\n }));\n\n // Collection context value\n const collectionContextValue = createMemo<AutocompleteCollectionContextValue>(() => ({\n collectionProps: autocomplete.collectionProps,\n collectionRef: (el: HTMLElement) => {\n collectionRef = el;\n },\n filter: autocomplete.filter,\n }));\n\n return (\n <AutocompleteStateContext.Provider value={state}>\n <AutocompleteContext.Provider value={inputContextValue()}>\n <AutocompleteCollectionContext.Provider value={collectionContextValue()}>\n {props.children}\n </AutocompleteCollectionContext.Provider>\n </AutocompleteContext.Provider>\n </AutocompleteStateContext.Provider>\n );\n}\n","/**\n * Drag and drop composition helpers for solidaria-components.\n *\n * Compatibility target: react-aria-components DragAndDrop exports.\n */\n\nimport { type JSX, type Accessor, createContext, createMemo, useContext } from \"solid-js\";\nimport type {\n DragTypes,\n DropOperation,\n DropTarget,\n ItemDropTarget,\n Key,\n} from \"@proyecto-viviana/solid-stately\";\nimport type { DragAndDropHooks } from \"./useDragAndDrop\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n} from \"./utils\";\n\nexport interface DragAndDropContextValue {\n dragAndDropHooks?: DragAndDropHooks<unknown>;\n dragState?: unknown;\n dropState?: {\n target?: DropTarget | null;\n isDropTarget?: (target: DropTarget) => boolean;\n };\n}\n\nexport const DragAndDropContext = createContext<DragAndDropContextValue>({});\n\nexport interface DropIndicatorRenderProps {\n isDropTarget: boolean;\n}\n\nexport interface DropIndicatorProps extends SlotProps {\n target: ItemDropTarget;\n children?: JSX.Element | ((props: DropIndicatorRenderProps) => JSX.Element);\n class?: ClassNameOrFunction<DropIndicatorRenderProps>;\n style?: StyleOrFunction<DropIndicatorRenderProps>;\n}\n\ninterface DropIndicatorContextValue {\n render: (props: DropIndicatorProps) => JSX.Element;\n}\n\nexport const DropIndicatorContext = createContext<DropIndicatorContextValue | null>(null);\n\nfunction DefaultDropIndicator(props: DropIndicatorProps): JSX.Element {\n const dnd = useContext(DragAndDropContext);\n const isDropTarget = createMemo(() => {\n const target = props.target;\n return dnd.dropState?.isDropTarget?.(target) ?? false;\n });\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-DropIndicator\",\n },\n () => ({\n isDropTarget: isDropTarget(),\n }),\n );\n\n return (\n <div\n role=\"option\"\n aria-disabled={true}\n class={renderProps.class()}\n style={renderProps.style()}\n data-drop-target={dataAttr(isDropTarget())}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nexport function DropIndicator(props: DropIndicatorProps): JSX.Element {\n const context = useContext(DropIndicatorContext);\n if (context) return context.render(props);\n return <DefaultDropIndicator {...props} />;\n}\n\nexport function useRenderDropIndicator(\n hooksOrDropState?:\n | Pick<\n DragAndDropHooks<unknown>,\n \"renderDropIndicator\" | \"isVirtualDragging\" | \"useDropIndicator\"\n >\n | {\n target?: DropTarget | null;\n isDropTarget?: ((target: DropTarget) => boolean) | boolean;\n },\n maybeDropState?: {\n target?: DropTarget | null;\n isDropTarget?: ((target: DropTarget) => boolean) | boolean;\n },\n): ((target: ItemDropTarget) => JSX.Element | undefined) | undefined {\n const looksLikeDropState = (\n value: unknown,\n ): value is {\n target?: DropTarget | null;\n isDropTarget?: ((target: DropTarget) => boolean) | boolean;\n } => {\n return Boolean(\n value &&\n typeof value === \"object\" &&\n (\"isDropTarget\" in (value as Record<string, unknown>) ||\n \"target\" in (value as Record<string, unknown>)),\n );\n };\n\n const dragAndDropHooks = looksLikeDropState(hooksOrDropState) ? undefined : hooksOrDropState;\n const dropState = looksLikeDropState(hooksOrDropState) ? hooksOrDropState : maybeDropState;\n\n // RAC only renders collection indicators when drop hooks are present.\n if (dragAndDropHooks && !dragAndDropHooks.useDropIndicator) return undefined;\n if (!dropState && !dragAndDropHooks?.renderDropIndicator) return undefined;\n\n const targetsEqual = (a: DropTarget | null | undefined, b: DropTarget): boolean => {\n if (!a) return false;\n if (a.type !== b.type) return false;\n if (a.type === \"root\" && b.type === \"root\") return true;\n if (a.type !== \"item\" || b.type !== \"item\") return false;\n return a.key === b.key && a.dropPosition === b.dropPosition;\n };\n\n return (target: ItemDropTarget) => {\n const stateIsDropTarget = dropState?.isDropTarget;\n const isTarget =\n typeof stateIsDropTarget === \"function\"\n ? stateIsDropTarget(target)\n : stateIsDropTarget === true\n ? targetsEqual(dropState?.target, target)\n : false;\n const isVirtualDragging = dragAndDropHooks?.isVirtualDragging?.() ?? false;\n if (!isTarget && !isVirtualDragging) return undefined;\n return dragAndDropHooks?.renderDropIndicator ? (\n dragAndDropHooks.renderDropIndicator(target)\n ) : (\n <DropIndicator target={target} />\n );\n };\n}\n\ntype KeyAccessor = Key | null | undefined | Accessor<Key | null | undefined>;\n\ninterface SelectionManagerLike {\n focusedKey?: KeyAccessor;\n}\n\ninterface CollectionLike {\n getKeyAfter: (key: Key) => Key | null;\n getItem: (key: Key) => { level?: number; type?: string } | null | undefined;\n}\n\ninterface DroppableCollectionStateLike {\n target?: DropTarget | null;\n}\n\nexport interface VirtualRangeLike {\n start: number;\n end: number;\n offsetTop: number;\n offsetBottom: number;\n}\n\nexport interface LayoutInfoProviderLike {\n getLayoutInfo: (index: number) => { rect: { y: number; height: number } };\n}\n\nfunction resolveKey(value: KeyAccessor): Key | null | undefined {\n if (typeof value === \"function\") {\n return (value as Accessor<Key | null | undefined>)();\n }\n return value;\n}\n\nfunction getAfterDropNormalizedKey(target: ItemDropTarget, collection?: CollectionLike): Key {\n if (target.dropPosition !== \"after\" || !collection) return target.key;\n\n let nextKey = collection.getKeyAfter(target.key);\n let lastDescendantKey: Key | null = null;\n\n if (nextKey != null) {\n const targetLevel = collection.getItem(target.key)?.level ?? 0;\n while (nextKey != null) {\n const node = collection.getItem(nextKey);\n if (!node) break;\n if (node.type && node.type !== \"item\") {\n nextKey = collection.getKeyAfter(nextKey);\n continue;\n }\n if ((node.level ?? 0) <= targetLevel) break;\n lastDescendantKey = nextKey;\n nextKey = collection.getKeyAfter(nextKey);\n }\n }\n\n return nextKey ?? lastDescendantKey ?? target.key;\n}\n\nexport function getNormalizedDropTargetKey(\n target: DropTarget | null | undefined,\n collection?: CollectionLike,\n): Key | null {\n if (!target || target.type !== \"item\") return null;\n return getAfterDropNormalizedKey(target, collection);\n}\n\nexport function useDndPersistedKeys(\n selectionManager: SelectionManagerLike | null | undefined,\n dragAndDropHooks?: Pick<DragAndDropHooks<unknown>, \"isVirtualDragging\">,\n dropState?: DroppableCollectionStateLike,\n collection?: CollectionLike,\n): Accessor<Set<Key>> {\n return createMemo(() => {\n const focusedKey = resolveKey(selectionManager?.focusedKey);\n let dropTargetKey: Key | null | undefined;\n\n if (dragAndDropHooks?.isVirtualDragging?.() && dropState?.target?.type === \"item\") {\n dropTargetKey = getNormalizedDropTargetKey(dropState.target, collection) ?? undefined;\n }\n\n const keys = new Set<Key>();\n if (focusedKey != null) keys.add(focusedKey);\n if (dropTargetKey != null) keys.add(dropTargetKey);\n return keys;\n });\n}\n\nexport function mergePersistedKeysIntoVirtualRange(\n baseRange: VirtualRangeLike,\n persistedIndexes: number[],\n itemCount: number,\n layoutInfoProvider: LayoutInfoProviderLike,\n maxExtraItems = 60,\n options?: {\n forceIncludeIndexes?: number[];\n forceIncludeMaxSpan?: number;\n fallbackToForcedWindow?: boolean;\n },\n): VirtualRangeLike {\n const validPersistedIndexes = Array.from(\n new Set(persistedIndexes.filter((index) => index >= 0 && index < itemCount)),\n ).sort((a, b) => a - b);\n const forceIndexes = Array.from(\n new Set(\n (options?.forceIncludeIndexes ?? []).filter((index) => index >= 0 && index < itemCount),\n ),\n );\n\n if (itemCount <= 0) return baseRange;\n if (validPersistedIndexes.length === 0 && forceIndexes.length === 0) return baseRange;\n\n const baseSpan = Math.max(1, baseRange.end - baseRange.start);\n const maxSpan = Math.max(baseSpan, baseSpan + maxExtraItems);\n\n let start = baseRange.start;\n let end = baseRange.end;\n\n const distanceToBaseRange = (index: number): number => {\n if (index < baseRange.start) return baseRange.start - index;\n if (index >= baseRange.end) return index - (baseRange.end - 1);\n return 0;\n };\n\n for (const index of validPersistedIndexes.sort(\n (a, b) => distanceToBaseRange(a) - distanceToBaseRange(b),\n )) {\n const nextStart = Math.min(start, index);\n const nextEnd = Math.max(end, index + 1);\n if (nextEnd - nextStart <= maxSpan) {\n start = nextStart;\n end = nextEnd;\n }\n }\n\n if (forceIndexes.length > 0) {\n const forceMaxSpan = Math.max(maxSpan, options?.forceIncludeMaxSpan ?? Math.max(maxSpan, 300));\n for (const index of forceIndexes) {\n const nextStart = Math.min(start, index);\n const nextEnd = Math.max(end, index + 1);\n if (nextEnd - nextStart <= forceMaxSpan) {\n start = nextStart;\n end = nextEnd;\n }\n }\n\n if (options?.fallbackToForcedWindow !== false) {\n const missingForced = forceIndexes.filter((index) => index < start || index >= end);\n if (missingForced.length > 0) {\n const nearestForced = missingForced[0];\n const forceMaxSpan = Math.max(\n maxSpan,\n options?.forceIncludeMaxSpan ?? Math.max(maxSpan, 300),\n );\n const windowSpan = Math.min(itemCount, Math.max(baseSpan, forceMaxSpan));\n const centeredStart = Math.max(\n 0,\n Math.min(itemCount - windowSpan, nearestForced - Math.floor(windowSpan / 2)),\n );\n start = centeredStart;\n end = Math.min(itemCount, centeredStart + windowSpan);\n }\n }\n }\n\n if (start === baseRange.start && end === baseRange.end) return baseRange;\n\n const startRect = start > 0 ? layoutInfoProvider.getLayoutInfo(start).rect : { y: 0, height: 0 };\n const lastRect = layoutInfoProvider.getLayoutInfo(itemCount - 1).rect;\n const endRect = end > 0 ? layoutInfoProvider.getLayoutInfo(end - 1).rect : { y: 0, height: 0 };\n\n return {\n start,\n end,\n offsetTop: Math.max(0, startRect.y),\n offsetBottom: Math.max(0, lastRect.y + lastRect.height - (endRect.y + endRect.height)),\n };\n}\n\nexport type DropTargetDelegate = {\n getDropTargetFromPoint: (\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ) => DropTarget | null;\n getDropOperation: (\n target: DropTarget,\n types: DragTypes,\n allowedOperations: DropOperation[],\n ) => DropOperation;\n};\n","/**\n * ListBox component for solidaria-components\n *\n * A pre-wired headless listbox that combines state + aria hooks.\n * Port of react-aria-components/src/ListBox.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createListBox,\n createOption,\n createFocusRing,\n mergeProps,\n type AriaListBoxProps,\n type AriaOptionProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n type ListState,\n type Key,\n type DropTarget,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { useVirtualizerContext } from \"./Virtualizer\";\nimport { type DragAndDropHooks } from \"./useDragAndDrop\";\nimport {\n getNormalizedDropTargetKey,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n} from \"./DragAndDrop\";\nimport {\n CollectionRendererContext,\n Section,\n Header,\n Group,\n type CollectionEntry,\n type CollectionRendererContextValue,\n type SectionProps,\n useCollectionRenderer,\n isCollectionSection,\n flattenCollectionEntries,\n} from \"./Collection\";\n\nexport interface ListBoxRenderProps {\n /** Whether the listbox has focus. */\n isFocused: boolean;\n /** Whether the listbox has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the listbox is disabled. */\n isDisabled: boolean;\n /** Whether the listbox is empty. */\n isEmpty: boolean;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") ref(el);\n else ref.current = el;\n}\n\nexport interface ListBoxProps<T> extends Omit<AriaListBoxProps, \"children\">, SlotProps {\n /** The items to render in the listbox. */\n items: CollectionEntry<T>[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** The selection mode. */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n /** The selection behavior (toggle vs replace). */\n selectionBehavior?: \"toggle\" | \"replace\";\n /** Whether disabled items can still receive focus. */\n disabledBehavior?: \"selection\" | \"all\";\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Currently selected keys (controlled). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** The children of the component. A function may be provided to render each item. */\n children: (item: T) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ListBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ListBoxRenderProps>;\n /** A function to render when the listbox is empty. */\n renderEmptyState?: () => JSX.Element;\n /** Whether there are more items to load. */\n hasMore?: boolean;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Ref for the listbox element. */\n ref?: RefLike<HTMLUListElement>;\n /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<T>;\n /** Layout hint for styling parity. */\n layout?: \"stack\" | \"grid\";\n /** Orientation hint for styling parity. */\n orientation?: \"vertical\" | \"horizontal\";\n /** Slot definitions provided through ListBoxContext. */\n slots?: Record<string, Partial<ListBoxProps<T>>>;\n}\n\nexport interface ListBoxOptionRenderProps {\n /** Whether the option is selected. */\n isSelected: boolean;\n /** Whether the option is focused. */\n isFocused: boolean;\n /** Whether the option has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the option is pressed. */\n isPressed: boolean;\n /** Whether the option is hovered. */\n isHovered: boolean;\n /** Whether the option is disabled. */\n isDisabled: boolean;\n}\n\nexport interface ListBoxOptionProps<T>\n extends Omit<AriaOptionProps, \"children\" | \"key\">, SlotProps {\n /** The unique key for the option. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the option. A function may be provided to receive render props. */\n children?: RenderChildren<ListBoxOptionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ListBoxOptionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ListBoxOptionRenderProps>;\n /** The text value of the option (for typeahead). */\n textValue?: string;\n /** Ref for the option element. */\n ref?: RefLike<HTMLLIElement>;\n}\n\nexport interface ListBoxLoadMoreItemProps extends SlotProps {\n /** Called when the sentinel becomes visible. */\n onLoadMore: () => void | Promise<void>;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Scroll offset multiplier for early loading trigger (default: 1 = 100% of viewport height). */\n scrollOffset?: number;\n /** Content for the load more row. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** The inline style for the element. */\n style?: StyleOrFunction<{ isLoading: boolean }>;\n}\n\nexport interface ListBoxSectionProps extends SectionProps {}\n\ninterface ListBoxContextValue<T> {\n state: ListState<T>;\n isDisabled: () => boolean;\n dragAndDropHooks?: DragAndDropHooks<unknown>;\n dragState?: unknown;\n dropState?: unknown;\n slots?: Record<string, Partial<ListBoxProps<T>>>;\n}\n\nexport const ListBoxContext = createContext<ListBoxContextValue<unknown> | null>(null);\nexport const ListBoxStateContext = createContext<ListState<unknown> | null>(null);\nexport const ListStateContext = ListBoxStateContext;\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport function ListBox<T>(props: ListBoxProps<T>): JSX.Element {\n const parentContext = useContext(ListBoxContext) as ListBoxContextValue<T> | null;\n const contextSlotProps = parentContext?.slots?.[props.slot ?? \"default\"];\n const mergedListBoxProps = contextSlotProps\n ? (mergeProps(contextSlotProps, props) as ListBoxProps<T>)\n : props;\n const [local, stateProps, ariaProps] = splitProps(\n mergedListBoxProps,\n [\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"renderEmptyState\",\n \"hasMore\",\n \"isLoading\",\n \"onLoadMore\",\n \"dragAndDropHooks\",\n \"slots\",\n \"ref\",\n ],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"selectionMode\",\n \"selectionBehavior\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"layout\",\n \"orientation\",\n ],\n );\n\n const flatItems = createMemo<T[]>(() => {\n return flattenCollectionEntries(stateProps.items);\n });\n\n const hasSections = createMemo(() => stateProps.items.some((item) => isCollectionSection(item)));\n\n const state = createListState<T>({\n get items() {\n return flatItems();\n },\n get getKey() {\n return stateProps.getKey;\n },\n get getTextValue() {\n return stateProps.getTextValue;\n },\n get getDisabled() {\n return stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectionBehavior() {\n return stateProps.selectionBehavior;\n },\n get disabledBehavior() {\n return stateProps.disabledBehavior;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n });\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const listBoxAria = createListBox(\n {\n ...ariaProps,\n get isDisabled() {\n return resolveDisabled();\n },\n },\n state,\n );\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const renderValues = createMemo<ListBoxRenderProps>(() => ({\n isFocused: state.isFocused() || isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isEmpty: state.collection().size === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ListBox\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n const cleanListBoxProps = () => {\n const { ref: _ref1, ...rest } = listBoxAria.listBoxProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanLabelProps = () => {\n const { ref: _ref3, ...rest } = listBoxAria.labelProps as Record<string, unknown>;\n return rest;\n };\n const [listRef, setListRef] = createSignal<HTMLElement | null>(null);\n\n const isEmpty = () => stateProps.items.length === 0;\n const parentCollectionRenderer = useCollectionRenderer<unknown>();\n const getItemNodes = createMemo(() =>\n Array.from(state.collection()).filter((node) => node.type === \"item\"),\n );\n const getDropTargetByIndex = (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ): DropTarget | null => {\n const node = getItemNodes()[index];\n if (!node) return null;\n return { type: \"item\", key: node.key, dropPosition: position };\n };\n const hasDroppableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(\n hooks?.useDroppableCollectionState &&\n hooks.useDroppableCollection &&\n (hooks.dropTargetDelegate ||\n parentCollectionRenderer?.dropTargetDelegate ||\n hooks.ListDropTargetDelegate),\n );\n });\n const dropState = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n return local.dragAndDropHooks?.useDroppableCollectionState?.({});\n });\n const hasDraggableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);\n });\n const dragState = createMemo(() => {\n if (!hasDraggableDnd()) return undefined;\n return local.dragAndDropHooks?.useDraggableCollectionState?.({\n items: flatItems(),\n });\n });\n createEffect(() => {\n if (!hasDraggableDnd()) return;\n const hooks = local.dragAndDropHooks;\n const activeDragState = dragState();\n if (!hooks?.useDraggableCollection || !activeDragState) return;\n hooks.useDraggableCollection({}, activeDragState, () => listRef());\n });\n const droppableCollection = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n const hooks = local.dragAndDropHooks;\n const activeDropState = dropState();\n if (!hooks?.useDroppableCollection || !activeDropState) return undefined;\n const resolveDirection = (): \"ltr\" | \"rtl\" => {\n const el = listRef();\n if (el && typeof window !== \"undefined\" && typeof window.getComputedStyle === \"function\") {\n const dir = window.getComputedStyle(el).direction;\n if (dir === \"rtl\") return \"rtl\";\n }\n return typeof document !== \"undefined\" && document.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n const dropTargetDelegate =\n hooks.dropTargetDelegate ??\n parentCollectionRenderer?.dropTargetDelegate ??\n (hooks.ListDropTargetDelegate\n ? new hooks.ListDropTargetDelegate(\n () => state.collection(),\n () => listRef(),\n { layout: \"stack\", orientation: \"vertical\", direction: resolveDirection() },\n )\n : undefined);\n if (!dropTargetDelegate) return undefined;\n return hooks.useDroppableCollection(\n {\n dropTargetDelegate,\n keyboardDelegate: {\n getFirstKey: () => state.collection().getFirstKey(),\n getLastKey: () => state.collection().getLastKey(),\n getKeyBelow: (key) => state.collection().getKeyAfter(key),\n getKeyAbove: (key) => state.collection().getKeyBefore(key),\n getKeyPageBelow: (key) => state.collection().getKeyAfter(key),\n getKeyPageAbove: (key) => state.collection().getKeyBefore(key),\n },\n },\n activeDropState,\n () => listRef(),\n );\n });\n const isRootDropTarget = createMemo(() => {\n return Boolean(dropState()?.target?.type === \"root\");\n });\n const dndRenderDropIndicator = createMemo(() =>\n useRenderDropIndicator(local.dragAndDropHooks, dropState()),\n );\n const dndDropIndicator = (index: number, position: \"before\" | \"after\" | \"on\") => {\n const target = getDropTargetByIndex(index, position);\n if (!target || target.type !== \"item\") return undefined;\n return dndRenderDropIndicator()?.(target);\n };\n const virtualizer = useVirtualizerContext();\n const persistedKeys = useDndPersistedKeys(\n { focusedKey: state.focusedKey },\n local.dragAndDropHooks,\n dropState(),\n state.collection(),\n );\n const virtualRange = createMemo(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized || hasSections()) return null;\n const baseRange = virtualizer.getVisibleRange(stateProps.items.length);\n const itemNodes = getItemNodes();\n const persistedIndexes = Array.from(persistedKeys())\n .map((key) => itemNodes.findIndex((node) => node.key === key))\n .filter((index) => index >= 0);\n const dropTarget = dropState()?.target;\n const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection());\n const focusedKey = state.focusedKey();\n const focusedIndex =\n focusedKey != null ? itemNodes.findIndex((node) => node.key === focusedKey) : -1;\n const forceIncludeIndexes = [\n dropTarget?.type === \"item\" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1,\n normalizedDropKey != null\n ? itemNodes.findIndex((node) => node.key === normalizedDropKey)\n : -1,\n dropTarget?.type === \"item\" ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(\n baseRange,\n persistedIndexes,\n stateProps.items.length,\n virtualizer,\n 80,\n {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n },\n );\n });\n createEffect(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;\n const getItemNodes = () =>\n Array.from(state.collection()).filter((node) => node.type === \"item\");\n virtualizer.setDropTargetItemCountResolver(() => getItemNodes().length);\n virtualizer.setDropTargetIndexResolver((key) => {\n const index = getItemNodes().findIndex((node) => node.key === key);\n return index >= 0 ? index : null;\n });\n virtualizer.setDropTargetResolver((target) => {\n const node = getItemNodes()[target.index];\n if (!node) return target;\n return {\n ...target,\n key: typeof node.key === \"string\" || typeof node.key === \"number\" ? node.key : undefined,\n };\n });\n onCleanup(() => {\n virtualizer.setDropTargetIndexResolver(undefined);\n virtualizer.setDropTargetItemCountResolver(undefined);\n virtualizer.setDropTargetResolver(undefined);\n });\n });\n const visibleItems = createMemo(() => {\n const range = virtualRange();\n if (!range) return stateProps.items;\n return stateProps.items.slice(range.start, range.end);\n });\n const sectionedRenderEntries = createMemo(() => {\n let globalIndex = 0;\n return stateProps.items.map((entry) => {\n if (isCollectionSection(entry)) {\n const sectionItems = entry.items.map((item) => ({\n item,\n index: globalIndex++,\n }));\n return {\n type: \"section\" as const,\n section: entry,\n items: sectionItems,\n };\n }\n const indexedItem = {\n item: entry as T,\n index: globalIndex++,\n };\n return {\n type: \"item\" as const,\n item: indexedItem,\n };\n });\n });\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => local.children(item as T),\n renderDropIndicator: (index, position) =>\n dndDropIndicator(index, position) ??\n parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n\n return (\n <ListBoxContext.Provider\n value={\n {\n state,\n isDisabled: resolveDisabled,\n dragAndDropHooks: local.dragAndDropHooks as DragAndDropHooks<unknown> | undefined,\n dragState: dragState(),\n dropState: dropState(),\n slots: local.slots,\n } as ListBoxContextValue<unknown>\n }\n >\n <ListBoxStateContext.Provider value={state}>\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n <ul\n {...mergeProps(\n domProps(),\n cleanListBoxProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as Record<string, unknown> | undefined) ??\n {},\n )}\n ref={(el) => {\n setListRef(el);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={resolveDisabled() || undefined}\n data-empty={isEmpty() || undefined}\n data-layout={stateProps.layout}\n data-orientation={stateProps.orientation}\n data-drop-target={isRootDropTarget() || undefined}\n slot={local.slot}\n >\n <SharedElementTransition>\n {isEmpty() && local.renderEmptyState ? (\n <li role=\"option\" style={{ display: \"contents\" }} data-empty-state>\n {local.renderEmptyState()}\n </li>\n ) : hasSections() ? (\n <For each={sectionedRenderEntries()}>\n {(entry) =>\n entry.type === \"section\" ? (\n <li role=\"presentation\" data-section-wrapper>\n <Section class=\"solidaria-ListBox-section\">\n {entry.section.title != null && (\n <Header class=\"solidaria-ListBox-sectionHeader\">\n {entry.section.title}\n </Header>\n )}\n <Group class=\"solidaria-ListBox-sectionGroup\">\n <ul role=\"group\" aria-label={entry.section[\"aria-label\"]}>\n <For each={entry.items}>\n {(indexedItem) => (\n <>\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"before\",\n )}\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"on\",\n )}\n {local.children(indexedItem.item)}\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"after\",\n )}\n </>\n )}\n </For>\n </ul>\n </Group>\n </Section>\n </li>\n ) : (\n <>\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"before\")}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"on\")}\n {local.children(entry.item.item)}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"after\")}\n </>\n )\n }\n </For>\n ) : (\n <>\n {virtualRange()?.offsetTop ? (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetTop}px` }}\n data-virtualizer-spacer=\"top\"\n />\n ) : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"before\");\n const onIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"on\");\n const afterIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"after\");\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {local.children(item as T)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom ? (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetBottom}px` }}\n data-virtualizer-spacer=\"bottom\"\n />\n ) : null}\n </>\n )}\n </SharedElementTransition>\n {local.hasMore && local.onLoadMore && (\n <ListBoxLoadMoreItem onLoadMore={local.onLoadMore} isLoading={local.isLoading} />\n )}\n </ul>\n </>\n </CollectionRendererContext.Provider>\n </ListBoxStateContext.Provider>\n </ListBoxContext.Provider>\n );\n}\n\n/**\n * An option in a listbox.\n */\nexport function ListBoxOption<T>(props: ListBoxOptionProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"ref\",\n ]);\n\n const context = useContext(ListBoxStateContext);\n if (!context) {\n throw new Error(\"ListBoxOption must be used within a ListBox\");\n }\n const state = context as ListState<T>;\n const listContext = useContext(ListBoxContext) as ListBoxContextValue<T> | null;\n const [ref, setRef] = createSignal<HTMLLIElement | null>(null);\n\n const optionAria = createOption<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(ariaProps.isDisabled || listContext?.isDisabled());\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n get shouldSelectOnPressUp() {\n return ariaProps.shouldSelectOnPressUp;\n },\n get shouldFocusOnHover() {\n return ariaProps.shouldFocusOnHover;\n },\n get onHoverStart() {\n return ariaProps.onHoverStart;\n },\n get onHoverEnd() {\n return ariaProps.onHoverEnd;\n },\n get onHoverChange() {\n return ariaProps.onHoverChange;\n },\n },\n state,\n );\n\n const renderValues = createMemo<ListBoxOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: optionAria.isFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: optionAria.isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ListBox-option\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: optionAria.isSelected,\n }));\n const draggableItem = createMemo(() => {\n if (!listContext?.dragAndDropHooks?.useDraggableItem || !listContext.dragState)\n return undefined;\n return listContext.dragAndDropHooks.useDraggableItem(\n {\n key: local.id as string | number,\n },\n listContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDraggableItem\"]>>[1],\n );\n });\n const droppableItem = createMemo(() => {\n if (!listContext?.dragAndDropHooks?.useDroppableItem || !listContext.dropState)\n return undefined;\n return listContext.dragAndDropHooks.useDroppableItem(\n {\n key: local.id as string | number,\n },\n listContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDroppableItem\"]>>[1],\n () => ref(),\n );\n });\n\n const cleanOptionProps = () => {\n const {\n ref: _ref1,\n \"aria-describedby\": _ariaDescribedby,\n ...rest\n } = optionAria.optionProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n return rest;\n };\n const domProps = () => filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <li\n ref={(el) => {\n setRef(el);\n assignRef(local.ref, el);\n }}\n {...mergeProps(\n domProps(),\n cleanOptionProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={optionAria.isSelected() || undefined}\n data-focused={optionAria.isFocused() || undefined}\n data-focus-visible={optionAria.isFocusVisible() || undefined}\n data-pressed={optionAria.isPressed() || undefined}\n data-hovered={optionAria.isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n data-dragging={draggableItem()?.isDragging || undefined}\n data-drop-target={droppableItem()?.isDropTarget || undefined}\n slot={local.slot}\n >\n {hasPrimitiveLabel() ? (\n <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n )}\n </li>\n </SelectionIndicatorContext.Provider>\n );\n}\n\n/**\n * Load more sentinel item for listbox collections.\n */\nexport function ListBoxLoadMoreItem(props: ListBoxLoadMoreItemProps): JSX.Element {\n let sentinelRef: HTMLDivElement | undefined;\n const [isPending, setIsPending] = createSignal(false);\n\n const isLoading = () => !!props.isLoading || isPending();\n\n const triggerLoadMore = async () => {\n if (isLoading()) return;\n setIsPending(true);\n try {\n await props.onLoadMore();\n } finally {\n setIsPending(false);\n }\n };\n\n createEffect(() => {\n if (!sentinelRef || typeof IntersectionObserver !== \"function\") return;\n\n const offset = props.scrollOffset ?? 1;\n const margin = `0px 0px ${100 * offset}% 0px`;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting) {\n void triggerLoadMore();\n }\n },\n { rootMargin: margin },\n );\n\n observer.observe(sentinelRef);\n return () => observer.disconnect();\n });\n\n const renderProps = useRenderProps(\n {\n children: props.children ?? (() => (isLoading() ? \"Loading more...\" : \"Load more\")),\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-ListBox-loadMore\",\n },\n () => ({ isLoading: isLoading() }),\n );\n\n return (\n <>\n <li style={{ position: \"relative\", width: 0, height: 0, overflow: \"hidden\" }} inert>\n <div ref={sentinelRef} style={{ position: \"absolute\", height: \"1px\", width: \"1px\" }} />\n </li>\n <li\n role=\"option\"\n aria-disabled={true}\n tabIndex={0}\n onFocus={() => {\n void triggerLoadMore();\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-loading={isLoading() || undefined}\n >\n {renderProps.renderChildren()}\n </li>\n </>\n );\n}\n\n/**\n * Section primitive alias for ListBox composition parity.\n */\nexport function ListBoxSection(props: ListBoxSectionProps): JSX.Element {\n return <Section {...props} />;\n}\n\nListBox.Option = ListBoxOption;\nListBox.LoadMoreItem = ListBoxLoadMoreItem;\n","/**\n * Menu component for solidaria-components\n *\n * A pre-wired headless menu that combines state + aria hooks.\n * Port of react-aria-components/src/Menu.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createMenu,\n createMenuItem,\n createMenuTrigger,\n createFocusRing,\n createHover,\n createButton,\n createInteractOutside,\n mergeProps,\n FocusScope,\n type AriaMenuProps,\n type AriaMenuItemProps,\n type AriaMenuTriggerProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSelectionState,\n createMenuState,\n createMenuTriggerState,\n type MenuState,\n type MenuStateProps,\n type OverlayTriggerState,\n type Key,\n type DropTarget,\n type SelectionMode,\n type SelectionStateProps,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport { type DragAndDropHooks } from \"./useDragAndDrop\";\nimport {\n CollectionRendererContext,\n Section,\n Header,\n Group,\n type CollectionEntry,\n type CollectionRendererContextValue,\n type SectionProps,\n useCollectionRenderer,\n flattenCollectionEntries,\n isCollectionSection,\n} from \"./Collection\";\nimport { useVirtualizerContext } from \"./Virtualizer\";\nimport {\n getNormalizedDropTargetKey,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n} from \"./DragAndDrop\";\nimport { PopoverTriggerContext } from \"./contexts\";\n\nexport interface MenuRenderProps {\n /** Whether the menu is focused. */\n isFocused: boolean;\n /** Whether the menu is open. */\n isOpen: boolean;\n /** Whether the menu has no items. */\n isEmpty: boolean;\n}\n\nexport interface MenuProps<T>\n extends\n Omit<AriaMenuProps, \"children\">,\n SlotProps,\n Pick<\n MenuStateProps<T>,\n | \"selectionMode\"\n | \"selectionBehavior\"\n | \"disallowEmptySelection\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"allowDuplicateSelectionEvents\"\n > {\n /** The items to render in the menu. */\n items?: CollectionEntry<T>[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Handler called when an item is activated. */\n onAction?: (key: Key) => void;\n /** Handler called when the menu should close. */\n onClose?: () => void;\n /** The children of the component. A function may be provided to render each item. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** Internal lazy static children accessor used when collection children need menu context. */\n staticChildren?: () => JSX.Element | undefined;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MenuRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MenuRenderProps>;\n /** Content to display when the menu has no items. */\n renderEmptyState?: () => JSX.Element;\n /** Whether the menu should close when an item is selected. */\n shouldCloseOnSelect?: boolean;\n /** Ref for the menu element. */\n ref?: RefLike<HTMLUListElement>;\n /** Custom renderer for the menu element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLUListElement>,\n renderProps: MenuRenderProps,\n ) => JSX.Element;\n /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<T>;\n}\n\nexport interface MenuItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** The parent menu selection mode. */\n selectionMode: SelectionMode;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item opens a submenu. */\n hasSubmenu: boolean;\n /** Whether the submenu is currently open. */\n isOpen: boolean;\n}\n\nexport interface MenuItemProps<T> extends Omit<AriaMenuItemProps, \"children\" | \"key\">, SlotProps {\n /** The unique key for the item. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the item. A function may be provided to receive render props. */\n children?: RenderChildren<MenuItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MenuItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MenuItemRenderProps>;\n /** The text value of the item (for typeahead). */\n textValue?: string;\n /** Handler called when the item is activated. */\n onAction?: () => void;\n /** A URL to link to. Turns the menu item into a link. */\n href?: string;\n /** The target window for the link. */\n target?: string;\n /** The relationship between the linked resource and the current page. */\n rel?: string;\n /** Causes the browser to download the linked URL. */\n download?: boolean | string;\n /** Handler called when hover starts. */\n onHoverStart?: () => void;\n /** Handler called when hover ends. */\n onHoverEnd?: () => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n /** Ref for the menu item element. */\n ref?: RefLike<HTMLLIElement>;\n /** Custom renderer for the menu item element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLLIElement>,\n renderProps: MenuItemRenderProps,\n ) => JSX.Element;\n}\n\nexport interface MenuTriggerRenderProps {\n /** Whether the menu is open. */\n isOpen: boolean;\n /** Whether the trigger is focused. */\n isFocused: boolean;\n /** Whether the trigger has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the trigger is pressed. */\n isPressed: boolean;\n /** Whether the trigger is hovered. */\n isHovered: boolean;\n /** Whether the trigger is disabled. */\n isDisabled: boolean;\n}\n\nexport interface MenuTriggerProps extends Omit<AriaMenuTriggerProps, \"children\">, SlotProps {\n /** The children of the trigger (typically a Button and Menu). */\n children: JSX.Element;\n /** Whether the menu trigger is disabled. */\n isDisabled?: boolean;\n /** Whether the menu is open by default. */\n defaultOpen?: boolean;\n /** Whether the menu is open (controlled). */\n isOpen?: boolean;\n /** Handler called when the open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nexport interface SubmenuTriggerProps extends SlotProps {\n /** The trigger item followed by submenu content. */\n children: JSX.Element;\n /** Delay before opening the submenu on hover. */\n delay?: number;\n /** Whether the submenu is open (controlled). */\n isOpen?: boolean;\n /** Whether the submenu is open by default. */\n defaultOpen?: boolean;\n /** Handler called when the submenu open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\ninterface MenuContextValue<T> {\n state: MenuState<T>;\n isDisabled: () => boolean;\n dragAndDropHooks?: DragAndDropHooks<T>;\n dragState?: unknown;\n dropState?: unknown;\n}\n\ntype MenuSelectionEvent = { shiftKey?: boolean; ctrlKey?: boolean; metaKey?: boolean };\n\ninterface MenuTriggerContextValue {\n state: OverlayTriggerState;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\ninterface MenuItemContextValue {\n props?: () => JSX.HTMLAttributes<HTMLElement>;\n closeOnSelect?: boolean;\n onAction?: () => void;\n setItemRef?: (el: HTMLLIElement | null) => void;\n}\n\ninterface StaticMenuCollectionItem {\n id: Key;\n textValue?: string;\n isDisabled?: boolean;\n}\n\ninterface StaticMenuCollectionContextValue {\n registerItem(item: StaticMenuCollectionItem): void;\n unregisterItem(id: Key): void;\n}\n\ninterface MenuSectionSelectionContextValue {\n selectionMode: () => SelectionMode;\n isSelected(key: Key): boolean;\n isDisabled(key: Key): boolean;\n select(key: Key, event?: MenuSelectionEvent): void;\n shouldCloseOnSelect(): boolean | undefined;\n}\n\ninterface MenuSectionSelectionRegistryContextValue {\n registerItem(key: Key, selection: MenuSectionSelectionContextValue): void;\n unregisterItem(key: Key, selection: MenuSectionSelectionContextValue): void;\n selectItem(key: Key, event?: MenuSelectionEvent): boolean;\n}\n\nexport const MenuContext = createContext<MenuContextValue<unknown> | null>(null);\nexport const MenuStateContext = createContext<MenuState<unknown> | null>(null);\nexport const MenuTriggerContext = createContext<MenuTriggerContextValue | null>(null);\nexport const RootMenuTriggerStateContext = createContext<OverlayTriggerState | null>(null);\nconst MenuItemContext = createContext<MenuItemContextValue | null>(null);\nconst StaticMenuCollectionContext = createContext<StaticMenuCollectionContextValue | null>(null);\nconst MenuSectionSelectionContext = createContext<MenuSectionSelectionContextValue | null>(null);\nconst MenuSectionSelectionRegistryContext =\n createContext<MenuSectionSelectionRegistryContextValue | null>(null);\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") ref(el);\n else ref.current = el;\n}\n\nfunction resolveBoolean(value: unknown): boolean {\n return typeof value === \"function\" ? Boolean((value as () => unknown)()) : Boolean(value);\n}\n\n/**\n * A menu trigger wraps a button and menu, handling the open/close state.\n */\nexport function MenuTrigger(props: MenuTriggerProps): JSX.Element {\n const [local, stateProps] = splitProps(props, [\"slot\"]);\n\n const state = createMenuTriggerState({\n get isOpen() {\n return stateProps.isOpen;\n },\n get defaultOpen() {\n return stateProps.defaultOpen;\n },\n get onOpenChange() {\n return stateProps.onOpenChange;\n },\n });\n\n const menuTrigger = createMenuTrigger(\n {\n get isDisabled() {\n return stateProps.isDisabled;\n },\n },\n state,\n );\n\n return (\n <RootMenuTriggerStateContext.Provider value={state}>\n <MenuTriggerContext.Provider\n value={{\n state,\n get triggerProps() {\n return menuTrigger.menuTriggerProps;\n },\n get menuProps() {\n return menuTrigger.menuProps;\n },\n }}\n >\n {props.children}\n </MenuTriggerContext.Provider>\n </RootMenuTriggerStateContext.Provider>\n );\n}\n\nexport function SubmenuTrigger(props: SubmenuTriggerProps): JSX.Element {\n const children = () =>\n (Array.isArray(props.children) ? props.children : [props.children]) as JSX.Element[];\n const trigger = () => children()[0];\n const content = () => children()[1];\n const parentMenuItemContext = useContext(MenuItemContext);\n const state = createMenuTriggerState({\n get isOpen() {\n return props.isOpen;\n },\n get defaultOpen() {\n return props.defaultOpen;\n },\n get onOpenChange() {\n return props.onOpenChange;\n },\n });\n\n let triggerRef: HTMLLIElement | null = null;\n const triggerId = createUniqueId();\n const menuId = createUniqueId();\n let hoverTimeout: number | undefined;\n const delay = () => props.delay ?? 200;\n\n const clearHoverTimeout = () => {\n if (hoverTimeout != null) {\n window.clearTimeout(hoverTimeout);\n hoverTimeout = undefined;\n }\n };\n\n const openSubmenu = () => {\n clearHoverTimeout();\n state.open();\n };\n\n const scheduleOpen = () => {\n clearHoverTimeout();\n hoverTimeout = window.setTimeout(() => {\n hoverTimeout = undefined;\n state.open();\n }, delay());\n };\n\n onCleanup(clearHoverTimeout);\n\n const menuTriggerContext = createMemo<MenuTriggerContextValue>(() => ({\n state,\n triggerProps: {},\n menuProps: {\n id: menuId,\n \"aria-labelledby\": triggerId,\n },\n }));\n\n const popoverTriggerContext = createMemo(() => ({\n state: {\n isOpen: () => state.isOpen(),\n open: () => state.open(),\n close: () => state.close(),\n toggle: () => state.toggle(),\n },\n triggerRef: () => triggerRef,\n setTriggerRef: (el: HTMLElement | null) => {\n triggerRef = el as HTMLLIElement | null;\n },\n triggerId,\n trigger: \"SubmenuTrigger\",\n }));\n\n const itemContext = createMemo<MenuItemContextValue>(() => ({\n closeOnSelect: false,\n onAction: () => openSubmenu(),\n setItemRef: (el) => {\n triggerRef = el;\n },\n props: () => ({\n id: triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": state.isOpen() || undefined,\n \"aria-controls\": state.isOpen() ? menuId : undefined,\n onPointerEnter: (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n scheduleOpen();\n },\n onPointerOver: (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n scheduleOpen();\n },\n onMouseEnter: () => scheduleOpen(),\n onKeyDown: (event: KeyboardEvent) => {\n if (event.key === \"ArrowRight\" || event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n openSubmenu();\n } else if (event.key === \"ArrowLeft\" && state.isOpen()) {\n event.preventDefault();\n state.close();\n }\n },\n }),\n }));\n\n return (\n <PopoverTriggerContext.Provider value={popoverTriggerContext()}>\n <MenuTriggerContext.Provider value={menuTriggerContext()}>\n <MenuItemContext.Provider value={{ ...parentMenuItemContext, ...itemContext() }}>\n {trigger()}\n </MenuItemContext.Provider>\n {content()}\n </MenuTriggerContext.Provider>\n </PopoverTriggerContext.Provider>\n );\n}\n\n/**\n * A button that opens a menu.\n */\nexport interface MenuButtonProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLButtonElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the button. A function may be provided to receive render props. */\n children?: RenderChildren<MenuTriggerRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MenuTriggerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MenuTriggerRenderProps>;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\nexport interface MenuSectionProps\n extends\n SectionProps,\n Pick<\n SelectionStateProps,\n | \"selectionMode\"\n | \"selectionBehavior\"\n | \"disallowEmptySelection\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"disabledKeys\"\n | \"disabledBehavior\"\n | \"allowDuplicateSelectionEvents\"\n > {\n /** Whether menu items in this section should close the menu when selected. */\n shouldCloseOnSelect?: boolean;\n}\n\nexport function MenuButton(props: MenuButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"isDisabled\", \"children\"]);\n\n const context = useContext(MenuTriggerContext);\n if (!context) {\n throw new Error(\"MenuButton must be used within a MenuTrigger\");\n }\n const { state } = context;\n\n const buttonAria = createButton({\n get isDisabled() {\n return local.isDisabled;\n },\n onPress() {\n state.toggle();\n },\n });\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return local.isDisabled;\n },\n });\n\n const renderValues = createMemo<MenuTriggerRenderProps>(() => ({\n isOpen: state.isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: !!local.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-MenuButton\",\n },\n renderValues,\n );\n\n const resolvedTriggerProps = () => context.triggerProps as Record<string, unknown>;\n const cleanTriggerProps = () => {\n const {\n ref: _ref1,\n \"aria-haspopup\": _ariaHasPopup,\n \"aria-expanded\": _ariaExpanded,\n \"aria-controls\": _ariaControls,\n \"aria-disabled\": _ariaDisabled,\n ...rest\n } = resolvedTriggerProps();\n return rest;\n };\n const cleanButtonProps = () => {\n const { ref: _ref2, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref4, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <button\n {...domProps}\n {...cleanTriggerProps()}\n {...cleanButtonProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n type=\"button\"\n class={renderProps.class()}\n style={renderProps.style()}\n aria-haspopup={resolvedTriggerProps()[\"aria-haspopup\"] as \"menu\" | \"listbox\" | undefined}\n aria-expanded={resolvedTriggerProps()[\"aria-expanded\"] as boolean | undefined}\n aria-controls={resolvedTriggerProps()[\"aria-controls\"] as string | undefined}\n aria-disabled={resolvedTriggerProps()[\"aria-disabled\"] as boolean | undefined}\n data-open={state.isOpen() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-pressed={buttonAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={local.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n );\n}\n\n/**\n * A menu displays a list of actions or options for the user to choose from.\n */\nexport function Menu<T>(props: MenuProps<T>): JSX.Element {\n const [local, stateProps, ariaProps] = splitProps(\n props,\n [\n \"children\",\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n \"renderEmptyState\",\n \"shouldCloseOnSelect\",\n \"ref\",\n \"staticChildren\",\n ],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectionMode\",\n \"selectionBehavior\",\n \"disallowEmptySelection\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"allowDuplicateSelectionEvents\",\n \"onAction\",\n \"onClose\",\n \"dragAndDropHooks\",\n ],\n );\n\n const triggerContext = useContext(MenuTriggerContext);\n\n const [menuRef, setMenuRef] = createSignal<HTMLUListElement | null>(null);\n const [staticItems, setStaticItems] = createSignal<StaticMenuCollectionItem[]>([]);\n const staticItemMap = new Map<Key, StaticMenuCollectionItem>();\n const sectionSelectionMap = new Map<Key, MenuSectionSelectionContextValue>();\n const usesStaticChildren = () => local.staticChildren != null || stateProps.items == null;\n\n const syncStaticItems = () => {\n setStaticItems(Array.from(staticItemMap.values()));\n };\n\n const staticCollectionContext: StaticMenuCollectionContextValue = {\n registerItem(item) {\n const previous = staticItemMap.get(item.id);\n if (\n previous &&\n previous.textValue === item.textValue &&\n previous.isDisabled === item.isDisabled\n ) {\n return;\n }\n\n staticItemMap.set(item.id, item);\n syncStaticItems();\n },\n unregisterItem(id) {\n if (staticItemMap.delete(id)) {\n syncStaticItems();\n }\n },\n };\n const sectionSelectionRegistry: MenuSectionSelectionRegistryContextValue = {\n registerItem(key, selection) {\n sectionSelectionMap.set(key, selection);\n },\n unregisterItem(key, selection) {\n if (sectionSelectionMap.get(key) === selection) {\n sectionSelectionMap.delete(key);\n }\n },\n selectItem(key, event) {\n const selection = sectionSelectionMap.get(key);\n if (!selection || selection.selectionMode() === \"none\") {\n return false;\n }\n\n selection.select(key, event);\n return true;\n },\n };\n const handleAction = (key: Key) => {\n sectionSelectionRegistry.selectItem(key);\n stateProps.onAction?.(key);\n };\n\n const flatItems = createMemo<T[]>(() => {\n return flattenCollectionEntries(stateProps.items ?? []);\n });\n\n const hasSections = createMemo(() =>\n (stateProps.items ?? []).some((item) => isCollectionSection(item)),\n );\n\n const state = createMenuState<T>({\n get items() {\n return usesStaticChildren() ? (staticItems() as T[]) : flatItems();\n },\n get getKey() {\n return usesStaticChildren()\n ? (item: T) => (item as StaticMenuCollectionItem).id\n : stateProps.getKey;\n },\n get getTextValue() {\n return usesStaticChildren()\n ? (item: T) =>\n (item as StaticMenuCollectionItem).textValue ??\n String((item as StaticMenuCollectionItem).id)\n : stateProps.getTextValue;\n },\n get getDisabled() {\n return usesStaticChildren()\n ? (item: T) => Boolean((item as StaticMenuCollectionItem).isDisabled)\n : stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectionBehavior() {\n return stateProps.selectionBehavior;\n },\n get disallowEmptySelection() {\n return stateProps.disallowEmptySelection;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get allowDuplicateSelectionEvents() {\n return stateProps.allowDuplicateSelectionEvents;\n },\n get onAction() {\n return handleAction;\n },\n get onClose() {\n return stateProps.onClose ?? (() => triggerContext?.state.close());\n },\n });\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const { menuProps, labelProps } = createMenu(\n {\n get isDisabled() {\n return resolveDisabled();\n },\n get label() {\n return ariaProps.label;\n },\n get onAction() {\n return handleAction;\n },\n get onClose() {\n return stateProps.onClose ?? (() => triggerContext?.state.close());\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n },\n state,\n );\n\n const { isFocused, focusProps } = createFocusRing();\n\n createInteractOutside({\n ref: () => menuRef(),\n onInteractOutside: () => {\n if (triggerContext?.state.isOpen()) {\n triggerContext.state.close();\n }\n },\n get isDisabled() {\n return !triggerContext?.state.isOpen();\n },\n });\n\n const renderValues = createMemo<MenuRenderProps>(() => ({\n isFocused: state.isFocused() || isFocused(),\n isOpen: triggerContext?.state.isOpen() ?? true,\n isEmpty: state.collection().size === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Menu\",\n },\n renderValues,\n );\n\n const cleanMenuProps = () => {\n const { ref: _ref1, ...rest } = menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanTriggerMenuProps = () => {\n if (!triggerContext) return {};\n const { ref: _ref2, ...rest } = triggerContext.menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const domProps = createMemo(() =>\n filterDOMProps(ariaProps as Record<string, unknown>, { global: true }),\n );\n const cleanLabelProps = () => {\n const { ref: _ref4, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const setResolvedMenuRef = (el: HTMLUListElement): void => {\n setMenuRef(el);\n assignRef(local.ref, el);\n };\n\n // If inside a MenuTrigger, only render when open\n // If standalone (no trigger context), always render\n const shouldRender = () => (triggerContext ? triggerContext.state.isOpen() : true);\n const parentCollectionRenderer = useCollectionRenderer<unknown>();\n const virtualizer = useVirtualizerContext();\n const getItemNodes = createMemo(() =>\n Array.from(state.collection()).filter((node) => node.type === \"item\"),\n );\n const getDropTargetByIndex = (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ): DropTarget | null => {\n const node = getItemNodes()[index];\n if (!node) return null;\n return { type: \"item\", key: node.key, dropPosition: position };\n };\n const hasDroppableDnd = createMemo(() => {\n const hooks = stateProps.dragAndDropHooks;\n return Boolean(\n hooks?.useDroppableCollectionState &&\n hooks.useDroppableCollection &&\n (hooks.dropTargetDelegate ||\n parentCollectionRenderer?.dropTargetDelegate ||\n hooks.ListDropTargetDelegate),\n );\n });\n const hasDraggableDnd = createMemo(() => {\n const hooks = stateProps.dragAndDropHooks;\n return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);\n });\n const dragState = createMemo(() => {\n if (!hasDraggableDnd()) return undefined;\n return stateProps.dragAndDropHooks?.useDraggableCollectionState?.({\n items: flatItems(),\n });\n });\n const dropState = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n return stateProps.dragAndDropHooks?.useDroppableCollectionState?.({});\n });\n const persistedKeys = useDndPersistedKeys(\n { focusedKey: state.focusedKey },\n stateProps.dragAndDropHooks,\n dropState(),\n state.collection(),\n );\n const virtualRange = createMemo(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized || hasSections()) return null;\n const dynamicItems = stateProps.items ?? [];\n const baseRange = virtualizer.getVisibleRange(dynamicItems.length);\n const itemNodes = getItemNodes();\n const persistedIndexes = Array.from(persistedKeys())\n .map((key) => itemNodes.findIndex((node) => node.key === key))\n .filter((index) => index >= 0);\n const dropTarget = dropState()?.target;\n const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection());\n const focusedKey = state.focusedKey();\n const focusedIndex =\n focusedKey != null ? itemNodes.findIndex((node) => node.key === focusedKey) : -1;\n const forceIncludeIndexes = [\n dropTarget?.type === \"item\" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1,\n normalizedDropKey != null\n ? itemNodes.findIndex((node) => node.key === normalizedDropKey)\n : -1,\n dropTarget?.type === \"item\" ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(\n baseRange,\n persistedIndexes,\n dynamicItems.length,\n virtualizer,\n 80,\n {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n },\n );\n });\n const visibleItems = createMemo(() => {\n const range = virtualRange();\n const items = stateProps.items ?? [];\n if (!range) return items;\n return items.slice(range.start, range.end);\n });\n createEffect(() => {\n if (!hasDraggableDnd()) return;\n const hooks = stateProps.dragAndDropHooks;\n const activeDragState = dragState();\n if (!hooks?.useDraggableCollection || !activeDragState) return;\n hooks.useDraggableCollection({}, activeDragState, () => menuRef());\n });\n const droppableCollection = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n const hooks = stateProps.dragAndDropHooks;\n const activeDropState = dropState();\n if (!hooks?.useDroppableCollection || !activeDropState) return undefined;\n const resolveDirection = (): \"ltr\" | \"rtl\" => {\n const menuEl = menuRef();\n if (\n menuEl &&\n typeof window !== \"undefined\" &&\n typeof window.getComputedStyle === \"function\"\n ) {\n const dir = window.getComputedStyle(menuEl).direction;\n if (dir === \"rtl\") return \"rtl\";\n }\n return typeof document !== \"undefined\" && document.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n const dropTargetDelegate =\n hooks.dropTargetDelegate ??\n parentCollectionRenderer?.dropTargetDelegate ??\n (hooks.ListDropTargetDelegate\n ? new hooks.ListDropTargetDelegate(\n () => state.collection(),\n () => menuRef(),\n { layout: \"stack\", orientation: \"vertical\", direction: resolveDirection() },\n )\n : undefined);\n if (!dropTargetDelegate) return undefined;\n return hooks.useDroppableCollection(\n {\n dropTargetDelegate,\n keyboardDelegate: {\n getFirstKey: () => state.collection().getFirstKey(),\n getLastKey: () => state.collection().getLastKey(),\n getKeyBelow: (key) => state.collection().getKeyAfter(key),\n getKeyAbove: (key) => state.collection().getKeyBefore(key),\n getKeyPageBelow: (key) => state.collection().getKeyAfter(key),\n getKeyPageAbove: (key) => state.collection().getKeyBefore(key),\n },\n },\n activeDropState,\n () => menuRef(),\n );\n });\n const isRootDropTarget = createMemo(() => {\n return Boolean(dropState()?.target?.type === \"root\");\n });\n const dndRenderDropIndicator = createMemo(() =>\n useRenderDropIndicator(stateProps.dragAndDropHooks, dropState()),\n );\n const dndDropIndicator = (index: number, position: \"before\" | \"after\" | \"on\") => {\n const target = getDropTargetByIndex(index, position);\n if (!target || target.type !== \"item\") return undefined;\n return dndRenderDropIndicator()?.(target);\n };\n const sectionedRenderEntries = createMemo(() => {\n let globalIndex = 0;\n return (stateProps.items ?? []).map((entry) => {\n if (isCollectionSection(entry)) {\n const sectionItems = entry.items.map((item) => ({\n item,\n index: globalIndex++,\n }));\n return {\n type: \"section\" as const,\n section: entry,\n items: sectionItems,\n };\n }\n const indexedItem = {\n item: entry as T,\n index: globalIndex++,\n };\n return {\n type: \"item\" as const,\n item: indexedItem,\n };\n });\n });\n const renderDynamicItem = (item: T) =>\n typeof local.children === \"function\" ? local.children(item) : undefined;\n const resolveStaticChild = (child: unknown): JSX.Element | undefined => {\n return typeof child === \"function\"\n ? (child as () => JSX.Element | undefined)()\n : (child as JSX.Element | undefined);\n };\n const renderStaticChildren = () => {\n const staticChildren = (local.staticChildren?.() ?? local.children) as unknown;\n if (Array.isArray(staticChildren)) {\n return staticChildren.map(resolveStaticChild);\n }\n return resolveStaticChild(staticChildren);\n };\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => renderDynamicItem(item as T),\n renderDropIndicator: (index, position) =>\n dndDropIndicator(index, position) ??\n parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n const menuListChildren = () => (\n <SharedElementTransition>\n {state.collection().size === 0 && !usesStaticChildren() && local.renderEmptyState ? (\n <li role=\"presentation\" data-empty-state>\n <div role=\"menuitem\" style={{ display: \"contents\" }}>\n {local.renderEmptyState()}\n </div>\n </li>\n ) : usesStaticChildren() ? (\n renderStaticChildren()\n ) : hasSections() ? (\n <For each={sectionedRenderEntries()}>\n {(entry) =>\n entry.type === \"section\" ? (\n <li role=\"presentation\" data-section-wrapper>\n <Section class=\"solidaria-Menu-section\">\n {entry.section.title != null && (\n <Header class=\"solidaria-Menu-sectionHeader\">{entry.section.title}</Header>\n )}\n <Group class=\"solidaria-Menu-sectionGroup\">\n <ul role=\"group\" aria-label={entry.section[\"aria-label\"]}>\n <For each={entry.items}>\n {(indexedItem) => (\n <>\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"before\",\n )}\n {collectionRenderer().renderDropIndicator?.(indexedItem.index, \"on\")}\n {renderDynamicItem(indexedItem.item)}\n {collectionRenderer().renderDropIndicator?.(indexedItem.index, \"after\")}\n </>\n )}\n </For>\n </ul>\n </Group>\n </Section>\n </li>\n ) : (\n <>\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"before\")}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"on\")}\n {renderDynamicItem(entry.item.item)}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"after\")}\n </>\n )\n }\n </For>\n ) : (\n <>\n {virtualRange()?.offsetTop ? (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetTop}px` }}\n data-virtualizer-spacer=\"top\"\n />\n ) : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"before\");\n const onIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"on\");\n const afterIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"after\");\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {renderDynamicItem(item as T)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom ? (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetBottom}px` }}\n data-virtualizer-spacer=\"bottom\"\n />\n ) : null}\n </>\n )}\n </SharedElementTransition>\n );\n const menuListProps = () =>\n ({\n ref: setResolvedMenuRef,\n ...mergeProps(\n domProps(),\n cleanMenuProps(),\n cleanTriggerMenuProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-focused\": state.isFocused() || undefined,\n \"data-disabled\": resolveDisabled() || undefined,\n \"data-empty\": state.collection().size === 0 || undefined,\n \"data-drop-target\": isRootDropTarget() || undefined,\n children: menuListChildren(),\n }) as JSX.HTMLAttributes<HTMLUListElement>;\n\n // Only use FocusScope when inside a MenuTrigger (for popover behavior)\n // Standalone menus don't need focus restoration\n const menuContent = () => (\n <MenuContext.Provider\n value={\n {\n state,\n isDisabled: resolveDisabled,\n dragAndDropHooks: stateProps.dragAndDropHooks,\n dragState: dragState(),\n dropState: dropState(),\n } as MenuContextValue<unknown>\n }\n >\n <MenuStateContext.Provider value={state}>\n <MenuSectionSelectionRegistryContext.Provider value={sectionSelectionRegistry}>\n <StaticMenuCollectionContext.Provider\n value={usesStaticChildren() ? staticCollectionContext : null}\n >\n <MenuItemContext.Provider value={{ closeOnSelect: local.shouldCloseOnSelect }}>\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n {local.render ? (\n local.render(menuListProps(), renderValues())\n ) : (\n <ul\n ref={setResolvedMenuRef}\n {...mergeProps(\n domProps(),\n cleanMenuProps(),\n cleanTriggerMenuProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as\n | Record<string, unknown>\n | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-focused={state.isFocused() || undefined}\n data-disabled={resolveDisabled() || undefined}\n data-empty={state.collection().size === 0 || undefined}\n data-drop-target={isRootDropTarget() || undefined}\n >\n {menuListChildren()}\n </ul>\n )}\n </>\n </CollectionRendererContext.Provider>\n </MenuItemContext.Provider>\n </StaticMenuCollectionContext.Provider>\n </MenuSectionSelectionRegistryContext.Provider>\n </MenuStateContext.Provider>\n </MenuContext.Provider>\n );\n\n return (\n <Show when={shouldRender()}>\n <Show when={triggerContext} fallback={menuContent()}>\n <FocusScope restoreFocus autoFocus>\n {menuContent()}\n </FocusScope>\n </Show>\n </Show>\n );\n}\n\n/**\n * An item in a menu.\n */\nexport function MenuItem<T>(props: MenuItemProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"onAction\",\n \"href\",\n \"target\",\n \"rel\",\n \"download\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n \"ref\",\n ]);\n\n const context = useContext(MenuStateContext);\n if (!context) {\n throw new Error(\"MenuItem must be used within a Menu\");\n }\n const state = context as MenuState<T>;\n const menuContext = useContext(MenuContext) as MenuContextValue<T> | null;\n const itemContext = useContext(MenuItemContext);\n const staticCollection = useContext(StaticMenuCollectionContext);\n const sectionSelection = useContext(MenuSectionSelectionContext);\n const sectionSelectionRegistry = useContext(MenuSectionSelectionRegistryContext);\n const [ref, setRef] = createSignal<HTMLLIElement | null>(null);\n const contextProps = () => itemContext?.props?.() ?? {};\n const combinedOnAction = () => {\n local.onAction?.();\n itemContext?.onAction?.();\n };\n const activeSectionSelection = () =>\n sectionSelection && sectionSelection.selectionMode() !== \"none\" ? sectionSelection : null;\n let registeredStaticKey: Key | null = null;\n let registeredSectionSelectionKey: Key | null = null;\n let registeredSectionSelection: MenuSectionSelectionContextValue | null = null;\n\n const unregisterSectionSelection = () => {\n if (registeredSectionSelectionKey != null && registeredSectionSelection) {\n sectionSelectionRegistry?.unregisterItem(\n registeredSectionSelectionKey,\n registeredSectionSelection,\n );\n registeredSectionSelectionKey = null;\n registeredSectionSelection = null;\n }\n };\n\n createEffect(() => {\n if (!staticCollection) return;\n\n if (registeredStaticKey != null && registeredStaticKey !== local.id) {\n staticCollection.unregisterItem(registeredStaticKey);\n }\n\n registeredStaticKey = local.id;\n staticCollection.registerItem({\n id: local.id,\n textValue: local.textValue ?? ariaProps[\"aria-label\"],\n isDisabled:\n resolveBoolean(ariaProps.isDisabled) || (sectionSelection?.isDisabled(local.id) ?? false),\n });\n });\n\n onCleanup(() => {\n if (registeredStaticKey != null) {\n staticCollection?.unregisterItem(registeredStaticKey);\n }\n });\n\n createEffect(() => {\n const selection = activeSectionSelection();\n if (!sectionSelectionRegistry || !selection) {\n unregisterSectionSelection();\n return;\n }\n\n if (registeredSectionSelectionKey === local.id && registeredSectionSelection === selection) {\n return;\n }\n\n unregisterSectionSelection();\n registeredSectionSelectionKey = local.id;\n registeredSectionSelection = selection;\n sectionSelectionRegistry.registerItem(local.id, selection);\n });\n\n onCleanup(unregisterSectionSelection);\n\n const itemAria = createMenuItem<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(\n ariaProps.isDisabled ||\n sectionSelection?.isDisabled(local.id) ||\n menuContext?.isDisabled(),\n );\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n get onAction() {\n return combinedOnAction;\n },\n get closeOnSelect() {\n return (\n ariaProps.closeOnSelect ??\n sectionSelection?.shouldCloseOnSelect() ??\n itemContext?.closeOnSelect\n );\n },\n get href() {\n return local.href;\n },\n get target() {\n return local.target;\n },\n get rel() {\n return local.rel;\n },\n get download() {\n return local.download;\n },\n },\n state,\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return itemAria.isDisabled();\n },\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n });\n\n const renderValues = createMemo<MenuItemRenderProps>(() => {\n const selection = activeSectionSelection();\n return {\n isSelected: selection?.isSelected(local.id) ?? itemAria.isSelected(),\n selectionMode: selection?.selectionMode() ?? itemAria.selectionMode(),\n isFocused: itemAria.isFocused(),\n isFocusVisible: itemAria.isFocusVisible(),\n isPressed: itemAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: itemAria.isDisabled(),\n hasSubmenu: Boolean(contextProps()[\"aria-haspopup\"]),\n isOpen: contextProps()[\"aria-expanded\"] === true,\n };\n });\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Menu-item\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const cleanItemProps = () => {\n const {\n ref: _ref1,\n \"aria-describedby\": _ariaDescribedby,\n ...rest\n } = itemAria.menuItemProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n const selection = activeSectionSelection();\n const selectionMode = selection?.selectionMode();\n if (selectionMode) {\n rest.role =\n selectionMode === \"single\"\n ? \"menuitemradio\"\n : selectionMode === \"multiple\"\n ? \"menuitemcheckbox\"\n : \"menuitem\";\n if (selectionMode !== \"none\") {\n rest[\"aria-checked\"] = selection?.isSelected(local.id) ?? false;\n } else {\n delete rest[\"aria-checked\"];\n }\n rest[\"data-selected\"] = selection?.isSelected(local.id) || undefined;\n }\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const domProps = createMemo(() =>\n filterDOMProps(ariaProps as Record<string, unknown>, { global: true }),\n );\n const draggableItem = createMemo(() => {\n if (!menuContext?.dragAndDropHooks?.useDraggableItem || !menuContext.dragState)\n return undefined;\n return menuContext.dragAndDropHooks.useDraggableItem(\n {\n key: local.id as string | number,\n },\n menuContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDraggableItem\"]>>[1],\n );\n });\n const droppableItem = createMemo(() => {\n if (!menuContext?.dragAndDropHooks?.useDroppableItem || !menuContext.dropState)\n return undefined;\n return menuContext.dragAndDropHooks.useDroppableItem(\n {\n key: local.id as string | number,\n },\n menuContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDroppableItem\"]>>[1],\n () => ref(),\n );\n });\n\n const isLink = () => !!local.href;\n\n const cleanItemPropsForLink = () => {\n const all = cleanItemProps();\n const { href: _href, target: _target, rel: _rel, download: _download, ...rest } = all;\n return rest;\n };\n\n const linkDomProps = () => {\n const all = cleanItemProps();\n const result: Record<string, unknown> = {};\n if (all.href !== undefined) result.href = all.href;\n if (all.target !== undefined) result.target = all.target;\n if (all.rel !== undefined) result.rel = all.rel;\n if (all.download !== undefined) result.download = all.download;\n return result;\n };\n\n const dataAttrs = () => {\n const selection = activeSectionSelection();\n return {\n \"data-focused\": itemAria.isFocused() || undefined,\n \"data-focus-visible\": itemAria.isFocusVisible() || undefined,\n \"data-pressed\": itemAria.isPressed() || undefined,\n \"data-hovered\": isHovered() || undefined,\n \"data-disabled\": itemAria.isDisabled() || undefined,\n \"data-selected\": (selection?.isSelected(local.id) ?? itemAria.isSelected()) || undefined,\n \"data-has-submenu\": Boolean(contextProps()[\"aria-haspopup\"]) || undefined,\n \"data-open\": contextProps()[\"aria-expanded\"] === true || undefined,\n \"data-dragging\": draggableItem()?.isDragging || undefined,\n \"data-drop-target\": droppableItem()?.isDropTarget || undefined,\n };\n };\n\n const childContent = () =>\n hasPrimitiveLabel() ? (\n <span {...itemAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n );\n const setResolvedItemRef = (el: HTMLLIElement | null) => {\n setRef(el);\n itemContext?.setItemRef?.(el);\n if (el) assignRef(local.ref, el);\n };\n const menuItemProps = () =>\n ({\n ref: setResolvedItemRef,\n ...mergeProps(\n cleanItemProps(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n ...dataAttrs(),\n children: childContent(),\n }) as JSX.HTMLAttributes<HTMLLIElement>;\n const linkMenuItemProps = () =>\n ({\n ...mergeProps(\n cleanItemPropsForLink(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n linkDomProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n ...dataAttrs(),\n children: childContent(),\n }) as JSX.HTMLAttributes<HTMLLIElement>;\n\n if (local.render && !isLink()) {\n return local.render(menuItemProps(), renderValues());\n }\n\n return (\n <Show\n when={isLink()}\n fallback={\n <li\n ref={(el) => {\n setRef(el);\n itemContext?.setItemRef?.(el);\n assignRef(local.ref, el);\n }}\n {...mergeProps(\n cleanItemProps(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n {...dataAttrs()}\n >\n {childContent()}\n </li>\n }\n >\n <li\n ref={(el) => {\n setRef(el);\n itemContext?.setItemRef?.(el);\n assignRef(local.ref, el);\n }}\n role=\"presentation\"\n >\n {local.render ? (\n local.render(linkMenuItemProps(), renderValues())\n ) : (\n <a\n {...mergeProps(\n cleanItemPropsForLink(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n linkDomProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n {...dataAttrs()}\n >\n {childContent()}\n </a>\n )}\n </li>\n </Show>\n );\n}\n\n/**\n * Section primitive alias for Menu composition parity.\n */\nexport function MenuSection(props: MenuSectionProps): JSX.Element {\n const [selectionProps, sectionProps] = splitProps(props, [\n \"selectionMode\",\n \"selectionBehavior\",\n \"disallowEmptySelection\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"allowDuplicateSelectionEvents\",\n \"shouldCloseOnSelect\",\n ]);\n\n const selectionState = createSelectionState({\n get selectionMode() {\n return selectionProps.selectionMode ?? \"none\";\n },\n get selectionBehavior() {\n return selectionProps.selectionBehavior;\n },\n get disallowEmptySelection() {\n return selectionProps.disallowEmptySelection;\n },\n get selectedKeys() {\n return selectionProps.selectionMode ? selectionProps.selectedKeys : undefined;\n },\n get defaultSelectedKeys() {\n return selectionProps.selectionMode ? selectionProps.defaultSelectedKeys : undefined;\n },\n get onSelectionChange() {\n return selectionProps.selectionMode ? selectionProps.onSelectionChange : undefined;\n },\n get disabledKeys() {\n return selectionProps.disabledKeys;\n },\n get disabledBehavior() {\n return selectionProps.disabledBehavior;\n },\n get allowDuplicateSelectionEvents() {\n return selectionProps.allowDuplicateSelectionEvents;\n },\n });\n\n const sectionSelection: MenuSectionSelectionContextValue = {\n selectionMode: selectionState.selectionMode,\n isSelected: selectionState.isSelected,\n isDisabled: selectionState.isDisabled,\n select(key, event) {\n selectionState.select(key, event);\n },\n shouldCloseOnSelect() {\n return selectionProps.shouldCloseOnSelect;\n },\n };\n\n return (\n <MenuSectionSelectionContext.Provider value={sectionSelection}>\n <Section {...sectionProps} />\n </MenuSectionSelectionContext.Provider>\n );\n}\n\nMenu.Item = MenuItem;\n","/**\n * Select component for solidaria-components\n *\n * A pre-wired headless select that combines state + aria hooks.\n * Port of react-aria-components/src/Select.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n useContext,\n For,\n Show,\n untrack,\n} from \"solid-js\";\nimport {\n createSelect,\n createHiddenSelect,\n createListBox,\n createOption,\n createHover,\n createInteractOutside,\n FocusScope,\n focusSafely,\n mergeProps,\n type AriaSelectProps,\n type AriaListBoxProps,\n type AriaOptionProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSelectState,\n type ListState,\n type SelectState,\n type Key,\n type CollectionNode,\n DEFAULT_VALIDATION_RESULT,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { ListBoxLoadMoreItem } from \"./ListBox\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nfunction getNativeSelectValidation(select: HTMLSelectElement): ValidationResult {\n return {\n isInvalid: !select.validity.valid,\n validationDetails: {\n badInput: select.validity.badInput,\n customError: select.validity.customError,\n patternMismatch: select.validity.patternMismatch,\n rangeOverflow: select.validity.rangeOverflow,\n rangeUnderflow: select.validity.rangeUnderflow,\n stepMismatch: select.validity.stepMismatch,\n tooLong: select.validity.tooLong,\n tooShort: select.validity.tooShort,\n typeMismatch: select.validity.typeMismatch,\n valueMissing: select.validity.valueMissing,\n valid: select.validity.valid,\n },\n validationErrors: select.validationMessage ? [select.validationMessage] : [],\n };\n}\n\nexport interface SelectRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the select is focused. */\n isFocused: boolean;\n /** Whether the select has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the select is disabled. */\n isDisabled: boolean;\n /** Whether the select is required. */\n isRequired: boolean;\n /** Whether a value is selected. */\n isSelected: boolean;\n}\n\nexport interface SelectProps<T> extends Omit<AriaSelectProps, \"children\">, SlotProps {\n /** The items to render in the select. */\n items: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Selection mode. */\n selectionMode?: \"single\" | \"multiple\";\n /** The currently selected key (controlled). */\n selectedKey?: Key | null;\n /** The default selected key (uncontrolled). */\n defaultSelectedKey?: Key | null;\n /** Currently selected keys (controlled, for multiple selection). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled, for multiple selection). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (key: Key | null) => void;\n /** Handler called when selected keys change. */\n onSelectionChangeKeys?: (keys: \"all\" | Set<Key>) => void;\n /** Whether the select is open (controlled). */\n isOpen?: boolean;\n /** Whether the select is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Placeholder text when no option is selected. */\n placeholder?: string;\n /** The name of the select, used when submitting an HTML form. */\n name?: string;\n /** The children of the component (compound components: SelectTrigger, SelectListBox). */\n children: RenderChildren<SelectRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectRenderProps>;\n /** Custom renderer for the outer select element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLDivElement>,\n renderProps: SelectRenderProps,\n ) => JSX.Element;\n /** Ref for the outer select element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface SelectValueRenderProps<T> {\n /** The selected item. */\n selectedItem: CollectionNode<T> | null;\n /** The selected items. */\n selectedItems: CollectionNode<T>[];\n /** The text value of the selected item. */\n selectedText: string | null;\n /** Whether a value is selected. */\n isSelected: boolean;\n /** The placeholder text. */\n placeholder: string | undefined;\n}\n\nexport interface SelectValueProps<T> extends SlotProps {\n /** The children of the value. A function may be provided to receive render props. */\n children?: RenderChildren<SelectValueRenderProps<T>>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectValueRenderProps<T>>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectValueRenderProps<T>>;\n /** Placeholder text when no option is selected. Overrides the placeholder from Select. */\n placeholder?: string;\n}\n\nexport interface SelectTriggerRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the trigger is focused. */\n isFocused: boolean;\n /** Whether the trigger has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the trigger is hovered. */\n isHovered: boolean;\n /** Whether the trigger is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectTriggerProps extends SlotProps {\n /** The children of the trigger. A function may be provided to receive render props. */\n children?: RenderChildren<SelectTriggerRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectTriggerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectTriggerRenderProps>;\n}\n\nexport interface SelectListBoxRenderProps {\n /** Whether the listbox is focused. */\n isFocused: boolean;\n}\n\nexport interface SelectListBoxProps<T> extends SlotProps {\n /** The children of the listbox. A function may be provided to render each item. */\n children?: (item: T) => JSX.Element;\n /** Content to display when the listbox has no items. */\n renderEmptyState?: () => JSX.Element;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Content to display in the load more sentinel row. */\n renderLoadMore?: () => JSX.Element | undefined;\n /** CSS class for the load more sentinel row. */\n loadMoreClass?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** Whether the listbox is rendered inside an overlay popover. */\n isInPopover?: boolean;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectListBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectListBoxRenderProps>;\n}\n\nexport interface SelectOptionRenderProps {\n /** Whether the option is selected. */\n isSelected: boolean;\n /** Whether the option is focused. */\n isFocused: boolean;\n /** Whether the option has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the option is pressed. */\n isPressed: boolean;\n /** Whether the option is hovered. */\n isHovered: boolean;\n /** Whether the option is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectOptionProps<T> extends Omit<AriaOptionProps, \"children\" | \"key\">, SlotProps {\n /** The unique key for the option. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the option. A function may be provided to receive render props. */\n children?: RenderChildren<SelectOptionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectOptionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectOptionRenderProps>;\n /** The text value of the option (for typeahead). */\n textValue?: string;\n}\n\ninterface SelectContextValue<T> {\n state: SelectState<T>;\n rootRef: Accessor<HTMLElement | null>;\n triggerRef: Accessor<HTMLElement | null>;\n setTriggerRef: (el: HTMLElement | null) => void;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n valueProps: JSX.HTMLAttributes<HTMLElement>;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n validation?: ValidationResult;\n isOpen: Accessor<boolean>;\n isFocused: Accessor<boolean>;\n isFocusVisible: Accessor<boolean>;\n isDisabled: Accessor<boolean>;\n placeholder?: string;\n items: T[];\n renderItem?: (item: T) => JSX.Element;\n slots?: Record<string, Partial<SelectProps<T>>>;\n autoFocus?: boolean;\n}\n\nexport const SelectContext = createContext<SelectContextValue<unknown> | null>(null);\nexport const SelectStateContext = createContext<SelectState<unknown> | null>(null);\nexport const SelectValueContext = SelectContext;\n\nconst selectRootLabelProps = new Set([\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n]);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport function Select<T>(props: SelectProps<T>): JSX.Element {\n const parentContext = useContext(SelectContext) as SelectContextValue<T> | null;\n const contextSlotProps = parentContext?.slots?.[props.slot ?? \"default\"] as\n | Partial<SelectProps<T>>\n | undefined;\n const mergedSelectProps = (\n contextSlotProps ? mergeProps(contextSlotProps, props) : props\n ) as SelectProps<T>;\n const [local, stateProps, ariaProps] = splitProps(\n mergedSelectProps,\n [\"class\", \"style\", \"render\", \"ref\", \"slot\", \"children\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectionMode\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onSelectionChangeKeys\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"name\",\n ],\n );\n let rootRef: HTMLDivElement | undefined;\n const [selectValidation, setSelectValidation] =\n createSignal<ValidationResult>(DEFAULT_VALIDATION_RESULT);\n const errorMessageId = createUniqueId();\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const state = createSelectState<T>({\n get items() {\n return stateProps.items;\n },\n get getKey() {\n return stateProps.getKey;\n },\n get getTextValue() {\n return stateProps.getTextValue;\n },\n get getDisabled() {\n return stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get onSelectionChangeKeys() {\n return stateProps.onSelectionChangeKeys;\n },\n get isOpen() {\n return stateProps.isOpen;\n },\n get defaultOpen() {\n return stateProps.defaultOpen;\n },\n get onOpenChange() {\n return stateProps.onOpenChange;\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n });\n\n const selectAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n const { labelProps, triggerProps, valueProps, menuProps, isFocused, isFocusVisible, isOpen } =\n createSelect<T>(selectAriaProps, state);\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled();\n },\n });\n\n const renderValues = createMemo<SelectRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isRequired: !!ariaProps.isRequired,\n isSelected:\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null,\n }));\n const childRenderValues: SelectRenderProps = {\n get isOpen() {\n return isOpen();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return !!ariaProps.isRequired;\n },\n get isSelected() {\n return hasSelection();\n },\n };\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n for (const key of selectRootLabelProps) {\n delete filtered[key];\n }\n return filtered;\n });\n\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const setRootRef = (el: HTMLDivElement) => {\n rootRef = el;\n assignRef(local.ref, el);\n };\n const validation = createMemo<ValidationResult>(() => {\n const current = selectValidation();\n if (current.isInvalid || !ariaProps.isInvalid) {\n return current;\n }\n\n return {\n ...DEFAULT_VALIDATION_RESULT,\n isInvalid: true,\n };\n });\n const isInvalid = createMemo(() => validation().isInvalid);\n const triggerDescribedBy = () => {\n const ids = [\n (triggerProps as { \"aria-describedby\"?: string })[\"aria-describedby\"],\n isInvalid() ? errorMessageId : undefined,\n ]\n .filter(Boolean)\n .join(\" \")\n .split(\" \")\n .filter(Boolean);\n return ids.length ? Array.from(new Set(ids)).join(\" \") : undefined;\n };\n const triggerPropsWithValidation = () =>\n ({\n ...triggerProps,\n \"aria-describedby\": triggerDescribedBy(),\n }) as JSX.HTMLAttributes<HTMLElement>;\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return validation();\n },\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n };\n const focusTrigger = () => {\n triggerRef?.focus();\n };\n const hasSelection = () =>\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null;\n const hasNativeValidation = () => (ariaProps.validationBehavior ?? \"native\") === \"native\";\n const getSelectValidation = (select: HTMLSelectElement): ValidationResult => {\n if (ariaProps.isRequired && !hasSelection()) {\n return {\n isInvalid: true,\n validationDetails: {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valueMissing: true,\n valid: false,\n },\n validationErrors: [select.validationMessage || \"Constraints not satisfied\"],\n };\n }\n return getNativeSelectValidation(select);\n };\n\n const { containerProps, selectProps: hiddenSelectProps } = createHiddenSelect({\n state,\n name: stateProps.name,\n form: ariaProps.form,\n isRequired: ariaProps.isRequired,\n validationBehavior: ariaProps.validationBehavior ?? \"native\",\n get isDisabled() {\n return resolveDisabled();\n },\n });\n const handleHiddenSelectInvalid: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n setSelectValidation(getSelectValidation(event.currentTarget));\n focusTrigger();\n event.preventDefault();\n };\n const handleHiddenSelectChange: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n (hiddenSelectProps as { onChange?: JSX.EventHandler<HTMLSelectElement, Event> }).onChange?.(\n event,\n );\n setSelectValidation(\n hasSelection() && event.currentTarget.validity.valid\n ? DEFAULT_VALIDATION_RESULT\n : getSelectValidation(event.currentTarget),\n );\n };\n createEffect(() => {\n if (hasSelection() && selectValidation().isInvalid) {\n setSelectValidation(DEFAULT_VALIDATION_RESULT);\n }\n });\n let triggerRef: HTMLElement | null = null;\n const setTriggerRef = (el: HTMLElement | null) => {\n triggerRef = el;\n };\n\n const RootChildren = () => {\n const selectChildren = untrack(() =>\n typeof local.children === \"function\"\n ? (local.children as (values: SelectRenderProps) => JSX.Element)(childRenderValues)\n : local.children,\n );\n\n return (\n <>\n <div {...containerProps}>\n <select\n {...hiddenSelectProps}\n name={hasSelection() ? undefined : stateProps.name}\n required={\n (hasNativeValidation() && ariaProps.isRequired && !hasSelection()) || undefined\n }\n onInvalid={handleHiddenSelectInvalid}\n onChange={handleHiddenSelectChange}\n >\n <Show when={state.selectionMode() !== \"multiple\"}>\n <option selected={state.selectedKey() == null} />\n </Show>\n <For each={stateProps.items}>\n {(item) => {\n const itemRecord = isObjectRecord(item) ? item : null;\n const fallbackKey =\n itemRecord != null ? (toKey(itemRecord.key) ?? toKey(itemRecord.id)) : undefined;\n const key = stateProps.getKey?.(item) ?? fallbackKey ?? String(item);\n const fallbackTextValue =\n itemRecord != null\n ? (toTextValue(itemRecord.textValue) ?? toTextValue(itemRecord.label))\n : undefined;\n const textValue =\n stateProps.getTextValue?.(item) ?? fallbackTextValue ?? String(item);\n const selectedKeys = state.selectedKeys();\n const isSelected =\n state.selectionMode() === \"multiple\"\n ? selectedKeys === \"all\"\n ? true\n : (selectedKeys as Set<Key>).has(key)\n : key === state.selectedKey();\n return (\n <option value={String(key)} selected={isSelected}>\n {textValue}\n </option>\n );\n }}\n </For>\n </select>\n <Show when={state.selectionMode() === \"multiple\" && stateProps.name}>\n <For\n each={\n state.selectedKeys() === \"all\"\n ? Array.from(state.collection()).map((item) => item.key)\n : Array.from(state.selectedKeys() as Set<Key>)\n }\n >\n {(key) => (\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(key)}\n disabled={resolveDisabled()}\n />\n )}\n </For>\n </Show>\n <Show\n when={\n state.selectionMode() !== \"multiple\" && stateProps.name && state.selectedKey() != null\n }\n >\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(state.selectedKey())}\n disabled={resolveDisabled()}\n />\n </Show>\n </div>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n {selectChildren}\n </>\n );\n };\n const baseRootProps = () =>\n ({\n ...domProps(),\n ...cleanHoverProps(),\n ref: setRootRef,\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-open\": isOpen() || undefined,\n \"data-disabled\": resolveDisabled() || undefined,\n \"data-required\": ariaProps.isRequired || undefined,\n \"data-invalid\": isInvalid() || undefined,\n \"data-hovered\": isHovered() || undefined,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n const RootContent = () => {\n const renderedRootChildren = <RootChildren />;\n const rootProps = () =>\n ({\n ...baseRootProps(),\n children: renderedRootChildren,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n\n return local.render ? (\n local.render(rootProps(), renderValues())\n ) : (\n <div {...baseRootProps()}>{renderedRootChildren}</div>\n );\n };\n\n return (\n <SelectContext.Provider\n value={\n {\n state,\n rootRef: () => rootRef ?? null,\n triggerRef: () => triggerRef,\n setTriggerRef,\n get triggerProps() {\n return triggerPropsWithValidation();\n },\n valueProps,\n labelProps,\n menuProps,\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n get validation() {\n return validation();\n },\n isOpen,\n isFocused,\n isFocusVisible,\n isDisabled: resolveDisabled,\n placeholder: ariaProps.placeholder,\n items: stateProps.items,\n autoFocus: !!ariaProps.autoFocus,\n } as SelectContextValue<unknown>\n }\n >\n <SelectStateContext.Provider value={state}>\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <RootContent />\n </FieldErrorContext.Provider>\n </SelectStateContext.Provider>\n </SelectContext.Provider>\n );\n}\n\n/**\n * The trigger button for a select.\n */\nexport function SelectTrigger(props: SelectTriggerProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectTrigger must be used within a Select\");\n }\n const { isOpen, isFocused, isFocusVisible, state } = context;\n let triggerRef: HTMLButtonElement | undefined;\n const setTriggerRef = (el: HTMLButtonElement) => {\n triggerRef = el;\n context.setTriggerRef(el);\n };\n\n createEffect(() => {\n if (context.autoFocus) {\n triggerRef?.focus();\n }\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SelectTriggerRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: state.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-trigger\",\n },\n renderValues,\n );\n\n const cleanTriggerProps = () => {\n const { ref: _ref1, ...rest } = context.triggerProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const triggerAriaProps = () => context.triggerProps as Record<string, unknown>;\n const menuAriaProps = () => context.menuProps as Record<string, unknown>;\n return (\n <button\n ref={setTriggerRef}\n {...domProps}\n {...cleanTriggerProps()}\n {...cleanHoverProps()}\n type=\"button\"\n id={triggerAriaProps().id as string | undefined}\n tabIndex={state.isDisabled ? undefined : 0}\n aria-label={triggerAriaProps()[\"aria-label\"] as string | undefined}\n aria-labelledby={triggerAriaProps()[\"aria-labelledby\"] as string | undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen()}\n aria-controls={isOpen() ? (menuAriaProps().id as string | undefined) : undefined}\n aria-disabled={state.isDisabled || undefined}\n aria-required={triggerAriaProps()[\"aria-required\"] as boolean | undefined}\n aria-describedby={triggerAriaProps()[\"aria-describedby\"] as string | undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-open={isOpen() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={state.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n );\n}\n\n// Default children function for SelectValue - defined at module level for SSR stability\nfunction defaultSelectValueChildren<T>(values: SelectValueRenderProps<T>) {\n return values.selectedText ?? values.placeholder ?? \"\";\n}\n\n/**\n * Displays the selected value in a select.\n */\nexport function SelectValue<T>(props: SelectValueProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"placeholder\",\n \"children\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectValue must be used within a Select\");\n }\n const { valueProps, placeholder: contextPlaceholder } = context;\n const state = context.state as SelectState<T>;\n\n const placeholder = () => local.placeholder ?? contextPlaceholder;\n\n const renderValues = createMemo<SelectValueRenderProps<T>>(() => {\n const collection = state.collection();\n const selectedItem =\n state.selectedKey() == null ? null : collection.getItem(state.selectedKey() as Key);\n const selectedKeys = state.selectedKeys();\n const selectedItems =\n selectedKeys === \"all\"\n ? Array.from(collection)\n : Array.from(selectedKeys as Set<Key>)\n .map((key) => collection.getItem(key))\n .filter((item): item is CollectionNode<T> => item != null);\n const selectedText =\n state.selectionMode() === \"multiple\"\n ? selectedItems.length > 0\n ? new Intl.ListFormat(undefined, { style: \"long\", type: \"conjunction\" }).format(\n selectedItems.map((item) => item.textValue),\n )\n : null\n : (selectedItem?.textValue ?? null);\n return {\n selectedItem,\n selectedItems,\n selectedText,\n isSelected:\n state.selectionMode() === \"multiple\" ? selectedItems.length > 0 : selectedItem != null,\n placeholder: placeholder(),\n };\n });\n\n const renderProps = useRenderProps(\n {\n children: props.children ?? defaultSelectValueChildren,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-value\",\n },\n renderValues,\n );\n\n return (\n <span\n {...domProps}\n {...valueProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-placeholder={!renderValues().isSelected || undefined}\n >\n {props.children == null\n ? (renderValues().selectedText ?? renderValues().placeholder ?? \"\")\n : renderProps.renderChildren()}\n </span>\n );\n}\n\n/**\n * The listbox popup for a select.\n */\nexport function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n \"renderEmptyState\",\n \"onLoadMore\",\n \"isLoading\",\n \"renderLoadMore\",\n \"loadMoreClass\",\n \"isInPopover\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectListBox must be used within a Select\");\n }\n const { menuProps, rootRef, state: selectState, isOpen } = context;\n const state = selectState as SelectState<T>;\n\n createEffect(() => {\n if (!isOpen()) {\n return;\n }\n if (state.focusedKey() != null) {\n return;\n }\n const selectedKey = state.selectedKey();\n if (selectedKey != null && !state.collection().getItem(selectedKey)?.isDisabled) {\n state.setFocusedKey(selectedKey);\n }\n });\n\n let listBoxRef: HTMLUListElement | undefined;\n\n createInteractOutside({\n ref: () => rootRef() ?? listBoxRef ?? null,\n onInteractOutside: () => {\n if (isOpen()) {\n state.close();\n }\n },\n get isDisabled() {\n return !isOpen() || local.isInPopover === true;\n },\n });\n\n const { listBoxProps } = createListBox(\n {\n ...(menuProps as unknown as AriaListBoxProps),\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n shouldSelectOnFocus: local.isInPopover === true ? false : undefined,\n get isDisabled() {\n return state.isDisabled;\n },\n },\n createSelectListStateAdapter(state),\n );\n\n const renderValues = createMemo<SelectListBoxRenderProps>(() => ({\n isFocused: state.isFocused(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-listbox\",\n },\n renderValues,\n );\n\n const cleanMenuProps = () => {\n const { ref: _ref1, ...rest } = menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanListBoxProps = () => {\n const { ref: _ref2, ...rest } = listBoxProps as Record<string, unknown>;\n return rest;\n };\n\n const items = () => Array.from(state.collection());\n createEffect(() => {\n if (!isOpen()) return;\n const focusedKey = state.focusedKey();\n if (focusedKey == null) return;\n\n queueMicrotask(() => {\n const option = Array.from(\n listBoxRef?.querySelectorAll<HTMLElement>(\"[role='option']\") ?? [],\n ).find((element) => element.id === String(focusedKey));\n if (option && document.activeElement !== option) {\n focusSafely(option);\n }\n });\n });\n\n const listBox = () => (\n <ul\n ref={(el) => (listBoxRef = el)}\n {...domProps}\n {...cleanMenuProps()}\n {...cleanListBoxProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.isFocused() || undefined}\n data-empty={state.collection().size === 0 || undefined}\n >\n {state.collection().size === 0 && local.renderEmptyState ? (\n <li role=\"option\" style={{ display: \"contents\" }} data-empty-state>\n {local.renderEmptyState()}\n </li>\n ) : (\n <Show\n when={local.children}\n fallback={\n <For each={items()}>\n {(node) => <SelectOption id={node.key}>{node.textValue}</SelectOption>}\n </For>\n }\n >\n <For each={items()}>\n {(node) => (node.value != null ? local.children!(node.value) : null)}\n </For>\n </Show>\n )}\n <Show when={local.onLoadMore}>\n <ListBoxLoadMoreItem\n onLoadMore={local.onLoadMore!}\n isLoading={local.isLoading}\n class={local.loadMoreClass}\n >\n {local.renderLoadMore?.()}\n </ListBoxLoadMoreItem>\n </Show>\n </ul>\n );\n\n return (\n <Show when={isOpen()}>\n <Show\n when={local.isInPopover}\n fallback={\n <FocusScope restoreFocus autoFocus>\n {listBox()}\n </FocusScope>\n }\n >\n {listBox()}\n </Show>\n </Show>\n );\n}\n\n/**\n * An option in a select listbox.\n */\nexport function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n ]);\n\n const context = useContext(SelectStateContext);\n if (!context) {\n throw new Error(\"SelectOption must be used within a Select\");\n }\n const state = context as SelectState<T>;\n const selectContext = useContext(SelectContext) as SelectContextValue<T> | null;\n\n const optionAria = createOption<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(ariaProps.isDisabled || selectContext?.isDisabled());\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n get onHoverStart() {\n return ariaProps.onHoverStart;\n },\n get onHoverEnd() {\n return ariaProps.onHoverEnd;\n },\n get onHoverChange() {\n return ariaProps.onHoverChange;\n },\n },\n {\n ...createSelectListStateAdapter(state),\n select: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n state.setSelectedKeys(new Set([...keys, key]));\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n toggleSelection: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n replaceSelection: (key: Key) => {\n state.setSelectedKey(key);\n if (state.selectionMode() !== \"multiple\") {\n state.close();\n }\n },\n },\n );\n const isOptionFocusVisible = () =>\n optionAria.isFocused() && (selectContext?.isFocusVisible() ?? optionAria.isFocusVisible());\n\n const renderValues = createMemo<SelectOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: isOptionFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: optionAria.isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-option\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: optionAria.isSelected,\n }));\n\n const cleanOptionProps = () => {\n const {\n ref: _ref1,\n \"aria-describedby\": _ariaDescribedby,\n ...rest\n } = optionAria.optionProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n const onClick = rest.onClick as ((event: MouseEvent) => void) | undefined;\n rest.onClick = ((event: MouseEvent) => {\n const wasSelected = optionAria.isSelected();\n onClick?.(event);\n if (typeof PointerEvent === \"undefined\") {\n return;\n }\n queueMicrotask(() => {\n if (state.selectionMode() !== \"multiple\" || optionAria.isSelected() === wasSelected) {\n selectOption();\n }\n });\n }) as JSX.EventHandler<HTMLLIElement, MouseEvent>;\n return rest;\n };\n const selectOption = () => {\n if (optionAria.isDisabled()) {\n return;\n }\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(local.id)) next.delete(local.id);\n else next.add(local.id);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(local.id);\n state.close();\n };\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <li\n {...cleanOptionProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={optionAria.isSelected() || undefined}\n data-focused={optionAria.isFocused() || undefined}\n data-focus-visible={isOptionFocusVisible() || undefined}\n data-pressed={optionAria.isPressed() || undefined}\n data-hovered={optionAria.isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n >\n {hasPrimitiveLabel() ? (\n <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n )}\n </li>\n </SelectionIndicatorContext.Provider>\n );\n}\n\nfunction isObjectRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction toKey(value: unknown): Key | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n return undefined;\n}\n\nfunction toTextValue(value: unknown): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return String(value);\n }\n return undefined;\n}\n\nfunction createSelectListStateAdapter<T>(state: SelectState<T>): ListState<T> {\n const selectedKeys = createMemo(() => {\n const keys = state.selectedKeys();\n return keys === \"all\" ? new Set(Array.from(state.collection()).map((item) => item.key)) : keys;\n });\n\n const disabledKeys = createMemo(() => {\n const keys = new Set<Key>();\n for (const node of state.collection()) {\n if (node.isDisabled) keys.add(node.key);\n }\n return keys;\n });\n\n return {\n collection: state.collection,\n isFocused: state.isFocused,\n setFocused: state.setFocused,\n focusedKey: state.focusedKey,\n setFocusedKey: (key) => state.setFocusedKey(key ?? null),\n childFocusStrategy: () => null,\n selectionMode: () => state.selectionMode(),\n selectionBehavior: () => \"replace\",\n disallowEmptySelection: () => true,\n selectedKeys,\n disabledKeys,\n disabledBehavior: () => \"all\",\n isEmpty: () => selectedKeys().size === 0,\n isSelectAll: () => state.selectedKeys() === \"all\",\n isSelected: (key) => selectedKeys().has(key),\n isDisabled: state.isKeyDisabled,\n setSelectionBehavior: () => {},\n toggleSelection: (key) => {\n if (state.selectionMode() !== \"multiple\") {\n state.setSelectedKey(key);\n return;\n }\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n },\n replaceSelection: (key) => state.setSelectedKey(key),\n setSelectedKeys: (keys) => state.setSelectedKeys(keys),\n selectAll: () => {},\n clearSelection: () =>\n state.selectionMode() === \"multiple\" ? state.setSelectedKeys([]) : state.setSelectedKey(null),\n toggleSelectAll: () => {},\n extendSelection: (toKey) => state.setSelectedKey(toKey),\n select: (key) =>\n state.selectionMode() === \"multiple\"\n ? state.setSelectedKeys([\n ...(state.selectedKeys() === \"all\" ? [] : (state.selectedKeys() as Set<Key>)),\n key,\n ])\n : state.setSelectedKey(key),\n };\n}\n\nSelect.Trigger = SelectTrigger;\nSelect.Value = SelectValue;\nSelect.ListBox = SelectListBox;\nSelect.Option = SelectOption;\n","/**\n * Tabs component for solidaria-components\n *\n * A pre-wired headless tabs component that combines state + aria hooks.\n * Port of react-aria-components/src/Tabs.tsx\n */\n\nimport {\n type Accessor,\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Show,\n onCleanup,\n} from \"solid-js\";\nimport {\n createTabList,\n createTab,\n createTabPanel,\n createFocusRing,\n createHover,\n type AriaTabListProps,\n type AriaTabProps,\n type AriaTabPanelProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createTabListState,\n type TabListState,\n type Key,\n type TabOrientation,\n type KeyboardActivation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\n\nexport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorProps,\n type SelectionIndicatorRenderProps,\n} from \"./SelectionIndicator\";\n\nexport interface TabsRenderProps {\n /** The orientation of the tabs. */\n orientation: TabOrientation;\n /** Whether the tabs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabsProps<T> extends SlotProps {\n /** The items to render in the tab list. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled tabs. */\n disabledKeys?: Iterable<Key>;\n /** The currently selected tab key (controlled). */\n selectedKey?: Key | null;\n /** The default selected tab key (uncontrolled). */\n defaultSelectedKey?: Key;\n /** Handler for tab selection changes. */\n onSelectionChange?: (key: Key) => void;\n /** Whether the tabs are disabled. */\n isDisabled?: boolean;\n /** The keyboard activation mode. */\n keyboardActivation?: KeyboardActivation;\n /** The orientation of the tabs. */\n orientation?: TabOrientation;\n /** The children of the component. */\n children?: RenderChildren<TabsRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabsRenderProps>;\n /** Ref for the root tabs element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface TabListRenderProps {\n /** The orientation of the tab list. */\n orientation: TabOrientation;\n /** Whether the tab list is disabled. */\n isDisabled: boolean;\n /** Whether the tab list has focus. */\n isFocused: boolean;\n /** Whether the tab list has visible focus. */\n isFocusVisible: boolean;\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps, \"children\">, SlotProps {\n /** Items to render in the tab list. */\n items?: T[];\n /** The children of the tab list - static tabs or a render function for each item. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabListRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabListRenderProps>;\n}\n\nexport interface TabRenderProps {\n /** Whether the tab is selected. */\n isSelected: boolean;\n /** Whether the tab is focused. */\n isFocused: boolean;\n /** Whether the tab has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the tab is pressed. */\n isPressed: boolean;\n /** Whether the tab is hovered. */\n isHovered: boolean;\n /** Whether the tab is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabProps extends Omit<AriaTabProps, \"key\">, SlotProps {\n /** The unique key for the tab. */\n id: Key;\n /** The children of the tab. */\n children?: RenderChildren<TabRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabRenderProps>;\n}\n\nexport interface TabPanelRenderProps {\n /** Whether the panel is the selected one. */\n isSelected: boolean;\n /** Whether the panel is focused. */\n isFocused: boolean;\n /** Whether the panel has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the panel is non-interactive while force mounted. */\n isInert: boolean;\n /** Whether the panel is currently entering. */\n isEntering: boolean;\n /** Whether the panel is currently exiting. */\n isExiting: boolean;\n /** State of the tab list. */\n state: TabListState<unknown> | null;\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, SlotProps {\n /** The children of the tab panel. */\n children?: RenderChildren<TabPanelRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabPanelRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabPanelRenderProps>;\n /** Whether to keep the panel mounted when not selected. */\n shouldForceMount?: boolean;\n}\n\nexport interface TabPanelsProps extends SlotProps {\n /** The grouped tab panels. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\ninterface TabsContextValue<T> {\n state: TabListState<T>;\n items: Accessor<T[]>;\n setTabListItems(items: T[] | undefined): void;\n registerTab(tab: RegisteredTab): void;\n unregisterTab(id: Key): void;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, element: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(element);\n } else if (typeof ref === \"object\" && \"current\" in ref) {\n ref.current = element;\n }\n}\n\nexport const TabsContext = createContext<TabsContextValue<unknown> | null>(null);\nexport const TabsStateContext = createContext<TabListState<unknown> | null>(null);\n\ninterface RegisteredTab {\n id: Key;\n textValue?: string;\n isDisabled?: boolean;\n}\n\ninterface CollectionItemLike {\n id?: Key;\n key?: Key;\n label?: string;\n textValue?: string;\n isDisabled?: boolean;\n}\n\nfunction collectionItemKey<T>(item: T): Key {\n const tab = item as CollectionItemLike;\n const key = tab.id ?? tab.key;\n if (key == null) {\n throw new Error(\"Tabs collection items require an id or key.\");\n }\n return key;\n}\n\nfunction staticTabText(tab: RegisteredTab): string {\n return tab.textValue ?? String(tab.id);\n}\n\n/**\n * Tabs provide a way to organize content into multiple sections, with only one section visible at a time.\n */\nexport function Tabs<T>(props: TabsProps<T>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"onSelectionChange\",\n \"isDisabled\",\n \"keyboardActivation\",\n \"orientation\",\n ],\n );\n\n const [tabListItems, setTabListItems] = createSignal<T[] | undefined>(undefined);\n const [registeredTabs, setRegisteredTabs] = createSignal<RegisteredTab[]>([]);\n const effectiveItems = createMemo<T[]>(() => {\n if (stateProps.items) return stateProps.items;\n if (tabListItems()) return tabListItems() ?? [];\n return registeredTabs() as T[];\n });\n\n // Create tab list state\n const state = createTabListState<T>({\n get items() {\n return effectiveItems();\n },\n get getKey() {\n return stateProps.getKey ?? collectionItemKey;\n },\n get getTextValue() {\n return (\n stateProps.getTextValue ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.textValue ?? tab.label ?? staticTabText(tab);\n })\n );\n },\n get getDisabled() {\n return (\n stateProps.getDisabled ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.isDisabled ?? false;\n })\n );\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get isDisabled() {\n return stateProps.isDisabled;\n },\n get keyboardActivation() {\n return stateProps.keyboardActivation;\n },\n get orientation() {\n return stateProps.orientation;\n },\n });\n\n const renderValues = createMemo<TabsRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n children: props.children,\n defaultClassName: \"solidaria-Tabs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: TabsContextValue<T> = {\n state,\n items: effectiveItems,\n setTabListItems(items) {\n setTabListItems(() => items);\n },\n registerTab(tab) {\n setRegisteredTabs((current) => {\n const next = current.filter((item) => item.id !== tab.id);\n next.push(tab);\n return next;\n });\n },\n unregisterTab(id) {\n setRegisteredTabs((current) => current.filter((item) => item.id !== id));\n },\n };\n\n return (\n <TabsContext.Provider value={contextValue as TabsContextValue<unknown>}>\n <TabsStateContext.Provider value={state}>\n <div\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-orientation={state.orientation()}\n data-disabled={state.isDisabled() || undefined}\n >\n {props.children as JSX.Element}\n </div>\n </TabsStateContext.Provider>\n </TabsContext.Provider>\n );\n}\n\n/**\n * A TabList contains Tab elements that represent the available tabs.\n */\nexport function TabList<T>(props: TabListProps<T>): JSX.Element {\n const [local, collectionProps, ariaProps] = splitProps(\n props,\n [\"class\", \"style\", \"slot\"],\n [\"items\"],\n );\n\n const context = useContext(TabsContext);\n\n return (\n <Show when={context} fallback={<div class=\"solidaria-TabList\" role=\"tablist\" />}>\n {(ctx) => (\n <TabListInner\n context={ctx()}\n local={local}\n items={collectionProps.items}\n ariaProps={ariaProps}\n children={props.children}\n />\n )}\n </Show>\n );\n}\n\n/** Inner TabList component that has access to context */\nfunction TabListInner<T>(props: {\n context: TabsContextValue<unknown>;\n local: {\n class?: ClassNameOrFunction<TabListRenderProps>;\n style?: StyleOrFunction<TabListRenderProps>;\n slot?: string;\n };\n ariaProps: Omit<TabListProps<T>, \"children\" | \"class\" | \"style\" | \"slot\" | \"items\">;\n items?: T[];\n children?: JSX.Element | ((item: T) => JSX.Element);\n}): JSX.Element {\n const state = props.context.state as TabListState<T>;\n const items = props.context.items as Accessor<T[]>;\n const renderItem = createMemo(() => {\n if (typeof props.children !== \"function\") {\n return undefined;\n }\n\n const child = props.children as (...args: unknown[]) => JSX.Element;\n if (child.length === 0 && props.items === undefined) {\n return undefined;\n }\n\n return props.children as (item: T) => JSX.Element;\n });\n const renderedChildren = createMemo(() => {\n if (renderItem() || typeof props.children !== \"function\") {\n return props.children as JSX.Element;\n }\n\n return (props.children as () => JSX.Element)();\n });\n\n createEffect(() => {\n props.context.setTabListItems(props.items as unknown[] | undefined);\n });\n\n onCleanup(() => {\n props.context.setTabListItems(undefined);\n });\n\n // Create tab list aria props\n const { tabListProps } = createTabList<T>(props.ariaProps as AriaTabListProps, state);\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const renderValues = createMemo<TabListRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n isFocused: state.isFocused() || isFocused(),\n isFocusVisible: isFocusVisible(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.local.class,\n style: props.local.style,\n defaultClassName: \"solidaria-TabList\",\n },\n renderValues,\n );\n\n // Helper to safely call event handlers that may be bound tuples\n const callHandler = <E extends Event>(\n handler: JSX.EventHandlerUnion<HTMLElement, E> | undefined,\n event: E,\n ) => {\n if (!handler) return;\n if (Array.isArray(handler)) {\n handler[1].call(handler[0], event);\n return;\n }\n if (typeof handler === \"function\") {\n (handler as (evt: E) => void)(event);\n return;\n }\n if (\n typeof handler === \"object\" &&\n \"handleEvent\" in handler &&\n typeof handler.handleEvent === \"function\"\n ) {\n (handler.handleEvent as (evt: E) => void)(event);\n }\n };\n\n // Combine event handlers\n const handleKeyDown = (e: KeyboardEvent) => {\n tabListProps.onKeyDown(e);\n };\n\n const handleFocus = (e: FocusEvent) => {\n tabListProps.onFocus(e);\n callHandler(focusProps.onFocus, e);\n };\n\n const handleBlur = (e: FocusEvent) => {\n tabListProps.onBlur(e);\n callHandler(focusProps.onBlur, e);\n };\n\n return (\n <div\n role={tabListProps.role}\n aria-orientation={tabListProps[\"aria-orientation\"]}\n aria-label={tabListProps[\"aria-label\"]}\n aria-labelledby={tabListProps[\"aria-labelledby\"]}\n aria-describedby={tabListProps[\"aria-describedby\"]}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n data-focused={state.isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-orientation={state.orientation()}\n data-disabled={state.isDisabled() || undefined}\n >\n {renderItem() ? (\n <SharedElementTransition>\n <For each={(props.items ?? items()) as T[]}>{(item) => renderItem()?.(item)}</For>\n </SharedElementTransition>\n ) : (\n renderedChildren()\n )}\n </div>\n );\n}\n\n/**\n * A Tab represents an individual tab in a TabList.\n */\nexport function Tab(props: TabProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"id\"]);\n\n const context = useContext(TabsStateContext);\n const tabsContext = useContext(TabsContext);\n\n return (\n <Show when={context} fallback={<div class=\"solidaria-Tab\" role=\"tab\" />}>\n {(state) => (\n <TabInner\n state={state()}\n tabsContext={tabsContext}\n local={local}\n ariaProps={ariaProps}\n children={props.children}\n />\n )}\n </Show>\n );\n}\n\n/** Inner Tab component that has access to context */\nfunction TabInner(props: {\n state: TabListState<unknown>;\n tabsContext: TabsContextValue<unknown> | null;\n local: {\n class?: ClassNameOrFunction<TabRenderProps>;\n style?: StyleOrFunction<TabRenderProps>;\n slot?: string;\n id: Key;\n };\n ariaProps: Omit<TabProps, \"children\" | \"class\" | \"style\" | \"slot\" | \"id\">;\n children?: RenderChildren<TabRenderProps>;\n}): JSX.Element {\n let tabRef: HTMLDivElement | undefined;\n const textValue = () => {\n if (props.ariaProps[\"aria-label\"]) return props.ariaProps[\"aria-label\"];\n return typeof props.children === \"string\" ? props.children : undefined;\n };\n\n createEffect(() => {\n props.tabsContext?.registerTab({\n id: props.local.id,\n textValue: textValue(),\n isDisabled: props.ariaProps.isDisabled,\n });\n });\n\n onCleanup(() => {\n props.tabsContext?.unregisterTab(props.local.id);\n });\n\n // Create tab aria props\n const tabAria = createTab<unknown>(\n {\n key: props.local.id,\n get isDisabled() {\n return props.ariaProps.isDisabled;\n },\n get \"aria-label\"() {\n return props.ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return props.ariaProps[\"aria-labelledby\"];\n },\n },\n props.state,\n () => tabRef ?? null,\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return tabAria.isDisabled();\n },\n });\n\n const renderValues = createMemo<TabRenderProps>(() => ({\n isSelected: tabAria.isSelected(),\n isFocused: tabAria.isFocused(),\n isFocusVisible: tabAria.isFocusVisible(),\n isPressed: tabAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: tabAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.local.class,\n style: props.local.style,\n defaultClassName: \"solidaria-Tab\",\n },\n renderValues,\n );\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: tabAria.isSelected,\n }));\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <div\n ref={tabRef}\n id={tabAria.tabProps.id}\n role={tabAria.tabProps.role}\n aria-selected={tabAria.isSelected()}\n aria-disabled={tabAria.isDisabled() || undefined}\n aria-controls={tabAria.isSelected() ? tabAria.tabProps[\"aria-controls\"] : undefined}\n aria-label={tabAria.tabProps[\"aria-label\"]}\n aria-labelledby={tabAria.tabProps[\"aria-labelledby\"]}\n tabIndex={tabAria.isSelected() && !tabAria.isDisabled() ? 0 : -1}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={tabAria.tabProps.onKeyDown}\n onMouseDown={tabAria.tabProps.onMouseDown}\n onPointerDown={tabAria.tabProps.onPointerDown}\n onClick={tabAria.tabProps.onClick}\n onFocus={tabAria.tabProps.onFocus}\n {...hoverProps}\n data-selected={tabAria.isSelected() || undefined}\n data-focused={tabAria.isFocused() || undefined}\n data-focus-visible={tabAria.isFocusVisible() || undefined}\n data-pressed={tabAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={tabAria.isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </SelectionIndicatorContext.Provider>\n );\n}\n\n/**\n * Groups multiple TabPanel elements.\n */\nexport function TabPanels(props: TabPanelsProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n const state = useContext(TabsStateContext);\n let ref: HTMLDivElement | undefined;\n let previousSelectedKey: Key | null | undefined = undefined;\n const [panelSize, setPanelSize] = createSignal<{ width?: string; height?: string }>({});\n\n createEffect(() => {\n const selectedKey = state?.selectedKey() ?? null;\n if (!ref) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === undefined) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === selectedKey) return;\n previousSelectedKey = selectedKey;\n\n const transition = window.getComputedStyle(ref).transition;\n const shouldMeasureWidth = /width|inline-size|all/.test(transition);\n const shouldMeasureHeight = /height|block-size|all/.test(transition);\n if (!shouldMeasureWidth && !shouldMeasureHeight) return;\n\n const selectedPanel = ref.querySelector<HTMLElement>('[role=\"tabpanel\"]:not([hidden])');\n if (!selectedPanel) return;\n\n setPanelSize({\n width: shouldMeasureWidth ? `${selectedPanel.offsetWidth}px` : undefined,\n height: shouldMeasureHeight ? `${selectedPanel.offsetHeight}px` : undefined,\n });\n });\n\n const mergedStyle = (): JSX.CSSProperties =>\n ({\n ...local.style,\n ...(panelSize().width ? { \"--tab-panel-width\": panelSize().width } : {}),\n ...(panelSize().height ? { \"--tab-panel-height\": panelSize().height } : {}),\n }) as JSX.CSSProperties;\n\n return (\n <div\n {...domProps()}\n ref={(el) => {\n ref = el;\n }}\n class={local.class ?? \"solidaria-TabPanels\"}\n style={mergedStyle()}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * A TabPanel displays the content for a selected Tab.\n */\nexport function TabPanel(props: TabPanelProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"shouldForceMount\"]);\n\n // Get state from context (may be null for SSR scenarios)\n const state = useContext(TabsStateContext);\n\n // Create tab panel aria props\n const { tabPanelProps, isSelected } = createTabPanel<unknown>(ariaProps, state);\n\n // Create focus ring for the panel\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const isInert = () =>\n Boolean(local.shouldForceMount && ariaProps.id !== undefined && !isSelected());\n const isEntering = () => false;\n const isExiting = () => false;\n\n const renderValues = createMemo<TabPanelRenderProps>(() => ({\n isSelected: isSelected(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isInert: isInert(),\n isEntering: isEntering(),\n isExiting: isExiting(),\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TabPanel\",\n },\n renderValues,\n );\n\n // Determine if we should render the panel\n // If no id is provided, render when any tab is selected (shared panel pattern)\n // If id is provided, render when that specific tab is selected\n const shouldRender = () => {\n if (local.shouldForceMount) return true;\n if (ariaProps.id === undefined) {\n return state ? state.selectedKey() !== null : true;\n }\n return isSelected();\n };\n\n return (\n <Show when={shouldRender()}>\n <div\n id={tabPanelProps.id}\n role={tabPanelProps.role}\n aria-labelledby={tabPanelProps[\"aria-labelledby\"]}\n aria-label={tabPanelProps[\"aria-label\"]}\n aria-describedby={tabPanelProps[\"aria-describedby\"]}\n tabIndex={tabPanelProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onFocus={focusProps.onFocus}\n onBlur={focusProps.onBlur}\n data-selected={isSelected() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n inert={isInert() ? true : undefined}\n data-inert={isInert() || undefined}\n data-entering={isEntering() || undefined}\n data-exiting={isExiting() || undefined}\n hidden={\n ariaProps.id !== undefined && !isSelected() && !local.shouldForceMount ? true : undefined\n }\n >\n {renderProps.renderChildren()}\n </div>\n </Show>\n );\n}\n\nTabs.List = TabList;\nTabs.Tab = Tab;\nTabs.Panels = TabPanels;\nTabs.Panel = TabPanel;\nTabs.SelectionIndicator = SelectionIndicator;\n","import { onCleanup, type JSX } from \"solid-js\";\nimport type { DragItem, DragPreviewRenderer } from \"@proyecto-viviana/solid-stately\";\n\nexport interface DragPreviewProps {\n ref?: { current: DragPreviewRenderer | null };\n children: (\n items: DragItem[],\n ) => JSX.Element | { element: JSX.Element; x?: number; y?: number } | null | undefined;\n}\n\nexport function DragPreview(props: DragPreviewProps): JSX.Element {\n const hasDom = typeof HTMLElement !== \"undefined\";\n const isElementNode = (value: unknown): value is HTMLElement => {\n if (!value) return false;\n if (hasDom && value instanceof HTMLElement) return true;\n return typeof value === \"object\" && (value as { nodeType?: number }).nodeType === 1;\n };\n\n if (props.ref) {\n const renderer: DragPreviewRenderer = (items, callback) => {\n const rendered = props.children(items);\n if (!rendered) {\n callback(null);\n return;\n }\n if (typeof rendered === \"object\" && rendered !== null && \"element\" in rendered) {\n const previewValue = rendered as { element: unknown; x?: number; y?: number };\n callback(\n isElementNode(previewValue.element) ? previewValue.element : null,\n previewValue.x,\n previewValue.y,\n );\n return;\n }\n callback(isElementNode(rendered) ? rendered : null);\n };\n\n props.ref.current = renderer;\n onCleanup(() => {\n if (props.ref?.current === renderer) {\n props.ref.current = null;\n }\n });\n }\n\n return null as unknown as JSX.Element;\n}\n","import type { Accessor } from \"solid-js\";\nimport type { DropTarget } from \"@proyecto-viviana/solid-stately\";\n\ntype Direction = \"ltr\" | \"rtl\";\ntype Orientation = \"horizontal\" | \"vertical\";\ntype Layout = \"stack\" | \"grid\";\n\ninterface CollectionNodeLike {\n key: string | number;\n type?: string;\n}\n\nexport interface ListDropTargetDelegateOptions {\n layout?: Layout;\n orientation?: Orientation;\n direction?: Direction;\n}\n\nconst cssEscape = (value: string): string => {\n const css = (globalThis as { CSS?: { escape?: (input: string) => string } }).CSS;\n return css?.escape ? css.escape(value) : value.replace(/[^a-zA-Z0-9_-]/g, \"\\\\$&\");\n};\n\nexport class ListDropTargetDelegate {\n private collection: Iterable<CollectionNodeLike> | (() => Iterable<CollectionNodeLike>);\n private ref: Accessor<HTMLElement | null>;\n private layout: Layout;\n private orientation: Orientation;\n private direction: Direction;\n\n constructor(\n collection: Iterable<CollectionNodeLike> | (() => Iterable<CollectionNodeLike>),\n ref: Accessor<HTMLElement | null>,\n options?: ListDropTargetDelegateOptions,\n ) {\n this.collection = collection;\n this.ref = ref;\n this.layout = options?.layout ?? \"stack\";\n this.orientation = options?.orientation ?? \"vertical\";\n this.direction = options?.direction ?? \"ltr\";\n }\n\n private getCollection(): Iterable<CollectionNodeLike> {\n return typeof this.collection === \"function\"\n ? (this.collection as () => Iterable<CollectionNodeLike>)()\n : this.collection;\n }\n\n private getPrimaryStart(rect: DOMRect): number {\n return this.orientation === \"horizontal\" ? rect.left : rect.top;\n }\n\n private getPrimaryEnd(rect: DOMRect): number {\n return this.orientation === \"horizontal\" ? rect.right : rect.bottom;\n }\n\n private getSecondaryStart(rect: DOMRect): number {\n return this.orientation === \"horizontal\" ? rect.top : rect.left;\n }\n\n private getSecondaryEnd(rect: DOMRect): number {\n return this.orientation === \"horizontal\" ? rect.bottom : rect.right;\n }\n\n private getFlowStart(rect: DOMRect): number {\n return this.layout === \"stack\" ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);\n }\n\n private getFlowEnd(rect: DOMRect): number {\n return this.layout === \"stack\" ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);\n }\n\n private getFlowSize(rect: DOMRect): number {\n return this.getFlowEnd(rect) - this.getFlowStart(rect);\n }\n\n private getItemKeys(): Array<string | number> {\n return [...this.getCollection()].filter((item) => item.type === \"item\").map((item) => item.key);\n }\n\n private resolveBoundaryTarget(\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null {\n const keys = this.getItemKeys();\n if (keys.length === 0) return null;\n const key = direction === \"next\" ? keys[0] : keys[keys.length - 1];\n const order: Array<\"before\" | \"on\" | \"after\"> =\n direction === \"next\" ? [\"before\", \"on\", \"after\"] : [\"after\", \"on\", \"before\"];\n for (const dropPosition of order) {\n const target: DropTarget = { type: \"item\", key, dropPosition };\n if (isValidDropTarget(target)) return target;\n }\n return null;\n }\n\n private resolveTransitionTarget(\n target: DropTarget,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null {\n if (target.type !== \"item\") return null;\n const tryPosition = (dropPosition: \"before\" | \"on\" | \"after\"): DropTarget | null => {\n if (target.dropPosition === dropPosition) return null;\n const nextTarget: DropTarget = {\n type: \"item\",\n key: target.key,\n dropPosition,\n };\n return isValidDropTarget(nextTarget) ? nextTarget : null;\n };\n\n if (direction === \"next\") {\n if (target.dropPosition === \"before\") {\n return tryPosition(\"on\") ?? tryPosition(\"after\");\n }\n if (target.dropPosition === \"on\") {\n return tryPosition(\"after\");\n }\n } else {\n if (target.dropPosition === \"after\") {\n return tryPosition(\"on\") ?? tryPosition(\"before\");\n }\n if (target.dropPosition === \"on\") {\n return tryPosition(\"before\");\n }\n }\n\n return null;\n }\n\n private resolveNeighborTarget(\n target: DropTarget,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null {\n if (target.type !== \"item\") return null;\n const keys = this.getItemKeys();\n const index = keys.findIndex((key) => key === target.key);\n if (index < 0) return this.resolveBoundaryTarget(direction, isValidDropTarget);\n const nextIndex = direction === \"next\" ? index + 1 : index - 1;\n if (nextIndex < 0 || nextIndex >= keys.length) {\n const rootTarget: DropTarget = { type: \"root\" };\n return isValidDropTarget(rootTarget) ? rootTarget : null;\n }\n const key = keys[nextIndex];\n const order: Array<\"on\" | \"before\" | \"after\"> =\n direction === \"next\" ? [\"on\", \"before\", \"after\"] : [\"on\", \"after\", \"before\"];\n for (const dropPosition of order) {\n const nextTarget: DropTarget = { type: \"item\", key, dropPosition };\n if (isValidDropTarget(nextTarget)) return nextTarget;\n }\n return null;\n }\n\n getKeyboardNavigationTarget(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null {\n if (!target || target.type === \"root\") {\n return this.resolveBoundaryTarget(direction, isValidDropTarget);\n }\n const transition = this.resolveTransitionTarget(target, direction, isValidDropTarget);\n if (transition) return transition;\n return this.resolveNeighborTarget(target, direction, isValidDropTarget);\n }\n\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget {\n const root = this.ref();\n if (!root) {\n return { type: \"root\" };\n }\n\n const allItems = [...this.getCollection()].filter((item) => item.type === \"item\");\n if (allItems.length === 0) {\n return { type: \"root\" };\n }\n\n const collectionId = root.dataset.collection;\n const selector = collectionId ? `[data-collection=\"${cssEscape(collectionId)}\"]` : \"[data-key]\";\n const elements = root.querySelectorAll(selector);\n const elementMap = new Map<string, HTMLElement>();\n for (const node of elements) {\n if (node instanceof HTMLElement && node.dataset.key != null) {\n elementMap.set(node.dataset.key, node);\n }\n }\n\n let low = 0;\n let high = allItems.length;\n const rootRect = root.getBoundingClientRect();\n let primary = this.orientation === \"horizontal\" ? x : y;\n let secondary = this.orientation === \"horizontal\" ? y : x;\n primary += this.getPrimaryStart(rootRect);\n secondary += this.getSecondaryStart(rootRect);\n\n const flow = this.layout === \"stack\" ? primary : secondary;\n const isPrimaryRtl = this.orientation === \"horizontal\" && this.direction === \"rtl\";\n const isSecondaryRtl =\n this.layout === \"grid\" && this.orientation === \"vertical\" && this.direction === \"rtl\";\n const isFlowRtl = this.layout === \"stack\" ? isPrimaryRtl : isSecondaryRtl;\n\n while (low < high) {\n const mid = Math.floor((low + high) / 2);\n const item = allItems[mid];\n const element = elementMap.get(String(item.key));\n if (!element) break;\n const rect = element.getBoundingClientRect();\n const update = (isGreater: boolean) => {\n if (isGreater) {\n low = mid + 1;\n } else {\n high = mid;\n }\n };\n\n if (primary < this.getPrimaryStart(rect)) {\n update(isPrimaryRtl);\n } else if (primary > this.getPrimaryEnd(rect)) {\n update(!isPrimaryRtl);\n } else if (secondary < this.getSecondaryStart(rect)) {\n update(isSecondaryRtl);\n } else if (secondary > this.getSecondaryEnd(rect)) {\n update(!isSecondaryRtl);\n } else {\n const target: DropTarget = {\n type: \"item\",\n key: item.key,\n dropPosition: \"on\",\n };\n\n if (isValidDropTarget(target)) {\n if (\n flow <= this.getFlowStart(rect) + 5 &&\n isValidDropTarget({ ...target, dropPosition: \"before\" })\n ) {\n target.dropPosition = isFlowRtl ? \"after\" : \"before\";\n } else if (\n flow >= this.getFlowEnd(rect) - 5 &&\n isValidDropTarget({ ...target, dropPosition: \"after\" })\n ) {\n target.dropPosition = isFlowRtl ? \"before\" : \"after\";\n }\n } else {\n const midpoint = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;\n if (flow <= midpoint && isValidDropTarget({ ...target, dropPosition: \"before\" })) {\n target.dropPosition = isFlowRtl ? \"after\" : \"before\";\n } else if (flow >= midpoint && isValidDropTarget({ ...target, dropPosition: \"after\" })) {\n target.dropPosition = isFlowRtl ? \"before\" : \"after\";\n }\n }\n\n return target;\n }\n }\n\n const item = allItems[Math.min(low, allItems.length - 1)];\n const element = elementMap.get(String(item.key));\n const rect = element?.getBoundingClientRect();\n if (\n rect &&\n (primary < this.getPrimaryStart(rect) ||\n Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect)))\n ) {\n return {\n type: \"item\",\n key: item.key,\n dropPosition: isFlowRtl ? \"after\" : \"before\",\n };\n }\n\n return {\n type: \"item\",\n key: item.key,\n dropPosition: isFlowRtl ? \"before\" : \"after\",\n };\n }\n}\n","/**\n * Drag and drop compatibility hook for collection components.\n *\n * Mirrors RAC's `useDragAndDrop` shape while delegating to Solid\n * state and aria primitives.\n */\n\nimport type { Accessor, JSX } from \"solid-js\";\nimport { DragPreview } from \"./DragPreview\";\nimport { ListDropTargetDelegate } from \"./ListDropTargetDelegate\";\nimport {\n createDraggableCollection,\n createDraggableItem,\n createDroppableCollection,\n createDroppableItem,\n getGlobalDraggingCollectionRef,\n getGlobalDraggingKeys,\n type DraggableCollectionOptions,\n type DraggableCollectionAria,\n type DraggableItemOptions,\n type DraggableItemAria,\n type DroppableCollectionOptions,\n type DroppableCollectionAria,\n type DroppableItemOptions,\n type DroppableItemAria,\n type DropTargetDelegate as AriaDropTargetDelegate,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createDraggableCollectionState,\n createDroppableCollectionState,\n type DragItem,\n type DragPreviewRenderer,\n type DraggableCollectionProps,\n type DraggableCollectionState,\n type DraggableCollectionStateOptions,\n type DropTarget,\n type DroppableCollectionProps,\n type DroppableCollectionState,\n type DroppableCollectionStateOptions,\n} from \"@proyecto-viviana/solid-stately\";\n\ninterface DraggableCollectionStateOpts<T = object> extends Omit<\n DraggableCollectionStateOptions<T>,\n \"getItems\"\n> {\n items?: T[];\n}\n\ninterface DragHooks<T = object> {\n useDraggableCollectionState?: (\n props: DraggableCollectionStateOpts<T>,\n ) => DraggableCollectionState;\n useDraggableCollection?: (\n props: Omit<DraggableCollectionOptions, \"ref\">,\n state: DraggableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => DraggableCollectionAria;\n useDraggableItem?: (\n props: DraggableItemOptions,\n state: DraggableCollectionState,\n ) => DraggableItemAria;\n DragPreview?: typeof DragPreview;\n renderDragPreview?: DragAndDropOptions<T>[\"renderDragPreview\"];\n isVirtualDragging?: () => boolean;\n}\n\ninterface DropHooks {\n useDroppableCollectionState?: (\n props: DroppableCollectionStateOptions,\n ) => DroppableCollectionState;\n useDroppableCollection?: (\n props: Omit<DroppableCollectionOptions, \"ref\">,\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => DroppableCollectionAria;\n useDroppableItem?: (\n options: Omit<DroppableItemOptions, \"ref\">,\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => DroppableItemAria;\n useDropIndicator?: (\n props: { target: DropTarget },\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => {\n dropIndicatorProps: JSX.HTMLAttributes<HTMLElement>;\n isDropTarget: boolean;\n isHidden: boolean;\n };\n renderDropIndicator?: (target: DropTarget) => JSX.Element;\n dropTargetDelegate?: AriaDropTargetDelegate;\n ListDropTargetDelegate?: typeof ListDropTargetDelegate;\n}\n\nexport type DragAndDropHooks<T = object> = DragHooks<T> & DropHooks;\n\nexport interface DragAndDrop<T = object> {\n /** Drag and drop hooks for the collection element. */\n dragAndDropHooks: DragAndDropHooks<T>;\n}\n\nexport interface DragAndDropOptions<T = object>\n extends Partial<Omit<DraggableCollectionProps<T>, \"preview\">>, Partial<DroppableCollectionProps> {\n /**\n * Optional keyboard delegate forwarded to the collection droppable hook.\n */\n keyboardDelegate?: DroppableCollectionOptions[\"keyboardDelegate\"];\n /**\n * Optional keydown handler composed with collection droppable keyboard behavior.\n */\n onKeyDown?: DroppableCollectionOptions[\"onKeyDown\"];\n /**\n * A function that returns the items being dragged.\n * If omitted, draggable hooks are not added.\n */\n getItems?: (keys: Set<string | number>, items: T[]) => DragItem[];\n /**\n * Optional custom drag preview renderer.\n */\n renderDragPreview?: (\n items: DragItem[],\n ) => JSX.Element | { element: JSX.Element; x: number; y: number };\n /**\n * Optional drop indicator renderer for collection components.\n */\n renderDropIndicator?: (target: DropTarget) => JSX.Element;\n /**\n * Optional custom drop target delegate.\n */\n dropTargetDelegate?: AriaDropTargetDelegate;\n /**\n * Optional drag preview ref.\n */\n preview?: { current: DragPreviewRenderer | null };\n /**\n * Optional item snapshot used by draggable state `getItems`.\n */\n items?: T[];\n /**\n * Disable both drag and drop behavior.\n */\n isDisabled?: boolean;\n}\n\n/**\n * Provides hooks to enable drag-and-drop behavior for collection components.\n */\nexport function useDragAndDrop<T = object>(options: DragAndDropOptions<T> = {}): DragAndDrop<T> {\n const {\n getItems,\n onDrop,\n onInsert,\n onItemDrop,\n onReorder,\n onMove,\n onRootDrop,\n renderDragPreview,\n renderDropIndicator,\n dropTargetDelegate,\n } = options;\n\n const isDraggable = typeof getItems === \"function\";\n const isDroppable = Boolean(\n onDrop || onInsert || onItemDrop || onReorder || onMove || onRootDrop,\n );\n\n const hooks: DragAndDropHooks<T> = {};\n const hasDom = typeof HTMLElement !== \"undefined\";\n const isElementNode = (value: unknown): value is HTMLElement => {\n if (!value) return false;\n if (hasDom && value instanceof HTMLElement) return true;\n return typeof value === \"object\" && (value as { nodeType?: number }).nodeType === 1;\n };\n const resolvedPreview =\n options.preview ??\n (renderDragPreview\n ? {\n current: (\n items: DragItem[],\n callback: (node: HTMLElement | null, x?: number, y?: number) => void,\n ) => {\n const rendered = renderDragPreview(items);\n if (!rendered) {\n callback(null);\n return;\n }\n if (typeof rendered === \"object\" && rendered !== null && \"element\" in rendered) {\n const previewValue = rendered as { element: unknown; x?: number; y?: number };\n callback(\n isElementNode(previewValue.element) ? previewValue.element : null,\n previewValue.x,\n previewValue.y,\n );\n return;\n }\n callback(isElementNode(rendered) ? rendered : null);\n },\n }\n : undefined);\n\n if (isDraggable && getItems) {\n hooks.useDraggableCollectionState = (props: DraggableCollectionStateOpts<T>) => {\n return createDraggableCollectionState<T>(() => ({\n onDragStart: options.onDragStart ?? props.onDragStart,\n onDragMove: options.onDragMove ?? props.onDragMove,\n onDragEnd: options.onDragEnd ?? props.onDragEnd,\n getAllowedDropOperations:\n options.getAllowedDropOperations ?? props.getAllowedDropOperations,\n isDisabled: options.isDisabled ?? props.isDisabled,\n preview: resolvedPreview ?? props.preview,\n getItems: (keys) => {\n const sourceItems = props.items ?? options.items ?? [];\n return getItems(keys, sourceItems);\n },\n }));\n };\n hooks.useDraggableCollection = (\n props: Omit<DraggableCollectionOptions, \"ref\">,\n state: DraggableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => createDraggableCollection({ ...props, ref }, state);\n hooks.useDraggableItem = (props, state) => createDraggableItem(() => props, state);\n hooks.DragPreview = DragPreview;\n hooks.renderDragPreview = renderDragPreview;\n hooks.isVirtualDragging = () =>\n getGlobalDraggingCollectionRef() != null || getGlobalDraggingKeys().size > 0;\n }\n\n if (isDroppable) {\n hooks.useDroppableCollectionState = (props: DroppableCollectionStateOptions) => {\n return createDroppableCollectionState(() => ({\n acceptedDragTypes: options.acceptedDragTypes ?? props.acceptedDragTypes,\n getDropOperation: options.getDropOperation ?? props.getDropOperation,\n onDropEnter: options.onDropEnter ?? props.onDropEnter,\n onDropActivate: options.onDropActivate ?? props.onDropActivate,\n onDropExit: options.onDropExit ?? props.onDropExit,\n onDrop: options.onDrop ?? props.onDrop,\n onInsert: options.onInsert ?? props.onInsert,\n onRootDrop: options.onRootDrop ?? props.onRootDrop,\n onItemDrop: options.onItemDrop ?? props.onItemDrop,\n onReorder: options.onReorder ?? props.onReorder,\n onMove: options.onMove ?? props.onMove,\n shouldAcceptItemDrop: options.shouldAcceptItemDrop ?? props.shouldAcceptItemDrop,\n isDisabled: options.isDisabled ?? props.isDisabled,\n }));\n };\n hooks.useDroppableCollection = (\n props: Omit<DroppableCollectionOptions, \"ref\">,\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => {\n const acceptedDragTypes = options.acceptedDragTypes ?? props.acceptedDragTypes;\n const normalizedAcceptedDragTypes =\n acceptedDragTypes === \"all\"\n ? \"all\"\n : acceptedDragTypes?.filter(\n (type): type is string | symbol =>\n typeof type === \"string\" || typeof type === \"symbol\",\n );\n return createDroppableCollection(\n () => ({\n ref,\n dropTargetDelegate: options.dropTargetDelegate ?? props.dropTargetDelegate,\n keyboardDelegate: options.keyboardDelegate ?? props.keyboardDelegate,\n onKeyDown: options.onKeyDown ?? props.onKeyDown,\n acceptedDragTypes: normalizedAcceptedDragTypes,\n isDisabled: options.isDisabled ?? props.isDisabled,\n onDropActivate: (e) => {\n (options.onDropActivate ?? props.onDropActivate)?.({\n type: \"dropactivate\",\n target: e.target,\n x: e.x,\n y: e.y,\n });\n },\n onDrop: (e) => {\n (options.onDrop ?? props.onDrop)?.({\n type: \"drop\",\n target: e.target,\n x: e.x,\n y: e.y,\n items: e.items,\n dropOperation: e.dropOperation,\n });\n },\n onRootDrop: options.onRootDrop ?? props.onRootDrop,\n onItemDrop: (e) => {\n if (e.target.type === \"item\") {\n (options.onItemDrop ?? props.onItemDrop)?.({\n items: e.items,\n target: e.target,\n dropOperation: e.dropOperation,\n isInternal: e.isInternal,\n });\n }\n },\n onInsert: (e) => {\n if (e.target.type === \"item\") {\n (options.onInsert ?? props.onInsert)?.({\n items: e.items,\n target: e.target,\n dropOperation: e.dropOperation,\n });\n }\n },\n onReorder: (e) => {\n if (e.target.type === \"item\") {\n (options.onReorder ?? props.onReorder)?.({\n keys: e.keys,\n target: e.target,\n dropOperation: e.dropOperation,\n });\n }\n },\n onMove: (e) => {\n if (e.target.type === \"item\") {\n (options.onMove ?? props.onMove)?.({\n keys: e.keys,\n target: e.target,\n dropOperation: e.dropOperation,\n });\n }\n },\n }),\n state,\n );\n };\n hooks.useDroppableItem = (\n props: Omit<DroppableItemOptions, \"ref\">,\n state: DroppableCollectionState,\n ref: Accessor<HTMLElement | null>,\n ) => createDroppableItem(() => ({ ...props, ref }), state);\n hooks.useDropIndicator = (\n props: { target: DropTarget },\n state: DroppableCollectionState,\n _ref: Accessor<HTMLElement | null>,\n ) => {\n const target = props.target;\n const activeTarget = state.target;\n const isDropTarget =\n activeTarget?.type === target.type &&\n (target.type === \"root\" ||\n (activeTarget.type === \"item\" &&\n target.type === \"item\" &&\n activeTarget.key === target.key &&\n activeTarget.dropPosition === target.dropPosition));\n return {\n dropIndicatorProps: {\n role: \"option\",\n \"aria-disabled\": true,\n \"aria-hidden\": isDropTarget ? undefined : \"true\",\n tabIndex: -1,\n \"data-drop-target\": isDropTarget ? \"\" : undefined,\n },\n isDropTarget,\n isHidden: !isDropTarget,\n };\n };\n hooks.renderDropIndicator = renderDropIndicator;\n hooks.dropTargetDelegate = dropTargetDelegate;\n hooks.ListDropTargetDelegate = ListDropTargetDelegate;\n }\n\n return {\n dragAndDropHooks: hooks,\n };\n}\n","/**\n * Breadcrumbs component for solidaria-components\n *\n * A pre-wired headless breadcrumbs component that combines aria hooks.\n * Port of react-aria-components Breadcrumbs.\n */\n\nimport {\n type Accessor,\n type JSX,\n createContext,\n createMemo,\n createSignal,\n children as resolveChildren,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport {\n createBreadcrumbs,\n createBreadcrumbItem,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaBreadcrumbsProps,\n type AriaBreadcrumbItemProps,\n type PressEvent,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface BreadcrumbsRenderProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps, \"isDisabled\">, SlotProps {\n /** The items to render in the breadcrumbs. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => string | number;\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean;\n /** Handler called when a breadcrumb item is activated. */\n onAction?: (key: string | number) => void;\n /** The children of the component, or a render function for collection items. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbsRenderProps>;\n /** Ref for the navigation element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport interface BreadcrumbItemRenderProps {\n /** Whether this is the current/last item. */\n isCurrent: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n}\n\nexport interface BreadcrumbItemProps\n extends Omit<AriaBreadcrumbItemProps, \"isDisabled\">, SlotProps {\n /** The children of the breadcrumb item. */\n children?: RenderChildren<BreadcrumbItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbItemRenderProps>;\n /** Whether this item is disabled. */\n isDisabled?: boolean;\n /** Ref for the breadcrumb item element. */\n ref?: RefLike<HTMLElement>;\n}\n\ninterface BreadcrumbsContextValue {\n isDisabled: Accessor<boolean>;\n onAction?: (key: string | number) => void;\n registerStaticItem?: () => number;\n staticItemCount?: Accessor<number>;\n resetStaticItems?: () => void;\n setStaticItemCount?: (count: number) => void;\n}\n\nexport const BreadcrumbsContext = createContext<BreadcrumbsContextValue | null>(null);\n\ninterface BreadcrumbItemContextValue {\n itemKey: string | number | null;\n isLast: Accessor<boolean>;\n}\n\nexport const BreadcrumbItemContext = createContext<BreadcrumbItemContextValue | null>(null);\n\nfunction defaultItemKey(item: unknown, index: number): string | number {\n const maybeItem = item as { key?: string | number; id?: string | number };\n return maybeItem.key ?? maybeItem.id ?? index;\n}\n\n/**\n * Breadcrumbs show hierarchy and navigational context for a user's location within an application.\n */\nexport function Breadcrumbs<T>(props: BreadcrumbsProps<T>): JSX.Element {\n const [local, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"items\", \"getKey\", \"isDisabled\", \"onAction\", \"ref\"],\n [\"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"aria-details\"],\n );\n\n const isDisabled = () => local.isDisabled ?? false;\n const items = () => local.items ?? [];\n const hasCollectionItems = () => local.items !== undefined;\n const getItemKey = (item: T, index: number): string | number =>\n local.getKey?.(item) ?? defaultItemKey(item, index);\n const [staticItemCount, setStaticItemCount] = createSignal(0);\n let nextStaticIndex = 0;\n const resetStaticItems = () => {\n nextStaticIndex = 0;\n setStaticItemCount(0);\n };\n const registerStaticItem = () => {\n const index = nextStaticIndex;\n nextStaticIndex += 1;\n return index;\n };\n\n const { navProps } = createBreadcrumbs({\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const renderValues = createMemo<BreadcrumbsRenderProps>(() => ({\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Breadcrumbs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n return (\n <BreadcrumbsContext.Provider\n value={{\n isDisabled,\n onAction: local.onAction,\n registerStaticItem,\n staticItemCount,\n resetStaticItems,\n setStaticItemCount,\n }}\n >\n <nav\n {...navProps}\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={isDisabled() || undefined}\n >\n <ol\n style={{\n display: \"flex\",\n \"align-items\": \"center\",\n \"list-style\": \"none\",\n margin: 0,\n padding: 0,\n }}\n >\n <Show\n when={hasCollectionItems()}\n fallback={\n <StaticBreadcrumbItems>{local.children as JSX.Element}</StaticBreadcrumbItems>\n }\n >\n <For each={items()}>\n {(item, index) => {\n const itemKey = getItemKey(item, index());\n const isLast = () => index() === items().length - 1;\n const renderItem = local.children as ((item: T) => JSX.Element) | undefined;\n\n return (\n <li style={{ display: \"flex\", \"align-items\": \"center\" }}>\n <BreadcrumbItemContext.Provider value={{ itemKey, isLast }}>\n {renderItem?.(item)}\n </BreadcrumbItemContext.Provider>\n </li>\n );\n }}\n </For>\n </Show>\n </ol>\n </nav>\n </BreadcrumbsContext.Provider>\n );\n}\n\nfunction StaticBreadcrumbItems(props: { children?: JSX.Element }): JSX.Element {\n const context = useContext(BreadcrumbsContext);\n const staticChildren = resolveChildren(() => props.children);\n const childArray = createMemo(() => {\n context?.resetStaticItems?.();\n const array = staticChildren.toArray();\n context?.setStaticItemCount?.(array.length);\n return array;\n });\n\n return (\n <For each={childArray()}>\n {(child) => <li style={{ display: \"flex\", \"align-items\": \"center\" }}>{child}</li>}\n </For>\n );\n}\n\n/**\n * A BreadcrumbItem represents an individual breadcrumb in the navigation trail.\n */\nexport function BreadcrumbItem(props: BreadcrumbItemProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"isDisabled\", \"ref\"]);\n\n const context = useContext(BreadcrumbsContext);\n const itemContext = useContext(BreadcrumbItemContext);\n const staticIndex = itemContext ? null : context?.registerStaticItem?.();\n const isDisabled = () => local.isDisabled ?? context?.isDisabled() ?? false;\n const isCurrent = () =>\n ariaProps.isCurrent ??\n itemContext?.isLast() ??\n (staticIndex !== null &&\n staticIndex !== undefined &&\n context?.staticItemCount !== undefined &&\n staticIndex === context.staticItemCount() - 1);\n const itemKey = () => itemContext?.itemKey ?? ariaProps.id ?? null;\n\n const handlePress = (e: PressEvent) => {\n ariaProps.onPress?.(e);\n const key = itemKey();\n if (key !== null && !isCurrent() && !isDisabled()) {\n context?.onAction?.(key);\n }\n };\n\n const { itemProps, isPressed } = createBreadcrumbItem({\n get id() {\n return ariaProps.id;\n },\n get isCurrent() {\n return isCurrent();\n },\n get isDisabled() {\n return isDisabled();\n },\n get href() {\n return ariaProps.href;\n },\n get target() {\n return ariaProps.target;\n },\n get rel() {\n return ariaProps.rel;\n },\n get elementType() {\n return ariaProps.elementType;\n },\n get onPress() {\n return handlePress;\n },\n get onPressStart() {\n return ariaProps.onPressStart;\n },\n get onPressEnd() {\n return ariaProps.onPressEnd;\n },\n get onClick() {\n return ariaProps.onClick;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n get \"aria-current\"() {\n return ariaProps[\"aria-current\"];\n },\n });\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n const mergedItemProps = createMemo(() =>\n mergeProps(\n itemProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n hoverProps as Record<string, unknown>,\n ),\n );\n const elementType = () => ariaProps.elementType ?? \"a\";\n\n const renderValues = createMemo<BreadcrumbItemRenderProps>(() => ({\n isCurrent: isCurrent(),\n isDisabled: isDisabled(),\n isPressed: isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-BreadcrumbItem\",\n },\n renderValues,\n );\n\n const mergedStyle = () => {\n const userStyle = renderProps.style();\n const baseStyle = { display: \"inline-flex\", \"align-items\": \"center\" };\n return userStyle ? { ...baseStyle, ...userStyle } : baseStyle;\n };\n\n return (\n <Dynamic\n component={elementType()}\n {...mergedItemProps()}\n ref={(element: HTMLElement) => assignRef(local.ref, element)}\n href={isCurrent() ? undefined : (mergedItemProps() as { href?: string }).href}\n aria-current={isCurrent() ? (ariaProps[\"aria-current\"] ?? \"page\") : undefined}\n aria-disabled={isDisabled() || isCurrent() || undefined}\n class={renderProps.class()}\n style={mergedStyle()}\n data-current={isCurrent() || undefined}\n data-disabled={isDisabled() || undefined}\n data-pressed={isPressed() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n {renderProps.renderChildren()}\n </Dynamic>\n );\n}\n\nBreadcrumbs.Item = BreadcrumbItem;\n","/**\n * NumberField component for solidaria-components\n *\n * A pre-wired headless number field that combines state + aria hooks.\n * Port of react-aria-components/src/NumberField.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext } from \"solid-js\";\nimport {\n createNumberField,\n createButton,\n createFocusRing,\n createHover,\n type AriaNumberFieldProps,\n type AriaButtonProps,\n} from \"@proyecto-viviana/solidaria\";\nimport { createNumberFieldState, type NumberFieldState } from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface NumberFieldRenderProps {\n /** Whether the number field is disabled. */\n isDisabled: boolean;\n /** Whether the number field is invalid. */\n isInvalid: boolean;\n /** Whether the number field is required. */\n isRequired: boolean;\n /** Whether the number field is read-only. */\n isReadOnly: boolean;\n /** The current numeric value. */\n value: number;\n}\n\nexport interface NumberFieldProps extends Omit<AriaNumberFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: number;\n /** The default value (uncontrolled). */\n defaultValue?: number;\n /** Handler called when the value changes. */\n onChange?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value for increment/decrement. */\n step?: number;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the number field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<NumberFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldRenderProps>;\n}\n\nexport interface NumberFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface NumberFieldInputProps extends SlotProps {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldInputRenderProps>;\n}\n\nexport interface NumberFieldButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface NumberFieldIncrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\nexport interface NumberFieldDecrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\ninterface NumberFieldContextValue {\n state: NumberFieldState;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n incrementButtonProps: AriaButtonProps;\n decrementButtonProps: AriaButtonProps;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n isDisabled: boolean;\n isInvalid: boolean;\n isRequired: boolean;\n isReadOnly: boolean;\n setInputRef: (el: HTMLInputElement) => void;\n}\n\nexport const NumberFieldContext = createContext<NumberFieldContextValue | null>(null);\nexport const NumberFieldStateContext = createContext<NumberFieldState | null>(null);\n\n/**\n * A number field allows a user to enter a number and increment/decrement the value.\n */\nexport function NumberField(props: NumberFieldProps): JSX.Element {\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"name\",\n \"form\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onPaste\",\n \"onCopy\",\n \"onCut\",\n ],\n );\n\n const state = createNumberFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n get minValue() {\n return stateProps.minValue;\n },\n get maxValue() {\n return stateProps.maxValue;\n },\n get step() {\n return stateProps.step;\n },\n get locale() {\n return stateProps.locale;\n },\n get formatOptions() {\n return stateProps.formatOptions;\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n });\n\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const numberFieldAria = createNumberField(\n {\n get label() {\n return ariaProps.label;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get id() {\n return ariaProps.id;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n },\n state,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<NumberFieldRenderProps>(() => ({\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: ariaProps.isInvalid ?? false,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.numberValue(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField\",\n },\n renderValues,\n );\n\n const childRenderValues: NumberFieldRenderProps = {\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return ariaProps.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.numberValue();\n },\n };\n\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: NumberFieldContextValue = {\n state,\n get inputProps() {\n return numberFieldAria.inputProps;\n },\n get incrementButtonProps() {\n return numberFieldAria.incrementButtonProps;\n },\n get decrementButtonProps() {\n return numberFieldAria.decrementButtonProps;\n },\n get labelProps() {\n return numberFieldAria.labelProps;\n },\n get groupProps() {\n return numberFieldAria.groupProps;\n },\n get descriptionProps() {\n return numberFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return numberFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return ariaProps.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n };\n\n return (\n <NumberFieldStateContext.Provider value={state}>\n <NumberFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={ariaProps.isDisabled || undefined}\n data-invalid={ariaProps.isInvalid || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-readonly={ariaProps.isReadOnly || undefined}\n >\n {fieldChildren()}\n </div>\n </NumberFieldContext.Provider>\n </NumberFieldStateContext.Provider>\n );\n}\n\n/**\n * The label for a number field.\n */\nexport function NumberFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldLabel must be used within a NumberField\");\n }\n\n return (\n <span\n {...context.labelProps}\n class={props.class ?? \"solidaria-NumberField-label\"}\n style={props.style}\n >\n {props.children}\n </span>\n );\n}\n\n/**\n * The input group for a number field (contains input and buttons).\n */\nexport function NumberFieldGroup(props: JSX.HTMLAttributes<HTMLDivElement>): JSX.Element {\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\"]);\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldGroup must be used within a NumberField\");\n }\n\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = context.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanGroupProps()}\n class={local.class ?? \"solidaria-NumberField-group\"}\n style={local.style}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * The input element for a number field.\n */\nexport function NumberFieldInput(props: NumberFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldInput must be used within a NumberField\");\n }\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<NumberFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: context.isDisabled,\n isInvalid: context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, onInput: _onInput, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const handleInput: JSX.EventHandler<HTMLInputElement, InputEvent> = (event) => {\n (\n context.inputProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }\n ).onInput?.(event);\n (domProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }).onInput?.(\n event,\n );\n };\n\n return (\n <input\n {...domProps}\n ref={context.setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n onInput={handleInput}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={context.isDisabled || undefined}\n data-invalid={context.isInvalid || undefined}\n />\n );\n}\n\n/**\n * The increment button for a number field.\n */\nexport function NumberFieldIncrementButton(props: NumberFieldIncrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldIncrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canIncrement();\n\n const buttonAria = createButton({\n ...(context.incrementButtonProps as Record<string, unknown>),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canIncrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-increment\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={isDisabled() || undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={buttonAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The decrement button for a number field.\n */\nexport function NumberFieldDecrementButton(props: NumberFieldDecrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldDecrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canDecrement();\n\n const buttonAria = createButton({\n ...(context.decrementButtonProps as Record<string, unknown>),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canDecrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-decrement\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={isDisabled() || undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={buttonAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nNumberField.Label = NumberFieldLabel;\nNumberField.Group = NumberFieldGroup;\nNumberField.Input = NumberFieldInput;\nNumberField.IncrementButton = NumberFieldIncrementButton;\nNumberField.DecrementButton = NumberFieldDecrementButton;\n","/**\n * SearchField component for solidaria-components\n *\n * A pre-wired headless search field that combines state + aria hooks.\n * Port of react-aria-components/src/SearchField.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n onCleanup,\n onMount,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport {\n createSearchField,\n createFocusRing,\n createHover,\n createPress,\n mergeProps,\n type AriaSearchFieldProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSearchFieldState,\n VALID_VALIDITY_STATE,\n type SearchFieldState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface SearchFieldRenderProps {\n /** Whether the search field is empty. */\n isEmpty: boolean;\n /** Whether the search field is disabled. */\n isDisabled: boolean;\n /** Whether the search field is invalid. */\n isInvalid: boolean;\n /** Whether the search field is read-only. */\n isReadOnly: boolean;\n /** Whether the search field is required. */\n isRequired: boolean;\n /** The current value. */\n value: string;\n}\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: string;\n /** The default value (uncontrolled). */\n defaultValue?: string;\n /** Handler called when the value changes. */\n onChange?: (value: string) => void;\n /** Handler called when the user submits the search. */\n onSubmit?: (value: string) => void;\n /** Handler called when the field is cleared. */\n onClear?: () => void;\n /** A visible label for the search field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SearchFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldRenderProps>;\n /** Ref for the outer search field element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SearchFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface SearchFieldInputProps\n extends SlotProps, Omit<JSX.InputHTMLAttributes<HTMLInputElement>, \"class\" | \"style\"> {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldInputRenderProps>;\n}\n\nexport interface SearchFieldClearButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SearchFieldClearButtonProps\n extends\n SlotProps,\n Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the button. */\n children?: RenderChildren<SearchFieldClearButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldClearButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldClearButtonRenderProps>;\n}\n\ninterface SearchFieldContextValue extends Partial<SearchFieldProps> {\n state?: SearchFieldState;\n inputProps?: JSX.InputHTMLAttributes<HTMLInputElement>;\n clearButtonProps?: {\n \"aria-label\": string;\n tabIndex: number;\n disabled?: boolean;\n onMouseDown: (e: MouseEvent) => void;\n onClick: () => void;\n };\n labelProps?: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps?: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n isDisabled?: boolean;\n isInvalid?: boolean;\n isRequired?: boolean;\n isReadOnly?: boolean;\n setInputRef?: (el: HTMLInputElement) => void;\n slots?: Record<string, SearchFieldProps>;\n}\n\nexport const SearchFieldContext = createContext<SearchFieldContextValue | null>(null);\n\nfunction withFormValidationBehavior(\n props: SearchFieldProps,\n formContext: FormProps | null,\n): SearchFieldProps {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nfunction eventWithCurrentTarget<T extends HTMLElement>(event: Event, element: T): Event {\n return new Proxy(event, {\n get(target, property, receiver) {\n if (property === \"target\" || property === \"currentTarget\") {\n return element;\n }\n\n const value = Reflect.get(target, property, receiver);\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n}\n\nfunction clearDelegatedTextEntryHandlers(element: HTMLElement) {\n const delegatedElement = element as HTMLElement & {\n $$input?: unknown;\n $$change?: unknown;\n };\n delete delegatedElement.$$input;\n delete delegatedElement.$$change;\n}\n\n/**\n * A search field allows a user to enter and clear a search query.\n */\nexport function SearchField(props: SearchFieldProps): JSX.Element {\n const formContext = useContext(FormContext);\n const contextProps = useContext(SearchFieldContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<SearchFieldProps>(() => {\n if (!contextProps) return {};\n const {\n state: _state,\n inputProps: _inputProps,\n clearButtonProps: _clearButtonProps,\n labelProps: _labelProps,\n descriptionProps: _descriptionProps,\n errorMessageProps: _errorMessageProps,\n isDisabled: _isDisabled,\n isInvalid: _isInvalid,\n isRequired: _isRequired,\n isReadOnly: _isReadOnly,\n setInputRef: _setInputRef,\n slots: _slots,\n ...restContextProps\n } = contextProps;\n return restContextProps as SearchFieldProps;\n });\n const baseProps = (\n contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props\n ) as SearchFieldProps;\n const mergedProps = withFormValidationBehavior(baseProps, formContext);\n\n const [local, stateProps, ariaProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\"value\", \"defaultValue\", \"onChange\", \"onSubmit\", \"onClear\"],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"excludeFromTabOrder\",\n \"name\",\n \"form\",\n \"validationBehavior\",\n \"type\",\n \"placeholder\",\n \"autoComplete\",\n \"inputMode\",\n \"enterKeyHint\",\n \"autoCorrect\",\n \"autoCapitalize\",\n \"spellCheck\",\n \"maxLength\",\n \"minLength\",\n \"pattern\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onCopy\",\n \"onCut\",\n \"onPaste\",\n \"onCompositionStart\",\n \"onCompositionEnd\",\n \"onCompositionUpdate\",\n \"onSelect\",\n \"onBeforeInput\",\n \"onInput\",\n ],\n );\n\n const state = createSearchFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n });\n\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const searchFieldAria = createSearchField(\n {\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get label() {\n return ariaProps.label;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get placeholder() {\n return ariaProps.placeholder;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get validationBehavior() {\n return ariaProps.validationBehavior;\n },\n get type() {\n return ariaProps.type;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get excludeFromTabOrder() {\n return ariaProps.excludeFromTabOrder;\n },\n get autoComplete() {\n return ariaProps.autoComplete;\n },\n get inputMode() {\n return ariaProps.inputMode;\n },\n get enterKeyHint() {\n return ariaProps.enterKeyHint;\n },\n get autoCorrect() {\n return ariaProps.autoCorrect;\n },\n get autoCapitalize() {\n return ariaProps.autoCapitalize;\n },\n get spellCheck() {\n return ariaProps.spellCheck;\n },\n get maxLength() {\n return ariaProps.maxLength;\n },\n get minLength() {\n return ariaProps.minLength;\n },\n get pattern() {\n return ariaProps.pattern;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCompositionStart() {\n return ariaProps.onCompositionStart;\n },\n get onCompositionEnd() {\n return ariaProps.onCompositionEnd;\n },\n get onCompositionUpdate() {\n return ariaProps.onCompositionUpdate;\n },\n get onSelect() {\n return ariaProps.onSelect;\n },\n get onBeforeInput() {\n return ariaProps.onBeforeInput;\n },\n get onInput() {\n return ariaProps.onInput;\n },\n get onSubmit() {\n return stateProps.onSubmit;\n },\n get onClear() {\n return stateProps.onClear;\n },\n },\n state,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SearchFieldRenderProps>(() => ({\n isEmpty: state.value() === \"\",\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: searchFieldAria.isInvalid ?? false,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.value(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField\",\n },\n renderValues,\n );\n const childRenderValues: SearchFieldRenderProps = {\n get isEmpty() {\n return state.value() === \"\";\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.value();\n },\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const fieldValidation = createMemo<ValidationResult>(() => {\n const isInvalid = searchFieldAria.isInvalid;\n const errorMessage = ariaProps.errorMessage;\n const validationErrors = isInvalid && typeof errorMessage === \"string\" ? [errorMessage] : [];\n\n return {\n isInvalid,\n validationErrors,\n validationDetails: isInvalid\n ? { ...VALID_VALIDITY_STATE, customError: true, valid: false }\n : VALID_VALIDITY_STATE,\n };\n });\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return fieldValidation();\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n };\n const contextValue: SearchFieldContextValue = {\n state,\n get inputProps() {\n return searchFieldAria.inputProps;\n },\n get clearButtonProps() {\n return searchFieldAria.clearButtonProps;\n },\n get labelProps() {\n return searchFieldAria.labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get descriptionProps() {\n return searchFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n };\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n return (\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <SearchFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-empty={state.value() === \"\" || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n data-invalid={searchFieldAria.isInvalid || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-readonly={ariaProps.isReadOnly || undefined}\n >\n {fieldChildren()}\n </div>\n </SearchFieldContext.Provider>\n </FieldErrorContext.Provider>\n );\n}\n\n/**\n * The label for a search field.\n */\nexport function SearchFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldLabel must be used within a SearchField\");\n }\n\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n class={props.class ?? \"solidaria-SearchField-label\"}\n style={props.style}\n >\n {props.children}\n </label>\n );\n}\n\n/**\n * The input element for a search field.\n */\nexport function SearchFieldInput(props: SearchFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n let inputElement: HTMLInputElement | undefined;\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldInput must be used within a SearchField\");\n }\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<SearchFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: !!context.isDisabled,\n isInvalid: !!context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedInputProps = () =>\n ({\n ...domProps,\n ...cleanInputProps(),\n ...cleanFocusProps(),\n ...cleanHoverProps(),\n }) as Record<string, unknown>;\n\n onMount(() => {\n const element = inputElement;\n if (!element) {\n return;\n }\n\n const inputHandler = (event: Event) => {\n const handler = mergedInputProps().onInput as\n | JSX.EventHandler<HTMLInputElement, InputEvent>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as InputEvent & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n const changeHandler = (event: Event) => {\n const handler = mergedInputProps().onChange as\n | JSX.EventHandler<HTMLInputElement, Event>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as Event & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n\n element.addEventListener(\"input\", inputHandler);\n element.addEventListener(\"change\", changeHandler);\n clearDelegatedTextEntryHandlers(element);\n onCleanup(() => {\n element.removeEventListener(\"input\", inputHandler);\n element.removeEventListener(\"change\", changeHandler);\n });\n });\n\n return (\n <input\n {...mergedInputProps()}\n ref={(element) => {\n inputElement = element;\n context.setInputRef?.(element);\n const ref = (domProps as { ref?: unknown }).ref;\n if (typeof ref === \"function\") {\n ref(element);\n }\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={context.isDisabled || undefined}\n data-invalid={context.isInvalid || undefined}\n />\n );\n}\n\n/**\n * The clear button for a search field.\n */\nexport function SearchFieldClearButton(props: SearchFieldClearButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldClearButton must be used within a SearchField\");\n }\n\n const isDisabled = () => !!(context.isDisabled || context.isReadOnly);\n const isEmpty = () => (context.state?.value() ?? \"\") === \"\";\n const clear = () => {\n if (!isDisabled() && !isEmpty()) {\n context.clearButtonProps?.onClick();\n }\n };\n\n const { isPressed, pressProps } = createPress({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n onClick: clear,\n onPress: clear,\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n });\n\n const renderValues = createMemo<SearchFieldClearButtonRenderProps>(() => ({\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField-clear\",\n },\n renderValues,\n );\n\n const cleanPressProps = () => {\n const { ref: _ref, ...rest } = pressProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <Show when={!isEmpty()}>\n <button\n {...domProps}\n type=\"button\"\n aria-label={context.clearButtonProps?.[\"aria-label\"] ?? \"Clear search\"}\n tabIndex={context.clearButtonProps?.tabIndex ?? -1}\n disabled={context.clearButtonProps?.disabled}\n onMouseDown={context.clearButtonProps?.onMouseDown}\n {...cleanPressProps()}\n onPointerUp={clear}\n onMouseUp={clear}\n onClick={clear}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n </Show>\n );\n}\n\nSearchField.Label = SearchFieldLabel;\nSearchField.Input = SearchFieldInput;\nSearchField.ClearButton = SearchFieldClearButton;\n","/**\n * Slider component for solidaria-components\n *\n * A pre-wired headless slider that combines state + aria hooks.\n * Port of react-aria-components/src/Slider.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext, Show } from \"solid-js\";\nimport {\n createSlider,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaSliderProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSliderState,\n type SliderState,\n type SliderOrientation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\nexport interface SliderRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** Whether the slider is focused. */\n isFocused: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderProps extends Omit<AriaSliderProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: number;\n /** The default value (uncontrolled). */\n defaultValue?: number;\n /** Handler called when the value changes. */\n onChange?: (value: number) => void;\n /** Handler called when dragging ends. */\n onChangeEnd?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value. */\n step?: number;\n /** The orientation of the slider. */\n orientation?: SliderOrientation;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the slider. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SliderRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderRenderProps>;\n /** Ref for the slider root element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SliderTrackRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderTrackProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the track. */\n children?: RenderChildren<SliderTrackRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderTrackRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderTrackRenderProps>;\n}\n\nexport interface SliderThumbRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the thumb is being dragged. */\n isDragging: boolean;\n /** Whether the thumb is focused. */\n isFocused: boolean;\n /** Whether the thumb has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the thumb is hovered. */\n isHovered: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n}\n\nexport interface SliderThumbProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the thumb. */\n children?: RenderChildren<SliderThumbRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderThumbRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderThumbRenderProps>;\n}\n\nexport interface SliderOutputRenderProps {\n /** The current value. */\n value: number;\n /** The formatted value string. */\n formattedValue: string;\n}\n\nexport interface SliderOutputProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the output. */\n children?: RenderChildren<SliderOutputRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderOutputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderOutputRenderProps>;\n}\n\ninterface SliderContextValue {\n state: SliderState;\n trackProps: JSX.HTMLAttributes<HTMLElement>;\n thumbProps: JSX.HTMLAttributes<HTMLElement>;\n outputProps: JSX.HTMLAttributes<HTMLElement>;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n trackRef: HTMLElement | undefined;\n setTrackRef: (el: HTMLElement) => void;\n inputRef: HTMLInputElement | undefined;\n setInputRef: (el: HTMLInputElement) => void;\n}\n\nexport const SliderContext = createContext<SliderContextValue | null>(null);\nexport const SliderStateContext = SliderContext;\nexport const SliderTrackContext = SliderContext;\nexport const SliderOutputContext = SliderContext;\n\n/**\n * A slider allows users to select a value from a range.\n */\nexport function Slider(props: SliderProps): JSX.Element {\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"onChangeEnd\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"orientation\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"id\",\n \"name\",\n \"form\",\n ],\n );\n\n const state = createSliderState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n get onChangeEnd() {\n return stateProps.onChangeEnd;\n },\n get minValue() {\n return stateProps.minValue;\n },\n get maxValue() {\n return stateProps.maxValue;\n },\n get step() {\n return stateProps.step;\n },\n get orientation() {\n return stateProps.orientation;\n },\n get locale() {\n return stateProps.locale;\n },\n get formatOptions() {\n return stateProps.formatOptions;\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n });\n\n let trackRef: HTMLElement | undefined;\n const setTrackRef = (el: HTMLElement) => {\n trackRef = el;\n };\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const sliderAria = createSlider(\n ariaProps,\n state,\n () => trackRef ?? null,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SliderRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: state.isFocused(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Slider\",\n },\n renderValues,\n );\n\n const childRenderValues: SliderRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isDragging() {\n return state.isDragging();\n },\n get isFocused() {\n return state.isFocused();\n },\n get value() {\n return state.value();\n },\n get valuePercent() {\n return state.getValuePercent();\n },\n get orientation() {\n return state.orientation;\n },\n };\n\n const sliderChildren = () => {\n const children = props.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = sliderAria.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <SliderContext.Provider\n value={{\n state,\n get trackProps() {\n return sliderAria.trackProps;\n },\n get thumbProps() {\n return sliderAria.thumbProps;\n },\n get outputProps() {\n return sliderAria.outputProps;\n },\n get inputProps() {\n return sliderAria.inputProps;\n },\n get trackRef() {\n return trackRef;\n },\n setTrackRef,\n get inputRef() {\n return inputRef;\n },\n setInputRef,\n }}\n >\n <div\n {...domProps()}\n {...cleanGroupProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={state.isDisabled || undefined}\n data-orientation={state.orientation}\n data-dragging={state.isDragging() || undefined}\n >\n <Show when={ariaProps.label}>\n <span {...sliderAria.labelProps}>{ariaProps.label}</span>\n </Show>\n\n {sliderChildren()}\n </div>\n </SliderContext.Provider>\n );\n}\n\n/**\n * The track element of a slider.\n */\nexport function SliderTrack(props: SliderTrackProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderTrack must be used within a Slider\");\n }\n\n const { state, setTrackRef } = context;\n\n const renderValues = createMemo<SliderTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Slider-track\",\n },\n renderValues,\n );\n\n const cleanTrackProps = () => {\n const { ref: _ref, style: trackStyle, ...rest } = context.trackProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const trackStyle = (context.trackProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...trackStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n ref={setTrackRef}\n {...cleanTrackProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-orientation={state.orientation}\n data-dragging={state.isDragging() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The thumb element of a slider.\n */\nexport function SliderThumb(props: SliderThumbProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderThumb must be used within a Slider\");\n }\n\n const { state, setInputRef } = context;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SliderThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: isFocused() || state.isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Slider-thumb\",\n },\n renderValues,\n );\n\n const cleanThumbProps = () => {\n const { ref: _ref, style: thumbStyle, ...rest } = context.thumbProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const thumbStyle = (context.thumbProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...thumbStyle, ...renderStyle };\n };\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const mergedInputProps = () =>\n mergeProps(\n cleanInputProps() as Record<string, unknown>,\n cleanFocusProps() as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n\n return (\n <div\n {...domProps}\n {...cleanThumbProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging() || undefined}\n data-focused={isFocused() || state.isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n <VisuallyHidden>\n <input ref={setInputRef} {...mergedInputProps()} />\n </VisuallyHidden>\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The output element of a slider, displaying the current value.\n */\nexport function SliderOutput(props: SliderOutputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderOutput must be used within a Slider\");\n }\n\n const { state } = context;\n\n const renderValues = createMemo<SliderOutputRenderProps>(() => ({\n value: state.value(),\n formattedValue: state.getFormattedValue(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Slider-output\",\n },\n renderValues,\n );\n\n const cleanDomProps = () => {\n const { ref: _ref, ...rest } = domProps as Record<string, unknown>;\n return rest;\n };\n const cleanOutputProps = () => {\n const { ref: _ref, ...rest } = context.outputProps as Record<string, unknown>;\n return rest;\n };\n\n const renderedChildren = () => {\n // Check if raw children prop exists before calling renderChildren\n if (renderProps.children === undefined || renderProps.children === null) {\n return state.getFormattedValue();\n }\n return renderProps.renderChildren();\n };\n\n return (\n <output\n {...cleanDomProps()}\n {...cleanOutputProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n {renderedChildren()}\n </output>\n );\n}\n\nSlider.Track = SliderTrack;\nSlider.Thumb = SliderThumb;\nSlider.Output = SliderOutput;\n","/**\n * Tooltip component for solidaria-components\n *\n * A tooltip displays a description of an element on hover or focus.\n * Port of react-aria-components/src/Tooltip.tsx\n */\n\nimport {\n type JSX,\n type ParentComponent,\n createContext,\n useContext,\n createMemo,\n createSignal,\n createEffect,\n onCleanup,\n Show,\n} from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport {\n createTooltipTriggerState,\n type TooltipTriggerState,\n type TooltipTriggerProps as StateProps,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n createTooltip,\n createTooltipTrigger,\n type TooltipTriggerProps as AriaProps,\n OverlayContainer,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface TooltipRenderProps {\n /** Whether the tooltip is currently entering (for animations). */\n isEntering: boolean;\n /** Whether the tooltip is currently exiting (for animations). */\n isExiting: boolean;\n /** The placement of the tooltip relative to the trigger. */\n placement: TooltipResolvedPlacement | null;\n}\n\nexport type TooltipPlacement = \"top\" | \"bottom\" | \"left\" | \"right\" | \"start\" | \"end\";\nexport type TooltipResolvedPlacement = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface TooltipTriggerComponentProps extends StateProps, AriaProps {\n /** The children of the tooltip trigger (trigger element and tooltip). */\n children: JSX.Element;\n /** The placement of the tooltip relative to the trigger. */\n placement?: TooltipPlacement;\n /** The placement padding between the tooltip and viewport edge. */\n containerPadding?: number;\n /** The additional offset along the cross axis. */\n crossOffset?: number;\n /** Whether the tooltip should flip when there is insufficient room. */\n shouldFlip?: boolean;\n}\n\nexport interface TooltipProps extends SlotProps {\n /** The element id. */\n id?: string;\n /** Custom aria-label for the tooltip. */\n \"aria-label\"?: string;\n /** ID of an element that labels the tooltip. */\n \"aria-labelledby\"?: string;\n /** ID of an element that describes the tooltip. */\n \"aria-describedby\"?: string;\n /** ID of an element that provides details for the tooltip. */\n \"aria-details\"?: string;\n /** The children of the tooltip. A function may be provided to receive render props. */\n children?: RenderChildren<TooltipRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TooltipRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TooltipRenderProps>;\n /** Whether the tooltip is open (controlled). */\n isOpen?: boolean;\n /** Whether the tooltip is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** The placement of the tooltip relative to the trigger. */\n placement?: TooltipPlacement;\n /** The placement padding between the tooltip and viewport edge. */\n containerPadding?: number;\n /** The additional offset along the cross axis. */\n crossOffset?: number;\n /** Whether the tooltip should flip when there is insufficient room. */\n shouldFlip?: boolean;\n /** The offset between the tooltip and trigger. */\n offset?: number;\n /** The arrow size used to keep the arrow overlapping the trigger. */\n arrowSize?: number;\n /** The padding between the arrow and tooltip edge. */\n arrowBoundaryOffset?: number;\n /** Whether the tooltip should be disabled. */\n isDisabled?: boolean;\n /** The element language. */\n lang?: string;\n /** The text direction. */\n dir?: \"ltr\" | \"rtl\";\n}\n\ninterface TooltipTriggerContextValue {\n state: TooltipTriggerState;\n tooltipProps: { readonly id: string };\n setTooltipId: (id: string | undefined) => void;\n triggerRef: () => HTMLElement | null | undefined;\n placement: () => TooltipPlacement | undefined;\n containerPadding: () => number | undefined;\n crossOffset: () => number | undefined;\n shouldFlip: () => boolean | undefined;\n isDisabled: () => boolean | undefined;\n}\n\nconst TooltipTriggerContext = createContext<TooltipTriggerContextValue | null>(null);\nexport const TooltipContext = TooltipTriggerContext;\nexport const TooltipTriggerStateContext = createContext<TooltipTriggerState | null>(null);\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip.\n * It handles opening and closing the Tooltip when the user hovers\n * over or focuses the trigger.\n *\n * @example\n * ```tsx\n * <TooltipTrigger>\n * <Button>Hover me</Button>\n * <Tooltip>This is a tooltip</Tooltip>\n * </TooltipTrigger>\n * ```\n */\nexport const TooltipTrigger: ParentComponent<TooltipTriggerComponentProps> = (props) => {\n let triggerRef: HTMLElement | null = null;\n const [tooltipId, setTooltipId] = createSignal<string | undefined>();\n\n const state = createTooltipTriggerState({\n get delay() {\n return props.delay;\n },\n get closeDelay() {\n return props.closeDelay;\n },\n get isOpen() {\n return props.isOpen;\n },\n get defaultOpen() {\n return props.defaultOpen;\n },\n get onOpenChange() {\n return props.onOpenChange;\n },\n });\n\n const { triggerProps, tooltipProps } = createTooltipTrigger(\n {\n get isDisabled() {\n return props.isDisabled;\n },\n get trigger() {\n return props.trigger;\n },\n get shouldCloseOnPress() {\n return props.shouldCloseOnPress;\n },\n get tooltipId() {\n return tooltipId();\n },\n },\n state,\n () => triggerRef,\n );\n\n const context: TooltipTriggerContextValue = {\n state,\n tooltipProps,\n setTooltipId,\n triggerRef: () => triggerRef,\n placement: () => props.placement,\n containerPadding: () => props.containerPadding,\n crossOffset: () => props.crossOffset,\n shouldFlip: () => props.shouldFlip,\n isDisabled: () => props.isDisabled,\n };\n\n const processChildren = () => {\n const children = props.children;\n if (Array.isArray(children)) {\n const [trigger, ...rest] = children;\n return (\n <>\n <TriggerWrapper\n triggerProps={triggerProps}\n ref={(el) => {\n triggerRef = el;\n }}\n >\n {trigger}\n </TriggerWrapper>\n {rest}\n </>\n );\n }\n return children;\n };\n\n return (\n <TooltipTriggerStateContext.Provider value={state}>\n <TooltipTriggerContext.Provider value={context}>\n {processChildren()}\n </TooltipTriggerContext.Provider>\n </TooltipTriggerStateContext.Provider>\n );\n};\n\n/**\n * Wrapper component that spreads trigger props onto its child\n */\nconst TriggerWrapper: ParentComponent<{\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n ref: (el: HTMLElement) => void;\n}> = (props) => {\n const child = () => props.children as JSX.Element;\n const [triggerElement, setTriggerElement] = createSignal<HTMLElement | null>(null);\n\n createEffect(() => {\n const element = triggerElement();\n if (!element) {\n return;\n }\n\n const triggerProps = props.triggerProps as Record<string, unknown>;\n const describedBy = triggerProps[\"aria-describedby\"] as string | undefined;\n if (describedBy) {\n element.setAttribute(\"aria-describedby\", describedBy);\n } else {\n element.removeAttribute(\"aria-describedby\");\n }\n\n const listeners: Array<[string, EventListener]> = [];\n const eventProps = [\n [\"onFocus\", \"focus\"],\n [\"onBlur\", \"blur\"],\n [\"onPointerEnter\", \"pointerenter\"],\n [\"onPointerLeave\", \"pointerleave\"],\n [\"onPointerOver\", \"pointerover\"],\n [\"onPointerOut\", \"pointerout\"],\n [\"onMouseEnter\", \"mouseenter\"],\n [\"onMouseLeave\", \"mouseleave\"],\n [\"onTouchStart\", \"touchstart\"],\n [\"onPointerDown\", \"pointerdown\"],\n [\"onKeyDown\", \"keydown\"],\n ] as const;\n\n for (const [propName, eventName] of eventProps) {\n const handler = triggerProps[propName];\n if (typeof handler === \"function\") {\n const listener = handler as EventListener;\n element.addEventListener(eventName, listener);\n listeners.push([eventName, listener]);\n }\n }\n\n onCleanup(() => {\n for (const [eventName, listener] of listeners) {\n element.removeEventListener(eventName, listener);\n }\n if (describedBy && element.getAttribute(\"aria-describedby\") === describedBy) {\n element.removeAttribute(\"aria-describedby\");\n }\n });\n });\n\n // We wrap in a span with display:contents to not affect layout.\n // However, display:contents makes getBoundingClientRect return zeros,\n // so we pass a ref callback that finds the first actual element child.\n const handleRef = (span: HTMLSpanElement) => {\n const findElementChild = (el: Element): HTMLElement | null => {\n for (const child of el.children) {\n if (child instanceof HTMLElement) {\n return child;\n }\n const found = findElementChild(child);\n if (found) return found;\n }\n return null;\n };\n\n // Find the first element child that has dimensions (not display:contents)\n const findVisibleChild = (el: Element): HTMLElement | null => {\n if (el instanceof HTMLElement) {\n const rect = el.getBoundingClientRect();\n if (rect.width > 0 && rect.height > 0) {\n return el;\n }\n for (const child of el.children) {\n const found = findVisibleChild(child);\n if (found) return found;\n }\n }\n return null;\n };\n\n // Use requestAnimationFrame to ensure children are rendered and have dimensions\n // This is necessary because SolidJS may not have computed child layout yet\n const resolveRef = () => {\n const elementChild = findElementChild(span);\n const visibleChild = findVisibleChild(span);\n setTriggerElement(elementChild ?? visibleChild ?? span);\n props.ref(visibleChild ?? elementChild ?? span);\n };\n\n const elementChild = findElementChild(span);\n if (elementChild) {\n setTriggerElement(elementChild);\n }\n\n const immediateChild = findVisibleChild(span);\n if (immediateChild) {\n setTriggerElement(elementChild ?? immediateChild);\n props.ref(immediateChild);\n } else {\n requestAnimationFrame(resolveRef);\n }\n };\n\n return (\n <span ref={handleRef} style={{ display: \"contents\" }}>\n {child()}\n </span>\n );\n};\n\n/**\n * A tooltip displays a description of an element on hover or focus.\n *\n * @example\n * ```tsx\n * <TooltipTrigger>\n * <Button>Hover me</Button>\n * <Tooltip>This is helpful information</Tooltip>\n * </TooltipTrigger>\n * ```\n */\nexport function Tooltip(props: TooltipProps): JSX.Element {\n const context = useContext(TooltipTriggerContext);\n\n createEffect(() => {\n context?.setTooltipId(props.id);\n onCleanup(() => {\n context?.setTooltipId(undefined);\n });\n });\n\n const localState = createTooltipTriggerState({\n get isOpen() {\n return props.isOpen;\n },\n get defaultOpen() {\n return props.defaultOpen;\n },\n });\n\n const state = () => context?.state ?? localState;\n const placement = () => props.placement ?? context?.placement() ?? \"top\";\n const containerPadding = () => props.containerPadding ?? context?.containerPadding() ?? 12;\n const crossOffset = () => props.crossOffset ?? context?.crossOffset() ?? 0;\n const shouldFlip = () => props.shouldFlip ?? context?.shouldFlip() ?? true;\n const offset = () => props.offset ?? 9;\n const arrowSize = () => props.arrowSize ?? 0;\n const arrowBoundaryOffset = () => props.arrowBoundaryOffset ?? 0;\n const isDisabled = () => props.isDisabled ?? context?.isDisabled() ?? false;\n\n const isOpen = () => !isDisabled() && state().isOpen();\n\n // Exit animation state machine: 'closed' | 'open' | 'exiting'\n // Keeps the tooltip mounted during exit animation so CSS transitions can play.\n const [exitState, setExitState] = createSignal<\"closed\" | \"open\" | \"exiting\">(\n isOpen() ? \"open\" : \"closed\",\n );\n\n createEffect(() => {\n const open = isOpen();\n const current = exitState();\n if (current === \"open\" && !open) {\n setExitState(\"exiting\");\n } else if ((current === \"closed\" || current === \"exiting\") && open) {\n setExitState(\"open\");\n }\n });\n\n // Signal for the tooltip ref so we can observe exit animations\n const [tooltipEl, setTooltipEl] = createSignal<HTMLDivElement | null>(null);\n\n // When exiting, wait for CSS animations to finish, then set state to closed\n createEffect(() => {\n if (exitState() !== \"exiting\") return;\n const el = tooltipEl();\n if (!el || !(\"getAnimations\" in el)) {\n setExitState(\"closed\");\n return;\n }\n const animations = el.getAnimations();\n if (animations.length === 0) {\n setExitState(\"closed\");\n return;\n }\n let canceled = false;\n Promise.all(animations.map((a) => a.finished))\n .then(() => {\n if (!canceled) setExitState((s) => (s === \"exiting\" ? \"closed\" : s));\n })\n .catch(() => {\n if (!canceled) setExitState((s) => (s === \"exiting\" ? \"closed\" : s));\n });\n onCleanup(() => {\n canceled = true;\n });\n });\n\n const shouldRender = () => isOpen() || exitState() === \"exiting\";\n const isExiting = () => exitState() === \"exiting\";\n\n return (\n <Show when={shouldRender()}>\n <TooltipContent\n {...props}\n state={state()}\n contextTooltipProps={context?.tooltipProps ?? {}}\n placement={placement()}\n containerPadding={containerPadding()}\n crossOffset={crossOffset()}\n shouldFlip={shouldFlip()}\n offset={offset()}\n arrowSize={arrowSize()}\n arrowBoundaryOffset={arrowBoundaryOffset()}\n triggerRef={context?.triggerRef ?? (() => null)}\n isExiting={isExiting()}\n onTooltipRef={setTooltipEl}\n />\n </Show>\n );\n}\n\n/**\n * Internal component that renders the tooltip content\n */\nfunction TooltipContent(\n props: TooltipProps & {\n state: TooltipTriggerState;\n contextTooltipProps: { readonly id?: string };\n placement: TooltipPlacement;\n containerPadding: number;\n crossOffset: number;\n shouldFlip: boolean;\n offset: number;\n arrowSize: number;\n arrowBoundaryOffset: number;\n triggerRef: () => HTMLElement | null | undefined;\n isExiting: boolean;\n onTooltipRef: (el: HTMLDivElement | null) => void;\n },\n): JSX.Element {\n if (isServer) {\n return null as unknown as JSX.Element;\n }\n\n let tooltipRef!: HTMLDivElement;\n const { tooltipProps: ariaTooltipProps } = createTooltip({}, props.state);\n\n // Start visible at 0,0 and update position asynchronously\n // This ensures the tooltip is immediately accessible (for screen readers and tests)\n // while the visual position gets calculated\n const [positionStyles, setPositionStyles] = createSignal({\n top: \"0px\",\n left: \"0px\",\n visibility: \"visible\" as \"hidden\" | \"visible\",\n });\n const [renderedPlacement, setRenderedPlacement] = createSignal<TooltipResolvedPlacement>(\n resolvePlacement(props.placement),\n );\n\n // Enter animation state: starts true on mount, clears after first animation frame.\n // Uses getAnimations() to detect CSS animations/transitions - if none exist (JSDOM,\n // no CSS defined, reduced-motion), clears immediately.\n const [isEntering, setIsEntering] = createSignal(true);\n\n createEffect(() => {\n if (!isEntering()) return;\n if (!tooltipRef || !(\"getAnimations\" in tooltipRef)) {\n setIsEntering(false);\n return;\n }\n // Cancel any premature CSS transitions triggered before layout\n for (const anim of tooltipRef.getAnimations()) {\n if (anim instanceof CSSTransition) {\n anim.cancel();\n }\n }\n const animations = tooltipRef.getAnimations();\n if (animations.length === 0) {\n setIsEntering(false);\n return;\n }\n let canceled = false;\n Promise.all(animations.map((a) => a.finished))\n .then(() => {\n if (!canceled) setIsEntering(false);\n })\n .catch(() => {\n if (!canceled) setIsEntering(false);\n });\n onCleanup(() => {\n canceled = true;\n });\n });\n\n const values = createMemo<TooltipRenderProps>(() => ({\n isEntering: isEntering(),\n isExiting: props.isExiting,\n placement: renderedPlacement(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n children: props.children,\n defaultClassName: \"solidaria-Tooltip\",\n },\n values,\n );\n\n // Position the overlay in document coordinates, matching React Aria's\n // absolute overlay positioning when the portal container is the document.\n // Returns true if position was successfully updated, false if we need to retry\n const updatePosition = (): boolean => {\n const triggerEl = props.triggerRef();\n if (!triggerEl || !tooltipRef) return false;\n\n const triggerRect = triggerEl.getBoundingClientRect();\n\n // Check if the trigger has valid dimensions (not display:contents or not rendered yet)\n if (triggerRect.width === 0 || triggerRect.height === 0) {\n return false; // Need to retry\n }\n\n // Use offsetWidth/offsetHeight which are more reliable than getBoundingClientRect\n // when the element might be positioned off-screen initially\n const tooltipWidth = tooltipRef.offsetWidth;\n const tooltipHeight = tooltipRef.offsetHeight;\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n const containerPadding = props.containerPadding;\n const crossOffset = props.crossOffset;\n const placement = maybeFlipPlacement(\n resolvePlacement(props.placement),\n triggerRect,\n tooltipWidth,\n tooltipHeight,\n viewportWidth,\n viewportHeight,\n containerPadding,\n props.offset,\n props.shouldFlip,\n );\n\n let top = 0;\n let left = 0;\n\n switch (placement) {\n case \"top\":\n top = triggerRect.top - tooltipHeight - props.offset;\n left = triggerRect.left + (triggerRect.width - tooltipWidth) / 2 + crossOffset;\n break;\n case \"bottom\":\n top = triggerRect.bottom + props.offset;\n left = triggerRect.left + (triggerRect.width - tooltipWidth) / 2 + crossOffset;\n break;\n case \"left\":\n top = triggerRect.top + (triggerRect.height - tooltipHeight) / 2 + crossOffset;\n left = triggerRect.left - tooltipWidth - props.offset;\n break;\n case \"right\":\n top = triggerRect.top + (triggerRect.height - tooltipHeight) / 2 + crossOffset;\n left = triggerRect.right + props.offset;\n break;\n }\n\n if (placement === \"top\" || placement === \"bottom\") {\n left = clamp(\n left,\n triggerRect.left - tooltipWidth + props.arrowSize + props.arrowBoundaryOffset,\n triggerRect.left + triggerRect.width - props.arrowSize - props.arrowBoundaryOffset,\n );\n left = clamp(left, containerPadding, viewportWidth - tooltipWidth - containerPadding);\n } else {\n top = clamp(\n top,\n triggerRect.top - tooltipHeight + props.arrowSize + props.arrowBoundaryOffset,\n triggerRect.top + triggerRect.height - props.arrowSize - props.arrowBoundaryOffset,\n );\n top = clamp(top, containerPadding, viewportHeight - tooltipHeight - containerPadding);\n }\n setRenderedPlacement(placement);\n setPositionStyles({\n top: `${Math.floor(top + window.scrollY)}px`,\n left: `${Math.floor(left + window.scrollX)}px`,\n visibility: \"visible\",\n });\n\n return true;\n };\n\n // Set up positioning and scroll-close effects. Positioning retries while the\n // trigger ref resolves, and pending rAF/setTimeout IDs are canceled on cleanup.\n createEffect(() => {\n // Track positioning inputs synchronously so updates from controlled route\n // props reschedule measurement even though layout reads happen in rAF.\n props.placement;\n props.containerPadding;\n props.crossOffset;\n props.shouldFlip;\n props.offset;\n props.arrowSize;\n props.arrowBoundaryOffset;\n\n let retryCount = 0;\n const maxRetries = 5;\n let pendingRaf = 0;\n let pendingTimeout = 0;\n\n const tryUpdatePosition = () => {\n pendingRaf = 0;\n pendingTimeout = 0;\n const success = updatePosition();\n if (!success && retryCount < maxRetries) {\n retryCount++;\n pendingTimeout = window.setTimeout(tryUpdatePosition, 16);\n }\n };\n\n pendingRaf = requestAnimationFrame(tryUpdatePosition);\n\n const closeOnScroll = (event: Event) => {\n const trigger = props.triggerRef();\n const target = event.target;\n if (!trigger || (target instanceof Node && !target.contains(trigger))) {\n return;\n }\n if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) {\n return;\n }\n\n props.state.close(true);\n };\n\n window.addEventListener(\"scroll\", closeOnScroll, true);\n window.addEventListener(\"resize\", updatePosition);\n\n onCleanup(() => {\n if (pendingRaf) cancelAnimationFrame(pendingRaf);\n if (pendingTimeout) clearTimeout(pendingTimeout);\n window.removeEventListener(\"scroll\", closeOnScroll, true);\n window.removeEventListener(\"resize\", updatePosition);\n });\n });\n\n const domProps = filterDOMProps(props, { global: true });\n const tooltipId = () => props.contextTooltipProps.id ?? (domProps as { id?: string }).id;\n\n // Extract ref from ariaTooltipProps to avoid type conflicts (SolidJS ref types are element-specific)\n const { ref: _ariaRef, ...cleanAriaProps } = ariaTooltipProps as Record<string, unknown>;\n\n const setRef = (el: HTMLDivElement) => {\n tooltipRef = el;\n if (!props.dir) {\n el.dir = getDocumentDirection();\n }\n if (!props.lang) {\n const documentLang = document.documentElement.lang;\n const navigatorLang = typeof navigator !== \"undefined\" ? navigator.language : \"\";\n el.lang = documentLang.includes(\"-\")\n ? documentLang\n : navigatorLang || documentLang || \"en-US\";\n }\n props.onTooltipRef(el);\n };\n\n onCleanup(() => {\n props.onTooltipRef(null);\n });\n\n return (\n <OverlayContainer>\n <div\n {...domProps}\n {...cleanAriaProps}\n id={tooltipId()}\n role=\"tooltip\"\n ref={setRef}\n class={renderProps.class()}\n style={{\n position: \"absolute\",\n \"z-index\": 100000,\n ...positionStyles(),\n ...renderProps.style(),\n }}\n data-placement={renderedPlacement()}\n data-entering={isEntering() || undefined}\n data-exiting={props.isExiting || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </OverlayContainer>\n );\n}\n\nfunction resolvePlacement(placement: TooltipPlacement): TooltipResolvedPlacement {\n if (placement === \"start\") {\n return getDocumentDirection() === \"rtl\" ? \"right\" : \"left\";\n }\n if (placement === \"end\") {\n return getDocumentDirection() === \"rtl\" ? \"left\" : \"right\";\n }\n return placement;\n}\n\nfunction getDocumentDirection(): \"ltr\" | \"rtl\" {\n if (typeof document === \"undefined\") {\n return \"ltr\";\n }\n\n return document.documentElement.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n}\n\nfunction maybeFlipPlacement(\n placement: TooltipResolvedPlacement,\n triggerRect: DOMRect,\n tooltipWidth: number,\n tooltipHeight: number,\n viewportWidth: number,\n viewportHeight: number,\n containerPadding: number,\n offset: number,\n shouldFlip: boolean,\n): TooltipResolvedPlacement {\n if (!shouldFlip) {\n return placement;\n }\n\n switch (placement) {\n case \"top\":\n return triggerRect.top - tooltipHeight - offset < containerPadding ? \"bottom\" : placement;\n case \"bottom\":\n return triggerRect.bottom + tooltipHeight + offset > viewportHeight - containerPadding\n ? \"top\"\n : placement;\n case \"left\":\n return triggerRect.left - tooltipWidth - offset < containerPadding ? \"right\" : placement;\n case \"right\":\n return triggerRect.right + tooltipWidth + offset > viewportWidth - containerPadding\n ? \"left\"\n : placement;\n }\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n if (max < min) {\n return min;\n }\n\n return Math.min(Math.max(value, min), max);\n}\n\nexport type { TooltipTriggerState };\n","/**\n * ComboBox component for solidaria-components\n *\n * A pre-wired headless combobox that combines state + aria hooks.\n * Port of react-aria-components/src/ComboBox.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createComboBox,\n createListBox,\n createOption,\n getComboBoxData,\n createHover,\n createInteractOutside,\n mergeProps,\n type AriaComboBoxProps,\n type AriaListBoxProps,\n type AriaOptionProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createComboBoxState,\n defaultContainsFilter,\n type ComboBoxState,\n type ListState,\n type Key,\n type FilterFn,\n type MenuTriggerAction,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ComboBoxRenderProps {\n /** Whether the combobox listbox is open. */\n isOpen: boolean;\n /** Whether the combobox input is focused. */\n isFocused: boolean;\n /** Whether the combobox input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the combobox is disabled. */\n isDisabled: boolean;\n /** Whether the combobox is required. */\n isRequired: boolean;\n /** Whether the combobox is invalid. */\n isInvalid: boolean;\n /** Whether the combobox is read only. */\n isReadOnly: boolean;\n /** Whether a value is selected. */\n isSelected: boolean;\n /** The current input value. */\n inputValue: string;\n}\n\nexport interface ComboBoxProps<T> extends Omit<AriaComboBoxProps, \"children\">, SlotProps {\n /** The items to render in the combobox. */\n items?: T[];\n /** The default items to render in the combobox when uncontrolled. */\n defaultItems?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** The selection mode for the combobox. */\n selectionMode?: \"single\" | \"multiple\";\n /** The currently selected key (controlled, single mode). */\n selectedKey?: Key | null;\n /** The default selected key (uncontrolled, single mode). */\n defaultSelectedKey?: Key | null;\n /** The currently selected keys (controlled, multiple mode). */\n selectedKeys?: Iterable<Key>;\n /** The default selected keys (uncontrolled, multiple mode). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler called when selection changes (single mode). */\n onSelectionChange?: (key: Key | null) => void;\n /** Handler called when selection changes (multiple mode). */\n onSelectionChangeMultiple?: (keys: Set<Key>) => void;\n /** The current input value (controlled). */\n inputValue?: string;\n /** The default input value (uncontrolled). */\n defaultInputValue?: string;\n /** Handler called when input value changes. */\n onInputChange?: (value: string) => void;\n /** Whether the combobox is open (controlled). */\n isOpen?: boolean;\n /** Whether the combobox is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the open state changes. */\n onOpenChange?: (isOpen: boolean, trigger?: MenuTriggerAction) => void;\n /** The filter function to use for filtering items. */\n defaultFilter?: FilterFn;\n /** Whether to allow custom values that don't match any item. */\n allowsCustomValue?: boolean;\n /** Whether to allow an empty collection (show listbox even with no matches). */\n allowsEmptyCollection?: boolean;\n /** The trigger mechanism for the combobox menu. */\n menuTrigger?: \"focus\" | \"input\" | \"manual\";\n /** The name of the combobox, used when submitting an HTML form. */\n name?: string;\n /**\n * Controls what value is submitted in forms.\n * - 'key': submit the selected key via hidden input (default)\n * - 'text': submit the text input value\n *\n * When allowsCustomValue is true, formValue is forced to 'text'.\n */\n formValue?: \"key\" | \"text\";\n /** The children of the component (compound components: ComboBoxInput, ComboBoxButton, ComboBoxListBox). */\n children: RenderChildren<ComboBoxRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ComboBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ComboBoxRenderProps>;\n /** Ref for the root combobox element. */\n ref?: RefLike<HTMLDivElement>;\n /** Internal alias for libraries that wrap ComboBox and need a root ref. */\n rootRef?: RefLike<HTMLDivElement>;\n /** Slot definitions provided through ComboBoxContext. */\n slots?: Record<string, Partial<ComboBoxProps<T>>>;\n}\n\nexport interface ComboBoxInputRenderProps {\n /** Whether the combobox is open. */\n isOpen: boolean;\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** The current input value. */\n inputValue: string;\n}\n\nexport interface ComboBoxInputProps extends SlotProps {\n /** The children of the input. */\n children?: RenderChildren<ComboBoxInputRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ComboBoxInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ComboBoxInputRenderProps>;\n}\n\nexport interface ComboBoxLabelProps extends SlotProps {\n /** The children of the label element. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\nexport interface ComboBoxDescriptionProps extends SlotProps {\n /** The children of the description element. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\nexport interface ComboBoxErrorMessageProps extends SlotProps {\n /** The children of the error message element. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\nexport interface ComboBoxButtonRenderProps {\n /** Whether the combobox is open. */\n isOpen: boolean;\n /** Whether the button is focused. */\n isFocused: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface ComboBoxValueRenderProps {\n textValue: string;\n isPlaceholder: boolean;\n selectedItems: unknown[];\n selectedText: string;\n state: ComboBoxState<unknown>;\n}\n\nexport interface ComboBoxValueProps extends SlotProps {\n children?: RenderChildren<ComboBoxValueRenderProps>;\n class?: ClassNameOrFunction<ComboBoxValueRenderProps>;\n style?: StyleOrFunction<ComboBoxValueRenderProps>;\n placeholder?: JSX.Element;\n}\n\nexport interface ComboBoxButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<ComboBoxButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ComboBoxButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ComboBoxButtonRenderProps>;\n}\n\nexport interface ComboBoxListBoxRenderProps {\n /** Whether the listbox is focused. */\n isFocused: boolean;\n}\n\nexport interface ComboBoxListBoxProps<T> extends SlotProps {\n /** The children of the listbox. A function may be provided to render each item. */\n children?: (item: T) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ComboBoxListBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ComboBoxListBoxRenderProps>;\n}\n\nexport interface ComboBoxOptionRenderProps {\n /** Whether the option is selected. */\n isSelected: boolean;\n /** Whether the option is focused. */\n isFocused: boolean;\n /** Whether the option has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the option is pressed. */\n isPressed: boolean;\n /** Whether the option is hovered. */\n isHovered: boolean;\n /** Whether the option is disabled. */\n isDisabled: boolean;\n}\n\nexport interface ComboBoxOptionProps<T>\n extends Omit<AriaOptionProps, \"children\" | \"key\">, SlotProps {\n /** The unique key for the option. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the option. A function may be provided to receive render props. */\n children?: RenderChildren<ComboBoxOptionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ComboBoxOptionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ComboBoxOptionRenderProps>;\n /** The text value of the option (for typeahead). */\n textValue?: string;\n /** Handler called when the option is activated. */\n onAction?: () => void;\n}\n\ninterface ComboBoxContextValue<T> {\n state: ComboBoxState<T>;\n inputProps: () => JSX.InputHTMLAttributes<HTMLInputElement>;\n buttonProps: () => JSX.HTMLAttributes<HTMLElement>;\n listBoxProps: () => JSX.HTMLAttributes<HTMLElement>;\n labelProps: () => JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: () => JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps: () => JSX.HTMLAttributes<HTMLElement>;\n isOpen: Accessor<boolean>;\n isFocused: Accessor<boolean>;\n isFocusVisible: Accessor<boolean>;\n items: T[];\n inputRef: () => HTMLInputElement | null;\n setInputRef: (el: HTMLInputElement | null) => void;\n buttonRef: () => HTMLElement | null;\n setButtonRef: (el: HTMLElement | null) => void;\n triggerRef: () => HTMLElement | null;\n setTriggerRef: (el: HTMLElement | null) => void;\n listBoxRef: () => HTMLElement | null;\n setListBoxRef: (el: HTMLElement | null) => void;\n slots?: Record<string, Partial<ComboBoxProps<T>>>;\n}\n\nexport const ComboBoxContext = createContext<ComboBoxContextValue<unknown> | null>(null);\nexport const ComboBoxStateContext = createContext<ComboBoxState<unknown> | null>(null);\nexport const ComboBoxValueContext = ComboBoxContext;\n\n/**\n * A combobox combines a text input with a listbox, allowing users to filter a list of options.\n */\nexport function ComboBox<T>(props: ComboBoxProps<T>): JSX.Element {\n const parentContext = useContext(ComboBoxContext) as ComboBoxContextValue<T> | null;\n const contextSlotProps = parentContext?.slots?.[props.slot ?? \"default\"];\n const mergedComboBoxProps = contextSlotProps\n ? (mergeProps(contextSlotProps, props) as ComboBoxProps<T>)\n : props;\n const [local, stateProps, ariaProps] = splitProps(\n mergedComboBoxProps,\n [\"class\", \"style\", \"slot\", \"children\", \"ref\", \"rootRef\", \"slots\"],\n [\n \"items\",\n \"defaultItems\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectionMode\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onSelectionChangeMultiple\",\n \"inputValue\",\n \"defaultInputValue\",\n \"onInputChange\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"defaultFilter\",\n \"allowsCustomValue\",\n \"allowsEmptyCollection\",\n \"menuTrigger\",\n \"name\",\n \"formValue\",\n ],\n );\n\n let inputRef: HTMLInputElement | null = null;\n let buttonRef: HTMLElement | null = null;\n let triggerRef: HTMLElement | null = null;\n let listBoxRef: HTMLElement | null = null;\n\n const state = createComboBoxState<T>({\n get items() {\n return stateProps.items;\n },\n get defaultItems() {\n return stateProps.defaultItems;\n },\n get getKey() {\n return stateProps.getKey;\n },\n get getTextValue() {\n return stateProps.getTextValue;\n },\n get getDisabled() {\n return stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get onSelectionChangeMultiple() {\n return stateProps.onSelectionChangeMultiple;\n },\n get inputValue() {\n return stateProps.inputValue;\n },\n get defaultInputValue() {\n return stateProps.defaultInputValue;\n },\n get onInputChange() {\n return stateProps.onInputChange;\n },\n get isOpen() {\n return stateProps.isOpen;\n },\n get defaultOpen() {\n return stateProps.defaultOpen;\n },\n get onOpenChange() {\n return stateProps.onOpenChange;\n },\n get defaultFilter() {\n return stateProps.defaultFilter;\n },\n get allowsCustomValue() {\n return stateProps.allowsCustomValue;\n },\n get allowsEmptyCollection() {\n return stateProps.allowsEmptyCollection;\n },\n get menuTrigger() {\n return stateProps.menuTrigger;\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n });\n\n const effectiveFormValue = createMemo<\"key\" | \"text\">(() => {\n if (stateProps.allowsCustomValue) {\n return \"text\";\n }\n return stateProps.formValue ?? \"key\";\n });\n\n const comboBoxAriaProps = createMemo(() => {\n const cleanProps: Record<string, unknown> = {};\n for (const key in ariaProps) {\n if (!key.startsWith(\"data-\")) {\n cleanProps[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return cleanProps as AriaComboBoxProps;\n });\n\n const comboBoxAria = createComboBox<T>(\n () => ({\n ...comboBoxAriaProps(),\n get name() {\n return effectiveFormValue() === \"text\" ? stateProps.name : undefined;\n },\n }),\n state,\n () => inputRef,\n () => buttonRef,\n () => listBoxRef,\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n });\n\n const renderValues = createMemo<ComboBoxRenderProps>(() => ({\n isOpen: comboBoxAria.isOpen(),\n isFocused: comboBoxAria.isFocused(),\n isFocusVisible: comboBoxAria.isFocusVisible(),\n isDisabled: !!ariaProps.isDisabled,\n isRequired: !!ariaProps.isRequired,\n isInvalid: !!ariaProps.isInvalid,\n isReadOnly: !!ariaProps.isReadOnly,\n isSelected: state.selectedKey() != null,\n inputValue: state.inputValue(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ComboBox\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n const ComboBoxChildren = () =>\n typeof local.children === \"function\"\n ? (local.children as (values: ComboBoxRenderProps) => JSX.Element)(renderValues())\n : local.children;\n\n return (\n <ComboBoxContext.Provider\n value={\n {\n state,\n inputProps: () => comboBoxAria.inputProps,\n buttonProps: () => comboBoxAria.buttonProps,\n listBoxProps: () => comboBoxAria.listBoxProps,\n labelProps: () => comboBoxAria.labelProps,\n descriptionProps: () => comboBoxAria.descriptionProps,\n errorMessageProps: () => comboBoxAria.errorMessageProps,\n isOpen: comboBoxAria.isOpen,\n isFocused: comboBoxAria.isFocused,\n isFocusVisible: comboBoxAria.isFocusVisible,\n items: stateProps.items ?? stateProps.defaultItems ?? [],\n inputRef: () => inputRef,\n setInputRef: (el) => {\n inputRef = el;\n },\n buttonRef: () => buttonRef,\n setButtonRef: (el) => {\n buttonRef = el;\n },\n triggerRef: () => triggerRef,\n setTriggerRef: (el) => {\n triggerRef = el;\n },\n listBoxRef: () => listBoxRef,\n setListBoxRef: (el) => {\n listBoxRef = el;\n },\n slots: local.slots,\n } as ComboBoxContextValue<unknown>\n }\n >\n <ComboBoxStateContext.Provider value={state}>\n <div\n {...domProps()}\n {...cleanHoverProps()}\n ref={(el) => {\n assignRef(local.ref, el);\n assignRef(local.rootRef, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-open={comboBoxAria.isOpen() || undefined}\n data-focused={comboBoxAria.isFocused() || undefined}\n data-focus-visible={comboBoxAria.isFocusVisible() || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-invalid={ariaProps.isInvalid || undefined}\n data-readonly={ariaProps.isReadOnly || undefined}\n data-hovered={isHovered() || undefined}\n slot={local.slot}\n >\n {/* Hidden input for key-based form submission parity */}\n <Show when={stateProps.name && effectiveFormValue() === \"key\"}>\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={state.selectedKey()?.toString() ?? \"\"}\n />\n </Show>\n <ComboBoxChildren />\n </div>\n </ComboBoxStateContext.Provider>\n </ComboBoxContext.Provider>\n );\n}\n\n/**\n * Label element for a combobox.\n */\nexport function ComboBoxLabel(props: ComboBoxLabelProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error(\"ComboBoxLabel must be used within a ComboBox\");\n }\n\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps() as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label {...domProps} {...cleanLabelProps()} class={local.class} style={local.style}>\n {local.children}\n </label>\n );\n}\n\n/**\n * Description element for a combobox.\n */\nexport function ComboBoxDescription(props: ComboBoxDescriptionProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error(\"ComboBoxDescription must be used within a ComboBox\");\n }\n\n const cleanDescriptionProps = () => {\n const { ref: _ref, ...rest } = context.descriptionProps() as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div {...domProps} {...cleanDescriptionProps()} class={local.class} style={local.style}>\n {local.children}\n </div>\n );\n}\n\n/**\n * Error message element for a combobox.\n */\nexport function ComboBoxErrorMessage(props: ComboBoxErrorMessageProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error(\"ComboBoxErrorMessage must be used within a ComboBox\");\n }\n\n const cleanErrorMessageProps = () => {\n const { ref: _ref, ...rest } = context.errorMessageProps() as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div {...domProps} {...cleanErrorMessageProps()} class={local.class} style={local.style}>\n {local.children}\n </div>\n );\n}\n\n/**\n * The text input for a combobox.\n */\nexport function ComboBoxInput(props: ComboBoxInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error(\"ComboBoxInput must be used within a ComboBox\");\n }\n const { isOpen, isFocused, isFocusVisible, state, setInputRef } = context;\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<ComboBoxInputRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: state.isDisabled,\n inputValue: state.inputValue(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ComboBox-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref1, value: _value, ...rest } = context.inputProps() as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <input\n {...domProps}\n ref={(el) => setInputRef(el)}\n {...cleanInputProps()}\n {...cleanHoverProps()}\n value={state.inputValue()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-open={isOpen() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={state.isDisabled || undefined}\n />\n );\n}\n\nexport function ComboBoxValue(props: ComboBoxValueProps): JSX.Element {\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error(\"ComboBoxValue must be used within a ComboBox\");\n }\n\n const state = context.state;\n const isMulti = createMemo(() => state.selectionMode() === \"multiple\");\n const selectedItem = createMemo(() => state.selectedItem());\n const selectedItems = createMemo(() => {\n if (isMulti()) {\n return state.selectedItems().map((node) => node.value ?? null);\n }\n const item = selectedItem();\n return item ? [item.value ?? null] : [];\n });\n const selectedText = createMemo(() => {\n if (isMulti()) {\n const items = state.selectedItems();\n return items.map((n) => n.textValue).join(\", \");\n }\n return selectedItem()?.textValue ?? \"\";\n });\n const textValue = createMemo(() => selectedText() || state.inputValue() || \"\");\n const isPlaceholder = createMemo(() => textValue().length === 0);\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-ComboBox-value\",\n },\n () => ({\n textValue: textValue(),\n isPlaceholder: isPlaceholder(),\n selectedItems: selectedItems(),\n selectedText: selectedText(),\n state: state as ComboBoxState<unknown>,\n }),\n );\n\n return (\n <span\n class={renderProps.class()}\n style={renderProps.style()}\n data-placeholder={isPlaceholder() || undefined}\n >\n {props.children\n ? renderProps.renderChildren()\n : isPlaceholder()\n ? props.placeholder\n : textValue()}\n </span>\n );\n}\n\n/**\n * The trigger button for a combobox.\n */\nexport function ComboBoxButton(props: ComboBoxButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error(\"ComboBoxButton must be used within a ComboBox\");\n }\n const { isOpen, isFocused, state, setButtonRef } = context;\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<ComboBoxButtonRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isHovered: isHovered(),\n isPressed: isOpen(),\n isDisabled: state.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ComboBox-button\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref1, ...rest } = context.buttonProps() as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <button\n {...domProps}\n ref={(el) => setButtonRef(el)}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-open={isOpen() || undefined}\n data-pressed={isOpen() || undefined}\n data-focused={isFocused() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={state.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n );\n}\n\n/**\n * The listbox popup for a combobox.\n */\nexport function ComboBoxListBox<T>(props: ComboBoxListBoxProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const rawContext = useContext(ComboBoxContext);\n if (!rawContext) {\n throw new Error(\"ComboBoxListBox must be used within a ComboBox\");\n }\n const context = rawContext as ComboBoxContextValue<T>;\n const { state: comboBoxState, isOpen, inputRef, buttonRef, setListBoxRef } = context;\n const state = comboBoxState;\n\n let listBoxRef: HTMLUListElement | undefined;\n\n createInteractOutside({\n ref: () => listBoxRef ?? null,\n onInteractOutside: (e) => {\n // Don't close if clicking the input or button\n const target = e.target as HTMLElement;\n const input = inputRef();\n const button = buttonRef();\n if (input?.contains(target)) {\n return;\n }\n if (button?.contains(target)) {\n return;\n }\n if (isOpen()) {\n state.close();\n }\n },\n get isDisabled() {\n return !isOpen();\n },\n });\n\n // Create listbox aria props using ComboBoxState's ListState-compatible interface\n const { listBoxProps } = createListBox(\n context.listBoxProps as unknown as AriaListBoxProps,\n createComboBoxListStateAdapter(state),\n );\n\n const renderValues = createMemo<ComboBoxListBoxRenderProps>(() => ({\n isFocused: state.isFocused(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ComboBox-listbox\",\n },\n renderValues,\n );\n\n const cleanContextProps = () => {\n const { ref: _ref1, ...rest } = context.listBoxProps() as Record<string, unknown>;\n return rest;\n };\n const cleanListBoxProps = () => {\n const { ref: _ref2, ...rest } = listBoxProps as Record<string, unknown>;\n return rest;\n };\n\n const items = () => Array.from(state.collection());\n const getNodeValue = (node: { key: Key; value?: T | null; index?: number }): T | null => {\n if (node.value != null) {\n return node.value;\n }\n\n return (\n context.items.find((item, index) => {\n const candidate = item as { key?: Key; id?: Key };\n const key = candidate.key ?? candidate.id ?? index;\n return key === node.key;\n }) ?? null\n );\n };\n\n const setListBoxElement = (el: HTMLUListElement) => {\n listBoxRef = el;\n setListBoxRef(el);\n };\n\n onCleanup(() => {\n setListBoxRef(null);\n });\n\n return (\n <Show when={isOpen()}>\n <ul\n {...domProps}\n ref={setListBoxElement}\n {...cleanContextProps()}\n {...cleanListBoxProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.isFocused() || undefined}\n >\n <Show\n when={local.children}\n fallback={\n <For each={items()}>\n {(node) => <ComboBoxOption id={node.key}>{node.textValue}</ComboBoxOption>}\n </For>\n }\n >\n <For each={items()}>\n {(node) => {\n const value = getNodeValue(node);\n return value != null ? (local.children as Function)!(value) : null;\n }}\n </For>\n </Show>\n </ul>\n </Show>\n );\n}\n\n/**\n * An option in a combobox listbox.\n */\nexport function ComboBoxOption<T>(props: ComboBoxOptionProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"onAction\",\n ]);\n\n const stateContext = useContext(ComboBoxStateContext);\n const comboBoxContext = useContext(ComboBoxContext);\n if (!stateContext) {\n throw new Error(\"ComboBoxOption must be used within a ComboBox\");\n }\n const state = stateContext as ComboBoxState<T>;\n const optionId = () => {\n const listBoxId = getComboBoxData(state as ComboBoxState<unknown>)?.listBoxId;\n return listBoxId ? `${listBoxId}-option-${local.id}` : String(local.id);\n };\n\n // Create option aria props using ComboBoxState's ListState-compatible interface\n const optionAria = createOption<T>(\n {\n key: local.id,\n get optionId() {\n return optionId();\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get onAction() {\n return local.onAction;\n },\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n shouldUseVirtualFocus: true,\n allowsDifferentPressOrigin: true,\n get onHoverStart() {\n return ariaProps.onHoverStart;\n },\n get onHoverEnd() {\n return ariaProps.onHoverEnd;\n },\n get onHoverChange() {\n return ariaProps.onHoverChange;\n },\n },\n createComboBoxListStateAdapter(state),\n );\n\n const isOptionFocusVisible = () =>\n optionAria.isFocusVisible() ||\n (optionAria.isFocused() && (comboBoxContext?.isFocusVisible() ?? false));\n\n const renderValues = createMemo<ComboBoxOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: isOptionFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: optionAria.isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ComboBox-option\",\n },\n renderValues,\n );\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: optionAria.isSelected,\n }));\n\n const cleanOptionProps = () => {\n const { ref: _ref1, ...rest } = optionAria.optionProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <li\n {...cleanOptionProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={optionAria.isSelected() || undefined}\n data-focused={optionAria.isFocused() || undefined}\n data-focus-visible={isOptionFocusVisible() || undefined}\n data-pressed={optionAria.isPressed() || undefined}\n data-hovered={optionAria.isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </li>\n </SelectionIndicatorContext.Provider>\n );\n}\n\nexport interface ComboBoxTagGroupProps {\n /** Render function for each selected item. */\n children: (item: { key: Key; label: string }) => JSX.Element;\n /** The CSS className for the container. */\n class?: string;\n /** The inline style for the container. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Renders selected items as tags in multi-select mode.\n */\nexport function ComboBoxTagGroup(props: ComboBoxTagGroupProps): JSX.Element {\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error(\"ComboBoxTagGroup must be used within a ComboBox\");\n }\n\n const state = context.state;\n const items = createMemo(() =>\n state.selectedItems().map((node) => ({\n key: node.key,\n label: node.textValue,\n })),\n );\n\n return (\n <Show when={items().length > 0}>\n <div\n class={props.class ?? \"solidaria-ComboBox-tagGroup\"}\n style={props.style}\n role=\"group\"\n aria-label=\"Selected items\"\n >\n <For each={items()}>{(item) => props.children(item)}</For>\n </div>\n </Show>\n );\n}\n\nexport interface ComboBoxTagProps {\n /** The item data. */\n item: { key: Key; label: string };\n /** Handler called when the tag remove button is clicked. */\n onRemove?: () => void;\n /** The children to render inside the tag. */\n children?: JSX.Element;\n /** The CSS className for the tag. */\n class?: string;\n /** The inline style for the tag. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * A tag representing a selected item in a multi-select combobox.\n */\nexport function ComboBoxTag(props: ComboBoxTagProps): JSX.Element {\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error(\"ComboBoxTag must be used within a ComboBox\");\n }\n\n const state = context.state;\n\n const handleRemove = () => {\n if (props.onRemove) {\n props.onRemove();\n } else {\n state.removeSelectedKey(props.item.key);\n }\n };\n\n return (\n <span\n class={props.class ?? \"solidaria-ComboBox-tag\"}\n style={props.style}\n data-key={String(props.item.key)}\n >\n {props.children ?? props.item.label}\n <button\n type=\"button\"\n aria-label={`Remove ${props.item.label}`}\n onClick={handleRemove}\n class=\"solidaria-ComboBox-tag-remove\"\n tabIndex={-1}\n >\n ×\n </button>\n </span>\n );\n}\n\nComboBox.Input = ComboBoxInput;\nComboBox.Button = ComboBoxButton;\nComboBox.ListBox = ComboBoxListBox;\nComboBox.Option = ComboBoxOption;\nComboBox.Label = ComboBoxLabel;\nComboBox.Description = ComboBoxDescription;\nComboBox.ErrorMessage = ComboBoxErrorMessage;\nComboBox.TagGroup = ComboBoxTagGroup;\nComboBox.Tag = ComboBoxTag;\n\nexport { defaultContainsFilter };\n\nfunction createComboBoxListStateAdapter<T>(state: ComboBoxState<T>): ListState<T> {\n const selectedKeys = createMemo(() => {\n if (state.selectionMode() === \"multiple\") {\n return state.selectedKeys();\n }\n const key = state.selectedKey();\n return key != null ? new Set<Key>([key]) : new Set<Key>();\n });\n\n const disabledKeys = createMemo(() => {\n const keys = new Set<Key>();\n for (const node of state.collection()) {\n if (node.isDisabled) keys.add(node.key);\n }\n return keys;\n });\n\n return {\n collection: state.collection,\n isFocused: state.isFocused,\n setFocused: state.setFocused,\n focusedKey: state.focusedKey,\n setFocusedKey: (key) => state.setFocusedKey(key ?? null),\n childFocusStrategy: () => null,\n selectionMode: state.selectionMode,\n selectionBehavior: () => \"replace\",\n disallowEmptySelection: () => true,\n selectedKeys,\n disabledKeys,\n disabledBehavior: () => \"all\",\n isEmpty: () => selectedKeys().size === 0,\n isSelectAll: () => false,\n isSelected: state.isSelected,\n isDisabled: state.isKeyDisabled,\n setSelectionBehavior: () => {},\n toggleSelection: (key) => state.select(key),\n replaceSelection: (key) => state.select(key),\n setSelectedKeys: (keys) => {\n const first = keys[Symbol.iterator]().next().value as Key | undefined;\n state.setSelectedKey(first ?? null);\n },\n selectAll: () => {},\n clearSelection: () => state.setSelectedKey(null),\n toggleSelectAll: () => {},\n extendSelection: (toKey) => state.select(toKey),\n select: (key) => state.select(key),\n };\n}\n","/**\n * Dialog component for solidaria-components\n *\n * A headless dialog component that combines ARIA hooks.\n * Port of react-aria-components Dialog.\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createUniqueId,\n splitProps,\n useContext,\n Switch,\n Match,\n} from \"solid-js\";\nimport {\n createDialog,\n createOverlayTrigger,\n focusSafely,\n type AriaDialogProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createOverlayTriggerState,\n type OverlayTriggerState,\n} from \"@proyecto-viviana/solid-stately\";\nimport { DialogTriggerContext, useOverlayTriggerState } from \"./contexts\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface DialogRenderProps {\n /** Function to close the dialog */\n close: () => void;\n}\n\nexport interface DialogProps extends Omit<AriaDialogProps, \"class\" | \"style\">, SlotProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<DialogRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DialogRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DialogRenderProps>;\n /** Callback when dialog should close */\n onClose?: () => void;\n}\n\nexport interface DialogTriggerProps {\n /** The children - should include a trigger and modal/popover content. */\n children: JSX.Element;\n /** Whether the dialog is open (controlled). */\n isOpen?: boolean;\n /** Whether the dialog is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Callback when open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\ninterface DialogContextValue {\n close: () => void;\n titleId?: string;\n}\n\nexport const DialogContext = createContext<DialogContextValue | null>(null);\n\nexport { DialogTriggerContext, useDialogTrigger } from \"./contexts\";\n\n/**\n * A DialogTrigger opens a dialog when a trigger element is pressed.\n * Children should include a trigger element (e.g. Button) and the dialog content.\n */\nexport function DialogTrigger(props: DialogTriggerProps): JSX.Element {\n const [local] = splitProps(props, [\"isOpen\", \"defaultOpen\", \"onOpenChange\"]);\n\n const state = createOverlayTriggerState({\n get isOpen() {\n return local.isOpen;\n },\n get defaultOpen() {\n return local.defaultOpen;\n },\n onOpenChange: local.onOpenChange,\n });\n\n let triggerRef: HTMLElement | null = null;\n const triggerId = createUniqueId();\n\n // Create overlay trigger props so registered trigger components can expose\n // the same expanded/controls relationship as React Aria DialogTrigger.\n const triggerAria = createOverlayTrigger({ type: \"dialog\" }, state, () => triggerRef);\n\n const restoreFocusToTrigger = () => {\n const trigger = triggerRef;\n if (!trigger?.isConnected) return;\n\n const win = trigger.ownerDocument.defaultView ?? window;\n win.requestAnimationFrame(() => {\n win.requestAnimationFrame(() => {\n if (trigger.isConnected && !state.isOpen()) {\n focusSafely(trigger);\n }\n });\n });\n };\n\n const stateWithFocusRestore: OverlayTriggerState = {\n isOpen: state.isOpen,\n setOpen: (isOpen) => {\n state.setOpen(isOpen);\n if (!isOpen) {\n restoreFocusToTrigger();\n }\n },\n open: state.open,\n close: () => {\n state.close();\n restoreFocusToTrigger();\n },\n toggle: () => {\n const wasOpen = state.isOpen();\n state.toggle();\n if (wasOpen) {\n restoreFocusToTrigger();\n }\n },\n };\n\n const setTriggerRef = (el: HTMLElement | null) => {\n if (!el) return;\n if (!triggerRef || !triggerRef.isConnected) {\n triggerRef = el;\n }\n };\n\n // Context value - memoized to avoid unnecessary re-renders\n const contextValue = createMemo(() => ({\n state: stateWithFocusRestore,\n triggerRef: () => triggerRef,\n setTriggerRef,\n triggerId,\n triggerProps: triggerAria.triggerProps,\n overlayProps: triggerAria.overlayProps,\n }));\n\n // In SolidJS, we simply render children directly within the provider\n return (\n <DialogTriggerContext.Provider value={contextValue()}>\n {props.children}\n </DialogTriggerContext.Provider>\n );\n}\n\n/**\n * A dialog is an overlay shown above other content in an application.\n */\nexport function Dialog(props: DialogProps): JSX.Element {\n const [local, ariaProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"onClose\"],\n [\"role\", \"aria-label\", \"aria-labelledby\", \"aria-describedby\"],\n );\n\n let dialogRef!: HTMLDivElement;\n\n // Get trigger context for aria-labelledby fallback\n const triggerContext = useContext(DialogTriggerContext);\n\n // createDialog returns dialogProps AND titleProps (with the id for the Heading)\n const { dialogProps, titleProps } = createDialog(\n {\n get role() {\n return ariaProps.role;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n },\n () => dialogRef,\n );\n\n // Get titleId from titleProps - this links Dialog's aria-labelledby to Heading's id\n const titleId = () => titleProps()?.id as string | undefined;\n\n // Get close function from OverlayTriggerState context or onClose prop\n const overlayState = useOverlayTriggerState();\n\n const close = () => {\n local.onClose?.();\n if (overlayState) {\n overlayState.close();\n return;\n }\n triggerContext?.state.close();\n };\n\n createEffect(() => {\n if (!dialogRef || ariaProps[\"aria-label\"] || ariaProps[\"aria-labelledby\"]) return;\n const labelledBy = dialogRef.getAttribute(\"aria-labelledby\");\n if (labelledBy && dialogRef.ownerDocument.getElementById(labelledBy)) return;\n\n const trigger = triggerContext?.triggerRef();\n if (trigger?.id) {\n dialogRef.setAttribute(\"aria-labelledby\", trigger.id);\n }\n });\n\n const renderValues = createMemo<DialogRenderProps>(() => ({\n close,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Dialog\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n return (\n <DialogContext.Provider value={{ close, titleId: titleId() }}>\n <div\n {...dialogProps()}\n {...domProps()}\n ref={dialogRef}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n >\n {renderProps.renderChildren()}\n </div>\n </DialogContext.Provider>\n );\n}\n\nexport interface HeadingProps {\n /** The children of the heading. */\n children: JSX.Element;\n /** The CSS className. */\n class?: string;\n /** The heading level (1-6). Defaults to 2. */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n /** The slot to render into. */\n slot?: string;\n}\n\n/**\n * Heading element for dialog title.\n * When rendered inside a Dialog, automatically gets the titleProps.\n */\nexport function Heading(props: HeadingProps): JSX.Element {\n const dialogContext = useContext(DialogContext);\n const level = () => props.level ?? 2;\n const id = () => dialogContext?.titleId;\n let headingRef: HTMLHeadingElement | undefined;\n\n createEffect(() => {\n const el = headingRef;\n if (!el) return;\n\n const contextId = id();\n if (contextId) {\n el.id = contextId;\n return;\n }\n\n if (!el.id) {\n const dialog = el.closest('[role=\"dialog\"],[role=\"alertdialog\"]');\n const labelledBy = dialog?.getAttribute(\"aria-labelledby\");\n if (labelledBy && !el.ownerDocument.getElementById(labelledBy)) {\n el.id = labelledBy;\n }\n }\n });\n\n return (\n <Switch>\n <Match when={level() === 1}>\n <h1 ref={headingRef} id={id()} class={props.class}>\n {props.children}\n </h1>\n </Match>\n <Match when={level() === 2}>\n <h2 ref={headingRef} id={id()} class={props.class}>\n {props.children}\n </h2>\n </Match>\n <Match when={level() === 3}>\n <h3 ref={headingRef} id={id()} class={props.class}>\n {props.children}\n </h3>\n </Match>\n <Match when={level() === 4}>\n <h4 ref={headingRef} id={id()} class={props.class}>\n {props.children}\n </h4>\n </Match>\n <Match when={level() === 5}>\n <h5 ref={headingRef} id={id()} class={props.class}>\n {props.children}\n </h5>\n </Match>\n <Match when={level() === 6}>\n <h6 ref={headingRef} id={id()} class={props.class}>\n {props.children}\n </h6>\n </Match>\n </Switch>\n );\n}\n\n// Keep backward compatibility\nexport { Heading as DialogHeading };\n","/**\n * Modal and ModalOverlay components for solidaria-components\n *\n * Headless modal components with overlay, focus trapping, and dismissal handling.\n * Port of react-aria-components Modal.\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n createSignal,\n createEffect,\n onCleanup,\n splitProps,\n Show,\n useContext,\n} from \"solid-js\";\nimport { Portal, isServer } from \"solid-js/web\";\nimport {\n createInteractOutside,\n ariaHideOutside,\n FocusScope,\n useUNSAFE_PortalContext,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport {\n DialogTriggerContext,\n OverlayTriggerStateContext,\n type OverlayTriggerState,\n} from \"./contexts\";\n\n/**\n * Internal context to signal that Modal is wrapped in ModalOverlay.\n * When present, Modal should not create its own Portal.\n */\ninterface InternalModalContextValue {\n isDismissable?: boolean;\n isKeyboardDismissDisabled?: boolean;\n}\n\nconst InternalModalContext = createContext<InternalModalContextValue | null>(null);\n\n// Stack of visible modals, used to ensure only the top-most modal dismisses on Escape/outside interaction.\nconst visibleModals: Array<() => Element | null> = [];\n\nfunction pruneDisconnectedModals() {\n for (let index = visibleModals.length - 1; index >= 0; index -= 1) {\n const element = visibleModals[index]?.();\n if (!element?.isConnected) {\n visibleModals.splice(index, 1);\n }\n }\n}\n\nexport interface ModalRenderProps {\n /** Whether the modal is currently entering (for animations). */\n isEntering: boolean;\n /** Whether the modal is currently exiting (for animations). */\n isExiting: boolean;\n}\n\nexport interface ModalOverlayProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ModalRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ModalRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ModalRenderProps>;\n /** Whether the modal is open (controlled). */\n isOpen?: boolean;\n /** Whether the modal opens by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the modal's open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Whether clicking outside the modal closes it. */\n isDismissable?: boolean;\n /** Whether pressing Escape closes the modal. */\n isKeyboardDismissDisabled?: boolean;\n /** Whether the modal is entering (for animations). */\n isEntering?: boolean;\n /** Whether the modal is exiting (for animations). */\n isExiting?: boolean;\n}\n\nexport interface ModalProps extends ModalOverlayProps {}\n\nexport { OverlayTriggerStateContext, type OverlayTriggerState } from \"./contexts\";\nexport { useOverlayTriggerState } from \"./contexts\";\nexport const ModalContext = OverlayTriggerStateContext;\n\n/**\n * ModalOverlay is the backdrop/underlay behind a modal.\n * It handles click-outside dismissal and provides styling hooks.\n */\nexport function ModalOverlay(props: ModalOverlayProps): JSX.Element {\n // Do NOT early-return on the server: rendering children bare on the server and a\n // <Show>/<Portal> overlay on the client desyncs hydration. Run the same structure\n // on both and gate the Portal on useIsHydrated() (see Popover for the rationale).\n const isHydrated = useIsHydrated();\n\n // IMPORTANT: Don't destructure or access props.children early!\n // In SolidJS, children are lazily evaluated. Accessing them before\n // the context provider renders causes them to evaluate outside the context.\n // See: https://github.com/solidjs/solid/issues/182\n const [local, rest] = splitProps(props, [\n \"class\",\n \"style\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"isDismissable\",\n \"isKeyboardDismissDisabled\",\n \"isEntering\",\n \"isExiting\",\n ]);\n\n // Get state from DialogTrigger context if available\n const dialogTriggerContext = useContext(DialogTriggerContext);\n\n // Internal state for uncontrolled mode\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n\n // Determine if open (controlled > DialogTrigger context > uncontrolled)\n const isOpen = (): boolean => {\n if (local.isOpen !== undefined) return local.isOpen;\n if (dialogTriggerContext) return dialogTriggerContext.state.isOpen();\n return internalOpen();\n };\n\n const close = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(false);\n } else if (dialogTriggerContext) {\n dialogTriggerContext.state.close();\n local.onOpenChange?.(false);\n } else {\n setInternalOpen(false);\n local.onOpenChange?.(false);\n }\n };\n\n const open = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(true);\n } else if (dialogTriggerContext) {\n dialogTriggerContext.state.open();\n local.onOpenChange?.(true);\n } else {\n setInternalOpen(true);\n local.onOpenChange?.(true);\n }\n };\n\n const toggle = () => {\n if (isOpen()) {\n close();\n } else {\n open();\n }\n };\n\n const state: OverlayTriggerState = {\n get isOpen() {\n return isOpen();\n },\n open,\n close,\n toggle,\n };\n\n const renderValues = createMemo<ModalRenderProps>(() => ({\n isEntering: local.isEntering ?? false,\n isExiting: local.isExiting ?? false,\n }));\n\n // Resolve render props - don't pass children, we'll render props.children directly\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ModalOverlay\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n // Internal context value to signal Modal that it's wrapped\n const internalModalContext: InternalModalContextValue = {\n isDismissable: local.isDismissable,\n isKeyboardDismissDisabled: local.isKeyboardDismissDisabled,\n };\n const portalContext = useUNSAFE_PortalContext();\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n let overlayRef!: HTMLDivElement;\n\n const isTopMostModalInOverlay = () => {\n pruneDisconnectedModals();\n const topMostModal = visibleModals[visibleModals.length - 1]?.();\n return !topMostModal || overlayRef?.contains(topMostModal);\n };\n\n const handleOverlayPointerDown: JSX.EventHandler<HTMLDivElement, PointerEvent> = (event) => {\n if (local.isDismissable && event.target === event.currentTarget && isTopMostModalInOverlay()) {\n close();\n }\n };\n\n createEffect(() => {\n if (!isOpen() || local.isKeyboardDismissDisabled) return;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && !event.isComposing && isTopMostModalInOverlay()) {\n event.preventDefault();\n event.stopPropagation();\n close();\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown, true);\n onCleanup(() => {\n document.removeEventListener(\"keydown\", handleKeyDown, true);\n });\n });\n\n // Resolve children - handle both static JSX and render functions\n // IMPORTANT: We access props.children directly (not local.children) to preserve\n // lazy evaluation inside context providers\n const resolveChildren = () => {\n const children = props.children;\n if (typeof children === \"function\") {\n return (children as (props: ModalRenderProps) => JSX.Element)(renderValues());\n }\n return children;\n };\n\n return (\n <Show when={isHydrated() && (isOpen() || local.isExiting)}>\n <Portal mount={portalContainer()}>\n <OverlayTriggerStateContext.Provider value={state}>\n <InternalModalContext.Provider value={internalModalContext}>\n <div\n {...domProps()}\n ref={overlayRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(local.isEntering)}\n data-exiting={dataAttr(local.isExiting)}\n onPointerDown={handleOverlayPointerDown}\n >\n {resolveChildren()}\n </div>\n </InternalModalContext.Provider>\n </OverlayTriggerStateContext.Provider>\n </Portal>\n </Show>\n );\n}\n\n/**\n * Modal is a dialog container that manages focus trapping, scroll prevention,\n * aria-hiding of content outside, and dismissal.\n *\n * Usage patterns:\n * 1. Standalone: `<Modal isOpen>...</Modal>` - Creates its own overlay\n * 2. With custom overlay: `<ModalOverlay><Modal>...</Modal></ModalOverlay>`\n *\n * Note: Due to SolidJS's eager JSX evaluation, we cannot detect at render time\n * whether Modal is wrapped in ModalOverlay. So standalone Modal always creates\n * an overlay, and wrapped Modal renders directly (relying on InternalModalContext).\n */\nexport function Modal(props: ModalProps): JSX.Element {\n // Check for InternalModalContext which signals we're inside a rendered ModalOverlay\n // This works because ModalContent is rendered INSIDE ModalOverlay's Show/Portal\n return <ModalContentWithAutoOverlay {...props} />;\n}\n\n/**\n * Helper component that handles the overlay detection.\n * By being a separate component, we can use Show to defer rendering until\n * the parent context is available.\n */\nfunction ModalContentWithAutoOverlay(props: ModalProps): JSX.Element {\n const [overlayProps, modalProps] = splitProps(props, [\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"isDismissable\",\n \"isKeyboardDismissDisabled\",\n \"isEntering\",\n \"isExiting\",\n ]);\n\n // Check for InternalModalContext - if present, we're inside a ModalOverlay\n const internalContext = useContext(InternalModalContext);\n\n // If wrapped in ModalOverlay, just render the content\n if (internalContext) {\n return (\n <ModalContent {...modalProps} internalContext={internalContext}>\n {props.children}\n </ModalContent>\n );\n }\n\n // For standalone usage, wrap in ModalOverlay\n const standaloneContext: InternalModalContextValue = {\n isDismissable: overlayProps.isDismissable,\n isKeyboardDismissDisabled: overlayProps.isKeyboardDismissDisabled,\n };\n\n return (\n <ModalOverlay {...overlayProps}>\n <ModalContent {...modalProps} internalContext={standaloneContext}>\n {props.children}\n </ModalContent>\n </ModalOverlay>\n );\n}\n\n/**\n * Internal component that renders the actual modal content.\n * Used by both standalone Modal and Modal wrapped in ModalOverlay.\n */\nfunction ModalContent(\n props: ModalProps & { internalContext: InternalModalContextValue },\n): JSX.Element {\n if (isServer) {\n return <>{props.children}</>;\n }\n\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"isDismissable\",\n \"isKeyboardDismissDisabled\",\n \"isEntering\",\n \"isExiting\",\n \"internalContext\",\n ]);\n\n let modalRef!: HTMLDivElement;\n const modalRefAccessor = () => modalRef ?? null;\n\n // Get state from parent OverlayTriggerStateContext (provided by ModalOverlay)\n const parentState = useContext(OverlayTriggerStateContext);\n\n // Get dismissable settings from internal context (set by ModalOverlay)\n const isDismissable = () => local.internalContext?.isDismissable ?? local.isDismissable;\n const isKeyboardDismissDisabled = () =>\n local.internalContext?.isKeyboardDismissDisabled ?? local.isKeyboardDismissDisabled;\n\n // Determine if open from parent state\n const isOpen = (): boolean => {\n if (local.isOpen !== undefined) return local.isOpen;\n return parentState?.isOpen ?? false;\n };\n\n // Keep this modal in a global stack so nested modals dismiss in top-down order.\n createEffect(() => {\n if (!isOpen()) return;\n\n pruneDisconnectedModals();\n if (!visibleModals.includes(modalRefAccessor)) {\n visibleModals.push(modalRefAccessor);\n }\n\n onCleanup(() => {\n const index = visibleModals.indexOf(modalRefAccessor);\n if (index >= 0) {\n visibleModals.splice(index, 1);\n }\n });\n });\n\n const isTopMostModal = () => {\n pruneDisconnectedModals();\n return visibleModals[visibleModals.length - 1] === modalRefAccessor;\n };\n\n const close = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(false);\n } else {\n parentState?.close();\n }\n };\n\n // Prevent scroll when modal is open\n createEffect(() => {\n if (!isOpen()) return;\n\n const html = document.documentElement;\n const prevOverflow = html.style.overflow;\n html.style.overflow = \"hidden\";\n\n onCleanup(() => {\n html.style.overflow = prevOverflow;\n });\n });\n\n // Click outside to close (if dismissable)\n createEffect(() => {\n if (!isOpen() || !isDismissable()) return;\n\n createInteractOutside({\n ref: modalRefAccessor,\n onInteractOutside: () => {\n if (isTopMostModal()) {\n close();\n }\n },\n isDisabled: false,\n });\n });\n\n // Escape key to close\n createEffect(() => {\n if (!isOpen() || isKeyboardDismissDisabled()) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\" && !e.isComposing && isTopMostModal()) {\n e.preventDefault();\n e.stopPropagation();\n close();\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown, true);\n onCleanup(() => {\n document.removeEventListener(\"keydown\", handleKeyDown, true);\n });\n });\n\n // Aria-hide outside content\n createEffect(() => {\n if (!isOpen() || !modalRef) return;\n\n let cleanup: (() => void) | undefined;\n let cancelled = false;\n const ownerWindow = modalRef.ownerDocument.defaultView ?? window;\n\n const hideOutside = () => {\n if (cancelled || !modalRef?.isConnected) return;\n cleanup = ariaHideOutside([modalRef]);\n };\n\n if (modalRef.isConnected) {\n hideOutside();\n } else {\n ownerWindow.queueMicrotask(hideOutside);\n }\n\n onCleanup(() => {\n cancelled = true;\n cleanup?.();\n });\n });\n\n const renderValues = createMemo<ModalRenderProps>(() => ({\n isEntering: local.isEntering ?? false,\n isExiting: local.isExiting ?? false,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Modal\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n return (\n <FocusScope contain restoreFocus autoFocus>\n <div\n {...domProps()}\n ref={modalRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(local.isEntering)}\n data-exiting={dataAttr(local.isExiting)}\n >\n <Show when={isDismissable()}>\n <button\n type=\"button\"\n aria-label=\"Dismiss\"\n tabIndex={-1}\n onClick={close}\n style={{\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: 0,\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n \"white-space\": \"nowrap\",\n border: 0,\n }}\n />\n </Show>\n {renderProps.renderChildren()}\n </div>\n </FocusScope>\n );\n}\n\nexport default Modal;\n","/**\n * Popover component for solidaria-components\n *\n * A headless popover component that positions relative to a trigger element.\n * Port of react-aria-components Popover.\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onCleanup,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport { Portal } from \"solid-js/web\";\nimport {\n createOverlayTrigger,\n createPopover,\n FocusScope,\n useUNSAFE_PortalContext,\n visuallyHiddenStyles,\n type Placement,\n type PlacementAxis,\n} from \"@proyecto-viviana/solidaria\";\nimport { createOverlayTriggerState } from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { DialogTriggerContext, PopoverTriggerContext } from \"./contexts\";\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover.\n */\n trigger: string | null;\n /**\n * The placement of the popover relative to the trigger.\n */\n placement: PlacementAxis | null;\n /**\n * Whether the popover is currently entering (for animations).\n */\n isEntering: boolean;\n /**\n * Whether the popover is currently exiting (for animations).\n */\n isExiting: boolean;\n}\n\nexport interface PopoverProps extends SlotProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<PopoverRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<PopoverRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<PopoverRenderProps>;\n /**\n * The name of the component that triggered the popover.\n */\n trigger?: string;\n /**\n * The ref for the element which the popover positions itself with respect to.\n * Required when used standalone (not within a trigger component).\n */\n triggerRef?: () => Element | null;\n /**\n * The placement of the element with respect to its anchor element.\n * @default 'bottom'\n */\n placement?: Placement;\n /**\n * The placement padding that should be applied between the element and its\n * surrounding container.\n * @default 12\n */\n containerPadding?: number;\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 8\n */\n offset?: number;\n /**\n * The additional offset applied along the cross axis between the element and its\n * anchor element.\n * @default 0\n */\n crossOffset?: number;\n /**\n * Whether the element should flip its orientation when there is insufficient room.\n * @default true\n */\n shouldFlip?: boolean;\n /**\n * The max height of the popover.\n */\n maxHeight?: number;\n /**\n * A boundary element for placement calculations.\n */\n boundaryElement?: Element;\n /**\n * A ref for the popover arrow element.\n */\n arrowRef?: () => Element | null;\n /**\n * A ref for the scrollable popover element.\n */\n scrollRef?: () => Element | null;\n /**\n * Whether the popover is non-modal (allows interaction outside).\n */\n isNonModal?: boolean;\n /**\n * Whether pressing Escape to close should be disabled.\n */\n isKeyboardDismissDisabled?: boolean;\n /**\n * Filter for which outside interactions should close the popover.\n */\n shouldCloseOnInteractOutside?: (element: Element) => boolean;\n /** Whether the popover is open (controlled). */\n isOpen?: boolean;\n /** Whether the popover opens by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the popover's open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /**\n * Whether focus should move to the popover container on open.\n * @default true\n */\n autoFocus?: boolean;\n /** Whether the popover is entering (for animations). */\n isEntering?: boolean;\n /** Whether the popover is exiting (for animations). */\n isExiting?: boolean;\n}\n\nexport interface PopoverTriggerProps {\n /** The children - should include a trigger and popover content. */\n children: JSX.Element;\n /** Whether the popover is open (controlled). */\n isOpen?: boolean;\n /** Whether the popover is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Callback when open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nexport {\n PopoverTriggerContext,\n usePopoverTrigger,\n type PopoverTriggerContextValue,\n} from \"./contexts\";\n\ninterface PopoverContextValue {\n placement: () => PlacementAxis | null;\n arrowProps: () => JSX.HTMLAttributes<HTMLElement>;\n}\n\nexport const PopoverContext = createContext<PopoverContextValue | null>(null);\nconst PopoverGroupContext = createContext<(() => HTMLElement | null) | null>(null);\n\nfunction PopoverDismissButton(props: { onDismiss: () => void }): JSX.Element {\n return (\n <button\n type=\"button\"\n aria-label=\"Dismiss\"\n tabIndex={-1}\n onClick={props.onDismiss}\n style={visuallyHiddenStyles}\n />\n );\n}\n\n/**\n * A PopoverTrigger opens a popover when a trigger element is pressed.\n * Children should include a trigger element (e.g. Button) and the Popover.\n */\nexport function PopoverTrigger(props: PopoverTriggerProps): JSX.Element {\n const [local] = splitProps(props, [\"isOpen\", \"defaultOpen\", \"onOpenChange\"]);\n\n const state = createOverlayTriggerState({\n get isOpen() {\n return local.isOpen;\n },\n get defaultOpen() {\n return local.defaultOpen;\n },\n onOpenChange: local.onOpenChange,\n });\n\n let triggerRef: HTMLElement | null = null;\n const triggerId = createUniqueId();\n\n const triggerAria = createOverlayTrigger({ type: \"dialog\" }, state, () => triggerRef);\n\n const contextValue = createMemo(() => ({\n state: {\n isOpen: () => state.isOpen(),\n open: () => state.open(),\n close: () => state.close(),\n toggle: () => state.toggle(),\n },\n triggerRef: () => triggerRef,\n setTriggerRef: (el: HTMLElement | null) => {\n if (!el) return;\n if (!triggerRef || !triggerRef.isConnected) {\n triggerRef = el;\n }\n },\n triggerId,\n triggerProps: triggerAria.triggerProps,\n overlayProps: triggerAria.overlayProps,\n trigger: \"PopoverTrigger\",\n }));\n\n return (\n <PopoverTriggerContext.Provider value={contextValue()}>\n {props.children}\n </PopoverTriggerContext.Provider>\n );\n}\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport function Popover(props: PopoverProps): JSX.Element {\n // Note: do NOT early-return on the server. Returning `null` on the server and a\n // full <Show>/<Portal> tree on the client desyncs Solid's hydration walk (the\n // server emits no marker for the <Show>), which surfaces as \"Hydration Mismatch /\n // getNextElement\" in the parent (e.g. Picker). Instead, run the same structure on\n // both and gate the Portal on `useIsHydrated()` so the overlay only mounts on the\n // client after hydration — the server + first client render both produce an empty\n // <Show> marker, so hydration aligns.\n const [local, rest] = splitProps(props, [\n \"class\",\n \"style\",\n \"trigger\",\n \"triggerRef\",\n \"placement\",\n \"containerPadding\",\n \"offset\",\n \"crossOffset\",\n \"shouldFlip\",\n \"maxHeight\",\n \"boundaryElement\",\n \"arrowRef\",\n \"scrollRef\",\n \"isNonModal\",\n \"isKeyboardDismissDisabled\",\n \"shouldCloseOnInteractOutside\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"autoFocus\",\n \"isEntering\",\n \"isExiting\",\n ]);\n\n let popoverRef!: HTMLDivElement;\n const [groupRef, setGroupRef] = createSignal<HTMLDivElement | null>(null);\n // False on the server and during hydration; true after onMount. Gates the Portal\n // so overlay content only ever renders client-side, post-hydration.\n const isHydrated = useIsHydrated();\n\n const triggerContext = useContext(PopoverTriggerContext);\n const dialogTriggerContext = useContext(DialogTriggerContext);\n const popoverGroupContext = useContext(PopoverGroupContext);\n const resolvedTrigger = () =>\n local.trigger ??\n triggerContext?.trigger ??\n (dialogTriggerContext ? \"DialogTrigger\" : undefined);\n const isSubPopover = () => resolvedTrigger() === \"SubmenuTrigger\" && popoverGroupContext != null;\n\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n\n const isOpen = (): boolean => {\n if (local.isOpen !== undefined) return local.isOpen;\n if (triggerContext) {\n return triggerContext.state.isOpen();\n }\n if (dialogTriggerContext) {\n return dialogTriggerContext.state.isOpen();\n }\n return internalOpen();\n };\n\n const close = () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(false);\n } else if (triggerContext) {\n triggerContext.state.close();\n local.onOpenChange?.(false);\n } else if (dialogTriggerContext) {\n dialogTriggerContext.state.close();\n local.onOpenChange?.(false);\n } else {\n setInternalOpen(false);\n local.onOpenChange?.(false);\n }\n };\n\n const getTriggerRef = () => {\n if (local.triggerRef) return local.triggerRef();\n if (triggerContext) return triggerContext.triggerRef();\n if (dialogTriggerContext) return dialogTriggerContext.triggerRef();\n return null;\n };\n\n const popoverAria = createPopover(\n {\n triggerRef: getTriggerRef,\n popoverRef: () => popoverRef ?? null,\n groupRef: () => (isSubPopover() ? (popoverGroupContext?.() ?? null) : groupRef()),\n get placement() {\n return local.placement;\n },\n get containerPadding() {\n return local.containerPadding;\n },\n get offset() {\n return local.offset ?? 8;\n },\n get crossOffset() {\n return local.crossOffset;\n },\n get shouldFlip() {\n return local.shouldFlip;\n },\n get maxHeight() {\n return local.maxHeight;\n },\n get boundaryElement() {\n return local.boundaryElement;\n },\n get arrowRef() {\n return local.arrowRef;\n },\n get scrollRef() {\n return local.scrollRef;\n },\n get isNonModal() {\n return local.isNonModal;\n },\n get isKeyboardDismissDisabled() {\n return local.isKeyboardDismissDisabled;\n },\n get shouldCloseOnInteractOutside() {\n return local.shouldCloseOnInteractOutside;\n },\n get trigger() {\n return resolvedTrigger();\n },\n },\n {\n isOpen,\n open: () => {\n if (local.isOpen !== undefined) {\n local.onOpenChange?.(true);\n } else if (triggerContext) {\n triggerContext.state.open();\n local.onOpenChange?.(true);\n } else if (dialogTriggerContext) {\n dialogTriggerContext.state.open();\n local.onOpenChange?.(true);\n } else {\n setInternalOpen(true);\n local.onOpenChange?.(true);\n }\n },\n close,\n toggle: () => {\n if (isOpen()) close();\n else if (local.isOpen !== undefined) {\n local.onOpenChange?.(true);\n } else if (triggerContext) {\n triggerContext.state.toggle();\n } else if (dialogTriggerContext) {\n dialogTriggerContext.state.toggle();\n } else {\n setInternalOpen(true);\n local.onOpenChange?.(true);\n }\n },\n },\n );\n\n const renderValues = createMemo<PopoverRenderProps>(() => ({\n trigger: resolvedTrigger() ?? null,\n placement: popoverAria.placement(),\n isEntering: local.isEntering ?? false,\n isExiting: local.isExiting ?? false,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Popover\",\n },\n renderValues,\n );\n\n const [triggerWidth, setTriggerWidth] = createSignal<string | undefined>();\n const hasExplicitTriggerWidth = () => {\n const style = renderProps.style() as (JSX.CSSProperties & Record<string, unknown>) | undefined;\n return style?.[\"--trigger-width\"] != null;\n };\n const updateTriggerWidth = () => {\n const trigger = getTriggerRef();\n if (!trigger || hasExplicitTriggerWidth()) return;\n setTriggerWidth(`${trigger.getBoundingClientRect().width}px`);\n };\n createEffect(() => {\n if (!isOpen()) return;\n updateTriggerWidth();\n\n const trigger = getTriggerRef();\n if (!trigger || hasExplicitTriggerWidth() || typeof ResizeObserver === \"undefined\") return;\n\n const observer = new ResizeObserver(updateTriggerWidth);\n observer.observe(trigger);\n onCleanup(() => observer.disconnect());\n });\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n const overlayId = () => {\n const restId = (rest as Record<string, unknown>).id as string | undefined;\n return (\n restId ??\n (triggerContext?.overlayProps?.id as string | undefined) ??\n (dialogTriggerContext?.overlayProps?.id as string | undefined)\n );\n };\n\n const cleanPopoverProps = () => {\n const {\n style: _style,\n ref: _ref,\n ...remaining\n } = popoverAria.popoverProps as Record<string, unknown>;\n return remaining;\n };\n\n const mergedStyle = (): JSX.CSSProperties => {\n const ariaStyle = (popoverAria.popoverProps as Record<string, unknown>).style as\n | JSX.CSSProperties\n | undefined;\n const renderStyle = (renderProps.style() || {}) as JSX.CSSProperties & Record<string, unknown>;\n return {\n ...ariaStyle,\n ...renderStyle,\n \"--trigger-width\": renderStyle[\"--trigger-width\"] ?? triggerWidth(),\n };\n };\n\n const shouldBeDialog = () => !local.isNonModal || resolvedTrigger() === \"SubmenuTrigger\";\n const portalContext = useUNSAFE_PortalContext();\n const portalContainer = () => {\n if (isSubPopover()) {\n return popoverGroupContext?.() ?? portalContext.getContainer?.() ?? undefined;\n }\n return portalContext.getContainer?.() ?? undefined;\n };\n\n // Match React Aria Components: focus the popover container only when no\n // descendant has already moved focus during mount.\n createEffect(() => {\n if (!isOpen() || !shouldBeDialog()) return;\n if ((local.autoFocus ?? true) === false) return;\n if (!popoverRef) return;\n if (resolvedTrigger() === \"SubmenuTrigger\") return;\n\n let timeout: number | undefined;\n let frame: number | undefined;\n\n const focusIfNeeded = () => {\n if (!isOpen() || !shouldBeDialog()) return;\n if (!popoverRef || resolvedTrigger() === \"SubmenuTrigger\") return;\n if (document.activeElement === popoverRef || popoverRef.contains(document.activeElement)) {\n return;\n }\n popoverRef.focus();\n };\n\n const scheduleFocus = () => {\n timeout = window.setTimeout(focusIfNeeded, 0);\n };\n\n if (typeof window.requestAnimationFrame === \"function\") {\n frame = window.requestAnimationFrame(scheduleFocus);\n } else {\n scheduleFocus();\n }\n\n onCleanup(() => {\n if (frame !== undefined) {\n window.cancelAnimationFrame(frame);\n }\n if (timeout !== undefined) {\n window.clearTimeout(timeout);\n }\n });\n });\n\n // Fallback Escape handling for environments where focus is not moved into the popover.\n createEffect(() => {\n if (!isOpen()) return;\n if (local.isKeyboardDismissDisabled) return;\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n if (event.defaultPrevented) return;\n close();\n };\n\n document.addEventListener(\"keydown\", onKeyDown);\n onCleanup(() => document.removeEventListener(\"keydown\", onKeyDown));\n });\n\n const overlay = () => (\n <PopoverContext.Provider\n value={{ placement: popoverAria.placement, arrowProps: () => popoverAria.arrowProps }}\n >\n <FocusScope contain={shouldBeDialog()} restoreFocus>\n <div\n {...domProps()}\n {...cleanPopoverProps()}\n ref={popoverRef}\n id={overlayId()}\n role={shouldBeDialog() ? \"dialog\" : undefined}\n tabIndex={shouldBeDialog() ? -1 : undefined}\n class={renderProps.class()}\n style={mergedStyle()}\n data-trigger={resolvedTrigger()}\n data-placement={popoverAria.placement()}\n data-entering={dataAttr(local.isEntering)}\n data-exiting={dataAttr(local.isExiting)}\n >\n <Show when={!local.isNonModal}>\n <PopoverDismissButton onDismiss={close} />\n </Show>\n {renderProps.renderChildren()}\n <PopoverDismissButton onDismiss={close} />\n </div>\n </FocusScope>\n </PopoverContext.Provider>\n );\n\n const underlay = () => (\n <div\n data-testid=\"underlay\"\n {...(popoverAria.underlayProps as unknown as JSX.HTMLAttributes<HTMLDivElement>)}\n style={{ position: \"fixed\", inset: 0 }}\n />\n );\n\n return (\n <Show when={isHydrated() && (isOpen() || local.isExiting)}>\n <Portal mount={portalContainer()}>\n <Show when={!local.isNonModal && !isSubPopover() && isOpen()}>{underlay()}</Show>\n <Show\n when={isSubPopover()}\n fallback={\n <div ref={setGroupRef} style={{ display: \"contents\" }}>\n <PopoverGroupContext.Provider value={() => groupRef()}>\n {overlay()}\n </PopoverGroupContext.Provider>\n </div>\n }\n >\n {overlay()}\n </Show>\n </Portal>\n </Show>\n );\n}\n\nexport interface OverlayArrowProps {\n /** The children - should be an SVG or element for the arrow. */\n children?: JSX.Element;\n /** Render function used when Solid children accessors would be ambiguous. */\n render?: () => JSX.Element;\n /** The CSS className. */\n class?: string;\n /** The inline style. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * An arrow element that points towards the trigger.\n */\nexport function OverlayArrow(props: OverlayArrowProps): JSX.Element {\n const popoverContext = useContext(PopoverContext);\n const placement = () => popoverContext?.placement() ?? null;\n\n const mergedStyle = () => {\n const contextStyle = (popoverContext?.arrowProps() as Record<string, unknown> | undefined)\n ?.style as (JSX.CSSProperties & Record<string, unknown>) | undefined;\n const style: JSX.CSSProperties = {};\n if (typeof contextStyle?.left === \"string\") {\n style.left = contextStyle.left;\n }\n if (typeof contextStyle?.top === \"string\") {\n style.top = contextStyle.top;\n }\n\n const localStyle =\n props.style &&\n !(typeof CSSStyleDeclaration !== \"undefined\" && props.style instanceof CSSStyleDeclaration)\n ? props.style\n : undefined;\n\n return {\n ...style,\n ...localStyle,\n };\n };\n\n return (\n <div\n class={props.class}\n style={mergedStyle()}\n data-placement={placement()}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {props.render ? props.render() : props.children}\n </div>\n );\n}\n\nexport default Popover;\n","/**\n * Toast components for solidaria-components\n *\n * Toast notifications with auto-dismiss, pause on hover/focus, and accessibility.\n * Port of react-aria-components Toast.\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createEffect,\n createSignal,\n onCleanup,\n splitProps,\n Show,\n useContext,\n} from \"solid-js\";\nimport { Portal } from \"solid-js/web\";\nimport {\n type ToastState,\n type QueuedToast,\n type ToastQueueOptions,\n type ToastOptions,\n ToastQueue,\n createToastState,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n createToast,\n createToastRegion,\n useUNSAFE_PortalContext,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n useRenderProps,\n filterDOMProps,\n useIsHydrated,\n} from \"./utils\";\n\nexport interface ToastContent {\n /** DOM id for the toast root when content is queued through Spectrum ToastQueue. */\n id?: string;\n /** Data attributes for the toast root when content is queued through Spectrum ToastQueue. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** Spectrum Toast message content. */\n children?: string;\n /** The title of the toast. */\n title?: string;\n /** The description/body of the toast. */\n description?: string;\n /** Spectrum variant. */\n variant?: \"info\" | \"positive\" | \"negative\" | \"neutral\";\n /** Backward-compatible type/variant of the toast. */\n type?: \"info\" | \"success\" | \"warning\" | \"error\" | \"positive\" | \"negative\" | \"neutral\";\n /** Spectrum action button label. */\n actionLabel?: string;\n /** Handler called when the Spectrum action button is pressed. */\n onAction?: () => void;\n /** Whether the toast should close when the Spectrum action is performed. */\n shouldCloseOnAction?: boolean;\n /** Custom action button. */\n action?: {\n label: string;\n onAction: () => void;\n };\n}\n\nexport interface ToastRenderProps {\n /** Whether the toast is currently animating in. */\n isEntering: boolean;\n /** Whether the toast is currently animating out. */\n isExiting: boolean;\n /** The animation state (entering, exiting, queued). */\n animation: \"entering\" | \"exiting\" | \"queued\" | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n}\n\nexport interface ToastRegionRenderProps {\n /** The visible toasts. */\n visibleToasts: Accessor<QueuedToast<ToastContent>[]>;\n}\n\nexport interface ToastRegionProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRegionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRegionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRegionRenderProps>;\n /** The toast state to display. If not provided, uses ToastContext. */\n state?: ToastState<ToastContent>;\n /** Accessible label for the region. */\n \"aria-label\"?: string;\n /** Whether to render in a portal. */\n portal?: boolean;\n /** Placement of the toast region. */\n placement?:\n | \"top\"\n | \"top start\"\n | \"top end\"\n | \"top-start\"\n | \"top-end\"\n | \"bottom\"\n | \"bottom start\"\n | \"bottom end\"\n | \"bottom-start\"\n | \"bottom-end\";\n}\n\nexport interface ToastProps {\n /** DOM id for the toast root. */\n id?: string;\n /** Data attributes for the toast root. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRenderProps>;\n}\n\nexport const ToastContext = createContext<ToastState<ToastContent> | null>(null);\n\ninterface ToastAriaContextValue {\n titleProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\nconst ToastAriaContext = createContext<ToastAriaContextValue | null>(null);\nconst toastStateByKey = new Map<string, ToastState<ToastContent>>();\n\nexport function useToastContext(): ToastState<ToastContent> {\n const context = useContext(ToastContext);\n if (!context) {\n throw new Error(\"Toast components must be used within a ToastProvider\");\n }\n return context;\n}\n\n/** Default global toast queue that can be used for app-wide toasts. */\nexport const globalToastQueue = new ToastQueue<ToastContent>({\n maxVisibleToasts: Infinity,\n hasExitAnimation: true,\n});\n\n/**\n * Add a toast to the global queue.\n * Convenience function for adding toasts from anywhere in the app.\n */\nexport function addToast(content: ToastContent, options?: ToastOptions): string {\n return globalToastQueue.add(content, options);\n}\n\nfunction normalizeToastPlacement(placement?: ToastRegionProps[\"placement\"]) {\n return (placement ?? \"bottom\").replace(\"-\", \" \") as NonNullable<ToastRegionProps[\"placement\"]>;\n}\n\nexport interface ToastProviderProps {\n /** The children of the provider. */\n children: JSX.Element;\n /** Custom toast queue options. */\n queueOptions?: ToastQueueOptions;\n /** Use global queue instead of creating a new one. */\n useGlobalQueue?: boolean;\n}\n\n/**\n * ToastProvider creates a toast queue context for descendant components.\n * Use this to wrap your app or a section that needs toast notifications.\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * <ToastRegion />\n * </ToastProvider>\n * ```\n */\nexport function ToastProvider(props: ToastProviderProps): JSX.Element {\n const queue = props.useGlobalQueue\n ? globalToastQueue\n : new ToastQueue<ToastContent>(props.queueOptions);\n\n const state = createToastState({ queue });\n\n return <ToastContext.Provider value={state}>{props.children}</ToastContext.Provider>;\n}\n\n/**\n * ToastRegion is a container that displays all visible toasts.\n * It handles pause on hover/focus and provides the landmark region.\n *\n * @example\n * ```tsx\n * <ToastRegion placement=\"bottom-end\">\n * {(renderProps) => (\n * <For each={renderProps.visibleToasts}>\n * {(toast) => <Toast toast={toast} />}\n * </For>\n * )}\n * </ToastRegion>\n * ```\n */\nexport function ToastRegion(props: ToastRegionProps): JSX.Element {\n // Do NOT early-return on the server: returning null on the server and a <Show>\n // on the client desyncs hydration when the region is in the SSR tree. Render the\n // same structure on both and gate the Portal on useIsHydrated() (see Popover).\n const isHydrated = useIsHydrated();\n\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"state\",\n \"aria-label\",\n \"portal\",\n \"placement\",\n ]);\n const portalContext = useUNSAFE_PortalContext();\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n const [regionElement, setRegionElement] = createSignal<HTMLElement>();\n\n const contextState = useContext(ToastContext);\n const state = () => local.state ?? contextState;\n\n const regionAria = createToastRegion<ToastContent>({\n state: {\n visibleToasts: () => state()?.visibleToasts() ?? [],\n add: (content, options) => state()?.add(content, options) ?? \"\",\n close: (key) => state()?.close(key),\n remove: (key) => state()?.remove(key),\n clear: () => state()?.clear(),\n pauseAll: () => state()?.pauseAll(),\n resumeAll: () => state()?.resumeAll(),\n },\n ref: regionElement,\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n });\n\n const renderValues = createMemo<ToastRegionRenderProps>(() => ({\n visibleToasts: () => state()?.visibleToasts() ?? [],\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ToastRegion\",\n },\n renderValues,\n );\n const renderedChildren = createMemo(() => renderProps.renderChildren());\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const placementStyles = createMemo<JSX.CSSProperties>(() => {\n const placement = normalizeToastPlacement(local.placement);\n const [edge, align = \"center\"] = placement.split(\" \");\n const base: JSX.CSSProperties = {\n position: \"fixed\",\n \"z-index\": 100001,\n display: \"flex\",\n \"flex-direction\": edge === \"top\" ? \"column\" : \"column-reverse\",\n gap: \"8px\",\n padding: \"16px\",\n \"pointer-events\": \"none\",\n };\n\n if (edge === \"top\") {\n if (align === \"end\") {\n return { ...base, top: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, top: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n top: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n }\n\n if (align === \"end\") {\n return { ...base, bottom: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, bottom: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n bottom: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n });\n\n const normalizedPlacement = () => normalizeToastPlacement(local.placement);\n\n const visibleToasts = () => state()?.visibleToasts() ?? [];\n const hasToasts = () => visibleToasts().length > 0;\n\n const regionContent = () => {\n if (!state()) return null;\n\n // Merge styles - placement styles are base, renderProps.style() overrides\n const mergedStyle = () => {\n const placement = placementStyles();\n const custom = renderProps.style();\n if (!custom) return placement;\n return { ...placement, ...custom } as JSX.CSSProperties;\n };\n\n const { ref: _ref, ...cleanRegionProps } = regionAria.regionProps as Record<string, unknown>;\n\n return (\n <div\n ref={setRegionElement}\n {...domProps()}\n {...cleanRegionProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-placement={normalizedPlacement()}\n >\n {renderedChildren()}\n </div>\n );\n };\n\n return (\n <Show when={isHydrated() && hasToasts()}>\n <Show when={local.portal !== false} fallback={regionContent()}>\n <Portal mount={portalContainer()}>{regionContent()}</Portal>\n </Show>\n </Show>\n );\n}\n\n/**\n * Toast is an individual notification component.\n *\n * @example\n * ```tsx\n * <Toast toast={toast}>\n * {(renderProps) => (\n * <div class={renderProps.isExiting ? 'fade-out' : 'fade-in'}>\n * <h3>{renderProps.toast.content.title}</h3>\n * <p>{renderProps.toast.content.description}</p>\n * </div>\n * )}\n * </Toast>\n * ```\n */\nexport function Toast(props: ToastProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"toast\", \"children\", \"class\", \"style\"]);\n\n let toastRef!: HTMLDivElement;\n\n const state = useToastContext();\n\n createEffect(() => {\n const key = local.toast.key;\n toastStateByKey.set(key, state);\n onCleanup(() => {\n if (toastStateByKey.get(key) === state) {\n toastStateByKey.delete(key);\n }\n });\n });\n\n const hasTitle = () => !!(local.toast.content.children ?? local.toast.content.title);\n const toastAria = createToast({\n toast: local.toast,\n state,\n hasTitle: hasTitle(),\n hasDescription: !!local.toast.content.description,\n });\n\n const renderValues = createMemo<ToastRenderProps>(() => ({\n isEntering: local.toast.animation === \"entering\",\n isExiting: local.toast.animation === \"exiting\",\n animation: local.toast.animation,\n toast: local.toast,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Toast\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const mergedStyle = () => {\n const custom = renderProps.style();\n if (!custom) return { \"pointer-events\": \"auto\" as const };\n return { \"pointer-events\": \"auto\" as const, ...custom } as JSX.CSSProperties;\n };\n\n const handleRootClick = (event: MouseEvent) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n if (target.closest(\"[data-solidaria-toast-close-button]\")) {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n }\n };\n\n // Exit animation lifecycle:\n // When animation becomes 'exiting', wait for CSS animations/transitions to finish,\n // then call state.remove() to finalize removal from the queue.\n // In JSDOM or when no animations are running, remove immediately.\n // Reduced-motion is handled by CSS (shorter/no animations), so the lifecycle\n // naturally completes faster when the user prefers reduced motion.\n createEffect(() => {\n if (local.toast.animation !== \"exiting\") return;\n if (!toastRef) {\n state.remove(local.toast.key);\n return;\n }\n\n // Check if the element supports the Web Animations API\n if (!(\"getAnimations\" in toastRef)) {\n state.remove(local.toast.key);\n return;\n }\n\n const animations = toastRef.getAnimations();\n if (animations.length === 0) {\n // No CSS animations/transitions running - remove immediately\n state.remove(local.toast.key);\n return;\n }\n\n // Wait for all running animations to finish, then remove\n let canceled = false;\n Promise.all(animations.map((a) => a.finished))\n .then(() => {\n if (!canceled) {\n state.remove(local.toast.key);\n }\n })\n .catch(() => {\n // Animation was canceled (e.g. element removed) - still clean up\n if (!canceled) {\n state.remove(local.toast.key);\n }\n });\n\n onCleanup(() => {\n canceled = true;\n });\n });\n\n const { ref: _ref, ...cleanToastProps } = toastAria.toastProps as Record<string, unknown>;\n\n // Ensure ARIA title/description IDs are present on rendered sub-components,\n // even when children are pre-composed outside the Toast provider owner.\n createEffect(() => {\n if (!toastRef) return;\n\n const titleId = (toastAria.titleProps as Record<string, unknown>).id as string | undefined;\n const descriptionId = (toastAria.descriptionProps as Record<string, unknown>).id as\n | string\n | undefined;\n\n if (titleId) {\n const titleEl = toastRef.querySelector(\"[data-solidaria-toast-title]\");\n if (titleEl instanceof HTMLElement) {\n titleEl.id = titleId;\n }\n }\n\n if (descriptionId) {\n const descriptionEl = toastRef.querySelector(\"[data-solidaria-toast-description]\");\n if (descriptionEl instanceof HTMLElement) {\n descriptionEl.id = descriptionId;\n }\n }\n });\n\n return (\n <ToastAriaContext.Provider\n value={{ titleProps: toastAria.titleProps, descriptionProps: toastAria.descriptionProps }}\n >\n <div\n ref={toastRef}\n {...domProps()}\n {...cleanToastProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-animation={local.toast.animation}\n data-type={local.toast.content.type ?? local.toast.content.variant}\n data-variant={local.toast.content.variant}\n on:click={handleRootClick}\n >\n {renderProps.renderChildren()}\n </div>\n </ToastAriaContext.Provider>\n );\n}\n\nexport interface ToastTitleProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastTitle renders the toast title with proper accessibility attributes.\n */\nexport function ToastTitle(props: ToastTitleProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaTitleProps } = (context?.titleProps ?? {}) as Record<string, unknown>;\n\n return (\n <div data-solidaria-toast-title=\"\" {...ariaTitleProps} class={props.class} style={props.style}>\n {props.children}\n </div>\n );\n}\n\nexport interface ToastDescriptionProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastDescription renders the toast description with proper accessibility attributes.\n */\nexport function ToastDescription(props: ToastDescriptionProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaDescriptionProps } = (context?.descriptionProps ?? {}) as Record<\n string,\n unknown\n >;\n\n return (\n <div\n data-solidaria-toast-description=\"\"\n {...ariaDescriptionProps}\n class={props.class}\n style={props.style}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ToastCloseButtonProps {\n /** The toast to close. */\n toast: QueuedToast<ToastContent>;\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n \"aria-label\"?: string;\n}\n\n/**\n * ToastCloseButton is a button that closes the toast.\n */\nexport function ToastCloseButton(props: ToastCloseButtonProps): JSX.Element {\n const contextState = useContext(ToastContext);\n const handleClose = () => {\n const key = props.toast.key;\n const state = contextState ?? toastStateByKey.get(key);\n state?.close(key);\n state?.remove(key);\n };\n\n return (\n <button\n type=\"button\"\n class={props.class}\n style={props.style}\n aria-label={props[\"aria-label\"] ?? \"Close\"}\n data-solidaria-toast-close-button=\"\"\n on:click={handleClose}\n onClick={handleClose}\n >\n {props.children ?? \"×\"}\n </button>\n );\n}\n\nexport interface DefaultToastProps {\n toast: QueuedToast<ToastContent>;\n}\n\n/**\n * DefaultToast provides a basic toast layout with title, description, and close button.\n * Use this as a starting point or as-is for simple toast needs.\n */\nexport function DefaultToast(props: DefaultToastProps): JSX.Element {\n const content = () => props.toast.content;\n const title = () => content().children ?? content().title;\n const actionLabel = () => content().actionLabel ?? content().action?.label;\n const actionHandler = () => content().onAction ?? content().action?.onAction;\n const state = useToastContext();\n const handleAction = () => {\n actionHandler()?.();\n if (content().shouldCloseOnAction) {\n state.close(props.toast.key);\n state.remove(props.toast.key);\n }\n };\n\n return (\n <Toast toast={props.toast}>\n <div style={{ display: \"flex\", \"align-items\": \"flex-start\", gap: \"12px\" }}>\n <div style={{ flex: 1 }}>\n <Show when={title()}>\n <ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>\n </Show>\n <Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>\n <Show when={actionLabel()}>\n <button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>\n </Show>\n </div>\n <ToastCloseButton toast={props.toast} />\n </div>\n </Toast>\n );\n}\n","/**\n * Disclosure and Accordion components for solidaria-components\n *\n * Disclosure is a widget that can be toggled to show or hide content.\n * Accordion (DisclosureGroup) manages multiple disclosures with optional single-expand.\n *\n * Port of react-aria-components Disclosure.\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport {\n createDisclosureState,\n createDisclosureGroupState,\n type DisclosureState,\n type DisclosureGroupState,\n type DisclosureStateProps,\n type DisclosureGroupStateProps,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n createDisclosure,\n createDisclosureGroup,\n createFocusRing,\n mergeProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n} from \"./utils\";\n\ntype RefLike<T> = T | ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n (ref as (el: T) => void)(el);\n } else if (typeof ref === \"object\" && \"current\" in ref) {\n ref.current = el;\n }\n}\n\nexport interface DisclosureRenderProps {\n /** Whether the disclosure is expanded. */\n isExpanded: boolean;\n /** Whether the disclosure has keyboard focus within. */\n isFocusVisibleWithin: boolean;\n /** Whether the disclosure is disabled. */\n isDisabled: boolean;\n /** The disclosure state. */\n state: DisclosureState;\n}\n\nexport interface DisclosureGroupRenderProps {\n /** Whether all items are disabled. */\n isDisabled: boolean;\n}\n\nexport interface DisclosureProps extends DisclosureStateProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DisclosureRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DisclosureRenderProps>;\n /** Whether the disclosure is disabled. */\n isDisabled?: boolean;\n /** A unique identifier for the disclosure (used in groups). */\n id?: string;\n /** A ref for the disclosure root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface DisclosureGroupProps extends DisclosureGroupStateProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DisclosureGroupRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DisclosureGroupRenderProps>;\n /** A ref for the disclosure group root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface DisclosureTriggerProps extends Omit<\n JSX.ButtonHTMLAttributes<HTMLButtonElement>,\n \"children\" | \"class\" | \"style\" | \"type\" | \"ref\"\n> {\n /** The children of the trigger. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** A ref for the trigger button element. */\n ref?: RefLike<HTMLButtonElement>;\n}\n\nexport interface DisclosurePanelProps extends Omit<\n JSX.HTMLAttributes<HTMLElement>,\n \"children\" | \"class\" | \"style\" | \"role\" | \"ref\"\n> {\n /** The children of the panel. */\n children?: RenderChildren<DisclosureRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DisclosureRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DisclosureRenderProps>;\n /** The accessibility role for the disclosure panel. */\n role?: \"group\" | \"region\";\n /** A ref for the panel element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\ninterface DisclosureContextValue {\n state: DisclosureState;\n isDisabled: () => boolean;\n /** The disclosure ARIA result object - access .buttonProps and .panelProps as getters */\n disclosureAria: {\n readonly buttonProps: JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n readonly panelProps: JSX.HTMLAttributes<HTMLElement>;\n readonly isPressed: () => boolean;\n };\n}\n\nexport const DisclosureContext = createContext<DisclosureContextValue | null>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\nexport function useDisclosureContext(): DisclosureContextValue | null {\n return useContext(DisclosureContext);\n}\n\ninterface DisclosureGroupContextValue {\n state: DisclosureGroupState;\n}\n\nexport const DisclosureGroupContext = createContext<DisclosureGroupContextValue | null>(null);\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\nexport function useDisclosureGroupContext(): DisclosureGroupContextValue | null {\n return useContext(DisclosureGroupContext);\n}\n\n/**\n * DisclosureGroup manages a group of Disclosure components.\n * Use this to create an accordion where only one item can be expanded at a time.\n *\n * @example\n * ```tsx\n * <DisclosureGroup>\n * <Disclosure id=\"item1\">\n * <DisclosureTrigger>Item 1</DisclosureTrigger>\n * <DisclosurePanel>Content 1</DisclosurePanel>\n * </Disclosure>\n * <Disclosure id=\"item2\">\n * <DisclosureTrigger>Item 2</DisclosureTrigger>\n * <DisclosurePanel>Content 2</DisclosurePanel>\n * </Disclosure>\n * </DisclosureGroup>\n * ```\n */\nexport function DisclosureGroup(props: DisclosureGroupProps): JSX.Element {\n // IMPORTANT: Don't destructure or access props.children early!\n // In SolidJS, children are lazily evaluated. Accessing them before\n // the context provider renders causes them to evaluate outside the context.\n // See: https://github.com/solidjs/solid/issues/182\n const [local, rest] = splitProps(props, [\n \"class\",\n \"style\",\n \"allowsMultipleExpanded\",\n \"isDisabled\",\n \"expandedKeys\",\n \"defaultExpandedKeys\",\n \"onExpandedChange\",\n \"ref\",\n ]);\n\n // Create group state\n const state = createDisclosureGroupState(() => ({\n allowsMultipleExpanded: local.allowsMultipleExpanded,\n isDisabled: local.isDisabled,\n expandedKeys: local.expandedKeys,\n defaultExpandedKeys: local.defaultExpandedKeys,\n onExpandedChange: local.onExpandedChange,\n }));\n\n // Create group accessibility props\n const { groupProps } = createDisclosureGroup(() => ({ isDisabled: local.isDisabled }), state);\n\n const renderValues = createMemo<DisclosureGroupRenderProps>(() => ({\n isDisabled: state.isDisabled,\n }));\n\n // Resolve render props - don't pass children, we'll render props.children directly\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-DisclosureGroup\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: DisclosureGroupContextValue = { state };\n\n // Extract ref from groupProps to avoid type conflicts\n const { ref: _ref, ...cleanGroupProps } = groupProps as Record<string, unknown>;\n\n return (\n <DisclosureGroupStateContext.Provider value={state}>\n <DisclosureGroupContext.Provider value={contextValue}>\n <div\n ref={(el) => assignRef(local.ref, el)}\n {...domProps()}\n {...cleanGroupProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled)}\n >\n {props.children}\n </div>\n </DisclosureGroupContext.Provider>\n </DisclosureGroupStateContext.Provider>\n );\n}\n\n/**\n * Disclosure is a widget that can be toggled to show or hide content.\n *\n * @example\n * ```tsx\n * <Disclosure>\n * <DisclosureTrigger>Show more</DisclosureTrigger>\n * <DisclosurePanel>Hidden content here...</DisclosurePanel>\n * </Disclosure>\n * ```\n */\nexport function Disclosure(props: DisclosureProps): JSX.Element {\n // IMPORTANT: Don't destructure or access props.children early!\n // In SolidJS, children are lazily evaluated. Accessing them before\n // the context provider renders causes them to evaluate outside the context.\n // See: https://github.com/solidjs/solid/issues/182\n const [local, rest] = splitProps(props, [\n \"class\",\n \"style\",\n \"isDisabled\",\n \"isExpanded\",\n \"defaultExpanded\",\n \"onExpandedChange\",\n \"id\",\n \"ref\",\n ]);\n\n // Check if we're inside a DisclosureGroup\n const groupContext = useDisclosureGroupContext();\n\n // Create disclosure state\n // If in a group, sync with group state\n const state = createDisclosureState(() => {\n const id = local.id;\n if (groupContext && id) {\n return {\n isExpanded: groupContext.state.isExpanded(id),\n onExpandedChange: (expanded: boolean) => {\n if (expanded !== groupContext.state.isExpanded(id)) {\n groupContext.state.toggleKey(id);\n }\n local.onExpandedChange?.(expanded);\n },\n };\n }\n return {\n isExpanded: local.isExpanded,\n defaultExpanded: local.defaultExpanded,\n onExpandedChange: local.onExpandedChange,\n };\n });\n\n // Panel ref as a signal so the createEffect in createDisclosure can track it\n const [panelRef, setPanelRefSignal] = createSignal<HTMLElement | null>(null);\n\n // Determine if disabled (used in multiple places)\n const isDisabled = () => local.isDisabled || groupContext?.state.isDisabled || false;\n\n // Create disclosure accessibility props\n // Pass props as accessor function for reactivity\n // IMPORTANT: Don't destructure! The getters must be called fresh each render\n const disclosureAria = createDisclosure(\n () => ({ isDisabled: isDisabled() }),\n state,\n panelRef, // Pass the accessor directly\n );\n const { isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps } = createFocusRing({\n within: true,\n });\n\n const renderValues = createMemo<DisclosureRenderProps>(() => ({\n isExpanded: state.isExpanded(),\n isFocusVisibleWithin: isFocusVisibleWithin(),\n isDisabled: isDisabled(),\n state,\n }));\n\n // Resolve render props - don't pass children, we'll render props.children directly\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Disclosure\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n // Context value - pass the disclosureAria object with getters intact\n const contextValue: DisclosureContextValue = {\n state,\n isDisabled, // Pass the accessor function, not the value\n disclosureAria,\n };\n\n const setPanelRef = (el: HTMLElement | null) => {\n setPanelRefSignal(el);\n };\n\n return (\n <DisclosureStateContext.Provider value={state}>\n <DisclosureContext.Provider value={contextValue}>\n <DisclosurePanelRefContext.Provider value={setPanelRef}>\n <div\n ref={(el) => assignRef(local.ref, el)}\n {...mergeProps(\n domProps() as Record<string, unknown>,\n focusWithinProps as Record<string, unknown>,\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n data-expanded={dataAttr(state.isExpanded())}\n data-disabled={dataAttr(isDisabled())}\n data-focus-visible-within={dataAttr(isFocusVisibleWithin())}\n >\n {props.children}\n </div>\n </DisclosurePanelRefContext.Provider>\n </DisclosureContext.Provider>\n </DisclosureStateContext.Provider>\n );\n}\n\n// Internal context to pass panel ref setter\nconst DisclosurePanelRefContext = createContext<((el: HTMLElement | null) => void) | null>(null);\n\n/**\n * DisclosureTrigger is the button that toggles the disclosure.\n * Pattern matches SelectTrigger for consistency.\n */\nexport function DisclosureTrigger(props: DisclosureTriggerProps): JSX.Element {\n // Get context - now safe because parent uses lazy children evaluation\n const context = useContext(DisclosureContext);\n if (!context) {\n throw new Error(\"DisclosureTrigger must be used within a Disclosure\");\n }\n\n const { state, disclosureAria, isDisabled } = context;\n\n // Reactive accessors\n const isExpanded = () => state.isExpanded();\n\n // Get buttonProps from the getter each time - this ensures reactivity\n // IMPORTANT: Call the getter fresh each render to get updated aria-expanded, etc.\n const getButtonProps = () => {\n const { ref: _ref, ...rest } = disclosureAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const [local, rest] = splitProps(props, [\"children\", \"class\", \"style\", \"ref\"]);\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <button\n {...mergeProps(domProps() as Record<string, unknown>, getButtonProps(), cleanFocusProps())}\n ref={(el) => assignRef(local.ref, el)}\n type=\"button\"\n class={local.class}\n style={local.style}\n data-expanded={dataAttr(isExpanded())}\n data-disabled={dataAttr(isDisabled())}\n data-pressed={dataAttr(disclosureAria.isPressed())}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n >\n {local.children}\n </button>\n );\n}\n\n/**\n * DisclosurePanel contains the content that is shown/hidden.\n */\nexport function DisclosurePanel(props: DisclosurePanelProps): JSX.Element {\n // Get context - now safe because parent uses lazy children evaluation\n const context = useContext(DisclosureContext);\n if (!context) {\n throw new Error(\"DisclosurePanel must be used within a Disclosure\");\n }\n const panelRefSetter = useContext(DisclosurePanelRefContext);\n\n const [local, rest] = splitProps(props, [\"class\", \"style\", \"role\", \"ref\"]);\n const { isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps } = createFocusRing({\n within: true,\n });\n\n // Reactive accessors\n const isExpanded = () => context.state.isExpanded();\n const isDisabled = () => context.isDisabled();\n\n const renderValues = createMemo<DisclosureRenderProps>(() => ({\n isExpanded: isExpanded(),\n isFocusVisibleWithin: isFocusVisibleWithin(),\n isDisabled: isDisabled(),\n state: context.state,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-DisclosurePanel\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n // Get panelProps from the getter each time - this ensures reactivity\n // IMPORTANT: Call the getter fresh each render to get updated hidden attribute, etc.\n const getPanelProps = () => {\n const { ref: _ref, ...rest } = context.disclosureAria.panelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...mergeProps(\n domProps() as Record<string, unknown>,\n focusWithinProps as Record<string, unknown>,\n )}\n {...getPanelProps()}\n ref={(el) => {\n panelRefSetter?.(el);\n assignRef(local.ref, el);\n }}\n role={local.role ?? \"group\"}\n class={renderProps.class()}\n style={renderProps.style()}\n data-expanded={dataAttr(isExpanded())}\n data-focus-visible-within={dataAttr(isFocusVisibleWithin())}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nexport type { DisclosureState, DisclosureGroupState };\n","/**\n * Meter component for solidaria-components\n *\n * Pre-wired headless meter component that combines aria hooks.\n * Port of react-aria-components/src/Meter.tsx\n *\n * Meters represent a quantity within a known range, or a fractional value.\n * Unlike progress bars, meters represent a current value rather than progress toward a goal.\n */\n\nimport { type JSX, createContext, createMemo, splitProps } from \"solid-js\";\nimport { createMeter, type AriaMeterProps } from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface MeterRenderProps {\n /** The value as a percentage between the minimum and maximum (0-100). */\n percentage: number;\n /** A formatted version of the value. */\n valueText: string | undefined;\n}\n\nexport interface MeterProps extends AriaMeterProps, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<MeterRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MeterRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MeterRenderProps>;\n}\n\nexport const MeterContext = createContext<MeterProps | null>(null);\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction getSafeRange(min: number, max: number): number {\n const range = max - min;\n return Number.isFinite(range) && range > 0 ? range : 1;\n}\n\n/**\n * A meter represents a quantity within a known range, or a fractional value.\n * Unlike progress bars, meters represent a current value rather than progress toward a goal.\n *\n * @example\n * ```tsx\n * <Meter value={75}>\n * {({ percentage, valueText }) => (\n * <>\n * <Label>Storage space</Label>\n * <span>{valueText}</span>\n * <div class=\"bar\" style={{ width: `${percentage}%` }} />\n * </>\n * )}\n * </Meter>\n * ```\n */\nexport function Meter(props: MeterProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"children\", \"class\", \"style\", \"slot\"]);\n\n const value = () => ariaProps.value ?? 0;\n const minValue = () => ariaProps.minValue ?? 0;\n const maxValue = () => ariaProps.maxValue ?? 100;\n\n const meterAria = createMeter({\n get value() {\n return ariaProps.value;\n },\n get minValue() {\n return ariaProps.minValue;\n },\n get maxValue() {\n return ariaProps.maxValue;\n },\n get valueLabel() {\n return ariaProps.valueLabel;\n },\n get formatOptions() {\n return ariaProps.formatOptions;\n },\n get label() {\n return ariaProps.label;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n });\n\n const percentage = createMemo(() => {\n const clampedValue = clamp(value(), minValue(), maxValue());\n return ((clampedValue - minValue()) / getSafeRange(minValue(), maxValue())) * 100;\n });\n\n const valueText = createMemo(() => {\n return meterAria.meterProps[\"aria-valuetext\"] as string | undefined;\n });\n\n const renderValues = createMemo<MeterRenderProps>(() => ({\n percentage: percentage(),\n valueText: valueText(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Meter\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n return (\n <div\n {...domProps()}\n {...meterAria.meterProps}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n","/**\n * TagGroup component for solidaria-components\n *\n * Pre-wired headless tag group component that combines aria hooks.\n * Port of react-aria-components/src/TagGroup.tsx\n *\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items,\n * with support for keyboard navigation, selection, and removal.\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport { createTagGroup, createTag, type AriaTagGroupProps } from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n type ListState,\n type Key,\n type SelectionMode,\n type SelectionBehavior,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\n\nexport interface TagGroupRenderProps {\n /** Whether the tag group is disabled. */\n isDisabled: boolean;\n /** Whether the tag list is empty. */\n isEmpty: boolean;\n}\n\nexport interface TagGroupProps\n extends\n Omit<AriaTagGroupProps, \"id\">,\n SlotProps,\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TagGroupRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TagGroupRenderProps>;\n}\n\nexport interface TagListRenderProps {\n /** Whether the tag list is empty. */\n isEmpty: boolean;\n /** Whether the tag list is focused. */\n isFocused: boolean;\n}\n\nexport interface TagListProps<T>\n extends\n SlotProps,\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"onSelectionChange\"> {\n /** The items to display in the tag list. */\n items: T[];\n /** Function to render each item. */\n children: (item: T) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TagListRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TagListRenderProps>;\n /** Content to render when the list is empty. */\n renderEmptyState?: () => JSX.Element;\n /** The selection mode for the tag list. */\n selectionMode?: SelectionMode;\n /** How selection behaves in the collection. */\n selectionBehavior?: SelectionBehavior;\n /** The currently selected keys (controlled). */\n selectedKeys?: Iterable<Key>;\n /** The default selected keys (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** Keys that are disabled. */\n disabledKeys?: Iterable<Key>;\n /** Function to get a unique key from an item. */\n getKey?: (item: T) => Key;\n /** Accessibility label. */\n label?: string;\n /** Custom aria-label. */\n \"aria-label\"?: string;\n /** Reference to external label element. */\n \"aria-labelledby\"?: string;\n /** Reference to description element. */\n \"aria-describedby\"?: string;\n /** Whether the tag list is disabled. */\n isDisabled?: boolean;\n /** Handler called when tags are removed. */\n onRemove?: (keys: Set<Key>) => void;\n}\n\nexport interface TagRenderProps {\n /** Whether the tag is selected. */\n isSelected: boolean;\n /** Whether the tag is disabled. */\n isDisabled: boolean;\n /** Whether the tag is focused. */\n isFocused: boolean;\n /** Whether the tag is pressed. */\n isPressed: boolean;\n /** Whether the tag allows removal. */\n allowsRemoving: boolean;\n /** The selection mode. */\n selectionMode: SelectionMode;\n /** Props for the remove button when removal is allowed. */\n removeButtonProps: Record<string, unknown>;\n}\n\nexport interface TagProps extends SlotProps {\n /** A unique key for this tag. */\n id: Key;\n /** Whether the tag is disabled. */\n isDisabled?: boolean;\n /** A text value for accessibility. */\n textValue?: string;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<TagRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TagRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TagRenderProps>;\n /** Handler called when the tag is activated. */\n onAction?: (key: Key) => void;\n}\n\ninterface TagGroupContextValue {\n state: ListState;\n onRemove?: (keys: Set<Key>) => void;\n isDisabled?: boolean;\n}\n\ninterface TagContextValue {\n removeButtonProps: Record<string, unknown>;\n allowsRemoving: boolean;\n}\n\nexport const TagGroupContext = createContext<TagGroupContextValue | null>(null);\nexport const TagListStateContext = createContext<ListState | null>(null);\nexport const TagContext = createContext<TagContextValue | null>(null);\n\nexport function useTagGroupContext(): TagGroupContextValue | null {\n return useContext(TagGroupContext);\n}\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items,\n * with support for keyboard navigation, selection, and removal.\n *\n * @example\n * ```tsx\n * <TagGroup label=\"Categories\" onRemove={(keys) => removeItems(keys)}>\n * <TagList items={items}>\n * {(item) => <Tag id={item.id}>{item.name}</Tag>}\n * </TagList>\n * </TagGroup>\n * ```\n */\nexport function TagGroup(props: TagGroupProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n // We need TagList to provide the state, so TagGroup just provides context\n return (\n <div\n {...domProps}\n class={typeof local.class === \"string\" ? local.class : \"solidaria-TagGroup\"}\n style={typeof local.style === \"object\" ? local.style : undefined}\n slot={local.slot}\n >\n {props.children}\n </div>\n );\n}\n\n/**\n * TagList contains the list of tags within a TagGroup.\n */\nexport function TagList<T extends { id?: Key; key?: Key }>(props: TagListProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"items\",\n \"class\",\n \"style\",\n \"slot\",\n \"renderEmptyState\",\n \"children\",\n \"selectionMode\",\n \"selectionBehavior\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"disabledKeys\",\n \"getKey\",\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"onRemove\",\n ]);\n\n // Create a ref for the grid\n const [gridRef, setGridRef] = createSignal<HTMLDivElement | null>(null);\n\n // Default getKey function\n const getKey = (item: T): Key => {\n if (local.getKey) return local.getKey(item);\n if (item.id !== undefined) return item.id;\n if (item.key !== undefined) return item.key;\n return String(item);\n };\n\n const state = createListState({\n get items() {\n return local.items;\n },\n getKey,\n get selectionMode() {\n return local.selectionMode ?? \"none\";\n },\n get selectionBehavior() {\n return local.selectionBehavior ?? \"toggle\";\n },\n get selectedKeys() {\n return local.selectedKeys;\n },\n get defaultSelectedKeys() {\n return local.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return local.onSelectionChange;\n },\n get disabledKeys() {\n return local.disabledKeys;\n },\n });\n\n // Create tag group accessibility props\n const tagGroupAria = createTagGroup(\n {\n get \"aria-label\"() {\n return local[\"aria-label\"] ?? (!local[\"aria-labelledby\"] ? local.label : undefined);\n },\n get \"aria-labelledby\"() {\n return local[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return local[\"aria-describedby\"];\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get onRemove() {\n return local.onRemove;\n },\n },\n state,\n gridRef,\n );\n\n const [isFocused, setIsFocused] = createSignal(false);\n\n const renderValues = createMemo<TagListRenderProps>(() => ({\n isEmpty: local.items.length === 0,\n isFocused: isFocused(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TagList\",\n },\n renderValues,\n );\n\n const contextValue: TagGroupContextValue = {\n state,\n get onRemove() {\n return local.onRemove;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n };\n\n return (\n <TagGroupContext.Provider value={contextValue}>\n <TagListStateContext.Provider value={state}>\n <div\n ref={setGridRef}\n {...domProps}\n {...tagGroupAria.gridProps}\n class={renderProps.class()}\n style={renderProps.style()}\n onFocus={() => {\n setIsFocused(true);\n state.setFocused(true);\n }}\n onBlur={(e) => {\n const nextTarget = e.relatedTarget as Node | null;\n if (nextTarget && e.currentTarget.contains(nextTarget)) {\n return;\n }\n\n setIsFocused(false);\n state.setFocused(false);\n }}\n data-empty={dataAttr(local.items.length === 0)}\n data-focused={dataAttr(isFocused())}\n >\n <SharedElementTransition>\n <Show when={local.items.length > 0} fallback={local.renderEmptyState?.()}>\n <For each={local.items}>{(item) => props.children(item)}</For>\n </Show>\n </SharedElementTransition>\n </div>\n </TagListStateContext.Provider>\n </TagGroupContext.Provider>\n );\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport function Tag(props: TagProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"id\",\n \"class\",\n \"style\",\n \"slot\",\n \"isDisabled\",\n \"textValue\",\n \"onAction\",\n ]);\n\n const state = useContext(TagListStateContext);\n const groupContext = useContext(TagGroupContext);\n\n // Create a ref for the tag\n const [tagRef, setTagRef] = createSignal<HTMLDivElement | null>(null);\n\n // Create tag accessibility props\n const tagAria = createTag(\n {\n get key() {\n return local.id;\n },\n get isDisabled() {\n return local.isDisabled || groupContext?.isDisabled;\n },\n get textValue() {\n return local.textValue;\n },\n },\n state!,\n tagRef,\n );\n\n const normalizedRemoveButtonProps = createMemo<Record<string, unknown>>(() => {\n const raw = tagAria.removeButtonProps;\n const rawHandler = typeof raw.onPress === \"function\" ? (raw.onPress as () => void) : undefined;\n return {\n ...raw,\n onPress: () => {\n if (!tagAria.isDisabled && groupContext?.onRemove) {\n groupContext.onRemove(new Set([local.id]));\n return;\n }\n rawHandler?.();\n },\n };\n });\n\n const renderValues = createMemo<TagRenderProps>(() => ({\n isSelected: tagAria.isSelected,\n isDisabled: tagAria.isDisabled,\n isFocused: tagAria.isFocused,\n isPressed: tagAria.isPressed,\n allowsRemoving: tagAria.allowsRemoving,\n selectionMode: state?.selectionMode() ?? \"none\",\n removeButtonProps: normalizedRemoveButtonProps(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Tag\",\n },\n renderValues,\n );\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: () => tagAria.isSelected,\n }));\n\n const domProps = createMemo(() => filterDOMProps(rest, { global: true }));\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <TagContext.Provider\n value={{\n get removeButtonProps() {\n return normalizedRemoveButtonProps();\n },\n get allowsRemoving() {\n return tagAria.allowsRemoving;\n },\n }}\n >\n <div\n ref={setTagRef}\n {...domProps()}\n {...tagAria.rowProps}\n class={renderProps.class()}\n style={renderProps.style()}\n onClick={(event) => {\n const rowClick = tagAria.rowProps.onClick;\n if (typeof rowClick === \"function\") {\n (rowClick as JSX.EventHandler<HTMLDivElement, MouseEvent>)(event);\n }\n\n if (!tagAria.isDisabled && !(event.target as Element | null)?.closest(\"button\")) {\n local.onAction?.(local.id);\n }\n }}\n data-selected={dataAttr(tagAria.isSelected)}\n data-disabled={dataAttr(tagAria.isDisabled)}\n data-focused={dataAttr(tagAria.isFocused)}\n data-pressed={dataAttr(tagAria.isPressed)}\n data-allows-removing={dataAttr(tagAria.allowsRemoving)}\n >\n <div {...tagAria.gridCellProps} style={{ display: \"contents\" }}>\n {renderProps.renderChildren()}\n </div>\n </div>\n </TagContext.Provider>\n </SelectionIndicatorContext.Provider>\n );\n}\n\nexport interface TagRemoveButtonProps {\n /** The children of the button (usually an X icon). */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Explicit button props from Tag render props. */\n buttonProps?: Record<string, unknown>;\n}\n\n/**\n * TagRemoveButton is the button used to remove a tag.\n * It should be placed inside a Tag component.\n */\nexport function TagRemoveButton(props: TagRemoveButtonProps): JSX.Element {\n const tagContext = useContext(TagContext);\n const getRemoveButtonProps = () => props.buttonProps ?? tagContext?.removeButtonProps ?? {};\n const getIsDisabled = () => Boolean(getRemoveButtonProps().isDisabled);\n const rawId = getRemoveButtonProps().id;\n const rawAriaLabel = getRemoveButtonProps()[\"aria-label\"];\n const rawAriaLabelledBy = getRemoveButtonProps()[\"aria-labelledby\"];\n const buttonId: string | undefined = typeof rawId === \"string\" ? rawId : undefined;\n const ariaLabel: string = typeof rawAriaLabel === \"string\" ? rawAriaLabel : \"Remove\";\n const ariaLabelledBy: string | undefined =\n typeof rawAriaLabelledBy === \"string\" ? rawAriaLabelledBy : undefined;\n\n const handleClick: JSX.EventHandler<HTMLButtonElement, MouseEvent> = (event) => {\n event.stopPropagation();\n const handler = getRemoveButtonProps().onPress;\n if (typeof handler === \"function\" && !getIsDisabled()) {\n (handler as () => void)();\n }\n };\n const stopRowPress: JSX.EventHandler<HTMLButtonElement, PointerEvent> = (event) => {\n event.stopPropagation();\n };\n\n return (\n <button\n type=\"button\"\n class={props.class ?? \"solidaria-TagRemoveButton\"}\n style={props.style}\n id={buttonId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n disabled={getIsDisabled()}\n data-allows-removing={dataAttr(tagContext?.allowsRemoving ?? false)}\n onPointerDown={stopRowPress}\n onClick={handleClick}\n >\n {props.children ?? \"×\"}\n </button>\n );\n}\n\nexport type { Key, SelectionMode, SelectionBehavior };\n","/**\n * Calendar component for solidaria-components\n *\n * Pre-wired headless calendar component that combines aria hooks.\n * Port of react-aria-components/src/Calendar.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Index,\n Show,\n} from \"solid-js\";\n\nimport {\n createCalendar,\n createCalendarGrid,\n createCalendarCell,\n createHover,\n type AriaCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createCalendarState,\n type CalendarState,\n type CalendarStateProps,\n type CalendarDate,\n type DateValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface CalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n}\n\nexport interface CalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<CalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface CalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface CalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving weeks). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Number of weeks to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface CalendarCellRenderProps {\n /** Whether the cell is selected. */\n isSelected: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell should display a keyboard focus ring. */\n isFocusVisible: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface CalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<CalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<CalendarCellRenderProps>;\n}\n\nexport interface CalendarHeaderCellProps extends SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\nexport interface CalendarGridHeaderProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport interface CalendarGridBodyProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport const CalendarContext = createContext<CalendarState<DateValue> | null>(null);\nconst CalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst CalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useCalendarContext(): CalendarState<DateValue> {\n const context = useContext(CalendarContext);\n if (!context) {\n throw new Error(\"Calendar components must be used within a Calendar\");\n }\n return context;\n}\n\n/**\n * A calendar displays a grid of days in a month and allows users to select a single date.\n *\n * @example\n * ```tsx\n * <Calendar aria-label=\"Event date\">\n * <header>\n * <CalendarButton slot=\"previous\">◀</CalendarButton>\n * <CalendarHeading />\n * <CalendarButton slot=\"next\">▶</CalendarButton>\n * </header>\n * <CalendarGrid>\n * {(date) => <CalendarCell date={date} />}\n * </CalendarGrid>\n * </Calendar>\n * ```\n */\nexport function Calendar<T extends DateValue = CalendarDate>(props: CalendarProps<T>): JSX.Element {\n const inheritedState = useContext(CalendarContext);\n\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div class=\"solidaria-Calendar solidaria-Calendar--placeholder\" aria-hidden=\"true\" />\n }\n >\n <Show when={inheritedState} fallback={<CalendarInner {...props} />}>\n <CalendarWithState state={inheritedState as CalendarState<DateValue>} {...props} />\n </Show>\n </Show>\n );\n}\n\nfunction CalendarWithState<T extends DateValue = CalendarDate>(\n props: CalendarProps<T> & { state: CalendarState<DateValue> },\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state(),\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n </div>\n );\n}\n\n/**\n * Internal Calendar component that renders after client mount.\n */\nfunction CalendarInner<T extends DateValue = CalendarDate>(props: CalendarProps<T>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n // Create calendar state\n const state = createCalendarState(stateProps);\n\n // Create calendar ARIA props\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state as unknown as CalendarState<DateValue>,\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\n <CalendarContext.Provider value={state as unknown as CalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n </div>\n </CalendarContext.Provider>\n );\n}\n\nexport interface CalendarHeadingProps extends SlotProps {\n /** The children of the component. */\n children?: RenderChildren<{ title: string }>;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the calendar.\n */\nexport function CalendarHeading(props: CalendarHeadingProps): JSX.Element {\n const state = useCalendarContext();\n const renderValues = createMemo(() => ({\n title: state.title(),\n }));\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-CalendarHeading\",\n },\n renderValues,\n );\n\n return (\n <h2 class={renderProps.class()} style={renderProps.style()} aria-live=\"polite\">\n {typeof props.children === \"function\" ? renderProps.renderChildren() : state.title()}\n </h2>\n );\n}\n\nexport interface CalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the calendar.\n */\nexport function CalendarButton(props: CalendarButtonProps): JSX.Element {\n const state = useCalendarContext();\n const calendarAria = createCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-CalendarButton\"}\n style={props.style}\n disabled={props.isDisabled || state.isDisabled()}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of calendar cells.\n */\nexport function CalendarGrid(props: CalendarGridProps): JSX.Element {\n const state = useCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state,\n gridRef,\n );\n\n const renderValues = createMemo<CalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-CalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize ALL dates for the grid at once to avoid reactive loops.\n // This breaks the cycle where accessing visibleRange() inside For loop\n // would cause infinite re-renders.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <CalendarGridMonthContext.Provider value={startDate}>\n <table\n ref={setGridRef}\n {...gridAria.gridProps}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...gridAria.headerProps}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th scope=\"col\" class={props.headerCellClass ?? \"solidaria-CalendarHeaderCell\"}>\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates, weekIndex) => (\n <tr>\n <Index each={weekDates()}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <CalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </CalendarGridMonthContext.Provider>\n );\n}\n\nexport function CalendarGridHeader(props: CalendarGridHeaderProps): JSX.Element {\n return (\n <thead class={props.class ?? \"solidaria-CalendarGridHeader\"} style={props.style}>\n {props.children}\n </thead>\n );\n}\n\nexport function CalendarGridBody(props: CalendarGridBodyProps): JSX.Element {\n return (\n <tbody class={props.class ?? \"solidaria-CalendarGridBody\"} style={props.style}>\n {props.children}\n </tbody>\n );\n}\n\nexport function CalendarHeaderCell(props: CalendarHeaderCellProps): JSX.Element {\n return (\n <th scope=\"col\" class={props.class ?? \"solidaria-CalendarHeaderCell\"} style={props.style}>\n {props.children}\n </th>\n );\n}\n\n/**\n * A cell in the calendar grid representing a single day.\n */\nexport function CalendarCell(props: CalendarCellProps): JSX.Element {\n const state = useCalendarContext();\n const currentMonthStart = useContext(CalendarGridMonthContext);\n const cellPosition = useContext(CalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<CalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isFocused: cellAria.isFocused,\n isFocusVisible: cellAria.isFocusVisible,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-CalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-CalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-focus-visible={dataAttr(cellAria.isFocusVisible)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { CalendarState, CalendarDate, DateValue };\n","/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Port of react-aria-components/src/RangeCalendar.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Index,\n Show,\n} from \"solid-js\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div\n class=\"solidaria-RangeCalendar solidaria-RangeCalendar--placeholder\"\n aria-hidden=\"true\"\n />\n }\n >\n <RangeCalendarInner {...props} />\n </Show>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n\n const calendarAria = createRangeCalendar(rest, state as unknown as RangeCalendarState<DateValue>);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext.Provider value={startDate}>\n <table\n ref={setGridRef}\n {...gridAria.gridProps}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...gridAria.headerProps}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates, weekIndex) => (\n <tr>\n <Index each={weekDates()}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext.Provider>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n","/**\n * HiddenDateInput component for solidaria-components\n *\n * A hidden native date/datetime-local input for form submission.\n * Renders server-side with the initial value for SSR safety.\n */\nimport { type JSX, createEffect, createSignal } from \"solid-js\";\nimport { type DateValue, type FormValidationState } from \"@proyecto-viviana/solid-stately\";\nimport { createFormValidation } from \"@proyecto-viviana/solidaria\";\n\ntype MaybeAccessor<T> = T | (() => T);\n\nexport interface HiddenDateInputProps {\n name?: string;\n form?: string;\n value?: MaybeAccessor<DateValue | null | undefined>;\n autoComplete?: string;\n isDisabled?: boolean;\n isRequired?: boolean;\n validationBehavior?: \"aria\" | \"native\";\n validationState?: FormValidationState;\n focus?: () => void;\n minValue?: MaybeAccessor<DateValue | undefined>;\n maxValue?: MaybeAccessor<DateValue | undefined>;\n granularity?: \"day\" | \"hour\" | \"minute\" | \"second\";\n}\n\nfunction accessValue<T>(value: MaybeAccessor<T> | undefined): T | undefined {\n return typeof value === \"function\" ? (value as () => T)() : value;\n}\n\nfunction formatDateValue(\n value: DateValue | undefined | null,\n granularity: \"day\" | \"hour\" | \"minute\" | \"second\",\n): string {\n if (!value) return \"\";\n\n if (\"timeZone\" in value) {\n return String(value);\n }\n\n const dateValue = value;\n\n const year = String(dateValue.year).padStart(4, \"0\");\n const month = String(dateValue.month).padStart(2, \"0\");\n const day = String(dateValue.day).padStart(2, \"0\");\n\n if (granularity === \"day\") {\n return `${year}-${month}-${day}`;\n }\n\n const hasHour = \"hour\" in dateValue;\n const hour = hasHour ? String((dateValue as { hour: number }).hour).padStart(2, \"0\") : \"00\";\n const hasMinute = hasHour && \"minute\" in dateValue;\n const minute = hasMinute\n ? String((dateValue as { minute: number }).minute).padStart(2, \"0\")\n : \"00\";\n\n if (granularity === \"second\" && hasMinute && \"second\" in dateValue) {\n const second = String((dateValue as { second: number }).second).padStart(2, \"0\");\n return `${year}-${month}-${day}T${hour}:${minute}:${second}`;\n }\n\n return `${year}-${month}-${day}T${hour}:${minute}`;\n}\n\nexport function HiddenDateInput(props: HiddenDateInputProps): JSX.Element {\n const granularity = () => props.granularity ?? \"day\";\n const hasValidationBehavior = () => props.validationBehavior != null;\n const validationBehavior = () => props.validationBehavior;\n const usesNativeValidation = () => validationBehavior() === \"native\";\n const value = () => accessValue(props.value);\n const minValue = () => accessValue(props.minValue);\n const maxValue = () => accessValue(props.maxValue);\n const hasTimeZoneValue = () =>\n Boolean(\n (value() && \"timeZone\" in value()!) ||\n (minValue() && \"timeZone\" in minValue()!) ||\n (maxValue() && \"timeZone\" in maxValue()!),\n );\n const inputType = () =>\n usesNativeValidation()\n ? \"text\"\n : hasValidationBehavior()\n ? \"hidden\"\n : hasTimeZoneValue()\n ? \"hidden\"\n : granularity() === \"day\"\n ? \"date\"\n : \"datetime-local\";\n const formattedValue = () => formatDateValue(value(), granularity());\n const formattedMin = () => formatDateValue(minValue(), granularity());\n const formattedMax = () => formatDateValue(maxValue(), granularity());\n\n const [inputRef, setInputRef] = createSignal<HTMLInputElement>();\n\n if (props.validationState) {\n createFormValidation(\n {\n get validationBehavior() {\n return validationBehavior();\n },\n get focus() {\n return props.focus;\n },\n },\n props.validationState,\n inputRef,\n );\n }\n\n createEffect(() => {\n const val = formattedValue();\n const input = inputRef();\n if (input && input.value !== val) {\n input.value = val;\n }\n });\n\n return (\n <input\n ref={(el) => {\n setInputRef(el);\n }}\n type={inputType()}\n name={props.name}\n form={props.form}\n value={formattedValue()}\n autocomplete={props.autoComplete}\n disabled={props.isDisabled}\n required={usesNativeValidation() && props.isRequired ? true : undefined}\n hidden={usesNativeValidation() || undefined}\n min={hasValidationBehavior() ? undefined : formattedMin() || undefined}\n max={hasValidationBehavior() ? undefined : formattedMax() || undefined}\n onChange={usesNativeValidation() ? () => {} : undefined}\n tabIndex={-1}\n aria-hidden=\"true\"\n style={\n {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: \"0\",\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n \"white-space\": \"nowrap\",\n \"border-width\": \"0\",\n } as JSX.CSSProperties\n }\n />\n );\n}\n","import { createContext, useContext } from \"solid-js\";\nimport { type createDateRangePicker } from \"@proyecto-viviana/solidaria\";\nimport {\n type DateFieldState,\n type DateValue,\n type RangeCalendarState,\n} from \"@proyecto-viviana/solid-stately\";\n\nexport interface DateRangePickerFieldContextValue {\n state: DateFieldState<DateValue>;\n aria: {\n labelProps: Record<string, unknown>;\n inputProps: Record<string, unknown>;\n descriptionProps: Record<string, unknown>;\n errorMessageProps: Record<string, unknown>;\n };\n}\n\nexport interface DateRangePickerContextValue {\n calendarState: RangeCalendarState<DateValue>;\n startFieldState: DateFieldState<DateValue>;\n endFieldState: DateFieldState<DateValue>;\n startFieldContext: DateRangePickerFieldContextValue;\n endFieldContext: DateRangePickerFieldContextValue;\n overlayState: {\n isOpen: boolean;\n open: () => void;\n close: () => void;\n toggle: () => void;\n };\n triggerRef: () => HTMLElement | null;\n setTriggerRef: (element: HTMLElement | null) => void;\n pickerAria: ReturnType<typeof createDateRangePicker>;\n}\n\nexport const DateRangePickerContext = createContext<DateRangePickerContextValue | null>(null);\n\nexport function useDateRangePickerContext(): DateRangePickerContextValue {\n const context = useContext(DateRangePickerContext);\n if (!context) {\n throw new Error(\"DateRangePicker components must be used within a DateRangePicker\");\n }\n return context;\n}\n","/**\n * DateField component for solidaria-components\n *\n * Pre-wired headless date field component with segment-based editing.\n * Port of react-aria-components/src/DateField.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createDateField,\n createDateSegment,\n type AriaDateFieldProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createDateFieldState,\n access,\n type DateFieldState,\n type DateFieldStateProps,\n type DateSegment as DateSegmentType,\n type CalendarDate,\n type DateValue,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { HiddenDateInput } from \"./HiddenDateInput\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport {\n DateRangePickerContext,\n type DateRangePickerFieldContextValue,\n} from \"./DateRangePickerContext\";\n\nexport interface DateFieldRenderProps {\n /** Whether the field is disabled. */\n isDisabled: boolean;\n /** Whether the field is read-only. */\n isReadOnly: boolean;\n /** Whether the field is required. */\n isRequired: boolean;\n /** Whether the field is invalid. */\n isInvalid: boolean;\n}\n\nexport interface DateFieldProps<T extends DateValue = DateValue>\n extends\n Omit<AriaDateFieldProps, \"id\" | \"isDisabled\" | \"isReadOnly\" | \"isRequired\">,\n Omit<DateFieldStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element | ((segment: DateSegmentType) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DateFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DateFieldRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n}\n\nexport interface DateInputRenderProps {\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is focused. */\n isFocused: boolean;\n}\n\nexport interface DateInputProps extends SlotProps {\n /** The children of the component (render function receiving segments). */\n children?: (segment: DateSegmentType) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DateInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DateInputRenderProps>;\n /** Handler called during the pointer down capture phase. */\n onPointerDownCapture?: JSX.EventHandler<HTMLDivElement, PointerEvent>;\n}\n\nexport interface DateSegmentRenderProps {\n /** Whether the segment is focused. */\n isFocused: boolean;\n /** Whether the segment is editable. */\n isEditable: boolean;\n /** Whether the segment is a placeholder. */\n isPlaceholder: boolean;\n /** The segment type. */\n type: DateSegmentType[\"type\"];\n /** The text to display. */\n text: string;\n}\n\nexport interface DateSegmentProps extends SlotProps {\n /** The segment data. */\n segment: DateSegmentType;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<DateSegmentRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DateSegmentRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DateSegmentRenderProps>;\n}\n\nexport interface DateFieldContextValue {\n state: DateFieldState<DateValue>;\n aria: {\n labelProps: Record<string, unknown>;\n inputProps: Record<string, unknown>;\n descriptionProps: Record<string, unknown>;\n errorMessageProps: Record<string, unknown>;\n };\n}\n\nexport const DateFieldContext = createContext<DateFieldContextValue | null>(null);\nexport const DateFieldStateContext = createContext<DateFieldState<DateValue> | null>(null);\n\nfunction withFormValidationBehavior<P extends object>(props: P, formContext: FormProps | null): P {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nexport function useDateFieldContext(): DateFieldContextValue {\n const context = useContext(DateFieldContext);\n if (!context) {\n throw new Error(\"DateField components must be used within a DateField\");\n }\n return context;\n}\n\nfunction useDateInputContext(\n slot?: string,\n): DateFieldContextValue | DateRangePickerFieldContextValue {\n const dateFieldContext = useContext(DateFieldContext);\n if (dateFieldContext) {\n return dateFieldContext;\n }\n\n const dateRangePickerContext = useContext(DateRangePickerContext);\n if (dateRangePickerContext && slot === \"start\") {\n return dateRangePickerContext.startFieldContext;\n }\n if (dateRangePickerContext && slot === \"end\") {\n return dateRangePickerContext.endFieldContext;\n }\n\n throw new Error(\"DateInput components must be used within a DateField or DateRangePicker slot\");\n}\n\n/**\n * A date field allows users to enter and edit date values using a keyboard.\n *\n * @example\n * ```tsx\n * <DateField label=\"Date\">\n * <Label>Date</Label>\n * <DateInput>\n * {(segment) => <DateSegment segment={segment} />}\n * </DateInput>\n * </DateField>\n * ```\n */\nexport function DateField<T extends DateValue = CalendarDate>(\n props: DateFieldProps<T>,\n): JSX.Element {\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n const formContext = useContext(FormContext);\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div class=\"solidaria-DateField solidaria-DateField--placeholder\" aria-hidden=\"true\" />\n }\n >\n <DateFieldInner {...props} __formContext={formContext} />\n </Show>\n );\n}\n\ntype DateFieldInnerProps<T extends DateValue = DateValue> = DateFieldProps<T> & {\n __formContext?: FormProps | null;\n};\n\n/**\n * Internal DateField component that renders after client mount.\n */\nfunction DateFieldInner<T extends DateValue = CalendarDate>(\n props: DateFieldInnerProps<T>,\n): JSX.Element {\n const formContext = props.__formContext ?? useContext(FormContext);\n const mergedProps = withFormValidationBehavior(props, formContext);\n const [local, stateProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"__formContext\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isInvalid\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"locale\",\n \"granularity\",\n \"hourCycle\",\n \"hideTimeZone\",\n \"placeholderValue\",\n \"shouldForceLeadingZeros\",\n \"validationState\",\n \"validationBehavior\",\n \"validate\",\n \"description\",\n \"errorMessage\",\n \"isDateUnavailable\",\n ],\n );\n\n const [fieldRef, setFieldRef] = createSignal<HTMLDivElement | null>(null);\n\n const state = createDateFieldState(stateProps);\n\n const fieldAria = createDateField(\n () => ({\n ...(rest as Record<string, unknown>),\n description: stateProps.description,\n errorMessage: stateProps.errorMessage,\n }),\n state as unknown as DateFieldState<DateValue>,\n fieldRef,\n );\n\n const renderValues = createMemo<DateFieldRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isRequired: state.isRequired(),\n isInvalid: state.isInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-DateField\",\n },\n renderValues,\n );\n\n const validationBehavior = () =>\n (stateProps as { validationBehavior?: \"aria\" | \"native\" }).validationBehavior ??\n formContext?.validationBehavior ??\n \"native\";\n\n return (\n <DateFieldStateContext.Provider value={state as unknown as DateFieldState<DateValue>}>\n <DateFieldContext.Provider\n value={{\n state: state as unknown as DateFieldState<DateValue>,\n aria: {\n labelProps: fieldAria.labelProps,\n inputProps: fieldAria.inputProps,\n descriptionProps: fieldAria.descriptionProps,\n errorMessageProps: fieldAria.errorMessageProps,\n },\n }}\n >\n <div\n ref={setFieldRef}\n {...fieldAria.fieldProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-required={dataAttr(state.isRequired())}\n data-invalid={dataAttr(state.isInvalid())}\n >\n {local.children as JSX.Element}\n </div>\n <Show when={(rest as Record<string, unknown>).name}>\n <HiddenDateInput\n name={(rest as Record<string, unknown>).name as string | undefined}\n form={(rest as Record<string, unknown>).form as string | undefined}\n value={state.value()}\n autoComplete={(rest as Record<string, unknown>).autoComplete as string | undefined}\n isDisabled={state.isDisabled()}\n isRequired={state.isRequired()}\n validationBehavior={validationBehavior()}\n validationState={state}\n focus={() => {\n fieldRef()?.querySelector<HTMLElement>('[role=\"spinbutton\"]')?.focus();\n }}\n minValue={access(stateProps.minValue) as DateValue | undefined}\n maxValue={access(stateProps.maxValue) as DateValue | undefined}\n granularity={state.granularity}\n />\n </Show>\n </DateFieldContext.Provider>\n </DateFieldStateContext.Provider>\n );\n}\n\n/**\n * The input area containing date segments.\n */\nexport function DateInput(props: DateInputProps): JSX.Element {\n const context = useDateInputContext(props.slot);\n const { state, aria } = context;\n const [isFocused, setIsFocused] = createSignal(false);\n const [inputRef, setInputRef] = createSignal<HTMLDivElement | null>(null);\n\n const renderValues = createMemo<DateInputRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isFocused: isFocused(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-DateInput\",\n },\n renderValues,\n );\n\n createEffect(() => {\n const element = inputRef();\n const handler = props.onPointerDownCapture;\n if (!element || !handler) return;\n\n const listener = (event: PointerEvent) =>\n (handler as unknown as (event: PointerEvent) => void)(event);\n element.addEventListener(\"pointerdown\", listener, { capture: true });\n onCleanup(() => element.removeEventListener(\"pointerdown\", listener, { capture: true }));\n });\n\n return (\n <DateFieldContext.Provider value={context as DateFieldContextValue}>\n <div\n ref={setInputRef}\n {...aria.inputProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-focused={dataAttr(isFocused())}\n onFocusIn={() => setIsFocused(true)}\n onFocusOut={() => setIsFocused(false)}\n >\n <For each={state.segments()}>{(segment) => props.children?.(segment)}</For>\n </div>\n </DateFieldContext.Provider>\n );\n}\n\n/**\n * A segment of a date field (year, month, day, etc.).\n */\nexport function DateSegment(props: DateSegmentProps): JSX.Element {\n const { state } = useDateFieldContext();\n const [segmentRef, setSegmentRef] = createSignal<HTMLElement | null>(null);\n\n const segmentAria = createDateSegment({ segment: props.segment }, state, segmentRef);\n\n const renderValues = createMemo<DateSegmentRenderProps>(() => ({\n isFocused: segmentAria.isFocused,\n isEditable: segmentAria.isEditable,\n isPlaceholder: segmentAria.isPlaceholder,\n type: props.segment.type,\n text: segmentAria.text,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-DateSegment\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return segmentAria.text;\n };\n\n return (\n <span\n ref={setSegmentRef}\n {...segmentAria.segmentProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={dataAttr(segmentAria.isFocused)}\n data-editable={dataAttr(segmentAria.isEditable)}\n data-placeholder={dataAttr(segmentAria.isPlaceholder)}\n data-type={props.segment.type}\n >\n {getChildren()}\n </span>\n );\n}\n\nexport interface DateFieldLabelProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DateFieldLabel(props: DateFieldLabelProps): JSX.Element {\n const { aria } = useDateFieldContext();\n return (\n <span {...aria.labelProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport interface DateFieldDescriptionProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DateFieldDescription(props: DateFieldDescriptionProps): JSX.Element {\n const { aria } = useDateFieldContext();\n return (\n <p {...aria.descriptionProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nexport interface DateFieldErrorMessageProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DateFieldErrorMessage(props: DateFieldErrorMessageProps): JSX.Element {\n const { aria } = useDateFieldContext();\n return (\n <p {...aria.errorMessageProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nexport type { DateFieldState, DateSegmentType };\n","/**\n * HiddenTimeInput component for solidaria-components\n *\n * A hidden native time input for form submission.\n */\nimport { type JSX, createEffect, createSignal } from \"solid-js\";\nimport { type FormValidationState, type TimeValue } from \"@proyecto-viviana/solid-stately\";\nimport { createFormValidation } from \"@proyecto-viviana/solidaria\";\n\ntype MaybeAccessor<T> = T | (() => T);\n\nexport interface HiddenTimeInputProps {\n name?: string;\n form?: string;\n value?: MaybeAccessor<TimeValue | null | undefined>;\n autoComplete?: string;\n isDisabled?: boolean;\n isRequired?: boolean;\n validationBehavior?: \"aria\" | \"native\";\n validationState?: FormValidationState;\n focus?: () => void;\n minValue?: MaybeAccessor<TimeValue | undefined>;\n maxValue?: MaybeAccessor<TimeValue | undefined>;\n granularity?: \"hour\" | \"minute\" | \"second\";\n}\n\nfunction accessValue<T>(value: MaybeAccessor<T> | undefined): T | undefined {\n return typeof value === \"function\" ? (value as () => T)() : value;\n}\n\nfunction formatTimeValue(\n value: TimeValue | undefined | null,\n granularity: \"hour\" | \"minute\" | \"second\",\n): string {\n if (!value) return \"\";\n\n const hour = String(value.hour).padStart(2, \"0\");\n const minute = String(granularity === \"hour\" ? 0 : value.minute).padStart(2, \"0\");\n\n if (granularity === \"second\") {\n const second = String(value.second).padStart(2, \"0\");\n return `${hour}:${minute}:${second}`;\n }\n\n return `${hour}:${minute}`;\n}\n\nfunction stepForGranularity(granularity: \"hour\" | \"minute\" | \"second\"): number {\n switch (granularity) {\n case \"hour\":\n return 3600;\n case \"second\":\n return 1;\n case \"minute\":\n default:\n return 60;\n }\n}\n\nexport function HiddenTimeInput(props: HiddenTimeInputProps): JSX.Element {\n const granularity = () => props.granularity ?? \"minute\";\n const hasValidationBehavior = () => props.validationBehavior != null;\n const validationBehavior = () => props.validationBehavior;\n const usesNativeValidation = () => validationBehavior() === \"native\";\n const value = () => accessValue(props.value);\n const minValue = () => accessValue(props.minValue);\n const maxValue = () => accessValue(props.maxValue);\n const inputType = () =>\n usesNativeValidation() ? \"text\" : hasValidationBehavior() ? \"hidden\" : \"time\";\n const formattedValue = () => formatTimeValue(value(), granularity());\n const formattedMin = () => formatTimeValue(minValue(), granularity());\n const formattedMax = () => formatTimeValue(maxValue(), granularity());\n\n const [inputRef, setInputRef] = createSignal<HTMLInputElement>();\n\n if (props.validationState) {\n createFormValidation(\n {\n get validationBehavior() {\n return validationBehavior();\n },\n get focus() {\n return props.focus;\n },\n },\n props.validationState,\n inputRef,\n );\n }\n\n createEffect(() => {\n const val = formattedValue();\n const input = inputRef();\n if (input && input.value !== val) {\n input.value = val;\n }\n });\n\n return (\n <input\n ref={(el) => {\n setInputRef(el);\n }}\n type={inputType()}\n name={props.name}\n form={props.form}\n value={formattedValue()}\n autocomplete={props.autoComplete}\n disabled={props.isDisabled}\n required={usesNativeValidation() && props.isRequired ? true : undefined}\n hidden={usesNativeValidation() || undefined}\n min={hasValidationBehavior() ? undefined : formattedMin() || undefined}\n max={hasValidationBehavior() ? undefined : formattedMax() || undefined}\n step={hasValidationBehavior() ? undefined : stepForGranularity(granularity())}\n onChange={usesNativeValidation() ? () => {} : undefined}\n tabIndex={-1}\n aria-hidden=\"true\"\n style={\n {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: \"0\",\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n \"white-space\": \"nowrap\",\n \"border-width\": \"0\",\n } as JSX.CSSProperties\n }\n />\n );\n}\n","/**\n * TimeField component for solidaria-components\n *\n * Pre-wired headless time field component with segment-based editing.\n * Port of react-aria-components/src/TimeField.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createTimeField,\n createTimeSegment,\n type AriaTimeFieldProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createTimeFieldState,\n access,\n type TimeFieldState,\n type TimeFieldStateProps,\n type TimeSegment as TimeSegmentType,\n type TimeValue,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { HiddenTimeInput } from \"./HiddenTimeInput\";\nimport { FormContext, type FormProps } from \"./Form\";\n\nexport interface TimeFieldRenderProps {\n /** Whether the field is disabled. */\n isDisabled: boolean;\n /** Whether the field is read-only. */\n isReadOnly: boolean;\n /** Whether the field is required. */\n isRequired: boolean;\n /** Whether the field is invalid. */\n isInvalid: boolean;\n}\n\nexport interface TimeFieldProps<T extends TimeValue = TimeValue>\n extends\n Omit<AriaTimeFieldProps, \"id\" | \"isDisabled\" | \"isReadOnly\" | \"isRequired\">,\n Omit<TimeFieldStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element | ((segment: TimeSegmentType) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TimeFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TimeFieldRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n}\n\nexport interface TimeInputRenderProps {\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is focused. */\n isFocused: boolean;\n}\n\nexport interface TimeInputProps extends SlotProps {\n /** The children of the component (render function receiving segments). */\n children?: (segment: TimeSegmentType) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TimeInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TimeInputRenderProps>;\n}\n\nexport interface TimeSegmentRenderProps {\n /** Whether the segment is focused. */\n isFocused: boolean;\n /** Whether the segment is editable. */\n isEditable: boolean;\n /** Whether the segment is a placeholder. */\n isPlaceholder: boolean;\n /** The segment type. */\n type: TimeSegmentType[\"type\"];\n /** The text to display. */\n text: string;\n}\n\nexport interface TimeSegmentProps extends SlotProps {\n /** The segment data. */\n segment: TimeSegmentType;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<TimeSegmentRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TimeSegmentRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TimeSegmentRenderProps>;\n}\n\nexport interface TimeFieldContextValue {\n state: TimeFieldState<TimeValue>;\n aria: {\n labelProps: Record<string, unknown>;\n inputProps: Record<string, unknown>;\n descriptionProps: Record<string, unknown>;\n errorMessageProps: Record<string, unknown>;\n };\n}\n\nexport const TimeFieldContext = createContext<TimeFieldContextValue | null>(null);\nexport const TimeFieldStateContext = createContext<TimeFieldState<TimeValue> | null>(null);\n\nfunction withFormValidationBehavior<P extends object>(props: P, formContext: FormProps | null): P {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nfunction useTimeFieldContextValue(): TimeFieldContextValue {\n const context = useContext(TimeFieldContext);\n if (!context) {\n throw new Error(\"TimeField components must be used within a TimeField\");\n }\n return context;\n}\n\nexport function useTimeFieldContext(): TimeFieldState<TimeValue> {\n return useTimeFieldContextValue().state;\n}\n\n/**\n * A time field allows users to enter and edit time values using a keyboard.\n *\n * @example\n * ```tsx\n * <TimeField label=\"Time\">\n * <Label>Time</Label>\n * <TimeInput>\n * {(segment) => <TimeSegment segment={segment} />}\n * </TimeInput>\n * </TimeField>\n * ```\n */\nexport function TimeField<T extends TimeValue = TimeValue>(props: TimeFieldProps<T>): JSX.Element {\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n const formContext = useContext(FormContext);\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div class=\"solidaria-TimeField solidaria-TimeField--placeholder\" aria-hidden=\"true\" />\n }\n >\n <TimeFieldInner {...props} __formContext={formContext} />\n </Show>\n );\n}\n\ntype TimeFieldInnerProps<T extends TimeValue = TimeValue> = TimeFieldProps<T> & {\n __formContext?: FormProps | null;\n};\n\n/**\n * Internal TimeField component that renders after client mount.\n */\nfunction TimeFieldInner<T extends TimeValue = TimeValue>(\n props: TimeFieldInnerProps<T>,\n): JSX.Element {\n const formContext = props.__formContext ?? useContext(FormContext);\n const mergedProps = withFormValidationBehavior(props, formContext);\n const [local, stateProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"__formContext\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isInvalid\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"locale\",\n \"granularity\",\n \"hourCycle\",\n \"shouldForceLeadingZeros\",\n \"validationState\",\n \"validationBehavior\",\n \"validate\",\n \"description\",\n \"errorMessage\",\n \"placeholderValue\",\n ],\n );\n\n const [fieldRef, setFieldRef] = createSignal<HTMLDivElement | null>(null);\n\n const state = createTimeFieldState(stateProps);\n\n const fieldAria = createTimeField(\n () => ({\n ...(rest as Record<string, unknown>),\n description: stateProps.description,\n errorMessage: stateProps.errorMessage,\n }),\n state as unknown as TimeFieldState<TimeValue>,\n fieldRef,\n );\n\n const renderValues = createMemo<TimeFieldRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isRequired: state.isRequired(),\n isInvalid: state.isInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TimeField\",\n },\n renderValues,\n );\n\n const validationBehavior = () =>\n (stateProps as { validationBehavior?: \"aria\" | \"native\" }).validationBehavior ??\n formContext?.validationBehavior ??\n \"native\";\n\n return (\n <TimeFieldStateContext.Provider value={state as unknown as TimeFieldState<TimeValue>}>\n <TimeFieldContext.Provider\n value={{\n state: state as unknown as TimeFieldState<TimeValue>,\n aria: {\n labelProps: fieldAria.labelProps,\n inputProps: fieldAria.inputProps,\n descriptionProps: fieldAria.descriptionProps,\n errorMessageProps: fieldAria.errorMessageProps,\n },\n }}\n >\n <div\n ref={setFieldRef}\n {...fieldAria.fieldProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-required={dataAttr(state.isRequired())}\n data-invalid={dataAttr(state.isInvalid())}\n >\n {local.children as JSX.Element}\n </div>\n <Show when={(rest as Record<string, unknown>).name}>\n <HiddenTimeInput\n name={(rest as Record<string, unknown>).name as string | undefined}\n form={(rest as Record<string, unknown>).form as string | undefined}\n value={state.value()}\n autoComplete={(rest as Record<string, unknown>).autoComplete as string | undefined}\n isDisabled={state.isDisabled()}\n isRequired={state.isRequired()}\n validationBehavior={validationBehavior()}\n validationState={state}\n focus={() => {\n fieldRef()?.querySelector<HTMLElement>('[role=\"spinbutton\"]')?.focus();\n }}\n minValue={access(stateProps.minValue) as TimeValue | undefined}\n maxValue={access(stateProps.maxValue) as TimeValue | undefined}\n granularity={state.granularity}\n />\n </Show>\n </TimeFieldContext.Provider>\n </TimeFieldStateContext.Provider>\n );\n}\n\n/**\n * The input area containing time segments.\n */\nexport function TimeInput(props: TimeInputProps): JSX.Element {\n const { state, aria } = useTimeFieldContextValue();\n const [isFocused, setIsFocused] = createSignal(false);\n\n const renderValues = createMemo<TimeInputRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isFocused: isFocused(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-TimeInput\",\n },\n renderValues,\n );\n\n return (\n <div\n {...aria.inputProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-focused={dataAttr(isFocused())}\n onFocusIn={() => setIsFocused(true)}\n onFocusOut={() => setIsFocused(false)}\n >\n <For each={state.segments()}>{(segment) => props.children?.(segment)}</For>\n </div>\n );\n}\n\n/**\n * A segment of a time field (hour, minute, second, AM/PM).\n */\nexport function TimeSegment(props: TimeSegmentProps): JSX.Element {\n const state = useTimeFieldContext();\n const [segmentRef, setSegmentRef] = createSignal<HTMLDivElement | null>(null);\n\n const segmentAria = createTimeSegment(\n { segment: props.segment },\n state as unknown as TimeFieldState,\n segmentRef,\n );\n\n const renderValues = createMemo<TimeSegmentRenderProps>(() => ({\n isFocused: segmentAria.isFocused,\n isEditable: segmentAria.isEditable,\n isPlaceholder: segmentAria.isPlaceholder,\n type: props.segment.type,\n text: segmentAria.text,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-TimeSegment\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return segmentAria.text;\n };\n\n return (\n <div\n ref={setSegmentRef}\n {...segmentAria.segmentProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={dataAttr(segmentAria.isFocused)}\n data-editable={dataAttr(segmentAria.isEditable)}\n data-placeholder={dataAttr(segmentAria.isPlaceholder)}\n data-type={props.segment.type}\n >\n {getChildren()}\n </div>\n );\n}\n\nexport interface TimeFieldLabelProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function TimeFieldLabel(props: TimeFieldLabelProps): JSX.Element {\n const { aria } = useTimeFieldContextValue();\n return (\n <span {...aria.labelProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport interface TimeFieldDescriptionProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function TimeFieldDescription(props: TimeFieldDescriptionProps): JSX.Element {\n const { aria } = useTimeFieldContextValue();\n return (\n <p {...aria.descriptionProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nexport interface TimeFieldErrorMessageProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function TimeFieldErrorMessage(props: TimeFieldErrorMessageProps): JSX.Element {\n const { aria } = useTimeFieldContextValue();\n return (\n <p {...aria.errorMessageProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nexport type { TimeFieldState, TimeSegmentType, TimeValue };\n","/**\n * DatePicker component for solidaria-components\n *\n * Pre-wired headless date picker component that combines a date field with a calendar popup.\n * Port of react-aria-components/src/DatePicker.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport { Portal } from \"solid-js/web\";\nimport {\n createDatePicker,\n createDateRangePicker,\n createPopover,\n FocusScope,\n useUNSAFE_PortalContext,\n type AriaDatePickerProps,\n type AriaDateRangePickerProps,\n type DatePickerState as AriaDatePickerState,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createDateFieldState,\n createCalendarState,\n createRangeCalendarState,\n createDatePickerState,\n access,\n type DateFieldState,\n type DatePickerState,\n type CalendarStateProps,\n type CalendarState,\n type RangeCalendarState,\n type DateFieldStateProps,\n type CalendarDate,\n type DateValue,\n type RangeCalendarStateProps,\n type RangeValue,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { DateFieldContext } from \"./DateField\";\nimport { CalendarContext } from \"./Calendar\";\nimport { RangeCalendarContext } from \"./RangeCalendar\";\nimport { HiddenDateInput } from \"./HiddenDateInput\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport {\n DateRangePickerContext,\n useDateRangePickerContext,\n type DateRangePickerContextValue,\n type DateRangePickerFieldContextValue,\n} from \"./DateRangePickerContext\";\n\nexport interface DatePickerRenderProps {\n /** Whether the picker is disabled. */\n isDisabled: boolean;\n /** Whether the picker is read-only. */\n isReadOnly: boolean;\n /** Whether the picker is required. */\n isRequired: boolean;\n /** Whether the picker is invalid. */\n isInvalid: boolean;\n /** Whether the calendar is open. */\n isOpen: boolean;\n}\n\nexport interface DateRangePickerRenderProps extends Omit<DatePickerRenderProps, \"isInvalid\"> {\n isInvalid: boolean;\n}\n\nexport interface DatePickerContextValue {\n fieldState: DateFieldState<DateValue>;\n datePickerState: DatePickerState<DateValue>;\n calendarState: CalendarState<DateValue>;\n overlayState: {\n isOpen: boolean;\n open: () => void;\n close: () => void;\n toggle: () => void;\n };\n triggerRef: () => HTMLElement | null;\n setTriggerRef: (element: HTMLElement | null) => void;\n pickerAria: ReturnType<typeof createDatePicker>;\n}\n\nexport type DatePickerProps<T extends DateValue = DateValue> = Omit<\n AriaDatePickerProps,\n \"id\" | \"isDisabled\" | \"isReadOnly\" | \"isRequired\" | \"minValue\" | \"maxValue\"\n> &\n Omit<DateFieldStateProps<T>, \"locale\"> &\n SlotProps & {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DatePickerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DatePickerRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Whether the calendar should close when a date is selected. */\n shouldCloseOnSelect?: boolean;\n /** Whether the overlay is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Whether the overlay is open (controlled). */\n isOpen?: boolean;\n /** Callback when the overlay open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** The name for the hidden date input used in HTML form submission. */\n name?: string;\n /** The associated form id for the hidden date input. */\n form?: string;\n /** The number of months to display in the calendar popover. */\n visibleMonths?: number;\n /** Controls whether calendar paging advances by one month or by the visible month range. */\n pageBehavior?: CalendarStateProps<T>[\"pageBehavior\"];\n /** Determines how visible months align around the initial focused date. */\n selectionAlignment?: CalendarStateProps<T>[\"selectionAlignment\"];\n /** A function that determines whether a date is disabled. */\n isDateDisabled?: (date: DateValue) => boolean;\n };\n\nexport interface DateRangePickerProps<T extends DateValue = DateValue>\n extends\n Omit<AriaDateRangePickerProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n children?: JSX.Element;\n class?: ClassNameOrFunction<DateRangePickerRenderProps>;\n style?: StyleOrFunction<DateRangePickerRenderProps>;\n locale?: string;\n shouldCloseOnSelect?: boolean;\n /** Whether the overlay is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Whether the overlay is open (controlled). */\n isOpen?: boolean;\n /** Callback when the overlay open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** The granularity of the date/time fields. */\n granularity?: \"day\" | \"hour\" | \"minute\" | \"second\";\n /** Whether to show the hour in 12 or 24 hour format. */\n hourCycle?: 12 | 24;\n /** Whether to hide the time zone in date/time fields. */\n hideTimeZone?: boolean;\n /** The placeholder date used to determine segment structure. */\n placeholderValue?: DateValue;\n /** The name for the start date input used in HTML form submission. */\n startName?: string;\n /** The name for the end date input used in HTML form submission. */\n endName?: string;\n /** The associated form id for the hidden start/end date inputs. */\n form?: string;\n /** Controls whether native or ARIA validation should be used. */\n validationBehavior?: \"native\" | \"aria\";\n}\n\nexport interface DatePickerButtonRenderProps {\n /** Whether the button is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is open. */\n isOpen: boolean;\n}\n\nexport interface DatePickerButtonProps extends SlotProps {\n /** The children of the component. */\n children?: RenderChildren<DatePickerButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DatePickerButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DatePickerButtonRenderProps>;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\nexport interface DateRangePickerButtonProps extends DatePickerButtonProps {}\n\nexport const DatePickerContext = createContext<DatePickerContextValue | null>(null);\nexport const DatePickerStateContext = createContext<DateFieldState<DateValue> | null>(null);\nexport const DateRangePickerStateContext = createContext<RangeCalendarState<DateValue> | null>(\n null,\n);\nexport { DateRangePickerContext, useDateRangePickerContext } from \"./DateRangePickerContext\";\nexport type {\n DateRangePickerContextValue,\n DateRangePickerFieldContextValue,\n} from \"./DateRangePickerContext\";\n\nfunction withFormValidationBehavior<P extends object>(props: P, formContext: FormProps | null): P {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nexport function useDatePickerContext(): DatePickerContextValue {\n const context = useContext(DatePickerContext);\n if (!context) {\n throw new Error(\"DatePicker components must be used within a DatePicker\");\n }\n return context;\n}\n\n/**\n * A date picker combines a DateField and a Calendar popover.\n *\n * @example\n * ```tsx\n * <DatePicker label=\"Event date\">\n * <Label>Event date</Label>\n * <Group>\n * <DateInput>\n * {(segment) => <DateSegment segment={segment} />}\n * </DateInput>\n * <DatePickerButton>📅</DatePickerButton>\n * </Group>\n * <Popover>\n * <Dialog>\n * <Calendar>\n * <CalendarGrid>\n * {(date) => <CalendarCell date={date} />}\n * </CalendarGrid>\n * </Calendar>\n * </Dialog>\n * </Popover>\n * </DatePicker>\n * ```\n */\nexport function DatePicker<T extends DateValue = CalendarDate>(\n props: DatePickerProps<T>,\n): JSX.Element {\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n const formContext = useContext(FormContext);\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div class=\"solidaria-DatePicker solidaria-DatePicker--placeholder\" aria-hidden=\"true\" />\n }\n >\n <DatePickerInner {...props} __formContext={formContext} />\n </Show>\n );\n}\n\ntype DatePickerInnerProps<T extends DateValue = DateValue> = DatePickerProps<T> & {\n __formContext?: FormProps | null;\n};\n\n/**\n * Internal DatePicker component that renders after client mount.\n */\nfunction DatePickerInner<T extends DateValue = CalendarDate>(\n props: DatePickerInnerProps<T>,\n): JSX.Element {\n const formContext = props.__formContext ?? useContext(FormContext);\n const mergedProps = withFormValidationBehavior(props, formContext);\n const [local, stateProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"shouldCloseOnSelect\", \"__formContext\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"minValue\",\n \"maxValue\",\n \"isInvalid\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"locale\",\n \"granularity\",\n \"hourCycle\",\n \"hideTimeZone\",\n \"placeholderValue\",\n \"shouldForceLeadingZeros\",\n \"createCalendar\",\n \"validationState\",\n \"validationBehavior\",\n \"validate\",\n \"description\",\n \"errorMessage\",\n \"isDateUnavailable\",\n \"firstDayOfWeek\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n ],\n );\n\n const [triggerRef, setTriggerRef] = createSignal<HTMLElement | null>(null);\n const [fieldRef, setFieldRef] = createSignal<HTMLDivElement | null>(null);\n\n // Unified state using createDatePickerState as single source of truth\n const datePickerState = createDatePickerState<T>({\n ...(stateProps as unknown as import(\"@proyecto-viviana/solid-stately\").DatePickerStateOptions<T>),\n shouldCloseOnSelect: local.shouldCloseOnSelect,\n });\n\n const overlayState = {\n get isOpen() {\n return datePickerState.isOpen();\n },\n open: datePickerState.open,\n close: datePickerState.close,\n toggle: () => datePickerState.setOpen(!datePickerState.isOpen()),\n };\n\n // Create field state synced through datePickerState\n const fieldState = createDateFieldState<T>({\n ...stateProps,\n value: () => datePickerState.value(),\n onChange: (value) => {\n datePickerState.setValue(value);\n },\n });\n\n // Create calendar state synced through datePickerState\n const calendarState = createCalendarState<T>({\n value: () => datePickerState.value(),\n onChange: (value) => {\n if (!value) {\n return;\n }\n datePickerState.setDateValue(value);\n },\n minValue: stateProps.minValue,\n maxValue: stateProps.maxValue,\n isDisabled: stateProps.isDisabled,\n isReadOnly: stateProps.isReadOnly,\n locale: stateProps.locale,\n createCalendar: stateProps.createCalendar as CalendarStateProps<T>[\"createCalendar\"],\n isDateUnavailable: stateProps.isDateUnavailable,\n firstDayOfWeek: stateProps.firstDayOfWeek as 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined,\n visibleMonths: stateProps.visibleMonths,\n pageBehavior: stateProps.pageBehavior,\n selectionAlignment: stateProps.selectionAlignment,\n isDateDisabled: stateProps.isDateDisabled,\n });\n\n // Create date picker ARIA props\n const pickerAria = createDatePicker(\n () => ({\n ...(rest as Record<string, unknown>),\n description: stateProps.description,\n errorMessage: stateProps.errorMessage,\n }),\n fieldState as unknown as DateFieldState<DateValue>,\n overlayState as AriaDatePickerState,\n calendarState as unknown as CalendarState<DateValue>,\n );\n\n const contextValue: DatePickerContextValue = {\n fieldState: fieldState as unknown as DateFieldState<DateValue>,\n datePickerState: datePickerState as unknown as DatePickerState<DateValue>,\n calendarState: calendarState as unknown as CalendarState<DateValue>,\n overlayState,\n triggerRef,\n setTriggerRef: (element) => {\n if (!element) return;\n const current = triggerRef();\n if (!current || !current.isConnected) {\n setTriggerRef(() => element);\n }\n },\n pickerAria,\n };\n\n const isInvalid = createMemo(\n () =>\n fieldState.isInvalid() ||\n datePickerState.builtinValidation().isInvalid ||\n Boolean(stateProps.isInvalid),\n );\n\n const renderValues = createMemo<DatePickerRenderProps>(() => ({\n isDisabled: fieldState.isDisabled(),\n isReadOnly: fieldState.isReadOnly(),\n isRequired: fieldState.isRequired(),\n isInvalid: isInvalid(),\n isOpen: overlayState.isOpen,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-DatePicker\",\n },\n renderValues,\n );\n\n const validationBehavior = () =>\n (stateProps as { validationBehavior?: \"aria\" | \"native\" }).validationBehavior ??\n formContext?.validationBehavior ??\n \"native\";\n\n return (\n <DatePickerStateContext.Provider value={fieldState as unknown as DateFieldState<DateValue>}>\n <DatePickerContext.Provider value={contextValue}>\n {/* Also provide DateFieldContext so DateInput/DateSegment work inside DatePicker */}\n <DateFieldContext.Provider\n value={{\n state: fieldState as unknown as DateFieldState<DateValue>,\n aria: {\n labelProps: pickerAria.labelProps,\n inputProps: pickerAria.fieldProps,\n descriptionProps: pickerAria.descriptionProps,\n errorMessageProps: pickerAria.errorMessageProps,\n },\n }}\n >\n <CalendarContext.Provider value={calendarState as unknown as CalendarState<DateValue>}>\n <div\n ref={setFieldRef}\n {...pickerAria.groupProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(fieldState.isDisabled())}\n data-readonly={dataAttr(fieldState.isReadOnly())}\n data-required={dataAttr(fieldState.isRequired())}\n data-invalid={dataAttr(isInvalid())}\n data-open={dataAttr(overlayState.isOpen)}\n >\n {props.children}\n </div>\n <Show when={(rest as Record<string, unknown>).name}>\n <HiddenDateInput\n name={(rest as Record<string, unknown>).name as string | undefined}\n form={(rest as Record<string, unknown>).form as string | undefined}\n value={() => datePickerState.value()}\n autoComplete={(rest as Record<string, unknown>).autoComplete as string | undefined}\n isDisabled={fieldState.isDisabled()}\n isRequired={fieldState.isRequired()}\n validationBehavior={validationBehavior()}\n validationState={fieldState}\n focus={() => {\n fieldRef()?.querySelector<HTMLElement>('[role=\"spinbutton\"]')?.focus();\n }}\n minValue={() => access(stateProps.minValue) as DateValue | undefined}\n maxValue={() => access(stateProps.maxValue) as DateValue | undefined}\n granularity={datePickerState.granularity}\n />\n </Show>\n </CalendarContext.Provider>\n </DateFieldContext.Provider>\n </DatePickerContext.Provider>\n </DatePickerStateContext.Provider>\n );\n}\n\nexport function DateRangePicker<T extends DateValue = CalendarDate>(\n props: DateRangePickerProps<T>,\n): JSX.Element {\n const isHydrated = useIsHydrated();\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div\n class=\"solidaria-DateRangePicker solidaria-DateRangePicker--placeholder\"\n aria-hidden=\"true\"\n />\n }\n >\n <DateRangePickerInner {...props} />\n </Show>\n );\n}\n\nfunction DateRangePickerInner<T extends DateValue = CalendarDate>(\n props: DateRangePickerProps<T>,\n): JSX.Element {\n const [local, overlayProps, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"shouldCloseOnSelect\"],\n [\"defaultOpen\", \"isOpen\", \"onOpenChange\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"granularity\",\n \"hourCycle\",\n \"hideTimeZone\",\n \"placeholderValue\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n \"pageBehavior\",\n \"selectionAlignment\",\n ],\n );\n\n const [internalOpen, setInternalOpen] = createSignal(overlayProps.defaultOpen ?? false);\n const isOpen = () => access(overlayProps.isOpen) ?? internalOpen();\n const setOpen = (open: boolean) => {\n if (access(overlayProps.isOpen) === undefined) {\n setInternalOpen(open);\n }\n overlayProps.onOpenChange?.(open);\n };\n\n let triggerRef: HTMLElement | null = null;\n const overlayState = {\n get isOpen() {\n return isOpen();\n },\n open: () => setOpen(true),\n close: () => setOpen(false),\n toggle: () => setOpen(!isOpen()),\n };\n\n const [internalRangeValue, setInternalRangeValue] = createSignal<RangeValue<T> | null>(\n stateProps.defaultValue ?? null,\n );\n const currentRangeValue = createMemo<RangeValue<T> | null>(() => {\n const controlled = access(stateProps.value);\n return controlled !== undefined ? controlled : internalRangeValue();\n });\n const setCommittedRangeValue = (value: RangeValue<T> | null) => {\n if (access(stateProps.value) === undefined) {\n setInternalRangeValue(() => value);\n }\n stateProps.onChange?.(value);\n };\n\n const calendarState = createRangeCalendarState({\n ...stateProps,\n value: currentRangeValue,\n onChange: (value) => {\n setCommittedRangeValue(value);\n if (local.shouldCloseOnSelect !== false && value?.start && value?.end) {\n setOpen(false);\n }\n },\n });\n\n const isInvalid = createMemo(\n () =>\n Boolean((rest as { isInvalid?: boolean }).isInvalid) ||\n calendarState.validationState() === \"invalid\",\n );\n const isRequired = createMemo(() => Boolean((rest as { isRequired?: boolean }).isRequired));\n const [startFieldValue, setStartFieldValue] = createSignal<T | null>(\n currentRangeValue()?.start ?? null,\n );\n const [endFieldValue, setEndFieldValue] = createSignal<T | null>(\n currentRangeValue()?.end ?? null,\n );\n const rangeGranularity = createMemo<\"day\" | \"hour\" | \"minute\" | \"second\">(() => {\n if (stateProps.granularity) {\n return stateProps.granularity;\n }\n const value = currentRangeValue()?.start ?? currentRangeValue()?.end;\n if (value && \"hour\" in value) {\n return \"second\" in value ? \"second\" : \"minute\";\n }\n return \"day\";\n });\n\n createEffect(() => {\n const value = currentRangeValue();\n setStartFieldValue(() => value?.start ?? null);\n setEndFieldValue(() => value?.end ?? null);\n });\n\n const setRangeFieldValue = (part: \"start\" | \"end\", nextValue: T | null) => {\n if (part === \"start\") {\n setStartFieldValue(() => nextValue);\n } else {\n setEndFieldValue(() => nextValue);\n }\n\n const nextStart = part === \"start\" ? nextValue : startFieldValue();\n const nextEnd = part === \"end\" ? nextValue : endFieldValue();\n\n setCommittedRangeValue(\n nextStart && nextEnd ? ({ start: nextStart, end: nextEnd } as RangeValue<T>) : null,\n );\n };\n\n const rangeFieldStateProps = {\n minValue: stateProps.minValue,\n maxValue: stateProps.maxValue,\n isDisabled: stateProps.isDisabled,\n isReadOnly: stateProps.isReadOnly,\n isRequired,\n locale: access(stateProps.locale),\n granularity: rangeGranularity(),\n hourCycle: stateProps.hourCycle,\n hideTimeZone: stateProps.hideTimeZone,\n placeholderValue: stateProps.placeholderValue,\n validationState: () => (isInvalid() ? \"invalid\" : access(stateProps.validationState)),\n isDateUnavailable: stateProps.isDateUnavailable,\n } satisfies Partial<DateFieldStateProps<T>>;\n\n const startFieldState = createDateFieldState<T>({\n ...rangeFieldStateProps,\n value: startFieldValue,\n onChange: (value) => setRangeFieldValue(\"start\", value),\n });\n\n const endFieldState = createDateFieldState<T>({\n ...rangeFieldStateProps,\n value: endFieldValue,\n onChange: (value) => setRangeFieldValue(\"end\", value),\n });\n\n const pickerAria = createDateRangePicker(\n () => ({\n ...(rest as Record<string, unknown>),\n description: (props as { description?: string }).description,\n errorMessage: (props as { errorMessage?: string }).errorMessage,\n }),\n calendarState as unknown as RangeCalendarState<DateValue>,\n overlayState as AriaDatePickerState,\n );\n\n const startFieldContext: DateRangePickerFieldContextValue = {\n state: startFieldState as unknown as DateFieldState<DateValue>,\n aria: {\n labelProps: {},\n get inputProps() {\n return pickerAria.startInputProps;\n },\n get descriptionProps() {\n return pickerAria.descriptionProps;\n },\n get errorMessageProps() {\n return pickerAria.errorMessageProps;\n },\n },\n };\n\n const endFieldContext: DateRangePickerFieldContextValue = {\n state: endFieldState as unknown as DateFieldState<DateValue>,\n aria: {\n labelProps: {},\n get inputProps() {\n return pickerAria.endInputProps;\n },\n get descriptionProps() {\n return pickerAria.descriptionProps;\n },\n get errorMessageProps() {\n return pickerAria.errorMessageProps;\n },\n },\n };\n\n const contextValue: DateRangePickerContextValue = {\n calendarState: calendarState as unknown as RangeCalendarState<DateValue>,\n startFieldState: startFieldState as unknown as DateFieldState<DateValue>,\n endFieldState: endFieldState as unknown as DateFieldState<DateValue>,\n startFieldContext,\n endFieldContext,\n overlayState,\n triggerRef: () => triggerRef,\n setTriggerRef: (element) => {\n if (!element) return;\n if (!triggerRef || !triggerRef.isConnected) triggerRef = element;\n },\n pickerAria,\n };\n\n const renderValues = createMemo<DateRangePickerRenderProps>(() => ({\n isDisabled: calendarState.isDisabled(),\n isReadOnly: calendarState.isReadOnly(),\n isRequired: isRequired(),\n isInvalid: isInvalid(),\n isOpen: overlayState.isOpen,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-DateRangePicker\",\n },\n renderValues,\n );\n\n return (\n <DateRangePickerStateContext.Provider\n value={calendarState as unknown as RangeCalendarState<DateValue>}\n >\n <DateRangePickerContext.Provider value={contextValue}>\n <RangeCalendarContext.Provider\n value={calendarState as unknown as RangeCalendarState<DateValue>}\n >\n <div\n {...pickerAria.groupProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(calendarState.isDisabled())}\n data-readonly={dataAttr(calendarState.isReadOnly())}\n data-required={dataAttr(isRequired())}\n data-invalid={dataAttr(isInvalid())}\n data-open={dataAttr(overlayState.isOpen)}\n >\n {props.children}\n </div>\n <Show when={(rest as Record<string, unknown>).startName}>\n <HiddenDateInput\n name={(rest as Record<string, unknown>).startName as string | undefined}\n form={(rest as Record<string, unknown>).form as string | undefined}\n value={() => currentRangeValue()?.start ?? null}\n isDisabled={access(stateProps.isDisabled) ?? false}\n minValue={() => access(stateProps.minValue) as DateValue | undefined}\n maxValue={() => access(stateProps.maxValue) as DateValue | undefined}\n granularity={rangeGranularity()}\n />\n </Show>\n <Show when={(rest as Record<string, unknown>).endName}>\n <HiddenDateInput\n name={(rest as Record<string, unknown>).endName as string | undefined}\n form={(rest as Record<string, unknown>).form as string | undefined}\n value={() => currentRangeValue()?.end ?? null}\n isDisabled={access(stateProps.isDisabled) ?? false}\n minValue={() => access(stateProps.minValue) as DateValue | undefined}\n maxValue={() => access(stateProps.maxValue) as DateValue | undefined}\n granularity={rangeGranularity()}\n />\n </Show>\n </RangeCalendarContext.Provider>\n </DateRangePickerContext.Provider>\n </DateRangePickerStateContext.Provider>\n );\n}\n\n/**\n * A button that opens the date picker calendar.\n */\nexport function DatePickerButton(props: DatePickerButtonProps): JSX.Element {\n const context = useDatePickerContext();\n\n const renderValues = createMemo<DatePickerButtonRenderProps>(() => ({\n isDisabled: context.fieldState.isDisabled() || (props.isDisabled ?? false),\n isOpen: context.overlayState.isOpen,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-DatePickerButton\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return props.children ?? \"📅\";\n };\n\n return (\n <button\n ref={(el) => {\n context.setTriggerRef(el);\n }}\n {...context.pickerAria.buttonProps}\n class={renderProps.class()}\n style={renderProps.style()}\n disabled={context.fieldState.isDisabled() || props.isDisabled}\n data-disabled={dataAttr(context.fieldState.isDisabled() || props.isDisabled)}\n data-open={dataAttr(context.overlayState.isOpen)}\n >\n {getChildren()}\n </button>\n );\n}\n\nexport function DateRangePickerButton(props: DateRangePickerButtonProps): JSX.Element {\n const context = useDateRangePickerContext();\n\n const renderValues = createMemo<DatePickerButtonRenderProps>(() => ({\n isDisabled: context.calendarState.isDisabled() || (props.isDisabled ?? false),\n isOpen: context.overlayState.isOpen,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-DateRangePickerButton\",\n },\n renderValues,\n );\n\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return props.children ?? \"📅\";\n };\n\n return (\n <button\n ref={(el) => context.setTriggerRef(el)}\n {...context.pickerAria.buttonProps}\n class={renderProps.class()}\n style={renderProps.style()}\n disabled={context.calendarState.isDisabled() || props.isDisabled}\n data-disabled={dataAttr(context.calendarState.isDisabled() || props.isDisabled)}\n data-open={dataAttr(context.overlayState.isOpen)}\n >\n {getChildren()}\n </button>\n );\n}\n\nexport interface DatePickerContentProps extends SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\nexport interface DateRangePickerContentProps extends DatePickerContentProps {}\n\nexport interface DatePickerLabelProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DatePickerLabel(props: DatePickerLabelProps): JSX.Element {\n const context = useDatePickerContext();\n return (\n <span {...context.pickerAria.labelProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport interface DatePickerDescriptionProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DatePickerDescription(props: DatePickerDescriptionProps): JSX.Element {\n const context = useDatePickerContext();\n return (\n <p {...context.pickerAria.descriptionProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nexport interface DatePickerErrorMessageProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DatePickerErrorMessage(props: DatePickerErrorMessageProps): JSX.Element {\n const context = useDatePickerContext();\n return (\n <p {...context.pickerAria.errorMessageProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nexport interface DateRangePickerLabelProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DateRangePickerLabel(props: DateRangePickerLabelProps): JSX.Element {\n const context = useDateRangePickerContext();\n return (\n <span {...context.pickerAria.labelProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport interface DateRangePickerDescriptionProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DateRangePickerDescription(props: DateRangePickerDescriptionProps): JSX.Element {\n const context = useDateRangePickerContext();\n return (\n <p {...context.pickerAria.descriptionProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nexport interface DateRangePickerErrorMessageProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DateRangePickerErrorMessage(props: DateRangePickerErrorMessageProps): JSX.Element {\n const context = useDateRangePickerContext();\n return (\n <p {...context.pickerAria.errorMessageProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nfunction createEscapeDismissFallback(isOpen: () => boolean, close: () => void): void {\n createEffect(() => {\n if (!isOpen() || typeof document === \"undefined\") return;\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing) return;\n close();\n };\n\n document.addEventListener(\"keydown\", onKeyDown);\n onCleanup(() => document.removeEventListener(\"keydown\", onKeyDown));\n });\n}\n\n/**\n * The content area of the date picker (typically contains a Calendar).\n */\nexport function DatePickerContent(props: DatePickerContentProps): JSX.Element {\n const context = useDatePickerContext();\n const portalContext = useUNSAFE_PortalContext();\n let contentRef: HTMLDivElement | undefined;\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n\n const popoverAria = createPopover(\n {\n triggerRef: () => context.triggerRef()?.parentElement ?? context.triggerRef(),\n popoverRef: () => contentRef ?? null,\n placement: \"bottom start\",\n offset: 8,\n isNonModal: false,\n isKeyboardDismissDisabled: false,\n },\n {\n isOpen: () => context.overlayState.isOpen,\n open: context.overlayState.open,\n close: context.overlayState.close,\n toggle: context.overlayState.toggle,\n },\n );\n\n createEscapeDismissFallback(() => context.overlayState.isOpen, context.overlayState.close);\n\n const cleanPopoverProps = () => {\n const {\n style: _style,\n ref: _ref,\n ...rest\n } = popoverAria.popoverProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = (): JSX.CSSProperties => {\n const popoverStyle = (popoverAria.popoverProps as Record<string, unknown>).style as\n | JSX.CSSProperties\n | undefined;\n return {\n ...popoverStyle,\n ...props.style,\n };\n };\n\n // Return focus to trigger when overlay closes\n createEffect(() => {\n const open = context.overlayState.isOpen;\n if (!open) {\n requestAnimationFrame(() => context.triggerRef()?.focus());\n }\n });\n\n return (\n <Show when={context.overlayState.isOpen}>\n <Portal mount={portalContainer()}>\n <FocusScope contain restoreFocus>\n <div\n ref={contentRef}\n {...cleanPopoverProps()}\n {...context.pickerAria.dialogProps}\n tabIndex={-1}\n class={props.class ?? \"solidaria-DatePickerContent\"}\n style={mergedStyle()}\n data-placement={popoverAria.placement() ?? undefined}\n >\n {props.children}\n </div>\n </FocusScope>\n </Portal>\n </Show>\n );\n}\n\nexport function DateRangePickerContent(props: DateRangePickerContentProps): JSX.Element {\n const context = useDateRangePickerContext();\n const portalContext = useUNSAFE_PortalContext();\n let contentRef: HTMLDivElement | undefined;\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n\n const popoverAria = createPopover(\n {\n triggerRef: () => context.triggerRef()?.parentElement ?? context.triggerRef(),\n popoverRef: () => contentRef ?? null,\n placement: \"bottom start\",\n offset: 8,\n isNonModal: false,\n isKeyboardDismissDisabled: false,\n },\n {\n isOpen: () => context.overlayState.isOpen,\n open: context.overlayState.open,\n close: context.overlayState.close,\n toggle: context.overlayState.toggle,\n },\n );\n\n createEscapeDismissFallback(() => context.overlayState.isOpen, context.overlayState.close);\n\n const cleanPopoverProps = () => {\n const {\n style: _style,\n ref: _ref,\n ...rest\n } = popoverAria.popoverProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = (): JSX.CSSProperties => {\n const popoverStyle = (popoverAria.popoverProps as Record<string, unknown>).style as\n | JSX.CSSProperties\n | undefined;\n return {\n ...popoverStyle,\n ...props.style,\n };\n };\n\n // Return focus to trigger when overlay closes\n createEffect(() => {\n const open = context.overlayState.isOpen;\n if (!open) {\n requestAnimationFrame(() => context.triggerRef()?.focus());\n }\n });\n\n return (\n <Show when={context.overlayState.isOpen}>\n <Portal mount={portalContainer()}>\n <FocusScope contain restoreFocus>\n <div\n ref={contentRef}\n {...cleanPopoverProps()}\n {...context.pickerAria.dialogProps}\n tabIndex={-1}\n class={props.class ?? \"solidaria-DateRangePickerContent\"}\n style={mergedStyle()}\n data-placement={popoverAria.placement() ?? undefined}\n >\n {props.children}\n </div>\n </FocusScope>\n </Portal>\n </Show>\n );\n}\n\nexport { HiddenDateInput } from \"./HiddenDateInput\";\nexport type { HiddenDateInputProps } from \"./HiddenDateInput\";\n\n// DatePickerContextValue is already exported at declaration\n","/**\n * Table component for solidaria-components\n *\n * A pre-wired headless table that combines state + aria hooks.\n * Based on react-aria-components/src/Table.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createUniqueId,\n createSignal,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createTable,\n createTableColumnHeader,\n createTableRow,\n createTableCell,\n createTableRowGroup,\n createTableSelectionCheckbox,\n createTableSelectAllCheckbox,\n createFocusRing,\n isFocusVisible as isGlobalFocusVisible,\n getTableData,\n createHover,\n mergeProps,\n type AriaTableProps,\n createTableColumnResize,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createTableState,\n createTableCollection,\n createTableColumnResizeState,\n type TableState,\n type TableCollection,\n type TableColumnResizeState,\n type Key,\n type SortDescriptor,\n type ColumnDefinition,\n type ColumnSize,\n type GridNode,\n type DropTarget,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n dataAttr,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport { type DragAndDropHooks } from \"./useDragAndDrop\";\nimport { ButtonContext, type ButtonProps } from \"./Button\";\nimport {\n CollectionRendererContext,\n type CollectionRendererContextValue,\n useCollectionRenderer,\n} from \"./Collection\";\nimport { useVirtualizerContext } from \"./Virtualizer\";\nimport {\n type LinkDOMProps,\n type RouterOptions,\n useRouter,\n useLinkProps,\n type RouterClickModifiers,\n} from \"./RouterProvider\";\nimport {\n getNormalizedDropTargetKey,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n} from \"./DragAndDrop\";\n\nexport interface TableRenderProps {\n /** Whether the table has focus. */\n isFocused: boolean;\n /** Whether the table has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the table is disabled. */\n isDisabled: boolean;\n /** Whether the table is empty. */\n isEmpty: boolean;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\nexport type TableColumnDefinition<T = unknown> = Omit<ColumnDefinition<T>, \"key\" | \"children\"> & {\n /** React Spectrum-style alias for the column key. */\n id?: Key;\n key?: Key;\n children?: TableColumnDefinition<T>[];\n};\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") ref(el);\n else ref.current = el;\n}\n\nfunction normalizeColumnDefinitions<T>(\n columns: TableColumnDefinition<T>[],\n parentKey?: Key,\n): (ColumnDefinition<T> & { id?: Key })[] {\n return columns.map((column, index) => {\n const key = column.key ?? column.id ?? (parentKey == null ? index : `${parentKey}-${index}`);\n const id = column.id ?? column.key;\n\n return {\n ...column,\n key,\n id,\n children: column.children ? normalizeColumnDefinitions(column.children, key) : undefined,\n } as ColumnDefinition<T> & { id?: Key };\n });\n}\n\nfunction getRowHeaderColumnKeys<T>(columns: (ColumnDefinition<T> & { id?: Key })[]): Set<Key> {\n const keys = new Set<Key>();\n\n for (const column of columns) {\n if (column.isRowHeader) {\n keys.add(column.key);\n }\n\n if (column.children) {\n for (const key of getRowHeaderColumnKeys(\n column.children as (ColumnDefinition<T> & {\n id?: Key;\n })[],\n )) {\n keys.add(key);\n }\n }\n }\n\n return keys;\n}\n\nexport interface TableProps<T extends object> extends Omit<AriaTableProps, \"children\">, SlotProps {\n /** The data items to render in the table. */\n items: T[];\n /** The column definitions. */\n columns: TableColumnDefinition<T>[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item for a column. */\n getTextValue?: (item: T, column: TableColumnDefinition<T>) => string;\n /** The selection mode. */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n /** The selection behavior (toggle vs replace). */\n selectionBehavior?: \"toggle\" | \"replace\";\n /** Whether disabled rows remain focusable. */\n disabledBehavior?: \"selection\" | \"all\";\n /** Whether Escape clears selection. */\n escapeKeyBehavior?: \"clearSelection\" | \"none\";\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Currently selected keys (controlled). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** The current sort descriptor. */\n sortDescriptor?: SortDescriptor;\n /** Handler called when sort changes. */\n onSortChange?: (descriptor: SortDescriptor) => void;\n /** Whether to show selection checkboxes. */\n showSelectionCheckboxes?: boolean;\n /** The children of the component. */\n children?: JSX.Element | RenderChildren<TableRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TableRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TableRenderProps>;\n /** A function to render when the table is empty. */\n renderEmptyState?: () => JSX.Element;\n /** Ref for the table element. */\n ref?: RefLike<HTMLTableElement>;\n /** Custom renderer for the table element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLTableElement>,\n renderProps: TableRenderProps,\n ) => JSX.Element;\n /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<T>;\n}\n\nexport interface TableHeaderRenderProps {\n /** Whether the header has focus. */\n isFocused: boolean;\n /** Whether the header is being hovered. */\n isHovered: boolean;\n}\n\nexport interface TableHeaderProps extends SlotProps {\n /** The children (usually TableColumn components). */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TableHeaderRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TableHeaderRenderProps>;\n /** Ref for the table header element. */\n ref?: RefLike<HTMLTableSectionElement>;\n /** Custom renderer for the table header element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLTableSectionElement>,\n renderProps: TableHeaderRenderProps,\n ) => JSX.Element;\n}\n\nexport interface TableColumnRenderProps {\n /** Whether the column is focused. */\n isFocused: boolean;\n /** Whether the column has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the column is sortable. */\n isSortable: boolean;\n /** The current sort direction ('ascending', 'descending', or undefined). */\n sortDirection: \"ascending\" | \"descending\" | undefined;\n /** Whether the column is being hovered. */\n isHovered: boolean;\n /** Whether the column allows resizing. */\n allowsResizing: boolean;\n /** Whether the column is currently being resized. */\n isResizing: boolean;\n}\n\nexport interface TableColumnProps extends SlotProps {\n /** The unique key for the column. */\n id: Key;\n /** Whether the column allows sorting. */\n allowsSorting?: boolean;\n /** Whether the column allows resizing. */\n allowsResizing?: boolean;\n /** Column width (number for px, string for 'Xfr', 'X%', 'Xpx'). */\n width?: ColumnSize;\n /** Default width for uncontrolled mode. */\n defaultWidth?: ColumnSize;\n /** Minimum column width in px. */\n minWidth?: number;\n /** Maximum column width in px. */\n maxWidth?: number;\n /** The children of the column. */\n children?: RenderChildren<TableColumnRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TableColumnRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TableColumnRenderProps>;\n /** Ref for the column header element. */\n ref?: RefLike<HTMLTableCellElement>;\n /** Custom renderer for the column header element. */\n render?: (\n props: JSX.ThHTMLAttributes<HTMLTableCellElement>,\n renderProps: TableColumnRenderProps,\n ) => JSX.Element;\n}\n\nexport interface TableBodyRenderProps {\n /** Whether the body is empty. */\n isEmpty: boolean;\n}\n\nexport interface TableBodyProps<T> extends SlotProps {\n /** The items to render. If not provided, uses items from Table. */\n items?: T[];\n /** The children (usually a render function for TableRow). */\n children?: (item: T) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TableBodyRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TableBodyRenderProps>;\n /** A function to render when the body is empty. */\n renderEmptyState?: () => JSX.Element;\n /** Whether there are more rows to load. */\n hasMore?: boolean;\n /** Whether additional rows are currently loading. */\n isLoading?: boolean;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Ref for the table body element. */\n ref?: RefLike<HTMLTableSectionElement>;\n /** Custom renderer for the table body element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLTableSectionElement>,\n renderProps: TableBodyRenderProps,\n ) => JSX.Element;\n}\n\nexport interface TableFooterRenderProps {\n /** Whether the footer has no items. */\n isEmpty: boolean;\n}\n\nexport interface TableFooterProps<T> extends SlotProps {\n /** The footer items to render. */\n items?: T[];\n /** The children, or a render function when `items` is provided. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TableFooterRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TableFooterRenderProps>;\n}\n\nexport interface TableRowRenderProps {\n /** Whether the row is selected. */\n isSelected: boolean;\n /** Whether the row is focused. */\n isFocused: boolean;\n /** Whether the row has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the row is pressed. */\n isPressed: boolean;\n /** Whether the row is hovered. */\n isHovered: boolean;\n /** Whether the row is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TableRowProps<T> extends SlotProps {\n /** The unique key for the row. */\n id?: Key;\n /** The item value. */\n item?: T;\n /** Columns to render when children is a column render function. */\n columns?: TableColumnDefinition<T>[];\n /** Whether the row is disabled. */\n isDisabled?: boolean;\n /** The children of the row (usually TableCell components). */\n children?:\n | JSX.Element\n | RenderChildren<TableRowRenderProps>\n | ((column: TableColumnDefinition<T>) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TableRowRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TableRowRenderProps>;\n /** Handler called when the row is activated (double-click or Enter). */\n onAction?: () => void;\n /** The URL this row links to. */\n href?: string;\n /** Link target for linked rows. */\n target?: LinkDOMProps[\"target\"];\n /** Link relationship for linked rows. */\n rel?: LinkDOMProps[\"rel\"];\n /** Download attribute for linked rows. */\n download?: LinkDOMProps[\"download\"];\n /** Ping attribute for linked rows. */\n ping?: LinkDOMProps[\"ping\"];\n /** Referrer policy for linked rows. */\n referrerPolicy?: LinkDOMProps[\"referrerPolicy\"];\n /** Router options for linked rows. */\n routerOptions?: RouterOptions;\n /** Ref for the table row element. */\n ref?: RefLike<HTMLTableRowElement>;\n /** Custom renderer for the table row element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLTableRowElement>,\n renderProps: TableRowRenderProps,\n ) => JSX.Element;\n}\n\nexport interface TableCellRenderProps {\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell has keyboard focus. */\n isFocusVisible: boolean;\n /** The zero-based column index for the cell. */\n columnIndex: number;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n}\n\nexport interface TableCellProps extends SlotProps {\n /** The unique key for the cell. */\n id?: Key;\n /** Number of columns spanned by the cell. */\n colSpan?: number;\n /** The children of the cell. */\n children?: RenderChildren<TableCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TableCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TableCellRenderProps>;\n /** Ref for the table cell element. */\n ref?: RefLike<HTMLTableCellElement>;\n /** Custom renderer for the table cell element. */\n render?: (\n props: JSX.TdHTMLAttributes<HTMLTableCellElement>,\n renderProps: TableCellRenderProps,\n ) => JSX.Element;\n}\n\nexport interface TableLoadMoreItemProps extends SlotProps {\n onLoadMore: () => void | Promise<void>;\n isLoading?: boolean;\n /** Scroll offset multiplier for early loading trigger (default: 1 = 100% of viewport height). */\n scrollOffset?: number;\n colSpan?: number;\n children?: JSX.Element;\n class?: ClassNameOrFunction<{ isLoading: boolean }>;\n style?: StyleOrFunction<{ isLoading: boolean }>;\n}\n\ninterface TableContextValue<T extends object> {\n state: TableState<T, TableCollection<T>>;\n collection: TableCollection<T>;\n items: T[];\n columns: (ColumnDefinition<T> & { id?: Key })[];\n isDisabled: boolean;\n showSelectionCheckboxes: boolean;\n dragAndDropHooks?: DragAndDropHooks<T>;\n dragState?: unknown;\n dropState?: unknown;\n isVirtualized: boolean;\n}\n\nexport const TableContext = createContext<TableContextValue<object> | null>(null);\nexport const TableStateContext = createContext<TableState<object, TableCollection<object>> | null>(\n null,\n);\n/** The resize context carries a getter for the resize state. The getter may return null before columns register. */\nexport const TableColumnResizeStateContext = createContext<{\n getState: () => TableColumnResizeState | null;\n getCallbacks?: () => {\n onResizeStart?: (widths: Map<Key, number>) => void;\n onResize?: (widths: Map<Key, number>) => void;\n onResizeEnd?: (widths: Map<Key, number>) => void;\n };\n} | null>(null);\n\ninterface TableRowContextValue {\n rowKey: Key;\n rowNode: GridNode<unknown>;\n getCellColumnKey(cellId: string, explicitId?: Key): Key | undefined;\n}\n\nexport const TableRowContext = createContext<TableRowContextValue | null>(null);\n\n/**\n * A table displays data in rows and columns and enables a user to navigate its contents via directional navigation keys,\n * and optionally supports row selection and sorting.\n */\nexport function Table<T extends object>(props: TableProps<T>): JSX.Element {\n const [local, stateProps, ariaProps] = splitProps(\n props,\n [\"class\", \"style\", \"render\", \"slot\", \"renderEmptyState\", \"dragAndDropHooks\", \"ref\"],\n [\n \"items\",\n \"columns\",\n \"getKey\",\n \"getTextValue\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"escapeKeyBehavior\",\n \"selectionMode\",\n \"selectionBehavior\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"sortDescriptor\",\n \"onSortChange\",\n \"showSelectionCheckboxes\",\n ],\n );\n\n const [ref, setRef] = createSignal<HTMLTableElement | null>(null);\n const normalizedColumns = createMemo(() => normalizeColumnDefinitions(stateProps.columns));\n const rowHeaderColumnKeys = createMemo(() => getRowHeaderColumnKeys(normalizedColumns()));\n\n const collection = createMemo(() =>\n createTableCollection<T>({\n columns: normalizedColumns(),\n rows: stateProps.items,\n getKey: stateProps.getKey,\n getTextValue: stateProps.getTextValue as\n | ((item: T, column: ColumnDefinition<T>) => string)\n | undefined,\n showSelectionCheckboxes: stateProps.showSelectionCheckboxes ?? false,\n rowHeaderColumnKeys: rowHeaderColumnKeys().size > 0 ? rowHeaderColumnKeys() : undefined,\n }),\n );\n\n const state = createTableState<T, TableCollection<T>>(() => ({\n collection: collection(),\n disabledKeys: stateProps.disabledKeys,\n selectionMode: stateProps.selectionMode,\n selectionBehavior: stateProps.selectionBehavior,\n selectedKeys: stateProps.selectedKeys,\n defaultSelectedKeys: stateProps.defaultSelectedKeys,\n onSelectionChange: stateProps.onSelectionChange,\n sortDescriptor: stateProps.sortDescriptor,\n onSortChange: stateProps.onSortChange,\n showSelectionCheckboxes: stateProps.showSelectionCheckboxes,\n }));\n const parentCollectionRenderer = useCollectionRenderer<T>();\n\n const { gridProps } = createTable<T>(\n () => ({\n id: ariaProps.id,\n \"aria-label\": ariaProps[\"aria-label\"],\n \"aria-labelledby\": ariaProps[\"aria-labelledby\"],\n \"aria-describedby\": ariaProps[\"aria-describedby\"],\n isVirtualized: ariaProps.isVirtualized ?? parentCollectionRenderer?.isVirtualized,\n onRowAction: ariaProps.onRowAction,\n onCellAction: ariaProps.onCellAction,\n shouldSelectOnPressUp: ariaProps.shouldSelectOnPressUp,\n focusMode: ariaProps.focusMode,\n escapeKeyBehavior: stateProps.escapeKeyBehavior,\n }),\n () => state,\n ref,\n );\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const renderValues = createMemo<TableRenderProps>(() => ({\n isFocused: state.isFocused || isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: false, // Tables don't have a global disabled state\n isEmpty: stateProps.items.length === 0,\n }));\n\n // Resolve render props (class and style only — children rendered directly in JSX\n // to avoid eager evaluation before context providers mount)\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Table\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n const cleanGridProps = () => {\n const { ref: _ref1, ...rest } = gridProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const getItemNodes = createMemo(() =>\n Array.from(state.collection).filter((node) => node.type === \"item\"),\n );\n const getDropTargetByIndex = (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ): DropTarget | null => {\n const node = getItemNodes()[index];\n if (!node) return null;\n return { type: \"item\", key: node.key, dropPosition: position };\n };\n const hasDroppableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(\n hooks?.useDroppableCollectionState &&\n hooks.useDroppableCollection &&\n (hooks.dropTargetDelegate ||\n parentCollectionRenderer?.dropTargetDelegate ||\n hooks.ListDropTargetDelegate),\n );\n });\n const hasDraggableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);\n });\n const dragState = createMemo(() => {\n if (!hasDraggableDnd()) return undefined;\n return local.dragAndDropHooks?.useDraggableCollectionState?.({\n items: stateProps.items,\n });\n });\n const dropState = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n return local.dragAndDropHooks?.useDroppableCollectionState?.({});\n });\n createEffect(() => {\n if (!hasDraggableDnd()) return;\n const hooks = local.dragAndDropHooks;\n const activeDragState = dragState();\n if (!hooks?.useDraggableCollection || !activeDragState) return;\n hooks.useDraggableCollection({}, activeDragState, () => ref());\n });\n const droppableCollection = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n const hooks = local.dragAndDropHooks;\n const activeDropState = dropState();\n if (!hooks?.useDroppableCollection || !activeDropState) return undefined;\n const resolveDirection = (): \"ltr\" | \"rtl\" => {\n const el = ref();\n if (el && typeof window !== \"undefined\" && typeof window.getComputedStyle === \"function\") {\n const dir = window.getComputedStyle(el).direction;\n if (dir === \"rtl\") return \"rtl\";\n }\n return typeof document !== \"undefined\" && document.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n const dropTargetDelegate =\n hooks.dropTargetDelegate ??\n parentCollectionRenderer?.dropTargetDelegate ??\n (hooks.ListDropTargetDelegate\n ? new hooks.ListDropTargetDelegate(\n () => state.collection,\n () => ref(),\n { layout: \"grid\", orientation: \"vertical\", direction: resolveDirection() },\n )\n : undefined);\n if (!dropTargetDelegate) return undefined;\n return hooks.useDroppableCollection(\n {\n dropTargetDelegate,\n keyboardDelegate: {\n getFirstKey: () => state.collection.getFirstKey?.() ?? null,\n getLastKey: () => state.collection.getLastKey?.() ?? null,\n getKeyBelow: (key) => state.collection.getKeyAfter?.(key) ?? null,\n getKeyAbove: (key) => state.collection.getKeyBefore?.(key) ?? null,\n getKeyLeftOf: (key) =>\n resolveDirection() === \"rtl\"\n ? (state.collection.getKeyAfter?.(key) ?? null)\n : (state.collection.getKeyBefore?.(key) ?? null),\n getKeyRightOf: (key) =>\n resolveDirection() === \"rtl\"\n ? (state.collection.getKeyBefore?.(key) ?? null)\n : (state.collection.getKeyAfter?.(key) ?? null),\n getKeyPageBelow: (key) => state.collection.getKeyAfter?.(key) ?? null,\n getKeyPageAbove: (key) => state.collection.getKeyBefore?.(key) ?? null,\n },\n get collection() {\n return state.collection;\n },\n get selectedKeys() {\n return state.selectedKeys;\n },\n setSelectedKeys: (keys: Set<Key>) => {\n if (state.selectionMode === \"none\") return;\n state.clearSelection();\n for (const key of keys) {\n state.toggleSelection(key);\n }\n },\n setFocusedKey: (key) => state.setFocusedKey(key),\n },\n activeDropState,\n () => ref(),\n );\n });\n const isRootDropTarget = createMemo(() => {\n return Boolean(dropState()?.target?.type === \"root\");\n });\n const dndRenderDropIndicator = createMemo(() =>\n useRenderDropIndicator(local.dragAndDropHooks, dropState()),\n );\n const dndDropIndicator = (index: number, position: \"before\" | \"after\" | \"on\") => {\n const target = getDropTargetByIndex(index, position);\n if (!target || target.type !== \"item\") return undefined;\n return dndRenderDropIndicator()?.(target);\n };\n\n const contextValue: TableContextValue<T> = {\n state,\n get collection() {\n return collection();\n },\n get items() {\n return stateProps.items;\n },\n get columns() {\n return normalizedColumns();\n },\n isDisabled: false,\n get showSelectionCheckboxes() {\n return stateProps.showSelectionCheckboxes ?? false;\n },\n get dragAndDropHooks() {\n return local.dragAndDropHooks;\n },\n get dragState() {\n return dragState();\n },\n get dropState() {\n return dropState();\n },\n get isVirtualized() {\n return ariaProps.isVirtualized ?? parentCollectionRenderer?.isVirtualized ?? false;\n },\n };\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => item as JSX.Element,\n renderDropIndicator: (index: number, position: \"before\" | \"after\" | \"on\") =>\n dndDropIndicator(index, position) ??\n parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n const tableChildren = () =>\n typeof props.children === \"function\" ? props.children(renderValues()) : props.children;\n const tableProps = () =>\n ({\n ref: (el: HTMLTableElement) => {\n setRef(el);\n assignRef(local.ref, el);\n },\n ...mergeProps(\n domProps(),\n cleanGridProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n \"data-focused\": state.isFocused || undefined,\n \"data-focus-visible\": isFocusVisible() || undefined,\n \"data-empty\": stateProps.items.length === 0 || undefined,\n \"data-drop-target\": isRootDropTarget() || undefined,\n slot: local.slot,\n children: tableChildren(),\n }) as JSX.HTMLAttributes<HTMLTableElement>;\n\n return (\n <TableContext.Provider value={contextValue as unknown as TableContextValue<object>}>\n <TableStateContext.Provider\n value={state as unknown as TableState<object, TableCollection<object>>}\n >\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n {local.render ? local.render(tableProps(), renderValues()) : <table {...tableProps()} />}\n </CollectionRendererContext.Provider>\n </TableStateContext.Provider>\n </TableContext.Provider>\n );\n}\n\n/**\n * A header row in a table containing column headers.\n */\nexport function TableHeader(props: TableHeaderProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n \"children\",\n \"ref\",\n ]);\n\n const context = useContext(TableContext);\n if (!context) {\n throw new Error(\"TableHeader must be used within a Table\");\n }\n\n const { rowGroupProps } = createTableRowGroup(() => ({ type: \"thead\" }));\n\n const { isHovered, hoverProps } = createHover({\n isDisabled: false,\n onHoverStart(e) {\n (domProps as Record<string, (e: unknown) => void>).onHoverStart?.(e);\n },\n onHoverEnd(e) {\n (domProps as Record<string, (e: unknown) => void>).onHoverEnd?.(e);\n },\n onHoverChange(isHovering) {\n (domProps as Record<string, (isHovering: boolean) => void>).onHoverChange?.(isHovering);\n },\n });\n\n const renderValues = createMemo<TableHeaderRenderProps>(() => ({\n isFocused: false,\n isHovered: isHovered(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Table-header\",\n },\n renderValues,\n );\n\n const cleanRowGroupProps = () => {\n const { ref: _ref, ...rest } = rowGroupProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n const headerProps = () =>\n ({\n ref: (el: HTMLTableSectionElement) => assignRef(local.ref, el),\n ...domProps,\n ...cleanRowGroupProps(),\n ...cleanHoverProps(),\n class: renderProps.class(),\n style: renderProps.style(),\n \"data-hovered\": isHovered() || undefined,\n children: <tr role=\"row\">{local.children}</tr>,\n }) as JSX.HTMLAttributes<HTMLTableSectionElement>;\n\n return local.render ? (\n local.render(headerProps(), renderValues())\n ) : (\n <thead\n ref={(el) => assignRef(local.ref, el)}\n {...domProps}\n {...cleanRowGroupProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-hovered={isHovered() || undefined}\n >\n <tr role=\"row\">{local.children}</tr>\n </thead>\n );\n}\n\n/**\n * A column header in a table.\n */\nexport function TableColumn(props: TableColumnProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n \"id\",\n \"allowsSorting\",\n \"allowsResizing\",\n \"width\",\n \"defaultWidth\",\n \"minWidth\",\n \"maxWidth\",\n \"children\",\n \"ref\",\n ]);\n\n const context = useContext(TableContext);\n if (!context) {\n throw new Error(\"TableColumn must be used within a Table\");\n }\n const { state, collection } = context;\n\n const [ref, setRef] = createSignal<HTMLTableCellElement | null>(null);\n\n const columnNode = createMemo(() => {\n const node = collection.getItem(local.id);\n if (!node) {\n return {\n type: \"column\" as const,\n key: local.id,\n value: null,\n textValue: String(local.id),\n level: 0,\n index: 0,\n hasChildNodes: false,\n childNodes: [],\n } as GridNode<unknown>;\n }\n return node;\n });\n\n const columnHeaderAria = createTableColumnHeader<object>(\n () => ({\n node: columnNode(),\n allowsSorting: local.allowsSorting,\n }),\n () => state as TableState<object, TableCollection<object>>,\n ref,\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return !local.allowsSorting;\n },\n onHoverStart(e) {\n (domProps as Record<string, (e: unknown) => void>).onHoverStart?.(e);\n },\n onHoverEnd(e) {\n (domProps as Record<string, (e: unknown) => void>).onHoverEnd?.(e);\n },\n onHoverChange(isHovering) {\n (domProps as Record<string, (isHovering: boolean) => void>).onHoverChange?.(isHovering);\n },\n });\n\n const { isFocusVisible, focusProps } = createFocusRing();\n\n const sortDirection = createMemo(() => {\n const sortDescriptor = state.sortDescriptor;\n if (sortDescriptor?.column === local.id) {\n return sortDescriptor.direction;\n }\n return undefined;\n });\n\n const resizeCtx = useContext(TableColumnResizeStateContext);\n\n const isResizing = createMemo(() => {\n const rs = resizeCtx?.getState();\n if (!rs) return false;\n return rs.resizingColumn() === local.id;\n });\n\n const resizeWidth = createMemo(() => {\n const rs = resizeCtx?.getState();\n if (!rs) return undefined;\n const w = rs.getColumnWidth(local.id);\n return w > 0 ? w : undefined;\n });\n\n const renderValues = createMemo<TableColumnRenderProps>(() => ({\n isFocused: state.focusedKey === local.id,\n isFocusVisible: isFocusVisible() && state.focusedKey === local.id,\n isSortable: local.allowsSorting ?? false,\n sortDirection: sortDirection(),\n isHovered: isHovered(),\n allowsResizing: local.allowsResizing ?? false,\n isResizing: isResizing(),\n }));\n\n // Resolve render props (children rendered directly in JSX to avoid eager evaluation)\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Table-column\",\n },\n renderValues,\n );\n\n const cleanColumnHeaderProps = () => {\n const { ref: _ref1, ...rest } = columnHeaderAria.columnHeaderProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n const columnStyle = createMemo(() => {\n const base = renderProps.style();\n const rw = resizeWidth();\n if (rw == null) return base;\n const widthStyle = { width: `${rw}px`, \"min-width\": `${rw}px`, \"max-width\": `${rw}px` };\n if (!base) return widthStyle;\n if (typeof base === \"string\") return widthStyle; // fallback\n return { ...base, ...widthStyle };\n });\n\n const columnChildren = () =>\n typeof local.children === \"function\" ? local.children(renderValues()) : local.children;\n const columnProps = () =>\n ({\n ref: (el: HTMLTableCellElement) => {\n setRef(el);\n assignRef(local.ref, el);\n },\n ...domProps,\n ...mergeProps(cleanColumnHeaderProps(), cleanHoverProps(), cleanFocusProps()),\n class: renderProps.class(),\n style: columnStyle(),\n \"data-sortable\": local.allowsSorting || undefined,\n \"data-sort-direction\": sortDirection() || undefined,\n \"data-resizable\": local.allowsResizing || undefined,\n \"data-resizing\": isResizing() || undefined,\n \"data-hovered\": isHovered() || undefined,\n \"data-focused\": state.focusedKey === local.id || undefined,\n \"data-focus-visible\": (isFocusVisible() && state.focusedKey === local.id) || undefined,\n children: columnChildren(),\n }) as JSX.ThHTMLAttributes<HTMLTableCellElement>;\n\n return local.render ? (\n local.render(columnProps(), renderValues())\n ) : (\n <th\n ref={(el) => {\n setRef(el);\n assignRef(local.ref, el);\n }}\n {...domProps}\n {...mergeProps(cleanColumnHeaderProps(), cleanHoverProps(), cleanFocusProps())}\n class={renderProps.class()}\n style={columnStyle()}\n data-sortable={local.allowsSorting || undefined}\n data-sort-direction={sortDirection() || undefined}\n data-resizable={local.allowsResizing || undefined}\n data-resizing={isResizing() || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={state.focusedKey === local.id || undefined}\n data-focus-visible={(isFocusVisible() && state.focusedKey === local.id) || undefined}\n >\n {columnChildren()}\n </th>\n );\n}\n\n/**\n * The body of a table containing data rows.\n */\nexport function TableBody<T extends object>(props: TableBodyProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"items\",\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n \"renderEmptyState\",\n \"hasMore\",\n \"isLoading\",\n \"onLoadMore\",\n \"children\",\n \"ref\",\n ]);\n\n const context = useContext(TableContext);\n if (!context) {\n throw new Error(\"TableBody must be used within a Table\");\n }\n\n const { rowGroupProps } = createTableRowGroup(() => ({ type: \"tbody\" }));\n\n const items = createMemo(() => (local.items ?? context.items) as T[]);\n\n const renderValues = createMemo<TableBodyRenderProps>(() => ({\n isEmpty: items().length === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Table-body\",\n },\n renderValues,\n );\n\n const cleanRowGroupProps = () => {\n const { ref: _ref, ...rest } = rowGroupProps as Record<string, unknown>;\n return rest;\n };\n\n const isEmpty = () => items().length === 0;\n const virtualizer = useVirtualizerContext();\n const parentCollectionRenderer = useCollectionRenderer<T>();\n const rowNodes = createMemo(() =>\n Array.from(context.collection).filter((node) => node.type === \"item\"),\n );\n const persistedKeys = useDndPersistedKeys(\n { focusedKey: () => context.state.focusedKey },\n context.dragAndDropHooks,\n context.dropState as { target?: DropTarget | null } | undefined,\n context.collection,\n );\n const virtualRange = createMemo(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return null;\n const rowCount = items().length;\n const baseRange = virtualizer.getVisibleRange(rowCount);\n const persistedIndexes = Array.from(persistedKeys())\n .map((key) => rowNodes().findIndex((node) => node.key === key))\n .filter((index) => index >= 0);\n const dropTarget = (context.dropState as { target?: DropTarget | null } | undefined)?.target;\n const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, context.collection);\n const focusedKey = context.state.focusedKey;\n const focusedIndex =\n focusedKey != null ? rowNodes().findIndex((node) => node.key === focusedKey) : -1;\n const forceIncludeIndexes = [\n dropTarget?.type === \"item\"\n ? rowNodes().findIndex((node) => node.key === dropTarget.key)\n : -1,\n normalizedDropKey != null\n ? rowNodes().findIndex((node) => node.key === normalizedDropKey)\n : -1,\n dropTarget?.type === \"item\" ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(\n baseRange,\n persistedIndexes,\n rowCount,\n virtualizer,\n 80,\n {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n },\n );\n });\n createEffect(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;\n virtualizer.setDropTargetItemCountResolver(() => items().length);\n virtualizer.setDropTargetIndexResolver((key) => {\n const index = rowNodes().findIndex((node) => node.key === key);\n return index >= 0 ? index : null;\n });\n virtualizer.setDropTargetResolver((target) => {\n const node = rowNodes()[target.index];\n if (!node) return target;\n return {\n ...target,\n key: typeof node.key === \"string\" || typeof node.key === \"number\" ? node.key : undefined,\n };\n });\n onCleanup(() => {\n virtualizer.setDropTargetIndexResolver(undefined);\n virtualizer.setDropTargetItemCountResolver(undefined);\n virtualizer.setDropTargetResolver(undefined);\n });\n });\n const visibleItems = createMemo(() => {\n const range = virtualRange();\n if (!range) return items();\n return items().slice(range.start, range.end);\n });\n const spacerColSpan = () => context.columns.length + (context.showSelectionCheckboxes ? 1 : 0);\n\n const bodyChildren = () => (\n <>\n <SharedElementTransition>\n <Show\n when={isEmpty() && local.renderEmptyState && !local.isLoading}\n fallback={\n <>\n {virtualRange()?.offsetTop ? (\n <tr role=\"presentation\" aria-hidden=\"true\" data-virtualizer-spacer=\"top\">\n <td\n colSpan={spacerColSpan()}\n style={{ height: `${virtualRange()!.offsetTop}px`, padding: \"0\", border: \"0\" }}\n />\n </tr>\n ) : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () =>\n parentCollectionRenderer?.renderDropIndicator?.(itemIndex(), \"before\");\n const onIndicator = () =>\n parentCollectionRenderer?.renderDropIndicator?.(itemIndex(), \"on\");\n const afterIndicator = () =>\n parentCollectionRenderer?.renderDropIndicator?.(itemIndex(), \"after\");\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {local.children?.(item)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom ? (\n <tr role=\"presentation\" aria-hidden=\"true\" data-virtualizer-spacer=\"bottom\">\n <td\n colSpan={spacerColSpan()}\n style={{\n height: `${virtualRange()!.offsetBottom}px`,\n padding: \"0\",\n border: \"0\",\n }}\n />\n </tr>\n ) : null}\n </>\n }\n >\n <tr role=\"row\" data-empty-state>\n <th role=\"rowheader\" colSpan={spacerColSpan()}>\n {local.renderEmptyState?.()}\n </th>\n </tr>\n </Show>\n </SharedElementTransition>\n <Show when={local.hasMore && local.onLoadMore}>\n <TableLoadMoreItem\n onLoadMore={local.onLoadMore!}\n isLoading={local.isLoading}\n colSpan={spacerColSpan()}\n />\n </Show>\n </>\n );\n const bodyProps = () =>\n ({\n ref: (el: HTMLTableSectionElement) => assignRef(local.ref, el),\n ...domProps,\n ...cleanRowGroupProps(),\n class: renderProps.class(),\n style: renderProps.style(),\n \"data-empty\": isEmpty() || undefined,\n children: bodyChildren(),\n }) as JSX.HTMLAttributes<HTMLTableSectionElement>;\n\n return local.render ? (\n local.render(bodyProps(), renderValues())\n ) : (\n <tbody\n ref={(el) => assignRef(local.ref, el)}\n {...domProps}\n {...cleanRowGroupProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-empty={isEmpty() || undefined}\n >\n <SharedElementTransition>\n <Show\n when={isEmpty() && local.renderEmptyState && !local.isLoading}\n fallback={\n <>\n {virtualRange()?.offsetTop ? (\n <tr role=\"presentation\" aria-hidden=\"true\" data-virtualizer-spacer=\"top\">\n <td\n colSpan={spacerColSpan()}\n style={{ height: `${virtualRange()!.offsetTop}px`, padding: \"0\", border: \"0\" }}\n />\n </tr>\n ) : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () =>\n parentCollectionRenderer?.renderDropIndicator?.(itemIndex(), \"before\");\n const onIndicator = () =>\n parentCollectionRenderer?.renderDropIndicator?.(itemIndex(), \"on\");\n const afterIndicator = () =>\n parentCollectionRenderer?.renderDropIndicator?.(itemIndex(), \"after\");\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {local.children?.(item)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom ? (\n <tr role=\"presentation\" aria-hidden=\"true\" data-virtualizer-spacer=\"bottom\">\n <td\n colSpan={spacerColSpan()}\n style={{\n height: `${virtualRange()!.offsetBottom}px`,\n padding: \"0\",\n border: \"0\",\n }}\n />\n </tr>\n ) : null}\n </>\n }\n >\n <tr role=\"row\" data-empty-state>\n <th role=\"rowheader\" colSpan={spacerColSpan()}>\n {local.renderEmptyState?.()}\n </th>\n </tr>\n </Show>\n </SharedElementTransition>\n <Show when={local.hasMore && local.onLoadMore}>\n <TableLoadMoreItem\n onLoadMore={local.onLoadMore!}\n isLoading={local.isLoading}\n colSpan={spacerColSpan()}\n />\n </Show>\n </tbody>\n );\n}\n\n/**\n * The footer of a table containing summary rows.\n */\nexport function TableFooter<T extends object>(props: TableFooterProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\"items\", \"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(TableContext);\n if (!context) {\n throw new Error(\"TableFooter must be used within a Table\");\n }\n\n const { rowGroupProps } = createTableRowGroup(() => ({ type: \"tfoot\" }));\n const items = createMemo(() => local.items ?? []);\n\n const renderValues = createMemo<TableFooterRenderProps>(() => ({\n isEmpty: items().length === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Table-footer\",\n },\n renderValues,\n );\n\n const cleanRowGroupProps = () => {\n const { ref: _ref, ...rest } = rowGroupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <tfoot\n {...domProps}\n {...cleanRowGroupProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <Show\n when={local.items && typeof local.children === \"function\"}\n fallback={local.children as JSX.Element}\n >\n <For each={items()}>{(item) => (local.children as (item: T) => JSX.Element)(item)}</For>\n </Show>\n </tfoot>\n );\n}\n\nexport function TableLoadMoreItem(props: TableLoadMoreItemProps): JSX.Element {\n let sentinelRef: HTMLDivElement | undefined;\n const [isPending, setIsPending] = createSignal(false);\n const isLoading = () => !!props.isLoading || isPending();\n\n const triggerLoadMore = async () => {\n if (isPending()) return;\n setIsPending(true);\n try {\n await props.onLoadMore();\n } finally {\n setIsPending(false);\n }\n };\n\n createEffect(() => {\n if (!sentinelRef || typeof IntersectionObserver !== \"function\") return;\n const offset = props.scrollOffset ?? 1;\n const margin = `0px 0px ${100 * offset}% 0px`;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting) {\n void triggerLoadMore();\n }\n },\n { rootMargin: margin },\n );\n observer.observe(sentinelRef);\n return () => observer.disconnect();\n });\n\n const renderProps = useRenderProps(\n {\n children:\n props.children ??\n (() => (isLoading() ? <div role=\"progressbar\" aria-label=\"loading\" /> : null)),\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-Table-loadMore\",\n },\n () => ({ isLoading: isLoading() }),\n );\n\n return (\n <>\n <tr style={{ position: \"relative\", width: 0, height: 0, overflow: \"hidden\" }} inert>\n <td>\n <div\n ref={sentinelRef}\n data-testid=\"loadMoreSentinel\"\n style={{ position: \"absolute\", height: \"1px\", width: \"1px\" }}\n />\n </td>\n </tr>\n <Show when={isLoading()}>\n <tr\n role=\"row\"\n tabIndex={0}\n onFocus={() => {\n void triggerLoadMore();\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-loading\n >\n <td role=\"rowheader\" colSpan={props.colSpan ?? 1}>\n {renderProps.renderChildren()}\n </td>\n </tr>\n </Show>\n </>\n );\n}\n\n/**\n * A row in a table.\n */\nexport function TableRow<T extends object>(props: TableRowProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n \"id\",\n \"item\",\n \"columns\",\n \"isDisabled\",\n \"onAction\",\n \"children\",\n \"ref\",\n \"href\",\n \"target\",\n \"rel\",\n \"download\",\n \"ping\",\n \"referrerPolicy\",\n \"routerOptions\",\n ]);\n\n const context = useContext(TableContext);\n if (!context) {\n throw new Error(\"TableRow must be used within a Table\");\n }\n const { state, collection } = context;\n const tableContext = context as unknown as TableContextValue<T>;\n const registeredCellIds: string[] = [];\n const generatedId = createUniqueId();\n const rowKey = () => local.id ?? generatedId;\n const router = useRouter();\n const linkProps = createMemo(() =>\n useLinkProps({\n href: local.href,\n target: local.target,\n rel: local.rel,\n download: local.download,\n ping: local.ping,\n referrerPolicy: local.referrerPolicy,\n }),\n );\n\n const [ref, setRef] = createSignal<HTMLTableRowElement | null>(null);\n\n const rowNode = createMemo(() => {\n const node = collection.getItem(rowKey());\n if (!node) {\n return {\n type: \"item\" as const,\n key: rowKey(),\n value: local.item ?? null,\n textValue: String(local.id),\n level: 0,\n index: 0,\n hasChildNodes: true,\n childNodes: [],\n } as GridNode<unknown>;\n }\n return node;\n });\n\n const rowAria = createTableRow<object>(\n () => ({\n node: rowNode(),\n isVirtualized: tableContext.isVirtualized,\n isDisabled: local.isDisabled,\n onAction: local.onAction,\n href: linkProps().href,\n onLinkAction: (event) => {\n const target = ref();\n if (!target || !local.href) return;\n router.open(target, event as RouterClickModifiers, local.href, local.routerOptions);\n },\n }),\n () => state as TableState<object, TableCollection<object>>,\n ref,\n );\n const isSelected = () => rowAria.isSelected;\n const isDisabled = () => rowAria.isDisabled;\n const isPressed = () => rowAria.isPressed;\n const isInteractive = () => {\n const tableData = getTableData(state as TableState<object, TableCollection<object>>);\n return state.selectionMode !== \"none\" || !!tableData?.actions.onRowAction || !!local.onAction;\n };\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled() || !isInteractive();\n },\n onHoverStart(e) {\n (domProps as Record<string, (e: unknown) => void>).onHoverStart?.(e);\n },\n onHoverEnd(e) {\n (domProps as Record<string, (e: unknown) => void>).onHoverEnd?.(e);\n },\n onHoverChange(isHovering) {\n (domProps as Record<string, (isHovering: boolean) => void>).onHoverChange?.(isHovering);\n },\n });\n\n const { isFocusVisible, focusProps } = createFocusRing();\n const [isFocusWithin, setIsFocusWithin] = createSignal(false);\n const focusWithinProps = {\n onFocusIn() {\n setIsFocusWithin(true);\n },\n onFocusOut(e: FocusEvent) {\n const currentTarget = e.currentTarget as HTMLElement;\n const nextTarget = e.relatedTarget as Node | null;\n if (!nextTarget || !currentTarget.contains(nextTarget)) {\n setIsFocusWithin(false);\n }\n },\n };\n\n const isFocused = createMemo(() => state.focusedKey === rowKey());\n const draggableItem = createMemo(() => {\n if (!tableContext.dragAndDropHooks?.useDraggableItem || !tableContext.dragState)\n return undefined;\n return tableContext.dragAndDropHooks.useDraggableItem(\n {\n key: rowKey() as string | number,\n hasDragButton: true,\n },\n tableContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDraggableItem\"]>>[1],\n );\n });\n const droppableItem = createMemo(() => {\n if (!tableContext.dragAndDropHooks?.useDroppableItem || !tableContext.dropState)\n return undefined;\n return tableContext.dragAndDropHooks.useDroppableItem(\n {\n key: rowKey() as string | number,\n },\n tableContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDroppableItem\"]>>[1],\n () => ref(),\n );\n });\n\n const renderValues = createMemo<TableRowRenderProps>(() => ({\n isSelected: isSelected(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible() && isFocused(),\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n // Resolve render props (children rendered directly in JSX to avoid eager evaluation)\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Table-row\",\n },\n renderValues,\n );\n\n const cleanRowProps = () => {\n const { ref: _ref1, ...rest } = rowAria.rowProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n const rowContextValue: TableRowContextValue = {\n rowKey: rowKey(),\n rowNode: rowNode(),\n getCellColumnKey(cellId, explicitId) {\n if (explicitId === \"__selection__\") {\n return explicitId;\n }\n\n let index = registeredCellIds.indexOf(cellId);\n if (index < 0) {\n index = registeredCellIds.length;\n registeredCellIds.push(cellId);\n }\n\n return explicitId ?? tableContext.columns[index]?.key;\n },\n };\n const dragButtonProps = createMemo<ButtonProps>(() => {\n const props = (draggableItem()?.dragButtonProps as ButtonProps | undefined) ?? {};\n const textValue = (rowNode().textValue || String(rowKey())).trim();\n return {\n ...props,\n \"aria-label\": `Drag ${textValue}`,\n style: {\n ...(typeof props.style === \"object\" ? props.style : {}),\n \"pointer-events\": \"none\",\n },\n };\n });\n const buttonContextValue = createMemo(() => ({\n slots: {\n default: {},\n drag: dragButtonProps(),\n },\n }));\n\n const rowChildren = () => (\n <ButtonContext.Provider value={buttonContextValue()}>\n {typeof local.children === \"function\" ? (\n local.columns ? (\n <For each={local.columns}>\n {(column) =>\n (local.children as (column: TableColumnDefinition<T>) => JSX.Element)(column)\n }\n </For>\n ) : (\n (local.children as (renderProps: TableRowRenderProps) => JSX.Element)(renderValues())\n )\n ) : (\n local.children\n )}\n </ButtonContext.Provider>\n );\n const tableRowProps = () =>\n ({\n ref: (el: HTMLTableRowElement) => {\n setRef(el);\n assignRef(local.ref, el);\n },\n ...domProps,\n ...mergeProps(\n cleanRowProps(),\n cleanHoverProps(),\n cleanFocusProps(),\n focusWithinProps as Record<string, unknown>,\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n \"data-selected\": isSelected() || undefined,\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": (isFocusVisible() && isFocused()) || undefined,\n \"data-focus-visible-within\": dataAttr(isFocusWithin() && isGlobalFocusVisible()),\n \"data-pressed\": isPressed() || undefined,\n \"data-hovered\": isHovered() || undefined,\n \"data-disabled\": isDisabled() || undefined,\n \"data-href\": linkProps().href,\n \"data-target\": linkProps().target,\n \"data-rel\": linkProps().rel,\n \"data-download\":\n typeof linkProps().download === \"string\"\n ? linkProps().download\n : linkProps().download\n ? \"\"\n : undefined,\n \"data-ping\": linkProps().ping,\n \"data-referrer-policy\": linkProps().referrerPolicy,\n \"data-dragging\": draggableItem()?.isDragging || undefined,\n \"data-drop-target\": droppableItem()?.isDropTarget || undefined,\n children: rowChildren(),\n }) as JSX.HTMLAttributes<HTMLTableRowElement>;\n\n return (\n <TableRowContext.Provider value={rowContextValue}>\n {local.render ? local.render(tableRowProps(), renderValues()) : <tr {...tableRowProps()} />}\n </TableRowContext.Provider>\n );\n}\n\n/**\n * A cell in a table row.\n */\nexport function TableCell(props: TableCellProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n \"id\",\n \"colSpan\",\n \"children\",\n \"ref\",\n ]);\n\n const tableContext = useContext(TableContext);\n const rowContext = useContext(TableRowContext);\n\n if (!tableContext) {\n throw new Error(\"TableCell must be used within a Table\");\n }\n if (!rowContext) {\n throw new Error(\"TableCell must be used within a Table\");\n }\n\n const { state, collection } = tableContext;\n const { rowKey, rowNode } = rowContext;\n\n const [ref, setRef] = createSignal<HTMLTableCellElement | null>(null);\n const cellId = createUniqueId();\n const columnKey = createMemo(() => rowContext.getCellColumnKey(cellId, local.id));\n\n const cellNode = createMemo(() => {\n const key = columnKey();\n if (key != null) {\n const cellKey = `${rowKey}-${key}`;\n const node = collection.getItem(cellKey);\n if (node) return node;\n }\n\n return {\n type: \"cell\" as const,\n key: key ?? `${rowKey}-cell`,\n value: rowNode.value,\n textValue: \"\",\n level: 1,\n index: 0,\n parentKey: rowKey,\n hasChildNodes: false,\n childNodes: [],\n } as GridNode<unknown>;\n });\n const cellColumnIndex = createMemo(() => {\n const key = columnKey();\n if (key == null) return undefined;\n const cellKey = `${rowKey}-${key}`;\n return collection.getItem(cellKey) ? (cellNode().index ?? 0) : undefined;\n });\n\n const cellAria = createTableCell<object>(\n () => ({\n node: cellNode(),\n }),\n () => state as TableState<object, TableCollection<object>>,\n ref,\n );\n const isPressed = () => cellAria.isPressed;\n\n const { isHovered, hoverProps } = createHover({\n isDisabled: false,\n });\n\n const { isFocusVisible, focusProps } = createFocusRing();\n\n const isFocused = createMemo(() => state.focusedKey === cellNode().key);\n\n const renderValues = createMemo<TableCellRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible() && isFocused(),\n columnIndex: cellColumnIndex() ?? 0,\n isPressed: isPressed(),\n isHovered: isHovered(),\n }));\n\n // Resolve render props (children rendered directly in JSX to avoid eager evaluation)\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Table-cell\",\n },\n renderValues,\n );\n\n const cleanCellProps = () => {\n const { ref: _ref1, ...rest } = cellAria.gridCellProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n const cellChildren = () =>\n typeof local.children === \"function\" ? local.children(renderValues()) : local.children;\n const tableCellProps = () =>\n ({\n ref: (el: HTMLTableCellElement) => {\n setRef(el);\n assignRef(local.ref, el);\n },\n ...domProps,\n ...mergeProps(cleanCellProps(), cleanHoverProps(), cleanFocusProps()),\n colSpan: local.colSpan,\n class: renderProps.class(),\n style: renderProps.style(),\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": (isFocusVisible() && isFocused()) || undefined,\n \"data-column-index\": cellColumnIndex(),\n \"data-pressed\": isPressed() || undefined,\n \"data-hovered\": isHovered() || undefined,\n children: cellChildren(),\n }) as JSX.TdHTMLAttributes<HTMLTableCellElement>;\n\n return local.render ? (\n local.render(tableCellProps(), renderValues())\n ) : (\n <td\n ref={(el) => {\n setRef(el);\n assignRef(local.ref, el);\n }}\n {...domProps}\n {...mergeProps(cleanCellProps(), cleanHoverProps(), cleanFocusProps())}\n colSpan={local.colSpan}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={(isFocusVisible() && isFocused()) || undefined}\n data-column-index={cellColumnIndex()}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n >\n {cellChildren()}\n </td>\n );\n}\n\nexport interface TableSelectionCheckboxProps {\n rowKey: Key;\n class?: string;\n style?: JSX.CSSProperties;\n excludeFromTabOrder?: boolean;\n \"aria-label\"?: string;\n}\n\n/**\n * A checkbox cell for row selection.\n */\nexport function TableSelectionCheckbox(props: TableSelectionCheckboxProps): JSX.Element {\n const context = useContext(TableContext);\n if (!context) {\n throw new Error(\"TableSelectionCheckbox must be used within a Table\");\n }\n\n const { state } = context;\n\n const selectionCheckboxAria = createTableSelectionCheckbox<object>(\n () => ({ key: props.rowKey }),\n () => state as TableState<object, TableCollection<object>>,\n );\n\n return (\n <input\n {...selectionCheckboxAria.checkboxProps}\n class={props.class}\n style={props.style}\n tabIndex={props.excludeFromTabOrder ? -1 : selectionCheckboxAria.checkboxProps.tabIndex}\n aria-label={props[\"aria-label\"] ?? selectionCheckboxAria.checkboxProps[\"aria-label\"]}\n />\n );\n}\n\nexport interface TableSelectAllCheckboxProps {\n class?: string;\n style?: JSX.CSSProperties;\n \"aria-label\"?: string;\n}\n\n/**\n * A checkbox for select-all functionality.\n */\nexport function TableSelectAllCheckbox(props: TableSelectAllCheckboxProps = {}): JSX.Element {\n const context = useContext(TableContext);\n if (!context) {\n throw new Error(\"TableSelectAllCheckbox must be used within a Table\");\n }\n\n const { state } = context;\n\n const selectAllCheckboxAria = createTableSelectAllCheckbox<object>(\n () => state as TableState<object, TableCollection<object>>,\n );\n\n return (\n <input\n {...selectAllCheckboxAria.checkboxProps}\n class={props.class}\n style={props.style}\n aria-label={props[\"aria-label\"] ?? selectAllCheckboxAria.checkboxProps[\"aria-label\"]}\n />\n );\n}\n\nTable.Header = TableHeader;\nTable.Column = TableColumn;\nTable.Body = TableBody;\nTable.LoadMoreItem = TableLoadMoreItem;\nTable.Row = TableRow;\nTable.Cell = TableCell;\nTable.SelectionCheckbox = TableSelectionCheckbox;\nTable.SelectAllCheckbox = TableSelectAllCheckbox;\n\nexport interface ColumnResizerRenderProps {\n /** Whether the resizer handle is hovered. */\n isHovered: boolean;\n /** Whether the resizer's hidden input is focused. */\n isFocused: boolean;\n /** Whether the column is currently being resized. */\n isResizing: boolean;\n /** The direction(s) the column can be resized: 'both', 'left', 'right'. */\n resizableDirection: \"both\" | \"left\" | \"right\";\n}\n\nexport interface ColumnResizerProps extends SlotProps {\n /** The column key this resizer belongs to. */\n column: { key: Key };\n /** Accessible label for the resizer. */\n \"aria-label\"?: string;\n /** Whether resizing is disabled. */\n isDisabled?: boolean;\n /** Called when resize starts. */\n onResizeStart?: (widths: Map<Key, number>) => void;\n /** Called during resize. */\n onResize?: (widths: Map<Key, number>) => void;\n /** Called when resize ends. */\n onResizeEnd?: (widths: Map<Key, number>) => void;\n /** CSS class — can be a string or function of render props. */\n class?: ClassNameOrFunction<ColumnResizerRenderProps>;\n /** Inline style — can be object or function of render props. */\n style?: StyleOrFunction<ColumnResizerRenderProps>;\n /** Children — can be JSX or render function. */\n children?: JSX.Element | RenderChildren<ColumnResizerRenderProps>;\n}\n\nexport function ColumnResizer(props: ColumnResizerProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"column\",\n \"aria-label\",\n \"isDisabled\",\n \"onResizeStart\",\n \"onResize\",\n \"onResizeEnd\",\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n ]);\n\n // Register this column with the ResizableTableContainer (auto-collect columns)\n const registerColumn = useContext(ResizableTableRegisterContext);\n if (registerColumn) {\n registerColumn(local.column.key, { key: local.column.key });\n }\n\n const resizeCtx = useContext(TableColumnResizeStateContext);\n const hasResizeContext = !!resizeCtx;\n\n // Create a fallback \"no-op\" resize state for when there's no ResizableTableContainer\n const noopResizeState: TableColumnResizeState = {\n resizingColumn: () => null,\n columnWidths: () => new Map(),\n startResize() {},\n endResize() {},\n updateResizedColumns(_key: Key, _width: number) {\n return new Map();\n },\n getColumnWidth() {\n return 0;\n },\n getColumnMinWidth() {\n return 75;\n },\n getColumnMaxWidth() {\n return Infinity;\n },\n };\n\n const { isHovered, hoverProps } = createHover({ isDisabled: local.isDisabled ?? false });\n const [isFocused, setIsFocused] = createSignal(false);\n\n // Create the ARIA resize hook — always create it but use reactive state getter\n const columnResize = createTableColumnResize(\n () => ({\n column: local.column,\n \"aria-label\": local[\"aria-label\"] ?? \"Resizer\",\n isDisabled: local.isDisabled,\n onResizeStart: (widths) => {\n resizeCtx?.getCallbacks?.().onResizeStart?.(widths);\n local.onResizeStart?.(widths);\n },\n onResize: (widths) => {\n resizeCtx?.getCallbacks?.().onResize?.(widths);\n local.onResize?.(widths);\n },\n onResizeEnd: (widths) => {\n resizeCtx?.getCallbacks?.().onResizeEnd?.(widths);\n local.onResizeEnd?.(widths);\n },\n }),\n () => resizeCtx?.getState() ?? noopResizeState,\n );\n\n const renderValues = createMemo<ColumnResizerRenderProps>(() => ({\n isHovered: isHovered(),\n isFocused: isFocused(),\n isResizing: columnResize.isResizing(),\n resizableDirection: \"both\",\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Table-columnResizer\",\n },\n renderValues,\n );\n\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...columnResize.resizerProps}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-hovered={isHovered() || undefined}\n data-resizing={columnResize.isResizing() || undefined}\n >\n <Show when={hasResizeContext}>\n <input\n {...columnResize.inputProps}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n />\n </Show>\n {typeof local.children === \"function\"\n ? (local.children as (props: ColumnResizerRenderProps) => JSX.Element)(renderValues())\n : local.children}\n </div>\n );\n}\n\nexport interface ResizableTableContainerProps extends SlotProps {\n /** Children (should contain a Table). */\n children?: JSX.Element;\n /** Column resize definitions. If not provided, columns from child ColumnResizers are auto-detected. */\n columns?: Array<{ key: Key; width?: ColumnSize; minWidth?: number; maxWidth?: number }>;\n /** CSS class name. */\n class?: string;\n /** Inline style. */\n style?: JSX.CSSProperties;\n /** Called when column resize starts. */\n onResizeStart?: (widths: Map<Key, number>) => void;\n /** Called during column resize. */\n onResize?: (widths: Map<Key, number>) => void;\n /** Called when column resize ends. */\n onResizeEnd?: (widths: Map<Key, number>) => void;\n}\n\nexport function ResizableTableContainer(props: ResizableTableContainerProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n \"columns\",\n \"onResizeStart\",\n \"onResize\",\n \"onResizeEnd\",\n ]);\n\n const [containerRef, setContainerRef] = createSignal<HTMLDivElement | null>(null);\n const [tableWidth, setTableWidth] = createSignal(0);\n\n // Track container width via ResizeObserver\n createEffect(() => {\n const el = containerRef();\n if (!el) return;\n\n // Initial measurement\n setTableWidth(el.clientWidth);\n\n if (typeof ResizeObserver !== \"undefined\") {\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setTableWidth(entry.contentRect.width);\n }\n });\n observer.observe(el);\n onCleanup(() => observer.disconnect());\n }\n });\n\n // Auto-collected columns from ColumnResizer children\n const [autoColumns, setAutoColumns] = createSignal<\n Map<Key, { key: Key; width?: ColumnSize; minWidth?: number; maxWidth?: number }>\n >(new Map());\n\n const registerColumn = (\n key: Key,\n def: { key: Key; width?: ColumnSize; minWidth?: number; maxWidth?: number },\n ) => {\n setAutoColumns((prev) => {\n const next = new Map(prev);\n next.set(key, def);\n return next;\n });\n };\n\n // Columns: prefer explicit prop, fall back to auto-collected\n const effectiveColumns = createMemo(() => {\n if (local.columns && local.columns.length > 0) return local.columns;\n return Array.from(autoColumns().values());\n });\n\n // Use measured width, with a reasonable fallback for environments without layout (e.g. jsdom)\n const effectiveWidth = createMemo(() => {\n const w = tableWidth();\n return w > 0 ? w : 800; // fallback to 800px\n });\n\n // Create resize state\n const resizeState = createMemo(() => {\n const cols = effectiveColumns();\n if (cols.length === 0) return null;\n\n return createTableColumnResizeState(() => ({\n tableWidth: effectiveWidth(),\n columns: cols,\n }));\n });\n\n // Provide a stable context object with a reactive getter\n const contextValue = {\n getState: () => resizeState(),\n getCallbacks: () => ({\n onResizeStart: local.onResizeStart,\n onResize: local.onResize,\n onResizeEnd: local.onResizeEnd,\n }),\n };\n\n return (\n <ResizableTableRegisterContext.Provider value={registerColumn}>\n <TableColumnResizeStateContext.Provider value={contextValue}>\n <div\n ref={setContainerRef}\n {...domProps}\n class={local.class ?? \"solidaria-ResizableTableContainer\"}\n style={{ position: \"relative\", overflow: \"auto\", ...local.style }}\n >\n {local.children}\n </div>\n </TableColumnResizeStateContext.Provider>\n </ResizableTableRegisterContext.Provider>\n );\n}\n\n/** Internal context for ColumnResizer to register itself with ResizableTableContainer */\nconst ResizableTableRegisterContext = createContext<\n | ((\n key: Key,\n def: { key: Key; width?: ColumnSize; minWidth?: number; maxWidth?: number },\n ) => void)\n | null\n>(null);\n\nexport function useTableOptions() {\n return useContext(TableContext);\n}\n","/**\n * GridList component for solidaria-components\n *\n * A pre-wired headless grid list that combines state + aria hooks.\n * Based on react-aria-components/src/GridList.tsx\n *\n * GridList is similar to ListBox but supports interactive elements within items\n * and uses grid keyboard navigation.\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createGridList,\n createGridListItem,\n createGridListSelectionCheckbox,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaGridListProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createGridState,\n type GridState,\n type GridCollection,\n type GridNode,\n type Key,\n type DropTarget,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport { type DragAndDropHooks } from \"./useDragAndDrop\";\nimport {\n CollectionRendererContext,\n type CollectionRendererContextValue,\n Section,\n type SectionProps,\n useCollectionRenderer,\n} from \"./Collection\";\nimport { useVirtualizerContext } from \"./Virtualizer\";\nimport {\n getNormalizedDropTargetKey,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n} from \"./DragAndDrop\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface GridListRenderProps {\n /** Whether the grid list has focus. */\n isFocused: boolean;\n /** Whether the grid list has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the grid list is disabled. */\n isDisabled: boolean;\n /** Whether the grid list is empty. */\n isEmpty: boolean;\n}\n\nexport interface GridListProps<T extends object>\n extends Omit<AriaGridListProps, \"children\">, SlotProps {\n /** The items to render in the grid list. */\n items: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** The selection mode. */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n /** How selection should behave when pressing an item. */\n selectionBehavior?: \"replace\" | \"toggle\";\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Currently selected keys (controlled). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** The children of the component. A function may be provided to render each item. */\n children: (item: T) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<GridListRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<GridListRenderProps>;\n /** Ref for the grid list root element. */\n ref?: RefLike<HTMLDivElement>;\n /** A function to render when the grid list is empty. */\n renderEmptyState?: () => JSX.Element;\n /** Whether there are more items to load. */\n hasMore?: boolean;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<T>;\n}\n\nexport interface GridListItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** The grid list selection mode. */\n selectionMode: \"none\" | \"single\" | \"multiple\";\n /** How selection behaves when pressing an item. */\n selectionBehavior: \"replace\" | \"toggle\";\n}\n\nexport interface GridListItemProps<T extends object>\n extends\n SlotProps,\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"id\" | \"ref\"> {\n /** The unique key for the item. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the item. A function may be provided to receive render props. */\n children?: RenderChildren<GridListItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<GridListItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<GridListItemRenderProps>;\n /** The text value of the item (for accessibility). */\n textValue?: string;\n /** Handler called when the item is activated. */\n onAction?: () => void;\n /** Ref for the rendered row element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface GridListLoadMoreItemProps extends SlotProps {\n onLoadMore: () => void | Promise<void>;\n isLoading?: boolean;\n /** Scroll offset multiplier for early loading trigger (default: 1 = 100% of viewport height). */\n scrollOffset?: number;\n children?: JSX.Element;\n class?: ClassNameOrFunction<{ isLoading: boolean }>;\n style?: StyleOrFunction<{ isLoading: boolean }>;\n}\n\nexport interface GridListSectionProps extends SectionProps {}\nexport interface GridListHeaderProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\ninterface GridListContextValue<T extends object> {\n state: GridState<T, GridCollection<T>>;\n collection: GridCollection<T>;\n isDisabled: boolean;\n selectionBehavior: \"replace\" | \"toggle\";\n dragAndDropHooks?: DragAndDropHooks<T>;\n dragState?: unknown;\n dropState?: unknown;\n}\n\nexport const GridListContext = createContext<GridListContextValue<object> | null>(null);\nexport const GridListStateContext = createContext<GridState<object, GridCollection<object>> | null>(\n null,\n);\nexport const GridListHeaderContext = createContext<null>(null);\n\nfunction buildGridCollection<T extends object>(\n items: T[],\n getKey?: (item: T) => Key,\n getTextValue?: (item: T) => string,\n getDisabled?: (item: T) => boolean,\n): GridCollection<T> {\n const nodes: GridNode<T>[] = items.map((item, index) => {\n const key = getKey?.(item) ?? index;\n return {\n type: \"item\" as const,\n key,\n value: item,\n textValue: getTextValue?.(item) ?? String(key),\n level: 0,\n index,\n hasChildNodes: false,\n childNodes: [],\n isDisabled: getDisabled?.(item),\n };\n });\n\n const keyMap = new Map<Key, GridNode<T>>();\n nodes.forEach((node) => keyMap.set(node.key, node));\n\n return {\n rows: nodes,\n columns: [],\n headerRows: [],\n get rowCount() {\n return nodes.length;\n },\n get columnCount() {\n return 1;\n },\n get size() {\n return nodes.length;\n },\n getKeys() {\n return nodes.map((n) => n.key);\n },\n getItem(key: Key) {\n return keyMap.get(key) ?? null;\n },\n at(index: number) {\n return nodes[index] ?? null;\n },\n getKeyBefore(key: Key) {\n const node = keyMap.get(key);\n if (!node) return null;\n return node.index > 0 ? nodes[node.index - 1].key : null;\n },\n getKeyAfter(key: Key) {\n const node = keyMap.get(key);\n if (!node) return null;\n return node.index < nodes.length - 1 ? nodes[node.index + 1].key : null;\n },\n getFirstKey() {\n return nodes[0]?.key ?? null;\n },\n getLastKey() {\n return nodes[nodes.length - 1]?.key ?? null;\n },\n getChildren(_key: Key) {\n return [];\n },\n getTextValue(key: Key) {\n return keyMap.get(key)?.textValue ?? \"\";\n },\n getCell(_rowKey: Key, _columnKey: Key) {\n return null;\n },\n [Symbol.iterator]() {\n return nodes[Symbol.iterator]();\n },\n };\n}\n\n/**\n * A grid list displays a list of interactive items, with support for\n * keyboard navigation, single or multiple selection, and row actions.\n */\nexport function GridList<T extends object>(props: GridListProps<T>): JSX.Element {\n const [local, stateProps, ariaProps] = splitProps(\n props,\n [\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n \"slot\",\n \"renderEmptyState\",\n \"hasMore\",\n \"isLoading\",\n \"onLoadMore\",\n \"dragAndDropHooks\",\n ],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectionMode\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"selectionBehavior\",\n ],\n );\n\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null);\n\n const collection = createMemo(() =>\n buildGridCollection(\n stateProps.items,\n stateProps.getKey,\n stateProps.getTextValue,\n stateProps.getDisabled,\n ),\n );\n\n const allDisabledKeys = createMemo(() => {\n const keys = new Set<Key>();\n\n if (stateProps.disabledKeys) {\n for (const key of stateProps.disabledKeys) {\n keys.add(key);\n }\n }\n\n for (const node of collection().rows) {\n if (node.isDisabled) {\n keys.add(node.key);\n }\n }\n\n return keys;\n });\n\n const state = createGridState<T, GridCollection<T>>(() => ({\n collection: collection(),\n disabledKeys: allDisabledKeys(),\n selectionMode: stateProps.selectionMode,\n selectionBehavior: stateProps.selectionBehavior,\n selectedKeys: stateProps.selectedKeys,\n defaultSelectedKeys: stateProps.defaultSelectedKeys,\n onSelectionChange: stateProps.onSelectionChange,\n }));\n\n const { gridProps } = createGridList<T, GridCollection<T>>(\n () => ({\n id: ariaProps.id,\n \"aria-label\": ariaProps[\"aria-label\"],\n \"aria-labelledby\": ariaProps[\"aria-labelledby\"],\n \"aria-describedby\": ariaProps[\"aria-describedby\"],\n isVirtualized: ariaProps.isVirtualized,\n onAction: ariaProps.onAction,\n isDisabled: ariaProps.isDisabled,\n selectionBehavior: stateProps.selectionBehavior,\n }),\n () => state,\n ref,\n );\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const renderValues = createMemo<GridListRenderProps>(() => ({\n isFocused: state.isFocused || isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: ariaProps.isDisabled ?? false,\n isEmpty: stateProps.items.length === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-GridList\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n const cleanGridProps = () => {\n const { ref: _ref1, ...rest } = gridProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n const isEmpty = () => stateProps.items.length === 0;\n const virtualizer = useVirtualizerContext();\n const parentCollectionRenderer = useCollectionRenderer<T>();\n const getItemNodes = createMemo(() =>\n Array.from(state.collection).filter((node) => node.type === \"item\"),\n );\n const getDropTargetByIndex = (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ): DropTarget | null => {\n const node = getItemNodes()[index];\n if (!node) return null;\n return { type: \"item\", key: node.key, dropPosition: position };\n };\n const hasDroppableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(\n hooks?.useDroppableCollectionState &&\n hooks.useDroppableCollection &&\n (hooks.dropTargetDelegate ||\n parentCollectionRenderer?.dropTargetDelegate ||\n hooks.ListDropTargetDelegate),\n );\n });\n const hasDraggableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);\n });\n const dragState = createMemo(() => {\n if (!hasDraggableDnd()) return undefined;\n return local.dragAndDropHooks?.useDraggableCollectionState?.({\n items: stateProps.items,\n });\n });\n const dropState = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n return local.dragAndDropHooks?.useDroppableCollectionState?.({});\n });\n createEffect(() => {\n if (!hasDraggableDnd()) return;\n const hooks = local.dragAndDropHooks;\n const activeDragState = dragState();\n if (!hooks?.useDraggableCollection || !activeDragState) return;\n hooks.useDraggableCollection({}, activeDragState, () => ref());\n });\n const droppableCollection = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n const hooks = local.dragAndDropHooks;\n const activeDropState = dropState();\n if (!hooks?.useDroppableCollection || !activeDropState) return undefined;\n const resolveDirection = (): \"ltr\" | \"rtl\" => {\n const el = ref();\n if (el && typeof window !== \"undefined\" && typeof window.getComputedStyle === \"function\") {\n const dir = window.getComputedStyle(el).direction;\n if (dir === \"rtl\") return \"rtl\";\n }\n return typeof document !== \"undefined\" && document.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n const dropTargetDelegate =\n hooks.dropTargetDelegate ??\n parentCollectionRenderer?.dropTargetDelegate ??\n (hooks.ListDropTargetDelegate\n ? new hooks.ListDropTargetDelegate(\n () => state.collection,\n () => ref(),\n { layout: \"grid\", orientation: \"vertical\", direction: resolveDirection() },\n )\n : undefined);\n if (!dropTargetDelegate) return undefined;\n return hooks.useDroppableCollection(\n {\n dropTargetDelegate,\n keyboardDelegate: {\n getFirstKey: () => state.collection.getFirstKey?.() ?? null,\n getLastKey: () => state.collection.getLastKey?.() ?? null,\n getKeyBelow: (key) => state.collection.getKeyAfter?.(key) ?? null,\n getKeyAbove: (key) => state.collection.getKeyBefore?.(key) ?? null,\n getKeyLeftOf: (key) =>\n resolveDirection() === \"rtl\"\n ? (state.collection.getKeyAfter?.(key) ?? null)\n : (state.collection.getKeyBefore?.(key) ?? null),\n getKeyRightOf: (key) =>\n resolveDirection() === \"rtl\"\n ? (state.collection.getKeyBefore?.(key) ?? null)\n : (state.collection.getKeyAfter?.(key) ?? null),\n getKeyPageBelow: (key) => state.collection.getKeyAfter?.(key) ?? null,\n getKeyPageAbove: (key) => state.collection.getKeyBefore?.(key) ?? null,\n },\n },\n activeDropState,\n () => ref(),\n );\n });\n const isRootDropTarget = createMemo(() => {\n return Boolean(dropState()?.target?.type === \"root\");\n });\n const dndRenderDropIndicator = createMemo(() =>\n useRenderDropIndicator(local.dragAndDropHooks, dropState()),\n );\n const dndDropIndicator = (index: number, position: \"before\" | \"after\" | \"on\") => {\n const target = getDropTargetByIndex(index, position);\n if (!target || target.type !== \"item\") return undefined;\n return dndRenderDropIndicator()?.(target);\n };\n const persistedKeys = useDndPersistedKeys(\n { focusedKey: () => state.focusedKey },\n local.dragAndDropHooks,\n dropState(),\n state.collection,\n );\n const virtualRange = createMemo(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return null;\n const baseRange = virtualizer.getVisibleRange(stateProps.items.length);\n const itemNodes = getItemNodes();\n const persistedIndexes = Array.from(persistedKeys())\n .map((key) => itemNodes.findIndex((node) => node.key === key))\n .filter((index) => index >= 0);\n const dropTarget = dropState()?.target;\n const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection);\n const focusedKey = state.focusedKey;\n const focusedIndex =\n focusedKey != null ? itemNodes.findIndex((node) => node.key === focusedKey) : -1;\n const forceIncludeIndexes = [\n dropTarget?.type === \"item\" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1,\n normalizedDropKey != null\n ? itemNodes.findIndex((node) => node.key === normalizedDropKey)\n : -1,\n dropTarget?.type === \"item\" ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(\n baseRange,\n persistedIndexes,\n stateProps.items.length,\n virtualizer,\n 80,\n {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n },\n );\n });\n createEffect(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;\n virtualizer.setDropTargetItemCountResolver(() => state.collection.size);\n virtualizer.setDropTargetIndexResolver((key) => {\n const entries = Array.from(state.collection);\n const index = entries.findIndex((node) => node.key === key);\n return index >= 0 ? index : null;\n });\n virtualizer.setDropTargetResolver((target) => {\n const node = Array.from(state.collection)[target.index];\n if (!node) return target;\n return {\n ...target,\n key: typeof node.key === \"string\" || typeof node.key === \"number\" ? node.key : undefined,\n };\n });\n onCleanup(() => {\n virtualizer.setDropTargetIndexResolver(undefined);\n virtualizer.setDropTargetItemCountResolver(undefined);\n virtualizer.setDropTargetResolver(undefined);\n });\n });\n const visibleItems = createMemo(() => {\n const range = virtualRange();\n if (!range) return stateProps.items;\n return stateProps.items.slice(range.start, range.end);\n });\n\n const contextValue = createMemo<GridListContextValue<T>>(() => ({\n state,\n collection: collection(),\n isDisabled: ariaProps.isDisabled ?? false,\n selectionBehavior: stateProps.selectionBehavior ?? \"replace\",\n dragAndDropHooks: local.dragAndDropHooks,\n dragState: dragState(),\n dropState: dropState(),\n }));\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => props.children(item as T),\n renderDropIndicator: (index: number, position: \"before\" | \"after\" | \"on\") =>\n dndDropIndicator(index, position) ??\n parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n\n return (\n <GridListContext.Provider value={contextValue() as unknown as GridListContextValue<object>}>\n <GridListStateContext.Provider\n value={state as unknown as GridState<object, GridCollection<object>>}\n >\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <div\n ref={(element) => {\n setRef(element);\n assignRef(local.ref, element);\n }}\n {...mergeProps(\n domProps(),\n cleanGridProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.isFocused || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n data-empty={isEmpty() || undefined}\n data-drop-target={isRootDropTarget() || undefined}\n >\n <SharedElementTransition>\n {isEmpty() && local.renderEmptyState ? (\n local.renderEmptyState()\n ) : (\n <>\n {virtualRange()?.offsetTop ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetTop}px` }}\n data-virtualizer-spacer=\"top\"\n />\n ) : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"before\");\n const onIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"on\");\n const afterIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"after\");\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {props.children(item)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetBottom}px` }}\n data-virtualizer-spacer=\"bottom\"\n />\n ) : null}\n </>\n )}\n </SharedElementTransition>\n {local.hasMore && local.onLoadMore && (\n <GridListLoadMoreItem onLoadMore={local.onLoadMore} isLoading={local.isLoading} />\n )}\n </div>\n </CollectionRendererContext.Provider>\n </GridListStateContext.Provider>\n </GridListContext.Provider>\n );\n}\n\n/**\n * An item in a grid list.\n */\nexport function GridListItem<T extends object>(props: GridListItemProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"onAction\",\n \"children\",\n \"ref\",\n ]);\n\n const context = useContext(GridListStateContext);\n if (!context) {\n throw new Error(\"GridListItem must be used within a GridList\");\n }\n const state = context as GridState<T, GridCollection<T>>;\n const listContext = useContext(GridListContext) as GridListContextValue<T> | null;\n\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null);\n\n const itemNode = createMemo(() => {\n const node = state.collection.getItem(local.id);\n if (!node) {\n return {\n type: \"item\" as const,\n key: local.id,\n value: local.item ?? null,\n textValue: local.textValue ?? String(local.id),\n level: 0,\n index: 0,\n hasChildNodes: false,\n childNodes: [],\n } as GridNode<T>;\n }\n return node as GridNode<T>;\n });\n\n const itemAria = createGridListItem<T, GridCollection<T>>(\n () => ({\n node: itemNode(),\n onAction: local.onAction,\n selectionBehavior: listContext?.selectionBehavior ?? \"replace\",\n }),\n () => state,\n ref,\n );\n const isSelected = () => itemAria.isSelected;\n const isDisabled = () => itemAria.isDisabled;\n const isPressed = () => itemAria.isPressed;\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isFocusVisible, focusProps } = createFocusRing();\n\n const isFocused = createMemo(() => state.focusedKey === local.id);\n const draggableItem = createMemo(() => {\n if (!listContext?.dragAndDropHooks?.useDraggableItem || !listContext.dragState)\n return undefined;\n return listContext.dragAndDropHooks.useDraggableItem(\n {\n key: local.id as string | number,\n },\n listContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDraggableItem\"]>>[1],\n );\n });\n const droppableItem = createMemo(() => {\n if (!listContext?.dragAndDropHooks?.useDroppableItem || !listContext.dropState)\n return undefined;\n return listContext.dragAndDropHooks.useDroppableItem(\n {\n key: local.id as string | number,\n },\n listContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDroppableItem\"]>>[1],\n () => ref(),\n );\n });\n\n const renderValues = createMemo<GridListItemRenderProps>(() => ({\n isSelected: isSelected(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible() && isFocused(),\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n selectionMode: state.selectionMode,\n selectionBehavior: listContext?.selectionBehavior ?? \"replace\",\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-GridList-item\",\n },\n renderValues,\n );\n\n const cleanRowProps = () => {\n const { ref: _ref1, ...rest } = itemAria.rowProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n ref={(element) => {\n setRef(element);\n assignRef(local.ref, element);\n }}\n {...domProps}\n {...mergeProps(\n cleanRowProps(),\n cleanHoverProps(),\n cleanFocusProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={isSelected() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={(isFocusVisible() && isFocused()) || undefined}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n data-dragging={draggableItem()?.isDragging || undefined}\n data-drop-target={droppableItem()?.isDropTarget || undefined}\n >\n <div {...itemAria.gridCellProps}>{renderProps.renderChildren()}</div>\n </div>\n );\n}\n\n/**\n * A checkbox for item selection in a grid list.\n */\nexport function GridListSelectionCheckbox(props: {\n itemKey: Key;\n class?: string;\n style?: JSX.CSSProperties;\n excludeFromTabOrder?: boolean;\n \"aria-label\"?: string;\n}): JSX.Element {\n const context = useContext(GridListStateContext);\n if (!context) {\n throw new Error(\"GridListSelectionCheckbox must be used within a GridList\");\n }\n\n const state = context as GridState<object, GridCollection<object>>;\n\n const checkboxAria = createGridListSelectionCheckbox<object, GridCollection<object>>(\n () => ({ key: props.itemKey }),\n () => state,\n );\n\n return (\n <input\n {...checkboxAria.checkboxProps}\n class={props.class}\n style={props.style}\n tabIndex={props.excludeFromTabOrder ? -1 : undefined}\n aria-label={props[\"aria-label\"] ?? \"Select\"}\n />\n );\n}\n\nexport function GridListLoadMoreItem(props: GridListLoadMoreItemProps): JSX.Element {\n let sentinelRef: HTMLDivElement | undefined;\n const [isPending, setIsPending] = createSignal(false);\n const isLoading = () => !!props.isLoading || isPending();\n\n const triggerLoadMore = async () => {\n if (isLoading()) return;\n setIsPending(true);\n try {\n await props.onLoadMore();\n } finally {\n setIsPending(false);\n }\n };\n\n createEffect(() => {\n if (!sentinelRef || typeof IntersectionObserver !== \"function\") return;\n const offset = props.scrollOffset ?? 1;\n const margin = `0px 0px ${100 * offset}% 0px`;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting) {\n void triggerLoadMore();\n }\n },\n { rootMargin: margin },\n );\n observer.observe(sentinelRef);\n return () => observer.disconnect();\n });\n\n const renderProps = useRenderProps(\n {\n children: props.children ?? (() => (isLoading() ? \"Loading more...\" : \"Load more\")),\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-GridList-loadMore\",\n },\n () => ({ isLoading: isLoading() }),\n );\n\n return (\n <>\n <div style={{ position: \"relative\", width: 0, height: 0, overflow: \"hidden\" }} inert>\n <div ref={sentinelRef} style={{ position: \"absolute\", height: \"1px\", width: \"1px\" }} />\n </div>\n <div\n role=\"row\"\n tabIndex={0}\n onFocus={() => {\n void triggerLoadMore();\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-loading={isLoading() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </>\n );\n}\n\nexport function GridListHeader(props: GridListHeaderProps): JSX.Element {\n return (\n <div class={props.class ?? \"solidaria-GridListHeader\"} style={props.style}>\n {props.children}\n </div>\n );\n}\n\n/**\n * Section primitive alias for GridList composition parity.\n */\nexport function GridListSection(props: GridListSectionProps): JSX.Element {\n return <Section {...props} />;\n}\n\nGridList.Item = GridListItem;\nGridList.SelectionCheckbox = GridListSelectionCheckbox;\nGridList.LoadMoreItem = GridListLoadMoreItem;\n","/**\n * Tree component for solidaria-components\n *\n * A pre-wired headless tree that combines state + aria hooks.\n * Based on react-aria-components/src/Tree.tsx\n *\n * Tree displays hierarchical data with expandable/collapsible nodes,\n * supporting keyboard navigation and selection.\n */\n\nimport {\n type JSX,\n onCleanup,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createTree,\n createTreeItem,\n createTreeSelectionCheckbox,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaTreeProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createTreeState,\n createTreeCollection,\n type TreeState,\n type TreeCollection,\n type TreeNode,\n type TreeItemData,\n type Key,\n type DropTarget,\n type ItemDropTarget,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport { type DragAndDropHooks } from \"./useDragAndDrop\";\nimport {\n getNormalizedDropTargetKey,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n} from \"./DragAndDrop\";\nimport {\n CollectionRendererContext,\n flattenCollectionEntries,\n isCollectionSection,\n Section,\n Header,\n type CollectionEntry,\n type CollectionRendererContextValue,\n type SectionProps,\n type HeaderProps,\n useCollectionRenderer,\n} from \"./Collection\";\nimport { useVirtualizerContext } from \"./Virtualizer\";\nimport {\n handleLinkClick,\n type LinkDOMProps,\n type RouterOptions,\n useLinkProps,\n useRouter,\n} from \"./RouterProvider\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface TreeRenderProps {\n /** Whether the tree has focus. */\n isFocused: boolean;\n /** Whether the tree has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the tree is disabled. */\n isDisabled: boolean;\n /** Whether the tree is empty. */\n isEmpty: boolean;\n}\n\nexport interface TreeProps<T extends object> extends Omit<AriaTreeProps, \"children\">, SlotProps {\n /** The hierarchical items to render in the tree. */\n items?: CollectionEntry<TreeItemData<T>>[];\n /** The selection mode. */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n /** The selection behavior (toggle vs replace). */\n selectionBehavior?: \"toggle\" | \"replace\";\n /** Whether disabled items can still receive focus. */\n disabledBehavior?: \"selection\" | \"all\";\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Currently selected keys (controlled). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** Currently expanded keys (controlled). */\n expandedKeys?: Iterable<Key>;\n /** Default expanded keys (uncontrolled). */\n defaultExpandedKeys?: Iterable<Key>;\n /** Handler called when expansion changes. */\n onExpandedChange?: (keys: Set<Key>) => void;\n /** The children of the component. A function provided to render each item. */\n children: (item: TreeItemData<T>, state: TreeRenderItemState) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TreeRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TreeRenderProps>;\n /** A function to render when the tree is empty. */\n renderEmptyState?: () => JSX.Element;\n /** Whether there are more items to load. */\n hasMore?: boolean;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Loading state for async collection parity. */\n loadingState?: \"idle\" | \"loading\" | \"loadingMore\" | \"sorting\" | \"filtering\" | \"error\";\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Renders the load-more sentinel content. */\n renderLoadMoreItem?: (state: { isLoading: boolean }) => JSX.Element;\n /** CSS className for the load-more sentinel. */\n loadMoreClass?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** Inline style for the load-more sentinel. */\n loadMoreStyle?: StyleOrFunction<{ isLoading: boolean }>;\n /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<T>;\n /** Ref for the rendered tree element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface TreeRenderItemState {\n /** Whether the item is expanded. */\n isExpanded: boolean;\n /** Whether the item is expandable (has children). */\n isExpandable: boolean;\n /** The nesting level (0 = root). */\n level: number;\n}\n\nexport interface TreeItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is expanded. */\n isExpanded: boolean;\n /** Whether the item is expandable (has children). */\n isExpandable: boolean;\n /** The nesting level (0 = root). */\n level: number;\n /** The selection mode active on the tree. */\n selectionMode: \"none\" | \"single\" | \"multiple\";\n /** The selection behavior active on the tree. */\n selectionBehavior: \"toggle\" | \"replace\";\n}\n\nexport interface TreeItemProps<T extends object>\n extends\n SlotProps,\n Omit<JSX.HTMLAttributes<HTMLElement>, \"class\" | \"style\" | \"children\" | \"id\" | \"ref\"> {\n /** The unique key for the item. */\n id: Key;\n /** The item value. */\n item?: TreeItemData<T>;\n /** The children of the item. A function may be provided to receive render props. */\n children?: RenderChildren<TreeItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TreeItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TreeItemRenderProps>;\n /** The text value of the item (for accessibility). */\n textValue?: string;\n /** Handler called when the item is activated. */\n onAction?: () => void;\n /** Whether this item has children that may not be loaded yet. */\n hasChildItems?: boolean;\n /** Whether this item is disabled. */\n isDisabled?: boolean;\n /** Link target metadata. */\n href?: string;\n target?: LinkDOMProps[\"target\"];\n download?: LinkDOMProps[\"download\"];\n rel?: LinkDOMProps[\"rel\"];\n hrefLang?: string;\n ping?: LinkDOMProps[\"ping\"];\n referrerPolicy?: LinkDOMProps[\"referrerPolicy\"];\n routerOptions?: RouterOptions;\n /** Ref for the rendered row element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport interface TreeExpandButtonProps {\n /** CSS class name for the button. */\n class?: string;\n /** CSS style for the button. */\n style?: JSX.CSSProperties;\n /** Children to render inside the button. */\n children?: JSX.Element | ((props: { isExpanded: boolean }) => JSX.Element);\n [key: `data-${string}`]: string | undefined;\n}\n\nexport interface TreeLoadMoreItemProps extends SlotProps {\n onLoadMore: () => void | Promise<void>;\n isLoading?: boolean;\n loadingState?: \"idle\" | \"loading\" | \"loadingMore\" | \"sorting\" | \"filtering\" | \"error\";\n level?: number;\n /** Scroll offset multiplier for early loading trigger (default: 1 = 100% of viewport height). */\n scrollOffset?: number;\n children?: JSX.Element;\n class?: ClassNameOrFunction<{ isLoading: boolean }>;\n style?: StyleOrFunction<{ isLoading: boolean }>;\n}\n\nexport interface TreeSectionProps extends SectionProps {}\nexport interface TreeHeaderProps extends HeaderProps {}\n\ninterface TreeContextValue<T extends object> {\n state: TreeState<T, TreeCollection<T>>;\n collection: TreeCollection<T>;\n isDisabled: boolean;\n renderItem: (item: TreeItemData<T>, state: TreeRenderItemState) => JSX.Element;\n dragAndDropHooks?: DragAndDropHooks<T>;\n dragState?: unknown;\n dropState?: unknown;\n}\n\ninterface TreeDropTargetDelegate {\n getDropTargetFromPoint: (\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ) => DropTarget | null;\n getKeyboardNavigationTarget?: (\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ) => DropTarget | null;\n getKeyboardPageNavigationTarget?: (\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ) => DropTarget | null;\n}\n\ninterface PointerTrackingState {\n lastY: number;\n lastX: number;\n yDirection: \"up\" | \"down\" | null;\n xDirection: \"left\" | \"right\" | null;\n boundaryContext: {\n parentKey: Key;\n lastSwitchY: number;\n lastSwitchX: number;\n preferredTargetIndex?: number;\n } | null;\n}\n\nconst X_SWITCH_THRESHOLD = 10;\nconst Y_SWITCH_THRESHOLD = 5;\nconst EXPANSION_KEYS = {\n expand: { ltr: \"ArrowRight\", rtl: \"ArrowLeft\" },\n collapse: { ltr: \"ArrowLeft\", rtl: \"ArrowRight\" },\n} as const;\n\nfunction resolveTreeDirection(element: HTMLElement | null): \"ltr\" | \"rtl\" {\n if (element) {\n const dir = element.closest(\"[dir]\")?.getAttribute(\"dir\");\n if (dir === \"rtl\") return \"rtl\";\n if (dir === \"ltr\") return \"ltr\";\n if (typeof window !== \"undefined\" && typeof window.getComputedStyle === \"function\") {\n const computedDirection = window.getComputedStyle(element).direction;\n if (computedDirection === \"rtl\") return \"rtl\";\n if (computedDirection === \"ltr\") return \"ltr\";\n }\n }\n if (typeof document !== \"undefined\") {\n return document.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n }\n return \"ltr\";\n}\n\nfunction createTreeDropTargetDelegate<T extends object>(\n delegate: TreeDropTargetDelegate,\n state: TreeState<T, TreeCollection<T>>,\n direction: \"ltr\" | \"rtl\",\n baseKeyboardNav?: (\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ) => DropTarget | null,\n): TreeDropTargetDelegate {\n const pointerTracking: PointerTrackingState = {\n lastY: 0,\n lastX: 0,\n yDirection: null,\n xDirection: null,\n boundaryContext: null,\n };\n\n const getPotentialTargets = (\n originalTarget: ItemDropTarget,\n isValidDropTarget: (target: DropTarget) => boolean,\n ): ItemDropTarget[] => {\n if (originalTarget.dropPosition === \"on\") return [originalTarget];\n\n const collection = state.collection;\n const getNodeNextKey = (node: TreeNode<T> | null | undefined): Key | null => {\n if (!node) return null;\n const declaredNextKey = (node as TreeNode<T> & { nextKey?: Key | null }).nextKey;\n return declaredNextKey ?? null;\n };\n const target: ItemDropTarget = { ...originalTarget };\n let currentItem = collection.getItem(target.key);\n while (currentItem && currentItem.type !== \"item\") {\n const nextKey = getNodeNextKey(currentItem);\n if (nextKey == null) break;\n target.key = nextKey;\n currentItem = collection.getItem(nextKey);\n }\n\n const potentialTargets: ItemDropTarget[] = [target];\n\n if (\n currentItem &&\n currentItem.hasChildNodes &&\n state.expandedKeys.has(currentItem.key) &&\n target.dropPosition === \"after\"\n ) {\n let firstChildItemNode: TreeNode<T> | null = null;\n for (const child of collection.getChildren(currentItem.key)) {\n if (child.type === \"item\") {\n firstChildItemNode = child;\n break;\n }\n }\n\n if (firstChildItemNode) {\n const beforeFirstChildTarget: ItemDropTarget = {\n type: \"item\",\n key: firstChildItemNode.key,\n dropPosition: \"before\",\n };\n\n if (isValidDropTarget(beforeFirstChildTarget)) {\n return [beforeFirstChildTarget];\n }\n return [];\n }\n }\n\n if (getNodeNextKey(currentItem) != null) {\n return [originalTarget];\n }\n\n let parentKey = currentItem?.parentKey ?? null;\n const ancestorTargets: ItemDropTarget[] = [];\n while (parentKey != null) {\n const parentItem = collection.getItem(parentKey);\n const nextKey = getNodeNextKey(parentItem);\n const nextItem = nextKey != null ? collection.getItem(nextKey) : null;\n const isLastChildAtLevel = !nextItem || nextItem.parentKey !== parentKey;\n\n if (isLastChildAtLevel) {\n const afterParentTarget: ItemDropTarget = {\n type: \"item\",\n key: parentKey,\n dropPosition: \"after\",\n };\n\n if (isValidDropTarget(afterParentTarget)) {\n ancestorTargets.push(afterParentTarget);\n }\n if (nextItem) break;\n }\n\n parentKey = parentItem?.parentKey ?? null;\n }\n\n if (ancestorTargets.length > 0) {\n potentialTargets.push(...ancestorTargets);\n }\n\n if (potentialTargets.length === 1) {\n const nextKey = collection.getKeyAfter(target.key);\n const nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (\n nextKey != null &&\n nextNode &&\n currentItem &&\n nextNode.level != null &&\n currentItem.level != null &&\n nextNode.level > currentItem.level\n ) {\n const beforeTarget: ItemDropTarget = {\n type: \"item\",\n key: nextKey,\n dropPosition: \"before\",\n };\n if (isValidDropTarget(beforeTarget)) return [beforeTarget];\n }\n }\n\n return potentialTargets.filter((candidate) => isValidDropTarget(candidate));\n };\n\n const selectTarget = (\n potentialTargets: ItemDropTarget[],\n originalTarget: ItemDropTarget,\n x: number,\n y: number,\n currentYMovement: \"up\" | \"down\" | null,\n currentXMovement: \"left\" | \"right\" | null,\n ): ItemDropTarget => {\n if (potentialTargets.length < 2) return potentialTargets[0];\n\n const currentItem = state.collection.getItem(originalTarget.key);\n const parentKey = currentItem?.parentKey;\n if (parentKey == null) return potentialTargets[0];\n\n if (\n !pointerTracking.boundaryContext ||\n pointerTracking.boundaryContext.parentKey !== parentKey\n ) {\n const initialTargetIndex =\n pointerTracking.yDirection === \"up\" ? potentialTargets.length - 1 : 0;\n pointerTracking.boundaryContext = {\n parentKey,\n preferredTargetIndex: initialTargetIndex,\n lastSwitchY: y,\n lastSwitchX: x,\n };\n }\n\n const boundaryContext = pointerTracking.boundaryContext;\n const distanceFromLastXSwitch = Math.abs(x - boundaryContext.lastSwitchX);\n const distanceFromLastYSwitch = Math.abs(y - boundaryContext.lastSwitchY);\n\n if (distanceFromLastYSwitch > Y_SWITCH_THRESHOLD && currentYMovement) {\n const currentIndex = boundaryContext.preferredTargetIndex ?? 0;\n if (currentYMovement === \"down\" && currentIndex === 0) {\n boundaryContext.preferredTargetIndex = potentialTargets.length - 1;\n } else if (currentYMovement === \"up\" && currentIndex === potentialTargets.length - 1) {\n boundaryContext.preferredTargetIndex = 0;\n }\n pointerTracking.xDirection = null;\n }\n\n if (distanceFromLastXSwitch > X_SWITCH_THRESHOLD && currentXMovement) {\n const currentTargetIndex = boundaryContext.preferredTargetIndex ?? 0;\n\n if (currentXMovement === \"left\") {\n if (direction === \"ltr\") {\n if (currentTargetIndex < potentialTargets.length - 1) {\n boundaryContext.preferredTargetIndex = currentTargetIndex + 1;\n boundaryContext.lastSwitchX = x;\n }\n } else if (currentTargetIndex > 0) {\n boundaryContext.preferredTargetIndex = currentTargetIndex - 1;\n boundaryContext.lastSwitchX = x;\n }\n } else if (currentXMovement === \"right\") {\n if (direction === \"ltr\") {\n if (currentTargetIndex > 0) {\n boundaryContext.preferredTargetIndex = currentTargetIndex - 1;\n boundaryContext.lastSwitchX = x;\n }\n } else if (currentTargetIndex < potentialTargets.length - 1) {\n boundaryContext.preferredTargetIndex = currentTargetIndex + 1;\n boundaryContext.lastSwitchX = x;\n }\n }\n\n pointerTracking.yDirection = null;\n }\n\n const targetIndex = Math.max(\n 0,\n Math.min(boundaryContext.preferredTargetIndex ?? 0, potentialTargets.length - 1),\n );\n return potentialTargets[targetIndex];\n };\n\n // --- Tree-aware keyboard DnD navigation (RAC parity) ---\n const getKeyboardNavigationTarget = (\n target: DropTarget | null,\n dir: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null => {\n const collection = state.collection;\n\n // If the target key is not a visible row (e.g. collapsed/hidden child node),\n // fall back to the base (non-override) index-based navigation to avoid infinite recursion.\n // The collection keyMap contains ALL nodes (even collapsed), so check visible rows instead.\n if (target && target.type === \"item\") {\n const node = collection.getItem(target.key);\n const isVisibleRow =\n node != null && (node as TreeNode<T> & { rowIndex?: number }).rowIndex != null;\n if (!isVisibleRow) {\n return baseKeyboardNav?.(target, dir, isValidDropTarget) ?? null;\n }\n }\n\n // Helpers\n const tryValid = (t: DropTarget): DropTarget | null => (isValidDropTarget(t) ? t : null);\n\n const getNodeNextKey = (node: TreeNode<T> | null | undefined): Key | null => {\n if (!node) return null;\n return (node as TreeNode<T> & { nextKey?: Key | null }).nextKey ?? null;\n };\n\n const isExpanded = (key: Key): boolean => {\n const node = collection.getItem(key);\n if (!node || !node.hasChildNodes) return false;\n return state.expandedKeys.has(key);\n };\n\n const getFirstChildItemKey = (key: Key): Key | null => {\n for (const child of collection.getChildren(key)) {\n if (child.type === \"item\") return child.key;\n }\n return null;\n };\n\n const getLastChildItemKey = (key: Key): Key | null => {\n let lastKey: Key | null = null;\n for (const child of collection.getChildren(key)) {\n if (child.type === \"item\") lastKey = child.key;\n }\n return lastKey;\n };\n\n // Find the deepest last expanded descendant (for \"previous\" from 'after')\n const getDeepestLastChild = (key: Key): Key => {\n let current = key;\n while (isExpanded(current)) {\n const lastChild = getLastChildItemKey(current);\n if (lastChild == null) break;\n current = lastChild;\n }\n return current;\n };\n\n if (dir === \"next\") {\n // From null → root\n if (!target) {\n return tryValid({ type: \"root\" });\n }\n // From root → first item 'before'\n if (target.type === \"root\") {\n const firstKey = collection.getFirstKey();\n if (firstKey != null) {\n return tryValid({ type: \"item\", key: firstKey, dropPosition: \"before\" });\n }\n return null;\n }\n if (target.type === \"item\") {\n switch (target.dropPosition) {\n case \"before\":\n return (\n tryValid({ type: \"item\", key: target.key, dropPosition: \"on\" }) ??\n tryValid({ type: \"item\", key: target.key, dropPosition: \"after\" })\n );\n case \"on\": {\n // If item is expanded and has children, go to first child 'before'\n if (isExpanded(target.key)) {\n const firstChild = getFirstChildItemKey(target.key);\n if (firstChild != null) {\n return (\n tryValid({ type: \"item\", key: firstChild, dropPosition: \"before\" }) ??\n tryValid({ type: \"item\", key: firstChild, dropPosition: \"on\" })\n );\n }\n }\n // Otherwise, next item in collection or 'after'\n const nextKey = collection.getKeyAfter(target.key);\n const targetNode = collection.getItem(target.key);\n const nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (\n targetNode &&\n nextNode &&\n nextNode.level != null &&\n targetNode.level != null &&\n nextNode.level >= targetNode.level\n ) {\n return (\n tryValid({ type: \"item\", key: nextNode.key, dropPosition: \"before\" }) ??\n tryValid({ type: \"item\", key: target.key, dropPosition: \"after\" })\n );\n }\n return tryValid({ type: \"item\", key: target.key, dropPosition: \"after\" });\n }\n case \"after\": {\n // If item is expanded (and we're at 'after'), first child\n if (isExpanded(target.key)) {\n const firstChild = getFirstChildItemKey(target.key);\n if (firstChild != null) {\n return (\n tryValid({ type: \"item\", key: firstChild, dropPosition: \"before\" }) ??\n tryValid({ type: \"item\", key: firstChild, dropPosition: \"on\" })\n );\n }\n }\n // Check if this is the last sibling at its level\n const targetNode = collection.getItem(target.key);\n const nextSiblingKey = getNodeNextKey(targetNode);\n if (nextSiblingKey != null) {\n const nextSibling = collection.getItem(nextSiblingKey);\n if (nextSibling?.type === \"item\") {\n return (\n tryValid({ type: \"item\", key: nextSibling.key, dropPosition: \"before\" }) ??\n tryValid({ type: \"item\", key: nextSibling.key, dropPosition: \"on\" })\n );\n }\n }\n // Traverse up to parent when at last sibling\n if (targetNode?.parentKey != null) {\n const parentNode = collection.getItem(targetNode.parentKey);\n const parentNextKey = getNodeNextKey(parentNode);\n const parentNextNode =\n parentNextKey != null ? collection.getItem(parentNextKey) : null;\n if (parentNextNode?.type === \"item\") {\n return tryValid({ type: \"item\", key: parentNextNode.key, dropPosition: \"before\" });\n }\n if (parentNode?.type === \"item\") {\n return tryValid({ type: \"item\", key: parentNode.key, dropPosition: \"after\" });\n }\n }\n // Reached end — try next item in flat collection\n const nextKey = collection.getKeyAfter(target.key);\n if (nextKey != null) {\n return (\n tryValid({ type: \"item\", key: nextKey, dropPosition: \"before\" }) ??\n tryValid({ type: \"item\", key: nextKey, dropPosition: \"on\" })\n );\n }\n return tryValid({ type: \"root\" });\n }\n }\n }\n return null;\n }\n\n // From null or root → last root-level item 'after'\n if (!target || target.type === \"root\") {\n const lastKey = collection.getLastKey();\n if (lastKey != null) {\n // Find root-level ancestor of last key\n let rootKey = lastKey;\n let node = collection.getItem(lastKey);\n while (node?.parentKey != null) {\n rootKey = node.parentKey;\n node = collection.getItem(rootKey);\n }\n return tryValid({ type: \"item\", key: rootKey, dropPosition: \"after\" });\n }\n return null;\n }\n\n if (target.type === \"item\") {\n switch (target.dropPosition) {\n case \"after\": {\n // If expanded with children, go to deepest last child 'after'\n const deepest = getDeepestLastChild(target.key);\n if (deepest !== target.key) {\n return (\n tryValid({ type: \"item\", key: deepest, dropPosition: \"after\" }) ??\n tryValid({ type: \"item\", key: target.key, dropPosition: \"on\" })\n );\n }\n return tryValid({ type: \"item\", key: target.key, dropPosition: \"on\" });\n }\n case \"on\":\n return tryValid({ type: \"item\", key: target.key, dropPosition: \"before\" });\n case \"before\": {\n // Move to the previous sibling's deepest last child 'after'\n const prevKey = collection.getKeyBefore(target.key);\n if (prevKey != null) {\n const deepest = getDeepestLastChild(prevKey);\n return (\n tryValid({ type: \"item\", key: deepest, dropPosition: \"after\" }) ??\n tryValid({ type: \"item\", key: prevKey, dropPosition: \"on\" })\n );\n }\n // No previous — go to root\n return tryValid({ type: \"root\" });\n }\n }\n }\n\n return null;\n };\n\n return {\n getDropTargetFromPoint(x, y, isValidDropTarget) {\n const baseTarget = delegate.getDropTargetFromPoint(x, y, isValidDropTarget);\n if (!baseTarget || baseTarget.type === \"root\") return baseTarget;\n\n const deltaY = y - pointerTracking.lastY;\n const deltaX = x - pointerTracking.lastX;\n let currentYMovement: \"up\" | \"down\" | null = pointerTracking.yDirection;\n let currentXMovement: \"left\" | \"right\" | null = pointerTracking.xDirection;\n\n if (Math.abs(deltaY) > Y_SWITCH_THRESHOLD) {\n currentYMovement = deltaY > 0 ? \"down\" : \"up\";\n pointerTracking.yDirection = currentYMovement;\n pointerTracking.lastY = y;\n }\n\n if (Math.abs(deltaX) > X_SWITCH_THRESHOLD) {\n currentXMovement = deltaX > 0 ? \"right\" : \"left\";\n pointerTracking.xDirection = currentXMovement;\n pointerTracking.lastX = x;\n }\n\n let target: ItemDropTarget = baseTarget;\n if (target.dropPosition === \"before\") {\n const keyBefore = state.collection.getKeyBefore(target.key);\n if (keyBefore != null) {\n const normalized: ItemDropTarget = {\n type: \"item\",\n key: keyBefore,\n dropPosition: \"after\",\n };\n if (isValidDropTarget(normalized)) target = normalized;\n }\n }\n\n const potentialTargets = getPotentialTargets(target, isValidDropTarget);\n if (potentialTargets.length === 0) return { type: \"root\" };\n\n if (potentialTargets.length > 1) {\n return selectTarget(potentialTargets, target, x, y, currentYMovement, currentXMovement);\n }\n\n pointerTracking.boundaryContext = null;\n return potentialTargets[0];\n },\n getKeyboardNavigationTarget,\n getKeyboardPageNavigationTarget: delegate.getKeyboardPageNavigationTarget?.bind(delegate),\n };\n}\n\ninterface TreeItemContextValue<T extends object> {\n node: TreeNode<T>;\n isExpanded: boolean;\n isExpandable: boolean;\n level: number;\n}\n\nexport const TreeContext = createContext<TreeContextValue<object> | null>(null);\nexport const TreeStateContext = createContext<TreeState<object, TreeCollection<object>> | null>(\n null,\n);\nexport const TreeItemContext = createContext<TreeItemContextValue<object> | null>(null);\nconst TreeItemContentContext = createContext<TreeItemRenderProps | null>(null);\n\nfunction isTreeItemRecord(value: unknown): value is Record<PropertyKey, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction treeItemDataFromNode<T extends object>(node: TreeNode<T>): TreeItemData<T> {\n const value = node.value;\n const item: Record<PropertyKey, unknown> = isTreeItemRecord(value) ? value : {};\n return {\n ...item,\n key: node.key,\n id: (item.id as Key | undefined) ?? node.key,\n value: (value ?? undefined) as T | undefined,\n textValue: node.textValue,\n isDisabled: node.isDisabled,\n hasChildItems: node.hasChildNodes,\n children:\n node.childNodes.length > 0\n ? node.childNodes.map((child) => treeItemDataFromNode(child))\n : undefined,\n };\n}\n\n/**\n * A tree displays hierarchical data with expandable/collapsible nodes,\n * supporting keyboard navigation and selection.\n */\nexport function Tree<T extends object>(props: TreeProps<T>): JSX.Element {\n const [local, stateProps, ariaProps] = splitProps(\n props,\n [\n \"class\",\n \"style\",\n \"slot\",\n \"renderEmptyState\",\n \"hasMore\",\n \"isLoading\",\n \"loadingState\",\n \"onLoadMore\",\n \"renderLoadMoreItem\",\n \"loadMoreClass\",\n \"loadMoreStyle\",\n \"dragAndDropHooks\",\n \"ref\",\n ],\n [\n \"items\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"selectionMode\",\n \"selectionBehavior\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"expandedKeys\",\n \"defaultExpandedKeys\",\n \"onExpandedChange\",\n ],\n );\n\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null);\n const flatItems = createMemo<TreeItemData<T>[]>(() =>\n flattenCollectionEntries(stateProps.items ?? []),\n );\n const hasSections = createMemo(() =>\n (stateProps.items ?? []).some((entry) => isCollectionSection(entry)),\n );\n\n const state = createTreeState<T, TreeCollection<T>>(() => ({\n collectionFactory: (expandedKeys) =>\n createTreeCollection(flatItems(), expandedKeys) as TreeCollection<T>,\n disabledKeys: stateProps.disabledKeys,\n disabledBehavior: stateProps.disabledBehavior,\n selectionMode: stateProps.selectionMode,\n selectionBehavior: stateProps.selectionBehavior,\n selectedKeys: stateProps.selectedKeys,\n defaultSelectedKeys: stateProps.defaultSelectedKeys,\n onSelectionChange: stateProps.onSelectionChange,\n expandedKeys: stateProps.expandedKeys,\n defaultExpandedKeys: stateProps.defaultExpandedKeys,\n onExpandedChange: stateProps.onExpandedChange,\n }));\n\n const [lastExpandedKeys, setLastExpandedKeys] = createSignal<Set<Key>>(new Set());\n const [lastItemsLength, setLastItemsLength] = createSignal(flatItems().length);\n const [collectionVersion, setCollectionVersion] = createSignal(0);\n createEffect(() => {\n const expanded = state.expandedKeys;\n const items = flatItems();\n if (!areSetsEqual(lastExpandedKeys(), expanded) || lastItemsLength() !== items.length) {\n setLastExpandedKeys(new Set(expanded));\n setLastItemsLength(items.length);\n setCollectionVersion((v) => v + 1);\n }\n });\n\n // Resolve writing direction for keyboard expand/collapse parity\n const treeDirection = createMemo(() => ariaProps.direction ?? resolveTreeDirection(ref()));\n\n const { treeProps } = createTree<T, TreeCollection<T>>(\n () => ({\n id: ariaProps.id,\n \"aria-label\": ariaProps[\"aria-label\"],\n \"aria-labelledby\": ariaProps[\"aria-labelledby\"],\n \"aria-describedby\": ariaProps[\"aria-describedby\"],\n isVirtualized: ariaProps.isVirtualized,\n onAction: ariaProps.onAction,\n isDisabled: ariaProps.isDisabled,\n direction: treeDirection(),\n }),\n () => state,\n ref,\n );\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const renderValues = createMemo<TreeRenderProps>(() => ({\n isFocused: state.isFocused || isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: ariaProps.isDisabled ?? false,\n isEmpty: flatItems().length === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Tree\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n const cleanTreeProps = () => {\n const { ref: _ref1, ...rest } = treeProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n const isEmpty = () => flatItems().length === 0;\n\n const visibleRows = createMemo(() => {\n collectionVersion();\n return state.collection.rows;\n });\n const virtualizer = useVirtualizerContext();\n const parentCollectionRenderer = useCollectionRenderer<TreeItemData<T>>();\n const getDropTargetByIndex = (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ): DropTarget | null => {\n const node = visibleRows()[index];\n if (!node) return null;\n return { type: \"item\", key: node.key, dropPosition: position };\n };\n const hasDroppableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(\n hooks?.useDroppableCollectionState &&\n hooks.useDroppableCollection &&\n (hooks.dropTargetDelegate ||\n parentCollectionRenderer?.dropTargetDelegate ||\n hooks.ListDropTargetDelegate),\n );\n });\n const hasDraggableDnd = createMemo(() => {\n const hooks = local.dragAndDropHooks;\n return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);\n });\n const dragState = createMemo(() => {\n if (!hasDraggableDnd()) return undefined;\n return local.dragAndDropHooks?.useDraggableCollectionState?.({\n items: visibleRows().map((node) => node.value as T),\n });\n });\n const dropState = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n return local.dragAndDropHooks?.useDroppableCollectionState?.({});\n });\n createEffect(() => {\n const activeDropState = dropState();\n if (!activeDropState) return;\n const originalGetDropOperation = activeDropState.getDropOperation.bind(activeDropState);\n\n activeDropState.getDropOperation = (target, types, allowedOperations) => {\n const currentDraggingKeys = dragState()?.draggingKeys ?? new Set<string | number>();\n if (target.type === \"item\" && currentDraggingKeys.size > 0) {\n if (currentDraggingKeys.has(target.key) && target.dropPosition === \"on\") {\n return \"cancel\";\n }\n\n let currentKey: Key | null = target.key;\n while (currentKey != null) {\n const item = state.collection.getItem(currentKey);\n const parentKey = item?.parentKey;\n if (parentKey != null && currentDraggingKeys.has(parentKey)) {\n return \"cancel\";\n }\n currentKey = parentKey ?? null;\n }\n }\n\n return originalGetDropOperation(target, types, allowedOperations);\n };\n\n onCleanup(() => {\n activeDropState.getDropOperation = originalGetDropOperation;\n });\n });\n createEffect(() => {\n if (!hasDraggableDnd()) return;\n const hooks = local.dragAndDropHooks;\n const activeDragState = dragState();\n if (!hooks?.useDraggableCollection || !activeDragState) return;\n hooks.useDraggableCollection({}, activeDragState, () => ref());\n });\n const contextValue = createMemo<TreeContextValue<T>>(() => ({\n state,\n collection: state.collection,\n isDisabled: ariaProps.isDisabled ?? false,\n renderItem: props.children,\n dragAndDropHooks: local.dragAndDropHooks,\n dragState: dragState(),\n dropState: dropState(),\n }));\n const droppableCollection = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n const hooks = local.dragAndDropHooks;\n const activeDropState = dropState();\n if (!hooks?.useDroppableCollection || !activeDropState) return undefined;\n const direction = resolveTreeDirection(ref());\n const baseDropTargetDelegate =\n hooks.dropTargetDelegate ??\n parentCollectionRenderer?.dropTargetDelegate ??\n (hooks.ListDropTargetDelegate\n ? new hooks.ListDropTargetDelegate(\n () => state.collection,\n () => ref(),\n { layout: \"stack\", orientation: \"vertical\", direction },\n )\n : undefined);\n if (!baseDropTargetDelegate) return undefined;\n const dropTargetDelegate = createTreeDropTargetDelegate(\n baseDropTargetDelegate as TreeDropTargetDelegate,\n state,\n direction,\n virtualizer?.getBaseKeyboardNavigationTarget,\n );\n return hooks.useDroppableCollection(\n {\n dropTargetDelegate,\n keyboardDelegate: {\n getFirstKey: () => state.collection.getFirstKey(),\n getLastKey: () => state.collection.getLastKey(),\n getKeyBelow: (key) => state.collection.getKeyAfter(key),\n getKeyAbove: (key) => state.collection.getKeyBefore(key),\n getKeyPageBelow: (key) => state.collection.getKeyAfter(key),\n getKeyPageAbove: (key) => state.collection.getKeyBefore(key),\n },\n get collection() {\n return state.collection;\n },\n get selectedKeys() {\n return state.selectedKeys;\n },\n setSelectedKeys: (keys: Set<Key>) => {\n if (state.selectionMode === \"none\") return;\n state.clearSelection();\n for (const key of keys) {\n state.toggleSelection(key);\n }\n },\n setFocusedKey: (key) => state.setFocusedKey(key),\n onDropActivate: (event) => {\n if (event.target.type !== \"item\") return;\n const key = event.target.key;\n const item = state.collection.getItem(key);\n const isExpanded = state.isExpanded(key);\n if (item?.hasChildNodes && (!isExpanded || hooks.isVirtualDragging?.())) {\n state.toggleKey(key);\n }\n },\n onKeyDown: (event) => {\n const target = activeDropState.target;\n if (!target || target.type !== \"item\" || target.dropPosition !== \"on\") return;\n const item = state.collection.getItem(target.key);\n if (!item?.hasChildNodes) return;\n const currentDirection = ariaProps.direction ?? resolveTreeDirection(ref());\n const expandKey = EXPANSION_KEYS.expand[currentDirection];\n const collapseKey = EXPANSION_KEYS.collapse[currentDirection];\n if (event.key === expandKey && !state.isExpanded(target.key)) {\n state.toggleKey(target.key);\n } else if (event.key === collapseKey && state.isExpanded(target.key)) {\n state.toggleKey(target.key);\n }\n },\n },\n activeDropState,\n () => ref(),\n );\n });\n const isRootDropTarget = createMemo(() => {\n return Boolean(dropState()?.target?.type === \"root\");\n });\n const dndRenderDropIndicator = createMemo(() =>\n useRenderDropIndicator(local.dragAndDropHooks, dropState()),\n );\n const dndDropIndicator = (index: number, position: \"before\" | \"after\" | \"on\") => {\n const target = getDropTargetByIndex(index, position);\n if (!target || target.type !== \"item\") return undefined;\n return dndRenderDropIndicator()?.(target);\n };\n const persistedKeys = useDndPersistedKeys(\n { focusedKey: () => state.focusedKey },\n local.dragAndDropHooks,\n dropState(),\n state.collection,\n );\n const virtualRange = createMemo(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return null;\n const rows = visibleRows();\n const baseRange = virtualizer.getVisibleRange(rows.length);\n const persistedIndexes = Array.from(persistedKeys())\n .map((key) => rows.findIndex((node) => node.key === key))\n .filter((index) => index >= 0);\n const dropTarget = dropState()?.target;\n const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection);\n const focusedKey = state.focusedKey;\n const focusedIndex =\n focusedKey != null ? rows.findIndex((node) => node.key === focusedKey) : -1;\n const forceIncludeIndexes = [\n dropTarget?.type === \"item\" ? rows.findIndex((node) => node.key === dropTarget.key) : -1,\n normalizedDropKey != null ? rows.findIndex((node) => node.key === normalizedDropKey) : -1,\n dropTarget?.type === \"item\" ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(\n baseRange,\n persistedIndexes,\n rows.length,\n virtualizer,\n 80,\n {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n },\n );\n });\n const virtualizedVisibleRows = createMemo(() => {\n const range = virtualRange();\n if (!range) return visibleRows();\n return visibleRows().slice(range.start, range.end);\n });\n createEffect(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;\n virtualizer.setDropTargetItemCountResolver(() => visibleRows().length);\n virtualizer.setDropTargetIndexResolver((key) => {\n const rows = visibleRows();\n const index = rows.findIndex((node) => node.key === key);\n return index >= 0 ? index : null;\n });\n virtualizer.setDropTargetResolver((target) => {\n const node = visibleRows()[target.index];\n if (!node) return target;\n return {\n ...target,\n key: typeof node.key === \"string\" || typeof node.key === \"number\" ? node.key : undefined,\n parentKey:\n typeof node.parentKey === \"string\" || typeof node.parentKey === \"number\"\n ? node.parentKey\n : node.parentKey == null\n ? null\n : undefined,\n level: typeof node.level === \"number\" ? node.level : undefined,\n };\n });\n onCleanup(() => {\n virtualizer.setDropTargetIndexResolver(undefined);\n virtualizer.setDropTargetItemCountResolver(undefined);\n virtualizer.setDropTargetResolver(undefined);\n });\n });\n const rowIndexByKey = createMemo(() => {\n const map = new Map<Key, number>();\n const rows = visibleRows();\n for (let i = 0; i < rows.length; i += 1) {\n map.set(rows[i].key, i);\n }\n return map;\n });\n const getAfterIndicatorIndexes = (\n absoluteIndex: number,\n renderRange?: { start: number; end: number } | null,\n ): number[] => {\n const rows = visibleRows();\n const current = rows[absoluteIndex];\n if (!current) return [];\n const next = rows[absoluteIndex + 1];\n // \"after\" is equivalent to next sibling's \"before\" when next row is at same or deeper level.\n if (next && next.level >= current.level) {\n return [];\n }\n\n const result: number[] = [];\n let cursorIndex: number | null = absoluteIndex;\n\n // Emit after indicators for current and ancestor boundary levels, matching RAC branch exit semantics.\n while (cursorIndex != null) {\n const cursor: TreeNode<T> | undefined = rows[cursorIndex];\n if (!cursor) break;\n const shouldRender =\n !next || (cursor.parentKey !== next.parentKey && next.level < cursor.level);\n if (!shouldRender) break;\n result.push(cursorIndex);\n if (cursor.parentKey == null) break;\n cursorIndex = rowIndexByKey().get(cursor.parentKey) ?? null;\n }\n if (!renderRange) return result;\n return result.filter((index) => index >= renderRange.start && index < renderRange.end);\n };\n // Install tree-aware keyboard navigation override into the Virtualizer (if present).\n // This replaces the generic index-based navigation with collection-level semantics\n // (tree branch traversal, level-aware wrapping — RAC parity item #36).\n createEffect(() => {\n if (!virtualizer) return;\n const direction = resolveTreeDirection(ref());\n const parentDelegate: TreeDropTargetDelegate = {\n getDropTargetFromPoint:\n parentCollectionRenderer?.dropTargetDelegate?.getDropTargetFromPoint ??\n ((_x, _y, _v) => null),\n getKeyboardNavigationTarget:\n parentCollectionRenderer?.dropTargetDelegate?.getKeyboardNavigationTarget,\n getKeyboardPageNavigationTarget:\n parentCollectionRenderer?.dropTargetDelegate?.getKeyboardPageNavigationTarget,\n };\n const treeDelegate = createTreeDropTargetDelegate(\n parentDelegate,\n state,\n direction,\n virtualizer.getBaseKeyboardNavigationTarget,\n );\n virtualizer.setKeyboardNavigationOverride(\n treeDelegate.getKeyboardNavigationTarget\n ? (target, dir, isValid) => treeDelegate.getKeyboardNavigationTarget!(target, dir, isValid)\n : undefined,\n );\n onCleanup(() => {\n virtualizer.setKeyboardNavigationOverride(undefined);\n });\n });\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => item as JSX.Element,\n renderDropIndicator: (index: number, position: \"before\" | \"after\" | \"on\") =>\n dndDropIndicator(index, position) ??\n parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n const rootKeyByNodeKey = createMemo(() => {\n const rootMap = new Map<Key, Key>();\n for (const row of visibleRows()) {\n let rootKey: Key = row.key;\n let parentKey = row.parentKey;\n while (parentKey != null) {\n rootKey = parentKey;\n parentKey = state.collection.getParentKey(parentKey);\n }\n rootMap.set(row.key, rootKey);\n }\n return rootMap;\n });\n const renderRange = createMemo(() => {\n const range = virtualRange();\n if (!range) return null;\n return { start: range.start, end: range.end };\n });\n const renderableRows = createMemo(() => {\n const offset = renderRange()?.start ?? 0;\n return virtualizedVisibleRows().map((node, index) => ({\n node,\n globalIndex: offset + index,\n }));\n });\n const sectionedRenderableRows = createMemo(() => {\n if (!hasSections()) return null;\n const rootMap = rootKeyByNodeKey();\n const rows = renderableRows();\n return (stateProps.items ?? []).map((entry) => {\n if (!isCollectionSection(entry)) {\n const matching = rows.filter((row) => rootMap.get(row.node.key) === entry.key);\n return {\n type: \"single\" as const,\n item: entry,\n rows: matching,\n };\n }\n const sectionRootKeys = new Set(entry.items.map((item) => item.key));\n const sectionRows = rows.filter((row) => {\n const rootKey = rootMap.get(row.node.key);\n return rootKey != null && sectionRootKeys.has(rootKey);\n });\n return {\n type: \"section\" as const,\n section: entry,\n rows: sectionRows,\n };\n });\n });\n const renderTreeRow = (node: TreeNode<T>, itemIndex: number) => {\n const beforeIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex, \"before\");\n const onIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex, \"on\");\n const afterIndicatorIndexes = () => getAfterIndicatorIndexes(itemIndex, renderRange());\n const itemData = treeItemDataFromNode(node);\n const itemState: TreeRenderItemState = {\n isExpanded: node.isExpanded ?? false,\n isExpandable: node.isExpandable ?? false,\n level: node.level,\n };\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {props.children(itemData, itemState)}\n <For each={afterIndicatorIndexes()}>\n {(afterIndex) => collectionRenderer().renderDropIndicator?.(afterIndex, \"after\")}\n </For>\n </>\n );\n };\n\n return (\n <TreeContext.Provider value={contextValue() as unknown as TreeContextValue<object>}>\n <TreeStateContext.Provider\n value={state as unknown as TreeState<object, TreeCollection<object>>}\n >\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <div\n ref={(element) => {\n setRef(element);\n assignRef(local.ref, element);\n }}\n {...mergeProps(\n domProps(),\n cleanTreeProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.isFocused || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n data-empty={isEmpty() || undefined}\n data-drop-target={isRootDropTarget() || undefined}\n data-selection-mode={\n stateProps.selectionMode !== \"none\" ? stateProps.selectionMode : undefined\n }\n data-allows-dragging={hasDraggableDnd() || undefined}\n >\n <SharedElementTransition>\n {isEmpty() && local.renderEmptyState ? (\n <div role=\"row\" aria-level={1} style={{ display: \"contents\" }}>\n <div role=\"gridcell\" style={{ display: \"contents\" }}>\n {local.renderEmptyState()}\n </div>\n </div>\n ) : (\n <>\n {virtualRange()?.offsetTop ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetTop}px` }}\n data-virtualizer-spacer=\"top\"\n />\n ) : null}\n <Show\n when={hasSections()}\n fallback={\n <For each={renderableRows()}>\n {(row) => renderTreeRow(row.node, row.globalIndex)}\n </For>\n }\n >\n <For each={sectionedRenderableRows() ?? []}>\n {(entry) => (\n <Show when={entry.rows.length > 0}>\n <Show\n when={entry.type === \"section\"}\n fallback={\n <For each={entry.rows}>\n {(row) => renderTreeRow(row.node, row.globalIndex)}\n </For>\n }\n >\n <TreeSection>\n {entry.type === \"section\" && entry.section.title ? (\n <TreeHeader>{entry.section.title}</TreeHeader>\n ) : null}\n <For each={entry.rows}>\n {(row) => renderTreeRow(row.node, row.globalIndex)}\n </For>\n </TreeSection>\n </Show>\n </Show>\n )}\n </For>\n </Show>\n {virtualRange()?.offsetBottom ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetBottom}px` }}\n data-virtualizer-spacer=\"bottom\"\n />\n ) : null}\n </>\n )}\n </SharedElementTransition>\n {local.hasMore && local.onLoadMore && (\n <TreeLoadMoreItem\n onLoadMore={local.onLoadMore}\n isLoading={local.isLoading}\n loadingState={local.loadingState}\n class={local.loadMoreClass}\n style={local.loadMoreStyle}\n >\n {local.renderLoadMoreItem?.({\n isLoading:\n !!local.isLoading ||\n local.loadingState === \"loading\" ||\n local.loadingState === \"loadingMore\",\n })}\n </TreeLoadMoreItem>\n )}\n </div>\n </CollectionRendererContext.Provider>\n </TreeStateContext.Provider>\n </TreeContext.Provider>\n );\n}\n\n/**\n * An item in a tree.\n */\nexport function TreeItem<T extends object>(props: TreeItemProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"onAction\",\n \"hasChildItems\",\n \"isDisabled\",\n \"href\",\n \"target\",\n \"download\",\n \"rel\",\n \"hrefLang\",\n \"ping\",\n \"referrerPolicy\",\n \"routerOptions\",\n \"ref\",\n \"children\",\n ]);\n\n const context = useContext(TreeStateContext);\n if (!context) {\n throw new Error(\"TreeItem must be used within a Tree\");\n }\n const state = context as TreeState<T, TreeCollection<T>>;\n const treeContext = useContext(TreeContext) as TreeContextValue<T> | null;\n const router = useRouter();\n const linkProps = createMemo(() =>\n useLinkProps({\n href: local.href,\n target: local.target,\n rel: local.rel,\n download: local.download,\n ping: local.ping,\n referrerPolicy: local.referrerPolicy,\n }),\n );\n\n const [ref, setRef] = createSignal<HTMLElement | null>(null);\n const setItemRef = (element: HTMLElement) => {\n setRef(element);\n assignRef(local.ref, element);\n };\n\n const itemNode = createMemo(() => {\n const node = state.collection.getItem(local.id);\n if (!node) {\n return {\n type: \"item\" as const,\n key: local.id,\n value: local.item?.value ?? null,\n textValue: local.textValue ?? String(local.id),\n level: 0,\n index: 0,\n hasChildNodes: !!local.hasChildItems,\n childNodes: [],\n isDisabled: local.isDisabled,\n isExpandable: !!local.hasChildItems,\n isExpanded: false,\n } as TreeNode<T>;\n }\n return node;\n });\n\n const treeItemAria = createTreeItem<T, TreeCollection<T>>(\n () => ({\n node: itemNode(),\n selectionBehavior: state.selectionBehavior,\n onAction: local.onAction,\n isDisabled: local.isDisabled,\n textValue: local.textValue,\n }),\n () => state,\n ref,\n );\n const isSelected = () => treeItemAria.isSelected;\n const isDisabled = () => treeItemAria.isDisabled;\n const isPressed = () => treeItemAria.isPressed;\n const isExpanded = () => treeItemAria.isExpanded;\n const isExpandable = () => treeItemAria.isExpandable;\n const level = () => treeItemAria.level;\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isFocusVisible, focusProps } = createFocusRing();\n\n const isFocused = createMemo(() => state.focusedKey === local.id);\n const draggableItem = createMemo(() => {\n if (!treeContext?.dragAndDropHooks?.useDraggableItem || !treeContext.dragState)\n return undefined;\n return treeContext.dragAndDropHooks.useDraggableItem(\n {\n key: local.id as string | number,\n },\n treeContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDraggableItem\"]>>[1],\n );\n });\n const droppableItem = createMemo(() => {\n if (!treeContext?.dragAndDropHooks?.useDroppableItem || !treeContext.dropState)\n return undefined;\n return treeContext.dragAndDropHooks.useDroppableItem(\n {\n key: local.id as string | number,\n },\n treeContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDroppableItem\"]>>[1],\n () => ref(),\n );\n });\n\n const renderValues = createMemo<TreeItemRenderProps>(() => ({\n isSelected: isSelected(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible() && isFocused(),\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n isExpanded: isExpanded(),\n isExpandable: isExpandable(),\n level: level(),\n selectionMode: state.selectionMode,\n selectionBehavior: state.selectionBehavior,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Tree-item\",\n },\n renderValues,\n );\n\n const cleanRowProps = () => {\n const { ref: _ref1, ...rest } = treeItemAria.rowProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n const itemContextValue = createMemo<TreeItemContextValue<T>>(() => ({\n node: itemNode(),\n isExpanded: isExpanded(),\n isExpandable: isExpandable(),\n level: level(),\n }));\n\n const rowStyle = () => ({\n \"--tree-item-level\": String(level()),\n ...((typeof renderProps.style() === \"object\" ? renderProps.style() : {}) as Record<\n string,\n string\n >),\n });\n\n const rowContent = () => (\n <TreeItemContentContext.Provider value={renderValues()}>\n <div {...treeItemAria.gridCellProps} class=\"solidaria-Tree-item-content\">\n {renderProps.renderChildren()}\n </div>\n </TreeItemContentContext.Provider>\n );\n\n const mergedRowProps = () =>\n mergeProps(\n cleanRowProps(),\n cleanHoverProps(),\n cleanFocusProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n );\n\n const onLinkedRowClick = (event: MouseEvent) => {\n const onClick = (mergedRowProps() as { onClick?: (event: MouseEvent) => void }).onClick;\n onClick?.(event);\n handleLinkClick(event, router, local.href, local.routerOptions);\n };\n\n const downloadAttr = () => {\n const download = linkProps().download;\n return typeof download === \"boolean\" ? (download ? \"\" : undefined) : download;\n };\n\n const referrerPolicyAttr = () => linkProps().referrerPolicy || undefined;\n const linkedRowDomProps = () =>\n local.href\n ? {\n onClick: onLinkedRowClick,\n \"data-href\": linkProps().href,\n \"data-target\": linkProps().target,\n \"data-download\": downloadAttr(),\n \"data-rel\": linkProps().rel,\n \"data-hreflang\": local.hrefLang,\n \"data-ping\": linkProps().ping,\n \"data-referrer-policy\": referrerPolicyAttr(),\n }\n : {};\n\n return (\n <TreeItemContext.Provider value={itemContextValue() as unknown as TreeItemContextValue<object>}>\n <div\n ref={setItemRef}\n {...domProps}\n {...mergedRowProps()}\n {...linkedRowDomProps()}\n class={renderProps.class()}\n style={rowStyle()}\n data-selected={isSelected() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={(isFocusVisible() && isFocused()) || undefined}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n data-expanded={isExpanded() || undefined}\n data-expandable={isExpandable() || undefined}\n data-has-child-items={isExpandable() || undefined}\n data-level={level()}\n data-selection-mode={\n treeContext?.state.selectionMode !== \"none\" ? treeContext?.state.selectionMode : undefined\n }\n data-dragging={draggableItem()?.isDragging || undefined}\n data-drop-target={droppableItem()?.isDropTarget || undefined}\n >\n {rowContent()}\n </div>\n </TreeItemContext.Provider>\n );\n}\n\n/**\n * A button to expand/collapse a tree item.\n */\nexport function TreeExpandButton(props: TreeExpandButtonProps): JSX.Element {\n const itemContext = useContext(TreeItemContext);\n if (!itemContext) {\n throw new Error(\"TreeExpandButton must be used within a Tree\");\n }\n\n const stateContext = useContext(TreeStateContext);\n if (!stateContext) {\n throw new Error(\"TreeExpandButton must be used within a Tree\");\n }\n\n const state = stateContext as TreeState<object, TreeCollection<object>>;\n\n const treeItemAria = createTreeItem(\n () => ({ node: itemContext.node }),\n () => state,\n () => null,\n );\n\n const cleanExpandProps = () => {\n const { ref: _ref, ...rest } = treeItemAria.expandButtonProps as Record<string, unknown>;\n return rest;\n };\n const dataProps = () => {\n const result: Record<string, string | undefined> = {};\n for (const key in props) {\n if (key.startsWith(\"data-\")) {\n result[key] = props[key as `data-${string}`];\n }\n }\n return result;\n };\n\n const isExpanded = createMemo(() => state.isExpanded(itemContext.node.key));\n\n const renderChildren = () => {\n if (typeof props.children === \"function\") {\n return props.children({ isExpanded: isExpanded() });\n }\n return props.children;\n };\n\n return (\n <Show when={itemContext.isExpandable}>\n <button\n {...cleanExpandProps()}\n {...dataProps()}\n class={props.class ?? \"solidaria-Tree-expand-button\"}\n style={props.style}\n data-expanded={isExpanded() || undefined}\n >\n {renderChildren()}\n </button>\n </Show>\n );\n}\n\n/**\n * A checkbox for item selection in a tree.\n */\nexport function TreeSelectionCheckbox(props: {\n itemKey: Key;\n class?: string;\n style?: JSX.CSSProperties;\n excludeFromTabOrder?: boolean;\n \"aria-label\"?: string;\n}): JSX.Element {\n const context = useContext(TreeStateContext);\n if (!context) {\n throw new Error(\"TreeSelectionCheckbox must be used within a Tree\");\n }\n\n const state = context as TreeState<object, TreeCollection<object>>;\n\n const treeSelectionCheckboxAria = createTreeSelectionCheckbox<object, TreeCollection<object>>(\n () => ({ key: props.itemKey }),\n () => state,\n );\n\n return (\n <input\n {...treeSelectionCheckboxAria.checkboxProps}\n class={props.class ?? \"solidaria-Tree-checkbox\"}\n style={props.style}\n tabIndex={props.excludeFromTabOrder ? -1 : undefined}\n aria-label={props[\"aria-label\"] ?? treeSelectionCheckboxAria.checkboxProps[\"aria-label\"]}\n />\n );\n}\n\nexport function TreeLoadMoreItem(props: TreeLoadMoreItemProps): JSX.Element {\n let sentinelRef: HTMLDivElement | undefined;\n const [isPending, setIsPending] = createSignal(false);\n const isLoading = () =>\n !!props.isLoading ||\n props.loadingState === \"loading\" ||\n props.loadingState === \"loadingMore\" ||\n isPending();\n\n const triggerLoadMore = async () => {\n if (isLoading()) return;\n setIsPending(true);\n try {\n await props.onLoadMore();\n } finally {\n setIsPending(false);\n }\n };\n\n createEffect(() => {\n if (!sentinelRef || typeof IntersectionObserver !== \"function\") return;\n const offset = props.scrollOffset ?? 1;\n const margin = `0px 0px ${100 * offset}% 0px`;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting) {\n void triggerLoadMore();\n }\n },\n { rootMargin: margin },\n );\n observer.observe(sentinelRef);\n return () => observer.disconnect();\n });\n\n const renderProps = useRenderProps(\n {\n children: props.children ?? (() => (isLoading() ? \"Loading more...\" : \"Load more\")),\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-Tree-loadMore\",\n },\n () => ({ isLoading: isLoading() }),\n );\n\n return (\n <>\n <div style={{ position: \"relative\", width: 0, height: 0, overflow: \"hidden\" }} inert>\n <div ref={sentinelRef} style={{ position: \"absolute\", height: \"1px\", width: \"1px\" }} />\n </div>\n <div\n role=\"row\"\n aria-level={props.level ?? 1}\n onFocus={() => {\n void triggerLoadMore();\n }}\n onFocusIn={() => {\n void triggerLoadMore();\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-loading={isLoading() || undefined}\n data-level={props.level ?? 1}\n >\n <div\n role=\"gridcell\"\n onFocus={() => {\n void triggerLoadMore();\n }}\n >\n {renderProps.renderChildren()}\n </div>\n </div>\n </>\n );\n}\n\nexport interface TreeItemContentProps {\n children?: RenderChildren<TreeItemContentRenderProps>;\n}\nexport type TreeItemContentRenderProps = TreeItemRenderProps;\n\nexport function TreeItemContent(props: TreeItemContentProps): JSX.Element {\n const context = useContext(TreeItemContentContext);\n if (!context) {\n throw new Error(\"TreeItemContent must be used within a TreeItem\");\n }\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n },\n () => context,\n );\n\n return <>{renderProps.renderChildren()}</>;\n}\n\nexport function TreeSection(props: TreeSectionProps): JSX.Element {\n return <Section {...props} />;\n}\n\nexport function TreeHeader(props: TreeHeaderProps): JSX.Element {\n return <Header {...props} />;\n}\n\nTree.Item = TreeItem;\nTree.ExpandButton = TreeExpandButton;\nTree.SelectionCheckbox = TreeSelectionCheckbox;\nTree.LoadMoreItem = TreeLoadMoreItem;\nTree.Section = TreeSection;\nTree.Header = TreeHeader;\n\nfunction areSetsEqual<T>(a: Set<T>, b: Set<T>): boolean {\n if (a.size !== b.size) return false;\n for (const entry of a) {\n if (!b.has(entry)) return false;\n }\n return true;\n}\n","/**\n * Color components for solidaria-components\n *\n * Pre-wired headless color picker components that combine state + aria hooks.\n * Port of react-aria-components color components.\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n untrack,\n useContext,\n Show,\n} from \"solid-js\";\nimport {\n createColorSlider,\n createColorArea,\n createColorWheel,\n createColorField,\n createColorSwatch,\n createListBox,\n createOption,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaColorSliderOptions,\n type AriaColorAreaOptions,\n type AriaColorWheelOptions,\n type AriaColorFieldOptions,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n createColorSliderState,\n createColorAreaState,\n createColorWheelState,\n createColorFieldState,\n normalizeColor,\n type Color,\n type ColorChannel,\n type ColorFormat,\n type ColorSpace,\n type ColorSliderState,\n type ColorAreaState,\n type ColorWheelState,\n type ColorFieldState,\n type ListState,\n type Key,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ninterface ColorPickerChannelContextValue {\n value?: Color | string;\n onChange?: (color: Color) => void;\n}\n\ninterface ColorPickerStateContextValue {\n color: () => Color;\n setColor: (color: Color) => void;\n}\n\ninterface ColorSwatchPickerItemData {\n key: string;\n color: Color;\n textValue: string;\n isDisabled?: boolean;\n}\n\ninterface ColorSwatchPickerContextValue {\n state: ListState<ColorSwatchPickerItemData>;\n registerItem: (item: ColorSwatchPickerItemData) => void;\n unregisterItem: (key: string) => void;\n}\n\nconst ColorPickerContextInternal = createContext<ColorPickerChannelContextValue | null>(null);\nconst ColorPickerStateContextInternal = createContext<ColorPickerStateContextValue | null>(null);\nconst ColorSwatchContextInternal = createContext<{ color?: Color | string } | null>(null);\nconst ColorSwatchPickerContextInternal = createContext<ColorSwatchPickerContextValue | null>(null);\n\nexport interface ColorSliderRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** The color channel being controlled. */\n channel: ColorChannel;\n /** The slider orientation. */\n orientation: \"horizontal\" | \"vertical\";\n /** The current value. */\n value: number;\n /** The formatted current value. */\n valueLabel: string;\n /** The current color. */\n color: Color;\n /** The default inline styles applied by the color slider hook. */\n defaultStyle: JSX.CSSProperties;\n}\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderOptions, \"channel\">, SlotProps {\n /** The current color value (controlled). */\n value?: Color | string;\n /** The default color value (uncontrolled). */\n defaultValue?: Color | string;\n /** Handler called when the color changes. */\n onChange?: (color: Color) => void;\n /** Handler called when dragging ends. */\n onChangeEnd?: (color: Color) => void;\n /** Color space used for channel values. */\n colorSpace?: ColorSpace;\n /** The color channel to control. */\n channel: ColorChannel;\n /** A visible label for the slider. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<ColorSliderRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorSliderRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorSliderRenderProps>;\n}\n\nexport interface ColorSliderTrackRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** The slider orientation. */\n orientation: \"horizontal\" | \"vertical\";\n /** The default inline styles applied by the color slider hook. */\n defaultStyle: JSX.CSSProperties;\n}\n\nexport interface ColorSliderTrackProps extends SlotProps {\n /** The children of the track. */\n children?: RenderChildren<ColorSliderTrackRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorSliderTrackRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorSliderTrackRenderProps>;\n}\n\nexport interface ColorSliderLabelProps extends SlotProps {\n /** The label contents. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\nexport interface ColorSliderOutputProps extends SlotProps {\n /** The output contents. Defaults to the formatted slider value. */\n children?: JSX.Element | ((renderProps: ColorSliderRenderProps) => JSX.Element);\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\nexport interface ColorSliderThumbRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the thumb is being dragged. */\n isDragging: boolean;\n /** Whether the thumb is focused. */\n isFocused: boolean;\n /** Whether the thumb has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the thumb is hovered. */\n isHovered: boolean;\n /** The current display color. */\n color: Color;\n /** The default inline styles applied by the color slider hook. */\n defaultStyle: JSX.CSSProperties;\n}\n\nexport interface ColorSliderThumbProps extends SlotProps {\n /** The children of the thumb. */\n children?: RenderChildren<ColorSliderThumbRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorSliderThumbRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorSliderThumbRenderProps>;\n /** Ref callback for the thumb element. */\n ref?: (element: HTMLDivElement) => void;\n}\n\ninterface ColorSliderContextValue {\n state: ColorSliderState;\n trackProps: JSX.HTMLAttributes<HTMLDivElement>;\n thumbProps: JSX.HTMLAttributes<HTMLDivElement>;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n outputProps: JSX.HTMLAttributes<HTMLOutputElement>;\n labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n trackRef: HTMLDivElement | undefined;\n setTrackRef: (el: HTMLDivElement) => void;\n setInputRef: (el: HTMLInputElement) => void;\n}\n\nexport const ColorSliderContext = createContext<ColorSliderContextValue | null>(null);\n\n/**\n * A color slider allows users to adjust a single color channel.\n */\nexport function ColorSlider(props: ColorSliderProps): JSX.Element {\n const pickerContext = useContext(ColorPickerContextInternal);\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"label\"],\n [\"value\", \"defaultValue\", \"onChange\", \"onChangeEnd\", \"channel\", \"colorSpace\"],\n [\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"isDisabled\",\n \"name\",\n \"form\",\n \"orientation\",\n \"channelName\",\n ],\n );\n\n // Create color slider state\n const state = createColorSliderState(() => ({\n value: stateProps.value ?? pickerContext?.value,\n defaultValue: stateProps.defaultValue,\n onChange: stateProps.onChange ?? pickerContext?.onChange,\n onChangeEnd: stateProps.onChangeEnd,\n channel: stateProps.channel,\n colorSpace: stateProps.colorSpace,\n orientation: ariaProps.orientation,\n isDisabled: ariaProps.isDisabled,\n }));\n\n let trackRef: HTMLDivElement | undefined;\n const setTrackRef = (el: HTMLDivElement) => {\n trackRef = el;\n };\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n // Create color slider aria props\n const colorSliderAria = createColorSlider(\n () => ({\n id: ariaProps.id,\n channel: stateProps.channel,\n label: local.label,\n \"aria-label\": ariaProps[\"aria-label\"],\n \"aria-labelledby\": ariaProps[\"aria-labelledby\"],\n \"aria-describedby\": ariaProps[\"aria-describedby\"],\n \"aria-details\": ariaProps[\"aria-details\"],\n isDisabled: ariaProps.isDisabled,\n name: ariaProps.name,\n form: ariaProps.form,\n orientation: ariaProps.orientation,\n channelName: ariaProps.channelName,\n }),\n () => state,\n () => trackRef ?? null,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<ColorSliderRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n channel: state.channel,\n orientation: state.orientation,\n value: state.getThumbValue(),\n valueLabel: state.getThumbValueLabel(),\n color: state.value,\n defaultStyle: (colorSliderAria.trackProps as { style?: JSX.CSSProperties }).style ?? {},\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorSlider\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n return (\n <ColorSliderContext.Provider\n value={{\n state,\n get trackProps() {\n return colorSliderAria.trackProps;\n },\n get thumbProps() {\n return colorSliderAria.thumbProps;\n },\n get inputProps() {\n return colorSliderAria.inputProps;\n },\n get outputProps() {\n return colorSliderAria.outputProps;\n },\n get labelProps() {\n return colorSliderAria.labelProps;\n },\n get trackRef() {\n return trackRef;\n },\n setTrackRef,\n setInputRef,\n }}\n >\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging || undefined}\n data-orientation={state.orientation}\n slot={local.slot || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </ColorSliderContext.Provider>\n );\n}\n\n/**\n * The label element of a color slider.\n */\nexport function ColorSliderLabel(props: ColorSliderLabelProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"slot\", \"children\"]);\n\n const context = useContext(ColorSliderContext);\n if (!context) {\n throw new Error(\"ColorSliderLabel must be used within a ColorSlider\");\n }\n\n const labelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label {...domProps} {...labelProps()} class={local.class}>\n {local.children}\n </label>\n );\n}\n\n/**\n * The output element of a color slider.\n */\nexport function ColorSliderOutput(props: ColorSliderOutputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"slot\", \"children\"]);\n\n const context = useContext(ColorSliderContext);\n if (!context) {\n throw new Error(\"ColorSliderOutput must be used within a ColorSlider\");\n }\n\n const state = context.state;\n\n const renderValues = createMemo<ColorSliderRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n channel: state.channel,\n orientation: state.orientation,\n value: state.getThumbValue(),\n valueLabel: state.getThumbValueLabel(),\n color: state.value,\n defaultStyle: (context.trackProps as { style?: JSX.CSSProperties }).style ?? {},\n }));\n\n const children = () =>\n typeof local.children === \"function\"\n ? local.children(renderValues())\n : (local.children ?? renderValues().valueLabel);\n\n return (\n <output {...domProps} {...context.outputProps} class={local.class}>\n {children()}\n </output>\n );\n}\n\n/**\n * The track element of a color slider.\n */\nexport function ColorSliderTrack(props: ColorSliderTrackProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(ColorSliderContext);\n if (!context) {\n throw new Error(\"ColorSliderTrack must be used within a ColorSlider\");\n }\n\n const state = context.state;\n\n const renderValues = createMemo<ColorSliderTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n orientation: state.orientation,\n defaultStyle: (context.trackProps as { style?: JSX.CSSProperties }).style ?? {},\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorSlider-track\",\n },\n renderValues,\n );\n\n const cleanTrackProps = () => {\n const {\n ref: _ref,\n style: _trackStyle,\n ...rest\n } = context.trackProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const trackStyle = (context.trackProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...trackStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n ref={context.setTrackRef}\n {...cleanTrackProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging || undefined}\n data-orientation={state.orientation}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The thumb element of a color slider.\n */\nexport function ColorSliderThumb(props: ColorSliderThumbProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\", \"ref\"]);\n\n const context = useContext(ColorSliderContext);\n if (!context) {\n throw new Error(\"ColorSliderThumb must be used within a ColorSlider\");\n }\n\n const state = context.state;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<ColorSliderThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n color: state.getDisplayColor(),\n defaultStyle: (context.thumbProps as { style?: JSX.CSSProperties }).style ?? {},\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorSlider-thumb\",\n },\n renderValues,\n );\n\n const cleanThumbProps = () => {\n const {\n ref: _ref,\n style: _thumbStyle,\n ...rest\n } = context.thumbProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const mergedInputProps = () => {\n return mergeProps(\n context.inputProps as Record<string, unknown>,\n cleanFocusProps(),\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n };\n\n const mergedStyle = () => {\n const thumbStyle = (context.thumbProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...thumbStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n {...cleanThumbProps()}\n {...cleanHoverProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n <input ref={context.setInputRef} {...mergedInputProps()} />\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nColorSlider.Track = ColorSliderTrack;\nColorSlider.Thumb = ColorSliderThumb;\nColorSlider.Label = ColorSliderLabel;\nColorSlider.Output = ColorSliderOutput;\n\nexport interface ColorAreaRenderProps {\n /** Whether the area is disabled. */\n isDisabled: boolean;\n /** Whether the area is being dragged. */\n isDragging: boolean;\n /** The X channel. */\n xChannel: ColorChannel;\n /** The Y channel. */\n yChannel: ColorChannel;\n /** The current color. */\n color: Color;\n /** The default inline styles applied by the color area hook. */\n defaultStyle: JSX.CSSProperties;\n}\n\nexport interface ColorAreaProps extends AriaColorAreaOptions, SlotProps {\n /** The current color value (controlled). */\n value?: Color | string;\n /** The default color value (uncontrolled). */\n defaultValue?: Color | string;\n /** Handler called when the color changes. */\n onChange?: (color: Color) => void;\n /** Handler called when dragging ends. */\n onChangeEnd?: (color: Color) => void;\n /** The X channel to control. */\n xChannel?: ColorChannel;\n /** The Y channel to control. */\n yChannel?: ColorChannel;\n /** The children of the component. */\n children?: RenderChildren<ColorAreaRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorAreaRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorAreaRenderProps>;\n}\n\nexport interface ColorAreaGradientRenderProps {\n /** Whether the area is disabled. */\n isDisabled: boolean;\n}\n\nexport interface ColorAreaGradientProps extends SlotProps {\n /** The children of the gradient. */\n children?: RenderChildren<ColorAreaGradientRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorAreaGradientRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorAreaGradientRenderProps>;\n}\n\nexport interface ColorAreaThumbRenderProps {\n /** Whether the area is disabled. */\n isDisabled: boolean;\n /** Whether the thumb is being dragged. */\n isDragging: boolean;\n /** The current display color. */\n color: Color;\n /** Whether the thumb is focused. */\n isFocused: boolean;\n /** Whether the thumb has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the thumb is hovered. */\n isHovered: boolean;\n}\n\nexport interface ColorAreaThumbProps extends SlotProps {\n /** The children of the thumb. */\n children?: RenderChildren<ColorAreaThumbRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorAreaThumbRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorAreaThumbRenderProps>;\n /** Ref callback for the thumb element. */\n ref?: (element: HTMLDivElement) => void;\n}\n\ninterface ColorAreaContextValue {\n state: ColorAreaState;\n colorAreaProps: JSX.HTMLAttributes<HTMLDivElement>;\n gradientProps: JSX.HTMLAttributes<HTMLDivElement>;\n thumbProps: JSX.HTMLAttributes<HTMLDivElement>;\n xInputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n yInputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n areaRef: HTMLDivElement | undefined;\n setAreaRef: (el: HTMLDivElement) => void;\n}\n\nexport const ColorAreaContext = createContext<ColorAreaContextValue | null>(null);\n\n/**\n * A color area allows users to select a color using a 2D gradient.\n */\nexport function ColorArea(props: ColorAreaProps): JSX.Element {\n const pickerContext = useContext(ColorPickerContextInternal);\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\"],\n [\"value\", \"defaultValue\", \"onChange\", \"onChangeEnd\", \"xChannel\", \"yChannel\", \"colorSpace\"],\n [\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"isDisabled\",\n \"xName\",\n \"yName\",\n \"form\",\n ],\n );\n\n // Create color area state\n const state = createColorAreaState(() => ({\n value: stateProps.value ?? pickerContext?.value,\n defaultValue: stateProps.defaultValue,\n onChange: stateProps.onChange ?? pickerContext?.onChange,\n onChangeEnd: stateProps.onChangeEnd,\n xChannel: stateProps.xChannel,\n yChannel: stateProps.yChannel,\n colorSpace: stateProps.colorSpace,\n isDisabled: ariaProps.isDisabled,\n }));\n\n // Area ref\n let areaRef: HTMLDivElement | undefined;\n const setAreaRef = (el: HTMLDivElement) => {\n areaRef = el;\n };\n\n // Create color area aria props\n const colorAreaAria = createColorArea(\n () => ({\n id: ariaProps.id,\n \"aria-label\": ariaProps[\"aria-label\"],\n \"aria-labelledby\": ariaProps[\"aria-labelledby\"],\n \"aria-describedby\": ariaProps[\"aria-describedby\"],\n \"aria-details\": ariaProps[\"aria-details\"],\n isDisabled: ariaProps.isDisabled,\n xName: ariaProps.xName,\n yName: ariaProps.yName,\n form: ariaProps.form,\n }),\n () => state,\n () => areaRef ?? null,\n );\n\n const renderValues = createMemo<ColorAreaRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n xChannel: state.xChannel,\n yChannel: state.yChannel,\n color: state.value,\n defaultStyle: (colorAreaAria.colorAreaProps as { style?: JSX.CSSProperties }).style ?? {},\n }));\n\n const childRenderValues: ColorAreaRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isDragging() {\n return state.isDragging;\n },\n get xChannel() {\n return state.xChannel;\n },\n get yChannel() {\n return state.yChannel;\n },\n get color() {\n return state.value;\n },\n get defaultStyle() {\n return (colorAreaAria.colorAreaProps as { style?: JSX.CSSProperties }).style ?? {};\n },\n };\n\n const colorAreaChildren = () => {\n const children = props.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorArea\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const cleanColorAreaProps = () => {\n const {\n ref: _ref,\n style: _areaStyle,\n ...rest\n } = colorAreaAria.colorAreaProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const areaStyle =\n (colorAreaAria.colorAreaProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...areaStyle, ...renderStyle };\n };\n\n return (\n <ColorAreaContext.Provider\n value={{\n state,\n get colorAreaProps() {\n return colorAreaAria.colorAreaProps;\n },\n get gradientProps() {\n return colorAreaAria.gradientProps;\n },\n get thumbProps() {\n return colorAreaAria.thumbProps;\n },\n get xInputProps() {\n return colorAreaAria.xInputProps;\n },\n get yInputProps() {\n return colorAreaAria.yInputProps;\n },\n areaRef,\n setAreaRef,\n }}\n >\n <div\n ref={setAreaRef}\n {...domProps()}\n {...cleanColorAreaProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n slot={local.slot ?? undefined}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging || undefined}\n >\n {colorAreaChildren()}\n </div>\n </ColorAreaContext.Provider>\n );\n}\n\n/**\n * The gradient background of a color area.\n */\nexport function ColorAreaGradient(props: ColorAreaGradientProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(ColorAreaContext);\n if (!context) {\n throw new Error(\"ColorAreaGradient must be used within a ColorArea\");\n }\n\n const { state } = context;\n\n const renderValues = createMemo<ColorAreaGradientRenderProps>(() => ({\n isDisabled: state.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorArea-gradient\",\n },\n renderValues,\n );\n\n const cleanGradientProps = () => {\n const {\n ref: _ref,\n style: _gradStyle,\n ...rest\n } = context.gradientProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const gradStyle = (context.gradientProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...gradStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n {...cleanGradientProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The thumb element of a color area.\n */\nexport function ColorAreaThumb(props: ColorAreaThumbProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\", \"ref\"]);\n\n const context = useContext(ColorAreaContext);\n if (!context) {\n throw new Error(\"ColorAreaThumb must be used within a ColorArea\");\n }\n\n const { state } = context;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n let xInputRef: HTMLInputElement | undefined;\n let yInputRef: HTMLInputElement | undefined;\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<ColorAreaThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n color: state.getDisplayColor(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorArea-thumb\",\n },\n renderValues,\n );\n\n const cleanThumbProps = () => {\n const {\n ref: _ref,\n style: _thumbStyle,\n ...rest\n } = context.thumbProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const mergedXInputProps = () => {\n const { value: _value, ...inputProps } = context.xInputProps as Record<string, unknown>;\n return mergeProps(inputProps, cleanFocusProps()) as JSX.InputHTMLAttributes<HTMLInputElement>;\n };\n const mergedYInputProps = () => {\n const { value: _value, ...inputProps } = context.yInputProps as Record<string, unknown>;\n return mergeProps(inputProps, cleanFocusProps()) as JSX.InputHTMLAttributes<HTMLInputElement>;\n };\n\n const mergedStyle = () => {\n const thumbStyle = (context.thumbProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...thumbStyle, ...renderStyle };\n };\n\n const syncInputValue = (input: HTMLInputElement | undefined, value: number) => {\n const nextValue = String(value);\n const update = () => {\n if (input && input.value !== nextValue) {\n input.value = nextValue;\n }\n };\n\n update();\n queueMicrotask(update);\n };\n\n createEffect(() => {\n syncInputValue(xInputRef, state.getXValue());\n });\n\n createEffect(() => {\n syncInputValue(yInputRef, state.getYValue());\n });\n\n return (\n <div\n {...domProps}\n ref={local.ref}\n {...cleanThumbProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n <input\n {...mergedXInputProps()}\n ref={(el) => {\n xInputRef = el;\n syncInputValue(el, state.getXValue());\n }}\n />\n <input\n {...mergedYInputProps()}\n ref={(el) => {\n yInputRef = el;\n syncInputValue(el, state.getYValue());\n }}\n />\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nColorArea.Gradient = ColorAreaGradient;\nColorArea.Thumb = ColorAreaThumb;\n\nexport interface ColorWheelRenderProps {\n /** Whether the wheel is disabled. */\n isDisabled: boolean;\n /** Whether the wheel is being dragged. */\n isDragging: boolean;\n /** The current hue value (0-360). */\n hue: number;\n /** The current color. */\n color: Color;\n /** The default inline styles applied by the color wheel hook. */\n defaultStyle: JSX.CSSProperties;\n}\n\nexport interface ColorWheelProps extends AriaColorWheelOptions, SlotProps {\n /** The current color value (controlled). */\n value?: Color | string;\n /** The default color value (uncontrolled). */\n defaultValue?: Color | string;\n /** Handler called when the color changes. */\n onChange?: (color: Color) => void;\n /** Handler called when dragging ends. */\n onChangeEnd?: (color: Color) => void;\n /** The children of the component. */\n children?: RenderChildren<ColorWheelRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorWheelRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorWheelRenderProps>;\n}\n\nexport interface ColorWheelTrackRenderProps {\n /** Whether the wheel is disabled. */\n isDisabled: boolean;\n /** Whether the wheel is being dragged. */\n isDragging: boolean;\n /** The default inline styles applied by the color wheel hook. */\n defaultStyle: JSX.CSSProperties;\n}\n\nexport interface ColorWheelTrackProps extends SlotProps {\n /** The children of the track. */\n children?: RenderChildren<ColorWheelTrackRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorWheelTrackRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorWheelTrackRenderProps>;\n}\n\nexport interface ColorWheelThumbRenderProps {\n /** Whether the wheel is disabled. */\n isDisabled: boolean;\n /** Whether the thumb is being dragged. */\n isDragging: boolean;\n /** The current display color. */\n color: Color;\n /** Whether the thumb is focused. */\n isFocused: boolean;\n /** Whether the thumb has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the thumb is hovered. */\n isHovered: boolean;\n /** The default inline styles applied by the color wheel hook. */\n defaultStyle: JSX.CSSProperties;\n}\n\nexport interface ColorWheelThumbProps extends SlotProps {\n /** The children of the thumb. */\n children?: RenderChildren<ColorWheelThumbRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorWheelThumbRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorWheelThumbRenderProps>;\n /** Ref callback for the thumb element. */\n ref?: (element: HTMLDivElement) => void;\n}\n\ninterface ColorWheelContextValue {\n state: ColorWheelState;\n trackProps: JSX.HTMLAttributes<HTMLDivElement>;\n thumbProps: JSX.HTMLAttributes<HTMLDivElement>;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n wheelRef: HTMLDivElement | undefined;\n setWheelRef: (el: HTMLDivElement) => void;\n}\n\nexport const ColorWheelContext = createContext<ColorWheelContextValue | null>(null);\n\n/**\n * A color wheel allows users to select a hue using a circular control.\n */\nexport function ColorWheel(props: ColorWheelProps): JSX.Element {\n const pickerContext = useContext(ColorPickerContextInternal);\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\"],\n [\"value\", \"defaultValue\", \"onChange\", \"onChangeEnd\"],\n [\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"aria-errormessage\",\n \"isDisabled\",\n \"name\",\n \"form\",\n \"outerRadius\",\n \"innerRadius\",\n ],\n );\n\n // Create color wheel state\n const state = createColorWheelState(() => ({\n value: stateProps.value ?? pickerContext?.value,\n defaultValue: stateProps.defaultValue,\n onChange: stateProps.onChange ?? pickerContext?.onChange,\n onChangeEnd: stateProps.onChangeEnd,\n isDisabled: ariaProps.isDisabled,\n }));\n\n let wheelRef: HTMLDivElement | undefined;\n const setWheelRef = (el: HTMLDivElement) => {\n wheelRef = el;\n };\n\n // Create color wheel aria props\n const colorWheelAria = createColorWheel(\n () => ({\n id: ariaProps.id,\n \"aria-label\": ariaProps[\"aria-label\"],\n \"aria-labelledby\": ariaProps[\"aria-labelledby\"],\n \"aria-describedby\": ariaProps[\"aria-describedby\"],\n \"aria-details\": ariaProps[\"aria-details\"],\n \"aria-errormessage\": ariaProps[\"aria-errormessage\"],\n isDisabled: ariaProps.isDisabled,\n name: ariaProps.name,\n form: ariaProps.form,\n outerRadius: ariaProps.outerRadius,\n innerRadius: ariaProps.innerRadius,\n }),\n () => state,\n () => wheelRef ?? null,\n );\n\n const renderValues = createMemo<ColorWheelRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n hue: state.getHue(),\n color: state.value,\n defaultStyle: { position: \"relative\" },\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorWheel\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n return (\n <ColorWheelContext.Provider\n value={{\n state,\n get trackProps() {\n return colorWheelAria.trackProps;\n },\n get thumbProps() {\n return colorWheelAria.thumbProps;\n },\n get inputProps() {\n return colorWheelAria.inputProps;\n },\n get wheelRef() {\n return wheelRef;\n },\n setWheelRef,\n }}\n >\n <div\n ref={setWheelRef}\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot || undefined}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </ColorWheelContext.Provider>\n );\n}\n\n/**\n * The track element of a color wheel.\n */\nexport function ColorWheelTrack(props: ColorWheelTrackProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(ColorWheelContext);\n if (!context) {\n throw new Error(\"ColorWheelTrack must be used within a ColorWheel\");\n }\n\n const state = context.state;\n\n const renderValues = createMemo<ColorWheelTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n defaultStyle: (context.trackProps as { style?: JSX.CSSProperties }).style ?? {},\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorWheel-track\",\n },\n renderValues,\n );\n\n const cleanTrackProps = () => {\n const {\n ref: _ref,\n style: _trackStyle,\n ...rest\n } = context.trackProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const trackStyle = (context.trackProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...trackStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n {...cleanTrackProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The thumb element of a color wheel.\n */\nexport function ColorWheelThumb(props: ColorWheelThumbProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\", \"ref\"]);\n\n const context = useContext(ColorWheelContext);\n if (!context) {\n throw new Error(\"ColorWheelThumb must be used within a ColorWheel\");\n }\n\n const state = context.state;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<ColorWheelThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n color: state.getDisplayColor(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n defaultStyle: (context.thumbProps as { style?: JSX.CSSProperties }).style ?? {},\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorWheel-thumb\",\n },\n renderValues,\n );\n\n const cleanThumbProps = () => {\n const {\n ref: _ref,\n style: _thumbStyle,\n ...rest\n } = context.thumbProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const mergedInputProps = () => {\n return mergeProps(\n context.inputProps as Record<string, unknown>,\n cleanFocusProps(),\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n };\n\n const mergedStyle = () => {\n const thumbStyle = (context.thumbProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...thumbStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n ref={local.ref}\n {...cleanThumbProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n <input {...mergedInputProps()} />\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nColorWheel.Track = ColorWheelTrack;\nColorWheel.Thumb = ColorWheelThumb;\n\nexport interface ColorFieldRenderProps {\n /** Whether the field is disabled. */\n isDisabled: boolean;\n /** Whether the field is read-only. */\n isReadOnly: boolean;\n /** Whether the field is required. */\n isRequired: boolean;\n /** Whether the input value is invalid. */\n isInvalid: boolean;\n /** The current color value (null if invalid). */\n color: Color | null;\n /** The color channel being edited, or \"hex\" for full color mode. */\n channel: ColorChannel | \"hex\";\n}\n\nexport interface ColorFieldProps extends AriaColorFieldOptions, SlotProps {\n /** The current color value (controlled). */\n value?: Color | string | null;\n /** The default color value (uncontrolled). */\n defaultValue?: Color | string;\n /** Handler called when the color changes. */\n onChange?: (color: Color | null) => void;\n /** The color channel to edit (for single channel mode). */\n channel?: ColorChannel;\n /** The color space to use for channel mode. */\n colorSpace?: ColorSpace;\n /** The color format for parsing/displaying. */\n colorFormat?: ColorFormat;\n /** A visible label for the field. */\n label?: JSX.Element;\n /** Description text for the field. */\n description?: JSX.Element;\n /** Error message for the field. */\n errorMessage?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<ColorFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorFieldRenderProps>;\n}\n\nexport interface ColorFieldInputRenderProps {\n /** Whether the field is disabled. */\n isDisabled: boolean;\n /** Whether the field is read-only. */\n isReadOnly: boolean;\n /** Whether the input value is invalid. */\n isInvalid: boolean;\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n}\n\nexport interface ColorFieldInputProps extends SlotProps {\n /** The children of the input (usually not used). */\n children?: RenderChildren<ColorFieldInputRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorFieldInputRenderProps>;\n /** Ref callback for the input element. */\n ref?: (element: HTMLInputElement) => void;\n}\n\ninterface ColorFieldContextValue {\n state: ColorFieldState;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n setInputRef: (el: HTMLInputElement) => void;\n setLabelElement: (isPresent: boolean) => void;\n}\n\nexport const ColorFieldContext = createContext<ColorFieldContextValue | null>(null);\n\n/**\n * A color field allows users to enter a color value as text.\n */\nexport function ColorField(props: ColorFieldProps): JSX.Element {\n const pickerContext = useContext(ColorPickerContextInternal);\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"label\", \"description\", \"errorMessage\"],\n [\"value\", \"defaultValue\", \"onChange\", \"channel\", \"colorSpace\", \"colorFormat\"],\n [\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"aria-errormessage\",\n \"name\",\n \"form\",\n \"isWheelDisabled\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"validationBehavior\",\n \"autoFocus\",\n \"excludeFromTabOrder\",\n \"placeholder\",\n ],\n );\n const [hasRegisteredLabelElement, setHasRegisteredLabelElement] = createSignal(false);\n\n // Create color field state\n const state = createColorFieldState(() => ({\n value: stateProps.value ?? pickerContext?.value,\n defaultValue: stateProps.defaultValue,\n onChange:\n stateProps.onChange ??\n ((color) => {\n if (color) {\n pickerContext?.onChange?.(color);\n }\n }),\n channel: stateProps.channel,\n colorSpace: stateProps.colorSpace,\n colorFormat: stateProps.colorFormat,\n isDisabled: ariaProps.isDisabled,\n isReadOnly: ariaProps.isReadOnly,\n isInvalid: ariaProps.isInvalid,\n isRequired: ariaProps.isRequired,\n }));\n\n // Input ref\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n // Create color field aria props\n const colorFieldAria = createColorField(\n () => ({\n id: ariaProps.id,\n \"aria-label\": ariaProps[\"aria-label\"],\n \"aria-labelledby\": ariaProps[\"aria-labelledby\"],\n \"aria-describedby\": ariaProps[\"aria-describedby\"],\n \"aria-details\": ariaProps[\"aria-details\"],\n \"aria-errormessage\": ariaProps[\"aria-errormessage\"],\n name: ariaProps.name,\n form: ariaProps.form,\n isWheelDisabled: ariaProps.isWheelDisabled,\n isDisabled: ariaProps.isDisabled,\n isReadOnly: ariaProps.isReadOnly,\n isRequired: ariaProps.isRequired,\n isInvalid: ariaProps.isInvalid,\n validationBehavior: ariaProps.validationBehavior,\n autoFocus: ariaProps.autoFocus,\n excludeFromTabOrder: ariaProps.excludeFromTabOrder,\n placeholder: ariaProps.placeholder,\n channel: stateProps.channel,\n colorSpace: stateProps.colorSpace,\n }),\n () => state,\n () => inputRef ?? null,\n );\n\n const describedBy = () => {\n const invalid = ariaProps.isInvalid || state.isInvalid;\n const ids = [\n ariaProps[\"aria-describedby\"],\n local.description && !invalid ? colorFieldAria.descriptionProps.id : undefined,\n invalid && local.errorMessage ? colorFieldAria.errorMessageProps.id : undefined,\n ];\n return ids.filter(Boolean).join(\" \") || undefined;\n };\n\n const fieldInputProps = () => {\n const labelledBy =\n ariaProps[\"aria-labelledby\"] ??\n (!ariaProps[\"aria-label\"] && (local.label || hasRegisteredLabelElement())\n ? colorFieldAria.labelProps.id\n : undefined);\n return {\n ...colorFieldAria.inputProps,\n \"aria-label\": labelledBy ? undefined : colorFieldAria.inputProps[\"aria-label\"],\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy(),\n \"aria-errormessage\":\n (ariaProps.isInvalid || state.isInvalid) && local.errorMessage\n ? colorFieldAria.errorMessageProps.id\n : colorFieldAria.inputProps[\"aria-errormessage\"],\n } as JSX.InputHTMLAttributes<HTMLInputElement>;\n };\n\n const hiddenInputValue = createMemo(() =>\n Number.isNaN(state.numberValue) ? \"\" : String(state.numberValue),\n );\n\n const renderValues = createMemo<ColorFieldRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n color: state.value,\n channel: state.channel ?? \"hex\",\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorField\",\n },\n renderValues,\n );\n\n const childRenderValues: ColorFieldRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isReadOnly() {\n return state.isReadOnly;\n },\n get isRequired() {\n return state.isRequired;\n },\n get isInvalid() {\n return state.isInvalid;\n },\n get color() {\n return state.value;\n },\n get channel() {\n return state.channel ?? \"hex\";\n },\n };\n\n let hasRenderedChildren = false;\n let renderedChildren: JSX.Element;\n const renderChildren = () => {\n if (!hasRenderedChildren) {\n const children = local.children;\n renderedChildren =\n typeof children === \"function\" ? untrack(() => children(childRenderValues)) : children;\n hasRenderedChildren = true;\n }\n return renderedChildren;\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n return (\n <ColorFieldContext.Provider\n value={{\n state,\n get inputProps() {\n return fieldInputProps();\n },\n get labelProps() {\n return colorFieldAria.labelProps;\n },\n get descriptionProps() {\n return colorFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return colorFieldAria.errorMessageProps;\n },\n setInputRef,\n setLabelElement: setHasRegisteredLabelElement,\n }}\n >\n <>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot ?? undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}\n data-channel={state.channel ?? \"hex\"}\n >\n <Show when={local.label}>\n <label {...colorFieldAria.labelProps}>{local.label}</label>\n </Show>\n\n {renderChildren()}\n </div>\n <Show when={state.channel && ariaProps.name}>\n <input\n type=\"hidden\"\n name={ariaProps.name}\n form={ariaProps.form}\n value={hiddenInputValue()}\n />\n </Show>\n </>\n </ColorFieldContext.Provider>\n );\n}\n\n/**\n * The input element of a color field.\n */\nexport function ColorFieldInput(props: ColorFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\", \"ref\"]);\n\n const context = useContext(ColorFieldContext);\n if (!context) {\n throw new Error(\"ColorFieldInput must be used within a ColorField\");\n }\n\n const state = context.state;\n const inputValue = createMemo(() => state.inputValue);\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<ColorFieldInputRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const {\n ref: _ref,\n style: _inputStyle,\n value: _value,\n ...rest\n } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <input\n {...domProps}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n ref={(el) => {\n context.setInputRef(el);\n local.ref?.(el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n value={inputValue()}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n />\n );\n}\n\nColorField.Input = ColorFieldInput;\n\nexport interface ColorSwatchRenderProps {\n /** The color being displayed. */\n color: Color;\n /** The color as a CSS string. */\n colorValue: string;\n}\n\nexport interface ColorSwatchProps extends SlotProps {\n /** The color to display. */\n color?: Color | string;\n /** Localized color name override. */\n colorName?: string;\n /** Accessible label for the swatch. */\n \"aria-label\"?: string;\n /** ID of element that labels the swatch. */\n \"aria-labelledby\"?: string;\n /** ID of element that describes the swatch. */\n \"aria-describedby\"?: string;\n /** ID of element that provides detailed information about the swatch. */\n \"aria-details\"?: string;\n /** The children of the component. */\n children?: RenderChildren<ColorSwatchRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorSwatchRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorSwatchRenderProps>;\n}\n\n/**\n * A color swatch displays a preview of a color.\n */\nexport function ColorSwatch(props: ColorSwatchProps): JSX.Element {\n const swatchContext = useContext(ColorSwatchContextInternal);\n const pickerContext = useContext(ColorPickerContextInternal);\n const [local, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"color\", \"colorName\"],\n [\"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"aria-details\"],\n );\n\n const resolvedColor = createMemo<Color | string>(() => {\n return local.color ?? swatchContext?.color ?? pickerContext?.value ?? \"#fff0\";\n });\n\n const swatchAria = createColorSwatch(() => ({\n id: (rest as Record<string, unknown>).id as string | undefined,\n slot: local.slot,\n color: resolvedColor(),\n colorName: local.colorName,\n \"aria-label\": ariaProps[\"aria-label\"],\n \"aria-labelledby\": ariaProps[\"aria-labelledby\"],\n \"aria-describedby\": ariaProps[\"aria-describedby\"],\n \"aria-details\": ariaProps[\"aria-details\"],\n }));\n\n const renderValues = createMemo<ColorSwatchRenderProps>(() => ({\n color: swatchAria.color,\n colorValue: swatchAria.color.toString(\"css\"),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorSwatch\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const cleanSwatchProps = () => {\n const {\n ref: _ref,\n style: _swatchStyle,\n ...rest\n } = swatchAria.swatchProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const swatchStyle = (swatchAria.swatchProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...swatchStyle, ...renderStyle };\n };\n\n return (\n <div {...domProps()} {...cleanSwatchProps()} class={renderProps.class()} style={mergedStyle()}>\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nexport const ColorSliderStateContext = ColorSliderContext;\nexport const ColorAreaStateContext = ColorAreaContext;\nexport const ColorWheelStateContext = ColorWheelContext;\nexport const ColorWheelTrackContext = ColorWheelContext;\nexport const ColorFieldStateContext = ColorFieldContext;\nexport const ColorSwatchContext = ColorSwatchContextInternal;\nexport const ColorPickerContext = ColorPickerContextInternal;\nexport const ColorPickerStateContext = ColorPickerStateContextInternal;\nexport const ColorSwatchPickerContext = ColorSwatchPickerContextInternal;\nexport const ColorThumb = ColorSliderThumb;\n\nexport interface ColorPickerRenderProps {\n /** The currently selected color. */\n color: Color;\n}\n\nexport interface ColorPickerProps extends SlotProps {\n /** The current color value (controlled). */\n value?: Color | string;\n /** The default color value (uncontrolled). */\n defaultValue?: Color | string;\n /** Handler called when the color changes. */\n onChange?: (color: Color) => void;\n /** The children of the color picker. */\n children?: RenderChildren<ColorPickerRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorPickerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorPickerRenderProps>;\n}\n\nexport interface ColorSwatchPickerRenderProps {\n /** Whether the swatch picker has focus. */\n isFocused: boolean;\n /** Whether the swatch picker has keyboard focus. */\n isFocusVisible: boolean;\n /** The currently selected color. */\n selectedColor: Color;\n /** Item arrangement mode. */\n layout: \"grid\" | \"stack\";\n}\n\nexport interface ColorSwatchPickerProps extends SlotProps {\n /** The element's unique identifier. */\n id?: string;\n /** The current color value (controlled). */\n value?: Color | string;\n /** The default color value (uncontrolled). */\n defaultValue?: Color | string;\n /** Handler called when the selected color changes. */\n onChange?: (color: Color) => void;\n /** Accessible label for the swatch picker. */\n \"aria-label\"?: string;\n /** ID of element that labels the swatch picker. */\n \"aria-labelledby\"?: string;\n /** ID of element that describes the swatch picker. */\n \"aria-describedby\"?: string;\n /** ID of element that provides detailed information about the swatch picker. */\n \"aria-details\"?: string;\n /** Whether swatches are arranged as a grid or stack. */\n layout?: \"grid\" | \"stack\";\n /** The children (ColorSwatchPickerItem elements). */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorSwatchPickerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorSwatchPickerRenderProps>;\n}\n\nexport interface ColorSwatchPickerItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** The color represented by the item. */\n color: Color;\n}\n\nexport interface ColorSwatchPickerItemProps extends SlotProps {\n /** The color represented by this swatch item. */\n color: Color | string;\n /** Whether this item is disabled. */\n isDisabled?: boolean;\n /** Accessible label for this item. */\n \"aria-label\"?: string;\n /** The children of the swatch item. */\n children?: RenderChildren<ColorSwatchPickerItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ColorSwatchPickerItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ColorSwatchPickerItemRenderProps>;\n}\n\nexport function ColorPicker(props: ColorPickerProps): JSX.Element {\n const [local] = splitProps(props, [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n ]);\n\n const [internalColor, setInternalColor] = createSignal<Color>(\n normalizeColor(local.defaultValue ?? \"#ff0000\"),\n );\n\n const color = createMemo<Color>(() => {\n if (local.value !== undefined) {\n return normalizeColor(local.value);\n }\n return internalColor();\n });\n\n const setColor = (nextColor: Color) => {\n if (local.value === undefined) {\n setInternalColor(nextColor);\n }\n local.onChange?.(nextColor);\n };\n\n const renderValues = createMemo<ColorPickerRenderProps>(() => ({\n color: color(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorPicker\",\n },\n renderValues,\n );\n\n return (\n <ColorPickerStateContextInternal.Provider\n value={{\n color: () => color(),\n setColor,\n }}\n >\n <ColorPickerContextInternal.Provider\n value={{\n get value() {\n return color();\n },\n onChange: setColor,\n }}\n >\n <div class={renderProps.class()} style={renderProps.style()}>\n {renderProps.renderChildren()}\n </div>\n </ColorPickerContextInternal.Provider>\n </ColorPickerStateContextInternal.Provider>\n );\n}\n\nexport function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {\n const pickerContext = useContext(ColorPickerContextInternal);\n const [local, rest] = splitProps(props, [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"layout\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n ]);\n\n const [itemMap, setItemMap] = createSignal<Map<string, ColorSwatchPickerItemData>>(new Map());\n const [itemOrder, setItemOrder] = createSignal<string[]>([]);\n const [internalColor, setInternalColor] = createSignal<Color>(\n normalizeColor(local.defaultValue ?? pickerContext?.value ?? \"#ff0000\"),\n );\n\n const selectedColor = createMemo<Color>(() => {\n if (local.value !== undefined) {\n return normalizeColor(local.value);\n }\n if (pickerContext?.value !== undefined) {\n return normalizeColor(pickerContext.value);\n }\n return internalColor();\n });\n\n const selectedKey = createMemo(() => selectedColor().toString(\"hexa\"));\n const isControlled = createMemo(\n () => local.value !== undefined || pickerContext?.value !== undefined,\n );\n\n const registerItem = (item: ColorSwatchPickerItemData) => {\n setItemMap((prev) => {\n const next = new Map(prev);\n next.set(item.key, item);\n return next;\n });\n setItemOrder((prev) => (prev.includes(item.key) ? prev : [...prev, item.key]));\n };\n\n const unregisterItem = (key: string) => {\n setItemMap((prev) => {\n if (!prev.has(key)) return prev;\n const next = new Map(prev);\n next.delete(key);\n return next;\n });\n setItemOrder((prev) => prev.filter((itemKey) => itemKey !== key));\n };\n\n const items = createMemo(() => {\n const map = itemMap();\n return itemOrder()\n .map((key) => map.get(key))\n .filter((item): item is ColorSwatchPickerItemData => item != null);\n });\n\n const state = createListState<ColorSwatchPickerItemData>({\n get items() {\n return items();\n },\n get getKey() {\n return (item: ColorSwatchPickerItemData) => item.key;\n },\n get getTextValue() {\n return (item: ColorSwatchPickerItemData) => item.textValue;\n },\n get getDisabled() {\n return (item: ColorSwatchPickerItemData) => !!item.isDisabled;\n },\n selectionMode: \"single\",\n disallowEmptySelection: true,\n get selectedKeys() {\n return [selectedKey()];\n },\n onSelectionChange(keys) {\n if (keys === \"all\") return;\n const key = keys.values().next().value as string | undefined;\n if (!key) return;\n const item = itemMap().get(key);\n if (!item) return;\n if (!isControlled()) {\n setInternalColor(item.color);\n }\n (local.onChange ?? pickerContext?.onChange)?.(item.color);\n },\n });\n\n const listBoxAria = createListBox(\n () => ({\n id: local.id,\n \"aria-label\":\n local[\"aria-label\"] ?? (!local[\"aria-labelledby\"] ? \"Color swatch picker\" : undefined),\n \"aria-labelledby\": local[\"aria-labelledby\"],\n \"aria-describedby\": local[\"aria-describedby\"],\n \"aria-details\": local[\"aria-details\"],\n shouldFocusWrap: true,\n }),\n state,\n );\n\n const resolveDirection = (): \"ltr\" | \"rtl\" => {\n if (typeof document === \"undefined\") return \"ltr\";\n const rootDir = document.dir;\n return rootDir === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n\n const findNextEnabledKey = (from: Key | null, direction: \"next\" | \"prev\") => {\n const collection = state.collection();\n const getAdjacent =\n direction === \"next\"\n ? (key: Key) => collection.getKeyAfter(key)\n : (key: Key) => collection.getKeyBefore(key);\n const getBoundary =\n direction === \"next\" ? () => collection.getFirstKey() : () => collection.getLastKey();\n\n let key = from != null ? getAdjacent(from) : getBoundary();\n while (key != null && state.isDisabled(key)) {\n key = getAdjacent(key);\n }\n\n return key;\n };\n\n const getBoundaryEnabledKey = (direction: \"next\" | \"prev\") => {\n const collection = state.collection();\n const getAdjacent =\n direction === \"next\"\n ? (key: Key) => collection.getKeyAfter(key)\n : (key: Key) => collection.getKeyBefore(key);\n const getBoundary =\n direction === \"next\" ? () => collection.getFirstKey() : () => collection.getLastKey();\n\n let key = getBoundary();\n while (key != null && state.isDisabled(key)) {\n key = getAdjacent(key);\n }\n\n return key;\n };\n\n const getOptionElementForKey = (\n listbox: HTMLElement | null,\n key: Key | null,\n ): HTMLElement | null => {\n if (!listbox || key == null) return null;\n const keyString = String(key);\n for (const optionElement of listbox.querySelectorAll<HTMLElement>('[role=\"option\"]')) {\n if (optionElement.id === keyString) {\n return optionElement;\n }\n }\n return null;\n };\n\n const findGridKey = (\n listbox: HTMLElement | null,\n key: Key,\n nextKey: (current: Key) => Key | null,\n shouldSkip: (prevRect: DOMRect, itemRect: DOMRect) => boolean,\n ): Key | null => {\n let candidate: Key | null = key;\n const previousRect = getOptionElementForKey(listbox, candidate)?.getBoundingClientRect();\n if (!previousRect) {\n return null;\n }\n\n while (candidate != null) {\n candidate = nextKey(candidate);\n if (candidate == null) {\n return null;\n }\n\n const itemRect = getOptionElementForKey(listbox, candidate)?.getBoundingClientRect();\n if (!itemRect) {\n return null;\n }\n\n if (!shouldSkip(previousRect, itemRect)) {\n return candidate;\n }\n }\n\n return null;\n };\n\n const isSameRow = (prevRect: DOMRect, itemRect: DOMRect) =>\n prevRect.y === itemRect.y || prevRect.x !== itemRect.x;\n const getGridKeyBelow = (listbox: HTMLElement | null, key: Key) =>\n findGridKey(listbox, key, (current) => findNextEnabledKey(current, \"next\"), isSameRow);\n const getGridKeyAbove = (listbox: HTMLElement | null, key: Key) =>\n findGridKey(listbox, key, (current) => findNextEnabledKey(current, \"prev\"), isSameRow);\n const getGridKeyRightOf = (key: Key) =>\n resolveDirection() === \"rtl\"\n ? findNextEnabledKey(key, \"prev\")\n : findNextEnabledKey(key, \"next\");\n const getGridKeyLeftOf = (key: Key) =>\n resolveDirection() === \"rtl\"\n ? findNextEnabledKey(key, \"next\")\n : findNextEnabledKey(key, \"prev\");\n\n const handleGridKeyDown = (e: KeyboardEvent): boolean => {\n if ((local.layout ?? \"grid\") !== \"grid\") return false;\n if (\n e.key !== \"ArrowRight\" &&\n e.key !== \"ArrowLeft\" &&\n e.key !== \"ArrowDown\" &&\n e.key !== \"ArrowUp\"\n ) {\n return false;\n }\n\n const listbox = e.currentTarget as HTMLElement | null;\n const focusedKey = state.focusedKey();\n const initialKey =\n focusedKey ??\n (e.key === \"ArrowUp\" || e.key === \"ArrowLeft\"\n ? getBoundaryEnabledKey(\"prev\")\n : getBoundaryEnabledKey(\"next\"));\n if (initialKey == null) return false;\n\n let nextKey: Key | null = null;\n switch (e.key) {\n case \"ArrowDown\":\n nextKey = getGridKeyBelow(listbox, initialKey) ?? getBoundaryEnabledKey(\"next\");\n break;\n case \"ArrowUp\":\n nextKey = getGridKeyAbove(listbox, initialKey) ?? getBoundaryEnabledKey(\"prev\");\n break;\n case \"ArrowRight\":\n nextKey =\n getGridKeyRightOf(initialKey) ??\n (resolveDirection() === \"rtl\"\n ? getBoundaryEnabledKey(\"prev\")\n : getBoundaryEnabledKey(\"next\"));\n break;\n case \"ArrowLeft\":\n nextKey =\n getGridKeyLeftOf(initialKey) ??\n (resolveDirection() === \"rtl\"\n ? getBoundaryEnabledKey(\"next\")\n : getBoundaryEnabledKey(\"prev\"));\n break;\n }\n\n if (nextKey == null) return false;\n\n state.setFocusedKey(nextKey);\n if (state.selectionMode() === \"single\") {\n state.replaceSelection(nextKey);\n }\n\n e.preventDefault();\n e.stopPropagation();\n return true;\n };\n\n const getListBoxKeyDown = () => {\n const props = listBoxAria.listBoxProps as Record<string, unknown>;\n return props.onKeyDown as JSX.EventHandler<HTMLDivElement, KeyboardEvent> | undefined;\n };\n\n const onColorSwatchPickerKeyDown: JSX.EventHandler<HTMLDivElement, KeyboardEvent> = (e) => {\n if (handleGridKeyDown(e)) {\n return;\n }\n getListBoxKeyDown()?.(e);\n };\n\n createEffect(() => {\n const key = selectedKey();\n if (key) {\n state.setFocusedKey(key);\n }\n });\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing({ within: true });\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n const renderValues = createMemo<ColorSwatchPickerRenderProps>(() => ({\n isFocused: state.isFocused() || isFocused(),\n isFocusVisible: isFocusVisible(),\n selectedColor: selectedColor(),\n layout: local.layout ?? \"grid\",\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorSwatchPicker\",\n },\n renderValues,\n );\n\n const cleanListBoxProps = () => {\n const {\n ref: _ref,\n onKeyDown: _onKeyDown,\n ...restListBoxProps\n } = listBoxAria.listBoxProps as Record<string, unknown>;\n return restListBoxProps;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...restFocusProps } = focusProps as Record<string, unknown>;\n return restFocusProps;\n };\n\n return (\n <ColorSwatchPickerContextInternal.Provider\n value={{\n state,\n registerItem,\n unregisterItem,\n }}\n >\n <div\n {...mergeProps(domProps(), cleanListBoxProps(), cleanFocusProps(), {\n onKeyDown: onColorSwatchPickerKeyDown,\n })}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot ?? undefined}\n data-focused={state.isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-layout={local.layout ?? \"grid\"}\n >\n {local.children}\n </div>\n </ColorSwatchPickerContextInternal.Provider>\n );\n}\n\nexport function ColorSwatchPickerItem(props: ColorSwatchPickerItemProps): JSX.Element {\n const context = useContext(ColorSwatchPickerContextInternal);\n if (!context) {\n throw new Error(\"ColorSwatchPickerItem must be used within a ColorSwatchPicker\");\n }\n\n const [local, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"color\"],\n [\"isDisabled\", \"aria-label\"],\n );\n\n const color = createMemo(() => normalizeColor(local.color));\n const key = createMemo(() => color().toString(\"hexa\"));\n const textValue = createMemo(() => {\n const locale = globalThis.navigator?.language ?? \"en-US\";\n return color().getColorName(locale);\n });\n\n createEffect(() => {\n const itemKey = key();\n context.registerItem({\n key: itemKey,\n color: color(),\n textValue: textValue(),\n isDisabled: ariaProps.isDisabled,\n });\n onCleanup(() => context.unregisterItem(itemKey));\n });\n\n const optionAria = createOption(\n () => ({\n key: key(),\n isDisabled: ariaProps.isDisabled,\n \"aria-label\": ariaProps[\"aria-label\"] ?? textValue(),\n }),\n context.state,\n );\n\n const renderValues = createMemo<ColorSwatchPickerItemRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: optionAria.isFocusVisible(),\n isPressed: optionAria.isPressed(),\n isDisabled: optionAria.isDisabled(),\n color: color(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ColorSwatchPickerItem\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n const cleanOptionProps = () => {\n const { ref: _ref, ...restOptionProps } = optionAria.optionProps as Record<string, unknown>;\n return restOptionProps;\n };\n\n return (\n <div\n {...mergeProps(domProps(), cleanOptionProps())}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <ColorSwatchContextInternal.Provider value={{ color: color() }}>\n {renderProps.children ? renderProps.renderChildren() : <ColorSwatch />}\n </ColorSwatchContextInternal.Provider>\n </div>\n );\n}\n","/**\n * ContextualHelpTrigger headless component\n *\n * A button trigger that opens contextual help in a popover or dialog.\n * Uses existing overlay infrastructure.\n */\n\nimport {\n type JSX,\n createSignal,\n splitProps,\n Show,\n onCleanup,\n createEffect,\n createUniqueId,\n} from \"solid-js\";\n\nexport interface ContextualHelpTriggerProps extends Omit<\n JSX.ButtonHTMLAttributes<HTMLButtonElement>,\n \"class\" | \"children\"\n> {\n /** Whether the trigger is currently unavailable (shows different styling). */\n isUnavailable?: boolean;\n /**\n * Two children: [trigger element, help content].\n * The trigger renders as a button, the content opens in a popover.\n */\n children?: [JSX.Element, JSX.Element];\n /** CSS class name. */\n class?: string;\n /** Whether the trigger is disabled. */\n isDisabled?: boolean;\n}\n\nexport interface ContextualHelpTriggerRenderProps {\n isOpen: boolean;\n isUnavailable: boolean;\n isDisabled: boolean;\n}\n\n/**\n * A trigger that opens contextual help content.\n *\n * @example\n * ```tsx\n * <ContextualHelpTrigger>\n * {[\n * <span>What is this?</span>,\n * <div>Help content goes here...</div>\n * ]}\n * </ContextualHelpTrigger>\n * ```\n */\nexport function ContextualHelpTrigger(props: ContextualHelpTriggerProps): JSX.Element {\n const [local, triggerProps] = splitProps(props, [\n \"isUnavailable\",\n \"children\",\n \"class\",\n \"isDisabled\",\n ]);\n const [isOpen, setIsOpen] = createSignal(false);\n const triggerId = createUniqueId();\n const contentId = createUniqueId();\n let triggerRef: HTMLButtonElement | undefined;\n let contentRef: HTMLDivElement | undefined;\n\n const isUnavailable = () => local.isUnavailable ?? false;\n const isDisabled = () => local.isDisabled ?? false;\n\n const toggle = () => {\n if (!isDisabled()) {\n setIsOpen(!isOpen());\n }\n };\n\n const close = () => setIsOpen(false);\n\n const callHandler = <E extends Event>(\n handler: JSX.EventHandlerUnion<HTMLButtonElement, E> | undefined,\n event: E,\n ) => {\n if (!handler) return;\n if (Array.isArray(handler)) {\n handler[1].call(handler[0], event);\n return;\n }\n if (typeof handler === \"function\") {\n (handler as (evt: E) => void)(event);\n return;\n }\n if (\n typeof handler === \"object\" &&\n \"handleEvent\" in handler &&\n typeof handler.handleEvent === \"function\"\n ) {\n (handler.handleEvent as (evt: E) => void)(event);\n }\n };\n\n const handleTriggerClick = (e: MouseEvent) => {\n callHandler(triggerProps.onClick, e);\n if (e.defaultPrevented) return;\n toggle();\n };\n\n const handleTriggerKeyDown = (e: KeyboardEvent) => {\n callHandler(triggerProps.onKeyDown, e);\n if (e.defaultPrevented) return;\n if (e.key === \"Escape\" && isOpen()) {\n e.preventDefault();\n e.stopPropagation();\n close();\n triggerRef?.focus();\n }\n };\n\n // Close on outside click\n const handleDocumentClick = (e: MouseEvent) => {\n if (\n isOpen() &&\n triggerRef &&\n contentRef &&\n !triggerRef.contains(e.target as Node) &&\n !contentRef.contains(e.target as Node)\n ) {\n close();\n }\n };\n\n createEffect(() => {\n if (!isOpen()) return;\n document.addEventListener(\"mousedown\", handleDocumentClick);\n onCleanup(() => {\n document.removeEventListener(\"mousedown\", handleDocumentClick);\n });\n });\n\n // Focus trap: return focus to trigger on close\n createEffect(() => {\n if (!isOpen()) return;\n // Focus the content on open\n contentRef?.focus();\n });\n\n const children = () => local.children ?? ([null, null] as [JSX.Element, JSX.Element]);\n const trigger = () => children()[0];\n const content = () => children()[1];\n\n return (\n <div\n class={`solidaria-ContextualHelpTrigger ${local.class ?? \"\"}`}\n style={{ position: \"relative\", display: \"inline-block\" }}\n >\n <button\n {...triggerProps}\n type=\"button\"\n id={triggerId}\n ref={triggerRef}\n aria-haspopup=\"dialog\"\n aria-expanded={isOpen()}\n aria-controls={isOpen() ? contentId : undefined}\n data-unavailable={isUnavailable() || undefined}\n data-disabled={isDisabled() || undefined}\n disabled={isDisabled()}\n onClick={handleTriggerClick}\n onKeyDown={handleTriggerKeyDown}\n class=\"solidaria-ContextualHelpTrigger-trigger\"\n >\n {trigger()}\n </button>\n\n <Show when={isOpen()}>\n <div\n id={contentId}\n ref={contentRef}\n role=\"dialog\"\n aria-labelledby={triggerId}\n tabIndex={-1}\n class=\"solidaria-ContextualHelpTrigger-content\"\n style={{ position: \"absolute\", \"z-index\": \"50\" }}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n close();\n triggerRef?.focus();\n }\n }}\n >\n {content()}\n </div>\n </Show>\n </div>\n );\n}\n","/**\n * ColorEditor headless component\n *\n * A composite component that combines ColorArea, ColorSlider, and ColorField\n * into a complete color editing UI. Pure composition — no new ARIA hooks needed.\n */\n\nimport { type JSX, createSignal, For, Show, splitProps, createMemo } from \"solid-js\";\nimport {\n ColorPicker,\n ColorArea,\n ColorAreaGradient,\n ColorAreaThumb,\n ColorSlider,\n ColorSliderTrack,\n ColorSliderThumb,\n ColorField,\n ColorFieldInput,\n} from \"./Color\";\nimport { getColorChannels } from \"@proyecto-viviana/solid-stately\";\nimport type { Color, ColorChannel, ColorSpace } from \"@proyecto-viviana/solid-stately\";\n\nexport type ColorEditorColorSpace = \"rgb\" | \"hsl\" | \"hsb\";\n\nexport interface ColorEditorRenderProps {\n colorSpace: ColorEditorColorSpace | \"hex\";\n}\n\nexport interface ColorEditorProps {\n /** The current color value (controlled). */\n value?: Color | string;\n /** The default color value (uncontrolled). */\n defaultValue?: Color | string;\n /** Handler called when the color changes. */\n onChange?: (color: Color) => void;\n /** Whether to hide the alpha channel. */\n hideAlphaChannel?: boolean;\n /** The initial color space. @default 'hex' */\n colorSpace?: ColorEditorColorSpace | \"hex\";\n /** Handler called when the color space changes. */\n onColorSpaceChange?: (colorSpace: ColorEditorColorSpace | \"hex\") => void;\n /** The CSS class name. */\n class?: string | ((renderProps: ColorEditorRenderProps) => string);\n /** The inline style. */\n style?: JSX.CSSProperties;\n /** Children override. If provided, replaces the default layout. */\n children?: JSX.Element;\n /** Whether the editor is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * ColorEditor provides a default UI for editing colors.\n *\n * Composes: ColorArea + ColorSlider (hue) + optional ColorSlider (alpha) +\n * color space selector + channel ColorFields.\n */\nexport function ColorEditor(props: ColorEditorProps): JSX.Element {\n const [local] = splitProps(props, [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"hideAlphaChannel\",\n \"colorSpace\",\n \"onColorSpaceChange\",\n \"class\",\n \"style\",\n \"children\",\n \"isDisabled\",\n ]);\n\n const [activeSpace, setActiveSpace] = createSignal<ColorEditorColorSpace | \"hex\">(\n local.colorSpace ?? \"hex\",\n );\n\n const handleSpaceChange = (space: ColorEditorColorSpace | \"hex\") => {\n setActiveSpace(space);\n local.onColorSpaceChange?.(space);\n };\n\n const channels = createMemo<ColorChannel[]>(() => {\n const space = activeSpace();\n if (space === \"hex\") return [];\n return getColorChannels(space as ColorSpace);\n });\n\n const resolvedClass = () => {\n if (typeof local.class === \"function\") {\n return local.class({ colorSpace: activeSpace() });\n }\n return local.class ?? \"\";\n };\n\n if (local.children) {\n return (\n <div class={resolvedClass()} style={local.style}>\n <ColorPicker\n value={local.value}\n defaultValue={local.defaultValue}\n onChange={local.onChange}\n >\n {() => local.children}\n </ColorPicker>\n </div>\n );\n }\n\n const areaChannels = createMemo(() => {\n const space = activeSpace();\n if (space === \"hsb\" || space === \"hex\") {\n return {\n x: \"saturation\" as ColorChannel,\n y: \"brightness\" as ColorChannel,\n colorSpace: \"hsb\" as ColorSpace,\n };\n }\n if (space === \"hsl\") {\n return {\n x: \"saturation\" as ColorChannel,\n y: \"lightness\" as ColorChannel,\n colorSpace: \"hsl\" as ColorSpace,\n };\n }\n return {\n x: \"green\" as ColorChannel,\n y: \"blue\" as ColorChannel,\n colorSpace: \"rgb\" as ColorSpace,\n };\n });\n\n return (\n <div\n class={`solidaria-ColorEditor ${resolvedClass()}`}\n style={local.style}\n data-color-space={activeSpace()}\n >\n <ColorPicker value={local.value} defaultValue={local.defaultValue} onChange={local.onChange}>\n {() => (\n <>\n <div class=\"solidaria-ColorEditor-top\">\n <ColorArea\n xChannel={areaChannels().x}\n yChannel={areaChannels().y}\n isDisabled={local.isDisabled}\n >\n {() => (\n <>\n <ColorAreaGradient />\n <ColorAreaThumb />\n </>\n )}\n </ColorArea>\n\n <ColorSlider channel=\"hue\" isDisabled={local.isDisabled} aria-label=\"Hue\">\n {() => <ColorSliderTrack>{() => <ColorSliderThumb />}</ColorSliderTrack>}\n </ColorSlider>\n\n <Show when={!local.hideAlphaChannel}>\n <ColorSlider channel=\"alpha\" isDisabled={local.isDisabled} aria-label=\"Alpha\">\n {() => <ColorSliderTrack>{() => <ColorSliderThumb />}</ColorSliderTrack>}\n </ColorSlider>\n </Show>\n </div>\n\n <div class=\"solidaria-ColorEditor-bottom\">\n <select\n value={activeSpace()}\n onChange={(e) =>\n handleSpaceChange(e.currentTarget.value as ColorEditorColorSpace | \"hex\")\n }\n disabled={local.isDisabled}\n aria-label=\"Color format\"\n class=\"solidaria-ColorEditor-format\"\n >\n <option value=\"hex\">Hex</option>\n <option value=\"rgb\">RGB</option>\n <option value=\"hsl\">HSL</option>\n <option value=\"hsb\">HSB</option>\n </select>\n\n <Show\n when={activeSpace() !== \"hex\"}\n fallback={\n <ColorField isDisabled={local.isDisabled} aria-label=\"Hex color\">\n {() => <ColorFieldInput />}\n </ColorField>\n }\n >\n <For each={channels()}>\n {(channel) => (\n <ColorField\n channel={channel}\n isDisabled={local.isDisabled}\n aria-label={channel}\n >\n {() => <ColorFieldInput />}\n </ColorField>\n )}\n </For>\n </Show>\n\n <Show when={!local.hideAlphaChannel && activeSpace() !== \"hex\"}>\n <ColorField channel=\"alpha\" isDisabled={local.isDisabled} aria-label=\"Alpha\">\n {() => <ColorFieldInput />}\n </ColorField>\n </Show>\n </div>\n </>\n )}\n </ColorPicker>\n </div>\n );\n}\n","/**\n * StepList component for solidaria-components\n *\n * A pre-wired headless step list component that combines state + aria hooks.\n * Renders an ordered list of steps with completion tracking.\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext, For } from \"solid-js\";\nimport {\n createStepListState,\n type StepListState,\n type StepListStateProps,\n type Key,\n} from \"@proyecto-viviana/solid-stately\";\nimport { createStepList, type AriaStepListProps } from \"@proyecto-viviana/solidaria\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface StepListItemRenderProps {\n /** Whether this step is currently selected. */\n isSelected: boolean;\n /** Whether this step is completed. */\n isCompleted: boolean;\n /** Whether this step is disabled. */\n isDisabled: boolean;\n /** Whether this step can be selected. */\n isSelectable: boolean;\n /** The 1-based step number. */\n stepNumber: number;\n /** Accessible text describing the step state. */\n stepStateText: string;\n}\n\nexport interface StepListRenderProps {\n /** Whether the step list is disabled. */\n isDisabled: boolean;\n}\n\nexport interface StepListProps<T extends { key: Key; label: string }> extends AriaStepListProps {\n /** The step items. */\n items: T[];\n /** The currently selected step key (controlled). */\n selectedKey?: Key;\n /** The default selected step key (uncontrolled). */\n defaultSelectedKey?: Key;\n /** Called when the selected step changes. */\n onSelectionChange?: (key: Key) => void;\n /** The last completed step key (controlled). */\n lastCompletedStep?: Key;\n /** The default last completed step key (uncontrolled). */\n defaultLastCompletedStep?: Key;\n /** Called when last completed step changes. */\n onLastCompletedStepChange?: (key: Key | null) => void;\n /** Whether all steps are disabled. */\n isDisabled?: boolean;\n /** Whether all steps are read-only. */\n isReadOnly?: boolean;\n /** Keys of individually disabled steps. */\n disabledKeys?: Iterable<Key>;\n /** Render function for each step item. */\n children: (item: T, state: StepListItemRenderProps) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<StepListRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<StepListRenderProps>;\n}\n\nexport interface StepProps {\n /** The step item. */\n item: { key: Key; label: string };\n /** The 1-based step number. */\n stepNumber: number;\n /** The children to render inside the step. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\nexport const StepListStateContext = createContext<StepListState | null>(null);\nexport const StepListContext = createContext<{} | null>(null);\n\nexport function useStepListState(): StepListState {\n const ctx = useContext(StepListStateContext);\n if (!ctx) throw new Error(\"useStepListState must be used within a StepList\");\n return ctx;\n}\n\n/**\n * StepList displays a sequence of steps with completion tracking and selection.\n */\nexport function StepList<T extends { key: Key; label: string }>(\n props: StepListProps<T>,\n): JSX.Element {\n const [local, ariaProps, domRest] = splitProps(\n props,\n [\n \"items\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"onSelectionChange\",\n \"lastCompletedStep\",\n \"defaultLastCompletedStep\",\n \"onLastCompletedStepChange\",\n \"isDisabled\",\n \"isReadOnly\",\n \"disabledKeys\",\n \"children\",\n \"class\",\n \"style\",\n ],\n [\"aria-label\", \"aria-labelledby\"],\n );\n\n const stateProps = createMemo<StepListStateProps>(() => ({\n items: local.items,\n selectedKey: local.selectedKey,\n defaultSelectedKey: local.defaultSelectedKey,\n onSelectionChange: local.onSelectionChange,\n lastCompletedStep: local.lastCompletedStep,\n defaultLastCompletedStep: local.defaultLastCompletedStep,\n onLastCompletedStepChange: local.onLastCompletedStepChange,\n isDisabled: local.isDisabled,\n isReadOnly: local.isReadOnly,\n disabledKeys: local.disabledKeys,\n }));\n\n const state = createStepListState(stateProps());\n\n // Create ARIA props\n const { stepListProps } = createStepList(\n {\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n },\n state,\n );\n\n const renderValues = createMemo<StepListRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-StepList\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(domRest as Record<string, unknown>, { global: true }),\n );\n\n return (\n <StepListStateContext.Provider value={state}>\n <ol\n {...stepListProps}\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={state.isDisabled() || undefined}\n >\n <For each={local.items}>\n {(item, index) => {\n const stepNumber = () => index() + 1;\n\n // Build render props as a static snapshot for the initial render.\n const renderProps: StepListItemRenderProps = {\n get isSelected() {\n return state.selectedKey() === item.key;\n },\n get isCompleted() {\n return state.isCompleted(item.key);\n },\n get isDisabled() {\n return state.isDisabled() || !state.isSelectable(item.key);\n },\n get isSelectable() {\n return state.isSelectable(item.key);\n },\n get stepNumber() {\n return stepNumber();\n },\n get stepStateText() {\n if (state.selectedKey() === item.key) return \"Current\";\n if (state.isCompleted(item.key)) return \"Completed\";\n return \"Not completed\";\n },\n };\n\n return local.children(item, renderProps);\n }}\n </For>\n </ol>\n </StepListStateContext.Provider>\n );\n}\n\n/**\n * Step represents an individual step within a StepList.\n * Renders as an `<li>` wrapping an `<a>` with accessible step props.\n */\nexport function Step(props: StepProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"item\", \"stepNumber\", \"children\", \"class\", \"style\"]);\n\n const state = useStepListState();\n\n const isSelected = () => state.selectedKey() === local.item.key;\n const isCompleted = () => state.isCompleted(local.item.key);\n const selectable = () => state.isSelectable(local.item.key);\n\n const handleClick = (e: MouseEvent) => {\n e.preventDefault();\n if (selectable()) {\n state.setSelectedKey(local.item.key);\n }\n };\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"ArrowUp\" || e.key === \"ArrowDown\") {\n e.preventDefault();\n return;\n }\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n if (selectable()) {\n state.setSelectedKey(local.item.key);\n }\n }\n };\n\n const stepStateText = () => {\n if (isSelected()) return \"Current\";\n if (isCompleted()) return \"Completed\";\n return \"Not completed\";\n };\n\n return (\n <li\n {...domProps}\n class={local.class}\n style={local.style}\n data-selected={isSelected() || undefined}\n data-completed={isCompleted() || undefined}\n data-disabled={!selectable() || undefined}\n data-selectable={selectable() || undefined}\n >\n <a\n role=\"link\"\n aria-current={isSelected() ? \"step\" : undefined}\n aria-disabled={!selectable() ? true : undefined}\n tabIndex={selectable() ? 0 : undefined}\n onClick={handleClick}\n on:keydown={handleKeyDown}\n aria-label={`Step ${local.stepNumber}: ${local.item.label}, ${stepStateText()}`}\n >\n {local.children}\n </a>\n </li>\n );\n}\n","/**\n * Landmark component for solidaria-components\n *\n * Pre-wired headless landmark component that combines aria hooks.\n * Enables F6 keyboard navigation between major page sections.\n */\n\nimport { type JSX, createContext, createMemo, createSignal, splitProps } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport {\n createLandmark,\n getLandmarkController,\n type AriaLandmarkProps,\n type AriaLandmarkRole,\n type LandmarkController,\n} from \"@proyecto-viviana/solidaria\";\nimport { type SlotProps, filterDOMProps } from \"./utils\";\n\nexport interface LandmarkRenderProps {\n /** The ARIA landmark role. */\n role: AriaLandmarkRole;\n}\n\nexport interface LandmarkProps extends AriaLandmarkProps, SlotProps {\n /**\n * The HTML element type to render.\n * @default 'div' (or semantic element based on role)\n */\n elementType?: keyof JSX.IntrinsicElements;\n /** The CSS className for the element. A function may be provided to receive render props. */\n class?: string | ((renderProps: LandmarkRenderProps) => string);\n /** The inline style for the element. A function may be provided to receive render props. */\n style?: JSX.CSSProperties | ((renderProps: LandmarkRenderProps) => JSX.CSSProperties);\n /** Children content. */\n children?: JSX.Element;\n}\n\nexport type { AriaLandmarkRole, LandmarkController };\n\nexport const LandmarkContext = createContext<LandmarkProps | null>(null);\n\n/**\n * Maps ARIA landmark roles to their semantic HTML elements.\n * Using semantic elements is preferred when possible.\n */\nconst roleToSemanticElement: Partial<Record<AriaLandmarkRole, keyof JSX.IntrinsicElements>> = {\n main: \"main\",\n navigation: \"nav\",\n search: \"search\", // HTML5.3 <search> element\n banner: \"header\",\n contentinfo: \"footer\",\n complementary: \"aside\",\n form: \"form\",\n region: \"section\",\n};\n\n/**\n * A landmark is a region of the page that helps screen reader users navigate.\n * Press F6 to cycle through landmarks, or Shift+F6 to go backwards.\n *\n * @example\n * ```tsx\n * // Main content area\n * <Landmark role=\"main\" aria-label=\"Main content\">\n * <h1>Welcome</h1>\n * <p>Page content here...</p>\n * </Landmark>\n *\n * // Navigation\n * <Landmark role=\"navigation\" aria-label=\"Primary navigation\">\n * <nav>...</nav>\n * </Landmark>\n *\n * // Search\n * <Landmark role=\"search\" aria-label=\"Site search\">\n * <form>...</form>\n * </Landmark>\n *\n * // Custom element type\n * <Landmark role=\"region\" aria-label=\"Featured content\" elementType=\"div\">\n * ...\n * </Landmark>\n * ```\n */\nexport function Landmark(props: LandmarkProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n \"elementType\",\n ]);\n\n // Element ref\n const [ref, setRef] = createSignal<HTMLElement>();\n\n // Determine the element type - use semantic element for the role if not specified\n const elementType = createMemo(() => {\n if (local.elementType) {\n return local.elementType;\n }\n return roleToSemanticElement[ariaProps.role] ?? \"div\";\n });\n\n // Create landmark aria props\n const landmarkAria = createLandmark(\n {\n get role() {\n return ariaProps.role;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get id() {\n return ariaProps.id;\n },\n get focus() {\n return ariaProps.focus;\n },\n },\n ref,\n );\n\n const renderValues = createMemo<LandmarkRenderProps>(() => ({\n role: ariaProps.role,\n }));\n\n const resolvedClass = createMemo(() => {\n const cls = local.class;\n if (typeof cls === \"function\") {\n return cls(renderValues());\n }\n return cls ?? `solidaria-Landmark solidaria-Landmark--${ariaProps.role}`;\n });\n\n const resolvedStyle = createMemo(() => {\n const style = local.style;\n if (typeof style === \"function\") {\n return style(renderValues());\n }\n return style;\n });\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n return (\n <Dynamic\n component={elementType()}\n ref={setRef}\n {...domProps()}\n {...landmarkAria.landmarkProps}\n class={resolvedClass()}\n style={resolvedStyle()}\n slot={local.slot}\n >\n {props.children}\n </Dynamic>\n );\n}\n\n/**\n * Returns a controller for programmatic landmark navigation.\n *\n * @example\n * ```tsx\n * const controller = useLandmarkController();\n *\n * <button onClick={() => controller.focusMain()}>Skip to main content</button>\n * <button onClick={() => controller.focusNext()}>Next landmark</button>\n * ```\n */\nexport function useLandmarkController(): LandmarkController {\n return getLandmarkController();\n}\n","/**\n * ActionBar component for solidaria-components\n *\n * Headless action bar that appears when items are selected in a collection.\n * Shows a selection count, clear button, and action buttons.\n *\n * No RAC headless equivalent — this is a thin component layer that ties\n * selection state to visibility and keyboard behavior.\n */\n\nimport {\n type JSX,\n type ParentProps,\n Show,\n createContext,\n createMemo,\n createEffect,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { announce, createToolbar } from \"@proyecto-viviana/solidaria\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ActionBarRenderProps {\n /** Whether the action bar is visible. */\n isOpen: boolean;\n /** The number of selected items. */\n selectedItemCount: number | \"all\";\n}\n\nexport interface ActionBarProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"ref\" | \"slot\">,\n SlotProps {\n /** The number of selected items. ActionBar is hidden when 0. @default 0 */\n selectedItemCount?: number | \"all\";\n /** Callback when the clear button is pressed. */\n onClearSelection?: () => void;\n /** Callback when an action is triggered. */\n onAction?: (key: Key) => void;\n /** The action buttons to display. */\n children?: JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionBarRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionBarRenderProps>;\n /** Accessible label for the action bar. @default 'Actions' */\n \"aria-label\"?: string;\n /** Identifies the element (or elements) that labels the action bar. */\n \"aria-labelledby\"?: string;\n /** Optional keydown handler on the action bar element. */\n onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>;\n /** Screen reader announcement when the action bar becomes available. */\n actionsAvailableMessage?: string;\n /** Ref for the underlying action bar element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ActionBarContextValue {\n selectedItemCount: () => number | \"all\";\n onClearSelection?: () => void;\n onAction?: (key: Key) => void;\n}\n\nexport const ActionBarContext = createContext<ActionBarContextValue | null>(null);\n\nexport function useActionBarContext(): ActionBarContextValue | null {\n return useContext(ActionBarContext);\n}\n\nexport function ActionBar(props: ActionBarProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"selectedItemCount\",\n \"onClearSelection\",\n \"onAction\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"aria-label\",\n \"aria-labelledby\",\n \"onKeyDown\",\n \"actionsAvailableMessage\",\n \"ref\",\n ]);\n\n const selectedItemCount = () => local.selectedItemCount ?? 0;\n const isOpen = () => selectedItemCount() !== 0;\n\n const { toolbarProps } = createToolbar({\n orientation: \"horizontal\",\n get \"aria-label\"() {\n return local[\"aria-label\"] ?? (local[\"aria-labelledby\"] ? undefined : \"Actions\");\n },\n get \"aria-labelledby\"() {\n return local[\"aria-labelledby\"];\n },\n });\n\n let wasOpen = false;\n createEffect(() => {\n const open = isOpen();\n if (open && !wasOpen) {\n const message = local.actionsAvailableMessage ?? \"Actions available.\";\n if (message) {\n announce(message);\n }\n }\n wasOpen = open;\n });\n\n const handleKeyDown: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent> = (e) => {\n const onKeyDown = local.onKeyDown as\n | JSX.EventHandler<HTMLDivElement, KeyboardEvent>\n | undefined;\n onKeyDown?.(e);\n if (e.defaultPrevented) {\n return;\n }\n\n if (e.key === \"Escape\" && isOpen()) {\n e.preventDefault();\n e.stopPropagation();\n local.onClearSelection?.();\n }\n };\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionBar\",\n },\n () => ({\n isOpen: isOpen(),\n selectedItemCount: selectedItemCount(),\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n const contextValue = createMemo<ActionBarContextValue>(() => ({\n selectedItemCount,\n onClearSelection: local.onClearSelection,\n onAction: local.onAction,\n }));\n\n return (\n <Show when={isOpen()}>\n <ActionBarContext.Provider value={contextValue()}>\n <div\n {...filteredDOMProps()}\n {...toolbarProps}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={isOpen() || undefined}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext.Provider>\n </Show>\n );\n}\n\nexport interface ActionBarContainerProps extends ParentProps {\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * Container that positions a collection and its ActionBar.\n */\nexport function ActionBarContainer(props: ActionBarContainerProps): JSX.Element {\n return (\n <div\n class={props.class ?? \"solidaria-ActionBarContainer\"}\n style={{ position: \"relative\", ...props.style }}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ActionBarSelectionCountProps {\n class?: string;\n}\n\n/**\n * Displays the count of selected items.\n */\nexport function ActionBarSelectionCount(props: ActionBarSelectionCountProps): JSX.Element {\n const ctx = useActionBarContext();\n\n const text = () => {\n if (!ctx) return \"\";\n const count = ctx.selectedItemCount();\n if (count === \"all\") return \"All selected\";\n if (count === 0) return \"None selected\";\n return `${count} selected`;\n };\n\n return <span class={props.class}>{text()}</span>;\n}\n\nexport interface ActionBarClearButtonProps {\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n}\n\n/**\n * Button to clear the current selection.\n */\nexport function ActionBarClearButton(props: ActionBarClearButtonProps): JSX.Element {\n const ctx = useActionBarContext();\n\n return (\n <button\n type=\"button\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n class={props.class}\n onClick={() => ctx?.onClearSelection?.()}\n >\n {props.children ?? \"\\u2715\"}\n </button>\n );\n}\n","/**\n * ActionGroup component for solidaria-components\n *\n * Pre-wired headless action group component that combines\n * createListState + createActionGroup/createActionGroupItem.\n * Provides proper dynamic roles (toolbar/radiogroup), keyboard\n * navigation, and ARIA attributes.\n *\n * No RAC equivalent exists — this bridges solidaria ARIA hooks\n * directly to a headless component.\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n createMemo,\n splitProps,\n useContext,\n For,\n} from \"solid-js\";\nimport {\n createActionGroup,\n createActionGroupItem,\n type AriaActionGroupProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n type ListState,\n type Key,\n type SelectionMode,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface ActionGroupRenderProps {\n /** The orientation of the action group. */\n orientation: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled: boolean;\n /** The selection mode. */\n selectionMode: SelectionMode;\n}\n\nexport interface ActionGroupItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n}\n\nexport interface ActionGroupItem {\n id: string;\n label: string;\n isDisabled?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ActionGroupProps<T extends ActionGroupItem = ActionGroupItem> extends SlotProps {\n /** The items in the action group. */\n items: T[];\n /** The selection mode. @default 'none' */\n selectionMode?: SelectionMode;\n /** Orientation of the group. @default 'horizontal' */\n orientation?: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled?: boolean;\n /** Accessible label. */\n \"aria-label\"?: string;\n /** Labelled-by id. */\n \"aria-labelledby\"?: string;\n /** Currently selected keys (controlled). */\n selectedKeys?: Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** Handler called when an item action is triggered. */\n onAction?: (key: Key) => void;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Render function for each item. */\n children: (item: T, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionGroupRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionGroupRenderProps>;\n}\n\nexport interface ActionGroupContextValue<T extends ActionGroupItem = ActionGroupItem> {\n state: ListState<T>;\n}\n\nexport const ActionGroupContext = createContext<ActionGroupContextValue | null>(null);\nexport const ActionGroupStateContext = createContext<ListState<ActionGroupItem> | null>(null);\n\nexport function ActionGroup<T extends ActionGroupItem = ActionGroupItem>(\n props: ActionGroupProps<T>,\n): JSX.Element {\n const [local, ariaGroupProps, domProps] = splitProps(\n props,\n [\n \"items\",\n \"selectionMode\",\n \"orientation\",\n \"isDisabled\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onAction\",\n \"disabledKeys\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n ],\n [\"aria-label\", \"aria-labelledby\"],\n );\n\n const state = createListState<T>({\n get items() {\n return local.items;\n },\n get selectionMode() {\n return local.selectionMode ?? \"none\";\n },\n get selectedKeys() {\n return local.selectedKeys;\n },\n get defaultSelectedKeys() {\n return local.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return local.onSelectionChange;\n },\n get disabledKeys() {\n return local.disabledKeys;\n },\n getKey: (item) => item.id,\n getTextValue: (item) => item.label,\n getDisabled: (item) => !!item.isDisabled,\n });\n\n const groupAriaProps: AriaActionGroupProps<T> = {\n get items() {\n return local.items;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get orientation() {\n return local.orientation;\n },\n get \"aria-label\"() {\n return ariaGroupProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaGroupProps[\"aria-labelledby\"];\n },\n get onAction() {\n return local.onAction;\n },\n };\n\n const { actionGroupProps } = createActionGroup(groupAriaProps, state as ListState<T>);\n\n const orientation = () => local.orientation ?? \"horizontal\";\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionGroup\",\n },\n () => ({\n orientation: orientation(),\n isDisabled: !!local.isDisabled,\n selectionMode: (local.selectionMode ?? \"none\") as SelectionMode,\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n return (\n <ActionGroupContext.Provider value={{ state: state as ListState<ActionGroupItem> }}>\n <ActionGroupStateContext.Provider value={state as ListState<ActionGroupItem>}>\n <div\n {...filteredDOMProps()}\n {...actionGroupProps}\n ref={(el: HTMLDivElement) => {\n const refFn = (actionGroupProps as { ref?: (el: HTMLElement) => void }).ref;\n refFn?.(el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-orientation={orientation()}\n data-disabled={local.isDisabled || undefined}\n >\n <For each={local.items}>\n {(item) => (\n <ActionGroupItemWrapper\n item={item}\n state={state as ListState<ActionGroupItem>}\n renderChild={\n local.children as (\n item: ActionGroupItem,\n rp: ActionGroupItemRenderProps,\n ) => JSX.Element\n }\n />\n )}\n </For>\n </div>\n </ActionGroupStateContext.Provider>\n </ActionGroupContext.Provider>\n );\n}\n\ninterface ActionGroupItemWrapperProps {\n item: ActionGroupItem;\n state: ListState<ActionGroupItem>;\n renderChild: (item: ActionGroupItem, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n}\n\nfunction ActionGroupItemWrapper(props: ActionGroupItemWrapperProps): JSX.Element {\n const { buttonProps } = createActionGroupItem(\n {\n get key() {\n return props.item.id;\n },\n },\n props.state,\n );\n\n const isFocused = () => props.state.focusedKey() === props.item.id;\n const isSelected = () => {\n const keys = props.state.selectedKeys();\n return keys === \"all\" || (keys instanceof Set && keys.has(props.item.id));\n };\n const isDisabled = () => props.state.isDisabled(props.item.id);\n\n const renderProps = createMemo<ActionGroupItemRenderProps>(() => ({\n isSelected: isSelected(),\n isDisabled: isDisabled(),\n isFocused: isFocused(),\n }));\n\n const { ref: _ref, ...restButtonProps } = buttonProps as Record<string, unknown> & {\n ref?: unknown;\n };\n\n return (\n <button\n {...restButtonProps}\n data-selected={isSelected() || undefined}\n data-disabled={isDisabled() || undefined}\n data-focused={isFocused() || undefined}\n >\n {props.renderChild(props.item, renderProps())}\n </button>\n );\n}\n\nexport function useActionGroupContext(): ActionGroupContextValue | null {\n return useContext(ActionGroupContext);\n}\n","/**\n * Alert component for solidaria-components\n *\n * Minimal headless Alert that owns ARIA semantics (role=\"alert\")\n * and provides render props for styling. The UI layer consumes this\n * for styling/composition only.\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext } from \"solid-js\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n filterDOMProps,\n} from \"./utils\";\nimport { Button, type ButtonProps } from \"./Button\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport interface AlertRenderProps {\n /** The variant of the alert. */\n variant: AlertVariant;\n /** Whether the alert can be dismissed. */\n isDismissible: boolean;\n}\n\nexport interface AlertProps extends SlotProps {\n /** The variant of the alert. */\n variant?: AlertVariant;\n /** Whether the alert can be dismissed. */\n isDismissible?: boolean;\n /** Handler called when the alert is dismissed. */\n onDismiss?: () => void;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<AlertRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<AlertRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<AlertRenderProps>;\n /** The id of the element. */\n id?: string;\n}\n\nexport interface AlertContextValue {\n variant: () => AlertVariant;\n isDismissible: () => boolean;\n onDismiss?: () => void;\n}\n\nexport const AlertContext = createContext<AlertContextValue | null>(null);\n\n/**\n * An alert displays a brief, important message in a way that\n * attracts the user's attention without interrupting their task.\n *\n * This is a headless component that provides the ARIA `role=\"alert\"`\n * semantics and render props for styling.\n *\n * @example\n * ```tsx\n * <Alert variant=\"error\" isDismissible onDismiss={() => setVisible(false)}>\n * {({ variant }) => <span>Something went wrong ({variant})</span>}\n * </Alert>\n * ```\n */\nexport function Alert(props: AlertProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"variant\",\n \"isDismissible\",\n \"onDismiss\",\n ]);\n\n const variant = () => local.variant ?? \"info\";\n const isDismissible = () => !!local.isDismissible;\n\n const renderValues = createMemo<AlertRenderProps>(() => ({\n variant: variant(),\n isDismissible: isDismissible(),\n }));\n\n // Resolve class and style manually. We intentionally avoid useRenderProps()\n // because it destructures children eagerly, which would create child\n // components (e.g. AlertDismissButton) BEFORE the AlertContext.Provider\n // is in scope, breaking context for sub-components.\n const computedClass = createMemo(() => {\n const cls = local.class;\n return typeof cls === \"function\" ? cls(renderValues()) : (cls ?? \"solidaria-Alert\");\n });\n\n const computedStyle = createMemo(() => {\n const s = local.style;\n return typeof s === \"function\" ? s(renderValues()) : s;\n });\n\n const domProps = createMemo(() => filterDOMProps(rest, { global: true }));\n\n const contextValue: AlertContextValue = {\n variant,\n isDismissible,\n onDismiss: local.onDismiss,\n };\n\n // Children are accessed lazily inside the Provider scope (via local.children\n // in JSX) so sub-components like AlertDismissButton can read AlertContext.\n return (\n <AlertContext.Provider value={contextValue}>\n <div\n {...domProps()}\n role=\"alert\"\n class={computedClass()}\n style={computedStyle()}\n data-variant={variant()}\n data-dismissible={isDismissible() || undefined}\n >\n {typeof local.children === \"function\"\n ? (local.children as (props: AlertRenderProps) => JSX.Element)(renderValues())\n : local.children}\n </div>\n </AlertContext.Provider>\n );\n}\n\nexport interface AlertDismissButtonProps extends Omit<ButtonProps, \"onPress\"> {}\n\n/**\n * A dismiss button for use inside an Alert.\n * Uses the headless Button for full keyboard/a11y support.\n *\n * @example\n * ```tsx\n * <Alert isDismissible onDismiss={handleDismiss}>\n * <span>Alert content</span>\n * <AlertDismissButton aria-label=\"Dismiss\">X</AlertDismissButton>\n * </Alert>\n * ```\n */\nexport function AlertDismissButton(props: AlertDismissButtonProps): JSX.Element {\n const context = useContext(AlertContext);\n\n return (\n <Button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Dismiss\"}\n onPress={() => context?.onDismiss?.()}\n />\n );\n}\n","/**\n * Icon component for solidaria-components\n *\n * Minimal headless Icon that owns ARIA semantics:\n * - Decorative (no label): aria-hidden=\"true\"\n * - Informative (aria-label): role=\"img\" + aria-label\n * - Interactive (onPress): wraps content in headless Button\n *\n * The UI layer consumes this for styling/composition only.\n */\n\nimport { type JSX, createContext, createMemo, Show, splitProps } from \"solid-js\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { Button } from \"./Button\";\nimport type { PressEvent } from \"@proyecto-viviana/solidaria\";\n\nexport interface IconRenderProps {\n /** Whether the icon is purely decorative (no label). */\n isDecorative: boolean;\n /** Whether the icon is interactive (has onPress). */\n isInteractive: boolean;\n}\n\nexport interface IconProps extends SlotProps {\n /** Handler called when the icon is pressed (makes it interactive). */\n onPress?: (e: PressEvent) => void;\n /** Accessible label for the icon. When provided, the icon is informative (role=\"img\"). */\n \"aria-label\"?: string;\n /** ID of an element that labels this icon. */\n \"aria-labelledby\"?: string;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<IconRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<IconRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<IconRenderProps>;\n /** The id of the element. */\n id?: string;\n}\n\nexport const IconContext = createContext<IconProps | null>(null);\n\n/**\n * An icon wrapper that provides correct ARIA semantics.\n *\n * - **Decorative** (no `aria-label`): renders `<span aria-hidden=\"true\">`\n * - **Informative** (`aria-label` provided): renders `<span role=\"img\" aria-label=\"...\">`\n * - **Interactive** (`onPress` provided): wraps in headless `Button`\n *\n * @example\n * ```tsx\n * // Decorative\n * <Icon><SearchSvg /></Icon>\n *\n * // Informative\n * <Icon aria-label=\"Search\"><SearchSvg /></Icon>\n *\n * // Interactive\n * <Icon onPress={handleSearch} aria-label=\"Search\"><SearchSvg /></Icon>\n * ```\n */\nexport function Icon(props: IconProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"onPress\",\n \"aria-label\",\n \"aria-labelledby\",\n ]);\n\n const hasLabel = () => !!(local[\"aria-label\"] || local[\"aria-labelledby\"]);\n const isInteractive = () => !!local.onPress;\n const isDecorative = () => !hasLabel();\n\n const renderValues = createMemo<IconRenderProps>(() => ({\n isDecorative: isDecorative(),\n isInteractive: isInteractive(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Icon\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => filterDOMProps(rest, { global: true }));\n\n return (\n <Show\n when={isInteractive()}\n fallback={\n <span\n {...domProps()}\n role={hasLabel() ? \"img\" : undefined}\n aria-hidden={isDecorative() ? \"true\" : undefined}\n aria-label={local[\"aria-label\"]}\n aria-labelledby={local[\"aria-labelledby\"]}\n class={renderProps.class()}\n style={renderProps.style()}\n data-interactive={undefined}\n data-decorative={isDecorative() || undefined}\n >\n {renderProps.renderChildren()}\n </span>\n }\n >\n <Button\n {...domProps()}\n onPress={local.onPress}\n aria-label={local[\"aria-label\"]}\n aria-labelledby={local[\"aria-labelledby\"]}\n class={renderProps.class()}\n style={renderProps.style()}\n data-interactive=\"\"\n >\n {renderProps.renderChildren()}\n </Button>\n </Show>\n );\n}\n","/**\n * Focusable component for solidaria-components\n *\n * A render-prop component that wraps createFocusable to make an element\n * focusable and capable of auto focus. Port of React Aria's Focusable.\n */\n\nimport {\n type JSX,\n children as resolveChildren,\n createEffect,\n onCleanup,\n splitProps,\n} from \"solid-js\";\nimport { createFocusable, type CreateFocusableProps } from \"@proyecto-viviana/solidaria\";\n\nexport interface FocusableProps extends CreateFocusableProps {\n /** A single child element to make focusable. */\n children: JSX.Element;\n /** Ref callback. */\n ref?: HTMLElement | ((el: HTMLElement) => void);\n}\n\n/**\n * Makes its child element focusable and capable of auto focus.\n * Applies focus and keyboard event handlers from createFocusable.\n *\n * @example\n * ```tsx\n * <Focusable onFocus={() => console.log('focused')}>\n * <div tabIndex={0}>Focusable content</div>\n * </Focusable>\n * ```\n */\nexport function Focusable(props: FocusableProps): JSX.Element {\n const [local, focusableProps] = splitProps(props, [\"children\", \"ref\"]);\n\n let ref!: HTMLElement;\n const { focusableProps: domProps } = createFocusable(focusableProps, () => ref);\n\n const resolved = resolveChildren(() => local.children);\n\n createEffect(() => {\n const child = resolved() as HTMLElement;\n if (child instanceof HTMLElement) {\n ref = child;\n if (typeof local.ref === \"function\") {\n local.ref(child);\n }\n\n // Apply focusable props to the child element\n const props = domProps;\n const listeners: Array<[string, EventListener]> = [];\n const addListener = (eventName: string, handler: unknown) => {\n if (typeof handler === \"function\") {\n const listener = handler as EventListener;\n child.addEventListener(eventName, listener);\n listeners.push([eventName, listener]);\n }\n };\n\n addListener(\"focus\", props.onFocus);\n addListener(\"blur\", props.onBlur);\n addListener(\"keydown\", props.onKeyDown);\n addListener(\"keyup\", props.onKeyUp);\n\n // Apply non-event focusable props (e.g. tabIndex/aria/data attrs).\n // Keep explicit child tabIndex to mirror mergeProps(child.props precedence).\n for (const [key, value] of Object.entries(props)) {\n if (key === \"ref\" || (key.startsWith(\"on\") && typeof value === \"function\")) continue;\n\n if (key === \"tabIndex\") {\n if (child.hasAttribute(\"tabindex\")) continue;\n if (value == null || value === false) {\n child.removeAttribute(\"tabindex\");\n } else {\n child.tabIndex = Number(value);\n }\n continue;\n }\n\n if (key.startsWith(\"aria-\") || key.startsWith(\"data-\") || key === \"id\" || key === \"role\") {\n if (child.hasAttribute(key)) continue;\n if (value == null || value === false) {\n child.removeAttribute(key);\n } else if (value === true) {\n child.setAttribute(key, \"\");\n } else {\n child.setAttribute(key, String(value));\n }\n }\n }\n\n onCleanup(() => {\n for (const [eventName, listener] of listeners) {\n child.removeEventListener(eventName, listener);\n }\n });\n }\n });\n\n return <>{resolved()}</>;\n}\n","/**\n * Pressable component for solidaria-components\n *\n * A render-prop component that wraps createPress + createFocusable\n * to make an element pressable. Port of React Aria's Pressable.\n */\n\nimport {\n type JSX,\n children as resolveChildren,\n createEffect,\n onCleanup,\n splitProps,\n} from \"solid-js\";\nimport {\n createPress,\n createFocusable,\n type CreatePressProps,\n type CreateFocusableProps,\n} from \"@proyecto-viviana/solidaria\";\n\nexport interface PressableProps extends CreatePressProps {\n /** A single child element to make pressable. */\n children: JSX.Element;\n /** Ref callback. */\n ref?: HTMLElement | ((el: HTMLElement) => void);\n}\n\n/**\n * Makes its child element pressable and focusable.\n * Combines createPress and createFocusable for full interaction support.\n *\n * @example\n * ```tsx\n * <Pressable onPress={() => console.log('pressed')}>\n * <div role=\"button\" tabIndex={0}>Click me</div>\n * </Pressable>\n * ```\n */\nexport function Pressable(props: PressableProps): JSX.Element {\n const [local, pressProps] = splitProps(props, [\"children\", \"ref\"]);\n\n let ref!: HTMLElement;\n const { pressProps: domPressProps } = createPress(pressProps);\n const { focusableProps: domFocusableProps } = createFocusable(\n pressProps as CreateFocusableProps,\n () => ref,\n );\n\n const resolved = resolveChildren(() => local.children);\n\n createEffect(() => {\n const child = resolved() as HTMLElement;\n if (child instanceof HTMLElement) {\n ref = child;\n if (typeof local.ref === \"function\") {\n local.ref(child);\n }\n\n // Apply press props\n const allProps = { ...domFocusableProps, ...domPressProps };\n const listeners: Array<[string, EventListener]> = [];\n for (const [key, handler] of Object.entries(allProps)) {\n if (key.startsWith(\"on\") && typeof handler === \"function\") {\n const eventName = key.slice(2).toLowerCase();\n const listener = handler as EventListener;\n child.addEventListener(eventName, listener);\n listeners.push([eventName, listener]);\n }\n }\n\n // Apply non-event press/focusable props (e.g. tabIndex/data attrs).\n // Keep explicit child tabIndex to mirror mergeProps(child.props precedence).\n for (const [key, value] of Object.entries(allProps)) {\n if (key === \"ref\" || (key.startsWith(\"on\") && typeof value === \"function\")) continue;\n\n if (key === \"tabIndex\") {\n if (child.hasAttribute(\"tabindex\")) continue;\n if (value == null || value === false) {\n child.removeAttribute(\"tabindex\");\n } else {\n child.tabIndex = Number(value);\n }\n continue;\n }\n\n if (key.startsWith(\"aria-\") || key.startsWith(\"data-\") || key === \"id\" || key === \"role\") {\n if (child.hasAttribute(key)) continue;\n if (value == null || value === false) {\n child.removeAttribute(key);\n } else if (value === true) {\n child.setAttribute(key, \"\");\n } else {\n child.setAttribute(key, String(value));\n }\n }\n }\n\n onCleanup(() => {\n for (const [eventName, listener] of listeners) {\n child.removeEventListener(eventName, listener);\n }\n });\n }\n });\n\n return <>{resolved()}</>;\n}\n"],"mappings":";;;;;;;;;AAsDA,MAAa,eAAe;;;;;;;;;;AAoC5B,SAAgB,eACd,OACA,QACsB;CAGtB,MAAM,EAAE,OAAO,WAAW,OAAO,mBAAmB,OAAO;AAiB3D,QAAO;EACL,OAfoB,iBAAiB;GACrC,MAAM,gBAAgB,QAAQ;AAC9B,UAAO,OAAO,cAAc,aACxB,UAAU,cAAc,GACvB,aAAa;IAWE;EACpB,OAToB,iBAAiB;GACrC,MAAM,gBAAgB,QAAQ;AAC9B,UAAO,OAAO,UAAU,aAAa,MAAM,cAAc,GAAG;IAOxC;EACpB,sBAAsB;GACpB,MAAM,gBAAgB,QAAQ;GAC9B,MAAM,WAAW,MAAM;AACvB,UAAO,OAAO,aAAa,aAAa,SAAS,cAAc,GAAG;;EAEpE,IAAI,WAAW;AACb,UAAO,MAAM;;EAEf;EACD;;AAGH,SAAgB,mBACd,MACA,UACoB;AACpB,KAAI,CAAC,KAAM,QAAO,YAAY,EAAE;AAChC,KAAI,CAAC,SAAU,QAAO;AACtB,QAAO;EACL,UAAU,SAAS,YAAY,KAAK;EACpC,OAAO,SAAS,SAAS,KAAK;EAC9B,OAAO,SAAS,SAAS,KAAK;EAC/B;;;;;AAkBH,SAAgB,kBACd,SACU;AACV,QAAO,WAAW,QAAQ;;AAG5B,SAAgB,gBACd,OACA,KACA,SACgB;AAChB,KAAI,CAAC,QAAS,QAAO,CAAC,OAAO,IAAI;AACjC,QAAO,CAAC;EAAE,GAAI;EAAoB,GAAG;EAAO,EAAE,IAAI;;AAGpD,MAAa,YAEP,UAAU;AACd,QAAO,MAAM;;;;;AAMf,SAAgB,SAAS,OAA4C;AACnE,QAAO,QAAQ,KAAK,KAAA;;;;;AAMtB,SAAgB,qBACd,QACoC;CACpC,MAAM,SAA6C,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