@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/Keyboard.jsx
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Keyboard.tsx
|
|
13
|
+
import { createContext, useContext } from "solid-js";
|
|
14
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
2
15
|
//#region src/Keyboard.tsx
|
|
3
16
|
/**
|
|
4
17
|
* Keyboard primitive for solidaria-components.
|
|
5
18
|
*
|
|
6
19
|
* Displays keyboard key hints with semantic <kbd> markup.
|
|
7
|
-
*
|
|
20
|
+
* Based on packages/react-aria-components/src/Keyboard.tsx.
|
|
8
21
|
*/
|
|
9
22
|
const KeyboardContext = createContext(null);
|
|
10
23
|
function Keyboard(props) {
|
package/dist/Keyboard.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Keyboard.jsx","names":[],"sources":["../src/Keyboard.tsx"],"sourcesContent":["/**\n * Keyboard primitive for solidaria-components.\n *\n * Displays keyboard key hints with semantic <kbd> markup.\n *
|
|
1
|
+
{"version":3,"file":"Keyboard.jsx","names":[],"sources":["../src/Keyboard.tsx"],"sourcesContent":["/*\n * Copyright 2022 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/Keyboard.tsx\n\n/**\n * Keyboard primitive for solidaria-components.\n *\n * Displays keyboard key hints with semantic <kbd> markup.\n * Based on packages/react-aria-components/src/Keyboard.tsx.\n */\n\nimport { createContext, useContext } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface KeyboardProps extends JSX.HTMLAttributes<HTMLElement> {\n children?: JSX.Element;\n}\n\nexport const KeyboardContext = createContext<KeyboardProps | null>(null);\n\nexport function Keyboard(props: KeyboardProps): JSX.Element {\n const context = useContext(KeyboardContext);\n const merged = () => ({ ...context, ...props });\n const [local, domProps] = splitProps(merged(), [\"children\"]);\n\n return (\n <kbd dir=\"ltr\" {...domProps}>\n {local.children}\n </kbd>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,kBAAkB,cAAoC,IAAI;AAEvE,SAAgB,SAAS,OAAmC;CAC1D,MAAM,UAAU,WAAW,eAAe;CAC1C,MAAM,gBAAgB;EAAE,GAAG;EAAS,GAAG;CAAM;CAC7C,MAAM,CAAC,OAAO,YAAY,WAAW,OAAO,GAAG,CAAC,UAAU,CAAC;CAE3D,OACE,CAAC,IAAI,cAAc,UAAU;OAC1B,MAAM,SAAS;IAClB,EAAE;AAEN"}
|
package/dist/Label.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
2
|
+
import { type ContextValue, type RefLike, type SlotProps } from "./utils";
|
|
3
|
+
export interface LabelProps extends Omit<JSX.LabelHTMLAttributes<HTMLLabelElement>, "ref">, SlotProps {
|
|
4
|
+
/** The HTML element used to render the label. @default 'label' */
|
|
5
|
+
elementType?: string;
|
|
6
|
+
ref?: RefLike<HTMLElement>;
|
|
7
|
+
/**
|
|
8
|
+
* The id of the labelled element. Solid's `LabelHTMLAttributes` uses `for`;
|
|
9
|
+
* parents also pass `htmlFor` (the RAC/DOM name).
|
|
10
|
+
*/
|
|
11
|
+
htmlFor?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Props supplied to a Label by its parent component. */
|
|
14
|
+
export declare const LabelContext: import("solid-js").Context<ContextValue<LabelProps, HTMLElement>>;
|
|
15
|
+
/**
|
|
16
|
+
* A label that receives its element type and relationship props from a parent.
|
|
17
|
+
* This is a Solid adaptation of the pinned Label component.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Label(props: LabelProps): JSX.Element;
|
|
20
|
+
//# sourceMappingURL=Label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../src/Label.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,SAAS,CAAC;AAG3F,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS;IACzE,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,yDAAyD;AACzD,eAAO,MAAM,YAAY,mEAA2D,CAAC;AAErF;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAqCpD"}
|
package/dist/Label.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Label.tsx
|
|
13
|
+
import { useContextProps } from "./utils.js";
|
|
14
|
+
import { ElementTag } from "./ElementTag.js";
|
|
15
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
16
|
+
import { createContext, createMemo, useContext } from "solid-js";
|
|
17
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
18
|
+
//#region src/Label.tsx
|
|
19
|
+
/** Props supplied to a Label by its parent component. */
|
|
20
|
+
const LabelContext = createContext({});
|
|
21
|
+
/**
|
|
22
|
+
* A label that receives its element type and relationship props from a parent.
|
|
23
|
+
* This is a Solid adaptation of the pinned Label component.
|
|
24
|
+
*/
|
|
25
|
+
function Label(props) {
|
|
26
|
+
const ctx = useContext(LabelContext);
|
|
27
|
+
const [merged, ref] = useContextProps(props, props.ref, LabelContext);
|
|
28
|
+
const [local, domProps] = splitProps(merged, [
|
|
29
|
+
"elementType",
|
|
30
|
+
"class",
|
|
31
|
+
"children",
|
|
32
|
+
"slot",
|
|
33
|
+
"ref",
|
|
34
|
+
"for",
|
|
35
|
+
"htmlFor"
|
|
36
|
+
]);
|
|
37
|
+
const htmlFor = createMemo(() => {
|
|
38
|
+
const fromContext = ctx && typeof ctx === "object" && "slots" in ctx && ctx.slots ? ctx.slots[typeof props.slot === "string" ? props.slot : "default"] : ctx;
|
|
39
|
+
return props.htmlFor ?? props.for ?? fromContext?.htmlFor ?? fromContext?.for;
|
|
40
|
+
});
|
|
41
|
+
return createComponent(ElementTag, mergeProps(domProps, {
|
|
42
|
+
ref,
|
|
43
|
+
get "for"() {
|
|
44
|
+
return htmlFor();
|
|
45
|
+
},
|
|
46
|
+
get "class"() {
|
|
47
|
+
return local.class ?? "solidaria-Label";
|
|
48
|
+
},
|
|
49
|
+
get tag() {
|
|
50
|
+
return local.elementType ?? "label";
|
|
51
|
+
},
|
|
52
|
+
get children() {
|
|
53
|
+
return local.children;
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { LabelContext as n, Label as t };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=Label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.js","names":["<ElementTag\n {...domProps}\n ref={ref}\n for={htmlFor()}\n class={local.class ?? \"solidaria-Label\"}\n tag={local.elementType ?? \"label\"}\n >\n {local.children}\n </ElementTag>"],"sources":["../src/Label.tsx"],"sourcesContent":["/*\n * Copyright 2022 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/Label.tsx\n\nimport { createContext, createMemo, useContext } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { ElementTag } from \"./ElementTag\";\nimport { type ContextValue, type RefLike, type SlotProps, useContextProps } from \"./utils\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface LabelProps\n extends Omit<JSX.LabelHTMLAttributes<HTMLLabelElement>, \"ref\">, SlotProps {\n /** The HTML element used to render the label. @default 'label' */\n elementType?: string;\n ref?: RefLike<HTMLElement>;\n /**\n * The id of the labelled element. Solid's `LabelHTMLAttributes` uses `for`;\n * parents also pass `htmlFor` (the RAC/DOM name).\n */\n htmlFor?: string;\n}\n\n/** Props supplied to a Label by its parent component. */\nexport const LabelContext = createContext<ContextValue<LabelProps, HTMLElement>>({});\n\n/**\n * A label that receives its element type and relationship props from a parent.\n * This is a Solid adaptation of the pinned Label component.\n */\nexport function Label(props: LabelProps): JSX.Element {\n const ctx = useContext(LabelContext);\n const [merged, ref] = useContextProps(props, props.ref, LabelContext);\n const [local, domProps] = splitProps(merged, [\n \"elementType\",\n \"class\",\n \"children\",\n \"slot\",\n \"ref\",\n \"for\",\n \"htmlFor\",\n ]);\n const htmlFor = createMemo(() => {\n const slotted =\n ctx && typeof ctx === \"object\" && \"slots\" in ctx && ctx.slots\n ? ctx.slots[typeof props.slot === \"string\" ? props.slot : \"default\"]\n : ctx;\n const fromContext = slotted as LabelProps | undefined;\n return (\n props.htmlFor ??\n (props as { for?: string }).for ??\n fromContext?.htmlFor ??\n (fromContext as { for?: string } | undefined)?.for\n );\n });\n\n return (\n <ElementTag\n {...domProps}\n ref={ref}\n for={htmlFor()}\n class={local.class ?? \"solidaria-Label\"}\n tag={local.elementType ?? \"label\"}\n >\n {local.children}\n </ElementTag>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiCA,MAAa,eAAe,cAAqD,CAAC,CAAC;;;;;AAMnF,SAAgB,MAAM,OAAgC;CACpD,MAAM,MAAM,WAAW,YAAY;CACnC,MAAM,CAAC,QAAQ,OAAO,gBAAgB,OAAO,MAAM,KAAK,YAAY;CACpE,MAAM,CAAC,OAAO,YAAY,WAAW,QAAQ;EAC3C;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,MAAM,UAAU,iBAAiB;EAK/B,MAAM,cAHJ,OAAO,OAAO,QAAQ,YAAY,WAAW,OAAO,IAAI,QACpD,IAAI,MAAM,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,aACxD;EAEN,OACE,MAAM,WACL,MAA2B,OAC5B,aAAa,WACZ,aAA8C;CAEnD,CAAC;CAED,OACEA,gBAAAA,YAAAA,WACM,UADN;EAEO;EACL,IAAA,QAAA;GAAK,OAAA,QAAQ;EAAC;EACd,IAAA,UAAA;GAAO,OAAA,MAAM,SAAS;EAAiB;EACvC,IAAA,MAAA;GAAK,OAAA,MAAM,eAAe;EAAO;EALnC,IAAA,WAAA;GAOG,OAAA,MAAM;EACG;;AAEhB"}
|
package/dist/Label.jsx
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Label.tsx
|
|
13
|
+
import { useContextProps } from "./utils.jsx";
|
|
14
|
+
import { ElementTag } from "./ElementTag.jsx";
|
|
15
|
+
import { createContext, createMemo, useContext } from "solid-js";
|
|
16
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
17
|
+
//#region src/Label.tsx
|
|
18
|
+
/** Props supplied to a Label by its parent component. */
|
|
19
|
+
const LabelContext = createContext({});
|
|
20
|
+
/**
|
|
21
|
+
* A label that receives its element type and relationship props from a parent.
|
|
22
|
+
* This is a Solid adaptation of the pinned Label component.
|
|
23
|
+
*/
|
|
24
|
+
function Label(props) {
|
|
25
|
+
const ctx = useContext(LabelContext);
|
|
26
|
+
const [merged, ref] = useContextProps(props, props.ref, LabelContext);
|
|
27
|
+
const [local, domProps] = splitProps(merged, [
|
|
28
|
+
"elementType",
|
|
29
|
+
"class",
|
|
30
|
+
"children",
|
|
31
|
+
"slot",
|
|
32
|
+
"ref",
|
|
33
|
+
"for",
|
|
34
|
+
"htmlFor"
|
|
35
|
+
]);
|
|
36
|
+
const htmlFor = createMemo(() => {
|
|
37
|
+
const fromContext = ctx && typeof ctx === "object" && "slots" in ctx && ctx.slots ? ctx.slots[typeof props.slot === "string" ? props.slot : "default"] : ctx;
|
|
38
|
+
return props.htmlFor ?? props.for ?? fromContext?.htmlFor ?? fromContext?.for;
|
|
39
|
+
});
|
|
40
|
+
return <ElementTag {...domProps} ref={ref} for={htmlFor()} class={local.class ?? "solidaria-Label"} tag={local.elementType ?? "label"}>
|
|
41
|
+
{local.children}
|
|
42
|
+
</ElementTag>;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { LabelContext as n, Label as t };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=Label.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.jsx","names":[],"sources":["../src/Label.tsx"],"sourcesContent":["/*\n * Copyright 2022 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/Label.tsx\n\nimport { createContext, createMemo, useContext } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { ElementTag } from \"./ElementTag\";\nimport { type ContextValue, type RefLike, type SlotProps, useContextProps } from \"./utils\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface LabelProps\n extends Omit<JSX.LabelHTMLAttributes<HTMLLabelElement>, \"ref\">, SlotProps {\n /** The HTML element used to render the label. @default 'label' */\n elementType?: string;\n ref?: RefLike<HTMLElement>;\n /**\n * The id of the labelled element. Solid's `LabelHTMLAttributes` uses `for`;\n * parents also pass `htmlFor` (the RAC/DOM name).\n */\n htmlFor?: string;\n}\n\n/** Props supplied to a Label by its parent component. */\nexport const LabelContext = createContext<ContextValue<LabelProps, HTMLElement>>({});\n\n/**\n * A label that receives its element type and relationship props from a parent.\n * This is a Solid adaptation of the pinned Label component.\n */\nexport function Label(props: LabelProps): JSX.Element {\n const ctx = useContext(LabelContext);\n const [merged, ref] = useContextProps(props, props.ref, LabelContext);\n const [local, domProps] = splitProps(merged, [\n \"elementType\",\n \"class\",\n \"children\",\n \"slot\",\n \"ref\",\n \"for\",\n \"htmlFor\",\n ]);\n const htmlFor = createMemo(() => {\n const slotted =\n ctx && typeof ctx === \"object\" && \"slots\" in ctx && ctx.slots\n ? ctx.slots[typeof props.slot === \"string\" ? props.slot : \"default\"]\n : ctx;\n const fromContext = slotted as LabelProps | undefined;\n return (\n props.htmlFor ??\n (props as { for?: string }).for ??\n fromContext?.htmlFor ??\n (fromContext as { for?: string } | undefined)?.for\n );\n });\n\n return (\n <ElementTag\n {...domProps}\n ref={ref}\n for={htmlFor()}\n class={local.class ?? \"solidaria-Label\"}\n tag={local.elementType ?? \"label\"}\n >\n {local.children}\n </ElementTag>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,MAAa,eAAe,cAAqD,CAAC,CAAC;;;;;AAMnF,SAAgB,MAAM,OAAgC;CACpD,MAAM,MAAM,WAAW,YAAY;CACnC,MAAM,CAAC,QAAQ,OAAO,gBAAgB,OAAO,MAAM,KAAK,YAAY;CACpE,MAAM,CAAC,OAAO,YAAY,WAAW,QAAQ;EAC3C;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,MAAM,UAAU,iBAAiB;EAK/B,MAAM,cAHJ,OAAO,OAAO,QAAQ,YAAY,WAAW,OAAO,IAAI,QACpD,IAAI,MAAM,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,aACxD;EAEN,OACE,MAAM,WACL,MAA2B,OAC5B,aAAa,WACZ,aAA8C;CAEnD,CAAC;CAED,OACE,CAAC,eACK,UACJ,KAAK,KACL,KAAK,QAAQ,GACb,OAAO,MAAM,SAAS,mBACtB,KAAK,MAAM,eAAe,SAC3B;OACE,MAAM,SAAS;IAClB,EAAE;AAEN"}
|
package/dist/Landmark.d.ts
CHANGED
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Pre-wired headless landmark component that combines aria hooks.
|
|
5
5
|
* Enables F6 keyboard navigation between major page sections.
|
|
6
|
+
*
|
|
7
|
+
* This is a local Solid component. The pinned React Aria Components source
|
|
8
|
+
* has no Landmark counterpart; Solidaria owns the underlying ARIA behavior.
|
|
6
9
|
*/
|
|
7
|
-
import {
|
|
10
|
+
import type { JSX } from "@solidjs/web";
|
|
8
11
|
import { type AriaLandmarkProps, type AriaLandmarkRole, type LandmarkController } from "@proyecto-viviana/solidaria";
|
|
9
12
|
import { type SlotProps } from "./utils";
|
|
10
13
|
export interface LandmarkRenderProps {
|
package/dist/Landmark.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Landmark.d.ts","sourceRoot":"","sources":["../src/Landmark.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Landmark.d.ts","sourceRoot":"","sources":["../src/Landmark.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,SAAS,CAAC;AAGzD,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB,EAAE,SAAS;IACjE;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,iBAAiB,CAAC;IAC1C,6FAA6F;IAC7F,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,WAAW,EAAE,mBAAmB,KAAK,MAAM,CAAC,CAAC;IAChE,4FAA4F;IAC5F,KAAK,CAAC,EAAE,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,WAAW,EAAE,mBAAmB,KAAK,GAAG,CAAC,aAAa,CAAC,CAAC;IACtF,wBAAwB;IACxB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACxB;AAED,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;AAErD,eAAO,MAAM,eAAe,kDAA4C,CAAC;AAiBzE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CA6E1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAE1D"}
|
package/dist/Landmark.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { filterDOMProps } from "./utils.js";
|
|
2
2
|
import { ElementTag } from "./ElementTag.js";
|
|
3
|
-
import { createComponent, mergeProps } from "
|
|
4
|
-
import { createContext, createMemo, createSignal
|
|
3
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
4
|
+
import { createContext, createMemo, createSignal } from "solid-js";
|
|
5
5
|
import { createLandmark, getLandmarkController } from "@proyecto-viviana/solidaria";
|
|
6
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
6
7
|
//#region src/Landmark.tsx
|
|
7
8
|
/**
|
|
8
9
|
* Landmark component for solidaria-components
|
|
9
10
|
*
|
|
10
11
|
* Pre-wired headless landmark component that combines aria hooks.
|
|
11
12
|
* Enables F6 keyboard navigation between major page sections.
|
|
13
|
+
*
|
|
14
|
+
* This is a local Solid component. The pinned React Aria Components source
|
|
15
|
+
* has no Landmark counterpart; Solidaria owns the underlying ARIA behavior.
|
|
12
16
|
*/
|
|
13
17
|
const LandmarkContext = createContext(null);
|
|
14
18
|
/**
|
|
@@ -100,8 +104,10 @@ function Landmark(props) {
|
|
|
100
104
|
return elementType();
|
|
101
105
|
},
|
|
102
106
|
ref: setRef
|
|
103
|
-
}, domProps, () =>
|
|
104
|
-
|
|
107
|
+
}, domProps, () => {
|
|
108
|
+
return landmarkAria.landmarkProps;
|
|
109
|
+
}, {
|
|
110
|
+
get "class"() {
|
|
105
111
|
return resolvedClass();
|
|
106
112
|
},
|
|
107
113
|
get style() {
|
package/dist/Landmark.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Landmark.js","names":["
|
|
1
|
+
{"version":3,"file":"Landmark.js","names":["<ElementTag\n tag={elementType()}\n ref={setRef}\n {...domProps()}\n {...landmarkAria.landmarkProps}\n class={resolvedClass()}\n style={resolvedStyle()}\n slot={local.slot}\n >\n {props.children}\n </ElementTag>","ref={setRef}"],"sources":["../src/Landmark.tsx"],"sourcesContent":["/**\n * Landmark component for solidaria-components\n *\n * Pre-wired headless landmark component that combines aria hooks.\n * Enables F6 keyboard navigation between major page sections.\n *\n * This is a local Solid component. The pinned React Aria Components source\n * has no Landmark counterpart; Solidaria owns the underlying ARIA behavior.\n */\n\nimport { createContext, createMemo, createSignal } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { ElementTag } from \"./ElementTag\";\nimport {\n createLandmark,\n getLandmarkController,\n type AriaLandmarkProps,\n type AriaLandmarkRole,\n type LandmarkController,\n} from \"@proyecto-viviana/solidaria\";\nimport { type SlotProps, filterDOMProps } from \"./utils\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface LandmarkRenderProps {\n /** The ARIA landmark role. */\n role: AriaLandmarkRole;\n}\n\nexport interface LandmarkProps extends AriaLandmarkProps, SlotProps {\n /**\n * The HTML element type to render.\n * @default 'div' (or semantic element based on role)\n */\n elementType?: keyof JSX.IntrinsicElements;\n /** The CSS className for the element. A function may be provided to receive render props. */\n class?: string | ((renderProps: LandmarkRenderProps) => string);\n /** The inline style for the element. A function may be provided to receive render props. */\n style?: JSX.CSSProperties | ((renderProps: LandmarkRenderProps) => JSX.CSSProperties);\n /** Children content. */\n children?: JSX.Element;\n}\n\nexport type { AriaLandmarkRole, LandmarkController };\n\nexport const LandmarkContext = createContext<LandmarkProps | null>(null);\n\n/**\n * Maps ARIA landmark roles to their semantic HTML elements.\n * Using semantic elements is preferred when possible.\n */\nconst roleToSemanticElement: Partial<Record<AriaLandmarkRole, keyof JSX.IntrinsicElements>> = {\n main: \"main\",\n navigation: \"nav\",\n search: \"search\", // HTML5.3 <search> element\n banner: \"header\",\n contentinfo: \"footer\",\n complementary: \"aside\",\n form: \"form\",\n region: \"section\",\n};\n\n/**\n * A landmark is a region of the page that helps screen reader users navigate.\n * Press F6 to cycle through landmarks, or Shift+F6 to go backwards.\n *\n * @example\n * ```tsx\n * // Main content area\n * <Landmark role=\"main\" aria-label=\"Main content\">\n * <h1>Welcome</h1>\n * <p>Page content here...</p>\n * </Landmark>\n *\n * // Navigation\n * <Landmark role=\"navigation\" aria-label=\"Primary navigation\">\n * <nav>...</nav>\n * </Landmark>\n *\n * // Search\n * <Landmark role=\"search\" aria-label=\"Site search\">\n * <form>...</form>\n * </Landmark>\n *\n * // Custom element type\n * <Landmark role=\"region\" aria-label=\"Featured content\" elementType=\"div\">\n * ...\n * </Landmark>\n * ```\n */\nexport function Landmark(props: LandmarkProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n \"elementType\",\n ]);\n\n // Element ref\n const [ref, setRef] = createSignal<HTMLElement>();\n\n // Determine the element type - use semantic element for the role if not specified\n const elementType = createMemo(() => {\n if (local.elementType) {\n return local.elementType;\n }\n return roleToSemanticElement[ariaProps.role] ?? \"div\";\n });\n\n // Create landmark aria props\n const landmarkAria = createLandmark(\n {\n get role() {\n return ariaProps.role;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get id() {\n return ariaProps.id;\n },\n get focus() {\n return ariaProps.focus;\n },\n },\n ref,\n );\n\n const renderValues = createMemo<LandmarkRenderProps>(() => ({\n role: ariaProps.role,\n }));\n\n const resolvedClass = createMemo(() => {\n const cls = local.class;\n if (typeof cls === \"function\") {\n return cls(renderValues());\n }\n return cls ?? `solidaria-Landmark solidaria-Landmark--${ariaProps.role}`;\n });\n\n const resolvedStyle = createMemo(() => {\n const style = local.style;\n if (typeof style === \"function\") {\n return style(renderValues());\n }\n return style;\n });\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n return (\n <ElementTag\n tag={elementType()}\n ref={setRef}\n {...domProps()}\n {...landmarkAria.landmarkProps}\n class={resolvedClass()}\n style={resolvedStyle()}\n slot={local.slot}\n >\n {props.children}\n </ElementTag>\n );\n}\n\n/**\n * Returns a controller for programmatic landmark navigation.\n *\n * @example\n * ```tsx\n * const controller = useLandmarkController();\n *\n * <button onClick={() => controller.focusMain()}>Skip to main content</button>\n * <button onClick={() => controller.focusNext()}>Next landmark</button>\n * ```\n */\nexport function useLandmarkController(): LandmarkController {\n return getLandmarkController();\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA4CA,MAAa,kBAAkB,cAAoC,IAAI;;;;;AAMvE,MAAM,wBAAwF;CAC5F,MAAM;CACN,YAAY;CACZ,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,eAAe;CACf,MAAM;CACN,QAAQ;AACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,SAAS,OAAmC;CAC1D,MAAM,CAAC,OAAO,aAAa,WAAW,OAAO;EAC3C;EACA;EACA;EACA;EACA;CACF,CAAC;CAGD,MAAM,CAAC,KAAK,UAAU,aAA0B;CAGhD,MAAM,cAAc,iBAAiB;EACnC,IAAI,MAAM,aACR,OAAO,MAAM;EAEf,OAAO,sBAAsB,UAAU,SAAS;CAClD,CAAC;CAGD,MAAM,eAAe,eACnB;EACE,IAAI,OAAO;GACT,OAAO,UAAU;EACnB;EACA,IAAI,eAAe;GACjB,OAAO,UAAU;EACnB;EACA,IAAI,oBAAoB;GACtB,OAAO,UAAU;EACnB;EACA,IAAI,KAAK;GACP,OAAO,UAAU;EACnB;EACA,IAAI,QAAQ;GACV,OAAO,UAAU;EACnB;CACF,GACA,GACF;CAEA,MAAM,eAAe,kBAAuC,EAC1D,MAAM,UAAU,KAClB,EAAE;CAEF,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,MAAM,MAAM;EAClB,IAAI,OAAO,QAAQ,YACjB,OAAO,IAAI,aAAa,CAAC;EAE3B,OAAO,OAAO,0CAA0C,UAAU;CACpE,CAAC;CAED,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,QAAQ,MAAM;EACpB,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM,aAAa,CAAC;EAE7B,OAAO;CACT,CAAC;CAED,MAAM,WAAW,iBAAiB,eAAe,WAAW,EAAE,QAAQ,KAAK,CAAC,CAAC;CAE7E,OACEA,gBAAAA,YAAAA,WAAAA;EACE,IAAA,MAAA;GAAK,OAAA,YAAY;EAAC;EAClBC,KAAK;CAQK,GAPN,gBACJ;EAAI,OAAA,aAAa;CAAa,GAJhC;EAKE,IAAA,UAAA;GAAO,OAAA,cAAc;EAAC;EACtB,IAAA,QAAA;GAAO,OAAA,cAAc;EAAC;EACtB,IAAA,OAAA;GAAM,OAAA,MAAM;EAAI;EAPlB,IAAA,WAAA;GASG,OAAA,MAAM;EACG;;AAEhB;;;;;;;;;;;;AAaA,SAAgB,wBAA4C;CAC1D,OAAO,sBAAsB;AAC/B"}
|
package/dist/Landmark.jsx
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { filterDOMProps } from "./utils.jsx";
|
|
2
2
|
import { ElementTag } from "./ElementTag.jsx";
|
|
3
|
-
import { createContext, createMemo, createSignal
|
|
3
|
+
import { createContext, createMemo, createSignal } from "solid-js";
|
|
4
4
|
import { createLandmark, getLandmarkController } from "@proyecto-viviana/solidaria";
|
|
5
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
5
6
|
//#region src/Landmark.tsx
|
|
6
7
|
/**
|
|
7
8
|
* Landmark component for solidaria-components
|
|
8
9
|
*
|
|
9
10
|
* Pre-wired headless landmark component that combines aria hooks.
|
|
10
11
|
* Enables F6 keyboard navigation between major page sections.
|
|
12
|
+
*
|
|
13
|
+
* This is a local Solid component. The pinned React Aria Components source
|
|
14
|
+
* has no Landmark counterpart; Solidaria owns the underlying ARIA behavior.
|
|
11
15
|
*/
|
|
12
16
|
const LandmarkContext = createContext(null);
|
|
13
17
|
/**
|
package/dist/Landmark.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Landmark.jsx","names":[],"sources":["../src/Landmark.tsx"],"sourcesContent":["/**\n * Landmark component for solidaria-components\n *\n * Pre-wired headless landmark component that combines aria hooks.\n * Enables F6 keyboard navigation between major page sections.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"Landmark.jsx","names":[],"sources":["../src/Landmark.tsx"],"sourcesContent":["/**\n * Landmark component for solidaria-components\n *\n * Pre-wired headless landmark component that combines aria hooks.\n * Enables F6 keyboard navigation between major page sections.\n *\n * This is a local Solid component. The pinned React Aria Components source\n * has no Landmark counterpart; Solidaria owns the underlying ARIA behavior.\n */\n\nimport { createContext, createMemo, createSignal } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { ElementTag } from \"./ElementTag\";\nimport {\n createLandmark,\n getLandmarkController,\n type AriaLandmarkProps,\n type AriaLandmarkRole,\n type LandmarkController,\n} from \"@proyecto-viviana/solidaria\";\nimport { type SlotProps, filterDOMProps } from \"./utils\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface LandmarkRenderProps {\n /** The ARIA landmark role. */\n role: AriaLandmarkRole;\n}\n\nexport interface LandmarkProps extends AriaLandmarkProps, SlotProps {\n /**\n * The HTML element type to render.\n * @default 'div' (or semantic element based on role)\n */\n elementType?: keyof JSX.IntrinsicElements;\n /** The CSS className for the element. A function may be provided to receive render props. */\n class?: string | ((renderProps: LandmarkRenderProps) => string);\n /** The inline style for the element. A function may be provided to receive render props. */\n style?: JSX.CSSProperties | ((renderProps: LandmarkRenderProps) => JSX.CSSProperties);\n /** Children content. */\n children?: JSX.Element;\n}\n\nexport type { AriaLandmarkRole, LandmarkController };\n\nexport const LandmarkContext = createContext<LandmarkProps | null>(null);\n\n/**\n * Maps ARIA landmark roles to their semantic HTML elements.\n * Using semantic elements is preferred when possible.\n */\nconst roleToSemanticElement: Partial<Record<AriaLandmarkRole, keyof JSX.IntrinsicElements>> = {\n main: \"main\",\n navigation: \"nav\",\n search: \"search\", // HTML5.3 <search> element\n banner: \"header\",\n contentinfo: \"footer\",\n complementary: \"aside\",\n form: \"form\",\n region: \"section\",\n};\n\n/**\n * A landmark is a region of the page that helps screen reader users navigate.\n * Press F6 to cycle through landmarks, or Shift+F6 to go backwards.\n *\n * @example\n * ```tsx\n * // Main content area\n * <Landmark role=\"main\" aria-label=\"Main content\">\n * <h1>Welcome</h1>\n * <p>Page content here...</p>\n * </Landmark>\n *\n * // Navigation\n * <Landmark role=\"navigation\" aria-label=\"Primary navigation\">\n * <nav>...</nav>\n * </Landmark>\n *\n * // Search\n * <Landmark role=\"search\" aria-label=\"Site search\">\n * <form>...</form>\n * </Landmark>\n *\n * // Custom element type\n * <Landmark role=\"region\" aria-label=\"Featured content\" elementType=\"div\">\n * ...\n * </Landmark>\n * ```\n */\nexport function Landmark(props: LandmarkProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n \"elementType\",\n ]);\n\n // Element ref\n const [ref, setRef] = createSignal<HTMLElement>();\n\n // Determine the element type - use semantic element for the role if not specified\n const elementType = createMemo(() => {\n if (local.elementType) {\n return local.elementType;\n }\n return roleToSemanticElement[ariaProps.role] ?? \"div\";\n });\n\n // Create landmark aria props\n const landmarkAria = createLandmark(\n {\n get role() {\n return ariaProps.role;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get id() {\n return ariaProps.id;\n },\n get focus() {\n return ariaProps.focus;\n },\n },\n ref,\n );\n\n const renderValues = createMemo<LandmarkRenderProps>(() => ({\n role: ariaProps.role,\n }));\n\n const resolvedClass = createMemo(() => {\n const cls = local.class;\n if (typeof cls === \"function\") {\n return cls(renderValues());\n }\n return cls ?? `solidaria-Landmark solidaria-Landmark--${ariaProps.role}`;\n });\n\n const resolvedStyle = createMemo(() => {\n const style = local.style;\n if (typeof style === \"function\") {\n return style(renderValues());\n }\n return style;\n });\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n return (\n <ElementTag\n tag={elementType()}\n ref={setRef}\n {...domProps()}\n {...landmarkAria.landmarkProps}\n class={resolvedClass()}\n style={resolvedStyle()}\n slot={local.slot}\n >\n {props.children}\n </ElementTag>\n );\n}\n\n/**\n * Returns a controller for programmatic landmark navigation.\n *\n * @example\n * ```tsx\n * const controller = useLandmarkController();\n *\n * <button onClick={() => controller.focusMain()}>Skip to main content</button>\n * <button onClick={() => controller.focusNext()}>Next landmark</button>\n * ```\n */\nexport function useLandmarkController(): LandmarkController {\n return getLandmarkController();\n}\n"],"mappings":";;;;;;;;;;;;;;;AA4CA,MAAa,kBAAkB,cAAoC,IAAI;;;;;AAMvE,MAAM,wBAAwF;CAC5F,MAAM;CACN,YAAY;CACZ,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,eAAe;CACf,MAAM;CACN,QAAQ;AACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,SAAS,OAAmC;CAC1D,MAAM,CAAC,OAAO,aAAa,WAAW,OAAO;EAC3C;EACA;EACA;EACA;EACA;CACF,CAAC;CAGD,MAAM,CAAC,KAAK,UAAU,aAA0B;CAGhD,MAAM,cAAc,iBAAiB;EACnC,IAAI,MAAM,aACR,OAAO,MAAM;EAEf,OAAO,sBAAsB,UAAU,SAAS;CAClD,CAAC;CAGD,MAAM,eAAe,eACnB;EACE,IAAI,OAAO;GACT,OAAO,UAAU;EACnB;EACA,IAAI,eAAe;GACjB,OAAO,UAAU;EACnB;EACA,IAAI,oBAAoB;GACtB,OAAO,UAAU;EACnB;EACA,IAAI,KAAK;GACP,OAAO,UAAU;EACnB;EACA,IAAI,QAAQ;GACV,OAAO,UAAU;EACnB;CACF,GACA,GACF;CAEA,MAAM,eAAe,kBAAuC,EAC1D,MAAM,UAAU,KAClB,EAAE;CAEF,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,MAAM,MAAM;EAClB,IAAI,OAAO,QAAQ,YACjB,OAAO,IAAI,aAAa,CAAC;EAE3B,OAAO,OAAO,0CAA0C,UAAU;CACpE,CAAC;CAED,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,QAAQ,MAAM;EACpB,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM,aAAa,CAAC;EAE7B,OAAO;CACT,CAAC;CAED,MAAM,WAAW,iBAAiB,eAAe,WAAW,EAAE,QAAQ,KAAK,CAAC,CAAC;CAE7E,OACE,CAAC,WACC,KAAK,YAAY,GACjB,KAAK,YACD,SAAS,OACT,aAAa,eACjB,OAAO,cAAc,GACrB,OAAO,cAAc,GACrB,MAAM,MAAM,MACb;OACE,MAAM,SAAS;IAClB,EAAE;AAEN;;;;;;;;;;;;AAaA,SAAgB,wBAA4C;CAC1D,OAAO,sBAAsB;AAC/B"}
|
package/dist/Link.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Pre-wired headless link component that combines aria hooks.
|
|
5
|
-
* Port of react-aria-components/src/Link.tsx
|
|
6
|
-
*/
|
|
7
|
-
import { type JSX, type ParentProps } from "solid-js";
|
|
1
|
+
import type { ParentProps } from "solid-js";
|
|
2
|
+
import type { JSX } from "@solidjs/web";
|
|
8
3
|
import { type AriaLinkProps, type HoverEvents } from "@proyecto-viviana/solidaria";
|
|
9
4
|
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
10
5
|
type RefLike<T> = ((el: T) => void) | {
|
package/dist/Link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../src/Link.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../src/Link.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAGf,MAAM,SAAS,CAAC;AAIjB,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,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,wDAAwD;IACxD,SAAS,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,cAAc,EAAE,OAAO,CAAC;IACxB,oCAAoC;IACpC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,EAAE,WAAW,EAAE,SAAS;IAC3F,yFAAyF;IACzF,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,WAAW,CAAC,CAAC;CAC5B;AAED,eAAO,MAAM,WAAW,8CAAwC,CAAC;AAEjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,OAAO,CAkN/D"}
|
package/dist/Link.js
CHANGED
|
@@ -1,9 +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
|
+
// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Link.tsx
|
|
1
13
|
import { filterDOMProps, useRenderProps } from "./utils.js";
|
|
2
14
|
import { ElementTag } from "./ElementTag.js";
|
|
3
15
|
import { handleLinkClick, useRouter } from "./RouterProvider.js";
|
|
4
|
-
import { createComponent, mergeProps } from "
|
|
5
|
-
import { createContext, createMemo
|
|
6
|
-
import { createFocusRing, createHover, createLink } from "@proyecto-viviana/solidaria";
|
|
16
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
17
|
+
import { createContext, createMemo } from "solid-js";
|
|
18
|
+
import { createFocusRing, createHover, createLink, mergeProps as mergeProps$1 } from "@proyecto-viviana/solidaria";
|
|
19
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
7
20
|
//#region src/Link.tsx
|
|
8
21
|
/**
|
|
9
22
|
* Link component for solidaria-components
|
|
@@ -11,7 +24,7 @@ import { createFocusRing, createHover, createLink } from "@proyecto-viviana/soli
|
|
|
11
24
|
* Pre-wired headless link component that combines aria hooks.
|
|
12
25
|
* Port of react-aria-components/src/Link.tsx
|
|
13
26
|
*/
|
|
14
|
-
function assignRef(ref, el) {
|
|
27
|
+
function assignRef$1(ref, el) {
|
|
15
28
|
if (!ref) return;
|
|
16
29
|
if (typeof ref === "function") ref(el);
|
|
17
30
|
else ref.current = el;
|
|
@@ -161,10 +174,11 @@ function Link(props) {
|
|
|
161
174
|
defaultClassName: "solidaria-Link"
|
|
162
175
|
}, renderValues);
|
|
163
176
|
const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));
|
|
164
|
-
const
|
|
165
|
-
const { ref:
|
|
177
|
+
const omitClickChannel = (raw) => {
|
|
178
|
+
const { onClick: _onClick, ref: _ref, ...rest } = raw;
|
|
166
179
|
return rest;
|
|
167
180
|
};
|
|
181
|
+
const cleanLinkProps = () => omitClickChannel(linkAria.linkProps);
|
|
168
182
|
const cleanHoverProps = () => {
|
|
169
183
|
const { ref: _ref2, ...rest } = hoverProps;
|
|
170
184
|
return rest;
|
|
@@ -174,40 +188,46 @@ function Link(props) {
|
|
|
174
188
|
return rest;
|
|
175
189
|
};
|
|
176
190
|
const onLinkClick = (event) => {
|
|
177
|
-
const
|
|
178
|
-
|
|
191
|
+
const click = linkAria.linkProps["onClick"];
|
|
192
|
+
click?.(event);
|
|
179
193
|
handleLinkClick(event, router, ariaProps.href, ariaProps.routerOptions);
|
|
180
194
|
};
|
|
181
|
-
return createComponent(ElementTag, mergeProps(
|
|
182
|
-
return
|
|
183
|
-
|
|
195
|
+
return createComponent(ElementTag, mergeProps(() => {
|
|
196
|
+
return mergeProps$1(omitClickChannel(domProps()), cleanLinkProps(), cleanHoverProps(), cleanFocusProps(), {
|
|
197
|
+
onClick: onLinkClick,
|
|
198
|
+
get class() {
|
|
199
|
+
return renderProps.class();
|
|
200
|
+
},
|
|
201
|
+
get style() {
|
|
202
|
+
return renderProps.style();
|
|
203
|
+
},
|
|
204
|
+
get "data-hovered"() {
|
|
205
|
+
return isHovered() || void 0;
|
|
206
|
+
},
|
|
207
|
+
get "data-pressed"() {
|
|
208
|
+
return linkAria.isPressed() || void 0;
|
|
209
|
+
},
|
|
210
|
+
get "data-focused"() {
|
|
211
|
+
return isFocused() || void 0;
|
|
212
|
+
},
|
|
213
|
+
get "data-focus-visible"() {
|
|
214
|
+
return isFocusVisible() || void 0;
|
|
215
|
+
},
|
|
216
|
+
get "data-current"() {
|
|
217
|
+
return !!ariaProps["aria-current"] || void 0;
|
|
218
|
+
},
|
|
219
|
+
get "data-disabled"() {
|
|
220
|
+
return ariaProps.isDisabled || void 0;
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}, {
|
|
184
224
|
ref: (element) => {
|
|
185
|
-
assignRef(local.ref, element);
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
get ["class"]() {
|
|
189
|
-
return renderProps.class();
|
|
190
|
-
},
|
|
191
|
-
get style() {
|
|
192
|
-
return renderProps.style();
|
|
193
|
-
},
|
|
194
|
-
get ["data-hovered"]() {
|
|
195
|
-
return isHovered() || void 0;
|
|
225
|
+
assignRef$1(local.ref, element);
|
|
226
|
+
const linkRef = linkAria.linkProps.ref;
|
|
227
|
+
if (typeof linkRef === "function") linkRef(element);
|
|
196
228
|
},
|
|
197
|
-
get
|
|
198
|
-
return
|
|
199
|
-
},
|
|
200
|
-
get ["data-focused"]() {
|
|
201
|
-
return isFocused() || void 0;
|
|
202
|
-
},
|
|
203
|
-
get ["data-focus-visible"]() {
|
|
204
|
-
return isFocusVisible() || void 0;
|
|
205
|
-
},
|
|
206
|
-
get ["data-current"]() {
|
|
207
|
-
return !!ariaProps["aria-current"] || void 0;
|
|
208
|
-
},
|
|
209
|
-
get ["data-disabled"]() {
|
|
210
|
-
return ariaProps.isDisabled || void 0;
|
|
229
|
+
get tag() {
|
|
230
|
+
return elementType();
|
|
211
231
|
},
|
|
212
232
|
get children() {
|
|
213
233
|
return renderProps.renderChildren();
|
package/dist/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","names":["JSX","ParentProps","createContext","createMemo","splitProps","ElementTag","createLink","createFocusRing","createHover","AriaLinkProps","HoverEvents","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","handleLinkClick","useRouter","RefLike","el","T","current","assignRef","ref","LinkRenderProps","isCurrent","isHovered","isPressed","isFocused","isFocusVisible","isDisabled","LinkProps","Omit","children","class","style","HTMLElement","LinkContext","Link","props","Element","local","ariaProps","router","resolvedHref","href","useHref","undefined","elementType","linkAria","hrefLang","target","rel","download","ping","referrerPolicy","onPress","onPressStart","onPressEnd","onPressUp","onPressChange","onClick","onFocus","onBlur","onFocusChange","onKeyDown","onKeyUp","autoFocus","aria-current","aria-label","aria-labelledby","aria-describedby","focusProps","hoverProps","onHoverStart","onHoverEnd","onHoverChange","renderValues","renderProps","defaultClassName","domProps","global","cleanLinkProps","_ref1","rest","linkProps","Record","cleanHoverProps","_ref2","cleanFocusProps","_ref3","onLinkClick","event","MouseEvent","routerOptions","_$createComponent","_$mergeProps","tag","element","data-hovered","data-pressed","data-focused","data-focus-visible","data-current","data-disabled","renderChildren"],"sources":["../src/Link.tsx"],"sourcesContent":["/**\n * Link component for solidaria-components\n *\n * Pre-wired headless link component that combines aria hooks.\n * Port of react-aria-components/src/Link.tsx\n */\n\nimport { type JSX, type ParentProps, createContext, createMemo, splitProps } from \"solid-js\";\nimport { ElementTag } from \"./ElementTag\";\nimport {\n createLink,\n createFocusRing,\n createHover,\n type AriaLinkProps,\n type HoverEvents,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { handleLinkClick, useRouter } from \"./RouterProvider\";\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 LinkRenderProps {\n /** Whether the link is the current item within a list. */\n isCurrent: boolean;\n /** Whether the link is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the link is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the link is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the link is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the link is disabled. */\n isDisabled: boolean;\n}\n\nexport interface LinkProps extends Omit<AriaLinkProps, \"elementType\">, HoverEvents, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<LinkRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<LinkRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<LinkRenderProps>;\n /** Ref for the underlying link element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport const LinkContext = createContext<LinkProps | null>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n *\n * @example\n * ```tsx\n * <Link href=\"https://example.com\">Visit Example</Link>\n *\n * // With render props\n * <Link href=\"/about\">\n * {({ isHovered, isFocusVisible }) => (\n * <span class={isHovered ? 'underline' : ''}>\n * About Us\n * </span>\n * )}\n * </Link>\n * ```\n */\nexport function Link(props: ParentProps<LinkProps>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n \"slot\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n const router = useRouter();\n const resolvedHref = createMemo(() =>\n ariaProps.href ? router.useHref(ariaProps.href) : undefined,\n );\n\n const elementType = () => {\n if (ariaProps.href && !ariaProps.isDisabled) {\n return \"a\";\n }\n return \"span\";\n };\n\n const linkAria = createLink({\n get elementType() {\n return elementType();\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get href() {\n return resolvedHref();\n },\n get hrefLang() {\n return ariaProps.hrefLang;\n },\n get target() {\n return ariaProps.target;\n },\n get rel() {\n return ariaProps.rel;\n },\n get download() {\n return ariaProps.download;\n },\n get ping() {\n return ariaProps.ping;\n },\n get referrerPolicy() {\n return ariaProps.referrerPolicy;\n },\n get onPress() {\n return ariaProps.onPress;\n },\n get onPressStart() {\n return ariaProps.onPressStart;\n },\n get onPressEnd() {\n return ariaProps.onPressEnd;\n },\n get onPressUp() {\n return ariaProps.onPressUp;\n },\n get onPressChange() {\n return ariaProps.onPressChange;\n },\n get onClick() {\n return ariaProps.onClick;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get \"aria-current\"() {\n return ariaProps[\"aria-current\"];\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n });\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get onHoverStart() {\n return local.onHoverStart;\n },\n get onHoverEnd() {\n return local.onHoverEnd;\n },\n get onHoverChange() {\n return local.onHoverChange;\n },\n });\n\n const renderValues = createMemo<LinkRenderProps>(() => ({\n isCurrent: !!ariaProps[\"aria-current\"],\n isHovered: isHovered(),\n isPressed: linkAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: ariaProps.isDisabled ?? false,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Link\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n const cleanLinkProps = () => {\n const { ref: _ref1, ...rest } = linkAria.linkProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const onLinkClick = (event: MouseEvent) => {\n const onClick = cleanLinkProps().onClick as ((event: MouseEvent) => void) | undefined;\n onClick?.(event);\n handleLinkClick(event, router, ariaProps.href, ariaProps.routerOptions);\n };\n\n return (\n <ElementTag\n tag={elementType()}\n {...domProps()}\n {...cleanLinkProps()}\n {...cleanHoverProps()}\n {...cleanFocusProps()}\n ref={(element: HTMLElement) => {\n assignRef(local.ref, element);\n }}\n onClick={onLinkClick}\n class={renderProps.class()}\n style={renderProps.style()}\n data-hovered={isHovered() || undefined}\n data-pressed={linkAria.isPressed() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-current={!!ariaProps[\"aria-current\"] || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </ElementTag>\n );\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Link.js","names":["<ElementTag\n {...mergeProps(\n omitClickChannel(domProps()),\n cleanLinkProps(),\n cleanHoverProps(),\n cleanFocusProps(),\n {\n onClick: onLinkClick,\n get class() {\n return renderProps.class();\n },\n get style() {\n return renderProps.style();\n },\n get \"data-hovered\"() {\n return isHovered() || undefined;\n },\n get \"data-pressed\"() {\n return linkAria.isPressed() || undefined;\n },\n get \"data-focused\"() {\n return isFocused() || undefined;\n },\n get \"data-focus-visible\"() {\n return isFocusVisible() || undefined;\n },\n get \"data-current\"() {\n return !!ariaProps[\"aria-current\"] || undefined;\n },\n get \"data-disabled\"() {\n return ariaProps.isDisabled || undefined;\n },\n },\n )}\n ref={(element: HTMLElement) => {\n assignRef(local.ref, element);\n const linkRef = (linkAria.linkProps as { ref?: (el: HTMLElement) => void }).ref;\n if (typeof linkRef === \"function\") {\n linkRef(element);\n }\n }}\n // last, so a stray `tag` in the spread can never redirect the element\n tag={elementType()}\n >\n {renderProps.renderChildren()}\n </ElementTag>","ref={(element: HTMLElement) => {\n assignRef(local.ref, element);\n const linkRef = (linkAria.linkProps as { ref?: (el: HTMLElement) => void }).ref;\n if (typeof linkRef === \"function\") {\n linkRef(element);\n }\n }}"],"sources":["../src/Link.tsx"],"sourcesContent":["/*\n * Copyright 2022 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/Link.tsx\n\n/**\n * Link component for solidaria-components\n *\n * Pre-wired headless link component that combines aria hooks.\n * Port of react-aria-components/src/Link.tsx\n */\n\nimport { createContext, createMemo } from \"solid-js\";\nimport type { ParentProps } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { ElementTag } from \"./ElementTag\";\nimport {\n createLink,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaLinkProps,\n type HoverEvents,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { handleLinkClick, useRouter } from \"./RouterProvider\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/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 LinkRenderProps {\n /** Whether the link is the current item within a list. */\n isCurrent: boolean;\n /** Whether the link is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the link is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the link is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the link is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the link is disabled. */\n isDisabled: boolean;\n}\n\nexport interface LinkProps extends Omit<AriaLinkProps, \"elementType\">, HoverEvents, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<LinkRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<LinkRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<LinkRenderProps>;\n /** Ref for the underlying link element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport const LinkContext = createContext<LinkProps | null>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n *\n * @example\n * ```tsx\n * <Link href=\"https://example.com\">Visit Example</Link>\n *\n * // With render props\n * <Link href=\"/about\">\n * {({ isHovered, isFocusVisible }) => (\n * <span class={isHovered ? 'underline' : ''}>\n * About Us\n * </span>\n * )}\n * </Link>\n * ```\n */\nexport function Link(props: ParentProps<LinkProps>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"ref\",\n \"slot\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n const router = useRouter();\n const resolvedHref = createMemo(() =>\n ariaProps.href ? router.useHref(ariaProps.href) : undefined,\n );\n\n const elementType = () => {\n if (ariaProps.href && !ariaProps.isDisabled) {\n return \"a\";\n }\n return \"span\";\n };\n\n const linkAria = createLink({\n get elementType() {\n return elementType();\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get href() {\n return resolvedHref();\n },\n get hrefLang() {\n return ariaProps.hrefLang;\n },\n get target() {\n return ariaProps.target;\n },\n get rel() {\n return ariaProps.rel;\n },\n get download() {\n return ariaProps.download;\n },\n get ping() {\n return ariaProps.ping;\n },\n get referrerPolicy() {\n return ariaProps.referrerPolicy;\n },\n get onPress() {\n return ariaProps.onPress;\n },\n get onPressStart() {\n return ariaProps.onPressStart;\n },\n get onPressEnd() {\n return ariaProps.onPressEnd;\n },\n get onPressUp() {\n return ariaProps.onPressUp;\n },\n get onPressChange() {\n return ariaProps.onPressChange;\n },\n get onClick() {\n return ariaProps.onClick;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get \"aria-current\"() {\n return ariaProps[\"aria-current\"];\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n });\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get onHoverStart() {\n return local.onHoverStart;\n },\n get onHoverEnd() {\n return local.onHoverEnd;\n },\n get onHoverChange() {\n return local.onHoverChange;\n },\n });\n\n const renderValues = createMemo<LinkRenderProps>(() => ({\n isCurrent: !!ariaProps[\"aria-current\"],\n isHovered: isHovered(),\n isPressed: linkAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: ariaProps.isDisabled ?? false,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Link\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n const omitClickChannel = (raw: Record<string, unknown>): Record<string, unknown> => {\n const { onClick: _onClick, ref: _ref, ...rest } = raw;\n return rest;\n };\n const cleanLinkProps = () => omitClickChannel(linkAria.linkProps as Record<string, unknown>);\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref3, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const onLinkClick = (event: MouseEvent) => {\n const click = (linkAria.linkProps as Record<string, unknown>)[\"onClick\"] as\n | ((event: MouseEvent) => void)\n | undefined;\n click?.(event);\n handleLinkClick(event, router, ariaProps.href, ariaProps.routerOptions);\n };\n\n return (\n <ElementTag\n {...mergeProps(\n omitClickChannel(domProps()),\n cleanLinkProps(),\n cleanHoverProps(),\n cleanFocusProps(),\n {\n onClick: onLinkClick,\n get class() {\n return renderProps.class();\n },\n get style() {\n return renderProps.style();\n },\n get \"data-hovered\"() {\n return isHovered() || undefined;\n },\n get \"data-pressed\"() {\n return linkAria.isPressed() || undefined;\n },\n get \"data-focused\"() {\n return isFocused() || undefined;\n },\n get \"data-focus-visible\"() {\n return isFocusVisible() || undefined;\n },\n get \"data-current\"() {\n return !!ariaProps[\"aria-current\"] || undefined;\n },\n get \"data-disabled\"() {\n return ariaProps.isDisabled || undefined;\n },\n },\n )}\n ref={(element: HTMLElement) => {\n assignRef(local.ref, element);\n const linkRef = (linkAria.linkProps as { ref?: (el: HTMLElement) => void }).ref;\n if (typeof linkRef === \"function\") {\n linkRef(element);\n }\n }}\n // last, so a stray `tag` in the spread can never redirect the element\n tag={elementType()}\n >\n {renderProps.renderChildren()}\n </ElementTag>\n );\n}\n"],"mappings":"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"}
|