@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
package/dist/index.ssr.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils.tsx","../src/VisuallyHidden.tsx","../src/Button.tsx","../src/contexts.ts","../src/Switch.tsx","../src/ToggleButton.tsx","../src/ToggleButtonGroup.tsx","../src/Checkbox.tsx","../src/RadioGroup.tsx","../src/SelectionIndicator.tsx","../src/SharedElementTransition.tsx","../src/TextField.tsx","../src/Text.tsx","../src/Link.tsx","../src/RouterProvider.tsx","../src/Keyboard.tsx","../src/Form.tsx","../src/FieldError.tsx","../src/FileTrigger.tsx","../src/DropZone.tsx","../src/virtualizer/Layout.ts","../src/Virtualizer.tsx","../src/Collection.tsx","../src/VirtualizerLayouts.ts","../src/ProgressBar.tsx","../src/Separator.tsx","../src/Toolbar.tsx","../src/Autocomplete.tsx","../src/ListBox.tsx","../src/DragAndDrop.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/DateField.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/Landmark.tsx","../src/ActionBar.tsx","../src/ActionGroup.tsx","../src/Alert.tsx","../src/Icon.tsx","../src/Focusable.tsx","../src/Pressable.tsx","../src/index.ts"],"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// TYPES\n// ============================================\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// RENDER PROPS\n// ============================================\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'\n ? style(currentValues)\n : 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'\n ? children(currentValues)\n : children;\n },\n get children() { return props.children; },\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 UTILITIES\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>(context: ReturnType<typeof createContext<T | null>>): 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// DATA ATTRIBUTES\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// PROPS UTILITIES\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', 'class', 'style', 'tabIndex', 'role', 'title', 'lang', 'dir',\n 'hidden', 'draggable', 'accessKey', 'contentEditable', '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 (\n (global && globalAttrs.has(key)) ||\n ariaAttrs.test(key) ||\n dataAttrs.test(key) ||\n eventHandlers.test(key)\n )\n ) {\n result[key] = (props as Record<string, unknown>)[key];\n }\n }\n\n return result as R;\n}\n\n// ============================================\n// CLIENT-ONLY UTILITIES\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\n// ============================================\n// TYPES\n// ============================================\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// COMPONENT\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 const [local, others] = splitProps(props, ['elementType', 'isFocusable', 'style']);\n const { visuallyHiddenProps } = createVisuallyHidden(() => ({\n style: local.style,\n isFocusable: local.isFocusable,\n }));\n\n const elementType = () => local.elementType ?? 'span';\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 return (\n <Dynamic\n component={elementType()}\n {...mergedProps()}\n >\n {props.children}\n </Dynamic>\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 createMemo,\n splitProps,\n useContext,\n} from 'solid-js';\nimport {\n createButton,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaButtonProps,\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';\n\n// ============================================\n// TYPES\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\n extends Omit<AriaButtonProps, 'children'>,\n 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 /** Whether the button is in a pending state. */\n isPending?: boolean;\n}\n\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const ButtonContext = createContext<ButtonProps | null>(null);\n\n// ============================================\n// COMPONENT\n// ============================================\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 mergedProps = (contextProps ? mergeProps(contextProps, props) : props) as ButtonProps;\n\n // Split props\n const [local, ariaProps] = splitProps(mergedProps, [\n 'children',\n 'class',\n 'style',\n 'slot',\n 'isPending',\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\n let buttonEl: HTMLButtonElement | undefined;\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 && !!buttonEl && dialogTriggerContext.triggerRef() === buttonEl;\n const isPopoverTrigger = () =>\n !!popoverTriggerContext && !!buttonEl && popoverTriggerContext.triggerRef() === buttonEl;\n\n // Wrap onPress to also toggle dialog/popover if this is a trigger button\n const handlePress = (e: PressEvent) => {\n if (resolvePending()) {\n return;\n }\n // Call original onPress if provided\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 // Create button aria props\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 // Create focus ring\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled() || resolvePending();\n },\n });\n\n // Render props values\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 // Resolve render props\n const renderProps = useRenderProps(\n {\n // Use merged children so ButtonContext can supply slot/default content.\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-Button',\n },\n renderValues\n );\n\n // Filter DOM props\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 // Extract refs from props to combine them manually\n const buttonPropsRef = (buttonAria.buttonProps as Record<string, unknown>).ref as ((el: HTMLElement) => void) | undefined;\n const focusPropsRef = (focusProps as Record<string, unknown>).ref as ((el: HTMLElement) => void) | undefined;\n const hoverPropsRef = (hoverProps as Record<string, unknown>).ref as ((el: HTMLElement) => void) | undefined;\n\n // Remove ref from spread props to avoid type conflicts\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\n // Ref callback that combines all refs\n const handleRef = (el: HTMLButtonElement) => {\n buttonEl = el;\n\n // Call the focusable ref for autoFocus support\n buttonPropsRef?.(el);\n focusPropsRef?.(el);\n hoverPropsRef?.(el);\n\n // Register trigger ownership for surrounding trigger contexts.\n if (dialogTriggerContext?.setTriggerRef) {\n dialogTriggerContext.setTriggerRef(el);\n }\n if (popoverTriggerContext?.setTriggerRef) {\n popoverTriggerContext.setTriggerRef(el);\n }\n };\n\n return (\n <button\n ref={handleRef}\n {...domProps()}\n {...cleanButtonProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n type={\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 }\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={(buttonAria.isPressed() && !resolvePending()) || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={resolveDisabled() || undefined}\n data-pending={resolvePending() || undefined}\n >\n {renderProps.renderChildren()}\n </button>\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\n// ============================================\n// OVERLAY TRIGGER STATE CONTEXT\n// ============================================\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\n// ============================================\n// DIALOG TRIGGER CONTEXT\n// ============================================\n\nexport interface DialogTriggerContextValue {\n state: StatelyOverlayTriggerState\n triggerRef: () => HTMLElement | null\n setTriggerRef: (el: HTMLElement | null) => void\n triggerId: string\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\n// ============================================\n// POPOVER TRIGGER CONTEXT\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 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 * 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 splitProps,\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\n// ============================================\n// TYPES\n// ============================================\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 /** State of the switch. */\n state: ToggleState;\n}\n\nexport interface ToggleSwitchProps\n extends Omit<AriaSwitchProps, 'children'>,\n 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}\n\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const ToggleSwitchContext = createContext<ToggleSwitchProps | null>(null);\n\n// ============================================\n// COMPONENT\n// ============================================\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 let inputRef: HTMLInputElement | null = null;\n\n // Split props\n const [local, ariaProps] = splitProps(props, [\n 'class',\n 'style',\n 'slot',\n ]);\n\n // Create toggle state\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createToggleState({\n get isSelected() { return ariaProps.isSelected; },\n get defaultSelected() { return ariaProps.defaultSelected; },\n get onChange() { return ariaProps.onChange; },\n get isReadOnly() { return ariaProps.isReadOnly; },\n });\n\n // Create switch aria props\n const switchAria = createSwitch(\n () => ({\n ...ariaProps,\n children: typeof props.children === 'function' ? true : props.children,\n }),\n state,\n () => inputRef\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 ariaProps.isDisabled || ariaProps.isReadOnly;\n },\n });\n\n // Render props values\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 state,\n }));\n\n // Resolve render props\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\n // Filter DOM props\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 // Remove ref from spread props to avoid type conflicts\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\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={(el) => (inputRef = el)}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n />\n </VisuallyHidden>\n {renderProps.renderChildren()}\n </label>\n );\n}\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 {\n type JSX,\n createContext,\n createMemo,\n splitProps,\n useContext,\n} 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\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\n extends Omit<AriaToggleButtonProps, 'children'>,\n 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}\n\nexport const ToggleButtonContext = createContext<ToggleButtonProps | null>(null);\n\nfunction resolveDisabledValue(\n isDisabled: AriaToggleButtonProps['isDisabled']\n): 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 'slot',\n 'toggleKey',\n 'id',\n ]);\n const groupState = useToggleButtonGroupStateContext();\n const groupKey = local.id ?? local.toggleKey;\n\n const toggleAria = groupState && groupKey != null\n ? createToggleButtonGroupItem(\n {\n ...ariaProps,\n id: groupKey,\n },\n groupState\n )\n : createToggleButton(ariaProps);\n\n const isDisabled = () =>\n 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 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 * 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 {\n createToggleButtonGroup,\n mergeProps,\n} 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 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 '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 >\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 * 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 splitProps,\n} from 'solid-js';\nimport {\n createCheckbox,\n createCheckboxGroup,\n createCheckboxGroupItem,\n createFocusRing,\n createHover,\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';\n\n// ============================================\n// TYPES\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' | 'description' | 'errorMessage'>,\n 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}\n\nexport interface CheckboxProps\n extends Omit<AriaCheckboxProps, 'children'>,\n 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 /** Whether the checkbox is indeterminate. */\n isIndeterminate?: boolean;\n}\n\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const CheckboxGroupContext = createContext<CheckboxGroupProps | null>(null);\nexport const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);\nexport const CheckboxContext = createContext<CheckboxProps | null>(null);\n\n// ============================================\n// CHECKBOX GROUP COMPONENT\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 [local, ariaProps] = splitProps(props, [\n 'class',\n 'style',\n 'slot',\n ]);\n\n // Create checkbox group state\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createCheckboxGroupState({\n get value() { return ariaProps.value; },\n get defaultValue() { return ariaProps.defaultValue; },\n get onChange() { return ariaProps.onChange; },\n get isDisabled() { return ariaProps.isDisabled; },\n get isReadOnly() { return ariaProps.isReadOnly; },\n get isRequired() { return ariaProps.isRequired; },\n get isInvalid() { return ariaProps.isInvalid; },\n });\n\n // Create checkbox group aria props\n const groupAria = createCheckboxGroup(() => ariaProps, state);\n\n // Render props values\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 // Resolve render props\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-CheckboxGroup',\n },\n renderValues\n );\n\n // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n // Remove ref from spread props to avoid type conflicts\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = groupAria.groupProps as Record<string, unknown>;\n return rest;\n };\n\n // Resolve children - we need to pass render props if children is a function\n // but we use props.children directly (not renderProps.renderChildren())\n // to preserve SolidJS context propagation for nested components like Checkbox\n const resolvedChildren = () => {\n const children = props.children;\n if (typeof children === 'function') {\n return children(renderValues());\n }\n return children;\n };\n\n return (\n <CheckboxGroupStateContext.Provider value={state}>\n <div\n {...domProps()}\n {...cleanGroupProps()}\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 {resolvedChildren()}\n </div>\n </CheckboxGroupStateContext.Provider>\n );\n}\n\n// ============================================\n// CHECKBOX COMPONENT\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 let inputRef: HTMLInputElement | null = null;\n\n const [local, ariaProps] = splitProps(props, [\n 'class',\n 'style',\n 'slot',\n 'isIndeterminate',\n ]);\n\n // Check if we're inside a CheckboxGroup\n const groupState = useContext(CheckboxGroupStateContext);\n\n // Create appropriate state/aria hooks based on context\n let isSelected: Accessor<boolean>;\n let isPressed: Accessor<boolean>;\n let isDisabled: boolean;\n let isReadOnly: boolean;\n let isInvalid: boolean;\n let labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n let inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n\n if (groupState) {\n // Inside a CheckboxGroup - use group item\n const itemAria = createCheckboxGroupItem(\n () => ({\n ...ariaProps,\n value: ariaProps.value ?? '',\n children: typeof props.children === 'function' ? true : props.children,\n }),\n groupState,\n () => inputRef\n );\n isSelected = itemAria.isSelected;\n isPressed = itemAria.isPressed;\n isDisabled = itemAria.isDisabled;\n isReadOnly = itemAria.isReadOnly;\n isInvalid = itemAria.isInvalid;\n labelProps = itemAria.labelProps;\n inputProps = itemAria.inputProps;\n } else {\n // Standalone checkbox\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createToggleState({\n get isSelected() { return ariaProps.isSelected; },\n get defaultSelected() { return ariaProps.defaultSelected; },\n get onChange() { return ariaProps.onChange; },\n get isReadOnly() { return ariaProps.isReadOnly; },\n });\n\n const checkboxAria = createCheckbox(\n () => ({\n ...ariaProps,\n isIndeterminate: local.isIndeterminate,\n children: typeof props.children === 'function' ? true : props.children,\n }),\n state,\n () => inputRef\n );\n isSelected = checkboxAria.isSelected;\n isPressed = checkboxAria.isPressed;\n isDisabled = checkboxAria.isDisabled;\n isReadOnly = checkboxAria.isReadOnly;\n isInvalid = checkboxAria.isInvalid;\n labelProps = checkboxAria.labelProps;\n inputProps = checkboxAria.inputProps;\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 isDisabled || isReadOnly;\n },\n });\n\n // Render props values\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,\n isReadOnly,\n isInvalid,\n isRequired: ariaProps.isRequired ?? false,\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-Checkbox',\n },\n renderValues\n );\n\n // Filter DOM props\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 // Remove ref from spread props to avoid type conflicts\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 { ref: _ref3, ...rest } = 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\n return (\n <label\n {...domProps()}\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\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 <VisuallyHidden>\n <input\n ref={(el) => (inputRef = el)}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n />\n </VisuallyHidden>\n {renderProps.renderChildren()}\n </label>\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 useContext,\n createMemo,\n splitProps,\n Show,\n} from 'solid-js';\nimport {\n createRadio,\n createRadioGroup,\n createFocusRing,\n createHover,\n type AriaRadioProps,\n type AriaRadioGroupProps,\n} from '@proyecto-viviana/solidaria';\nimport {\n createRadioGroupState,\n type RadioGroupState,\n type RadioGroupProps as RadioGroupStateProps,\n} from '@proyecto-viviana/solid-stately';\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\n// ============================================\n// TYPES\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 Omit<AriaRadioGroupProps, 'children' | 'label' | 'description' | 'errorMessage'>,\n Pick<RadioGroupStateProps, 'value' | 'defaultValue' | 'onChange'>,\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}\n\nexport interface RadioProps\n extends Omit<AriaRadioProps, 'children'>,\n 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}\n\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const RadioGroupContext = createContext<RadioGroupProps | null>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\nexport const RadioContext = createContext<RadioProps | null>(null);\n\n// ============================================\n// RADIO GROUP COMPONENT\n// ============================================\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 [local, ariaProps] = splitProps(props, [\n 'class',\n 'style',\n 'slot',\n ]);\n\n // Create radio group state\n // We pass a function that returns props so that createRadioGroupState\n // can access props reactively. The props object itself is a proxy in SolidJS,\n // so accessing props.value inside a reactive context will track changes.\n const state = createRadioGroupState({\n get value() { return props.value; },\n get defaultValue() { return props.defaultValue; },\n get onChange() { return props.onChange; },\n get isDisabled() { return props.isDisabled; },\n get isReadOnly() { return props.isReadOnly; },\n get isRequired() { return props.isRequired; },\n get isInvalid() { return props.isInvalid; },\n });\n\n // Create radio group aria props\n const groupAria = createRadioGroup(() => ariaProps, state);\n\n // Render props values\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: groupAria.isInvalid,\n state,\n }));\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n // Remove ref from spread props to avoid type conflicts\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = groupAria.radioGroupProps as Record<string, unknown>;\n return rest;\n };\n\n // Resolve children - we need to pass render props if children is a function\n // but we use props.children directly (not renderProps.renderChildren())\n // to preserve SolidJS context propagation for nested components like Radio\n const resolvedChildren = () => {\n const children = props.children;\n if (typeof children === 'function') {\n return children(renderValues());\n }\n return children;\n };\n\n return (\n <RadioGroupStateContext.Provider value={state}>\n <div\n {...domProps()}\n {...cleanGroupProps()}\n class={renderProps.class()}\n style={renderProps.style()}\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={groupAria.isInvalid || undefined}\n >\n {resolvedChildren()}\n </div>\n </RadioGroupStateContext.Provider>\n );\n}\n\n// ============================================\n// RADIO COMPONENT\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 let inputRef: HTMLInputElement | null = null;\n const { radioProps, state } = props;\n\n const [local, ariaProps] = splitProps(radioProps, ['class', 'style', 'slot']);\n\n // Create radio aria props\n const radioAria = createRadio(\n () => ({\n ...ariaProps,\n children: typeof radioProps.children === 'function' ? true : radioProps.children,\n }),\n state,\n () => inputRef\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 });\n\n // Render props values\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 // Resolve render props\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 // Filter DOM props\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 // Remove ref from spread props to avoid type conflicts\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 { ref: _ref3, ...rest } = radioAria.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\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <label\n {...domProps()}\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\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 <VisuallyHidden>\n <input\n ref={(el) => (inputRef = el)}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n />\n </VisuallyHidden>\n {renderProps.renderChildren()}\n </label>\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\n when={getState()}\n fallback={null}\n keyed\n >\n {(state) => <RadioImpl radioProps={props} state={state} />}\n </Show>\n );\n}\n","/**\n * Shared SelectionIndicator primitive for selected collection items.\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n splitProps,\n useContext,\n Show,\n} 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 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, ['isSelected', 'shouldForceMount', 'children', 'class', 'style', 'slot']);\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> & { ref?: unknown };\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 * 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}>\n {props.children}\n </SharedElementContext.Provider>\n );\n}\n\nexport interface SharedElementRenderProps {\n isEntering: boolean;\n isExiting: boolean;\n}\n\nexport interface SharedElementPropsBase\n extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'style'> {\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?: HTMLDivElement | ((el: HTMLDivElement) => void);\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', 'isVisible', 'children', 'class', 'style', '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 // Direct assignment for ref={myVar} pattern\n (local as any).ref = el;\n }\n };\n\n // Handle visibility transitions with FLIP animation\n createEffect(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 as any)[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.translate = `${deltaX}px ${deltaY}px`;\n } else {\n (element.style as any)[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 as any)[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 // 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(p => [p, (style as any)[p]]),\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 * 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 splitProps,\n} from 'solid-js';\nimport {\n createTextField,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaTextFieldProps,\n} from '@proyecto-viviana/solidaria';\nimport { createTextFieldState } 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\n// ============================================\n// TYPES\n// ============================================\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\n extends Omit<AriaTextFieldProps, 'children'>,\n 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}\n\n// ============================================\n// CONTEXT\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}\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\n// ============================================\n// SUB-COMPONENTS\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<string, unknown>;\n return { ...contextLabelProps, ...props };\n }\n return props;\n };\n\n return <label {...mergedProps()}>{props.children}</label>;\n}\n\nexport interface InputProps extends Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'children'> {}\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\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<string, unknown>;\n return { ...contextInputProps, ...props };\n }\n return props;\n };\n\n return <input {...mergedProps()} />;\n}\n\nexport interface TextAreaProps extends Omit<JSX.TextareaHTMLAttributes<HTMLTextAreaElement>, 'children'> {}\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\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 { ref: _ref, type: _type, ...contextInputProps } = context.inputProps as Record<string, unknown>;\n return { ...contextInputProps, ...props };\n }\n return props;\n };\n\n return <textarea {...mergedProps()} />;\n}\n\n// ============================================\n// COMPONENT\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 // Split props\n const [local, ariaProps] = splitProps(props, [\n 'children',\n 'class',\n 'style',\n 'slot',\n ]);\n\n // Create text field state\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createTextFieldState({\n get value() { return ariaProps.value; },\n get defaultValue() { return ariaProps.defaultValue; },\n get onChange() { return ariaProps.onChange; },\n });\n\n // Create text field aria props\n const textFieldAria = createTextField(() => ({\n ...ariaProps,\n value: state.value(),\n onChange: state.setValue,\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 ariaProps.isDisabled;\n },\n });\n\n // Render props values\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 // Resolve render props\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-TextField',\n },\n renderValues\n );\n\n // Filter DOM props\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 // Remove ref from spread props to avoid type conflicts\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 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 };\n\n return (\n <TextFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\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 >\n {renderProps.renderChildren()}\n </div>\n </TextFieldContext.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 * 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 {\n type JSX,\n type ParentProps,\n createContext,\n createMemo,\n splitProps,\n} 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\n// ============================================\n// TYPES\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\n extends Omit<AriaLinkProps, 'elementType'>,\n HoverEvents,\n 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}\n\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const LinkContext = createContext<LinkProps | null>(null);\n\n// ============================================\n// LINK COMPONENT\n// ============================================\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 'slot',\n 'onHoverStart',\n 'onHoverEnd',\n 'onHoverChange',\n ]);\n const router = useRouter();\n const resolvedHref = createMemo(() => ariaProps.href ? router.useHref(ariaProps.href) : undefined);\n\n // Determine element type - use 'a' if href is provided and not disabled\n const elementType = () => {\n if (ariaProps.href && !ariaProps.isDisabled) {\n return 'a';\n }\n return 'span';\n };\n\n // Create link aria props\n const linkAria = createLink({\n get elementType() { return elementType(); },\n get isDisabled() { return ariaProps.isDisabled; },\n get href() { return resolvedHref(); },\n get hrefLang() { return ariaProps.hrefLang; },\n get target() { return ariaProps.target; },\n get rel() { return ariaProps.rel; },\n get download() { return ariaProps.download; },\n get ping() { return ariaProps.ping; },\n get referrerPolicy() { return ariaProps.referrerPolicy; },\n get onPress() { return ariaProps.onPress; },\n get onPressStart() { return ariaProps.onPressStart; },\n get onPressEnd() { return ariaProps.onPressEnd; },\n get onClick() { return ariaProps.onClick; },\n get onFocus() { return ariaProps.onFocus; },\n get onBlur() { return ariaProps.onBlur; },\n get onFocusChange() { return ariaProps.onFocusChange; },\n get onKeyDown() { return ariaProps.onKeyDown; },\n get onKeyUp() { return ariaProps.onKeyUp; },\n get autoFocus() { return ariaProps.autoFocus; },\n get 'aria-current'() { return ariaProps['aria-current']; },\n get 'aria-label'() { return ariaProps['aria-label']; },\n get 'aria-labelledby'() { return ariaProps['aria-labelledby']; },\n get 'aria-describedby'() { return ariaProps['aria-describedby']; },\n });\n\n // Create focus ring\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() { return ariaProps.isDisabled ?? false; },\n get onHoverStart() { return local.onHoverStart; },\n get onHoverEnd() { return local.onHoverEnd; },\n get onHoverChange() { return local.onHoverChange; },\n });\n\n // Render props values\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 // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n // Remove ref from spread props to avoid type conflicts\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 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 * 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\n// ============================================\n// TYPES\n// ============================================\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\n// ============================================\n// CONTEXT\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\n// ============================================\n// HELPERS\n// ============================================\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(link: HTMLAnchorElement, modifiers: RouterClickModifiers): 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// COMPONENT\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 (\n <RouterContext.Provider value={ctx}>\n {props.children}\n </RouterContext.Provider>\n );\n}\n\n/**\n * Returns the current router context value.\n */\nexport function useRouter(): RouterContextValue {\n return useContext(RouterContext);\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 * 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\nexport interface FormRenderProps {\n validationBehavior: ValidationBehavior;\n}\n\nexport interface FormProps\n extends Omit<JSX.FormHTMLAttributes<HTMLFormElement>, 'children' | 'class' | 'style'>,\n SlotProps {\n /** Server-side validation errors keyed by field name. */\n validationErrors?: ValidationErrors;\n /** Validation behavior mode. */\n validationBehavior?: ValidationBehavior;\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}\n\nexport const FormContext = createContext<FormProps | null>(null);\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 'slot',\n ]);\n\n const validationBehavior: ValidationBehavior = local.validationBehavior ?? 'native';\n const errors = local.validationErrors ?? {};\n const renderProps = useRenderProps(\n {\n children: local.children,\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-Form',\n },\n () => ({\n validationBehavior,\n })\n );\n\n const filteredDomProps = filterDOMProps(domProps, { global: true });\n\n return (\n <form\n {...filteredDomProps}\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 * 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, createContext, createMemo, splitProps, useContext } from 'solid-js';\nimport 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 FieldErrorProps\n extends Omit<JSX.HTMLAttributes<HTMLElement>, 'children' | 'class' | 'style'>,\n 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 | null>(null);\n\nexport function FieldError(props: FieldErrorProps): JSX.Element | null {\n const contextValidation = useContext(FieldErrorContext);\n const [local, domProps] = splitProps(props, ['validation', 'children', 'class', 'style', 'slot']);\n\n const validation = createMemo<ValidationResult | null>(() => local.validation ?? contextValidation);\n if (!validation()?.isInvalid) return null;\n\n const renderProps = useRenderProps(\n {\n children: local.children ?? validation()!.validationErrors.join(' '),\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-FieldError',\n },\n () => validation()!\n );\n\n if (renderProps.renderChildren() == null) return null;\n\n const filteredDomProps = filterDOMProps(domProps, { global: true });\n\n return (\n <div\n {...filteredDomProps}\n slot={local.slot ?? 'errorMessage'}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n {renderProps.renderChildren()}\n </div>\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\n extends Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange' | 'children' | 'onSelect'> {\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}>\n {local.children}\n </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 { type JSX, createContext, createMemo, createSignal, splitProps } 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 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 [local, dropProps, hoverEventProps, domProps] = splitProps(\n props,\n ['children', 'class', 'style', 'slot', 'aria-label', 'aria-labelledby'],\n ['getDropOperation', 'getDropOperationForPoint', 'onDropEnter', 'onDropMove', 'onDropActivate', 'onDropExit', 'onDrop', 'isDisabled'],\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(public x = 0, public y = 0) {}\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 (\n this.x <= rect.maxX &&\n rect.x <= this.maxX &&\n this.y <= rect.maxY &&\n rect.y <= this.maxY\n );\n }\n\n containsRect(rect: Rect): boolean {\n return (\n this.x <= rect.x &&\n this.y <= rect.y &&\n this.maxX >= rect.maxX &&\n this.maxY >= rect.maxY\n );\n }\n\n containsPoint(point: Point): boolean {\n return (\n this.x <= point.x &&\n this.y <= point.y &&\n this.maxX >= point.x &&\n this.maxY >= point.y\n );\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(public type: string, public key: Key, public rect: Rect) {}\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 * 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 { DragTypes, DropOperation, DropTarget, ItemDropTarget } 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?(\n context: VirtualizerRangeContext,\n options?: O\n ): VirtualizerVisibleRange;\n getLayoutInfo?(\n index: number,\n context: VirtualizerLayoutInfoContext,\n options?: O\n ): 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: ((resolver: ((key: string | number) => number | null) | undefined) => void);\n setDropOperationResolver: ((resolver: VirtualizerDropOperationResolver | undefined) => void);\n setKeyboardNavigationOverride: ((override: VirtualizerKeyboardNavigationOverride | undefined) => void);\n getBaseKeyboardNavigationTarget: VirtualizerKeyboardNavigationOverride;\n}\n\nexport type VirtualizerDropTargetResolver = (target: VirtualizerDropTarget) => 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>\n extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'style'> {\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?: (index: number, position: 'before' | 'after' | 'on') => 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<VirtualizerDropTargetResolver | undefined>(\n undefined\n );\n const [dropTargetItemCountResolver, setDropTargetItemCountResolver] = createSignal<(() => number) | undefined>(\n undefined\n );\n const [dropTargetIndexResolver, setDropTargetIndexResolver] = createSignal<\n ((key: string | number) => number | null) | undefined\n >(undefined);\n const [dropOperationResolver, setDropOperationResolver] = createSignal<VirtualizerDropOperationResolver | undefined>(\n undefined\n );\n const [keyboardNavigationOverride, setKeyboardNavigationOverride] = createSignal<VirtualizerKeyboardNavigationOverride | undefined>(\n undefined\n );\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(() => resolvedLayoutOptions() as DefaultVirtualizerLayoutOptions | undefined);\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(itemCount, ctx.scrollOffset, ctx.viewportSize, itemSize(), ctx.overscan);\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 = (point: Point, itemCount: number): VirtualizerDropTarget | null => {\n const target = 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 = (resolver: ((key: string | number) => number | null) | undefined): void => {\n setDropTargetIndexResolver(() => resolver);\n };\n const assignDropOperationResolver = (resolver: VirtualizerDropOperationResolver | undefined): void => {\n setDropOperationResolver(() => resolver);\n };\n const assignKeyboardNavigationOverride = (override: VirtualizerKeyboardNavigationOverride | undefined): 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'> = 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) return fromResolver;\n return null;\n }\n if (typeof currentTarget.key === 'number' && currentTarget.key >= 0 && currentTarget.key < itemCount) {\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 (\n let index = startIndex;\n index >= 0 && index < itemCount;\n index += step\n ) {\n const onTarget = tryTarget(index, 'on');\n if (onTarget) return onTarget;\n\n const insertionOrder: Array<'before' | 'after'> = directionForInsertion === 'next'\n ? ['before', 'after']\n : ['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 = (\n index: number,\n position: 'on' | 'before' | 'after'\n ): 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'> = boundaryDirection === 'next'\n ? ['before', 'on', 'after']\n : ['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 = 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'> = direction === 'next'\n ? ['before', 'on', 'after']\n : ['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 = resolvedIndex != null\n ? resolvedIndex\n : resolver\n ? (direction === 'next' ? -1 : itemCount)\n : (typeof target.key === 'number' ? target.key : (direction === 'next' ? -1 : 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 = (\n index: number,\n position: 'on' | 'before' | 'after'\n ): 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'> = step > 0\n ? ['before', 'after']\n : ['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 = 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 = tryTarget(0, 'before')\n ?? tryTarget(0, 'on')\n ?? 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 onCleanup(() => {\n window.removeEventListener('resize', handleResize);\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 {\n ListLayout,\n GridLayout,\n WaterfallLayout,\n TableLayout,\n};\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 * Collection composition primitives for solidaria-components.\n *\n * Foundational parity layer for React Spectrum-style composition:\n * Section / Header / Group.\n */\n\nimport {\n type JSX,\n createContext,\n createMemo,\n splitProps,\n useContext,\n For,\n} 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\n// ============================================\n// TYPES\n// ============================================\n\nexport interface CollectionPrimitiveRenderProps {\n /** Whether the primitive has visible children content. */\n hasChildren: boolean;\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?: (index: number, position: 'before' | 'after' | 'on') => 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 /** 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: { type: 'item'; key: Key; dropPosition: 'before' | 'after' | 'on' }) => JSX.Element | undefined;\n}\n\nexport interface CollectionRootProps<T> {\n collection: Iterable<T>;\n persistedKeys?: Set<Key> | null;\n renderDropIndicator?: (target: { type: 'item'; key: Key; dropPosition: 'before' | 'after' | 'on' }) => 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\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const CollectionRendererContext = 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\n// ============================================\n// HELPERS\n// ============================================\n\nexport function isCollectionSection<T>(entry: CollectionEntry<T>): entry is CollectionSection<T> {\n return typeof entry === 'object' && entry !== null && Array.isArray((entry as CollectionSection<T>).items);\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: { type: 'item'; key: Key; dropPosition: 'before' | 'after' | 'on' }) => 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// COMPONENTS\n// ============================================\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?.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']);\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 {...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(itemCount: number, start: number, end: number, itemSize: number): 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\n ? 'before'\n : offsetWithinItem > threshold * 2\n ? 'after'\n : 'on';\n return { type: 'item', index, position };\n }\n}\n\nexport class TableLayout extends ListLayout {}\n\nexport class GridLayout {\n getVisibleRange(ctx: VirtualizerRangeContext, options?: GridLayoutOptions): 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(index: number, context: VirtualizerLayoutInfoContext, options?: GridLayoutOptions): 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(ctx: VirtualizerRangeContext, options?: WaterfallLayoutOptions): 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(index: number, context: VirtualizerLayoutInfoContext, options?: WaterfallLayoutOptions): 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 * 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 {\n type JSX,\n createContext,\n createMemo,\n splitProps,\n} from 'solid-js';\nimport {\n createProgressBar,\n type AriaProgressBarProps,\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\n// ============================================\n// TYPES\n// ============================================\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\n extends AriaProgressBarProps,\n SlotProps {\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\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const ProgressBarContext = createContext<ProgressBarProps | null>(null);\n\n// ============================================\n// UTILITIES\n// ============================================\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// PROGRESSBAR COMPONENT\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 [local, ariaProps] = splitProps(props, [\n 'children',\n 'class',\n 'style',\n 'slot',\n ]);\n\n // Get values for calculations\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 // Create progress bar aria props\n const progressAria = createProgressBar({\n get value() { return ariaProps.value; },\n get minValue() { return ariaProps.minValue; },\n get maxValue() { return ariaProps.maxValue; },\n get valueLabel() { return ariaProps.valueLabel; },\n get isIndeterminate() { return ariaProps.isIndeterminate; },\n get formatOptions() { return ariaProps.formatOptions; },\n get label() { return ariaProps.label; },\n get 'aria-label'() { return ariaProps['aria-label']; },\n get 'aria-labelledby'() { return ariaProps['aria-labelledby']; },\n get 'aria-describedby'() { return ariaProps['aria-describedby']; },\n get 'aria-details'() { return ariaProps['aria-details']; },\n });\n\n // Calculate percentage\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 // Get value text from aria props\n const valueText = createMemo(() => {\n return progressAria.progressBarProps['aria-valuetext'] as string | undefined;\n });\n\n // Render props values\n const renderValues = createMemo<ProgressBarRenderProps>(() => ({\n percentage: percentage(),\n valueText: valueText(),\n isIndeterminate: isIndeterminate(),\n }));\n\n // Resolve render props\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 // Filter DOM props\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 * 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 {\n type JSX,\n createContext,\n createMemo,\n splitProps,\n} from 'solid-js';\nimport { Dynamic } from 'solid-js/web';\nimport {\n createSeparator,\n type AriaSeparatorProps,\n type Orientation,\n} from '@proyecto-viviana/solidaria';\nimport {\n type SlotProps,\n filterDOMProps,\n} from './utils';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface SeparatorRenderProps {\n /** The orientation of the separator. */\n orientation: Orientation;\n}\n\nexport interface SeparatorProps\n extends AriaSeparatorProps,\n 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}\n\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const SeparatorContext = createContext<SeparatorProps | null>(null);\n\n// ============================================\n// SEPARATOR COMPONENT\n// ============================================\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, [\n 'class',\n 'style',\n 'slot',\n ]);\n\n // Determine the element type\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 // Create separator aria props\n const separatorAria = createSeparator({\n get orientation() { return ariaProps.orientation; },\n get elementType() { return elementType(); },\n get 'aria-label'() { return ariaProps['aria-label']; },\n get 'aria-labelledby'() { return ariaProps['aria-labelledby']; },\n get id() { return ariaProps.id; },\n });\n\n // Render props values\n const renderValues = createMemo<SeparatorRenderProps>(() => ({\n orientation: ariaProps.orientation ?? 'horizontal',\n }));\n\n // Resolve class\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 // Resolve style\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n return (\n <Dynamic\n component={elementType()}\n {...domProps()}\n {...separatorAria.separatorProps}\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 {\n type SlotProps,\n filterDOMProps,\n} from './utils'\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface ToolbarRenderProps {\n /** The orientation of the toolbar. */\n orientation: Orientation\n}\n\nexport interface ToolbarProps\n extends AriaToolbarProps,\n ParentProps,\n 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}\n\n// ============================================\n// CONTEXT\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// TOOLBAR COMPONENT\n// ============================================\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'],\n ['orientation', 'aria-label', 'aria-labelledby']\n )\n\n // Get slot props from context if available\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 // Create toolbar aria props\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 // Render props values\n const renderValues = createMemo<ToolbarRenderProps>(() => ({\n orientation: orientation(),\n }))\n\n // Resolve class\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 // Resolve style\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 // Resolve children (support render props)\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 // Filter remaining DOM props\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 >\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\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AutocompleteProps<T = unknown>\n extends Omit<AutocompleteStateOptions, 'children'>,\n Omit<AriaAutocompleteOptions<T>, 'inputRef' | 'collectionRef'>,\n ParentProps,\n SlotProps {}\n\n// ============================================\n// CONTEXTS\n// ============================================\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 = 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// AUTOCOMPLETE COMPONENT\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 ['filter', 'disableAutoFocusFirst', 'disableVirtualFocus', 'collectionId', 'collectionAriaLabel']\n )\n\n // Create state\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 * 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 createHover,\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\n// ============================================\n// TYPES\n// ============================================\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\nexport interface ListBoxProps<T>\n extends Omit<AriaListBoxProps, 'children'>,\n 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 /** 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 /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<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'>,\n 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}\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 /** 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\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface ListBoxContextValue<T> {\n state: ListState<T>;\n isDisabled: () => boolean;\n dragAndDropHooks?: DragAndDropHooks<unknown>;\n dragState?: unknown;\n dropState?: unknown;\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// COMPONENTS\n// ============================================\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 [local, stateProps, ariaProps] = splitProps(\n props,\n ['children', 'class', 'style', 'slot', 'renderEmptyState', 'hasMore', 'isLoading', 'onLoadMore', 'dragAndDropHooks'],\n ['items', 'getKey', 'getTextValue', 'getDisabled', 'disabledKeys', 'selectionMode', 'selectedKeys', 'defaultSelectedKeys', 'onSelectionChange']\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 // Create list state\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 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 // Helper to resolve isDisabled\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 // Create listbox aria props\n const listBoxAria = createListBox(\n {\n ...ariaProps,\n get isDisabled() {\n return resolveDisabled();\n },\n },\n state\n );\n\n // Create focus ring\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n // Render props values\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 // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-ListBox',\n },\n renderValues\n );\n\n // Filter DOM props\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n // Remove ref from spread props\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(() => Array.from(state.collection()).filter((node) => node.type === 'item'));\n const getDropTargetByIndex = (index: number, position: 'before' | 'after' | 'on'): 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 || parentCollectionRenderer?.dropTargetDelegate || 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 = 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(() => useRenderDropIndicator(local.dragAndDropHooks, dropState()));\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 = 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 ? itemNodes.findIndex((node) => node.key === normalizedDropKey) : -1,\n dropTarget?.type === 'item' ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(baseRange, persistedIndexes, stateProps.items.length, virtualizer, 80, {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n });\n });\n createEffect(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized) return;\n const getItemNodes = () => 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) => props.children(item as T),\n renderDropIndicator: (index, position) =>\n dndDropIndicator(index, position) ?? parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n\n return (\n <ListBoxContext.Provider\n value={{\n state,\n isDisabled: resolveDisabled,\n dragAndDropHooks: local.dragAndDropHooks as DragAndDropHooks<unknown> | undefined,\n dragState: dragState(),\n dropState: dropState(),\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 ref={(el) => {\n setListRef(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-drop-target={isRootDropTarget() || undefined}\n >\n <SharedElementTransition>\n {isEmpty() && local.renderEmptyState\n ? local.renderEmptyState()\n : hasSections()\n ? (\n <For each={sectionedRenderEntries()}>\n {(entry) =>\n entry.type === 'section'\n ? (\n <li role=\"presentation\" data-section-wrapper>\n <Section class=\"solidaria-ListBox-section\">\n {entry.section.title != null && (\n <Header class=\"solidaria-ListBox-sectionHeader\">{entry.section.title}</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?.(indexedItem.index, 'before')}\n {collectionRenderer().renderDropIndicator?.(indexedItem.index, 'on')}\n {props.children(indexedItem.item)}\n {collectionRenderer().renderDropIndicator?.(indexedItem.index, 'after')}\n </>\n )}\n </For>\n </ul>\n </Group>\n </Section>\n </li>\n )\n : (\n <>\n {collectionRenderer().renderDropIndicator?.(entry.item.index, 'before')}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, 'on')}\n {props.children(entry.item.item)}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, 'after')}\n </>\n )\n }\n </For>\n )\n : (\n <>\n {virtualRange()?.offsetTop\n ? <li role=\"presentation\" aria-hidden=\"true\" style={{ height: `${virtualRange()!.offsetTop}px` }} data-virtualizer-spacer=\"top\" />\n : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex(), 'before');\n const onIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex(), 'on');\n const afterIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex(), 'after');\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {props.children(item as T)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom\n ? <li role=\"presentation\" aria-hidden=\"true\" style={{ height: `${virtualRange()!.offsetBottom}px` }} data-virtualizer-spacer=\"bottom\" />\n : null}\n </>\n )\n }\n </SharedElementTransition>\n {local.hasMore && local.onLoadMore && (\n <ListBoxLoadMoreItem\n onLoadMore={local.onLoadMore}\n isLoading={local.isLoading}\n />\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 ]);\n\n // Get state from context\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 // Create option aria props\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 },\n state\n );\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return optionAria.isDisabled();\n },\n });\n\n // Render props values\n const renderValues = createMemo<ListBoxOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: optionAria.isFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n // Resolve render props\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) 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) 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 // Remove ref from spread props\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 cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <li\n ref={setRef}\n {...mergeProps(\n cleanOptionProps(),\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 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={isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n data-dragging={draggableItem()?.isDragging || undefined}\n data-drop-target={droppableItem()?.isDropTarget || undefined}\n >\n {hasPrimitiveLabel()\n ? <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n : renderProps.renderChildren()}\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 ref: HTMLLIElement | 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 (!ref || typeof IntersectionObserver !== 'function') return;\n\n const observer = new IntersectionObserver((entries) => {\n const entry = entries[0];\n if (entry?.isIntersecting) {\n void triggerLoadMore();\n }\n });\n\n observer.observe(ref);\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 <li\n ref={ref}\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 * Section primitive alias for ListBox composition parity.\n */\nexport function ListBoxSection(props: ListBoxSectionProps): JSX.Element {\n return <Section {...props} />;\n}\n\n// Attach Option as a static property\nListBox.Option = ListBoxOption;\nListBox.LoadMoreItem = ListBoxLoadMoreItem;\n","/**\n * Drag and drop composition helpers for solidaria-components.\n *\n * Compatibility target: react-aria-components DragAndDrop exports.\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n useContext,\n} 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<DragAndDropHooks<unknown>, 'renderDropIndicator' | 'isVirtualDragging' | 'useDropIndicator'>\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>) || 'target' in (value as Record<string, unknown>))\n );\n };\n\n const dragAndDropHooks = looksLikeDropState(hooksOrDropState)\n ? undefined\n : 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 = 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 : <DropIndicator target={target} />;\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(\n target: ItemDropTarget,\n collection?: CollectionLike\n): 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((options?.forceIncludeIndexes ?? []).filter((index) => index >= 0 && index < itemCount))\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((a, b) => distanceToBaseRange(a) - distanceToBaseRange(b))) {\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(maxSpan, options?.forceIncludeMaxSpan ?? Math.max(maxSpan, 300));\n const windowSpan = Math.min(itemCount, Math.max(baseSpan, forceMaxSpan));\n const centeredStart = Math.max(0, Math.min(itemCount - windowSpan, nearestForced - Math.floor(windowSpan / 2)));\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 * 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 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 createMenuState,\n createMenuTriggerState,\n type MenuState,\n type OverlayTriggerState,\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} 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';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface MenuRenderProps {\n /** Whether the menu is focused. */\n isFocused: boolean;\n /** Whether the menu is open. */\n isOpen: boolean;\n}\n\nexport interface MenuProps<T>\n extends Omit<AriaMenuProps, 'children'>,\n SlotProps {\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: (item: T) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MenuRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MenuRenderProps>;\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 /** 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}\n\nexport interface MenuItemProps<T>\n extends Omit<AriaMenuItemProps, 'children' | 'key'>,\n 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}\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 MenuTriggerProps {}\n\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface MenuContextValue<T> {\n state: MenuState<T>;\n isDisabled: () => boolean;\n dragAndDropHooks?: DragAndDropHooks<T>;\n dragState?: unknown;\n dropState?: unknown;\n}\n\ninterface MenuTriggerContextValue {\n state: OverlayTriggerState;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: JSX.HTMLAttributes<HTMLElement>;\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);\n\n// ============================================\n// COMPONENTS\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 // Create trigger state\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 // Create trigger aria props\n const { menuTriggerProps, menuProps } = 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 triggerProps: menuTriggerProps,\n menuProps,\n }}\n >\n {props.children}\n </MenuTriggerContext.Provider>\n </RootMenuTriggerStateContext.Provider>\n );\n}\n\nexport function SubmenuTrigger(props: SubmenuTriggerProps): JSX.Element {\n return <MenuTrigger {...props} />;\n}\n\n/**\n * A button that opens a menu.\n */\nexport interface MenuButtonProps 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 extends SectionProps {}\n\nexport function MenuButton(props: MenuButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, ['class', 'style', 'slot', 'isDisabled', 'children']);\n\n // Get trigger context\n const context = useContext(MenuTriggerContext);\n if (!context) {\n throw new Error('MenuButton must be used within a MenuTrigger');\n }\n const { state, triggerProps } = context;\n\n // Create button aria props for proper press handling\n const buttonAria = createButton({\n get isDisabled() {\n return local.isDisabled;\n },\n onPress() {\n state.toggle();\n },\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 local.isDisabled;\n },\n });\n\n // Render props values\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 // Resolve render props\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 // Remove ref from spread props\n const cleanTriggerProps = () => {\n const { ref: _ref1, ...rest } = triggerProps as Record<string, unknown>;\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 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 ['children', 'class', 'style', 'slot'],\n ['items', 'getKey', 'getTextValue', 'getDisabled', 'disabledKeys', 'onAction', 'onClose', 'dragAndDropHooks']\n );\n\n // Get trigger context if available\n const triggerContext = useContext(MenuTriggerContext);\n\n // Ref for the menu element (for click outside detection)\n const [menuRef, setMenuRef] = createSignal<HTMLUListElement | null>(null);\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 // Create menu state\n const state = createMenuState<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 onAction() {\n return stateProps.onAction;\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 // Create menu aria props\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 stateProps.onAction;\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 // Create focus ring\n const { isFocused, focusProps } = createFocusRing();\n\n // Handle click outside to close menu\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 // Render props values\n const renderValues = createMemo<MenuRenderProps>(() => ({\n isFocused: state.isFocused() || isFocused(),\n isOpen: triggerContext?.state.isOpen() ?? true,\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-Menu',\n },\n renderValues\n );\n\n // Remove ref from spread props\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 cleanLabelProps = () => {\n const { ref: _ref4, ...rest } = labelProps as Record<string, unknown>;\n return rest;\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(() => Array.from(state.collection()).filter((node) => node.type === 'item'));\n const getDropTargetByIndex = (index: number, position: 'before' | 'after' | 'on'): 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 || parentCollectionRenderer?.dropTargetDelegate || 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 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 = 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 ? itemNodes.findIndex((node) => node.key === normalizedDropKey) : -1,\n dropTarget?.type === 'item' ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(baseRange, persistedIndexes, stateProps.items.length, virtualizer, 80, {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\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 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 (menuEl && typeof window !== 'undefined' && typeof window.getComputedStyle === 'function') {\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 = 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(() => useRenderDropIndicator(stateProps.dragAndDropHooks, dropState()));\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 collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => props.children(item as T),\n renderDropIndicator: (index, position) =>\n dndDropIndicator(index, position) ?? parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\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 state,\n isDisabled: resolveDisabled,\n dragAndDropHooks: stateProps.dragAndDropHooks,\n dragState: dragState(),\n dropState: dropState(),\n } as MenuContextValue<unknown>}\n >\n <MenuStateContext.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 ref={setMenuRef}\n {...mergeProps(\n cleanMenuProps(),\n cleanTriggerMenuProps(),\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-disabled={resolveDisabled() || undefined}\n data-drop-target={isRootDropTarget() || undefined}\n >\n <SharedElementTransition>\n {hasSections()\n ? (\n <For each={sectionedRenderEntries()}>\n {(entry) =>\n entry.type === 'section'\n ? (\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?.(indexedItem.index, 'before')}\n {collectionRenderer().renderDropIndicator?.(indexedItem.index, 'on')}\n {props.children?.(indexedItem.item)}\n {collectionRenderer().renderDropIndicator?.(indexedItem.index, 'after')}\n </>\n )}\n </For>\n </ul>\n </Group>\n </Section>\n </li>\n )\n : (\n <>\n {collectionRenderer().renderDropIndicator?.(entry.item.index, 'before')}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, 'on')}\n {props.children?.(entry.item.item)}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, 'after')}\n </>\n )\n }\n </For>\n )\n : (\n <>\n {virtualRange()?.offsetTop\n ? <li role=\"presentation\" aria-hidden=\"true\" style={{ height: `${virtualRange()!.offsetTop}px` }} data-virtualizer-spacer=\"top\" />\n : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex(), 'before');\n const onIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex(), 'on');\n const afterIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex(), 'after');\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {props.children?.(item as T)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom\n ? <li role=\"presentation\" aria-hidden=\"true\" style={{ height: `${virtualRange()!.offsetBottom}px` }} data-virtualizer-spacer=\"bottom\" />\n : null}\n </>\n )}\n </SharedElementTransition>\n </ul>\n </>\n </CollectionRendererContext.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 'slot',\n 'id',\n 'item',\n 'textValue',\n 'onAction',\n ]);\n\n // Get state from context\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 [ref, setRef] = createSignal<HTMLLIElement | null>(null);\n\n // Create menu item aria props\n const itemAria = createMenuItem<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(ariaProps.isDisabled || menuContext?.isDisabled());\n },\n get 'aria-label'() {\n return ariaProps['aria-label'] ?? local.textValue;\n },\n get onAction() {\n return local.onAction;\n },\n },\n state\n );\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return itemAria.isDisabled();\n },\n });\n\n // Render props values\n const renderValues = createMemo<MenuItemRenderProps>(() => ({\n isSelected: false, // Menu items don't have selection state\n isFocused: itemAria.isFocused(),\n isFocusVisible: itemAria.isFocusVisible(),\n isPressed: itemAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: itemAria.isDisabled(),\n }));\n\n // Resolve render props\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 // Remove ref from spread props\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 return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const draggableItem = createMemo(() => {\n if (!menuContext?.dragAndDropHooks?.useDraggableItem || !menuContext.dragState) 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) 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 return (\n <li\n ref={setRef}\n {...mergeProps(\n cleanItemProps(),\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 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-dragging={draggableItem()?.isDragging || undefined}\n data-drop-target={droppableItem()?.isDropTarget || undefined}\n >\n {hasPrimitiveLabel()\n ? <span {...itemAria.labelProps}>{renderProps.renderChildren()}</span>\n : renderProps.renderChildren()}\n </li>\n );\n}\n\n/**\n * Section primitive alias for Menu composition parity.\n */\nexport function MenuSection(props: MenuSectionProps): JSX.Element {\n return <Section {...props} />;\n}\n\n// Attach Item as a static property\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 createMemo,\n splitProps,\n useContext,\n For,\n Show,\n} from 'solid-js';\nimport {\n createSelect,\n createHiddenSelect,\n createListBox,\n createOption,\n createHover,\n createInteractOutside,\n FocusScope,\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} 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\n// ============================================\n// TYPES\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>\n extends Omit<AriaSelectProps, 'children'>,\n 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: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectRenderProps>;\n}\n\nexport interface SelectValueRenderProps<T> {\n /** The selected item. */\n selectedItem: CollectionNode<T> | null;\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 /** 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>\n extends Omit<AriaOptionProps, 'children' | 'key'>,\n 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\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface SelectContextValue<T> {\n state: SelectState<T>;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n valueProps: JSX.HTMLAttributes<HTMLElement>;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: JSX.HTMLAttributes<HTMLElement>;\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}\n\nexport const SelectContext = createContext<SelectContextValue<unknown> | null>(null);\nexport const SelectStateContext = createContext<SelectState<unknown> | null>(null);\nexport const SelectValueContext = SelectContext;\n\n// ============================================\n// COMPONENTS\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 [local, stateProps, ariaProps] = splitProps(\n props,\n ['class', 'style', 'slot'],\n ['items', 'getKey', 'getTextValue', 'getDisabled', 'disabledKeys', 'selectionMode', 'selectedKey', 'defaultSelectedKey', 'selectedKeys', 'defaultSelectedKeys', 'onSelectionChange', 'onSelectionChangeKeys', 'isOpen', 'defaultOpen', 'onOpenChange', 'name']\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 // Create select state\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 // Create select aria props\n const { labelProps, triggerProps, valueProps, menuProps, isFocused, isFocusVisible, isOpen } = createSelect<T>(\n ariaProps,\n state\n );\n\n // Create hover for wrapper\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled();\n },\n });\n\n // Render props values\n const renderValues = createMemo<SelectRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isRequired: !!ariaProps.isRequired,\n isSelected: state.selectionMode() === 'multiple'\n ? state.selectedKeys() === 'all' || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null,\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-Select',\n },\n renderValues\n );\n\n // Filter DOM props\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n // Remove ref from hover props\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\n // Create hidden select for form submission\n const { containerProps, selectProps: hiddenSelectProps } = createHiddenSelect({\n state,\n name: stateProps.name,\n get isDisabled() {\n return resolveDisabled();\n },\n });\n\n return (\n <SelectContext.Provider\n value={{\n state,\n triggerProps,\n valueProps,\n labelProps,\n menuProps,\n isOpen,\n isFocused,\n isFocusVisible,\n isDisabled: resolveDisabled,\n placeholder: ariaProps.placeholder,\n items: stateProps.items,\n }}\n >\n <SelectStateContext.Provider value={state}>\n <div\n {...domProps()}\n {...cleanHoverProps()}\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-disabled={resolveDisabled() || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-hovered={isHovered() || undefined}\n >\n {/* Hidden select for form submission */}\n <div {...containerProps}>\n <select {...hiddenSelectProps}>\n <option />\n <For each={stateProps.items}>\n {(item) => {\n const itemRecord = isObjectRecord(item) ? item : null;\n const fallbackKey = itemRecord != null\n ? toKey(itemRecord.key) ?? toKey(itemRecord.id)\n : undefined;\n const key = stateProps.getKey?.(item) ?? fallbackKey ?? String(item);\n const fallbackTextValue = itemRecord != null\n ? toTextValue(itemRecord.textValue) ?? toTextValue(itemRecord.label)\n : undefined;\n const textValue = stateProps.getTextValue?.(item) ?? fallbackTextValue ?? String(item);\n const selectedKeys = state.selectedKeys();\n const isSelected = 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 </div>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n {props.children}\n </div>\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 // Get context\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error('SelectTrigger must be used within a Select');\n }\n const { triggerProps, isOpen, isFocused, isFocusVisible, state } = context;\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n // Render props values\n const renderValues = createMemo<SelectTriggerRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: state.isDisabled,\n }));\n\n // Resolve render props\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 // Remove ref from spread props\n const cleanTriggerProps = () => {\n const { ref: _ref1, ...rest } = 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\n return (\n <button\n {...domProps}\n {...cleanTriggerProps()}\n {...cleanHoverProps()}\n type=\"button\"\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, ['class', 'style', 'slot', 'placeholder', 'children']);\n\n // Get context\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 // Use local placeholder if provided, otherwise fall back to context\n const placeholder = () => local.placeholder ?? contextPlaceholder;\n\n // Render props values\n const renderValues = createMemo<SelectValueRenderProps<T>>(() => {\n const selectedItem = state.selectedItem();\n const selectedItems = state.selectedItems();\n const selectedText = state.selectionMode() === 'multiple'\n ? selectedItems.map((item) => item.textValue).join(', ')\n : selectedItem?.textValue ?? null;\n return {\n selectedItem,\n selectedText,\n isSelected: state.selectionMode() === 'multiple' ? selectedItems.length > 0 : selectedItem != null,\n placeholder: placeholder(),\n };\n });\n\n // Resolve render props\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 {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, ['class', 'style', 'slot', 'children']);\n\n // Get context\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error('SelectListBox must be used within a Select');\n }\n const { menuProps, state: selectState, isOpen } = context;\n const state = selectState as SelectState<T>;\n\n // Ref for the listbox element (for click outside detection)\n let listBoxRef: HTMLUListElement | undefined;\n\n // Handle click outside to close select\n createInteractOutside({\n ref: () => listBoxRef ?? null,\n onInteractOutside: () => {\n if (isOpen()) {\n state.close();\n }\n },\n get isDisabled() {\n return !isOpen();\n },\n });\n\n // Create listbox aria props - reuse select's internal list state via collection\n const { listBoxProps } = createListBox(\n {\n ...(menuProps as unknown as AriaListBoxProps),\n get isDisabled() {\n return state.isDisabled;\n },\n },\n createSelectListStateAdapter(state)\n );\n\n // Render props values\n const renderValues = createMemo<SelectListBoxRenderProps>(() => ({\n isFocused: state.isFocused(),\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-Select-listbox',\n },\n renderValues\n );\n\n // Remove ref from spread props\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\n return (\n <Show when={isOpen()}>\n <FocusScope restoreFocus autoFocus>\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 >\n <Show when={props.children} fallback={\n <For each={items()}>\n {(node) => (\n <SelectOption id={node.key}>\n {node.textValue}\n </SelectOption>\n )}\n </For>\n }>\n <For each={items()}>\n {(node) => node.value != null ? props.children!(node.value) : null}\n </For>\n </Show>\n </ul>\n </FocusScope>\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 // Get state from context\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 // Create option aria props - adapt select state to list state interface\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 },\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\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return optionAria.isDisabled();\n },\n });\n\n // Render props values\n const renderValues = createMemo<SelectOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: optionAria.isFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n // Resolve render props\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 // Remove ref from spread props\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 cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <li\n {...cleanOptionProps()}\n {...cleanHoverProps()}\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={isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n >\n {hasPrimitiveLabel()\n ? <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n : renderProps.renderChildren()}\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'\n ? new Set(Array.from(state.collection()).map((item) => item.key))\n : 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: () => state.selectionMode() === 'multiple' ? state.setSelectedKeys([]) : state.setSelectedKey(null),\n toggleSelectAll: () => {},\n extendSelection: (toKey) => state.setSelectedKey(toKey),\n select: (key) => state.selectionMode() === 'multiple'\n ? state.setSelectedKeys([...(state.selectedKeys() === 'all' ? [] : state.selectedKeys() as Set<Key>), key])\n : state.setSelectedKey(key),\n };\n}\n\n// Attach sub-components\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 createMemo,\n splitProps,\n useContext,\n For,\n Show,\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\n// ============================================\n// TYPES\n// ============================================\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}\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 /** The children of the tab list - render function for each item. */\n children: (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}\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\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface TabsContextValue<T> {\n state: TabListState<T>;\n items: Accessor<T[]>;\n}\n\nexport const TabsContext = createContext<TabsContextValue<unknown> | null>(null);\nexport const TabsStateContext = createContext<TabListState<unknown> | null>(null);\n\n// ============================================\n// COMPONENTS\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'],\n ['items', 'getKey', 'getTextValue', 'getDisabled', 'disabledKeys', 'selectedKey', 'defaultSelectedKey', 'onSelectionChange', 'isDisabled', 'keyboardActivation', 'orientation']\n );\n\n // Create tab list state\n const state = createTabListState<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 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 // Render props values\n const renderValues = createMemo<TabsRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n return (\n <TabsContext.Provider value={{ state, items: () => stateProps.items ?? [] }}>\n <TabsStateContext.Provider value={state}>\n <div\n {...domProps()}\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, ariaProps] = splitProps(props, [\n 'class',\n 'style',\n 'slot',\n ]);\n\n // Get state from context\n const context = useContext(TabsContext);\n\n return (\n <Show\n when={context}\n fallback={<div class=\"solidaria-TabList\" role=\"tablist\" />}\n >\n {(ctx) => (\n <TabListInner\n context={ctx()}\n local={local}\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: { class?: ClassNameOrFunction<TabListRenderProps>; style?: StyleOrFunction<TabListRenderProps>; slot?: string };\n ariaProps: Omit<TabListProps<T>, 'children' | 'class' | 'style' | 'slot'>;\n children?: (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\n // Create tab list aria props\n const { tabListProps } = createTabList<T>(props.ariaProps as AriaTabListProps, state);\n\n // Create focus ring\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n // Render props values\n const renderValues = createMemo<TabListRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n isFocused: state.isFocused() || isFocused(),\n isFocusVisible: isFocusVisible(),\n }));\n\n // Resolve render props\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 (typeof handler === 'object' && 'handleEvent' in handler && typeof handler.handleEvent === 'function') {\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 <SharedElementTransition>\n <For each={items()}>{(item) => props.children?.(item)}</For>\n </SharedElementTransition>\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, [\n 'class',\n 'style',\n 'slot',\n 'id',\n ]);\n\n // Get state from context\n const context = useContext(TabsStateContext);\n\n return (\n <Show\n when={context}\n fallback={<div class=\"solidaria-Tab\" role=\"tab\" />}\n >\n {(state) => (\n <TabInner\n state={state()}\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 local: { class?: ClassNameOrFunction<TabRenderProps>; style?: StyleOrFunction<TabRenderProps>; slot?: string; id: Key };\n ariaProps: Omit<TabProps, 'children' | 'class' | 'style' | 'slot' | 'id'>;\n children?: RenderChildren<TabRenderProps>;\n}): JSX.Element {\n let tabRef: HTMLDivElement | undefined;\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 },\n props.state,\n () => tabRef ?? null\n );\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return tabAria.isDisabled();\n },\n });\n\n // Render props values\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 // Resolve render props\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 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 * A TabPanel displays the content for a selected Tab.\n */\nexport function TabPanel(props: TabPanelProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n 'class',\n 'style',\n 'slot',\n 'shouldForceMount',\n ]);\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\n // Render props values\n const renderValues = createMemo<TabPanelRenderProps>(() => ({\n isSelected: isSelected(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n }));\n\n // Resolve render props\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 // Shared panel pattern - render when any tab is selected\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={ariaProps.id !== undefined && !isSelected() ? true : undefined}\n hidden={ariaProps.id !== undefined && !isSelected() && !local.shouldForceMount ? true : undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </Show>\n );\n}\n\n// Attach sub-components\nTabs.List = TabList;\nTabs.Tab = Tab;\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: (items: DragItem[]) => 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 (\n typeof rendered === 'object' &&\n rendered !== null &&\n 'element' in rendered\n ) {\n const previewValue = rendered as { element: unknown; x?: number; y?: number };\n callback(isElementNode(previewValue.element) ? previewValue.element : null, previewValue.x, previewValue.y);\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()]\n .filter((item) => item.type === 'item')\n .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'> = direction === 'next'\n ? ['before', 'on', 'after']\n : ['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'> = direction === 'next'\n ? ['on', 'before', 'after']\n : ['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\n ? `[data-collection=\"${cssEscape(collectionId)}\"]`\n : '[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 = 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 (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({ ...target, dropPosition: 'before' })) {\n target.dropPosition = isFlowRtl ? 'after' : 'before';\n } else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({ ...target, dropPosition: 'after' })) {\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>\n extends Omit<DraggableCollectionStateOptions<T>, 'getItems'> {\n items?: T[];\n}\n\ninterface DragHooks<T = object> {\n useDraggableCollectionState?: (props: DraggableCollectionStateOpts<T>) => DraggableCollectionState;\n useDraggableCollection?: (\n props: Omit<DraggableCollectionOptions, 'ref'>,\n state: DraggableCollectionState,\n ref: Accessor<HTMLElement | null>\n ) => DraggableCollectionAria;\n useDraggableItem?: (props: DraggableItemOptions, state: DraggableCollectionState) => DraggableItemAria;\n DragPreview?: typeof DragPreview;\n renderDragPreview?: DragAndDropOptions<T>['renderDragPreview'];\n isVirtualDragging?: () => boolean;\n}\n\ninterface DropHooks {\n useDroppableCollectionState?: (props: DroppableCollectionStateOptions) => 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'>>,\n 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?: (items: DragItem[]) => 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(onDrop || onInsert || onItemDrop || onReorder || onMove || onRootDrop);\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 = options.preview ?? (\n renderDragPreview\n ? {\n current: (items: DragItem[], callback: (node: HTMLElement | null, x?: number, y?: number) => void) => {\n const rendered = renderDragPreview(items);\n if (!rendered) {\n callback(null);\n return;\n }\n if (\n typeof rendered === 'object' &&\n rendered !== null &&\n 'element' in rendered\n ) {\n const previewValue = rendered as { element: unknown; x?: number; y?: number };\n callback(isElementNode(previewValue.element) ? previewValue.element : null, previewValue.x, previewValue.y);\n return;\n }\n callback(isElementNode(rendered) ? rendered : null);\n },\n }\n : undefined\n );\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: 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 = acceptedDragTypes === 'all'\n ? 'all'\n : acceptedDragTypes?.filter((type): type is string | symbol =>\n typeof type === 'string' || typeof type === 'symbol');\n return (\n 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 || (\n activeTarget.type === 'item' &&\n target.type === 'item' &&\n activeTarget.key === target.key &&\n activeTarget.dropPosition === target.dropPosition\n ));\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 splitProps,\n useContext,\n For,\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\n// ============================================\n// TYPES\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 - render function for each item. */\n children: (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}\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 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}\n\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface BreadcrumbsContextValue {\n isDisabled: Accessor<boolean>;\n onAction?: (key: string | 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// COMPONENTS\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'],\n ['aria-label', 'aria-labelledby', 'aria-describedby']\n );\n\n const isDisabled = () => local.isDisabled ?? false;\n const items = () => local.items ?? [];\n const getItemKey = (item: T, index: number): string | number =>\n local.getKey?.(item) ?? defaultItemKey(item, index);\n\n // Create breadcrumbs aria props\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 // Render props values\n const renderValues = createMemo<BreadcrumbsRenderProps>(() => ({\n isDisabled: isDisabled(),\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-Breadcrumbs',\n },\n renderValues\n );\n\n // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n return (\n <BreadcrumbsContext.Provider value={{ isDisabled, onAction: local.onAction }}>\n <nav\n {...navProps}\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={isDisabled() || undefined}\n >\n <ol style={{ display: 'flex', 'align-items': 'center', 'list-style': 'none', margin: 0, padding: 0 }}>\n <For each={items()}>\n {(item, index) => {\n const itemKey = getItemKey(item, index());\n const isLast = () => index() === items().length - 1;\n\n return (\n <li style={{ display: 'flex', 'align-items': 'center' }}>\n <BreadcrumbItemContext.Provider value={{ itemKey, isLast }}>\n {props.children(item)}\n </BreadcrumbItemContext.Provider>\n </li>\n );\n }}\n </For>\n </ol>\n </nav>\n </BreadcrumbsContext.Provider>\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, [\n 'class',\n 'style',\n 'slot',\n 'isDisabled',\n ]);\n\n // Get context\n const context = useContext(BreadcrumbsContext);\n const itemContext = useContext(BreadcrumbItemContext);\n const isDisabled = () => local.isDisabled ?? context?.isDisabled() ?? false;\n const isCurrent = () => ariaProps.isCurrent ?? itemContext?.isLast() ?? false;\n const itemKey = () => itemContext?.itemKey ?? 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 // Create breadcrumb item aria props\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-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 // Render props values\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 // Resolve render props\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 // Merge inline flex styles with user styles\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 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\n// Attach sub-components\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 {\n type JSX,\n createContext,\n createMemo,\n splitProps,\n useContext,\n} from 'solid-js';\nimport {\n createNumberField,\n createFocusRing,\n createHover,\n createPress,\n type AriaNumberFieldProps,\n} from '@proyecto-viviana/solidaria';\nimport {\n createNumberFieldState,\n type NumberFieldState,\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\n// ============================================\n// TYPES\n// ============================================\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\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface NumberFieldContextValue {\n state: NumberFieldState;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n incrementButtonProps: JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n decrementButtonProps: JSX.ButtonHTMLAttributes<HTMLButtonElement>;\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// COMPONENTS\n// ============================================\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 ['value', 'defaultValue', 'onChange', 'minValue', 'maxValue', 'step', 'locale', 'formatOptions'],\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 // Create number field state\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 // Ref for the input\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n // Create number field aria props\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 // Render props values\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 // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\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 {renderProps.renderChildren()}\n </div>\n </NumberFieldContext.Provider>\n </NumberFieldStateContext.Provider>\n );\n}\n\n/**\n * The label for a number field.\n */\nexport function NumberFieldLabel(props: { children?: JSX.Element; class?: string; style?: JSX.CSSProperties }): 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: { children?: JSX.Element; class?: string; style?: JSX.CSSProperties }): JSX.Element {\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error('NumberFieldGroup must be used within a NumberField');\n }\n\n // Extract ref to avoid type issues\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = context.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...cleanGroupProps()}\n class={props.class ?? 'solidaria-NumberField-group'}\n style={props.style}\n >\n {props.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 // Create focus ring\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n // Render props values\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 // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-NumberField-input',\n },\n renderValues\n );\n\n // Remove ref from spread props\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 return (\n <input\n {...domProps}\n ref={context.setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\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 // Create press\n const { isPressed, pressProps } = createPress({\n get isDisabled() {\n return context.isDisabled || !context.state.canIncrement();\n },\n onPress: () => {\n (context.incrementButtonProps.onClick as ((e?: MouseEvent) => void) | undefined)?.();\n },\n });\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canIncrement();\n },\n });\n\n const isDisabled = () => context.isDisabled || !context.state.canIncrement();\n\n // Render props values\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n // Resolve render props\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 // Remove ref from spread props\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = context.incrementButtonProps as Record<string, unknown>;\n return rest;\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 <button\n {...domProps}\n {...cleanButtonProps()}\n {...cleanPressProps()}\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 );\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 // Create press\n const { isPressed, pressProps } = createPress({\n get isDisabled() {\n return context.isDisabled || !context.state.canDecrement();\n },\n onPress: () => {\n (context.decrementButtonProps.onClick as ((e?: MouseEvent) => void) | undefined)?.();\n },\n });\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canDecrement();\n },\n });\n\n const isDisabled = () => context.isDisabled || !context.state.canDecrement();\n\n // Render props values\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n // Resolve render props\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 // Remove ref from spread props\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = context.decrementButtonProps as Record<string, unknown>;\n return rest;\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 <button\n {...domProps}\n {...cleanButtonProps()}\n {...cleanPressProps()}\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 );\n}\n\n// Attach sub-components\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 splitProps,\n useContext,\n Show,\n} from 'solid-js';\nimport {\n createSearchField,\n createFocusRing,\n createHover,\n createPress,\n type AriaSearchFieldProps,\n} from '@proyecto-viviana/solidaria';\nimport {\n createSearchFieldState,\n type SearchFieldState,\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\n// ============================================\n// TYPES\n// ============================================\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}\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 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 extends SlotProps, 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\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface SearchFieldContextValue {\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}\n\nexport const SearchFieldContext = createContext<SearchFieldContextValue | null>(null);\n\n// ============================================\n// COMPONENTS\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 [local, stateProps, ariaProps, rest] = splitProps(\n props,\n ['children', 'class', 'style', 'slot'],\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 'name',\n 'placeholder',\n 'autoComplete',\n 'inputMode',\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 // Create search field state\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 // Ref for the input\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n // Create search field aria props\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 autoFocus() {\n return ariaProps.autoFocus;\n },\n get autoComplete() {\n return ariaProps.autoComplete;\n },\n get inputMode() {\n return ariaProps.inputMode;\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 // Render props values\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 // Resolve render props\n const renderProps = useRenderProps(\n {\n children: props.children,\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-SearchField',\n },\n renderValues\n );\n\n // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\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\n return (\n <SearchFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\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 {renderProps.renderChildren()}\n </div>\n </SearchFieldContext.Provider>\n );\n}\n\n/**\n * The label for a search field.\n */\nexport function SearchFieldLabel(props: { children?: JSX.Element; class?: string; style?: JSX.CSSProperties }): 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\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error('SearchFieldInput must be used within a SearchField');\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 context.isDisabled;\n },\n });\n\n // Render props values\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 // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-SearchField-input',\n },\n renderValues\n );\n\n // Remove ref from spread props\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 return (\n <input\n {...domProps}\n ref={context.setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\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 // Create press\n const { isPressed, pressProps } = createPress({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n onPress: () => {\n context.clearButtonProps.onClick();\n },\n });\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n });\n\n const isDisabled = () => context.isDisabled || context.isReadOnly;\n const isEmpty = () => context.state.value() === '';\n\n // Render props values\n const renderValues = createMemo<SearchFieldClearButtonRenderProps>(() => ({\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n // Resolve render props\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 // Remove ref from spread props\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 // Only show clear button when there's a value\n return (\n <Show when={!isEmpty()}>\n <button\n {...domProps}\n type=\"button\"\n aria-label={context.clearButtonProps['aria-label']}\n tabIndex={context.clearButtonProps.tabIndex}\n disabled={context.clearButtonProps.disabled}\n onMouseDown={context.clearButtonProps.onMouseDown}\n {...cleanPressProps()}\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\n// Attach sub-components\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 {\n type JSX,\n createContext,\n createMemo,\n splitProps,\n useContext,\n Show,\n} from 'solid-js';\nimport {\n createSlider,\n createFocusRing,\n createHover,\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';\n\n// ============================================\n// TYPES\n// ============================================\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}\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 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 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 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\n// ============================================\n// CONTEXT\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}\n\nexport const SliderContext = createContext<SliderContextValue | null>(null);\nexport const SliderStateContext = SliderContext;\nexport const SliderTrackContext = SliderContext;\nexport const SliderOutputContext = SliderContext;\n\n// ============================================\n// COMPONENTS\n// ============================================\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'],\n ['value', 'defaultValue', 'onChange', 'onChangeEnd', 'minValue', 'maxValue', 'step', 'orientation', 'locale', 'formatOptions'],\n ['label', 'aria-label', 'aria-labelledby', 'aria-describedby', 'isDisabled', 'id']\n );\n\n // Create slider state\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 // Track ref for pointer handling\n let trackRef: HTMLElement | undefined;\n const setTrackRef = (el: HTMLElement) => {\n trackRef = el;\n };\n\n // Create slider aria props\n const {\n labelProps,\n groupProps,\n trackProps,\n thumbProps,\n inputProps,\n outputProps,\n } = createSlider(ariaProps, state, () => trackRef ?? null);\n\n // Render props values\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 // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n // Clean props helpers\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <SliderContext.Provider\n value={{\n state,\n trackProps,\n thumbProps,\n outputProps,\n inputProps,\n trackRef,\n setTrackRef,\n }}\n >\n <div\n {...domProps()}\n {...cleanGroupProps()}\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 {/* Label */}\n <Show when={ariaProps.label}>\n <span {...labelProps}>{ariaProps.label}</span>\n </Show>\n\n {renderProps.renderChildren()}\n\n {/* Hidden input for form submission */}\n <input {...inputProps} />\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, trackProps, setTrackRef } = context;\n\n // Render props values\n const renderValues = createMemo<SliderTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\n }));\n\n // Resolve render props\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 // Clean props\n const cleanTrackProps = () => {\n const { ref: _ref, style: trackStyle, ...rest } = trackProps as Record<string, unknown>;\n return rest;\n };\n\n // Merge styles\n const mergedStyle = () => {\n const trackStyle = (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('SliderFill must be used within a Slider');\n }\n\n const { state, thumbProps } = context;\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 state.isDisabled;\n },\n });\n\n // Render props values\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 // Resolve render props\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 // Clean props\n const cleanThumbProps = () => {\n const { ref: _ref, style: thumbStyle, ...rest } = 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 // Merge styles\n const mergedStyle = () => {\n const thumbStyle = (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 {...cleanFocusProps()}\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 {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('SliderThumb must be used within a Slider');\n }\n\n const { state, outputProps } = context;\n\n // Render props values\n const renderValues = createMemo<SliderOutputRenderProps>(() => ({\n value: state.value(),\n formattedValue: state.getFormattedValue(),\n }));\n\n // Resolve render props\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 // Clean props\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 } = outputProps as Record<string, unknown>;\n return rest;\n };\n\n // Default children shows formatted value\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\n// Attach sub-components\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\n// ============================================\n// TYPES\n// ============================================\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: 'top' | 'bottom' | 'left' | 'right' | null;\n}\n\nexport interface TooltipTriggerComponentProps extends StateProps, AriaProps {\n /** The children of the tooltip trigger (trigger element and tooltip). */\n children: JSX.Element;\n}\n\nexport interface TooltipProps extends SlotProps {\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?: 'top' | 'bottom' | 'left' | 'right';\n /** Whether to render the tooltip in a portal. */\n shouldFlip?: boolean;\n}\n\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface TooltipTriggerContextValue {\n state: TooltipTriggerState;\n tooltipProps: { id: string };\n triggerRef: () => HTMLElement | null | undefined;\n}\n\nconst TooltipTriggerContext = createContext<TooltipTriggerContextValue | null>(null);\nexport const TooltipContext = TooltipTriggerContext;\nexport const TooltipTriggerStateContext = createContext<TooltipTriggerState | null>(null);\n\n// ============================================\n// COMPONENTS\n// ============================================\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\n const state = createTooltipTriggerState({\n get delay() { return props.delay; },\n get closeDelay() { return props.closeDelay; },\n get isOpen() { return props.isOpen; },\n get defaultOpen() { return props.defaultOpen; },\n get onOpenChange() { return props.onOpenChange; },\n });\n\n const { triggerProps, tooltipProps } = createTooltipTrigger(\n {\n get isDisabled() { return props.isDisabled; },\n get trigger() { return props.trigger; },\n get shouldCloseOnPress() { return props.shouldCloseOnPress; },\n },\n state,\n () => triggerRef\n );\n\n const context: TooltipTriggerContextValue = {\n state,\n tooltipProps,\n triggerRef: () => triggerRef,\n };\n\n // Clone children and inject trigger props into the first child\n const processChildren = () => {\n const children = props.children;\n if (Array.isArray(children)) {\n // First child is the trigger, rest are tooltip(s)\n const [trigger, ...rest] = children;\n return (\n <>\n <TriggerWrapper\n triggerProps={triggerProps}\n ref={(el) => { triggerRef = el; }}\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 // Get the child element and clone it with trigger props\n const child = () => props.children as JSX.Element;\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 // 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 // Check children\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 visibleChild = findVisibleChild(span);\n if (visibleChild) {\n props.ref(visibleChild);\n } else {\n // Fallback to span itself\n props.ref(span);\n }\n };\n\n // Try immediately first (in case layout is already computed)\n const immediateChild = findVisibleChild(span);\n if (immediateChild) {\n props.ref(immediateChild);\n } else {\n // Defer to next frame when layout should be computed\n requestAnimationFrame(resolveRef);\n }\n };\n\n return (\n <span\n {...props.triggerProps}\n ref={handleRef}\n style={{ display: 'contents' }}\n >\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 // Support standalone usage\n const localState = createTooltipTriggerState({\n get isOpen() { return props.isOpen; },\n get defaultOpen() { return props.defaultOpen; },\n });\n\n const state = () => context?.state ?? localState;\n const placement = () => props.placement ?? 'top';\n\n const isOpen = () => 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(() => { if (!canceled) setExitState((s) => s === 'exiting' ? 'closed' : s); })\n .catch(() => { if (!canceled) setExitState((s) => s === 'exiting' ? 'closed' : s); });\n onCleanup(() => { canceled = true; });\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 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: { id?: string };\n placement: 'top' | 'bottom' | 'left' | 'right';\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 // Signal to track position styles\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\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(() => { if (!canceled) setIsEntering(false); })\n .catch(() => { if (!canceled) setIsEntering(false); });\n onCleanup(() => { canceled = true; });\n });\n\n const values = createMemo<TooltipRenderProps>(() => ({\n isEntering: isEntering(),\n isExiting: props.isExiting,\n placement: props.placement,\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 // Calculate position based on trigger element\n // Using position: fixed so we use viewport coordinates directly from getBoundingClientRect\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 offset = 8; // Gap between trigger and tooltip\n\n let top = 0;\n let left = 0;\n\n // Using viewport coordinates for position: fixed\n switch (props.placement) {\n case 'top':\n top = triggerRect.top - tooltipHeight - offset;\n left = triggerRect.left + (triggerRect.width - tooltipWidth) / 2;\n break;\n case 'bottom':\n top = triggerRect.bottom + offset;\n left = triggerRect.left + (triggerRect.width - tooltipWidth) / 2;\n break;\n case 'left':\n top = triggerRect.top + (triggerRect.height - tooltipHeight) / 2;\n left = triggerRect.left - tooltipWidth - offset;\n break;\n case 'right':\n top = triggerRect.top + (triggerRect.height - tooltipHeight) / 2;\n left = triggerRect.right + offset;\n break;\n }\n\n setPositionStyles({\n top: `${top}px`,\n left: `${left}px`,\n visibility: 'visible',\n });\n\n return true;\n };\n\n // Set up positioning effect - runs when trigger ref is available.\n // Tracks pending rAF/setTimeout IDs so they can be canceled on cleanup.\n createEffect(() => {\n const trigger = props.triggerRef();\n if (!trigger) return;\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 // Update on scroll/resize\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n\n onCleanup(() => {\n if (pendingRaf) cancelAnimationFrame(pendingRaf);\n if (pendingTimeout) clearTimeout(pendingTimeout);\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n });\n });\n\n // Filter to only valid DOM props (aria-*, data-*, events)\n const domProps = filterDOMProps(props);\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 props.onTooltipRef(el);\n };\n\n // Clean up ref on unmount\n onCleanup(() => {\n props.onTooltipRef(null);\n });\n\n return (\n <OverlayContainer>\n <div\n {...domProps}\n {...props.contextTooltipProps}\n {...cleanAriaProps}\n role=\"tooltip\"\n ref={setRef}\n class={renderProps.class()}\n style={{\n position: 'fixed',\n 'z-index': 100000,\n ...positionStyles(),\n ...renderProps.style(),\n }}\n data-placement={props.placement}\n data-entering={isEntering() || undefined}\n data-exiting={props.isExiting || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </OverlayContainer>\n );\n}\n\n// Re-export types\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 createHover,\n createInteractOutside,\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\n// ============================================\n// TYPES\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 a value is selected. */\n isSelected: boolean;\n /** The current input value. */\n inputValue: string;\n}\n\nexport interface ComboBoxProps<T>\n extends Omit<AriaComboBoxProps, 'children'>,\n SlotProps {\n /** The items to render in the combobox. */\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 /** The currently selected key (controlled). */\n selectedKey?: Key | null;\n /** The default selected key (uncontrolled). */\n defaultSelectedKey?: Key | null;\n /** Handler called when selection changes. */\n onSelectionChange?: (key: Key | null) => 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: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ComboBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ComboBoxRenderProps>;\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}\n\nexport interface ComboBoxValueProps extends SlotProps {\n children?: RenderChildren<ComboBoxValueRenderProps>;\n class?: ClassNameOrFunction<ComboBoxValueRenderProps>;\n style?: StyleOrFunction<ComboBoxValueRenderProps>;\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'>,\n 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}\n\n// ============================================\n// CONTEXT\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 listBoxRef: () => HTMLElement | null;\n setListBoxRef: (el: HTMLElement | null) => void;\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// COMPONENTS\n// ============================================\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 [local, stateProps, ariaProps] = splitProps(\n props,\n ['class', 'style', 'slot', 'children'],\n [\n 'items',\n 'getKey',\n 'getTextValue',\n 'getDisabled',\n 'disabledKeys',\n 'selectedKey',\n 'defaultSelectedKey',\n 'onSelectionChange',\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 // Refs\n let inputRef: HTMLInputElement | null = null;\n let buttonRef: HTMLElement | null = null;\n let listBoxRef: HTMLElement | null = null;\n\n // Create combobox state\n const state = createComboBoxState<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 selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\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 // Create combobox aria props\n const comboBoxAria = createComboBox<T>(\n {\n ...ariaProps,\n get name() {\n return effectiveFormValue() === 'text' ? stateProps.name : undefined;\n },\n },\n state,\n () => inputRef,\n () => buttonRef,\n () => listBoxRef\n );\n\n // Create hover for wrapper\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n });\n\n // Render props values\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 isSelected: state.selectedKey() != null,\n inputValue: state.inputValue(),\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-ComboBox',\n },\n renderValues\n );\n\n // Filter DOM props\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n // Remove ref from hover props\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <ComboBoxContext.Provider\n value={{\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,\n inputRef: () => inputRef,\n setInputRef: (el) => { inputRef = el; },\n buttonRef: () => buttonRef,\n setButtonRef: (el) => { buttonRef = el; },\n listBoxRef: () => listBoxRef,\n setListBoxRef: (el) => { listBoxRef = el; },\n }}\n >\n <ComboBoxStateContext.Provider value={state}>\n <div\n {...domProps()}\n {...cleanHoverProps()}\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-hovered={isHovered() || undefined}\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 value={state.selectedKey()?.toString() ?? ''}\n />\n </Show>\n {local.children}\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\n {...domProps}\n {...cleanLabelProps()}\n class={local.class}\n style={local.style}\n >\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\n {...domProps}\n {...cleanDescriptionProps()}\n class={local.class}\n style={local.style}\n >\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\n {...domProps}\n {...cleanErrorMessageProps()}\n class={local.class}\n style={local.style}\n >\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 // Get context\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error('ComboBoxInput must be used within a ComboBox');\n }\n const { inputProps, isOpen, isFocused, isFocusVisible, state, setInputRef } = context;\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n // Render props values\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 // Resolve render props\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 // Remove ref from spread props\n const cleanInputProps = () => {\n const { ref: _ref1, value: _value, ...rest } = 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 textValue = createMemo(() => 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 })\n );\n\n return (\n <span\n class={renderProps.class()}\n style={renderProps.style()}\n data-placeholder={isPlaceholder() || undefined}\n >\n {props.children ? renderProps.renderChildren() : 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 // Get context\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error('ComboBoxButton must be used within a ComboBox');\n }\n const { buttonProps, isOpen, isFocused, state, setButtonRef } = context;\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n // Render props values\n const renderValues = createMemo<ComboBoxButtonRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isHovered: isHovered(),\n isPressed: isOpen(),\n isDisabled: state.isDisabled,\n }));\n\n // Resolve render props\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 // Remove ref from spread props\n const cleanButtonProps = () => {\n const { ref: _ref1, ...rest } = 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-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 // Get context\n const context = useContext(ComboBoxContext);\n if (!context) {\n throw new Error('ComboBoxListBox must be used within a ComboBox');\n }\n const {\n listBoxProps: contextListBoxProps,\n state: comboBoxState,\n isOpen,\n inputRef,\n buttonRef,\n setListBoxRef,\n } = context;\n const state = comboBoxState as ComboBoxState<T>;\n\n // Ref for the listbox element (for click outside detection)\n let listBoxRef: HTMLUListElement | undefined;\n\n // Handle click outside to close combobox\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 contextListBoxProps as unknown as AriaListBoxProps,\n createComboBoxListStateAdapter(state)\n );\n\n // Render props values\n const renderValues = createMemo<ComboBoxListBoxRenderProps>(() => ({\n isFocused: state.isFocused(),\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-ComboBox-listbox',\n },\n renderValues\n );\n\n // Remove ref from spread props\n const cleanContextProps = () => {\n const { ref: _ref1, ...rest } = contextListBoxProps 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\n // Prevent focus from being lost when clicking in the listbox\n // This is critical - if we don't prevent default, the input loses focus\n // and the blur handler closes the menu before the click can be processed\n // We need to attach this in the ref callback to use capture phase\n let cleanupFocusGuard: (() => void) | undefined;\n\n const setupMouseDownHandler = (el: HTMLUListElement) => {\n cleanupFocusGuard?.();\n cleanupFocusGuard = undefined;\n\n listBoxRef = el;\n setListBoxRef(el);\n if (el) {\n const mouseHandler = (e: MouseEvent) => {\n e.preventDefault();\n };\n const pointerHandler = (e: PointerEvent) => {\n e.preventDefault();\n };\n el.addEventListener('mousedown', mouseHandler, true); // capture phase\n el.addEventListener('pointerdown', pointerHandler, true); // capture phase\n cleanupFocusGuard = () => {\n el.removeEventListener('mousedown', mouseHandler, true);\n el.removeEventListener('pointerdown', pointerHandler, true);\n };\n }\n };\n\n onCleanup(() => {\n cleanupFocusGuard?.();\n setListBoxRef(null);\n });\n\n return (\n <Show when={isOpen()}>\n <ul\n {...domProps}\n ref={setupMouseDownHandler}\n {...cleanContextProps()}\n {...cleanListBoxProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.isFocused() || undefined}\n >\n <Show when={local.children} fallback={\n <For each={items()}>\n {(node) => (\n <ComboBoxOption id={node.key}>\n {node.textValue}\n </ComboBoxOption>\n )}\n </For>\n }>\n <For each={items()}>\n {(node) => node.value != null ? (local.children as Function)!(node.value) : null}\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 ]);\n\n // Get state from context\n const context = useContext(ComboBoxStateContext);\n if (!context) {\n throw new Error('ComboBoxOption must be used within a ComboBox');\n }\n const state = context as ComboBoxState<T>;\n\n // Create option aria props using ComboBoxState's ListState-compatible interface\n const optionAria = createOption<T>(\n {\n key: local.id,\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get 'aria-label'() {\n return ariaProps['aria-label'];\n },\n },\n createComboBoxListStateAdapter(state)\n );\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return optionAria.isDisabled();\n },\n });\n\n // Render props values\n const renderValues = createMemo<ComboBoxOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: optionAria.isFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n // Resolve render props\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 // Remove ref from spread props\n const cleanOptionProps = () => {\n const { ref: _ref1, ...rest } = optionAria.optionProps 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 <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <li\n {...cleanOptionProps()}\n {...cleanHoverProps()}\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={isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </li>\n </SelectionIndicatorContext.Provider>\n );\n}\n\n// Attach sub-components\nComboBox.Input = ComboBoxInput;\nComboBox.Button = ComboBoxButton;\nComboBox.ListBox = ComboBoxListBox;\nComboBox.Option = ComboBoxOption;\nComboBox.Label = ComboBoxLabel;\nComboBox.Description = ComboBoxDescription;\nComboBox.ErrorMessage = ComboBoxErrorMessage;\n\n// Re-export filter function for convenience\nexport { defaultContainsFilter };\n\nfunction createComboBoxListStateAdapter<T>(state: ComboBoxState<T>): ListState<T> {\n const selectedKeys = createMemo(() => {\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 type AriaDialogProps,\n} from '@proyecto-viviana/solidaria'\nimport { createOverlayTriggerState } 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\n// ============================================\n// TYPES\n// ============================================\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\n// ============================================\n// CONTEXTS\n// ============================================\n\ninterface DialogContextValue {\n close: () => void\n titleId?: string\n}\n\nexport const DialogContext = createContext<DialogContextValue | null>(null)\n\n// Re-export DialogTriggerContext from shared contexts (also imported above for local use)\nexport { DialogTriggerContext, useDialogTrigger } from './contexts'\n\n// ============================================\n// DIALOG TRIGGER COMPONENT\n// ============================================\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 // Create overlay trigger state\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 // Ref for the trigger element\n let triggerRef: HTMLElement | null = null\n const triggerId = createUniqueId()\n\n // Create overlay trigger props (used via context, not directly applied)\n createOverlayTrigger(\n { type: 'dialog' },\n state,\n () => triggerRef\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,\n triggerRef: () => triggerRef,\n setTriggerRef,\n triggerId,\n }))\n\n // In SolidJS, we simply render children directly within the provider\n // The children will have access to the context\n return (\n <DialogTriggerContext.Provider value={contextValue()}>\n {props.children}\n </DialogTriggerContext.Provider>\n )\n}\n\n// ============================================\n// DIALOG COMPONENT\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\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 // Render props values\n const renderValues = createMemo<DialogRenderProps>(() => ({\n close,\n }))\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }))\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 >\n {renderProps.renderChildren()}\n </div>\n </DialogContext.Provider>\n )\n}\n\n// ============================================\n// HEADING COMPONENT\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}>{props.children}</h1>\n </Match>\n <Match when={level() === 2}>\n <h2 ref={headingRef} id={id()} class={props.class}>{props.children}</h2>\n </Match>\n <Match when={level() === 3}>\n <h3 ref={headingRef} id={id()} class={props.class}>{props.children}</h3>\n </Match>\n <Match when={level() === 4}>\n <h4 ref={headingRef} id={id()} class={props.class}>{props.children}</h4>\n </Match>\n <Match when={level() === 5}>\n <h5 ref={headingRef} id={id()} class={props.class}>{props.children}</h5>\n </Match>\n <Match when={level() === 6}>\n <h6 ref={headingRef} id={id()} class={props.class}>{props.children}</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} from './utils'\nimport {\n DialogTriggerContext,\n OverlayTriggerStateContext,\n type OverlayTriggerState,\n} from './contexts'\n\n// ============================================\n// INTERNAL CONTEXT\n// ============================================\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\n// ============================================\n// TYPES\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\n// Re-export from contexts for backwards compatibility\nexport { OverlayTriggerStateContext, type OverlayTriggerState } from './contexts'\nexport { useOverlayTriggerState } from './contexts'\nexport const ModalContext = OverlayTriggerStateContext;\n\n// ============================================\n// MODAL OVERLAY COMPONENT\n// ============================================\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 if (isServer) {\n return <>{props.children}</>\n }\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 // Create overlay trigger state for context\n const state: OverlayTriggerState = {\n get isOpen() { return isOpen() },\n open,\n close,\n toggle,\n }\n\n // Render props values\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }))\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\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={isOpen() || local.isExiting}>\n <Portal mount={portalContainer()}>\n <OverlayTriggerStateContext.Provider value={state}>\n <InternalModalContext.Provider value={internalModalContext}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-entering={dataAttr(local.isEntering)}\n data-exiting={dataAttr(local.isExiting)}\n >\n {resolveChildren()}\n </div>\n </InternalModalContext.Provider>\n </OverlayTriggerStateContext.Provider>\n </Portal>\n </Show>\n )\n}\n\n// ============================================\n// MODAL COMPONENT\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(props: ModalProps & { internalContext: InternalModalContextValue }): 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 = () => 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 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 = () => visibleModals[visibleModals.length - 1] === modalRefAccessor\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 // Set overflow hidden on html element\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 const cleanup = ariaHideOutside([modalRef])\n onCleanup(cleanup)\n })\n\n // Render props values\n const renderValues = createMemo<ModalRenderProps>(() => ({\n isEntering: local.isEntering ?? false,\n isExiting: local.isExiting ?? false,\n }))\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }))\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 {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, isServer } from 'solid-js/web'\nimport {\n createOverlayTrigger,\n createPopover,\n FocusScope,\n useUNSAFE_PortalContext,\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} from './utils'\nimport { PopoverTriggerContext } from './contexts'\n\n// ============================================\n// TYPES\n// ============================================\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 * 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 /** 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\n// ============================================\n// CONTEXTS\n// ============================================\n\n// Re-export from shared contexts\nexport { PopoverTriggerContext, usePopoverTrigger, type PopoverTriggerContextValue } from './contexts'\n\ninterface PopoverContextValue {\n placement: () => PlacementAxis | null\n arrowProps: () => JSX.HTMLAttributes<HTMLElement>\n}\n\n// Internal context for placement + arrow\nexport const PopoverContext = createContext<PopoverContextValue | null>(null)\n\n// ============================================\n// POPOVER TRIGGER COMPONENT\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 // Create overlay trigger state\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 // Ref for the trigger element\n let triggerRef: HTMLElement | null = null\n const triggerId = createUniqueId()\n\n // Create overlay trigger (for side effects like scroll close)\n createOverlayTrigger(\n { type: 'dialog' },\n state,\n () => triggerRef\n )\n\n // Context value\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 trigger: 'PopoverTrigger',\n }))\n\n return (\n <PopoverTriggerContext.Provider value={contextValue()}>\n {props.children}\n </PopoverTriggerContext.Provider>\n )\n}\n\n// ============================================\n// POPOVER COMPONENT\n// ============================================\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport function Popover(props: PopoverProps): JSX.Element {\n if (isServer) {\n // On the server, return null - popovers should not render during SSR\n return null as unknown as JSX.Element\n }\n\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 'isNonModal',\n 'isKeyboardDismissDisabled',\n 'shouldCloseOnInteractOutside',\n 'isOpen',\n 'defaultOpen',\n 'onOpenChange',\n 'isEntering',\n 'isExiting',\n ])\n\n let popoverRef!: HTMLDivElement\n\n // Get trigger context if available\n const triggerContext = useContext(PopoverTriggerContext)\n\n // Internal state for uncontrolled mode\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false)\n\n // Determine if open\n const isOpen = (): boolean => {\n if (local.isOpen !== undefined) return local.isOpen\n if (triggerContext) {\n return triggerContext.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 {\n setInternalOpen(false)\n local.onOpenChange?.(false)\n }\n }\n\n // Get trigger ref\n const getTriggerRef = () => {\n if (local.triggerRef) return local.triggerRef()\n if (triggerContext) return triggerContext.triggerRef()\n return null\n }\n\n const popoverAria = createPopover(\n {\n triggerRef: getTriggerRef,\n popoverRef: () => popoverRef ?? null,\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 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 local.trigger ?? triggerContext?.trigger\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 {\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 {\n setInternalOpen(true)\n local.onOpenChange?.(true)\n }\n },\n }\n )\n\n // Render props values\n const renderValues = createMemo<PopoverRenderProps>(() => ({\n trigger: local.trigger ?? triggerContext?.trigger ?? null,\n placement: popoverAria.placement(),\n isEntering: local.isEntering ?? false,\n isExiting: local.isExiting ?? false,\n }))\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }))\n\n // Remove style/ref from spread props to avoid collisions\n const cleanPopoverProps = () => {\n const { style: _style, ref: _ref, ...remaining } = 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 JSX.CSSProperties | undefined\n const renderStyle = renderProps.style() || {}\n return {\n ...(ariaStyle ?? {}),\n ...renderStyle,\n }\n }\n\n // Check if we should render with dialog role\n const shouldBeDialog = () => !local.isNonModal\n const portalContext = useUNSAFE_PortalContext()\n const portalContainer = () => portalContext.getContainer?.() ?? undefined\n\n // Ensure Escape handling works even when popover content has no focusable children.\n createEffect(() => {\n if (!isOpen() || !shouldBeDialog()) return\n if (!popoverRef) return\n if (document.activeElement !== popoverRef) {\n popoverRef.focus()\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 return (\n <Show when={isOpen() || local.isExiting}>\n <Portal mount={portalContainer()}>\n <PopoverContext.Provider value={{ placement: popoverAria.placement, arrowProps: () => popoverAria.arrowProps }}>\n <FocusScope contain={shouldBeDialog()} restoreFocus autoFocus>\n <div\n {...domProps()}\n {...cleanPopoverProps()}\n ref={popoverRef}\n role={shouldBeDialog() ? 'dialog' : undefined}\n tabIndex={shouldBeDialog() ? -1 : undefined}\n class={renderProps.class()}\n style={mergedStyle()}\n data-trigger={local.trigger ?? triggerContext?.trigger}\n data-placement={popoverAria.placement()}\n data-entering={dataAttr(local.isEntering)}\n data-exiting={dataAttr(local.isExiting)}\n >\n {renderProps.renderChildren()}\n </div>\n </FocusScope>\n </PopoverContext.Provider>\n </Portal>\n </Show>\n )\n}\n\n// ============================================\n// OVERLAY ARROW COMPONENT\n// ============================================\n\nexport interface OverlayArrowProps {\n /** The children - should be an SVG or element for the arrow. */\n children?: JSX.Element | ((placement: PlacementAxis | null) => 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 cleanArrowProps = () => {\n const contextArrowProps = popoverContext?.arrowProps() as Record<string, unknown> | undefined\n if (!contextArrowProps) return {}\n const { style: _style, ref: _ref, ...rest } = contextArrowProps\n return rest\n }\n\n const mergedStyle = () => {\n const contextStyle = (popoverContext?.arrowProps() as Record<string, unknown> | undefined)?.style as JSX.CSSProperties | undefined\n return {\n ...(contextStyle ?? {}),\n ...(props.style ?? {}),\n }\n }\n\n const resolveChildren = () => {\n const children = props.children\n if (typeof children === 'function') {\n return children(placement())\n }\n return children\n }\n\n return (\n <div\n {...cleanArrowProps()}\n class={props.class}\n style={mergedStyle()}\n data-placement={placement()}\n aria-hidden=\"true\"\n role=\"presentation\"\n >\n {resolveChildren()}\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 createContext,\n createMemo,\n createEffect,\n onCleanup,\n splitProps,\n Show,\n useContext,\n} from 'solid-js';\nimport { Portal, isServer } from 'solid-js/web';\nimport {\n type ToastState,\n type QueuedToast,\n type ToastQueueOptions,\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} from './utils';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface ToastContent {\n /** The title of the toast. */\n title?: string;\n /** The description/body of the toast. */\n description?: string;\n /** The type/variant of the toast (info, success, warning, error). */\n type?: 'info' | 'success' | 'warning' | 'error';\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: 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?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';\n}\n\nexport interface ToastProps {\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\n// ============================================\n// CONTEXT\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);\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// ============================================\n// GLOBAL TOAST QUEUE\n// ============================================\n\n/** Default global toast queue that can be used for app-wide toasts. */\nexport const globalToastQueue = new ToastQueue<ToastContent>({\n maxVisibleToasts: 5,\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(\n content: ToastContent,\n options?: { timeout?: number; priority?: number }\n): string {\n return globalToastQueue.add(content, options);\n}\n\n// ============================================\n// TOAST PROVIDER\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 (\n <ToastContext.Provider value={state}>\n {props.children}\n </ToastContext.Provider>\n );\n}\n\n// ============================================\n// TOAST REGION COMPONENT\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 if (isServer) {\n return null as unknown as JSX.Element;\n }\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\n // Get state from context if not provided\n const contextState = useContext(ToastContext);\n const state = () => local.state ?? contextState;\n\n // Create region accessibility props\n const getRegionAria = () => {\n const s = state();\n if (!s) return null;\n return createToastRegion({\n state: s,\n 'aria-label': local['aria-label'],\n });\n };\n\n // Render props values\n const renderValues = createMemo<ToastRegionRenderProps>(() => ({\n visibleToasts: state()?.visibleToasts() ?? [],\n }));\n\n // Resolve render props\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\n // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n // Placement styles\n const placementStyles = createMemo<JSX.CSSProperties>(() => {\n const placement = local.placement ?? 'bottom-end';\n const base: JSX.CSSProperties = {\n position: 'fixed',\n 'z-index': 100001,\n display: 'flex',\n 'flex-direction': 'column',\n gap: '8px',\n padding: '16px',\n 'pointer-events': 'none',\n };\n\n switch (placement) {\n case 'top':\n return { ...base, top: 0, left: '50%', transform: 'translateX(-50%)' } as JSX.CSSProperties;\n case 'top-start':\n return { ...base, top: 0, left: 0 } as JSX.CSSProperties;\n case 'top-end':\n return { ...base, top: 0, right: 0 } as JSX.CSSProperties;\n case 'bottom':\n return { ...base, bottom: 0, left: '50%', transform: 'translateX(-50%)' } as JSX.CSSProperties;\n case 'bottom-start':\n return { ...base, bottom: 0, left: 0 } as JSX.CSSProperties;\n case 'bottom-end':\n default:\n return { ...base, bottom: 0, right: 0 } as JSX.CSSProperties;\n }\n });\n\n const visibleToasts = () => state()?.visibleToasts() ?? [];\n const hasToasts = () => visibleToasts().length > 0;\n\n const regionContent = () => {\n const regionAria = getRegionAria();\n if (!regionAria || !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 // Extract ref from regionProps to avoid type conflicts\n const { ref: _ref, ...cleanRegionProps } = regionAria.regionProps as Record<string, unknown>;\n\n return (\n <div\n {...domProps()}\n {...cleanRegionProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-placement={local.placement ?? 'bottom-end'}\n >\n {renderProps.renderChildren()}\n </div>\n );\n };\n\n // Only render when there are toasts\n return (\n <Show when={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 COMPONENT\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, [\n 'toast',\n 'children',\n 'class',\n 'style',\n ]);\n\n let toastRef!: HTMLDivElement;\n\n // Get state from context\n const state = useToastContext();\n\n // Create toast accessibility props\n const toastAria = createToast({\n toast: local.toast,\n state,\n hasTitle: !!local.toast.content.title,\n hasDescription: !!local.toast.content.description,\n });\n\n // Render props values\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 // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n // Merge styles\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 // 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 // Extract ref from toastProps to avoid type conflicts\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 string | 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 value={{ titleProps: toastAria.titleProps, descriptionProps: toastAria.descriptionProps }}>\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}\n >\n {renderProps.renderChildren()}\n </div>\n </ToastAriaContext.Provider>\n );\n}\n\n// ============================================\n// TOAST SUB-COMPONENTS\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<string, unknown>;\n\n return (\n <div data-solidaria-toast-description=\"\" {...ariaDescriptionProps} class={props.class} style={props.style}>\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 state = useToastContext();\n\n const handleClose = () => {\n state.close(props.toast.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 onClick={handleClose}\n >\n {props.children ?? '×'}\n </button>\n );\n}\n\n// ============================================\n// DEFAULT TOAST RENDERING\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\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={content().title}>\n <ToastTitle style={{ 'font-weight': 'bold', 'margin-bottom': '4px' }}>\n {content().title}\n </ToastTitle>\n </Show>\n <Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>\n <Show when={content().action}>\n <button\n type=\"button\"\n style={{ 'margin-top': '8px' }}\n onClick={content().action?.onAction}\n >\n {content().action?.label}\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} from '@proyecto-viviana/solidaria';\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n} from './utils';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface DisclosureRenderProps {\n /** Whether the disclosure is expanded. */\n isExpanded: boolean;\n /** Whether the disclosure is disabled. */\n isDisabled: boolean;\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}\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}\n\nexport interface DisclosureTriggerProps {\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}\n\nexport interface DisclosurePanelProps {\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}\n\n// ============================================\n// CONTEXT\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 };\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// DISCLOSURE GROUP (Accordion)\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 ]);\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(\n () => ({ isDisabled: local.isDisabled }),\n state\n );\n\n // Render props values\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n // Context value\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 {...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\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 ]);\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\n // Render props values\n const renderValues = createMemo<DisclosureRenderProps>(() => ({\n isExpanded: state.isExpanded(),\n isDisabled: 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-Disclosure',\n },\n renderValues\n );\n\n // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\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 // Setter for panel ref\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 {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-expanded={dataAttr(state.isExpanded())}\n data-disabled={dataAttr(isDisabled())}\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// DISCLOSURE TRIGGER\n// ============================================\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\n return (\n <button\n {...getButtonProps()}\n type=\"button\"\n class={props.class}\n style={props.style}\n data-expanded={dataAttr(isExpanded())}\n data-disabled={dataAttr(isDisabled())}\n >\n {props.children}\n </button>\n );\n}\n\n// ============================================\n// DISCLOSURE PANEL\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 const panelRefSetter = useContext(DisclosurePanelRefContext);\n\n const [local, rest] = splitProps(props, ['class', 'style']);\n\n // Reactive accessors\n const isExpanded = () => context?.state.isExpanded() ?? false;\n const isDisabled = () => context?.isDisabled() ?? false;\n\n // Render props values\n const renderValues = createMemo<DisclosureRenderProps>(() => ({\n isExpanded: isExpanded(),\n isDisabled: isDisabled(),\n }));\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\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 if (!context) return { id: undefined, role: 'region', 'aria-labelledby': undefined, hidden: true };\n const { ref: _ref, ...rest } = context.disclosureAria.panelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps()}\n {...getPanelProps()}\n ref={(el) => panelRefSetter?.(el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-expanded={dataAttr(isExpanded())}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n// Re-export state types for convenience\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 {\n type JSX,\n createContext,\n createMemo,\n splitProps,\n} from 'solid-js';\nimport {\n createMeter,\n type AriaMeterProps,\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\n// ============================================\n// TYPES\n// ============================================\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\n extends AriaMeterProps,\n 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\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const MeterContext = createContext<MeterProps | null>(null);\n\n// ============================================\n// UTILITIES\n// ============================================\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// METER COMPONENT\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, [\n 'children',\n 'class',\n 'style',\n 'slot',\n ]);\n\n // Get values for calculations\n const value = () => ariaProps.value ?? 0;\n const minValue = () => ariaProps.minValue ?? 0;\n const maxValue = () => ariaProps.maxValue ?? 100;\n\n // Create meter aria props\n const meterAria = createMeter({\n get value() { return ariaProps.value; },\n get minValue() { return ariaProps.minValue; },\n get maxValue() { return ariaProps.maxValue; },\n get valueLabel() { return ariaProps.valueLabel; },\n get formatOptions() { return ariaProps.formatOptions; },\n get label() { return ariaProps.label; },\n get 'aria-label'() { return ariaProps['aria-label']; },\n get 'aria-labelledby'() { return ariaProps['aria-labelledby']; },\n get 'aria-describedby'() { return ariaProps['aria-describedby']; },\n get 'aria-details'() { return ariaProps['aria-details']; },\n });\n\n // Calculate percentage\n const percentage = createMemo(() => {\n const clampedValue = clamp(value(), minValue(), maxValue());\n return ((clampedValue - minValue()) / getSafeRange(minValue(), maxValue())) * 100;\n });\n\n // Get value text from aria props\n const valueText = createMemo(() => {\n return meterAria.meterProps['aria-valuetext'] as string | undefined;\n });\n\n // Render props values\n const renderValues = createMemo<MeterRenderProps>(() => ({\n percentage: percentage(),\n valueText: valueText(),\n }));\n\n // Resolve render props\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 // Filter DOM props\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 {\n createTagGroup,\n createTag,\n type AriaTagGroupProps,\n} 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\n// ============================================\n// TYPES\n// ============================================\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 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> extends SlotProps, 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}\n\n// ============================================\n// CONTEXT\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// TAG GROUP COMPONENT\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, [\n 'class',\n 'style',\n 'slot',\n 'children',\n ]);\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// TAG LIST COMPONENT\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 // Create list state\n const state = createListState({\n get items() { return local.items; },\n getKey,\n get selectionMode() { return local.selectionMode ?? 'none'; },\n get selectionBehavior() { return local.selectionBehavior ?? 'toggle'; },\n get selectedKeys() { return local.selectedKeys; },\n get defaultSelectedKeys() { return local.defaultSelectedKeys; },\n get onSelectionChange() { return local.onSelectionChange; },\n get disabledKeys() { return local.disabledKeys; },\n });\n\n // Create tag group accessibility props\n const tagGroupAria = createTagGroup(\n {\n get 'aria-label'() { return local['aria-label'] ?? (!local['aria-labelledby'] ? local.label : undefined); },\n get 'aria-labelledby'() { return local['aria-labelledby']; },\n get 'aria-describedby'() { return local['aria-describedby']; },\n get isDisabled() { return local.isDisabled; },\n get onRemove() { return local.onRemove; },\n },\n state,\n gridRef\n );\n\n // Track focus\n const [isFocused, setIsFocused] = createSignal(false);\n\n // Render props values\n const renderValues = createMemo<TagListRenderProps>(() => ({\n isEmpty: local.items.length === 0,\n isFocused: isFocused(),\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-TagList',\n },\n renderValues\n );\n\n // Context value\n const contextValue: TagGroupContextValue = {\n state,\n get onRemove() { return local.onRemove; },\n get isDisabled() { return local.isDisabled; },\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\n when={local.items.length > 0}\n fallback={local.renderEmptyState?.()}\n >\n <For each={local.items}>\n {(item) => props.children(item)}\n </For>\n </Show>\n </SharedElementTransition>\n </div>\n </TagListStateContext.Provider>\n </TagGroupContext.Provider>\n );\n}\n\n// ============================================\n// TAG COMPONENT\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 ]);\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() { return local.id; },\n get isDisabled() { return local.isDisabled || groupContext?.isDisabled; },\n get textValue() { return local.textValue; },\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 // Render props values\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 // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest, { global: true }));\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <TagContext.Provider\n value={{\n get removeButtonProps() { return normalizedRemoveButtonProps(); },\n get allowsRemoving() { return tagAria.allowsRemoving; },\n }}\n >\n <div\n ref={setTagRef}\n {...domProps()}\n {...tagAria.rowProps}\n class={renderProps.class()}\n style={renderProps.style()}\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\n// ============================================\n// TAG REMOVE BUTTON COMPONENT\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 = 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\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 onClick={handleClick}\n >\n {props.children ?? '×'}\n </button>\n );\n}\n\n// Re-export types\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 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 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';\n\n// ============================================\n// TYPES\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}\n\nexport interface CalendarProps<T extends DateValue = DateValue>\n extends 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}\n\nexport interface CalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface CalendarGridProps 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 /** 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 is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: 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 /** 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}\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\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const CalendarContext = createContext<CalendarState<DateValue> | null>(null);\nconst CalendarGridMonthContext = createContext<CalendarDate | 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// CALENDAR COMPONENT\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>(\n props: CalendarProps<T>\n): 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={<div class=\"solidaria-Calendar solidaria-Calendar--placeholder\" aria-hidden=\"true\" />}\n >\n <Show\n when={inheritedState}\n fallback={<CalendarInner {...props} />}\n >\n <CalendarWithState\n state={inheritedState as CalendarState<DateValue>}\n {...props}\n />\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'],\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 'isDateUnavailable',\n 'visibleMonths',\n 'isDateDisabled',\n 'validationState',\n 'errorMessage',\n 'firstDayOfWeek',\n ]\n );\n\n const state = () => props.state;\n const calendarAria = createCalendar(rest, state());\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\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 class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n >\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>(\n props: CalendarProps<T>\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n ['children', 'class', 'style', 'slot'],\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 'isDateUnavailable',\n 'visibleMonths',\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(rest, state as unknown as CalendarState<DateValue>);\n\n // Render props values\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n }));\n\n // Resolve render props\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 class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n >\n {props.children}\n </div>\n </CalendarContext.Provider>\n );\n}\n\n// ============================================\n// CALENDAR HEADING COMPONENT\n// ============================================\n\nexport interface CalendarHeadingProps 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 calendar.\n */\nexport function CalendarHeading(props: CalendarHeadingProps): JSX.Element {\n const state = useCalendarContext();\n\n return (\n <h2\n class={props.class ?? 'solidaria-CalendarHeading'}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\n// ============================================\n// CALENDAR BUTTON COMPONENT\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// CALENDAR GRID COMPONENT\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 // Create grid ARIA props\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state,\n gridRef\n );\n\n // Render props values\n const renderValues = createMemo<CalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n // Resolve render props\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=\"solidaria-CalendarHeaderCell\">\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates) => (\n <tr>\n <Index each={weekDates()}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {props.children?.(date()!)}\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\n scope=\"col\"\n class={props.class ?? 'solidaria-CalendarHeaderCell'}\n style={props.style}\n >\n {props.children}\n </th>\n );\n}\n\n// ============================================\n// CALENDAR CELL COMPONENT\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 [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(() => currentMonthStart != null && !isSameMonth(currentMonthStart, props.date));\n\n // Create cell ARIA props\n const cellAria = createCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef\n );\n\n // Render props values\n const renderValues = createMemo<CalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isFocused: cellAria.isFocused,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n formattedDate: cellAria.formattedDate,\n }));\n\n // Resolve render props\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\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}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\n// Re-export types\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 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 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';\n\n// ============================================\n// TYPES\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 user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends 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}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps 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 /** 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 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 /** 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}\n\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<CalendarDate | 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// RANGE CALENDAR COMPONENT\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={<div class=\"solidaria-RangeCalendar solidaria-RangeCalendar--placeholder\" aria-hidden=\"true\" />}\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'],\n [\n 'value',\n 'defaultValue',\n 'onChange',\n 'minValue',\n 'maxValue',\n 'isDisabled',\n 'isReadOnly',\n 'focusedValue',\n 'defaultFocusedValue',\n 'onFocusChange',\n 'locale',\n 'isDateUnavailable',\n 'visibleMonths',\n 'isDateDisabled',\n 'validationState',\n 'allowsNonContiguousRanges',\n 'firstDayOfWeek',\n ]\n );\n\n // Create range calendar state\n const state = createRangeCalendarState(stateProps);\n\n // Create range calendar ARIA props\n const calendarAria = createRangeCalendar(rest, state as unknown as RangeCalendarState<DateValue>);\n\n // Render props values\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isDragging: state.isDragging(),\n }));\n\n // Resolve render props\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 class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-dragging={dataAttr(state.isDragging())}\n >\n {props.children}\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\n// ============================================\n// RANGE CALENDAR HEADING COMPONENT\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\n// ============================================\n// RANGE CALENDAR BUTTON COMPONENT\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\n return (\n <button\n {...buttonProps()}\n class={props.class ?? 'solidaria-RangeCalendarButton'}\n style={props.style}\n disabled={props.isDisabled || state.isDisabled()}\n >\n {props.children}\n </button>\n );\n}\n\n// ============================================\n// RANGE CALENDAR GRID COMPONENT\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 // Create grid ARIA props\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 // Render props values\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n // Resolve render props\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 scope=\"col\" class=\"solidaria-RangeCalendarHeaderCell\">\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates) => (\n <tr>\n <Index each={weekDates()}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {props.children?.(date()!)}\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext.Provider>\n );\n}\n\n// ============================================\n// RANGE CALENDAR CELL COMPONENT\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 [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart, props.date)\n );\n\n // Create cell ARIA props\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef\n );\n\n // Render props values\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 isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n formattedDate: cellAria.formattedDate,\n }));\n\n // Resolve render props\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\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}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\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-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\n// Re-export types\nexport type { RangeCalendarState, RangeValue };\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 createMemo,\n createSignal,\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 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';\n\n// ============================================\n// TYPES\n// ============================================\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 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}\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\n// ============================================\n// CONTEXT\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\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\n// ============================================\n// DATE FIELD COMPONENT\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\n return (\n <Show\n when={isHydrated()}\n fallback={<div class=\"solidaria-DateField solidaria-DateField--placeholder\" aria-hidden=\"true\" />}\n >\n <DateFieldInner {...props} />\n </Show>\n );\n}\n\n/**\n * Internal DateField component that renders after client mount.\n */\nfunction DateFieldInner<T extends DateValue = CalendarDate>(\n props: DateFieldProps<T>\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n ['children', 'class', 'style', 'slot'],\n [\n 'value',\n 'defaultValue',\n 'onChange',\n 'minValue',\n 'maxValue',\n 'isDisabled',\n 'isReadOnly',\n 'isRequired',\n 'locale',\n 'granularity',\n 'hourCycle',\n 'hideTimeZone',\n 'placeholderValue',\n 'validationState',\n 'description',\n 'errorMessage',\n ]\n );\n\n const [fieldRef, setFieldRef] = createSignal<HTMLDivElement | null>(null);\n\n // Create date field state\n const state = createDateFieldState(stateProps);\n\n // Create date field ARIA props\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 // Render props values\n const renderValues = createMemo<DateFieldRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isRequired: state.isRequired(),\n isInvalid: state.isInvalid(),\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-DateField',\n },\n renderValues\n );\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 {props.children as JSX.Element}\n </div>\n </DateFieldContext.Provider>\n </DateFieldStateContext.Provider>\n );\n}\n\n// ============================================\n// DATE INPUT COMPONENT\n// ============================================\n\n/**\n * The input area containing date segments.\n */\nexport function DateInput(props: DateInputProps): JSX.Element {\n const context = useDateFieldContext();\n const { state, aria } = context;\n const [isFocused, setIsFocused] = createSignal(false);\n\n // Render props values\n const renderValues = createMemo<DateInputRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isFocused: isFocused(),\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: 'solidaria-DateInput',\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()}>\n {(segment) => props.children?.(segment)}\n </For>\n </div>\n );\n}\n\n// ============================================\n// DATE SEGMENT COMPONENT\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<HTMLDivElement | null>(null);\n\n // Create segment ARIA props\n const segmentAria = createDateSegment(\n { segment: props.segment },\n state,\n segmentRef\n );\n\n // Render props values\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 // Resolve render props\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 <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 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\n// Re-export types\nexport type { DateFieldState, DateSegmentType };\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 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';\n\n// ============================================\n// TYPES\n// ============================================\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 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\n// ============================================\n// CONTEXT\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 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// TIME FIELD COMPONENT\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>(\n props: TimeFieldProps<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={<div class=\"solidaria-TimeField solidaria-TimeField--placeholder\" aria-hidden=\"true\" />}\n >\n <TimeFieldInner {...props} />\n </Show>\n );\n}\n\n/**\n * Internal TimeField component that renders after client mount.\n */\nfunction TimeFieldInner<T extends TimeValue = TimeValue>(\n props: TimeFieldProps<T>\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n ['children', 'class', 'style', 'slot'],\n [\n 'value',\n 'defaultValue',\n 'onChange',\n 'minValue',\n 'maxValue',\n 'isDisabled',\n 'isReadOnly',\n 'isRequired',\n 'locale',\n 'granularity',\n 'hourCycle',\n 'validationState',\n 'placeholderValue',\n ]\n );\n\n const [fieldRef, setFieldRef] = createSignal<HTMLDivElement | null>(null);\n\n // Create time field state\n const state = createTimeFieldState(stateProps);\n\n // Create time field ARIA props\n const fieldAria = createTimeField(rest, state as unknown as TimeFieldState<TimeValue>, fieldRef);\n\n // Render props values\n const renderValues = createMemo<TimeFieldRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isRequired: state.isRequired(),\n isInvalid: state.isInvalid(),\n }));\n\n // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-TimeField',\n },\n renderValues\n );\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 {props.children as JSX.Element}\n </div>\n </TimeFieldContext.Provider>\n </TimeFieldStateContext.Provider>\n );\n}\n\n// ============================================\n// TIME INPUT COMPONENT\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 // Render props values\n const renderValues = createMemo<TimeInputRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isFocused: isFocused(),\n }));\n\n // Resolve render props\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()}>\n {(segment) => props.children?.(segment)}\n </For>\n </div>\n );\n}\n\n// ============================================\n// TIME SEGMENT COMPONENT\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 // Render props values\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 // Resolve render props\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\n// ============================================\n// LABEL / DESCRIPTION / ERROR\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\n// Re-export types\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 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 type DateFieldState,\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';\n\n// ============================================\n// TYPES\n// ============================================\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\n extends Omit<DatePickerRenderProps, 'isInvalid'> {\n isInvalid: boolean;\n}\n\nexport interface DatePickerContextValue {\n fieldState: DateFieldState<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 interface DateRangePickerContextValue {\n calendarState: RangeCalendarState<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 createDateRangePicker>;\n}\n\nexport interface DatePickerProps<T extends DateValue = DateValue>\n extends Omit<AriaDatePickerProps, 'id' | 'isDisabled' | 'isReadOnly' | 'isRequired'>,\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}\n\nexport interface DateRangePickerProps<T extends DateValue = DateValue>\n extends 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}\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\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const DatePickerContext = createContext<DatePickerContextValue | null>(null);\nexport const DateRangePickerContext = createContext<DateRangePickerContextValue | null>(null);\nexport const DatePickerStateContext = createContext<DateFieldState<DateValue> | null>(null);\nexport const DateRangePickerStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\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\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// ============================================\n// DATE PICKER COMPONENT\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\n return (\n <Show\n when={isHydrated()}\n fallback={<div class=\"solidaria-DatePicker solidaria-DatePicker--placeholder\" aria-hidden=\"true\" />}\n >\n <DatePickerInner {...props} />\n </Show>\n );\n}\n\n/**\n * Internal DatePicker component that renders after client mount.\n */\nfunction DatePickerInner<T extends DateValue = CalendarDate>(\n props: DatePickerProps<T>\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n ['children', 'class', 'style', 'slot', 'shouldCloseOnSelect'],\n [\n 'value',\n 'defaultValue',\n 'onChange',\n 'minValue',\n 'maxValue',\n 'isDisabled',\n 'isReadOnly',\n 'isRequired',\n 'locale',\n 'granularity',\n 'hourCycle',\n 'hideTimeZone',\n 'placeholderValue',\n 'validationState',\n 'description',\n 'errorMessage',\n ]\n );\n\n // Create overlay trigger state\n const [isOpen, setIsOpen] = createSignal(false);\n let triggerRef: HTMLElement | null = null;\n\n const overlayState = {\n get isOpen() { return isOpen(); },\n open: () => setIsOpen(true),\n close: () => setIsOpen(false),\n toggle: () => setIsOpen((prev) => !prev),\n };\n\n // Create date field state\n const fieldState = createDateFieldState({\n ...stateProps,\n onChange: (value) => {\n stateProps.onChange?.(value);\n if (local.shouldCloseOnSelect !== false && value) {\n overlayState.close();\n }\n },\n });\n\n // Create calendar state that syncs with field\n const calendarState = createCalendarState({\n value: () => fieldState.value(),\n onChange: (value) => {\n fieldState.setValue(value as T | null);\n if (local.shouldCloseOnSelect !== false) {\n overlayState.close();\n }\n },\n minValue: stateProps.minValue,\n maxValue: stateProps.maxValue,\n isDisabled: stateProps.isDisabled,\n isReadOnly: stateProps.isReadOnly,\n locale: stateProps.locale,\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 // Context value\n const contextValue: DatePickerContextValue = {\n fieldState: fieldState as unknown as DateFieldState<DateValue>,\n calendarState: calendarState as unknown as CalendarState<DateValue>,\n overlayState,\n triggerRef: () => triggerRef,\n setTriggerRef: (element) => {\n if (!element) return;\n if (!triggerRef || !triggerRef.isConnected) {\n triggerRef = element;\n }\n },\n pickerAria,\n };\n\n // Render props values\n const isInvalid = createMemo(\n () => fieldState.isInvalid() || Boolean((rest as { isInvalid?: boolean }).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 // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-DatePicker',\n },\n renderValues\n );\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 {...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 </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={<div class=\"solidaria-DateRangePicker solidaria-DateRangePicker--placeholder\" aria-hidden=\"true\" />}\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, stateProps, rest] = splitProps(\n props,\n ['children', 'class', 'style', 'slot', 'shouldCloseOnSelect'],\n [\n 'value',\n 'defaultValue',\n 'onChange',\n 'minValue',\n 'maxValue',\n 'isDisabled',\n 'isReadOnly',\n 'focusedValue',\n 'defaultFocusedValue',\n 'onFocusChange',\n 'locale',\n 'isDateUnavailable',\n 'visibleMonths',\n 'isDateDisabled',\n 'validationState',\n 'allowsNonContiguousRanges',\n 'firstDayOfWeek',\n ]\n );\n\n const [isOpen, setIsOpen] = createSignal(false);\n let triggerRef: HTMLElement | null = null;\n const overlayState = {\n get isOpen() { return isOpen(); },\n open: () => setIsOpen(true),\n close: () => setIsOpen(false),\n toggle: () => setIsOpen((prev) => !prev),\n };\n\n const calendarState = createRangeCalendarState({\n ...stateProps,\n onChange: (value) => {\n stateProps.onChange?.(value);\n if (local.shouldCloseOnSelect !== false && value?.start && value?.end) {\n overlayState.close();\n }\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 isInvalid = createMemo(\n () => Boolean((rest as { isInvalid?: boolean }).isInvalid) || calendarState.validationState() === 'invalid'\n );\n const isRequired = createMemo(\n () => Boolean((rest as { isRequired?: boolean }).isRequired)\n );\n\n const contextValue: DateRangePickerContextValue = {\n calendarState: calendarState as unknown as RangeCalendarState<DateValue>,\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 value={calendarState as unknown as RangeCalendarState<DateValue>}>\n <DateRangePickerContext.Provider value={contextValue}>\n <RangeCalendarContext.Provider value={calendarState as unknown as RangeCalendarState<DateValue>}>\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 </RangeCalendarContext.Provider>\n </DateRangePickerContext.Provider>\n </DateRangePickerStateContext.Provider>\n );\n}\n\n// ============================================\n// DATE PICKER BUTTON COMPONENT\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 let buttonRef: HTMLButtonElement | undefined;\n\n // Render props values\n const renderValues = createMemo<DatePickerButtonRenderProps>(() => ({\n isDisabled: context.fieldState.isDisabled() || (props.isDisabled ?? false),\n isOpen: context.overlayState.isOpen,\n }));\n\n // Resolve render props\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 buttonRef = 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\n// ============================================\n// DATE PICKER CONTENT COMPONENT\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\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,\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 const cleanPopoverProps = () => {\n const { style: _style, ref: _ref, ...rest } = 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 JSX.CSSProperties | undefined;\n return {\n ...(popoverStyle ?? {}),\n ...(props.style ?? {}),\n };\n };\n\n createEffect(() => {\n if (!context.overlayState.isOpen || !contentRef) return;\n if (document.activeElement !== contentRef) {\n contentRef.focus();\n }\n });\n\n return (\n <Show when={context.overlayState.isOpen}>\n <Portal mount={portalContainer()}>\n <FocusScope contain restoreFocus autoFocus>\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 onKeyDown={(event) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n context.overlayState.close();\n }\n }}\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,\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 const cleanPopoverProps = () => {\n const { style: _style, ref: _ref, ...rest } = 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 JSX.CSSProperties | undefined;\n return {\n ...(popoverStyle ?? {}),\n ...(props.style ?? {}),\n };\n };\n\n createEffect(() => {\n if (!context.overlayState.isOpen || !contentRef) return;\n if (document.activeElement !== contentRef) {\n contentRef.focus();\n }\n });\n\n return (\n <Show when={context.overlayState.isOpen}>\n <Portal mount={portalContainer()}>\n <FocusScope contain restoreFocus autoFocus>\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 onKeyDown={(event) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n context.overlayState.close();\n }\n }}\n >\n {props.children}\n </div>\n </FocusScope>\n </Portal>\n </Show>\n );\n}\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 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 createHover,\n mergeProps,\n type AriaTableProps,\n} from '@proyecto-viviana/solidaria';\nimport {\n createTableState,\n createTableCollection,\n type TableState,\n type TableCollection,\n type Key,\n type SortDescriptor,\n type ColumnDefinition,\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 useRenderProps,\n filterDOMProps,\n} from './utils';\nimport { SharedElementTransition } from './SharedElementTransition';\nimport { type DragAndDropHooks } from './useDragAndDrop';\nimport { CollectionRendererContext, type CollectionRendererContextValue, useCollectionRenderer } from './Collection';\nimport { useVirtualizerContext } from './Virtualizer';\nimport {\n getNormalizedDropTargetKey,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n} from './DragAndDrop';\n\n// ============================================\n// TYPES\n// ============================================\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\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: ColumnDefinition<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: ColumnDefinition<T>) => string;\n /** The selection mode. */\n selectionMode?: 'none' | 'single' | 'multiple';\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 /** 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}\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}\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}\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 /** 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}\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}\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 /** The children of the row (usually TableCell components). */\n children?: JSX.Element | RenderChildren<TableRowRenderProps>;\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}\n\nexport interface TableCellRenderProps {\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell has keyboard focus. */\n isFocusVisible: boolean;\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 /** 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}\n\nexport interface TableLoadMoreItemProps extends SlotProps {\n onLoadMore: () => void | Promise<void>;\n isLoading?: boolean;\n colSpan?: number;\n children?: JSX.Element;\n class?: ClassNameOrFunction<{ isLoading: boolean }>;\n style?: StyleOrFunction<{ isLoading: boolean }>;\n}\n\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface TableContextValue<T extends object> {\n state: TableState<T, TableCollection<T>>;\n collection: TableCollection<T>;\n items: T[];\n columns: ColumnDefinition<T>[];\n isDisabled: boolean;\n showSelectionCheckboxes: boolean;\n dragAndDropHooks?: DragAndDropHooks<T>;\n dragState?: unknown;\n dropState?: unknown;\n}\n\nexport const TableContext = createContext<TableContextValue<object> | null>(null);\nexport const TableStateContext = createContext<TableState<object, TableCollection<object>> | null>(null);\nexport const TableColumnResizeStateContext = createContext<null>(null);\n\n// Row-level context for cells\ninterface TableRowContextValue {\n rowKey: Key;\n rowNode: GridNode<unknown>;\n}\n\nexport const TableRowContext = createContext<TableRowContextValue | null>(null);\n\n// ============================================\n// COMPONENTS\n// ============================================\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', 'slot', 'renderEmptyState', 'dragAndDropHooks'],\n [\n 'items',\n 'columns',\n 'getKey',\n 'getTextValue',\n 'disabledKeys',\n 'selectionMode',\n 'selectedKeys',\n 'defaultSelectedKeys',\n 'onSelectionChange',\n 'sortDescriptor',\n 'onSortChange',\n 'showSelectionCheckboxes',\n ]\n );\n\n // Create ref signal\n const [ref, setRef] = createSignal<HTMLTableElement | null>(null);\n\n // Create collection\n const collection = createMemo(() =>\n createTableCollection<T>({\n columns: stateProps.columns,\n rows: stateProps.items,\n getKey: stateProps.getKey,\n getTextValue: stateProps.getTextValue,\n showSelectionCheckboxes: stateProps.showSelectionCheckboxes ?? false,\n })\n );\n\n // Create table state\n const state = createTableState<T, TableCollection<T>>(() => ({\n collection: collection(),\n disabledKeys: stateProps.disabledKeys,\n selectionMode: stateProps.selectionMode,\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\n // Create table aria props\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,\n onRowAction: ariaProps.onRowAction,\n onCellAction: ariaProps.onCellAction,\n focusMode: ariaProps.focusMode,\n }),\n () => state,\n ref\n );\n\n // Create focus ring\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n // Render props values\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 // Filter DOM props\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n // Remove ref from spread props\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 parentCollectionRenderer = useCollectionRenderer<T>();\n const getItemNodes = createMemo(() => Array.from(state.collection).filter((node) => node.type === 'item'));\n const getDropTargetByIndex = (index: number, position: 'before' | 'after' | 'on'): 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 || parentCollectionRenderer?.dropTargetDelegate || 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 = 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(() => useRenderDropIndicator(local.dragAndDropHooks, dropState()));\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 = createMemo<TableContextValue<T>>(() => ({\n state,\n collection: collection(),\n items: stateProps.items,\n columns: stateProps.columns,\n isDisabled: false,\n showSelectionCheckboxes: stateProps.showSelectionCheckboxes ?? false,\n dragAndDropHooks: local.dragAndDropHooks,\n dragState: dragState(),\n dropState: dropState(),\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) ?? parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n\n return (\n <TableContext.Provider value={contextValue() as unknown as TableContextValue<object>}>\n <TableStateContext.Provider value={state as unknown as TableState<object, TableCollection<object>>}>\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <table\n ref={setRef}\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 >\n {typeof props.children === 'function'\n ? props.children(renderValues())\n : props.children}\n </table>\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, ['class', 'style', 'slot', 'children']);\n\n // Get context\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 // Render props values\n const renderValues = createMemo<TableHeaderRenderProps>(() => ({\n isFocused: false,\n }));\n\n // Resolve render props\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\n return (\n <thead {...domProps} {...cleanRowGroupProps()} class={renderProps.class()} style={renderProps.style()}>\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, ['class', 'style', 'slot', 'id', 'allowsSorting', 'children']);\n\n // Get context\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 // Create ref signal\n const [ref, setRef] = createSignal<HTMLTableCellElement | null>(null);\n\n // Find the column node\n const columnNode = createMemo(() => {\n const node = collection.getItem(local.id);\n if (!node) {\n // Create a simple node for the column\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 // Create column header aria props\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 // Create hover\n const { isHovered, hoverProps } = createHover({\n isDisabled: false,\n });\n\n // Create focus ring\n const { isFocusVisible, focusProps } = createFocusRing();\n\n // Get sort direction\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 // Render props values\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 }));\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 // Remove ref from spread props\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 return (\n <th\n ref={setRef}\n {...domProps}\n {...cleanColumnHeaderProps()}\n {...cleanHoverProps()}\n {...cleanFocusProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-sortable={local.allowsSorting || undefined}\n data-sort-direction={sortDirection() || 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 {typeof local.children === 'function'\n ? local.children(renderValues())\n : local.children}\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, ['items', 'class', 'style', 'slot', 'renderEmptyState', 'hasMore', 'isLoading', 'onLoadMore', 'children']);\n\n // Get context\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 // Use provided items or context items\n const items = createMemo(() => (local.items ?? context.items) as T[]);\n\n // Render props values\n const renderValues = createMemo<TableBodyRenderProps>(() => ({\n isEmpty: items().length === 0,\n }));\n\n // Resolve render props\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(() => Array.from(context.collection).filter((node) => node.type === 'item'));\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 = focusedKey != null ? rowNodes().findIndex((node) => node.key === focusedKey) : -1;\n const forceIncludeIndexes = [\n dropTarget?.type === 'item' ? rowNodes().findIndex((node) => node.key === dropTarget.key) : -1,\n normalizedDropKey != null ? rowNodes().findIndex((node) => node.key === normalizedDropKey) : -1,\n dropTarget?.type === 'item' ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(baseRange, persistedIndexes, rowCount, virtualizer, 80, {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\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 return (\n <tbody {...domProps} {...cleanRowGroupProps()} class={renderProps.class()} style={renderProps.style()}>\n <SharedElementTransition>\n <Show when={isEmpty() && local.renderEmptyState} fallback={\n <>\n {virtualRange()?.offsetTop\n ? (\n <tr role=\"presentation\" aria-hidden=\"true\" data-virtualizer-spacer=\"top\">\n <td colSpan={spacerColSpan()} style={{ height: `${virtualRange()!.offsetTop}px`, padding: '0', border: '0' }} />\n </tr>\n )\n : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () => parentCollectionRenderer?.renderDropIndicator?.(itemIndex(), 'before');\n const onIndicator = () => parentCollectionRenderer?.renderDropIndicator?.(itemIndex(), 'on');\n const afterIndicator = () => 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 ? (\n <tr role=\"presentation\" aria-hidden=\"true\" data-virtualizer-spacer=\"bottom\">\n <td colSpan={spacerColSpan()} style={{ height: `${virtualRange()!.offsetBottom}px`, padding: '0', border: '0' }} />\n </tr>\n )\n : null}\n </>\n }>\n {local.renderEmptyState?.()}\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\nexport function TableLoadMoreItem(props: TableLoadMoreItemProps): JSX.Element {\n let ref: HTMLTableRowElement | 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 (!ref || typeof IntersectionObserver !== 'function') return;\n const observer = new IntersectionObserver((entries) => {\n if (entries[0]?.isIntersecting) {\n void triggerLoadMore();\n }\n });\n observer.observe(ref);\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-Table-loadMore',\n },\n () => ({ isLoading: isLoading() })\n );\n\n return (\n <tr\n ref={ref}\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 <td colSpan={props.colSpan ?? 1}>{renderProps.renderChildren()}</td>\n </tr>\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, ['class', 'style', 'slot', 'id', 'item', 'onAction', 'children']);\n\n // Get context\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\n // Create ref signal\n const [ref, setRef] = createSignal<HTMLTableRowElement | null>(null);\n\n // Find the row node\n const rowNode = createMemo(() => {\n const node = collection.getItem(local.id);\n if (!node) {\n // Create a simple node for the row\n return {\n type: 'item' as const,\n key: local.id,\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 // Create row aria props\n const rowAria = createTableRow<object>(\n () => ({\n node: rowNode(),\n onAction: local.onAction,\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\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n\n // Create focus ring\n const { isFocusVisible, focusProps } = createFocusRing();\n\n // Check if focused\n const isFocused = createMemo(() => state.focusedKey === local.id);\n const draggableItem = createMemo(() => {\n if (!tableContext.dragAndDropHooks?.useDraggableItem || !tableContext.dragState) return undefined;\n return tableContext.dragAndDropHooks.useDraggableItem(\n {\n key: local.id as string | number,\n },\n tableContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>['useDraggableItem']>>[1]\n );\n });\n const droppableItem = createMemo(() => {\n if (!tableContext.dragAndDropHooks?.useDroppableItem || !tableContext.dropState) return undefined;\n return tableContext.dragAndDropHooks.useDroppableItem(\n {\n key: local.id as string | number,\n },\n tableContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>['useDroppableItem']>>[1],\n () => ref()\n );\n });\n\n // Render props values\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 // Remove ref from spread props\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: local.id,\n rowNode: rowNode(),\n };\n\n return (\n <TableRowContext.Provider value={rowContextValue}>\n <tr\n ref={setRef}\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 {typeof local.children === 'function'\n ? local.children(renderValues())\n : local.children}\n </tr>\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, ['class', 'style', 'slot', 'id', 'children']);\n\n // Get context\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 // Create ref signal\n const [ref, setRef] = createSignal<HTMLTableCellElement | null>(null);\n\n // Find the cell node\n const cellNode = createMemo(() => {\n // If id is provided, look for that specific cell\n if (local.id != null) {\n const cellKey = `${rowKey}-${local.id}`;\n const node = collection.getItem(cellKey);\n if (node) return node;\n }\n\n // Otherwise create a simple node\n return {\n type: 'cell' as const,\n key: local.id ?? `${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\n // Create cell aria props\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 // Create hover\n const { isHovered, hoverProps } = createHover({\n isDisabled: false,\n });\n\n // Create focus ring\n const { isFocusVisible, focusProps } = createFocusRing();\n\n // Check if focused\n const isFocused = createMemo(() => state.focusedKey === cellNode().key);\n\n // Render props values\n const renderValues = createMemo<TableCellRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible() && isFocused(),\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 // Remove ref from spread props\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 return (\n <td\n ref={setRef}\n {...domProps}\n {...cleanCellProps()}\n {...cleanHoverProps()}\n {...cleanFocusProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={(isFocusVisible() && isFocused()) || undefined}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n >\n {typeof local.children === 'function'\n ? local.children(renderValues())\n : local.children}\n </td>\n );\n}\n\n/**\n * A checkbox cell for row selection.\n */\nexport function TableSelectionCheckbox(props: { rowKey: Key }): 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 <input {...selectionCheckboxAria.checkboxProps} />;\n}\n\n/**\n * A checkbox for select-all functionality.\n */\nexport function TableSelectAllCheckbox(): 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 <input {...selectAllCheckboxAria.checkboxProps} />;\n}\n\n// Attach components as static properties\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 ColumnResizerProps extends SlotProps {\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport function ColumnResizer(props: ColumnResizerProps): JSX.Element {\n return <div role=\"separator\" class={props.class ?? 'solidaria-Table-columnResizer'} style={props.style} />;\n}\n\nexport interface ResizableTableContainerProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport function ResizableTableContainer(props: ResizableTableContainerProps): JSX.Element {\n return (\n <div class={props.class ?? 'solidaria-ResizableTableContainer'} style={props.style}>\n {props.children}\n </div>\n );\n}\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 Accessor,\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n useContext,\n For,\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\n// ============================================\n// TYPES\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> 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 /** 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 /** 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}\n\nexport interface GridListItemProps<T extends object> extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, 'class' | 'style' | 'children' | 'id'> {\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}\n\nexport interface GridListLoadMoreItemProps extends SlotProps {\n onLoadMore: () => void | Promise<void>;\n isLoading?: boolean;\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\n// ============================================\n// CONTEXT\n// ============================================\n\ninterface GridListContextValue<T extends object> {\n state: GridState<T, GridCollection<T>>;\n collection: GridCollection<T>;\n isDisabled: boolean;\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>(null);\nexport const GridListHeaderContext = createContext<null>(null);\n\n// ============================================\n// HELPER: Build GridCollection from items\n// ============================================\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// COMPONENTS\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 ['children', 'class', 'style', 'slot', 'renderEmptyState', 'hasMore', 'isLoading', 'onLoadMore', 'dragAndDropHooks'],\n [\n 'items',\n 'getKey',\n 'getTextValue',\n 'getDisabled',\n 'disabledKeys',\n 'selectionMode',\n 'selectedKeys',\n 'defaultSelectedKeys',\n 'onSelectionChange',\n ]\n );\n\n // Create ref signal\n const [ref, setRef] = createSignal<HTMLUListElement | null>(null);\n\n // Build collection\n const collection = createMemo(() =>\n buildGridCollection(\n stateProps.items,\n stateProps.getKey,\n stateProps.getTextValue,\n stateProps.getDisabled\n )\n );\n\n // Get disabled keys from items + explicit disabledKeys\n const allDisabledKeys = createMemo(() => {\n const keys = new Set<Key>();\n\n // Add explicitly disabled keys\n if (stateProps.disabledKeys) {\n for (const key of stateProps.disabledKeys) {\n keys.add(key);\n }\n }\n\n // Add keys from items marked as disabled\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 // Create grid state\n const state = createGridState<T, GridCollection<T>>(() => ({\n collection: collection(),\n disabledKeys: allDisabledKeys(),\n selectionMode: stateProps.selectionMode,\n selectedKeys: stateProps.selectedKeys,\n defaultSelectedKeys: stateProps.defaultSelectedKeys,\n onSelectionChange: stateProps.onSelectionChange,\n }));\n\n // Create grid list aria props\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 }),\n () => state,\n ref\n );\n\n // Create focus ring\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n // Render props values\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 // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-GridList',\n },\n renderValues\n );\n\n // Filter DOM props\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n // Remove ref from spread props\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(() => Array.from(state.collection).filter((node) => node.type === 'item'));\n const getDropTargetByIndex = (index: number, position: 'before' | 'after' | 'on'): 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 || parentCollectionRenderer?.dropTargetDelegate || 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 = 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(() => useRenderDropIndicator(local.dragAndDropHooks, dropState()));\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 = 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 ? itemNodes.findIndex((node) => node.key === normalizedDropKey) : -1,\n dropTarget?.type === 'item' ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(baseRange, persistedIndexes, stateProps.items.length, virtualizer, 80, {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\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 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) ?? parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n\n return (\n <GridListContext.Provider value={contextValue() as unknown as GridListContextValue<object>}>\n <GridListStateContext.Provider value={state as unknown as GridState<object, GridCollection<object>>}>\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <div\n ref={setRef}\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 role=\"presentation\" aria-hidden=\"true\" style={{ height: `${virtualRange()!.offsetTop}px` }} data-virtualizer-spacer=\"top\" />\n : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex(), 'before');\n const onIndicator = () => collectionRenderer().renderDropIndicator?.(itemIndex(), 'on');\n const afterIndicator = () => 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 role=\"presentation\" aria-hidden=\"true\" style={{ height: `${virtualRange()!.offsetBottom}px` }} data-virtualizer-spacer=\"bottom\" />\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 ]);\n\n // Get state from context\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 // Create ref signal\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null);\n\n // Find or create the item node\n const itemNode = createMemo(() => {\n const node = state.collection.getItem(local.id);\n if (!node) {\n // Create a simple node for the item\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 // Create item aria props\n const itemAria = createGridListItem<T, GridCollection<T>>(\n () => ({\n node: itemNode(),\n onAction: local.onAction,\n }),\n () => state,\n ref as Accessor<HTMLLIElement | null>\n );\n const isSelected = () => itemAria.isSelected;\n const isDisabled = () => itemAria.isDisabled;\n const isPressed = () => itemAria.isPressed;\n\n // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n\n // Create focus ring\n const { isFocusVisible, focusProps } = createFocusRing();\n\n // Check if focused\n const isFocused = createMemo(() => state.focusedKey === local.id);\n const draggableItem = createMemo(() => {\n if (!listContext?.dragAndDropHooks?.useDraggableItem || !listContext.dragState) 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) 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 // Render props values\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 }));\n\n // Resolve render props\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 // Remove ref from spread props\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={setRef}\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: { itemKey: Key }): 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 <input {...checkboxAria.checkboxProps} />;\n}\n\nexport function GridListLoadMoreItem(props: GridListLoadMoreItemProps): JSX.Element {\n let ref: 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 (!ref || typeof IntersectionObserver !== 'function') return;\n const observer = new IntersectionObserver((entries) => {\n if (entries[0]?.isIntersecting) {\n void triggerLoadMore();\n }\n });\n observer.observe(ref);\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 <div\n ref={ref}\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\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\n// Attach Item and SelectionCheckbox as static properties\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';\n\n// ============================================\n// TYPES\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 /** 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 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}\n\nexport interface TreeItemProps<T extends object> extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, 'class' | 'style' | 'children' | 'id'> {\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}\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}\n\nexport interface TreeLoadMoreItemProps extends SlotProps {\n onLoadMore: () => void | Promise<void>;\n isLoading?: boolean;\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\n// ============================================\n// CONTEXT\n// ============================================\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 (!pointerTracking.boundaryContext || pointerTracking.boundaryContext.parentKey !== parentKey) {\n const initialTargetIndex = 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 = 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 =>\n 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 tryValid({ type: 'item', key: target.key, dropPosition: 'on' })\n ?? tryValid({ type: 'item', key: target.key, dropPosition: 'after' });\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 tryValid({ type: 'item', key: firstChild, dropPosition: 'before' })\n ?? tryValid({ type: 'item', key: firstChild, dropPosition: 'on' });\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 (targetNode && nextNode && nextNode.level != null && targetNode.level != null && nextNode.level >= targetNode.level) {\n return tryValid({ type: 'item', key: nextNode.key, dropPosition: 'before' })\n ?? tryValid({ type: 'item', key: target.key, dropPosition: 'after' });\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 tryValid({ type: 'item', key: firstChild, dropPosition: 'before' })\n ?? tryValid({ type: 'item', key: firstChild, dropPosition: 'on' });\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 tryValid({ type: 'item', key: nextSibling.key, dropPosition: 'before' })\n ?? tryValid({ type: 'item', key: nextSibling.key, dropPosition: 'on' });\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 = 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 tryValid({ type: 'item', key: nextKey, dropPosition: 'before' })\n ?? tryValid({ type: 'item', key: nextKey, dropPosition: 'on' });\n }\n // Wrap to root\n return tryValid({ type: 'root' });\n }\n }\n }\n return null;\n }\n\n // dir === 'previous'\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 tryValid({ type: 'item', key: deepest, dropPosition: 'after' })\n ?? tryValid({ type: 'item', key: target.key, dropPosition: 'on' });\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 tryValid({ type: 'item', key: deepest, dropPosition: 'after' })\n ?? tryValid({ type: 'item', key: prevKey, dropPosition: 'on' });\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>(null);\nexport const TreeItemContext = createContext<TreeItemContextValue<object> | null>(null);\n\n// ============================================\n// COMPONENTS\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 ['class', 'style', 'slot', 'renderEmptyState', 'hasMore', 'isLoading', 'onLoadMore', 'dragAndDropHooks'],\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 // Create ref signal\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null);\n const flatItems = createMemo<TreeItemData<T>[]>(() => flattenCollectionEntries(stateProps.items));\n const hasSections = createMemo(() => stateProps.items.some((entry) => isCollectionSection(entry)));\n\n // Create tree state\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 // Create tree aria props\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 // Create focus ring\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n // Render props values\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 // Resolve render props\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: 'solidaria-Tree',\n },\n renderValues\n );\n\n // Filter DOM props\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n return filtered;\n });\n\n // Remove ref from spread props\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 // Render visible rows (flat list based on expansion state)\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 = (index: number, position: 'before' | 'after' | 'on'): 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 || parentCollectionRenderer?.dropTargetDelegate || 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 = 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 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 expandKey = EXPANSION_KEYS.expand[direction];\n const collapseKey = EXPANSION_KEYS.collapse[direction];\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(() => useRenderDropIndicator(local.dragAndDropHooks, dropState()));\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 = 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(baseRange, persistedIndexes, rows.length, virtualizer, 80, {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\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: parentCollectionRenderer?.dropTargetDelegate?.getDropTargetFromPoint\n ?? ((_x, _y, _v) => null),\n getKeyboardNavigationTarget: parentCollectionRenderer?.dropTargetDelegate?.getKeyboardNavigationTarget,\n getKeyboardPageNavigationTarget: parentCollectionRenderer?.dropTargetDelegate?.getKeyboardPageNavigationTarget,\n };\n const treeDelegate = createTreeDropTargetDelegate(\n parentDelegate, state, 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) ?? 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 // Find the original item data to pass to render function\n const itemData: TreeItemData<T> = {\n key: node.key,\n value: node.value as T,\n textValue: node.textValue,\n children: node.hasChildNodes\n ? node.childNodes.map((child) => ({\n key: child.key,\n value: child.value as T,\n textValue: child.textValue,\n }))\n : undefined,\n };\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 value={state as unknown as TreeState<object, TreeCollection<object>>}>\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <div\n ref={setRef}\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={stateProps.selectionMode !== 'none' ? stateProps.selectionMode : undefined}\n data-allows-dragging={hasDraggableDnd() || undefined}\n >\n <SharedElementTransition>\n {isEmpty() && local.renderEmptyState ? (\n local.renderEmptyState()\n ) : (\n <>\n {virtualRange()?.offsetTop\n ? <div role=\"presentation\" aria-hidden=\"true\" style={{ height: `${virtualRange()!.offsetTop}px` }} data-virtualizer-spacer=\"top\" />\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 role=\"presentation\" aria-hidden=\"true\" style={{ height: `${virtualRange()!.offsetBottom}px` }} data-virtualizer-spacer=\"bottom\" />\n : null}\n </>\n )}\n </SharedElementTransition>\n {local.hasMore && local.onLoadMore && (\n <TreeLoadMoreItem onLoadMore={local.onLoadMore} isLoading={local.isLoading} />\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 'children',\n ]);\n\n // Get state from context\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\n // Create ref signal\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null);\n\n // Find the item node\n const itemNode = createMemo(() => {\n const node = state.collection.getItem(local.id);\n if (!node) {\n // Create a simple node for the item\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: false,\n childNodes: [],\n isExpandable: false,\n isExpanded: false,\n } as TreeNode<T>;\n }\n return node;\n });\n\n // Create item aria props\n const treeItemAria = createTreeItem<T, TreeCollection<T>>(\n () => ({\n node: itemNode(),\n onAction: local.onAction,\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 // Create hover\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n\n // Create focus ring\n const { isFocusVisible, focusProps } = createFocusRing();\n\n // Check if focused\n const isFocused = createMemo(() => state.focusedKey === local.id);\n const draggableItem = createMemo(() => {\n if (!treeContext?.dragAndDropHooks?.useDraggableItem || !treeContext.dragState) 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) 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 // Render props values\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 }));\n\n // Resolve render props\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 // Remove ref from spread props\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 // Item context for nested components\n const itemContextValue = createMemo<TreeItemContextValue<T>>(() => ({\n node: itemNode(),\n isExpanded: isExpanded(),\n isExpandable: isExpandable(),\n level: level(),\n }));\n\n return (\n <TreeItemContext.Provider value={itemContextValue() as unknown as TreeItemContextValue<object>}>\n <div\n ref={setRef}\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={{ '--tree-item-level': String(level()), ...((typeof renderProps.style() === 'object' ? renderProps.style() : {}) as Record<string, string>) }}\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={treeContext?.state.selectionMode !== 'none' ? treeContext?.state.selectionMode : undefined}\n data-dragging={draggableItem()?.isDragging || undefined}\n data-drop-target={droppableItem()?.isDropTarget || undefined}\n >\n <div {...treeItemAria.gridCellProps} class=\"solidaria-Tree-item-content\">\n {renderProps.renderChildren()}\n </div>\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 // Get item context\n const itemContext = useContext(TreeItemContext);\n if (!itemContext) {\n throw new Error('TreeExpandButton must be used within a Tree');\n }\n\n // Get state context\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 // Create expand button props\n const treeItemAria = createTreeItem(\n () => ({ node: itemContext.node }),\n () => state,\n () => null\n );\n\n // Remove ref and add custom handling\n const cleanExpandProps = () => {\n const { ref: _ref, ...rest } = treeItemAria.expandButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const isExpanded = createMemo(() => state.isExpanded(itemContext.node.key));\n\n // Render children\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 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: { itemKey: Key }): 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 <input {...treeSelectionCheckboxAria.checkboxProps} class=\"solidaria-Tree-checkbox\" />;\n}\n\nexport function TreeLoadMoreItem(props: TreeLoadMoreItemProps): JSX.Element {\n let ref: 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 (!ref || typeof IntersectionObserver !== 'function') return;\n const observer = new IntersectionObserver((entries) => {\n if (entries[0]?.isIntersecting) {\n void triggerLoadMore();\n }\n });\n observer.observe(ref);\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 <div\n ref={ref}\n role=\"treeitem\"\n tabIndex={0}\n aria-disabled={true}\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\nexport interface TreeItemContentProps<T extends object> extends TreeItemProps<T> {}\nexport type TreeItemContentRenderProps = TreeItemRenderProps;\n\nexport function TreeItemContent<T extends object>(props: TreeItemContentProps<T>): JSX.Element {\n return <TreeItem {...props} />;\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\n// Attach static properties\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 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 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\n// ============================================\n// COLOR SLIDER\n// ============================================\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 current value. */\n value: number;\n /** The current color. */\n color: Color;\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 /** 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}\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 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}\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}\n\n// Context\ninterface ColorSliderContextValue {\n state: ColorSliderState;\n trackProps: JSX.HTMLAttributes<HTMLDivElement>;\n thumbProps: JSX.HTMLAttributes<HTMLDivElement>;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n trackRef: HTMLDivElement | undefined;\n setTrackRef: (el: HTMLDivElement) => 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'],\n ['aria-label', 'aria-labelledby', 'aria-describedby', 'isDisabled', 'channelName']\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 isDisabled: ariaProps.isDisabled,\n }));\n\n // Track ref\n let trackRef: HTMLDivElement | undefined;\n const setTrackRef = (el: HTMLDivElement) => {\n trackRef = el;\n };\n\n // Create color slider aria props\n const {\n trackProps,\n thumbProps,\n inputProps,\n labelProps,\n } = createColorSlider(\n () => ({\n channel: stateProps.channel,\n 'aria-label': ariaProps['aria-label'],\n 'aria-labelledby': ariaProps['aria-labelledby'],\n 'aria-describedby': ariaProps['aria-describedby'],\n isDisabled: ariaProps.isDisabled,\n channelName: ariaProps.channelName,\n }),\n () => state,\n () => trackRef ?? null\n );\n\n // Render props values\n const renderValues = createMemo<ColorSliderRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n channel: state.channel,\n value: state.getThumbValue(),\n color: state.value,\n }));\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n return (\n <ColorSliderContext.Provider\n value={{\n state,\n trackProps,\n thumbProps,\n inputProps,\n trackRef,\n setTrackRef,\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-channel={state.channel}\n >\n {/* Label */}\n <Show when={local.label}>\n <label {...labelProps}>{local.label}</label>\n </Show>\n\n {renderProps.renderChildren()}\n </div>\n </ColorSliderContext.Provider>\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, trackProps, setTrackRef } = context;\n\n // Render props values\n const renderValues = createMemo<ColorSliderTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n }));\n\n // Resolve render props\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 // Clean props\n const cleanTrackProps = () => {\n const { ref: _ref, style: _trackStyle, ...rest } = trackProps as Record<string, unknown>;\n return rest;\n };\n\n // Merge styles\n const mergedStyle = () => {\n const trackStyle = (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-dragging={state.isDragging || undefined}\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']);\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, thumbProps, inputProps } = context;\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 state.isDisabled;\n },\n });\n\n // Render props values\n const renderValues = createMemo<ColorSliderThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n // Resolve render props\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 // Clean props\n const cleanThumbProps = () => {\n const { ref: _ref, style: _thumbStyle, ...rest } = 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 inputProps as Record<string, unknown>,\n cleanFocusProps()\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n };\n\n // Merge styles\n const mergedStyle = () => {\n const thumbStyle = (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 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\n// Attach sub-components\nColorSlider.Track = ColorSliderTrack;\nColorSlider.Thumb = ColorSliderThumb;\n\n// ============================================\n// COLOR AREA\n// ============================================\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}\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 /** 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}\n\n// Context\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'],\n ['aria-label', 'aria-labelledby', 'aria-describedby', 'isDisabled']\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 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 {\n colorAreaProps,\n gradientProps,\n thumbProps,\n xInputProps,\n yInputProps,\n } = createColorArea(\n () => ({\n 'aria-label': ariaProps['aria-label'],\n 'aria-labelledby': ariaProps['aria-labelledby'],\n 'aria-describedby': ariaProps['aria-describedby'],\n isDisabled: ariaProps.isDisabled,\n }),\n () => state,\n () => areaRef ?? null\n );\n\n // Render props values\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 }));\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n // Clean props\n const cleanColorAreaProps = () => {\n const { ref: _ref, style: _areaStyle, ...rest } = colorAreaProps as Record<string, unknown>;\n return rest;\n };\n\n // Merge styles\n const mergedStyle = () => {\n const areaStyle = (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 colorAreaProps,\n gradientProps,\n thumbProps,\n xInputProps,\n yInputProps,\n areaRef,\n setAreaRef,\n }}\n >\n <div\n ref={setAreaRef}\n {...domProps()}\n {...cleanColorAreaProps()}\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 </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, gradientProps } = context;\n\n // Render props values\n const renderValues = createMemo<ColorAreaGradientRenderProps>(() => ({\n isDisabled: state.isDisabled,\n }));\n\n // Resolve render props\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 // Clean props\n const cleanGradientProps = () => {\n const { ref: _ref, style: _gradStyle, ...rest } = gradientProps as Record<string, unknown>;\n return rest;\n };\n\n // Merge styles\n const mergedStyle = () => {\n const gradStyle = (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']);\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, thumbProps, xInputProps, yInputProps } = context;\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 state.isDisabled;\n },\n });\n\n // Render props values\n const renderValues = createMemo<ColorAreaThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n // Resolve render props\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 // Clean props\n const cleanThumbProps = () => {\n const { ref: _ref, style: _thumbStyle, ...rest } = 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 return mergeProps(\n xInputProps as Record<string, unknown>,\n cleanFocusProps()\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n };\n const mergedYInputProps = () => {\n return mergeProps(\n yInputProps as Record<string, unknown>,\n cleanFocusProps()\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n };\n\n // Merge styles\n const mergedStyle = () => {\n const thumbStyle = (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 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 {...mergedXInputProps()} />\n <input {...mergedYInputProps()} />\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n// Attach sub-components\nColorArea.Gradient = ColorAreaGradient;\nColorArea.Thumb = ColorAreaThumb;\n\n// ============================================\n// COLOR WHEEL\n// ============================================\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}\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}\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 /** 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 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}\n\n// Context\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 ['aria-label', 'aria-labelledby', 'aria-describedby', 'isDisabled']\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 // Wheel ref\n let wheelRef: HTMLDivElement | undefined;\n const setWheelRef = (el: HTMLDivElement) => {\n wheelRef = el;\n };\n\n // Create color wheel aria props\n const {\n trackProps,\n thumbProps,\n inputProps,\n } = createColorWheel(\n () => ({\n 'aria-label': ariaProps['aria-label'],\n 'aria-labelledby': ariaProps['aria-labelledby'],\n 'aria-describedby': ariaProps['aria-describedby'],\n isDisabled: ariaProps.isDisabled,\n }),\n () => state,\n () => wheelRef ?? null\n );\n\n // Render props values\n const renderValues = createMemo<ColorWheelRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n hue: state.getHue(),\n color: state.value,\n }));\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n return (\n <ColorWheelContext.Provider\n value={{\n state,\n trackProps,\n thumbProps,\n inputProps,\n wheelRef,\n setWheelRef,\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 >\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, trackProps, setWheelRef } = context;\n\n // Render props values\n const renderValues = createMemo<ColorWheelTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n }));\n\n // Resolve render props\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 // Clean props\n const cleanTrackProps = () => {\n const { ref: _ref, style: _trackStyle, ...rest } = trackProps as Record<string, unknown>;\n return rest;\n };\n\n // Merge styles\n const mergedStyle = () => {\n const trackStyle = (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={setWheelRef}\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']);\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, thumbProps, inputProps } = context;\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 state.isDisabled;\n },\n });\n\n // Render props values\n const renderValues = createMemo<ColorWheelThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging,\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n // Resolve render props\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 // Clean props\n const cleanThumbProps = () => {\n const { ref: _ref, style: _thumbStyle, ...rest } = 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 inputProps as Record<string, unknown>,\n cleanFocusProps()\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n };\n\n // Merge styles\n const mergedStyle = () => {\n const thumbStyle = (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 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\n// Attach sub-components\nColorWheel.Track = ColorWheelTrack;\nColorWheel.Thumb = ColorWheelThumb;\n\n// ============================================\n// COLOR FIELD\n// ============================================\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 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 (if single channel mode). */\n channel: ColorChannel | undefined;\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 format for parsing/displaying. */\n colorFormat?: ColorFormat;\n /** A visible label for the field. */\n label?: 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}\n\n// Context\ninterface ColorFieldContextValue {\n state: ColorFieldState;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\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'],\n ['value', 'defaultValue', 'onChange', 'channel', 'colorFormat'],\n ['aria-label', 'aria-labelledby', 'aria-describedby', 'isDisabled', 'isReadOnly']\n );\n\n // Create color field state\n const state = createColorFieldState(() => ({\n value: stateProps.value ?? pickerContext?.value,\n defaultValue: stateProps.defaultValue,\n onChange: stateProps.onChange ?? ((color) => {\n if (color) {\n pickerContext?.onChange?.(color);\n }\n }),\n channel: stateProps.channel,\n colorFormat: stateProps.colorFormat,\n isDisabled: ariaProps.isDisabled,\n isReadOnly: ariaProps.isReadOnly,\n }));\n\n // Input ref\n let inputRef: HTMLInputElement | undefined;\n\n // Create color field aria props\n const {\n inputProps,\n labelProps,\n } = createColorField(\n () => ({\n 'aria-label': ariaProps['aria-label'],\n 'aria-labelledby': ariaProps['aria-labelledby'],\n 'aria-describedby': ariaProps['aria-describedby'],\n isDisabled: ariaProps.isDisabled,\n isReadOnly: ariaProps.isReadOnly,\n channel: stateProps.channel,\n }),\n () => state,\n () => inputRef ?? null\n );\n\n // Render props values\n const renderValues = createMemo<ColorFieldRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n color: state.value,\n channel: state.channel,\n }));\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n return (\n <ColorFieldContext.Provider\n value={{\n state,\n inputProps,\n labelProps,\n }}\n >\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n >\n {/* Label */}\n <Show when={local.label}>\n <label {...labelProps}>{local.label}</label>\n </Show>\n\n {renderProps.renderChildren()}\n </div>\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']);\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, inputProps } = context;\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 state.isDisabled;\n },\n });\n\n // Render props values\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 // Resolve render props\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 // Clean props\n const cleanInputProps = () => {\n const { ref: _ref, style: _inputStyle, ...rest } = 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 class={renderProps.class()}\n style={renderProps.style()}\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\n// Attach sub-components\nColorField.Input = ColorFieldInput;\n\n// ============================================\n// COLOR SWATCH\n// ============================================\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 /** Accessible label for the swatch. */\n 'aria-label'?: 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'],\n ['aria-label']\n );\n\n const resolvedColor = createMemo<Color | string>(() => {\n return local.color ?? swatchContext?.color ?? pickerContext?.value ?? '#0000';\n });\n\n // Create color swatch aria props\n const { swatchProps } = createColorSwatch(() => ({\n color: resolvedColor(),\n 'aria-label': ariaProps['aria-label'],\n }));\n\n // Normalize color\n const color = createMemo(() => normalizeColor(resolvedColor()));\n\n // Render props values\n const renderValues = createMemo<ColorSwatchRenderProps>(() => ({\n color: color(),\n colorValue: color().toString('css'),\n }));\n\n // Resolve render props\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\n\n // Clean props\n const cleanSwatchProps = () => {\n const { ref: _ref, style: _swatchStyle, ...rest } = swatchProps as Record<string, unknown>;\n return rest;\n };\n\n // Merge styles\n const mergedStyle = () => {\n const swatchStyle = (swatchProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...swatchStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps()}\n {...cleanSwatchProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n >\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 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 /** 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 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\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(() => local.value !== undefined || pickerContext?.value !== undefined);\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 'aria-label': local['aria-label'] ?? (!local['aria-labelledby'] ? 'Color swatch picker' : undefined),\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\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 = direction === 'next'\n ? (key: Key) => collection.getKeyAfter(key)\n : (key: Key) => collection.getKeyBefore(key);\n const getBoundary = direction === 'next'\n ? () => collection.getFirstKey()\n : () => 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 = direction === 'next'\n ? (key: Key) => collection.getKeyAfter(key)\n : (key: Key) => collection.getKeyBefore(key);\n const getBoundary = direction === 'next'\n ? () => collection.getFirstKey()\n : () => 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 = (listbox: HTMLElement | null, key: Key | null): 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) => 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' ? findNextEnabledKey(key, 'prev') : findNextEnabledKey(key, 'next');\n const getGridKeyLeftOf = (key: Key) =>\n resolveDirection() === 'rtl' ? findNextEnabledKey(key, 'next') : findNextEnabledKey(key, 'prev');\n\n const handleGridKeyDown = (e: KeyboardEvent): boolean => {\n if ((local.layout ?? 'grid') !== 'grid') return false;\n if (e.key !== 'ArrowRight' && e.key !== 'ArrowLeft' && e.key !== 'ArrowDown' && e.key !== 'ArrowUp') {\n return false;\n }\n\n const listbox = e.currentTarget as HTMLElement | null;\n const focusedKey = state.focusedKey();\n const initialKey = focusedKey ?? (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 = getGridKeyRightOf(initialKey) ?? (\n resolveDirection() === 'rtl' ? getBoundaryEnabledKey('prev') : getBoundaryEnabledKey('next')\n );\n break;\n case 'ArrowLeft':\n nextKey = getGridKeyLeftOf(initialKey) ?? (\n resolveDirection() === 'rtl' ? getBoundaryEnabledKey('next') : getBoundaryEnabledKey('prev')\n );\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(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\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 { ref: _ref, onKeyDown: _onKeyDown, ...restListBoxProps } = 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(), { onKeyDown: onColorSwatchPickerKeyDown })}\n class={renderProps.class()}\n style={renderProps.style()}\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(() => filterDOMProps(rest as Record<string, unknown>, { global: true }));\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 { type JSX, createSignal, splitProps, Show, onCleanup, createEffect, createUniqueId } from 'solid-js'\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface ContextualHelpTriggerProps extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, 'class' | 'children'> {\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// COMPONENT\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, ['isUnavailable', 'children', 'class', 'isDisabled'])\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 (typeof handler === 'object' && 'handleEvent' in handler && typeof handler.handleEvent === 'function') {\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\n// ============================================\n// TYPES\n// ============================================\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// COMPONENT\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 children are provided, render them instead of the default layout\n if (local.children) {\n return (\n <div class={resolvedClass()} style={local.style}>\n <ColorPicker value={local.value} defaultValue={local.defaultValue} onChange={local.onChange}>\n {() => local.children}\n </ColorPicker>\n </div>\n )\n }\n\n // Determine ColorArea channels based on active color space\n const areaChannels = createMemo(() => {\n const space = activeSpace()\n if (space === 'hsb' || space === 'hex') {\n return { x: 'saturation' as ColorChannel, y: 'brightness' as ColorChannel, colorSpace: 'hsb' as ColorSpace }\n }\n if (space === 'hsl') {\n return { x: 'saturation' as ColorChannel, y: 'lightness' as ColorChannel, colorSpace: 'hsl' as ColorSpace }\n }\n // rgb: use green and blue on area\n return { x: 'green' as ColorChannel, y: 'blue' as ColorChannel, colorSpace: 'rgb' as ColorSpace }\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 {/* Top row: ColorArea + vertical sliders */}\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\n channel=\"hue\"\n isDisabled={local.isDisabled}\n aria-label=\"Hue\"\n >\n {() => (\n <ColorSliderTrack>\n {() => <ColorSliderThumb />}\n </ColorSliderTrack>\n )}\n </ColorSlider>\n\n <Show when={!local.hideAlphaChannel}>\n <ColorSlider\n channel=\"alpha\"\n isDisabled={local.isDisabled}\n aria-label=\"Alpha\"\n >\n {() => (\n <ColorSliderTrack>\n {() => <ColorSliderThumb />}\n </ColorSliderTrack>\n )}\n </ColorSlider>\n </Show>\n </div>\n\n {/* Bottom row: color space selector + channel fields */}\n <div class=\"solidaria-ColorEditor-bottom\">\n <select\n value={activeSpace()}\n onChange={(e) => handleSpaceChange(e.currentTarget.value as ColorEditorColorSpace | 'hex')}\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\n isDisabled={local.isDisabled}\n aria-label=\"Hex color\"\n >\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\n channel=\"alpha\"\n isDisabled={local.isDisabled}\n aria-label=\"Alpha\"\n >\n {() => <ColorFieldInput />}\n </ColorField>\n </Show>\n </div>\n </>\n )}\n </ColorPicker>\n </div>\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 {\n type JSX,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n} 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 {\n type SlotProps,\n filterDOMProps,\n} from './utils';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface LandmarkRenderProps {\n /** The ARIA landmark role. */\n role: AriaLandmarkRole;\n}\n\nexport interface LandmarkProps\n extends AriaLandmarkProps,\n 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\n// Re-export types\nexport type { AriaLandmarkRole, LandmarkController };\n\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const LandmarkContext = createContext<LandmarkProps | null>(null);\n\n// ============================================\n// SEMANTIC ELEMENT MAPPING\n// ============================================\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// LANDMARK COMPONENT\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() { return ariaProps.role; },\n get 'aria-label'() { return ariaProps['aria-label']; },\n get 'aria-labelledby'() { return ariaProps['aria-labelledby']; },\n get id() { return ariaProps.id; },\n get focus() { return ariaProps.focus; },\n },\n ref\n );\n\n // Render props values\n const renderValues = createMemo<LandmarkRenderProps>(() => ({\n role: ariaProps.role,\n }));\n\n // Resolve class\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 // Resolve style\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 // Filter DOM props\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// LANDMARK CONTROLLER EXPORT\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\n// ============================================\n// TYPES\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 extends SlotProps {\n /** The number of selected items. ActionBar is hidden when 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}\n\n// ============================================\n// CONTEXT\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\n// ============================================\n// ACTIONBAR COMPONENT\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 ]);\n\n const isOpen = () => local.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 // Announce only when transitioning from closed -> open.\n createEffect(() => {\n const open = isOpen();\n if (open && !wasOpen) {\n announce('Actions available.');\n }\n wasOpen = open;\n });\n\n // Escape key to clear selection\n const handleKeyDown: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent> = (e) => {\n const onKeyDown = local.onKeyDown as JSX.EventHandler<HTMLDivElement, KeyboardEvent> | 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: local.selectedItemCount,\n })\n );\n\n const filteredDOMProps = createMemo(() => filterDOMProps(domProps as Record<string, unknown>, { global: true }));\n\n const contextValue = createMemo<ActionBarContextValue>(() => ({\n selectedItemCount: () => local.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 >\n {local.children}\n </div>\n </ActionBarContext.Provider>\n </Show>\n );\n}\n\n// ============================================\n// ACTIONBAR CONTAINER\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\n// ============================================\n// SELECTION COUNT\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\n// ============================================\n// CLEAR BUTTON\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\n// ============================================\n// TYPES\n// ============================================\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>\n 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\n// ============================================\n// CONTEXT\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\n// ============================================\n// ACTIONGROUP COMPONENT\n// ============================================\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(() => filterDOMProps(domProps as Record<string, unknown>, { global: true }));\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={local.children as (item: ActionGroupItem, rp: ActionGroupItemRenderProps) => JSX.Element}\n />\n )}\n </For>\n </div>\n </ActionGroupStateContext.Provider>\n </ActionGroupContext.Provider>\n );\n}\n\n// ============================================\n// INTERNAL ITEM WRAPPER\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 { get key() { return props.item.id; } },\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> & { ref?: unknown };\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\n// ============================================\n// HOOKS\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 {\n type JSX,\n createContext,\n createMemo,\n splitProps,\n useContext,\n} 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\n// ============================================\n// TYPES\n// ============================================\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\n// ============================================\n// CONTEXT\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// ALERT COMPONENT\n// ============================================\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 // Render props values\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 // Filter DOM props\n const domProps = createMemo(() => filterDOMProps(rest, { global: true }));\n\n // Context value for sub-components\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\n// ============================================\n// ALERT DISMISS BUTTON\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 {\n type JSX,\n createContext,\n createMemo,\n Show,\n splitProps,\n} 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\n// ============================================\n// TYPES\n// ============================================\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\n// ============================================\n// CONTEXT\n// ============================================\n\nexport const IconContext = createContext<IconProps | null>(null);\n\n// ============================================\n// ICON COMPONENT\n// ============================================\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 // Render props values\n const renderValues = createMemo<IconRenderProps>(() => ({\n isDecorative: isDecorative(),\n isInteractive: isInteractive(),\n }));\n\n // Resolve render props\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 // Filter DOM props\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 { type JSX, children as resolveChildren, createEffect, onCleanup, splitProps } from 'solid-js';\nimport { createFocusable, type CreateFocusableProps } from '@proyecto-viviana/solidaria';\n\n// ============================================\n// TYPES\n// ============================================\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// COMPONENT\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 // Forward ref\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 { type JSX, children as resolveChildren, createEffect, onCleanup, splitProps } from 'solid-js';\nimport {\n createPress,\n createFocusable,\n type CreatePressProps,\n type CreateFocusableProps,\n} from '@proyecto-viviana/solidaria';\n\n// ============================================\n// TYPES\n// ============================================\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// COMPONENT\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(pressProps as CreateFocusableProps, () => 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 // Forward ref\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","/**\n * solidaria-components\n *\n * Pre-wired headless components for SolidJS.\n * Port of react-aria-components.\n *\n * These components combine state management + accessibility hooks into\n * ready-to-style components using the render props pattern and data attributes.\n */\n\n// Utilities\nexport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type RenderPropsBase,\n type SlotProps,\n DEFAULT_SLOT,\n Provider,\n composeRenderProps,\n useRenderProps,\n useContextProps,\n useSlottedContext,\n filterDOMProps,\n removeDataAttributes,\n createDataAttributes,\n dataAttr,\n} from './utils';\n\n// VisuallyHidden\nexport {\n VisuallyHidden,\n type VisuallyHiddenProps,\n} from './VisuallyHidden';\n\n// Button\nexport {\n Button,\n ButtonContext,\n type ButtonProps,\n type ButtonRenderProps,\n} from './Button';\n\n// ToggleSwitch (named to avoid conflict with SolidJS's Switch)\nexport {\n ToggleSwitch,\n ToggleSwitchContext,\n ToggleSwitch as Switch,\n ToggleSwitchContext as SwitchContext,\n type ToggleSwitchProps,\n type ToggleSwitchRenderProps,\n type ToggleSwitchProps as SwitchProps,\n type ToggleSwitchRenderProps as SwitchRenderProps,\n} from './Switch';\n\n// ToggleButton\nexport {\n ToggleButton,\n ToggleButtonContext,\n type ToggleButtonProps,\n type ToggleButtonRenderProps,\n} from './ToggleButton';\n\n// ToggleButtonGroup\nexport {\n ToggleButtonGroup,\n ToggleButtonGroupContext,\n ToggleButtonGroupStateContext,\n ToggleGroupStateContext,\n useToggleButtonGroupStateContext,\n type ToggleButtonGroupProps,\n type ToggleButtonGroupRenderProps,\n type ToggleButtonGroupStateContextValue,\n} from './ToggleButtonGroup';\n\n// Checkbox\nexport {\n Checkbox,\n CheckboxGroup,\n CheckboxContext,\n CheckboxGroupContext,\n CheckboxGroupStateContext,\n type CheckboxProps,\n type CheckboxRenderProps,\n type CheckboxGroupProps,\n type CheckboxGroupRenderProps,\n} from './Checkbox';\n\n// Radio\nexport {\n Radio,\n RadioGroup,\n RadioContext,\n RadioGroupContext,\n RadioGroupStateContext,\n type RadioProps,\n type RadioRenderProps,\n type RadioGroupProps,\n type RadioGroupRenderProps,\n type Orientation,\n} from './RadioGroup';\n\n// TextField\nexport {\n TextField,\n TextFieldContext,\n LabelContext,\n InputContext,\n TextAreaContext,\n FieldInputContext,\n Label,\n Input,\n TextArea,\n type TextFieldProps,\n type TextFieldRenderProps,\n type TextFieldContextValue,\n type LabelProps,\n type InputProps,\n type TextAreaProps,\n} from './TextField';\n\nexport {\n Text,\n TextContext,\n type TextProps,\n} from './Text';\n\n// Link\nexport {\n Link,\n LinkContext,\n type LinkProps,\n type LinkRenderProps,\n} from './Link';\n\n// Keyboard\nexport {\n Keyboard,\n KeyboardContext,\n type KeyboardProps,\n} from './Keyboard';\n\n// Form\nexport {\n Form,\n FormContext,\n type FormProps,\n type FormRenderProps,\n} from './Form';\n\n// FieldError\nexport {\n FieldError,\n FieldErrorContext,\n type FieldErrorProps,\n type FieldErrorRenderProps,\n} from './FieldError';\n\n// FileTrigger\nexport {\n FileTrigger,\n type FileTriggerProps,\n} from './FileTrigger';\n\n// DropZone\nexport {\n DropZone,\n DropZoneContext,\n type DropZoneProps,\n type DropZoneRenderProps,\n} from './DropZone';\n\n// SharedElementTransition\nexport {\n SharedElementTransition,\n SharedElement,\n useHasSharedElementTransitionScope,\n type SharedElementTransitionProps,\n type SharedElementProps,\n type SharedElementPropsBase,\n type SharedElementRenderProps,\n} from './SharedElementTransition';\n\n// Layout base\nexport {\n Layout,\n LayoutInfo,\n Rect,\n Size,\n Point,\n type InvalidationContext,\n} from './virtualizer/Layout';\n\n// Virtualizer\nexport {\n Virtualizer,\n VirtualizerContext,\n useVirtualizerContext,\n ListLayout,\n GridLayout,\n WaterfallLayout,\n TableLayout,\n type VirtualizerProps,\n type VirtualizerLayout,\n type VirtualizerLayoutClass,\n type VirtualizerContextValue,\n type VirtualizerVisibleRange,\n type VirtualizerDropTarget,\n type VirtualizerDropOperationResolver,\n type VirtualizerDropTargetResolver,\n type VirtualizerRangeContext,\n type DefaultVirtualizerLayoutOptions,\n type GridLayoutOptions,\n type WaterfallLayoutOptions,\n} from './Virtualizer';\n\n// ProgressBar\nexport {\n ProgressBar,\n ProgressBarContext,\n type ProgressBarProps,\n type ProgressBarRenderProps,\n} from './ProgressBar';\n\n// Separator\nexport {\n Separator,\n SeparatorContext,\n type SeparatorProps,\n type SeparatorRenderProps,\n} from './Separator';\n\n// Toolbar\nexport {\n Toolbar,\n ToolbarContext,\n type ToolbarProps,\n type ToolbarRenderProps,\n type ToolbarContextValue,\n} from './Toolbar';\n\n// Autocomplete\nexport {\n Autocomplete,\n AutocompleteContext,\n AutocompleteStateContext,\n AutocompleteCollectionContext,\n useAutocompleteInput,\n useAutocompleteState,\n useAutocompleteCollection,\n type AutocompleteProps,\n type AutocompleteContextValue,\n type AutocompleteCollectionContextValue,\n} from './Autocomplete';\n\n// ListBox\nexport {\n ListBox,\n ListBoxOption,\n ListBoxOption as ListBoxItem,\n ListBoxSection,\n ListBoxLoadMoreItem,\n ListBoxContext,\n ListBoxStateContext,\n ListStateContext,\n type ListBoxProps,\n type ListBoxRenderProps,\n type ListBoxOptionProps,\n type ListBoxOptionRenderProps,\n type ListBoxOptionProps as ListBoxItemProps,\n type ListBoxOptionRenderProps as ListBoxItemRenderProps,\n type ListBoxSectionProps,\n type ListBoxLoadMoreItemProps,\n} from './ListBox';\n\n// Menu\nexport {\n Menu,\n MenuItem,\n MenuSection,\n MenuTrigger,\n SubmenuTrigger,\n MenuButton,\n MenuContext,\n MenuStateContext,\n MenuTriggerContext,\n RootMenuTriggerStateContext,\n type MenuProps,\n type MenuRenderProps,\n type MenuItemProps,\n type MenuItemRenderProps,\n type MenuSectionProps,\n type MenuTriggerProps,\n type SubmenuTriggerProps,\n type MenuTriggerRenderProps,\n type MenuButtonProps,\n} from './Menu';\n\n// Select\nexport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectListBox,\n SelectOption,\n SelectContext,\n SelectValueContext,\n SelectStateContext,\n type SelectProps,\n type SelectRenderProps,\n type SelectTriggerProps,\n type SelectTriggerRenderProps,\n type SelectValueProps,\n type SelectValueRenderProps,\n type SelectListBoxProps,\n type SelectListBoxRenderProps,\n type SelectOptionProps,\n type SelectOptionRenderProps,\n} from './Select';\n\n// Tabs\nexport {\n Tabs,\n TabList,\n Tab,\n TabPanel as TabPanels,\n TabPanel,\n TabsContext,\n TabsStateContext,\n TabsStateContext as TabListStateContext,\n type TabsProps,\n type TabsRenderProps,\n type TabListProps,\n type TabListRenderProps,\n type TabProps,\n type TabRenderProps,\n type TabPanelProps,\n type TabPanelRenderProps,\n} from './Tabs';\n\n// SelectionIndicator\nexport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorProps,\n type SelectionIndicatorRenderProps,\n} from './SelectionIndicator';\n\n// Collection primitives\nexport {\n Collection,\n CollectionBuilder,\n createLeafComponent,\n createBranchComponent,\n CollectionRendererContext,\n SelectableCollectionContext,\n DefaultCollectionRenderer,\n GroupContext,\n HeaderContext,\n HeadingContext,\n Section,\n Header,\n Group,\n isCollectionSection,\n flattenCollectionEntries,\n type SectionProps,\n type HeaderProps,\n type GroupProps,\n type CollectionEntry,\n type CollectionSection,\n type CollectionDropTargetDelegate,\n type CollectionRenderer,\n type CollectionRootProps,\n type CollectionBranchProps,\n type CollectionRendererContextValue,\n type CollectionPrimitiveRenderProps,\n} from './Collection';\n\n// Drag and Drop\nexport {\n DragAndDropContext,\n DropIndicator,\n DropIndicatorContext,\n useDndPersistedKeys,\n useRenderDropIndicator,\n type DragAndDropContextValue,\n type DropIndicatorProps,\n type DropIndicatorRenderProps,\n type DropTargetDelegate,\n} from './DragAndDrop';\nexport {\n useDragAndDrop,\n type DragAndDropOptions,\n type DragAndDropHooks,\n} from './useDragAndDrop';\n\n// Breadcrumbs\nexport {\n Breadcrumbs,\n BreadcrumbItem,\n BreadcrumbItem as Breadcrumb,\n BreadcrumbsContext,\n type BreadcrumbsProps,\n type BreadcrumbsRenderProps,\n type BreadcrumbItemProps,\n type BreadcrumbItemRenderProps,\n} from './Breadcrumbs';\n\n// NumberField\nexport {\n NumberField,\n NumberFieldLabel,\n NumberFieldGroup,\n NumberFieldInput,\n NumberFieldIncrementButton,\n NumberFieldDecrementButton,\n NumberFieldContext,\n NumberFieldStateContext,\n type NumberFieldProps,\n type NumberFieldRenderProps,\n type NumberFieldInputProps,\n type NumberFieldInputRenderProps,\n type NumberFieldIncrementButtonProps,\n type NumberFieldDecrementButtonProps,\n type NumberFieldButtonRenderProps,\n} from './NumberField';\n\n// SearchField\nexport {\n SearchField,\n SearchFieldLabel,\n SearchFieldInput,\n SearchFieldClearButton,\n SearchFieldContext,\n type SearchFieldProps,\n type SearchFieldRenderProps,\n type SearchFieldInputProps,\n type SearchFieldInputRenderProps,\n type SearchFieldClearButtonProps,\n type SearchFieldClearButtonRenderProps,\n} from './SearchField';\n\n// Slider\nexport {\n Slider,\n SliderTrack,\n SliderThumb,\n SliderOutput,\n SliderContext,\n SliderStateContext,\n SliderTrackContext,\n SliderOutputContext,\n type SliderProps,\n type SliderRenderProps,\n type SliderTrackProps,\n type SliderTrackRenderProps,\n type SliderThumbProps,\n type SliderThumbRenderProps,\n type SliderOutputProps,\n type SliderOutputRenderProps,\n} from './Slider';\n\n// Tooltip\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContext,\n TooltipTriggerStateContext,\n type TooltipProps,\n type TooltipRenderProps,\n type TooltipTriggerComponentProps,\n type TooltipTriggerState,\n} from './Tooltip';\n\n// ComboBox\nexport {\n ComboBox,\n ComboBoxValue,\n ComboBoxInput,\n ComboBoxLabel,\n ComboBoxDescription,\n ComboBoxErrorMessage,\n ComboBoxButton,\n ComboBoxListBox,\n ComboBoxOption,\n ComboBoxContext,\n ComboBoxStateContext,\n ComboBoxValueContext,\n defaultContainsFilter,\n type ComboBoxProps,\n type ComboBoxRenderProps,\n type ComboBoxValueProps,\n type ComboBoxValueRenderProps,\n type ComboBoxInputProps,\n type ComboBoxInputRenderProps,\n type ComboBoxLabelProps,\n type ComboBoxDescriptionProps,\n type ComboBoxErrorMessageProps,\n type ComboBoxButtonProps,\n type ComboBoxButtonRenderProps,\n type ComboBoxListBoxProps,\n type ComboBoxListBoxRenderProps,\n type ComboBoxOptionProps,\n type ComboBoxOptionRenderProps,\n} from './ComboBox';\n\n// Dialog\nexport {\n Dialog,\n DialogTrigger,\n DialogContext,\n DialogTriggerContext,\n useDialogTrigger,\n Heading,\n DialogHeading,\n type DialogProps,\n type DialogRenderProps,\n type DialogTriggerProps,\n type HeadingProps,\n} from './Dialog';\n\n// Modal\nexport {\n Modal,\n ModalOverlay,\n ModalContext,\n OverlayTriggerStateContext,\n useOverlayTriggerState,\n type ModalProps,\n type ModalOverlayProps,\n type ModalRenderProps,\n type OverlayTriggerState,\n} from './Modal';\n\n// Popover\nexport {\n Popover,\n PopoverTrigger,\n PopoverContext,\n PopoverTriggerContext,\n usePopoverTrigger,\n OverlayArrow,\n type PopoverProps,\n type PopoverRenderProps,\n type PopoverTriggerProps,\n type PopoverTriggerContextValue,\n type OverlayArrowProps,\n} from './Popover';\n\n// Toast\nexport {\n Toast,\n Toast as UNSTABLE_Toast,\n ToastRegion as UNSTABLE_ToastRegion,\n ToastRegion as UNSTABLE_ToastList,\n Toast as UNSTABLE_ToastContent,\n ToastRegion,\n ToastProvider,\n ToastContext,\n ToastContext as UNSTABLE_ToastStateContext,\n ToastTitle,\n ToastDescription,\n ToastCloseButton,\n DefaultToast,\n useToastContext,\n globalToastQueue,\n addToast,\n type ToastContent,\n type ToastProps,\n type ToastRenderProps,\n type ToastRegionProps,\n type ToastRegionRenderProps,\n type ToastProviderProps,\n type ToastTitleProps,\n type ToastDescriptionProps,\n type ToastCloseButtonProps,\n type DefaultToastProps,\n} from './Toast';\n\n// Disclosure\nexport {\n Disclosure,\n DisclosureGroup,\n DisclosureTrigger,\n DisclosurePanel,\n DisclosureContext,\n DisclosureGroupContext,\n DisclosureStateContext,\n DisclosureGroupStateContext,\n useDisclosureContext,\n useDisclosureGroupContext,\n type DisclosureProps,\n type DisclosureRenderProps,\n type DisclosureGroupProps,\n type DisclosureGroupRenderProps,\n type DisclosureTriggerProps,\n type DisclosurePanelProps,\n type DisclosureState,\n type DisclosureGroupState,\n} from './Disclosure';\n\n// Meter\nexport {\n Meter,\n MeterContext,\n type MeterProps,\n type MeterRenderProps,\n} from './Meter';\n\n// TagGroup\nexport {\n TagGroup,\n TagList,\n Tag,\n TagRemoveButton,\n TagGroupContext,\n TagListStateContext,\n TagListStateContext as TagListContext,\n useTagGroupContext,\n type TagGroupProps,\n type TagGroupRenderProps,\n type TagListProps,\n type TagListRenderProps,\n type TagProps,\n type TagRenderProps,\n type TagRemoveButtonProps,\n} from './TagGroup';\n\n// Calendar\nexport {\n Calendar,\n CalendarHeading,\n CalendarButton,\n CalendarGrid,\n CalendarGridHeader,\n CalendarGridBody,\n CalendarHeaderCell,\n CalendarCell,\n CalendarContext,\n CalendarContext as CalendarStateContext,\n useCalendarContext,\n type CalendarProps,\n type CalendarRenderProps,\n type CalendarHeadingProps,\n type CalendarButtonProps,\n type CalendarGridProps,\n type CalendarGridHeaderProps,\n type CalendarGridBodyProps,\n type CalendarGridRenderProps,\n type CalendarCellProps,\n type CalendarCellRenderProps,\n type CalendarHeaderCellProps,\n type CalendarState,\n type CalendarDate,\n type DateValue,\n} from './Calendar';\n\n// RangeCalendar\nexport {\n RangeCalendar,\n RangeCalendarHeading,\n RangeCalendarButton,\n RangeCalendarGrid,\n RangeCalendarCell,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useRangeCalendarContext,\n type RangeCalendarProps,\n type RangeCalendarRenderProps,\n type RangeCalendarHeadingProps,\n type RangeCalendarButtonProps,\n type RangeCalendarGridProps,\n type RangeCalendarGridRenderProps,\n type RangeCalendarCellProps,\n type RangeCalendarCellRenderProps,\n type RangeCalendarState,\n type RangeValue,\n} from './RangeCalendar';\n\n// DateField\nexport {\n DateField,\n DateFieldLabel,\n DateFieldDescription,\n DateFieldErrorMessage,\n DateInput,\n DateSegment,\n DateFieldContext,\n DateFieldStateContext,\n useDateFieldContext,\n type DateFieldProps,\n type DateFieldRenderProps,\n type DateInputProps,\n type DateInputRenderProps,\n type DateSegmentProps,\n type DateSegmentRenderProps,\n type DateFieldLabelProps,\n type DateFieldDescriptionProps,\n type DateFieldErrorMessageProps,\n type DateFieldContextValue,\n type DateFieldState,\n type DateSegmentType,\n} from './DateField';\n\n// TimeField\nexport {\n TimeField,\n TimeFieldLabel,\n TimeFieldDescription,\n TimeFieldErrorMessage,\n TimeInput,\n TimeSegment,\n TimeFieldContext,\n TimeFieldStateContext,\n useTimeFieldContext,\n type TimeFieldProps,\n type TimeFieldRenderProps,\n type TimeInputProps,\n type TimeInputRenderProps,\n type TimeSegmentProps,\n type TimeSegmentRenderProps,\n type TimeFieldLabelProps,\n type TimeFieldDescriptionProps,\n type TimeFieldErrorMessageProps,\n type TimeFieldContextValue,\n type TimeFieldState,\n type TimeSegmentType,\n type TimeValue,\n} from './TimeField';\n\n// DatePicker\nexport {\n DatePicker,\n DateRangePicker,\n DatePickerLabel,\n DatePickerDescription,\n DatePickerErrorMessage,\n DateRangePickerLabel,\n DateRangePickerDescription,\n DateRangePickerErrorMessage,\n DatePickerButton,\n DateRangePickerButton,\n DatePickerContent,\n DateRangePickerContent,\n DatePickerContext,\n DateRangePickerContext,\n DatePickerStateContext,\n DateRangePickerStateContext,\n useDatePickerContext,\n useDateRangePickerContext,\n type DatePickerProps,\n type DateRangePickerProps,\n type DatePickerRenderProps,\n type DateRangePickerRenderProps,\n type DatePickerButtonProps,\n type DateRangePickerButtonProps,\n type DatePickerButtonRenderProps,\n type DatePickerContentProps,\n type DateRangePickerContentProps,\n type DatePickerLabelProps,\n type DatePickerDescriptionProps,\n type DatePickerErrorMessageProps,\n type DateRangePickerLabelProps,\n type DateRangePickerDescriptionProps,\n type DateRangePickerErrorMessageProps,\n type DatePickerContextValue,\n type DateRangePickerContextValue,\n} from './DatePicker';\n\n// Table\nexport {\n Table,\n TableHeader,\n TableColumn,\n TableColumn as Column,\n ColumnResizer,\n TableBody,\n TableLoadMoreItem,\n TableRow,\n TableRow as Row,\n TableCell,\n TableCell as Cell,\n ResizableTableContainer,\n useTableOptions,\n TableSelectionCheckbox,\n TableSelectAllCheckbox,\n TableContext,\n TableStateContext,\n TableColumnResizeStateContext,\n TableRowContext,\n type TableProps,\n type TableRenderProps,\n type TableHeaderProps,\n type TableHeaderRenderProps,\n type TableColumnProps,\n type TableColumnRenderProps,\n type ColumnResizerProps,\n type TableBodyProps,\n type TableBodyRenderProps,\n type ResizableTableContainerProps,\n type TableLoadMoreItemProps,\n type TableRowProps,\n type TableRowRenderProps,\n type TableCellProps,\n type TableCellRenderProps,\n} from './Table';\n\n// GridList\nexport {\n GridList,\n GridListHeader,\n GridListItem,\n GridListSection,\n GridListSelectionCheckbox,\n GridListLoadMoreItem,\n GridListContext,\n GridListHeaderContext,\n GridListStateContext,\n type GridListProps,\n type GridListRenderProps,\n type GridListItemProps,\n type GridListItemRenderProps,\n type GridListHeaderProps,\n type GridListSectionProps,\n type GridListLoadMoreItemProps,\n} from './GridList';\n\n// Tree\nexport {\n Tree,\n TreeItem,\n TreeItemContent,\n TreeHeader,\n TreeSection,\n TreeExpandButton,\n TreeSelectionCheckbox,\n TreeLoadMoreItem,\n TreeContext,\n TreeStateContext,\n TreeItemContext,\n type TreeProps,\n type TreeRenderProps,\n type TreeRenderItemState,\n type TreeItemProps,\n type TreeItemRenderProps,\n type TreeItemContentProps,\n type TreeItemContentRenderProps,\n type TreeHeaderProps,\n type TreeSectionProps,\n type TreeExpandButtonProps,\n type TreeLoadMoreItemProps,\n} from './Tree';\n\n// Color\nexport {\n // ColorSlider\n ColorSlider,\n ColorSliderTrack,\n ColorSliderThumb,\n ColorThumb,\n ColorSliderContext,\n ColorSliderStateContext,\n type ColorSliderProps,\n type ColorSliderRenderProps,\n type ColorSliderTrackProps,\n type ColorSliderTrackRenderProps,\n type ColorSliderThumbProps,\n type ColorSliderThumbRenderProps,\n // ColorArea\n ColorArea,\n ColorAreaGradient,\n ColorAreaThumb,\n ColorAreaContext,\n ColorAreaStateContext,\n type ColorAreaProps,\n type ColorAreaRenderProps,\n type ColorAreaGradientProps,\n type ColorAreaGradientRenderProps,\n type ColorAreaThumbProps,\n type ColorAreaThumbRenderProps,\n // ColorWheel\n ColorWheel,\n ColorWheelTrack,\n ColorWheelThumb,\n ColorWheelContext,\n ColorWheelStateContext,\n ColorWheelTrackContext,\n type ColorWheelProps,\n type ColorWheelRenderProps,\n type ColorWheelTrackProps,\n type ColorWheelTrackRenderProps,\n type ColorWheelThumbProps,\n type ColorWheelThumbRenderProps,\n // ColorField\n ColorField,\n ColorFieldInput,\n ColorFieldContext,\n ColorFieldStateContext,\n ColorPicker,\n ColorPickerContext,\n ColorPickerStateContext,\n type ColorFieldProps,\n type ColorFieldRenderProps,\n type ColorFieldInputProps,\n type ColorFieldInputRenderProps,\n type ColorPickerProps,\n type ColorPickerRenderProps,\n // ColorSwatch\n ColorSwatch,\n ColorSwatchContext,\n ColorSwatchPicker,\n ColorSwatchPickerItem,\n ColorSwatchPickerContext,\n type ColorSwatchProps,\n type ColorSwatchRenderProps,\n type ColorSwatchPickerProps,\n type ColorSwatchPickerItemProps,\n} from './Color';\n\n// ContextualHelpTrigger\nexport {\n ContextualHelpTrigger,\n type ContextualHelpTriggerProps,\n type ContextualHelpTriggerRenderProps,\n} from './ContextualHelpTrigger';\n\n// ColorEditor\nexport {\n ColorEditor,\n type ColorEditorProps,\n type ColorEditorRenderProps,\n type ColorEditorColorSpace,\n} from './ColorEditor';\n\n// Landmark\nexport {\n Landmark,\n LandmarkContext,\n useLandmarkController,\n type LandmarkProps,\n type LandmarkRenderProps,\n type AriaLandmarkRole,\n type LandmarkController,\n} from './Landmark';\n\n// ActionBar\nexport {\n ActionBar,\n ActionBarContainer,\n ActionBarSelectionCount,\n ActionBarClearButton,\n ActionBarContext,\n useActionBarContext,\n type ActionBarProps,\n type ActionBarRenderProps,\n type ActionBarContainerProps,\n type ActionBarSelectionCountProps,\n type ActionBarClearButtonProps,\n type ActionBarContextValue,\n} from './ActionBar';\n\n// ActionGroup\nexport {\n ActionGroup,\n ActionGroupContext,\n ActionGroupStateContext,\n useActionGroupContext,\n type ActionGroupProps,\n type ActionGroupRenderProps,\n type ActionGroupItemRenderProps,\n type ActionGroupItem,\n type ActionGroupContextValue,\n} from './ActionGroup';\n\n// Alert\nexport {\n Alert,\n AlertContext,\n AlertDismissButton,\n type AlertProps,\n type AlertRenderProps,\n type AlertVariant,\n type AlertContextValue,\n type AlertDismissButtonProps,\n} from './Alert';\n\n// Icon\nexport {\n Icon,\n IconContext,\n type IconProps,\n type IconRenderProps,\n} from './Icon';\n\n// Focusable\nexport {\n Focusable,\n type FocusableProps,\n} from './Focusable';\n\n// Pressable\nexport {\n Pressable,\n type PressableProps,\n} from './Pressable';\n\n// RouterProvider\nexport {\n RouterProvider,\n RouterContext,\n useRouter,\n type RouterProviderProps,\n type RouterContextValue,\n type RouterOptions,\n} from './RouterProvider';\n\n// ============================================\n// RE-EXPORTS FROM LOWER LAYERS\n// ============================================\n\n// DnD utilities\nexport { DIRECTORY_DRAG_TYPE } from '@proyecto-viviana/solid-stately';\nexport { isDirectoryDropItem, isFileDropItem, isTextDropItem } from '@proyecto-viviana/solidaria';\nexport { createDrag as useDrag, createDrop as useDrop } from '@proyecto-viviana/solidaria';\n\n// i18n\nexport { isRTL, I18nProvider, useLocale, createFilter as useFilter } from '@proyecto-viviana/solidaria';\n\n// SSR\nexport { SSRProvider } from '@proyecto-viviana/solidaria';\n\n// Color + Form\nexport { parseColor, FormValidationContext } from '@proyecto-viviana/solid-stately';\n\n// Toast alias\nexport { ToastQueue as UNSTABLE_ToastQueue } from '@proyecto-viviana/solid-stately';\n\n// Data hooks (aliased to match RAC's useXxx naming)\nexport {\n createListData,\n createListData as useListData,\n createTreeData,\n createTreeData as useTreeData,\n createAsyncList,\n createAsyncList as useAsyncList,\n getColorChannels,\n type ListOptions,\n type ListData,\n type TreeOptions,\n type TreeData,\n type TreeDataNode,\n type AsyncListOptions,\n type AsyncListData,\n type AsyncListLoadFunction,\n type SortDescriptor,\n type LoadingState,\n} from '@proyecto-viviana/solid-stately';\n"],"mappings":";;AAKA,SAKEA,eACAC,YACAC,YACAC,cACAC,SACAC,YACK;AACP,SAASC,gBAAgB;AAyClB,I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AACsB,WAAWG,QAAQ,KAAKT,WAAW;AAC7CH,gBAAMsB,oBAAoBb,WAAWG,QAAQ;QAC/C;MACF,CAAC;IACH;EACF,CAAC;AAED,SAAUb,SAAS;AACrB;;;ACk5BA,SAAS,2BAA2B;AACpC,SAAS,qBAAqB,gBAAgB,sBAAsB;AACpE,SAAuB,YAAuB,cAAdwB,mBAA6B;AAG7D,SAAS,OAAO,cAAc,WAA2B,oBAAiB;AAG1E,SAAS,mBAAmB;AAG5B,SAAS,YAAY,yBAAAC,8BAA6B;AAGlD,SAAuB,cAAdC,mBAAyC;AAGlD;AAAA,EACE;AAAA,EACkB,kBAAlBC;AAAA,EACA;AAAA,EACkB,kBAAlBC;AAAA,EACA;AAAA,EACmB,mBAAnBC;AAAA,EACA,oBAAAC;AAAA,OAWK;","names":["createContext","useContext","createMemo","createSignal","onMount","Show","isServer","DEFAULT_SLOT","useRenderProps","props","values","class","className","style","defaultClassName","computedClass","currentValues","computedStyle","renderChildren","children","composeRenderProps","base","override","useSlottedContext","context","useContext","useContextProps","props","ref","Provider","children","dataAttr","value","undefined","createDataAttributes","values","result","key","Object","entries","camelToKebab","str","replace","toLowerCase","removeDataAttributes","startsWith","filterDOMProps","options","global","globalAttrs","Set","ariaAttrs","dataAttrs","eventHandlers","prototype","hasOwnProperty","call","has","test","useIsHydrated","isServer","isHydrated","setIsHydrated","createSignal","requestAnimationFrame","splitProps","Dynamic","createVisuallyHidden","mergeProps","VisuallyHidden","props","local","others","visuallyHiddenProps","style","isFocusable","elementType","mergedProps","_$createComponent","_$mergeProps","component","children","createContext","createMemo","splitProps","useContext","createButton","createFocusRing","createHover","mergeProps","createContext","useContext","ButtonContext","createContext","Button","props","contextProps","useContext","mergedProps","mergeProps","local","ariaProps","splitProps","dialogTriggerContext","DialogTriggerContext","popoverTriggerContext","PopoverTriggerContext","resolveDisabled","disabled","isDisabled","resolvePending","isPending","buttonEl","isDialogTrigger","triggerRef","isPopoverTrigger","handlePress","e","onPress","state","toggle","buttonAria","createButton","onPressStart","undefined","onPressEnd","onPressUp","onPressChange","onClick","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","renderValues","createMemo","isPressed","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","buttonPropsRef","buttonProps","ref","focusPropsRef","hoverPropsRef","cleanButtonProps","_ref1","rest","cleanFocusProps","_ref2","cleanHoverProps","_ref3","handleRef","el","setTriggerRef","_$ssrElement","_$mergeProps","type","_$escape","renderChildren","createContext","createMemo","splitProps","createSwitch","createFocusRing","createHover","createToggleState","ToggleSwitchContext","createContext","ToggleSwitch","props","inputRef","local","ariaProps","splitProps","state","createToggleState","isSelected","defaultSelected","onChange","isReadOnly","switchAria","createSwitch","children","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","isDisabled","renderValues","createMemo","isPressed","renderProps","useRenderProps","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","id","onClick","cleanLabelProps","ref","_ref1","rest","labelProps","cleanHoverProps","_ref2","cleanInputProps","_ref3","inputProps","cleanFocusProps","_ref4","_$ssrElement","_$mergeProps","undefined","_$escape","_$createComponent","VisuallyHidden","renderChildren","createContext","createMemo","splitProps","useContext","createToggleButton","createToggleButtonGroupItem","createFocusRing","createHover","mergeProps","createContext","createMemo","splitProps","useContext","createToggleButtonGroup","mergeProps","createToggleGroupState","ToggleButtonGroupContext","createContext","ToggleButtonGroupStateContext","ToggleGroupStateContext","ToggleButtonGroup","props","local","domProps","splitProps","state","createToggleGroupState","selectionMode","disallowEmptySelection","selectedKeys","defaultSelectedKeys","onSelectionChange","isDisabled","groupProps","createToggleButtonGroup","orientation","renderProps","useRenderProps","children","class","style","defaultClassName","filteredDomProps","createMemo","filterDOMProps","global","mergedGroupProps","mergeProps","_$ssrElement","_$mergeProps","slot","undefined","_$escape","_$createComponent","Provider","value","renderChildren","useToggleButtonGroupStateContext","useContext","ToggleButtonContext","createContext","resolveDisabledValue","isDisabled","ToggleButton","props","contextProps","useContext","mergedProps","mergeProps","local","ariaProps","splitProps","groupState","useToggleButtonGroupStateContext","groupKey","id","toggleKey","toggleAria","createToggleButtonGroupItem","createToggleButton","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","renderValues","createMemo","isPressed","isSelected","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","onClick","cleanButtonProps","ref","_ref1","rest","buttonProps","cleanFocusProps","_ref2","cleanHoverProps","_ref3","_$ssrElement","_$mergeProps","slot","undefined","_$escape","renderChildren","createContext","useContext","createMemo","splitProps","createCheckbox","createCheckboxGroup","createCheckboxGroupItem","createFocusRing","createHover","createToggleState","createCheckboxGroupState","CheckboxGroupContext","createContext","CheckboxGroupStateContext","CheckboxContext","CheckboxGroup","props","local","ariaProps","splitProps","state","createCheckboxGroupState","value","defaultValue","onChange","isDisabled","isReadOnly","isRequired","isInvalid","groupAria","createCheckboxGroup","renderValues","createMemo","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","cleanGroupProps","ref","_ref","rest","groupProps","resolvedChildren","_$createComponent","Provider","_$ssrElement","_$mergeProps","undefined","_$escape","Checkbox","inputRef","groupState","useContext","isSelected","isPressed","labelProps","inputProps","itemAria","createCheckboxGroupItem","createToggleState","defaultSelected","checkboxAria","createCheckbox","isIndeterminate","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","filtered","id","onClick","cleanLabelProps","_ref1","cleanHoverProps","_ref2","cleanInputProps","_ref3","cleanFocusProps","_ref4","VisuallyHidden","renderChildren","createContext","useContext","createMemo","splitProps","Show","createRadio","createRadioGroup","createFocusRing","createHover","createRadioGroupState","createContext","createMemo","splitProps","useContext","Show","createContext","createEffect","createMemo","createSignal","onCleanup","splitProps","useContext","Show","on","getAnimations","el","SharedElementContext","createContext","useHasSharedElementTransitionScope","useContext","SharedElementTransition","props","scope","snapshots","_$createComponent","Provider","value","children","SharedElement","Error","local","domProps","splitProps","lifecycle","setLifecycle","createSignal","isVisible","elementRef","frame","setRef","userRef","ref","undefined","createEffect","on","name","element","cancelAnimationFrame","prevSnapshot","animations","values","style","map","property","prevValue","prevRect","rect","currentRect","getBoundingClientRect","deltaX","left","deltaY","top","translate","a","includes","cancel","requestAnimationFrame","queueMicrotask","Promise","all","finished","then","catch","onCleanup","isConnected","hasAttribute","window","getComputedStyle","transitionProperty","split","p","renderProps","useRenderProps","class","defaultClassName","isEntering","isExiting","filteredDomProps","createMemo","filterDOMProps","global","Show","when","_$ssrElement","_$mergeProps","_$escape","renderChildren","SelectionIndicatorContext","createContext","SelectionIndicator","props","local","domProps","splitProps","context","useContext","hasSharedElementScope","useHasSharedElementTransitionScope","isSelected","isVisible","shouldForceMount","renderValues","createMemo","renderProps","useRenderProps","children","class","style","defaultClassName","sharedElementProps","ref","_ref","rest","_$createComponent","SharedElement","_$mergeProps","name","undefined","renderChildren","Show","when","_$ssrElement","_$escape","RadioGroupContext","createContext","RadioGroupStateContext","RadioContext","RadioGroup","props","local","ariaProps","splitProps","state","createRadioGroupState","value","defaultValue","onChange","isDisabled","isReadOnly","isRequired","isInvalid","groupAria","createRadioGroup","renderValues","createMemo","orientation","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","cleanGroupProps","ref","_ref","rest","radioGroupProps","resolvedChildren","_$createComponent","Provider","_$ssrElement","_$mergeProps","undefined","_$escape","RadioImpl","inputRef","radioProps","radioAria","createRadio","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","isSelected","isPressed","selectionIndicatorContext","filtered","id","onClick","cleanLabelProps","_ref1","labelProps","cleanHoverProps","_ref2","cleanInputProps","_ref3","inputProps","cleanFocusProps","_ref4","SelectionIndicatorContext","VisuallyHidden","renderChildren","Radio","getState","useContext","Show","when","fallback","keyed","createContext","useContext","createMemo","splitProps","createTextField","createFocusRing","createHover","mergeProps","createTextFieldState","TextFieldContext","createContext","LabelContext","InputContext","TextAreaContext","FieldInputContext","Label","props","context","useContext","mergedProps","ref","_ref","contextLabelProps","labelProps","_$ssrElement","_$escape","children","Input","contextInputProps","inputProps","undefined","TextArea","type","_type","TextField","local","ariaProps","splitProps","state","createTextFieldState","value","defaultValue","onChange","textFieldAria","createTextField","setValue","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","isDisabled","renderValues","createMemo","isInvalid","isReadOnly","isRequired","renderProps","useRenderProps","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","id","cleanHoverProps","rest","contextValue","mergeProps","descriptionProps","errorMessageProps","_$createComponent","Provider","_$mergeProps","renderChildren","createContext","TextContext","Text","props","_$ssr","_tmpl$","_$ssrAttribute","_$escape","class","_$ssrStyle","style","children","createContext","createMemo","splitProps","Dynamic","createLink","createFocusRing","createHover","createContext","useContext","defaultRouter","isNative","navigate","open","target","modifiers","openSyntheticLink","useHref","href","RouterContext","shouldClientNavigate","link","getAttribute","sameOrigin","location","origin","hasAttribute","metaKey","ctrlKey","altKey","shiftKey","openLink","event","MouseEvent","detail","bubbles","cancelable","dispatchEvent","getSyntheticLink","HTMLAnchorElement","document","createElement","targetValue","rel","download","ping","referrerPolicy","appendChild","removeChild","handleLinkClick","event","router","href","routerOptions","isNative","currentTarget","HTMLAnchorElement","defaultPrevented","shouldClientNavigate","preventDefault","open","RouterProvider","props","ctx","navigate","target","modifiers","getSyntheticLink","link","openLink","useHref","_$createComponent","RouterContext","Provider","value","children","useRouter","useContext","LinkContext","createContext","Link","props","local","ariaProps","splitProps","router","useRouter","resolvedHref","createMemo","href","useHref","undefined","elementType","isDisabled","linkAria","createLink","hrefLang","target","rel","download","ping","referrerPolicy","onPress","onPressStart","onPressEnd","onClick","onFocus","onBlur","onFocusChange","onKeyDown","onKeyUp","autoFocus","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","onHoverStart","onHoverEnd","onHoverChange","renderValues","isCurrent","isPressed","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","cleanLinkProps","ref","_ref1","rest","linkProps","cleanHoverProps","_ref2","cleanFocusProps","_ref3","onLinkClick","event","handleLinkClick","routerOptions","_$createComponent","Dynamic","_$mergeProps","component","renderChildren","createContext","splitProps","useContext","KeyboardContext","Keyboard","props","context","merged","local","domProps","_$ssrElement","_$mergeProps","dir","_$escape","children","createContext","splitProps","FormValidationContext","FormContext","createContext","Form","props","local","domProps","splitProps","validationBehavior","errors","validationErrors","renderProps","useRenderProps","children","class","style","defaultClassName","filteredDomProps","filterDOMProps","global","_$ssrElement","_$mergeProps","noValidate","slot","_$escape","_$createComponent","Provider","value","FormValidationContext","renderChildren","createContext","createMemo","splitProps","useContext","FieldErrorContext","createContext","FieldError","props","contextValidation","useContext","local","domProps","splitProps","validation","createMemo","isInvalid","renderProps","useRenderProps","children","validationErrors","join","class","style","defaultClassName","renderChildren","filteredDomProps","filterDOMProps","global","_$ssrElement","_$mergeProps","slot","_$escape","createSignal","splitProps","createPress","FileTrigger","props","local","inputProps","inputRef","setInputRef","openFilePicker","input","value","click","pressProps","isDisabled","disabled","onPress","_e","onInputChange","e","onSelect","currentTarget","files","_$ssrElement","_$escape","children","_$mergeProps","type","style","display","accept","acceptedFileTypes","join","multiple","allowsMultiple","capture","defaultCamera","webkitdirectory","acceptDirectory","undefined","createContext","createMemo","createSignal","splitProps","createDrop","createFocusRing","createHover","readFromDataTransfer","DropZoneContext","createContext","DEFAULT_DROPZONE_LABEL","FOCUSABLE_SELECTOR","join","isFocusableElement","target","HTMLElement","matches","DropZone","props","local","dropProps","hoverEventProps","domProps","splitProps","dropZoneRef","setDropZoneRef","createSignal","dropButtonRef","setDropButtonRef","dropAria","createDrop","getDropOperation","getDropOperationForPoint","onDropEnter","onDropMove","onDropActivate","onDropExit","onDrop","hasDropButton","isDisabled","isHovered","hoverProps","createHover","onHoverStart","onHoverEnd","onHoverChange","isFocused","isFocusVisible","focusProps","createFocusRing","renderValues","createMemo","isDropTarget","renderProps","useRenderProps","children","class","style","defaultClassName","filteredDomProps","filterDOMProps","global","cleanDropProps","ref","_ref","rest","cleanHoverProps","cleanFocusProps","cleanDropButtonProps","dropButtonProps","onRootClick","e","onClick","defaultPrevented","root","hiddenButton","Element","contains","focus","parentElement","onHiddenButtonPaste","clipboardData","items","readFromDataTransfer","length","preventDefault","type","x","y","dropOperation","dropButtonAriaLabel","undefined","_$ssrElement","_$mergeProps","slot","_$escape","_$createComponent","VisuallyHidden","renderChildren","createContext","createMemo","createSignal","onCleanup","onMount","splitProps","useContext","createContext","createMemo","splitProps","useContext","For","Collection","AriaCollection","CollectionBuilder","AriaCollectionBuilder","createLeafComponent","createBranchComponent","CollectionRendererContext","createContext","SelectableCollectionContext","SectionContext","GroupContext","HeaderContext","HeadingContext","useCollectionRenderer","useContext","isCollectionSection","entry","Array","isArray","items","flattenCollectionEntries","entries","flattened","push","renderCollectionItems","collection","renderDropIndicator","from","_$createComponent","For","each","children","item","index","node","type","key","dropPosition","DefaultCollectionRenderer","CollectionRoot","props","CollectionBranch","CollectionBuilder","AriaCollectionBuilder","Collection","AriaCollection","Section","props","sectionContext","useContext","SectionContext","nodeEnv","globalThis","process","env","NODE_ENV","console","warn","name","render","local","domProps","splitProps","renderValues","createMemo","hasChildren","children","renderProps","useRenderProps","class","style","defaultClassName","filteredDomProps","filterDOMProps","global","_$ssrElement","_$mergeProps","slot","_$escape","renderChildren","Header","role","Group","VirtualizerContext","createContext","useVirtualizerContext","useContext","getObjectValue","value","key","isSameRange","a","b","start","end","offsetTop","offsetBottom","isSameLayoutInfo","index","rect","x","y","width","height","Virtualizer","props","local","domProps","splitProps","scrollOffset","setScrollOffset","createSignal","measuredViewportSize","setMeasuredViewportSize","measuredViewportWidth","setMeasuredViewportWidth","dropTargetResolver","setDropTargetResolver","undefined","dropTargetItemCountResolver","setDropTargetItemCountResolver","dropTargetIndexResolver","setDropTargetIndexResolver","dropOperationResolver","setDropOperationResolver","keyboardNavigationOverride","setKeyboardNavigationOverride","containerRef","fallbackLayout","ListLayout","visibleRangeCache","Map","layoutInfoCache","layout","createMemo","resolvedLayout","resolvedLayoutOptions","fromLayout","useLayoutOptions","layoutOptions","virtualOptions","layoutOptionsWithViewport","options","viewportWidth","itemSize","overscan","viewportSize","getVisibleRange","itemCount","ctx","layoutResult","nextRange","calculateLinearVisibleRange","cachedRange","get","set","getLayoutInfo","nextInfo","String","Math","max","cachedInfo","getDropTargetFromPoint","point","target","resolver","assignDropTargetResolver","assignDropTargetItemCountResolver","assignDropTargetIndexResolver","assignDropOperationResolver","assignKeyboardNavigationOverride","override","toCollectionDropTarget","type","dropPosition","position","getCollectionDropTargetFromPoint","isValidDropTarget","virtualTarget","mappedTarget","alternatePositions","alternateTarget","rootTarget","getCollectionDropOperation","types","allowedOperations","getDropOperation","length","includes","find","operation","getBaseKeyboardNavigationTarget","direction","resolveCurrentIndex","currentTarget","fromResolver","getCurrentIndex","resolvedIndex","tryCurrentItemTransition","tryPosition","nextTarget","scanFromIndex","startIndex","step","directionForInsertion","onTarget","tryTarget","insertionOrder","insertionTarget","findNavigationTarget","currentIndex","delta","stepSize","nextStart","clampedStart","min","primaryTarget","oppositeDirection","oppositeTarget","layoutInfo","tryBoundaryTarget","boundaryDirection","boundaryIndex","boundaryOrder","candidate","directTransition","boundaryTarget","wrappedBoundary","getKeyboardNavigationTarget","getKeyboardPageNavigationTarget","pageSize","floor","endBoundaryTarget","backwardFallback","startBoundaryTarget","forwardFallback","contextValue","isVirtualized","collectionRenderer","renderItem","item","layoutDelegate","dropTargetDelegate","renderDropIndicator","filteredDomProps","filterDOMProps","global","updateViewportSize","nextHeight","clientHeight","nextWidth","clientWidth","onMount","handleResize","window","addEventListener","onCleanup","removeEventListener","scrollFrame","cancelAnimationFrame","_$createComponent","CollectionRendererContext","Provider","children","_$ssrElement","_$mergeProps","class","style","_$escape","createContext","createMemo","splitProps","createProgressBar","ProgressBarContext","createContext","clamp","value","min","max","Math","getSafeRange","range","Number","isFinite","ProgressBar","props","local","ariaProps","splitProps","minValue","maxValue","isIndeterminate","progressAria","createProgressBar","valueLabel","formatOptions","label","percentage","createMemo","undefined","clampedValue","valueText","progressBarProps","renderValues","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","_$ssrElement","_$mergeProps","slot","_$escape","renderChildren","createContext","createMemo","splitProps","Dynamic","createSeparator","SeparatorContext","createContext","Separator","props","local","ariaProps","splitProps","elementType","createMemo","element","orientation","separatorAria","createSeparator","id","renderValues","resolvedClass","cls","class","resolvedStyle","style","domProps","filterDOMProps","global","_$createComponent","Dynamic","_$mergeProps","component","separatorProps","slot","createContext","createMemo","splitProps","useContext","createToolbar","ToolbarContext","createContext","Toolbar","props","local","ariaProps","domProps","splitProps","ctx","useContext","slotProps","slots","slot","toolbarProps","orientation","createToolbar","renderValues","createMemo","resolvedClass","cls","class","resolvedStyle","style","resolvedChildren","children","filteredDOMProps","filterDOMProps","global","_$ssrElement","_$mergeProps","_$escape","createContext","useContext","createMemo","splitProps","createAutocomplete","createAutocompleteState","AutocompleteContext","AutocompleteStateContext","AutocompleteCollectionContext","useAutocompleteInput","useAutocompleteState","useAutocompleteCollection","Autocomplete","props","stateProps","ariaProps","local","state","inputRef","collectionRef","autocomplete","inputContextValue","inputProps","el","collectionContextValue","collectionProps","filter","_$createComponent","Provider","value","children","createContext","createEffect","createMemo","createSignal","onCleanup","splitProps","useContext","For","Show","createListBox","createOption","createFocusRing","createHover","mergeProps","createListState","createContext","createMemo","useContext","DragAndDropContext","createContext","DropIndicatorContext","DefaultDropIndicator","props","dnd","useContext","isDropTarget","createMemo","target","dropState","renderProps","useRenderProps","children","class","style","defaultClassName","_$ssr","_tmpl$","_$ssrAttribute","_$escape","_$ssrStyle","dataAttr","renderChildren","DropIndicator","context","render","_$createComponent","useRenderDropIndicator","hooksOrDropState","maybeDropState","looksLikeDropState","value","Boolean","dragAndDropHooks","undefined","useDropIndicator","renderDropIndicator","targetsEqual","a","b","type","key","dropPosition","stateIsDropTarget","isTarget","isVirtualDragging","resolveKey","getAfterDropNormalizedKey","collection","nextKey","getKeyAfter","lastDescendantKey","targetLevel","getItem","level","node","getNormalizedDropTargetKey","useDndPersistedKeys","selectionManager","focusedKey","dropTargetKey","keys","Set","add","mergePersistedKeysIntoVirtualRange","baseRange","persistedIndexes","itemCount","layoutInfoProvider","maxExtraItems","options","validPersistedIndexes","Array","from","filter","index","sort","forceIndexes","forceIncludeIndexes","length","baseSpan","Math","max","end","start","maxSpan","distanceToBaseRange","nextStart","min","nextEnd","forceMaxSpan","forceIncludeMaxSpan","fallbackToForcedWindow","missingForced","nearestForced","windowSpan","centeredStart","floor","startRect","getLayoutInfo","rect","y","height","lastRect","endRect","offsetTop","offsetBottom","ListBoxContext","createContext","ListBoxStateContext","ListStateContext","ListBox","props","local","stateProps","ariaProps","splitProps","flatItems","createMemo","flattenCollectionEntries","items","hasSections","some","item","isCollectionSection","state","createListState","getKey","getTextValue","getDisabled","disabledKeys","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","resolveDisabled","disabled","isDisabled","listBoxAria","createListBox","isFocused","isFocusVisible","focusProps","createFocusRing","renderValues","isEmpty","collection","size","renderProps","useRenderProps","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","cleanListBoxProps","ref","_ref1","rest","listBoxProps","cleanFocusProps","_ref2","cleanLabelProps","_ref3","labelProps","listRef","setListRef","createSignal","length","parentCollectionRenderer","useCollectionRenderer","getItemNodes","Array","from","filter","node","type","getDropTargetByIndex","index","position","key","dropPosition","hasDroppableDnd","hooks","dragAndDropHooks","Boolean","useDroppableCollectionState","useDroppableCollection","dropTargetDelegate","ListDropTargetDelegate","dropState","undefined","hasDraggableDnd","useDraggableCollectionState","useDraggableCollection","dragState","createEffect","activeDragState","droppableCollection","activeDropState","resolveDirection","el","window","getComputedStyle","dir","direction","document","layout","orientation","keyboardDelegate","getFirstKey","getLastKey","getKeyBelow","getKeyAfter","getKeyAbove","getKeyBefore","getKeyPageBelow","getKeyPageAbove","isRootDropTarget","target","dndRenderDropIndicator","useRenderDropIndicator","dndDropIndicator","virtualizer","useVirtualizerContext","persistedKeys","useDndPersistedKeys","focusedKey","virtualRange","isVirtualized","baseRange","getVisibleRange","itemNodes","persistedIndexes","map","findIndex","dropTarget","normalizedDropKey","getNormalizedDropTargetKey","focusedIndex","forceIncludeIndexes","mergePersistedKeysIntoVirtualRange","forceIncludeMaxSpan","setDropTargetItemCountResolver","setDropTargetIndexResolver","setDropTargetResolver","onCleanup","visibleItems","range","slice","start","end","sectionedRenderEntries","globalIndex","entry","sectionItems","section","indexedItem","collectionRenderer","renderItem","children","renderDropIndicator","_$createComponent","Provider","value","CollectionRendererContext","Show","when","label","_$ssrElement","_$escape","_$mergeProps","mergeProps","collectionProps","SharedElementTransition","renderEmptyState","For","each","_$ssr","_tmpl$2","Section","title","Header","Group","_tmpl$","_$ssrAttribute","offsetTop","_tmpl$3","_$ssrStyleProperty","itemIndex","beforeIndicator","onIndicator","afterIndicator","offsetBottom","_tmpl$4","hasMore","onLoadMore","ListBoxLoadMoreItem","isLoading","ListBoxOption","context","useContext","Error","listContext","setRef","optionAria","createOption","id","textValue","shouldSelectOnPressUp","isHovered","hoverProps","createHover","isSelected","isPressed","hasPrimitiveLabel","selectionIndicatorContext","draggableItem","useDraggableItem","droppableItem","useDroppableItem","cleanOptionProps","_ariaDescribedby","optionProps","cleanHoverProps","SelectionIndicatorContext","dragProps","dropProps","isDragging","isDropTarget","renderChildren","isPending","setIsPending","triggerLoadMore","IntersectionObserver","observer","entries","isIntersecting","observe","disconnect","_tmpl$5","_$ssrStyle","ListBoxSection","Option","LoadMoreItem","createContext","createEffect","createMemo","createSignal","splitProps","useContext","For","Show","createMenu","createMenuItem","createMenuTrigger","createFocusRing","createHover","createButton","createInteractOutside","mergeProps","FocusScope","createMenuState","createMenuTriggerState","MenuContext","createContext","MenuStateContext","MenuTriggerContext","RootMenuTriggerStateContext","MenuTrigger","props","local","stateProps","splitProps","state","createMenuTriggerState","isOpen","defaultOpen","onOpenChange","menuTriggerProps","menuProps","createMenuTrigger","isDisabled","_$createComponent","Provider","value","children","triggerProps","SubmenuTrigger","MenuButton","domProps","context","useContext","Error","buttonAria","createButton","onPress","toggle","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","renderValues","createMemo","isPressed","renderProps","useRenderProps","class","style","defaultClassName","cleanTriggerProps","ref","_ref1","rest","cleanButtonProps","_ref2","buttonProps","cleanFocusProps","_ref3","cleanHoverProps","_ref4","_$ssrElement","_$mergeProps","type","undefined","_$escape","renderChildren","Menu","ariaProps","triggerContext","menuRef","setMenuRef","createSignal","flatItems","flattenCollectionEntries","items","hasSections","some","item","isCollectionSection","createMenuState","getKey","getTextValue","getDisabled","disabledKeys","onAction","onClose","close","resolveDisabled","disabled","labelProps","createMenu","label","createInteractOutside","onInteractOutside","cleanMenuProps","cleanTriggerMenuProps","cleanLabelProps","shouldRender","parentCollectionRenderer","useCollectionRenderer","virtualizer","useVirtualizerContext","getItemNodes","Array","from","collection","filter","node","getDropTargetByIndex","index","position","key","dropPosition","hasDroppableDnd","hooks","dragAndDropHooks","Boolean","useDroppableCollectionState","useDroppableCollection","dropTargetDelegate","ListDropTargetDelegate","hasDraggableDnd","useDraggableCollectionState","useDraggableCollection","dragState","dropState","persistedKeys","useDndPersistedKeys","focusedKey","virtualRange","isVirtualized","baseRange","getVisibleRange","length","itemNodes","persistedIndexes","map","findIndex","dropTarget","target","normalizedDropKey","getNormalizedDropTargetKey","focusedIndex","forceIncludeIndexes","mergePersistedKeysIntoVirtualRange","forceIncludeMaxSpan","visibleItems","range","slice","start","end","createEffect","activeDragState","droppableCollection","activeDropState","resolveDirection","menuEl","window","getComputedStyle","dir","direction","document","layout","orientation","keyboardDelegate","getFirstKey","getLastKey","getKeyBelow","getKeyAfter","getKeyAbove","getKeyBefore","getKeyPageBelow","getKeyPageAbove","isRootDropTarget","dndRenderDropIndicator","useRenderDropIndicator","dndDropIndicator","sectionedRenderEntries","globalIndex","entry","sectionItems","section","indexedItem","collectionRenderer","renderItem","renderDropIndicator","menuContent","CollectionRendererContext","Show","when","mergeProps","collectionProps","SharedElementTransition","For","each","_$ssr","_tmpl$2","Section","title","Header","Group","_tmpl$","_$ssrAttribute","offsetTop","_tmpl$3","_$ssrStyleProperty","itemIndex","beforeIndicator","onIndicator","afterIndicator","offsetBottom","_tmpl$4","fallback","FocusScope","restoreFocus","autoFocus","MenuItem","menuContext","setRef","itemAria","createMenuItem","id","textValue","isSelected","hasPrimitiveLabel","cleanItemProps","_ariaDescribedby","menuItemProps","draggableItem","useDraggableItem","droppableItem","useDroppableItem","dragProps","dropProps","isDragging","isDropTarget","MenuSection","Item","createContext","createMemo","splitProps","useContext","For","Show","createSelect","createHiddenSelect","createListBox","createOption","createHover","createInteractOutside","FocusScope","createSelectState","SelectContext","createContext","SelectStateContext","SelectValueContext","Select","props","local","stateProps","ariaProps","splitProps","resolveDisabled","disabled","isDisabled","state","createSelectState","items","getKey","getTextValue","getDisabled","disabledKeys","selectionMode","selectedKey","defaultSelectedKey","selectedKeys","defaultSelectedKeys","onSelectionChange","onSelectionChangeKeys","isOpen","defaultOpen","onOpenChange","isRequired","labelProps","triggerProps","valueProps","menuProps","isFocused","isFocusVisible","createSelect","isHovered","hoverProps","createHover","renderValues","createMemo","isSelected","size","renderProps","useRenderProps","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","cleanHoverProps","ref","_ref","rest","cleanLabelProps","containerProps","selectProps","hiddenSelectProps","createHiddenSelect","name","_$createComponent","Provider","value","placeholder","children","_$ssrElement","_$mergeProps","undefined","_$ssr","_tmpl$","_$escape","For","each","item","itemRecord","isObjectRecord","fallbackKey","toKey","key","id","String","fallbackTextValue","toTextValue","textValue","label","has","_tmpl$2","_$ssrAttribute","Show","when","SelectTrigger","context","useContext","Error","cleanTriggerProps","_ref1","_ref2","type","renderChildren","defaultSelectValueChildren","values","selectedText","SelectValue","contextPlaceholder","selectedItem","selectedItems","map","join","length","SelectListBox","selectState","listBoxRef","createInteractOutside","onInteractOutside","close","listBoxProps","createListBox","createSelectListStateAdapter","cleanMenuProps","cleanListBoxProps","Array","from","collection","FocusScope","restoreFocus","autoFocus","fallback","node","SelectOption","selectContext","optionAria","createOption","Boolean","select","keys","setSelectedKeys","Set","setSelectedKey","toggleSelection","next","delete","add","replaceSelection","isPressed","hasPrimitiveLabel","selectionIndicatorContext","cleanOptionProps","_ariaDescribedby","optionProps","SelectionIndicatorContext","setFocused","focusedKey","setFocusedKey","childFocusStrategy","selectionBehavior","disallowEmptySelection","disabledBehavior","isEmpty","isSelectAll","isKeyDisabled","setSelectionBehavior","selectAll","clearSelection","toggleSelectAll","extendSelection","Trigger","Value","ListBox","Option","createContext","createMemo","splitProps","useContext","For","Show","createTabList","createTab","createTabPanel","createFocusRing","createHover","createTabListState","TabsContext","createContext","TabsStateContext","Tabs","props","local","stateProps","rest","splitProps","state","createTabListState","items","getKey","getTextValue","getDisabled","disabledKeys","selectedKey","defaultSelectedKey","onSelectionChange","isDisabled","keyboardActivation","orientation","renderValues","createMemo","renderProps","useRenderProps","class","style","children","defaultClassName","domProps","filterDOMProps","global","_$createComponent","Provider","value","_$ssrElement","_$mergeProps","undefined","_$escape","TabList","ariaProps","context","useContext","Show","when","fallback","_$ssr","_tmpl$","ctx","TabListInner","tabListProps","createTabList","isFocused","isFocusVisible","focusProps","createFocusRing","callHandler","handler","event","Array","isArray","call","handleEvent","handleKeyDown","e","onKeyDown","handleFocus","onFocus","handleBlur","onBlur","_tmpl$2","_$ssrAttribute","role","_$ssrStyle","SharedElementTransition","For","each","item","Tab","_tmpl$3","TabInner","tabRef","tabAria","createTab","key","id","isHovered","hoverProps","createHover","isSelected","isPressed","selectionIndicatorContext","SelectionIndicatorContext","tabProps","tabIndex","renderChildren","TabPanel","tabPanelProps","createTabPanel","shouldRender","shouldForceMount","_tmpl$4","List","Panel","SelectionIndicator","onCleanup","DragPreview","props","hasDom","HTMLElement","isElementNode","value","nodeType","ref","renderer","items","callback","rendered","children","previewValue","element","x","y","current","key","item","element","rect","createContext","createMemo","splitProps","useContext","For","Dynamic","createBreadcrumbs","createBreadcrumbItem","createFocusRing","createHover","mergeProps","BreadcrumbsContext","createContext","BreadcrumbItemContext","defaultItemKey","item","index","maybeItem","key","id","Breadcrumbs","props","local","ariaProps","rest","splitProps","isDisabled","items","getItemKey","getKey","navProps","createBreadcrumbs","renderValues","createMemo","renderProps","useRenderProps","class","style","defaultClassName","domProps","filterDOMProps","global","_$createComponent","Provider","value","onAction","children","_$ssrElement","_$mergeProps","undefined","_$ssr","_tmpl$","_$ssrStyleProperty","_$escape","For","each","itemKey","isLast","length","_tmpl$2","BreadcrumbItem","context","useContext","itemContext","isCurrent","handlePress","e","onPress","itemProps","isPressed","createBreadcrumbItem","href","target","rel","elementType","onPressStart","onPressEnd","onClick","onFocus","onBlur","onFocusChange","onKeyDown","onKeyUp","autoFocus","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","mergedItemProps","mergeProps","mergedStyle","userStyle","baseStyle","display","Dynamic","component","renderChildren","Item","createContext","createMemo","splitProps","useContext","createNumberField","createFocusRing","createHover","createPress","createNumberFieldState","NumberFieldContext","createContext","NumberFieldStateContext","NumberField","props","local","stateProps","ariaProps","rest","splitProps","state","createNumberFieldState","value","defaultValue","onChange","minValue","maxValue","step","locale","formatOptions","isDisabled","isReadOnly","inputRef","setInputRef","el","numberFieldAria","createNumberField","label","isRequired","isInvalid","description","errorMessage","id","autoFocus","name","form","onFocus","onBlur","onFocusChange","onKeyDown","onKeyUp","onPaste","onCopy","onCut","renderValues","createMemo","numberValue","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","contextValue","inputProps","incrementButtonProps","decrementButtonProps","labelProps","groupProps","descriptionProps","errorMessageProps","_$createComponent","Provider","_$ssrElement","_$mergeProps","undefined","_$escape","renderChildren","NumberFieldLabel","context","useContext","Error","NumberFieldGroup","cleanGroupProps","ref","_ref","NumberFieldInput","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","cleanInputProps","cleanFocusProps","cleanHoverProps","NumberFieldIncrementButton","isPressed","pressProps","createPress","canIncrement","onPress","onClick","cleanButtonProps","cleanPressProps","NumberFieldDecrementButton","canDecrement","Label","Group","Input","IncrementButton","DecrementButton","createContext","createMemo","splitProps","useContext","Show","createSearchField","createFocusRing","createHover","createPress","createSearchFieldState","SearchFieldContext","createContext","SearchField","props","local","stateProps","ariaProps","rest","splitProps","state","createSearchFieldState","value","defaultValue","onChange","inputRef","setInputRef","el","searchFieldAria","createSearchField","isDisabled","isReadOnly","isRequired","isInvalid","label","description","errorMessage","placeholder","name","autoFocus","autoComplete","inputMode","autoCorrect","autoCapitalize","spellCheck","maxLength","minLength","pattern","onFocus","onBlur","onFocusChange","onKeyDown","onKeyUp","onCopy","onCut","onPaste","onCompositionStart","onCompositionEnd","onCompositionUpdate","onSelect","onBeforeInput","onInput","onSubmit","onClear","renderValues","createMemo","isEmpty","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","contextValue","inputProps","clearButtonProps","labelProps","descriptionProps","errorMessageProps","_$createComponent","Provider","_$ssrElement","_$mergeProps","undefined","_$escape","renderChildren","SearchFieldLabel","context","useContext","Error","cleanLabelProps","ref","_ref","SearchFieldInput","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","cleanInputProps","cleanFocusProps","cleanHoverProps","SearchFieldClearButton","isPressed","pressProps","createPress","onPress","onClick","cleanPressProps","Show","when","type","tabIndex","disabled","Label","Input","ClearButton","createContext","createMemo","splitProps","useContext","Show","createSlider","createFocusRing","createHover","createSliderState","SliderContext","createContext","SliderStateContext","SliderTrackContext","SliderOutputContext","Slider","props","local","stateProps","ariaProps","rest","splitProps","state","createSliderState","value","defaultValue","onChange","onChangeEnd","minValue","maxValue","step","orientation","locale","formatOptions","isDisabled","trackRef","setTrackRef","el","labelProps","groupProps","trackProps","thumbProps","inputProps","outputProps","createSlider","renderValues","createMemo","isDragging","isFocused","valuePercent","getValuePercent","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","cleanGroupProps","ref","_ref","_$createComponent","Provider","_$ssrElement","_$mergeProps","undefined","_$escape","Show","when","label","renderChildren","SliderTrack","context","useContext","Error","cleanTrackProps","trackStyle","mergedStyle","renderStyle","SliderThumb","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","cleanThumbProps","thumbStyle","cleanFocusProps","cleanHoverProps","SliderOutput","formattedValue","getFormattedValue","cleanDomProps","cleanOutputProps","renderedChildren","Track","Thumb","Output","createContext","useContext","createMemo","createSignal","createEffect","onCleanup","Show","isServer","createTooltipTriggerState","createTooltip","createTooltipTrigger","OverlayContainer","TooltipTriggerContext","createContext","TooltipContext","TooltipTriggerStateContext","TooltipTrigger","props","triggerRef","state","createTooltipTriggerState","delay","closeDelay","isOpen","defaultOpen","onOpenChange","triggerProps","tooltipProps","createTooltipTrigger","isDisabled","trigger","shouldCloseOnPress","context","processChildren","children","Array","isArray","rest","_$createComponent","TriggerWrapper","Provider","value","child","handleRef","span","findVisibleChild","el","HTMLElement","rect","getBoundingClientRect","width","height","found","resolveRef","visibleChild","ref","immediateChild","requestAnimationFrame","_$ssrElement","_$mergeProps","style","display","_$escape","Tooltip","useContext","localState","placement","exitState","setExitState","createSignal","createEffect","open","current","tooltipEl","setTooltipEl","animations","getAnimations","length","canceled","Promise","all","map","a","finished","then","s","catch","onCleanup","shouldRender","isExiting","Show","when","TooltipContent","contextTooltipProps","onTooltipRef","isServer","tooltipRef","ariaTooltipProps","createTooltip","positionStyles","setPositionStyles","top","left","visibility","isEntering","setIsEntering","anim","CSSTransition","cancel","values","createMemo","renderProps","useRenderProps","class","defaultClassName","updatePosition","triggerEl","triggerRect","tooltipWidth","offsetWidth","tooltipHeight","offsetHeight","offset","bottom","right","retryCount","maxRetries","pendingRaf","pendingTimeout","tryUpdatePosition","success","window","setTimeout","addEventListener","cancelAnimationFrame","clearTimeout","removeEventListener","domProps","filterDOMProps","_ariaRef","cleanAriaProps","setRef","OverlayContainer","role","position","undefined","renderChildren","createContext","createMemo","onCleanup","splitProps","useContext","For","Show","createComboBox","createListBox","createOption","createHover","createInteractOutside","createComboBoxState","defaultContainsFilter","ComboBoxContext","createContext","ComboBoxStateContext","ComboBoxValueContext","ComboBox","props","local","stateProps","ariaProps","splitProps","inputRef","buttonRef","listBoxRef","state","createComboBoxState","items","getKey","getTextValue","getDisabled","disabledKeys","selectedKey","defaultSelectedKey","onSelectionChange","inputValue","defaultInputValue","onInputChange","isOpen","defaultOpen","onOpenChange","defaultFilter","allowsCustomValue","allowsEmptyCollection","menuTrigger","isDisabled","isReadOnly","isRequired","effectiveFormValue","createMemo","formValue","comboBoxAria","createComboBox","name","undefined","isHovered","hoverProps","createHover","renderValues","isFocused","isFocusVisible","isInvalid","isSelected","renderProps","useRenderProps","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","cleanHoverProps","ref","_ref","rest","_$createComponent","Provider","value","inputProps","buttonProps","listBoxProps","labelProps","descriptionProps","errorMessageProps","setInputRef","el","setButtonRef","setListBoxRef","children","_$ssrElement","_$mergeProps","_$escape","Show","when","_$ssr","_tmpl$","_$ssrAttribute","toString","ComboBoxLabel","context","useContext","Error","cleanLabelProps","ComboBoxDescription","cleanDescriptionProps","ComboBoxErrorMessage","cleanErrorMessageProps","ComboBoxInput","cleanInputProps","_ref1","_value","_ref2","ComboBoxValue","textValue","isPlaceholder","length","_tmpl$2","_$ssrStyle","renderChildren","ComboBoxButton","isPressed","cleanButtonProps","ComboBoxListBox","contextListBoxProps","comboBoxState","createInteractOutside","onInteractOutside","e","target","input","button","contains","close","createListBox","createComboBoxListStateAdapter","cleanContextProps","cleanListBoxProps","Array","from","collection","cleanupFocusGuard","setupMouseDownHandler","mouseHandler","preventDefault","pointerHandler","addEventListener","removeEventListener","onCleanup","fallback","For","each","node","ComboBoxOption","id","key","optionAria","createOption","selectionIndicatorContext","cleanOptionProps","optionProps","SelectionIndicatorContext","Input","Button","ListBox","Option","Label","Description","ErrorMessage","createComboBoxListStateAdapter","state","selectedKeys","createMemo","key","selectedKey","Set","disabledKeys","keys","node","collection","isDisabled","add","isFocused","setFocused","focusedKey","setFocusedKey","childFocusStrategy","selectionMode","selectionBehavior","disallowEmptySelection","disabledBehavior","isEmpty","size","isSelectAll","isSelected","isKeyDisabled","setSelectionBehavior","toggleSelection","select","replaceSelection","setSelectedKeys","first","Symbol","iterator","next","value","setSelectedKey","selectAll","clearSelection","toggleSelectAll","extendSelection","toKey","createContext","createEffect","createMemo","createUniqueId","splitProps","useContext","Switch","Match","createDialog","createOverlayTrigger","createOverlayTriggerState","DialogContext","createContext","DialogTrigger","props","local","splitProps","state","createOverlayTriggerState","isOpen","defaultOpen","onOpenChange","triggerRef","triggerId","createUniqueId","createOverlayTrigger","type","setTriggerRef","el","isConnected","contextValue","createMemo","_$createComponent","DialogTriggerContext","Provider","value","children","Dialog","ariaProps","rest","dialogRef","triggerContext","useContext","dialogProps","titleProps","createDialog","role","titleId","id","overlayState","useOverlayTriggerState","close","onClose","renderValues","renderProps","useRenderProps","class","style","defaultClassName","domProps","filterDOMProps","global","_$ssrElement","_$mergeProps","_$escape","renderChildren","Heading","dialogContext","level","headingRef","createEffect","contextId","dialog","closest","labelledBy","getAttribute","ownerDocument","getElementById","Switch","Match","when","_$ssr","_tmpl$","_$ssrAttribute","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","createContext","createMemo","createSignal","createEffect","onCleanup","splitProps","Show","useContext","Portal","isServer","createInteractOutside","ariaHideOutside","FocusScope","useUNSAFE_PortalContext","InternalModalContext","createContext","visibleModals","ModalContext","OverlayTriggerStateContext","ModalOverlay","props","isServer","children","local","rest","splitProps","dialogTriggerContext","useContext","DialogTriggerContext","internalOpen","setInternalOpen","createSignal","defaultOpen","isOpen","undefined","state","close","onOpenChange","open","toggle","renderValues","createMemo","isEntering","isExiting","renderProps","useRenderProps","class","style","defaultClassName","domProps","filterDOMProps","global","internalModalContext","isDismissable","isKeyboardDismissDisabled","portalContext","useUNSAFE_PortalContext","portalContainer","getContainer","resolveChildren","_$createComponent","Show","when","Portal","mount","Provider","value","_$ssrElement","_$mergeProps","dataAttr","_$escape","Modal","ModalContentWithAutoOverlay","overlayProps","modalProps","internalContext","ModalContent","standaloneContext","modalRef","modalRefAccessor","parentState","createEffect","includes","push","onCleanup","index","indexOf","splice","isTopMostModal","length","html","document","documentElement","prevOverflow","overflow","createInteractOutside","ref","onInteractOutside","isDisabled","handleKeyDown","e","key","isComposing","preventDefault","stopPropagation","addEventListener","removeEventListener","cleanup","ariaHideOutside","FocusScope","contain","restoreFocus","autoFocus","renderChildren","createContext","createEffect","createMemo","createSignal","createUniqueId","onCleanup","splitProps","useContext","Show","Portal","isServer","createOverlayTrigger","createPopover","FocusScope","useUNSAFE_PortalContext","createOverlayTriggerState","PopoverContext","createContext","PopoverTrigger","props","local","splitProps","state","createOverlayTriggerState","isOpen","defaultOpen","onOpenChange","triggerRef","triggerId","createUniqueId","createOverlayTrigger","type","contextValue","createMemo","open","close","toggle","setTriggerRef","el","isConnected","trigger","_$createComponent","PopoverTriggerContext","Provider","value","children","Popover","isServer","rest","popoverRef","triggerContext","useContext","internalOpen","setInternalOpen","createSignal","undefined","getTriggerRef","popoverAria","createPopover","placement","containerPadding","offset","crossOffset","shouldFlip","isNonModal","isKeyboardDismissDisabled","shouldCloseOnInteractOutside","renderValues","isEntering","isExiting","renderProps","useRenderProps","class","style","defaultClassName","domProps","filterDOMProps","global","cleanPopoverProps","_style","ref","_ref","remaining","popoverProps","mergedStyle","ariaStyle","renderStyle","shouldBeDialog","portalContext","useUNSAFE_PortalContext","portalContainer","getContainer","createEffect","document","activeElement","focus","onKeyDown","event","key","defaultPrevented","addEventListener","onCleanup","removeEventListener","Show","when","Portal","mount","arrowProps","FocusScope","contain","restoreFocus","autoFocus","_$ssrElement","_$mergeProps","role","tabIndex","dataAttr","_$escape","renderChildren","OverlayArrow","popoverContext","cleanArrowProps","contextArrowProps","contextStyle","resolveChildren","createContext","createMemo","createEffect","onCleanup","splitProps","Show","useContext","Portal","isServer","ToastQueue","createToastState","createToast","createToastRegion","useUNSAFE_PortalContext","ToastContext","createContext","ToastAriaContext","useToastContext","context","useContext","Error","globalToastQueue","ToastQueue","maxVisibleToasts","hasExitAnimation","addToast","content","options","add","ToastProvider","props","queue","useGlobalQueue","queueOptions","state","createToastState","_$createComponent","Provider","value","children","ToastRegion","isServer","local","rest","splitProps","portalContext","useUNSAFE_PortalContext","portalContainer","getContainer","undefined","contextState","getRegionAria","s","createToastRegion","renderValues","createMemo","visibleToasts","renderProps","useRenderProps","class","style","defaultClassName","domProps","filterDOMProps","global","placementStyles","placement","base","position","display","gap","padding","top","left","transform","right","bottom","hasToasts","length","regionContent","regionAria","mergedStyle","custom","ref","_ref","cleanRegionProps","regionProps","_$ssrElement","_$mergeProps","_$escape","renderChildren","Show","when","portal","fallback","Portal","mount","Toast","toastRef","toastAria","createToast","toast","hasTitle","title","hasDescription","description","isEntering","animation","isExiting","createEffect","remove","key","animations","getAnimations","canceled","Promise","all","map","a","finished","then","catch","onCleanup","cleanToastProps","toastProps","titleId","titleProps","id","descriptionId","descriptionProps","titleEl","querySelector","HTMLElement","descriptionEl","type","ToastTitle","ariaTitleProps","ToastDescription","ariaDescriptionProps","ToastCloseButton","handleClose","close","_$ssr","_tmpl$","_$ssrAttribute","_$ssrStyle","DefaultToast","_tmpl$3","_$ssrStyleProperty","action","_tmpl$2","label","createContext","createMemo","createSignal","splitProps","useContext","createDisclosureState","createDisclosureGroupState","createDisclosure","createDisclosureGroup","DisclosureContext","createContext","DisclosureStateContext","useDisclosureContext","useContext","DisclosureGroupContext","DisclosureGroupStateContext","useDisclosureGroupContext","DisclosureGroup","props","local","rest","splitProps","state","createDisclosureGroupState","allowsMultipleExpanded","isDisabled","expandedKeys","defaultExpandedKeys","onExpandedChange","groupProps","createDisclosureGroup","renderValues","createMemo","renderProps","useRenderProps","class","style","defaultClassName","domProps","filterDOMProps","global","contextValue","ref","_ref","cleanGroupProps","_$createComponent","Provider","value","children","_$ssrElement","_$mergeProps","dataAttr","_$escape","Disclosure","groupContext","createDisclosureState","id","isExpanded","expanded","toggleKey","defaultExpanded","panelRef","setPanelRefSignal","createSignal","disclosureAria","createDisclosure","setPanelRef","el","DisclosurePanelRefContext","DisclosureTrigger","context","Error","getButtonProps","buttonProps","type","DisclosurePanel","panelRefSetter","getPanelProps","undefined","role","hidden","panelProps","renderChildren","createContext","createMemo","splitProps","createMeter","MeterContext","createContext","clamp","value","min","max","Math","getSafeRange","range","Number","isFinite","Meter","props","local","ariaProps","splitProps","minValue","maxValue","meterAria","createMeter","valueLabel","formatOptions","label","percentage","createMemo","clampedValue","valueText","meterProps","renderValues","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","_$ssrElement","_$mergeProps","slot","_$escape","renderChildren","createContext","createMemo","createSignal","splitProps","useContext","For","Show","createTagGroup","createTag","createListState","TagGroupContext","createContext","TagListStateContext","TagContext","useTagGroupContext","useContext","TagGroup","props","local","domProps","splitProps","_$ssrElement","_$mergeProps","class","style","undefined","slot","_$escape","children","TagList","gridRef","setGridRef","createSignal","getKey","item","id","key","String","state","createListState","items","selectionMode","selectionBehavior","selectedKeys","defaultSelectedKeys","onSelectionChange","disabledKeys","tagGroupAria","createTagGroup","label","isDisabled","onRemove","isFocused","setIsFocused","renderValues","createMemo","isEmpty","length","renderProps","useRenderProps","defaultClassName","contextValue","_$createComponent","Provider","value","gridProps","dataAttr","SharedElementTransition","Show","when","fallback","renderEmptyState","For","each","Tag","rest","groupContext","tagRef","setTagRef","tagAria","createTag","textValue","normalizedRemoveButtonProps","raw","removeButtonProps","rawHandler","onPress","Set","isSelected","isPressed","allowsRemoving","selectionIndicatorContext","filterDOMProps","global","SelectionIndicatorContext","rowProps","gridCellProps","display","renderChildren","TagRemoveButton","tagContext","getRemoveButtonProps","buttonProps","getIsDisabled","Boolean","rawId","rawAriaLabel","rawAriaLabelledBy","buttonId","ariaLabel","ariaLabelledBy","handleClick","event","stopPropagation","handler","_$ssr","_tmpl$","_$ssrAttribute","_$ssrStyle","createContext","createMemo","createSignal","splitProps","useContext","For","Index","Show","createCalendar","createCalendarGrid","createCalendarCell","createCalendarState","endOfMonth","isSameMonth","CalendarContext","createContext","CalendarGridMonthContext","useCalendarContext","context","useContext","Error","Calendar","props","inheritedState","isHydrated","useIsHydrated","_$createComponent","Show","when","fallback","_$ssr","_tmpl$","children","CalendarInner","CalendarWithState","_$mergeProps","state","local","_stateProps","rest","splitProps","calendarAria","createCalendar","renderValues","createMemo","isDisabled","isReadOnly","renderProps","useRenderProps","class","style","defaultClassName","_$ssrElement","calendarProps","dataAttr","_$escape","stateProps","createCalendarState","Provider","value","CalendarHeading","_tmpl$2","_$ssrAttribute","_$ssrStyle","title","CalendarButton","buttonProps","slot","prevButtonProps","nextButtonProps","disabled","CalendarGrid","gridRef","setGridRef","createSignal","startDate","offsetMonths","offset","months","baseStart","visibleRange","start","add","gridAria","createCalendarGrid","endDate","endOfMonth","weekdayStyle","allDates","monthStart","numWeeks","getWeeksInMonth","weekDates","weekIndex","push","getDatesInWeek","gridProps","headerProps","_tmpl$3","For","each","weekDays","day","_tmpl$5","_tmpl$4","Index","date","_tmpl$6","CalendarGridHeader","_tmpl$7","CalendarGridBody","_tmpl$8","CalendarHeaderCell","_tmpl$9","CalendarCell","currentMonthStart","cellRef","setCellRef","isOutsideMonth","isSameMonth","cellAria","createCalendarCell","isSelected","isFocused","isUnavailable","isToday","isPressed","formattedDate","getChildren","renderChildren","cellProps","createContext","createMemo","createSignal","splitProps","useContext","For","Index","Show","createRangeCalendar","createCalendarGrid","createRangeCalendarCell","createRangeCalendarState","endOfMonth","isSameMonth","RangeCalendarContext","createContext","RangeCalendarStateContext","RangeCalendarGridMonthContext","useRangeCalendarContext","context","useContext","Error","RangeCalendar","props","isHydrated","useIsHydrated","_$createComponent","Show","when","fallback","_$ssr","_tmpl$","children","RangeCalendarInner","local","stateProps","rest","splitProps","state","createRangeCalendarState","calendarAria","createRangeCalendar","renderValues","createMemo","isDisabled","isReadOnly","isDragging","renderProps","useRenderProps","class","style","defaultClassName","Provider","value","_$ssrElement","_$mergeProps","calendarProps","dataAttr","_$escape","RangeCalendarHeading","_tmpl$2","_$ssrAttribute","_$ssrStyle","title","RangeCalendarButton","buttonProps","slot","prevButtonProps","nextButtonProps","disabled","RangeCalendarGrid","gridRef","setGridRef","createSignal","startDate","offsetMonths","offset","months","baseStart","visibleRange","start","add","gridAria","createCalendarGrid","endDate","endOfMonth","weekdayStyle","allDates","monthStart","numWeeks","getWeeksInMonth","weekDates","weekIndex","push","getDatesInWeek","gridProps","headerProps","_tmpl$3","For","each","weekDays","day","_tmpl$5","_tmpl$4","Index","date","_tmpl$6","RangeCalendarCell","currentMonthStart","cellRef","setCellRef","isOutsideMonth","isSameMonth","cellAria","createRangeCalendarCell","isSelected","isSelectionStart","isSelectionEnd","isFocused","isUnavailable","isToday","isPressed","formattedDate","getChildren","renderChildren","cellProps","createContext","createMemo","createSignal","splitProps","useContext","For","Show","createDateField","createDateSegment","createDateFieldState","DateFieldContext","createContext","DateFieldStateContext","useDateFieldContext","context","useContext","Error","DateField","props","isHydrated","useIsHydrated","_$createComponent","Show","when","fallback","_$ssr","_tmpl$","children","DateFieldInner","local","stateProps","rest","splitProps","fieldRef","setFieldRef","createSignal","state","createDateFieldState","fieldAria","createDateField","description","errorMessage","renderValues","createMemo","isDisabled","isReadOnly","isRequired","isInvalid","renderProps","useRenderProps","class","style","defaultClassName","Provider","value","aria","labelProps","inputProps","descriptionProps","errorMessageProps","_$ssrElement","_$mergeProps","fieldProps","dataAttr","_$escape","DateInput","isFocused","setIsFocused","For","each","segments","segment","DateSegment","segmentRef","setSegmentRef","segmentAria","createDateSegment","isEditable","isPlaceholder","type","text","getChildren","renderChildren","segmentProps","DateFieldLabel","DateFieldDescription","DateFieldErrorMessage","createContext","createMemo","createSignal","splitProps","useContext","For","Show","createTimeField","createTimeSegment","createTimeFieldState","TimeFieldContext","createContext","TimeFieldStateContext","useTimeFieldContextValue","context","useContext","Error","useTimeFieldContext","state","TimeField","props","isHydrated","useIsHydrated","_$createComponent","Show","when","fallback","_$ssr","_tmpl$","children","TimeFieldInner","local","stateProps","rest","splitProps","fieldRef","setFieldRef","createSignal","createTimeFieldState","fieldAria","createTimeField","renderValues","createMemo","isDisabled","isReadOnly","isRequired","isInvalid","renderProps","useRenderProps","class","style","defaultClassName","Provider","value","aria","labelProps","inputProps","descriptionProps","errorMessageProps","_$ssrElement","_$mergeProps","fieldProps","dataAttr","_$escape","TimeInput","isFocused","setIsFocused","For","each","segments","segment","TimeSegment","segmentRef","setSegmentRef","segmentAria","createTimeSegment","isEditable","isPlaceholder","type","text","getChildren","renderChildren","segmentProps","TimeFieldLabel","TimeFieldDescription","TimeFieldErrorMessage","createContext","createEffect","createMemo","createSignal","splitProps","useContext","Show","Portal","createDatePicker","createDateRangePicker","createPopover","FocusScope","useUNSAFE_PortalContext","createDateFieldState","createCalendarState","createRangeCalendarState","DatePickerContext","createContext","DateRangePickerContext","DatePickerStateContext","DateRangePickerStateContext","useDatePickerContext","context","useContext","Error","useDateRangePickerContext","DatePicker","props","isHydrated","useIsHydrated","_$createComponent","Show","when","fallback","_$ssr","_tmpl$","children","DatePickerInner","local","stateProps","rest","splitProps","isOpen","setIsOpen","createSignal","triggerRef","overlayState","open","close","toggle","prev","fieldState","createDateFieldState","onChange","value","shouldCloseOnSelect","calendarState","createCalendarState","setValue","minValue","maxValue","isDisabled","isReadOnly","locale","pickerAria","createDatePicker","description","errorMessage","contextValue","setTriggerRef","element","isConnected","isInvalid","createMemo","Boolean","renderValues","isRequired","renderProps","useRenderProps","class","style","defaultClassName","Provider","DateFieldContext","state","aria","labelProps","inputProps","fieldProps","descriptionProps","errorMessageProps","CalendarContext","_$ssrElement","_$mergeProps","groupProps","dataAttr","_$escape","DateRangePicker","_tmpl$2","DateRangePickerInner","createRangeCalendarState","start","end","createDateRangePicker","validationState","RangeCalendarContext","DatePickerButton","buttonRef","getChildren","renderChildren","buttonProps","disabled","DateRangePickerButton","DatePickerLabel","DatePickerDescription","DatePickerErrorMessage","DateRangePickerLabel","DateRangePickerDescription","DateRangePickerErrorMessage","DatePickerContent","portalContext","useUNSAFE_PortalContext","contentRef","portalContainer","getContainer","undefined","popoverAria","createPopover","popoverRef","placement","offset","isNonModal","isKeyboardDismissDisabled","cleanPopoverProps","_style","ref","_ref","popoverProps","mergedStyle","popoverStyle","createEffect","document","activeElement","focus","Portal","mount","FocusScope","contain","restoreFocus","autoFocus","dialogProps","tabIndex","DateRangePickerContent","createContext","createEffect","createMemo","createSignal","onCleanup","splitProps","useContext","For","Show","createTable","createTableColumnHeader","createTableRow","createTableCell","createTableRowGroup","createTableSelectionCheckbox","createTableSelectAllCheckbox","createFocusRing","createHover","mergeProps","createTableState","createTableCollection","TableContext","createContext","TableStateContext","TableColumnResizeStateContext","TableRowContext","Table","props","local","stateProps","ariaProps","splitProps","ref","setRef","createSignal","collection","createMemo","createTableCollection","columns","rows","items","getKey","getTextValue","showSelectionCheckboxes","state","createTableState","disabledKeys","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","sortDescriptor","onSortChange","gridProps","createTable","id","isVirtualized","onRowAction","onCellAction","focusMode","isFocused","isFocusVisible","focusProps","createFocusRing","renderValues","isDisabled","isEmpty","length","renderProps","useRenderProps","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","cleanGridProps","_ref1","rest","cleanFocusProps","_ref2","parentCollectionRenderer","useCollectionRenderer","getItemNodes","Array","from","filter","node","type","getDropTargetByIndex","index","position","key","dropPosition","hasDroppableDnd","hooks","dragAndDropHooks","Boolean","useDroppableCollectionState","useDroppableCollection","dropTargetDelegate","ListDropTargetDelegate","hasDraggableDnd","useDraggableCollectionState","useDraggableCollection","dragState","undefined","dropState","createEffect","activeDragState","droppableCollection","activeDropState","resolveDirection","el","window","getComputedStyle","dir","direction","document","layout","orientation","keyboardDelegate","getFirstKey","getLastKey","getKeyBelow","getKeyAfter","getKeyAbove","getKeyBefore","getKeyLeftOf","getKeyRightOf","getKeyPageBelow","getKeyPageAbove","isRootDropTarget","target","dndRenderDropIndicator","useRenderDropIndicator","dndDropIndicator","contextValue","collectionRenderer","renderItem","item","renderDropIndicator","_$createComponent","Provider","value","children","CollectionRendererContext","_$ssrElement","_$mergeProps","mergeProps","collectionProps","_$escape","TableHeader","context","useContext","Error","rowGroupProps","createTableRowGroup","cleanRowGroupProps","_ref","_$ssr","_tmpl$","TableColumn","columnNode","getItem","textValue","String","level","hasChildNodes","childNodes","columnHeaderAria","createTableColumnHeader","allowsSorting","isHovered","hoverProps","createHover","sortDirection","column","focusedKey","isSortable","cleanColumnHeaderProps","columnHeaderProps","cleanHoverProps","_ref3","TableBody","virtualizer","useVirtualizerContext","rowNodes","persistedKeys","useDndPersistedKeys","virtualRange","rowCount","baseRange","getVisibleRange","persistedIndexes","map","findIndex","dropTarget","normalizedDropKey","getNormalizedDropTargetKey","focusedIndex","forceIncludeIndexes","mergePersistedKeysIntoVirtualRange","forceIncludeMaxSpan","setDropTargetItemCountResolver","setDropTargetIndexResolver","setDropTargetResolver","onCleanup","visibleItems","range","slice","start","end","spacerColSpan","SharedElementTransition","Show","when","renderEmptyState","fallback","offsetTop","_tmpl$2","_$ssrAttribute","_$ssrStyleProperty","For","each","itemIndex","beforeIndicator","onIndicator","afterIndicator","offsetBottom","_tmpl$3","hasMore","onLoadMore","TableLoadMoreItem","isLoading","colSpan","isPending","setIsPending","triggerLoadMore","IntersectionObserver","observer","entries","isIntersecting","observe","disconnect","_tmpl$4","_$ssrStyle","renderChildren","TableRow","tableContext","rowNode","rowAria","createTableRow","onAction","isSelected","isPressed","draggableItem","useDraggableItem","droppableItem","useDroppableItem","cleanRowProps","rowProps","rowContextValue","rowKey","dragProps","dropProps","isDragging","isDropTarget","TableCell","rowContext","cellNode","cellKey","parentKey","cellAria","createTableCell","cleanCellProps","gridCellProps","TableSelectionCheckbox","selectionCheckboxAria","createTableSelectionCheckbox","checkboxProps","TableSelectAllCheckbox","selectAllCheckboxAria","createTableSelectAllCheckbox","Header","Column","Body","LoadMoreItem","Row","Cell","SelectionCheckbox","SelectAllCheckbox","ColumnResizer","_tmpl$5","ResizableTableContainer","_tmpl$6","useTableOptions","createContext","createEffect","createMemo","createSignal","onCleanup","splitProps","useContext","For","createGridList","createGridListItem","createGridListSelectionCheckbox","createFocusRing","createHover","mergeProps","createGridState","GridListContext","createContext","GridListStateContext","GridListHeaderContext","buildGridCollection","items","getKey","getTextValue","getDisabled","nodes","map","item","index","key","type","value","textValue","String","level","hasChildNodes","childNodes","isDisabled","keyMap","Map","forEach","node","set","rows","columns","headerRows","rowCount","length","columnCount","size","getKeys","n","getItem","get","at","getKeyBefore","getKeyAfter","getFirstKey","getLastKey","getChildren","_key","getCell","_rowKey","_columnKey","Symbol","iterator","GridList","props","local","stateProps","ariaProps","splitProps","ref","setRef","createSignal","collection","createMemo","allDisabledKeys","keys","Set","disabledKeys","add","state","createGridState","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","gridProps","createGridList","id","isVirtualized","onAction","isFocused","isFocusVisible","focusProps","createFocusRing","renderValues","isEmpty","renderProps","useRenderProps","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","cleanGridProps","_ref1","rest","cleanFocusProps","_ref2","virtualizer","useVirtualizerContext","parentCollectionRenderer","useCollectionRenderer","getItemNodes","Array","from","filter","getDropTargetByIndex","position","dropPosition","hasDroppableDnd","hooks","dragAndDropHooks","Boolean","useDroppableCollectionState","useDroppableCollection","dropTargetDelegate","ListDropTargetDelegate","hasDraggableDnd","useDraggableCollectionState","useDraggableCollection","dragState","undefined","dropState","createEffect","activeDragState","droppableCollection","activeDropState","resolveDirection","el","window","getComputedStyle","dir","direction","document","layout","orientation","keyboardDelegate","getKeyBelow","getKeyAbove","getKeyLeftOf","getKeyRightOf","getKeyPageBelow","getKeyPageAbove","isRootDropTarget","target","dndRenderDropIndicator","useRenderDropIndicator","dndDropIndicator","persistedKeys","useDndPersistedKeys","focusedKey","virtualRange","baseRange","getVisibleRange","itemNodes","persistedIndexes","findIndex","dropTarget","normalizedDropKey","getNormalizedDropTargetKey","focusedIndex","forceIncludeIndexes","mergePersistedKeysIntoVirtualRange","forceIncludeMaxSpan","setDropTargetItemCountResolver","setDropTargetIndexResolver","entries","setDropTargetResolver","onCleanup","visibleItems","range","slice","start","end","contextValue","collectionRenderer","renderItem","children","renderDropIndicator","_$createComponent","Provider","CollectionRendererContext","_$ssrElement","_$mergeProps","mergeProps","collectionProps","_$escape","SharedElementTransition","renderEmptyState","offsetTop","_$ssr","_tmpl$","_$ssrStyleProperty","For","each","itemIndex","beforeIndicator","onIndicator","afterIndicator","offsetBottom","_tmpl$2","hasMore","onLoadMore","GridListLoadMoreItem","isLoading","GridListItem","context","useContext","Error","listContext","itemNode","itemAria","createGridListItem","isSelected","isPressed","isHovered","hoverProps","createHover","draggableItem","useDraggableItem","droppableItem","useDroppableItem","cleanRowProps","rowProps","cleanHoverProps","_ref3","dragProps","dropProps","isDragging","isDropTarget","gridCellProps","renderChildren","GridListSelectionCheckbox","checkboxAria","createGridListSelectionCheckbox","itemKey","checkboxProps","isPending","setIsPending","triggerLoadMore","IntersectionObserver","observer","isIntersecting","observe","disconnect","_tmpl$3","_$ssrAttribute","_$ssrStyle","GridListHeader","_tmpl$4","GridListSection","Section","Item","SelectionCheckbox","LoadMoreItem","onCleanup","createContext","createEffect","createMemo","createSignal","splitProps","useContext","For","Show","createTree","createTreeItem","createTreeSelectionCheckbox","createFocusRing","createHover","mergeProps","createTreeState","createTreeCollection","X_SWITCH_THRESHOLD","Y_SWITCH_THRESHOLD","EXPANSION_KEYS","expand","ltr","rtl","collapse","resolveTreeDirection","element","dir","closest","getAttribute","window","getComputedStyle","computedDirection","direction","document","createTreeDropTargetDelegate","delegate","state","baseKeyboardNav","pointerTracking","lastY","lastX","yDirection","xDirection","boundaryContext","getPotentialTargets","originalTarget","isValidDropTarget","dropPosition","collection","getNodeNextKey","node","declaredNextKey","nextKey","target","currentItem","getItem","key","type","potentialTargets","hasChildNodes","expandedKeys","has","firstChildItemNode","child","getChildren","beforeFirstChildTarget","parentKey","ancestorTargets","parentItem","nextItem","isLastChildAtLevel","afterParentTarget","push","length","getKeyAfter","nextNode","level","beforeTarget","filter","candidate","selectTarget","x","y","currentYMovement","currentXMovement","initialTargetIndex","preferredTargetIndex","lastSwitchY","lastSwitchX","distanceFromLastXSwitch","Math","abs","distanceFromLastYSwitch","currentIndex","currentTargetIndex","targetIndex","max","min","getKeyboardNavigationTarget","isVisibleRow","rowIndex","tryValid","t","isExpanded","getFirstChildItemKey","getLastChildItemKey","lastKey","getDeepestLastChild","current","lastChild","firstKey","getFirstKey","firstChild","targetNode","nextSiblingKey","nextSibling","parentNode","parentNextKey","parentNextNode","getLastKey","rootKey","deepest","prevKey","getKeyBefore","getDropTargetFromPoint","baseTarget","deltaY","deltaX","keyBefore","normalized","getKeyboardPageNavigationTarget","bind","TreeContext","createContext","TreeStateContext","TreeItemContext","Tree","props","local","stateProps","ariaProps","splitProps","ref","setRef","createSignal","flatItems","createMemo","flattenCollectionEntries","items","hasSections","some","entry","isCollectionSection","createTreeState","collectionFactory","createTreeCollection","disabledKeys","disabledBehavior","selectionMode","selectionBehavior","selectedKeys","defaultSelectedKeys","onSelectionChange","defaultExpandedKeys","onExpandedChange","lastExpandedKeys","setLastExpandedKeys","Set","lastItemsLength","setLastItemsLength","collectionVersion","setCollectionVersion","createEffect","expanded","areSetsEqual","v","treeDirection","treeProps","createTree","id","isVirtualized","onAction","isDisabled","isFocused","isFocusVisible","focusProps","createFocusRing","renderValues","isEmpty","renderProps","useRenderProps","class","style","defaultClassName","domProps","filtered","filterDOMProps","global","cleanTreeProps","_ref1","rest","cleanFocusProps","_ref2","visibleRows","rows","virtualizer","useVirtualizerContext","parentCollectionRenderer","useCollectionRenderer","getDropTargetByIndex","index","position","hasDroppableDnd","hooks","dragAndDropHooks","Boolean","useDroppableCollectionState","useDroppableCollection","dropTargetDelegate","ListDropTargetDelegate","hasDraggableDnd","useDraggableCollectionState","useDraggableCollection","dragState","undefined","map","value","dropState","activeDropState","originalGetDropOperation","getDropOperation","types","allowedOperations","currentDraggingKeys","draggingKeys","size","currentKey","item","onCleanup","activeDragState","contextValue","renderItem","children","droppableCollection","baseDropTargetDelegate","layout","orientation","getBaseKeyboardNavigationTarget","keyboardDelegate","getKeyBelow","getKeyAbove","getKeyPageBelow","getKeyPageAbove","onDropActivate","event","isVirtualDragging","toggleKey","onKeyDown","expandKey","collapseKey","isRootDropTarget","dndRenderDropIndicator","useRenderDropIndicator","dndDropIndicator","persistedKeys","useDndPersistedKeys","focusedKey","virtualRange","baseRange","getVisibleRange","persistedIndexes","Array","from","findIndex","dropTarget","normalizedDropKey","getNormalizedDropTargetKey","focusedIndex","forceIncludeIndexes","mergePersistedKeysIntoVirtualRange","forceIncludeMaxSpan","virtualizedVisibleRows","range","slice","start","end","setDropTargetItemCountResolver","setDropTargetIndexResolver","setDropTargetResolver","rowIndexByKey","Map","i","set","getAfterIndicatorIndexes","absoluteIndex","renderRange","next","result","cursorIndex","cursor","shouldRender","get","parentDelegate","_x","_y","_v","treeDelegate","setKeyboardNavigationOverride","isValid","collectionRenderer","renderDropIndicator","rootKeyByNodeKey","rootMap","row","getParentKey","renderableRows","offset","globalIndex","sectionedRenderableRows","matching","sectionRootKeys","sectionRows","section","renderTreeRow","itemIndex","beforeIndicator","onIndicator","afterIndicatorIndexes","itemData","textValue","childNodes","itemState","isExpandable","_$createComponent","For","each","afterIndex","Provider","CollectionRendererContext","_$ssrElement","_$mergeProps","mergeProps","collectionProps","_$escape","SharedElementTransition","renderEmptyState","offsetTop","_$ssr","_tmpl$","_$ssrStyleProperty","Show","when","fallback","TreeSection","title","TreeHeader","offsetBottom","_tmpl$2","hasMore","onLoadMore","TreeLoadMoreItem","isLoading","TreeItem","context","useContext","Error","treeContext","itemNode","String","treeItemAria","createTreeItem","isSelected","isPressed","isHovered","hoverProps","createHover","draggableItem","useDraggableItem","droppableItem","useDroppableItem","cleanRowProps","rowProps","cleanHoverProps","_ref3","itemContextValue","dragProps","dropProps","isDragging","isDropTarget","gridCellProps","renderChildren","TreeExpandButton","itemContext","stateContext","cleanExpandProps","_ref","expandButtonProps","TreeSelectionCheckbox","treeSelectionCheckboxAria","createTreeSelectionCheckbox","itemKey","checkboxProps","isPending","setIsPending","triggerLoadMore","IntersectionObserver","observer","entries","isIntersecting","observe","disconnect","_tmpl$3","_$ssrAttribute","_$ssrStyle","TreeItemContent","Section","Header","Item","ExpandButton","SelectionCheckbox","LoadMoreItem","a","b","createContext","createEffect","createMemo","createSignal","onCleanup","splitProps","useContext","Show","createColorSlider","createColorArea","createColorWheel","createColorField","createColorSwatch","createListBox","createOption","createFocusRing","createHover","mergeProps","createListState","createColorSliderState","createColorAreaState","createColorWheelState","createColorFieldState","normalizeColor","ColorPickerContextInternal","createContext","ColorPickerStateContextInternal","ColorSwatchContextInternal","ColorSwatchPickerContextInternal","ColorSliderContext","ColorSlider","props","pickerContext","useContext","local","stateProps","ariaProps","rest","splitProps","state","createColorSliderState","value","defaultValue","onChange","onChangeEnd","channel","isDisabled","trackRef","setTrackRef","el","trackProps","thumbProps","inputProps","labelProps","createColorSlider","channelName","renderValues","createMemo","isDragging","getThumbValue","color","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","_$createComponent","Provider","_$ssrElement","_$mergeProps","undefined","_$escape","Show","when","label","renderChildren","ColorSliderTrack","context","Error","cleanTrackProps","ref","_ref","_trackStyle","mergedStyle","trackStyle","renderStyle","ColorSliderThumb","isFocused","isFocusVisible","focusProps","createFocusRing","isHovered","hoverProps","createHover","cleanThumbProps","_thumbStyle","cleanFocusProps","cleanHoverProps","mergedInputProps","mergeProps","thumbStyle","Track","Thumb","ColorAreaContext","ColorArea","createColorAreaState","xChannel","yChannel","areaRef","setAreaRef","colorAreaProps","gradientProps","xInputProps","yInputProps","createColorArea","cleanColorAreaProps","_areaStyle","areaStyle","ColorAreaGradient","cleanGradientProps","_gradStyle","gradStyle","ColorAreaThumb","mergedXInputProps","mergedYInputProps","Gradient","ColorWheelContext","ColorWheel","createColorWheelState","wheelRef","setWheelRef","createColorWheel","hue","getHue","ColorWheelTrack","ColorWheelThumb","ColorFieldContext","ColorField","createColorFieldState","colorFormat","isReadOnly","inputRef","createColorField","isInvalid","ColorFieldInput","cleanInputProps","_inputStyle","Input","ColorSwatch","swatchContext","resolvedColor","swatchProps","createColorSwatch","normalizeColor","colorValue","toString","cleanSwatchProps","_swatchStyle","swatchStyle","ColorSliderStateContext","ColorAreaStateContext","ColorWheelStateContext","ColorWheelTrackContext","ColorFieldStateContext","ColorSwatchContext","ColorPickerContext","ColorPickerStateContext","ColorSwatchPickerContext","ColorThumb","ColorPicker","internalColor","setInternalColor","createSignal","setColor","nextColor","_$ssr","_tmpl$","_$ssrAttribute","_$ssrStyle","ColorSwatchPicker","itemMap","setItemMap","Map","itemOrder","setItemOrder","selectedColor","selectedKey","isControlled","registerItem","item","prev","next","set","key","includes","unregisterItem","has","delete","filter","itemKey","items","map","get","createListState","getKey","getTextValue","textValue","getDisabled","selectionMode","disallowEmptySelection","selectedKeys","onSelectionChange","keys","values","listBoxAria","createListBox","shouldFocusWrap","resolveDirection","document","rootDir","dir","findNextEnabledKey","from","direction","collection","getAdjacent","getKeyAfter","getKeyBefore","getBoundary","getFirstKey","getLastKey","getBoundaryEnabledKey","getOptionElementForKey","listbox","keyString","String","optionElement","querySelectorAll","id","findGridKey","nextKey","shouldSkip","candidate","previousRect","getBoundingClientRect","itemRect","isSameRow","prevRect","y","x","getGridKeyBelow","current","getGridKeyAbove","getGridKeyRightOf","getGridKeyLeftOf","handleGridKeyDown","e","layout","currentTarget","focusedKey","initialKey","setFocusedKey","replaceSelection","preventDefault","stopPropagation","getListBoxKeyDown","listBoxProps","onKeyDown","onColorSwatchPickerKeyDown","createEffect","within","cleanListBoxProps","_onKeyDown","restListBoxProps","restFocusProps","ColorSwatchPickerItem","locale","globalThis","navigator","language","getColorName","onCleanup","optionAria","createOption","isSelected","isPressed","cleanOptionProps","restOptionProps","optionProps","createSignal","splitProps","Show","onCleanup","createEffect","createUniqueId","ContextualHelpTrigger","props","local","triggerProps","isOpen","setIsOpen","triggerId","contentId","triggerRef","contentRef","isUnavailable","isDisabled","toggle","close","callHandler","handler","event","Array","isArray","call","handleEvent","handleTriggerClick","e","onClick","defaultPrevented","handleTriggerKeyDown","onKeyDown","key","preventDefault","stopPropagation","focus","handleDocumentClick","contains","target","document","addEventListener","removeEventListener","children","trigger","content","_$ssr","_tmpl$2","_$escape","class","_$ssrStyleProperty","_$ssrElement","_$mergeProps","type","id","undefined","disabled","_$createComponent","when","_tmpl$","_$ssrAttribute","createSignal","For","Show","splitProps","createMemo","getColorChannels","ColorEditor","props","local","splitProps","activeSpace","setActiveSpace","createSignal","colorSpace","handleSpaceChange","space","onColorSpaceChange","channels","createMemo","resolvedClass","class","children","_$ssr","_tmpl$","_$ssrAttribute","_$escape","_$ssrStyle","style","_$createComponent","ColorPicker","value","defaultValue","onChange","areaChannels","x","y","_tmpl$2","_tmpl$3","ColorArea","xChannel","yChannel","isDisabled","ColorAreaGradient","ColorAreaThumb","ColorSlider","channel","ColorSliderTrack","ColorSliderThumb","Show","when","hideAlphaChannel","_tmpl$4","fallback","ColorField","ColorFieldInput","For","each","createContext","createMemo","createSignal","splitProps","Dynamic","createLandmark","getLandmarkController","LandmarkContext","createContext","roleToSemanticElement","main","navigation","search","banner","contentinfo","complementary","form","region","Landmark","props","local","ariaProps","splitProps","ref","setRef","createSignal","elementType","createMemo","role","landmarkAria","createLandmark","id","focus","renderValues","resolvedClass","cls","class","resolvedStyle","style","domProps","filterDOMProps","global","_$createComponent","Dynamic","_$mergeProps","component","landmarkProps","slot","children","useLandmarkController","getLandmarkController","Show","createContext","createMemo","createEffect","splitProps","useContext","announce","createToolbar","ActionBarContext","createContext","useActionBarContext","useContext","ActionBar","props","local","domProps","splitProps","isOpen","selectedItemCount","toolbarProps","createToolbar","orientation","undefined","wasOpen","createEffect","open","announce","handleKeyDown","e","onKeyDown","defaultPrevented","key","preventDefault","stopPropagation","onClearSelection","renderProps","useRenderProps","children","class","style","defaultClassName","filteredDOMProps","createMemo","filterDOMProps","global","contextValue","onAction","_$createComponent","Show","when","Provider","value","_$ssrElement","_$mergeProps","slot","_$escape","ActionBarContainer","_$ssr","_tmpl$","_$ssrAttribute","_$ssrStyle","position","ActionBarSelectionCount","ctx","text","count","_tmpl$2","ActionBarClearButton","_tmpl$3","createContext","createMemo","splitProps","useContext","For","createActionGroup","createActionGroupItem","createListState","ActionGroupContext","createContext","ActionGroupStateContext","ActionGroup","props","local","ariaGroupProps","domProps","splitProps","state","createListState","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disabledKeys","getKey","item","id","getTextValue","label","getDisabled","isDisabled","groupAriaProps","orientation","onAction","actionGroupProps","createActionGroup","renderProps","useRenderProps","children","undefined","class","style","defaultClassName","filteredDOMProps","createMemo","filterDOMProps","global","_$createComponent","Provider","value","_$ssrElement","_$mergeProps","slot","_$escape","For","each","ActionGroupItemWrapper","renderChild","buttonProps","createActionGroupItem","key","isFocused","focusedKey","isSelected","keys","Set","has","ref","_ref","restButtonProps","useActionGroupContext","useContext","createContext","createMemo","splitProps","useContext","AlertContext","createContext","Alert","props","local","rest","splitProps","variant","isDismissible","renderValues","createMemo","computedClass","cls","class","computedStyle","s","style","domProps","filterDOMProps","global","contextValue","onDismiss","_$createComponent","Provider","value","children","_$ssrElement","_$mergeProps","role","undefined","_$escape","AlertDismissButton","context","useContext","Button","onPress","createContext","createMemo","Show","splitProps","IconContext","createContext","Icon","props","local","rest","splitProps","hasLabel","isInteractive","onPress","isDecorative","renderValues","createMemo","renderProps","useRenderProps","children","class","style","defaultClassName","domProps","filterDOMProps","global","_$createComponent","Show","when","fallback","_$ssrElement","_$mergeProps","role","undefined","_$escape","renderChildren","Button","children","resolveChildren","createEffect","onCleanup","splitProps","createFocusable","Focusable","props","local","focusableProps","ref","domProps","resolved","child","HTMLElement","listeners","addListener","eventName","handler","listener","addEventListener","push","onFocus","onBlur","onKeyDown","onKeyUp","key","value","Object","entries","startsWith","hasAttribute","removeAttribute","tabIndex","Number","setAttribute","String","removeEventListener","children","resolveChildren","createEffect","onCleanup","splitProps","createPress","createFocusable","Pressable","props","local","pressProps","ref","domPressProps","focusableProps","domFocusableProps","resolved","child","HTMLElement","allProps","listeners","key","handler","Object","entries","startsWith","eventName","slice","toLowerCase","listener","addEventListener","push","value","hasAttribute","removeAttribute","tabIndex","Number","setAttribute","String","removeEventListener","createDrop","FormValidationContext","ToastQueue","createListData","createTreeData","createAsyncList","getColorChannels"]}
|