@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeCalendar.js","names":["JSX","Accessor","createContext","createMemo","createSignal","splitProps","useContext","For","Index","Show","createRangeCalendar","createCalendarGrid","createRangeCalendarCell","createHover","AriaRangeCalendarProps","AriaCalendarGridProps","createRangeCalendarState","RangeCalendarState","RangeCalendarStateProps","CalendarDate","DateValue","RangeValue","endOfMonth","isSameMonth","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","dataAttr","useIsHydrated","VisuallyHidden","RefLike","el","T","current","assignRef","ref","RangeCalendarRenderProps","isDisabled","isReadOnly","isInvalid","isDragging","RangeCalendarProps","Omit","children","Element","class","style","locale","HTMLDivElement","RangeCalendarGridRenderProps","RangeCalendarGridProps","date","headerCellClass","headerCellStyle","CSSProperties","offset","months","RangeCalendarCellRenderProps","isSelected","isSelectionStart","isSelectionEnd","isFocused","isUnavailable","isOutsideMonth","isToday","isPressed","isHovered","isFirstChild","isLastChild","isFirstWeek","isLastWeek","formattedDate","RangeCalendarCellProps","cellClass","cellStyle","RangeCalendarContext","RangeCalendarStateContext","RangeCalendarGridMonthContext","RangeCalendarGridCellPositionContext","weekIndex","dayIndex","lastWeekIndex","useRangeCalendarContext","context","Error","RangeCalendar","props","inheritedState","isHydrated","_$createComponent","when","fallback","_$getNextElement","_tmpl$","RangeCalendarInner","RangeCalendarWithState","_$mergeProps","state","local","rest","calendarAria","renderValues","isValueInvalid","renderProps","defaultClassName","Provider","value","_el$2","_tmpl$4","_el$5","firstChild","_el$6","_co$","_$getNextMarker","nextSibling","_el$7","_el$8","_co$2","_el$9","_el$0","_co$3","_$use","_$spread","calendarProps","data-disabled","data-readonly","data-invalid","data-dragging","_$insert","_el$3","_tmpl$2","String","_el$4","_tmpl$3","$$click","focusNextPage","_$effect","_p$","_v$","nextButtonProps","_v$2","Boolean","disabled","e","_$setAttribute","t","_$setProperty","undefined","_$runHydrationEvents","stateProps","_el$1","_el$12","_el$13","_co$4","_el$14","_el$15","_co$5","_el$16","_el$17","_co$6","_el$10","_el$11","_v$3","_v$4","RangeCalendarHeadingProps","RangeCalendarHeading","_el$18","_tmpl$5","title","_v$5","_v$6","_$className","_$style","RangeCalendarButtonProps","slot","RangeCalendarButton","buttonProps","prevButtonProps","_el$19","_tmpl$6","tabindex","RangeCalendarGrid","gridRef","setGridRef","HTMLTableElement","startDate","offsetMonths","baseStart","visibleRange","start","add","gridAria","endDate","weekdayStyle","Parameters","allDates","monthStart","numWeeks","getWeeksInMonth","weekDates","push","getDatesInWeek","_el$20","_tmpl$7","_el$21","_el$22","_el$23","gridProps","headerProps","each","weekDays","day","_el$24","_tmpl$8","_v$7","_v$8","_el$25","_tmpl$9","_tmpl$0","length","RangeCalendarCell","currentMonthStart","cellPosition","cellRef","setCellRef","position","cellAria","hoverProps","cellRenderProps","getChildren","renderChildren","_el$27","_tmpl$1","_el$28","cellProps","data-selected","data-selection-start","data-selection-end","data-focused","data-unavailable","data-outside-month","data-today","data-pressed","data-hovered","_$delegateEvents"],"sources":["../src/RangeCalendar.tsx"],"sourcesContent":["/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Port of react-aria-components/src/RangeCalendar.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Index,\n Show,\n} from \"solid-js\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // When rendered inside a composite that owns the range state (e.g.\n // DateRangePicker provides `RangeCalendarContext`), reuse that shared state\n // instead of minting a fresh one — otherwise the composite's focus/anchor\n // flags (e.g. the popover-open `setFocused(true)`) drive a different state\n // instance than the one this grid renders. Mirrors the single `Calendar`.\n const inheritedState = useContext(RangeCalendarContext);\n\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div\n class=\"solidaria-RangeCalendar solidaria-RangeCalendar--placeholder\"\n aria-hidden=\"true\"\n />\n }\n >\n <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState\n state={inheritedState as RangeCalendarState<DateValue>}\n {...props}\n />\n </Show>\n </Show>\n );\n}\n\n/**\n * RangeCalendar variant that renders against an externally-owned state (from\n * `RangeCalendarContext`) rather than creating its own. Mirrors the single\n * `CalendarWithState`.\n */\nfunction RangeCalendarWithState<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T> & { state: RangeCalendarState<DateValue> },\n): JSX.Element {\n const [local, , rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n\n const calendarAria = createRangeCalendar(rest, state());\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n isDragging: state().isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state()}>\n <RangeCalendarContext.Provider value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n\n const calendarAria = createRangeCalendar(rest, state as unknown as RangeCalendarState<DateValue>);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext.Provider value={startDate}>\n <table\n ref={setGridRef}\n {...gridAria.gridProps}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...gridAria.headerProps}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates, weekIndex) => (\n <tr>\n <Index each={weekDates()}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext.Provider>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n"],"mappings":";;;;;;;;;;;;;;AAkDA,SAASoC,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KACH;CAGF,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AAqGA,MAAa4C,uBAAuB3E,cAAoD,IAAI;AAC5F,MAAa4E,4BAA4B5E,cAAoD,IAAI;AACjG,MAAM6E,gCAAgC7E,cAA6C,IAAI;AACvF,MAAM8E,uCAAuC9E,cAIlC,IAAI;AAEf,SAAgBkF,0BAAyD;CACvE,MAAMC,UAAU/E,WAAWuE,oBAAoB;CAC/C,IAAI,CAACQ,SACH,MAAM,IAAIC,MAAM,8DAA8D;CAEhF,OAAOD;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgBE,cACdC,OACa;CAMb,MAAMC,iBAAiBnF,WAAWuE,oBAAoB;CAGtD,MAAMa,aAAa5D,cAAc;CAEjC,OAAA6D,gBACGlF,MAAI;EAAA,IACHmF,OAAI;GAAA,OAAEF,WAAW;EAAC;EAAA,IAClBG,WAAQ;GAAA,OAAAC,eAAAC,MAAA;EAAA;EAAA,IAAAlD,WAAA;GAAA,OAAA8C,gBAOPlF,MAAI;IAACmF,MAAMH;IAAc,IAAEI,WAAQ;KAAA,OAAAF,gBAAGK,oBAAuBR,KAAK;IAAA;IAAA,IAAA3C,WAAA;KAAA,OAAA8C,gBAChEM,wBAAsBC,WAAA,EACrBC,OAAOV,eAA+C,GAClDD,KAAK,CAAA;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA;AAKnB;;;;;;AAOA,SAASS,uBACPT,OACa;CACb,MAAM,CAACY,SAASC,QAAQhG,WACtBmF,OACA;EAAC;EAAY;EAAS;EAAS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AAS7L,UAAU;GAAC;GAAA,KAAA,sBAAA;IAAA,OAC1BV,SAASuM,SAASpK,aAAa;GAAC;GAAA,KAAA,kBAAA;IAAA,OACpCnC,SAASuM,SAAS3L,SAAS;GAAC;GAAA,KAAA,wBAAA;IAAA,OACtBZ,SAASuM,SAASnK,cAAc;GAAC;GAAA,KAAA,gBAAA;IAAA,OACzCpC,SAASuM,SAASlK,OAAO;GAAC;GAAA,KAAA,kBAAA;IAAA,OACxBrC,SAASuM,SAASjK,SAAS;GAAC;GAAA,KAAA,kBAAA;IAAA,OAC5BtC,SAASuC,UAAU,CAAC;GAAC;EAAA,CAAA,GAAA,OAAA,IAAA;EAAA8D,OAAAyG,QAElCJ,WAAW;EAAAjF,mBAAA;EAAA,OAAAmF;CAAA,EAAA,CAAA;AAIpB;AAE+Ca,eAAA,CAAA,OAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"RangeCalendar.js","names":["<Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState state={inheritedState as RangeCalendarState<DateValue>} {...props} />\n </Show>","when={inheritedState}","<RangeCalendarInner {...props} />","<RangeCalendarWithState state={inheritedState as RangeCalendarState<DateValue>} {...props} />","state={inheritedState as RangeCalendarState<DateValue>}","<RangeCalendarStateContext value={state()}>\n <RangeCalendarContext value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>","<RangeCalendarContext value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>","ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}","<VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>","{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}","<h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>","<div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>","{props.children}","<VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>","disabled={Boolean(calendarAria.nextButtonProps.disabled)}","<button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />","<RangeCalendarStateContext value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>","value={state as unknown as RangeCalendarState<DateValue>}","<RangeCalendarContext value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>","<div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>","<VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>","<button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />","{state.title()}","style={props.style}","<h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>","<button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>","<RangeCalendarGridMonthContext value={startDate}>\n <table\n ref={setGridRef}\n {...coerceDomRecord(gridAria.gridProps as Record<string, unknown>)}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...coerceDomRecord(gridAria.headerProps as Record<string, unknown>)}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext>","value={startDate}","ref={setGridRef}","<For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>","style={props.headerCellStyle}","<For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>","keyed={false}","<For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>","<Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>","<td />","<RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>","value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}","<table\n ref={setGridRef}\n {...coerceDomRecord(gridAria.gridProps as Record<string, unknown>)}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...coerceDomRecord(gridAria.headerProps as Record<string, unknown>)}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>","ref={setCellRef}","{getChildren()}","<td\n {...coerceDomRecord(cellAria.cellProps as Record<string, unknown>)}\n class={cellRenderProps.class()}\n style={cellRenderProps.style()}\n >\n <div\n ref={setCellRef}\n {...mergeProps(cellAria.buttonProps, hoverProps)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-focus-visible={dataAttr(cellAria.isFocusVisible)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>"],"sources":["../src/RangeCalendar.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/Calendar.tsx\n\n/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Solid adaptation of the pinned RangeCalendar implementation.\n */\n\nimport { createContext, createMemo, createSignal, useContext, For, Show } from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n mergeProps,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n coerceDomRecord,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\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) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell should display a keyboard focus ring. */\n isFocusVisible: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // When rendered inside a composite that owns the range state (e.g.\n // DateRangePicker provides `RangeCalendarContext`), reuse that shared state\n // instead of minting a fresh one — otherwise the composite's focus/anchor\n // flags (e.g. the popover-open `setFocused(true)`) drive a different state\n // instance than the one this grid renders. Mirrors the single `Calendar`.\n const inheritedState = useContext(RangeCalendarContext);\n\n return (\n <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState state={inheritedState as RangeCalendarState<DateValue>} {...props} />\n </Show>\n );\n}\n\n/**\n * RangeCalendar variant that renders against an externally-owned state (from\n * `RangeCalendarContext`) rather than creating its own. Mirrors the single\n * `CalendarWithState`.\n */\nfunction RangeCalendarWithState<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T> & { state: RangeCalendarState<DateValue> },\n): JSX.Element {\n const [local, , rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n const [calendarEl, setCalendarEl] = createSignal<HTMLDivElement | null>(null);\n\n const calendarAria = createRangeCalendar(rest, state(), calendarEl);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n isDragging: state().isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext value={state()}>\n <RangeCalendarContext value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n const [calendarEl, setCalendarEl] = createSignal<HTMLDivElement | null>(null);\n\n const calendarAria = createRangeCalendar(\n rest,\n state as unknown as RangeCalendarState<DateValue>,\n calendarEl,\n );\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext value={startDate}>\n <table\n ref={setGridRef}\n {...coerceDomRecord(gridAria.gridProps as Record<string, unknown>)}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...coerceDomRecord(gridAria.headerProps as Record<string, unknown>)}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isFocusVisible: cellAria.isFocusVisible,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility.\n // `renderChildrenStable` keeps the inner fill node across isFocusVisible flips\n // so Chromium interpolates selected-default → isFocusVisible (D2 open-enter).\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildrenStable();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td\n {...coerceDomRecord(cellAria.cellProps as Record<string, unknown>)}\n class={cellRenderProps.class()}\n style={cellRenderProps.style()}\n >\n <div\n ref={setCellRef}\n {...mergeProps(cellAria.buttonProps, hoverProps)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-focus-visible={dataAttr(cellAria.isFocusVisible)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAAS,YAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAuGA,MAAa,uBAAuB,cAAoD,IAAI;AAC5F,MAAa,4BAA4B,cAAoD,IAAI;AACjG,MAAM,gCAAgC,cAA6C,IAAI;AACvF,MAAM,uCAAuC,cAIlC,IAAI;AAEf,SAAgB,0BAAyD;CACvE,MAAM,UAAU,WAAW,oBAAoB;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,8DAA8D;CAEhF,OAAO;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,cACd,OACa;CAMb,MAAM,iBAAiB,WAAW,oBAAoB;CAEtD,OACEA,gBAAAA,MAAAA;EAAMC,MAAM;EAAgB,IAAA,WAAA;GAAUC,OAAAA,gBAAAA,oBAAwB,KAAQ;EAAC;EAAvE,IAAA,WAAA;GACEC,OAAAA,gBAAAA,wBAAAA,WAAAA,EAAwBC,OAAO,eAA6D,GAAR,KAAQ,CAAA;EACxF;;AAEV;;;;;;AAOA,SAAS,uBAC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zD,IAAA,uBAAA;GAAoB,OAAA,SAAS,SAAS,cAAc;EAAC;EACrD,IAAA,iBAAA;GAAc,OAAA,SAAS,SAAS,SAAS;EAAC;EAC1C,IAAA,uBAAA;GAAoB,OAAA,SAAS,SAAS,cAAc;EAAC;EACrD,IAAA,kBAAA;GAAe,OAAA,SAAS,SAAS,UAAU;EAAC;EAC5C,IAAA,qBAAA;GAAkB,OAAA,SAAS,SAAS,aAAa;EAAC;EAClD,IAAA,iBAAA;GAAc,OAAA,SAAS,SAAS,SAAS;EAAC;EAC1C,IAAA,uBAAA;GAAoB,OAAA,SAAS,SAAS,cAAc;EAAC;EACrD,IAAA,eAAA;GAAY,OAAA,SAAS,SAAS,OAAO;EAAC;EACtC,IAAA,iBAAA;GAAc,OAAA,SAAS,SAAS,SAAS;EAAC;EAC1C,IAAA,iBAAA;GAAc,OAAA,SAAS,UAAU,CAAC;EAAC;;CAhBrC,OAAA,QAkBEC,YAAAA;EAAC,OAAA,YAAa;CACX,CAAA,CAAA;CAxBP,mBAyBI;CA1BN,OACEC;AA2BJ"}
|
package/dist/RangeCalendar.jsx
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
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/Calendar.tsx
|
|
13
|
+
import { coerceDomRecord, dataAttr, useRenderProps } from "./utils.jsx";
|
|
2
14
|
import { VisuallyHidden } from "./VisuallyHidden.jsx";
|
|
3
|
-
import { For,
|
|
4
|
-
import { createCalendarGrid, createHover, createRangeCalendar, createRangeCalendarCell } from "@proyecto-viviana/solidaria";
|
|
15
|
+
import { For, Show, createContext, createMemo, createSignal, useContext } from "solid-js";
|
|
16
|
+
import { createCalendarGrid, createHover, createRangeCalendar, createRangeCalendarCell, mergeProps } from "@proyecto-viviana/solidaria";
|
|
17
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
5
18
|
import { createRangeCalendarState, endOfMonth, isSameMonth } from "@proyecto-viviana/solid-stately";
|
|
6
19
|
//#region src/RangeCalendar.tsx
|
|
7
20
|
/**
|
|
8
21
|
* RangeCalendar component for solidaria-components
|
|
9
22
|
*
|
|
10
23
|
* Pre-wired headless range calendar component that combines aria hooks.
|
|
11
|
-
*
|
|
24
|
+
* Solid adaptation of the pinned RangeCalendar implementation.
|
|
12
25
|
*/
|
|
13
|
-
function assignRef(ref, el) {
|
|
26
|
+
function assignRef$1(ref, el) {
|
|
14
27
|
if (!ref) return;
|
|
15
28
|
if (typeof ref === "function") ref(el);
|
|
16
29
|
else ref.current = el;
|
|
@@ -43,11 +56,8 @@ function useRangeCalendarContext() {
|
|
|
43
56
|
*/
|
|
44
57
|
function RangeCalendar(props) {
|
|
45
58
|
const inheritedState = useContext(RangeCalendarContext);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>
|
|
49
|
-
<RangeCalendarWithState state={inheritedState} {...props} />
|
|
50
|
-
</Show>
|
|
59
|
+
return <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>
|
|
60
|
+
<RangeCalendarWithState state={inheritedState} {...props} />
|
|
51
61
|
</Show>;
|
|
52
62
|
}
|
|
53
63
|
/**
|
|
@@ -86,7 +96,8 @@ function RangeCalendarWithState(props) {
|
|
|
86
96
|
"firstDayOfWeek"
|
|
87
97
|
]);
|
|
88
98
|
const state = () => props.state;
|
|
89
|
-
const
|
|
99
|
+
const [calendarEl, setCalendarEl] = createSignal(null);
|
|
100
|
+
const calendarAria = createRangeCalendar(rest, state(), calendarEl);
|
|
90
101
|
const renderValues = createMemo(() => ({
|
|
91
102
|
isDisabled: state().isDisabled(),
|
|
92
103
|
isReadOnly: state().isReadOnly(),
|
|
@@ -98,20 +109,23 @@ function RangeCalendarWithState(props) {
|
|
|
98
109
|
style: local.style,
|
|
99
110
|
defaultClassName: "solidaria-RangeCalendar"
|
|
100
111
|
}, renderValues);
|
|
101
|
-
return <RangeCalendarStateContext
|
|
102
|
-
<RangeCalendarContext
|
|
103
|
-
<div {...calendarAria.calendarProps} ref={(el) =>
|
|
112
|
+
return <RangeCalendarStateContext value={state()}>
|
|
113
|
+
<RangeCalendarContext value={state()}>
|
|
114
|
+
<div {...calendarAria.calendarProps} ref={(el) => {
|
|
115
|
+
setCalendarEl(el ?? null);
|
|
116
|
+
assignRef$1(local.ref, el);
|
|
117
|
+
}} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state().isDisabled())} data-readonly={dataAttr(state().isReadOnly())} data-invalid={dataAttr(state().isValueInvalid())} data-dragging={dataAttr(state().isDragging())}>
|
|
104
118
|
<VisuallyHidden>
|
|
105
119
|
<h2>{String(calendarAria.calendarProps["aria-label"] ?? "")}</h2>
|
|
106
120
|
</VisuallyHidden>
|
|
107
121
|
{props.children}
|
|
108
122
|
{}
|
|
109
123
|
<VisuallyHidden>
|
|
110
|
-
<button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state().focusNextPage()}
|
|
124
|
+
<button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state().focusNextPage()} tabindex={-1} />
|
|
111
125
|
</VisuallyHidden>
|
|
112
126
|
</div>
|
|
113
|
-
</RangeCalendarContext
|
|
114
|
-
</RangeCalendarStateContext
|
|
127
|
+
</RangeCalendarContext>
|
|
128
|
+
</RangeCalendarStateContext>;
|
|
115
129
|
}
|
|
116
130
|
/**
|
|
117
131
|
* Internal RangeCalendar component that renders after client mount.
|
|
@@ -146,7 +160,8 @@ function RangeCalendarInner(props) {
|
|
|
146
160
|
"firstDayOfWeek"
|
|
147
161
|
]);
|
|
148
162
|
const state = createRangeCalendarState(stateProps);
|
|
149
|
-
const
|
|
163
|
+
const [calendarEl, setCalendarEl] = createSignal(null);
|
|
164
|
+
const calendarAria = createRangeCalendar(rest, state, calendarEl);
|
|
150
165
|
const renderValues = createMemo(() => ({
|
|
151
166
|
isDisabled: state.isDisabled(),
|
|
152
167
|
isReadOnly: state.isReadOnly(),
|
|
@@ -158,20 +173,23 @@ function RangeCalendarInner(props) {
|
|
|
158
173
|
style: local.style,
|
|
159
174
|
defaultClassName: "solidaria-RangeCalendar"
|
|
160
175
|
}, renderValues);
|
|
161
|
-
return <RangeCalendarStateContext
|
|
162
|
-
<RangeCalendarContext
|
|
163
|
-
<div {...calendarAria.calendarProps} ref={(el) =>
|
|
176
|
+
return <RangeCalendarStateContext value={state}>
|
|
177
|
+
<RangeCalendarContext value={state}>
|
|
178
|
+
<div {...calendarAria.calendarProps} ref={(el) => {
|
|
179
|
+
setCalendarEl(el ?? null);
|
|
180
|
+
assignRef$1(local.ref, el);
|
|
181
|
+
}} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled())} data-readonly={dataAttr(state.isReadOnly())} data-invalid={dataAttr(state.isValueInvalid())} data-dragging={dataAttr(state.isDragging())}>
|
|
164
182
|
<VisuallyHidden>
|
|
165
183
|
<h2>{String(calendarAria.calendarProps["aria-label"] ?? "")}</h2>
|
|
166
184
|
</VisuallyHidden>
|
|
167
185
|
{props.children}
|
|
168
186
|
{}
|
|
169
187
|
<VisuallyHidden>
|
|
170
|
-
<button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state.focusNextPage()}
|
|
188
|
+
<button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state.focusNextPage()} tabindex={-1} />
|
|
171
189
|
</VisuallyHidden>
|
|
172
190
|
</div>
|
|
173
|
-
</RangeCalendarContext
|
|
174
|
-
</RangeCalendarStateContext
|
|
191
|
+
</RangeCalendarContext>
|
|
192
|
+
</RangeCalendarStateContext>;
|
|
175
193
|
}
|
|
176
194
|
/**
|
|
177
195
|
* Displays the current month and year in the range calendar.
|
|
@@ -226,9 +244,9 @@ function RangeCalendarGrid(props) {
|
|
|
226
244
|
for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) weekDates.push(state.getDatesInWeek(weekIndex, monthStart));
|
|
227
245
|
return weekDates;
|
|
228
246
|
});
|
|
229
|
-
return <RangeCalendarGridMonthContext
|
|
230
|
-
<table ref={setGridRef} {...gridAria.gridProps} class={renderProps.class()} style={renderProps.style()}>
|
|
231
|
-
<thead {...gridAria.headerProps}>
|
|
247
|
+
return <RangeCalendarGridMonthContext value={startDate}>
|
|
248
|
+
<table ref={setGridRef} {...coerceDomRecord(gridAria.gridProps)} class={renderProps.class()} style={renderProps.style()}>
|
|
249
|
+
<thead {...coerceDomRecord(gridAria.headerProps)}>
|
|
232
250
|
<tr>
|
|
233
251
|
<For each={gridAria.weekDays}>
|
|
234
252
|
{(day) => <th scope="col" class={props.headerCellClass ?? "solidaria-RangeCalendarHeaderCell"} style={props.headerCellStyle}>
|
|
@@ -238,24 +256,24 @@ function RangeCalendarGrid(props) {
|
|
|
238
256
|
</tr>
|
|
239
257
|
</thead>
|
|
240
258
|
<tbody>
|
|
241
|
-
<
|
|
259
|
+
<For each={allDates()} keyed={false}>
|
|
242
260
|
{(weekDates, weekIndex) => <tr>
|
|
243
|
-
<
|
|
261
|
+
<For each={weekDates()} keyed={false}>
|
|
244
262
|
{(date, dayIndex) => <Show when={date()} fallback={<td />}>
|
|
245
|
-
<RangeCalendarGridCellPositionContext
|
|
263
|
+
<RangeCalendarGridCellPositionContext value={() => ({
|
|
246
264
|
weekIndex,
|
|
247
265
|
dayIndex,
|
|
248
266
|
lastWeekIndex: allDates().length - 1
|
|
249
267
|
})}>
|
|
250
268
|
{props.children?.(date())}
|
|
251
|
-
</RangeCalendarGridCellPositionContext
|
|
269
|
+
</RangeCalendarGridCellPositionContext>
|
|
252
270
|
</Show>}
|
|
253
|
-
</
|
|
271
|
+
</For>
|
|
254
272
|
</tr>}
|
|
255
|
-
</
|
|
273
|
+
</For>
|
|
256
274
|
</tbody>
|
|
257
275
|
</table>
|
|
258
|
-
</RangeCalendarGridMonthContext
|
|
276
|
+
</RangeCalendarGridMonthContext>;
|
|
259
277
|
}
|
|
260
278
|
/**
|
|
261
279
|
* A cell in the range calendar grid representing a single day.
|
|
@@ -281,6 +299,7 @@ function RangeCalendarCell(props) {
|
|
|
281
299
|
isSelectionStart: cellAria.isSelectionStart,
|
|
282
300
|
isSelectionEnd: cellAria.isSelectionEnd,
|
|
283
301
|
isFocused: cellAria.isFocused,
|
|
302
|
+
isFocusVisible: cellAria.isFocusVisible,
|
|
284
303
|
isDisabled: cellAria.isDisabled,
|
|
285
304
|
isUnavailable: cellAria.isUnavailable,
|
|
286
305
|
isInvalid: cellAria.isInvalid,
|
|
@@ -308,11 +327,11 @@ function RangeCalendarCell(props) {
|
|
|
308
327
|
defaultClassName: "solidaria-RangeCalendarCellWrapper"
|
|
309
328
|
}, renderValues);
|
|
310
329
|
const getChildren = () => {
|
|
311
|
-
if (typeof props.children === "function") return renderProps.
|
|
330
|
+
if (typeof props.children === "function") return renderProps.renderChildrenStable();
|
|
312
331
|
return cellAria.formattedDate;
|
|
313
332
|
};
|
|
314
|
-
return <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>
|
|
315
|
-
<div ref={setCellRef} {...cellAria.buttonProps
|
|
333
|
+
return <td {...coerceDomRecord(cellAria.cellProps)} class={cellRenderProps.class()} style={cellRenderProps.style()}>
|
|
334
|
+
<div ref={setCellRef} {...mergeProps(cellAria.buttonProps, hoverProps)} class={renderProps.class()} style={renderProps.style()} data-selected={dataAttr(cellAria.isSelected)} data-selection-start={dataAttr(cellAria.isSelectionStart)} data-selection-end={dataAttr(cellAria.isSelectionEnd)} data-focused={dataAttr(cellAria.isFocused)} data-focus-visible={dataAttr(cellAria.isFocusVisible)} data-disabled={dataAttr(cellAria.isDisabled)} data-unavailable={dataAttr(cellAria.isUnavailable)} data-invalid={dataAttr(cellAria.isInvalid)} data-outside-month={dataAttr(cellAria.isOutsideMonth)} data-today={dataAttr(cellAria.isToday)} data-pressed={dataAttr(cellAria.isPressed)} data-hovered={dataAttr(isHovered())}>
|
|
316
335
|
{getChildren()}
|
|
317
336
|
</div>
|
|
318
337
|
</td>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeCalendar.jsx","names":[],"sources":["../src/RangeCalendar.tsx"],"sourcesContent":["/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Port of react-aria-components/src/RangeCalendar.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Index,\n Show,\n} from \"solid-js\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // When rendered inside a composite that owns the range state (e.g.\n // DateRangePicker provides `RangeCalendarContext`), reuse that shared state\n // instead of minting a fresh one — otherwise the composite's focus/anchor\n // flags (e.g. the popover-open `setFocused(true)`) drive a different state\n // instance than the one this grid renders. Mirrors the single `Calendar`.\n const inheritedState = useContext(RangeCalendarContext);\n\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div\n class=\"solidaria-RangeCalendar solidaria-RangeCalendar--placeholder\"\n aria-hidden=\"true\"\n />\n }\n >\n <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState\n state={inheritedState as RangeCalendarState<DateValue>}\n {...props}\n />\n </Show>\n </Show>\n );\n}\n\n/**\n * RangeCalendar variant that renders against an externally-owned state (from\n * `RangeCalendarContext`) rather than creating its own. Mirrors the single\n * `CalendarWithState`.\n */\nfunction RangeCalendarWithState<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T> & { state: RangeCalendarState<DateValue> },\n): JSX.Element {\n const [local, , rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n\n const calendarAria = createRangeCalendar(rest, state());\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n isDragging: state().isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state()}>\n <RangeCalendarContext.Provider value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n\n const calendarAria = createRangeCalendar(rest, state as unknown as RangeCalendarState<DateValue>);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext.Provider value={startDate}>\n <table\n ref={setGridRef}\n {...gridAria.gridProps}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...gridAria.headerProps}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates, weekIndex) => (\n <tr>\n <Index each={weekDates()}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext.Provider>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n"],"mappings":";;;;;;;;;;;;AAkDA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAqGA,MAAa,uBAAuB,cAAoD,IAAI;AAC5F,MAAa,4BAA4B,cAAoD,IAAI;AACjG,MAAM,gCAAgC,cAA6C,IAAI;AACvF,MAAM,uCAAuC,cAIlC,IAAI;AAEf,SAAgB,0BAAyD;CACvE,MAAM,UAAU,WAAW,oBAAoB;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,8DAA8D;CAEhF,OAAO;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,cACd,OACa;CAMb,MAAM,iBAAiB,WAAW,oBAAoB;CAGtD,MAAM,aAAa,cAAc;CAEjC,OACE,CAAC,KACC,MAAM,WAAW,GACjB,UACE,CAAC,IACC,qEACA,uBAGL;MACC,CAAC,KAAK,MAAM,gBAAgB,UAAU,CAAC,uBAAuB,WAAW;QACvE,CAAC,u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,SAAS;CAClB;CAEA,OACE,CAAC,OAAO,SAAS,WAAW,OAAO,gBAAgB,MAAM,GAAG,OAAO,gBAAgB,MAAM,GAAG;MAC1F,CAAC,IACC,KAAK,gBACD,SAAS,iBACT,YACJ,OAAO,YAAY,MAAM,GACzB,OAAO,YAAY,MAAM,GACzB,eAAe,SAAS,SAAS,UAAU,GAC3C,sBAAsB,SAAS,SAAS,gBAAgB,GACxD,oBAAoB,SAAS,SAAS,cAAc,GACpD,cAAc,SAAS,SAAS,SAAS,GACzC,eAAe,SAAS,SAAS,UAAU,GAC3C,kBAAkB,SAAS,SAAS,aAAa,GACjD,cAAc,SAAS,SAAS,SAAS,GACzC,oBAAoB,SAAS,SAAS,cAAc,GACpD,YAAY,SAAS,SAAS,OAAO,GACrC,cAAc,SAAS,SAAS,SAAS,GACzC,cAAc,SAAS,UAAU,CAAC,GACnC;SACE,YAAY,EAAE;MACjB,EAAE,IAAI;IACR,EAAE;AAEN"}
|
|
1
|
+
{"version":3,"file":"RangeCalendar.jsx","names":["assignRef"],"sources":["../src/RangeCalendar.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/Calendar.tsx\n\n/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Solid adaptation of the pinned RangeCalendar implementation.\n */\n\nimport { createContext, createMemo, createSignal, useContext, For, Show } from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n mergeProps,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n coerceDomRecord,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\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) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell should display a keyboard focus ring. */\n isFocusVisible: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // When rendered inside a composite that owns the range state (e.g.\n // DateRangePicker provides `RangeCalendarContext`), reuse that shared state\n // instead of minting a fresh one — otherwise the composite's focus/anchor\n // flags (e.g. the popover-open `setFocused(true)`) drive a different state\n // instance than the one this grid renders. Mirrors the single `Calendar`.\n const inheritedState = useContext(RangeCalendarContext);\n\n return (\n <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState state={inheritedState as RangeCalendarState<DateValue>} {...props} />\n </Show>\n );\n}\n\n/**\n * RangeCalendar variant that renders against an externally-owned state (from\n * `RangeCalendarContext`) rather than creating its own. Mirrors the single\n * `CalendarWithState`.\n */\nfunction RangeCalendarWithState<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T> & { state: RangeCalendarState<DateValue> },\n): JSX.Element {\n const [local, , rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n const [calendarEl, setCalendarEl] = createSignal<HTMLDivElement | null>(null);\n\n const calendarAria = createRangeCalendar(rest, state(), calendarEl);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n isDragging: state().isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext value={state()}>\n <RangeCalendarContext value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n const [calendarEl, setCalendarEl] = createSignal<HTMLDivElement | null>(null);\n\n const calendarAria = createRangeCalendar(\n rest,\n state as unknown as RangeCalendarState<DateValue>,\n calendarEl,\n );\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext value={startDate}>\n <table\n ref={setGridRef}\n {...coerceDomRecord(gridAria.gridProps as Record<string, unknown>)}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...coerceDomRecord(gridAria.headerProps as Record<string, unknown>)}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isFocusVisible: cellAria.isFocusVisible,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility.\n // `renderChildrenStable` keeps the inner fill node across isFocusVisible flips\n // so Chromium interpolates selected-default → isFocusVisible (D2 open-enter).\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildrenStable();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td\n {...coerceDomRecord(cellAria.cellProps as Record<string, unknown>)}\n class={cellRenderProps.class()}\n style={cellRenderProps.style()}\n >\n <div\n ref={setCellRef}\n {...mergeProps(cellAria.buttonProps, hoverProps)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-focus-visible={dataAttr(cellAria.isFocusVisible)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeVal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AAc,GACpD,YAAY,SAAS,SAAS,OAAO,GACrC,cAAc,SAAS,SAAS,SAAS,GACzC,cAAc,SAAS,UAAU,CAAC,GACnC;SACE,YAAY,EAAE;MACjB,EAAE,IAAI;IACR,EAAE;AAEN"}
|
package/dist/RouterProvider.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* A context provider for client-side router integration.
|
|
5
|
-
* SolidJS apps typically use TanStack Router or SolidRouter directly;
|
|
6
|
-
* this provides API compatibility with React Aria's RouterProvider.
|
|
7
|
-
*/
|
|
8
|
-
import { type JSX } from "solid-js";
|
|
1
|
+
import { openLink } from "@proyecto-viviana/solidaria/utils";
|
|
2
|
+
import type { JSX } from "@solidjs/web";
|
|
9
3
|
export interface RouterClickModifiers {
|
|
10
4
|
metaKey?: boolean;
|
|
11
5
|
ctrlKey?: boolean;
|
|
@@ -46,7 +40,7 @@ export interface LinkDOMProps {
|
|
|
46
40
|
referrerPolicy?: "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
|
|
47
41
|
}
|
|
48
42
|
export declare function shouldClientNavigate(link: HTMLAnchorElement, modifiers: RouterClickModifiers): boolean;
|
|
49
|
-
export
|
|
43
|
+
export { openLink };
|
|
50
44
|
export declare function useLinkProps(props?: LinkDOMProps): LinkDOMProps;
|
|
51
45
|
export declare function handleLinkClick(event: MouseEvent, router: RouterContextValue, href: string | undefined, routerOptions?: RouterOptions): void;
|
|
52
46
|
/**
|