@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/Alert.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { filterDOMProps } from "./utils.js";
|
|
1
|
+
import { dataAttr, filterDOMProps } from "./utils.js";
|
|
2
2
|
import { Button } from "./Button.js";
|
|
3
|
-
import { createComponent, getNextElement, insert, memo, mergeProps, runHydrationEvents, spread, template } from "
|
|
4
|
-
import { createContext, createMemo,
|
|
3
|
+
import { createComponent, getNextElement, insert, memo, mergeProps, runHydrationEvents, scope, spread, template } from "@solidjs/web";
|
|
4
|
+
import { createContext, createMemo, useContext } from "solid-js";
|
|
5
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
5
6
|
//#region src/Alert.tsx
|
|
6
7
|
/**
|
|
7
8
|
* Alert component for solidaria-components
|
|
@@ -9,8 +10,11 @@ import { createContext, createMemo, splitProps, useContext } from "solid-js";
|
|
|
9
10
|
* Minimal headless Alert that owns ARIA semantics (role="alert")
|
|
10
11
|
* and provides render props for styling. The UI layer consumes this
|
|
11
12
|
* for styling/composition only.
|
|
13
|
+
*
|
|
14
|
+
* This is a local Solid component. The pinned React Aria Components source
|
|
15
|
+
* has no Alert counterpart.
|
|
12
16
|
*/
|
|
13
|
-
var _tmpl$ =
|
|
17
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
14
18
|
const AlertContext = createContext(null);
|
|
15
19
|
/**
|
|
16
20
|
* An alert displays a brief, important message in a way that
|
|
@@ -56,29 +60,33 @@ function Alert(props) {
|
|
|
56
60
|
isDismissible,
|
|
57
61
|
onDismiss: local.onDismiss
|
|
58
62
|
};
|
|
59
|
-
return createComponent(AlertContext
|
|
63
|
+
return createComponent(AlertContext, {
|
|
60
64
|
value: contextValue,
|
|
61
65
|
get children() {
|
|
62
66
|
var _el$ = getNextElement(_tmpl$);
|
|
63
|
-
spread(_el$,
|
|
64
|
-
|
|
65
|
-
get
|
|
67
|
+
spread(_el$, [domProps, {
|
|
68
|
+
role: "alert",
|
|
69
|
+
get "class"() {
|
|
66
70
|
return computedClass();
|
|
67
71
|
},
|
|
68
72
|
get style() {
|
|
69
73
|
return computedStyle();
|
|
70
74
|
},
|
|
71
|
-
get
|
|
75
|
+
get "data-variant"() {
|
|
72
76
|
return variant();
|
|
73
77
|
},
|
|
74
|
-
get
|
|
75
|
-
return isDismissible()
|
|
78
|
+
get "data-dismissible"() {
|
|
79
|
+
return dataAttr(isDismissible());
|
|
76
80
|
}
|
|
77
|
-
}
|
|
78
|
-
insert(_el$, (() => {
|
|
79
|
-
var _c$ = memo(() =>
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
}], true);
|
|
82
|
+
insert(_el$, scope((() => {
|
|
83
|
+
var _c$ = memo(() => {
|
|
84
|
+
return typeof local.children === "function";
|
|
85
|
+
});
|
|
86
|
+
return () => {
|
|
87
|
+
return _c$() ? local.children(renderValues()) : local.children;
|
|
88
|
+
};
|
|
89
|
+
})()));
|
|
82
90
|
runHydrationEvents();
|
|
83
91
|
return _el$;
|
|
84
92
|
}
|
|
@@ -99,7 +107,7 @@ function Alert(props) {
|
|
|
99
107
|
function AlertDismissButton(props) {
|
|
100
108
|
const context = useContext(AlertContext);
|
|
101
109
|
return createComponent(Button, mergeProps(props, {
|
|
102
|
-
get
|
|
110
|
+
get "aria-label"() {
|
|
103
111
|
return props["aria-label"] ?? "Dismiss";
|
|
104
112
|
},
|
|
105
113
|
onPress: () => context?.onDismiss?.()
|
package/dist/Alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","names":["
|
|
1
|
+
{"version":3,"file":"Alert.js","names":["<AlertContext value={contextValue}>\n <div\n {...domProps()}\n role=\"alert\"\n class={computedClass()}\n style={computedStyle()}\n data-variant={variant()}\n data-dismissible={dataAttr(isDismissible())}\n >\n {typeof local.children === \"function\"\n ? (local.children as (props: AlertRenderProps) => JSX.Element)(renderValues())\n : local.children}\n </div>\n </AlertContext>","value={contextValue}","role=\"alert\"","{typeof local.children === \"function\"\n ? (local.children as (props: AlertRenderProps) => JSX.Element)(renderValues())\n : local.children}","<div\n {...domProps()}\n role=\"alert\"\n class={computedClass()}\n style={computedStyle()}\n data-variant={variant()}\n data-dismissible={dataAttr(isDismissible())}\n >\n {typeof local.children === \"function\"\n ? (local.children as (props: AlertRenderProps) => JSX.Element)(renderValues())\n : local.children}\n </div>","<Button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Dismiss\"}\n onPress={() => context?.onDismiss?.()}\n />","onPress={() => context?.onDismiss?.()}"],"sources":["../src/Alert.tsx"],"sourcesContent":["/**\n * Alert component for solidaria-components\n *\n * Minimal headless Alert that owns ARIA semantics (role=\"alert\")\n * and provides render props for styling. The UI layer consumes this\n * for styling/composition only.\n *\n * This is a local Solid component. The pinned React Aria Components source\n * has no Alert counterpart.\n */\n\nimport { createContext, createMemo, useContext } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n filterDOMProps,\n dataAttr,\n} from \"./utils\";\nimport { Button, type ButtonProps } from \"./Button\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport interface AlertRenderProps {\n /** The variant of the alert. */\n variant: AlertVariant;\n /** Whether the alert can be dismissed. */\n isDismissible: boolean;\n}\n\nexport interface AlertProps extends SlotProps {\n /** The variant of the alert. */\n variant?: AlertVariant;\n /** Whether the alert can be dismissed. */\n isDismissible?: boolean;\n /** Handler called when the alert is dismissed. */\n onDismiss?: () => void;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<AlertRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<AlertRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<AlertRenderProps>;\n /** The id of the element. */\n id?: string;\n}\n\nexport interface AlertContextValue {\n variant: () => AlertVariant;\n isDismissible: () => boolean;\n onDismiss?: () => void;\n}\n\nexport const AlertContext = createContext<AlertContextValue | null>(null);\n\n/**\n * An alert displays a brief, important message in a way that\n * attracts the user's attention without interrupting their task.\n *\n * This is a headless component that provides the ARIA `role=\"alert\"`\n * semantics and render props for styling.\n *\n * @example\n * ```tsx\n * <Alert variant=\"error\" isDismissible onDismiss={() => setVisible(false)}>\n * {({ variant }) => <span>Something went wrong ({variant})</span>}\n * </Alert>\n * ```\n */\nexport function Alert(props: AlertProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"variant\",\n \"isDismissible\",\n \"onDismiss\",\n ]);\n\n const variant = () => local.variant ?? \"info\";\n const isDismissible = () => !!local.isDismissible;\n\n const renderValues = createMemo<AlertRenderProps>(() => ({\n variant: variant(),\n isDismissible: isDismissible(),\n }));\n\n // Resolve class and style manually. We intentionally avoid useRenderProps()\n // because it destructures children eagerly, which would create child\n // components (e.g. AlertDismissButton) BEFORE the AlertContext.Provider\n // is in scope, breaking context for sub-components.\n const computedClass = createMemo(() => {\n const cls = local.class;\n return typeof cls === \"function\" ? cls(renderValues()) : (cls ?? \"solidaria-Alert\");\n });\n\n const computedStyle = createMemo(() => {\n const s = local.style;\n return typeof s === \"function\" ? s(renderValues()) : s;\n });\n\n const domProps = createMemo(() => filterDOMProps(rest, { global: true }));\n\n const contextValue: AlertContextValue = {\n variant,\n isDismissible,\n onDismiss: local.onDismiss,\n };\n\n // Children are accessed lazily inside the Provider scope (via local.children\n // in JSX) so sub-components like AlertDismissButton can read AlertContext.\n return (\n <AlertContext value={contextValue}>\n <div\n {...domProps()}\n role=\"alert\"\n class={computedClass()}\n style={computedStyle()}\n data-variant={variant()}\n data-dismissible={dataAttr(isDismissible())}\n >\n {typeof local.children === \"function\"\n ? (local.children as (props: AlertRenderProps) => JSX.Element)(renderValues())\n : local.children}\n </div>\n </AlertContext>\n );\n}\n\nexport interface AlertDismissButtonProps extends Omit<ButtonProps, \"onPress\"> {}\n\n/**\n * A dismiss button for use inside an Alert.\n * Uses the headless Button for full keyboard/a11y support.\n *\n * @example\n * ```tsx\n * <Alert isDismissible onDismiss={handleDismiss}>\n * <span>Alert content</span>\n * <AlertDismissButton aria-label=\"Dismiss\">X</AlertDismissButton>\n * </Alert>\n * ```\n */\nexport function AlertDismissButton(props: AlertDismissButtonProps): JSX.Element {\n const context = useContext(AlertContext);\n\n return (\n <Button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Dismiss\"}\n onPress={() => context?.onDismiss?.()}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwDA,MAAa,eAAe,cAAwC,IAAI;;;;;;;;;;;;;;;AAgBxE,SAAgB,MAAM,OAAgC;CACpD,MAAM,CAAC,OAAO,QAAQ,WAAW,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,gBAAgB,MAAM,WAAW;CACvC,MAAM,sBAAsB,CAAC,CAAC,MAAM;CAEpC,MAAM,eAAe,kBAAoC;EACvD,SAAS,QAAQ;EACjB,eAAe,cAAc;CAC/B,EAAE;CAMF,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,MAAM,MAAM;EAClB,OAAO,OAAO,QAAQ,aAAa,IAAI,aAAa,CAAC,IAAK,OAAO;CACnE,CAAC;CAED,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,IAAI,MAAM;EAChB,OAAO,OAAO,MAAM,aAAa,EAAE,aAAa,CAAC,IAAI;CACvD,CAAC;CAED,MAAM,WAAW,iBAAiB,eAAe,MAAM,EAAE,QAAQ,KAAK,CAAC,CAAC;CAExE,MAAM,eAAkC;EACtC;EACA;EACA,WAAW,MAAM;CACnB;CAIA,OACEA,gBAAAA,cAAAA;EAAcC,OAAO;EAArB,IAAA,WAAA;GACE,IAAA,OAAA,eAAA,MAWK;GAVC,OAAA,MAAA,CAAA,UAAA;IACJC,MAAAA;IACA,IAAA,UAAA;KAAO,OAAA,cAAc;IAAC;IACtB,IAAA,QAAA;KAAO,OAAA,cAAc;IAAC;IACtB,IAAA,iBAAA;KAAc,OAAA,QAAQ;IAAC;IACvB,IAAA,qBAAA;KAAkB,OAAA,SAAS,cAAc,CAAC;IAAC;;GAN7C,OAAA,MAQEC,aAAAA;;KAAC,OAAA,OAAO,MAAM,aAAa;IAET,CAAA;IAFlB,aAAA;KAEkB,OAAA,IAAA,IADb,MAAM,SAAsD,aAAa,CAAC,IAC3E,MAAM;IAAQ;GAAC,EAAA,CAAD,CAAA,CACf;GAXL,mBAWK;GAZP,OACEC;EAYY;;AAElB;;;;;;;;;;;;;AAgBA,SAAgB,mBAAmB,OAA6C;CAC9E,MAAM,UAAU,WAAW,YAAY;CAEvC,OACEC,gBAAAA,QAAAA,WACM,OADN;EAEE,IAAA,eAAA;GAAY,OAAA,MAAM,iBAAiB;EAAS;EAC5CC,eAAe,SAAS,YAAY;CACrC,CAAA,CAAA;AAEL"}
|
package/dist/Alert.jsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { filterDOMProps } from "./utils.jsx";
|
|
1
|
+
import { dataAttr, filterDOMProps } from "./utils.jsx";
|
|
2
2
|
import { Button } from "./Button.jsx";
|
|
3
|
-
import { createContext, createMemo,
|
|
3
|
+
import { createContext, createMemo, useContext } from "solid-js";
|
|
4
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
4
5
|
//#region src/Alert.tsx
|
|
5
6
|
/**
|
|
6
7
|
* Alert component for solidaria-components
|
|
@@ -8,6 +9,9 @@ import { createContext, createMemo, splitProps, useContext } from "solid-js";
|
|
|
8
9
|
* Minimal headless Alert that owns ARIA semantics (role="alert")
|
|
9
10
|
* and provides render props for styling. The UI layer consumes this
|
|
10
11
|
* for styling/composition only.
|
|
12
|
+
*
|
|
13
|
+
* This is a local Solid component. The pinned React Aria Components source
|
|
14
|
+
* has no Alert counterpart.
|
|
11
15
|
*/
|
|
12
16
|
const AlertContext = createContext(null);
|
|
13
17
|
/**
|
|
@@ -54,11 +58,11 @@ function Alert(props) {
|
|
|
54
58
|
isDismissible,
|
|
55
59
|
onDismiss: local.onDismiss
|
|
56
60
|
};
|
|
57
|
-
return <AlertContext
|
|
58
|
-
<div {...domProps()} role="alert" class={computedClass()} style={computedStyle()} data-variant={variant()} data-dismissible={isDismissible()
|
|
61
|
+
return <AlertContext value={contextValue}>
|
|
62
|
+
<div {...domProps()} role="alert" class={computedClass()} style={computedStyle()} data-variant={variant()} data-dismissible={dataAttr(isDismissible())}>
|
|
59
63
|
{typeof local.children === "function" ? local.children(renderValues()) : local.children}
|
|
60
64
|
</div>
|
|
61
|
-
</AlertContext
|
|
65
|
+
</AlertContext>;
|
|
62
66
|
}
|
|
63
67
|
/**
|
|
64
68
|
* A dismiss button for use inside an Alert.
|
package/dist/Alert.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.jsx","names":[],"sources":["../src/Alert.tsx"],"sourcesContent":["/**\n * Alert component for solidaria-components\n *\n * Minimal headless Alert that owns ARIA semantics (role=\"alert\")\n * and provides render props for styling. The UI layer consumes this\n * for styling/composition only.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"Alert.jsx","names":[],"sources":["../src/Alert.tsx"],"sourcesContent":["/**\n * Alert component for solidaria-components\n *\n * Minimal headless Alert that owns ARIA semantics (role=\"alert\")\n * and provides render props for styling. The UI layer consumes this\n * for styling/composition only.\n *\n * This is a local Solid component. The pinned React Aria Components source\n * has no Alert counterpart.\n */\n\nimport { createContext, createMemo, useContext } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n filterDOMProps,\n dataAttr,\n} from \"./utils\";\nimport { Button, type ButtonProps } from \"./Button\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport interface AlertRenderProps {\n /** The variant of the alert. */\n variant: AlertVariant;\n /** Whether the alert can be dismissed. */\n isDismissible: boolean;\n}\n\nexport interface AlertProps extends SlotProps {\n /** The variant of the alert. */\n variant?: AlertVariant;\n /** Whether the alert can be dismissed. */\n isDismissible?: boolean;\n /** Handler called when the alert is dismissed. */\n onDismiss?: () => void;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<AlertRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<AlertRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<AlertRenderProps>;\n /** The id of the element. */\n id?: string;\n}\n\nexport interface AlertContextValue {\n variant: () => AlertVariant;\n isDismissible: () => boolean;\n onDismiss?: () => void;\n}\n\nexport const AlertContext = createContext<AlertContextValue | null>(null);\n\n/**\n * An alert displays a brief, important message in a way that\n * attracts the user's attention without interrupting their task.\n *\n * This is a headless component that provides the ARIA `role=\"alert\"`\n * semantics and render props for styling.\n *\n * @example\n * ```tsx\n * <Alert variant=\"error\" isDismissible onDismiss={() => setVisible(false)}>\n * {({ variant }) => <span>Something went wrong ({variant})</span>}\n * </Alert>\n * ```\n */\nexport function Alert(props: AlertProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"variant\",\n \"isDismissible\",\n \"onDismiss\",\n ]);\n\n const variant = () => local.variant ?? \"info\";\n const isDismissible = () => !!local.isDismissible;\n\n const renderValues = createMemo<AlertRenderProps>(() => ({\n variant: variant(),\n isDismissible: isDismissible(),\n }));\n\n // Resolve class and style manually. We intentionally avoid useRenderProps()\n // because it destructures children eagerly, which would create child\n // components (e.g. AlertDismissButton) BEFORE the AlertContext.Provider\n // is in scope, breaking context for sub-components.\n const computedClass = createMemo(() => {\n const cls = local.class;\n return typeof cls === \"function\" ? cls(renderValues()) : (cls ?? \"solidaria-Alert\");\n });\n\n const computedStyle = createMemo(() => {\n const s = local.style;\n return typeof s === \"function\" ? s(renderValues()) : s;\n });\n\n const domProps = createMemo(() => filterDOMProps(rest, { global: true }));\n\n const contextValue: AlertContextValue = {\n variant,\n isDismissible,\n onDismiss: local.onDismiss,\n };\n\n // Children are accessed lazily inside the Provider scope (via local.children\n // in JSX) so sub-components like AlertDismissButton can read AlertContext.\n return (\n <AlertContext value={contextValue}>\n <div\n {...domProps()}\n role=\"alert\"\n class={computedClass()}\n style={computedStyle()}\n data-variant={variant()}\n data-dismissible={dataAttr(isDismissible())}\n >\n {typeof local.children === \"function\"\n ? (local.children as (props: AlertRenderProps) => JSX.Element)(renderValues())\n : local.children}\n </div>\n </AlertContext>\n );\n}\n\nexport interface AlertDismissButtonProps extends Omit<ButtonProps, \"onPress\"> {}\n\n/**\n * A dismiss button for use inside an Alert.\n * Uses the headless Button for full keyboard/a11y support.\n *\n * @example\n * ```tsx\n * <Alert isDismissible onDismiss={handleDismiss}>\n * <span>Alert content</span>\n * <AlertDismissButton aria-label=\"Dismiss\">X</AlertDismissButton>\n * </Alert>\n * ```\n */\nexport function AlertDismissButton(props: AlertDismissButtonProps): JSX.Element {\n const context = useContext(AlertContext);\n\n return (\n <Button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Dismiss\"}\n onPress={() => context?.onDismiss?.()}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAwDA,MAAa,eAAe,cAAwC,IAAI;;;;;;;;;;;;;;;AAgBxE,SAAgB,MAAM,OAAgC;CACpD,MAAM,CAAC,OAAO,QAAQ,WAAW,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,gBAAgB,MAAM,WAAW;CACvC,MAAM,sBAAsB,CAAC,CAAC,MAAM;CAEpC,MAAM,eAAe,kBAAoC;EACvD,SAAS,QAAQ;EACjB,eAAe,cAAc;CAC/B,EAAE;CAMF,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,MAAM,MAAM;EAClB,OAAO,OAAO,QAAQ,aAAa,IAAI,aAAa,CAAC,IAAK,OAAO;CACnE,CAAC;CAED,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,IAAI,MAAM;EAChB,OAAO,OAAO,MAAM,aAAa,EAAE,aAAa,CAAC,IAAI;CACvD,CAAC;CAED,MAAM,WAAW,iBAAiB,eAAe,MAAM,EAAE,QAAQ,KAAK,CAAC,CAAC;CAExE,MAAM,eAAkC;EACtC;EACA;EACA,WAAW,MAAM;CACnB;CAIA,OACE,CAAC,aAAa,OAAO,cAAc;MACjC,CAAC,QACK,SAAS,GACb,aACA,OAAO,cAAc,GACrB,OAAO,cAAc,GACrB,cAAc,QAAQ,GACtB,kBAAkB,SAAS,cAAc,CAAC,GAC3C;SACE,OAAO,MAAM,aAAa,aACtB,MAAM,SAAsD,aAAa,CAAC,IAC3E,MAAM,SAAS;MACrB,EAAE,IAAI;IACR,EAAE;AAEN;;;;;;;;;;;;;AAgBA,SAAgB,mBAAmB,OAA6C;CAC9E,MAAM,UAAU,WAAW,YAAY;CAEvC,OACE,CAAC,WACK,OACJ,YAAY,MAAM,iBAAiB,WACnC,eAAe,SAAS,YAAY;AAG1C"}
|
package/dist/Autocomplete.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Provides autocomplete functionality by wrapping a text input
|
|
5
|
-
* with a filterable collection (ListBox/Menu).
|
|
6
|
-
*
|
|
7
|
-
* Port of react-aria-components/src/Autocomplete.tsx
|
|
8
|
-
*/
|
|
9
|
-
import { type JSX, type ParentProps } from "solid-js";
|
|
1
|
+
import type { ParentProps } from "solid-js";
|
|
2
|
+
import type { JSX } from "@solidjs/web";
|
|
10
3
|
import { type AriaAutocompleteOptions, type AutocompleteInputProps, type CollectionOptions } from "@proyecto-viviana/solidaria";
|
|
11
4
|
import { type AutocompleteState, type AutocompleteStateOptions, type CollectionNode } from "@proyecto-viviana/solid-stately";
|
|
12
5
|
import { type SlotProps } from "./utils";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../src/Autocomplete.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../src/Autocomplete.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO,CAC5C,SACE,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,EAC1C,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,eAAe,CAAC,EAC9D,WAAW,EACX,SAAS;CAAG;AAEhB,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,sBAAsB,CAAC;IACnC,QAAQ,EAAE,CAAC,EAAE,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,kCAAkC;IACjD,eAAe,EAAE,iBAAiB,CAAC;IACnC,aAAa,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC;CAC5E;AAED,eAAO,MAAM,mBAAmB,6DAAuD,CAAC;AACxF,eAAO,MAAM,wBAAwB,sDAAgD,CAAC;AACtF,eAAO,MAAM,6BAA6B,uEACsB,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,oBAAoB,oCAEnC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,6BAEnC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,8CAExC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CA2DlF"}
|
package/dist/Autocomplete.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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/Autocomplete.tsx
|
|
13
|
+
import { createComponent } from "@solidjs/web";
|
|
14
|
+
import { createContext, createMemo, createSignal, useContext } from "solid-js";
|
|
3
15
|
import { createAutocomplete } from "@proyecto-viviana/solidaria";
|
|
16
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
4
17
|
import { createAutocompleteState } from "@proyecto-viviana/solid-stately";
|
|
5
18
|
//#region src/Autocomplete.tsx
|
|
6
19
|
/**
|
|
@@ -103,15 +116,15 @@ function Autocomplete(props) {
|
|
|
103
116
|
},
|
|
104
117
|
filter: autocomplete.filter
|
|
105
118
|
}));
|
|
106
|
-
return createComponent(AutocompleteStateContext
|
|
119
|
+
return createComponent(AutocompleteStateContext, {
|
|
107
120
|
value: state,
|
|
108
121
|
get children() {
|
|
109
|
-
return createComponent(AutocompleteContext
|
|
122
|
+
return createComponent(AutocompleteContext, {
|
|
110
123
|
get value() {
|
|
111
124
|
return inputContextValue();
|
|
112
125
|
},
|
|
113
126
|
get children() {
|
|
114
|
-
return createComponent(AutocompleteCollectionContext
|
|
127
|
+
return createComponent(AutocompleteCollectionContext, {
|
|
115
128
|
get value() {
|
|
116
129
|
return collectionContextValue();
|
|
117
130
|
},
|
package/dist/Autocomplete.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.js","names":["
|
|
1
|
+
{"version":3,"file":"Autocomplete.js","names":["<AutocompleteStateContext value={state}>\n <AutocompleteContext value={inputContextValue()}>\n <AutocompleteCollectionContext value={collectionContextValue()}>\n {props.children}\n </AutocompleteCollectionContext>\n </AutocompleteContext>\n </AutocompleteStateContext>","value={state}","<AutocompleteContext value={inputContextValue()}>\n <AutocompleteCollectionContext value={collectionContextValue()}>\n {props.children}\n </AutocompleteCollectionContext>\n </AutocompleteContext>","<AutocompleteCollectionContext value={collectionContextValue()}>\n {props.children}\n </AutocompleteCollectionContext>"],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 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/Autocomplete.tsx\n\n/**\n * Autocomplete component for solidaria-components\n *\n * Provides autocomplete functionality by wrapping a text input\n * with a filterable collection (ListBox/Menu).\n *\n * Port of react-aria-components/src/Autocomplete.tsx\n */\n\nimport { createContext, useContext, createMemo, createSignal } from \"solid-js\";\nimport type { ParentProps } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createAutocomplete,\n type AriaAutocompleteOptions,\n type AutocompleteInputProps,\n type CollectionOptions,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createAutocompleteState,\n type AutocompleteState,\n type AutocompleteStateOptions,\n type CollectionNode,\n} from \"@proyecto-viviana/solid-stately\";\nimport { type SlotProps } from \"./utils\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface AutocompleteProps<T = unknown>\n extends\n Omit<AutocompleteStateOptions, \"children\">,\n Omit<AriaAutocompleteOptions<T>, \"inputRef\" | \"collectionRef\">,\n ParentProps,\n SlotProps {}\n\nexport interface AutocompleteContextValue {\n inputProps: AutocompleteInputProps;\n inputRef: (el: HTMLInputElement) => void;\n}\n\nexport interface AutocompleteCollectionContextValue {\n collectionProps: CollectionOptions;\n collectionRef: (el: HTMLElement) => void;\n filter?: (nodeTextValue: string, node: CollectionNode<unknown>) => boolean;\n}\n\nexport const AutocompleteContext = createContext<AutocompleteContextValue | null>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\nexport const AutocompleteCollectionContext =\n createContext<AutocompleteCollectionContextValue | null>(null);\n\n/**\n * Hook to consume autocomplete input context.\n * Use this in your input component (TextField/SearchField) to get the autocomplete props.\n */\nexport function useAutocompleteInput() {\n return useContext(AutocompleteContext);\n}\n\n/**\n * Hook to consume autocomplete state context.\n */\nexport function useAutocompleteState() {\n return useContext(AutocompleteStateContext);\n}\n\n/**\n * Hook to consume autocomplete collection context.\n * Use this in your collection component (ListBox/Menu) to get the autocomplete props.\n */\nexport function useAutocompleteCollection() {\n return useContext(AutocompleteCollectionContext);\n}\n\n/**\n * An autocomplete allows users to search or filter a list of suggestions.\n * It wraps a text input and a collection component (ListBox or Menu),\n * providing keyboard navigation and filtering capabilities.\n *\n * @example\n * ```tsx\n * // Basic usage with SearchField and ListBox\n * <Autocomplete\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * <SearchField aria-label=\"Search\">\n * <Input />\n * </SearchField>\n * <ListBox aria-label=\"Suggestions\">\n * <ListBoxItem>Option 1</ListBoxItem>\n * <ListBoxItem>Option 2</ListBoxItem>\n * <ListBoxItem>Option 3</ListBoxItem>\n * </ListBox>\n * </Autocomplete>\n *\n * // Controlled input value\n * const [value, setValue] = createSignal('');\n * <Autocomplete\n * inputValue={value()}\n * onInputChange={setValue}\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * {/* ... *\\/}\n * </Autocomplete>\n * ```\n */\nexport function Autocomplete<T = unknown>(props: AutocompleteProps<T>): JSX.Element {\n const [stateProps, ariaProps, local] = splitProps(\n props,\n [\"inputValue\", \"defaultInputValue\", \"onInputChange\"],\n [\n \"filter\",\n \"disableAutoFocusFirst\",\n \"disableVirtualFocus\",\n \"collectionId\",\n \"collectionAriaLabel\",\n ],\n );\n\n const state = createAutocompleteState(stateProps);\n\n // Refs are signals so createAutocomplete's effects (the beforeinput listener\n // and the reverse-path focusin listener that mirrors aria-activedescendant)\n // bind reactively once the input/collection elements actually mount.\n const [inputRef, setInputRef] = createSignal<HTMLInputElement>();\n const [collectionRef, setCollectionRef] = createSignal<HTMLElement>();\n\n // Create autocomplete aria\n const autocomplete = createAutocomplete<T>(\n {\n ...ariaProps,\n inputRef,\n collectionRef,\n },\n state,\n );\n\n // Input context value\n const inputContextValue = createMemo<AutocompleteContextValue>(() => ({\n inputProps: autocomplete.inputProps,\n inputRef: (el: HTMLInputElement) => {\n setInputRef(el);\n },\n }));\n\n // Collection context value\n const collectionContextValue = createMemo<AutocompleteCollectionContextValue>(() => ({\n collectionProps: autocomplete.collectionProps,\n collectionRef: (el: HTMLElement) => {\n setCollectionRef(el);\n },\n filter: autocomplete.filter as\n | ((nodeTextValue: string, node: CollectionNode<unknown>) => boolean)\n | undefined,\n }));\n\n return (\n <AutocompleteStateContext value={state}>\n <AutocompleteContext value={inputContextValue()}>\n <AutocompleteCollectionContext value={collectionContextValue()}>\n {props.children}\n </AutocompleteCollectionContext>\n </AutocompleteContext>\n </AutocompleteStateContext>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,MAAa,sBAAsB,cAA+C,IAAI;AACtF,MAAa,2BAA2B,cAAwC,IAAI;AACpF,MAAa,gCACX,cAAyD,IAAI;;;;;AAM/D,SAAgB,uBAAuB;CACrC,OAAO,WAAW,mBAAmB;AACvC;;;;AAKA,SAAgB,uBAAuB;CACrC,OAAO,WAAW,wBAAwB;AAC5C;;;;;AAMA,SAAgB,4BAA4B;CAC1C,OAAO,WAAW,6BAA6B;AACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAgB,aAA0B,OAA0C;CAClF,MAAM,CAAC,YAAY,WAAW,SAAS,WACrC,OACA;EAAC;EAAc;EAAqB;CAAe,GACnD;EACE;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,QAAQ,wBAAwB,UAAU;CAKhD,MAAM,CAAC,UAAU,eAAe,aAA+B;CAC/D,MAAM,CAAC,eAAe,oBAAoB,aAA0B;CAGpE,MAAM,eAAe,mBACnB;EACE,GAAG;EACH;EACA;CACF,GACA,KACF;CAGA,MAAM,oBAAoB,kBAA4C;EACpE,YAAY,aAAa;EACzB,WAAW,OAAyB;GAClC,YAAY,EAAE;EAChB;CACF,EAAE;CAGF,MAAM,yBAAyB,kBAAsD;EACnF,iBAAiB,aAAa;EAC9B,gBAAgB,OAAoB;GAClC,iBAAiB,EAAE;EACrB;EACA,QAAQ,aAAa;CAGvB,EAAE;CAEF,OACEA,gBAAAA,0BAAAA;EAA0BC,OAAO;EAAjC,IAAA,WAAA;GACEC,OAAAA,gBAAAA,qBAAAA;IAAqB,IAAA,QAAA;KAAO,OAAA,kBAAkB;IAAC;IAA/C,IAAA,WAAA;KACEC,OAAAA,gBAAAA,+BAAAA;MAA+B,IAAA,QAAA;OAAO,OAAA,uBAAuB;MAAC;MAA9D,IAAA,WAAA;OACG,OAAA,MAAM;MACsB;;IACZ;;EACG;;AAE9B"}
|
package/dist/Autocomplete.jsx
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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/Autocomplete.tsx
|
|
13
|
+
import { createContext, createMemo, createSignal, useContext } from "solid-js";
|
|
2
14
|
import { createAutocomplete } from "@proyecto-viviana/solidaria";
|
|
15
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
3
16
|
import { createAutocompleteState } from "@proyecto-viviana/solid-stately";
|
|
4
17
|
//#region src/Autocomplete.tsx
|
|
5
18
|
/**
|
|
@@ -102,13 +115,13 @@ function Autocomplete(props) {
|
|
|
102
115
|
},
|
|
103
116
|
filter: autocomplete.filter
|
|
104
117
|
}));
|
|
105
|
-
return <AutocompleteStateContext
|
|
106
|
-
<AutocompleteContext
|
|
107
|
-
<AutocompleteCollectionContext
|
|
118
|
+
return <AutocompleteStateContext value={state}>
|
|
119
|
+
<AutocompleteContext value={inputContextValue()}>
|
|
120
|
+
<AutocompleteCollectionContext value={collectionContextValue()}>
|
|
108
121
|
{props.children}
|
|
109
|
-
</AutocompleteCollectionContext
|
|
110
|
-
</AutocompleteContext
|
|
111
|
-
</AutocompleteStateContext
|
|
122
|
+
</AutocompleteCollectionContext>
|
|
123
|
+
</AutocompleteContext>
|
|
124
|
+
</AutocompleteStateContext>;
|
|
112
125
|
}
|
|
113
126
|
//#endregion
|
|
114
127
|
export { Autocomplete, AutocompleteCollectionContext, AutocompleteContext, AutocompleteStateContext, useAutocompleteCollection, useAutocompleteInput, useAutocompleteState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.jsx","names":[],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/**\n * Autocomplete component for solidaria-components\n *\n * Provides autocomplete functionality by wrapping a text input\n * with a filterable collection (ListBox/Menu).\n *\n * Port of react-aria-components/src/Autocomplete.tsx\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"Autocomplete.jsx","names":[],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 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/Autocomplete.tsx\n\n/**\n * Autocomplete component for solidaria-components\n *\n * Provides autocomplete functionality by wrapping a text input\n * with a filterable collection (ListBox/Menu).\n *\n * Port of react-aria-components/src/Autocomplete.tsx\n */\n\nimport { createContext, useContext, createMemo, createSignal } from \"solid-js\";\nimport type { ParentProps } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createAutocomplete,\n type AriaAutocompleteOptions,\n type AutocompleteInputProps,\n type CollectionOptions,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createAutocompleteState,\n type AutocompleteState,\n type AutocompleteStateOptions,\n type CollectionNode,\n} from \"@proyecto-viviana/solid-stately\";\nimport { type SlotProps } from \"./utils\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface AutocompleteProps<T = unknown>\n extends\n Omit<AutocompleteStateOptions, \"children\">,\n Omit<AriaAutocompleteOptions<T>, \"inputRef\" | \"collectionRef\">,\n ParentProps,\n SlotProps {}\n\nexport interface AutocompleteContextValue {\n inputProps: AutocompleteInputProps;\n inputRef: (el: HTMLInputElement) => void;\n}\n\nexport interface AutocompleteCollectionContextValue {\n collectionProps: CollectionOptions;\n collectionRef: (el: HTMLElement) => void;\n filter?: (nodeTextValue: string, node: CollectionNode<unknown>) => boolean;\n}\n\nexport const AutocompleteContext = createContext<AutocompleteContextValue | null>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\nexport const AutocompleteCollectionContext =\n createContext<AutocompleteCollectionContextValue | null>(null);\n\n/**\n * Hook to consume autocomplete input context.\n * Use this in your input component (TextField/SearchField) to get the autocomplete props.\n */\nexport function useAutocompleteInput() {\n return useContext(AutocompleteContext);\n}\n\n/**\n * Hook to consume autocomplete state context.\n */\nexport function useAutocompleteState() {\n return useContext(AutocompleteStateContext);\n}\n\n/**\n * Hook to consume autocomplete collection context.\n * Use this in your collection component (ListBox/Menu) to get the autocomplete props.\n */\nexport function useAutocompleteCollection() {\n return useContext(AutocompleteCollectionContext);\n}\n\n/**\n * An autocomplete allows users to search or filter a list of suggestions.\n * It wraps a text input and a collection component (ListBox or Menu),\n * providing keyboard navigation and filtering capabilities.\n *\n * @example\n * ```tsx\n * // Basic usage with SearchField and ListBox\n * <Autocomplete\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * <SearchField aria-label=\"Search\">\n * <Input />\n * </SearchField>\n * <ListBox aria-label=\"Suggestions\">\n * <ListBoxItem>Option 1</ListBoxItem>\n * <ListBoxItem>Option 2</ListBoxItem>\n * <ListBoxItem>Option 3</ListBoxItem>\n * </ListBox>\n * </Autocomplete>\n *\n * // Controlled input value\n * const [value, setValue] = createSignal('');\n * <Autocomplete\n * inputValue={value()}\n * onInputChange={setValue}\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * {/* ... *\\/}\n * </Autocomplete>\n * ```\n */\nexport function Autocomplete<T = unknown>(props: AutocompleteProps<T>): JSX.Element {\n const [stateProps, ariaProps, local] = splitProps(\n props,\n [\"inputValue\", \"defaultInputValue\", \"onInputChange\"],\n [\n \"filter\",\n \"disableAutoFocusFirst\",\n \"disableVirtualFocus\",\n \"collectionId\",\n \"collectionAriaLabel\",\n ],\n );\n\n const state = createAutocompleteState(stateProps);\n\n // Refs are signals so createAutocomplete's effects (the beforeinput listener\n // and the reverse-path focusin listener that mirrors aria-activedescendant)\n // bind reactively once the input/collection elements actually mount.\n const [inputRef, setInputRef] = createSignal<HTMLInputElement>();\n const [collectionRef, setCollectionRef] = createSignal<HTMLElement>();\n\n // Create autocomplete aria\n const autocomplete = createAutocomplete<T>(\n {\n ...ariaProps,\n inputRef,\n collectionRef,\n },\n state,\n );\n\n // Input context value\n const inputContextValue = createMemo<AutocompleteContextValue>(() => ({\n inputProps: autocomplete.inputProps,\n inputRef: (el: HTMLInputElement) => {\n setInputRef(el);\n },\n }));\n\n // Collection context value\n const collectionContextValue = createMemo<AutocompleteCollectionContextValue>(() => ({\n collectionProps: autocomplete.collectionProps,\n collectionRef: (el: HTMLElement) => {\n setCollectionRef(el);\n },\n filter: autocomplete.filter as\n | ((nodeTextValue: string, node: CollectionNode<unknown>) => boolean)\n | undefined,\n }));\n\n return (\n <AutocompleteStateContext value={state}>\n <AutocompleteContext value={inputContextValue()}>\n <AutocompleteCollectionContext value={collectionContextValue()}>\n {props.children}\n </AutocompleteCollectionContext>\n </AutocompleteContext>\n </AutocompleteStateContext>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,MAAa,sBAAsB,cAA+C,IAAI;AACtF,MAAa,2BAA2B,cAAwC,IAAI;AACpF,MAAa,gCACX,cAAyD,IAAI;;;;;AAM/D,SAAgB,uBAAuB;CACrC,OAAO,WAAW,mBAAmB;AACvC;;;;AAKA,SAAgB,uBAAuB;CACrC,OAAO,WAAW,wBAAwB;AAC5C;;;;;AAMA,SAAgB,4BAA4B;CAC1C,OAAO,WAAW,6BAA6B;AACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAgB,aAA0B,OAA0C;CAClF,MAAM,CAAC,YAAY,WAAW,SAAS,WACrC,OACA;EAAC;EAAc;EAAqB;CAAe,GACnD;EACE;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,QAAQ,wBAAwB,UAAU;CAKhD,MAAM,CAAC,UAAU,eAAe,aAA+B;CAC/D,MAAM,CAAC,eAAe,oBAAoB,aAA0B;CAGpE,MAAM,eAAe,mBACnB;EACE,GAAG;EACH;EACA;CACF,GACA,KACF;CAGA,MAAM,oBAAoB,kBAA4C;EACpE,YAAY,aAAa;EACzB,WAAW,OAAyB;GAClC,YAAY,EAAE;EAChB;CACF,EAAE;CAGF,MAAM,yBAAyB,kBAAsD;EACnF,iBAAiB,aAAa;EAC9B,gBAAgB,OAAoB;GAClC,iBAAiB,EAAE;EACrB;EACA,QAAQ,aAAa;CAGvB,EAAE;CAEF,OACE,CAAC,yBAAyB,OAAO,OAAO;MACtC,CAAC,oBAAoB,OAAO,kBAAkB,GAAG;QAC/C,CAAC,8BAA8B,OAAO,uBAAuB,GAAG;WAC7D,MAAM,SAAS;QAClB,EAAE,8BAA8B;MAClC,EAAE,oBAAoB;IACxB,EAAE;AAEN"}
|
package/dist/Breadcrumbs.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* A pre-wired headless breadcrumbs component that combines aria hooks.
|
|
5
|
-
* Port of react-aria-components Breadcrumbs.
|
|
6
|
-
*/
|
|
7
|
-
import { type Accessor, type JSX } from "solid-js";
|
|
1
|
+
import type { Accessor } from "solid-js";
|
|
2
|
+
import type { JSX } from "@solidjs/web";
|
|
8
3
|
import { type AriaBreadcrumbsProps, type AriaBreadcrumbItemProps } from "@proyecto-viviana/solidaria";
|
|
9
4
|
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
10
5
|
type RefLike<T> = ((el: T) => void) | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../src/Breadcrumbs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../src/Breadcrumbs.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAE7B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAKf,MAAM,SAAS,CAAC;AAEjB,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,CAAC;AAczE,MAAM,WAAW,sBAAsB;IACrC,4CAA4C;IAC5C,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC,EAAE,SAAS;IAC9F,8CAA8C;IAC9C,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACZ,4CAA4C;IAC5C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC;IACtC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC1C,gFAAgF;IAChF,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC;IACpD,yCAAyC;IACzC,KAAK,CAAC,EAAE,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;IACpD,wCAAwC;IACxC,KAAK,CAAC,EAAE,eAAe,CAAC,sBAAsB,CAAC,CAAC;IAChD,sCAAsC;IACtC,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACxC,6CAA6C;IAC7C,SAAS,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,cAAc,EAAE,OAAO,CAAC;IACxB,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,uBAAuB,EAAE,YAAY,CAAC,EAAE,SAAS;IAC9D,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,cAAc,CAAC,yBAAyB,CAAC,CAAC;IACrD,yCAAyC;IACzC,KAAK,CAAC,EAAE,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;IACvD,wCAAwC;IACxC,KAAK,CAAC,EAAE,eAAe,CAAC,yBAAyB,CAAC,CAAC;IACnD,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC5B;AAED,UAAU,uBAAuB;IAC/B,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC1C,kBAAkB,CAAC,EAAE,MAAM,MAAM,CAAC;IAClC,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,kBAAkB,4DAAsD,CAAC;AAEtF,UAAU,0BAA0B;IAClC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,qBAAqB,+DAAyD,CAAC;AAO5F;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CA8GtE;yBA9Ge,WAAW;;;AAiI3B;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAyKtE"}
|
package/dist/Breadcrumbs.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
|
|
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/Breadcrumbs.tsx
|
|
13
|
+
import { attrTrue, dataAttr, filterDOMProps, useRenderProps } from "./utils.js";
|
|
2
14
|
import { ElementTag } from "./ElementTag.js";
|
|
3
|
-
import { createComponent, getNextElement, insert, memo, mergeProps, runHydrationEvents, spread, template
|
|
4
|
-
import { For, Show, children, createContext, createMemo, createSignal,
|
|
5
|
-
import { createBreadcrumbItem, createBreadcrumbs, createFocusRing, createHover, mergeProps as mergeProps$
|
|
15
|
+
import { createComponent, getNextElement, insert, memo, mergeProps, ref, runHydrationEvents, spread, template } from "@solidjs/web";
|
|
16
|
+
import { For, Show, children, createContext, createMemo, createSignal, useContext } from "solid-js";
|
|
17
|
+
import { createBreadcrumbItem, createBreadcrumbs, createFocusRing, createHover, mergeProps as mergeProps$1 } from "@proyecto-viviana/solidaria";
|
|
18
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
6
19
|
//#region src/Breadcrumbs.tsx
|
|
7
20
|
/**
|
|
8
21
|
* Breadcrumbs component for solidaria-components
|
|
@@ -10,8 +23,9 @@ import { createBreadcrumbItem, createBreadcrumbs, createFocusRing, createHover,
|
|
|
10
23
|
* A pre-wired headless breadcrumbs component that combines aria hooks.
|
|
11
24
|
* Port of react-aria-components Breadcrumbs.
|
|
12
25
|
*/
|
|
13
|
-
var _tmpl$ =
|
|
14
|
-
|
|
26
|
+
var _tmpl$ = /* @__PURE__ */ template(`<ol>`);
|
|
27
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<li style=display:flex;align-items:center>`);
|
|
28
|
+
function assignRef$1(ref, el) {
|
|
15
29
|
if (!ref) return;
|
|
16
30
|
if (typeof ref === "function") ref(el);
|
|
17
31
|
else ref.current = el;
|
|
@@ -46,7 +60,7 @@ function Breadcrumbs(props) {
|
|
|
46
60
|
const items = () => local.items ?? [];
|
|
47
61
|
const hasCollectionItems = () => local.items !== void 0;
|
|
48
62
|
const getItemKey = (item, index) => local.getKey?.(item) ?? defaultItemKey(item, index);
|
|
49
|
-
const [staticItemCount, setStaticItemCount] = createSignal(0);
|
|
63
|
+
const [staticItemCount, setStaticItemCount] = createSignal(0, { ownedWrite: true });
|
|
50
64
|
let nextStaticIndex = 0;
|
|
51
65
|
const resetStaticItems = () => {
|
|
52
66
|
nextStaticIndex = 0;
|
|
@@ -78,7 +92,7 @@ function Breadcrumbs(props) {
|
|
|
78
92
|
defaultClassName: "solidaria-Breadcrumbs"
|
|
79
93
|
}, renderValues);
|
|
80
94
|
const domProps = createMemo(() => filterDOMProps(rest, { global: true }));
|
|
81
|
-
return createComponent(BreadcrumbsContext
|
|
95
|
+
return createComponent(BreadcrumbsContext, {
|
|
82
96
|
get value() {
|
|
83
97
|
return {
|
|
84
98
|
isDisabled,
|
|
@@ -91,18 +105,24 @@ function Breadcrumbs(props) {
|
|
|
91
105
|
},
|
|
92
106
|
get children() {
|
|
93
107
|
var _el$ = getNextElement(_tmpl$);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
ref(() => {
|
|
109
|
+
return (element) => assignRef$1(local.ref, element);
|
|
110
|
+
}, _el$);
|
|
111
|
+
spread(_el$, [
|
|
112
|
+
navProps,
|
|
113
|
+
domProps,
|
|
114
|
+
{
|
|
115
|
+
get "class"() {
|
|
116
|
+
return renderProps.class();
|
|
117
|
+
},
|
|
118
|
+
get style() {
|
|
119
|
+
return renderProps.style();
|
|
120
|
+
},
|
|
121
|
+
get "data-disabled"() {
|
|
122
|
+
return dataAttr(isDisabled());
|
|
123
|
+
}
|
|
104
124
|
}
|
|
105
|
-
|
|
125
|
+
], true);
|
|
106
126
|
insert(_el$, createComponent(Show, {
|
|
107
127
|
get when() {
|
|
108
128
|
return hasCollectionItems();
|
|
@@ -121,19 +141,17 @@ function Breadcrumbs(props) {
|
|
|
121
141
|
const itemKey = getItemKey(item, index());
|
|
122
142
|
const isLast = () => index() === items().length - 1;
|
|
123
143
|
const renderItem = local.children;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return _el$2;
|
|
136
|
-
})();
|
|
144
|
+
var _el$2 = getNextElement(_tmpl$2);
|
|
145
|
+
insert(_el$2, createComponent(BreadcrumbItemContext, {
|
|
146
|
+
value: {
|
|
147
|
+
itemKey,
|
|
148
|
+
isLast
|
|
149
|
+
},
|
|
150
|
+
get children() {
|
|
151
|
+
return renderItem?.(item);
|
|
152
|
+
}
|
|
153
|
+
}));
|
|
154
|
+
return _el$2;
|
|
137
155
|
}
|
|
138
156
|
});
|
|
139
157
|
}
|
|
@@ -260,7 +278,7 @@ function BreadcrumbItem(props) {
|
|
|
260
278
|
const { isHovered, hoverProps } = createHover({ get isDisabled() {
|
|
261
279
|
return isDisabled();
|
|
262
280
|
} });
|
|
263
|
-
const mergedItemProps = createMemo(() => mergeProps$
|
|
281
|
+
const mergedItemProps = createMemo(() => mergeProps$1(itemAria.itemProps, focusProps, hoverProps));
|
|
264
282
|
const renderValues = createMemo(() => ({
|
|
265
283
|
isCurrent: isCurrent(),
|
|
266
284
|
isDisabled: isDisabled(),
|
|
@@ -291,36 +309,38 @@ function BreadcrumbItem(props) {
|
|
|
291
309
|
return createComponent(ElementTag, mergeProps({ get tag() {
|
|
292
310
|
return elementType();
|
|
293
311
|
} }, mergedItemProps, {
|
|
294
|
-
ref: (element) => assignRef(local.ref, element),
|
|
295
|
-
get
|
|
296
|
-
return memo(() =>
|
|
312
|
+
ref: (element) => assignRef$1(local.ref, element),
|
|
313
|
+
get "aria-current"() {
|
|
314
|
+
return memo(() => {
|
|
315
|
+
return !!isCurrent();
|
|
316
|
+
})() ? ariaProps["aria-current"] ?? "page" : void 0;
|
|
297
317
|
},
|
|
298
|
-
get
|
|
299
|
-
return isDisabled() || isCurrent()
|
|
318
|
+
get "aria-disabled"() {
|
|
319
|
+
return attrTrue(isDisabled() || isCurrent());
|
|
300
320
|
},
|
|
301
|
-
get
|
|
321
|
+
get "class"() {
|
|
302
322
|
return renderProps.class();
|
|
303
323
|
},
|
|
304
324
|
get style() {
|
|
305
325
|
return mergedStyle();
|
|
306
326
|
},
|
|
307
|
-
get
|
|
308
|
-
return isCurrent()
|
|
327
|
+
get "data-current"() {
|
|
328
|
+
return dataAttr(isCurrent());
|
|
309
329
|
},
|
|
310
|
-
get
|
|
311
|
-
return isDisabled()
|
|
330
|
+
get "data-disabled"() {
|
|
331
|
+
return dataAttr(isDisabled());
|
|
312
332
|
},
|
|
313
|
-
get
|
|
314
|
-
return isPressed()
|
|
333
|
+
get "data-pressed"() {
|
|
334
|
+
return dataAttr(isPressed());
|
|
315
335
|
},
|
|
316
|
-
get
|
|
317
|
-
return isFocused()
|
|
336
|
+
get "data-focused"() {
|
|
337
|
+
return dataAttr(isFocused());
|
|
318
338
|
},
|
|
319
|
-
get
|
|
320
|
-
return isFocusVisible()
|
|
339
|
+
get "data-focus-visible"() {
|
|
340
|
+
return dataAttr(isFocusVisible());
|
|
321
341
|
},
|
|
322
|
-
get
|
|
323
|
-
return isHovered()
|
|
342
|
+
get "data-hovered"() {
|
|
343
|
+
return dataAttr(isHovered());
|
|
324
344
|
},
|
|
325
345
|
get children() {
|
|
326
346
|
return renderProps.renderChildren();
|