@proyecto-viviana/solidaria-components 0.3.2 → 0.4.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/dist/ActionBar.js +184 -0
- package/dist/ActionBar.js.map +1 -0
- package/dist/ActionBar.jsx +128 -0
- package/dist/ActionBar.jsx.map +1 -0
- package/dist/ActionGroup.js +179 -0
- package/dist/ActionGroup.js.map +1 -0
- package/dist/ActionGroup.jsx +129 -0
- package/dist/ActionGroup.jsx.map +1 -0
- package/dist/Alert.js +111 -0
- package/dist/Alert.js.map +1 -0
- package/dist/Alert.jsx +82 -0
- package/dist/Alert.jsx.map +1 -0
- package/dist/Autocomplete.js +130 -0
- package/dist/Autocomplete.js.map +1 -0
- package/dist/Autocomplete.jsx +116 -0
- package/dist/Autocomplete.jsx.map +1 -0
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +334 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.jsx +266 -0
- package/dist/Breadcrumbs.jsx.map +1 -0
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +348 -0
- package/dist/Button.js.map +1 -0
- package/dist/Button.jsx +314 -0
- package/dist/Button.jsx.map +1 -0
- package/dist/Calendar.d.ts +4 -4
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +538 -0
- package/dist/Calendar.js.map +1 -0
- package/dist/Calendar.jsx +333 -0
- package/dist/Calendar.jsx.map +1 -0
- package/dist/CalendarPicker.d.ts +33 -0
- package/dist/CalendarPicker.d.ts.map +1 -0
- package/dist/CalendarPicker.js +44 -0
- package/dist/CalendarPicker.js.map +1 -0
- package/dist/CalendarPicker.jsx +44 -0
- package/dist/CalendarPicker.jsx.map +1 -0
- package/dist/Checkbox.d.ts +83 -4
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +923 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/Checkbox.jsx +707 -0
- package/dist/Checkbox.jsx.map +1 -0
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +202 -0
- package/dist/Collection.js.map +1 -0
- package/dist/Collection.jsx +152 -0
- package/dist/Collection.jsx.map +1 -0
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +1720 -0
- package/dist/Color.js.map +1 -0
- package/dist/Color.jsx +1344 -0
- package/dist/Color.jsx.map +1 -0
- package/dist/ColorEditor.js +208 -0
- package/dist/ColorEditor.js.map +1 -0
- package/dist/ColorEditor.jsx +120 -0
- package/dist/ColorEditor.jsx.map +1 -0
- package/dist/ComboBox.d.ts +4 -4
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +992 -0
- package/dist/ComboBox.js.map +1 -0
- package/dist/ComboBox.jsx +714 -0
- package/dist/ComboBox.jsx.map +1 -0
- package/dist/ContextualHelpTrigger.js +146 -0
- package/dist/ContextualHelpTrigger.js.map +1 -0
- package/dist/ContextualHelpTrigger.jsx +109 -0
- package/dist/ContextualHelpTrigger.jsx.map +1 -0
- package/dist/DateField.d.ts +3 -3
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +4 -0
- package/dist/DateField.jsx +4 -0
- package/dist/DateField2.js +499 -0
- package/dist/DateField2.js.map +1 -0
- package/dist/DateField2.jsx +317 -0
- package/dist/DateField2.jsx.map +1 -0
- package/dist/DatePicker.d.ts +4 -4
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +991 -0
- package/dist/DatePicker.js.map +1 -0
- package/dist/DatePicker.jsx +682 -0
- package/dist/DatePicker.jsx.map +1 -0
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +337 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/Dialog.jsx +192 -0
- package/dist/Dialog.jsx.map +1 -0
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +328 -0
- package/dist/Disclosure.js.map +1 -0
- package/dist/Disclosure.jsx +230 -0
- package/dist/Disclosure.jsx.map +1 -0
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragAndDrop.js +176 -0
- package/dist/DragAndDrop.js.map +1 -0
- package/dist/DragAndDrop.jsx +160 -0
- package/dist/DragAndDrop.jsx.map +1 -0
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/DropZone.js +189 -0
- package/dist/DropZone.js.map +1 -0
- package/dist/DropZone.jsx +144 -0
- package/dist/DropZone.jsx.map +1 -0
- package/dist/FieldError.js +66 -0
- package/dist/FieldError.js.map +1 -0
- package/dist/FieldError.jsx +47 -0
- package/dist/FieldError.jsx.map +1 -0
- package/dist/FileTrigger.js +79 -0
- package/dist/FileTrigger.js.map +1 -0
- package/dist/FileTrigger.jsx +49 -0
- package/dist/FileTrigger.jsx.map +1 -0
- package/dist/Focusable.js +70 -0
- package/dist/Focusable.js.map +1 -0
- package/dist/Focusable.jsx +69 -0
- package/dist/Focusable.jsx.map +1 -0
- package/dist/Form.js +99 -0
- package/dist/Form.js.map +1 -0
- package/dist/Form.jsx +73 -0
- package/dist/Form.jsx.map +1 -0
- package/dist/GridList.d.ts +34 -2
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +723 -0
- package/dist/GridList.js.map +1 -0
- package/dist/GridList.jsx +552 -0
- package/dist/GridList.jsx.map +1 -0
- package/dist/HiddenTimeInput.js +104 -0
- package/dist/HiddenTimeInput.js.map +1 -0
- package/dist/HiddenTimeInput.jsx +69 -0
- package/dist/HiddenTimeInput.jsx.map +1 -0
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +127 -0
- package/dist/Icon.js.map +1 -0
- package/dist/Icon.jsx +72 -0
- package/dist/Icon.jsx.map +1 -0
- package/dist/Keyboard.js +30 -0
- package/dist/Keyboard.js.map +1 -0
- package/dist/Keyboard.jsx +24 -0
- package/dist/Keyboard.jsx.map +1 -0
- package/dist/Landmark.js +134 -0
- package/dist/Landmark.js.map +1 -0
- package/dist/Landmark.jsx +118 -0
- package/dist/Landmark.jsx.map +1 -0
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +219 -0
- package/dist/Link.js.map +1 -0
- package/dist/Link.jsx +189 -0
- package/dist/Link.jsx.map +1 -0
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +670 -0
- package/dist/ListBox.js.map +1 -0
- package/dist/ListBox.jsx +508 -0
- package/dist/ListBox.jsx.map +1 -0
- package/dist/Menu.d.ts +27 -9
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +1254 -0
- package/dist/Menu.js.map +1 -0
- package/dist/Menu.jsx +1042 -0
- package/dist/Menu.jsx.map +1 -0
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +123 -0
- package/dist/Meter.js.map +1 -0
- package/dist/Meter.jsx +107 -0
- package/dist/Meter.jsx.map +1 -0
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +380 -0
- package/dist/Modal.js.map +1 -0
- package/dist/Modal.jsx +314 -0
- package/dist/Modal.jsx.map +1 -0
- package/dist/NumberField.d.ts +3 -3
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/NumberField.js +573 -0
- package/dist/NumberField.js.map +1 -0
- package/dist/NumberField.jsx +443 -0
- package/dist/NumberField.jsx.map +1 -0
- package/dist/Popover.d.ts +10 -2
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +464 -0
- package/dist/Popover.js.map +1 -0
- package/dist/Popover.jsx +333 -0
- package/dist/Popover.jsx.map +1 -0
- package/dist/Pressable.js +69 -0
- package/dist/Pressable.js.map +1 -0
- package/dist/Pressable.jsx +68 -0
- package/dist/Pressable.jsx.map +1 -0
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar.js +130 -0
- package/dist/ProgressBar.js.map +1 -0
- package/dist/ProgressBar.jsx +114 -0
- package/dist/ProgressBar.jsx.map +1 -0
- package/dist/RadioGroup.d.ts +82 -4
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +931 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/RadioGroup.jsx +681 -0
- package/dist/RadioGroup.jsx.map +1 -0
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +410 -0
- package/dist/RangeCalendar.js.map +1 -0
- package/dist/RangeCalendar.jsx +253 -0
- package/dist/RangeCalendar.jsx.map +1 -0
- package/dist/RouterProvider.js +118 -0
- package/dist/RouterProvider.js.map +1 -0
- package/dist/RouterProvider.jsx +112 -0
- package/dist/RouterProvider.jsx.map +1 -0
- package/dist/SearchField.d.ts +2 -2
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +643 -0
- package/dist/SearchField.js.map +1 -0
- package/dist/SearchField.jsx +526 -0
- package/dist/SearchField.jsx.map +1 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +1031 -0
- package/dist/Select.js.map +1 -0
- package/dist/Select.jsx +744 -0
- package/dist/Select.jsx.map +1 -0
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/SelectionIndicator.js +86 -0
- package/dist/SelectionIndicator.js.map +1 -0
- package/dist/SelectionIndicator.jsx +50 -0
- package/dist/SelectionIndicator.jsx.map +1 -0
- package/dist/Separator.js +97 -0
- package/dist/Separator.js.map +1 -0
- package/dist/Separator.jsx +85 -0
- package/dist/Separator.jsx.map +1 -0
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +165 -0
- package/dist/SharedElementTransition.js.map +1 -0
- package/dist/SharedElementTransition.jsx +138 -0
- package/dist/SharedElementTransition.jsx.map +1 -0
- package/dist/Slider.d.ts +33 -1
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +515 -0
- package/dist/Slider.js.map +1 -0
- package/dist/Slider.jsx +403 -0
- package/dist/Slider.jsx.map +1 -0
- package/dist/StepList.js +198 -0
- package/dist/StepList.js.map +1 -0
- package/dist/StepList.jsx +141 -0
- package/dist/StepList.jsx.map +1 -0
- package/dist/Switch.d.ts +65 -2
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +534 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Switch.jsx +393 -0
- package/dist/Switch.jsx.map +1 -0
- package/dist/Table.d.ts +48 -0
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +1759 -0
- package/dist/Table.js.map +1 -0
- package/dist/Table.jsx +1348 -0
- package/dist/Table.jsx.map +1 -0
- package/dist/Tabs.d.ts +0 -4
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +595 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tabs.jsx +367 -0
- package/dist/Tabs.jsx.map +1 -0
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +378 -0
- package/dist/TagGroup.js.map +1 -0
- package/dist/TagGroup.jsx +270 -0
- package/dist/TagGroup.jsx.map +1 -0
- package/dist/Text.d.ts +18 -6
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +42 -0
- package/dist/Text.js.map +1 -0
- package/dist/Text.jsx +35 -0
- package/dist/Text.jsx.map +1 -0
- package/dist/TextField.d.ts +6 -6
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +436 -0
- package/dist/TextField.js.map +1 -0
- package/dist/TextField.jsx +403 -0
- package/dist/TextField.jsx.map +1 -0
- package/dist/TimeField.d.ts +3 -3
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +372 -0
- package/dist/TimeField.js.map +1 -0
- package/dist/TimeField.jsx +224 -0
- package/dist/TimeField.jsx.map +1 -0
- package/dist/Toast.d.ts +14 -0
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toast.js +551 -0
- package/dist/Toast.js.map +1 -0
- package/dist/Toast.jsx +361 -0
- package/dist/Toast.jsx.map +1 -0
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton.js +123 -0
- package/dist/ToggleButton.js.map +1 -0
- package/dist/ToggleButton.jsx +88 -0
- package/dist/ToggleButton.jsx.map +1 -0
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.js +114 -0
- package/dist/ToggleButtonGroup.js.map +1 -0
- package/dist/ToggleButtonGroup.jsx +85 -0
- package/dist/ToggleButtonGroup.jsx.map +1 -0
- package/dist/Toolbar.js +112 -0
- package/dist/Toolbar.js.map +1 -0
- package/dist/Toolbar.jsx +92 -0
- package/dist/Toolbar.jsx.map +1 -0
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip.js +539 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/Tooltip.jsx +465 -0
- package/dist/Tooltip.jsx.map +1 -0
- package/dist/Tree.d.ts +14 -2
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +1424 -0
- package/dist/Tree.js.map +1 -0
- package/dist/Tree.jsx +1172 -0
- package/dist/Tree.jsx.map +1 -0
- package/dist/Virtualizer.d.ts +16 -2
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/Virtualizer.js +2 -0
- package/dist/Virtualizer.jsx +2 -0
- package/dist/Virtualizer2.js +751 -0
- package/dist/Virtualizer2.js.map +1 -0
- package/dist/Virtualizer2.jsx +730 -0
- package/dist/Virtualizer2.jsx.map +1 -0
- package/dist/VirtualizerLayouts.d.ts +18 -0
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +42 -0
- package/dist/VisuallyHidden.js.map +1 -0
- package/dist/VisuallyHidden.jsx +35 -0
- package/dist/VisuallyHidden.jsx.map +1 -0
- package/dist/contexts.js +33 -0
- package/dist/contexts.js.map +1 -0
- package/dist/contexts.jsx +33 -0
- package/dist/contexts.jsx.map +1 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -23932
- package/dist/index.jsx +70 -18337
- package/dist/useDragAndDrop.js +2 -0
- package/dist/useDragAndDrop.jsx +2 -0
- package/dist/useDragAndDrop2.js +395 -0
- package/dist/useDragAndDrop2.js.map +1 -0
- package/dist/useDragAndDrop2.jsx +395 -0
- package/dist/useDragAndDrop2.jsx.map +1 -0
- package/dist/utils.d.ts +83 -11
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +285 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.jsx +277 -0
- package/dist/utils.jsx.map +1 -0
- package/dist/virtualizer/Layout.js +144 -0
- package/dist/virtualizer/Layout.js.map +1 -0
- package/dist/virtualizer/Layout.jsx +144 -0
- package/dist/virtualizer/Layout.jsx.map +1 -0
- package/package.json +401 -4
- package/src/Breadcrumbs.tsx +3 -1
- package/src/Button.tsx +22 -2
- package/src/Calendar.tsx +27 -10
- package/src/CalendarPicker.tsx +73 -0
- package/src/Checkbox.tsx +539 -3
- package/src/Collection.tsx +9 -3
- package/src/Color.tsx +42 -14
- package/src/ComboBox.tsx +50 -6
- package/src/DateField.tsx +20 -2
- package/src/DatePicker.tsx +57 -5
- package/src/Dialog.tsx +13 -5
- package/src/Disclosure.tsx +3 -1
- package/src/DragAndDrop.tsx +3 -1
- package/src/DropZone.tsx +3 -1
- package/src/GridList.tsx +125 -24
- package/src/Icon.tsx +3 -1
- package/src/Link.tsx +3 -1
- package/src/ListBox.tsx +31 -4
- package/src/Menu.tsx +252 -128
- package/src/Meter.tsx +3 -1
- package/src/Modal.tsx +100 -52
- package/src/NumberField.tsx +51 -8
- package/src/Popover.tsx +40 -10
- package/src/ProgressBar.tsx +3 -1
- package/src/RadioGroup.tsx +468 -4
- package/src/RangeCalendar.tsx +3 -1
- package/src/SearchField.tsx +27 -3
- package/src/Select.tsx +22 -7
- package/src/SelectionIndicator.tsx +3 -1
- package/src/SharedElementTransition.tsx +3 -1
- package/src/Slider.tsx +159 -13
- package/src/Switch.tsx +395 -2
- package/src/Table.tsx +409 -95
- package/src/Tabs.tsx +16 -45
- package/src/TagGroup.tsx +3 -1
- package/src/Text.tsx +31 -10
- package/src/TextField.tsx +43 -5
- package/src/TimeField.tsx +20 -2
- package/src/Toast.tsx +79 -14
- package/src/ToggleButton.tsx +3 -1
- package/src/ToggleButtonGroup.tsx +3 -1
- package/src/Tooltip.tsx +3 -1
- package/src/Tree.tsx +77 -9
- package/src/Virtualizer.tsx +180 -31
- package/src/VirtualizerLayouts.ts +45 -10
- package/src/index.ts +50 -0
- package/src/utils.tsx +243 -27
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.jsx","names":["mergeProps"],"sources":["../src/Checkbox.tsx"],"sourcesContent":["/**\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 Context,\n type Accessor,\n createContext,\n useContext,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n Show,\n} from \"solid-js\";\nimport {\n createCheckbox,\n createCheckboxGroup,\n createCheckboxGroupItem,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaCheckboxProps,\n type AriaCheckboxGroupProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createToggleState,\n createCheckboxGroupState,\n VALID_VALIDITY_STATE,\n type CheckboxGroupState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n Provider,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport { TextContext } from \"./Text\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface CheckboxGroupRenderProps {\n /** Whether the checkbox group is disabled. */\n isDisabled: boolean;\n /** Whether the checkbox group is read only. */\n isReadOnly: boolean;\n /** Whether the checkbox group is required. */\n isRequired: boolean;\n /** Whether the checkbox group is invalid. */\n isInvalid: boolean;\n /** State of the checkbox group. */\n state: CheckboxGroupState;\n}\n\nexport interface CheckboxRenderProps {\n /** Whether the checkbox is selected. */\n isSelected: boolean;\n /** Whether the checkbox is indeterminate. */\n isIndeterminate: boolean;\n /** Whether the checkbox is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the checkbox is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the checkbox is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the checkbox is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the checkbox is disabled. */\n isDisabled: boolean;\n /** Whether the checkbox is read only. */\n isReadOnly: boolean;\n /** Whether the checkbox is invalid. */\n isInvalid: boolean;\n /** Whether the checkbox is required. */\n isRequired: boolean;\n}\n\nexport interface CheckboxGroupProps\n extends Omit<AriaCheckboxGroupProps, \"children\" | \"label\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<CheckboxGroupRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CheckboxGroupRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CheckboxGroupRenderProps>;\n /** Ref for the checkbox group root element. */\n ref?: RefLike<HTMLDivElement>;\n /**\n * Whether this component renders its own description/error-message elements.\n * A styled layer (e.g. solid-spectrum) that renders its own HelpText via a\n * `<Text slot>` sets this to `false`: the wiring stays here — the single source\n * of truth that mints the description/error ids and threads them onto the group\n * and every item's `aria-describedby` — while the visible node is owned by the\n * styled layer. Mirrors RAC, where the group provides a `TextContext` slot and\n * never renders its own description node.\n * @default true\n */\n renderHelpText?: boolean;\n}\n\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<CheckboxRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CheckboxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CheckboxRenderProps>;\n /** Custom renderer for the outer label element. */\n render?: (\n props: JSX.LabelHTMLAttributes<HTMLLabelElement>,\n renderProps: CheckboxRenderProps,\n ) => JSX.Element;\n /** Ref for the outer label element. */\n ref?: RefLike<HTMLLabelElement>;\n /** Ref for the underlying input element. */\n inputRef?: RefLike<HTMLInputElement>;\n /** Whether the checkbox is indeterminate. */\n isIndeterminate?: boolean;\n /** A description for the checkbox. */\n description?: JSX.Element;\n /** An error message for the checkbox. */\n errorMessage?: JSX.Element;\n /** Handler called when hover starts. */\n onHoverStart?: () => void;\n /** Handler called when hover ends. */\n onHoverEnd?: () => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n}\n\nexport const CheckboxGroupContext = createContext<CheckboxGroupProps | null>(null);\nexport const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);\nexport interface CheckboxContextValue extends CheckboxProps {\n slots?: Record<string, CheckboxProps>;\n}\nexport const CheckboxContext = createContext<CheckboxContextValue | null>(null);\n\ntype PropsWithValidationBehavior = {\n validationBehavior?: \"aria\" | \"native\";\n};\n\nfunction withFormValidationBehavior<T extends PropsWithValidationBehavior>(\n props: T,\n formContext: FormProps | null,\n): T {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\n/**\n * A checkbox group allows a user to select multiple items from a list of options.\n *\n * @example\n * ```tsx\n * <CheckboxGroup>\n * <Checkbox value=\"one\">Option 1</Checkbox>\n * <Checkbox value=\"two\">Option 2</Checkbox>\n * </CheckboxGroup>\n * ```\n */\nexport function CheckboxGroup(props: CheckboxGroupProps): JSX.Element {\n const formContext = useContext(FormContext);\n const mergedProps = withFormValidationBehavior(props, formContext);\n const [local, ariaProps] = splitProps(mergedProps, [\n \"class\",\n \"style\",\n \"slot\",\n \"ref\",\n \"description\",\n \"errorMessage\",\n \"renderHelpText\",\n \"children\",\n ]);\n\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createCheckboxGroupState(() => ({\n value: ariaProps.value,\n defaultValue: ariaProps.defaultValue,\n onChange: ariaProps.onChange,\n isDisabled: ariaProps.isDisabled,\n isReadOnly: ariaProps.isReadOnly,\n isRequired: ariaProps.isRequired,\n isInvalid: ariaProps.isInvalid,\n validationState: ariaProps.validationState,\n validate: ariaProps.validate,\n validationBehavior: ariaProps.validationBehavior,\n name: ariaProps.name,\n }));\n\n const groupAria = createCheckboxGroup(\n () => ({\n ...ariaProps,\n description: local.description,\n errorMessage: local.errorMessage,\n }),\n state,\n );\n\n const renderValues = createMemo<CheckboxGroupRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: ariaProps.isRequired ?? false,\n isInvalid: groupAria.isInvalid,\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-CheckboxGroup\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = groupAria.groupProps as Record<string, unknown>;\n return rest;\n };\n const setGroupRef = (el: HTMLDivElement) => {\n assignRef(local.ref, el);\n };\n const groupDescribedBy = () => {\n const ids = [\n (cleanGroupProps() as { \"aria-describedby\"?: string })[\"aria-describedby\"],\n local.description ? groupAria.descriptionProps.id : undefined,\n groupAria.isInvalid && local.errorMessage ? groupAria.errorMessageProps.id : undefined,\n ]\n .filter(Boolean)\n .join(\" \")\n .split(\" \")\n .filter(Boolean);\n return ids.length ? Array.from(new Set(ids)).join(\" \") : undefined;\n };\n\n const GroupChildren = () => {\n const childRenderValues: CheckboxGroupRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isReadOnly() {\n return state.isReadOnly;\n },\n get isRequired() {\n return state.isRequired();\n },\n get isInvalid() {\n return groupAria.isInvalid;\n },\n get state() {\n return state;\n },\n };\n const renderedChildren = createMemo(() => {\n const children = local.children;\n if (typeof children === \"function\") {\n return children.length > 0\n ? children(childRenderValues)\n : (children as unknown as () => JSX.Element)();\n }\n return children;\n });\n\n return <>{renderedChildren()}</>;\n };\n\n return (\n <CheckboxGroupStateContext.Provider value={state}>\n <div\n {...domProps()}\n {...cleanGroupProps()}\n ref={setGroupRef}\n aria-describedby={groupDescribedBy()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-invalid={groupAria.isInvalid || undefined}\n >\n <GroupChildren />\n {/* A styled layer can own the visible HelpText (renderHelpText={false});\n the id wiring above still runs so the group and its items stay\n associated. Default true keeps the bare headless self-sufficient. */}\n <Show when={(local.renderHelpText ?? true) && local.description}>\n <div {...(groupAria.descriptionProps as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {local.description}\n </div>\n </Show>\n <Show when={(local.renderHelpText ?? true) && groupAria.isInvalid && local.errorMessage}>\n <div {...(groupAria.errorMessageProps as unknown as JSX.HTMLAttributes<HTMLDivElement>)}>\n {local.errorMessage}\n </div>\n </Show>\n </div>\n </CheckboxGroupStateContext.Provider>\n );\n}\n\n/**\n * A checkbox allows a user to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n *\n * @example\n * ```tsx\n * <Checkbox>\n * {({ isSelected }) => (\n * <>\n * <span class={`checkbox ${isSelected ? 'checked' : ''}`}>\n * {isSelected && '✓'}\n * </span>\n * <span>Accept terms</span>\n * </>\n * )}\n * </Checkbox>\n * ```\n */\nexport function Checkbox(props: CheckboxProps): JSX.Element {\n const [inputElement, setInputElement] = createSignal<HTMLInputElement | null>(null);\n const formContext = useContext(FormContext);\n const contextProps = useContext(CheckboxContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<CheckboxProps>(() => {\n if (!contextProps) return {};\n const { slots: _slots, ...rest } = contextProps;\n return rest;\n });\n const mergedProps = contextProps\n ? (mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) as CheckboxProps)\n : props;\n const propsWithFormBehavior = withFormValidationBehavior(mergedProps, formContext);\n const inputRefs = createMemo(\n () =>\n [contextBaseProps().inputRef, contextSlotProps?.inputRef, props.inputRef].filter(\n Boolean,\n ) as RefLike<HTMLInputElement>[],\n );\n\n const [local, ariaProps] = splitProps(propsWithFormBehavior, [\n \"class\",\n \"style\",\n \"render\",\n \"ref\",\n \"inputRef\",\n \"slot\",\n \"isIndeterminate\",\n \"description\",\n \"errorMessage\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n const descriptionId = createUniqueId();\n const errorMessageId = createUniqueId();\n\n const inputAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n const groupState = useContext(CheckboxGroupStateContext);\n\n let isSelected: Accessor<boolean>;\n let isPressed: Accessor<boolean>;\n let isDisabled: Accessor<boolean>;\n let isReadOnly: Accessor<boolean>;\n let isInvalid: Accessor<boolean>;\n let labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n let inputProps: () => JSX.InputHTMLAttributes<HTMLInputElement>;\n\n if (groupState) {\n const itemAria = createCheckboxGroupItem(\n () => ({\n ...inputAriaProps(),\n value: inputAriaProps().value ?? \"\",\n children: typeof mergedProps.children === \"function\" ? true : mergedProps.children,\n }),\n groupState,\n inputElement,\n );\n isSelected = itemAria.isSelected;\n isPressed = itemAria.isPressed;\n labelProps = itemAria.labelProps;\n inputProps = () => itemAria.inputProps;\n } else {\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createToggleState(() => ({\n isSelected: ariaProps.isSelected,\n defaultSelected: ariaProps.defaultSelected,\n onChange: ariaProps.onChange,\n isReadOnly: ariaProps.isReadOnly,\n }));\n\n const checkboxAria = createCheckbox(\n () => ({\n ...inputAriaProps(),\n isIndeterminate: local.isIndeterminate,\n children: typeof mergedProps.children === \"function\" ? true : mergedProps.children,\n }),\n state,\n inputElement,\n );\n isSelected = checkboxAria.isSelected;\n isPressed = checkboxAria.isPressed;\n labelProps = checkboxAria.labelProps;\n inputProps = () => checkboxAria.inputProps;\n }\n isDisabled = () => inputProps().disabled === true;\n isReadOnly = () => inputProps()[\"aria-readonly\"] === true;\n isInvalid = () => inputProps()[\"aria-invalid\"] === true;\n const describedBy = () => {\n const ids = [\n ariaProps[\"aria-describedby\"],\n local.description ? descriptionId : undefined,\n isInvalid() && local.errorMessage ? errorMessageId : undefined,\n ].filter(Boolean);\n return ids.length ? ids.join(\" \") : undefined;\n };\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled() || isReadOnly();\n },\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n });\n\n const renderValues = createMemo<CheckboxRenderProps>(() => ({\n isSelected: isSelected(),\n isIndeterminate: local.isIndeterminate ?? false,\n isHovered: isHovered(),\n isPressed: isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: isDisabled(),\n isReadOnly: isReadOnly(),\n isInvalid: isInvalid(),\n isRequired: ariaProps.isRequired ?? false,\n }));\n\n const renderProps = useRenderProps(\n {\n children: mergedProps.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Checkbox\",\n },\n renderValues,\n );\n const childRenderValues: CheckboxRenderProps = {\n get isSelected() {\n return isSelected();\n },\n get isIndeterminate() {\n return local.isIndeterminate ?? false;\n },\n get isHovered() {\n return isHovered();\n },\n get isPressed() {\n return isPressed();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return isDisabled();\n },\n get isReadOnly() {\n return isReadOnly();\n },\n get isInvalid() {\n return isInvalid();\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n };\n const checkboxChildren = () => {\n const children = mergedProps.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n const cleanLabelProps = () => {\n const { ref: _ref1, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanInputProps = () => {\n const {\n ref: _ref3,\n onFocus: _onFocus,\n onBlur: _onBlur,\n ...rest\n } = inputProps() as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const {\n ref: _ref4,\n onFocus: _onFocus,\n onBlur: _onBlur,\n ...rest\n } = focusProps as Record<string, unknown>;\n return rest;\n };\n const handleInputFocus: JSX.EventHandler<HTMLInputElement, FocusEvent> = (event) => {\n (\n inputProps() as unknown as { onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onFocus?.(event);\n (\n focusProps as unknown as { onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onFocus?.(event);\n };\n const handleInputBlur: JSX.EventHandler<HTMLInputElement, FocusEvent> = (event) => {\n (\n inputProps() as unknown as { onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onBlur?.(event);\n (focusProps as unknown as { onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent> }).onBlur?.(\n event,\n );\n };\n const setLabelRef = (el: HTMLLabelElement) => {\n assignRef(local.ref, el);\n };\n const setInputRef = (el: HTMLInputElement) => {\n setInputElement(el);\n for (const ref of inputRefs()) {\n assignRef(ref, el);\n }\n };\n const hiddenInput = (\n <VisuallyHidden>\n <input\n ref={setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n aria-describedby={describedBy()}\n />\n </VisuallyHidden>\n );\n const labelChildren = () => (\n <>\n {hiddenInput}\n {checkboxChildren()}\n <Show when={local.description}>\n <span id={descriptionId} slot=\"description\">\n {local.description}\n </span>\n </Show>\n <Show when={isInvalid() && local.errorMessage}>\n <span id={errorMessageId} slot=\"errorMessage\">\n {local.errorMessage}\n </span>\n </Show>\n </>\n );\n const rootProps = createMemo(\n () =>\n ({\n ...domProps(),\n ...cleanLabelProps(),\n ...cleanHoverProps(),\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-selected\": isSelected() || undefined,\n \"data-indeterminate\": local.isIndeterminate || undefined,\n \"data-pressed\": isPressed() || undefined,\n \"data-hovered\": isHovered() || undefined,\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": isFocusVisible() || undefined,\n \"data-disabled\": isDisabled() || undefined,\n \"data-readonly\": isReadOnly() || undefined,\n \"data-invalid\": isInvalid() || undefined,\n \"data-required\": ariaProps.isRequired || undefined,\n }) as JSX.LabelHTMLAttributes<HTMLLabelElement>,\n );\n const customRootProps = () =>\n ({\n ...rootProps(),\n ref: setLabelRef,\n children: labelChildren(),\n }) as JSX.LabelHTMLAttributes<HTMLLabelElement>;\n\n return local.render ? (\n local.render(customRootProps(), renderValues())\n ) : (\n <label\n {...domProps()}\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n ref={setLabelRef}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-selected={isSelected() || undefined}\n data-indeterminate={local.isIndeterminate || undefined}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={isDisabled() || undefined}\n data-readonly={isReadOnly() || undefined}\n data-invalid={isInvalid() || undefined}\n data-required={ariaProps.isRequired || undefined}\n >\n {labelChildren()}\n </label>\n );\n}\n\n// ============================================================================\n// CheckboxField + CheckboxButton — the RAC form-field split (RAC 1.19)\n// ----------------------------------------------------------------------------\n// Upstream split the monolithic Checkbox into a CheckboxField wrapper (owns\n// state, validation, and help text) containing a CheckboxButton control (the\n// clickable indicator + label). Mirrors react-aria-components/src/Checkbox.tsx.\n// The legacy `Checkbox` above stays as the deprecated monolith for back-compat.\n//\n// Help text wiring mirrors upstream exactly: CheckboxField has NO description /\n// errorMessage props. createCheckbox (via createToggle) mints descriptionProps /\n// errorMessageProps (slot ids) and bakes the combined aria-describedby into\n// inputProps; the field provides those ids through TextContext slots. Consumers\n// render the help text themselves with `<Text slot=\"description\">` / `<FieldError>`.\n// The field/button handoff still uses a native InternalCheckboxContext (read inside\n// the provider via `Show … keyed`), but the slot wiring is now faithful.\n// ============================================================================\n\nexport interface CheckboxFieldRenderProps {\n /** Whether the checkbox is selected. */\n isSelected: boolean;\n /** Whether the checkbox is indeterminate. */\n isIndeterminate: 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 CheckboxButtonRenderProps extends CheckboxRenderProps {}\n\nexport interface CheckboxFieldProps\n extends Omit<AriaCheckboxProps, \"children\" | \"validationState\">, SlotProps {\n /** The children of the component (typically a `CheckboxButton`). A function may receive render props. */\n children?: RenderChildren<CheckboxFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CheckboxFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CheckboxFieldRenderProps>;\n /** Whether the checkbox is indeterminate. */\n isIndeterminate?: boolean;\n /** Ref for the checkbox field root element. */\n ref?: RefLike<HTMLDivElement>;\n /** Ref for the underlying input element. */\n inputRef?: RefLike<HTMLInputElement>;\n}\n\nexport interface CheckboxButtonProps extends SlotProps {\n /** The children of the component. A function may receive render props. */\n children?: RenderChildren<CheckboxButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CheckboxButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CheckboxButtonRenderProps>;\n /** Ref for the outer label element. */\n ref?: RefLike<HTMLLabelElement>;\n /** Handler called when hover starts. */\n onHoverStart?: () => void;\n /** Handler called when hover ends. */\n onHoverEnd?: () => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n}\n\nexport interface CheckboxFieldContextValue extends CheckboxFieldProps {\n slots?: Record<string, CheckboxFieldProps>;\n}\nexport const CheckboxFieldContext = createContext<CheckboxFieldContextValue | null>(null);\n\n/** Carries the checkbox aria + state from a CheckboxField/Checkbox wrapper to its CheckboxButton. */\ninterface InternalCheckboxContextValue {\n isSelected: Accessor<boolean>;\n isPressed: Accessor<boolean>;\n isDisabled: Accessor<boolean>;\n isReadOnly: Accessor<boolean>;\n isInvalid: Accessor<boolean>;\n isIndeterminate: Accessor<boolean>;\n isRequired: Accessor<boolean>;\n labelProps: () => JSX.LabelHTMLAttributes<HTMLLabelElement>;\n inputProps: () => JSX.InputHTMLAttributes<HTMLInputElement>;\n setInputRef: (el: HTMLInputElement) => void;\n defaultClassName: string;\n}\nconst InternalCheckboxContext = createContext<InternalCheckboxContextValue | null>(null);\n\n/**\n * A checkbox allows a user to select an item, with support for validation and help text.\n * Wraps a `CheckboxButton` and provides description/error wiring.\n *\n * @example\n * ```tsx\n * <CheckboxField>\n * <CheckboxButton>Accept terms</CheckboxButton>\n * <Text slot=\"description\">Required to continue</Text>\n * </CheckboxField>\n * ```\n */\nexport function CheckboxField(props: CheckboxFieldProps): JSX.Element {\n const [inputElement, setInputElement] = createSignal<HTMLInputElement | null>(null);\n const formContext = useContext(FormContext);\n const contextProps = useContext(CheckboxFieldContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<CheckboxFieldProps>(() => {\n if (!contextProps) return {};\n const { slots: _slots, ...rest } = contextProps;\n return rest;\n });\n const mergedProps = contextProps\n ? (mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) as CheckboxFieldProps)\n : props;\n const propsWithFormBehavior = withFormValidationBehavior(mergedProps, formContext);\n const inputRefs = createMemo(\n () =>\n [contextBaseProps().inputRef, contextSlotProps?.inputRef, props.inputRef].filter(\n Boolean,\n ) as RefLike<HTMLInputElement>[],\n );\n\n // `children` is split out of ariaProps so neither the inputAriaProps key-copy\n // loop nor the hook accessor spread eagerly reads it — reading a Solid\n // `children` getter instantiates the nested CheckboxButton, and doing so\n // OUTSIDE InternalCheckboxContext both breaks its binding and recurses.\n const [local, ariaProps] = splitProps(propsWithFormBehavior, [\n \"class\",\n \"style\",\n \"ref\",\n \"inputRef\",\n \"slot\",\n \"isIndeterminate\",\n \"children\",\n ]);\n\n const inputAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n const groupState = useContext(CheckboxGroupStateContext);\n\n let isSelected: Accessor<boolean>;\n let isPressed: Accessor<boolean>;\n let labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n let inputProps: () => JSX.InputHTMLAttributes<HTMLInputElement>;\n let getDescriptionProps: () => JSX.HTMLAttributes<HTMLElement>;\n let getErrorMessageProps: () => JSX.HTMLAttributes<HTMLElement>;\n\n if (groupState) {\n const itemAria = createCheckboxGroupItem(\n () => ({\n ...inputAriaProps(),\n value: inputAriaProps().value ?? \"\",\n // The hook reads `children` only to decide if an aria-label is needed;\n // the visible label lives in the CheckboxButton, so report presence.\n children: true,\n }),\n groupState,\n inputElement,\n );\n isSelected = itemAria.isSelected;\n isPressed = itemAria.isPressed;\n labelProps = itemAria.labelProps;\n inputProps = () => itemAria.inputProps;\n getDescriptionProps = () => itemAria.descriptionProps;\n getErrorMessageProps = () => itemAria.errorMessageProps;\n } else {\n const state = createToggleState(() => ({\n isSelected: ariaProps.isSelected,\n defaultSelected: ariaProps.defaultSelected,\n onChange: ariaProps.onChange,\n isReadOnly: ariaProps.isReadOnly,\n }));\n\n const checkboxAria = createCheckbox(\n () => ({\n ...inputAriaProps(),\n isIndeterminate: local.isIndeterminate,\n children: true,\n }),\n state,\n inputElement,\n );\n isSelected = checkboxAria.isSelected;\n isPressed = checkboxAria.isPressed;\n labelProps = checkboxAria.labelProps;\n inputProps = () => checkboxAria.inputProps;\n getDescriptionProps = () => checkboxAria.descriptionProps;\n getErrorMessageProps = () => checkboxAria.errorMessageProps;\n }\n const isDisabled = () => inputProps().disabled === true;\n const isReadOnly = () => inputProps()[\"aria-readonly\"] === true;\n const isInvalid = () => inputProps()[\"aria-invalid\"] === true;\n const isIndeterminate = () => local.isIndeterminate ?? false;\n const isRequired = () => ariaProps.isRequired ?? false;\n\n const setInputRef = (el: HTMLInputElement) => {\n setInputElement(el);\n for (const ref of inputRefs()) {\n assignRef(ref, el);\n }\n };\n const setFieldRef = (el: HTMLDivElement) => {\n assignRef(local.ref, el);\n };\n\n const internalContext: InternalCheckboxContextValue = {\n isSelected,\n isPressed,\n isDisabled,\n isReadOnly,\n isInvalid,\n isIndeterminate,\n isRequired,\n labelProps: () => labelProps,\n inputProps,\n setInputRef,\n defaultClassName: \"solidaria-CheckboxButton\",\n };\n\n // Slot the description/error message ids onto a TextContext so a child\n // `<Text slot=\"description\">` / `<FieldError>` resolves the id the input's\n // baked aria-describedby references — mirrors upstream CheckboxField.\n const textSlots = {\n slots: {\n get description() {\n return getDescriptionProps();\n },\n get errorMessage() {\n return getErrorMessageProps();\n },\n },\n };\n\n const renderValues = createMemo<CheckboxFieldRenderProps>(() => ({\n isSelected: isSelected(),\n isIndeterminate: isIndeterminate(),\n isDisabled: isDisabled(),\n isReadOnly: isReadOnly(),\n isInvalid: isInvalid(),\n isRequired: isRequired(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: mergedProps.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-CheckboxField\",\n },\n renderValues,\n );\n\n // In a CheckboxGroup, validation is handled at the group level — mirror\n // upstream and provide no per-field FieldErrorContext there.\n const fieldErrorContext: FieldErrorContextValue | null = groupState\n ? null\n : {\n get validation(): ValidationResult {\n return {\n isInvalid: isInvalid(),\n validationDetails: VALID_VALIDITY_STATE,\n validationErrors: [],\n };\n },\n get errorMessageProps() {\n return getErrorMessageProps() as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n // Children are accessed inside the providers (component-execution owner) so a\n // nested CheckboxButton's useContext binds to InternalCheckboxContext.\n const FieldChildren = () => {\n const childRenderValues: CheckboxFieldRenderProps = {\n get isSelected() {\n return isSelected();\n },\n get isIndeterminate() {\n return isIndeterminate();\n },\n get isDisabled() {\n return isDisabled();\n },\n get isReadOnly() {\n return isReadOnly();\n },\n get isInvalid() {\n return isInvalid();\n },\n get isRequired() {\n return isRequired();\n },\n };\n const renderedChildren = createMemo(() => {\n const children = mergedProps.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n });\n return <>{renderedChildren()}</>;\n };\n\n const fieldDiv = (\n <div\n {...domProps()}\n ref={setFieldRef}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-selected={isSelected() || undefined}\n data-indeterminate={isIndeterminate() || undefined}\n data-disabled={isDisabled() || undefined}\n data-readonly={isReadOnly() || undefined}\n data-invalid={isInvalid() || undefined}\n data-required={isRequired() || undefined}\n >\n <InternalCheckboxContext.Provider value={internalContext}>\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n <Show when={fieldErrorContext} fallback={<FieldChildren />} keyed>\n {(ctx) => (\n <FieldErrorContext.Provider value={ctx}>\n <FieldChildren />\n </FieldErrorContext.Provider>\n )}\n </Show>\n </Provider>\n </InternalCheckboxContext.Provider>\n </div>\n );\n\n return fieldDiv;\n}\n\n/**\n * A checkbox button is the clickable area of a checkbox, including the indicator and label.\n * Must be rendered inside a `CheckboxField` (or the legacy `Checkbox`).\n */\nexport function CheckboxButton(props: CheckboxButtonProps): JSX.Element {\n const getCtx = createMemo(() => useContext(InternalCheckboxContext));\n return (\n <Show when={getCtx()} fallback={null} keyed>\n {(ctx) => <CheckboxButtonImpl buttonProps={props} ctx={ctx} />}\n </Show>\n );\n}\n\nfunction CheckboxButtonImpl(props: {\n buttonProps: CheckboxButtonProps;\n ctx: InternalCheckboxContextValue;\n}): JSX.Element {\n const { ctx } = props;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ctx.isDisabled() || ctx.isReadOnly();\n },\n onHoverStart: props.buttonProps.onHoverStart,\n onHoverEnd: props.buttonProps.onHoverEnd,\n onHoverChange: props.buttonProps.onHoverChange,\n });\n\n const renderValues = createMemo<CheckboxButtonRenderProps>(() => ({\n isSelected: ctx.isSelected(),\n isIndeterminate: ctx.isIndeterminate(),\n isHovered: isHovered(),\n isPressed: ctx.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: ctx.isDisabled(),\n isReadOnly: ctx.isReadOnly(),\n isInvalid: ctx.isInvalid(),\n isRequired: ctx.isRequired(),\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.buttonProps.children,\n class: props.buttonProps.class,\n style: props.buttonProps.style,\n defaultClassName: ctx.defaultClassName,\n },\n renderValues,\n );\n\n const childRenderValues: CheckboxButtonRenderProps = {\n get isSelected() {\n return ctx.isSelected();\n },\n get isIndeterminate() {\n return ctx.isIndeterminate();\n },\n get isHovered() {\n return isHovered();\n },\n get isPressed() {\n return ctx.isPressed();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return ctx.isDisabled();\n },\n get isReadOnly() {\n return ctx.isReadOnly();\n },\n get isInvalid() {\n return ctx.isInvalid();\n },\n get isRequired() {\n return ctx.isRequired();\n },\n };\n\n const cleanLabelProps = () => {\n const { ref: _ref1, ...rest } = ctx.labelProps() as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanInputProps = () => {\n const {\n ref: _ref3,\n onFocus: _onFocus,\n onBlur: _onBlur,\n ...rest\n } = ctx.inputProps() as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const {\n ref: _ref4,\n onFocus: _onFocus,\n onBlur: _onBlur,\n ...rest\n } = focusProps as Record<string, unknown>;\n return rest;\n };\n const handleInputFocus: JSX.EventHandler<HTMLInputElement, FocusEvent> = (event) => {\n (\n ctx.inputProps() as unknown as { onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onFocus?.(event);\n (\n focusProps as unknown as { onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onFocus?.(event);\n };\n const handleInputBlur: JSX.EventHandler<HTMLInputElement, FocusEvent> = (event) => {\n (\n ctx.inputProps() as unknown as { onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent> }\n ).onBlur?.(event);\n (focusProps as unknown as { onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent> }).onBlur?.(\n event,\n );\n };\n const setButtonRef = (el: HTMLLabelElement) => {\n assignRef(props.buttonProps.ref, el);\n };\n\n const buttonChildren = () => {\n const children = props.buttonProps.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n ref={setButtonRef}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={props.buttonProps.slot}\n data-selected={ctx.isSelected() || undefined}\n data-indeterminate={ctx.isIndeterminate() || undefined}\n data-pressed={ctx.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={ctx.isDisabled() || undefined}\n data-readonly={ctx.isReadOnly() || undefined}\n data-invalid={ctx.isInvalid() || undefined}\n data-required={ctx.isRequired() || undefined}\n >\n <VisuallyHidden>\n <input\n ref={ctx.setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n />\n </VisuallyHidden>\n {buttonChildren()}\n </label>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoDA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AA2FA,MAAa,uBAAuB,cAAyC,IAAI;AACjF,MAAa,4BAA4B,cAAyC,IAAI;AAItF,MAAa,kBAAkB,cAA2C,IAAI;AAM9E,SAAS,2BACP,OACA,aACG;CACH,IAAI,CAAC,aAAa,oBAChB,OAAO;CAGT,OAAO,IAAI,MAAM,OAAO;EACtB,IAAI,QAAQ,UAAU,UAAU;GAC9B,MAAM,aAAa,QAAQ,IAAI,QAAQ,UAAU,QAAQ;GACzD,IAAI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1,202 @@
|
|
|
1
|
+
import { filterDOMProps, useRenderProps } from "./utils.js";
|
|
2
|
+
import { createComponent, getNextElement, insert, memo, mergeProps, runHydrationEvents, spread, template, use } from "solid-js/web";
|
|
3
|
+
import { For, createContext, createMemo, splitProps, useContext } from "solid-js";
|
|
4
|
+
import { Collection as Collection$1, CollectionBuilder as CollectionBuilder$1, createBranchComponent, createLeafComponent } from "@proyecto-viviana/solidaria";
|
|
5
|
+
//#region src/Collection.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Collection composition primitives for solidaria-components.
|
|
8
|
+
*
|
|
9
|
+
* Foundational parity layer for React Spectrum-style composition:
|
|
10
|
+
* Section / Header / Group.
|
|
11
|
+
*/
|
|
12
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div>`);
|
|
13
|
+
function assignRef(ref, el) {
|
|
14
|
+
if (!ref) return;
|
|
15
|
+
if (typeof ref === "function") ref(el);
|
|
16
|
+
else ref.current = el;
|
|
17
|
+
}
|
|
18
|
+
const CollectionRendererContext = createContext(null);
|
|
19
|
+
const SelectableCollectionContext = CollectionRendererContext;
|
|
20
|
+
const SectionContext = createContext(null);
|
|
21
|
+
const GroupContext = createContext(null);
|
|
22
|
+
const HeaderContext = createContext(null);
|
|
23
|
+
const HeadingContext = createContext(null);
|
|
24
|
+
function useCollectionRenderer() {
|
|
25
|
+
return useContext(CollectionRendererContext);
|
|
26
|
+
}
|
|
27
|
+
function isCollectionSection(entry) {
|
|
28
|
+
return typeof entry === "object" && entry !== null && Array.isArray(entry.items);
|
|
29
|
+
}
|
|
30
|
+
function flattenCollectionEntries(entries) {
|
|
31
|
+
const flattened = [];
|
|
32
|
+
for (const entry of entries) if (isCollectionSection(entry)) flattened.push(...entry.items);
|
|
33
|
+
else flattened.push(entry);
|
|
34
|
+
return flattened;
|
|
35
|
+
}
|
|
36
|
+
function renderCollectionItems(collection, renderDropIndicator) {
|
|
37
|
+
return createComponent(For, {
|
|
38
|
+
each: Array.from(collection),
|
|
39
|
+
children: (item, index) => {
|
|
40
|
+
const node = item;
|
|
41
|
+
if (node.type === "content") return [];
|
|
42
|
+
const key = node.key ?? index();
|
|
43
|
+
return [
|
|
44
|
+
memo(() => renderDropIndicator?.({
|
|
45
|
+
type: "item",
|
|
46
|
+
key,
|
|
47
|
+
dropPosition: "before"
|
|
48
|
+
})),
|
|
49
|
+
item,
|
|
50
|
+
memo(() => renderDropIndicator?.({
|
|
51
|
+
type: "item",
|
|
52
|
+
key,
|
|
53
|
+
dropPosition: "after"
|
|
54
|
+
}))
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const DefaultCollectionRenderer = {
|
|
60
|
+
CollectionRoot(props) {
|
|
61
|
+
return renderCollectionItems(props.collection, props.renderDropIndicator);
|
|
62
|
+
},
|
|
63
|
+
CollectionBranch(props) {
|
|
64
|
+
return renderCollectionItems(props.collection, props.renderDropIndicator);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function CollectionBuilder(props) {
|
|
68
|
+
return CollectionBuilder$1(props);
|
|
69
|
+
}
|
|
70
|
+
function Collection(props) {
|
|
71
|
+
return Collection$1(props);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A semantic section wrapper for grouped collection content.
|
|
75
|
+
*/
|
|
76
|
+
function Section(props) {
|
|
77
|
+
const sectionContext = useContext(SectionContext);
|
|
78
|
+
if (sectionContext) {
|
|
79
|
+
if (globalThis.process?.env?.NODE_ENV !== "production") console.warn(`<Section> is deprecated. Please use <${sectionContext.name}> instead.`);
|
|
80
|
+
return sectionContext.render(props, "solidaria-Section");
|
|
81
|
+
}
|
|
82
|
+
const [local, domProps] = splitProps(props, [
|
|
83
|
+
"children",
|
|
84
|
+
"class",
|
|
85
|
+
"style",
|
|
86
|
+
"slot",
|
|
87
|
+
"ref"
|
|
88
|
+
]);
|
|
89
|
+
const renderValues = createMemo(() => ({ hasChildren: local.children != null }));
|
|
90
|
+
const renderProps = useRenderProps({
|
|
91
|
+
get children() {
|
|
92
|
+
return local.children;
|
|
93
|
+
},
|
|
94
|
+
class: local.class,
|
|
95
|
+
style: local.style,
|
|
96
|
+
defaultClassName: "solidaria-Section"
|
|
97
|
+
}, renderValues);
|
|
98
|
+
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
99
|
+
return (() => {
|
|
100
|
+
var _el$ = getNextElement(_tmpl$);
|
|
101
|
+
use((el) => assignRef(local.ref, el), _el$);
|
|
102
|
+
spread(_el$, mergeProps(filteredDomProps, {
|
|
103
|
+
get ["class"]() {
|
|
104
|
+
return renderProps.class();
|
|
105
|
+
},
|
|
106
|
+
get style() {
|
|
107
|
+
return renderProps.style();
|
|
108
|
+
},
|
|
109
|
+
get slot() {
|
|
110
|
+
return local.slot;
|
|
111
|
+
},
|
|
112
|
+
"data-section": ""
|
|
113
|
+
}), false, true);
|
|
114
|
+
insert(_el$, () => renderProps.renderChildren());
|
|
115
|
+
runHydrationEvents();
|
|
116
|
+
return _el$;
|
|
117
|
+
})();
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* A header/title primitive for collection sections.
|
|
121
|
+
*/
|
|
122
|
+
function Header(props) {
|
|
123
|
+
const [local, domProps] = splitProps(props, [
|
|
124
|
+
"children",
|
|
125
|
+
"class",
|
|
126
|
+
"style",
|
|
127
|
+
"slot"
|
|
128
|
+
]);
|
|
129
|
+
const renderValues = createMemo(() => ({ hasChildren: local.children != null }));
|
|
130
|
+
const renderProps = useRenderProps({
|
|
131
|
+
get children() {
|
|
132
|
+
return local.children;
|
|
133
|
+
},
|
|
134
|
+
class: local.class,
|
|
135
|
+
style: local.style,
|
|
136
|
+
defaultClassName: "solidaria-Header"
|
|
137
|
+
}, renderValues);
|
|
138
|
+
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
139
|
+
return (() => {
|
|
140
|
+
var _el$2 = getNextElement(_tmpl$);
|
|
141
|
+
spread(_el$2, mergeProps(filteredDomProps, {
|
|
142
|
+
"role": "heading",
|
|
143
|
+
get ["class"]() {
|
|
144
|
+
return renderProps.class();
|
|
145
|
+
},
|
|
146
|
+
get style() {
|
|
147
|
+
return renderProps.style();
|
|
148
|
+
},
|
|
149
|
+
get slot() {
|
|
150
|
+
return local.slot;
|
|
151
|
+
},
|
|
152
|
+
"data-header": ""
|
|
153
|
+
}), false, true);
|
|
154
|
+
insert(_el$2, () => renderProps.renderChildren());
|
|
155
|
+
runHydrationEvents();
|
|
156
|
+
return _el$2;
|
|
157
|
+
})();
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A grouping primitive for section item containers.
|
|
161
|
+
*/
|
|
162
|
+
function Group(props) {
|
|
163
|
+
const [local, domProps] = splitProps(props, [
|
|
164
|
+
"children",
|
|
165
|
+
"class",
|
|
166
|
+
"style",
|
|
167
|
+
"slot"
|
|
168
|
+
]);
|
|
169
|
+
const renderValues = createMemo(() => ({ hasChildren: local.children != null }));
|
|
170
|
+
const renderProps = useRenderProps({
|
|
171
|
+
get children() {
|
|
172
|
+
return local.children;
|
|
173
|
+
},
|
|
174
|
+
class: local.class,
|
|
175
|
+
style: local.style,
|
|
176
|
+
defaultClassName: "solidaria-Group"
|
|
177
|
+
}, renderValues);
|
|
178
|
+
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
179
|
+
return (() => {
|
|
180
|
+
var _el$3 = getNextElement(_tmpl$);
|
|
181
|
+
spread(_el$3, mergeProps(filteredDomProps, {
|
|
182
|
+
"role": "group",
|
|
183
|
+
get ["class"]() {
|
|
184
|
+
return renderProps.class();
|
|
185
|
+
},
|
|
186
|
+
get style() {
|
|
187
|
+
return renderProps.style();
|
|
188
|
+
},
|
|
189
|
+
get slot() {
|
|
190
|
+
return local.slot;
|
|
191
|
+
},
|
|
192
|
+
"data-group": ""
|
|
193
|
+
}), false, true);
|
|
194
|
+
insert(_el$3, () => renderProps.renderChildren());
|
|
195
|
+
runHydrationEvents();
|
|
196
|
+
return _el$3;
|
|
197
|
+
})();
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
export { Collection, CollectionBuilder, CollectionRendererContext, DefaultCollectionRenderer, Group, GroupContext, Header, HeaderContext, HeadingContext, Section, SectionContext, SelectableCollectionContext, createBranchComponent, createLeafComponent, flattenCollectionEntries, isCollectionSection, useCollectionRenderer };
|
|
201
|
+
|
|
202
|
+
//# sourceMappingURL=Collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collection.js","names":["JSX","createContext","createMemo","splitProps","useContext","For","Key","DragTypes","DropOperation","DropTarget","Collection","AriaCollection","CollectionBuilder","AriaCollectionBuilder","createLeafComponent","createBranchComponent","CollectionProps","AriaCollectionProps","CollectionBuilderProps","AriaCollectionBuilderProps","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","CollectionPrimitiveRenderProps","hasChildren","RefLike","el","T","current","assignRef","ref","CollectionDropTargetDelegate","getDropTargetFromPoint","x","y","isValidDropTarget","target","getDropOperation","types","allowedOperations","getKeyboardNavigationTarget","direction","getKeyboardPageNavigationTarget","CollectionRendererContextValue","renderItem","item","Element","isVirtualized","layoutDelegate","dropTargetDelegate","renderDropIndicator","index","position","CollectionEntry","CollectionSection","key","title","items","SectionProps","children","HTMLDivElement","class","style","HeaderProps","GroupProps","SectionContextValue","name","render","props","className","CollectionBranchProps","collection","Iterable","parent","type","dropPosition","CollectionRootProps","persistedKeys","Set","CollectionRenderer","CollectionRoot","CollectionBranch","CollectionRendererContext","SelectableCollectionContext","SectionContext","GroupContext","Partial","HeaderContext","HeadingContext","useCollectionRenderer","isCollectionSection","entry","Array","isArray","flattenCollectionEntries","entries","flattened","push","renderCollectionItems","from","_$createComponent","each","node","_$memo","DefaultCollectionRenderer","Section","sectionContext","nodeEnv","globalThis","process","env","NODE_ENV","console","warn","local","domProps","renderValues","renderProps","defaultClassName","filteredDomProps","global","_el$","_$getNextElement","_tmpl$","_$use","_$spread","_$mergeProps","slot","_$insert","renderChildren","_$runHydrationEvents","Header","_el$2","Group","_el$3"],"sources":["../src/Collection.tsx"],"sourcesContent":["/**\n * Collection composition primitives for solidaria-components.\n *\n * Foundational parity layer for React Spectrum-style composition:\n * Section / Header / Group.\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext, For } from \"solid-js\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport type { DragTypes, DropOperation, DropTarget } from \"@proyecto-viviana/solid-stately\";\nimport {\n Collection as AriaCollection,\n CollectionBuilder as AriaCollectionBuilder,\n createLeafComponent,\n createBranchComponent,\n type CollectionProps as AriaCollectionProps,\n type CollectionBuilderProps as AriaCollectionBuilderProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface CollectionPrimitiveRenderProps {\n /** Whether the primitive has visible children content. */\n hasChildren: boolean;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") ref(el);\n else ref.current = el;\n}\n\nexport interface CollectionDropTargetDelegate {\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n getDropOperation(\n target: DropTarget,\n types: DragTypes,\n allowedOperations: DropOperation[],\n ): DropOperation;\n getKeyboardNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n getKeyboardPageNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n}\n\nexport interface CollectionRendererContextValue<T> {\n /** Render function used by collection parents to render each item node. */\n renderItem: (item: T) => JSX.Element;\n /** Whether collection rendering is currently virtualized. */\n isVirtualized?: boolean;\n /** Optional layout delegate used by virtualized renderers. */\n layoutDelegate?: unknown;\n /** Optional drop target delegate used by DnD-aware collection paths. */\n dropTargetDelegate?: CollectionDropTargetDelegate;\n /** Optional drop indicator renderer for DnD-aware collection paths. */\n renderDropIndicator?: (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ) => JSX.Element | undefined;\n}\n\nexport type CollectionEntry<T> = T | CollectionSection<T>;\n\nexport interface CollectionSection<T> {\n /** Optional unique key for the section wrapper. */\n key?: Key;\n /** Optional section header title. */\n title?: JSX.Element;\n /** Optional aria-label for section grouping. */\n \"aria-label\"?: string;\n /** Items contained in the section. */\n items: T[];\n}\n\nexport interface SectionProps extends SlotProps {\n /** Section contents, usually Header + Group/items. */\n children?: JSX.Element;\n /** Ref for the section element. */\n ref?: RefLike<HTMLDivElement>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CollectionPrimitiveRenderProps>;\n}\n\nexport interface HeaderProps extends SlotProps {\n /** Header contents, usually section title text. */\n children?: JSX.Element;\n /** Optional heading level when rendered as a heading role. */\n \"aria-level\"?: number;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CollectionPrimitiveRenderProps>;\n}\n\nexport interface GroupProps extends SlotProps {\n /** Group contents, usually section items. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CollectionPrimitiveRenderProps>;\n}\n\ninterface SectionContextValue {\n name: string;\n render: (props: SectionProps, className?: string) => JSX.Element;\n}\n\nexport interface CollectionBranchProps<T> {\n collection: Iterable<T>;\n parent?: unknown;\n renderDropIndicator?: (target: {\n type: \"item\";\n key: Key;\n dropPosition: \"before\" | \"after\" | \"on\";\n }) => JSX.Element | undefined;\n}\n\nexport interface CollectionRootProps<T> {\n collection: Iterable<T>;\n persistedKeys?: Set<Key> | null;\n renderDropIndicator?: (target: {\n type: \"item\";\n key: Key;\n dropPosition: \"before\" | \"after\" | \"on\";\n }) => JSX.Element | undefined;\n}\n\nexport interface CollectionRenderer<T = unknown> {\n isVirtualized?: boolean;\n layoutDelegate?: unknown;\n dropTargetDelegate?: CollectionDropTargetDelegate;\n CollectionRoot: (props: CollectionRootProps<T>) => JSX.Element;\n CollectionBranch: (props: CollectionBranchProps<T>) => JSX.Element;\n}\n\nexport const CollectionRendererContext =\n createContext<CollectionRendererContextValue<unknown> | null>(null);\nexport const SelectableCollectionContext = CollectionRendererContext;\nexport const SectionContext = createContext<SectionContextValue | null>(null);\nexport const GroupContext = createContext<Partial<GroupProps> | null>(null);\nexport const HeaderContext = createContext<Partial<HeaderProps> | null>(null);\nexport const HeadingContext = createContext<Partial<HeaderProps> | null>(null);\n\nexport function useCollectionRenderer<T>(): CollectionRendererContextValue<T> | null {\n return useContext(CollectionRendererContext) as CollectionRendererContextValue<T> | null;\n}\n\nexport function isCollectionSection<T>(entry: CollectionEntry<T>): entry is CollectionSection<T> {\n return (\n typeof entry === \"object\" &&\n entry !== null &&\n Array.isArray((entry as CollectionSection<T>).items)\n );\n}\n\nexport function flattenCollectionEntries<T>(entries: CollectionEntry<T>[]): T[] {\n const flattened: T[] = [];\n for (const entry of entries) {\n if (isCollectionSection(entry)) flattened.push(...entry.items);\n else flattened.push(entry);\n }\n return flattened;\n}\n\nfunction renderCollectionItems<T>(\n collection: Iterable<T>,\n renderDropIndicator?: (target: {\n type: \"item\";\n key: Key;\n dropPosition: \"before\" | \"after\" | \"on\";\n }) => JSX.Element | undefined,\n): JSX.Element {\n const items = Array.from(collection);\n return (\n <For each={items}>\n {(item, index) => {\n const node = item as { type?: unknown; key?: Key };\n if (node.type === \"content\") {\n // Content rows are rendered by their owning item/section branch.\n return <></>;\n }\n const key = node.key ?? index();\n return (\n <>\n {renderDropIndicator?.({ type: \"item\", key, dropPosition: \"before\" })}\n {item as unknown as JSX.Element}\n {renderDropIndicator?.({ type: \"item\", key, dropPosition: \"after\" })}\n </>\n );\n }}\n </For>\n );\n}\n\nexport const DefaultCollectionRenderer: CollectionRenderer<unknown> = {\n CollectionRoot(props) {\n return renderCollectionItems(props.collection, props.renderDropIndicator);\n },\n CollectionBranch(props) {\n return renderCollectionItems(props.collection, props.renderDropIndicator);\n },\n};\n\nexport function CollectionBuilder<T>(props: AriaCollectionBuilderProps<T>): unknown {\n return AriaCollectionBuilder(props);\n}\n\nexport function Collection<T>(props: AriaCollectionProps<T>): unknown {\n return AriaCollection(props);\n}\n\nexport { createLeafComponent, createBranchComponent };\n\n/**\n * A semantic section wrapper for grouped collection content.\n */\nexport function Section(props: SectionProps): JSX.Element {\n const sectionContext = useContext(SectionContext);\n if (sectionContext) {\n const nodeEnv = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env\n ?.NODE_ENV;\n if (nodeEnv !== \"production\") {\n console.warn(`<Section> is deprecated. Please use <${sectionContext.name}> instead.`);\n }\n return sectionContext.render(props, \"solidaria-Section\");\n }\n\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\", \"slot\", \"ref\"]);\n\n const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({\n hasChildren: local.children != null,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Section\",\n },\n renderValues,\n );\n\n const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n\n return (\n <div\n ref={(el) => assignRef(local.ref, el)}\n {...filteredDomProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-section\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * A header/title primitive for collection sections.\n */\nexport function Header(props: HeaderProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\", \"slot\"]);\n\n const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({\n hasChildren: local.children != null,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\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 get children() {\n return local.children;\n },\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"],"mappings":";;;;;;;;;;;;AAiCA,SAAS+B,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KAAK;CACV,IAAI,OAAOA,QAAQ,YAAYA,IAAIJ,EAAE;MAChCI,IAAIF,UAAUF;AACrB;AAsHA,MAAawD,4BACXnF,cAA8D,IAAI;AACpE,MAAaoF,8BAA8BD;AAC3C,MAAaE,iBAAiBrF,cAA0C,IAAI;AAC5E,MAAasF,eAAetF,cAA0C,IAAI;AAC1E,MAAawF,gBAAgBxF,cAA2C,IAAI;AAC5E,MAAayF,iBAAiBzF,cAA2C,IAAI;AAE7E,SAAgB0F,wBAAqE;CACnF,OAAOvF,WAAWgF,yBAAyB;AAC7C;AAEA,SAAgBQ,oBAAuBC,OAA0D;CAC/F,OACE,O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M,aAGfjB,YAAYY,eAAe,CAAC;EAAAC,mBAAA;EAAA,OAAAI;CAAA,EAAA,CAAA;AAGnC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { filterDOMProps, useRenderProps } from "./utils.jsx";
|
|
2
|
+
import { For, createContext, createMemo, splitProps, useContext } from "solid-js";
|
|
3
|
+
import { Collection as Collection$1, CollectionBuilder as CollectionBuilder$1, createBranchComponent, createLeafComponent } from "@proyecto-viviana/solidaria";
|
|
4
|
+
//#region src/Collection.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Collection composition primitives for solidaria-components.
|
|
7
|
+
*
|
|
8
|
+
* Foundational parity layer for React Spectrum-style composition:
|
|
9
|
+
* Section / Header / Group.
|
|
10
|
+
*/
|
|
11
|
+
function assignRef(ref, el) {
|
|
12
|
+
if (!ref) return;
|
|
13
|
+
if (typeof ref === "function") ref(el);
|
|
14
|
+
else ref.current = el;
|
|
15
|
+
}
|
|
16
|
+
const CollectionRendererContext = createContext(null);
|
|
17
|
+
const SelectableCollectionContext = CollectionRendererContext;
|
|
18
|
+
const SectionContext = createContext(null);
|
|
19
|
+
const GroupContext = createContext(null);
|
|
20
|
+
const HeaderContext = createContext(null);
|
|
21
|
+
const HeadingContext = createContext(null);
|
|
22
|
+
function useCollectionRenderer() {
|
|
23
|
+
return useContext(CollectionRendererContext);
|
|
24
|
+
}
|
|
25
|
+
function isCollectionSection(entry) {
|
|
26
|
+
return typeof entry === "object" && entry !== null && Array.isArray(entry.items);
|
|
27
|
+
}
|
|
28
|
+
function flattenCollectionEntries(entries) {
|
|
29
|
+
const flattened = [];
|
|
30
|
+
for (const entry of entries) if (isCollectionSection(entry)) flattened.push(...entry.items);
|
|
31
|
+
else flattened.push(entry);
|
|
32
|
+
return flattened;
|
|
33
|
+
}
|
|
34
|
+
function renderCollectionItems(collection, renderDropIndicator) {
|
|
35
|
+
const items = Array.from(collection);
|
|
36
|
+
return <For each={items}>
|
|
37
|
+
{(item, index) => {
|
|
38
|
+
const node = item;
|
|
39
|
+
if (node.type === "content") return <></>;
|
|
40
|
+
const key = node.key ?? index();
|
|
41
|
+
return <>
|
|
42
|
+
{renderDropIndicator?.({
|
|
43
|
+
type: "item",
|
|
44
|
+
key,
|
|
45
|
+
dropPosition: "before"
|
|
46
|
+
})}
|
|
47
|
+
{item}
|
|
48
|
+
{renderDropIndicator?.({
|
|
49
|
+
type: "item",
|
|
50
|
+
key,
|
|
51
|
+
dropPosition: "after"
|
|
52
|
+
})}
|
|
53
|
+
</>;
|
|
54
|
+
}}
|
|
55
|
+
</For>;
|
|
56
|
+
}
|
|
57
|
+
const DefaultCollectionRenderer = {
|
|
58
|
+
CollectionRoot(props) {
|
|
59
|
+
return renderCollectionItems(props.collection, props.renderDropIndicator);
|
|
60
|
+
},
|
|
61
|
+
CollectionBranch(props) {
|
|
62
|
+
return renderCollectionItems(props.collection, props.renderDropIndicator);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
function CollectionBuilder(props) {
|
|
66
|
+
return CollectionBuilder$1(props);
|
|
67
|
+
}
|
|
68
|
+
function Collection(props) {
|
|
69
|
+
return Collection$1(props);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A semantic section wrapper for grouped collection content.
|
|
73
|
+
*/
|
|
74
|
+
function Section(props) {
|
|
75
|
+
const sectionContext = useContext(SectionContext);
|
|
76
|
+
if (sectionContext) {
|
|
77
|
+
if (globalThis.process?.env?.NODE_ENV !== "production") console.warn(`<Section> is deprecated. Please use <${sectionContext.name}> instead.`);
|
|
78
|
+
return sectionContext.render(props, "solidaria-Section");
|
|
79
|
+
}
|
|
80
|
+
const [local, domProps] = splitProps(props, [
|
|
81
|
+
"children",
|
|
82
|
+
"class",
|
|
83
|
+
"style",
|
|
84
|
+
"slot",
|
|
85
|
+
"ref"
|
|
86
|
+
]);
|
|
87
|
+
const renderValues = createMemo(() => ({ hasChildren: local.children != null }));
|
|
88
|
+
const renderProps = useRenderProps({
|
|
89
|
+
get children() {
|
|
90
|
+
return local.children;
|
|
91
|
+
},
|
|
92
|
+
class: local.class,
|
|
93
|
+
style: local.style,
|
|
94
|
+
defaultClassName: "solidaria-Section"
|
|
95
|
+
}, renderValues);
|
|
96
|
+
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
97
|
+
return <div ref={(el) => assignRef(local.ref, el)} {...filteredDomProps()} class={renderProps.class()} style={renderProps.style()} slot={local.slot} data-section>
|
|
98
|
+
{renderProps.renderChildren()}
|
|
99
|
+
</div>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A header/title primitive for collection sections.
|
|
103
|
+
*/
|
|
104
|
+
function Header(props) {
|
|
105
|
+
const [local, domProps] = splitProps(props, [
|
|
106
|
+
"children",
|
|
107
|
+
"class",
|
|
108
|
+
"style",
|
|
109
|
+
"slot"
|
|
110
|
+
]);
|
|
111
|
+
const renderValues = createMemo(() => ({ hasChildren: local.children != null }));
|
|
112
|
+
const renderProps = useRenderProps({
|
|
113
|
+
get children() {
|
|
114
|
+
return local.children;
|
|
115
|
+
},
|
|
116
|
+
class: local.class,
|
|
117
|
+
style: local.style,
|
|
118
|
+
defaultClassName: "solidaria-Header"
|
|
119
|
+
}, renderValues);
|
|
120
|
+
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
121
|
+
return <div {...filteredDomProps()} role="heading" class={renderProps.class()} style={renderProps.style()} slot={local.slot} data-header>
|
|
122
|
+
{renderProps.renderChildren()}
|
|
123
|
+
</div>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A grouping primitive for section item containers.
|
|
127
|
+
*/
|
|
128
|
+
function Group(props) {
|
|
129
|
+
const [local, domProps] = splitProps(props, [
|
|
130
|
+
"children",
|
|
131
|
+
"class",
|
|
132
|
+
"style",
|
|
133
|
+
"slot"
|
|
134
|
+
]);
|
|
135
|
+
const renderValues = createMemo(() => ({ hasChildren: local.children != null }));
|
|
136
|
+
const renderProps = useRenderProps({
|
|
137
|
+
get children() {
|
|
138
|
+
return local.children;
|
|
139
|
+
},
|
|
140
|
+
class: local.class,
|
|
141
|
+
style: local.style,
|
|
142
|
+
defaultClassName: "solidaria-Group"
|
|
143
|
+
}, renderValues);
|
|
144
|
+
const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));
|
|
145
|
+
return <div {...filteredDomProps()} role="group" class={renderProps.class()} style={renderProps.style()} slot={local.slot} data-group>
|
|
146
|
+
{renderProps.renderChildren()}
|
|
147
|
+
</div>;
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
export { Collection, CollectionBuilder, CollectionRendererContext, DefaultCollectionRenderer, Group, GroupContext, Header, HeaderContext, HeadingContext, Section, SectionContext, SelectableCollectionContext, createBranchComponent, createLeafComponent, flattenCollectionEntries, isCollectionSection, useCollectionRenderer };
|
|
151
|
+
|
|
152
|
+
//# sourceMappingURL=Collection.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collection.jsx","names":["AriaCollectionBuilder","AriaCollection"],"sources":["../src/Collection.tsx"],"sourcesContent":["/**\n * Collection composition primitives for solidaria-components.\n *\n * Foundational parity layer for React Spectrum-style composition:\n * Section / Header / Group.\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext, For } from \"solid-js\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport type { DragTypes, DropOperation, DropTarget } from \"@proyecto-viviana/solid-stately\";\nimport {\n Collection as AriaCollection,\n CollectionBuilder as AriaCollectionBuilder,\n createLeafComponent,\n createBranchComponent,\n type CollectionProps as AriaCollectionProps,\n type CollectionBuilderProps as AriaCollectionBuilderProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface CollectionPrimitiveRenderProps {\n /** Whether the primitive has visible children content. */\n hasChildren: boolean;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") ref(el);\n else ref.current = el;\n}\n\nexport interface CollectionDropTargetDelegate {\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n getDropOperation(\n target: DropTarget,\n types: DragTypes,\n allowedOperations: DropOperation[],\n ): DropOperation;\n getKeyboardNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n getKeyboardPageNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n}\n\nexport interface CollectionRendererContextValue<T> {\n /** Render function used by collection parents to render each item node. */\n renderItem: (item: T) => JSX.Element;\n /** Whether collection rendering is currently virtualized. */\n isVirtualized?: boolean;\n /** Optional layout delegate used by virtualized renderers. */\n layoutDelegate?: unknown;\n /** Optional drop target delegate used by DnD-aware collection paths. */\n dropTargetDelegate?: CollectionDropTargetDelegate;\n /** Optional drop indicator renderer for DnD-aware collection paths. */\n renderDropIndicator?: (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ) => JSX.Element | undefined;\n}\n\nexport type CollectionEntry<T> = T | CollectionSection<T>;\n\nexport interface CollectionSection<T> {\n /** Optional unique key for the section wrapper. */\n key?: Key;\n /** Optional section header title. */\n title?: JSX.Element;\n /** Optional aria-label for section grouping. */\n \"aria-label\"?: string;\n /** Items contained in the section. */\n items: T[];\n}\n\nexport interface SectionProps extends SlotProps {\n /** Section contents, usually Header + Group/items. */\n children?: JSX.Element;\n /** Ref for the section element. */\n ref?: RefLike<HTMLDivElement>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CollectionPrimitiveRenderProps>;\n}\n\nexport interface HeaderProps extends SlotProps {\n /** Header contents, usually section title text. */\n children?: JSX.Element;\n /** Optional heading level when rendered as a heading role. */\n \"aria-level\"?: number;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CollectionPrimitiveRenderProps>;\n}\n\nexport interface GroupProps extends SlotProps {\n /** Group contents, usually section items. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CollectionPrimitiveRenderProps>;\n}\n\ninterface SectionContextValue {\n name: string;\n render: (props: SectionProps, className?: string) => JSX.Element;\n}\n\nexport interface CollectionBranchProps<T> {\n collection: Iterable<T>;\n parent?: unknown;\n renderDropIndicator?: (target: {\n type: \"item\";\n key: Key;\n dropPosition: \"before\" | \"after\" | \"on\";\n }) => JSX.Element | undefined;\n}\n\nexport interface CollectionRootProps<T> {\n collection: Iterable<T>;\n persistedKeys?: Set<Key> | null;\n renderDropIndicator?: (target: {\n type: \"item\";\n key: Key;\n dropPosition: \"before\" | \"after\" | \"on\";\n }) => JSX.Element | undefined;\n}\n\nexport interface CollectionRenderer<T = unknown> {\n isVirtualized?: boolean;\n layoutDelegate?: unknown;\n dropTargetDelegate?: CollectionDropTargetDelegate;\n CollectionRoot: (props: CollectionRootProps<T>) => JSX.Element;\n CollectionBranch: (props: CollectionBranchProps<T>) => JSX.Element;\n}\n\nexport const CollectionRendererContext =\n createContext<CollectionRendererContextValue<unknown> | null>(null);\nexport const SelectableCollectionContext = CollectionRendererContext;\nexport const SectionContext = createContext<SectionContextValue | null>(null);\nexport const GroupContext = createContext<Partial<GroupProps> | null>(null);\nexport const HeaderContext = createContext<Partial<HeaderProps> | null>(null);\nexport const HeadingContext = createContext<Partial<HeaderProps> | null>(null);\n\nexport function useCollectionRenderer<T>(): CollectionRendererContextValue<T> | null {\n return useContext(CollectionRendererContext) as CollectionRendererContextValue<T> | null;\n}\n\nexport function isCollectionSection<T>(entry: CollectionEntry<T>): entry is CollectionSection<T> {\n return (\n typeof entry === \"object\" &&\n entry !== null &&\n Array.isArray((entry as CollectionSection<T>).items)\n );\n}\n\nexport function flattenCollectionEntries<T>(entries: CollectionEntry<T>[]): T[] {\n const flattened: T[] = [];\n for (const entry of entries) {\n if (isCollectionSection(entry)) flattened.push(...entry.items);\n else flattened.push(entry);\n }\n return flattened;\n}\n\nfunction renderCollectionItems<T>(\n collection: Iterable<T>,\n renderDropIndicator?: (target: {\n type: \"item\";\n key: Key;\n dropPosition: \"before\" | \"after\" | \"on\";\n }) => JSX.Element | undefined,\n): JSX.Element {\n const items = Array.from(collection);\n return (\n <For each={items}>\n {(item, index) => {\n const node = item as { type?: unknown; key?: Key };\n if (node.type === \"content\") {\n // Content rows are rendered by their owning item/section branch.\n return <></>;\n }\n const key = node.key ?? index();\n return (\n <>\n {renderDropIndicator?.({ type: \"item\", key, dropPosition: \"before\" })}\n {item as unknown as JSX.Element}\n {renderDropIndicator?.({ type: \"item\", key, dropPosition: \"after\" })}\n </>\n );\n }}\n </For>\n );\n}\n\nexport const DefaultCollectionRenderer: CollectionRenderer<unknown> = {\n CollectionRoot(props) {\n return renderCollectionItems(props.collection, props.renderDropIndicator);\n },\n CollectionBranch(props) {\n return renderCollectionItems(props.collection, props.renderDropIndicator);\n },\n};\n\nexport function CollectionBuilder<T>(props: AriaCollectionBuilderProps<T>): unknown {\n return AriaCollectionBuilder(props);\n}\n\nexport function Collection<T>(props: AriaCollectionProps<T>): unknown {\n return AriaCollection(props);\n}\n\nexport { createLeafComponent, createBranchComponent };\n\n/**\n * A semantic section wrapper for grouped collection content.\n */\nexport function Section(props: SectionProps): JSX.Element {\n const sectionContext = useContext(SectionContext);\n if (sectionContext) {\n const nodeEnv = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env\n ?.NODE_ENV;\n if (nodeEnv !== \"production\") {\n console.warn(`<Section> is deprecated. Please use <${sectionContext.name}> instead.`);\n }\n return sectionContext.render(props, \"solidaria-Section\");\n }\n\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\", \"slot\", \"ref\"]);\n\n const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({\n hasChildren: local.children != null,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Section\",\n },\n renderValues,\n );\n\n const filteredDomProps = createMemo(() => filterDOMProps(domProps, { global: true }));\n\n return (\n <div\n ref={(el) => assignRef(local.ref, el)}\n {...filteredDomProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-section\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * A header/title primitive for collection sections.\n */\nexport function Header(props: HeaderProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\", \"slot\"]);\n\n const renderValues = createMemo<CollectionPrimitiveRenderProps>(() => ({\n hasChildren: local.children != null,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\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 get children() {\n return local.children;\n },\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"],"mappings":";;;;;;;;;;AAiCA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YAAY,IAAI,EAAE;MAChC,IAAI,UAAU;AACrB;AAsHA,MAAa,4BACX,cAA8D,IAAI;AACpE,MAAa,8BAA8B;AAC3C,MAAa,iBAAiB,cAA0C,IAAI;AAC5E,MAAa,eAAe,cAA0C,IAAI;AAC1E,MAAa,gBAAgB,cAA2C,IAAI;AAC5E,MAAa,iBAAiB,cAA2C,IAAI;AAE7E,SAAgB,wBAAqE;CACnF,OAAO,WAAW,yBAAyB;AAC7C;AAEA,SAAgB,oBAAuB,OAA0D;CAC/F,OACE,OAAO,UAAU,YACjB,UAAU,QACV,MAAM,QAAS,MAA+B,KAAK;AAEvD;AAEA,SAAgB,yBAA4B,SAAoC;CAC9E,MAAM,YAAiB,CAAC;CACxB,KAAK,MAAM,SAAS,SAClB,IAAI,oBAAoB,KAAK,GAAG,UAAU,KAAK,GAAG,MAAM,KAAK;MACxD,UAAU,KAAK,KAAK;CAE3B,OAAO;AACT;AAEA,SAAS,sBACP,YACA,qBAKa;CACb,MAAM,QAAQ,MAAM,KAAK,UAAU;CACnC,OACE,CAAC,IAAI,MAAM,OAAO;QACd,MAAM,UAAU;EAChB,MAAM,OAAO;EACb,IAAI,KAAK,SAAS,WAEhB,OAAO,EAAE;EAEX,MAAM,MAAM,KAAK,OAAO,MAAM;EAC9B,OACE,EAAE;aACC,sBAAsB;GAAE,MAAM;GAAQ;GAAK,cAAc;EAAS,CAAC,EAAE;aACrE,KAA+B;aAC/B,sBAAsB;GAAE,MAAM;GAAQ;GAAK,cAAc;EAAQ,CAAC,EAAE;UACvE;CAEJ,EAAE;IACJ,EAAE;AAEN;AAEA,MAAa,4BAAyD;CACpE,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