@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/src/Color.tsx
CHANGED
|
@@ -1,22 +1,81 @@
|
|
|
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
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
15
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
17
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
20
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
21
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
22
|
+
* governing permissions and limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
27
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
28
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
29
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
30
|
+
*
|
|
31
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
32
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
33
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
34
|
+
* governing permissions and limitations under the License.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorArea.tsx
|
|
38
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorField.tsx
|
|
39
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorPicker.tsx
|
|
40
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorSlider.tsx
|
|
41
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorSwatch.tsx
|
|
42
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorSwatchPicker.tsx
|
|
43
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorThumb.tsx
|
|
44
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorWheel.tsx
|
|
45
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/selection/ListKeyboardDelegate.ts
|
|
46
|
+
|
|
1
47
|
/**
|
|
2
|
-
* Color components for solidaria-components
|
|
48
|
+
* Color components for solidaria-components.
|
|
3
49
|
*
|
|
4
50
|
* Pre-wired headless color picker components that combine state + aria hooks.
|
|
5
|
-
*
|
|
51
|
+
* Based on these pinned React Aria Components sources:
|
|
52
|
+
* - packages/react-aria-components/src/ColorArea.tsx
|
|
53
|
+
* - packages/react-aria-components/src/ColorField.tsx
|
|
54
|
+
* - packages/react-aria-components/src/ColorPicker.tsx
|
|
55
|
+
* - packages/react-aria-components/src/ColorSlider.tsx
|
|
56
|
+
* - packages/react-aria-components/src/ColorSwatch.tsx
|
|
57
|
+
* - packages/react-aria-components/src/ColorSwatchPicker.tsx
|
|
58
|
+
* - packages/react-aria-components/src/ColorThumb.tsx
|
|
59
|
+
* - packages/react-aria-components/src/ColorWheel.tsx
|
|
60
|
+
* - packages/react-aria/src/selection/ListKeyboardDelegate.ts
|
|
61
|
+
*
|
|
62
|
+
* This Solid module combines the upstream component files and grid keyboard behavior.
|
|
6
63
|
*/
|
|
7
64
|
|
|
8
65
|
import {
|
|
9
|
-
type JSX,
|
|
10
66
|
createContext,
|
|
11
67
|
createEffect,
|
|
12
68
|
createMemo,
|
|
13
69
|
createSignal,
|
|
70
|
+
flush,
|
|
14
71
|
onCleanup,
|
|
15
|
-
splitProps,
|
|
16
72
|
untrack,
|
|
17
73
|
useContext,
|
|
18
74
|
Show,
|
|
75
|
+
createTrackedEffect,
|
|
19
76
|
} from "solid-js";
|
|
77
|
+
import type { Context } from "solid-js";
|
|
78
|
+
import type { JSX } from "@solidjs/web";
|
|
20
79
|
import {
|
|
21
80
|
createColorSlider,
|
|
22
81
|
createColorArea,
|
|
@@ -29,6 +88,7 @@ import {
|
|
|
29
88
|
createHover,
|
|
30
89
|
mergeProps,
|
|
31
90
|
useLocale,
|
|
91
|
+
createStringFormatter,
|
|
32
92
|
type AriaColorSliderOptions,
|
|
33
93
|
type AriaColorAreaOptions,
|
|
34
94
|
type AriaColorWheelOptions,
|
|
@@ -40,6 +100,7 @@ import {
|
|
|
40
100
|
createColorAreaState,
|
|
41
101
|
createColorWheelState,
|
|
42
102
|
createColorFieldState,
|
|
103
|
+
VALID_VALIDITY_STATE,
|
|
43
104
|
normalizeColor,
|
|
44
105
|
type Color,
|
|
45
106
|
type ColorChannel,
|
|
@@ -59,7 +120,14 @@ import {
|
|
|
59
120
|
type SlotProps,
|
|
60
121
|
useRenderProps,
|
|
61
122
|
filterDOMProps,
|
|
123
|
+
Provider,
|
|
124
|
+
dataAttr,
|
|
125
|
+
attrString,
|
|
62
126
|
} from "./utils";
|
|
127
|
+
import { FieldErrorContext, type FieldErrorContextValue } from "./FieldError";
|
|
128
|
+
import { TextContext } from "./Text";
|
|
129
|
+
import { racIntlStrings } from "./intl";
|
|
130
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
63
131
|
|
|
64
132
|
interface ColorPickerChannelContextValue {
|
|
65
133
|
value?: Color | string;
|
|
@@ -309,7 +377,7 @@ export function ColorSlider(props: ColorSliderProps): JSX.Element {
|
|
|
309
377
|
);
|
|
310
378
|
|
|
311
379
|
return (
|
|
312
|
-
<ColorSliderContext
|
|
380
|
+
<ColorSliderContext
|
|
313
381
|
value={{
|
|
314
382
|
state,
|
|
315
383
|
get trackProps() {
|
|
@@ -338,14 +406,14 @@ export function ColorSlider(props: ColorSliderProps): JSX.Element {
|
|
|
338
406
|
{...domProps()}
|
|
339
407
|
class={renderProps.class()}
|
|
340
408
|
style={renderProps.style()}
|
|
341
|
-
data-disabled={state.isDisabled
|
|
342
|
-
data-dragging={state.isDragging
|
|
409
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
410
|
+
data-dragging={dataAttr(state.isDragging)}
|
|
343
411
|
data-orientation={state.orientation}
|
|
344
412
|
slot={local.slot || undefined}
|
|
345
413
|
>
|
|
346
|
-
{renderProps.
|
|
414
|
+
{renderProps.renderChildrenStable()}
|
|
347
415
|
</div>
|
|
348
|
-
</ColorSliderContext
|
|
416
|
+
</ColorSliderContext>
|
|
349
417
|
);
|
|
350
418
|
}
|
|
351
419
|
|
|
@@ -462,11 +530,11 @@ export function ColorSliderTrack(props: ColorSliderTrackProps): JSX.Element {
|
|
|
462
530
|
{...cleanTrackProps()}
|
|
463
531
|
class={renderProps.class()}
|
|
464
532
|
style={mergedStyle()}
|
|
465
|
-
data-disabled={state.isDisabled
|
|
466
|
-
data-dragging={state.isDragging
|
|
533
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
534
|
+
data-dragging={dataAttr(state.isDragging)}
|
|
467
535
|
data-orientation={state.orientation}
|
|
468
536
|
>
|
|
469
|
-
{renderProps.
|
|
537
|
+
{renderProps.renderChildrenStable()}
|
|
470
538
|
</div>
|
|
471
539
|
);
|
|
472
540
|
}
|
|
@@ -537,6 +605,16 @@ export function ColorSliderThumb(props: ColorSliderThumbProps): JSX.Element {
|
|
|
537
605
|
) as JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
538
606
|
};
|
|
539
607
|
|
|
608
|
+
let sliderInput: HTMLInputElement | undefined;
|
|
609
|
+
createEffect(
|
|
610
|
+
() => state.getThumbValue(),
|
|
611
|
+
(value) => {
|
|
612
|
+
if (sliderInput && sliderInput.value !== String(value)) {
|
|
613
|
+
sliderInput.value = String(value);
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
);
|
|
617
|
+
|
|
540
618
|
const mergedStyle = () => {
|
|
541
619
|
const thumbStyle = (context.thumbProps as { style?: Record<string, string> }).style || {};
|
|
542
620
|
const renderStyle = renderProps.style() || {};
|
|
@@ -551,14 +629,21 @@ export function ColorSliderThumb(props: ColorSliderThumbProps): JSX.Element {
|
|
|
551
629
|
ref={local.ref}
|
|
552
630
|
class={renderProps.class()}
|
|
553
631
|
style={mergedStyle()}
|
|
554
|
-
data-disabled={state.isDisabled
|
|
555
|
-
data-dragging={state.isDragging
|
|
556
|
-
data-focused={isFocused()
|
|
557
|
-
data-focus-visible={isFocusVisible()
|
|
558
|
-
data-hovered={isHovered()
|
|
632
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
633
|
+
data-dragging={dataAttr(state.isDragging)}
|
|
634
|
+
data-focused={dataAttr(isFocused())}
|
|
635
|
+
data-focus-visible={dataAttr(isFocusVisible())}
|
|
636
|
+
data-hovered={dataAttr(isHovered())}
|
|
559
637
|
>
|
|
560
|
-
<input
|
|
561
|
-
|
|
638
|
+
<input
|
|
639
|
+
ref={(el) => {
|
|
640
|
+
sliderInput = el;
|
|
641
|
+
context.setInputRef(el);
|
|
642
|
+
if (el) el.value = String(state.getThumbValue());
|
|
643
|
+
}}
|
|
644
|
+
{...mergedInputProps()}
|
|
645
|
+
/>
|
|
646
|
+
{renderProps.renderChildrenStable()}
|
|
562
647
|
</div>
|
|
563
648
|
);
|
|
564
649
|
}
|
|
@@ -782,7 +867,7 @@ export function ColorArea(props: ColorAreaProps): JSX.Element {
|
|
|
782
867
|
};
|
|
783
868
|
|
|
784
869
|
return (
|
|
785
|
-
<ColorAreaContext
|
|
870
|
+
<ColorAreaContext
|
|
786
871
|
value={{
|
|
787
872
|
state,
|
|
788
873
|
get colorAreaProps() {
|
|
@@ -811,12 +896,12 @@ export function ColorArea(props: ColorAreaProps): JSX.Element {
|
|
|
811
896
|
class={renderProps.class()}
|
|
812
897
|
style={mergedStyle()}
|
|
813
898
|
slot={local.slot ?? undefined}
|
|
814
|
-
data-disabled={state.isDisabled
|
|
815
|
-
data-dragging={state.isDragging
|
|
899
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
900
|
+
data-dragging={dataAttr(state.isDragging)}
|
|
816
901
|
>
|
|
817
902
|
{colorAreaChildren()}
|
|
818
903
|
</div>
|
|
819
|
-
</ColorAreaContext
|
|
904
|
+
</ColorAreaContext>
|
|
820
905
|
);
|
|
821
906
|
}
|
|
822
907
|
|
|
@@ -870,7 +955,7 @@ export function ColorAreaGradient(props: ColorAreaGradientProps): JSX.Element {
|
|
|
870
955
|
{...cleanGradientProps()}
|
|
871
956
|
class={renderProps.class()}
|
|
872
957
|
style={mergedStyle()}
|
|
873
|
-
data-disabled={state.isDisabled
|
|
958
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
874
959
|
>
|
|
875
960
|
{renderProps.renderChildren()}
|
|
876
961
|
</div>
|
|
@@ -964,11 +1049,11 @@ export function ColorAreaThumb(props: ColorAreaThumbProps): JSX.Element {
|
|
|
964
1049
|
queueMicrotask(update);
|
|
965
1050
|
};
|
|
966
1051
|
|
|
967
|
-
|
|
1052
|
+
createTrackedEffect(() => {
|
|
968
1053
|
syncInputValue(xInputRef, state.getXValue());
|
|
969
1054
|
});
|
|
970
1055
|
|
|
971
|
-
|
|
1056
|
+
createTrackedEffect(() => {
|
|
972
1057
|
syncInputValue(yInputRef, state.getYValue());
|
|
973
1058
|
});
|
|
974
1059
|
|
|
@@ -980,11 +1065,11 @@ export function ColorAreaThumb(props: ColorAreaThumbProps): JSX.Element {
|
|
|
980
1065
|
{...cleanHoverProps()}
|
|
981
1066
|
class={renderProps.class()}
|
|
982
1067
|
style={mergedStyle()}
|
|
983
|
-
data-disabled={state.isDisabled
|
|
984
|
-
data-dragging={state.isDragging
|
|
985
|
-
data-focused={isFocused()
|
|
986
|
-
data-focus-visible={isFocusVisible()
|
|
987
|
-
data-hovered={isHovered()
|
|
1068
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
1069
|
+
data-dragging={dataAttr(state.isDragging)}
|
|
1070
|
+
data-focused={dataAttr(isFocused())}
|
|
1071
|
+
data-focus-visible={dataAttr(isFocusVisible())}
|
|
1072
|
+
data-hovered={dataAttr(isHovered())}
|
|
988
1073
|
>
|
|
989
1074
|
<input
|
|
990
1075
|
{...mergedXInputProps()}
|
|
@@ -1177,7 +1262,7 @@ export function ColorWheel(props: ColorWheelProps): JSX.Element {
|
|
|
1177
1262
|
);
|
|
1178
1263
|
|
|
1179
1264
|
return (
|
|
1180
|
-
<ColorWheelContext
|
|
1265
|
+
<ColorWheelContext
|
|
1181
1266
|
value={{
|
|
1182
1267
|
state,
|
|
1183
1268
|
get trackProps() {
|
|
@@ -1201,12 +1286,12 @@ export function ColorWheel(props: ColorWheelProps): JSX.Element {
|
|
|
1201
1286
|
class={renderProps.class()}
|
|
1202
1287
|
style={renderProps.style()}
|
|
1203
1288
|
slot={local.slot || undefined}
|
|
1204
|
-
data-disabled={state.isDisabled
|
|
1205
|
-
data-dragging={state.isDragging
|
|
1289
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
1290
|
+
data-dragging={dataAttr(state.isDragging)}
|
|
1206
1291
|
>
|
|
1207
|
-
{renderProps.
|
|
1292
|
+
{renderProps.renderChildrenStable()}
|
|
1208
1293
|
</div>
|
|
1209
|
-
</ColorWheelContext
|
|
1294
|
+
</ColorWheelContext>
|
|
1210
1295
|
);
|
|
1211
1296
|
}
|
|
1212
1297
|
|
|
@@ -1262,10 +1347,10 @@ export function ColorWheelTrack(props: ColorWheelTrackProps): JSX.Element {
|
|
|
1262
1347
|
{...cleanTrackProps()}
|
|
1263
1348
|
class={renderProps.class()}
|
|
1264
1349
|
style={mergedStyle()}
|
|
1265
|
-
data-disabled={state.isDisabled
|
|
1266
|
-
data-dragging={state.isDragging
|
|
1350
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
1351
|
+
data-dragging={dataAttr(state.isDragging)}
|
|
1267
1352
|
>
|
|
1268
|
-
{renderProps.
|
|
1353
|
+
{renderProps.renderChildrenStable()}
|
|
1269
1354
|
</div>
|
|
1270
1355
|
);
|
|
1271
1356
|
}
|
|
@@ -1350,14 +1435,14 @@ export function ColorWheelThumb(props: ColorWheelThumbProps): JSX.Element {
|
|
|
1350
1435
|
{...cleanHoverProps()}
|
|
1351
1436
|
class={renderProps.class()}
|
|
1352
1437
|
style={mergedStyle()}
|
|
1353
|
-
data-disabled={state.isDisabled
|
|
1354
|
-
data-dragging={state.isDragging
|
|
1355
|
-
data-focused={isFocused()
|
|
1356
|
-
data-focus-visible={isFocusVisible()
|
|
1357
|
-
data-hovered={isHovered()
|
|
1438
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
1439
|
+
data-dragging={dataAttr(state.isDragging)}
|
|
1440
|
+
data-focused={dataAttr(isFocused())}
|
|
1441
|
+
data-focus-visible={dataAttr(isFocusVisible())}
|
|
1442
|
+
data-hovered={dataAttr(isHovered())}
|
|
1358
1443
|
>
|
|
1359
1444
|
<input {...mergedInputProps()} />
|
|
1360
|
-
{renderProps.
|
|
1445
|
+
{renderProps.renderChildrenStable()}
|
|
1361
1446
|
</div>
|
|
1362
1447
|
);
|
|
1363
1448
|
}
|
|
@@ -1474,7 +1559,9 @@ export function ColorField(props: ColorFieldProps): JSX.Element {
|
|
|
1474
1559
|
"placeholder",
|
|
1475
1560
|
],
|
|
1476
1561
|
);
|
|
1477
|
-
const [hasRegisteredLabelElement, setHasRegisteredLabelElement] = createSignal(false
|
|
1562
|
+
const [hasRegisteredLabelElement, setHasRegisteredLabelElement] = createSignal(false, {
|
|
1563
|
+
ownedWrite: true,
|
|
1564
|
+
});
|
|
1478
1565
|
|
|
1479
1566
|
// Create color field state
|
|
1480
1567
|
const state = createColorFieldState(() => ({
|
|
@@ -1524,21 +1611,13 @@ export function ColorField(props: ColorFieldProps): JSX.Element {
|
|
|
1524
1611
|
placeholder: ariaProps.placeholder,
|
|
1525
1612
|
channel: stateProps.channel,
|
|
1526
1613
|
colorSpace: stateProps.colorSpace,
|
|
1614
|
+
description: local.description,
|
|
1615
|
+
errorMessage: local.errorMessage,
|
|
1527
1616
|
}),
|
|
1528
1617
|
() => state,
|
|
1529
1618
|
() => inputRef ?? null,
|
|
1530
1619
|
);
|
|
1531
1620
|
|
|
1532
|
-
const describedBy = () => {
|
|
1533
|
-
const invalid = ariaProps.isInvalid || state.isInvalid;
|
|
1534
|
-
const ids = [
|
|
1535
|
-
ariaProps["aria-describedby"],
|
|
1536
|
-
local.description && !invalid ? colorFieldAria.descriptionProps.id : undefined,
|
|
1537
|
-
invalid && local.errorMessage ? colorFieldAria.errorMessageProps.id : undefined,
|
|
1538
|
-
];
|
|
1539
|
-
return ids.filter(Boolean).join(" ") || undefined;
|
|
1540
|
-
};
|
|
1541
|
-
|
|
1542
1621
|
const fieldInputProps = () => {
|
|
1543
1622
|
const labelledBy =
|
|
1544
1623
|
ariaProps["aria-labelledby"] ??
|
|
@@ -1549,11 +1628,6 @@ export function ColorField(props: ColorFieldProps): JSX.Element {
|
|
|
1549
1628
|
...colorFieldAria.inputProps,
|
|
1550
1629
|
"aria-label": labelledBy ? undefined : colorFieldAria.inputProps["aria-label"],
|
|
1551
1630
|
"aria-labelledby": labelledBy,
|
|
1552
|
-
"aria-describedby": describedBy(),
|
|
1553
|
-
"aria-errormessage":
|
|
1554
|
-
(ariaProps.isInvalid || state.isInvalid) && local.errorMessage
|
|
1555
|
-
? colorFieldAria.errorMessageProps.id
|
|
1556
|
-
: colorFieldAria.inputProps["aria-errormessage"],
|
|
1557
1631
|
} as JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
1558
1632
|
};
|
|
1559
1633
|
|
|
@@ -1619,8 +1693,42 @@ export function ColorField(props: ColorFieldProps): JSX.Element {
|
|
|
1619
1693
|
filterDOMProps(rest as Record<string, unknown>, { global: true }),
|
|
1620
1694
|
);
|
|
1621
1695
|
|
|
1696
|
+
// RAC ColorField `useChildren` (ColorField.tsx:258-282) provides
|
|
1697
|
+
// description / errorMessage as `TextContext` slots and a
|
|
1698
|
+
// `FieldErrorContext`, so `<Text slot="description">` / `<FieldError>`
|
|
1699
|
+
// pick up the `id` `aria-describedby` references. `createField` +
|
|
1700
|
+
// `createSlotId` only keep those ids on the input when the slot is in
|
|
1701
|
+
// the DOM.
|
|
1702
|
+
const textSlots = {
|
|
1703
|
+
slots: {
|
|
1704
|
+
get description() {
|
|
1705
|
+
return colorFieldAria.descriptionProps;
|
|
1706
|
+
},
|
|
1707
|
+
get errorMessage() {
|
|
1708
|
+
return colorFieldAria.errorMessageProps;
|
|
1709
|
+
},
|
|
1710
|
+
},
|
|
1711
|
+
};
|
|
1712
|
+
const fieldErrorContext: FieldErrorContextValue = {
|
|
1713
|
+
get validation() {
|
|
1714
|
+
const invalid = ariaProps.isInvalid || state.isInvalid;
|
|
1715
|
+
const errorMessage = local.errorMessage;
|
|
1716
|
+
const validationErrors = invalid && typeof errorMessage === "string" ? [errorMessage] : [];
|
|
1717
|
+
return {
|
|
1718
|
+
isInvalid: invalid,
|
|
1719
|
+
validationErrors,
|
|
1720
|
+
validationDetails: invalid
|
|
1721
|
+
? { ...VALID_VALIDITY_STATE, customError: true, valid: false }
|
|
1722
|
+
: VALID_VALIDITY_STATE,
|
|
1723
|
+
};
|
|
1724
|
+
},
|
|
1725
|
+
get errorMessageProps() {
|
|
1726
|
+
return colorFieldAria.errorMessageProps;
|
|
1727
|
+
},
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1622
1730
|
return (
|
|
1623
|
-
<ColorFieldContext
|
|
1731
|
+
<ColorFieldContext
|
|
1624
1732
|
value={{
|
|
1625
1733
|
state,
|
|
1626
1734
|
get inputProps() {
|
|
@@ -1645,17 +1753,26 @@ export function ColorField(props: ColorFieldProps): JSX.Element {
|
|
|
1645
1753
|
class={renderProps.class()}
|
|
1646
1754
|
style={renderProps.style()}
|
|
1647
1755
|
slot={local.slot ?? undefined}
|
|
1648
|
-
data-disabled={state.isDisabled
|
|
1649
|
-
data-readonly={state.isReadOnly
|
|
1650
|
-
data-invalid={state.isInvalid
|
|
1651
|
-
data-required={state.isRequired
|
|
1756
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
1757
|
+
data-readonly={dataAttr(state.isReadOnly)}
|
|
1758
|
+
data-invalid={dataAttr(state.isInvalid)}
|
|
1759
|
+
data-required={dataAttr(state.isRequired)}
|
|
1652
1760
|
data-channel={state.channel ?? "hex"}
|
|
1653
1761
|
>
|
|
1654
1762
|
<Show when={local.label}>
|
|
1655
1763
|
<label {...colorFieldAria.labelProps}>{local.label}</label>
|
|
1656
1764
|
</Show>
|
|
1657
1765
|
|
|
1658
|
-
|
|
1766
|
+
<Provider
|
|
1767
|
+
values={
|
|
1768
|
+
[
|
|
1769
|
+
[TextContext, textSlots],
|
|
1770
|
+
[FieldErrorContext, fieldErrorContext],
|
|
1771
|
+
] as Array<[Context<unknown>, unknown]>
|
|
1772
|
+
}
|
|
1773
|
+
>
|
|
1774
|
+
{renderChildren()}
|
|
1775
|
+
</Provider>
|
|
1659
1776
|
</div>
|
|
1660
1777
|
<Show when={state.channel && ariaProps.name}>
|
|
1661
1778
|
<input
|
|
@@ -1666,7 +1783,7 @@ export function ColorField(props: ColorFieldProps): JSX.Element {
|
|
|
1666
1783
|
/>
|
|
1667
1784
|
</Show>
|
|
1668
1785
|
</>
|
|
1669
|
-
</ColorFieldContext
|
|
1786
|
+
</ColorFieldContext>
|
|
1670
1787
|
);
|
|
1671
1788
|
}
|
|
1672
1789
|
|
|
@@ -1744,12 +1861,12 @@ export function ColorFieldInput(props: ColorFieldInputProps): JSX.Element {
|
|
|
1744
1861
|
class={renderProps.class()}
|
|
1745
1862
|
style={renderProps.style()}
|
|
1746
1863
|
value={inputValue()}
|
|
1747
|
-
data-disabled={state.isDisabled
|
|
1748
|
-
data-readonly={state.isReadOnly
|
|
1749
|
-
data-invalid={state.isInvalid
|
|
1750
|
-
data-focused={isFocused()
|
|
1751
|
-
data-focus-visible={isFocusVisible()
|
|
1752
|
-
data-hovered={isHovered()
|
|
1864
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
1865
|
+
data-readonly={dataAttr(state.isReadOnly)}
|
|
1866
|
+
data-invalid={dataAttr(state.isInvalid)}
|
|
1867
|
+
data-focused={dataAttr(isFocused())}
|
|
1868
|
+
data-focus-visible={dataAttr(isFocusVisible())}
|
|
1869
|
+
data-hovered={dataAttr(isHovered())}
|
|
1753
1870
|
/>
|
|
1754
1871
|
);
|
|
1755
1872
|
}
|
|
@@ -1802,7 +1919,7 @@ export function ColorSwatch(props: ColorSwatchProps): JSX.Element {
|
|
|
1802
1919
|
|
|
1803
1920
|
const swatchAria = createColorSwatch(() => ({
|
|
1804
1921
|
id: (rest as Record<string, unknown>).id as string | undefined,
|
|
1805
|
-
slot: local.slot,
|
|
1922
|
+
slot: attrString(local.slot),
|
|
1806
1923
|
color: resolvedColor(),
|
|
1807
1924
|
colorName: local.colorName,
|
|
1808
1925
|
"aria-label": ariaProps["aria-label"],
|
|
@@ -1999,13 +2116,13 @@ export function ColorPicker(props: ColorPickerProps): JSX.Element {
|
|
|
1999
2116
|
);
|
|
2000
2117
|
|
|
2001
2118
|
return (
|
|
2002
|
-
<ColorPickerStateContextInternal
|
|
2119
|
+
<ColorPickerStateContextInternal
|
|
2003
2120
|
value={{
|
|
2004
2121
|
color: () => color(),
|
|
2005
2122
|
setColor,
|
|
2006
2123
|
}}
|
|
2007
2124
|
>
|
|
2008
|
-
<ColorPickerContextInternal
|
|
2125
|
+
<ColorPickerContextInternal
|
|
2009
2126
|
value={{
|
|
2010
2127
|
get value() {
|
|
2011
2128
|
return color();
|
|
@@ -2016,13 +2133,15 @@ export function ColorPicker(props: ColorPickerProps): JSX.Element {
|
|
|
2016
2133
|
<div class={renderProps.class()} style={renderProps.style()}>
|
|
2017
2134
|
{renderProps.renderChildren()}
|
|
2018
2135
|
</div>
|
|
2019
|
-
</ColorPickerContextInternal
|
|
2020
|
-
</ColorPickerStateContextInternal
|
|
2136
|
+
</ColorPickerContextInternal>
|
|
2137
|
+
</ColorPickerStateContextInternal>
|
|
2021
2138
|
);
|
|
2022
2139
|
}
|
|
2023
2140
|
|
|
2024
2141
|
export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
2025
2142
|
const pickerContext = useContext(ColorPickerContextInternal);
|
|
2143
|
+
const locale = useLocale();
|
|
2144
|
+
const stringFormatter = createStringFormatter(racIntlStrings, "react-aria-components");
|
|
2026
2145
|
const [local, rest] = splitProps(props, [
|
|
2027
2146
|
"value",
|
|
2028
2147
|
"defaultValue",
|
|
@@ -2039,8 +2158,10 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2039
2158
|
"slot",
|
|
2040
2159
|
]);
|
|
2041
2160
|
|
|
2042
|
-
const [itemMap, setItemMap] = createSignal<Map<string, ColorSwatchPickerItemData>>(new Map()
|
|
2043
|
-
|
|
2161
|
+
const [itemMap, setItemMap] = createSignal<Map<string, ColorSwatchPickerItemData>>(new Map(), {
|
|
2162
|
+
ownedWrite: true,
|
|
2163
|
+
});
|
|
2164
|
+
const [itemOrder, setItemOrder] = createSignal<string[]>([], { ownedWrite: true });
|
|
2044
2165
|
const [internalColor, setInternalColor] = createSignal<Color>(
|
|
2045
2166
|
normalizeColor(local.defaultValue ?? pickerContext?.value ?? "#ff0000"),
|
|
2046
2167
|
);
|
|
@@ -2117,22 +2238,30 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2117
2238
|
},
|
|
2118
2239
|
});
|
|
2119
2240
|
|
|
2241
|
+
const [pickerRef, setPickerRef] = createSignal<HTMLDivElement | null>(null);
|
|
2242
|
+
|
|
2120
2243
|
const listBoxAria = createListBox(
|
|
2121
2244
|
() => ({
|
|
2122
2245
|
id: local.id,
|
|
2123
2246
|
"aria-label":
|
|
2124
|
-
local["aria-label"]
|
|
2247
|
+
(local["aria-label"] || undefined) ??
|
|
2248
|
+
(!local["aria-labelledby"] ? stringFormatter().format("colorSwatchPicker") : undefined),
|
|
2125
2249
|
"aria-labelledby": local["aria-labelledby"],
|
|
2126
2250
|
"aria-describedby": local["aria-describedby"],
|
|
2127
2251
|
"aria-details": local["aria-details"],
|
|
2128
2252
|
}),
|
|
2129
2253
|
state,
|
|
2254
|
+
() => pickerRef(),
|
|
2130
2255
|
);
|
|
2131
2256
|
|
|
2132
|
-
const resolveDirection = (): "ltr" | "rtl" =>
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2257
|
+
const resolveDirection = (): "ltr" | "rtl" => locale().direction;
|
|
2258
|
+
|
|
2259
|
+
const isItemDisabled = (key: Key | null) => {
|
|
2260
|
+
if (key == null) return false;
|
|
2261
|
+
if (state.isDisabled(key)) return true;
|
|
2262
|
+
// Collection disabledKeys can lag the first registration pass; the item
|
|
2263
|
+
// map is the live source for ColorSwatchPickerItem `isDisabled`.
|
|
2264
|
+
return !!itemMap().get(String(key))?.isDisabled;
|
|
2136
2265
|
};
|
|
2137
2266
|
|
|
2138
2267
|
const findNextEnabledKey = (from: Key | null, direction: "next" | "prev") => {
|
|
@@ -2145,7 +2274,7 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2145
2274
|
direction === "next" ? () => collection.getFirstKey() : () => collection.getLastKey();
|
|
2146
2275
|
|
|
2147
2276
|
let key = from != null ? getAdjacent(from) : getBoundary();
|
|
2148
|
-
while (key != null &&
|
|
2277
|
+
while (key != null && isItemDisabled(key)) {
|
|
2149
2278
|
key = getAdjacent(key);
|
|
2150
2279
|
}
|
|
2151
2280
|
|
|
@@ -2162,7 +2291,7 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2162
2291
|
direction === "next" ? () => collection.getFirstKey() : () => collection.getLastKey();
|
|
2163
2292
|
|
|
2164
2293
|
let key = getBoundary();
|
|
2165
|
-
while (key != null &&
|
|
2294
|
+
while (key != null && isItemDisabled(key)) {
|
|
2166
2295
|
key = getAdjacent(key);
|
|
2167
2296
|
}
|
|
2168
2297
|
|
|
@@ -2229,6 +2358,29 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2229
2358
|
? findNextEnabledKey(key, "next")
|
|
2230
2359
|
: findNextEnabledKey(key, "prev");
|
|
2231
2360
|
|
|
2361
|
+
const handleStackKeyDown = (e: KeyboardEvent): boolean => {
|
|
2362
|
+
if ((local.layout ?? "grid") === "grid") return false;
|
|
2363
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return false;
|
|
2364
|
+
|
|
2365
|
+
const focusedKey = state.focusedKey();
|
|
2366
|
+
const initialKey =
|
|
2367
|
+
focusedKey ??
|
|
2368
|
+
(e.key === "ArrowUp" ? getBoundaryEnabledKey("prev") : getBoundaryEnabledKey("next"));
|
|
2369
|
+
if (initialKey == null) return false;
|
|
2370
|
+
|
|
2371
|
+
const nextKey =
|
|
2372
|
+
e.key === "ArrowDown"
|
|
2373
|
+
? findNextEnabledKey(initialKey, "next")
|
|
2374
|
+
: findNextEnabledKey(initialKey, "prev");
|
|
2375
|
+
if (nextKey != null) {
|
|
2376
|
+
state.setFocusedKey(nextKey);
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
e.preventDefault();
|
|
2380
|
+
e.stopPropagation();
|
|
2381
|
+
return true;
|
|
2382
|
+
};
|
|
2383
|
+
|
|
2232
2384
|
const handleGridKeyDown = (e: KeyboardEvent): boolean => {
|
|
2233
2385
|
if ((local.layout ?? "grid") !== "grid") return false;
|
|
2234
2386
|
if (
|
|
@@ -2265,8 +2417,8 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2265
2417
|
break;
|
|
2266
2418
|
}
|
|
2267
2419
|
|
|
2268
|
-
//
|
|
2269
|
-
//
|
|
2420
|
+
// Match the pinned ListKeyboardDelegate: an arrow in grid layout is always
|
|
2421
|
+
// consumed (blocking the linear ListBox handler and page scroll),
|
|
2270
2422
|
// but focus only moves when the delegate yields a next key. With
|
|
2271
2423
|
// shouldFocusWrap unset (upstream default false) there is no wrap, so arrows
|
|
2272
2424
|
// stop dead at the grid's edges. Selection is not mutated on arrow — under
|
|
@@ -2287,9 +2439,18 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2287
2439
|
};
|
|
2288
2440
|
|
|
2289
2441
|
const onColorSwatchPickerKeyDown: JSX.EventHandler<HTMLDivElement, KeyboardEvent> = (e) => {
|
|
2290
|
-
if (handleGridKeyDown(e)) {
|
|
2442
|
+
if (handleGridKeyDown(e) || handleStackKeyDown(e)) {
|
|
2291
2443
|
return;
|
|
2292
2444
|
}
|
|
2445
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2446
|
+
const key = state.focusedKey();
|
|
2447
|
+
if (key != null && !isItemDisabled(key)) {
|
|
2448
|
+
state.setSelectedKeys([key]);
|
|
2449
|
+
e.preventDefault();
|
|
2450
|
+
e.stopPropagation();
|
|
2451
|
+
return;
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2293
2454
|
getListBoxKeyDown()?.(e);
|
|
2294
2455
|
};
|
|
2295
2456
|
|
|
@@ -2340,7 +2501,7 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2340
2501
|
};
|
|
2341
2502
|
|
|
2342
2503
|
return (
|
|
2343
|
-
<ColorSwatchPickerContextInternal
|
|
2504
|
+
<ColorSwatchPickerContextInternal
|
|
2344
2505
|
value={{
|
|
2345
2506
|
state,
|
|
2346
2507
|
registerItem,
|
|
@@ -2350,17 +2511,32 @@ export function ColorSwatchPicker(props: ColorSwatchPickerProps): JSX.Element {
|
|
|
2350
2511
|
<div
|
|
2351
2512
|
{...mergeProps(domProps(), cleanListBoxProps(), cleanFocusProps(), {
|
|
2352
2513
|
onKeyDown: onColorSwatchPickerKeyDown,
|
|
2514
|
+
onFocus: (e: FocusEvent) => {
|
|
2515
|
+
if (e.target !== e.currentTarget) return;
|
|
2516
|
+
if (state.focusedKey() == null) {
|
|
2517
|
+
const key =
|
|
2518
|
+
state.selectionManager.firstSelectedKey ?? state.collection().getFirstKey();
|
|
2519
|
+
if (key != null) state.setFocusedKey(key);
|
|
2520
|
+
}
|
|
2521
|
+
state.setFocused(true);
|
|
2522
|
+
try {
|
|
2523
|
+
flush();
|
|
2524
|
+
} catch {
|
|
2525
|
+
/* event handler; ignore forbidden-scope flush */
|
|
2526
|
+
}
|
|
2527
|
+
},
|
|
2353
2528
|
})}
|
|
2529
|
+
ref={setPickerRef}
|
|
2354
2530
|
class={renderProps.class()}
|
|
2355
2531
|
style={renderProps.style()}
|
|
2356
2532
|
slot={local.slot ?? undefined}
|
|
2357
|
-
data-focused={state.isFocused()
|
|
2358
|
-
data-focus-visible={isFocusVisible()
|
|
2533
|
+
data-focused={dataAttr(state.isFocused())}
|
|
2534
|
+
data-focus-visible={dataAttr(isFocusVisible())}
|
|
2359
2535
|
data-layout={local.layout ?? "grid"}
|
|
2360
2536
|
>
|
|
2361
2537
|
{local.children}
|
|
2362
2538
|
</div>
|
|
2363
|
-
</ColorSwatchPickerContextInternal
|
|
2539
|
+
</ColorSwatchPickerContextInternal>
|
|
2364
2540
|
);
|
|
2365
2541
|
}
|
|
2366
2542
|
|
|
@@ -2383,16 +2559,18 @@ export function ColorSwatchPickerItem(props: ColorSwatchPickerItemProps): JSX.El
|
|
|
2383
2559
|
return color().getColorName(locale);
|
|
2384
2560
|
});
|
|
2385
2561
|
|
|
2386
|
-
createEffect(
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
key: itemKey,
|
|
2562
|
+
createEffect(
|
|
2563
|
+
() => ({
|
|
2564
|
+
key: key(),
|
|
2390
2565
|
color: color(),
|
|
2391
2566
|
textValue: textValue(),
|
|
2392
2567
|
isDisabled: ariaProps.isDisabled,
|
|
2393
|
-
})
|
|
2394
|
-
|
|
2395
|
-
|
|
2568
|
+
}),
|
|
2569
|
+
(item) => {
|
|
2570
|
+
context.registerItem(item);
|
|
2571
|
+
return () => context.unregisterItem(item.key);
|
|
2572
|
+
},
|
|
2573
|
+
);
|
|
2396
2574
|
|
|
2397
2575
|
const [optionRef, setOptionRef] = createSignal<HTMLElement | null>(null);
|
|
2398
2576
|
|
|
@@ -2446,9 +2624,9 @@ export function ColorSwatchPickerItem(props: ColorSwatchPickerItemProps): JSX.El
|
|
|
2446
2624
|
class={renderProps.class()}
|
|
2447
2625
|
style={renderProps.style()}
|
|
2448
2626
|
>
|
|
2449
|
-
<ColorSwatchContextInternal
|
|
2627
|
+
<ColorSwatchContextInternal value={{ color: color() }}>
|
|
2450
2628
|
{renderProps.children ? renderProps.renderChildren() : <ColorSwatch />}
|
|
2451
|
-
</ColorSwatchContextInternal
|
|
2629
|
+
</ColorSwatchContextInternal>
|
|
2452
2630
|
</div>
|
|
2453
2631
|
);
|
|
2454
2632
|
}
|