@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/Color.jsx
CHANGED
|
@@ -1,13 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
14
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
+
* governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
/*
|
|
24
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
25
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
26
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
27
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
28
|
+
*
|
|
29
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
30
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
31
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
32
|
+
* governing permissions and limitations under the License.
|
|
33
|
+
*/
|
|
34
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorArea.tsx
|
|
35
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorField.tsx
|
|
36
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorPicker.tsx
|
|
37
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorSlider.tsx
|
|
38
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorSwatch.tsx
|
|
39
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorSwatchPicker.tsx
|
|
40
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorThumb.tsx
|
|
41
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ColorWheel.tsx
|
|
42
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/selection/ListKeyboardDelegate.ts
|
|
43
|
+
import { Provider, attrString as attrString$1, dataAttr, filterDOMProps, useRenderProps } from "./utils.jsx";
|
|
44
|
+
import { TextContext } from "./Text.jsx";
|
|
45
|
+
import { FieldErrorContext } from "./FieldError.jsx";
|
|
46
|
+
import { t as racIntlStrings } from "./intl.jsx";
|
|
47
|
+
import { Show, createContext, createEffect, createMemo, createSignal, createTrackedEffect, flush, untrack, useContext } from "solid-js";
|
|
48
|
+
import { createColorArea, createColorField, createColorSlider, createColorSwatch, createColorWheel, createFocusRing, createHover, createListBox, createOption, createStringFormatter, mergeProps, useLocale } from "@proyecto-viviana/solidaria";
|
|
49
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
50
|
+
import { VALID_VALIDITY_STATE, createColorAreaState, createColorFieldState, createColorSliderState, createColorWheelState, createListState, normalizeColor } from "@proyecto-viviana/solid-stately";
|
|
5
51
|
//#region src/Color.tsx
|
|
6
52
|
/**
|
|
7
|
-
* Color components for solidaria-components
|
|
53
|
+
* Color components for solidaria-components.
|
|
8
54
|
*
|
|
9
55
|
* Pre-wired headless color picker components that combine state + aria hooks.
|
|
10
|
-
*
|
|
56
|
+
* Based on these pinned React Aria Components sources:
|
|
57
|
+
* - packages/react-aria-components/src/ColorArea.tsx
|
|
58
|
+
* - packages/react-aria-components/src/ColorField.tsx
|
|
59
|
+
* - packages/react-aria-components/src/ColorPicker.tsx
|
|
60
|
+
* - packages/react-aria-components/src/ColorSlider.tsx
|
|
61
|
+
* - packages/react-aria-components/src/ColorSwatch.tsx
|
|
62
|
+
* - packages/react-aria-components/src/ColorSwatchPicker.tsx
|
|
63
|
+
* - packages/react-aria-components/src/ColorThumb.tsx
|
|
64
|
+
* - packages/react-aria-components/src/ColorWheel.tsx
|
|
65
|
+
* - packages/react-aria/src/selection/ListKeyboardDelegate.ts
|
|
66
|
+
*
|
|
67
|
+
* This Solid module combines the upstream component files and grid keyboard behavior.
|
|
11
68
|
*/
|
|
12
69
|
const ColorPickerContextInternal = createContext(null);
|
|
13
70
|
const ColorPickerStateContextInternal = createContext(null);
|
|
@@ -97,7 +154,7 @@ function ColorSlider(props) {
|
|
|
97
154
|
defaultClassName: "solidaria-ColorSlider"
|
|
98
155
|
}, renderValues);
|
|
99
156
|
const domProps = createMemo(() => filterDOMProps(rest, { global: true }));
|
|
100
|
-
return <ColorSliderContext
|
|
157
|
+
return <ColorSliderContext value={{
|
|
101
158
|
state,
|
|
102
159
|
get trackProps() {
|
|
103
160
|
return colorSliderAria.trackProps;
|
|
@@ -120,10 +177,10 @@ function ColorSlider(props) {
|
|
|
120
177
|
setTrackRef,
|
|
121
178
|
setInputRef
|
|
122
179
|
}}>
|
|
123
|
-
<div {...domProps()} class={renderProps.class()} style={renderProps.style()} data-disabled={state.isDisabled
|
|
124
|
-
{renderProps.
|
|
180
|
+
<div {...domProps()} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled)} data-dragging={dataAttr(state.isDragging)} data-orientation={state.orientation} slot={local.slot || void 0}>
|
|
181
|
+
{renderProps.renderChildrenStable()}
|
|
125
182
|
</div>
|
|
126
|
-
</ColorSliderContext
|
|
183
|
+
</ColorSliderContext>;
|
|
127
184
|
}
|
|
128
185
|
/**
|
|
129
186
|
* The label element of a color slider.
|
|
@@ -210,8 +267,8 @@ function ColorSliderTrack(props) {
|
|
|
210
267
|
...renderStyle
|
|
211
268
|
};
|
|
212
269
|
};
|
|
213
|
-
return <div {...domProps} ref={context.setTrackRef} {...cleanTrackProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={state.isDisabled
|
|
214
|
-
{renderProps.
|
|
270
|
+
return <div {...domProps} ref={context.setTrackRef} {...cleanTrackProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={dataAttr(state.isDisabled)} data-dragging={dataAttr(state.isDragging)} data-orientation={state.orientation}>
|
|
271
|
+
{renderProps.renderChildrenStable()}
|
|
215
272
|
</div>;
|
|
216
273
|
}
|
|
217
274
|
/**
|
|
@@ -262,8 +319,12 @@ function ColorSliderThumb(props) {
|
|
|
262
319
|
return rest;
|
|
263
320
|
};
|
|
264
321
|
const mergedInputProps = () => {
|
|
265
|
-
return mergeProps
|
|
322
|
+
return mergeProps(context.inputProps, cleanFocusProps());
|
|
266
323
|
};
|
|
324
|
+
let sliderInput;
|
|
325
|
+
createEffect(() => state.getThumbValue(), (value) => {
|
|
326
|
+
if (sliderInput && sliderInput.value !== String(value)) sliderInput.value = String(value);
|
|
327
|
+
});
|
|
267
328
|
const mergedStyle = () => {
|
|
268
329
|
const thumbStyle = context.thumbProps.style || {};
|
|
269
330
|
const renderStyle = renderProps.style() || {};
|
|
@@ -272,9 +333,13 @@ function ColorSliderThumb(props) {
|
|
|
272
333
|
...renderStyle
|
|
273
334
|
};
|
|
274
335
|
};
|
|
275
|
-
return <div {...domProps} {...cleanThumbProps()} {...cleanHoverProps()} ref={local.ref} class={renderProps.class()} style={mergedStyle()} data-disabled={state.isDisabled
|
|
276
|
-
<input ref={
|
|
277
|
-
|
|
336
|
+
return <div {...domProps} {...cleanThumbProps()} {...cleanHoverProps()} ref={local.ref} class={renderProps.class()} style={mergedStyle()} data-disabled={dataAttr(state.isDisabled)} data-dragging={dataAttr(state.isDragging)} data-focused={dataAttr(isFocused())} data-focus-visible={dataAttr(isFocusVisible())} data-hovered={dataAttr(isHovered())}>
|
|
337
|
+
<input ref={(el) => {
|
|
338
|
+
sliderInput = el;
|
|
339
|
+
context.setInputRef(el);
|
|
340
|
+
if (el) el.value = String(state.getThumbValue());
|
|
341
|
+
}} {...mergedInputProps()} />
|
|
342
|
+
{renderProps.renderChildrenStable()}
|
|
278
343
|
</div>;
|
|
279
344
|
}
|
|
280
345
|
ColorSlider.Track = ColorSliderTrack;
|
|
@@ -389,7 +454,7 @@ function ColorArea(props) {
|
|
|
389
454
|
...renderStyle
|
|
390
455
|
};
|
|
391
456
|
};
|
|
392
|
-
return <ColorAreaContext
|
|
457
|
+
return <ColorAreaContext value={{
|
|
393
458
|
state,
|
|
394
459
|
get colorAreaProps() {
|
|
395
460
|
return colorAreaAria.colorAreaProps;
|
|
@@ -409,10 +474,10 @@ function ColorArea(props) {
|
|
|
409
474
|
areaRef,
|
|
410
475
|
setAreaRef
|
|
411
476
|
}}>
|
|
412
|
-
<div ref={setAreaRef} {...domProps()} {...cleanColorAreaProps()} class={renderProps.class()} style={mergedStyle()} slot={local.slot ?? void 0} data-disabled={state.isDisabled
|
|
477
|
+
<div ref={setAreaRef} {...domProps()} {...cleanColorAreaProps()} class={renderProps.class()} style={mergedStyle()} slot={local.slot ?? void 0} data-disabled={dataAttr(state.isDisabled)} data-dragging={dataAttr(state.isDragging)}>
|
|
413
478
|
{colorAreaChildren()}
|
|
414
479
|
</div>
|
|
415
|
-
</ColorAreaContext
|
|
480
|
+
</ColorAreaContext>;
|
|
416
481
|
}
|
|
417
482
|
/**
|
|
418
483
|
* The gradient background of a color area.
|
|
@@ -448,7 +513,7 @@ function ColorAreaGradient(props) {
|
|
|
448
513
|
...renderStyle
|
|
449
514
|
};
|
|
450
515
|
};
|
|
451
|
-
return <div {...domProps} {...cleanGradientProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={state.isDisabled
|
|
516
|
+
return <div {...domProps} {...cleanGradientProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={dataAttr(state.isDisabled)}>
|
|
452
517
|
{renderProps.renderChildren()}
|
|
453
518
|
</div>;
|
|
454
519
|
}
|
|
@@ -502,11 +567,11 @@ function ColorAreaThumb(props) {
|
|
|
502
567
|
};
|
|
503
568
|
const mergedXInputProps = () => {
|
|
504
569
|
const { value: _value, ...inputProps } = context.xInputProps;
|
|
505
|
-
return mergeProps
|
|
570
|
+
return mergeProps(inputProps, cleanFocusProps());
|
|
506
571
|
};
|
|
507
572
|
const mergedYInputProps = () => {
|
|
508
573
|
const { value: _value, ...inputProps } = context.yInputProps;
|
|
509
|
-
return mergeProps
|
|
574
|
+
return mergeProps(inputProps, cleanFocusProps());
|
|
510
575
|
};
|
|
511
576
|
const mergedStyle = () => {
|
|
512
577
|
const thumbStyle = context.thumbProps.style || {};
|
|
@@ -524,13 +589,13 @@ function ColorAreaThumb(props) {
|
|
|
524
589
|
update();
|
|
525
590
|
queueMicrotask(update);
|
|
526
591
|
};
|
|
527
|
-
|
|
592
|
+
createTrackedEffect(() => {
|
|
528
593
|
syncInputValue(xInputRef, state.getXValue());
|
|
529
594
|
});
|
|
530
|
-
|
|
595
|
+
createTrackedEffect(() => {
|
|
531
596
|
syncInputValue(yInputRef, state.getYValue());
|
|
532
597
|
});
|
|
533
|
-
return <div {...domProps} ref={local.ref} {...cleanThumbProps()} {...cleanHoverProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={state.isDisabled
|
|
598
|
+
return <div {...domProps} ref={local.ref} {...cleanThumbProps()} {...cleanHoverProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={dataAttr(state.isDisabled)} data-dragging={dataAttr(state.isDragging)} data-focused={dataAttr(isFocused())} data-focus-visible={dataAttr(isFocusVisible())} data-hovered={dataAttr(isHovered())}>
|
|
534
599
|
<input {...mergedXInputProps()} ref={(el) => {
|
|
535
600
|
xInputRef = el;
|
|
536
601
|
syncInputValue(el, state.getXValue());
|
|
@@ -613,7 +678,7 @@ function ColorWheel(props) {
|
|
|
613
678
|
defaultClassName: "solidaria-ColorWheel"
|
|
614
679
|
}, renderValues);
|
|
615
680
|
const domProps = createMemo(() => filterDOMProps(rest, { global: true }));
|
|
616
|
-
return <ColorWheelContext
|
|
681
|
+
return <ColorWheelContext value={{
|
|
617
682
|
state,
|
|
618
683
|
get trackProps() {
|
|
619
684
|
return colorWheelAria.trackProps;
|
|
@@ -629,10 +694,10 @@ function ColorWheel(props) {
|
|
|
629
694
|
},
|
|
630
695
|
setWheelRef
|
|
631
696
|
}}>
|
|
632
|
-
<div ref={setWheelRef} {...domProps()} class={renderProps.class()} style={renderProps.style()} slot={local.slot || void 0} data-disabled={state.isDisabled
|
|
633
|
-
{renderProps.
|
|
697
|
+
<div ref={setWheelRef} {...domProps()} class={renderProps.class()} style={renderProps.style()} slot={local.slot || void 0} data-disabled={dataAttr(state.isDisabled)} data-dragging={dataAttr(state.isDragging)}>
|
|
698
|
+
{renderProps.renderChildrenStable()}
|
|
634
699
|
</div>
|
|
635
|
-
</ColorWheelContext
|
|
700
|
+
</ColorWheelContext>;
|
|
636
701
|
}
|
|
637
702
|
/**
|
|
638
703
|
* The track element of a color wheel.
|
|
@@ -672,8 +737,8 @@ function ColorWheelTrack(props) {
|
|
|
672
737
|
...renderStyle
|
|
673
738
|
};
|
|
674
739
|
};
|
|
675
|
-
return <div {...domProps} {...cleanTrackProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={state.isDisabled
|
|
676
|
-
{renderProps.
|
|
740
|
+
return <div {...domProps} {...cleanTrackProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={dataAttr(state.isDisabled)} data-dragging={dataAttr(state.isDragging)}>
|
|
741
|
+
{renderProps.renderChildrenStable()}
|
|
677
742
|
</div>;
|
|
678
743
|
}
|
|
679
744
|
/**
|
|
@@ -724,7 +789,7 @@ function ColorWheelThumb(props) {
|
|
|
724
789
|
return rest;
|
|
725
790
|
};
|
|
726
791
|
const mergedInputProps = () => {
|
|
727
|
-
return mergeProps
|
|
792
|
+
return mergeProps(context.inputProps, cleanFocusProps());
|
|
728
793
|
};
|
|
729
794
|
const mergedStyle = () => {
|
|
730
795
|
const thumbStyle = context.thumbProps.style || {};
|
|
@@ -734,9 +799,9 @@ function ColorWheelThumb(props) {
|
|
|
734
799
|
...renderStyle
|
|
735
800
|
};
|
|
736
801
|
};
|
|
737
|
-
return <div {...domProps} ref={local.ref} {...cleanThumbProps()} {...cleanHoverProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={state.isDisabled
|
|
802
|
+
return <div {...domProps} ref={local.ref} {...cleanThumbProps()} {...cleanHoverProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={dataAttr(state.isDisabled)} data-dragging={dataAttr(state.isDragging)} data-focused={dataAttr(isFocused())} data-focus-visible={dataAttr(isFocusVisible())} data-hovered={dataAttr(isHovered())}>
|
|
738
803
|
<input {...mergedInputProps()} />
|
|
739
|
-
{renderProps.
|
|
804
|
+
{renderProps.renderChildrenStable()}
|
|
740
805
|
</div>;
|
|
741
806
|
}
|
|
742
807
|
ColorWheel.Track = ColorWheelTrack;
|
|
@@ -781,7 +846,7 @@ function ColorField(props) {
|
|
|
781
846
|
"excludeFromTabOrder",
|
|
782
847
|
"placeholder"
|
|
783
848
|
]);
|
|
784
|
-
const [hasRegisteredLabelElement, setHasRegisteredLabelElement] = createSignal(false);
|
|
849
|
+
const [hasRegisteredLabelElement, setHasRegisteredLabelElement] = createSignal(false, { ownedWrite: true });
|
|
785
850
|
const state = createColorFieldState(() => ({
|
|
786
851
|
value: stateProps.value ?? pickerContext?.value,
|
|
787
852
|
defaultValue: stateProps.defaultValue,
|
|
@@ -819,24 +884,16 @@ function ColorField(props) {
|
|
|
819
884
|
excludeFromTabOrder: ariaProps.excludeFromTabOrder,
|
|
820
885
|
placeholder: ariaProps.placeholder,
|
|
821
886
|
channel: stateProps.channel,
|
|
822
|
-
colorSpace: stateProps.colorSpace
|
|
887
|
+
colorSpace: stateProps.colorSpace,
|
|
888
|
+
description: local.description,
|
|
889
|
+
errorMessage: local.errorMessage
|
|
823
890
|
}), () => state, () => inputRef ?? null);
|
|
824
|
-
const describedBy = () => {
|
|
825
|
-
const invalid = ariaProps.isInvalid || state.isInvalid;
|
|
826
|
-
return [
|
|
827
|
-
ariaProps["aria-describedby"],
|
|
828
|
-
local.description && !invalid ? colorFieldAria.descriptionProps.id : void 0,
|
|
829
|
-
invalid && local.errorMessage ? colorFieldAria.errorMessageProps.id : void 0
|
|
830
|
-
].filter(Boolean).join(" ") || void 0;
|
|
831
|
-
};
|
|
832
891
|
const fieldInputProps = () => {
|
|
833
892
|
const labelledBy = ariaProps["aria-labelledby"] ?? (!ariaProps["aria-label"] && (local.label || hasRegisteredLabelElement()) ? colorFieldAria.labelProps.id : void 0);
|
|
834
893
|
return {
|
|
835
894
|
...colorFieldAria.inputProps,
|
|
836
895
|
"aria-label": labelledBy ? void 0 : colorFieldAria.inputProps["aria-label"],
|
|
837
|
-
"aria-labelledby": labelledBy
|
|
838
|
-
"aria-describedby": describedBy(),
|
|
839
|
-
"aria-errormessage": (ariaProps.isInvalid || state.isInvalid) && local.errorMessage ? colorFieldAria.errorMessageProps.id : colorFieldAria.inputProps["aria-errormessage"]
|
|
896
|
+
"aria-labelledby": labelledBy
|
|
840
897
|
};
|
|
841
898
|
};
|
|
842
899
|
const hiddenInputValue = createMemo(() => Number.isNaN(state.numberValue) ? "" : String(state.numberValue));
|
|
@@ -887,7 +944,33 @@ function ColorField(props) {
|
|
|
887
944
|
return renderedChildren;
|
|
888
945
|
};
|
|
889
946
|
const domProps = createMemo(() => filterDOMProps(rest, { global: true }));
|
|
890
|
-
|
|
947
|
+
const textSlots = { slots: {
|
|
948
|
+
get description() {
|
|
949
|
+
return colorFieldAria.descriptionProps;
|
|
950
|
+
},
|
|
951
|
+
get errorMessage() {
|
|
952
|
+
return colorFieldAria.errorMessageProps;
|
|
953
|
+
}
|
|
954
|
+
} };
|
|
955
|
+
const fieldErrorContext = {
|
|
956
|
+
get validation() {
|
|
957
|
+
const invalid = ariaProps.isInvalid || state.isInvalid;
|
|
958
|
+
const errorMessage = local.errorMessage;
|
|
959
|
+
return {
|
|
960
|
+
isInvalid: invalid,
|
|
961
|
+
validationErrors: invalid && typeof errorMessage === "string" ? [errorMessage] : [],
|
|
962
|
+
validationDetails: invalid ? {
|
|
963
|
+
...VALID_VALIDITY_STATE,
|
|
964
|
+
customError: true,
|
|
965
|
+
valid: false
|
|
966
|
+
} : VALID_VALIDITY_STATE
|
|
967
|
+
};
|
|
968
|
+
},
|
|
969
|
+
get errorMessageProps() {
|
|
970
|
+
return colorFieldAria.errorMessageProps;
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
return <ColorFieldContext value={{
|
|
891
974
|
state,
|
|
892
975
|
get inputProps() {
|
|
893
976
|
return fieldInputProps();
|
|
@@ -905,18 +988,20 @@ function ColorField(props) {
|
|
|
905
988
|
setLabelElement: setHasRegisteredLabelElement
|
|
906
989
|
}}>
|
|
907
990
|
<>
|
|
908
|
-
<div {...domProps()} class={renderProps.class()} style={renderProps.style()} slot={local.slot ?? void 0} data-disabled={state.isDisabled
|
|
991
|
+
<div {...domProps()} class={renderProps.class()} style={renderProps.style()} slot={local.slot ?? void 0} data-disabled={dataAttr(state.isDisabled)} data-readonly={dataAttr(state.isReadOnly)} data-invalid={dataAttr(state.isInvalid)} data-required={dataAttr(state.isRequired)} data-channel={state.channel ?? "hex"}>
|
|
909
992
|
<Show when={local.label}>
|
|
910
993
|
<label {...colorFieldAria.labelProps}>{local.label}</label>
|
|
911
994
|
</Show>
|
|
912
995
|
|
|
913
|
-
{
|
|
996
|
+
<Provider values={[[TextContext, textSlots], [FieldErrorContext, fieldErrorContext]]}>
|
|
997
|
+
{renderChildren()}
|
|
998
|
+
</Provider>
|
|
914
999
|
</div>
|
|
915
1000
|
<Show when={state.channel && ariaProps.name}>
|
|
916
1001
|
<input type="hidden" name={ariaProps.name} form={ariaProps.form} value={hiddenInputValue()} />
|
|
917
1002
|
</Show>
|
|
918
1003
|
</>
|
|
919
|
-
</ColorFieldContext
|
|
1004
|
+
</ColorFieldContext>;
|
|
920
1005
|
}
|
|
921
1006
|
/**
|
|
922
1007
|
* The input element of a color field.
|
|
@@ -968,7 +1053,7 @@ function ColorFieldInput(props) {
|
|
|
968
1053
|
return <input {...domProps} {...cleanInputProps()} {...cleanFocusProps()} {...cleanHoverProps()} ref={(el) => {
|
|
969
1054
|
context.setInputRef(el);
|
|
970
1055
|
local.ref?.(el);
|
|
971
|
-
}} class={renderProps.class()} style={renderProps.style()} value={inputValue()} data-disabled={state.isDisabled
|
|
1056
|
+
}} class={renderProps.class()} style={renderProps.style()} value={inputValue()} data-disabled={dataAttr(state.isDisabled)} data-readonly={dataAttr(state.isReadOnly)} data-invalid={dataAttr(state.isInvalid)} data-focused={dataAttr(isFocused())} data-focus-visible={dataAttr(isFocusVisible())} data-hovered={dataAttr(isHovered())} />;
|
|
972
1057
|
}
|
|
973
1058
|
ColorField.Input = ColorFieldInput;
|
|
974
1059
|
/**
|
|
@@ -995,7 +1080,7 @@ function ColorSwatch(props) {
|
|
|
995
1080
|
});
|
|
996
1081
|
const swatchAria = createColorSwatch(() => ({
|
|
997
1082
|
id: rest.id,
|
|
998
|
-
slot: local.slot,
|
|
1083
|
+
slot: attrString$1(local.slot),
|
|
999
1084
|
color: resolvedColor(),
|
|
1000
1085
|
colorName: local.colorName,
|
|
1001
1086
|
"aria-label": ariaProps["aria-label"],
|
|
@@ -1070,11 +1155,11 @@ function ColorPicker(props) {
|
|
|
1070
1155
|
style: local.style,
|
|
1071
1156
|
defaultClassName: "solidaria-ColorPicker"
|
|
1072
1157
|
}, renderValues);
|
|
1073
|
-
return <ColorPickerStateContextInternal
|
|
1158
|
+
return <ColorPickerStateContextInternal value={{
|
|
1074
1159
|
color: () => color(),
|
|
1075
1160
|
setColor
|
|
1076
1161
|
}}>
|
|
1077
|
-
<ColorPickerContextInternal
|
|
1162
|
+
<ColorPickerContextInternal value={{
|
|
1078
1163
|
get value() {
|
|
1079
1164
|
return color();
|
|
1080
1165
|
},
|
|
@@ -1083,11 +1168,13 @@ function ColorPicker(props) {
|
|
|
1083
1168
|
<div class={renderProps.class()} style={renderProps.style()}>
|
|
1084
1169
|
{renderProps.renderChildren()}
|
|
1085
1170
|
</div>
|
|
1086
|
-
</ColorPickerContextInternal
|
|
1087
|
-
</ColorPickerStateContextInternal
|
|
1171
|
+
</ColorPickerContextInternal>
|
|
1172
|
+
</ColorPickerStateContextInternal>;
|
|
1088
1173
|
}
|
|
1089
1174
|
function ColorSwatchPicker(props) {
|
|
1090
1175
|
const pickerContext = useContext(ColorPickerContextInternal);
|
|
1176
|
+
const locale = useLocale();
|
|
1177
|
+
const stringFormatter = createStringFormatter(racIntlStrings, "react-aria-components");
|
|
1091
1178
|
const [local, rest] = splitProps(props, [
|
|
1092
1179
|
"value",
|
|
1093
1180
|
"defaultValue",
|
|
@@ -1103,8 +1190,8 @@ function ColorSwatchPicker(props) {
|
|
|
1103
1190
|
"style",
|
|
1104
1191
|
"slot"
|
|
1105
1192
|
]);
|
|
1106
|
-
const [itemMap, setItemMap] = createSignal(/* @__PURE__ */ new Map());
|
|
1107
|
-
const [itemOrder, setItemOrder] = createSignal([]);
|
|
1193
|
+
const [itemMap, setItemMap] = createSignal(/* @__PURE__ */ new Map(), { ownedWrite: true });
|
|
1194
|
+
const [itemOrder, setItemOrder] = createSignal([], { ownedWrite: true });
|
|
1108
1195
|
const [internalColor, setInternalColor] = createSignal(normalizeColor(local.defaultValue ?? pickerContext?.value ?? "#ff0000"));
|
|
1109
1196
|
const selectedColor = createMemo(() => {
|
|
1110
1197
|
if (local.value !== void 0) return normalizeColor(local.value);
|
|
@@ -1162,29 +1249,32 @@ function ColorSwatchPicker(props) {
|
|
|
1162
1249
|
(local.onChange ?? pickerContext?.onChange)?.(item.color);
|
|
1163
1250
|
}
|
|
1164
1251
|
});
|
|
1252
|
+
const [pickerRef, setPickerRef] = createSignal(null);
|
|
1165
1253
|
const listBoxAria = createListBox(() => ({
|
|
1166
1254
|
id: local.id,
|
|
1167
|
-
"aria-label": local["aria-label"] ?? (!local["aria-labelledby"] ? "
|
|
1255
|
+
"aria-label": (local["aria-label"] || void 0) ?? (!local["aria-labelledby"] ? stringFormatter().format("colorSwatchPicker") : void 0),
|
|
1168
1256
|
"aria-labelledby": local["aria-labelledby"],
|
|
1169
1257
|
"aria-describedby": local["aria-describedby"],
|
|
1170
1258
|
"aria-details": local["aria-details"]
|
|
1171
|
-
}), state);
|
|
1172
|
-
const resolveDirection = () =>
|
|
1173
|
-
|
|
1174
|
-
|
|
1259
|
+
}), state, () => pickerRef());
|
|
1260
|
+
const resolveDirection = () => locale().direction;
|
|
1261
|
+
const isItemDisabled = (key) => {
|
|
1262
|
+
if (key == null) return false;
|
|
1263
|
+
if (state.isDisabled(key)) return true;
|
|
1264
|
+
return !!itemMap().get(String(key))?.isDisabled;
|
|
1175
1265
|
};
|
|
1176
1266
|
const findNextEnabledKey = (from, direction) => {
|
|
1177
1267
|
const collection = state.collection();
|
|
1178
1268
|
const getAdjacent = direction === "next" ? (key) => collection.getKeyAfter(key) : (key) => collection.getKeyBefore(key);
|
|
1179
1269
|
let key = from != null ? getAdjacent(from) : (direction === "next" ? () => collection.getFirstKey() : () => collection.getLastKey())();
|
|
1180
|
-
while (key != null &&
|
|
1270
|
+
while (key != null && isItemDisabled(key)) key = getAdjacent(key);
|
|
1181
1271
|
return key;
|
|
1182
1272
|
};
|
|
1183
1273
|
const getBoundaryEnabledKey = (direction) => {
|
|
1184
1274
|
const collection = state.collection();
|
|
1185
1275
|
const getAdjacent = direction === "next" ? (key) => collection.getKeyAfter(key) : (key) => collection.getKeyBefore(key);
|
|
1186
1276
|
let key = (direction === "next" ? () => collection.getFirstKey() : () => collection.getLastKey())();
|
|
1187
|
-
while (key != null &&
|
|
1277
|
+
while (key != null && isItemDisabled(key)) key = getAdjacent(key);
|
|
1188
1278
|
return key;
|
|
1189
1279
|
};
|
|
1190
1280
|
const getOptionElementForKey = (listbox, key) => {
|
|
@@ -1211,6 +1301,17 @@ function ColorSwatchPicker(props) {
|
|
|
1211
1301
|
const getGridKeyAbove = (listbox, key) => findGridKey(listbox, key, (current) => findNextEnabledKey(current, "prev"), isSameRow);
|
|
1212
1302
|
const getGridKeyRightOf = (key) => resolveDirection() === "rtl" ? findNextEnabledKey(key, "prev") : findNextEnabledKey(key, "next");
|
|
1213
1303
|
const getGridKeyLeftOf = (key) => resolveDirection() === "rtl" ? findNextEnabledKey(key, "next") : findNextEnabledKey(key, "prev");
|
|
1304
|
+
const handleStackKeyDown = (e) => {
|
|
1305
|
+
if ((local.layout ?? "grid") === "grid") return false;
|
|
1306
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return false;
|
|
1307
|
+
const initialKey = state.focusedKey() ?? (e.key === "ArrowUp" ? getBoundaryEnabledKey("prev") : getBoundaryEnabledKey("next"));
|
|
1308
|
+
if (initialKey == null) return false;
|
|
1309
|
+
const nextKey = e.key === "ArrowDown" ? findNextEnabledKey(initialKey, "next") : findNextEnabledKey(initialKey, "prev");
|
|
1310
|
+
if (nextKey != null) state.setFocusedKey(nextKey);
|
|
1311
|
+
e.preventDefault();
|
|
1312
|
+
e.stopPropagation();
|
|
1313
|
+
return true;
|
|
1314
|
+
};
|
|
1214
1315
|
const handleGridKeyDown = (e) => {
|
|
1215
1316
|
if ((local.layout ?? "grid") !== "grid") return false;
|
|
1216
1317
|
if (e.key !== "ArrowRight" && e.key !== "ArrowLeft" && e.key !== "ArrowDown" && e.key !== "ArrowUp") return false;
|
|
@@ -1228,9 +1329,7 @@ function ColorSwatchPicker(props) {
|
|
|
1228
1329
|
case "ArrowRight":
|
|
1229
1330
|
nextKey = getGridKeyRightOf(initialKey);
|
|
1230
1331
|
break;
|
|
1231
|
-
case "ArrowLeft":
|
|
1232
|
-
nextKey = getGridKeyLeftOf(initialKey);
|
|
1233
|
-
break;
|
|
1332
|
+
case "ArrowLeft": nextKey = getGridKeyLeftOf(initialKey);
|
|
1234
1333
|
}
|
|
1235
1334
|
if (nextKey != null) state.setFocusedKey(nextKey);
|
|
1236
1335
|
e.preventDefault();
|
|
@@ -1241,7 +1340,16 @@ function ColorSwatchPicker(props) {
|
|
|
1241
1340
|
return listBoxAria.listBoxProps.onKeyDown;
|
|
1242
1341
|
};
|
|
1243
1342
|
const onColorSwatchPickerKeyDown = (e) => {
|
|
1244
|
-
if (handleGridKeyDown(e)) return;
|
|
1343
|
+
if (handleGridKeyDown(e) || handleStackKeyDown(e)) return;
|
|
1344
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1345
|
+
const key = state.focusedKey();
|
|
1346
|
+
if (key != null && !isItemDisabled(key)) {
|
|
1347
|
+
state.setSelectedKeys([key]);
|
|
1348
|
+
e.preventDefault();
|
|
1349
|
+
e.stopPropagation();
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1245
1353
|
getListBoxKeyDown()?.(e);
|
|
1246
1354
|
};
|
|
1247
1355
|
const { isFocused, isFocusVisible, focusProps } = createFocusRing({ within: true });
|
|
@@ -1265,15 +1373,28 @@ function ColorSwatchPicker(props) {
|
|
|
1265
1373
|
const { ref: _ref, ...restFocusProps } = focusProps;
|
|
1266
1374
|
return restFocusProps;
|
|
1267
1375
|
};
|
|
1268
|
-
return <ColorSwatchPickerContextInternal
|
|
1376
|
+
return <ColorSwatchPickerContextInternal value={{
|
|
1269
1377
|
state,
|
|
1270
1378
|
registerItem,
|
|
1271
1379
|
unregisterItem
|
|
1272
1380
|
}}>
|
|
1273
|
-
<div {...mergeProps
|
|
1381
|
+
<div {...mergeProps(domProps(), cleanListBoxProps(), cleanFocusProps(), {
|
|
1382
|
+
onKeyDown: onColorSwatchPickerKeyDown,
|
|
1383
|
+
onFocus: (e) => {
|
|
1384
|
+
if (e.target !== e.currentTarget) return;
|
|
1385
|
+
if (state.focusedKey() == null) {
|
|
1386
|
+
const key = state.selectionManager.firstSelectedKey ?? state.collection().getFirstKey();
|
|
1387
|
+
if (key != null) state.setFocusedKey(key);
|
|
1388
|
+
}
|
|
1389
|
+
state.setFocused(true);
|
|
1390
|
+
try {
|
|
1391
|
+
flush();
|
|
1392
|
+
} catch {}
|
|
1393
|
+
}
|
|
1394
|
+
})} ref={setPickerRef} class={renderProps.class()} style={renderProps.style()} slot={local.slot ?? void 0} data-focused={dataAttr(state.isFocused())} data-focus-visible={dataAttr(isFocusVisible())} data-layout={local.layout ?? "grid"}>
|
|
1274
1395
|
{local.children}
|
|
1275
1396
|
</div>
|
|
1276
|
-
</ColorSwatchPickerContextInternal
|
|
1397
|
+
</ColorSwatchPickerContextInternal>;
|
|
1277
1398
|
}
|
|
1278
1399
|
function ColorSwatchPickerItem(props) {
|
|
1279
1400
|
const context = useContext(ColorSwatchPickerContextInternal);
|
|
@@ -1291,15 +1412,14 @@ function ColorSwatchPickerItem(props) {
|
|
|
1291
1412
|
const locale = globalThis.navigator?.language ?? "en-US";
|
|
1292
1413
|
return color().getColorName(locale);
|
|
1293
1414
|
});
|
|
1294
|
-
createEffect(() => {
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
onCleanup(() => context.unregisterItem(itemKey));
|
|
1415
|
+
createEffect(() => ({
|
|
1416
|
+
key: key(),
|
|
1417
|
+
color: color(),
|
|
1418
|
+
textValue: textValue(),
|
|
1419
|
+
isDisabled: ariaProps.isDisabled
|
|
1420
|
+
}), (item) => {
|
|
1421
|
+
context.registerItem(item);
|
|
1422
|
+
return () => context.unregisterItem(item.key);
|
|
1303
1423
|
});
|
|
1304
1424
|
const [optionRef, setOptionRef] = createSignal(null);
|
|
1305
1425
|
const optionAria = createOption(() => ({
|
|
@@ -1328,10 +1448,10 @@ function ColorSwatchPickerItem(props) {
|
|
|
1328
1448
|
const { ref: _ref, ...restOptionProps } = optionAria.optionProps;
|
|
1329
1449
|
return restOptionProps;
|
|
1330
1450
|
};
|
|
1331
|
-
return <div ref={setOptionRef} {...mergeProps
|
|
1332
|
-
<ColorSwatchContextInternal
|
|
1451
|
+
return <div ref={setOptionRef} {...mergeProps(domProps(), cleanOptionProps())} class={renderProps.class()} style={renderProps.style()}>
|
|
1452
|
+
<ColorSwatchContextInternal value={{ color: color() }}>
|
|
1333
1453
|
{renderProps.children ? renderProps.renderChildren() : <ColorSwatch />}
|
|
1334
|
-
</ColorSwatchContextInternal
|
|
1454
|
+
</ColorSwatchContextInternal>
|
|
1335
1455
|
</div>;
|
|
1336
1456
|
}
|
|
1337
1457
|
//#endregion
|