@proyecto-viviana/solidaria-components 0.5.0 → 0.7.0-rc.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/LICENSE-APACHE-2.0 +201 -0
- package/NOTICE +91 -0
- package/README.md +4 -7
- package/dist/ActionBar.d.ts +2 -10
- package/dist/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar.js +95 -59
- package/dist/ActionBar.js.map +1 -1
- package/dist/ActionBar.jsx +42 -15
- package/dist/ActionBar.jsx.map +1 -1
- package/dist/ActionGroup.d.ts +1 -12
- package/dist/ActionGroup.d.ts.map +1 -1
- package/dist/ActionGroup.js +66 -44
- package/dist/ActionGroup.js.map +1 -1
- package/dist/ActionGroup.jsx +25 -10
- package/dist/ActionGroup.jsx.map +1 -1
- package/dist/Alert.d.ts +4 -1
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Alert.js +25 -17
- package/dist/Alert.js.map +1 -1
- package/dist/Alert.jsx +9 -5
- package/dist/Alert.jsx.map +1 -1
- package/dist/Autocomplete.d.ts +2 -9
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Autocomplete.js +18 -5
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Autocomplete.jsx +20 -7
- package/dist/Autocomplete.jsx.map +1 -1
- package/dist/Breadcrumbs.d.ts +2 -7
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +71 -51
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Breadcrumbs.jsx +25 -12
- package/dist/Breadcrumbs.jsx.map +1 -1
- package/dist/Button.d.ts +1 -7
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +125 -72
- package/dist/Button.js.map +1 -1
- package/dist/Button.jsx +105 -43
- package/dist/Button.jsx.map +1 -1
- package/dist/Calendar.d.ts +1 -7
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +297 -221
- package/dist/Calendar.js.map +1 -1
- package/dist/Calendar.jsx +52 -32
- package/dist/Calendar.jsx.map +1 -1
- package/dist/CalendarPicker.d.ts +1 -10
- package/dist/CalendarPicker.d.ts.map +1 -1
- package/dist/CalendarPicker.js +12 -0
- package/dist/CalendarPicker.js.map +1 -1
- package/dist/CalendarPicker.jsx +12 -0
- package/dist/CalendarPicker.jsx.map +1 -1
- package/dist/Checkbox.d.ts +2 -7
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +332 -270
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.jsx +70 -77
- package/dist/Checkbox.jsx.map +1 -1
- package/dist/Collection.d.ts +33 -7
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +128 -74
- package/dist/Collection.js.map +1 -1
- package/dist/Collection.jsx +46 -7
- package/dist/Collection.jsx.map +1 -1
- package/dist/Color.d.ts +15 -20
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +572 -334
- package/dist/Color.js.map +1 -1
- package/dist/Color.jsx +205 -85
- package/dist/Color.jsx.map +1 -1
- package/dist/ColorEditor.d.ts +3 -1
- package/dist/ColorEditor.d.ts.map +1 -1
- package/dist/ColorEditor.js +147 -124
- package/dist/ColorEditor.js.map +1 -1
- package/dist/ColorEditor.jsx +4 -1
- package/dist/ColorEditor.jsx.map +1 -1
- package/dist/ComboBox.d.ts +31 -10
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +539 -274
- package/dist/ComboBox.js.map +1 -1
- package/dist/ComboBox.jsx +213 -70
- package/dist/ComboBox.jsx.map +1 -1
- package/dist/ContextualHelpTrigger.d.ts +1 -7
- package/dist/ContextualHelpTrigger.d.ts.map +1 -1
- package/dist/ContextualHelpTrigger.js +102 -72
- package/dist/ContextualHelpTrigger.js.map +1 -1
- package/dist/ContextualHelpTrigger.jsx +36 -16
- package/dist/ContextualHelpTrigger.jsx.map +1 -1
- package/dist/DateField.d.ts +2 -7
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +0 -2
- package/dist/DateField.jsx +0 -2
- package/dist/DateField2.js +194 -179
- package/dist/DateField2.js.map +1 -1
- package/dist/DateField2.jsx +58 -55
- package/dist/DateField2.jsx.map +1 -1
- package/dist/DatePicker.d.ts +7 -7
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +2 -2
- package/dist/DatePicker.jsx +2 -2
- package/dist/DatePicker2.js +357 -435
- package/dist/DatePicker2.js.map +1 -1
- package/dist/DatePicker2.jsx +109 -178
- package/dist/DatePicker2.jsx.map +1 -1
- package/dist/DateRangePickerContext.d.ts +7 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -1
- package/dist/Dialog.d.ts +4 -9
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +168 -101
- package/dist/Dialog.js.map +1 -1
- package/dist/Dialog.jsx +75 -27
- package/dist/Dialog.jsx.map +1 -1
- package/dist/Disclosure.d.ts +1 -9
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +121 -79
- package/dist/Disclosure.js.map +1 -1
- package/dist/Disclosure.jsx +32 -19
- package/dist/Disclosure.jsx.map +1 -1
- package/dist/DragAndDrop.d.ts +9 -6
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragAndDrop.js +37 -22
- package/dist/DragAndDrop.js.map +1 -1
- package/dist/DragAndDrop.jsx +20 -4
- package/dist/DragAndDrop.jsx.map +1 -1
- package/dist/DragPreview.d.ts +1 -1
- package/dist/DragPreview.d.ts.map +1 -1
- package/dist/DropZone.d.ts +1 -7
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/DropZone.js +74 -40
- package/dist/DropZone.js.map +1 -1
- package/dist/DropZone.jsx +24 -8
- package/dist/DropZone.jsx.map +1 -1
- package/dist/ElementTag.d.ts +9 -20
- package/dist/ElementTag.d.ts.map +1 -1
- package/dist/ElementTag.js +8 -210
- package/dist/ElementTag.js.map +1 -1
- package/dist/ElementTag.jsx +8 -57
- package/dist/ElementTag.jsx.map +1 -1
- package/dist/FieldError.d.ts +8 -7
- package/dist/FieldError.d.ts.map +1 -1
- package/dist/FieldError.js +33 -13
- package/dist/FieldError.js.map +1 -1
- package/dist/FieldError.jsx +20 -5
- package/dist/FieldError.jsx.map +1 -1
- package/dist/FileTrigger.d.ts +1 -7
- package/dist/FileTrigger.d.ts.map +1 -1
- package/dist/FileTrigger.js +30 -12
- package/dist/FileTrigger.js.map +1 -1
- package/dist/FileTrigger.jsx +15 -2
- package/dist/FileTrigger.jsx.map +1 -1
- package/dist/Focusable.d.ts +2 -8
- package/dist/Focusable.d.ts.map +1 -1
- package/dist/Focusable.js +23 -6
- package/dist/Focusable.js.map +1 -1
- package/dist/Focusable.jsx +22 -5
- package/dist/Focusable.jsx.map +1 -1
- package/dist/Form.d.ts +9 -8
- package/dist/Form.d.ts.map +1 -1
- package/dist/Form.js +66 -43
- package/dist/Form.js.map +1 -1
- package/dist/Form.jsx +36 -16
- package/dist/Form.jsx.map +1 -1
- package/dist/GridList.d.ts +5 -10
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +372 -243
- package/dist/GridList.js.map +1 -1
- package/dist/GridList.jsx +177 -99
- package/dist/GridList.jsx.map +1 -1
- package/dist/HiddenDateInput.d.ts +1 -7
- package/dist/HiddenDateInput.d.ts.map +1 -1
- package/dist/Icon.d.ts +4 -1
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +41 -37
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.jsx +7 -3
- package/dist/Icon.jsx.map +1 -1
- package/dist/Keyboard.d.ts +1 -7
- package/dist/Keyboard.d.ts.map +1 -1
- package/dist/Keyboard.js +24 -11
- package/dist/Keyboard.js.map +1 -1
- package/dist/Keyboard.jsx +15 -2
- package/dist/Keyboard.jsx.map +1 -1
- package/dist/Label.d.ts +20 -0
- package/dist/Label.d.ts.map +1 -0
- package/dist/Label.js +60 -0
- package/dist/Label.js.map +1 -0
- package/dist/Label.jsx +47 -0
- package/dist/Label.jsx.map +1 -0
- package/dist/Landmark.d.ts +4 -1
- package/dist/Landmark.d.ts.map +1 -1
- package/dist/Landmark.js +10 -4
- package/dist/Landmark.js.map +1 -1
- package/dist/Landmark.jsx +5 -1
- package/dist/Landmark.jsx.map +1 -1
- package/dist/Link.d.ts +2 -7
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +56 -36
- package/dist/Link.js.map +1 -1
- package/dist/Link.jsx +52 -10
- package/dist/Link.jsx.map +1 -1
- package/dist/ListBox.d.ts +17 -13
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +647 -348
- package/dist/ListBox.js.map +1 -1
- package/dist/ListBox.jsx +339 -236
- package/dist/ListBox.jsx.map +1 -1
- package/dist/ListDropTargetDelegate.d.ts +3 -0
- package/dist/ListDropTargetDelegate.d.ts.map +1 -1
- package/dist/Menu.d.ts +39 -30
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +547 -368
- package/dist/Menu.js.map +1 -1
- package/dist/Menu.jsx +328 -230
- package/dist/Menu.jsx.map +1 -1
- package/dist/Meter.d.ts +6 -13
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +55 -18
- package/dist/Meter.js.map +1 -1
- package/dist/Meter.jsx +33 -8
- package/dist/Meter.jsx.map +1 -1
- package/dist/Modal.d.ts +1 -7
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +104 -56
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.jsx +68 -38
- package/dist/Modal.jsx.map +1 -1
- package/dist/NumberField.d.ts +4 -7
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/NumberField.js +243 -124
- package/dist/NumberField.js.map +1 -1
- package/dist/NumberField.jsx +115 -26
- package/dist/NumberField.jsx.map +1 -1
- package/dist/Popover.d.ts +15 -7
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +370 -181
- package/dist/Popover.js.map +1 -1
- package/dist/Popover.jsx +215 -82
- package/dist/Popover.jsx.map +1 -1
- package/dist/Pressable.d.ts +2 -8
- package/dist/Pressable.d.ts.map +1 -1
- package/dist/Pressable.js +23 -6
- package/dist/Pressable.js.map +1 -1
- package/dist/Pressable.jsx +22 -5
- package/dist/Pressable.jsx.map +1 -1
- package/dist/PreviewTrigger.d.ts +24 -0
- package/dist/PreviewTrigger.d.ts.map +1 -0
- package/dist/PreviewTrigger.js +128 -0
- package/dist/PreviewTrigger.js.map +1 -0
- package/dist/PreviewTrigger.jsx +117 -0
- package/dist/PreviewTrigger.jsx.map +1 -0
- package/dist/ProgressBar.d.ts +1 -7
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar.js +34 -14
- package/dist/ProgressBar.js.map +1 -1
- package/dist/ProgressBar.jsx +17 -3
- package/dist/ProgressBar.jsx.map +1 -1
- package/dist/RadioGroup.d.ts +2 -7
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +388 -269
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.jsx +110 -99
- package/dist/RadioGroup.jsx.map +1 -1
- package/dist/RangeCalendar.d.ts +3 -7
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +271 -202
- package/dist/RangeCalendar.js.map +1 -1
- package/dist/RangeCalendar.jsx +56 -37
- package/dist/RangeCalendar.jsx.map +1 -1
- package/dist/RouterProvider.d.ts +3 -9
- package/dist/RouterProvider.d.ts.map +1 -1
- package/dist/RouterProvider.js +15 -14
- package/dist/RouterProvider.js.map +1 -1
- package/dist/RouterProvider.jsx +14 -13
- package/dist/RouterProvider.jsx.map +1 -1
- package/dist/SearchField.d.ts +4 -7
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +191 -164
- package/dist/SearchField.js.map +1 -1
- package/dist/SearchField.jsx +69 -62
- package/dist/SearchField.jsx.map +1 -1
- package/dist/Select.d.ts +5 -10
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +565 -359
- package/dist/Select.js.map +1 -1
- package/dist/Select.jsx +281 -161
- package/dist/Select.jsx.map +1 -1
- package/dist/SelectionIndicator.d.ts +1 -4
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/SelectionIndicator.js +29 -13
- package/dist/SelectionIndicator.js.map +1 -1
- package/dist/SelectionIndicator.jsx +18 -4
- package/dist/SelectionIndicator.jsx.map +1 -1
- package/dist/Separator.d.ts +1 -7
- package/dist/Separator.d.ts.map +1 -1
- package/dist/Separator.js +22 -6
- package/dist/Separator.js.map +1 -1
- package/dist/Separator.jsx +16 -3
- package/dist/Separator.jsx.map +1 -1
- package/dist/SharedElementTransition.d.ts +1 -10
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +68 -40
- package/dist/SharedElementTransition.js.map +1 -1
- package/dist/SharedElementTransition.jsx +49 -25
- package/dist/SharedElementTransition.jsx.map +1 -1
- package/dist/Slider.d.ts +2 -8
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +155 -97
- package/dist/Slider.js.map +1 -1
- package/dist/Slider.jsx +25 -12
- package/dist/Slider.jsx.map +1 -1
- package/dist/StepList.d.ts +1 -7
- package/dist/StepList.d.ts.map +1 -1
- package/dist/StepList.js +112 -68
- package/dist/StepList.js.map +1 -1
- package/dist/StepList.jsx +58 -20
- package/dist/StepList.jsx.map +1 -1
- package/dist/Switch.d.ts +2 -9
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +164 -114
- package/dist/Switch.js.map +1 -1
- package/dist/Switch.jsx +26 -13
- package/dist/Switch.jsx.map +1 -1
- package/dist/Table.d.ts +2 -1
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +689 -592
- package/dist/Table.js.map +1 -1
- package/dist/Table.jsx +317 -237
- package/dist/Table.jsx.map +1 -1
- package/dist/Tabs.d.ts +2 -7
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +278 -293
- package/dist/Tabs.js.map +1 -1
- package/dist/Tabs.jsx +68 -66
- package/dist/Tabs.jsx.map +1 -1
- package/dist/TagGroup.d.ts +4 -11
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +153 -115
- package/dist/TagGroup.js.map +1 -1
- package/dist/TagGroup.jsx +37 -24
- package/dist/TagGroup.jsx.map +1 -1
- package/dist/Text.d.ts +3 -3
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +24 -7
- package/dist/Text.js.map +1 -1
- package/dist/Text.jsx +17 -5
- package/dist/Text.jsx.map +1 -1
- package/dist/TextField.d.ts +3 -16
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +104 -129
- package/dist/TextField.js.map +1 -1
- package/dist/TextField.jsx +76 -102
- package/dist/TextField.jsx.map +1 -1
- package/dist/TimeField.d.ts +2 -15
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +86 -102
- package/dist/TimeField.js.map +1 -1
- package/dist/TimeField.jsx +32 -49
- package/dist/TimeField.jsx.map +1 -1
- package/dist/Toast.d.ts +10 -13
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toast.js +209 -108
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.jsx +127 -22
- package/dist/Toast.jsx.map +1 -1
- package/dist/ToggleButton.d.ts +1 -7
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton.js +57 -35
- package/dist/ToggleButton.js.map +1 -1
- package/dist/ToggleButton.jsx +26 -12
- package/dist/ToggleButton.jsx.map +1 -1
- package/dist/ToggleButtonGroup.d.ts +1 -7
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.js +59 -44
- package/dist/ToggleButtonGroup.js.map +1 -1
- package/dist/ToggleButtonGroup.jsx +25 -12
- package/dist/ToggleButtonGroup.jsx.map +1 -1
- package/dist/TokenField.d.ts +52 -0
- package/dist/TokenField.d.ts.map +1 -0
- package/dist/TokenField.js +301 -0
- package/dist/TokenField.js.map +1 -0
- package/dist/TokenField.jsx +197 -0
- package/dist/TokenField.jsx.map +1 -0
- package/dist/Toolbar.d.ts +2 -7
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar.js +35 -16
- package/dist/Toolbar.js.map +1 -1
- package/dist/Toolbar.jsx +15 -2
- package/dist/Toolbar.jsx.map +1 -1
- package/dist/Tooltip.d.ts +2 -7
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip.js +105 -68
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.jsx +60 -36
- package/dist/Tooltip.jsx.map +1 -1
- package/dist/Tree.d.ts +8 -11
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +486 -339
- package/dist/Tree.js.map +1 -1
- package/dist/Tree.jsx +155 -107
- package/dist/Tree.jsx.map +1 -1
- package/dist/Virtualizer.d.ts +39 -9
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/Virtualizer.js +2 -2
- package/dist/Virtualizer.jsx +2 -2
- package/dist/Virtualizer2.js +491 -136
- package/dist/Virtualizer2.js.map +1 -1
- package/dist/Virtualizer2.jsx +455 -122
- package/dist/Virtualizer2.jsx.map +1 -1
- package/dist/VirtualizerLayouts.d.ts +55 -2
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.d.ts +4 -3
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +18 -11
- package/dist/VisuallyHidden.js.map +1 -1
- package/dist/VisuallyHidden.jsx +15 -9
- package/dist/VisuallyHidden.jsx.map +1 -1
- package/dist/contexts.d.ts +25 -0
- package/dist/contexts.d.ts.map +1 -1
- package/dist/contexts.js +3 -0
- package/dist/contexts.js.map +1 -1
- package/dist/contexts.jsx +3 -0
- package/dist/contexts.jsx.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -11
- package/dist/index.jsx +14 -11
- package/dist/intl/index.d.ts +16 -0
- package/dist/intl/index.d.ts.map +1 -0
- package/dist/intl.js +212 -0
- package/dist/intl.js.map +1 -0
- package/dist/intl.jsx +212 -0
- package/dist/intl.jsx.map +1 -0
- package/dist/useDragAndDrop.d.ts +4 -2
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/useDragAndDrop2.js +39 -21
- package/dist/useDragAndDrop2.js.map +1 -1
- package/dist/useDragAndDrop2.jsx +39 -21
- package/dist/useDragAndDrop2.jsx.map +1 -1
- package/dist/utils.d.ts +28 -9
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +96 -24
- package/dist/utils.js.map +1 -1
- package/dist/utils.jsx +81 -24
- package/dist/utils.jsx.map +1 -1
- package/dist/virtualizer/Layout.d.ts +9 -0
- package/dist/virtualizer/Layout.d.ts.map +1 -1
- package/dist/virtualizer/Layout.js +23 -2
- package/dist/virtualizer/Layout.js.map +1 -1
- package/dist/virtualizer/Layout.jsx +23 -2
- package/dist/virtualizer/Layout.jsx.map +1 -1
- package/package.json +29 -10
- package/src/ActionBar.tsx +50 -24
- package/src/ActionGroup.tsx +31 -19
- package/src/Alert.tsx +10 -4
- package/src/Autocomplete.tsx +24 -15
- package/src/Breadcrumbs.tsx +32 -16
- package/src/Button.tsx +182 -67
- package/src/Calendar.tsx +65 -47
- package/src/CalendarPicker.tsx +16 -1
- package/src/Checkbox.tsx +84 -116
- package/src/Collection.tsx +84 -3
- package/src/Color.tsx +282 -104
- package/src/ColorEditor.tsx +5 -1
- package/src/ComboBox.tsx +384 -109
- package/src/ContextualHelpTrigger.tsx +47 -41
- package/src/DateField.tsx +74 -106
- package/src/DatePicker.tsx +156 -352
- package/src/DateRangePickerContext.tsx +8 -0
- package/src/Dialog.tsx +105 -38
- package/src/Disclosure.tsx +29 -19
- package/src/DragAndDrop.tsx +43 -8
- package/src/DragPreview.tsx +20 -1
- package/src/DropZone.tsx +32 -18
- package/src/ElementTag.tsx +14 -104
- package/src/FieldError.tsx +39 -7
- package/src/FileTrigger.tsx +18 -3
- package/src/Focusable.tsx +27 -6
- package/src/Form.tsx +57 -11
- package/src/GridList.tsx +233 -141
- package/src/HiddenDateInput.tsx +19 -3
- package/src/Icon.tsx +8 -2
- package/src/Keyboard.tsx +18 -2
- package/src/Label.tsx +77 -0
- package/src/Landmark.tsx +6 -1
- package/src/Link.tsx +65 -19
- package/src/ListBox.tsx +645 -468
- package/src/ListDropTargetDelegate.ts +4 -0
- package/src/Menu.tsx +512 -349
- package/src/Meter.tsx +42 -8
- package/src/Modal.tsx +85 -42
- package/src/NumberField.tsx +161 -48
- package/src/Popover.tsx +424 -148
- package/src/Pressable.tsx +27 -6
- package/src/PreviewTrigger.tsx +171 -0
- package/src/ProgressBar.tsx +25 -3
- package/src/RadioGroup.tsx +230 -161
- package/src/RangeCalendar.tsx +75 -63
- package/src/RouterProvider.tsx +24 -14
- package/src/SearchField.tsx +118 -121
- package/src/Select.tsx +454 -274
- package/src/SelectionIndicator.tsx +21 -3
- package/src/Separator.tsx +17 -1
- package/src/SharedElementTransition.tsx +115 -97
- package/src/Slider.tsx +35 -17
- package/src/StepList.tsx +71 -32
- package/src/Switch.tsx +45 -29
- package/src/Table.tsx +446 -380
- package/src/Tabs.tsx +132 -155
- package/src/TagGroup.tsx +53 -40
- package/src/Text.tsx +23 -6
- package/src/TextField.tsx +118 -159
- package/src/TimeField.tsx +34 -95
- package/src/Toast.tsx +141 -67
- package/src/ToggleButton.tsx +33 -15
- package/src/ToggleButtonGroup.tsx +27 -9
- package/src/TokenField.tsx +379 -0
- package/src/Toolbar.tsx +19 -9
- package/src/Tooltip.tsx +126 -84
- package/src/Tree.tsx +233 -173
- package/src/Virtualizer.tsx +400 -138
- package/src/VirtualizerLayouts.ts +211 -26
- package/src/VisuallyHidden.tsx +22 -8
- package/src/contexts.ts +13 -0
- package/src/index.ts +32 -11
- package/src/intl/ar-AE.json +6 -0
- package/src/intl/bg-BG.json +6 -0
- package/src/intl/cs-CZ.json +6 -0
- package/src/intl/da-DK.json +6 -0
- package/src/intl/de-DE.json +6 -0
- package/src/intl/el-GR.json +6 -0
- package/src/intl/en-US.json +6 -0
- package/src/intl/es-ES.json +6 -0
- package/src/intl/et-EE.json +6 -0
- package/src/intl/fi-FI.json +6 -0
- package/src/intl/fr-FR.json +6 -0
- package/src/intl/he-IL.json +6 -0
- package/src/intl/hr-HR.json +6 -0
- package/src/intl/hu-HU.json +6 -0
- package/src/intl/index.ts +125 -0
- package/src/intl/it-IT.json +6 -0
- package/src/intl/ja-JP.json +6 -0
- package/src/intl/ko-KR.json +6 -0
- package/src/intl/lt-LT.json +6 -0
- package/src/intl/lv-LV.json +6 -0
- package/src/intl/nb-NO.json +6 -0
- package/src/intl/nl-NL.json +6 -0
- package/src/intl/pl-PL.json +6 -0
- package/src/intl/pt-BR.json +6 -0
- package/src/intl/pt-PT.json +6 -0
- package/src/intl/ro-RO.json +6 -0
- package/src/intl/ru-RU.json +6 -0
- package/src/intl/sk-SK.json +6 -0
- package/src/intl/sl-SI.json +6 -0
- package/src/intl/sr-SP.json +6 -0
- package/src/intl/sv-SE.json +6 -0
- package/src/intl/tr-TR.json +6 -0
- package/src/intl/uk-UA.json +6 -0
- package/src/intl/zh-CN.json +6 -0
- package/src/intl/zh-TW.json +6 -0
- package/src/useDragAndDrop.ts +30 -32
- package/src/utils.tsx +124 -68
- package/src/virtualizer/Layout.ts +29 -0
package/dist/Menu.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.jsx","names":["mergeProps"],"sources":["../src/Menu.tsx"],"sourcesContent":["/**\n * Menu component for solidaria-components\n *\n * A pre-wired headless menu that combines state + aria hooks.\n * Port of react-aria-components/src/Menu.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createMenu,\n createMenuItem,\n createMenuTrigger,\n createFocusRing,\n createHover,\n createButton,\n createInteractOutside,\n createScrollIntoViewOnFocus,\n mergeProps,\n FocusScope,\n type AriaMenuProps,\n type AriaMenuItemProps,\n type AriaMenuTriggerProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSelectionState,\n createMenuState,\n createMenuTriggerState,\n type MenuState,\n type MenuStateProps,\n type OverlayTriggerState,\n type Key,\n type DropTarget,\n type SelectionMode,\n type SelectionStateProps,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport { type DragAndDropHooks } from \"./useDragAndDrop\";\nimport {\n CollectionRendererContext,\n Section,\n Header,\n Group,\n type CollectionEntry,\n type CollectionRendererContextValue,\n type SectionProps,\n useCollectionRenderer,\n flattenCollectionEntries,\n isCollectionSection,\n} from \"./Collection\";\nimport { useVirtualizerContext } from \"./Virtualizer\";\nimport {\n getNormalizedDropTargetKey,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n} from \"./DragAndDrop\";\nimport { PopoverTriggerContext } from \"./contexts\";\n\nexport interface MenuRenderProps {\n /** Whether the menu is focused. */\n isFocused: boolean;\n /** Whether the menu is open. */\n isOpen: boolean;\n /** Whether the menu has no items. */\n isEmpty: boolean;\n}\n\nexport interface MenuProps<T>\n extends\n Omit<AriaMenuProps<T>, \"children\">,\n SlotProps,\n Pick<\n MenuStateProps<T>,\n | \"selectionMode\"\n | \"selectionBehavior\"\n | \"disallowEmptySelection\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"allowDuplicateSelectionEvents\"\n > {\n /** The items to render in the menu. */\n items?: CollectionEntry<T>[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Whether disabled items can still receive focus. */\n disabledBehavior?: \"selection\" | \"all\";\n /** Handler called when an item is activated, with the activated item's value. */\n onAction?: (key: Key, value: T) => void;\n /** Handler called when the menu should close. */\n onClose?: () => void;\n /** The children of the component. A function may be provided to render each item. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** Internal lazy static children accessor used when collection children need menu context. */\n staticChildren?: () => JSX.Element | undefined;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MenuRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MenuRenderProps>;\n /** Content to display when the menu has no items. */\n renderEmptyState?: () => JSX.Element;\n /** Whether the menu should close when an item is selected. */\n shouldCloseOnSelect?: boolean;\n /** Ref for the menu element. */\n ref?: RefLike<HTMLDivElement>;\n /** Custom renderer for the menu element. */\n render?: (props: JSX.HTMLAttributes<HTMLDivElement>, renderProps: MenuRenderProps) => JSX.Element;\n /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<T>;\n}\n\nexport interface MenuItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** The parent menu selection mode. */\n selectionMode: SelectionMode;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item opens a submenu. */\n hasSubmenu: boolean;\n /** Whether the submenu is currently open. */\n isOpen: boolean;\n /**\n * Internal: props (carrying the slot `id` the item's `aria-describedby`\n * references) for the item's description text element. Threaded to the styled\n * `Text slot=\"description\"` so it receives the id — mirrors upstream's\n * `TextContext` description-slot delegation.\n */\n descriptionProps?: JSX.HTMLAttributes<HTMLElement>;\n /**\n * Internal: props (id + `aria-hidden`) for the item's keyboard-shortcut\n * element, threaded to the styled `Keyboard`.\n */\n keyboardShortcutProps?: JSX.HTMLAttributes<HTMLElement>;\n}\n\nexport interface MenuItemProps<T>\n extends Omit<AriaMenuItemProps, \"children\" | \"key\" | \"id\">, SlotProps {\n /** The unique key for the item. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the item. A function may be provided to receive render props. */\n children?: RenderChildren<MenuItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MenuItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MenuItemRenderProps>;\n /** The text value of the item (for typeahead). */\n textValue?: string;\n /** Handler called when the item is activated. */\n onAction?: () => void;\n /** A URL to link to. Turns the menu item into a link. */\n href?: string;\n /** The target window for the link. */\n target?: string;\n /** The relationship between the linked resource and the current page. */\n rel?: string;\n /** Causes the browser to download the linked URL. */\n download?: boolean | string;\n /** Handler called when hover starts. */\n onHoverStart?: () => void;\n /** Handler called when hover ends. */\n onHoverEnd?: () => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n /** Ref for the menu item element (a `<div>`, or an `<a>` for link items). */\n ref?: RefLike<HTMLElement>;\n /** Custom renderer for the menu item element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLElement>,\n renderProps: MenuItemRenderProps,\n ) => JSX.Element;\n}\n\nexport interface MenuTriggerRenderProps {\n /** Whether the menu is open. */\n isOpen: boolean;\n /** Whether the trigger is focused. */\n isFocused: boolean;\n /** Whether the trigger has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the trigger is pressed. */\n isPressed: boolean;\n /** Whether the trigger is hovered. */\n isHovered: boolean;\n /** Whether the trigger is disabled. */\n isDisabled: boolean;\n}\n\nexport interface MenuTriggerProps extends Omit<AriaMenuTriggerProps, \"children\">, SlotProps {\n /** The children of the trigger (typically a Button and Menu). */\n children: JSX.Element;\n /** Whether the menu trigger is disabled. */\n isDisabled?: boolean;\n /** Whether the menu is open by default. */\n defaultOpen?: boolean;\n /** Whether the menu is open (controlled). */\n isOpen?: boolean;\n /** Handler called when the open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nexport interface SubmenuTriggerProps extends SlotProps {\n /** The trigger item followed by submenu content. */\n children: JSX.Element;\n /** Delay before opening the submenu on hover. */\n delay?: number;\n /** Whether the submenu is open (controlled). */\n isOpen?: boolean;\n /** Whether the submenu is open by default. */\n defaultOpen?: boolean;\n /** Handler called when the submenu open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\ninterface MenuContextValue<T> {\n state: MenuState<T>;\n isDisabled: () => boolean;\n dragAndDropHooks?: DragAndDropHooks<T>;\n dragState?: unknown;\n dropState?: unknown;\n}\n\ntype MenuSelectionEvent = { shiftKey?: boolean; ctrlKey?: boolean; metaKey?: boolean };\n\ninterface MenuTriggerContextValue {\n state: OverlayTriggerState;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n isPressed?: () => boolean;\n onPressStart?: (e: { pointerType?: string }) => void;\n}\n\ninterface MenuItemContextValue {\n props?: () => JSX.HTMLAttributes<HTMLElement>;\n closeOnSelect?: boolean;\n onAction?: () => void;\n setItemRef?: (el: HTMLElement | null) => void;\n}\n\ninterface StaticMenuCollectionItem {\n id: Key;\n textValue?: string;\n isDisabled?: boolean;\n}\n\ninterface StaticMenuCollectionContextValue {\n registerItem(item: StaticMenuCollectionItem): void;\n unregisterItem(id: Key): void;\n}\n\ninterface MenuSectionSelectionContextValue {\n selectionMode: () => SelectionMode;\n isSelected(key: Key): boolean;\n isDisabled(key: Key): boolean;\n select(key: Key, event?: MenuSelectionEvent): void;\n shouldCloseOnSelect(): boolean | undefined;\n}\n\ninterface MenuSectionSelectionRegistryContextValue {\n registerItem(key: Key, selection: MenuSectionSelectionContextValue): void;\n unregisterItem(key: Key, selection: MenuSectionSelectionContextValue): void;\n selectItem(key: Key, event?: MenuSelectionEvent): boolean;\n}\n\ninterface MenuItemCloseRegistryContextValue {\n registerItem(key: Key, shouldCloseOnSelect: () => boolean | undefined): void;\n unregisterItem(key: Key, shouldCloseOnSelect: () => boolean | undefined): void;\n shouldCloseOnSelect(key: Key | null): boolean | undefined;\n}\n\nexport const MenuContext = createContext<MenuContextValue<unknown> | null>(null);\nexport const MenuStateContext = createContext<MenuState<unknown> | null>(null);\nexport const MenuTriggerContext = createContext<MenuTriggerContextValue | null>(null);\nexport const RootMenuTriggerStateContext = createContext<OverlayTriggerState | null>(null);\nconst MenuItemContext = createContext<MenuItemContextValue | null>(null);\nconst StaticMenuCollectionContext = createContext<StaticMenuCollectionContextValue | null>(null);\nconst MenuSectionSelectionContext = createContext<MenuSectionSelectionContextValue | null>(null);\nconst MenuSectionSelectionRegistryContext =\n createContext<MenuSectionSelectionRegistryContextValue | null>(null);\nconst MenuItemCloseRegistryContext = createContext<MenuItemCloseRegistryContextValue | null>(null);\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") ref(el);\n else ref.current = el;\n}\n\nfunction resolveBoolean(value: unknown): boolean {\n return typeof value === \"function\" ? Boolean((value as () => unknown)()) : Boolean(value);\n}\n\n/**\n * A menu trigger wraps a button and menu, handling the open/close state.\n */\nexport function MenuTrigger(props: MenuTriggerProps): JSX.Element {\n const [local, stateProps] = splitProps(props, [\"slot\"]);\n\n const state = createMenuTriggerState({\n get isOpen() {\n return stateProps.isOpen;\n },\n get defaultOpen() {\n return stateProps.defaultOpen;\n },\n get onOpenChange() {\n return stateProps.onOpenChange;\n },\n });\n\n const [isMousePressed, setMousePressed] = createSignal(false);\n const onPressStart = (e: { pointerType?: string }) => {\n if (e.pointerType !== \"mouse\" || typeof document === \"undefined\") {\n return;\n }\n\n setMousePressed(true);\n document.addEventListener(\n \"pointerup\",\n () => {\n setMousePressed(false);\n },\n { once: true, capture: true },\n );\n };\n\n const menuTrigger = createMenuTrigger(\n {\n get isDisabled() {\n return stateProps.isDisabled;\n },\n },\n state,\n );\n\n return (\n <RootMenuTriggerStateContext.Provider value={state}>\n <MenuTriggerContext.Provider\n value={{\n state,\n get triggerProps() {\n return menuTrigger.menuTriggerProps;\n },\n get menuProps() {\n return menuTrigger.menuProps;\n },\n isPressed: isMousePressed,\n onPressStart,\n }}\n >\n {props.children}\n </MenuTriggerContext.Provider>\n </RootMenuTriggerStateContext.Provider>\n );\n}\n\nexport function SubmenuTrigger(props: SubmenuTriggerProps): JSX.Element {\n const children = () =>\n (Array.isArray(props.children) ? props.children : [props.children]) as JSX.Element[];\n const trigger = () => children()[0];\n const content = () => children()[1];\n const parentMenuItemContext = useContext(MenuItemContext);\n const state = createMenuTriggerState({\n get isOpen() {\n return props.isOpen;\n },\n get defaultOpen() {\n return props.defaultOpen;\n },\n get onOpenChange() {\n return props.onOpenChange;\n },\n });\n\n let triggerRef: HTMLElement | null = null;\n const triggerId = createUniqueId();\n const menuId = createUniqueId();\n let hoverTimeout: number | undefined;\n let hasPointerHover = false;\n const delay = () => props.delay ?? 200;\n\n const clearHoverTimeout = () => {\n if (hoverTimeout != null) {\n window.clearTimeout(hoverTimeout);\n hoverTimeout = undefined;\n }\n };\n\n const openSubmenu = () => {\n clearHoverTimeout();\n state.open();\n };\n\n const queueOpenSubmenu = () => {\n clearHoverTimeout();\n const open = () => state.open();\n if (typeof queueMicrotask === \"function\") {\n queueMicrotask(open);\n } else {\n Promise.resolve().then(open);\n }\n };\n\n const scheduleOpen = () => {\n clearHoverTimeout();\n hoverTimeout = window.setTimeout(() => {\n hoverTimeout = undefined;\n state.open();\n }, delay());\n };\n\n const schedulePointerOpen = (event: PointerEvent) => {\n hasPointerHover = true;\n if (event.isTrusted === false) {\n queueOpenSubmenu();\n return;\n }\n\n scheduleOpen();\n };\n\n const openFromMouseHover = () => {\n if (state.isOpen()) {\n return;\n }\n\n if (hasPointerHover) {\n scheduleOpen();\n } else {\n queueOpenSubmenu();\n }\n };\n\n onCleanup(clearHoverTimeout);\n\n const menuTriggerContext = createMemo<MenuTriggerContextValue>(() => ({\n state,\n triggerProps: {},\n menuProps: {\n id: menuId,\n \"aria-labelledby\": triggerId,\n },\n }));\n\n const popoverTriggerContext = createMemo(() => ({\n state: {\n isOpen: () => state.isOpen(),\n open: () => state.open(),\n close: () => state.close(),\n toggle: () => state.toggle(),\n },\n triggerRef: () => triggerRef,\n setTriggerRef: (el: HTMLElement | null) => {\n triggerRef = el;\n },\n triggerId,\n trigger: \"SubmenuTrigger\",\n }));\n\n const itemContext = createMemo<MenuItemContextValue>(() => ({\n closeOnSelect: false,\n onAction: () => openSubmenu(),\n setItemRef: (el) => {\n triggerRef = el;\n },\n props: () => ({\n id: triggerId,\n \"aria-haspopup\": \"menu\",\n get \"aria-expanded\"() {\n return state.isOpen() || undefined;\n },\n get \"aria-controls\"() {\n return state.isOpen() ? menuId : undefined;\n },\n onPointerEnter: (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n schedulePointerOpen(event);\n },\n onPointerOver: (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n schedulePointerOpen(event);\n },\n onMouseEnter: openFromMouseHover,\n onMouseOver: openFromMouseHover,\n onKeyDown: (event: KeyboardEvent) => {\n if (event.key === \"ArrowRight\" || event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n openSubmenu();\n } else if (event.key === \"ArrowLeft\" && state.isOpen()) {\n event.preventDefault();\n state.close();\n }\n },\n }),\n }));\n\n return (\n <PopoverTriggerContext.Provider value={popoverTriggerContext()}>\n <MenuTriggerContext.Provider value={menuTriggerContext()}>\n <MenuItemContext.Provider value={{ ...parentMenuItemContext, ...itemContext() }}>\n {trigger()}\n </MenuItemContext.Provider>\n {content()}\n </MenuTriggerContext.Provider>\n </PopoverTriggerContext.Provider>\n );\n}\n\n/**\n * A button that opens a menu.\n */\nexport interface MenuButtonProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLButtonElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the button. A function may be provided to receive render props. */\n children?: RenderChildren<MenuTriggerRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MenuTriggerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MenuTriggerRenderProps>;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\nexport interface MenuSectionProps\n extends\n SectionProps,\n Pick<\n SelectionStateProps,\n | \"selectionMode\"\n | \"selectionBehavior\"\n | \"disallowEmptySelection\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"disabledKeys\"\n | \"disabledBehavior\"\n | \"allowDuplicateSelectionEvents\"\n > {\n /** Whether menu items in this section should close the menu when selected. */\n shouldCloseOnSelect?: boolean;\n}\n\nexport function MenuButton(props: MenuButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"isDisabled\", \"children\"]);\n\n const context = useContext(MenuTriggerContext);\n if (!context) {\n throw new Error(\"MenuButton must be used within a MenuTrigger\");\n }\n const { state } = context;\n\n const buttonAria = createButton({\n get isDisabled() {\n return local.isDisabled;\n },\n onPressStart(e) {\n context.onPressStart?.(e);\n },\n onPress() {\n state.toggle();\n },\n });\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return local.isDisabled;\n },\n });\n\n const renderValues = createMemo<MenuTriggerRenderProps>(() => ({\n isOpen: state.isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isPressed: context.isPressed?.() || buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: !!local.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-MenuButton\",\n },\n renderValues,\n );\n\n const resolvedTriggerProps = () => context.triggerProps as Record<string, unknown>;\n const cleanTriggerProps = () => {\n const {\n ref: _ref1,\n \"aria-haspopup\": _ariaHasPopup,\n \"aria-expanded\": _ariaExpanded,\n \"aria-controls\": _ariaControls,\n \"aria-disabled\": _ariaDisabled,\n ...rest\n } = resolvedTriggerProps();\n return rest;\n };\n const cleanButtonProps = () => {\n const { ref: _ref2, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref4, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <button\n {...domProps}\n {...cleanTriggerProps()}\n {...cleanButtonProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n type=\"button\"\n class={renderProps.class()}\n style={renderProps.style()}\n aria-haspopup={resolvedTriggerProps()[\"aria-haspopup\"] as \"menu\" | \"listbox\" | undefined}\n aria-expanded={resolvedTriggerProps()[\"aria-expanded\"] as boolean | undefined}\n aria-controls={resolvedTriggerProps()[\"aria-controls\"] as string | undefined}\n aria-disabled={resolvedTriggerProps()[\"aria-disabled\"] as boolean | undefined}\n data-open={state.isOpen() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-pressed={context.isPressed?.() || buttonAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={local.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n );\n}\n\n/**\n * A menu displays a list of actions or options for the user to choose from.\n */\nexport function Menu<T>(props: MenuProps<T>): JSX.Element {\n const [local, stateProps, ariaProps] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"render\", \"slot\", \"renderEmptyState\", \"ref\", \"staticChildren\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"selectionMode\",\n \"selectionBehavior\",\n \"disallowEmptySelection\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"allowDuplicateSelectionEvents\",\n \"onAction\",\n \"onClose\",\n \"shouldCloseOnSelect\",\n \"dragAndDropHooks\",\n ],\n );\n\n const triggerContext = useContext(MenuTriggerContext);\n\n const [menuRef, setMenuRef] = createSignal<HTMLDivElement | null>(null);\n const [staticItems, setStaticItems] = createSignal<StaticMenuCollectionItem[]>([]);\n const staticItemMap = new Map<Key, StaticMenuCollectionItem>();\n const sectionSelectionMap = new Map<Key, MenuSectionSelectionContextValue>();\n const itemCloseMap = new Map<Key, () => boolean | undefined>();\n const usesStaticChildren = () => local.staticChildren != null || stateProps.items == null;\n\n const syncStaticItems = () => {\n setStaticItems(Array.from(staticItemMap.values()));\n };\n\n const staticCollectionContext: StaticMenuCollectionContextValue = {\n registerItem(item) {\n const previous = staticItemMap.get(item.id);\n if (\n previous &&\n previous.textValue === item.textValue &&\n previous.isDisabled === item.isDisabled\n ) {\n return;\n }\n\n staticItemMap.set(item.id, item);\n syncStaticItems();\n },\n unregisterItem(id) {\n if (staticItemMap.delete(id)) {\n syncStaticItems();\n }\n },\n };\n const sectionSelectionRegistry: MenuSectionSelectionRegistryContextValue = {\n registerItem(key, selection) {\n sectionSelectionMap.set(key, selection);\n },\n unregisterItem(key, selection) {\n if (sectionSelectionMap.get(key) === selection) {\n sectionSelectionMap.delete(key);\n }\n },\n selectItem(key, event) {\n const selection = sectionSelectionMap.get(key);\n if (!selection || selection.selectionMode() === \"none\") {\n return false;\n }\n\n selection.select(key, event);\n return true;\n },\n };\n const itemCloseRegistry: MenuItemCloseRegistryContextValue = {\n registerItem(key, shouldCloseOnSelect) {\n itemCloseMap.set(key, shouldCloseOnSelect);\n },\n unregisterItem(key, shouldCloseOnSelect) {\n if (itemCloseMap.get(key) === shouldCloseOnSelect) {\n itemCloseMap.delete(key);\n }\n },\n shouldCloseOnSelect(key) {\n return key == null ? undefined : itemCloseMap.get(key)?.();\n },\n };\n const handleAction = (key: Key, value?: T) => {\n sectionSelectionRegistry.selectItem(key);\n // Forward the activated item's value, which `createMenuState` sets from the\n // collection node. For dynamic collections this is the user's data item.\n // Static children are modeled with an internal item descriptor that upstream\n // RAC does not expose as `value` (MenuItem only carries `value` for dynamic\n // collections), so it is suppressed there to match.\n stateProps.onAction?.(key, (usesStaticChildren() ? undefined : value) as T);\n };\n\n const flatItems = createMemo<T[]>(() => {\n return flattenCollectionEntries(stateProps.items ?? []);\n });\n\n const hasSections = createMemo(() =>\n (stateProps.items ?? []).some((item) => isCollectionSection(item)),\n );\n\n const state = createMenuState<T>({\n get items() {\n return usesStaticChildren() ? (staticItems() as T[]) : flatItems();\n },\n get getKey() {\n return usesStaticChildren()\n ? (item: T) => (item as StaticMenuCollectionItem).id\n : stateProps.getKey;\n },\n get getTextValue() {\n return usesStaticChildren()\n ? (item: T) =>\n (item as StaticMenuCollectionItem).textValue ??\n String((item as StaticMenuCollectionItem).id)\n : stateProps.getTextValue;\n },\n get getDisabled() {\n return usesStaticChildren()\n ? (item: T) => Boolean((item as StaticMenuCollectionItem).isDisabled)\n : stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get disabledBehavior() {\n return stateProps.disabledBehavior;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectionBehavior() {\n return stateProps.selectionBehavior;\n },\n get disallowEmptySelection() {\n return stateProps.disallowEmptySelection;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get allowDuplicateSelectionEvents() {\n return stateProps.allowDuplicateSelectionEvents;\n },\n get onAction() {\n return handleAction;\n },\n get onClose() {\n return stateProps.onClose ?? (() => triggerContext?.state.close());\n },\n });\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const { menuProps, labelProps } = createMenu(\n {\n get isDisabled() {\n return resolveDisabled();\n },\n get label() {\n return ariaProps.label;\n },\n get onAction() {\n return handleAction;\n },\n get onClose() {\n return stateProps.onClose ?? (() => triggerContext?.state.close());\n },\n get shouldCloseOnSelect() {\n return (\n itemCloseRegistry.shouldCloseOnSelect(state.focusedKey()) ??\n stateProps.shouldCloseOnSelect\n );\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n },\n state,\n );\n\n // Reveal the activedescendant-focused item on keyboard navigation. The menu\n // keeps real DOM focus on itself, so the browser won't natively scroll an\n // off-screen focused item into view the way roving tabindex would.\n createScrollIntoViewOnFocus({\n focusedKey: () => state.focusedKey(),\n isActive: () => state.isFocused(),\n ref: () => menuRef(),\n });\n\n const { isFocused, focusProps } = createFocusRing();\n\n createInteractOutside({\n ref: () => menuRef(),\n onInteractOutside: () => {\n if (triggerContext?.state.isOpen()) {\n triggerContext.state.close();\n }\n },\n get isDisabled() {\n return !triggerContext?.state.isOpen();\n },\n });\n\n const renderValues = createMemo<MenuRenderProps>(() => ({\n isFocused: state.isFocused() || isFocused(),\n isOpen: triggerContext?.state.isOpen() ?? true,\n isEmpty: state.collection().size === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Menu\",\n },\n renderValues,\n );\n\n const cleanMenuProps = () => {\n const { ref: _ref1, ...rest } = menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanTriggerMenuProps = () => {\n if (!triggerContext) return {};\n const { ref: _ref2, ...rest } = triggerContext.menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const domProps = createMemo(() =>\n filterDOMProps(ariaProps as Record<string, unknown>, { global: true }),\n );\n const cleanLabelProps = () => {\n const { ref: _ref4, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const setResolvedMenuRef = (el: HTMLDivElement): void => {\n setMenuRef(el);\n assignRef(local.ref, el);\n };\n\n // If inside a MenuTrigger, only render when open\n // If standalone (no trigger context), always render\n const shouldRender = () => (triggerContext ? triggerContext.state.isOpen() : true);\n const parentCollectionRenderer = useCollectionRenderer<unknown>();\n const virtualizer = useVirtualizerContext();\n const getItemNodes = createMemo(() =>\n Array.from(state.collection()).filter((node) => node.type === \"item\"),\n );\n const getDropTargetByIndex = (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ): DropTarget | null => {\n const node = getItemNodes()[index];\n if (!node) return null;\n return { type: \"item\", key: node.key, dropPosition: position };\n };\n const hasDroppableDnd = createMemo(() => {\n const hooks = stateProps.dragAndDropHooks;\n return Boolean(\n hooks?.useDroppableCollectionState &&\n hooks.useDroppableCollection &&\n (hooks.dropTargetDelegate ||\n parentCollectionRenderer?.dropTargetDelegate ||\n hooks.ListDropTargetDelegate),\n );\n });\n const hasDraggableDnd = createMemo(() => {\n const hooks = stateProps.dragAndDropHooks;\n return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);\n });\n const dragState = createMemo(() => {\n if (!hasDraggableDnd()) return undefined;\n return stateProps.dragAndDropHooks?.useDraggableCollectionState?.({\n items: flatItems(),\n });\n });\n const dropState = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n return stateProps.dragAndDropHooks?.useDroppableCollectionState?.({});\n });\n const persistedKeys = useDndPersistedKeys(\n { focusedKey: state.focusedKey },\n stateProps.dragAndDropHooks,\n dropState(),\n state.collection(),\n );\n const virtualRange = createMemo(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized || hasSections()) return null;\n const dynamicItems = stateProps.items ?? [];\n const baseRange = virtualizer.getVisibleRange(dynamicItems.length);\n const itemNodes = getItemNodes();\n const persistedIndexes = Array.from(persistedKeys())\n .map((key) => itemNodes.findIndex((node) => node.key === key))\n .filter((index) => index >= 0);\n const dropTarget = dropState()?.target;\n const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection());\n const focusedKey = state.focusedKey();\n const focusedIndex =\n focusedKey != null ? itemNodes.findIndex((node) => node.key === focusedKey) : -1;\n const forceIncludeIndexes = [\n dropTarget?.type === \"item\" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1,\n normalizedDropKey != null\n ? itemNodes.findIndex((node) => node.key === normalizedDropKey)\n : -1,\n dropTarget?.type === \"item\" ? -1 : focusedIndex,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(\n baseRange,\n persistedIndexes,\n dynamicItems.length,\n virtualizer,\n 80,\n {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n },\n );\n });\n const visibleItems = createMemo(() => {\n const range = virtualRange();\n const items = stateProps.items ?? [];\n if (!range) return items;\n return items.slice(range.start, range.end);\n });\n createEffect(() => {\n if (!hasDraggableDnd()) return;\n const hooks = stateProps.dragAndDropHooks;\n const activeDragState = dragState();\n if (!hooks?.useDraggableCollection || !activeDragState) return;\n hooks.useDraggableCollection({}, activeDragState, () => menuRef());\n });\n const droppableCollection = createMemo(() => {\n if (!hasDroppableDnd()) return undefined;\n const hooks = stateProps.dragAndDropHooks;\n const activeDropState = dropState();\n if (!hooks?.useDroppableCollection || !activeDropState) return undefined;\n const resolveDirection = (): \"ltr\" | \"rtl\" => {\n const menuEl = menuRef();\n if (\n menuEl &&\n typeof window !== \"undefined\" &&\n typeof window.getComputedStyle === \"function\"\n ) {\n const dir = window.getComputedStyle(menuEl).direction;\n if (dir === \"rtl\") return \"rtl\";\n }\n return typeof document !== \"undefined\" && document.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n const dropTargetDelegate =\n hooks.dropTargetDelegate ??\n parentCollectionRenderer?.dropTargetDelegate ??\n (hooks.ListDropTargetDelegate\n ? new hooks.ListDropTargetDelegate(\n () => state.collection(),\n () => menuRef(),\n { layout: \"stack\", orientation: \"vertical\", direction: resolveDirection() },\n )\n : undefined);\n if (!dropTargetDelegate) return undefined;\n return hooks.useDroppableCollection(\n {\n dropTargetDelegate,\n keyboardDelegate: {\n getFirstKey: () => state.collection().getFirstKey(),\n getLastKey: () => state.collection().getLastKey(),\n getKeyBelow: (key) => state.collection().getKeyAfter(key),\n getKeyAbove: (key) => state.collection().getKeyBefore(key),\n getKeyPageBelow: (key) => state.collection().getKeyAfter(key),\n getKeyPageAbove: (key) => state.collection().getKeyBefore(key),\n },\n },\n activeDropState,\n () => menuRef(),\n );\n });\n const isRootDropTarget = createMemo(() => {\n return Boolean(dropState()?.target?.type === \"root\");\n });\n const dndRenderDropIndicator = createMemo(() =>\n useRenderDropIndicator(stateProps.dragAndDropHooks, dropState()),\n );\n const dndDropIndicator = (index: number, position: \"before\" | \"after\" | \"on\") => {\n const target = getDropTargetByIndex(index, position);\n if (!target || target.type !== \"item\") return undefined;\n return dndRenderDropIndicator()?.(target);\n };\n const sectionedRenderEntries = createMemo(() => {\n let globalIndex = 0;\n return (stateProps.items ?? []).map((entry) => {\n if (isCollectionSection(entry)) {\n const sectionItems = entry.items.map((item) => ({\n item,\n index: globalIndex++,\n }));\n return {\n type: \"section\" as const,\n section: entry,\n items: sectionItems,\n };\n }\n const indexedItem = {\n item: entry as T,\n index: globalIndex++,\n };\n return {\n type: \"item\" as const,\n item: indexedItem,\n };\n });\n });\n const renderDynamicItem = (item: T) =>\n typeof local.children === \"function\" ? local.children(item) : undefined;\n const resolveStaticChild = (child: unknown): JSX.Element | undefined => {\n return typeof child === \"function\"\n ? (child as () => JSX.Element | undefined)()\n : (child as JSX.Element | undefined);\n };\n const renderStaticChildren = () => {\n const staticChildren = (local.staticChildren?.() ?? local.children) as unknown;\n if (Array.isArray(staticChildren)) {\n return staticChildren.map(resolveStaticChild);\n }\n return resolveStaticChild(staticChildren);\n };\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => renderDynamicItem(item as T),\n renderDropIndicator: (index, position) =>\n dndDropIndicator(index, position) ??\n parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n const menuItemContextValue = createMemo<MenuItemContextValue>(() =>\n stateProps.shouldCloseOnSelect !== undefined\n ? { closeOnSelect: stateProps.shouldCloseOnSelect }\n : {},\n );\n const menuListChildren = () => (\n <SharedElementTransition>\n {state.collection().size === 0 && !usesStaticChildren() && local.renderEmptyState ? (\n <div role=\"presentation\" data-empty-state>\n <div role=\"menuitem\" style={{ display: \"contents\" }}>\n {local.renderEmptyState()}\n </div>\n </div>\n ) : usesStaticChildren() ? (\n renderStaticChildren()\n ) : hasSections() ? (\n <For each={sectionedRenderEntries()}>\n {(entry) =>\n entry.type === \"section\" ? (\n <div role=\"presentation\" data-section-wrapper>\n <Section class=\"solidaria-Menu-section\">\n {entry.section.title != null && (\n <Header class=\"solidaria-Menu-sectionHeader\">{entry.section.title}</Header>\n )}\n <Group class=\"solidaria-Menu-sectionGroup\">\n <div role=\"group\" aria-label={entry.section[\"aria-label\"]}>\n <For each={entry.items}>\n {(indexedItem) => (\n <>\n {collectionRenderer().renderDropIndicator?.(\n indexedItem.index,\n \"before\",\n )}\n {collectionRenderer().renderDropIndicator?.(indexedItem.index, \"on\")}\n {renderDynamicItem(indexedItem.item)}\n {collectionRenderer().renderDropIndicator?.(indexedItem.index, \"after\")}\n </>\n )}\n </For>\n </div>\n </Group>\n </Section>\n </div>\n ) : (\n <>\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"before\")}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"on\")}\n {renderDynamicItem(entry.item.item)}\n {collectionRenderer().renderDropIndicator?.(entry.item.index, \"after\")}\n </>\n )\n }\n </For>\n ) : (\n <>\n {virtualRange()?.offsetTop ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetTop}px` }}\n data-virtualizer-spacer=\"top\"\n />\n ) : null}\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n const beforeIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"before\");\n const onIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"on\");\n const afterIndicator = () =>\n collectionRenderer().renderDropIndicator?.(itemIndex(), \"after\");\n return (\n <>\n {beforeIndicator()}\n {onIndicator()}\n {renderDynamicItem(item as T)}\n {afterIndicator()}\n </>\n );\n }}\n </For>\n {virtualRange()?.offsetBottom ? (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ height: `${virtualRange()!.offsetBottom}px` }}\n data-virtualizer-spacer=\"bottom\"\n />\n ) : null}\n </>\n )}\n </SharedElementTransition>\n );\n const menuListProps = () =>\n ({\n ref: setResolvedMenuRef,\n ...mergeProps(\n domProps(),\n cleanMenuProps(),\n cleanTriggerMenuProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-focused\": state.isFocused() || undefined,\n \"data-disabled\": resolveDisabled() || undefined,\n \"data-empty\": state.collection().size === 0 || undefined,\n \"data-drop-target\": isRootDropTarget() || undefined,\n children: menuListChildren(),\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n\n // Only use FocusScope when inside a MenuTrigger (for popover behavior)\n // Standalone menus don't need focus restoration\n const menuContent = () => (\n <MenuContext.Provider\n value={\n {\n state,\n isDisabled: resolveDisabled,\n dragAndDropHooks: stateProps.dragAndDropHooks,\n dragState: dragState(),\n dropState: dropState(),\n } as MenuContextValue<unknown>\n }\n >\n <MenuStateContext.Provider value={state}>\n <MenuSectionSelectionRegistryContext.Provider value={sectionSelectionRegistry}>\n <MenuItemCloseRegistryContext.Provider value={itemCloseRegistry}>\n <StaticMenuCollectionContext.Provider\n value={usesStaticChildren() ? staticCollectionContext : null}\n >\n <MenuItemContext.Provider value={menuItemContextValue()}>\n <CollectionRendererContext.Provider value={collectionRenderer()}>\n <>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n {local.render ? (\n local.render(menuListProps(), renderValues())\n ) : (\n <div\n ref={setResolvedMenuRef}\n {...mergeProps(\n domProps(),\n cleanMenuProps(),\n cleanTriggerMenuProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as\n | Record<string, unknown>\n | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-focused={state.isFocused() || undefined}\n data-disabled={resolveDisabled() || undefined}\n data-empty={state.collection().size === 0 || undefined}\n data-drop-target={isRootDropTarget() || undefined}\n >\n {menuListChildren()}\n </div>\n )}\n </>\n </CollectionRendererContext.Provider>\n </MenuItemContext.Provider>\n </StaticMenuCollectionContext.Provider>\n </MenuItemCloseRegistryContext.Provider>\n </MenuSectionSelectionRegistryContext.Provider>\n </MenuStateContext.Provider>\n </MenuContext.Provider>\n );\n\n return (\n <Show when={shouldRender()}>\n <Show when={triggerContext} fallback={menuContent()}>\n <FocusScope restoreFocus autoFocus>\n {menuContent()}\n </FocusScope>\n </Show>\n </Show>\n );\n}\n\n/**\n * An item in a menu.\n */\nexport function MenuItem<T>(props: MenuItemProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"onAction\",\n \"href\",\n \"target\",\n \"rel\",\n \"download\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n \"ref\",\n ]);\n\n const context = useContext(MenuStateContext);\n if (!context) {\n throw new Error(\"MenuItem must be used within a Menu\");\n }\n const state = context as MenuState<T>;\n const menuContext = useContext(MenuContext) as MenuContextValue<T> | null;\n const itemContext = useContext(MenuItemContext);\n const staticCollection = useContext(StaticMenuCollectionContext);\n const sectionSelection = useContext(MenuSectionSelectionContext);\n const sectionSelectionRegistry = useContext(MenuSectionSelectionRegistryContext);\n const itemCloseRegistry = useContext(MenuItemCloseRegistryContext);\n // Tracks the focusable menuitem element (the <div>, or the <a> for link\n // items) so roving focus can be moved onto it imperatively.\n const [ref, setRef] = createSignal<HTMLElement | null>(null);\n const contextProps = () => itemContext?.props?.() ?? {};\n const combinedOnAction = () => {\n local.onAction?.();\n itemContext?.onAction?.();\n };\n const itemCloseOnSelect = () =>\n ariaProps.closeOnSelect ??\n sectionSelection?.shouldCloseOnSelect() ??\n itemContext?.closeOnSelect;\n const activeSectionSelection = () =>\n sectionSelection && sectionSelection.selectionMode() !== \"none\" ? sectionSelection : null;\n let registeredStaticKey: Key | null = null;\n let registeredSectionSelectionKey: Key | null = null;\n let registeredSectionSelection: MenuSectionSelectionContextValue | null = null;\n let registeredCloseKey: Key | null = null;\n let registeredCloseAccessor: (() => boolean | undefined) | null = null;\n\n const unregisterSectionSelection = () => {\n if (registeredSectionSelectionKey != null && registeredSectionSelection) {\n sectionSelectionRegistry?.unregisterItem(\n registeredSectionSelectionKey,\n registeredSectionSelection,\n );\n registeredSectionSelectionKey = null;\n registeredSectionSelection = null;\n }\n };\n\n createEffect(() => {\n if (!staticCollection) return;\n\n if (registeredStaticKey != null && registeredStaticKey !== local.id) {\n staticCollection.unregisterItem(registeredStaticKey);\n }\n\n registeredStaticKey = local.id;\n staticCollection.registerItem({\n id: local.id,\n textValue: local.textValue ?? ariaProps[\"aria-label\"],\n isDisabled:\n resolveBoolean(ariaProps.isDisabled) || (sectionSelection?.isDisabled(local.id) ?? false),\n });\n });\n\n onCleanup(() => {\n if (registeredStaticKey != null) {\n staticCollection?.unregisterItem(registeredStaticKey);\n }\n });\n\n createEffect(() => {\n const selection = activeSectionSelection();\n if (!sectionSelectionRegistry || !selection) {\n unregisterSectionSelection();\n return;\n }\n\n if (registeredSectionSelectionKey === local.id && registeredSectionSelection === selection) {\n return;\n }\n\n unregisterSectionSelection();\n registeredSectionSelectionKey = local.id;\n registeredSectionSelection = selection;\n sectionSelectionRegistry.registerItem(local.id, selection);\n });\n\n onCleanup(unregisterSectionSelection);\n\n const unregisterItemClose = () => {\n if (registeredCloseKey != null && registeredCloseAccessor) {\n itemCloseRegistry?.unregisterItem(registeredCloseKey, registeredCloseAccessor);\n registeredCloseKey = null;\n registeredCloseAccessor = null;\n }\n };\n\n createEffect(() => {\n if (!itemCloseRegistry) {\n unregisterItemClose();\n return;\n }\n\n if (registeredCloseKey === local.id && registeredCloseAccessor === itemCloseOnSelect) {\n return;\n }\n\n unregisterItemClose();\n registeredCloseKey = local.id;\n registeredCloseAccessor = itemCloseOnSelect;\n itemCloseRegistry.registerItem(local.id, itemCloseOnSelect);\n });\n\n onCleanup(unregisterItemClose);\n\n const itemAria = createMenuItem<T>(\n {\n key: local.id,\n get id() {\n return contextProps().id as string | undefined;\n },\n get isDisabled() {\n return Boolean(\n ariaProps.isDisabled ||\n sectionSelection?.isDisabled(local.id) ||\n menuContext?.isDisabled(),\n );\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n get \"aria-controls\"() {\n return contextProps()[\"aria-controls\"] as string | undefined;\n },\n get \"aria-haspopup\"() {\n return contextProps()[\"aria-haspopup\"] as string | boolean | undefined;\n },\n get \"aria-expanded\"() {\n return contextProps()[\"aria-expanded\"] as boolean | \"true\" | \"false\" | undefined;\n },\n get onAction() {\n return combinedOnAction;\n },\n get closeOnSelect() {\n return itemCloseOnSelect();\n },\n get href() {\n return local.href;\n },\n get target() {\n return local.target;\n },\n get rel() {\n return local.rel;\n },\n get download() {\n return local.download;\n },\n },\n state,\n () => ref(),\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return itemAria.isDisabled();\n },\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n });\n\n const renderValues = createMemo<MenuItemRenderProps>(() => {\n const selection = activeSectionSelection();\n return {\n isSelected: selection?.isSelected(local.id) ?? itemAria.isSelected(),\n selectionMode: selection?.selectionMode() ?? itemAria.selectionMode(),\n isFocused: itemAria.isFocused(),\n isFocusVisible: itemAria.isFocusVisible(),\n isPressed: itemAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: itemAria.isDisabled(),\n hasSubmenu: Boolean(contextProps()[\"aria-haspopup\"]),\n isOpen: contextProps()[\"aria-expanded\"] === true,\n descriptionProps: itemAria.descriptionProps,\n keyboardShortcutProps: itemAria.keyboardShortcutProps,\n };\n });\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Menu-item\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const cleanItemProps = () => {\n // Keep `aria-describedby`: the headless emits it (via `createSlotId`) only\n // when a description/keyboard element is actually rendered, so it points at\n // the styled `Text slot=\"description\"` + `Keyboard` ids threaded through\n // `renderValues` below — restoring upstream's two-context description\n // delegation. `createSlotId` clears it to `undefined` on description-less\n // items, so nothing dangles.\n const { ref: _ref1, ...rest } = itemAria.menuItemProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n const selection = activeSectionSelection();\n const selectionMode = selection?.selectionMode();\n if (selectionMode) {\n rest.role =\n selectionMode === \"single\"\n ? \"menuitemradio\"\n : selectionMode === \"multiple\"\n ? \"menuitemcheckbox\"\n : \"menuitem\";\n if (selectionMode !== \"none\") {\n rest[\"aria-checked\"] = selection?.isSelected(local.id) ?? false;\n } else {\n delete rest[\"aria-checked\"];\n }\n rest[\"data-selected\"] = selection?.isSelected(local.id) || undefined;\n }\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const domProps = createMemo(() =>\n filterDOMProps(ariaProps as Record<string, unknown>, { global: true }),\n );\n const draggableItem = createMemo(() => {\n if (!menuContext?.dragAndDropHooks?.useDraggableItem || !menuContext.dragState)\n return undefined;\n return menuContext.dragAndDropHooks.useDraggableItem(\n {\n key: local.id as string | number,\n },\n menuContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDraggableItem\"]>>[1],\n );\n });\n const droppableItem = createMemo(() => {\n if (!menuContext?.dragAndDropHooks?.useDroppableItem || !menuContext.dropState)\n return undefined;\n return menuContext.dragAndDropHooks.useDroppableItem(\n {\n key: local.id as string | number,\n },\n menuContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDroppableItem\"]>>[1],\n () => ref(),\n );\n });\n\n const isLink = () => !!local.href;\n\n const cleanItemPropsForLink = () => {\n const all = cleanItemProps();\n const { href: _href, target: _target, rel: _rel, download: _download, ...rest } = all;\n return rest;\n };\n\n const linkDomProps = () => {\n const all = cleanItemProps();\n const result: Record<string, unknown> = {};\n if (all.href !== undefined) result.href = all.href;\n if (all.target !== undefined) result.target = all.target;\n if (all.rel !== undefined) result.rel = all.rel;\n if (all.download !== undefined) result.download = all.download;\n return result;\n };\n\n const dataAttrs = () => {\n const selection = activeSectionSelection();\n return {\n \"data-focused\": itemAria.isFocused() || undefined,\n \"data-focus-visible\": itemAria.isFocusVisible() || undefined,\n \"data-pressed\": itemAria.isPressed() || undefined,\n \"data-hovered\": isHovered() || undefined,\n \"data-disabled\": itemAria.isDisabled() || undefined,\n \"data-selected\": (selection?.isSelected(local.id) ?? itemAria.isSelected()) || undefined,\n \"data-has-submenu\": Boolean(contextProps()[\"aria-haspopup\"]) || undefined,\n \"data-open\": contextProps()[\"aria-expanded\"] === true || undefined,\n \"data-dragging\": draggableItem()?.isDragging || undefined,\n \"data-drop-target\": droppableItem()?.isDropTarget || undefined,\n };\n };\n\n const childContent = () =>\n hasPrimitiveLabel() ? (\n <span {...itemAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n );\n const setResolvedItemRef = (el: HTMLElement | null) => {\n setRef(el);\n itemContext?.setItemRef?.(el);\n if (el) assignRef(local.ref, el);\n };\n const menuItemProps = () =>\n ({\n ref: setResolvedItemRef,\n ...mergeProps(\n cleanItemProps(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n ...dataAttrs(),\n children: childContent(),\n }) as JSX.HTMLAttributes<HTMLElement>;\n const linkMenuItemProps = () =>\n ({\n ...mergeProps(\n cleanItemPropsForLink(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n linkDomProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n ...dataAttrs(),\n children: childContent(),\n }) as JSX.HTMLAttributes<HTMLElement>;\n\n if (local.render && !isLink()) {\n return local.render(menuItemProps(), renderValues());\n }\n\n return (\n <Show\n when={isLink()}\n fallback={\n <div\n ref={(el) => {\n setRef(el);\n itemContext?.setItemRef?.(el);\n assignRef(local.ref, el);\n }}\n {...mergeProps(\n cleanItemProps(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n {...dataAttrs()}\n >\n {childContent()}\n </div>\n }\n >\n {local.render ? (\n local.render(linkMenuItemProps(), renderValues())\n ) : (\n // Upstream renders the link menuitem as a bare <a role=\"menuitem\"> (no\n // presentation wrapper); the <div> root makes the wrapper unnecessary.\n <a\n ref={(el) => {\n setRef(el);\n itemContext?.setItemRef?.(el);\n assignRef(local.ref, el);\n }}\n {...mergeProps(\n cleanItemPropsForLink(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n linkDomProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n {...dataAttrs()}\n >\n {childContent()}\n </a>\n )}\n </Show>\n );\n}\n\n/**\n * Section primitive alias for Menu composition parity.\n */\nexport function MenuSection(props: MenuSectionProps): JSX.Element {\n const [selectionProps, sectionProps] = splitProps(props, [\n \"selectionMode\",\n \"selectionBehavior\",\n \"disallowEmptySelection\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"allowDuplicateSelectionEvents\",\n \"shouldCloseOnSelect\",\n ]);\n\n const selectionState = createSelectionState({\n get selectionMode() {\n return selectionProps.selectionMode ?? \"none\";\n },\n get selectionBehavior() {\n return selectionProps.selectionBehavior;\n },\n get disallowEmptySelection() {\n return selectionProps.disallowEmptySelection;\n },\n get selectedKeys() {\n return selectionProps.selectionMode ? selectionProps.selectedKeys : undefined;\n },\n get defaultSelectedKeys() {\n return selectionProps.selectionMode ? selectionProps.defaultSelectedKeys : undefined;\n },\n get onSelectionChange() {\n return selectionProps.selectionMode ? selectionProps.onSelectionChange : undefined;\n },\n get disabledKeys() {\n return selectionProps.disabledKeys;\n },\n get disabledBehavior() {\n return selectionProps.disabledBehavior;\n },\n get allowDuplicateSelectionEvents() {\n return selectionProps.allowDuplicateSelectionEvents;\n },\n });\n\n const sectionSelection: MenuSectionSelectionContextValue = {\n selectionMode: selectionState.selectionMode,\n isSelected: selectionState.isSelected,\n isDisabled: selectionState.isDisabled,\n select(key, event) {\n selectionState.select(key, event);\n },\n shouldCloseOnSelect() {\n return selectionProps.shouldCloseOnSelect;\n },\n };\n\n return (\n <MenuSectionSelectionContext.Provider value={sectionSelection}>\n <Section {...sectionProps} />\n </MenuSectionSelectionContext.Provider>\n );\n}\n\nMenu.Item = MenuItem;\n"],"mappings":";;;;;;;;;;;;;;;;AAkTA,MAAa,cAAc,cAAgD,IAAI;AAC/E,MAAa,mBAAmB,cAAyC,IAAI;AAC7E,MAAa,qBAAqB,cAA8C,IAAI;AACpF,MAAa,8BAA8B,cAA0C,IAAI;AACzF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AAO;GACjB,eAAe,OAAO,KAAK,KAAK;EAClC;EACA,sBAAsB;GACpB,OAAO,eAAe;EACxB;CACF;CAEA,OACE,CAAC,4BAA4B,SAAS,OAAO,kBAAkB;MAC7D,CAAC,YAAY,gBAAgB;IAC/B,EAAE,4BAA4B;AAElC;AAEA,KAAK,OAAO"}
|
|
1
|
+
{"version":3,"file":"Menu.jsx","names":["assignRef"],"sources":["../src/Menu.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Menu.tsx\n\n/**\n * Menu component for solidaria-components\n *\n * A pre-wired headless menu that combines state + aria hooks.\n * Port of react-aria-components/src/Menu.tsx\n */\n\nimport {\n createContext,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onCleanup,\n useContext,\n For,\n Show,\n createTrackedEffect,\n} from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createMenu,\n createMenuItem,\n createMenuTrigger,\n type MenuTriggerMenuProps,\n createFocusRing,\n createHover,\n createInteractOutside,\n createScrollIntoViewOnFocus,\n mergeProps,\n FocusScope,\n type AriaMenuProps,\n type AriaMenuItemProps,\n type AriaMenuTriggerProps,\n useLocale,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSelectionState,\n createMenuState,\n createMenuTriggerState,\n type MenuState,\n type MenuStateProps,\n type MenuTriggerState,\n type Key,\n type DropTarget,\n type SelectionMode,\n type SelectionStateProps,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n assignRef,\n dataAttr,\n isAriaTrue,\n type RefLike,\n} from \"./utils\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport { type DragAndDropHooks } from \"./useDragAndDrop\";\nimport {\n CollectionRendererContext,\n Section,\n Header,\n Group,\n type CollectionEntry,\n type CollectionRendererContextValue,\n type SectionProps,\n useCollectionRenderer,\n flattenCollectionEntries,\n isCollectionSection,\n useCollectionRoot,\n renderCollectionDropSlots,\n} from \"./Collection\";\nimport { useVirtualizerContext, PersistedVirtualItem } from \"./Virtualizer\";\nimport {\n getNormalizedDropTargetKey,\n indexesOutsideRange,\n mergePersistedKeysIntoVirtualRange,\n useDndPersistedKeys,\n useRenderDropIndicator,\n} from \"./DragAndDrop\";\nimport { PopoverTriggerContext } from \"./contexts\";\nimport { OverlayContext } from \"./Popover\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface MenuRenderProps {\n /** Whether the menu is focused. */\n isFocused: boolean;\n /** Whether the menu is open. */\n isOpen: boolean;\n /** Whether the menu has no items. */\n isEmpty: boolean;\n}\n\nexport interface MenuProps<T>\n extends\n Omit<AriaMenuProps<T>, \"children\">,\n SlotProps,\n Pick<\n MenuStateProps<T>,\n | \"selectionMode\"\n | \"selectionBehavior\"\n | \"disallowEmptySelection\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"allowDuplicateSelectionEvents\"\n > {\n /** The items to render in the menu. */\n items?: CollectionEntry<T>[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Whether disabled items can still receive focus. */\n disabledBehavior?: \"selection\" | \"all\";\n /** Handler called when an item is activated, with the activated item's value. */\n onAction?: (key: Key, value: T) => void;\n /** Handler called when the menu should close. */\n onClose?: () => void;\n /** The children of the component. A function may be provided to render each item. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** Internal lazy static children accessor used when collection children need menu context. */\n staticChildren?: () => JSX.Element | undefined;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MenuRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MenuRenderProps>;\n /** Content to display when the menu has no items. */\n renderEmptyState?: () => JSX.Element;\n /** Whether the menu should close when an item is selected. */\n shouldCloseOnSelect?: boolean;\n /** Ref for the menu element. */\n ref?: RefLike<HTMLDivElement>;\n /** Custom renderer for the menu element. */\n render?: (props: JSX.HTMLAttributes<HTMLDivElement>, renderProps: MenuRenderProps) => JSX.Element;\n /** Drag and drop hooks from `useDragAndDrop`. */\n dragAndDropHooks?: DragAndDropHooks<T>;\n}\n\nexport interface MenuItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** The parent menu selection mode. */\n selectionMode: SelectionMode;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item opens a submenu. */\n hasSubmenu: boolean;\n /** Whether the submenu is currently open. */\n isOpen: boolean;\n /**\n * Internal: props (carrying the slot `id` the item's `aria-describedby`\n * references) for the item's description text element. Threaded to the styled\n * `Text slot=\"description\"` so it receives the id — mirrors upstream's\n * `TextContext` description-slot delegation.\n */\n descriptionProps?: JSX.HTMLAttributes<HTMLElement>;\n /**\n * Internal: props (id + `aria-hidden`) for the item's keyboard-shortcut\n * element, threaded to the styled `Keyboard`.\n */\n keyboardShortcutProps?: JSX.HTMLAttributes<HTMLElement>;\n}\n\nexport interface MenuItemProps<T>\n extends Omit<AriaMenuItemProps, \"children\" | \"key\" | \"id\">, SlotProps {\n /** The unique key for the item. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the item. A function may be provided to receive render props. */\n children?: RenderChildren<MenuItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<MenuItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<MenuItemRenderProps>;\n /** The text value of the item (for typeahead). */\n textValue?: string;\n /** Handler called when the item is activated. */\n onAction?: () => void;\n /** A URL to link to. Turns the menu item into a link. */\n href?: string;\n /** The target window for the link. */\n target?: string;\n /** The relationship between the linked resource and the current page. */\n rel?: string;\n /** Causes the browser to download the linked URL. */\n download?: boolean | string;\n /** Handler called when hover starts. */\n onHoverStart?: () => void;\n /** Handler called when hover ends. */\n onHoverEnd?: () => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n /** Ref for the menu item element (a `<div>`, or an `<a>` for link items). */\n ref?: RefLike<HTMLElement>;\n /** Custom renderer for the menu item element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLElement>,\n renderProps: MenuItemRenderProps,\n ) => JSX.Element;\n}\n\nexport interface MenuTriggerRenderProps {\n /** Whether the menu is open. */\n isOpen: boolean;\n /** Whether the trigger is focused. */\n isFocused: boolean;\n /** Whether the trigger has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the trigger is pressed. */\n isPressed: boolean;\n /** Whether the trigger is hovered. */\n isHovered: boolean;\n /** Whether the trigger is disabled. */\n isDisabled: boolean;\n}\n\nexport interface MenuTriggerProps extends Omit<AriaMenuTriggerProps, \"children\">, SlotProps {\n /** The children of the trigger (typically a Button and Menu). */\n children: JSX.Element;\n /** Whether the menu trigger is disabled. */\n isDisabled?: boolean;\n /** Whether the menu is open by default. */\n defaultOpen?: boolean;\n /** Whether the menu is open (controlled). */\n isOpen?: boolean;\n /** Handler called when the open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nexport interface SubmenuTriggerProps extends SlotProps {\n /** The trigger item followed by submenu content. */\n children: JSX.Element;\n /** Delay before opening the submenu on hover. */\n delay?: number;\n /** Whether the submenu is open (controlled). */\n isOpen?: boolean;\n /** Whether the submenu is open by default. */\n defaultOpen?: boolean;\n /** Handler called when the submenu open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\ninterface MenuContextValue<T> {\n state: MenuState<T>;\n isDisabled: () => boolean;\n dragAndDropHooks?: DragAndDropHooks<T>;\n dragState?: unknown;\n dropState?: unknown;\n}\n\ntype MenuSelectionEvent = { shiftKey?: boolean; ctrlKey?: boolean; metaKey?: boolean };\n\ninterface MenuTriggerContextValue {\n state: MenuTriggerState;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: MenuTriggerMenuProps;\n triggerRef?: () => HTMLElement | null;\n setTriggerRef?: (element: HTMLElement | null) => void;\n isDisabled?: () => boolean;\n isPressed?: () => boolean;\n onPressStart?: (e: { pointerType?: string }) => void;\n}\n\ninterface MenuItemContextValue {\n props?: () => JSX.HTMLAttributes<HTMLElement>;\n closeOnSelect?: boolean;\n onAction?: () => void;\n setItemRef?: (el: HTMLElement | null) => void;\n}\n\ninterface StaticMenuCollectionItem {\n id: Key;\n textValue?: string;\n isDisabled?: boolean;\n}\n\ninterface StaticMenuCollectionContextValue {\n registerItem(item: StaticMenuCollectionItem): void;\n unregisterItem(id: Key): void;\n}\n\ninterface MenuSectionSelectionContextValue {\n selectionMode: () => SelectionMode;\n isSelected(key: Key): boolean;\n isDisabled(key: Key): boolean;\n select(key: Key, event?: MenuSelectionEvent): void;\n shouldCloseOnSelect(): boolean | undefined;\n}\n\ninterface MenuSectionSelectionRegistryContextValue {\n registerItem(key: Key, selection: MenuSectionSelectionContextValue): void;\n unregisterItem(key: Key, selection: MenuSectionSelectionContextValue): void;\n selectItem(key: Key, event?: MenuSelectionEvent): boolean;\n}\n\ninterface MenuItemCloseRegistryContextValue {\n registerItem(key: Key, shouldCloseOnSelect: () => boolean | undefined): void;\n unregisterItem(key: Key, shouldCloseOnSelect: () => boolean | undefined): void;\n shouldCloseOnSelect(key: Key | null): boolean | undefined;\n}\n\nexport const MenuContext = createContext<MenuContextValue<unknown> | null>(null);\nexport const MenuStateContext = createContext<MenuState<unknown> | null>(null);\nexport const MenuTriggerContext = createContext<MenuTriggerContextValue | null>(null);\nexport const RootMenuTriggerStateContext = createContext<MenuTriggerState | null>(null);\nconst MenuItemContext = createContext<MenuItemContextValue | null>(null);\nconst StaticMenuCollectionContext = createContext<StaticMenuCollectionContextValue | null>(null);\nconst MenuSectionSelectionContext = createContext<MenuSectionSelectionContextValue | null>(null);\nconst MenuSectionSelectionRegistryContext =\n createContext<MenuSectionSelectionRegistryContextValue | null>(null);\nconst MenuItemCloseRegistryContext = createContext<MenuItemCloseRegistryContextValue | null>(null);\n\nfunction resolveBoolean(value: unknown): boolean {\n return typeof value === \"function\" ? Boolean((value as () => unknown)()) : Boolean(value);\n}\n\n/**\n * A menu trigger wraps a button and menu, handling the open/close state.\n */\nexport function MenuTrigger(props: MenuTriggerProps): JSX.Element {\n const [local, stateProps] = splitProps(props, [\"slot\"]);\n\n const state = createMenuTriggerState({\n get isOpen() {\n return stateProps.isOpen;\n },\n get defaultOpen() {\n return stateProps.defaultOpen;\n },\n get onOpenChange() {\n return stateProps.onOpenChange;\n },\n get trigger() {\n return stateProps.trigger;\n },\n });\n\n const [triggerRef, setTriggerRef] = createSignal<HTMLElement | null>(null);\n\n const [isMousePressed, setMousePressed] = createSignal(false);\n const onPressStart = (e: { pointerType?: string }) => {\n if (e.pointerType !== \"mouse\" || typeof document === \"undefined\") {\n return;\n }\n\n setMousePressed(true);\n document.addEventListener(\n \"pointerup\",\n () => {\n setMousePressed(false);\n },\n { once: true, capture: true },\n );\n };\n\n const menuTrigger = createMenuTrigger(\n {\n get isDisabled() {\n return stateProps.isDisabled;\n },\n get type() {\n return stateProps.type;\n },\n get trigger() {\n return stateProps.trigger;\n },\n },\n state,\n triggerRef,\n );\n\n return (\n <RootMenuTriggerStateContext value={state}>\n <MenuTriggerContext\n value={{\n state,\n get triggerProps() {\n return menuTrigger.menuTriggerProps;\n },\n get menuProps() {\n return menuTrigger.menuProps;\n },\n triggerRef,\n setTriggerRef,\n isDisabled: () => Boolean(stateProps.isDisabled),\n isPressed: isMousePressed,\n onPressStart,\n }}\n >\n <PopoverTriggerContext\n value={{\n state,\n triggerRef,\n setTriggerRef,\n triggerId: String(menuTrigger.menuTriggerProps.id),\n trigger: \"MenuTrigger\",\n get triggerProps() {\n return mergeProps(menuTrigger.menuTriggerProps, {\n onPressStart: (event: { pointerType?: string }) => {\n onPressStart(event);\n (\n menuTrigger.menuTriggerProps.onPressStart as\n | ((event: { pointerType?: string }) => void)\n | undefined\n )?.(event);\n },\n }) as unknown as Record<string, unknown>;\n },\n // RAC MenuTrigger PopoverContext (`Menu.tsx:161`) names the overlay\n // dialog from the trigger. Without this, name-from-contents concatenates\n // every menuitem (Menu/ActionMenu D2 `target.name`).\n get overlayProps() {\n return {\n \"aria-labelledby\": menuTrigger.menuProps[\"aria-labelledby\"],\n };\n },\n }}\n >\n {props.children}\n </PopoverTriggerContext>\n </MenuTriggerContext>\n </RootMenuTriggerStateContext>\n );\n}\n\nexport function SubmenuTrigger(props: SubmenuTriggerProps): JSX.Element {\n const children = () =>\n (Array.isArray(props.children) ? props.children : [props.children]) as JSX.Element[];\n const trigger = () => children()[0];\n const content = () => children()[1];\n const parentMenuItemContext = useContext(MenuItemContext);\n const locale = useLocale();\n const state = createMenuTriggerState({\n get isOpen() {\n return props.isOpen;\n },\n get defaultOpen() {\n return props.defaultOpen;\n },\n get onOpenChange() {\n return props.onOpenChange;\n },\n });\n\n let triggerRef: HTMLElement | null = null;\n const triggerId = createUniqueId();\n const menuId = createUniqueId();\n let hoverTimeout: number | undefined;\n let hasPointerHover = false;\n const delay = () => props.delay ?? 200;\n\n const clearHoverTimeout = () => {\n if (hoverTimeout != null) {\n window.clearTimeout(hoverTimeout);\n hoverTimeout = undefined;\n }\n };\n\n const openSubmenu = () => {\n clearHoverTimeout();\n state.open();\n };\n\n const queueOpenSubmenu = () => {\n clearHoverTimeout();\n const open = () => state.open();\n if (typeof queueMicrotask === \"function\") {\n queueMicrotask(open);\n } else {\n Promise.resolve().then(open);\n }\n };\n\n const scheduleOpen = () => {\n clearHoverTimeout();\n hoverTimeout = window.setTimeout(() => {\n hoverTimeout = undefined;\n state.open();\n }, delay());\n };\n\n const schedulePointerOpen = (event: PointerEvent) => {\n hasPointerHover = true;\n if (event.isTrusted === false) {\n queueOpenSubmenu();\n return;\n }\n\n scheduleOpen();\n };\n\n const openFromMouseHover = () => {\n if (state.isOpen()) {\n return;\n }\n\n if (hasPointerHover) {\n scheduleOpen();\n } else {\n queueOpenSubmenu();\n }\n };\n\n onCleanup(clearHoverTimeout);\n\n const menuTriggerContext = createMemo<MenuTriggerContextValue>(() => ({\n state,\n triggerProps: {},\n menuProps: {\n id: menuId,\n \"aria-labelledby\": triggerId,\n },\n }));\n\n const popoverTriggerContext = createMemo(() => ({\n state: {\n isOpen: () => state.isOpen(),\n open: () => state.open(),\n close: () => state.close(),\n toggle: () => state.toggle(),\n },\n triggerRef: () => triggerRef,\n setTriggerRef: (el: HTMLElement | null) => {\n triggerRef = el;\n },\n triggerId,\n trigger: \"SubmenuTrigger\",\n // RAC SubmenuTrigger PopoverContext (`Menu.tsx:255`) names the nested\n // overlay from the trigger item.\n overlayProps: {\n \"aria-labelledby\": triggerId,\n },\n }));\n\n const itemContext = createMemo<MenuItemContextValue>(() => ({\n closeOnSelect: false,\n onAction: () => openSubmenu(),\n setItemRef: (el) => {\n triggerRef = el;\n },\n props: () => ({\n id: triggerId,\n \"aria-haspopup\": \"menu\",\n get \"aria-expanded\"() {\n return state.isOpen() ? (\"true\" as const) : undefined;\n },\n get \"aria-controls\"() {\n return state.isOpen() ? menuId : undefined;\n },\n onPointerEnter: (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n schedulePointerOpen(event);\n },\n onPointerOver: (event: PointerEvent) => {\n if (event.pointerType === \"touch\") return;\n schedulePointerOpen(event);\n },\n onMouseEnter: openFromMouseHover,\n onMouseOver: openFromMouseHover,\n onKeyDown: (event: KeyboardEvent) => {\n const openKey = locale().direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n const closeKey = locale().direction === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\";\n if (event.key === openKey || event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n openSubmenu();\n } else if (event.key === closeKey && state.isOpen()) {\n event.preventDefault();\n state.close();\n }\n },\n }),\n }));\n\n return (\n <PopoverTriggerContext value={popoverTriggerContext()}>\n <MenuTriggerContext value={menuTriggerContext()}>\n <MenuItemContext value={{ ...parentMenuItemContext, ...itemContext() }}>\n {trigger()}\n </MenuItemContext>\n {content()}\n </MenuTriggerContext>\n </PopoverTriggerContext>\n );\n}\n\nexport interface MenuSectionProps\n extends\n SectionProps,\n Pick<\n SelectionStateProps,\n | \"selectionMode\"\n | \"selectionBehavior\"\n | \"disallowEmptySelection\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"disabledKeys\"\n | \"disabledBehavior\"\n | \"allowDuplicateSelectionEvents\"\n > {\n /** Whether menu items in this section should close the menu when selected. */\n shouldCloseOnSelect?: boolean;\n}\n\n/**\n * A menu displays a list of actions or options for the user to choose from.\n */\nexport function Menu<T>(props: MenuProps<T>): JSX.Element {\n const [local, stateProps, ariaProps] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"render\", \"slot\", \"renderEmptyState\", \"ref\", \"staticChildren\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"selectionMode\",\n \"selectionBehavior\",\n \"disallowEmptySelection\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"allowDuplicateSelectionEvents\",\n \"onAction\",\n \"onClose\",\n \"shouldCloseOnSelect\",\n \"dragAndDropHooks\",\n ],\n );\n\n const triggerContext = useContext(MenuTriggerContext);\n const popoverTriggerContext = useContext(PopoverTriggerContext);\n const overlayContext = useContext(OverlayContext);\n const locale = useLocale();\n\n const [menuRef, setMenuRef] = createSignal<HTMLDivElement | null>(null);\n const [staticItems, setStaticItems] = createSignal<StaticMenuCollectionItem[]>([], {\n ownedWrite: true,\n });\n const staticItemMap = new Map<Key, StaticMenuCollectionItem>();\n const sectionSelectionMap = new Map<Key, MenuSectionSelectionContextValue>();\n const itemCloseMap = new Map<Key, () => boolean | undefined>();\n const usesStaticChildren = () => local.staticChildren != null || stateProps.items == null;\n\n const syncStaticItems = () => {\n setStaticItems(Array.from(staticItemMap.values()));\n };\n\n const staticCollectionContext: StaticMenuCollectionContextValue = {\n registerItem(item) {\n const previous = staticItemMap.get(item.id);\n if (\n previous &&\n previous.textValue === item.textValue &&\n previous.isDisabled === item.isDisabled\n ) {\n return;\n }\n\n staticItemMap.set(item.id, item);\n syncStaticItems();\n },\n unregisterItem(id) {\n if (staticItemMap.delete(id)) {\n syncStaticItems();\n }\n },\n };\n const sectionSelectionRegistry: MenuSectionSelectionRegistryContextValue = {\n registerItem(key, selection) {\n sectionSelectionMap.set(key, selection);\n },\n unregisterItem(key, selection) {\n if (sectionSelectionMap.get(key) === selection) {\n sectionSelectionMap.delete(key);\n }\n },\n selectItem(key, event) {\n const selection = sectionSelectionMap.get(key);\n if (!selection || selection.selectionMode() === \"none\") {\n return false;\n }\n\n selection.select(key, event);\n return true;\n },\n };\n const itemCloseRegistry: MenuItemCloseRegistryContextValue = {\n registerItem(key, shouldCloseOnSelect) {\n itemCloseMap.set(key, shouldCloseOnSelect);\n },\n unregisterItem(key, shouldCloseOnSelect) {\n if (itemCloseMap.get(key) === shouldCloseOnSelect) {\n itemCloseMap.delete(key);\n }\n },\n shouldCloseOnSelect(key) {\n return key == null ? undefined : itemCloseMap.get(key)?.();\n },\n };\n const handleAction = (key: Key, value?: T) => {\n sectionSelectionRegistry.selectItem(key);\n // Forward the activated item's value, which `createMenuState` sets from the\n // collection node. For dynamic collections this is the user's data item.\n // Static children are modeled with an internal item descriptor that upstream\n // RAC does not expose as `value` (MenuItem only carries `value` for dynamic\n // collections), so it is suppressed there to match.\n stateProps.onAction?.(key, (usesStaticChildren() ? undefined : value) as T);\n };\n\n const flatItems = createMemo<T[]>(() => {\n return flattenCollectionEntries(stateProps.items ?? []);\n });\n\n const hasSections = createMemo(() =>\n (stateProps.items ?? []).some((item) => isCollectionSection(item)),\n );\n\n const state = createMenuState<T>({\n get items() {\n return usesStaticChildren() ? (staticItems() as T[]) : flatItems();\n },\n get getKey() {\n return usesStaticChildren()\n ? (item: T) => (item as StaticMenuCollectionItem).id\n : stateProps.getKey;\n },\n get getTextValue() {\n return usesStaticChildren()\n ? (item: T) =>\n (item as StaticMenuCollectionItem).textValue ??\n String((item as StaticMenuCollectionItem).id)\n : stateProps.getTextValue;\n },\n get getDisabled() {\n return usesStaticChildren()\n ? (item: T) => Boolean((item as StaticMenuCollectionItem).isDisabled)\n : stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get disabledBehavior() {\n return stateProps.disabledBehavior;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectionBehavior() {\n return stateProps.selectionBehavior;\n },\n get disallowEmptySelection() {\n return stateProps.disallowEmptySelection;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get allowDuplicateSelectionEvents() {\n return stateProps.allowDuplicateSelectionEvents;\n },\n get onAction() {\n return handleAction;\n },\n get onClose() {\n return stateProps.onClose ?? (() => triggerContext?.state.close());\n },\n });\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const { menuProps, labelProps } = createMenu(\n {\n get isDisabled() {\n return resolveDisabled();\n },\n get label() {\n return ariaProps.label;\n },\n get autoFocus() {\n return ariaProps.autoFocus ?? triggerContext?.menuProps.autoFocus;\n },\n get onAction() {\n return handleAction;\n },\n get onClose() {\n return (\n stateProps.onClose ??\n triggerContext?.menuProps.onClose ??\n (() => triggerContext?.state.close())\n );\n },\n get shouldCloseOnSelect() {\n return (\n itemCloseRegistry.shouldCloseOnSelect(state.focusedKey()) ??\n stateProps.shouldCloseOnSelect\n );\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n },\n state,\n () => menuRef(),\n );\n\n // Reveal the activedescendant-focused item on keyboard navigation. The menu\n // keeps real DOM focus on itself, so the browser won't natively scroll an\n // off-screen focused item into view the way roving tabindex would.\n createScrollIntoViewOnFocus({\n focusedKey: () => state.focusedKey(),\n isActive: () => state.isFocused(),\n ref: () => menuRef(),\n });\n\n const { isFocused, focusProps } = createFocusRing();\n\n createInteractOutside({\n ref: () => menuRef(),\n onInteractOutside: () => {\n if (triggerContext?.state.isOpen()) {\n triggerContext.state.close();\n }\n },\n get isDisabled() {\n return !triggerContext?.state.isOpen();\n },\n });\n\n const renderValues = createMemo<MenuRenderProps>(() => ({\n isFocused: state.isFocused() || isFocused(),\n isOpen: triggerContext?.state.isOpen() ?? true,\n isEmpty: state.collection().size === 0,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Menu\",\n },\n renderValues,\n );\n\n const cleanMenuProps = () => {\n const { ref: _ref1, ...rest } = menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanTriggerMenuProps = () => {\n if (!triggerContext) return {};\n const {\n ref: _ref2,\n autoFocus: _autoFocus,\n onClose: _onClose,\n \"aria-labelledby\": triggerLabelledBy,\n ...rest\n } = triggerContext.menuProps as Record<string, unknown>;\n\n if (triggerLabelledBy && popoverTriggerContext?.trigger === \"SubmenuTrigger\") {\n // SubmenuTrigger names the nested menu from the trigger item. That\n // labelledby must win over a Menu-level aria-label.\n rest[\"aria-labelledby\"] = triggerLabelledBy;\n } else if (!ariaProps.label && !ariaProps[\"aria-label\"] && !ariaProps[\"aria-labelledby\"]) {\n rest[\"aria-labelledby\"] = triggerLabelledBy;\n }\n\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const domProps = createMemo(() =>\n filterDOMProps(ariaProps as Record<string, unknown>, { global: true }),\n );\n const cleanLabelProps = () => {\n const { ref: _ref4, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const setResolvedMenuRef = (el: HTMLDivElement): void => {\n setMenuRef(el);\n assignRef(local.ref, el);\n };\n\n const parentCollectionRenderer = useCollectionRenderer<unknown>();\n const virtualizer = useVirtualizerContext();\n const getItemNodes = createMemo(() =>\n Array.from(state.collection()).filter((node) => node.type === \"item\"),\n );\n const getDropTargetByIndex = (\n index: number,\n position: \"before\" | \"after\" | \"on\",\n ): DropTarget | null => {\n const node = getItemNodes()[index];\n if (!node) return null;\n return { type: \"item\", key: node.key, dropPosition: position };\n };\n const hasDroppableDnd = createMemo(() => {\n const hooks = stateProps.dragAndDropHooks;\n return Boolean(\n hooks?.useDroppableCollectionState &&\n hooks.useDroppableCollection &&\n (hooks.dropTargetDelegate ||\n parentCollectionRenderer?.dropTargetDelegate ||\n hooks.ListDropTargetDelegate),\n );\n });\n const hasDraggableDnd = createMemo(() => {\n const hooks = stateProps.dragAndDropHooks;\n return Boolean(hooks?.useDraggableCollectionState && hooks.useDraggableCollection);\n });\n const dragStateValue = hasDraggableDnd()\n ? stateProps.dragAndDropHooks?.useDraggableCollectionState?.({\n items: flatItems(),\n collection: state.collection(),\n selectedKeys: state.selectionManager.selectedKeys,\n isSelected: (key) => state.selectionManager.isSelected(key),\n })\n : undefined;\n const dragState = () => dragStateValue;\n const dropStateValue = hasDroppableDnd()\n ? stateProps.dragAndDropHooks?.useDroppableCollectionState?.({\n get collection() {\n return state.collection();\n },\n })\n : undefined;\n const dropState = () => dropStateValue;\n const persistedKeys = useDndPersistedKeys(\n { focusedKey: state.focusedKey },\n stateProps.dragAndDropHooks,\n dropState(),\n state.collection(),\n );\n const virtualRange = createMemo(() => {\n if (!virtualizer || !parentCollectionRenderer?.isVirtualized || hasSections()) return null;\n const dynamicItems = stateProps.items ?? [];\n const baseRange = virtualizer.getVisibleRange(dynamicItems.length);\n const itemNodes = getItemNodes();\n const dropTarget = dropState()?.target;\n const normalizedDropKey = getNormalizedDropTargetKey(dropTarget, state.collection());\n const forceIncludeIndexes = [\n dropTarget?.type === \"item\" ? itemNodes.findIndex((node) => node.key === dropTarget.key) : -1,\n normalizedDropKey != null\n ? itemNodes.findIndex((node) => node.key === normalizedDropKey)\n : -1,\n ].filter((index) => index >= 0);\n return mergePersistedKeysIntoVirtualRange(baseRange, [], dynamicItems.length, virtualizer, 80, {\n forceIncludeIndexes,\n forceIncludeMaxSpan: 320,\n });\n });\n const persistedOutsideIndexes = createMemo(() => {\n const range = virtualRange();\n if (!range) return [] as number[];\n const itemNodes = getItemNodes();\n const persistedIndexes = Array.from(persistedKeys())\n .map((key) => itemNodes.findIndex((node) => node.key === key))\n .filter((index) => index >= 0);\n return indexesOutsideRange(range, persistedIndexes);\n });\n const visibleItems = createMemo(() => {\n const range = virtualRange();\n const items = stateProps.items ?? [];\n if (!range) return items;\n return items.slice(range.start, range.end);\n });\n if (stateProps.dragAndDropHooks?.useDraggableCollection && dragStateValue) {\n stateProps.dragAndDropHooks.useDraggableCollection({}, dragStateValue, () => menuRef());\n }\n const droppableCollectionValue = (() => {\n if (!hasDroppableDnd()) return undefined;\n const hooks = stateProps.dragAndDropHooks;\n const activeDropState = dropStateValue;\n if (!hooks?.useDroppableCollection || !activeDropState) return undefined;\n const resolveDirection = (): \"ltr\" | \"rtl\" => locale().direction;\n const dropTargetDelegate =\n hooks.dropTargetDelegate ??\n parentCollectionRenderer?.dropTargetDelegate ??\n (hooks.ListDropTargetDelegate\n ? new hooks.ListDropTargetDelegate(\n () => state.collection(),\n () => menuRef(),\n { layout: \"stack\", orientation: \"vertical\", direction: resolveDirection() },\n )\n : undefined);\n if (!dropTargetDelegate) return undefined;\n return hooks.useDroppableCollection(\n {\n dropTargetDelegate,\n keyboardDelegate: {\n getFirstKey: () => state.collection().getFirstKey(),\n getLastKey: () => state.collection().getLastKey(),\n getKeyBelow: (key) => state.collection().getKeyAfter(key),\n getKeyAbove: (key) => state.collection().getKeyBefore(key),\n getKeyPageBelow: (key) => state.collection().getKeyAfter(key),\n getKeyPageAbove: (key) => state.collection().getKeyBefore(key),\n },\n },\n activeDropState,\n () => menuRef(),\n );\n })();\n const droppableCollection = () => droppableCollectionValue;\n const isRootDropTarget = createMemo(() => {\n return Boolean(dropState()?.target?.type === \"root\");\n });\n const dndRenderDropIndicator = createMemo(() =>\n useRenderDropIndicator(stateProps.dragAndDropHooks, dropState()),\n );\n const dndDropIndicator = (index: number, position: \"before\" | \"after\" | \"on\") => {\n const target = getDropTargetByIndex(index, position);\n if (!target || target.type !== \"item\") return undefined;\n return dndRenderDropIndicator()?.(target);\n };\n const sectionedRenderEntries = createMemo(() => {\n let globalIndex = 0;\n return (stateProps.items ?? []).map((entry) => {\n if (isCollectionSection(entry)) {\n const sectionItems = entry.items.map((item) => ({\n item,\n index: globalIndex++,\n }));\n return {\n type: \"section\" as const,\n section: entry,\n items: sectionItems,\n };\n }\n const indexedItem = {\n item: entry as T,\n index: globalIndex++,\n };\n return {\n type: \"item\" as const,\n item: indexedItem,\n };\n });\n });\n const renderDynamicItem = (item: T) =>\n typeof local.children === \"function\" ? local.children(item) : undefined;\n const resolveStaticChild = (child: unknown): JSX.Element | undefined => {\n return typeof child === \"function\"\n ? (child as () => JSX.Element | undefined)()\n : (child as JSX.Element | undefined);\n };\n const renderStaticChildren = () => {\n const staticChildren = (local.staticChildren?.() ?? local.children) as unknown;\n if (Array.isArray(staticChildren)) {\n return staticChildren.map(resolveStaticChild);\n }\n return resolveStaticChild(staticChildren);\n };\n const collectionRenderer = createMemo<CollectionRendererContextValue<unknown>>(() => ({\n ...parentCollectionRenderer,\n renderItem: (item) => renderDynamicItem(item as T),\n renderDropIndicator: (index, position) =>\n dndDropIndicator(index, position) ??\n parentCollectionRenderer?.renderDropIndicator?.(index, position),\n }));\n const CollectionRoot = useCollectionRoot();\n const menuItemContextValue = createMemo<MenuItemContextValue>(() =>\n stateProps.shouldCloseOnSelect !== undefined\n ? { closeOnSelect: stateProps.shouldCloseOnSelect }\n : {},\n );\n const menuListChildren = () => (\n <SharedElementTransition>\n {parentCollectionRenderer?.isVirtualized ? (\n <CollectionRoot\n collection={virtualRange() ? (stateProps.items ?? []) : []}\n scrollRef={() => menuRef()}\n persistedKeys={persistedKeys()}\n >\n {usesStaticChildren() ? (\n renderStaticChildren()\n ) : hasSections() ? (\n <For each={sectionedRenderEntries()}>\n {(entry) =>\n entry.type === \"section\" ? (\n <div role=\"presentation\" data-section-wrapper>\n <Section class=\"solidaria-Menu-section\">\n {entry.section.title != null && (\n <Header class=\"solidaria-Menu-sectionHeader\">{entry.section.title}</Header>\n )}\n <Group class=\"solidaria-Menu-sectionGroup\">\n <div role=\"group\" aria-label={entry.section[\"aria-label\"]}>\n <For each={entry.items}>\n {(indexedItem) =>\n renderCollectionDropSlots({\n index: indexedItem.index,\n lastIndex: getItemNodes().length - 1,\n renderDropIndicator: (i, position) =>\n collectionRenderer().renderDropIndicator?.(i, position),\n children: renderDynamicItem(indexedItem.item),\n })\n }\n </For>\n </div>\n </Group>\n </Section>\n </div>\n ) : (\n renderCollectionDropSlots({\n index: entry.item.index,\n lastIndex: getItemNodes().length - 1,\n renderDropIndicator: (i, position) =>\n collectionRenderer().renderDropIndicator?.(i, position),\n children: renderDynamicItem(entry.item.item),\n })\n )\n }\n </For>\n ) : (\n <>\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n return renderCollectionDropSlots({\n index: itemIndex(),\n lastIndex: getItemNodes().length - 1,\n renderDropIndicator: (i, position) =>\n collectionRenderer().renderDropIndicator?.(i, position),\n children: renderDynamicItem(item as T),\n });\n }}\n </For>\n <For each={persistedOutsideIndexes()}>\n {(index) => (\n <PersistedVirtualItem index={index}>\n {renderCollectionDropSlots({\n index,\n lastIndex: getItemNodes().length - 1,\n renderDropIndicator: (i, position) =>\n collectionRenderer().renderDropIndicator?.(i, position),\n children: renderDynamicItem((stateProps.items ?? [])[index] as T),\n })}\n </PersistedVirtualItem>\n )}\n </For>\n </>\n )}\n </CollectionRoot>\n ) : usesStaticChildren() ? (\n renderStaticChildren()\n ) : hasSections() ? (\n <For each={sectionedRenderEntries()}>\n {(entry) =>\n entry.type === \"section\" ? (\n <div role=\"presentation\" data-section-wrapper>\n <Section class=\"solidaria-Menu-section\">\n {entry.section.title != null && (\n <Header class=\"solidaria-Menu-sectionHeader\">{entry.section.title}</Header>\n )}\n <Group class=\"solidaria-Menu-sectionGroup\">\n <div role=\"group\" aria-label={entry.section[\"aria-label\"]}>\n <For each={entry.items}>\n {(indexedItem) =>\n renderCollectionDropSlots({\n index: indexedItem.index,\n lastIndex: getItemNodes().length - 1,\n renderDropIndicator: (i, position) =>\n collectionRenderer().renderDropIndicator?.(i, position),\n children: renderDynamicItem(indexedItem.item),\n })\n }\n </For>\n </div>\n </Group>\n </Section>\n </div>\n ) : (\n renderCollectionDropSlots({\n index: entry.item.index,\n lastIndex: getItemNodes().length - 1,\n renderDropIndicator: (i, position) =>\n collectionRenderer().renderDropIndicator?.(i, position),\n children: renderDynamicItem(entry.item.item),\n })\n )\n }\n </For>\n ) : (\n <>\n <For each={visibleItems()}>\n {(item, index) => {\n const itemIndex = () => (virtualRange()?.start ?? 0) + index();\n return renderCollectionDropSlots({\n index: itemIndex(),\n lastIndex: getItemNodes().length - 1,\n renderDropIndicator: (i, position) =>\n collectionRenderer().renderDropIndicator?.(i, position),\n children: renderDynamicItem(item as T),\n });\n }}\n </For>\n </>\n )}\n {state.collection().size === 0 && local.renderEmptyState ? (\n <div role=\"presentation\" data-empty-state>\n <div role=\"menuitem\" style={{ display: \"contents\" }}>\n {local.renderEmptyState()}\n </div>\n </div>\n ) : null}\n </SharedElementTransition>\n );\n const menuListProps = () =>\n ({\n ref: setResolvedMenuRef,\n ...mergeProps(\n domProps(),\n cleanMenuProps(),\n cleanTriggerMenuProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-focused\": dataAttr(state.isFocused()),\n \"data-disabled\": dataAttr(resolveDisabled()),\n \"data-empty\": dataAttr(state.collection().size === 0),\n \"data-drop-target\": dataAttr(isRootDropTarget()),\n children: menuListChildren(),\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n\n const menuContent = () => (\n <MenuContext\n value={\n {\n state,\n isDisabled: resolveDisabled,\n dragAndDropHooks: stateProps.dragAndDropHooks,\n dragState: dragState(),\n dropState: dropState(),\n } as MenuContextValue<unknown>\n }\n >\n <MenuStateContext value={state}>\n <MenuSectionSelectionRegistryContext value={sectionSelectionRegistry}>\n <MenuItemCloseRegistryContext value={itemCloseRegistry}>\n <StaticMenuCollectionContext\n value={usesStaticChildren() ? staticCollectionContext : null}\n >\n <MenuItemContext value={menuItemContextValue()}>\n <CollectionRendererContext value={collectionRenderer()}>\n <>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n {local.render ? (\n local.render(menuListProps(), renderValues())\n ) : (\n <div\n ref={setResolvedMenuRef}\n {...mergeProps(\n domProps(),\n cleanMenuProps(),\n cleanTriggerMenuProps(),\n cleanFocusProps(),\n (droppableCollection()?.collectionProps as\n | Record<string, unknown>\n | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-focused={dataAttr(state.isFocused())}\n data-disabled={dataAttr(resolveDisabled())}\n data-empty={dataAttr(state.collection().size === 0)}\n data-drop-target={dataAttr(isRootDropTarget())}\n >\n {menuListChildren()}\n </div>\n )}\n </>\n </CollectionRendererContext>\n </MenuItemContext>\n </StaticMenuCollectionContext>\n </MenuItemCloseRegistryContext>\n </MenuSectionSelectionRegistryContext>\n </MenuStateContext>\n </MenuContext>\n );\n\n // RAC MenuInner always renders and uses a plain FocusScope. Popover's\n // `isOpen || isExiting` gate owns lifetime. Gating on isOpen here dropped\n // role=\"menu\" during exit so ArrowUp reused the same instance\n // (menu-focus.spec.ts:20). Headless tests that put Menu directly in\n // MenuTrigger without a Popover still need the isOpen gate and trigger\n // restore — OverlayContext is how we tell the two compositions apart.\n const shouldRender = () =>\n overlayContext != null || !triggerContext ? true : triggerContext.state.isOpen();\n\n return (\n <Show when={shouldRender()}>\n {overlayContext != null || !triggerContext ? (\n <FocusScope>{menuContent()}</FocusScope>\n ) : (\n <FocusScope restoreFocus>{menuContent()}</FocusScope>\n )}\n </Show>\n );\n}\n\n/**\n * An item in a menu.\n */\nexport function MenuItem<T>(props: MenuItemProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"render\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"onAction\",\n \"href\",\n \"target\",\n \"rel\",\n \"download\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n \"ref\",\n ]);\n\n const context = useContext(MenuStateContext);\n if (!context) {\n throw new Error(\"MenuItem must be used within a Menu\");\n }\n const state = context as MenuState<T>;\n const menuContext = useContext(MenuContext) as MenuContextValue<T> | null;\n const itemContext = useContext(MenuItemContext);\n const staticCollection = useContext(StaticMenuCollectionContext);\n const sectionSelection = useContext(MenuSectionSelectionContext);\n const sectionSelectionRegistry = useContext(MenuSectionSelectionRegistryContext);\n const itemCloseRegistry = useContext(MenuItemCloseRegistryContext);\n // Tracks the focusable menuitem element (the <div>, or the <a> for link\n // items) so roving focus can be moved onto it imperatively.\n const [ref, setRef] = createSignal<HTMLElement | null>(null);\n const contextProps = () => itemContext?.props?.() ?? {};\n const combinedOnAction = () => {\n local.onAction?.();\n itemContext?.onAction?.();\n };\n const itemCloseOnSelect = () =>\n ariaProps.closeOnSelect ??\n sectionSelection?.shouldCloseOnSelect() ??\n itemContext?.closeOnSelect;\n const activeSectionSelection = () =>\n sectionSelection && sectionSelection.selectionMode() !== \"none\" ? sectionSelection : null;\n let registeredStaticKey: Key | null = null;\n let registeredSectionSelectionKey: Key | null = null;\n let registeredSectionSelection: MenuSectionSelectionContextValue | null = null;\n let registeredCloseKey: Key | null = null;\n let registeredCloseAccessor: (() => boolean | undefined) | null = null;\n\n const unregisterSectionSelection = () => {\n if (registeredSectionSelectionKey != null && registeredSectionSelection) {\n sectionSelectionRegistry?.unregisterItem(\n registeredSectionSelectionKey,\n registeredSectionSelection,\n );\n registeredSectionSelectionKey = null;\n registeredSectionSelection = null;\n }\n };\n\n createEffect(\n () => {\n if (!staticCollection) return null;\n return {\n id: local.id,\n textValue: local.textValue ?? ariaProps[\"aria-label\"],\n isDisabled:\n resolveBoolean(ariaProps.isDisabled) || (sectionSelection?.isDisabled(local.id) ?? false),\n };\n },\n (item) => {\n if (!staticCollection || !item) return;\n if (registeredStaticKey != null && registeredStaticKey !== item.id) {\n staticCollection.unregisterItem(registeredStaticKey);\n }\n registeredStaticKey = item.id;\n staticCollection.registerItem(item);\n },\n );\n\n onCleanup(() => {\n if (registeredStaticKey != null) {\n staticCollection?.unregisterItem(registeredStaticKey);\n }\n });\n\n createEffect(\n () => ({\n selection: activeSectionSelection(),\n id: local.id,\n }),\n ({ selection, id }) => {\n if (!sectionSelectionRegistry || !selection) {\n unregisterSectionSelection();\n return;\n }\n\n if (registeredSectionSelectionKey === id && registeredSectionSelection === selection) {\n return;\n }\n\n unregisterSectionSelection();\n registeredSectionSelectionKey = id;\n registeredSectionSelection = selection;\n sectionSelectionRegistry.registerItem(id, selection);\n },\n );\n\n onCleanup(unregisterSectionSelection);\n\n const unregisterItemClose = () => {\n if (registeredCloseKey != null && registeredCloseAccessor) {\n itemCloseRegistry?.unregisterItem(registeredCloseKey, registeredCloseAccessor);\n registeredCloseKey = null;\n registeredCloseAccessor = null;\n }\n };\n\n createEffect(\n () => ({\n id: local.id,\n shouldClose: itemCloseOnSelect,\n registry: itemCloseRegistry,\n }),\n ({ id, shouldClose, registry }) => {\n if (!registry) {\n unregisterItemClose();\n return;\n }\n\n if (registeredCloseKey === id && registeredCloseAccessor === shouldClose) {\n return;\n }\n\n unregisterItemClose();\n registeredCloseKey = id;\n registeredCloseAccessor = shouldClose;\n registry.registerItem(id, shouldClose);\n },\n );\n\n onCleanup(unregisterItemClose);\n\n const itemAria = createMenuItem<T>(\n {\n key: local.id,\n get id() {\n return contextProps().id as string | undefined;\n },\n get isDisabled() {\n return Boolean(\n ariaProps.isDisabled ||\n sectionSelection?.isDisabled(local.id) ||\n menuContext?.isDisabled(),\n );\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n get \"aria-controls\"() {\n return contextProps()[\"aria-controls\"] as string | undefined;\n },\n get \"aria-haspopup\"() {\n return contextProps()[\"aria-haspopup\"] as string | boolean | undefined;\n },\n get \"aria-expanded\"() {\n return contextProps()[\"aria-expanded\"] as boolean | \"true\" | \"false\" | undefined;\n },\n get onAction() {\n return combinedOnAction;\n },\n get closeOnSelect() {\n return itemCloseOnSelect();\n },\n get href() {\n return local.href;\n },\n get target() {\n return local.target;\n },\n get rel() {\n return local.rel;\n },\n get download() {\n return local.download;\n },\n },\n state,\n () => ref(),\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return itemAria.isDisabled();\n },\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n });\n\n const renderValues = createMemo<MenuItemRenderProps>(() => {\n const selection = activeSectionSelection();\n return {\n isSelected: selection?.isSelected(local.id) ?? itemAria.isSelected(),\n selectionMode: selection?.selectionMode() ?? itemAria.selectionMode(),\n isFocused: itemAria.isFocused(),\n isFocusVisible: itemAria.isFocusVisible(),\n isPressed: itemAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: itemAria.isDisabled(),\n hasSubmenu: Boolean(contextProps()[\"aria-haspopup\"]),\n isOpen: isAriaTrue(contextProps()[\"aria-expanded\"]),\n descriptionProps: itemAria.descriptionProps,\n keyboardShortcutProps: itemAria.keyboardShortcutProps,\n };\n });\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Menu-item\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const cleanItemProps = () => {\n // Keep `aria-describedby`: the headless emits it (via `createSlotId`) only\n // when a description/keyboard element is actually rendered, so it points at\n // the styled `Text slot=\"description\"` + `Keyboard` ids threaded through\n // `renderValues` below — restoring upstream's two-context description\n // delegation. `createSlotId` clears it to `undefined` on description-less\n // items, so nothing dangles.\n const { ref: _ref1, ...rest } = itemAria.menuItemProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n const selection = activeSectionSelection();\n const selectionMode = selection?.selectionMode();\n if (selectionMode) {\n rest.role =\n selectionMode === \"single\"\n ? \"menuitemradio\"\n : selectionMode === \"multiple\"\n ? \"menuitemcheckbox\"\n : \"menuitem\";\n if (selectionMode !== \"none\") {\n rest[\"aria-checked\"] = selection?.isSelected(local.id) ?? false;\n } else {\n delete rest[\"aria-checked\"];\n }\n rest[\"data-selected\"] = selection?.isSelected(local.id) || undefined;\n }\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const domProps = createMemo(() =>\n filterDOMProps(ariaProps as Record<string, unknown>, { global: true }),\n );\n const draggableItem = createMemo(() => {\n if (!menuContext?.dragAndDropHooks?.useDraggableItem || !menuContext.dragState)\n return undefined;\n return menuContext.dragAndDropHooks.useDraggableItem(\n {\n key: local.id as string | number,\n },\n menuContext.dragState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDraggableItem\"]>>[1],\n );\n });\n const droppableItem = createMemo(() => {\n if (!menuContext?.dragAndDropHooks?.useDroppableItem || !menuContext.dropState)\n return undefined;\n return menuContext.dragAndDropHooks.useDroppableItem(\n {\n key: local.id as string | number,\n },\n menuContext.dropState as Parameters<NonNullable<DragAndDropHooks<T>[\"useDroppableItem\"]>>[1],\n () => ref(),\n );\n });\n\n const isLink = () => !!local.href;\n\n const cleanItemPropsForLink = () => {\n const all = cleanItemProps();\n const { href: _href, target: _target, rel: _rel, download: _download, ...rest } = all;\n return rest;\n };\n\n const linkDomProps = () => {\n const all = cleanItemProps();\n const result: Record<string, unknown> = {};\n if (all.href !== undefined) result.href = all.href;\n if (all.target !== undefined) result.target = all.target;\n if (all.rel !== undefined) result.rel = all.rel;\n if (all.download !== undefined) result.download = all.download;\n return result;\n };\n\n const dataAttrs = () => {\n const selection = activeSectionSelection();\n return {\n \"data-focused\": dataAttr(itemAria.isFocused()),\n \"data-focus-visible\": dataAttr(itemAria.isFocusVisible()),\n \"data-pressed\": dataAttr(itemAria.isPressed()),\n \"data-hovered\": dataAttr(isHovered()),\n \"data-disabled\": dataAttr(itemAria.isDisabled()),\n \"data-selected\": dataAttr(selection?.isSelected(local.id) ?? itemAria.isSelected()),\n \"data-has-submenu\": dataAttr(Boolean(contextProps()[\"aria-haspopup\"])),\n \"data-open\": dataAttr(isAriaTrue(contextProps()[\"aria-expanded\"])),\n \"data-dragging\": dataAttr(!!draggableItem()?.isDragging),\n \"data-drop-target\": dataAttr(!!droppableItem()?.isDropTarget),\n };\n };\n\n const childContent = () =>\n hasPrimitiveLabel() ? (\n <span {...itemAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n );\n const setResolvedItemRef = (el: HTMLElement | null) => {\n setRef(el);\n itemContext?.setItemRef?.(el);\n if (el) assignRef(local.ref, el);\n const dragRef = (draggableItem()?.dragProps as { ref?: (el: HTMLElement) => void } | undefined)\n ?.ref;\n if (el && typeof dragRef === \"function\") dragRef(el);\n };\n const menuItemProps = () =>\n ({\n ref: setResolvedItemRef,\n ...mergeProps(\n cleanItemProps(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n ...dataAttrs(),\n children: childContent(),\n }) as JSX.HTMLAttributes<HTMLElement>;\n const linkMenuItemProps = () =>\n ({\n ...mergeProps(\n cleanItemPropsForLink(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n linkDomProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n ),\n class: renderProps.class(),\n style: renderProps.style(),\n ...dataAttrs(),\n children: childContent(),\n }) as JSX.HTMLAttributes<HTMLElement>;\n\n if (local.render && !isLink()) {\n return local.render(menuItemProps(), renderValues());\n }\n\n return (\n <Show\n when={isLink()}\n fallback={\n <div\n ref={setResolvedItemRef}\n {...mergeProps(\n cleanItemProps(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n {...dataAttrs()}\n >\n {childContent()}\n </div>\n }\n >\n {local.render ? (\n local.render(linkMenuItemProps(), renderValues())\n ) : (\n // Upstream renders the link menuitem as a bare <a role=\"menuitem\"> (no\n // presentation wrapper); the <div> root makes the wrapper unnecessary.\n <a\n ref={setResolvedItemRef}\n {...mergeProps(\n cleanItemPropsForLink(),\n contextProps() as Record<string, unknown>,\n domProps(),\n cleanHoverProps(),\n linkDomProps(),\n (draggableItem()?.dragProps as Record<string, unknown> | undefined) ?? {},\n (droppableItem()?.dropProps as Record<string, unknown> | undefined) ?? {},\n )}\n class={renderProps.class()}\n style={renderProps.style()}\n {...dataAttrs()}\n >\n {childContent()}\n </a>\n )}\n </Show>\n );\n}\n\n/**\n * Section primitive alias for Menu composition parity.\n */\nexport function MenuSection(props: MenuSectionProps): JSX.Element {\n const [selectionProps, sectionProps] = splitProps(props, [\n \"selectionMode\",\n \"selectionBehavior\",\n \"disallowEmptySelection\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"disabledKeys\",\n \"disabledBehavior\",\n \"allowDuplicateSelectionEvents\",\n \"shouldCloseOnSelect\",\n ]);\n\n const selectionState = createSelectionState({\n get selectionMode() {\n return selectionProps.selectionMode ?? \"none\";\n },\n get selectionBehavior() {\n return selectionProps.selectionBehavior;\n },\n get disallowEmptySelection() {\n return selectionProps.disallowEmptySelection;\n },\n get selectedKeys() {\n return selectionProps.selectionMode ? selectionProps.selectedKeys : undefined;\n },\n get defaultSelectedKeys() {\n return selectionProps.selectionMode ? selectionProps.defaultSelectedKeys : undefined;\n },\n get onSelectionChange() {\n return selectionProps.selectionMode ? selectionProps.onSelectionChange : undefined;\n },\n get disabledKeys() {\n return selectionProps.disabledKeys;\n },\n get disabledBehavior() {\n return selectionProps.disabledBehavior;\n },\n get allowDuplicateSelectionEvents() {\n return selectionProps.allowDuplicateSelectionEvents;\n },\n });\n\n const sectionSelection: MenuSectionSelectionContextValue = {\n selectionMode: selectionState.selectionMode,\n isSelected: selectionState.isSelected,\n isDisabled: selectionState.isDisabled,\n select(key, event) {\n selectionState.select(key, event);\n },\n shouldCloseOnSelect() {\n return selectionProps.shouldCloseOnSelect;\n },\n };\n\n return (\n <MenuSectionSelectionContext value={sectionSelection}>\n <Section {...sectionProps} />\n </MenuSectionSelectionContext>\n );\n}\n\nexport interface MenuLoadMoreItemProps extends SlotProps {\n /** Called when the sentinel intersects the scroll parent. */\n onLoadMore?: () => void | Promise<void>;\n /** Whether the loading spinner should be rendered. */\n isLoading?: boolean;\n /**\n * Offset from the bottom of the scroll region that should trigger load more,\n * as a percentage of the scroll body's client height. `1` = 100%.\n */\n scrollOffset?: number;\n /** The load more spinner to render when loading additional items. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** The inline style for the element. */\n style?: StyleOrFunction<{ isLoading: boolean }>;\n /** Ref for the loading indicator element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\n/**\n * Load more sentinel item for menu collections.\n * Port of RAC `MenuLoadMoreItem` (`react-aria-components/src/Menu.tsx`).\n */\nexport function MenuLoadMoreItem(props: MenuLoadMoreItemProps): JSX.Element {\n const state = useContext(MenuStateContext);\n const [sentinel, setSentinel] = createSignal<HTMLElement | null>(null);\n const [collectionEpoch, setCollectionEpoch] = createSignal(0);\n let seenCollectionSize: number | undefined;\n const [local, domProps] = splitProps(props, [\n \"onLoadMore\",\n \"isLoading\",\n \"scrollOffset\",\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n \"slot\",\n ]);\n const scrollOffsetValue = createMemo(() => local.scrollOffset ?? 1);\n\n createEffect(\n () => state?.collection()?.size ?? 0,\n (size) => {\n if (seenCollectionSize === undefined || seenCollectionSize === 0) {\n seenCollectionSize = size;\n return;\n }\n if (size !== seenCollectionSize) {\n seenCollectionSize = size;\n setCollectionEpoch((n) => n + 1);\n }\n },\n );\n\n createEffect(\n () => ({\n current: sentinel(),\n scrollOffset: scrollOffsetValue(),\n epoch: collectionEpoch(),\n }),\n ({ current, scrollOffset }) => {\n if (!current || typeof IntersectionObserver !== \"function\") return;\n\n const onLoadMore = local.onLoadMore;\n const margin = 100 * scrollOffset;\n const rootMargin = `0px ${margin}% ${margin}% ${margin}%`;\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting && onLoadMore) {\n void onLoadMore();\n }\n }\n },\n { rootMargin },\n );\n observer.observe(current);\n return () => observer.disconnect();\n },\n );\n\n const isLoading = () => !!local.isLoading;\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-Menu-loadMore\",\n },\n () => ({ isLoading: isLoading() }),\n );\n\n return (\n <>\n <div style={{ position: \"relative\", width: 0, height: 0 }} inert>\n <div\n ref={setSentinel}\n data-testid=\"loadMoreSentinel\"\n style={{ position: \"absolute\", height: \"1px\", width: \"1px\" }}\n />\n </div>\n <Show when={isLoading() && local.children}>\n <div\n {...filterDOMProps(domProps as Record<string, unknown>, { global: true })}\n role=\"menuitem\"\n tabindex={-1}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-loading\n >\n {renderProps.renderChildren()}\n </div>\n </Show>\n </>\n );\n}\n\nMenu.Item = MenuItem;\nMenu.LoadMoreItem = MenuLoadMoreItem;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6UA,MAAa,cAAc,cAAgD,IAAI;AAC/E,MAAa,mBAAmB,cAAyC,IAAI;AAC7E,MAAa,qBAAqB,cAA8C,IAAI;AACpF,MAAa,8BAA8B,cAAuC,IAAI;AACtF,MAAM,kBAAkB,cAA2C,IAAI;AACvE,MAAM,8BAA8B,cAAuD,IAAI;AAC/F,MAAM,8BAA8B,cAAuD,IAAI;AAC/F,MAAM,sCACJ,cAA+D,IAAI;AACrE,MAAM,+BAA+B,cAAwD,IAAI;AAEjG,SAAS,eAAe,OAAyB;CAC/C,OAAO,OAAO,UAAU,aAAa,QAAS,MAAwB,CAAC,IAAI,QAAQ,KAAK;AAC1F;;;;AAKA,SAAgB,YAAY,OAAsC;CAChE,MAAM,CAAC,OAAO,cAAc,WAAW,OAAO,CAAC,MAAM,CAAC;CAEtD,MAAM,QAAQ,uBAAuB;EACnC,IAAI,SAAS;GACX,OAAO,WAAW;EACpB;E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EAAE,IAAI;MACN,CAAC,KAAK,MAAM,UAAU,KAAK,MAAM,UAAU;QACzC,CAAC,QACK,eAAe,UAAqC,EAAE,QAAQ,KAAK,CAAC,GACxE,gBACA,UAAU,IACV,MAAM,OAAOA,YAAU,MAAM,KAAK,EAAE,GACpC,OAAO,YAAY,MAAM,GACzB,OAAO,YAAY,MAAM,GACzB,aACD;WACE,YAAY,eAAe,EAAE;QAChC,EAAE,IAAI;MACR,EAAE,KAAK;IACT;AAEJ;AAEA,KAAK,OAAO;AACZ,KAAK,eAAe"}
|
package/dist/Meter.d.ts
CHANGED
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
* Meter component for solidaria-components
|
|
3
|
-
*
|
|
4
|
-
* Pre-wired headless meter component that combines aria hooks.
|
|
5
|
-
* Port of react-aria-components/src/Meter.tsx
|
|
6
|
-
*
|
|
7
|
-
* Meters represent a quantity within a known range, or a fractional value.
|
|
8
|
-
* Unlike progress bars, meters represent a current value rather than progress toward a goal.
|
|
9
|
-
*/
|
|
10
|
-
import { type JSX } from "solid-js";
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
11
2
|
import { type AriaMeterProps } from "@proyecto-viviana/solidaria";
|
|
12
|
-
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
3
|
+
import { type RenderChildren, type ClassNameOrFunction, type ContextValue, type RefLike, type StyleOrFunction, type SlotProps } from "./utils";
|
|
13
4
|
export interface MeterRenderProps {
|
|
14
5
|
/** The value as a percentage between the minimum and maximum (0-100). */
|
|
15
6
|
percentage: number;
|
|
16
7
|
/** A formatted version of the value. */
|
|
17
8
|
valueText: string | undefined;
|
|
18
9
|
}
|
|
19
|
-
export interface MeterProps extends AriaMeterProps, SlotProps {
|
|
10
|
+
export interface MeterProps extends Omit<AriaMeterProps, "label">, SlotProps {
|
|
20
11
|
/** The children of the component. A function may be provided to receive render props. */
|
|
21
12
|
children?: RenderChildren<MeterRenderProps>;
|
|
22
13
|
/** The CSS className for the element. */
|
|
23
14
|
class?: ClassNameOrFunction<MeterRenderProps>;
|
|
24
15
|
/** The inline style for the element. */
|
|
25
16
|
style?: StyleOrFunction<MeterRenderProps>;
|
|
17
|
+
/** A ref for the meter element. */
|
|
18
|
+
ref?: RefLike<HTMLDivElement>;
|
|
26
19
|
}
|
|
27
|
-
export declare const MeterContext: import("solid-js").Context<MeterProps
|
|
20
|
+
export declare const MeterContext: import("solid-js").Context<ContextValue<MeterProps, HTMLDivElement>>;
|
|
28
21
|
/**
|
|
29
22
|
* A meter represents a quantity within a known range, or a fractional value.
|
|
30
23
|
* Unlike progress bars, meters represent a current value rather than progress toward a goal.
|
package/dist/Meter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Meter.d.ts","sourceRoot":"","sources":["../src/Meter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Meter.d.ts","sourceRoot":"","sources":["../src/Meter.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG/E,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,SAAS,EAKf,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,SAAS;IAC1E,yFAAyF;IACzF,QAAQ,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC5C,yCAAyC;IACzC,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,wCAAwC;IACxC,KAAK,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAC1C,mCAAmC;IACnC,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,sEAAgE,CAAC;AAW1F;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CA0FpD"}
|
package/dist/Meter.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Meter.tsx
|
|
13
|
+
import { filterDOMProps, useContextProps, useRenderProps, useSlot } from "./utils.js";
|
|
14
|
+
import { n as LabelContext } from "./Label.js";
|
|
15
|
+
import { createComponent, getNextElement, insert, ref, runHydrationEvents, spread, template } from "@solidjs/web";
|
|
16
|
+
import { createContext, createMemo } from "solid-js";
|
|
4
17
|
import { createMeter } from "@proyecto-viviana/solidaria";
|
|
18
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
5
19
|
//#region src/Meter.tsx
|
|
6
20
|
/**
|
|
7
21
|
* Meter component for solidaria-components
|
|
@@ -12,7 +26,7 @@ import { createMeter } from "@proyecto-viviana/solidaria";
|
|
|
12
26
|
* Meters represent a quantity within a known range, or a fractional value.
|
|
13
27
|
* Unlike progress bars, meters represent a current value rather than progress toward a goal.
|
|
14
28
|
*/
|
|
15
|
-
var _tmpl$ =
|
|
29
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
16
30
|
const MeterContext = createContext(null);
|
|
17
31
|
function clamp(value, min, max) {
|
|
18
32
|
return Math.min(Math.max(value, min), max);
|
|
@@ -39,15 +53,19 @@ function getSafeRange(min, max) {
|
|
|
39
53
|
* ```
|
|
40
54
|
*/
|
|
41
55
|
function Meter(props) {
|
|
42
|
-
const [
|
|
56
|
+
const [mergedProps, ref$1] = useContextProps(props, props.ref, MeterContext);
|
|
57
|
+
const [local, ariaProps] = splitProps(mergedProps, [
|
|
43
58
|
"children",
|
|
44
59
|
"class",
|
|
45
60
|
"style",
|
|
46
|
-
"slot"
|
|
61
|
+
"slot",
|
|
62
|
+
"ref"
|
|
47
63
|
]);
|
|
48
64
|
const value = () => ariaProps.value ?? 0;
|
|
49
65
|
const minValue = () => ariaProps.minValue ?? 0;
|
|
50
66
|
const maxValue = () => ariaProps.maxValue ?? 100;
|
|
67
|
+
const hasExplicitLabel = () => Boolean(ariaProps["aria-label"] || ariaProps["aria-labelledby"]);
|
|
68
|
+
const [labelRef, hasLabel] = useSlot(!hasExplicitLabel());
|
|
51
69
|
const meterAria = createMeter({
|
|
52
70
|
get value() {
|
|
53
71
|
return ariaProps.value;
|
|
@@ -65,7 +83,7 @@ function Meter(props) {
|
|
|
65
83
|
return ariaProps.formatOptions;
|
|
66
84
|
},
|
|
67
85
|
get label() {
|
|
68
|
-
return
|
|
86
|
+
return hasExplicitLabel() ? void 0 : hasLabel();
|
|
69
87
|
},
|
|
70
88
|
get "aria-label"() {
|
|
71
89
|
return ariaProps["aria-label"];
|
|
@@ -92,30 +110,49 @@ function Meter(props) {
|
|
|
92
110
|
}));
|
|
93
111
|
const renderProps = useRenderProps({
|
|
94
112
|
get children() {
|
|
95
|
-
return
|
|
113
|
+
return mergedProps.children;
|
|
96
114
|
},
|
|
97
115
|
class: local.class,
|
|
98
116
|
style: local.style,
|
|
99
117
|
defaultClassName: "solidaria-Meter"
|
|
100
118
|
}, renderValues);
|
|
101
119
|
const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
120
|
+
const labelContextValue = {
|
|
121
|
+
get id() {
|
|
122
|
+
return hasExplicitLabel() ? void 0 : meterAria.labelProps.id;
|
|
123
|
+
},
|
|
124
|
+
ref: labelRef,
|
|
125
|
+
elementType: "span"
|
|
126
|
+
};
|
|
127
|
+
var _el$ = getNextElement(_tmpl$);
|
|
128
|
+
ref(() => {
|
|
129
|
+
return ref$1;
|
|
130
|
+
}, _el$);
|
|
131
|
+
spread(_el$, [
|
|
132
|
+
domProps,
|
|
133
|
+
() => {
|
|
134
|
+
return meterAria.meterProps;
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
get "class"() {
|
|
106
138
|
return renderProps.class();
|
|
107
139
|
},
|
|
108
140
|
get style() {
|
|
109
141
|
return renderProps.style();
|
|
110
142
|
},
|
|
111
143
|
get slot() {
|
|
112
|
-
return local.slot;
|
|
144
|
+
return local.slot ?? void 0;
|
|
113
145
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
146
|
+
}
|
|
147
|
+
], true);
|
|
148
|
+
insert(_el$, createComponent(LabelContext, {
|
|
149
|
+
value: labelContextValue,
|
|
150
|
+
get children() {
|
|
151
|
+
return renderProps.renderChildren();
|
|
152
|
+
}
|
|
153
|
+
}));
|
|
154
|
+
runHydrationEvents();
|
|
155
|
+
return _el$;
|
|
119
156
|
}
|
|
120
157
|
//#endregion
|
|
121
158
|
export { Meter, MeterContext };
|