@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/TimeField.tsx
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
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
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/DateField.tsx
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* TimeField component for solidaria-components
|
|
3
17
|
*
|
|
4
|
-
* Pre-wired headless time field.
|
|
5
|
-
*
|
|
18
|
+
* Pre-wired headless time field. The pinned TimeField implementation does not
|
|
19
|
+
* define its own segment primitives. It reuses
|
|
6
20
|
* `DateInput`/`DateSegment` (there is no `TimeInput`/`TimeSegment` upstream).
|
|
7
21
|
* `TimeFieldState` IS a `DateFieldState` (plus `timeValue`), so this component
|
|
8
22
|
* drives the certified DateField segment/group stack directly: it provides the
|
|
@@ -13,16 +27,9 @@
|
|
|
13
27
|
* the inner DateInput sibling.
|
|
14
28
|
*/
|
|
15
29
|
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
createContext,
|
|
20
|
-
createMemo,
|
|
21
|
-
createSignal,
|
|
22
|
-
splitProps,
|
|
23
|
-
useContext,
|
|
24
|
-
Show,
|
|
25
|
-
} from "solid-js";
|
|
30
|
+
import { createContext, createMemo, createSignal, useContext } from "solid-js";
|
|
31
|
+
import type { Context } from "solid-js";
|
|
32
|
+
import type { JSX } from "@solidjs/web";
|
|
26
33
|
import { createTimeField, mergeProps, type AriaTimeFieldProps } from "@proyecto-viviana/solidaria";
|
|
27
34
|
import {
|
|
28
35
|
createTimeFieldState,
|
|
@@ -32,22 +39,18 @@ import {
|
|
|
32
39
|
type TimeSegment as TimeSegmentType,
|
|
33
40
|
type TimeValue,
|
|
34
41
|
} from "@proyecto-viviana/solid-stately";
|
|
35
|
-
import {
|
|
36
|
-
DateFieldContext,
|
|
37
|
-
DateFieldStateContext,
|
|
38
|
-
type DateFieldContextValue,
|
|
39
|
-
} from "./DateField";
|
|
42
|
+
import { DateFieldContext, DateFieldStateContext, type DateFieldContextValue } from "./DateField";
|
|
40
43
|
import {
|
|
41
44
|
type ClassNameOrFunction,
|
|
42
45
|
type StyleOrFunction,
|
|
43
46
|
type SlotProps,
|
|
44
47
|
useRenderProps,
|
|
45
48
|
dataAttr,
|
|
46
|
-
useIsHydrated,
|
|
47
49
|
Provider,
|
|
48
50
|
} from "./utils";
|
|
49
51
|
import { TextContext } from "./Text";
|
|
50
|
-
import { FormContext, type FormProps } from "./Form";
|
|
52
|
+
import { FormContext, resolveValidationBehavior, type FormProps } from "./Form";
|
|
53
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
51
54
|
|
|
52
55
|
export interface TimeFieldRenderProps {
|
|
53
56
|
/** Whether the field is disabled. */
|
|
@@ -88,53 +91,6 @@ export interface TimeFieldContextValue {
|
|
|
88
91
|
export const TimeFieldContext = createContext<TimeFieldContextValue | null>(null);
|
|
89
92
|
export const TimeFieldStateContext = createContext<TimeFieldState<TimeValue> | null>(null);
|
|
90
93
|
|
|
91
|
-
function withFormValidationBehavior<P extends object>(props: P, formContext: FormProps | null): P {
|
|
92
|
-
if (!formContext?.validationBehavior) {
|
|
93
|
-
return props;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return new Proxy(props, {
|
|
97
|
-
get(target, property, receiver) {
|
|
98
|
-
const localValue = Reflect.get(target, property, receiver);
|
|
99
|
-
if (property === "validationBehavior" && localValue === undefined) {
|
|
100
|
-
return formContext.validationBehavior;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return localValue;
|
|
104
|
-
},
|
|
105
|
-
has(target, property) {
|
|
106
|
-
return (
|
|
107
|
-
Reflect.has(target, property) ||
|
|
108
|
-
(property === "validationBehavior" && formContext.validationBehavior !== undefined)
|
|
109
|
-
);
|
|
110
|
-
},
|
|
111
|
-
ownKeys(target) {
|
|
112
|
-
const keys = new Set(Reflect.ownKeys(target));
|
|
113
|
-
if (formContext.validationBehavior !== undefined) {
|
|
114
|
-
keys.add("validationBehavior");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return Array.from(keys);
|
|
118
|
-
},
|
|
119
|
-
getOwnPropertyDescriptor(target, property) {
|
|
120
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(target, property);
|
|
121
|
-
if (descriptor) {
|
|
122
|
-
return descriptor;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (property === "validationBehavior" && formContext.validationBehavior !== undefined) {
|
|
126
|
-
return {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
configurable: true,
|
|
129
|
-
get: () => formContext.validationBehavior,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return undefined;
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
94
|
function useTimeFieldContextValue(): TimeFieldContextValue {
|
|
139
95
|
const context = useContext(TimeFieldContext);
|
|
140
96
|
if (!context) {
|
|
@@ -161,20 +117,7 @@ export function useTimeFieldContext(): TimeFieldState<TimeValue> {
|
|
|
161
117
|
* ```
|
|
162
118
|
*/
|
|
163
119
|
export function TimeField<T extends TimeValue = TimeValue>(props: TimeFieldProps<T>): JSX.Element {
|
|
164
|
-
|
|
165
|
-
const isHydrated = useIsHydrated();
|
|
166
|
-
const formContext = useContext(FormContext);
|
|
167
|
-
|
|
168
|
-
return (
|
|
169
|
-
<Show
|
|
170
|
-
when={isHydrated()}
|
|
171
|
-
fallback={
|
|
172
|
-
<div class="solidaria-TimeField solidaria-TimeField--placeholder" aria-hidden="true" />
|
|
173
|
-
}
|
|
174
|
-
>
|
|
175
|
-
<TimeFieldInner {...props} __formContext={formContext} />
|
|
176
|
-
</Show>
|
|
177
|
-
);
|
|
120
|
+
return <TimeFieldInner {...props} />;
|
|
178
121
|
}
|
|
179
122
|
|
|
180
123
|
type TimeFieldInnerProps<T extends TimeValue = TimeValue> = TimeFieldProps<T> & {
|
|
@@ -188,9 +131,8 @@ function TimeFieldInner<T extends TimeValue = TimeValue>(
|
|
|
188
131
|
props: TimeFieldInnerProps<T>,
|
|
189
132
|
): JSX.Element {
|
|
190
133
|
const formContext = props.__formContext ?? useContext(FormContext);
|
|
191
|
-
const mergedProps = withFormValidationBehavior(props, formContext);
|
|
192
134
|
const [local, stateProps, rest] = splitProps(
|
|
193
|
-
|
|
135
|
+
props,
|
|
194
136
|
["children", "class", "style", "slot", "__formContext"],
|
|
195
137
|
[
|
|
196
138
|
"value",
|
|
@@ -220,8 +162,7 @@ function TimeFieldInner<T extends TimeValue = TimeValue>(
|
|
|
220
162
|
// Ref to the hidden validation <input> (the DateInput's `<Input>` sibling).
|
|
221
163
|
// Mirrors DateField: create it here, hand it to createTimeField below, and
|
|
222
164
|
// attach it to the same input through the DateFieldContext getter.
|
|
223
|
-
const [validationInputRef, setValidationInputRef] =
|
|
224
|
-
createSignal<HTMLInputElement | null>(null);
|
|
165
|
+
const [validationInputRef, setValidationInputRef] = createSignal<HTMLInputElement | null>(null);
|
|
225
166
|
|
|
226
167
|
const state = createTimeFieldState(stateProps);
|
|
227
168
|
|
|
@@ -236,7 +177,7 @@ function TimeFieldInner<T extends TimeValue = TimeValue>(
|
|
|
236
177
|
isRequired: access(stateProps.isRequired),
|
|
237
178
|
// Standalone default flips the hidden input to type="text" so an empty
|
|
238
179
|
// required value blocks HTML form submission (mirrors DateField).
|
|
239
|
-
validationBehavior: stateProps.validationBehavior
|
|
180
|
+
validationBehavior: resolveValidationBehavior(stateProps.validationBehavior, formContext),
|
|
240
181
|
description: stateProps.description,
|
|
241
182
|
errorMessage: stateProps.errorMessage,
|
|
242
183
|
inputRef: () => validationInputRef() ?? undefined,
|
|
@@ -306,12 +247,10 @@ function TimeFieldInner<T extends TimeValue = TimeValue>(
|
|
|
306
247
|
};
|
|
307
248
|
|
|
308
249
|
return (
|
|
309
|
-
<TimeFieldStateContext
|
|
310
|
-
<DateFieldStateContext
|
|
311
|
-
value={
|
|
312
|
-
|
|
313
|
-
<DateFieldContext.Provider value={dateFieldContextValue}>
|
|
314
|
-
<TimeFieldContext.Provider
|
|
250
|
+
<TimeFieldStateContext value={state as unknown as TimeFieldState<TimeValue>}>
|
|
251
|
+
<DateFieldStateContext value={state as unknown as DateFieldContextValue["state"]}>
|
|
252
|
+
<DateFieldContext value={dateFieldContextValue}>
|
|
253
|
+
<TimeFieldContext
|
|
315
254
|
value={{
|
|
316
255
|
state: state as unknown as TimeFieldState<TimeValue>,
|
|
317
256
|
aria: {
|
|
@@ -348,10 +287,10 @@ function TimeFieldInner<T extends TimeValue = TimeValue>(
|
|
|
348
287
|
RAC TimeField renders none (react-aria-components TimeField.mjs). The
|
|
349
288
|
native-validation <input> is emitted by the inner DateInput sibling.
|
|
350
289
|
*/}
|
|
351
|
-
</TimeFieldContext
|
|
352
|
-
</DateFieldContext
|
|
353
|
-
</DateFieldStateContext
|
|
354
|
-
</TimeFieldStateContext
|
|
290
|
+
</TimeFieldContext>
|
|
291
|
+
</DateFieldContext>
|
|
292
|
+
</DateFieldStateContext>
|
|
293
|
+
</TimeFieldStateContext>
|
|
355
294
|
);
|
|
356
295
|
}
|
|
357
296
|
|
package/src/Toast.tsx
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 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
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Toast.tsx
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* Toast components for solidaria-components
|
|
3
17
|
*
|
|
@@ -6,18 +20,19 @@
|
|
|
6
20
|
*/
|
|
7
21
|
|
|
8
22
|
import {
|
|
9
|
-
type JSX,
|
|
10
|
-
type Accessor,
|
|
11
23
|
createContext,
|
|
12
24
|
createMemo,
|
|
13
25
|
createEffect,
|
|
26
|
+
createRenderEffect,
|
|
14
27
|
createSignal,
|
|
15
28
|
onCleanup,
|
|
16
|
-
splitProps,
|
|
17
29
|
Show,
|
|
18
30
|
useContext,
|
|
31
|
+
createTrackedEffect,
|
|
19
32
|
} from "solid-js";
|
|
20
|
-
import {
|
|
33
|
+
import type { Accessor, Context } from "solid-js";
|
|
34
|
+
import type { JSX } from "@solidjs/web";
|
|
35
|
+
import { Portal } from "@solidjs/web";
|
|
21
36
|
import {
|
|
22
37
|
type ToastState,
|
|
23
38
|
type QueuedToast,
|
|
@@ -31,10 +46,18 @@ import {
|
|
|
31
46
|
createToastRegion,
|
|
32
47
|
useUNSAFE_PortalContext,
|
|
33
48
|
} from "@proyecto-viviana/solidaria";
|
|
49
|
+
import { ButtonContext } from "./Button";
|
|
50
|
+
import { TextContext } from "./Text";
|
|
51
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
34
52
|
import {
|
|
53
|
+
type ContextValue,
|
|
35
54
|
type RenderChildren,
|
|
36
55
|
type ClassNameOrFunction,
|
|
37
56
|
type StyleOrFunction,
|
|
57
|
+
type SlotProps,
|
|
58
|
+
DEFAULT_SLOT,
|
|
59
|
+
Provider,
|
|
60
|
+
useContextProps,
|
|
38
61
|
useRenderProps,
|
|
39
62
|
filterDOMProps,
|
|
40
63
|
useIsHydrated,
|
|
@@ -135,6 +158,9 @@ interface ToastAriaContextValue {
|
|
|
135
158
|
}
|
|
136
159
|
|
|
137
160
|
const ToastAriaContext = createContext<ToastAriaContextValue | null>(null);
|
|
161
|
+
export const ToastContentContext = createContext<ContextValue<ToastContentProps, HTMLDivElement>>(
|
|
162
|
+
{},
|
|
163
|
+
);
|
|
138
164
|
const toastStateByKey = new Map<string, ToastState<ToastContent>>();
|
|
139
165
|
|
|
140
166
|
export function useToastContext(): ToastState<ToastContent> {
|
|
@@ -191,7 +217,7 @@ export function ToastProvider(props: ToastProviderProps): JSX.Element {
|
|
|
191
217
|
|
|
192
218
|
const state = createToastState({ queue });
|
|
193
219
|
|
|
194
|
-
return <ToastContext
|
|
220
|
+
return <ToastContext value={state}>{props.children}</ToastContext>;
|
|
195
221
|
}
|
|
196
222
|
|
|
197
223
|
/**
|
|
@@ -376,18 +402,24 @@ export function ToastRegion(props: ToastRegionProps): JSX.Element {
|
|
|
376
402
|
export function Toast(props: ToastProps): JSX.Element {
|
|
377
403
|
const [local, rest] = splitProps(props, ["toast", "children", "class", "style"]);
|
|
378
404
|
|
|
379
|
-
|
|
405
|
+
const [toastEl, setToastEl] = createSignal<HTMLDivElement | null>(null);
|
|
380
406
|
|
|
381
407
|
const state = useToastContext();
|
|
382
408
|
|
|
383
|
-
|
|
409
|
+
createTrackedEffect(() => {
|
|
410
|
+
const _s2Cleanups: Array<() => void> = [];
|
|
411
|
+
|
|
384
412
|
const key = local.toast.key;
|
|
385
413
|
toastStateByKey.set(key, state);
|
|
386
|
-
|
|
414
|
+
_s2Cleanups.push(() => {
|
|
387
415
|
if (toastStateByKey.get(key) === state) {
|
|
388
416
|
toastStateByKey.delete(key);
|
|
389
417
|
}
|
|
390
418
|
});
|
|
419
|
+
|
|
420
|
+
return () => {
|
|
421
|
+
for (const c of _s2Cleanups) c();
|
|
422
|
+
};
|
|
391
423
|
});
|
|
392
424
|
|
|
393
425
|
const hasTitle = () => !!(local.toast.content.children ?? local.toast.content.title);
|
|
@@ -442,8 +474,11 @@ export function Toast(props: ToastProps): JSX.Element {
|
|
|
442
474
|
// In JSDOM or when no animations are running, remove immediately.
|
|
443
475
|
// Reduced-motion is handled by CSS (shorter/no animations), so the lifecycle
|
|
444
476
|
// naturally completes faster when the user prefers reduced motion.
|
|
445
|
-
|
|
477
|
+
createTrackedEffect(() => {
|
|
478
|
+
const _s2Cleanups: Array<() => void> = [];
|
|
479
|
+
|
|
446
480
|
if (local.toast.animation !== "exiting") return;
|
|
481
|
+
const toastRef = toastEl();
|
|
447
482
|
if (!toastRef) {
|
|
448
483
|
state.remove(local.toast.key);
|
|
449
484
|
return;
|
|
@@ -477,55 +512,63 @@ export function Toast(props: ToastProps): JSX.Element {
|
|
|
477
512
|
}
|
|
478
513
|
});
|
|
479
514
|
|
|
480
|
-
|
|
515
|
+
_s2Cleanups.push(() => {
|
|
481
516
|
canceled = true;
|
|
482
517
|
});
|
|
518
|
+
|
|
519
|
+
return () => {
|
|
520
|
+
for (const c of _s2Cleanups) c();
|
|
521
|
+
};
|
|
483
522
|
});
|
|
484
523
|
|
|
485
524
|
const { ref: _ref, ...cleanToastProps } = toastAria.toastProps as Record<string, unknown>;
|
|
486
525
|
|
|
487
|
-
//
|
|
488
|
-
//
|
|
489
|
-
//
|
|
490
|
-
//
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
if (
|
|
503
|
-
|
|
526
|
+
// Apply title/description ids and content live-region attributes onto
|
|
527
|
+
// descendants that opted in via data-solidaria-toast-* (S2 used a raw
|
|
528
|
+
// content div before ToastContent). Signal ref + createRenderEffect so
|
|
529
|
+
// a first-run null ref still reapplies after mount, before paint.
|
|
530
|
+
createRenderEffect(
|
|
531
|
+
() => {
|
|
532
|
+
const toastRef = toastEl();
|
|
533
|
+
const titleId = (toastAria.titleProps as Record<string, unknown>).id as string | undefined;
|
|
534
|
+
const descriptionId = (toastAria.descriptionProps as Record<string, unknown>).id as
|
|
535
|
+
| string
|
|
536
|
+
| undefined;
|
|
537
|
+
const contentProps = toastAria.contentProps as Record<string, unknown>;
|
|
538
|
+
return { toastRef, titleId, descriptionId, contentProps };
|
|
539
|
+
},
|
|
540
|
+
({ toastRef, titleId, descriptionId, contentProps }) => {
|
|
541
|
+
if (!toastRef) return;
|
|
542
|
+
|
|
543
|
+
if (titleId) {
|
|
544
|
+
const titleEl = toastRef.querySelector("[data-solidaria-toast-title]");
|
|
545
|
+
if (titleEl instanceof HTMLElement) {
|
|
546
|
+
titleEl.id = titleId;
|
|
547
|
+
}
|
|
504
548
|
}
|
|
505
|
-
}
|
|
506
549
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
550
|
+
if (descriptionId) {
|
|
551
|
+
const descriptionEl = toastRef.querySelector("[data-solidaria-toast-description]");
|
|
552
|
+
if (descriptionEl instanceof HTMLElement) {
|
|
553
|
+
descriptionEl.id = descriptionId;
|
|
554
|
+
}
|
|
511
555
|
}
|
|
512
|
-
}
|
|
513
556
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
}
|
|
525
|
-
|
|
557
|
+
const contentEl = toastRef.querySelector("[data-solidaria-toast-content]");
|
|
558
|
+
if (contentEl instanceof HTMLElement) {
|
|
559
|
+
const role = contentProps.role as string | undefined;
|
|
560
|
+
const ariaAtomic = contentProps["aria-atomic"] as string | undefined;
|
|
561
|
+
const ariaHidden = contentProps["aria-hidden"] as string | undefined;
|
|
562
|
+
if (role) contentEl.setAttribute("role", role);
|
|
563
|
+
if (ariaAtomic) contentEl.setAttribute("aria-atomic", ariaAtomic);
|
|
564
|
+
if (ariaHidden) contentEl.setAttribute("aria-hidden", ariaHidden);
|
|
565
|
+
else contentEl.removeAttribute("aria-hidden");
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
);
|
|
526
569
|
|
|
527
570
|
return (
|
|
528
|
-
<ToastAriaContext
|
|
571
|
+
<ToastAriaContext
|
|
529
572
|
value={{
|
|
530
573
|
titleProps: toastAria.titleProps,
|
|
531
574
|
descriptionProps: toastAria.descriptionProps,
|
|
@@ -533,7 +576,7 @@ export function Toast(props: ToastProps): JSX.Element {
|
|
|
533
576
|
}}
|
|
534
577
|
>
|
|
535
578
|
<div
|
|
536
|
-
ref={
|
|
579
|
+
ref={setToastEl}
|
|
537
580
|
{...domProps()}
|
|
538
581
|
{...cleanToastProps}
|
|
539
582
|
class={renderProps.class()}
|
|
@@ -541,11 +584,50 @@ export function Toast(props: ToastProps): JSX.Element {
|
|
|
541
584
|
data-animation={local.toast.animation}
|
|
542
585
|
data-type={local.toast.content.type ?? local.toast.content.variant}
|
|
543
586
|
data-variant={local.toast.content.variant}
|
|
544
|
-
|
|
587
|
+
onClick={handleRootClick}
|
|
545
588
|
>
|
|
546
|
-
|
|
589
|
+
<Provider
|
|
590
|
+
values={
|
|
591
|
+
[
|
|
592
|
+
[ToastContentContext, toastAria.contentProps],
|
|
593
|
+
[
|
|
594
|
+
TextContext,
|
|
595
|
+
{
|
|
596
|
+
slots: {
|
|
597
|
+
[DEFAULT_SLOT]: {},
|
|
598
|
+
get title() {
|
|
599
|
+
return toastAria.titleProps;
|
|
600
|
+
},
|
|
601
|
+
get description() {
|
|
602
|
+
return toastAria.descriptionProps;
|
|
603
|
+
},
|
|
604
|
+
},
|
|
605
|
+
},
|
|
606
|
+
],
|
|
607
|
+
[
|
|
608
|
+
ButtonContext,
|
|
609
|
+
{
|
|
610
|
+
slots: {
|
|
611
|
+
[DEFAULT_SLOT]: {},
|
|
612
|
+
close: {
|
|
613
|
+
onPress: () => {
|
|
614
|
+
state.close(local.toast.key);
|
|
615
|
+
state.remove(local.toast.key);
|
|
616
|
+
},
|
|
617
|
+
"aria-label": (toastAria.closeButtonProps as Record<string, unknown>)[
|
|
618
|
+
"aria-label"
|
|
619
|
+
],
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
],
|
|
624
|
+
] as Array<[Context<unknown>, unknown]>
|
|
625
|
+
}
|
|
626
|
+
>
|
|
627
|
+
{renderProps.renderChildren()}
|
|
628
|
+
</Provider>
|
|
547
629
|
</div>
|
|
548
|
-
</ToastAriaContext
|
|
630
|
+
</ToastAriaContext>
|
|
549
631
|
);
|
|
550
632
|
}
|
|
551
633
|
|
|
@@ -604,35 +686,28 @@ export function ToastDescription(props: ToastDescriptionProps): JSX.Element {
|
|
|
604
686
|
);
|
|
605
687
|
}
|
|
606
688
|
|
|
607
|
-
export interface ToastContentProps {
|
|
608
|
-
children
|
|
689
|
+
export interface ToastContentProps extends JSX.HTMLAttributes<HTMLDivElement>, SlotProps {
|
|
690
|
+
children?: JSX.Element;
|
|
609
691
|
class?: string;
|
|
610
692
|
style?: JSX.CSSProperties;
|
|
611
693
|
}
|
|
612
694
|
|
|
613
695
|
/**
|
|
614
696
|
* ToastContent wraps the toast message (title + description) in the live region
|
|
615
|
-
* announced to screen readers. It
|
|
616
|
-
*
|
|
697
|
+
* announced to screen readers. It consumes RAC ToastContentContext (role="alert",
|
|
698
|
+
* aria-atomic, aria-hidden until mounted) so the toast text is announced when
|
|
699
|
+
* it appears.
|
|
617
700
|
*
|
|
618
701
|
* It is rendered as a sibling of the close button (never wrapping it) so screen
|
|
619
702
|
* readers announce the message without reading the close button first.
|
|
620
703
|
*/
|
|
621
704
|
export function ToastContent(props: ToastContentProps): JSX.Element {
|
|
622
|
-
const
|
|
623
|
-
const
|
|
624
|
-
string,
|
|
625
|
-
unknown
|
|
626
|
-
>;
|
|
705
|
+
const [merged] = useContextProps(props, undefined, ToastContentContext);
|
|
706
|
+
const [local, rest] = splitProps(merged, ["class", "style", "children", "slot", "ref"]);
|
|
627
707
|
|
|
628
708
|
return (
|
|
629
|
-
<div
|
|
630
|
-
|
|
631
|
-
{...ariaContentProps}
|
|
632
|
-
class={props.class}
|
|
633
|
-
style={props.style}
|
|
634
|
-
>
|
|
635
|
-
{props.children}
|
|
709
|
+
<div data-solidaria-toast-content="" {...rest} class={local.class} style={local.style}>
|
|
710
|
+
{local.children}
|
|
636
711
|
</div>
|
|
637
712
|
);
|
|
638
713
|
}
|
|
@@ -665,7 +740,6 @@ export function ToastCloseButton(props: ToastCloseButtonProps): JSX.Element {
|
|
|
665
740
|
style={props.style}
|
|
666
741
|
aria-label={props["aria-label"] ?? "Close"}
|
|
667
742
|
data-solidaria-toast-close-button=""
|
|
668
|
-
on:click={handleClose}
|
|
669
743
|
onClick={handleClose}
|
|
670
744
|
>
|
|
671
745
|
{props.children ?? "×"}
|
package/src/ToggleButton.tsx
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
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
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/ToggleButton.tsx
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* ToggleButton component for solidaria-components
|
|
3
17
|
*
|
|
4
18
|
* A pre-wired headless toggle button that combines pressed + selected state.
|
|
5
|
-
*
|
|
19
|
+
* Based on packages/react-aria-components/src/ToggleButton.tsx.
|
|
6
20
|
*/
|
|
7
21
|
|
|
8
|
-
import {
|
|
22
|
+
import { createContext, createMemo, useContext } from "solid-js";
|
|
23
|
+
import type { JSX } from "@solidjs/web";
|
|
9
24
|
import {
|
|
10
25
|
createToggleButton,
|
|
11
26
|
createToggleButtonGroupItem,
|
|
12
27
|
createFocusRing,
|
|
13
28
|
createHover,
|
|
14
29
|
mergeProps,
|
|
30
|
+
type AriaToggleButtonGroupItemProps,
|
|
15
31
|
type AriaToggleButtonProps,
|
|
16
32
|
} from "@proyecto-viviana/solidaria";
|
|
17
33
|
import type { Key } from "@proyecto-viviana/solid-stately";
|
|
@@ -22,8 +38,10 @@ import {
|
|
|
22
38
|
type SlotProps,
|
|
23
39
|
useRenderProps,
|
|
24
40
|
filterDOMProps,
|
|
41
|
+
dataAttr,
|
|
25
42
|
} from "./utils";
|
|
26
43
|
import { useToggleButtonGroupStateContext } from "./ToggleButtonGroup";
|
|
44
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
27
45
|
|
|
28
46
|
type RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;
|
|
29
47
|
|
|
@@ -87,15 +105,15 @@ export function ToggleButton(props: ToggleButtonProps): JSX.Element {
|
|
|
87
105
|
},
|
|
88
106
|
});
|
|
89
107
|
|
|
108
|
+
const groupedAriaProps = mergeProps<AriaToggleButtonGroupItemProps>(ariaProps, {
|
|
109
|
+
get id(): Key {
|
|
110
|
+
return (local.id ?? local.toggleKey) as Key;
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
90
114
|
const toggleAria =
|
|
91
115
|
groupState && groupKey != null
|
|
92
|
-
? createToggleButtonGroupItem(
|
|
93
|
-
{
|
|
94
|
-
...ariaProps,
|
|
95
|
-
id: groupKey,
|
|
96
|
-
},
|
|
97
|
-
groupState,
|
|
98
|
-
)
|
|
116
|
+
? createToggleButtonGroupItem(groupedAriaProps, groupState)
|
|
99
117
|
: createToggleButton(standaloneAriaProps);
|
|
100
118
|
|
|
101
119
|
const isDisabled = () => resolveDisabledValue(ariaProps.isDisabled) || !!groupState?.isDisabled;
|
|
@@ -158,12 +176,12 @@ export function ToggleButton(props: ToggleButtonProps): JSX.Element {
|
|
|
158
176
|
style={renderProps.style()}
|
|
159
177
|
ref={(el) => assignRef(local.ref, el)}
|
|
160
178
|
slot={local.slot}
|
|
161
|
-
data-pressed={toggleAria.isPressed()
|
|
162
|
-
data-hovered={isHovered()
|
|
163
|
-
data-focused={isFocused()
|
|
164
|
-
data-focus-visible={isFocusVisible()
|
|
165
|
-
data-disabled={isDisabled()
|
|
166
|
-
data-selected={toggleAria.isSelected()
|
|
179
|
+
data-pressed={dataAttr(toggleAria.isPressed())}
|
|
180
|
+
data-hovered={dataAttr(isHovered())}
|
|
181
|
+
data-focused={dataAttr(isFocused())}
|
|
182
|
+
data-focus-visible={dataAttr(isFocusVisible())}
|
|
183
|
+
data-disabled={dataAttr(isDisabled())}
|
|
184
|
+
data-selected={dataAttr(toggleAria.isSelected())}
|
|
167
185
|
>
|
|
168
186
|
{renderProps.renderChildren()}
|
|
169
187
|
</button>
|