@proyecto-viviana/solidaria-components 0.5.1 → 0.7.0-rc.1
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 +57 -34
- 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 +20 -17
- package/dist/Alert.js.map +1 -1
- package/dist/Alert.jsx +10 -6
- 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 +19 -6
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Autocomplete.jsx +21 -8
- package/dist/Autocomplete.jsx.map +1 -1
- package/dist/Breadcrumbs.d.ts +2 -1
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +152 -59
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Breadcrumbs.jsx +99 -19
- 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 +144 -79
- package/dist/Button.js.map +1 -1
- package/dist/Button.jsx +124 -50
- package/dist/Button.jsx.map +1 -1
- package/dist/Calendar.d.ts +9 -7
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +321 -228
- package/dist/Calendar.js.map +1 -1
- package/dist/Calendar.jsx +74 -41
- 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 +3 -19
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +422 -317
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.jsx +150 -131
- package/dist/Checkbox.jsx.map +1 -1
- package/dist/Collection.d.ts +152 -6
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +245 -78
- package/dist/Collection.js.map +1 -1
- package/dist/Collection.jsx +150 -12
- package/dist/Collection.jsx.map +1 -1
- package/dist/Color.d.ts +8 -572
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +8 -1717
- package/dist/Color.jsx +8 -1340
- package/dist/ColorArea.d.ts +104 -0
- package/dist/ColorArea.d.ts.map +1 -0
- package/dist/ColorArea.js +382 -0
- package/dist/ColorArea.js.map +1 -0
- package/dist/ColorArea.jsx +286 -0
- package/dist/ColorArea.jsx.map +1 -0
- package/dist/ColorEditor.d.ts +3 -1
- package/dist/ColorEditor.d.ts.map +1 -1
- package/dist/ColorEditor.js +147 -125
- package/dist/ColorEditor.js.map +1 -1
- package/dist/ColorEditor.jsx +12 -6
- package/dist/ColorEditor.jsx.map +1 -1
- package/dist/ColorField.d.ts +89 -0
- package/dist/ColorField.d.ts.map +1 -0
- package/dist/ColorField.js +395 -0
- package/dist/ColorField.js.map +1 -0
- package/dist/ColorField.jsx +280 -0
- package/dist/ColorField.jsx.map +1 -0
- package/dist/ColorPicker.d.ts +33 -0
- package/dist/ColorPicker.d.ts.map +1 -0
- package/dist/ColorPicker.js +86 -0
- package/dist/ColorPicker.js.map +1 -0
- package/dist/ColorPicker.jsx +67 -0
- package/dist/ColorPicker.jsx.map +1 -0
- package/dist/ColorSlider.d.ts +145 -0
- package/dist/ColorSlider.d.ts.map +1 -0
- package/dist/ColorSlider.js +444 -0
- package/dist/ColorSlider.js.map +1 -0
- package/dist/ColorSlider.jsx +319 -0
- package/dist/ColorSlider.jsx.map +1 -0
- package/dist/ColorSwatch.d.ts +37 -0
- package/dist/ColorSwatch.d.ts.map +1 -0
- package/dist/ColorSwatch.js +101 -0
- package/dist/ColorSwatch.js.map +1 -0
- package/dist/ColorSwatch.jsx +84 -0
- package/dist/ColorSwatch.jsx.map +1 -0
- package/dist/ColorSwatchPicker.d.ts +82 -0
- package/dist/ColorSwatchPicker.d.ts.map +1 -0
- package/dist/ColorSwatchPicker.js +364 -0
- package/dist/ColorSwatchPicker.js.map +1 -0
- package/dist/ColorSwatchPicker.jsx +314 -0
- package/dist/ColorSwatchPicker.jsx.map +1 -0
- package/dist/ColorThumb.d.ts +16 -0
- package/dist/ColorThumb.d.ts.map +1 -0
- package/dist/ColorThumb.js +14 -0
- package/dist/ColorThumb.jsx +14 -0
- package/dist/ColorWheel.d.ts +103 -0
- package/dist/ColorWheel.d.ts.map +1 -0
- package/dist/ColorWheel.js +312 -0
- package/dist/ColorWheel.js.map +1 -0
- package/dist/ColorWheel.jsx +224 -0
- package/dist/ColorWheel.jsx.map +1 -0
- package/dist/ComboBox.d.ts +68 -32
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +564 -292
- package/dist/ComboBox.js.map +1 -1
- package/dist/ComboBox.jsx +235 -89
- 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 +104 -86
- package/dist/ContextualHelpTrigger.js.map +1 -1
- package/dist/ContextualHelpTrigger.jsx +38 -30
- package/dist/ContextualHelpTrigger.jsx.map +1 -1
- package/dist/DateField.d.ts +15 -9
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +0 -2
- package/dist/DateField.jsx +0 -2
- package/dist/DateField2.js +262 -196
- package/dist/DateField2.js.map +1 -1
- package/dist/DateField2.jsx +114 -74
- package/dist/DateField2.jsx.map +1 -1
- package/dist/DatePicker.d.ts +13 -34
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +3 -2
- package/dist/DatePicker.jsx +3 -2
- package/dist/DatePicker2.js +671 -512
- package/dist/DatePicker2.js.map +1 -1
- package/dist/DatePicker2.jsx +342 -222
- 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 +6 -25
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +181 -232
- package/dist/Dialog.js.map +1 -1
- package/dist/Dialog.jsx +138 -98
- 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 +167 -92
- package/dist/Disclosure.js.map +1 -1
- package/dist/Disclosure.jsx +62 -22
- 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 +40 -23
- package/dist/DragAndDrop.js.map +1 -1
- package/dist/DragAndDrop.jsx +23 -5
- 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 +4 -3
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/DropZone.js +107 -57
- package/dist/DropZone.js.map +1 -1
- package/dist/DropZone.jsx +49 -13
- 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 +69 -17
- package/dist/FileTrigger.js.map +1 -1
- package/dist/FileTrigger.jsx +49 -3
- 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 +82 -42
- package/dist/Form.js.map +1 -1
- package/dist/Form.jsx +52 -17
- package/dist/Form.jsx.map +1 -1
- package/dist/GridList.d.ts +65 -37
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +512 -277
- package/dist/GridList.js.map +1 -1
- package/dist/GridList.jsx +307 -134
- package/dist/GridList.jsx.map +1 -1
- package/dist/Heading.d.ts +15 -0
- package/dist/Heading.d.ts.map +1 -0
- package/dist/Heading.js +55 -0
- package/dist/Heading.js.map +1 -0
- package/dist/Heading.jsx +40 -0
- package/dist/Heading.jsx.map +1 -0
- 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 +55 -38
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.jsx +12 -4
- 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 +4 -7
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +80 -47
- package/dist/Link.js.map +1 -1
- package/dist/Link.jsx +76 -21
- package/dist/Link.jsx.map +1 -1
- package/dist/ListBox.d.ts +62 -33
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +858 -411
- package/dist/ListBox.js.map +1 -1
- package/dist/ListBox.jsx +478 -268
- 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 +51 -34
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +808 -427
- package/dist/Menu.js.map +1 -1
- package/dist/Menu.jsx +570 -296
- 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 +106 -74
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.jsx +68 -57
- package/dist/Modal.jsx.map +1 -1
- package/dist/NumberField.d.ts +6 -9
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/NumberField.js +344 -136
- package/dist/NumberField.js.map +1 -1
- package/dist/NumberField.jsx +194 -38
- package/dist/NumberField.jsx.map +1 -1
- package/dist/Popover.d.ts +21 -7
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +392 -192
- package/dist/Popover.js.map +1 -1
- package/dist/Popover.jsx +237 -93
- 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 +49 -16
- package/dist/ProgressBar.js.map +1 -1
- package/dist/ProgressBar.jsx +30 -6
- package/dist/ProgressBar.jsx.map +1 -1
- package/dist/RadioGroup.d.ts +4 -20
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +459 -338
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.jsx +186 -153
- package/dist/RadioGroup.jsx.map +1 -1
- package/dist/RangeCalendar.d.ts +11 -7
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +299 -208
- package/dist/RangeCalendar.js.map +1 -1
- package/dist/RangeCalendar.jsx +79 -47
- package/dist/RangeCalendar.jsx.map +1 -1
- package/dist/RouterProvider.d.ts +17 -69
- package/dist/RouterProvider.d.ts.map +1 -1
- package/dist/RouterProvider.js +12 -116
- package/dist/RouterProvider.jsx +12 -110
- package/dist/SearchField.d.ts +5 -8
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +212 -181
- package/dist/SearchField.js.map +1 -1
- package/dist/SearchField.jsx +94 -78
- package/dist/SearchField.jsx.map +1 -1
- package/dist/Select.d.ts +73 -36
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +700 -453
- package/dist/Select.js.map +1 -1
- package/dist/Select.jsx +356 -237
- 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 +3 -9
- package/dist/Separator.d.ts.map +1 -1
- package/dist/Separator.js +24 -12
- package/dist/Separator.js.map +1 -1
- package/dist/Separator.jsx +18 -9
- 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 +25 -26
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +324 -167
- package/dist/Slider.js.map +1 -1
- package/dist/Slider.jsx +195 -93
- package/dist/Slider.jsx.map +1 -1
- package/dist/StepList.d.ts +2 -8
- package/dist/StepList.d.ts.map +1 -1
- package/dist/StepList.js +121 -75
- package/dist/StepList.js.map +1 -1
- package/dist/StepList.jsx +67 -27
- package/dist/StepList.jsx.map +1 -1
- package/dist/Switch.d.ts +17 -11
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +213 -128
- package/dist/Switch.js.map +1 -1
- package/dist/Switch.jsx +68 -31
- package/dist/Switch.jsx.map +1 -1
- package/dist/Table.d.ts +21 -2
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +938 -638
- package/dist/Table.js.map +1 -1
- package/dist/Table.jsx +537 -259
- 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 +322 -300
- package/dist/Tabs.js.map +1 -1
- package/dist/Tabs.jsx +106 -67
- package/dist/Tabs.jsx.map +1 -1
- package/dist/TagGroup.d.ts +32 -22
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +377 -136
- package/dist/TagGroup.js.map +1 -1
- package/dist/TagGroup.jsx +220 -53
- 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 +38 -8
- package/dist/Text.js.map +1 -1
- package/dist/Text.jsx +27 -5
- package/dist/Text.jsx.map +1 -1
- package/dist/TextField.d.ts +4 -17
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +116 -142
- package/dist/TextField.js.map +1 -1
- package/dist/TextField.jsx +88 -115
- package/dist/TextField.jsx.map +1 -1
- package/dist/TimeField.d.ts +3 -16
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +121 -107
- package/dist/TimeField.js.map +1 -1
- package/dist/TimeField.jsx +67 -54
- package/dist/TimeField.jsx.map +1 -1
- package/dist/Toast.d.ts +27 -14
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toast.js +273 -113
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.jsx +182 -32
- 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 +75 -35
- package/dist/ToggleButton.js.map +1 -1
- package/dist/ToggleButton.jsx +39 -13
- 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 +54 -0
- package/dist/TokenField.d.ts.map +1 -0
- package/dist/TokenField.js +374 -0
- package/dist/TokenField.js.map +1 -0
- package/dist/TokenField.jsx +272 -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 +37 -22
- package/dist/Toolbar.js.map +1 -1
- package/dist/Toolbar.jsx +17 -8
- 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 +128 -78
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.jsx +83 -46
- package/dist/Tooltip.jsx.map +1 -1
- package/dist/Tree.d.ts +85 -39
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +926 -414
- package/dist/Tree.js.map +1 -1
- package/dist/Tree.jsx +450 -195
- package/dist/Tree.jsx.map +1 -1
- package/dist/Virtualizer.d.ts +41 -10
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/Virtualizer.js +2 -2
- package/dist/Virtualizer.jsx +2 -2
- package/dist/Virtualizer2.js +554 -144
- package/dist/Virtualizer2.js.map +1 -1
- package/dist/Virtualizer2.jsx +516 -124
- 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/calendarHeadingTitle.d.ts +14 -0
- package/dist/calendarHeadingTitle.d.ts.map +1 -0
- package/dist/calendarHeadingTitle.js +23 -0
- package/dist/calendarHeadingTitle.js.map +1 -0
- package/dist/calendarHeadingTitle.jsx +23 -0
- package/dist/calendarHeadingTitle.jsx.map +1 -0
- package/dist/contexts.d.ts +31 -1
- package/dist/contexts.d.ts.map +1 -1
- package/dist/contexts.js +9 -1
- package/dist/contexts.js.map +1 -1
- package/dist/contexts.jsx +9 -1
- package/dist/contexts.jsx.map +1 -1
- package/dist/fileTriggerContext.d.ts +5 -0
- package/dist/fileTriggerContext.d.ts.map +1 -0
- package/dist/fileTriggerContext.js +7 -0
- package/dist/fileTriggerContext.js.map +1 -0
- package/dist/fileTriggerContext.jsx +7 -0
- package/dist/fileTriggerContext.jsx.map +1 -0
- package/dist/index.d.ts +27 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -18
- package/dist/index.jsx +30 -18
- 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/loadMoreSentinel.d.ts +7 -0
- package/dist/loadMoreSentinel.d.ts.map +1 -0
- package/dist/loadMoreSentinel.js +30 -0
- package/dist/loadMoreSentinel.js.map +1 -0
- package/dist/loadMoreSentinel.jsx +30 -0
- package/dist/loadMoreSentinel.jsx.map +1 -0
- package/dist/slots.d.ts +35 -0
- package/dist/slots.d.ts.map +1 -0
- package/dist/slots.js +66 -0
- package/dist/slots.js.map +1 -0
- package/dist/slots.jsx +66 -0
- package/dist/slots.jsx.map +1 -0
- package/dist/staticSelectCollection.d.ts +2 -0
- package/dist/staticSelectCollection.d.ts.map +1 -0
- package/dist/staticSelectCollection.js +2 -0
- package/dist/staticSelectCollection.jsx +2 -0
- package/dist/useDragAndDrop.d.ts +6 -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 +49 -9
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +119 -24
- package/dist/utils.js.map +1 -1
- package/dist/utils.jsx +110 -24
- package/dist/utils.jsx.map +1 -1
- package/dist/virtualizer/Layout.d.ts +12 -2
- 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 +87 -10
- package/src/ActionBar.tsx +50 -24
- package/src/ActionGroup.tsx +30 -19
- package/src/Alert.tsx +12 -7
- package/src/Autocomplete.tsx +25 -16
- package/src/Breadcrumbs.tsx +139 -24
- package/src/Button.tsx +214 -76
- package/src/Calendar.tsx +120 -61
- package/src/CalendarPicker.tsx +16 -1
- package/src/Checkbox.tsx +205 -227
- package/src/Collection.tsx +334 -12
- package/src/Color.tsx +8 -2454
- package/src/ColorArea.tsx +479 -0
- package/src/ColorEditor.tsx +9 -9
- package/src/ColorField.tsx +471 -0
- package/src/ColorPicker.tsx +126 -0
- package/src/ColorSlider.tsx +562 -0
- package/src/ColorSwatch.tsx +129 -0
- package/src/ColorSwatchPicker.tsx +623 -0
- package/src/ColorThumb.tsx +19 -0
- package/src/ColorWheel.tsx +398 -0
- package/src/ComboBox.tsx +471 -173
- package/src/ContextualHelpTrigger.tsx +49 -65
- package/src/DateField.tsx +174 -131
- package/src/DatePicker.tsx +501 -376
- package/src/DateRangePickerContext.tsx +8 -0
- package/src/Dialog.tsx +224 -162
- package/src/Disclosure.tsx +85 -34
- package/src/DragAndDrop.tsx +51 -9
- package/src/DragPreview.tsx +20 -1
- package/src/DropZone.tsx +77 -42
- package/src/ElementTag.tsx +14 -104
- package/src/FieldError.tsx +39 -7
- package/src/FileTrigger.tsx +71 -4
- package/src/Focusable.tsx +27 -11
- package/src/Form.tsx +64 -15
- package/src/GridList.tsx +478 -214
- package/src/Heading.tsx +59 -0
- package/src/HiddenDateInput.tsx +19 -3
- package/src/Icon.tsx +19 -4
- package/src/Keyboard.tsx +18 -2
- package/src/Label.tsx +77 -0
- package/src/Landmark.tsx +6 -1
- package/src/Link.tsx +103 -30
- package/src/ListBox.tsx +924 -530
- package/src/ListDropTargetDelegate.ts +4 -0
- package/src/Menu.tsx +883 -465
- package/src/Meter.tsx +42 -8
- package/src/Modal.tsx +89 -80
- package/src/NumberField.tsx +267 -66
- package/src/Popover.tsx +454 -156
- package/src/Pressable.tsx +27 -11
- package/src/PreviewTrigger.tsx +171 -0
- package/src/ProgressBar.tsx +41 -5
- package/src/RadioGroup.tsx +358 -278
- package/src/RangeCalendar.tsx +130 -77
- package/src/RouterProvider.tsx +33 -215
- package/src/SearchField.tsx +157 -136
- package/src/Select.tsx +689 -453
- package/src/SelectionIndicator.tsx +21 -3
- package/src/Separator.tsx +22 -14
- package/src/SharedElementTransition.tsx +67 -46
- package/src/Slider.tsx +296 -120
- package/src/StepList.tsx +88 -38
- package/src/Switch.tsx +127 -51
- package/src/Table.tsx +842 -479
- package/src/Tabs.tsx +186 -156
- package/src/TagGroup.tsx +377 -90
- package/src/Text.tsx +39 -7
- package/src/TextField.tsx +136 -173
- package/src/TimeField.tsx +90 -93
- package/src/Toast.tsx +238 -82
- package/src/ToggleButton.tsx +60 -17
- package/src/ToggleButtonGroup.tsx +27 -9
- package/src/TokenField.tsx +502 -0
- package/src/Toolbar.tsx +21 -17
- package/src/Tooltip.tsx +157 -99
- package/src/Tree.tsx +888 -360
- package/src/Virtualizer.tsx +501 -148
- package/src/VirtualizerLayouts.ts +211 -26
- package/src/VisuallyHidden.tsx +22 -8
- package/src/calendarHeadingTitle.ts +37 -0
- package/src/contexts.ts +23 -1
- package/src/fileTriggerContext.ts +8 -0
- package/src/index.ts +98 -22
- 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/loadMoreSentinel.ts +31 -0
- package/src/slots.tsx +103 -0
- package/src/staticSelectCollection.tsx +25 -0
- package/src/useDragAndDrop.ts +35 -33
- package/src/utils.tsx +178 -67
- package/src/virtualizer/Layout.ts +32 -2
- package/dist/Color.js.map +0 -1
- package/dist/Color.jsx.map +0 -1
- package/dist/RouterProvider.js.map +0 -1
- package/dist/RouterProvider.jsx.map +0 -1
package/dist/Button.jsx
CHANGED
|
@@ -1,8 +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/Button.tsx
|
|
13
|
+
import { coerceDomBoolean, filterDOMProps, useRenderProps } from "./utils.jsx";
|
|
2
14
|
import { r as PopoverTriggerContext, t as DialogTriggerContext } from "./contexts.jsx";
|
|
15
|
+
import { t as FileTriggerContext } from "./fileTriggerContext.jsx";
|
|
3
16
|
import { ProgressBarContext } from "./ProgressBar.jsx";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
17
|
+
import { joinSlotClass, useSlotValue } from "./slots.jsx";
|
|
18
|
+
import { createContext, createEffect, createMemo, createSignal, onCleanup, untrack, useContext } from "solid-js";
|
|
19
|
+
import { announce, createButton, createFocusRing, createHover, createId, mergeProps } from "@proyecto-viviana/solidaria";
|
|
20
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
6
21
|
//#region src/Button.tsx
|
|
7
22
|
/**
|
|
8
23
|
* Button component for solidaria-components
|
|
@@ -11,7 +26,7 @@ import { announce, createButton, createFocusRing, createHover, createId, mergePr
|
|
|
11
26
|
* Port of react-aria-components/src/Button.tsx
|
|
12
27
|
*/
|
|
13
28
|
const pendingPreservedEventPattern = /Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;
|
|
14
|
-
function assignRef(ref, el) {
|
|
29
|
+
function assignRef$1(ref, el) {
|
|
15
30
|
if (!ref) return;
|
|
16
31
|
if (typeof ref === "function") ref(el);
|
|
17
32
|
else ref.current = el;
|
|
@@ -40,8 +55,8 @@ function createLiveButtonRenderProps(values) {
|
|
|
40
55
|
}
|
|
41
56
|
function createLiveCustomRootProps(getProps, getChildren, ref) {
|
|
42
57
|
const props = {};
|
|
43
|
-
const keys = new Set([
|
|
44
|
-
...Object.keys(getProps
|
|
58
|
+
const keys = /* @__PURE__ */ new Set([
|
|
59
|
+
...Object.keys(untrack(getProps)),
|
|
45
60
|
"children",
|
|
46
61
|
"ref"
|
|
47
62
|
]);
|
|
@@ -70,7 +85,8 @@ const buttonAriaOverrideProps = [
|
|
|
70
85
|
];
|
|
71
86
|
function createForwardedAriaButtonProps(source, overrides) {
|
|
72
87
|
const result = {};
|
|
73
|
-
|
|
88
|
+
const sourceKeys = untrack(() => Object.keys(source));
|
|
89
|
+
for (const key of sourceKeys) Object.defineProperty(result, key, {
|
|
74
90
|
enumerable: true,
|
|
75
91
|
configurable: true,
|
|
76
92
|
get() {
|
|
@@ -107,14 +123,16 @@ const ButtonContext = createContext(null);
|
|
|
107
123
|
* ```
|
|
108
124
|
*/
|
|
109
125
|
function Button(props) {
|
|
126
|
+
const fileTrigger = useContext(FileTriggerContext);
|
|
110
127
|
const contextProps = useContext(ButtonContext);
|
|
111
|
-
const contextSlotProps = contextProps?.slots?.[props.slot
|
|
128
|
+
const contextSlotProps = untrack(() => contextProps?.slots?.[typeof props.slot === "string" ? props.slot : "default"]);
|
|
112
129
|
const contextBaseProps = createMemo(() => {
|
|
113
130
|
if (!contextProps) return {};
|
|
114
131
|
const { slots: _slots, ...rest } = contextProps;
|
|
115
132
|
return rest;
|
|
116
133
|
});
|
|
117
|
-
const
|
|
134
|
+
const mergedProps = contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props;
|
|
135
|
+
const [local, ariaProps] = splitProps(mergedProps, [
|
|
118
136
|
"children",
|
|
119
137
|
"class",
|
|
120
138
|
"style",
|
|
@@ -127,30 +145,47 @@ function Button(props) {
|
|
|
127
145
|
"onHoverEnd",
|
|
128
146
|
"onHoverChange"
|
|
129
147
|
]);
|
|
148
|
+
const slotValue = useSlotValue(() => typeof local.slot === "string" ? local.slot : void 0, { named: true });
|
|
130
149
|
const dialogTriggerContext = useContext(DialogTriggerContext);
|
|
131
150
|
const popoverTriggerContext = useContext(PopoverTriggerContext);
|
|
151
|
+
const menuTriggerProps = () => isPopoverTrigger() && popoverTriggerContext?.trigger === "MenuTrigger" ? popoverTriggerContext.triggerProps : void 0;
|
|
132
152
|
const resolveDisabled = () => {
|
|
133
153
|
const disabled = ariaProps.isDisabled;
|
|
134
|
-
if (typeof disabled === "function"
|
|
135
|
-
|
|
154
|
+
if (typeof disabled === "function" ? disabled() : !!disabled) return true;
|
|
155
|
+
const triggerProps = menuTriggerProps();
|
|
156
|
+
return Boolean(triggerProps?.["aria-disabled"] || triggerProps?.isDisabled);
|
|
136
157
|
};
|
|
137
|
-
const resolvePending = () => !!local.isPending;
|
|
158
|
+
const resolvePending = createMemo(() => fileTrigger ? !!(props.isPending ?? contextSlotProps?.isPending ?? contextProps?.isPending) : !!local.isPending);
|
|
138
159
|
const isPendingFocusable = () => local.isPendingFocusable !== false;
|
|
139
|
-
const [resolvedButtonEl, setResolvedButtonEl] = createSignal(null);
|
|
140
|
-
const buttonId = createId(ariaProps.id);
|
|
160
|
+
const [resolvedButtonEl, setResolvedButtonEl] = createSignal(null, { ownedWrite: true });
|
|
161
|
+
const buttonId = createId(untrack(() => ariaProps.id));
|
|
141
162
|
const progressId = createId();
|
|
142
163
|
const isDialogTrigger = () => !!dialogTriggerContext && !!resolvedButtonEl() && dialogTriggerContext.triggerRef() === resolvedButtonEl();
|
|
143
164
|
const isPopoverTrigger = () => !!popoverTriggerContext && !!resolvedButtonEl() && popoverTriggerContext.triggerRef() === resolvedButtonEl();
|
|
144
165
|
const handlePress = (e) => {
|
|
145
166
|
if (resolvePending()) return;
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
|
|
167
|
+
if (fileTrigger) {
|
|
168
|
+
contextProps?.onPress?.(e);
|
|
169
|
+
contextSlotProps?.onPress?.(e);
|
|
170
|
+
fileTrigger.open();
|
|
171
|
+
props.onPress?.(e);
|
|
172
|
+
} else if (typeof ariaProps.onPress === "function") ariaProps.onPress(e);
|
|
173
|
+
if (isDialogTrigger() && local.slot !== "close") dialogTriggerContext.state.toggle();
|
|
174
|
+
else if (isPopoverTrigger() && local.slot !== "close") {
|
|
175
|
+
const triggerOnPress = popoverTriggerContext.triggerProps?.onPress;
|
|
176
|
+
if (typeof triggerOnPress === "function") triggerOnPress(e);
|
|
177
|
+
else if (popoverTriggerContext.trigger !== "MenuTrigger") popoverTriggerContext.state.toggle();
|
|
178
|
+
}
|
|
149
179
|
};
|
|
150
180
|
const buttonAria = createButton(createForwardedAriaButtonProps(ariaProps, {
|
|
151
181
|
onPress: handlePress,
|
|
152
182
|
get onPressStart() {
|
|
153
|
-
|
|
183
|
+
if (resolvePending()) return void 0;
|
|
184
|
+
return (event) => {
|
|
185
|
+
const triggerStart = popoverTriggerContext?.triggerProps?.onPressStart;
|
|
186
|
+
triggerStart?.(event);
|
|
187
|
+
ariaProps.onPressStart?.(event);
|
|
188
|
+
};
|
|
154
189
|
},
|
|
155
190
|
get onPressEnd() {
|
|
156
191
|
return resolvePending() ? void 0 : ariaProps.onPressEnd;
|
|
@@ -164,6 +199,9 @@ function Button(props) {
|
|
|
164
199
|
get onClick() {
|
|
165
200
|
return resolvePending() ? void 0 : ariaProps.onClick;
|
|
166
201
|
},
|
|
202
|
+
get preventFocusOnPress() {
|
|
203
|
+
return menuTriggerProps()?.preventFocusOnPress ?? ariaProps.preventFocusOnPress;
|
|
204
|
+
},
|
|
167
205
|
get isDisabled() {
|
|
168
206
|
return resolveDisabled();
|
|
169
207
|
}
|
|
@@ -173,9 +211,15 @@ function Button(props) {
|
|
|
173
211
|
get isDisabled() {
|
|
174
212
|
return resolveDisabled() || resolvePending();
|
|
175
213
|
},
|
|
176
|
-
onHoverStart
|
|
177
|
-
|
|
178
|
-
|
|
214
|
+
get onHoverStart() {
|
|
215
|
+
return local.onHoverStart;
|
|
216
|
+
},
|
|
217
|
+
get onHoverEnd() {
|
|
218
|
+
return local.onHoverEnd;
|
|
219
|
+
},
|
|
220
|
+
get onHoverChange() {
|
|
221
|
+
return local.onHoverChange;
|
|
222
|
+
}
|
|
179
223
|
});
|
|
180
224
|
const renderValues = createMemo(() => ({
|
|
181
225
|
isHovered: isHovered(),
|
|
@@ -189,18 +233,24 @@ function Button(props) {
|
|
|
189
233
|
get children() {
|
|
190
234
|
return local.children;
|
|
191
235
|
},
|
|
192
|
-
class
|
|
193
|
-
|
|
236
|
+
get class() {
|
|
237
|
+
return local.class;
|
|
238
|
+
},
|
|
239
|
+
get style() {
|
|
240
|
+
return local.style;
|
|
241
|
+
},
|
|
194
242
|
defaultClassName: "solidaria-Button"
|
|
195
243
|
}, renderValues);
|
|
196
|
-
const
|
|
244
|
+
const slotClass = () => joinSlotClass(renderProps.class(), slotValue().class);
|
|
245
|
+
const domProps = () => {
|
|
197
246
|
const filtered = filterDOMProps(ariaProps, { global: true });
|
|
198
247
|
delete filtered.onClick;
|
|
248
|
+
for (const key in ariaProps) if (key.startsWith("data-")) filtered[key] = ariaProps[key];
|
|
199
249
|
return filtered;
|
|
200
|
-
}
|
|
201
|
-
const buttonPropsRef = buttonAria.buttonProps.ref;
|
|
202
|
-
const focusPropsRef = focusProps.ref;
|
|
203
|
-
const hoverPropsRef = hoverProps.ref;
|
|
250
|
+
};
|
|
251
|
+
const buttonPropsRef = untrack(() => buttonAria.buttonProps.ref);
|
|
252
|
+
const focusPropsRef = untrack(() => focusProps.ref);
|
|
253
|
+
const hoverPropsRef = untrack(() => hoverProps.ref);
|
|
204
254
|
const cleanButtonProps = () => {
|
|
205
255
|
const { ref: _ref1, ...rest } = buttonAria.buttonProps;
|
|
206
256
|
return rest;
|
|
@@ -220,17 +270,18 @@ function Button(props) {
|
|
|
220
270
|
if (cleanButtonProps()["aria-label"]) return `${buttonId} ${progressId}`;
|
|
221
271
|
return labelledBy;
|
|
222
272
|
});
|
|
273
|
+
let releaseFileTrigger;
|
|
274
|
+
onCleanup(() => releaseFileTrigger?.());
|
|
223
275
|
const handleRef = (el) => {
|
|
276
|
+
releaseFileTrigger?.();
|
|
224
277
|
setResolvedButtonEl(el);
|
|
225
|
-
|
|
278
|
+
releaseFileTrigger = fileTrigger?.register(el);
|
|
279
|
+
assignRef$1(local.ref, el);
|
|
226
280
|
buttonPropsRef?.(el);
|
|
227
281
|
focusPropsRef?.(el);
|
|
228
282
|
hoverPropsRef?.(el);
|
|
229
|
-
if (dialogTriggerContext?.setTriggerRef)
|
|
230
|
-
|
|
231
|
-
dialogTriggerContext.setTriggerRef(el);
|
|
232
|
-
}
|
|
233
|
-
if (popoverTriggerContext?.setTriggerRef) popoverTriggerContext.setTriggerRef(el);
|
|
283
|
+
if (dialogTriggerContext?.setTriggerRef && local.slot !== "close") dialogTriggerContext.setTriggerRef(el);
|
|
284
|
+
if (popoverTriggerContext?.setTriggerRef && local.slot !== "close") popoverTriggerContext.setTriggerRef(el);
|
|
234
285
|
};
|
|
235
286
|
const buttonType = () => buttonAria.buttonProps.type === "submit" && resolvePending() ? "button" : buttonAria.buttonProps.type;
|
|
236
287
|
const triggerAriaProps = () => {
|
|
@@ -254,9 +305,15 @@ function Button(props) {
|
|
|
254
305
|
]) if (triggerProps[name] != null) next[name] = triggerProps[name];
|
|
255
306
|
return next;
|
|
256
307
|
};
|
|
308
|
+
const triggerDomProps = () => {
|
|
309
|
+
const triggerProps = menuTriggerProps();
|
|
310
|
+
if (!triggerProps) return {};
|
|
311
|
+
const { onPress: _onPress, onPressStart: _onPressStart, preventFocusOnPress: _preventFocusOnPress, "aria-haspopup": _ariaHasPopup, "aria-expanded": _ariaExpanded, "aria-controls": _ariaControls, "aria-disabled": _ariaDisabled, id: _id, ref: _ref, onKeyDown: _onKeyDown, ...rest } = triggerProps;
|
|
312
|
+
return rest;
|
|
313
|
+
};
|
|
257
314
|
const directAriaProps = () => {
|
|
258
315
|
const next = {};
|
|
259
|
-
for (const name of buttonAriaOverrideProps) next[name] = ariaProps[name];
|
|
316
|
+
for (const name of buttonAriaOverrideProps) next[name] = coerceDomBoolean(name, ariaProps[name]);
|
|
260
317
|
return next;
|
|
261
318
|
};
|
|
262
319
|
const disablePendingInteractions = (props) => {
|
|
@@ -269,30 +326,45 @@ function Button(props) {
|
|
|
269
326
|
};
|
|
270
327
|
const dataState = (value) => value ? "true" : void 0;
|
|
271
328
|
const buttonChildren = () => renderProps.renderChildren();
|
|
272
|
-
const buttonContent = () => <ProgressBarContext
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
let wasPending = resolvePending();
|
|
329
|
+
const buttonContent = () => <ProgressBarContext value={{ id: progressId }}>{buttonChildren()}</ProgressBarContext>;
|
|
330
|
+
let wasPending = false;
|
|
331
|
+
let pendingAnnounceReady = false;
|
|
276
332
|
createEffect(() => {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
333
|
+
return {
|
|
334
|
+
pending: resolvePending(),
|
|
335
|
+
focused: isFocused(),
|
|
336
|
+
labelledBy: ariaLabelledBy() || buttonId
|
|
337
|
+
};
|
|
338
|
+
}, ({ pending, focused, labelledBy }) => {
|
|
339
|
+
if (!pendingAnnounceReady) {
|
|
340
|
+
wasPending = pending;
|
|
341
|
+
pendingAnnounceReady = true;
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
const message = { "aria-labelledby": labelledBy };
|
|
345
|
+
if (!wasPending && focused && pending) announce(message, "assertive");
|
|
346
|
+
else if (wasPending && focused && !pending) announce(message, "assertive");
|
|
281
347
|
wasPending = pending;
|
|
282
348
|
});
|
|
283
349
|
const rootProps = () => ({
|
|
284
350
|
...domProps(),
|
|
351
|
+
...triggerDomProps(),
|
|
285
352
|
...disablePendingInteractions(cleanButtonProps()),
|
|
286
353
|
...directAriaProps(),
|
|
287
354
|
...triggerAriaProps(),
|
|
288
355
|
...cleanFocusProps(),
|
|
289
356
|
...cleanHoverProps(),
|
|
357
|
+
onKeyDown: (event) => {
|
|
358
|
+
(menuTriggerProps()?.onKeyDown)?.(event);
|
|
359
|
+
if (!resolvePending()) cleanButtonProps().onKeyDown?.(event);
|
|
360
|
+
},
|
|
290
361
|
type: buttonType(),
|
|
291
|
-
id: buttonId,
|
|
292
|
-
class:
|
|
362
|
+
id: ariaProps.id || menuTriggerProps()?.id || (dialogTriggerContext && local.slot !== "close" ? dialogTriggerContext.triggerId : void 0) || (popoverTriggerContext && local.slot !== "close" ? popoverTriggerContext.triggerId : void 0) || buttonId,
|
|
363
|
+
class: slotClass(),
|
|
293
364
|
style: renderProps.style(),
|
|
294
365
|
slot: local.slot,
|
|
295
|
-
|
|
366
|
+
"data-rsp-slot": slotValue()["data-rsp-slot"],
|
|
367
|
+
disabled: resolvePending() && !isPendingFocusable() ? true : cleanButtonProps().disabled,
|
|
296
368
|
"aria-labelledby": ariaLabelledBy(),
|
|
297
369
|
"aria-disabled": resolvePending() ? "true" : cleanButtonProps()["aria-disabled"] ?? ariaProps["aria-disabled"],
|
|
298
370
|
"data-pressed": dataState(buttonAria.isPressed() && !resolvePending()),
|
|
@@ -302,11 +374,13 @@ function Button(props) {
|
|
|
302
374
|
"data-disabled": dataState(resolveDisabled()),
|
|
303
375
|
"data-pending": dataState(resolvePending())
|
|
304
376
|
});
|
|
305
|
-
const customRootProps = createLiveCustomRootProps(rootProps, buttonContent, handleRef);
|
|
306
377
|
const customRenderValues = createLiveButtonRenderProps(renderValues);
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
378
|
+
const customRender = createMemo(() => local.render);
|
|
379
|
+
return <>
|
|
380
|
+
{customRender() ? customRender()(createLiveCustomRootProps(rootProps, buttonContent, handleRef), customRenderValues) : <button ref={handleRef} {...rootProps()} class={slotClass()} style={renderProps.style()}>
|
|
381
|
+
{buttonContent()}
|
|
382
|
+
</button>}
|
|
383
|
+
</>;
|
|
310
384
|
}
|
|
311
385
|
//#endregion
|
|
312
386
|
export { Button, ButtonContext };
|
package/dist/Button.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.jsx","names":["mergeProps"],"sources":["../src/Button.tsx"],"sourcesContent":["/**\n * Button component for solidaria-components\n *\n * A pre-wired headless button that combines state + aria hooks.\n * Port of react-aria-components/src/Button.tsx\n */\n\nimport {\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport {\n announce,\n createButton,\n createFocusRing,\n createHover,\n createId,\n mergeProps,\n type AriaButtonProps,\n type HoverEvent,\n type PressEvent,\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 { DialogTriggerContext, PopoverTriggerContext } from \"./contexts\";\nimport { ProgressBarContext } from \"./ProgressBar\";\n\n// Events preserved when `isPending` is true (for tooltips and other overlays),\n// mirroring RAC Button's `PRESERVED_EVENT_PATTERN`. Every other `on*` handler\n// is stripped so a pending-but-focusable button cannot be activated.\nconst pendingPreservedEventPattern =\n /Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;\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\nfunction createLiveButtonRenderProps(values: () => ButtonRenderProps): ButtonRenderProps {\n return {\n get isHovered() {\n return values().isHovered;\n },\n get isPressed() {\n return values().isPressed;\n },\n get isFocused() {\n return values().isFocused;\n },\n get isFocusVisible() {\n return values().isFocusVisible;\n },\n get isDisabled() {\n return values().isDisabled;\n },\n get isPending() {\n return values().isPending;\n },\n };\n}\n\nfunction createLiveCustomRootProps(\n getProps: () => JSX.ButtonHTMLAttributes<HTMLButtonElement>,\n getChildren: () => JSX.Element,\n ref: (el: HTMLButtonElement) => void,\n): JSX.ButtonHTMLAttributes<HTMLButtonElement> {\n const props = {} as JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n const keys = new Set([...Object.keys(getProps()), \"children\", \"ref\"]);\n\n for (const key of keys) {\n Object.defineProperty(props, key, {\n enumerable: true,\n configurable: true,\n get() {\n if (key === \"children\") {\n return getChildren();\n }\n if (key === \"ref\") {\n return ref;\n }\n return (getProps() as Record<string, unknown>)[key];\n },\n });\n }\n\n return props;\n}\n\nconst buttonAriaOverrideProps = [\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"aria-haspopup\",\n \"aria-expanded\",\n \"aria-controls\",\n \"aria-pressed\",\n \"aria-current\",\n \"aria-disabled\",\n] as const;\n\nfunction createForwardedAriaButtonProps(\n source: AriaButtonProps,\n overrides: AriaButtonProps,\n): AriaButtonProps {\n const result = {} as AriaButtonProps;\n\n for (const key in source) {\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get() {\n return (source as Record<string, unknown>)[key];\n },\n });\n }\n\n for (const key in overrides) {\n const descriptor = Object.getOwnPropertyDescriptor(overrides, key);\n if (!descriptor) continue;\n Object.defineProperty(result, key, { ...descriptor, enumerable: true, configurable: true });\n }\n\n return result;\n}\n\nexport interface ButtonRenderProps {\n /** Whether the button is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the button is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the button is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the button is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n /** Whether the button is currently in a pending state. */\n isPending: boolean;\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<ButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ButtonRenderProps>;\n /** Custom renderer for the outer button element. */\n render?: (\n props: JSX.ButtonHTMLAttributes<HTMLButtonElement>,\n renderProps: ButtonRenderProps,\n ) => JSX.Element;\n /** Ref for the underlying button element. */\n ref?: RefLike<HTMLButtonElement>;\n /** Whether the button is in a pending state. */\n isPending?: boolean;\n /** Keeps pending buttons focusable by using aria-disabled without a native disabled attribute. */\n isPendingFocusable?: boolean;\n /** Handler called when hover starts. */\n onHoverStart?: (e: HoverEvent) => void;\n /** Handler called when hover ends. */\n onHoverEnd?: (e: HoverEvent) => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n}\n\nexport interface ButtonContextValue extends ButtonProps {\n slots?: Record<string, ButtonProps>;\n}\n\nexport const ButtonContext = createContext<ButtonContextValue | null>(null);\n\n/**\n * A button allows a user to perform an action.\n *\n * This is a headless component that provides accessibility and state management.\n * Style it using the render props pattern or data attributes.\n *\n * @example\n * ```tsx\n * <Button onPress={() => alert('Pressed!')}>\n * {({ isPressed, isHovered }) => (\n * <span class={isPressed ? 'bg-blue-700' : isHovered ? 'bg-blue-600' : 'bg-blue-500'}>\n * Click me\n * </span>\n * )}\n * </Button>\n * ```\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const contextProps = useContext(ButtonContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<ButtonProps>(() => {\n if (!contextProps) return {};\n const { slots: _slots, ...rest } = contextProps;\n return rest;\n });\n const mergedProps = (\n contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props\n ) as ButtonProps;\n\n const [local, ariaProps] = splitProps(mergedProps, [\n \"children\",\n \"class\",\n \"style\",\n \"render\",\n \"ref\",\n \"slot\",\n \"isPending\",\n \"isPendingFocusable\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n\n // Check if inside a DialogTrigger or PopoverTrigger - if so, toggle on press\n // NOTE: Context is captured at component creation time. For Buttons inside a Modal,\n // the Modal provides OverlayTriggerStateContext, but due to SolidJS's eager JSX evaluation,\n // components inside Modal children are created before the Modal's Show renders.\n // So we can't reliably use context here to determine if we're inside a Modal.\n const dialogTriggerContext = useContext(DialogTriggerContext);\n const popoverTriggerContext = useContext(PopoverTriggerContext);\n\n // Helper to resolve isDisabled (handles both boolean and Accessor<boolean>)\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return disabled();\n }\n return !!disabled;\n };\n\n const resolvePending = (): boolean => !!local.isPending;\n const isPendingFocusable = () => local.isPendingFocusable !== false;\n\n const [resolvedButtonEl, setResolvedButtonEl] = createSignal<HTMLButtonElement | null>(null);\n const buttonId = createId((ariaProps as Record<string, unknown>).id as string | undefined);\n const progressId = createId();\n\n // Explicit trigger ownership: a button toggles overlays only when it is the\n // registered trigger element for the surrounding trigger context.\n const isDialogTrigger = () =>\n !!dialogTriggerContext &&\n !!resolvedButtonEl() &&\n dialogTriggerContext.triggerRef() === resolvedButtonEl();\n const isPopoverTrigger = () =>\n !!popoverTriggerContext &&\n !!resolvedButtonEl() &&\n popoverTriggerContext.triggerRef() === resolvedButtonEl();\n\n const handlePress = (e: PressEvent) => {\n if (resolvePending()) {\n return;\n }\n if (typeof ariaProps.onPress === \"function\") {\n ariaProps.onPress(e);\n }\n // Toggle only when this exact button is the registered trigger element.\n if (isDialogTrigger()) {\n dialogTriggerContext!.state.toggle();\n }\n if (isPopoverTrigger()) {\n popoverTriggerContext!.state.toggle();\n }\n };\n\n const buttonAria = createButton(\n createForwardedAriaButtonProps(ariaProps, {\n onPress: handlePress,\n get onPressStart() {\n return resolvePending() ? undefined : ariaProps.onPressStart;\n },\n get onPressEnd() {\n return resolvePending() ? undefined : ariaProps.onPressEnd;\n },\n get onPressUp() {\n return resolvePending() ? undefined : ariaProps.onPressUp;\n },\n get onPressChange() {\n return resolvePending() ? undefined : ariaProps.onPressChange;\n },\n get onClick() {\n return resolvePending() ? undefined : ariaProps.onClick;\n },\n // Mirror React Aria's RAC `Button`: `useButton` is called with the base\n // `isDisabled` WITHOUT `isPending`, so a pending-focusable button stays a\n // non-disabled native `<button>` — keeping `useFocusable`'s always-on\n // `tabIndex={0}` (the Safari focus workaround) and no native `disabled`\n // attribute. The pending \"disabled\" semantics are layered ON TOP:\n // `aria-disabled=\"true\"` below and `disablePendingInteractions` stripping\n // the press handlers post-hoc (RAC's `useDisableInteractions`). Folding\n // `isPending` in here instead would make the focusable hook drop\n // `tabIndex`, diverging from upstream's pending button (D4).\n get isDisabled() {\n return resolveDisabled();\n },\n }),\n );\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled() || resolvePending();\n },\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n });\n\n const renderValues = createMemo<ButtonRenderProps>(() => ({\n isHovered: isHovered(),\n isPressed: buttonAria.isPressed() && !resolvePending(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isPending: resolvePending(),\n }));\n\n const renderProps = useRenderProps(\n {\n // Use merged children so ButtonContext can supply slot/default content.\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Button\",\n },\n renderValues,\n );\n\n // Remove onClick from DOM props - it's already handled by createPress\n // This matches React Aria Components behavior (Button.tsx line 144: delete DOMProps.onClick)\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n // onClick is handled by createPress, not passed directly to DOM\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n const buttonPropsRef = (buttonAria.buttonProps as Record<string, unknown>).ref as\n | ((el: HTMLElement) => void)\n | undefined;\n const focusPropsRef = (focusProps as Record<string, unknown>).ref as\n | ((el: HTMLElement) => void)\n | undefined;\n const hoverPropsRef = (hoverProps as Record<string, unknown>).ref as\n | ((el: HTMLElement) => void)\n | undefined;\n\n const cleanButtonProps = () => {\n const { ref: _ref1, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref3, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const ariaLabelledBy = createMemo(() => {\n const labelledBy = cleanButtonProps()[\"aria-labelledby\"] as string | undefined;\n if (!resolvePending()) {\n return labelledBy;\n }\n\n if (labelledBy) {\n return `${labelledBy} ${progressId}`;\n }\n\n if (cleanButtonProps()[\"aria-label\"]) {\n return `${buttonId} ${progressId}`;\n }\n\n return labelledBy;\n });\n\n const handleRef = (el: HTMLButtonElement) => {\n setResolvedButtonEl(el);\n assignRef(local.ref, el);\n\n buttonPropsRef?.(el);\n focusPropsRef?.(el);\n hoverPropsRef?.(el);\n\n // Register trigger ownership for surrounding trigger contexts.\n if (dialogTriggerContext?.setTriggerRef) {\n if (!el.id) {\n el.id = dialogTriggerContext.triggerId;\n }\n dialogTriggerContext.setTriggerRef(el);\n }\n if (popoverTriggerContext?.setTriggerRef) {\n popoverTriggerContext.setTriggerRef(el);\n }\n };\n const buttonType = () =>\n (buttonAria.buttonProps as Record<string, unknown>).type === \"submit\" && resolvePending()\n ? \"button\"\n : ((buttonAria.buttonProps as Record<string, unknown>).type as\n | \"button\"\n | \"submit\"\n | \"reset\"\n | undefined);\n const triggerAriaProps = () => {\n const dialogTriggerProps = dialogTriggerContext?.triggerProps;\n if (dialogTriggerProps && isDialogTrigger()) {\n const next: Record<string, unknown> = {};\n for (const name of [\"aria-haspopup\", \"aria-expanded\", \"aria-controls\"]) {\n if (dialogTriggerProps[name] != null) {\n next[name] = dialogTriggerProps[name];\n }\n }\n return next;\n }\n\n const triggerProps = popoverTriggerContext?.triggerProps;\n if (!triggerProps || !isPopoverTrigger()) {\n return {};\n }\n\n const next: Record<string, unknown> = {};\n for (const name of [\"aria-haspopup\", \"aria-expanded\", \"aria-controls\"]) {\n if (triggerProps[name] != null) {\n next[name] = triggerProps[name];\n }\n }\n return next;\n };\n const directAriaProps = () => {\n const next: Record<string, unknown> = {};\n for (const name of buttonAriaOverrideProps) {\n next[name] = (ariaProps as Record<string, unknown>)[name];\n }\n return next;\n };\n const disablePendingInteractions = (props: Record<string, unknown>) => {\n if (!resolvePending()) {\n return props;\n }\n\n const next = { ...props };\n for (const key of Object.keys(next)) {\n // Mirror RAC's `useDisableInteractions`: when pending, strip every event\n // handler except the ones overlays/tooltips still need — focus/blur,\n // hover, and pointer/mouse enter-leave-over-out. Press handlers\n // (click/pointerdown/keydown/…) are removed so the focusable button\n // cannot be activated while pending.\n if (key.startsWith(\"on\") && !pendingPreservedEventPattern.test(key)) {\n next[key] = undefined;\n }\n }\n next.href = undefined;\n next.target = undefined;\n return next;\n };\n const dataState = (value: boolean) => (value ? \"true\" : undefined);\n const buttonChildren = () => renderProps.renderChildren();\n const buttonContent = () => (\n <ProgressBarContext.Provider value={{ id: progressId }}>\n {buttonChildren()}\n </ProgressBarContext.Provider>\n );\n let wasPending = resolvePending();\n createEffect(() => {\n const pending = resolvePending();\n const message = { \"aria-labelledby\": ariaLabelledBy() || buttonId };\n\n if (!wasPending && isFocused() && pending) {\n announce(message, \"assertive\");\n } else if (wasPending && isFocused() && !pending) {\n announce(message, \"assertive\");\n }\n\n wasPending = pending;\n });\n const rootProps = () =>\n ({\n ...domProps(),\n ...disablePendingInteractions(cleanButtonProps()),\n ...directAriaProps(),\n ...triggerAriaProps(),\n ...cleanFocusProps(),\n ...cleanHoverProps(),\n type: buttonType(),\n id: buttonId,\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n disabled: resolvePending() && isPendingFocusable() ? undefined : cleanButtonProps().disabled,\n \"aria-labelledby\": ariaLabelledBy(),\n \"aria-disabled\": resolvePending()\n ? \"true\"\n : (cleanButtonProps()[\"aria-disabled\"] ?? ariaProps[\"aria-disabled\"]),\n \"data-pressed\": dataState(buttonAria.isPressed() && !resolvePending()),\n \"data-hovered\": dataState(isHovered()),\n \"data-focused\": dataState(isFocused()),\n \"data-focus-visible\": dataState(isFocusVisible()),\n \"data-disabled\": dataState(resolveDisabled()),\n \"data-pending\": dataState(resolvePending()),\n }) as JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n const customRootProps = createLiveCustomRootProps(rootProps, buttonContent, handleRef);\n const customRenderValues = createLiveButtonRenderProps(renderValues);\n\n return local.render ? (\n local.render(customRootProps, customRenderValues)\n ) : (\n <button\n ref={handleRef}\n {...rootProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n attr:data-pressed={(rootProps() as Record<string, unknown>)[\"data-pressed\"] as string}\n attr:data-hovered={(rootProps() as Record<string, unknown>)[\"data-hovered\"] as string}\n attr:data-focused={(rootProps() as Record<string, unknown>)[\"data-focused\"] as string}\n attr:data-focus-visible={\n (rootProps() as Record<string, unknown>)[\"data-focus-visible\"] as string\n }\n attr:data-disabled={(rootProps() as Record<string, unknown>)[\"data-disabled\"] as string}\n attr:data-pending={(rootProps() as Record<string, unknown>)[\"data-pending\"] as string}\n >\n {buttonContent()}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAyCA,MAAM,+BACJ;AAIF,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAEA,SAAS,4BAA4B,QAAoD;CACvF,OAAO;EACL,IAAI,YAAY;GACd,OAAO,OAAO,CAAC,CAAC;EAClB;EACA,IAAI,YAAY;GACd,OAAO,OAAO,CAAC,CAAC;EAClB;EACA,IAAI,YAAY;GACd,OAAO,OAAO,CAAC,CAAC;EAClB;EACA,IAAI,iBAAiB;GACnB,OAAO,OAAO,CAAC,CAAC;EAClB;EACA,IAAI,aAAa;GACf,OAAO,OAAO,CAAC,CAAC;EAClB;EACA,IAAI,YAAY;GACd,OAAO,OAAO,CAAC,CAAC;EAClB;CACF;AACF;AAEA,SAAS,0BACP,UACA,aACA,KAC6C;CAC7C,MAAM,QAAQ,CAAC;CACf,MAAM,OAAO,IAAI,IAAI;EAAC,GAAG,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B,KAAK,cAAe,UAAU,CAAC,CAA6B,iBAC5D,KAAK,cAAe,UAAU,CAAC,CAA6B,iBAC5D,KAAK,cAAe,UAAU,CAAC,CAA6B,iBAC5D,KAAK,oBACF,UAAU,CAAC,CAA6B,uBAE3C,KAAK,eAAgB,UAAU,CAAC,CAA6B,kBAC7D,KAAK,cAAe,UAAU,CAAC,CAA6B,iBAC7D;OACE,cAAc,EAAE;IACnB,EAAE;AAEN"}
|
|
1
|
+
{"version":3,"file":"Button.jsx","names":["assignRef"],"sources":["../src/Button.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/Button.tsx\n\n/**\n * Button component for solidaria-components\n *\n * A pre-wired headless button that combines state + aria hooks.\n * Port of react-aria-components/src/Button.tsx\n */\n\nimport {\n createContext,\n createEffect,\n createMemo,\n onCleanup,\n createSignal,\n untrack,\n useContext,\n} from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n announce,\n createButton,\n createFocusRing,\n createHover,\n createId,\n mergeProps,\n type AriaButtonProps,\n type HoverEvent,\n type PressEvent,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n coerceDomBoolean,\n} from \"./utils\";\nimport { DialogTriggerContext, PopoverTriggerContext } from \"./contexts\";\nimport { FileTriggerContext } from \"./fileTriggerContext\";\nimport { ProgressBarContext } from \"./ProgressBar\";\nimport { joinSlotClass, useSlotValue } from \"./slots\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\n// Events preserved when `isPending` is true (for tooltips and other overlays),\n// mirroring RAC Button's `PRESERVED_EVENT_PATTERN`. Every other `on*` handler\n// is stripped so a pending-but-focusable button cannot be activated.\nconst pendingPreservedEventPattern =\n /Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;\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\nfunction createLiveButtonRenderProps(values: () => ButtonRenderProps): ButtonRenderProps {\n return {\n get isHovered() {\n return values().isHovered;\n },\n get isPressed() {\n return values().isPressed;\n },\n get isFocused() {\n return values().isFocused;\n },\n get isFocusVisible() {\n return values().isFocusVisible;\n },\n get isDisabled() {\n return values().isDisabled;\n },\n get isPending() {\n return values().isPending;\n },\n };\n}\n\nfunction createLiveCustomRootProps(\n getProps: () => JSX.ButtonHTMLAttributes<HTMLButtonElement>,\n getChildren: () => JSX.Element,\n ref: (el: HTMLButtonElement) => void,\n): JSX.ButtonHTMLAttributes<HTMLButtonElement> {\n const props = {} as JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n // Snapshot keys once. Reading getProps() in the component body is\n // STRICT_READ_UNTRACKED; getters re-read live values on later access.\n const keys = new Set([...Object.keys(untrack(getProps)), \"children\", \"ref\"]);\n\n for (const key of keys) {\n Object.defineProperty(props, key, {\n enumerable: true,\n configurable: true,\n get() {\n if (key === \"children\") {\n return getChildren();\n }\n if (key === \"ref\") {\n return ref;\n }\n return (getProps() as Record<string, unknown>)[key];\n },\n });\n }\n\n return props;\n}\n\nconst buttonAriaOverrideProps = [\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"aria-haspopup\",\n \"aria-expanded\",\n \"aria-controls\",\n \"aria-pressed\",\n \"aria-current\",\n \"aria-disabled\",\n] as const;\n\nfunction createForwardedAriaButtonProps(\n source: AriaButtonProps,\n overrides: AriaButtonProps,\n): AriaButtonProps {\n const result = {} as AriaButtonProps;\n\n // Enumerating an omit/merge proxy can read reactive leaves (descriptor\n // value snapshots). Snapshot keys once, untracked; getters re-read live.\n const sourceKeys = untrack(() => Object.keys(source as Record<string, unknown>));\n for (const key of sourceKeys) {\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get() {\n return (source as Record<string, unknown>)[key];\n },\n });\n }\n\n for (const key in overrides) {\n const descriptor = Object.getOwnPropertyDescriptor(overrides, key);\n if (!descriptor) continue;\n Object.defineProperty(result, key, { ...descriptor, enumerable: true, configurable: true });\n }\n\n return result;\n}\n\nexport interface ButtonRenderProps {\n /** Whether the button is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the button is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the button is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the button is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n /** Whether the button is currently in a pending state. */\n isPending: boolean;\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<ButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ButtonRenderProps>;\n /** Custom renderer for the outer button element. */\n render?: (\n props: JSX.ButtonHTMLAttributes<HTMLButtonElement>,\n renderProps: ButtonRenderProps,\n ) => JSX.Element;\n /** Ref for the underlying button element. */\n ref?: RefLike<HTMLButtonElement>;\n /** Whether the button is in a pending state. */\n isPending?: boolean;\n /** Keeps pending buttons focusable by using aria-disabled without a native disabled attribute. */\n isPendingFocusable?: boolean;\n /** Handler called when hover starts. */\n onHoverStart?: (e: HoverEvent) => void;\n /** Handler called when hover ends. */\n onHoverEnd?: (e: HoverEvent) => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n}\n\nexport interface ButtonContextValue extends ButtonProps {\n slots?: Record<string, ButtonProps>;\n}\n\nexport const ButtonContext = createContext<ButtonContextValue | null>(null);\n\n/**\n * A button allows a user to perform an action.\n *\n * This is a headless component that provides accessibility and state management.\n * Style it using the render props pattern or data attributes.\n *\n * @example\n * ```tsx\n * <Button onPress={() => alert('Pressed!')}>\n * {({ isPressed, isHovered }) => (\n * <span class={isPressed ? 'bg-blue-700' : isHovered ? 'bg-blue-600' : 'bg-blue-500'}>\n * Click me\n * </span>\n * )}\n * </Button>\n * ```\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const fileTrigger = useContext(FileTriggerContext);\n const contextProps = useContext(ButtonContext);\n const contextSlotProps = untrack(\n () => contextProps?.slots?.[typeof props.slot === \"string\" ? props.slot : \"default\"],\n );\n const contextBaseProps = createMemo<ButtonProps>(() => {\n if (!contextProps) return {};\n const { slots: _slots, ...rest } = contextProps;\n return rest;\n });\n const mergedProps = (\n contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props\n ) as ButtonProps;\n\n const [local, ariaProps] = splitProps(mergedProps, [\n \"children\",\n \"class\",\n \"style\",\n \"render\",\n \"ref\",\n \"slot\",\n \"isPending\",\n \"isPendingFocusable\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n const slotValue = useSlotValue(() => (typeof local.slot === \"string\" ? local.slot : undefined), {\n named: true,\n });\n\n // Check if inside a DialogTrigger or PopoverTrigger - if so, toggle on press\n // NOTE: Context is captured at component creation time. For Buttons inside a Modal,\n // the Modal provides OverlayTriggerStateContext, but due to SolidJS's eager JSX evaluation,\n // components inside Modal children are created before the Modal's Show renders.\n // So we can't reliably use context here to determine if we're inside a Modal.\n const dialogTriggerContext = useContext(DialogTriggerContext);\n const popoverTriggerContext = useContext(PopoverTriggerContext);\n\n // Helper to resolve isDisabled (handles both boolean and Accessor<boolean>)\n const menuTriggerProps = () =>\n isPopoverTrigger() && popoverTriggerContext?.trigger === \"MenuTrigger\"\n ? popoverTriggerContext.triggerProps\n : undefined;\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\" ? disabled() : !!disabled) {\n return true;\n }\n const triggerProps = menuTriggerProps();\n return Boolean(triggerProps?.[\"aria-disabled\"] || triggerProps?.isDisabled);\n };\n\n // Owned at setup. Solid compiles a compound `isPending={a() && b()}` prop into\n // a getter that calls `memo()` on every read, so reading it lazily from a native\n // press or hover handler creates that computation with no owner: it warns and is\n // never disposed. A memo pins the read to this component's owner.\n const resolvePending = createMemo((): boolean =>\n fileTrigger\n ? !!(props.isPending ?? contextSlotProps?.isPending ?? contextProps?.isPending)\n : !!local.isPending,\n );\n const isPendingFocusable = () => local.isPendingFocusable !== false;\n\n const [resolvedButtonEl, setResolvedButtonEl] = createSignal<HTMLButtonElement | null>(null, {\n ownedWrite: true,\n });\n const buttonId = createId(\n untrack(() => (ariaProps as Record<string, unknown>).id as string | undefined),\n );\n const progressId = createId();\n\n // Explicit trigger ownership: a button toggles overlays only when it is the\n // registered trigger element for the surrounding trigger context.\n const isDialogTrigger = () =>\n !!dialogTriggerContext &&\n !!resolvedButtonEl() &&\n dialogTriggerContext.triggerRef() === resolvedButtonEl();\n const isPopoverTrigger = () =>\n !!popoverTriggerContext &&\n !!resolvedButtonEl() &&\n popoverTriggerContext.triggerRef() === resolvedButtonEl();\n\n const handlePress = (e: PressEvent) => {\n if (resolvePending()) {\n return;\n }\n if (fileTrigger) {\n // Read original callbacks at activation time. mergeProps event chains\n // capture snapshots; calling that chain too would double delivery.\n contextProps?.onPress?.(e);\n contextSlotProps?.onPress?.(e);\n fileTrigger.open();\n props.onPress?.(e);\n } else if (typeof ariaProps.onPress === \"function\") {\n ariaProps.onPress(e);\n }\n // Toggle only when this exact button is the registered trigger element.\n if (isDialogTrigger() && local.slot !== \"close\") {\n dialogTriggerContext!.state.toggle();\n } else if (isPopoverTrigger() && local.slot !== \"close\") {\n const triggerOnPress = popoverTriggerContext!.triggerProps?.onPress as\n | ((event: PressEvent) => void)\n | undefined;\n if (typeof triggerOnPress === \"function\") {\n triggerOnPress(e);\n } else if (popoverTriggerContext!.trigger !== \"MenuTrigger\") {\n popoverTriggerContext!.state.toggle();\n }\n }\n };\n\n const buttonAria = createButton(\n createForwardedAriaButtonProps(ariaProps, {\n onPress: handlePress,\n get onPressStart() {\n if (resolvePending()) return undefined;\n return (event: PressEvent) => {\n const triggerStart = popoverTriggerContext?.triggerProps?.onPressStart as\n | ((event: PressEvent) => void)\n | undefined;\n triggerStart?.(event);\n ariaProps.onPressStart?.(event);\n };\n },\n get onPressEnd() {\n return resolvePending() ? undefined : ariaProps.onPressEnd;\n },\n get onPressUp() {\n return resolvePending() ? undefined : ariaProps.onPressUp;\n },\n get onPressChange() {\n return resolvePending() ? undefined : ariaProps.onPressChange;\n },\n get onClick() {\n return resolvePending() ? undefined : ariaProps.onClick;\n },\n get preventFocusOnPress() {\n return (menuTriggerProps()?.preventFocusOnPress ?? ariaProps.preventFocusOnPress) as\n | boolean\n | undefined;\n },\n // Mirror React Aria's RAC `Button`: `useButton` is called with the base\n // `isDisabled` WITHOUT `isPending`, so a pending-focusable button stays a\n // non-disabled native `<button>` — keeping `useFocusable`'s always-on\n // `tabindex={0}` (the Safari focus workaround) and no native `disabled`\n // attribute. The pending \"disabled\" semantics are layered ON TOP:\n // `aria-disabled=\"true\"` below and `disablePendingInteractions` stripping\n // the press handlers post-hoc (RAC's `useDisableInteractions`). Folding\n // `isPending` in here instead would make the focusable hook drop\n // `tabIndex`, diverging from upstream's pending button (D4).\n get isDisabled() {\n return resolveDisabled();\n },\n }),\n );\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled() || resolvePending();\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<ButtonRenderProps>(() => ({\n isHovered: isHovered(),\n isPressed: buttonAria.isPressed() && !resolvePending(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isPending: resolvePending(),\n }));\n\n const renderProps = useRenderProps(\n {\n // Use merged children so ButtonContext can supply slot/default content.\n get children() {\n return local.children;\n },\n get class() {\n return local.class;\n },\n get style() {\n return local.style;\n },\n defaultClassName: \"solidaria-Button\",\n },\n renderValues,\n );\n const slotClass = () => joinSlotClass(renderProps.class(), slotValue().class);\n\n // Remove onClick from DOM props - it's already handled by createPress\n // This matches React Aria Components behavior (Button.tsx line 144: delete DOMProps.onClick)\n const domProps = () => {\n const filtered = filterDOMProps(ariaProps, { global: true }) as Record<string, unknown>;\n // onClick is handled by createPress, not passed directly to DOM\n delete filtered.onClick;\n // Read data-* now so `{...rootProps()}` re-applies when a trigger attr changes.\n for (const key in ariaProps) {\n if (key.startsWith(\"data-\")) {\n filtered[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return filtered;\n };\n\n const buttonPropsRef = untrack(() => (buttonAria.buttonProps as Record<string, unknown>).ref) as\n | ((el: HTMLElement) => void)\n | undefined;\n const focusPropsRef = untrack(() => (focusProps as Record<string, unknown>).ref) as\n | ((el: HTMLElement) => void)\n | undefined;\n const hoverPropsRef = untrack(() => (hoverProps as Record<string, unknown>).ref) as\n | ((el: HTMLElement) => void)\n | undefined;\n\n const cleanButtonProps = () => {\n const { ref: _ref1, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref2, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref3, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const ariaLabelledBy = createMemo(() => {\n const labelledBy = cleanButtonProps()[\"aria-labelledby\"] as string | undefined;\n if (!resolvePending()) {\n return labelledBy;\n }\n\n if (labelledBy) {\n return `${labelledBy} ${progressId}`;\n }\n\n if (cleanButtonProps()[\"aria-label\"]) {\n return `${buttonId} ${progressId}`;\n }\n\n return labelledBy;\n });\n\n let releaseFileTrigger: (() => void) | undefined;\n onCleanup(() => releaseFileTrigger?.());\n const handleRef = (el: HTMLButtonElement) => {\n releaseFileTrigger?.();\n setResolvedButtonEl(el);\n releaseFileTrigger = fileTrigger?.register(el);\n assignRef(local.ref, el);\n\n buttonPropsRef?.(el);\n focusPropsRef?.(el);\n hoverPropsRef?.(el);\n\n // Register trigger ownership for surrounding trigger contexts.\n // Close buttons live inside the overlay and must not steal trigger identity.\n if (dialogTriggerContext?.setTriggerRef && local.slot !== \"close\") {\n dialogTriggerContext.setTriggerRef(el);\n }\n if (popoverTriggerContext?.setTriggerRef && local.slot !== \"close\") {\n popoverTriggerContext.setTriggerRef(el);\n }\n };\n const buttonType = () =>\n (buttonAria.buttonProps as Record<string, unknown>).type === \"submit\" && resolvePending()\n ? \"button\"\n : ((buttonAria.buttonProps as Record<string, unknown>).type as\n | \"button\"\n | \"submit\"\n | \"reset\"\n | undefined);\n const triggerAriaProps = () => {\n const dialogTriggerProps = dialogTriggerContext?.triggerProps;\n if (dialogTriggerProps && isDialogTrigger()) {\n const next: Record<string, unknown> = {};\n for (const name of [\"aria-haspopup\", \"aria-expanded\", \"aria-controls\"]) {\n if (dialogTriggerProps[name] != null) {\n next[name] = dialogTriggerProps[name];\n }\n }\n return next;\n }\n\n const triggerProps = popoverTriggerContext?.triggerProps;\n if (!triggerProps || !isPopoverTrigger()) {\n return {};\n }\n\n const next: Record<string, unknown> = {};\n for (const name of [\"aria-haspopup\", \"aria-expanded\", \"aria-controls\"]) {\n if (triggerProps[name] != null) {\n next[name] = triggerProps[name];\n }\n }\n return next;\n };\n const triggerDomProps = () => {\n const triggerProps = menuTriggerProps();\n if (!triggerProps) {\n return {};\n }\n\n const {\n onPress: _onPress,\n onPressStart: _onPressStart,\n preventFocusOnPress: _preventFocusOnPress,\n \"aria-haspopup\": _ariaHasPopup,\n \"aria-expanded\": _ariaExpanded,\n \"aria-controls\": _ariaControls,\n \"aria-disabled\": _ariaDisabled,\n id: _id,\n ref: _ref,\n onKeyDown: _onKeyDown,\n ...rest\n } = triggerProps;\n return rest;\n };\n const directAriaProps = () => {\n const next: Record<string, unknown> = {};\n for (const name of buttonAriaOverrideProps) {\n next[name] = coerceDomBoolean(name, (ariaProps as Record<string, unknown>)[name]);\n }\n return next;\n };\n const disablePendingInteractions = (props: Record<string, unknown>) => {\n if (!resolvePending()) {\n return props;\n }\n\n const next = { ...props };\n for (const key of Object.keys(next)) {\n // Mirror RAC's `useDisableInteractions`: when pending, strip every event\n // handler except the ones overlays/tooltips still need — focus/blur,\n // hover, and pointer/mouse enter-leave-over-out. Press handlers\n // (click/pointerdown/keydown/…) are removed so the focusable button\n // cannot be activated while pending.\n if (key.startsWith(\"on\") && !pendingPreservedEventPattern.test(key)) {\n next[key] = undefined;\n }\n }\n next.href = undefined;\n next.target = undefined;\n return next;\n };\n const dataState = (value: boolean) => (value ? \"true\" : undefined);\n const buttonChildren = () => renderProps.renderChildren();\n const buttonContent = () => (\n <ProgressBarContext value={{ id: progressId }}>{buttonChildren()}</ProgressBarContext>\n );\n let wasPending = false;\n let pendingAnnounceReady = false;\n createEffect(\n () => {\n const pending = resolvePending();\n const focused = isFocused();\n const labelledBy = ariaLabelledBy() || buttonId;\n return { pending, focused, labelledBy };\n },\n ({ pending, focused, labelledBy }) => {\n if (!pendingAnnounceReady) {\n wasPending = pending;\n pendingAnnounceReady = true;\n return;\n }\n const message = { \"aria-labelledby\": labelledBy };\n if (!wasPending && focused && pending) {\n announce(message, \"assertive\");\n } else if (wasPending && focused && !pending) {\n announce(message, \"assertive\");\n }\n wasPending = pending;\n },\n );\n const rootProps = () =>\n ({\n ...domProps(),\n ...triggerDomProps(),\n ...disablePendingInteractions(cleanButtonProps()),\n ...directAriaProps(),\n ...triggerAriaProps(),\n ...cleanFocusProps(),\n ...cleanHoverProps(),\n // RAC pending strips usePress keydown. Keep this wrapper so MenuTrigger\n // still peels onto the host; skip createPress while pending so Enter/Space\n // are not preventDefault'd and the native trusted click can fire.\n onKeyDown: (event: KeyboardEvent) => {\n (menuTriggerProps()?.onKeyDown as ((event: KeyboardEvent) => void) | undefined)?.(event);\n if (!resolvePending()) {\n (cleanButtonProps().onKeyDown as ((event: KeyboardEvent) => void) | undefined)?.(event);\n }\n },\n type: buttonType(),\n id:\n ((ariaProps as { id?: string }).id as string | undefined) ||\n (menuTriggerProps()?.id as string | undefined) ||\n (dialogTriggerContext && local.slot !== \"close\"\n ? dialogTriggerContext.triggerId\n : undefined) ||\n (popoverTriggerContext && local.slot !== \"close\"\n ? popoverTriggerContext.triggerId\n : undefined) ||\n buttonId,\n class: slotClass(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-rsp-slot\": slotValue()[\"data-rsp-slot\"],\n // Pending opts out of native focus only when explicitly requested. Keep\n // base disability authoritative without changing useFocusable's policy.\n disabled: resolvePending() && !isPendingFocusable() ? true : cleanButtonProps().disabled,\n \"aria-labelledby\": ariaLabelledBy(),\n \"aria-disabled\": resolvePending()\n ? \"true\"\n : (cleanButtonProps()[\"aria-disabled\"] ?? ariaProps[\"aria-disabled\"]),\n \"data-pressed\": dataState(buttonAria.isPressed() && !resolvePending()),\n \"data-hovered\": dataState(isHovered()),\n \"data-focused\": dataState(isFocused()),\n \"data-focus-visible\": dataState(isFocusVisible()),\n \"data-disabled\": dataState(resolveDisabled()),\n \"data-pending\": dataState(resolvePending()),\n }) as JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n const customRenderValues = createLiveButtonRenderProps(renderValues);\n const customRender = createMemo(() => local.render);\n\n return (\n <>\n {customRender() ? (\n customRender()!(\n createLiveCustomRootProps(rootProps, buttonContent, handleRef),\n customRenderValues,\n )\n ) : (\n <button ref={handleRef} {...rootProps()} class={slotCl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gB,UAAU,eAAe,CAAC;CAC5C;CACF,MAAM,qBAAqB,4BAA4B,YAAY;CACnE,MAAM,eAAe,iBAAiB,MAAM,MAAM;CAElD,OACE,EAAE;OACC,aAAa,IACZ,aAAa,CAAC,CACZ,0BAA0B,WAAW,eAAe,SAAS,GAC7D,kBACF,IAEA,CAAC,OAAO,KAAK,eAAe,UAAU,GAAG,OAAO,UAAU,GAAG,OAAO,YAAY,MAAM,GAAG;WACtF,cAAc,EAAE;QACnB,EAAE,QACF;IACJ;AAEJ"}
|
package/dist/Calendar.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
* Calendar component for solidaria-components
|
|
3
|
-
*
|
|
4
|
-
* Pre-wired headless calendar component that combines aria hooks.
|
|
5
|
-
* Port of react-aria-components/src/Calendar.tsx
|
|
6
|
-
*/
|
|
7
|
-
import { type JSX } from "solid-js";
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
8
2
|
import { type AriaCalendarProps, type AriaCalendarGridProps } from "@proyecto-viviana/solidaria";
|
|
3
|
+
import type { DateDuration } from "@internationalized/date";
|
|
9
4
|
import { type CalendarState, type CalendarStateProps, type CalendarSelectionMode, type CalendarDate, type DateValue } from "@proyecto-viviana/solid-stately";
|
|
5
|
+
import { type CalendarHeadingFormatOptions } from "./calendarHeadingTitle";
|
|
10
6
|
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
11
7
|
type RefLike<T> = ((el: T) => void) | {
|
|
12
8
|
current?: T | null;
|
|
@@ -64,6 +60,8 @@ export interface CalendarCellRenderProps {
|
|
|
64
60
|
isInvalid: boolean;
|
|
65
61
|
/** Whether the cell is outside the visible month. */
|
|
66
62
|
isOutsideMonth: boolean;
|
|
63
|
+
/** Whether the cell is outside the visible range. */
|
|
64
|
+
isOutsideVisibleRange: boolean;
|
|
67
65
|
/** Whether the cell represents today. */
|
|
68
66
|
isToday: boolean;
|
|
69
67
|
/** Whether the cell is pressed. */
|
|
@@ -142,6 +140,10 @@ export interface CalendarHeadingProps extends SlotProps {
|
|
|
142
140
|
class?: string;
|
|
143
141
|
/** The inline style for the element. */
|
|
144
142
|
style?: JSX.CSSProperties;
|
|
143
|
+
/** Duration added to the start of the visible range. */
|
|
144
|
+
offset?: DateDuration;
|
|
145
|
+
/** Overrides the default long month and numeric year. */
|
|
146
|
+
format?: CalendarHeadingFormatOptions;
|
|
145
147
|
}
|
|
146
148
|
/**
|
|
147
149
|
* Displays the current month and year in the calendar.
|
package/dist/Calendar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../src/Calendar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../src/Calendar.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,SAAS,EAGf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAwB,KAAK,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAIf,MAAM,SAAS,CAAC;AAKjB,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;AAczE,MAAM,WAAW,mBAAmB;IAClC,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