@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/FileTrigger.js
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/FileTrigger.tsx
|
|
13
|
+
import { getNextElement, insert, ref, runHydrationEvents, scope, spread, template } from "@solidjs/web";
|
|
14
|
+
import { createSignal } from "solid-js";
|
|
3
15
|
import { createPress } from "@proyecto-viviana/solidaria";
|
|
16
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
4
17
|
//#region src/FileTrigger.tsx
|
|
5
18
|
/**
|
|
6
19
|
* FileTrigger primitive for solidaria-components.
|
|
7
20
|
*
|
|
8
21
|
* Opens the native file picker from any pressable child.
|
|
9
|
-
*
|
|
22
|
+
* Based on packages/react-aria-components/src/FileTrigger.tsx.
|
|
10
23
|
*/
|
|
11
|
-
var _tmpl$ =
|
|
24
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
25
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<input>`);
|
|
12
26
|
/**
|
|
13
27
|
* A FileTrigger allows a user to access the file system using a custom trigger.
|
|
14
28
|
*/
|
|
@@ -42,16 +56,20 @@ function FileTrigger(props) {
|
|
|
42
56
|
};
|
|
43
57
|
return [(() => {
|
|
44
58
|
var _el$ = getNextElement(_tmpl$);
|
|
45
|
-
spread(_el$, pressProps,
|
|
46
|
-
insert(_el$, () =>
|
|
59
|
+
spread(_el$, pressProps, true);
|
|
60
|
+
insert(_el$, scope(() => {
|
|
61
|
+
return local.children;
|
|
62
|
+
}));
|
|
47
63
|
runHydrationEvents();
|
|
48
64
|
return _el$;
|
|
49
65
|
})(), (() => {
|
|
50
66
|
var _el$2 = getNextElement(_tmpl$2);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
67
|
+
ref(() => {
|
|
68
|
+
return setInputRef;
|
|
69
|
+
}, _el$2);
|
|
70
|
+
spread(_el$2, [inputProps, {
|
|
71
|
+
type: "file",
|
|
72
|
+
style: { display: "none" },
|
|
55
73
|
get accept() {
|
|
56
74
|
return local.acceptedFileTypes?.join(",");
|
|
57
75
|
},
|
|
@@ -67,8 +85,8 @@ function FileTrigger(props) {
|
|
|
67
85
|
get webkitdirectory() {
|
|
68
86
|
return local.acceptDirectory ? "" : void 0;
|
|
69
87
|
},
|
|
70
|
-
|
|
71
|
-
}
|
|
88
|
+
onChange: onInputChange
|
|
89
|
+
}], false);
|
|
72
90
|
runHydrationEvents();
|
|
73
91
|
return _el$2;
|
|
74
92
|
})()];
|
package/dist/FileTrigger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileTrigger.js","names":["
|
|
1
|
+
{"version":3,"file":"FileTrigger.js","names":["{local.children}","ref={setInputRef}","type=\"file\"","style={{ display: \"none\" }}","onChange={onInputChange}"],"sources":["../src/FileTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/FileTrigger.tsx\n\n/**\n * FileTrigger primitive for solidaria-components.\n *\n * Opens the native file picker from any pressable child.\n * Based on packages/react-aria-components/src/FileTrigger.tsx.\n */\n\nimport { createSignal } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { createPress, type PressEvent } from \"@proyecto-viviana/solidaria\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface FileTriggerProps extends Omit<\n JSX.InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"onChange\" | \"children\" | \"onSelect\"\n> {\n /** Mime types accepted by the file picker. */\n acceptedFileTypes?: ReadonlyArray<string>;\n /** Whether multiple files can be selected. */\n allowsMultiple?: boolean;\n /** Default camera capture mode for mobile devices. */\n defaultCamera?: \"user\" | \"environment\";\n /** Enables directory selection in supported browsers. */\n acceptDirectory?: boolean;\n /** Called when user selection changes. */\n onSelect?: (files: FileList | null) => void;\n /** Trigger content (typically a button). */\n children?: JSX.Element;\n}\n\n/**\n * A FileTrigger allows a user to access the file system using a custom trigger.\n */\nexport function FileTrigger(props: FileTriggerProps): JSX.Element {\n const [local, inputProps] = splitProps(props, [\n \"acceptedFileTypes\",\n \"allowsMultiple\",\n \"defaultCamera\",\n \"acceptDirectory\",\n \"onSelect\",\n \"children\",\n \"disabled\",\n ]);\n\n const [inputRef, setInputRef] = createSignal<HTMLInputElement | null>(null);\n\n const openFilePicker = () => {\n const input = inputRef();\n if (!input) return;\n if (input.value) input.value = \"\";\n input.click();\n };\n\n const { pressProps } = createPress({\n get isDisabled() {\n return !!local.disabled;\n },\n onPress: (_e: PressEvent) => {\n openFilePicker();\n },\n });\n\n const onInputChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n local.onSelect?.(e.currentTarget.files);\n };\n\n return (\n <>\n <span {...pressProps}>{local.children}</span>\n <input\n {...inputProps}\n ref={setInputRef}\n type=\"file\"\n style={{ display: \"none\" }}\n accept={local.acceptedFileTypes?.join(\",\")}\n multiple={local.allowsMultiple}\n capture={local.defaultCamera}\n disabled={local.disabled}\n webkitdirectory={local.acceptDirectory ? \"\" : undefined}\n onChange={onInputChange}\n />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,YAAY,OAAsC;CAChE,MAAM,CAAC,OAAO,cAAc,WAAW,OAAO;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,CAAC,UAAU,eAAe,aAAsC,IAAI;CAE1E,MAAM,uBAAuB;EAC3B,MAAM,QAAQ,SAAS;EACvB,IAAI,CAAC,OAAO;EACZ,IAAI,MAAM,OAAO,MAAM,QAAQ;EAC/B,MAAM,MAAM;CACd;CAEA,MAAM,EAAE,eAAe,YAAY;EACjC,IAAI,aAAa;GACf,OAAO,CAAC,CAAC,MAAM;EACjB;EACA,UAAU,OAAmB;GAC3B,eAAe;EACjB;CACF,CAAC;CAED,MAAM,iBAA4D,MAAM;EACtE,MAAM,WAAW,EAAE,cAAc,KAAK;CACxC;CAEA,OACI,QACA;EAA4C,IAAA,OAAA,eAAA,MAAA;EAAlC,OAAA,MAAA,YAAA,IAAA;EAAV,OAAA,MAAsBA,YAAAA;GAAC,OAAA,MAAM;EAAQ,CAAA,CAAO;EAA5C,mBAA4C;EAA5C,OAAA;CAA4C,EAAA,CAAA,UAC5C;EAWC,IAAA,QAAA,eAAA,OAAA;EATC,UAAA;GAAK,OAAA;EAAW,GAAhBC,KAAgB;EADZ,OAAA,OAAA,CAAA,YAAA;GAEJC,MAAAA;GACAC,OAAO,EAAE,SAAS,OAAO;GACzB,IAAA,SAAA;IAAQ,OAAA,MAAM,mBAAmB,KAAK,GAAG;GAAC;GAC1C,IAAA,WAAA;IAAU,OAAA,MAAM;GAAc;GAC9B,IAAA,UAAA;IAAS,OAAA,MAAM;GAAa;GAC5B,IAAA,WAAA;IAAU,OAAA,MAAM;GAAQ;GACxB,IAAA,kBAAA;IAAiB,OAAA,MAAM,kBAAkB,KAAK,KAAA;GAAS;GACvDC,UAAU;;EAVZ,mBAWC;EAXD,OAAA;CAWC,EAAA,CAAA,CAZF;AAeL"}
|
package/dist/FileTrigger.jsx
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/FileTrigger.tsx
|
|
13
|
+
import { createSignal } from "solid-js";
|
|
2
14
|
import { createPress } from "@proyecto-viviana/solidaria";
|
|
15
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
3
16
|
//#region src/FileTrigger.tsx
|
|
4
17
|
/**
|
|
5
18
|
* FileTrigger primitive for solidaria-components.
|
|
6
19
|
*
|
|
7
20
|
* Opens the native file picker from any pressable child.
|
|
8
|
-
*
|
|
21
|
+
* Based on packages/react-aria-components/src/FileTrigger.tsx.
|
|
9
22
|
*/
|
|
10
23
|
/**
|
|
11
24
|
* A FileTrigger allows a user to access the file system using a custom trigger.
|
package/dist/FileTrigger.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileTrigger.jsx","names":[],"sources":["../src/FileTrigger.tsx"],"sourcesContent":["/**\n * FileTrigger primitive for solidaria-components.\n *\n * Opens the native file picker from any pressable child.\n *
|
|
1
|
+
{"version":3,"file":"FileTrigger.jsx","names":[],"sources":["../src/FileTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/FileTrigger.tsx\n\n/**\n * FileTrigger primitive for solidaria-components.\n *\n * Opens the native file picker from any pressable child.\n * Based on packages/react-aria-components/src/FileTrigger.tsx.\n */\n\nimport { createSignal } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { createPress, type PressEvent } from \"@proyecto-viviana/solidaria\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface FileTriggerProps extends Omit<\n JSX.InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"onChange\" | \"children\" | \"onSelect\"\n> {\n /** Mime types accepted by the file picker. */\n acceptedFileTypes?: ReadonlyArray<string>;\n /** Whether multiple files can be selected. */\n allowsMultiple?: boolean;\n /** Default camera capture mode for mobile devices. */\n defaultCamera?: \"user\" | \"environment\";\n /** Enables directory selection in supported browsers. */\n acceptDirectory?: boolean;\n /** Called when user selection changes. */\n onSelect?: (files: FileList | null) => void;\n /** Trigger content (typically a button). */\n children?: JSX.Element;\n}\n\n/**\n * A FileTrigger allows a user to access the file system using a custom trigger.\n */\nexport function FileTrigger(props: FileTriggerProps): JSX.Element {\n const [local, inputProps] = splitProps(props, [\n \"acceptedFileTypes\",\n \"allowsMultiple\",\n \"defaultCamera\",\n \"acceptDirectory\",\n \"onSelect\",\n \"children\",\n \"disabled\",\n ]);\n\n const [inputRef, setInputRef] = createSignal<HTMLInputElement | null>(null);\n\n const openFilePicker = () => {\n const input = inputRef();\n if (!input) return;\n if (input.value) input.value = \"\";\n input.click();\n };\n\n const { pressProps } = createPress({\n get isDisabled() {\n return !!local.disabled;\n },\n onPress: (_e: PressEvent) => {\n openFilePicker();\n },\n });\n\n const onInputChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n local.onSelect?.(e.currentTarget.files);\n };\n\n return (\n <>\n <span {...pressProps}>{local.children}</span>\n <input\n {...inputProps}\n ref={setInputRef}\n type=\"file\"\n style={{ display: \"none\" }}\n accept={local.acceptedFileTypes?.join(\",\")}\n multiple={local.allowsMultiple}\n capture={local.defaultCamera}\n disabled={local.disabled}\n webkitdirectory={local.acceptDirectory ? \"\" : undefined}\n onChange={onInputChange}\n />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,YAAY,OAAsC;CAChE,MAAM,CAAC,OAAO,cAAc,WAAW,OAAO;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,CAAC,UAAU,eAAe,aAAsC,IAAI;CAE1E,MAAM,uBAAuB;EAC3B,MAAM,QAAQ,SAAS;EACvB,IAAI,CAAC,OAAO;EACZ,IAAI,MAAM,OAAO,MAAM,QAAQ;EAC/B,MAAM,MAAM;CACd;CAEA,MAAM,EAAE,eAAe,YAAY;EACjC,IAAI,aAAa;GACf,OAAO,CAAC,CAAC,MAAM;EACjB;EACA,UAAU,OAAmB;GAC3B,eAAe;EACjB;CACF,CAAC;CAED,MAAM,iBAA4D,MAAM;EACtE,MAAM,WAAW,EAAE,cAAc,KAAK;CACxC;CAEA,OACE,EAAE;MACA,CAAC,SAAS,aAAa,MAAM,SAAS,EAAE,KAAK;MAC7C,CAAC,UACK,YACJ,KAAK,aACL,YACA,OAAO,EAAE,SAAS,OAAO,GACzB,QAAQ,MAAM,mBAAmB,KAAK,GAAG,GACzC,UAAU,MAAM,gBAChB,SAAS,MAAM,eACf,UAAU,MAAM,UAChB,iBAAiB,MAAM,kBAAkB,KAAK,KAAA,GAC9C,UAAU,iBACV;IACJ;AAEJ"}
|
package/dist/Focusable.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Focusable component for solidaria-components
|
|
3
|
-
*
|
|
4
|
-
* A render-prop component that wraps createFocusable to make an element
|
|
5
|
-
* focusable and capable of auto focus. Port of React Aria's Focusable.
|
|
6
|
-
*/
|
|
7
|
-
import { type JSX } from "solid-js";
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
8
2
|
import { type CreateFocusableProps } from "@proyecto-viviana/solidaria";
|
|
9
3
|
export interface FocusableProps extends CreateFocusableProps {
|
|
10
4
|
/** A single child element to make focusable. */
|
|
@@ -19,7 +13,7 @@ export interface FocusableProps extends CreateFocusableProps {
|
|
|
19
13
|
* @example
|
|
20
14
|
* ```tsx
|
|
21
15
|
* <Focusable onFocus={() => console.log('focused')}>
|
|
22
|
-
* <div
|
|
16
|
+
* <div tabindex={0}>Focusable content</div>
|
|
23
17
|
* </Focusable>
|
|
24
18
|
* ```
|
|
25
19
|
*/
|
package/dist/Focusable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Focusable.d.ts","sourceRoot":"","sources":["../src/Focusable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Focusable.d.ts","sourceRoot":"","sources":["../src/Focusable.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGzF,MAAM,WAAW,cAAe,SAAQ,oBAAoB;IAC1D,gDAAgD;IAChD,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;IACtB,oBAAoB;IACpB,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;CACjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CA0E5D"}
|
package/dist/Focusable.js
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/interactions/useFocusable.tsx
|
|
13
|
+
import { memo } from "@solidjs/web";
|
|
14
|
+
import { children, createTrackedEffect } from "solid-js";
|
|
3
15
|
import { createFocusable } from "@proyecto-viviana/solidaria";
|
|
16
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
4
17
|
//#region src/Focusable.tsx
|
|
5
18
|
/**
|
|
6
19
|
* Focusable component for solidaria-components
|
|
7
20
|
*
|
|
8
21
|
* A render-prop component that wraps createFocusable to make an element
|
|
9
|
-
* focusable and capable of auto focus.
|
|
22
|
+
* focusable and capable of auto focus.
|
|
10
23
|
*/
|
|
11
24
|
/**
|
|
12
25
|
* Makes its child element focusable and capable of auto focus.
|
|
@@ -15,7 +28,7 @@ import { createFocusable } from "@proyecto-viviana/solidaria";
|
|
|
15
28
|
* @example
|
|
16
29
|
* ```tsx
|
|
17
30
|
* <Focusable onFocus={() => console.log('focused')}>
|
|
18
|
-
* <div
|
|
31
|
+
* <div tabindex={0}>Focusable content</div>
|
|
19
32
|
* </Focusable>
|
|
20
33
|
* ```
|
|
21
34
|
*/
|
|
@@ -24,7 +37,8 @@ function Focusable(props) {
|
|
|
24
37
|
let ref;
|
|
25
38
|
const { focusableProps: domProps } = createFocusable(focusableProps, () => ref);
|
|
26
39
|
const resolved = children(() => local.children);
|
|
27
|
-
|
|
40
|
+
createTrackedEffect(() => {
|
|
41
|
+
const _s2Cleanups = [];
|
|
28
42
|
const child = resolved();
|
|
29
43
|
if (child instanceof HTMLElement) {
|
|
30
44
|
ref = child;
|
|
@@ -57,10 +71,13 @@ function Focusable(props) {
|
|
|
57
71
|
else child.setAttribute(key, String(value));
|
|
58
72
|
}
|
|
59
73
|
}
|
|
60
|
-
|
|
74
|
+
_s2Cleanups.push(() => {
|
|
61
75
|
for (const [eventName, listener] of listeners) child.removeEventListener(eventName, listener);
|
|
62
76
|
});
|
|
63
77
|
}
|
|
78
|
+
return () => {
|
|
79
|
+
for (const c of _s2Cleanups) c();
|
|
80
|
+
};
|
|
64
81
|
});
|
|
65
82
|
return memo(resolved);
|
|
66
83
|
}
|
package/dist/Focusable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Focusable.js","names":["
|
|
1
|
+
{"version":3,"file":"Focusable.js","names":["{resolved()}"],"sources":["../src/Focusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/interactions/useFocusable.tsx\n\n/**\n * Focusable component for solidaria-components\n *\n * A render-prop component that wraps createFocusable to make an element\n * focusable and capable of auto focus.\n */\n\nimport {\n children as resolveChildren,\n createEffect,\n onCleanup,\n createTrackedEffect,\n} from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { createFocusable, type CreateFocusableProps } from \"@proyecto-viviana/solidaria\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface FocusableProps extends CreateFocusableProps {\n /** A single child element to make focusable. */\n children: JSX.Element;\n /** Ref callback. */\n ref?: HTMLElement | ((el: HTMLElement) => void);\n}\n\n/**\n * Makes its child element focusable and capable of auto focus.\n * Applies focus and keyboard event handlers from createFocusable.\n *\n * @example\n * ```tsx\n * <Focusable onFocus={() => console.log('focused')}>\n * <div tabindex={0}>Focusable content</div>\n * </Focusable>\n * ```\n */\nexport function Focusable(props: FocusableProps): JSX.Element {\n const [local, focusableProps] = splitProps(props, [\"children\", \"ref\"]);\n\n let ref!: HTMLElement;\n const { focusableProps: domProps } = createFocusable(focusableProps, () => ref);\n\n const resolved = resolveChildren(() => local.children);\n\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n const child = resolved() as HTMLElement;\n if (child instanceof HTMLElement) {\n ref = child;\n if (typeof local.ref === \"function\") {\n local.ref(child);\n }\n\n // Apply focusable props to the child element\n const props = domProps;\n const listeners: Array<[string, EventListener]> = [];\n const addListener = (eventName: string, handler: unknown) => {\n if (typeof handler === \"function\") {\n const listener = handler as EventListener;\n child.addEventListener(eventName, listener);\n listeners.push([eventName, listener]);\n }\n };\n\n addListener(\"focus\", props.onFocus);\n addListener(\"blur\", props.onBlur);\n addListener(\"keydown\", props.onKeyDown);\n addListener(\"keyup\", props.onKeyUp);\n\n // Apply non-event focusable props (e.g. tabIndex/aria/data attrs).\n // Keep explicit child tabIndex to mirror mergeProps(child.props precedence).\n for (const [key, value] of Object.entries(props)) {\n if (key === \"ref\" || (key.startsWith(\"on\") && typeof value === \"function\")) continue;\n\n if (key === \"tabIndex\") {\n if (child.hasAttribute(\"tabindex\")) continue;\n if (value == null || value === false) {\n child.removeAttribute(\"tabindex\");\n } else {\n child.tabIndex = Number(value);\n }\n continue;\n }\n\n if (key.startsWith(\"aria-\") || key.startsWith(\"data-\") || key === \"id\" || key === \"role\") {\n if (child.hasAttribute(key)) continue;\n if (value == null || value === false) {\n child.removeAttribute(key);\n } else if (value === true) {\n child.setAttribute(key, \"\");\n } else {\n child.setAttribute(key, String(value));\n }\n }\n }\n\n _s2Cleanups.push(() => {\n for (const [eventName, listener] of listeners) {\n child.removeEventListener(eventName, listener);\n }\n });\n }\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n return <>{resolved()}</>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,SAAgB,UAAU,OAAoC;CAC5D,MAAM,CAAC,OAAO,kBAAkB,WAAW,OAAO,CAAC,YAAY,KAAK,CAAC;CAErE,IAAI;CACJ,MAAM,EAAE,gBAAgB,aAAa,gBAAgB,sBAAsB,GAAG;CAE9E,MAAM,WAAW,eAAsB,MAAM,QAAQ;CAErD,0BAA0B;EACxB,MAAM,cAAiC,CAAC;EAExC,MAAM,QAAQ,SAAS;EACvB,IAAI,iBAAiB,aAAa;GAChC,MAAM;GACN,IAAI,OAAO,MAAM,QAAQ,YACvB,MAAM,IAAI,KAAK;GAIjB,MAAM,QAAQ;GACd,MAAM,YAA4C,CAAC;GACnD,MAAM,eAAe,WAAmB,YAAqB;IAC3D,IAAI,OAAO,YAAY,YAAY;KACjC,MAAM,WAAW;KACjB,MAAM,iBAAiB,WAAW,QAAQ;KAC1C,UAAU,KAAK,CAAC,WAAW,QAAQ,CAAC;IACtC;GACF;GAEA,YAAY,SAAS,MAAM,OAAO;GAClC,YAAY,QAAQ,MAAM,MAAM;GAChC,YAAY,WAAW,MAAM,SAAS;GACtC,YAAY,SAAS,MAAM,OAAO;GAIlC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAAG;IAChD,IAAI,QAAQ,SAAU,IAAI,WAAW,IAAI,KAAK,OAAO,UAAU,YAAa;IAE5E,IAAI,QAAQ,YAAY;KACtB,IAAI,MAAM,aAAa,UAAU,GAAG;KACpC,IAAI,SAAS,QAAQ,UAAU,OAC7B,MAAM,gBAAgB,UAAU;UAEhC,MAAM,WAAW,OAAO,KAAK;KAE/B;IACF;IAEA,IAAI,IAAI,WAAW,OAAO,KAAK,IAAI,WAAW,OAAO,KAAK,QAAQ,QAAQ,QAAQ,QAAQ;KACxF,IAAI,MAAM,aAAa,GAAG,GAAG;KAC7B,IAAI,SAAS,QAAQ,UAAU,OAC7B,MAAM,gBAAgB,GAAG;UACpB,IAAI,UAAU,MACnB,MAAM,aAAa,KAAK,EAAE;UAE1B,MAAM,aAAa,KAAK,OAAO,KAAK,CAAC;IAEzC;GACF;GAEA,YAAY,WAAW;IACrB,KAAK,MAAM,CAAC,WAAW,aAAa,WAClC,MAAM,oBAAoB,WAAW,QAAQ;GAEjD,CAAC;EACH;EAEA,aAAa;GACX,KAAK,MAAM,KAAK,aAAa,EAAE;EACjC;CACF,CAAC;CAED,OAASA,KAAC,QAAU;AACtB"}
|
package/dist/Focusable.jsx
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/interactions/useFocusable.tsx
|
|
13
|
+
import { children, createTrackedEffect } from "solid-js";
|
|
2
14
|
import { createFocusable } from "@proyecto-viviana/solidaria";
|
|
15
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
3
16
|
//#region src/Focusable.tsx
|
|
4
17
|
/**
|
|
5
18
|
* Focusable component for solidaria-components
|
|
6
19
|
*
|
|
7
20
|
* A render-prop component that wraps createFocusable to make an element
|
|
8
|
-
* focusable and capable of auto focus.
|
|
21
|
+
* focusable and capable of auto focus.
|
|
9
22
|
*/
|
|
10
23
|
/**
|
|
11
24
|
* Makes its child element focusable and capable of auto focus.
|
|
@@ -14,7 +27,7 @@ import { createFocusable } from "@proyecto-viviana/solidaria";
|
|
|
14
27
|
* @example
|
|
15
28
|
* ```tsx
|
|
16
29
|
* <Focusable onFocus={() => console.log('focused')}>
|
|
17
|
-
* <div
|
|
30
|
+
* <div tabindex={0}>Focusable content</div>
|
|
18
31
|
* </Focusable>
|
|
19
32
|
* ```
|
|
20
33
|
*/
|
|
@@ -23,7 +36,8 @@ function Focusable(props) {
|
|
|
23
36
|
let ref;
|
|
24
37
|
const { focusableProps: domProps } = createFocusable(focusableProps, () => ref);
|
|
25
38
|
const resolved = children(() => local.children);
|
|
26
|
-
|
|
39
|
+
createTrackedEffect(() => {
|
|
40
|
+
const _s2Cleanups = [];
|
|
27
41
|
const child = resolved();
|
|
28
42
|
if (child instanceof HTMLElement) {
|
|
29
43
|
ref = child;
|
|
@@ -56,10 +70,13 @@ function Focusable(props) {
|
|
|
56
70
|
else child.setAttribute(key, String(value));
|
|
57
71
|
}
|
|
58
72
|
}
|
|
59
|
-
|
|
73
|
+
_s2Cleanups.push(() => {
|
|
60
74
|
for (const [eventName, listener] of listeners) child.removeEventListener(eventName, listener);
|
|
61
75
|
});
|
|
62
76
|
}
|
|
77
|
+
return () => {
|
|
78
|
+
for (const c of _s2Cleanups) c();
|
|
79
|
+
};
|
|
63
80
|
});
|
|
64
81
|
return <>{resolved()}</>;
|
|
65
82
|
}
|
package/dist/Focusable.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Focusable.jsx","names":["resolveChildren"],"sources":["../src/Focusable.tsx"],"sourcesContent":["/**\n * Focusable component for solidaria-components\n *\n * A render-prop component that wraps createFocusable to make an element\n * focusable and capable of auto focus
|
|
1
|
+
{"version":3,"file":"Focusable.jsx","names":["resolveChildren"],"sources":["../src/Focusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/interactions/useFocusable.tsx\n\n/**\n * Focusable component for solidaria-components\n *\n * A render-prop component that wraps createFocusable to make an element\n * focusable and capable of auto focus.\n */\n\nimport {\n children as resolveChildren,\n createEffect,\n onCleanup,\n createTrackedEffect,\n} from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { createFocusable, type CreateFocusableProps } from \"@proyecto-viviana/solidaria\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface FocusableProps extends CreateFocusableProps {\n /** A single child element to make focusable. */\n children: JSX.Element;\n /** Ref callback. */\n ref?: HTMLElement | ((el: HTMLElement) => void);\n}\n\n/**\n * Makes its child element focusable and capable of auto focus.\n * Applies focus and keyboard event handlers from createFocusable.\n *\n * @example\n * ```tsx\n * <Focusable onFocus={() => console.log('focused')}>\n * <div tabindex={0}>Focusable content</div>\n * </Focusable>\n * ```\n */\nexport function Focusable(props: FocusableProps): JSX.Element {\n const [local, focusableProps] = splitProps(props, [\"children\", \"ref\"]);\n\n let ref!: HTMLElement;\n const { focusableProps: domProps } = createFocusable(focusableProps, () => ref);\n\n const resolved = resolveChildren(() => local.children);\n\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n const child = resolved() as HTMLElement;\n if (child instanceof HTMLElement) {\n ref = child;\n if (typeof local.ref === \"function\") {\n local.ref(child);\n }\n\n // Apply focusable props to the child element\n const props = domProps;\n const listeners: Array<[string, EventListener]> = [];\n const addListener = (eventName: string, handler: unknown) => {\n if (typeof handler === \"function\") {\n const listener = handler as EventListener;\n child.addEventListener(eventName, listener);\n listeners.push([eventName, listener]);\n }\n };\n\n addListener(\"focus\", props.onFocus);\n addListener(\"blur\", props.onBlur);\n addListener(\"keydown\", props.onKeyDown);\n addListener(\"keyup\", props.onKeyUp);\n\n // Apply non-event focusable props (e.g. tabIndex/aria/data attrs).\n // Keep explicit child tabIndex to mirror mergeProps(child.props precedence).\n for (const [key, value] of Object.entries(props)) {\n if (key === \"ref\" || (key.startsWith(\"on\") && typeof value === \"function\")) continue;\n\n if (key === \"tabIndex\") {\n if (child.hasAttribute(\"tabindex\")) continue;\n if (value == null || value === false) {\n child.removeAttribute(\"tabindex\");\n } else {\n child.tabIndex = Number(value);\n }\n continue;\n }\n\n if (key.startsWith(\"aria-\") || key.startsWith(\"data-\") || key === \"id\" || key === \"role\") {\n if (child.hasAttribute(key)) continue;\n if (value == null || value === false) {\n child.removeAttribute(key);\n } else if (value === true) {\n child.setAttribute(key, \"\");\n } else {\n child.setAttribute(key, String(value));\n }\n }\n }\n\n _s2Cleanups.push(() => {\n for (const [eventName, listener] of listeners) {\n child.removeEventListener(eventName, listener);\n }\n });\n }\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n return <>{resolved()}</>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,SAAgB,UAAU,OAAoC;CAC5D,MAAM,CAAC,OAAO,kBAAkB,WAAW,OAAO,CAAC,YAAY,KAAK,CAAC;CAErE,IAAI;CACJ,MAAM,EAAE,gBAAgB,aAAa,gBAAgB,sBAAsB,GAAG;CAE9E,MAAM,WAAWA,eAAsB,MAAM,QAAQ;CAErD,0BAA0B;EACxB,MAAM,cAAiC,CAAC;EAExC,MAAM,QAAQ,SAAS;EACvB,IAAI,iBAAiB,aAAa;GAChC,MAAM;GACN,IAAI,OAAO,MAAM,QAAQ,YACvB,MAAM,IAAI,KAAK;GAIjB,MAAM,QAAQ;GACd,MAAM,YAA4C,CAAC;GACnD,MAAM,eAAe,WAAmB,YAAqB;IAC3D,IAAI,OAAO,YAAY,YAAY;KACjC,MAAM,WAAW;KACjB,MAAM,iBAAiB,WAAW,QAAQ;KAC1C,UAAU,KAAK,CAAC,WAAW,QAAQ,CAAC;IACtC;GACF;GAEA,YAAY,SAAS,MAAM,OAAO;GAClC,YAAY,QAAQ,MAAM,MAAM;GAChC,YAAY,WAAW,MAAM,SAAS;GACtC,YAAY,SAAS,MAAM,OAAO;GAIlC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAAG;IAChD,IAAI,QAAQ,SAAU,IAAI,WAAW,IAAI,KAAK,OAAO,UAAU,YAAa;IAE5E,IAAI,QAAQ,YAAY;KACtB,IAAI,MAAM,aAAa,UAAU,GAAG;KACpC,IAAI,SAAS,QAAQ,UAAU,OAC7B,MAAM,gBAAgB,UAAU;UAEhC,MAAM,WAAW,OAAO,KAAK;KAE/B;IACF;IAEA,IAAI,IAAI,WAAW,OAAO,KAAK,IAAI,WAAW,OAAO,KAAK,QAAQ,QAAQ,QAAQ,QAAQ;KACxF,IAAI,MAAM,aAAa,GAAG,GAAG;KAC7B,IAAI,SAAS,QAAQ,UAAU,OAC7B,MAAM,gBAAgB,GAAG;UACpB,IAAI,UAAU,MACnB,MAAM,aAAa,KAAK,EAAE;UAE1B,MAAM,aAAa,KAAK,OAAO,KAAK,CAAC;IAEzC;GACF;GAEA,YAAY,WAAW;IACrB,KAAK,MAAM,CAAC,WAAW,aAAa,WAClC,MAAM,oBAAoB,WAAW,QAAQ;GAEjD,CAAC;EACH;EAEA,aAAa;GACX,KAAK,MAAM,KAAK,aAAa,EAAE;EACjC;CACF,CAAC;CAED,OAAO,GAAG,SAAS,EAAE;AACvB"}
|
package/dist/Form.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Form primitive for solidaria-components.
|
|
3
|
-
*
|
|
4
|
-
* Provides form-level validation behavior and server validation context.
|
|
5
|
-
* Port direction: react-aria-components/src/Form.tsx
|
|
6
|
-
*/
|
|
7
|
-
import { type JSX } from "solid-js";
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
8
2
|
import { type ValidationErrors, type ValidationBehavior } from "@proyecto-viviana/solid-stately";
|
|
9
3
|
import { type ClassNameOrFunction, type StyleOrFunction, type RenderChildren, type SlotProps } from "./utils";
|
|
10
4
|
type RefLike<T> = ((el: T) => void) | {
|
|
@@ -21,7 +15,7 @@ export interface FormProps extends Omit<JSX.FormHTMLAttributes<HTMLFormElement>,
|
|
|
21
15
|
/** Character encodings accepted by the server. React-style alias for Solid's `accept-charset`. */
|
|
22
16
|
acceptCharset?: string;
|
|
23
17
|
/** Browser auto-capitalization hint. React-style alias for Solid's `autocapitalize`. */
|
|
24
|
-
autoCapitalize?: JSX.HTMLAttributes<
|
|
18
|
+
autoCapitalize?: JSX.HTMLAttributes<HTMLElement>["autocapitalize"];
|
|
25
19
|
/** Browser autocomplete behavior. React-style alias for Solid's `autocomplete`. */
|
|
26
20
|
autoComplete?: JSX.FormHTMLAttributes<HTMLFormElement>["autocomplete"];
|
|
27
21
|
/** Form encoding type. React-style alias for Solid's `enctype`. */
|
|
@@ -36,6 +30,13 @@ export interface FormProps extends Omit<JSX.FormHTMLAttributes<HTMLFormElement>,
|
|
|
36
30
|
ref?: RefLike<HTMLFormElement>;
|
|
37
31
|
}
|
|
38
32
|
export declare const FormContext: import("solid-js").Context<FormProps | null>;
|
|
33
|
+
/**
|
|
34
|
+
* RAC `props.validationBehavior ?? formValidationBehavior ?? "native"`.
|
|
35
|
+
* Resolve after splitProps. Do not Proxy field props — Solid's server
|
|
36
|
+
* splitProps rejects a getOwnPropertyDescriptor trap that disagrees with the
|
|
37
|
+
* target (viviana-ui TextField always owns a `validationBehavior` getter).
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveValidationBehavior(local: ValidationBehavior | undefined, formContext: FormProps | null | undefined): ValidationBehavior;
|
|
39
40
|
export declare function Form(props: FormProps): JSX.Element;
|
|
40
41
|
export {};
|
|
41
42
|
//# sourceMappingURL=Form.d.ts.map
|
package/dist/Form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../src/Form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../src/Form.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,SAAS,CAAC;AAEjB,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,CAAC;AAWzE,MAAM,WAAW,eAAe;IAC9B,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,MAAM,WAAW,SACf,SACE,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,eAAe,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC,EACrF,SAAS;IACX,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,gCAAgC;IAChC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,kGAAkG;IAClG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,cAAc,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACnE,mFAAmF;IACnF,YAAY,CAAC,EAAE,GAAG,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,CAAC;IACvE,mEAAmE;IACnE,OAAO,CAAC,EAAE,GAAG,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7D,qCAAqC;IACrC,QAAQ,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IAC3C,yCAAyC;IACzC,KAAK,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC7C,wCAAwC;IACxC,KAAK,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACzC,2CAA2C;IAC3C,GAAG,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,WAAW,8CAAwC,CAAC;AAEjE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,kBAAkB,GAAG,SAAS,EACrC,WAAW,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GACxC,kBAAkB,CAEpB;AA+BD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CA8DlD"}
|
package/dist/Form.js
CHANGED
|
@@ -1,22 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the 'License');
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Form.tsx
|
|
1
13
|
import { filterDOMProps, useRenderProps } from "./utils.js";
|
|
2
|
-
import { createComponent, getNextElement, insert,
|
|
3
|
-
import { createContext
|
|
14
|
+
import { claimElement, createComponent, getNextElement, insert, ref, runHydrationEvents, spread, template } from "@solidjs/web";
|
|
15
|
+
import { createContext } from "solid-js";
|
|
16
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
4
17
|
import { FormValidationContext } from "@proyecto-viviana/solid-stately";
|
|
5
18
|
//#region src/Form.tsx
|
|
6
19
|
/**
|
|
7
20
|
* Form primitive for solidaria-components.
|
|
8
21
|
*
|
|
9
22
|
* Provides form-level validation behavior and server validation context.
|
|
10
|
-
*
|
|
23
|
+
* Based on packages/react-aria-components/src/Form.tsx.
|
|
11
24
|
*/
|
|
12
|
-
var _tmpl$ =
|
|
13
|
-
function assignRef(ref, el) {
|
|
25
|
+
var _tmpl$ = /* @__PURE__ */ template(`<form>`);
|
|
26
|
+
function assignRef$1(ref, el) {
|
|
14
27
|
if (!ref) return;
|
|
15
28
|
if (typeof ref === "function") ref(el);
|
|
16
29
|
else ref.current = el;
|
|
17
30
|
}
|
|
18
31
|
const FormContext = createContext(null);
|
|
19
|
-
|
|
32
|
+
/**
|
|
33
|
+
* RAC `props.validationBehavior ?? formValidationBehavior ?? "native"`.
|
|
34
|
+
* Resolve after splitProps. Do not Proxy field props — Solid's server
|
|
35
|
+
* splitProps rejects a getOwnPropertyDescriptor trap that disagrees with the
|
|
36
|
+
* target (viviana-ui TextField always owns a `validationBehavior` getter).
|
|
37
|
+
*/
|
|
38
|
+
function resolveValidationBehavior(local, formContext) {
|
|
39
|
+
return local ?? formContext?.validationBehavior ?? "native";
|
|
40
|
+
}
|
|
41
|
+
const formDOMPropNames = /* @__PURE__ */ new Set([
|
|
20
42
|
"accept-charset",
|
|
21
43
|
"acceptCharset",
|
|
22
44
|
"action",
|
|
@@ -47,7 +69,7 @@ function Form(props) {
|
|
|
47
69
|
"ref",
|
|
48
70
|
"slot"
|
|
49
71
|
]);
|
|
50
|
-
const validationBehavior = local.validationBehavior ?? "native";
|
|
72
|
+
const validationBehavior = () => local.validationBehavior ?? "native";
|
|
51
73
|
const errors = local.validationErrors ?? {};
|
|
52
74
|
const renderProps = useRenderProps({
|
|
53
75
|
get children() {
|
|
@@ -56,44 +78,45 @@ function Form(props) {
|
|
|
56
78
|
class: local.class,
|
|
57
79
|
style: local.style,
|
|
58
80
|
defaultClassName: "solidaria-Form"
|
|
59
|
-
}, () => ({ validationBehavior }));
|
|
81
|
+
}, () => ({ validationBehavior: validationBehavior() }));
|
|
60
82
|
const filteredDomProps = filterFormDOMProps(domProps);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
83
|
+
const formContextValue = { get validationBehavior() {
|
|
84
|
+
return validationBehavior();
|
|
85
|
+
} };
|
|
86
|
+
var _el$ = getNextElement(_tmpl$);
|
|
87
|
+
ref(() => {
|
|
88
|
+
return (el) => assignRef$1(local.ref, el);
|
|
89
|
+
}, _el$);
|
|
90
|
+
claimElement(_el$);
|
|
91
|
+
spread(_el$, [filteredDomProps, {
|
|
92
|
+
get novalidate() {
|
|
93
|
+
return validationBehavior() !== "native";
|
|
94
|
+
},
|
|
95
|
+
get "class"() {
|
|
96
|
+
return renderProps.class();
|
|
97
|
+
},
|
|
98
|
+
get style() {
|
|
99
|
+
return renderProps.style();
|
|
100
|
+
},
|
|
101
|
+
get slot() {
|
|
102
|
+
return local.slot;
|
|
103
|
+
}
|
|
104
|
+
}], true);
|
|
105
|
+
insert(_el$, createComponent(FormContext, {
|
|
106
|
+
value: formContextValue,
|
|
107
|
+
get children() {
|
|
108
|
+
return createComponent(FormValidationContext, {
|
|
109
|
+
value: errors,
|
|
110
|
+
get children() {
|
|
111
|
+
return renderProps.renderChildren();
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
116
|
+
runHydrationEvents();
|
|
117
|
+
return _el$;
|
|
95
118
|
}
|
|
96
119
|
//#endregion
|
|
97
|
-
export { Form, FormContext };
|
|
120
|
+
export { Form, FormContext, resolveValidationBehavior };
|
|
98
121
|
|
|
99
122
|
//# sourceMappingURL=Form.js.map
|
package/dist/Form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","names":["
|
|
1
|
+
{"version":3,"file":"Form.js","names":["ref={(el) => assignRef(local.ref, el)}","<FormContext value={formContextValue}>\n <FormValidationContext value={errors}>{renderProps.renderChildren()}</FormValidationContext>\n </FormContext>","value={formContextValue}","<FormValidationContext value={errors}>{renderProps.renderChildren()}</FormValidationContext>","value={errors}","<form\n {...filteredDomProps}\n ref={(el) => assignRef(local.ref, el)}\n novalidate={validationBehavior() !== \"native\"}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n >\n <FormContext value={formContextValue}>\n <FormValidationContext value={errors}>{renderProps.renderChildren()}</FormValidationContext>\n </FormContext>\n </form>"],"sources":["../src/Form.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Form.tsx\n\n/**\n * Form primitive for solidaria-components.\n *\n * Provides form-level validation behavior and server validation context.\n * Based on packages/react-aria-components/src/Form.tsx.\n */\n\nimport { createContext } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n FormValidationContext,\n type ValidationErrors,\n type ValidationBehavior,\n} from \"@proyecto-viviana/solid-stately\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type RenderChildren,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface FormRenderProps {\n validationBehavior: ValidationBehavior;\n}\n\nexport interface FormProps\n extends\n Omit<JSX.FormHTMLAttributes<HTMLFormElement>, \"children\" | \"class\" | \"style\" | \"ref\">,\n SlotProps {\n /** Server-side validation errors keyed by field name. */\n validationErrors?: ValidationErrors;\n /** Validation behavior mode. */\n validationBehavior?: ValidationBehavior;\n /** Character encodings accepted by the server. React-style alias for Solid's `accept-charset`. */\n acceptCharset?: string;\n /** Browser auto-capitalization hint. React-style alias for Solid's `autocapitalize`. */\n autoCapitalize?: JSX.HTMLAttributes<HTMLElement>[\"autocapitalize\"];\n /** Browser autocomplete behavior. React-style alias for Solid's `autocomplete`. */\n autoComplete?: JSX.FormHTMLAttributes<HTMLFormElement>[\"autocomplete\"];\n /** Form encoding type. React-style alias for Solid's `enctype`. */\n encType?: JSX.FormHTMLAttributes<HTMLFormElement>[\"enctype\"];\n /** The children of the component. */\n children?: RenderChildren<FormRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<FormRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<FormRenderProps>;\n /** Ref for the underlying form element. */\n ref?: RefLike<HTMLFormElement>;\n}\n\nexport const FormContext = createContext<FormProps | null>(null);\n\n/**\n * RAC `props.validationBehavior ?? formValidationBehavior ?? \"native\"`.\n * Resolve after splitProps. Do not Proxy field props — Solid's server\n * splitProps rejects a getOwnPropertyDescriptor trap that disagrees with the\n * target (viviana-ui TextField always owns a `validationBehavior` getter).\n */\nexport function resolveValidationBehavior(\n local: ValidationBehavior | undefined,\n formContext: FormProps | null | undefined,\n): ValidationBehavior {\n return local ?? formContext?.validationBehavior ?? \"native\";\n}\n\nconst formDOMPropNames = new Set([\n \"accept-charset\",\n \"acceptCharset\",\n \"action\",\n \"autocapitalize\",\n \"autoCapitalize\",\n \"autocomplete\",\n \"autoComplete\",\n \"encoding\",\n \"enctype\",\n \"encType\",\n \"method\",\n \"name\",\n \"rel\",\n \"target\",\n]);\n\nfunction filterFormDOMProps(props: object): Record<string, unknown> {\n const filtered = filterDOMProps<Record<string, unknown>>(props, { global: true });\n\n for (const key in props) {\n if (Object.prototype.hasOwnProperty.call(props, key) && formDOMPropNames.has(key)) {\n filtered[key] = (props as Record<string, unknown>)[key];\n }\n }\n\n return filtered;\n}\n\nexport function Form(props: FormProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"validationErrors\",\n \"validationBehavior\",\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n \"slot\",\n ]);\n\n const validationBehavior = () => local.validationBehavior ?? \"native\";\n const errors = local.validationErrors ?? {};\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Form\",\n },\n () => ({\n validationBehavior: validationBehavior(),\n }),\n );\n\n const filteredDomProps = filterFormDOMProps(domProps);\n\n // FormContext is only consumed for `validationBehavior` (TextField, Checkbox,\n // DateField, …). Never spread `props` into the context value: in Solid,\n // `props.children` is a getter that *creates* the child tree when read. Eager\n // `{...props}` therefore builds every child once for the discarded context\n // object and again for `renderChildren()`, double-advancing createUniqueId\n // and desyncing SSR hydration keys. RAC can spread props because React\n // elements are already-built descriptors; Solid cannot.\n //\n // Surface symptom (effect-latam /perfil, /foros): Form+sole Spectrum Button\n // → \"Hydration Mismatch\" / \"template is not a function\" and a blank route.\n // Form+TextField (multiple children) often still hydrates because array/\n // fragment child paths mask the slot drift — the double-create is still\n // wrong either way.\n const formContextValue: FormProps = {\n get validationBehavior() {\n return validationBehavior();\n },\n };\n\n return (\n <form\n {...filteredDomProps}\n ref={(el) => assignRef(local.ref, el)}\n novalidate={validationBehavior() !== \"native\"}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n >\n <FormContext value={formContextValue}>\n <FormValidationContext value={errors}>{renderProps.renderChildren()}</FormValidationContext>\n </FormContext>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,YAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAgCA,MAAa,cAAc,cAAgC,IAAI;;;;;;;AAQ/D,SAAgB,0BACd,OACA,aACoB;CACpB,OAAO,SAAS,aAAa,sBAAsB;AACrD;AAEA,MAAM,mCAAmB,IAAI,IAAI;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAS,mBAAmB,OAAwC;CAClE,MAAM,WAAW,eAAwC,OAAO,EAAE,QAAQ,KAAK,CAAC;CAEhF,KAAK,MAAM,OAAO,OAChB,IAAI,OAAO,UAAU,eAAe,KAAK,OAAO,GAAG,KAAK,iBAAiB,IAAI,GAAG,GAC9E,SAAS,OAAQ,MAAkC;CAIvD,OAAO;AACT;AAEA,SAAgB,KAAK,OAA+B;CAClD,MAAM,CAAC,OAAO,YAAY,WAAW,OAAO;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,2BAA2B,MAAM,sBAAsB;CAC7D,MAAM,SAAS,MAAM,oBAAoB,CAAC;CAC1C,MAAM,cAAc,eAClB;EACE,IAAI,WAAW;GACb,OAAO,MAAM;EACf;EACA,OAAO,MAAM;EACb,OAAO,MAAM;EACb,kBAAkB;CACpB,UACO,EACL,oBAAoB,mBAAmB,EACzC,EACF;CAEA,MAAM,mBAAmB,mBAAmB,QAAQ;CAepD,MAAM,mBAA8B,EAClC,IAAI,qBAAqB;EACvB,OAAO,mBAAmB;CAC5B,EACF;CAGE,IAAA,OAAA,eAAA,MAWM;CATJ,UAAA;EAAM,QAAA,OAAO,YAAU,MAAM,KAAK,EAAE;CAAC,GAArCA,IAAqC;;CADjC,OAAA,MAAA,CAAA,kBAAA;EAEJ,IAAA,aAAA;GAAY,OAAA,mBAAmB,MAAM;EAAQ;EAC7C,IAAA,UAAA;GAAO,OAAA,YAAY,MAAM;EAAC;EAC1B,IAAA,QAAA;GAAO,OAAA,YAAY,MAAM;EAAC;EAC1B,IAAA,OAAA;GAAM,OAAA,MAAM;EAAI;;CANlB,OAAA,MAQEC,gBAAAA,aAAAA;EAAaC,OAAO;EAApB,IAAA,WAAA;GACEC,OAAAA,gBAAAA,uBAAAA;IAAuBC,OAAO;IAA9B,IAAA,WAAA;KAAuC,OAAA,YAAY,eAAe;IAAyB;;EAChF;CACT,CAAA,CAAA;CAXN,mBAWM;CAZR,OACEC;AAaJ"}
|