@proyecto-viviana/solidaria-components 0.5.0 → 0.7.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE-2.0 +201 -0
- package/NOTICE +91 -0
- package/README.md +4 -7
- package/dist/ActionBar.d.ts +2 -10
- package/dist/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar.js +95 -59
- package/dist/ActionBar.js.map +1 -1
- package/dist/ActionBar.jsx +42 -15
- package/dist/ActionBar.jsx.map +1 -1
- package/dist/ActionGroup.d.ts +1 -12
- package/dist/ActionGroup.d.ts.map +1 -1
- package/dist/ActionGroup.js +66 -44
- package/dist/ActionGroup.js.map +1 -1
- package/dist/ActionGroup.jsx +25 -10
- package/dist/ActionGroup.jsx.map +1 -1
- package/dist/Alert.d.ts +4 -1
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Alert.js +25 -17
- package/dist/Alert.js.map +1 -1
- package/dist/Alert.jsx +9 -5
- package/dist/Alert.jsx.map +1 -1
- package/dist/Autocomplete.d.ts +2 -9
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Autocomplete.js +18 -5
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Autocomplete.jsx +20 -7
- package/dist/Autocomplete.jsx.map +1 -1
- package/dist/Breadcrumbs.d.ts +2 -7
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +71 -51
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Breadcrumbs.jsx +25 -12
- package/dist/Breadcrumbs.jsx.map +1 -1
- package/dist/Button.d.ts +1 -7
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +125 -72
- package/dist/Button.js.map +1 -1
- package/dist/Button.jsx +105 -43
- package/dist/Button.jsx.map +1 -1
- package/dist/Calendar.d.ts +1 -7
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +297 -221
- package/dist/Calendar.js.map +1 -1
- package/dist/Calendar.jsx +52 -32
- package/dist/Calendar.jsx.map +1 -1
- package/dist/CalendarPicker.d.ts +1 -10
- package/dist/CalendarPicker.d.ts.map +1 -1
- package/dist/CalendarPicker.js +12 -0
- package/dist/CalendarPicker.js.map +1 -1
- package/dist/CalendarPicker.jsx +12 -0
- package/dist/CalendarPicker.jsx.map +1 -1
- package/dist/Checkbox.d.ts +2 -7
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +332 -270
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.jsx +70 -77
- package/dist/Checkbox.jsx.map +1 -1
- package/dist/Collection.d.ts +33 -7
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +128 -74
- package/dist/Collection.js.map +1 -1
- package/dist/Collection.jsx +46 -7
- package/dist/Collection.jsx.map +1 -1
- package/dist/Color.d.ts +15 -20
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +572 -334
- package/dist/Color.js.map +1 -1
- package/dist/Color.jsx +205 -85
- package/dist/Color.jsx.map +1 -1
- package/dist/ColorEditor.d.ts +3 -1
- package/dist/ColorEditor.d.ts.map +1 -1
- package/dist/ColorEditor.js +147 -124
- package/dist/ColorEditor.js.map +1 -1
- package/dist/ColorEditor.jsx +4 -1
- package/dist/ColorEditor.jsx.map +1 -1
- package/dist/ComboBox.d.ts +31 -10
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +539 -274
- package/dist/ComboBox.js.map +1 -1
- package/dist/ComboBox.jsx +213 -70
- package/dist/ComboBox.jsx.map +1 -1
- package/dist/ContextualHelpTrigger.d.ts +1 -7
- package/dist/ContextualHelpTrigger.d.ts.map +1 -1
- package/dist/ContextualHelpTrigger.js +102 -72
- package/dist/ContextualHelpTrigger.js.map +1 -1
- package/dist/ContextualHelpTrigger.jsx +36 -16
- package/dist/ContextualHelpTrigger.jsx.map +1 -1
- package/dist/DateField.d.ts +2 -7
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +0 -2
- package/dist/DateField.jsx +0 -2
- package/dist/DateField2.js +194 -179
- package/dist/DateField2.js.map +1 -1
- package/dist/DateField2.jsx +58 -55
- package/dist/DateField2.jsx.map +1 -1
- package/dist/DatePicker.d.ts +7 -7
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +2 -2
- package/dist/DatePicker.jsx +2 -2
- package/dist/DatePicker2.js +357 -435
- package/dist/DatePicker2.js.map +1 -1
- package/dist/DatePicker2.jsx +109 -178
- package/dist/DatePicker2.jsx.map +1 -1
- package/dist/DateRangePickerContext.d.ts +7 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -1
- package/dist/Dialog.d.ts +4 -9
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +168 -101
- package/dist/Dialog.js.map +1 -1
- package/dist/Dialog.jsx +75 -27
- package/dist/Dialog.jsx.map +1 -1
- package/dist/Disclosure.d.ts +1 -9
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +121 -79
- package/dist/Disclosure.js.map +1 -1
- package/dist/Disclosure.jsx +32 -19
- package/dist/Disclosure.jsx.map +1 -1
- package/dist/DragAndDrop.d.ts +9 -6
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragAndDrop.js +37 -22
- package/dist/DragAndDrop.js.map +1 -1
- package/dist/DragAndDrop.jsx +20 -4
- package/dist/DragAndDrop.jsx.map +1 -1
- package/dist/DragPreview.d.ts +1 -1
- package/dist/DragPreview.d.ts.map +1 -1
- package/dist/DropZone.d.ts +1 -7
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/DropZone.js +74 -40
- package/dist/DropZone.js.map +1 -1
- package/dist/DropZone.jsx +24 -8
- package/dist/DropZone.jsx.map +1 -1
- package/dist/ElementTag.d.ts +9 -20
- package/dist/ElementTag.d.ts.map +1 -1
- package/dist/ElementTag.js +8 -210
- package/dist/ElementTag.js.map +1 -1
- package/dist/ElementTag.jsx +8 -57
- package/dist/ElementTag.jsx.map +1 -1
- package/dist/FieldError.d.ts +8 -7
- package/dist/FieldError.d.ts.map +1 -1
- package/dist/FieldError.js +33 -13
- package/dist/FieldError.js.map +1 -1
- package/dist/FieldError.jsx +20 -5
- package/dist/FieldError.jsx.map +1 -1
- package/dist/FileTrigger.d.ts +1 -7
- package/dist/FileTrigger.d.ts.map +1 -1
- package/dist/FileTrigger.js +30 -12
- package/dist/FileTrigger.js.map +1 -1
- package/dist/FileTrigger.jsx +15 -2
- package/dist/FileTrigger.jsx.map +1 -1
- package/dist/Focusable.d.ts +2 -8
- package/dist/Focusable.d.ts.map +1 -1
- package/dist/Focusable.js +23 -6
- package/dist/Focusable.js.map +1 -1
- package/dist/Focusable.jsx +22 -5
- package/dist/Focusable.jsx.map +1 -1
- package/dist/Form.d.ts +9 -8
- package/dist/Form.d.ts.map +1 -1
- package/dist/Form.js +66 -43
- package/dist/Form.js.map +1 -1
- package/dist/Form.jsx +36 -16
- package/dist/Form.jsx.map +1 -1
- package/dist/GridList.d.ts +5 -10
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +372 -243
- package/dist/GridList.js.map +1 -1
- package/dist/GridList.jsx +177 -99
- package/dist/GridList.jsx.map +1 -1
- package/dist/HiddenDateInput.d.ts +1 -7
- package/dist/HiddenDateInput.d.ts.map +1 -1
- package/dist/Icon.d.ts +4 -1
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +41 -37
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.jsx +7 -3
- package/dist/Icon.jsx.map +1 -1
- package/dist/Keyboard.d.ts +1 -7
- package/dist/Keyboard.d.ts.map +1 -1
- package/dist/Keyboard.js +24 -11
- package/dist/Keyboard.js.map +1 -1
- package/dist/Keyboard.jsx +15 -2
- package/dist/Keyboard.jsx.map +1 -1
- package/dist/Label.d.ts +20 -0
- package/dist/Label.d.ts.map +1 -0
- package/dist/Label.js +60 -0
- package/dist/Label.js.map +1 -0
- package/dist/Label.jsx +47 -0
- package/dist/Label.jsx.map +1 -0
- package/dist/Landmark.d.ts +4 -1
- package/dist/Landmark.d.ts.map +1 -1
- package/dist/Landmark.js +10 -4
- package/dist/Landmark.js.map +1 -1
- package/dist/Landmark.jsx +5 -1
- package/dist/Landmark.jsx.map +1 -1
- package/dist/Link.d.ts +2 -7
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +56 -36
- package/dist/Link.js.map +1 -1
- package/dist/Link.jsx +52 -10
- package/dist/Link.jsx.map +1 -1
- package/dist/ListBox.d.ts +17 -13
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +647 -348
- package/dist/ListBox.js.map +1 -1
- package/dist/ListBox.jsx +339 -236
- package/dist/ListBox.jsx.map +1 -1
- package/dist/ListDropTargetDelegate.d.ts +3 -0
- package/dist/ListDropTargetDelegate.d.ts.map +1 -1
- package/dist/Menu.d.ts +39 -30
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +547 -368
- package/dist/Menu.js.map +1 -1
- package/dist/Menu.jsx +328 -230
- package/dist/Menu.jsx.map +1 -1
- package/dist/Meter.d.ts +6 -13
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +55 -18
- package/dist/Meter.js.map +1 -1
- package/dist/Meter.jsx +33 -8
- package/dist/Meter.jsx.map +1 -1
- package/dist/Modal.d.ts +1 -7
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +104 -56
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.jsx +68 -38
- package/dist/Modal.jsx.map +1 -1
- package/dist/NumberField.d.ts +4 -7
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/NumberField.js +243 -124
- package/dist/NumberField.js.map +1 -1
- package/dist/NumberField.jsx +115 -26
- package/dist/NumberField.jsx.map +1 -1
- package/dist/Popover.d.ts +15 -7
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +370 -181
- package/dist/Popover.js.map +1 -1
- package/dist/Popover.jsx +215 -82
- package/dist/Popover.jsx.map +1 -1
- package/dist/Pressable.d.ts +2 -8
- package/dist/Pressable.d.ts.map +1 -1
- package/dist/Pressable.js +23 -6
- package/dist/Pressable.js.map +1 -1
- package/dist/Pressable.jsx +22 -5
- package/dist/Pressable.jsx.map +1 -1
- package/dist/PreviewTrigger.d.ts +24 -0
- package/dist/PreviewTrigger.d.ts.map +1 -0
- package/dist/PreviewTrigger.js +128 -0
- package/dist/PreviewTrigger.js.map +1 -0
- package/dist/PreviewTrigger.jsx +117 -0
- package/dist/PreviewTrigger.jsx.map +1 -0
- package/dist/ProgressBar.d.ts +1 -7
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar.js +34 -14
- package/dist/ProgressBar.js.map +1 -1
- package/dist/ProgressBar.jsx +17 -3
- package/dist/ProgressBar.jsx.map +1 -1
- package/dist/RadioGroup.d.ts +2 -7
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +388 -269
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.jsx +110 -99
- package/dist/RadioGroup.jsx.map +1 -1
- package/dist/RangeCalendar.d.ts +3 -7
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +271 -202
- package/dist/RangeCalendar.js.map +1 -1
- package/dist/RangeCalendar.jsx +56 -37
- package/dist/RangeCalendar.jsx.map +1 -1
- package/dist/RouterProvider.d.ts +3 -9
- package/dist/RouterProvider.d.ts.map +1 -1
- package/dist/RouterProvider.js +15 -14
- package/dist/RouterProvider.js.map +1 -1
- package/dist/RouterProvider.jsx +14 -13
- package/dist/RouterProvider.jsx.map +1 -1
- package/dist/SearchField.d.ts +4 -7
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +191 -164
- package/dist/SearchField.js.map +1 -1
- package/dist/SearchField.jsx +69 -62
- package/dist/SearchField.jsx.map +1 -1
- package/dist/Select.d.ts +5 -10
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +565 -359
- package/dist/Select.js.map +1 -1
- package/dist/Select.jsx +281 -161
- package/dist/Select.jsx.map +1 -1
- package/dist/SelectionIndicator.d.ts +1 -4
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/SelectionIndicator.js +29 -13
- package/dist/SelectionIndicator.js.map +1 -1
- package/dist/SelectionIndicator.jsx +18 -4
- package/dist/SelectionIndicator.jsx.map +1 -1
- package/dist/Separator.d.ts +1 -7
- package/dist/Separator.d.ts.map +1 -1
- package/dist/Separator.js +22 -6
- package/dist/Separator.js.map +1 -1
- package/dist/Separator.jsx +16 -3
- package/dist/Separator.jsx.map +1 -1
- package/dist/SharedElementTransition.d.ts +1 -10
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +68 -40
- package/dist/SharedElementTransition.js.map +1 -1
- package/dist/SharedElementTransition.jsx +49 -25
- package/dist/SharedElementTransition.jsx.map +1 -1
- package/dist/Slider.d.ts +2 -8
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +155 -97
- package/dist/Slider.js.map +1 -1
- package/dist/Slider.jsx +25 -12
- package/dist/Slider.jsx.map +1 -1
- package/dist/StepList.d.ts +1 -7
- package/dist/StepList.d.ts.map +1 -1
- package/dist/StepList.js +112 -68
- package/dist/StepList.js.map +1 -1
- package/dist/StepList.jsx +58 -20
- package/dist/StepList.jsx.map +1 -1
- package/dist/Switch.d.ts +2 -9
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +164 -114
- package/dist/Switch.js.map +1 -1
- package/dist/Switch.jsx +26 -13
- package/dist/Switch.jsx.map +1 -1
- package/dist/Table.d.ts +2 -1
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +689 -592
- package/dist/Table.js.map +1 -1
- package/dist/Table.jsx +317 -237
- package/dist/Table.jsx.map +1 -1
- package/dist/Tabs.d.ts +2 -7
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +278 -293
- package/dist/Tabs.js.map +1 -1
- package/dist/Tabs.jsx +68 -66
- package/dist/Tabs.jsx.map +1 -1
- package/dist/TagGroup.d.ts +4 -11
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +153 -115
- package/dist/TagGroup.js.map +1 -1
- package/dist/TagGroup.jsx +37 -24
- package/dist/TagGroup.jsx.map +1 -1
- package/dist/Text.d.ts +3 -3
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +24 -7
- package/dist/Text.js.map +1 -1
- package/dist/Text.jsx +17 -5
- package/dist/Text.jsx.map +1 -1
- package/dist/TextField.d.ts +3 -16
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +104 -129
- package/dist/TextField.js.map +1 -1
- package/dist/TextField.jsx +76 -102
- package/dist/TextField.jsx.map +1 -1
- package/dist/TimeField.d.ts +2 -15
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +86 -102
- package/dist/TimeField.js.map +1 -1
- package/dist/TimeField.jsx +32 -49
- package/dist/TimeField.jsx.map +1 -1
- package/dist/Toast.d.ts +10 -13
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toast.js +209 -108
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.jsx +127 -22
- package/dist/Toast.jsx.map +1 -1
- package/dist/ToggleButton.d.ts +1 -7
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton.js +57 -35
- package/dist/ToggleButton.js.map +1 -1
- package/dist/ToggleButton.jsx +26 -12
- package/dist/ToggleButton.jsx.map +1 -1
- package/dist/ToggleButtonGroup.d.ts +1 -7
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.js +59 -44
- package/dist/ToggleButtonGroup.js.map +1 -1
- package/dist/ToggleButtonGroup.jsx +25 -12
- package/dist/ToggleButtonGroup.jsx.map +1 -1
- package/dist/TokenField.d.ts +52 -0
- package/dist/TokenField.d.ts.map +1 -0
- package/dist/TokenField.js +301 -0
- package/dist/TokenField.js.map +1 -0
- package/dist/TokenField.jsx +197 -0
- package/dist/TokenField.jsx.map +1 -0
- package/dist/Toolbar.d.ts +2 -7
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar.js +35 -16
- package/dist/Toolbar.js.map +1 -1
- package/dist/Toolbar.jsx +15 -2
- package/dist/Toolbar.jsx.map +1 -1
- package/dist/Tooltip.d.ts +2 -7
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip.js +105 -68
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.jsx +60 -36
- package/dist/Tooltip.jsx.map +1 -1
- package/dist/Tree.d.ts +8 -11
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +486 -339
- package/dist/Tree.js.map +1 -1
- package/dist/Tree.jsx +155 -107
- package/dist/Tree.jsx.map +1 -1
- package/dist/Virtualizer.d.ts +39 -9
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/Virtualizer.js +2 -2
- package/dist/Virtualizer.jsx +2 -2
- package/dist/Virtualizer2.js +491 -136
- package/dist/Virtualizer2.js.map +1 -1
- package/dist/Virtualizer2.jsx +455 -122
- package/dist/Virtualizer2.jsx.map +1 -1
- package/dist/VirtualizerLayouts.d.ts +55 -2
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.d.ts +4 -3
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +18 -11
- package/dist/VisuallyHidden.js.map +1 -1
- package/dist/VisuallyHidden.jsx +15 -9
- package/dist/VisuallyHidden.jsx.map +1 -1
- package/dist/contexts.d.ts +25 -0
- package/dist/contexts.d.ts.map +1 -1
- package/dist/contexts.js +3 -0
- package/dist/contexts.js.map +1 -1
- package/dist/contexts.jsx +3 -0
- package/dist/contexts.jsx.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -11
- package/dist/index.jsx +14 -11
- package/dist/intl/index.d.ts +16 -0
- package/dist/intl/index.d.ts.map +1 -0
- package/dist/intl.js +212 -0
- package/dist/intl.js.map +1 -0
- package/dist/intl.jsx +212 -0
- package/dist/intl.jsx.map +1 -0
- package/dist/useDragAndDrop.d.ts +4 -2
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/useDragAndDrop2.js +39 -21
- package/dist/useDragAndDrop2.js.map +1 -1
- package/dist/useDragAndDrop2.jsx +39 -21
- package/dist/useDragAndDrop2.jsx.map +1 -1
- package/dist/utils.d.ts +28 -9
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +96 -24
- package/dist/utils.js.map +1 -1
- package/dist/utils.jsx +81 -24
- package/dist/utils.jsx.map +1 -1
- package/dist/virtualizer/Layout.d.ts +9 -0
- package/dist/virtualizer/Layout.d.ts.map +1 -1
- package/dist/virtualizer/Layout.js +23 -2
- package/dist/virtualizer/Layout.js.map +1 -1
- package/dist/virtualizer/Layout.jsx +23 -2
- package/dist/virtualizer/Layout.jsx.map +1 -1
- package/package.json +29 -10
- package/src/ActionBar.tsx +50 -24
- package/src/ActionGroup.tsx +31 -19
- package/src/Alert.tsx +10 -4
- package/src/Autocomplete.tsx +24 -15
- package/src/Breadcrumbs.tsx +32 -16
- package/src/Button.tsx +182 -67
- package/src/Calendar.tsx +65 -47
- package/src/CalendarPicker.tsx +16 -1
- package/src/Checkbox.tsx +84 -116
- package/src/Collection.tsx +84 -3
- package/src/Color.tsx +282 -104
- package/src/ColorEditor.tsx +5 -1
- package/src/ComboBox.tsx +384 -109
- package/src/ContextualHelpTrigger.tsx +47 -41
- package/src/DateField.tsx +74 -106
- package/src/DatePicker.tsx +156 -352
- package/src/DateRangePickerContext.tsx +8 -0
- package/src/Dialog.tsx +105 -38
- package/src/Disclosure.tsx +29 -19
- package/src/DragAndDrop.tsx +43 -8
- package/src/DragPreview.tsx +20 -1
- package/src/DropZone.tsx +32 -18
- package/src/ElementTag.tsx +14 -104
- package/src/FieldError.tsx +39 -7
- package/src/FileTrigger.tsx +18 -3
- package/src/Focusable.tsx +27 -6
- package/src/Form.tsx +57 -11
- package/src/GridList.tsx +233 -141
- package/src/HiddenDateInput.tsx +19 -3
- package/src/Icon.tsx +8 -2
- package/src/Keyboard.tsx +18 -2
- package/src/Label.tsx +77 -0
- package/src/Landmark.tsx +6 -1
- package/src/Link.tsx +65 -19
- package/src/ListBox.tsx +645 -468
- package/src/ListDropTargetDelegate.ts +4 -0
- package/src/Menu.tsx +512 -349
- package/src/Meter.tsx +42 -8
- package/src/Modal.tsx +85 -42
- package/src/NumberField.tsx +161 -48
- package/src/Popover.tsx +424 -148
- package/src/Pressable.tsx +27 -6
- package/src/PreviewTrigger.tsx +171 -0
- package/src/ProgressBar.tsx +25 -3
- package/src/RadioGroup.tsx +230 -161
- package/src/RangeCalendar.tsx +75 -63
- package/src/RouterProvider.tsx +24 -14
- package/src/SearchField.tsx +118 -121
- package/src/Select.tsx +454 -274
- package/src/SelectionIndicator.tsx +21 -3
- package/src/Separator.tsx +17 -1
- package/src/SharedElementTransition.tsx +115 -97
- package/src/Slider.tsx +35 -17
- package/src/StepList.tsx +71 -32
- package/src/Switch.tsx +45 -29
- package/src/Table.tsx +446 -380
- package/src/Tabs.tsx +132 -155
- package/src/TagGroup.tsx +53 -40
- package/src/Text.tsx +23 -6
- package/src/TextField.tsx +118 -159
- package/src/TimeField.tsx +34 -95
- package/src/Toast.tsx +141 -67
- package/src/ToggleButton.tsx +33 -15
- package/src/ToggleButtonGroup.tsx +27 -9
- package/src/TokenField.tsx +379 -0
- package/src/Toolbar.tsx +19 -9
- package/src/Tooltip.tsx +126 -84
- package/src/Tree.tsx +233 -173
- package/src/Virtualizer.tsx +400 -138
- package/src/VirtualizerLayouts.ts +211 -26
- package/src/VisuallyHidden.tsx +22 -8
- package/src/contexts.ts +13 -0
- package/src/index.ts +32 -11
- package/src/intl/ar-AE.json +6 -0
- package/src/intl/bg-BG.json +6 -0
- package/src/intl/cs-CZ.json +6 -0
- package/src/intl/da-DK.json +6 -0
- package/src/intl/de-DE.json +6 -0
- package/src/intl/el-GR.json +6 -0
- package/src/intl/en-US.json +6 -0
- package/src/intl/es-ES.json +6 -0
- package/src/intl/et-EE.json +6 -0
- package/src/intl/fi-FI.json +6 -0
- package/src/intl/fr-FR.json +6 -0
- package/src/intl/he-IL.json +6 -0
- package/src/intl/hr-HR.json +6 -0
- package/src/intl/hu-HU.json +6 -0
- package/src/intl/index.ts +125 -0
- package/src/intl/it-IT.json +6 -0
- package/src/intl/ja-JP.json +6 -0
- package/src/intl/ko-KR.json +6 -0
- package/src/intl/lt-LT.json +6 -0
- package/src/intl/lv-LV.json +6 -0
- package/src/intl/nb-NO.json +6 -0
- package/src/intl/nl-NL.json +6 -0
- package/src/intl/pl-PL.json +6 -0
- package/src/intl/pt-BR.json +6 -0
- package/src/intl/pt-PT.json +6 -0
- package/src/intl/ro-RO.json +6 -0
- package/src/intl/ru-RU.json +6 -0
- package/src/intl/sk-SK.json +6 -0
- package/src/intl/sl-SI.json +6 -0
- package/src/intl/sr-SP.json +6 -0
- package/src/intl/sv-SE.json +6 -0
- package/src/intl/tr-TR.json +6 -0
- package/src/intl/uk-UA.json +6 -0
- package/src/intl/zh-CN.json +6 -0
- package/src/intl/zh-TW.json +6 -0
- package/src/useDragAndDrop.ts +30 -32
- package/src/utils.tsx +124 -68
- package/src/virtualizer/Layout.ts +29 -0
package/dist/Calendar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.js","names":["JSX","Accessor","createContext","createMemo","createSignal","splitProps","useContext","For","Index","Show","createCalendar","createCalendarGrid","createCalendarCell","createHover","AriaCalendarProps","AriaCalendarGridProps","createCalendarState","CalendarState","CalendarStateProps","CalendarSelectionMode","CalendarDate","DateValue","endOfMonth","isSameMonth","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","dataAttr","useIsHydrated","VisuallyHidden","RefLike","el","T","current","assignRef","ref","CalendarRenderProps","isDisabled","isReadOnly","isInvalid","CalendarProps","Omit","M","children","Element","class","style","locale","HTMLDivElement","CalendarGridRenderProps","CalendarGridProps","date","headerCellClass","offset","months","CalendarCellRenderProps","isSelected","isFocused","isFocusVisible","isUnavailable","isOutsideMonth","isToday","isPressed","isHovered","isFirstChild","isLastChild","isFirstWeek","isLastWeek","formattedDate","CalendarCellProps","cellClass","cellStyle","CalendarHeaderCellProps","CSSProperties","CalendarGridHeaderProps","CalendarGridBodyProps","CalendarContext","CalendarGridMonthContext","CalendarGridCellPositionContext","weekIndex","dayIndex","lastWeekIndex","useCalendarContext","context","Error","Calendar","props","inheritedState","isHydrated","_$createComponent","when","fallback","_$getNextElement","_tmpl$","CalendarInner","CalendarWithState","_$mergeProps","state","local","stateProps","rest","calendarAria","errorMessage","renderValues","isValueInvalid","renderProps","defaultClassName","_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","_$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","Provider","value","_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","CalendarHeadingProps","title","CalendarHeading","_el$18","_tmpl$5","_c$","_$memo","renderChildren","_v$5","_v$6","_$className","_$style","CalendarButtonProps","slot","CalendarButton","buttonProps","prevButtonProps","_el$19","_tmpl$6","tabindex","CalendarGrid","gridRef","setGridRef","HTMLTableElement","startDate","offsetMonths","baseStart","visibleRange","start","add","gridAria","endDate","weekdayStyle","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","_el$25","_tmpl$9","_tmpl$0","length","CalendarGridHeader","_el$27","_tmpl$1","_v$7","_v$8","CalendarGridBody","_el$28","_tmpl$10","_v$9","_v$0","CalendarHeaderCell","_el$29","_v$1","_v$10","CalendarCell","currentMonthStart","cellPosition","cellRef","setCellRef","position","cellAria","hoverProps","cellRenderProps","getChildren","_el$30","_tmpl$11","_el$31","cellProps","data-selected","data-focused","data-focus-visible","data-unavailable","data-outside-month","data-today","data-pressed","data-hovered","_$delegateEvents"],"sources":["../src/Calendar.tsx"],"sourcesContent":["/**\n * Calendar component for solidaria-components\n *\n * Pre-wired headless calendar component that combines aria hooks.\n * Port of react-aria-components/src/Calendar.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\";\n\nimport {\n createCalendar,\n createCalendarGrid,\n createCalendarCell,\n createHover,\n type AriaCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createCalendarState,\n type CalendarState,\n type CalendarStateProps,\n type CalendarSelectionMode,\n type CalendarDate,\n type DateValue,\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 CalendarRenderProps {\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}\n\nexport interface CalendarProps<\n T extends DateValue = DateValue,\n M extends CalendarSelectionMode = \"single\",\n>\n extends\n Omit<AriaCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<CalendarStateProps<T, M>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface CalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface CalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving weeks). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Number of weeks to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface CalendarCellRenderProps {\n /** Whether the cell is selected. */\n isSelected: 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 CalendarCellProps 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<CalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<CalendarCellRenderProps>;\n}\n\nexport interface CalendarHeaderCellProps extends SlotProps {\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}\n\nexport interface CalendarGridHeaderProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport interface CalendarGridBodyProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport const CalendarContext = createContext<CalendarState<DateValue> | null>(null);\nconst CalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst CalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useCalendarContext(): CalendarState<DateValue> {\n const context = useContext(CalendarContext);\n if (!context) {\n throw new Error(\"Calendar components must be used within a Calendar\");\n }\n return context;\n}\n\n/**\n * A calendar displays a grid of days in a month and allows users to select a single date.\n *\n * @example\n * ```tsx\n * <Calendar aria-label=\"Event date\">\n * <header>\n * <CalendarButton slot=\"previous\">◀</CalendarButton>\n * <CalendarHeading />\n * <CalendarButton slot=\"next\">▶</CalendarButton>\n * </header>\n * <CalendarGrid>\n * {(date) => <CalendarCell date={date} />}\n * </CalendarGrid>\n * </Calendar>\n * ```\n */\nexport function Calendar<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M>): JSX.Element {\n const inheritedState = useContext(CalendarContext);\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 class=\"solidaria-Calendar solidaria-Calendar--placeholder\" aria-hidden=\"true\" />\n }\n >\n <Show when={inheritedState} fallback={<CalendarInner {...props} />}>\n <CalendarWithState state={inheritedState as CalendarState<DateValue>} {...props} />\n </Show>\n </Show>\n );\n}\n\nfunction CalendarWithState<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M> & { state: CalendarState<DateValue> }): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"selectionMode\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state(),\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\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 >\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 month\n * grid so it's easy to navigate after reaching the end without going all\n * the way back to the start. Mirrors react-aria-components 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 );\n}\n\n/**\n * Internal Calendar component that renders after client mount.\n */\nfunction CalendarInner<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"selectionMode\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n // Create calendar state\n const state = createCalendarState<T, M>(stateProps);\n\n // Create calendar ARIA props\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state as unknown as CalendarState<DateValue>,\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\n <CalendarContext.Provider value={state as unknown as CalendarState<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 >\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. */}\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 </CalendarContext.Provider>\n );\n}\n\nexport interface CalendarHeadingProps extends SlotProps {\n /** The children of the component. */\n children?: RenderChildren<{ title: string }>;\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 calendar.\n */\nexport function CalendarHeading(props: CalendarHeadingProps): JSX.Element {\n const state = useCalendarContext();\n const renderValues = createMemo(() => ({\n title: state.title(),\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-CalendarHeading\",\n },\n renderValues,\n );\n\n return (\n <h2 class={renderProps.class()} style={renderProps.style()} aria-live=\"polite\">\n {typeof props.children === \"function\" ? renderProps.renderChildren() : state.title()}\n </h2>\n );\n}\n\nexport interface CalendarButtonProps 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 calendar.\n */\nexport function CalendarButton(props: CalendarButtonProps): JSX.Element {\n const state = useCalendarContext();\n const calendarAria = createCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n\n const isDisabled = () => props.isDisabled || state.isDisabled();\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-CalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable: always set an explicit tabIndex on an enabled\n // focusable button (0), and drop it entirely when disabled — so the\n // nav buttons appear in the roving tab order exactly as upstream does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of calendar cells.\n */\nexport function CalendarGrid(props: CalendarGridProps): JSX.Element {\n const state = useCalendarContext();\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,\n gridRef,\n );\n\n const renderValues = createMemo<CalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-CalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize ALL dates for the grid at once to avoid reactive loops.\n // This breaks the cycle where accessing visibleRange() inside For loop\n // would cause infinite re-renders.\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 <CalendarGridMonthContext.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 scope=\"col\" class={props.headerCellClass ?? \"solidaria-CalendarHeaderCell\"}>\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 <CalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </CalendarGridMonthContext.Provider>\n );\n}\n\nexport function CalendarGridHeader(props: CalendarGridHeaderProps): JSX.Element {\n return (\n <thead class={props.class ?? \"solidaria-CalendarGridHeader\"} style={props.style}>\n {props.children}\n </thead>\n );\n}\n\nexport function CalendarGridBody(props: CalendarGridBodyProps): JSX.Element {\n return (\n <tbody class={props.class ?? \"solidaria-CalendarGridBody\"} style={props.style}>\n {props.children}\n </tbody>\n );\n}\n\nexport function CalendarHeaderCell(props: CalendarHeaderCellProps): JSX.Element {\n return (\n <th scope=\"col\" class={props.class ?? \"solidaria-CalendarHeaderCell\"} style={props.style}>\n {props.children}\n </th>\n );\n}\n\n/**\n * A cell in the calendar grid representing a single day.\n */\nexport function CalendarCell(props: CalendarCellProps): JSX.Element {\n const state = useCalendarContext();\n const currentMonthStart = useContext(CalendarGridMonthContext);\n const cellPosition = useContext(CalendarGridCellPositionContext);\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 = createCalendarCell(\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<CalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\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-CalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-CalendarCellWrapper\",\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-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 { CalendarState, CalendarDate, DateValue };\n"],"mappings":";;;;;;;;;;;;;;AAmDA,SAASoC,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KACH;CAGF,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AAuHA,MAAa6C,kBAAkB5E,cAA+C,IAAI;AAClF,MAAM6E,2BAA2B7E,cAA6C,IAAI;AAClF,MAAM8E,kCAAkC9E,cAI7B,IAAI;AAEf,SAAgBkF,qBAA+C;CAC7D,MAAMC,UAAU/E,WAAWwE,eAAe;CAC1C,IAAI,CAACO,SACH,MAAM,IAAIC,MAAM,oDAAoD;CAEtE,OAAOD;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgBE,SAGdC,OAAyC;CACzC,MAAMC,iBAAiBnF,WAAWwE,eAAe;CAGjD,MAAMY,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,gBAIPlF,MAAI;IAACmF,MAAMH;IAAc,IAAEI,WAAQ;KAAA,OAAAF,gBAAGK,eAAkBR,KAAK;IAAA;IAAA,IAAA3C,WAAA;KAAA,OAAA8C,gBAC3DM,mBAAiBC,WAAA,EAACC,OAAOV,eAA0C,GAAMD,KAAK,CAAA;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA;AAIvF;AAEA,SAASS,kBAGPT,OAA+E;CAC/E,MAAM,CAACY,OAAOC,YAAYC,QAAQjG,WAChCmF,OACA;EAAC;EAAY;EAAS;EAAS;EAAQ;EAAS;CAAK,GACrD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA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AA,IAAA;EAAAgE,OAAAuH,QAElCH,WAAW;EAAAhG,mBAAA;EAAA,OAAAiG;CAAA,EAAA,CAAA;AAIpB;AAEuDY,eAAA,CAAA,OAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"Calendar.js","names":["<Show when={inheritedState} fallback={<CalendarInner {...props} />}>\n <CalendarWithState state={inheritedState as CalendarState<DateValue>} {...props} />\n </Show>","when={inheritedState}","<CalendarInner {...props} />","<CalendarWithState state={inheritedState as CalendarState<DateValue>} {...props} />","state={inheritedState as CalendarState<DateValue>}","ref={(el) => assignRef(local.ref, el)}","<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) => 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 >\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 month\n * grid so it's easy to navigate after reaching the end without going all\n * the way back to the start. Mirrors react-aria-components 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 />","<CalendarContext value={state as unknown as CalendarState<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 >\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. */}\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 </CalendarContext>","value={state as unknown as CalendarState<DateValue>}","<VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>","<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 >\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. */}\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 />","{typeof props.children === \"function\" ? renderProps.renderChildren() : state.title()}","style={renderProps.style()}","<h2 class={renderProps.class()} style={renderProps.style()} aria-live=\"polite\">\n {typeof props.children === \"function\" ? renderProps.renderChildren() : state.title()}\n </h2>","onClick={(event) => {\n const click = buttonProps().onClick as\n | ((event: MouseEvent & { currentTarget: HTMLButtonElement }) => void)\n | undefined;\n click?.(event);\n if (!isDisabled()) {\n event.currentTarget.focus();\n }\n }}","<button\n {...buttonProps()}\n class={props.class ?? \"solidaria-CalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable: always set an explicit tabIndex on an enabled\n // focusable button (0), and drop it entirely when disabled — so the\n // nav buttons appear in the roving tab order exactly as upstream does.\n tabindex={isDisabled() ? undefined : 0}\n onClick={(event) => {\n const click = buttonProps().onClick as\n | ((event: MouseEvent & { currentTarget: HTMLButtonElement }) => void)\n | undefined;\n click?.(event);\n if (!isDisabled()) {\n event.currentTarget.focus();\n }\n }}\n >\n {props.children}\n </button>","<CalendarGridMonthContext 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 scope=\"col\" class={props.headerCellClass ?? \"solidaria-CalendarHeaderCell\"}>\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 <CalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n </CalendarGridMonthContext>","value={startDate}","ref={setGridRef}","<For each={gridAria.weekDays}>\n {(day) => (\n <th scope=\"col\" class={props.headerCellClass ?? \"solidaria-CalendarHeaderCell\"}>\n {day}\n </th>\n )}\n </For>","<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 <CalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext>\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 <CalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext>\n </Show>\n )}\n </For>","<Show when={date()} fallback={<td />}>\n <CalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext>\n </Show>","<td />","<CalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext>","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 scope=\"col\" class={props.headerCellClass ?? \"solidaria-CalendarHeaderCell\"}>\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 <CalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>","style={props.style}","<thead class={props.class ?? \"solidaria-CalendarGridHeader\"} style={props.style}>\n {props.children}\n </thead>","<tbody class={props.class ?? \"solidaria-CalendarGridBody\"} style={props.style}>\n {props.children}\n </tbody>","<th scope=\"col\" class={props.class ?? \"solidaria-CalendarHeaderCell\"} style={props.style}>\n {props.children}\n </th>","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 {...coerceDomRecord(cellAria.buttonProps as Record<string, unknown>)}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\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/Calendar.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 * Calendar component for solidaria-components\n *\n * Pre-wired headless calendar component that combines aria hooks.\n * Port of react-aria-components/src/Calendar.tsx\n */\n\nimport { createContext, createMemo, createSignal, useContext, For, Show } from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\n\nimport {\n createCalendar,\n createCalendarGrid,\n createCalendarCell,\n createHover,\n type AriaCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createCalendarState,\n type CalendarState,\n type CalendarStateProps,\n type CalendarSelectionMode,\n type CalendarDate,\n type DateValue,\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 CalendarRenderProps {\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}\n\nexport interface CalendarProps<\n T extends DateValue = DateValue,\n M extends CalendarSelectionMode = \"single\",\n>\n extends\n Omit<AriaCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<CalendarStateProps<T, M>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface CalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface CalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving weeks). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Number of weeks to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface CalendarCellRenderProps {\n /** Whether the cell is selected. */\n isSelected: 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 CalendarCellProps 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<CalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<CalendarCellRenderProps>;\n}\n\nexport interface CalendarHeaderCellProps extends SlotProps {\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}\n\nexport interface CalendarGridHeaderProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport interface CalendarGridBodyProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport const CalendarContext = createContext<CalendarState<DateValue> | null>(null);\nconst CalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst CalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useCalendarContext(): CalendarState<DateValue> {\n const context = useContext(CalendarContext);\n if (!context) {\n throw new Error(\"Calendar components must be used within a Calendar\");\n }\n return context;\n}\n\n/**\n * A calendar displays a grid of days in a month and allows users to select a single date.\n *\n * @example\n * ```tsx\n * <Calendar aria-label=\"Event date\">\n * <header>\n * <CalendarButton slot=\"previous\">◀</CalendarButton>\n * <CalendarHeading />\n * <CalendarButton slot=\"next\">▶</CalendarButton>\n * </header>\n * <CalendarGrid>\n * {(date) => <CalendarCell date={date} />}\n * </CalendarGrid>\n * </Calendar>\n * ```\n */\nexport function Calendar<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M>): JSX.Element {\n const inheritedState = useContext(CalendarContext);\n\n return (\n <Show when={inheritedState} fallback={<CalendarInner {...props} />}>\n <CalendarWithState state={inheritedState as CalendarState<DateValue>} {...props} />\n </Show>\n );\n}\n\nfunction CalendarWithState<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M> & { state: CalendarState<DateValue> }): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"selectionMode\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state(),\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\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 >\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 month\n * grid so it's easy to navigate after reaching the end without going all\n * the way back to the start. Mirrors react-aria-components 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 );\n}\n\n/**\n * Internal Calendar component that renders after client mount.\n */\nfunction CalendarInner<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"selectionMode\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n // Create calendar state\n const state = createCalendarState<T, M>(stateProps);\n\n // Create calendar ARIA props\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state as unknown as CalendarState<DateValue>,\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\n <CalendarContext value={state as unknown as CalendarState<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 >\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. */}\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 </CalendarContext>\n );\n}\n\nexport interface CalendarHeadingProps extends SlotProps {\n /** The children of the component. */\n children?: RenderChildren<{ title: string }>;\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 calendar.\n */\nexport function CalendarHeading(props: CalendarHeadingProps): JSX.Element {\n const state = useCalendarContext();\n const renderValues = createMemo(() => ({\n title: state.title(),\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-CalendarHeading\",\n },\n renderValues,\n );\n\n return (\n <h2 class={renderProps.class()} style={renderProps.style()} aria-live=\"polite\">\n {typeof props.children === \"function\" ? renderProps.renderChildren() : state.title()}\n </h2>\n );\n}\n\nexport interface CalendarButtonProps 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 calendar.\n */\nexport function CalendarButton(props: CalendarButtonProps): JSX.Element {\n const state = useCalendarContext();\n const calendarAria = createCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n\n const isDisabled = () =>\n props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled();\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-CalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable: always set an explicit tabIndex on an enabled\n // focusable button (0), and drop it entirely when disabled — so the\n // nav buttons appear in the roving tab order exactly as upstream does.\n tabindex={isDisabled() ? undefined : 0}\n onClick={(event) => {\n const click = buttonProps().onClick as\n | ((event: MouseEvent & { currentTarget: HTMLButtonElement }) => void)\n | undefined;\n click?.(event);\n if (!isDisabled()) {\n event.currentTarget.focus();\n }\n }}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of calendar cells.\n */\nexport function CalendarGrid(props: CalendarGridProps): JSX.Element {\n const state = useCalendarContext();\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 get startDate() {\n return startDate();\n },\n get endDate() {\n return endOfMonth(startDate());\n },\n get weekdayStyle() {\n return props.weekdayStyle;\n },\n },\n state,\n gridRef,\n );\n\n const renderValues = createMemo<CalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-CalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize ALL dates for the grid at once to avoid reactive loops.\n // This breaks the cycle where accessing visibleRange() inside For loop\n // would cause infinite re-renders.\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 <CalendarGridMonthContext 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 scope=\"col\" class={props.headerCellClass ?? \"solidaria-CalendarHeaderCell\"}>\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 <CalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n </CalendarGridMonthContext>\n );\n}\n\nexport function CalendarGridHeader(props: CalendarGridHeaderProps): JSX.Element {\n return (\n <thead class={props.class ?? \"solidaria-CalendarGridHeader\"} style={props.style}>\n {props.children}\n </thead>\n );\n}\n\nexport function CalendarGridBody(props: CalendarGridBodyProps): JSX.Element {\n return (\n <tbody class={props.class ?? \"solidaria-CalendarGridBody\"} style={props.style}>\n {props.children}\n </tbody>\n );\n}\n\nexport function CalendarHeaderCell(props: CalendarHeaderCellProps): JSX.Element {\n return (\n <th scope=\"col\" class={props.class ?? \"solidaria-CalendarHeaderCell\"} style={props.style}>\n {props.children}\n </th>\n );\n}\n\n/**\n * A cell in the calendar grid representing a single day.\n */\nexport function CalendarCell(props: CalendarCellProps): JSX.Element {\n const state = useCalendarContext();\n const currentMonthStart = useContext(CalendarGridMonthContext);\n const cellPosition = useContext(CalendarGridCellPositionContext);\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 = createCalendarCell(\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<CalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\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-CalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-CalendarCellWrapper\",\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 {...coerceDomRecord(cellAria.buttonProps as Record<string, unknown>)}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\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 { CalendarState, CalendarDate, DateValue };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAAS,YAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAuHA,MAAa,kBAAkB,cAA+C,IAAI;AAClF,MAAM,2BAA2B,cAA6C,IAAI;AAClF,MAAM,kCAAkC,cAI7B,IAAI;AAEf,SAAgB,qBAA+C;CAC7D,MAAM,UAAU,WAAW,eAAe;CAC1C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,oDAAoD;CAEtE,OAAO;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,SAGd,OAAyC;CACzC,MAAM,iBAAiB,WAAW,eAAe;CAEjD,OACEA,gBAAAA,MAAAA;EAAMC,MAAM;EAAgB,IAAA,WAAA;GAAUC,OAAAA,gBAAAA,eAAmB,KAAQ;EAAC;EAAlE,IAAA,WAAA;GACEC,OAAAA,gBAAAA,mBAAAA,WAAAA,EAAmBC,OAAO,eAAwD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AAA;IAAc,OAAA,SAAS,SAAS,SAAS;GAAC;GAC1C,IAAA,iBAAA;IAAc,OAAA,SAAS,UAAU,CAAC;GAAC;;;CAfrC,OAAA,QAiBEC,YAAAA;EAAC,OAAA,YAAa;CACX,CAAA,CAAA;CAvBP,mBAwBI;CAzBN,OACEC;AA0BJ"}
|
package/dist/Calendar.jsx
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
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,
|
|
15
|
+
import { For, Show, createContext, createMemo, createSignal, useContext } from "solid-js";
|
|
4
16
|
import { createCalendar, createCalendarCell, createCalendarGrid, createHover } from "@proyecto-viviana/solidaria";
|
|
17
|
+
import { splitProps } from "@proyecto-viviana/solidaria/utils";
|
|
5
18
|
import { createCalendarState, endOfMonth, isSameMonth } from "@proyecto-viviana/solid-stately";
|
|
6
19
|
//#region src/Calendar.tsx
|
|
7
20
|
/**
|
|
@@ -10,7 +23,7 @@ import { createCalendarState, endOfMonth, isSameMonth } from "@proyecto-viviana/
|
|
|
10
23
|
* Pre-wired headless calendar component that combines aria hooks.
|
|
11
24
|
* Port of react-aria-components/src/Calendar.tsx
|
|
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;
|
|
@@ -42,11 +55,8 @@ function useCalendarContext() {
|
|
|
42
55
|
*/
|
|
43
56
|
function Calendar(props) {
|
|
44
57
|
const inheritedState = useContext(CalendarContext);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<Show when={inheritedState} fallback={<CalendarInner {...props} />}>
|
|
48
|
-
<CalendarWithState state={inheritedState} {...props} />
|
|
49
|
-
</Show>
|
|
58
|
+
return <Show when={inheritedState} fallback={<CalendarInner {...props} />}>
|
|
59
|
+
<CalendarWithState state={inheritedState} {...props} />
|
|
50
60
|
</Show>;
|
|
51
61
|
}
|
|
52
62
|
function CalendarWithState(props) {
|
|
@@ -96,14 +106,14 @@ function CalendarWithState(props) {
|
|
|
96
106
|
style: local.style,
|
|
97
107
|
defaultClassName: "solidaria-Calendar"
|
|
98
108
|
}, renderValues);
|
|
99
|
-
return <div {...calendarAria.calendarProps} ref={(el) => assignRef(local.ref, el)} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state().isDisabled())} data-readonly={dataAttr(state().isReadOnly())} data-invalid={dataAttr(state().isValueInvalid())}>
|
|
109
|
+
return <div {...calendarAria.calendarProps} ref={(el) => assignRef$1(local.ref, el)} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state().isDisabled())} data-readonly={dataAttr(state().isReadOnly())} data-invalid={dataAttr(state().isValueInvalid())}>
|
|
100
110
|
<VisuallyHidden>
|
|
101
111
|
<h2>{String(calendarAria.calendarProps["aria-label"] ?? "")}</h2>
|
|
102
112
|
</VisuallyHidden>
|
|
103
113
|
{props.children}
|
|
104
114
|
{}
|
|
105
115
|
<VisuallyHidden>
|
|
106
|
-
<button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state().focusNextPage()}
|
|
116
|
+
<button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state().focusNextPage()} tabindex={-1} />
|
|
107
117
|
</VisuallyHidden>
|
|
108
118
|
</div>;
|
|
109
119
|
}
|
|
@@ -156,18 +166,18 @@ function CalendarInner(props) {
|
|
|
156
166
|
style: local.style,
|
|
157
167
|
defaultClassName: "solidaria-Calendar"
|
|
158
168
|
}, renderValues);
|
|
159
|
-
return <CalendarContext
|
|
160
|
-
<div {...calendarAria.calendarProps} ref={(el) => assignRef(local.ref, el)} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled())} data-readonly={dataAttr(state.isReadOnly())} data-invalid={dataAttr(state.isValueInvalid())}>
|
|
169
|
+
return <CalendarContext value={state}>
|
|
170
|
+
<div {...calendarAria.calendarProps} ref={(el) => assignRef$1(local.ref, el)} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled())} data-readonly={dataAttr(state.isReadOnly())} data-invalid={dataAttr(state.isValueInvalid())}>
|
|
161
171
|
<VisuallyHidden>
|
|
162
172
|
<h2>{String(calendarAria.calendarProps["aria-label"] ?? "")}</h2>
|
|
163
173
|
</VisuallyHidden>
|
|
164
174
|
{props.children}
|
|
165
175
|
{}
|
|
166
176
|
<VisuallyHidden>
|
|
167
|
-
<button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state.focusNextPage()}
|
|
177
|
+
<button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state.focusNextPage()} tabindex={-1} />
|
|
168
178
|
</VisuallyHidden>
|
|
169
179
|
</div>
|
|
170
|
-
</CalendarContext
|
|
180
|
+
</CalendarContext>;
|
|
171
181
|
}
|
|
172
182
|
/**
|
|
173
183
|
* Displays the current month and year in the calendar.
|
|
@@ -197,8 +207,12 @@ function CalendarButton(props) {
|
|
|
197
207
|
if (props.slot === "previous") return calendarAria.prevButtonProps;
|
|
198
208
|
return calendarAria.nextButtonProps;
|
|
199
209
|
});
|
|
200
|
-
const isDisabled = () => props.isDisabled || state.isDisabled();
|
|
201
|
-
return <button {...buttonProps()} class={props.class ?? "solidaria-CalendarButton"} style={props.style} disabled={isDisabled()} tabindex={isDisabled() ? void 0 : 0}
|
|
210
|
+
const isDisabled = () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled();
|
|
211
|
+
return <button {...buttonProps()} class={props.class ?? "solidaria-CalendarButton"} style={props.style} disabled={isDisabled()} tabindex={isDisabled() ? void 0 : 0} onClick={(event) => {
|
|
212
|
+
const click = buttonProps().onClick;
|
|
213
|
+
click?.(event);
|
|
214
|
+
if (!isDisabled()) event.currentTarget.focus();
|
|
215
|
+
}}>
|
|
202
216
|
{props.children}
|
|
203
217
|
</button>;
|
|
204
218
|
}
|
|
@@ -214,9 +228,15 @@ function CalendarGrid(props) {
|
|
|
214
228
|
return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;
|
|
215
229
|
});
|
|
216
230
|
const gridAria = createCalendarGrid({
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
231
|
+
get startDate() {
|
|
232
|
+
return startDate();
|
|
233
|
+
},
|
|
234
|
+
get endDate() {
|
|
235
|
+
return endOfMonth(startDate());
|
|
236
|
+
},
|
|
237
|
+
get weekdayStyle() {
|
|
238
|
+
return props.weekdayStyle;
|
|
239
|
+
}
|
|
220
240
|
}, state, gridRef);
|
|
221
241
|
const renderValues = createMemo(() => ({ isDisabled: state.isDisabled() }));
|
|
222
242
|
const renderProps = useRenderProps({
|
|
@@ -231,9 +251,9 @@ function CalendarGrid(props) {
|
|
|
231
251
|
for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) weekDates.push(state.getDatesInWeek(weekIndex, monthStart));
|
|
232
252
|
return weekDates;
|
|
233
253
|
});
|
|
234
|
-
return <CalendarGridMonthContext
|
|
235
|
-
<table ref={setGridRef} {...gridAria.gridProps} class={renderProps.class()} style={renderProps.style()}>
|
|
236
|
-
<thead {...gridAria.headerProps}>
|
|
254
|
+
return <CalendarGridMonthContext value={startDate}>
|
|
255
|
+
<table ref={setGridRef} {...coerceDomRecord(gridAria.gridProps)} class={renderProps.class()} style={renderProps.style()}>
|
|
256
|
+
<thead {...coerceDomRecord(gridAria.headerProps)}>
|
|
237
257
|
<tr>
|
|
238
258
|
<For each={gridAria.weekDays}>
|
|
239
259
|
{(day) => <th scope="col" class={props.headerCellClass ?? "solidaria-CalendarHeaderCell"}>
|
|
@@ -243,24 +263,24 @@ function CalendarGrid(props) {
|
|
|
243
263
|
</tr>
|
|
244
264
|
</thead>
|
|
245
265
|
<tbody>
|
|
246
|
-
<
|
|
266
|
+
<For each={allDates()} keyed={false}>
|
|
247
267
|
{(weekDates, weekIndex) => <tr>
|
|
248
|
-
<
|
|
268
|
+
<For each={weekDates()} keyed={false}>
|
|
249
269
|
{(date, dayIndex) => <Show when={date()} fallback={<td />}>
|
|
250
|
-
<CalendarGridCellPositionContext
|
|
270
|
+
<CalendarGridCellPositionContext value={() => ({
|
|
251
271
|
weekIndex,
|
|
252
272
|
dayIndex,
|
|
253
273
|
lastWeekIndex: allDates().length - 1
|
|
254
274
|
})}>
|
|
255
275
|
{props.children?.(date())}
|
|
256
|
-
</CalendarGridCellPositionContext
|
|
276
|
+
</CalendarGridCellPositionContext>
|
|
257
277
|
</Show>}
|
|
258
|
-
</
|
|
278
|
+
</For>
|
|
259
279
|
</tr>}
|
|
260
|
-
</
|
|
280
|
+
</For>
|
|
261
281
|
</tbody>
|
|
262
282
|
</table>
|
|
263
|
-
</CalendarGridMonthContext
|
|
283
|
+
</CalendarGridMonthContext>;
|
|
264
284
|
}
|
|
265
285
|
function CalendarGridHeader(props) {
|
|
266
286
|
return <thead class={props.class ?? "solidaria-CalendarGridHeader"} style={props.style}>
|
|
@@ -327,11 +347,11 @@ function CalendarCell(props) {
|
|
|
327
347
|
defaultClassName: "solidaria-CalendarCellWrapper"
|
|
328
348
|
}, renderValues);
|
|
329
349
|
const getChildren = () => {
|
|
330
|
-
if (typeof props.children === "function") return renderProps.
|
|
350
|
+
if (typeof props.children === "function") return renderProps.renderChildrenStable();
|
|
331
351
|
return cellAria.formattedDate;
|
|
332
352
|
};
|
|
333
|
-
return <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>
|
|
334
|
-
<div ref={setCellRef} {...cellAria.buttonProps} {...hoverProps} class={renderProps.class()} style={renderProps.style()} data-selected={dataAttr(cellAria.isSelected)} 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())}>
|
|
353
|
+
return <td {...coerceDomRecord(cellAria.cellProps)} class={cellRenderProps.class()} style={cellRenderProps.style()}>
|
|
354
|
+
<div ref={setCellRef} {...coerceDomRecord(cellAria.buttonProps)} {...hoverProps} class={renderProps.class()} style={renderProps.style()} data-selected={dataAttr(cellAria.isSelected)} 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())}>
|
|
335
355
|
{getChildren()}
|
|
336
356
|
</div>
|
|
337
357
|
</td>;
|
package/dist/Calendar.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.jsx","names":[],"sources":["../src/Calendar.tsx"],"sourcesContent":["/**\n * Calendar component for solidaria-components\n *\n * Pre-wired headless calendar component that combines aria hooks.\n * Port of react-aria-components/src/Calendar.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\";\n\nimport {\n createCalendar,\n createCalendarGrid,\n createCalendarCell,\n createHover,\n type AriaCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createCalendarState,\n type CalendarState,\n type CalendarStateProps,\n type CalendarSelectionMode,\n type CalendarDate,\n type DateValue,\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 CalendarRenderProps {\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}\n\nexport interface CalendarProps<\n T extends DateValue = DateValue,\n M extends CalendarSelectionMode = \"single\",\n>\n extends\n Omit<AriaCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<CalendarStateProps<T, M>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface CalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface CalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving weeks). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Number of weeks to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface CalendarCellRenderProps {\n /** Whether the cell is selected. */\n isSelected: 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 CalendarCellProps 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<CalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<CalendarCellRenderProps>;\n}\n\nexport interface CalendarHeaderCellProps extends SlotProps {\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}\n\nexport interface CalendarGridHeaderProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport interface CalendarGridBodyProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport const CalendarContext = createContext<CalendarState<DateValue> | null>(null);\nconst CalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst CalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useCalendarContext(): CalendarState<DateValue> {\n const context = useContext(CalendarContext);\n if (!context) {\n throw new Error(\"Calendar components must be used within a Calendar\");\n }\n return context;\n}\n\n/**\n * A calendar displays a grid of days in a month and allows users to select a single date.\n *\n * @example\n * ```tsx\n * <Calendar aria-label=\"Event date\">\n * <header>\n * <CalendarButton slot=\"previous\">◀</CalendarButton>\n * <CalendarHeading />\n * <CalendarButton slot=\"next\">▶</CalendarButton>\n * </header>\n * <CalendarGrid>\n * {(date) => <CalendarCell date={date} />}\n * </CalendarGrid>\n * </Calendar>\n * ```\n */\nexport function Calendar<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M>): JSX.Element {\n const inheritedState = useContext(CalendarContext);\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 class=\"solidaria-Calendar solidaria-Calendar--placeholder\" aria-hidden=\"true\" />\n }\n >\n <Show when={inheritedState} fallback={<CalendarInner {...props} />}>\n <CalendarWithState state={inheritedState as CalendarState<DateValue>} {...props} />\n </Show>\n </Show>\n );\n}\n\nfunction CalendarWithState<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M> & { state: CalendarState<DateValue> }): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"selectionMode\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state(),\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\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 >\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 month\n * grid so it's easy to navigate after reaching the end without going all\n * the way back to the start. Mirrors react-aria-components 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 );\n}\n\n/**\n * Internal Calendar component that renders after client mount.\n */\nfunction CalendarInner<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"selectionMode\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n // Create calendar state\n const state = createCalendarState<T, M>(stateProps);\n\n // Create calendar ARIA props\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state as unknown as CalendarState<DateValue>,\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\n <CalendarContext.Provider value={state as unknown as CalendarState<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 >\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. */}\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 </CalendarContext.Provider>\n );\n}\n\nexport interface CalendarHeadingProps extends SlotProps {\n /** The children of the component. */\n children?: RenderChildren<{ title: string }>;\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 calendar.\n */\nexport function CalendarHeading(props: CalendarHeadingProps): JSX.Element {\n const state = useCalendarContext();\n const renderValues = createMemo(() => ({\n title: state.title(),\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-CalendarHeading\",\n },\n renderValues,\n );\n\n return (\n <h2 class={renderProps.class()} style={renderProps.style()} aria-live=\"polite\">\n {typeof props.children === \"function\" ? renderProps.renderChildren() : state.title()}\n </h2>\n );\n}\n\nexport interface CalendarButtonProps 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 calendar.\n */\nexport function CalendarButton(props: CalendarButtonProps): JSX.Element {\n const state = useCalendarContext();\n const calendarAria = createCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n\n const isDisabled = () => props.isDisabled || state.isDisabled();\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-CalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable: always set an explicit tabIndex on an enabled\n // focusable button (0), and drop it entirely when disabled — so the\n // nav buttons appear in the roving tab order exactly as upstream does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of calendar cells.\n */\nexport function CalendarGrid(props: CalendarGridProps): JSX.Element {\n const state = useCalendarContext();\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,\n gridRef,\n );\n\n const renderValues = createMemo<CalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-CalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize ALL dates for the grid at once to avoid reactive loops.\n // This breaks the cycle where accessing visibleRange() inside For loop\n // would cause infinite re-renders.\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 <CalendarGridMonthContext.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 scope=\"col\" class={props.headerCellClass ?? \"solidaria-CalendarHeaderCell\"}>\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 <CalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </CalendarGridMonthContext.Provider>\n );\n}\n\nexport function CalendarGridHeader(props: CalendarGridHeaderProps): JSX.Element {\n return (\n <thead class={props.class ?? \"solidaria-CalendarGridHeader\"} style={props.style}>\n {props.children}\n </thead>\n );\n}\n\nexport function CalendarGridBody(props: CalendarGridBodyProps): JSX.Element {\n return (\n <tbody class={props.class ?? \"solidaria-CalendarGridBody\"} style={props.style}>\n {props.children}\n </tbody>\n );\n}\n\nexport function CalendarHeaderCell(props: CalendarHeaderCellProps): JSX.Element {\n return (\n <th scope=\"col\" class={props.class ?? \"solidaria-CalendarHeaderCell\"} style={props.style}>\n {props.children}\n </th>\n );\n}\n\n/**\n * A cell in the calendar grid representing a single day.\n */\nexport function CalendarCell(props: CalendarCellProps): JSX.Element {\n const state = useCalendarContext();\n const currentMonthStart = useContext(CalendarGridMonthContext);\n const cellPosition = useContext(CalendarGridCellPositionContext);\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 = createCalendarCell(\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<CalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\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-CalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-CalendarCellWrapper\",\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-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 { CalendarState, CalendarDate, DateValue };\n"],"mappings":";;;;;;;;;;;;AAmDA,SAAS,UAAa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Ac,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":"Calendar.jsx","names":["assignRef"],"sources":["../src/Calendar.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 * Calendar component for solidaria-components\n *\n * Pre-wired headless calendar component that combines aria hooks.\n * Port of react-aria-components/src/Calendar.tsx\n */\n\nimport { createContext, createMemo, createSignal, useContext, For, Show } from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\n\nimport {\n createCalendar,\n createCalendarGrid,\n createCalendarCell,\n createHover,\n type AriaCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createCalendarState,\n type CalendarState,\n type CalendarStateProps,\n type CalendarSelectionMode,\n type CalendarDate,\n type DateValue,\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 CalendarRenderProps {\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}\n\nexport interface CalendarProps<\n T extends DateValue = DateValue,\n M extends CalendarSelectionMode = \"single\",\n>\n extends\n Omit<AriaCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<CalendarStateProps<T, M>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface CalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface CalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving weeks). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Number of weeks to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface CalendarCellRenderProps {\n /** Whether the cell is selected. */\n isSelected: 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 CalendarCellProps 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<CalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<CalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<CalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<CalendarCellRenderProps>;\n}\n\nexport interface CalendarHeaderCellProps extends SlotProps {\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}\n\nexport interface CalendarGridHeaderProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport interface CalendarGridBodyProps extends SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\nexport const CalendarContext = createContext<CalendarState<DateValue> | null>(null);\nconst CalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst CalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useCalendarContext(): CalendarState<DateValue> {\n const context = useContext(CalendarContext);\n if (!context) {\n throw new Error(\"Calendar components must be used within a Calendar\");\n }\n return context;\n}\n\n/**\n * A calendar displays a grid of days in a month and allows users to select a single date.\n *\n * @example\n * ```tsx\n * <Calendar aria-label=\"Event date\">\n * <header>\n * <CalendarButton slot=\"previous\">◀</CalendarButton>\n * <CalendarHeading />\n * <CalendarButton slot=\"next\">▶</CalendarButton>\n * </header>\n * <CalendarGrid>\n * {(date) => <CalendarCell date={date} />}\n * </CalendarGrid>\n * </Calendar>\n * ```\n */\nexport function Calendar<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M>): JSX.Element {\n const inheritedState = useContext(CalendarContext);\n\n return (\n <Show when={inheritedState} fallback={<CalendarInner {...props} />}>\n <CalendarWithState state={inheritedState as CalendarState<DateValue>} {...props} />\n </Show>\n );\n}\n\nfunction CalendarWithState<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M> & { state: CalendarState<DateValue> }): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"selectionMode\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state(),\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\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 >\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 month\n * grid so it's easy to navigate after reaching the end without going all\n * the way back to the start. Mirrors react-aria-components 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 );\n}\n\n/**\n * Internal Calendar component that renders after client mount.\n */\nfunction CalendarInner<\n T extends DateValue = CalendarDate,\n M extends CalendarSelectionMode = \"single\",\n>(props: CalendarProps<T, M>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"selectionMode\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"errorMessage\",\n \"firstDayOfWeek\",\n ],\n );\n\n // Create calendar state\n const state = createCalendarState<T, M>(stateProps);\n\n // Create calendar ARIA props\n const calendarAria = createCalendar(\n () => ({\n ...rest,\n errorMessage: stateProps.errorMessage,\n }),\n state as unknown as CalendarState<DateValue>,\n );\n\n const renderValues = createMemo<CalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Calendar\",\n },\n renderValues,\n );\n\n return (\n <CalendarContext value={state as unknown as CalendarState<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 >\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. */}\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 </CalendarContext>\n );\n}\n\nexport interface CalendarHeadingProps extends SlotProps {\n /** The children of the component. */\n children?: RenderChildren<{ title: string }>;\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 calendar.\n */\nexport function CalendarHeading(props: CalendarHeadingProps): JSX.Element {\n const state = useCalendarContext();\n const renderValues = createMemo(() => ({\n title: state.title(),\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-CalendarHeading\",\n },\n renderValues,\n );\n\n return (\n <h2 class={renderProps.class()} style={renderProps.style()} aria-live=\"polite\">\n {typeof props.children === \"function\" ? renderProps.renderChildren() : state.title()}\n </h2>\n );\n}\n\nexport interface CalendarButtonProps 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 calendar.\n */\nexport function CalendarButton(props: CalendarButtonProps): JSX.Element {\n const state = useCalendarContext();\n const calendarAria = createCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n\n const isDisabled = () =>\n props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled();\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-CalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable: always set an explicit tabIndex on an enabled\n // focusable button (0), and drop it entirely when disabled — so the\n // nav buttons appear in the roving tab order exactly as upstream does.\n tabindex={isDisabled() ? undefined : 0}\n onClick={(event) => {\n const click = buttonProps().onClick as\n | ((event: MouseEvent & { currentTarget: HTMLButtonElement }) => void)\n | undefined;\n click?.(event);\n if (!isDisabled()) {\n event.currentTarget.focus();\n }\n }}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of calendar cells.\n */\nexport function CalendarGrid(props: CalendarGridProps): JSX.Element {\n const state = useCalendarContext();\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 get startDate() {\n return startDate();\n },\n get endDate() {\n return endOfMonth(startDate());\n },\n get weekdayStyle() {\n return props.weekdayStyle;\n },\n },\n state,\n gridRef,\n );\n\n const renderValues = createMemo<CalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-CalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize ALL dates for the grid at once to avoid reactive loops.\n // This breaks the cycle where accessing visibleRange() inside For loop\n // would cause infinite re-renders.\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 <CalendarGridMonthContext 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 scope=\"col\" class={props.headerCellClass ?? \"solidaria-CalendarHeaderCell\"}>\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 <CalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </CalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n </CalendarGridMonthContext>\n );\n}\n\nexport function CalendarGridHeader(props: CalendarGridHeaderProps): JSX.Element {\n return (\n <thead class={props.class ?? \"solidaria-CalendarGridHeader\"} style={props.style}>\n {props.children}\n </thead>\n );\n}\n\nexport function CalendarGridBody(props: CalendarGridBodyProps): JSX.Element {\n return (\n <tbody class={props.class ?? \"solidaria-CalendarGridBody\"} style={props.style}>\n {props.children}\n </tbody>\n );\n}\n\nexport function CalendarHeaderCell(props: CalendarHeaderCellProps): JSX.Element {\n return (\n <th scope=\"col\" class={props.class ?? \"solidaria-CalendarHeaderCell\"} style={props.style}>\n {props.children}\n </th>\n );\n}\n\n/**\n * A cell in the calendar grid representing a single day.\n */\nexport function CalendarCell(props: CalendarCellProps): JSX.Element {\n const state = useCalendarContext();\n const currentMonthStart = useContext(CalendarGridMonthContext);\n const cellPosition = useContext(CalendarGridCellPositionContext);\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 = createCalendarCell(\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<CalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\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-CalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-CalendarCellWrapper\",\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 {...coerceDomRecord(cellAria.buttonProps as Record<string, unknown>)}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\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 { CalendarState, CalendarDate, DateValue };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAASA,YAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAuHA,MAAa,kBAAkB,cAA+C,IAAI;AAClF,MAAM,2BAA2B,cAA6C,IAAI;AAClF,MAAM,kCAAkC,cAI7B,IAAI;AAEf,SAAgB,qBAA+C;CAC7D,MAAM,UAAU,WAAW,eAAe;CAC1C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,oDAAoD;CAEtE,OAAO;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,SAGd,OAAyC;CACzC,MAAM,iBAAiB,WAAW,eAAe;CAEjD,OACE,CAAC,KAAK,MAAM,gBAAgB,UAAU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alendarMonthPicker / CalendarYearPicker components for solidaria-components
|
|
3
|
-
*
|
|
4
|
-
* Headless month/year "jump-to" pickers shared by Calendar and RangeCalendar.
|
|
5
|
-
* Each reads whichever calendar state context is present and renders through a
|
|
6
|
-
* child function, mirroring the single context-agnostic components upstream.
|
|
7
|
-
* Port of react-aria-components/src/Calendar.tsx (CalendarMonthPicker /
|
|
8
|
-
* CalendarYearPicker).
|
|
9
|
-
*/
|
|
10
|
-
import { type JSX } from "solid-js";
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
11
2
|
import { type CalendarMonthPickerProps as AriaCalendarMonthPickerProps, type CalendarMonthPickerAria, type CalendarYearPickerProps as AriaCalendarYearPickerProps, type CalendarYearPickerAria } from "@proyecto-viviana/solidaria";
|
|
12
3
|
export type { CalendarMonthPickerAria, CalendarMonthPickerItem, CalendarYearPickerAria, CalendarYearPickerItem, CalendarYearPickerFormatOptions, } from "@proyecto-viviana/solidaria";
|
|
13
4
|
export interface CalendarMonthPickerProps extends AriaCalendarMonthPickerProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarPicker.d.ts","sourceRoot":"","sources":["../src/CalendarPicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CalendarPicker.d.ts","sourceRoot":"","sources":["../src/CalendarPicker.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAGL,KAAK,wBAAwB,IAAI,4BAA4B,EAC7D,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,KAAK,sBAAsB,EAC5B,MAAM,6BAA6B,CAAC;AAKrC,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC5E,0EAA0E;IAC1E,QAAQ,EAAE,CAAC,WAAW,EAAE,uBAAuB,KAAK,GAAG,CAAC,OAAO,CAAC;CACjE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAShF;AAED,MAAM,WAAW,uBAAwB,SAAQ,2BAA2B;IAC1E,yEAAyE;IACzE,QAAQ,EAAE,CAAC,WAAW,EAAE,sBAAsB,KAAK,GAAG,CAAC,OAAO,CAAC;CAChE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAS9E"}
|
package/dist/CalendarPicker.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
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
|
|
1
13
|
import { CalendarContext } from "./Calendar.js";
|
|
2
14
|
import { RangeCalendarContext } from "./RangeCalendar.js";
|
|
3
15
|
import { useContext } from "solid-js";
|