@react-spectrum/s2 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/CenterBaseline.cjs +12 -0
- package/dist/exports/CenterBaseline.cjs.map +1 -0
- package/dist/exports/CenterBaseline.mjs +7 -0
- package/dist/exports/CenterBaseline.mjs.map +1 -0
- package/dist/exports/Skeleton.cjs +1 -0
- package/dist/exports/Skeleton.cjs.map +1 -1
- package/dist/exports/Skeleton.mjs +2 -2
- package/dist/exports/Skeleton.mjs.map +1 -1
- package/dist/exports/index.cjs +3 -0
- package/dist/exports/index.cjs.map +1 -1
- package/dist/exports/index.mjs +3 -1
- package/dist/exports/index.mjs.map +1 -1
- package/dist/private/Accordion.cjs +2 -2
- package/dist/private/Accordion.css +2 -2
- package/dist/private/Accordion.mjs +2 -2
- package/dist/private/ActionBar.cjs +59 -59
- package/dist/private/ActionBar.cjs.map +1 -1
- package/dist/private/ActionBar.css +58 -58
- package/dist/private/ActionBar.css.map +1 -1
- package/dist/private/ActionBar.mjs +59 -59
- package/dist/private/ActionBar.mjs.map +1 -1
- package/dist/private/ActionButton.cjs +247 -247
- package/dist/private/ActionButton.cjs.map +1 -1
- package/dist/private/ActionButton.css +169 -169
- package/dist/private/ActionButton.css.map +1 -1
- package/dist/private/ActionButton.mjs +247 -247
- package/dist/private/ActionButton.mjs.map +1 -1
- package/dist/private/ActionButtonGroup.cjs +15 -15
- package/dist/private/ActionButtonGroup.css +9 -9
- package/dist/private/ActionButtonGroup.mjs +15 -15
- package/dist/private/ActionMenu.cjs.map +1 -1
- package/dist/private/ActionMenu.mjs.map +1 -1
- package/dist/private/Add.cjs +10 -10
- package/dist/private/Add.css +6 -6
- package/dist/private/Add.mjs +10 -10
- package/dist/private/AlertDialog.cjs +3 -3
- package/dist/private/AlertDialog.cjs.map +1 -1
- package/dist/private/AlertDialog.css +3 -3
- package/dist/private/AlertDialog.css.map +1 -1
- package/dist/private/AlertDialog.mjs +3 -3
- package/dist/private/AlertDialog.mjs.map +1 -1
- package/dist/private/Asterisk.cjs +6 -6
- package/dist/private/Asterisk.css +4 -4
- package/dist/private/Asterisk.mjs +6 -6
- package/dist/private/Avatar.cjs +16 -16
- package/dist/private/Avatar.css +16 -16
- package/dist/private/Avatar.mjs +16 -16
- package/dist/private/AvatarGroup.cjs +120 -120
- package/dist/private/AvatarGroup.css +31 -31
- package/dist/private/AvatarGroup.mjs +120 -120
- package/dist/private/Badge.cjs +197 -197
- package/dist/private/Badge.css +125 -125
- package/dist/private/Badge.mjs +197 -197
- package/dist/private/Breadcrumbs.cjs +234 -234
- package/dist/private/Breadcrumbs.cjs.map +1 -1
- package/dist/private/Breadcrumbs.css +100 -100
- package/dist/private/Breadcrumbs.css.map +1 -1
- package/dist/private/Breadcrumbs.mjs +234 -234
- package/dist/private/Breadcrumbs.mjs.map +1 -1
- package/dist/private/Button.cjs +335 -326
- package/dist/private/Button.cjs.map +1 -1
- package/dist/private/Button.css +176 -172
- package/dist/private/Button.css.map +1 -1
- package/dist/private/Button.mjs +335 -326
- package/dist/private/Button.mjs.map +1 -1
- package/dist/private/ButtonGroup.cjs +23 -20
- package/dist/private/ButtonGroup.cjs.map +1 -1
- package/dist/private/ButtonGroup.css +19 -15
- package/dist/private/ButtonGroup.css.map +1 -1
- package/dist/private/ButtonGroup.mjs +23 -20
- package/dist/private/ButtonGroup.mjs.map +1 -1
- package/dist/private/Calendar.cjs +232 -232
- package/dist/private/Calendar.cjs.map +1 -1
- package/dist/private/Calendar.css +149 -149
- package/dist/private/Calendar.css.map +1 -1
- package/dist/private/Calendar.mjs +232 -232
- package/dist/private/Calendar.mjs.map +1 -1
- package/dist/private/Card.cjs +309 -309
- package/dist/private/Card.css +206 -206
- package/dist/private/Card.mjs +309 -309
- package/dist/private/CardView.cjs +17 -17
- package/dist/private/CardView.css +17 -17
- package/dist/private/CardView.mjs +17 -17
- package/dist/private/CenterBaseline.cjs +1 -1
- package/dist/private/CenterBaseline.cjs.map +1 -1
- package/dist/private/CenterBaseline.css +2 -2
- package/dist/private/CenterBaseline.css.map +1 -1
- package/dist/private/CenterBaseline.mjs +1 -1
- package/dist/private/CenterBaseline.mjs.map +1 -1
- package/dist/private/Checkbox.cjs +188 -188
- package/dist/private/Checkbox.css +110 -110
- package/dist/private/Checkbox.mjs +188 -188
- package/dist/private/CheckboxGroup.cjs +43 -43
- package/dist/private/CheckboxGroup.css +37 -37
- package/dist/private/CheckboxGroup.mjs +43 -43
- package/dist/private/Checkmark.cjs +12 -12
- package/dist/private/Checkmark.css +8 -8
- package/dist/private/Checkmark.mjs +12 -12
- package/dist/private/Chevron.cjs +12 -12
- package/dist/private/Chevron.css +10 -10
- package/dist/private/Chevron.mjs +12 -12
- package/dist/private/ClearButton.cjs +30 -30
- package/dist/private/ClearButton.css +30 -30
- package/dist/private/ClearButton.mjs +30 -30
- package/dist/private/CloseButton.cjs +52 -52
- package/dist/private/CloseButton.cjs.map +1 -1
- package/dist/private/CloseButton.css +46 -46
- package/dist/private/CloseButton.css.map +1 -1
- package/dist/private/CloseButton.mjs +52 -52
- package/dist/private/CloseButton.mjs.map +1 -1
- package/dist/private/ColorArea.cjs +16 -16
- package/dist/private/ColorArea.css +16 -16
- package/dist/private/ColorArea.mjs +16 -16
- package/dist/private/ColorField.cjs +31 -31
- package/dist/private/ColorField.css +27 -27
- package/dist/private/ColorField.mjs +31 -31
- package/dist/private/ColorHandle.cjs +27 -27
- package/dist/private/ColorHandle.css +42 -42
- package/dist/private/ColorHandle.mjs +27 -27
- package/dist/private/ColorSlider.cjs +108 -108
- package/dist/private/ColorSlider.css +52 -52
- package/dist/private/ColorSlider.mjs +108 -108
- package/dist/private/ColorSwatch.cjs +29 -29
- package/dist/private/ColorSwatch.css +29 -29
- package/dist/private/ColorSwatch.mjs +29 -29
- package/dist/private/ColorSwatchPicker.cjs +29 -29
- package/dist/private/ColorSwatchPicker.css +48 -48
- package/dist/private/ColorSwatchPicker.mjs +29 -29
- package/dist/private/ColorWheel.cjs +26 -26
- package/dist/private/ColorWheel.css +17 -17
- package/dist/private/ColorWheel.mjs +26 -26
- package/dist/private/ComboBox.cjs +381 -381
- package/dist/private/ComboBox.cjs.map +1 -1
- package/dist/private/ComboBox.css +188 -188
- package/dist/private/ComboBox.css.map +1 -1
- package/dist/private/ComboBox.mjs +381 -381
- package/dist/private/ComboBox.mjs.map +1 -1
- package/dist/private/ContextualHelp.cjs +5 -5
- package/dist/private/ContextualHelp.cjs.map +1 -1
- package/dist/private/ContextualHelp.css +50 -50
- package/dist/private/ContextualHelp.css.map +1 -1
- package/dist/private/ContextualHelp.mjs +5 -5
- package/dist/private/ContextualHelp.mjs.map +1 -1
- package/dist/private/CornerTriangle.cjs +8 -8
- package/dist/private/CornerTriangle.css +6 -6
- package/dist/private/CornerTriangle.mjs +8 -8
- package/dist/private/Cross.cjs +14 -14
- package/dist/private/Cross.css +10 -10
- package/dist/private/Cross.mjs +14 -14
- package/dist/private/CustomDialog.cjs +25 -25
- package/dist/private/CustomDialog.css +25 -25
- package/dist/private/CustomDialog.mjs +25 -25
- package/dist/private/Dash.cjs +10 -10
- package/dist/private/Dash.css +6 -6
- package/dist/private/Dash.mjs +10 -10
- package/dist/private/DateField.cjs +73 -73
- package/dist/private/DateField.css +77 -77
- package/dist/private/DateField.mjs +73 -73
- package/dist/private/DatePicker.cjs +172 -172
- package/dist/private/DatePicker.cjs.map +1 -1
- package/dist/private/DatePicker.css +128 -128
- package/dist/private/DatePicker.css.map +1 -1
- package/dist/private/DatePicker.mjs +172 -172
- package/dist/private/DatePicker.mjs.map +1 -1
- package/dist/private/DateRangePicker.cjs +55 -55
- package/dist/private/DateRangePicker.cjs.map +1 -1
- package/dist/private/DateRangePicker.css +59 -59
- package/dist/private/DateRangePicker.css.map +1 -1
- package/dist/private/DateRangePicker.mjs +55 -55
- package/dist/private/DateRangePicker.mjs.map +1 -1
- package/dist/private/Dialog.cjs +17 -17
- package/dist/private/Dialog.css +70 -70
- package/dist/private/Dialog.mjs +17 -17
- package/dist/private/Disclosure.cjs +144 -122
- package/dist/private/Disclosure.cjs.map +1 -1
- package/dist/private/Disclosure.css +112 -112
- package/dist/private/Disclosure.css.map +1 -1
- package/dist/private/Disclosure.mjs +144 -122
- package/dist/private/Disclosure.mjs.map +1 -1
- package/dist/private/Divider.cjs +25 -25
- package/dist/private/Divider.css +25 -25
- package/dist/private/Divider.mjs +25 -25
- package/dist/private/DragHandle.cjs +8 -8
- package/dist/private/DragHandle.css +6 -6
- package/dist/private/DragHandle.mjs +8 -8
- package/dist/private/DragPreview.cjs +154 -154
- package/dist/private/DragPreview.css +106 -106
- package/dist/private/DragPreview.mjs +154 -154
- package/dist/private/DropZone.cjs +61 -61
- package/dist/private/DropZone.cjs.map +1 -1
- package/dist/private/DropZone.css +57 -57
- package/dist/private/DropZone.css.map +1 -1
- package/dist/private/DropZone.mjs +61 -61
- package/dist/private/DropZone.mjs.map +1 -1
- package/dist/private/Field.cjs +360 -360
- package/dist/private/Field.cjs.map +1 -1
- package/dist/private/Field.css +160 -160
- package/dist/private/Field.css.map +1 -1
- package/dist/private/Field.mjs +360 -360
- package/dist/private/Field.mjs.map +1 -1
- package/dist/private/Form.cjs +9 -9
- package/dist/private/Form.css +9 -9
- package/dist/private/Form.mjs +9 -9
- package/dist/private/FullscreenDialog.cjs +5 -5
- package/dist/private/FullscreenDialog.css +78 -78
- package/dist/private/FullscreenDialog.mjs +5 -5
- package/dist/private/IllustratedMessage.cjs +228 -228
- package/dist/private/IllustratedMessage.css +72 -72
- package/dist/private/IllustratedMessage.mjs +228 -228
- package/dist/private/Image.cjs +14 -14
- package/dist/private/Image.css +14 -14
- package/dist/private/Image.mjs +14 -14
- package/dist/private/InlineAlert.cjs +100 -100
- package/dist/private/InlineAlert.cjs.map +1 -1
- package/dist/private/InlineAlert.css +76 -76
- package/dist/private/InlineAlert.css.map +1 -1
- package/dist/private/InlineAlert.mjs +100 -100
- package/dist/private/InlineAlert.mjs.map +1 -1
- package/dist/private/LabeledValue.cjs +134 -134
- package/dist/private/LabeledValue.css +63 -63
- package/dist/private/LabeledValue.mjs +134 -134
- package/dist/private/Link.cjs +49 -49
- package/dist/private/Link.css +41 -41
- package/dist/private/Link.mjs +49 -49
- package/dist/private/LinkOut.cjs +8 -8
- package/dist/private/LinkOut.css +8 -8
- package/dist/private/LinkOut.mjs +8 -8
- package/dist/private/ListView.cjs +245 -245
- package/dist/private/ListView.cjs.map +1 -1
- package/dist/private/ListView.css +177 -177
- package/dist/private/ListView.css.map +1 -1
- package/dist/private/ListView.mjs +245 -245
- package/dist/private/ListView.mjs.map +1 -1
- package/dist/private/Menu.cjs +446 -446
- package/dist/private/Menu.cjs.map +1 -1
- package/dist/private/Menu.css +196 -196
- package/dist/private/Menu.css.map +1 -1
- package/dist/private/Menu.mjs +446 -446
- package/dist/private/Menu.mjs.map +1 -1
- package/dist/private/Meter.cjs +153 -153
- package/dist/private/Meter.css +91 -91
- package/dist/private/Meter.mjs +153 -153
- package/dist/private/Modal.cjs +74 -74
- package/dist/private/Modal.css +59 -59
- package/dist/private/Modal.mjs +74 -74
- package/dist/private/NotificationBadge.cjs +56 -56
- package/dist/private/NotificationBadge.cjs.map +1 -1
- package/dist/private/NotificationBadge.css +49 -49
- package/dist/private/NotificationBadge.css.map +1 -1
- package/dist/private/NotificationBadge.mjs +56 -56
- package/dist/private/NotificationBadge.mjs.map +1 -1
- package/dist/private/NumberField.cjs +114 -114
- package/dist/private/NumberField.css +99 -99
- package/dist/private/NumberField.mjs +114 -114
- package/dist/private/Picker.cjs +275 -275
- package/dist/private/Picker.cjs.map +1 -1
- package/dist/private/Picker.css +173 -173
- package/dist/private/Picker.css.map +1 -1
- package/dist/private/Picker.mjs +275 -275
- package/dist/private/Picker.mjs.map +1 -1
- package/dist/private/Popover.cjs +95 -95
- package/dist/private/Popover.cjs.map +1 -1
- package/dist/private/Popover.css +75 -75
- package/dist/private/Popover.css.map +1 -1
- package/dist/private/Popover.mjs +95 -95
- package/dist/private/Popover.mjs.map +1 -1
- package/dist/private/ProgressBar.cjs +163 -163
- package/dist/private/ProgressBar.css +99 -99
- package/dist/private/ProgressBar.mjs +163 -163
- package/dist/private/ProgressCircle.cjs +34 -31
- package/dist/private/ProgressCircle.cjs.map +1 -1
- package/dist/private/ProgressCircle.css +24 -24
- package/dist/private/ProgressCircle.css.map +1 -1
- package/dist/private/ProgressCircle.mjs +34 -31
- package/dist/private/ProgressCircle.mjs.map +1 -1
- package/dist/private/Provider.cjs +19 -19
- package/dist/private/Provider.css +15 -15
- package/dist/private/Provider.mjs +19 -19
- package/dist/private/RadioGroup.cjs +208 -208
- package/dist/private/RadioGroup.css +113 -113
- package/dist/private/RadioGroup.mjs +208 -208
- package/dist/private/RangeCalendar.cjs +16 -16
- package/dist/private/RangeCalendar.cjs.map +1 -1
- package/dist/private/RangeCalendar.css +17 -17
- package/dist/private/RangeCalendar.css.map +1 -1
- package/dist/private/RangeCalendar.mjs +16 -16
- package/dist/private/RangeCalendar.mjs.map +1 -1
- package/dist/private/RangeSlider.cjs.map +1 -1
- package/dist/private/RangeSlider.mjs.map +1 -1
- package/dist/private/SearchField.cjs +41 -41
- package/dist/private/SearchField.css +45 -45
- package/dist/private/SearchField.mjs +41 -41
- package/dist/private/SegmentedControl.cjs +178 -178
- package/dist/private/SegmentedControl.css +123 -123
- package/dist/private/SegmentedControl.mjs +178 -178
- package/dist/private/SelectBoxGroup.cjs +142 -142
- package/dist/private/SelectBoxGroup.css +120 -120
- package/dist/private/SelectBoxGroup.mjs +142 -142
- package/dist/private/Slider.cjs +292 -292
- package/dist/private/Slider.css +159 -159
- package/dist/private/Slider.mjs +292 -292
- package/dist/private/StatusLight.cjs +115 -115
- package/dist/private/StatusLight.css +59 -59
- package/dist/private/StatusLight.mjs +115 -115
- package/dist/private/Switch.cjs +171 -171
- package/dist/private/Switch.css +85 -85
- package/dist/private/Switch.mjs +171 -171
- package/dist/private/TableView.cjs +551 -534
- package/dist/private/TableView.cjs.map +1 -1
- package/dist/private/TableView.css +329 -303
- package/dist/private/TableView.css.map +1 -1
- package/dist/private/TableView.mjs +551 -534
- package/dist/private/TableView.mjs.map +1 -1
- package/dist/private/Tabs.cjs +131 -125
- package/dist/private/Tabs.cjs.map +1 -1
- package/dist/private/Tabs.css +105 -105
- package/dist/private/Tabs.css.map +1 -1
- package/dist/private/Tabs.mjs +131 -125
- package/dist/private/Tabs.mjs.map +1 -1
- package/dist/private/TabsPicker.cjs +127 -127
- package/dist/private/TabsPicker.css +108 -108
- package/dist/private/TabsPicker.mjs +127 -127
- package/dist/private/TagGroup.cjs +203 -203
- package/dist/private/TagGroup.cjs.map +1 -1
- package/dist/private/TagGroup.css +146 -146
- package/dist/private/TagGroup.css.map +1 -1
- package/dist/private/TagGroup.mjs +203 -203
- package/dist/private/TagGroup.mjs.map +1 -1
- package/dist/private/TextField.cjs +58 -58
- package/dist/private/TextField.css +54 -54
- package/dist/private/TextField.mjs +58 -58
- package/dist/private/TimeField.cjs +51 -51
- package/dist/private/TimeField.css +47 -47
- package/dist/private/TimeField.mjs +51 -51
- package/dist/private/Toast.cjs +120 -120
- package/dist/private/Toast.cjs.map +1 -1
- package/dist/private/Toast.css +110 -110
- package/dist/private/Toast.css.map +1 -1
- package/dist/private/Toast.mjs +120 -120
- package/dist/private/Toast.mjs.map +1 -1
- package/dist/private/ToggleButton.cjs +16 -16
- package/dist/private/ToggleButton.css +23 -23
- package/dist/private/ToggleButton.mjs +16 -16
- package/dist/private/Tooltip.cjs +86 -86
- package/dist/private/Tooltip.css +70 -70
- package/dist/private/Tooltip.mjs +86 -86
- package/dist/private/TreeView.cjs +229 -229
- package/dist/private/TreeView.cjs.map +1 -1
- package/dist/private/TreeView.css +184 -184
- package/dist/private/TreeView.css.map +1 -1
- package/dist/private/TreeView.mjs +229 -229
- package/dist/private/TreeView.mjs.map +1 -1
- package/dist/private/dnd-utils.cjs +42 -42
- package/dist/private/dnd-utils.css +39 -39
- package/dist/private/dnd-utils.mjs +42 -42
- package/dist/types/exports/CenterBaseline.d.ts +1 -0
- package/dist/types/exports/Skeleton.d.ts +1 -1
- package/dist/types/exports/index.d.ts +1 -0
- package/dist/types/src/CenterBaseline.d.ts +17 -0
- package/dist/types/src/ContextualHelp.d.ts +1 -1
- package/dist/types/src/Disclosure.d.ts +6 -1
- package/dist/types/src/ListView.d.ts +1 -1
- package/dist/types/src/Menu.d.ts +1 -1
- package/dist/types/src/Popover.d.ts +2 -2
- package/dist/types/src/style-utils.d.ts +4 -1
- package/exports/CenterBaseline.ts +1 -0
- package/exports/Skeleton.ts +1 -1
- package/exports/index.ts +2 -0
- package/icons/Icon.cjs +10 -10
- package/icons/Icon.css +9 -9
- package/icons/Icon.mjs +10 -10
- package/icons/Skeleton.cjs +2 -2
- package/icons/Skeleton.css +6 -6
- package/icons/Skeleton.mjs +2 -2
- package/package.json +6 -6
- package/src/ActionBar.tsx +0 -1
- package/src/ActionButton.tsx +0 -1
- package/src/ActionMenu.tsx +0 -1
- package/src/AlertDialog.tsx +0 -1
- package/src/Breadcrumbs.tsx +0 -4
- package/src/Button.tsx +12 -3
- package/src/ButtonGroup.tsx +1 -0
- package/src/Calendar.tsx +0 -1
- package/src/CenterBaseline.tsx +17 -0
- package/src/CloseButton.tsx +0 -1
- package/src/ComboBox.tsx +0 -1
- package/src/ContextualHelp.tsx +1 -2
- package/src/DatePicker.tsx +0 -1
- package/src/DateRangePicker.tsx +0 -1
- package/src/Disclosure.tsx +92 -79
- package/src/DropZone.tsx +0 -1
- package/src/Field.tsx +0 -1
- package/src/InlineAlert.tsx +0 -1
- package/src/ListView.tsx +0 -2
- package/src/Menu.tsx +1 -8
- package/src/NotificationBadge.tsx +0 -1
- package/src/Picker.tsx +0 -1
- package/src/Popover.tsx +2 -1
- package/src/ProgressCircle.tsx +1 -1
- package/src/RangeCalendar.tsx +0 -1
- package/src/RangeSlider.tsx +0 -1
- package/src/TableView.tsx +75 -37
- package/src/Tabs.tsx +9 -2
- package/src/TagGroup.tsx +0 -1
- package/src/Toast.tsx +0 -3
- package/src/TreeView.tsx +0 -1
- package/src/style-utils.ts +13 -2
- package/style/__tests__/style-macro.test.js +73 -71
- package/style/dist/main.cjs +25 -25
- package/style/dist/module.mjs +13 -13
- package/style/dist/properties.mjs +3 -3
- package/style/dist/spectrum-theme.cjs +224 -224
- package/style/dist/spectrum-theme.mjs +217 -217
- package/style/dist/style-macro.cjs +100 -100
- package/style/dist/style-macro.mjs +94 -94
- package/style/dist/style-utils.cjs +51 -39
- package/style/dist/style-utils.cjs.map +1 -1
- package/style/dist/style-utils.mjs +50 -38
- package/style/dist/style-utils.mjs.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AC4FoB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAoDK;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6CjB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8Cc;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA0BU;;;;EAqCb;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6CG;;;;EAAA;;;;EAAA;;;;;AA3PF;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AA+IE;EAAA;IAAA","sources":["d4ca8e646fea5360","packages/@react-spectrum/s2/src/DatePicker.tsx"],"sourcesContent":["@import \"54172f634399832c\";\n@import \"fa2321f9143b745c\";\n@import \"8b549979924a612a\";\n@import \"b86e209972e15459\";\n@import \"8b256a2bed52f067\";\n@import \"5e26ccdc056a4ced\";\n@import \"fb93b5d68257fecd\";\n","/*\n * Copyright 2024 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\nimport {\n DatePicker as AriaDatePicker,\n DatePickerProps as AriaDatePickerProps,\n DateValue\n} from 'react-aria-components/DatePicker';\nimport {baseColor, focusRing, fontRelative, space, style} from '../style' with {type: 'macro'};\nimport {Button, ButtonRenderProps} from 'react-aria-components/Button';\nimport {Calendar, CalendarProps} from './Calendar';\nimport CalendarIcon from '../s2wf-icons/S2_Icon_Calendar_20_N.svg';\nimport {ContextValue, Provider} from 'react-aria-components/slots';\nimport {\n controlBorderRadius,\n field,\n fieldInput,\n getAllowedOverrides,\n StyleProps\n} from './style-utils' with {type: 'macro'};\nimport {\n createContext,\n forwardRef,\n ReactElement,\n ReactNode,\n Ref,\n useContext,\n useRef,\n useState\n} from 'react';\nimport {DateInput, DateInputContainer, InvalidIndicator} from './DateField';\nimport {Dialog, OverlayTriggerStateContext} from 'react-aria-components/Dialog';\nimport {FieldGroup, FieldLabel, HelpText} from './Field';\nimport {FormContext} from 'react-aria-components/Form';\nimport {\n forwardRefType,\n GlobalDOMAttributes,\n HelpTextProps,\n SpectrumLabelableProps\n} from '@react-types/shared';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Popover} from './Popover';\nimport {PopoverProps} from 'react-aria-components/Popover';\nimport {pressScale} from './pressScale';\nimport {TimeField} from './TimeField';\nimport {TimeValue} from 'react-aria-components/TimeField';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DatePickerProps<T extends DateValue>\n extends\n Omit<\n AriaDatePickerProps<T>,\n 'children' | 'className' | 'style' | 'render' | keyof GlobalDOMAttributes\n >,\n Pick<\n CalendarProps<T>,\n 'createCalendar' | 'pageBehavior' | 'firstDayOfWeek' | 'isDateUnavailable'\n >,\n Pick<PopoverProps, 'shouldFlip'>,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps {\n /**\n * The size of the DateField.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL';\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n}\n\nexport const DatePickerContext =\n createContext<ContextValue<Partial<DatePickerProps<any>>, HTMLDivElement>>(null);\n\nconst inputButton = style<ButtonRenderProps & {isOpen: boolean; size: 'S' | 'M' | 'L' | 'XL'}>({\n ...focusRing(),\n ...controlBorderRadius('sm'),\n position: 'relative',\n font: {\n size: {\n S: 'ui-sm',\n M: 'ui',\n L: 'ui-lg',\n XL: 'ui-xl'\n }\n },\n cursor: 'default',\n display: 'flex',\n textAlign: 'center',\n borderStyle: 'none',\n alignItems: 'center',\n justifyContent: 'center',\n width: {\n size: {\n S: 16,\n M: 20,\n L: 24,\n XL: 32\n }\n },\n height: 'auto',\n marginStart: 'text-to-control',\n aspectRatio: 'square',\n flexShrink: 0,\n transition: {\n default: 'default',\n forcedColors: 'none'\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isOpen: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n color: {\n default: baseColor('neutral'),\n isDisabled: 'disabled',\n forcedColors: 'ButtonFace'\n }\n});\n\nexport const timeField = style({\n flexShrink: 1,\n flexGrow: 0,\n minWidth: 0,\n width: 'unset'\n});\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DatePicker<\n T extends DateValue\n>(props: DatePickerProps<T>, ref: Ref<HTMLDivElement>): ReactElement {\n [props, ref] = useSpectrumContextProps(props, ref, DatePickerContext);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n label,\n contextualHelp,\n description: descriptionMessage,\n errorMessage,\n isRequired,\n size = 'M',\n labelPosition = 'top',\n necessityIndicator,\n labelAlign = 'start',\n UNSAFE_style,\n UNSAFE_className,\n styles,\n placeholderValue,\n maxVisibleMonths = 1,\n createCalendar,\n ...dateFieldProps\n } = props;\n let formContext = useContext(FormContext);\n let [buttonHasFocus, setButtonHasFocus] = useState(false);\n\n return (\n <AriaDatePicker\n ref={ref}\n isRequired={isRequired}\n {...dateFieldProps}\n style={UNSAFE_style}\n className={\n (UNSAFE_className || '') +\n style(field(), getAllowedOverrides())(\n {\n isInForm: !!formContext,\n labelPosition,\n size\n },\n styles\n )\n }>\n {({isDisabled, isInvalid, isOpen, state}) => {\n let placeholder: DateValue | undefined = placeholderValue ?? undefined;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : undefined;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : undefined;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : undefined;\n let timeGranularity =\n state.granularity === 'hour' ||\n state.granularity === 'minute' ||\n state.granularity === 'second'\n ? state.granularity\n : undefined;\n let showTimeField = !!timeGranularity;\n\n // Ideally, we could omit errorMessage here and let S2 Calendar read it from RAC's CalendarContext which already contains the resolved value via calendarProps from useDatePicker.\n // However, RAC's CalendarProps omits errorMessage, so reading it back from the context would require an unsafe cast. Instead, we resolve it here using the same logic as useDatePicker.\n let resolvedErrorMessage =\n typeof errorMessage === 'function'\n ? errorMessage(state.displayValidation)\n : errorMessage || state.displayValidation.validationErrors.join(' ');\n return (\n <>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup\n role=\"presentation\"\n shouldTurnOffFocusRing={buttonHasFocus}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n size={size}\n styles={style({\n ...fieldInput(),\n textWrap: 'nowrap',\n paddingStart: 'edge-to-text',\n paddingEnd: {\n size: {\n S: 2,\n M: 4,\n L: space(6),\n XL: space(6)\n }\n }\n })({size})}>\n <DateInputContainer>\n <DateInput />\n </DateInputContainer>\n <InvalidIndicator isInvalid={isInvalid} isDisabled={isDisabled} />\n <CalendarButton isOpen={isOpen} size={size} setButtonHasFocus={setButtonHasFocus} />\n </FieldGroup>\n <CalendarPopover shouldFlip={props.shouldFlip}>\n <Calendar\n visibleMonths={maxVisibleMonths}\n createCalendar={createCalendar}\n errorMessage={resolvedErrorMessage}\n />\n {showTimeField && (\n <div className={style({display: 'flex', gap: 16, contain: 'inline-size'})}>\n <TimeField\n styles={timeField}\n label={stringFormatter.format('datepicker.time')}\n value={state.timeValue}\n // TODO: why do i need the cast?\n onChange={v => state.setTimeValue(v as TimeValue)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n />\n </div>\n )}\n </CalendarPopover>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {resolvedErrorMessage}\n </HelpText>\n </>\n );\n }}\n </AriaDatePicker>\n );\n});\n\nexport function CalendarPopover(\n props: Omit<PopoverProps, 'children'> & {children: ReactNode}\n): ReactElement {\n return (\n <Popover {...props} hideArrow padding=\"none\">\n <div\n className={style({\n paddingX: 16,\n paddingY: 24,\n overflow: 'auto',\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n boxSizing: 'border-box',\n size: 'full'\n })}>\n <Dialog>\n <Provider values={[[OverlayTriggerStateContext, null]]}>{props.children}</Provider>\n </Dialog>\n </div>\n </Popover>\n );\n}\n\nexport function CalendarButton(props: {\n isOpen: boolean;\n size: 'S' | 'M' | 'L' | 'XL';\n setButtonHasFocus: (hasFocus: boolean) => void;\n}): ReactElement {\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {isOpen, size, setButtonHasFocus} = props;\n return (\n <Button\n ref={buttonRef}\n // Prevent press scale from sticking while DatePicker is open.\n // @ts-ignore\n isPressed={false}\n onFocusChange={setButtonHasFocus}\n style={pressScale(buttonRef)}\n className={renderProps =>\n inputButton({\n ...renderProps,\n size,\n isOpen\n })\n }>\n <Provider\n values={[\n [\n IconContext,\n {\n styles: style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n size: fontRelative(14)\n })\n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A;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AA+IE;EAAA;IAAA","sources":["d4ca8e646fea5360","packages/@react-spectrum/s2/src/DatePicker.tsx"],"sourcesContent":["@import \"54172f634399832c\";\n@import \"fa2321f9143b745c\";\n@import \"8b549979924a612a\";\n@import \"b86e209972e15459\";\n@import \"8b256a2bed52f067\";\n@import \"5e26ccdc056a4ced\";\n@import \"fb93b5d68257fecd\";\n","/*\n * Copyright 2024 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\nimport {\n DatePicker as AriaDatePicker,\n DatePickerProps as AriaDatePickerProps,\n DateValue\n} from 'react-aria-components/DatePicker';\nimport {baseColor, focusRing, fontRelative, space, style} from '../style' with {type: 'macro'};\nimport {Button, ButtonRenderProps} from 'react-aria-components/Button';\nimport {Calendar, CalendarProps} from './Calendar';\nimport CalendarIcon from '../s2wf-icons/S2_Icon_Calendar_20_N.svg';\nimport {ContextValue, Provider} from 'react-aria-components/slots';\nimport {\n controlBorderRadius,\n field,\n fieldInput,\n getAllowedOverrides,\n StyleProps\n} from './style-utils' with {type: 'macro'};\nimport {\n createContext,\n forwardRef,\n ReactElement,\n ReactNode,\n Ref,\n useContext,\n useRef,\n useState\n} from 'react';\nimport {DateInput, DateInputContainer, InvalidIndicator} from './DateField';\nimport {Dialog, OverlayTriggerStateContext} from 'react-aria-components/Dialog';\nimport {FieldGroup, FieldLabel, HelpText} from './Field';\nimport {FormContext} from 'react-aria-components/Form';\nimport {\n forwardRefType,\n GlobalDOMAttributes,\n HelpTextProps,\n SpectrumLabelableProps\n} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport intlMessages from '../intl/*.json';\nimport {Popover} from './Popover';\nimport {PopoverProps} from 'react-aria-components/Popover';\nimport {pressScale} from './pressScale';\nimport {TimeField} from './TimeField';\nimport {TimeValue} from 'react-aria-components/TimeField';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DatePickerProps<T extends DateValue>\n extends\n Omit<\n AriaDatePickerProps<T>,\n 'children' | 'className' | 'style' | 'render' | keyof GlobalDOMAttributes\n >,\n Pick<\n CalendarProps<T>,\n 'createCalendar' | 'pageBehavior' | 'firstDayOfWeek' | 'isDateUnavailable'\n >,\n Pick<PopoverProps, 'shouldFlip'>,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps {\n /**\n * The size of the DateField.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL';\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n}\n\nexport const DatePickerContext =\n createContext<ContextValue<Partial<DatePickerProps<any>>, HTMLDivElement>>(null);\n\nconst inputButton = style<ButtonRenderProps & {isOpen: boolean; size: 'S' | 'M' | 'L' | 'XL'}>({\n ...focusRing(),\n ...controlBorderRadius('sm'),\n position: 'relative',\n font: {\n size: {\n S: 'ui-sm',\n M: 'ui',\n L: 'ui-lg',\n XL: 'ui-xl'\n }\n },\n cursor: 'default',\n display: 'flex',\n textAlign: 'center',\n borderStyle: 'none',\n alignItems: 'center',\n justifyContent: 'center',\n width: {\n size: {\n S: 16,\n M: 20,\n L: 24,\n XL: 32\n }\n },\n height: 'auto',\n marginStart: 'text-to-control',\n aspectRatio: 'square',\n flexShrink: 0,\n transition: {\n default: 'default',\n forcedColors: 'none'\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isOpen: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n color: {\n default: baseColor('neutral'),\n isDisabled: 'disabled',\n forcedColors: 'ButtonFace'\n }\n});\n\nexport const timeField = style({\n flexShrink: 1,\n flexGrow: 0,\n minWidth: 0,\n width: 'unset'\n});\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DatePicker<\n T extends DateValue\n>(props: DatePickerProps<T>, ref: Ref<HTMLDivElement>): ReactElement {\n [props, ref] = useSpectrumContextProps(props, ref, DatePickerContext);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n label,\n contextualHelp,\n description: descriptionMessage,\n errorMessage,\n isRequired,\n size = 'M',\n labelPosition = 'top',\n necessityIndicator,\n labelAlign = 'start',\n UNSAFE_style,\n UNSAFE_className,\n styles,\n placeholderValue,\n maxVisibleMonths = 1,\n createCalendar,\n ...dateFieldProps\n } = props;\n let formContext = useContext(FormContext);\n let [buttonHasFocus, setButtonHasFocus] = useState(false);\n\n return (\n <AriaDatePicker\n ref={ref}\n isRequired={isRequired}\n {...dateFieldProps}\n style={UNSAFE_style}\n className={\n (UNSAFE_className || '') +\n style(field(), getAllowedOverrides())(\n {\n isInForm: !!formContext,\n labelPosition,\n size\n },\n styles\n )\n }>\n {({isDisabled, isInvalid, isOpen, state}) => {\n let placeholder: DateValue | undefined = placeholderValue ?? undefined;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : undefined;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : undefined;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : undefined;\n let timeGranularity =\n state.granularity === 'hour' ||\n state.granularity === 'minute' ||\n state.granularity === 'second'\n ? state.granularity\n : undefined;\n let showTimeField = !!timeGranularity;\n\n // Ideally, we could omit errorMessage here and let S2 Calendar read it from RAC's CalendarContext which already contains the resolved value via calendarProps from useDatePicker.\n // However, RAC's CalendarProps omits errorMessage, so reading it back from the context would require an unsafe cast. Instead, we resolve it here using the same logic as useDatePicker.\n let resolvedErrorMessage =\n typeof errorMessage === 'function'\n ? errorMessage(state.displayValidation)\n : errorMessage || state.displayValidation.validationErrors.join(' ');\n return (\n <>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup\n role=\"presentation\"\n shouldTurnOffFocusRing={buttonHasFocus}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n size={size}\n styles={style({\n ...fieldInput(),\n textWrap: 'nowrap',\n paddingStart: 'edge-to-text',\n paddingEnd: {\n size: {\n S: 2,\n M: 4,\n L: space(6),\n XL: space(6)\n }\n }\n })({size})}>\n <DateInputContainer>\n <DateInput />\n </DateInputContainer>\n <InvalidIndicator isInvalid={isInvalid} isDisabled={isDisabled} />\n <CalendarButton isOpen={isOpen} size={size} setButtonHasFocus={setButtonHasFocus} />\n </FieldGroup>\n <CalendarPopover shouldFlip={props.shouldFlip}>\n <Calendar\n visibleMonths={maxVisibleMonths}\n createCalendar={createCalendar}\n errorMessage={resolvedErrorMessage}\n />\n {showTimeField && (\n <div className={style({display: 'flex', gap: 16, contain: 'inline-size'})}>\n <TimeField\n styles={timeField}\n label={stringFormatter.format('datepicker.time')}\n value={state.timeValue}\n // TODO: why do i need the cast?\n onChange={v => state.setTimeValue(v as TimeValue)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n />\n </div>\n )}\n </CalendarPopover>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {resolvedErrorMessage}\n </HelpText>\n </>\n );\n }}\n </AriaDatePicker>\n );\n});\n\nexport function CalendarPopover(\n props: Omit<PopoverProps, 'children'> & {children: ReactNode}\n): ReactElement {\n return (\n <Popover {...props} hideArrow padding=\"none\">\n <div\n className={style({\n paddingX: 16,\n paddingY: 24,\n overflow: 'auto',\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n boxSizing: 'border-box',\n size: 'full'\n })}>\n <Dialog>\n <Provider values={[[OverlayTriggerStateContext, null]]}>{props.children}</Provider>\n </Dialog>\n </div>\n </Popover>\n );\n}\n\nexport function CalendarButton(props: {\n isOpen: boolean;\n size: 'S' | 'M' | 'L' | 'XL';\n setButtonHasFocus: (hasFocus: boolean) => void;\n}): ReactElement {\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {isOpen, size, setButtonHasFocus} = props;\n return (\n <Button\n ref={buttonRef}\n // Prevent press scale from sticking while DatePicker is open.\n // @ts-ignore\n isPressed={false}\n onFocusChange={setButtonHasFocus}\n style={pressScale(buttonRef)}\n className={renderProps =>\n inputButton({\n ...renderProps,\n size,\n isOpen\n })\n }>\n <Provider\n values={[\n [\n IconContext,\n {\n styles: style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n size: fontRelative(14)\n })\n }\n ]\n ]}>\n <CalendarIcon />\n </Provider>\n </Button>\n );\n}\n"],"names":[],"version":3,"file":"DatePicker.css.map"}
|
|
@@ -53,146 +53,146 @@ function $parcel$interopDefault(a) {
|
|
|
53
53
|
const $1196aa313ab37be1$export$cf316c7f3b44c11e = /*#__PURE__*/ (0, $djrek$createContext)(null);
|
|
54
54
|
const $1196aa313ab37be1$var$inputButton = function anonymous(props) {
|
|
55
55
|
let rules = " ";
|
|
56
|
-
if (props.isFocusVisible) rules += '
|
|
57
|
-
else rules += '
|
|
58
|
-
rules += '
|
|
59
|
-
rules += '
|
|
60
|
-
rules += '
|
|
61
|
-
rules += '
|
|
62
|
-
if (props.size === "XL") rules += ' -SFnbic-
|
|
63
|
-
else if (props.size === "L") rules += ' -SFnbic-
|
|
64
|
-
else if (props.size === "S") rules += ' -SFnbic-
|
|
65
|
-
else if (props.size === "XS") rules += ' -SFnbic-
|
|
66
|
-
else rules += ' -SFnbic-
|
|
67
|
-
rules += ' -Bu7z1c-
|
|
68
|
-
rules += '
|
|
69
|
-
rules += '
|
|
70
|
-
rules += '
|
|
71
|
-
rules += '
|
|
72
|
-
rules += '
|
|
56
|
+
if (props.isFocusVisible) rules += ' _Lf151';
|
|
57
|
+
else rules += ' _Le151';
|
|
58
|
+
rules += ' Oh151';
|
|
59
|
+
rules += ' Olc151';
|
|
60
|
+
rules += ' _Mc151';
|
|
61
|
+
rules += ' _Kd151';
|
|
62
|
+
if (props.size === "XL") rules += ' -SFnbic-_JaP8ec151';
|
|
63
|
+
else if (props.size === "L") rules += ' -SFnbic-_J0K2hn151';
|
|
64
|
+
else if (props.size === "S") rules += ' -SFnbic-_JJOW22b151';
|
|
65
|
+
else if (props.size === "XS") rules += ' -SFnbic-_JICefdd151';
|
|
66
|
+
else rules += ' -SFnbic-_Jb151';
|
|
67
|
+
rules += ' -Bu7z1c-oa151';
|
|
68
|
+
rules += ' oj151';
|
|
69
|
+
rules += ' nj151';
|
|
70
|
+
rules += ' kj151';
|
|
71
|
+
rules += ' jj151';
|
|
72
|
+
rules += ' _Pc151';
|
|
73
73
|
if (props.size === "XL") {
|
|
74
|
-
rules += '
|
|
75
|
-
rules += '
|
|
76
|
-
rules += '
|
|
77
|
-
rules += '
|
|
78
|
-
rules += '
|
|
79
|
-
rules += '
|
|
80
|
-
rules += '
|
|
81
|
-
rules += '
|
|
82
|
-
rules += '
|
|
74
|
+
rules += ' uk151';
|
|
75
|
+
rules += ' ucJ9TBTb151';
|
|
76
|
+
rules += ' ud3Euai151';
|
|
77
|
+
rules += ' uea151';
|
|
78
|
+
rules += ' ugb151';
|
|
79
|
+
rules += ' uhd151';
|
|
80
|
+
rules += ' uje151';
|
|
81
|
+
rules += ' u2NhKxcl151';
|
|
82
|
+
rules += ' uic151';
|
|
83
83
|
} else if (props.size === "L") {
|
|
84
|
-
rules += '
|
|
85
|
-
rules += '
|
|
86
|
-
rules += '
|
|
87
|
-
rules += '
|
|
88
|
-
rules += '
|
|
89
|
-
rules += '
|
|
90
|
-
rules += '
|
|
91
|
-
rules += '
|
|
92
|
-
rules += '
|
|
84
|
+
rules += ' uk151';
|
|
85
|
+
rules += ' ucJ9TBTb151';
|
|
86
|
+
rules += ' ud3Euai151';
|
|
87
|
+
rules += ' uea151';
|
|
88
|
+
rules += ' ugb151';
|
|
89
|
+
rules += ' uhd151';
|
|
90
|
+
rules += ' uje151';
|
|
91
|
+
rules += ' u2NhKxcl151';
|
|
92
|
+
rules += ' uic151';
|
|
93
93
|
} else if (props.size === "M") {
|
|
94
|
-
rules += '
|
|
95
|
-
rules += '
|
|
96
|
-
rules += '
|
|
97
|
-
rules += '
|
|
98
|
-
rules += '
|
|
99
|
-
rules += '
|
|
100
|
-
rules += '
|
|
101
|
-
rules += '
|
|
102
|
-
rules += '
|
|
94
|
+
rules += ' uk151';
|
|
95
|
+
rules += ' ucJ9TBTb151';
|
|
96
|
+
rules += ' ud3Euai151';
|
|
97
|
+
rules += ' uea151';
|
|
98
|
+
rules += ' ugb151';
|
|
99
|
+
rules += ' uhd151';
|
|
100
|
+
rules += ' uje151';
|
|
101
|
+
rules += ' u2NhKxcl151';
|
|
102
|
+
rules += ' uic151';
|
|
103
103
|
} else if (props.size === "S") {
|
|
104
|
-
rules += '
|
|
105
|
-
rules += '
|
|
106
|
-
rules += '
|
|
107
|
-
rules += '
|
|
108
|
-
rules += '
|
|
109
|
-
rules += '
|
|
110
|
-
rules += '
|
|
111
|
-
rules += '
|
|
112
|
-
rules += '
|
|
104
|
+
rules += ' uk151';
|
|
105
|
+
rules += ' ucJ9TBTb151';
|
|
106
|
+
rules += ' ud3Euai151';
|
|
107
|
+
rules += ' uea151';
|
|
108
|
+
rules += ' ugb151';
|
|
109
|
+
rules += ' uhd151';
|
|
110
|
+
rules += ' uje151';
|
|
111
|
+
rules += ' u2NhKxcl151';
|
|
112
|
+
rules += ' uic151';
|
|
113
113
|
}
|
|
114
114
|
if (props.size === "XL") {
|
|
115
|
-
rules += ' -_6BNtrc-
|
|
116
|
-
rules += '
|
|
115
|
+
rules += ' -_6BNtrc-e151';
|
|
116
|
+
rules += ' vx151';
|
|
117
117
|
} else if (props.size === "L") {
|
|
118
|
-
rules += ' -_6BNtrc-
|
|
119
|
-
rules += '
|
|
118
|
+
rules += ' -_6BNtrc-d151';
|
|
119
|
+
rules += ' vx151';
|
|
120
120
|
} else if (props.size === "M") {
|
|
121
|
-
rules += ' -_6BNtrc-
|
|
122
|
-
rules += '
|
|
121
|
+
rules += ' -_6BNtrc-c151';
|
|
122
|
+
rules += ' vx151';
|
|
123
123
|
} else if (props.size === "S") {
|
|
124
|
-
rules += ' -_6BNtrc-
|
|
125
|
-
rules += '
|
|
124
|
+
rules += ' -_6BNtrc-b151';
|
|
125
|
+
rules += ' vx151';
|
|
126
126
|
}
|
|
127
127
|
if (props.size === "XL") {
|
|
128
|
-
rules += '
|
|
129
|
-
rules += '
|
|
128
|
+
rules += ' xb151';
|
|
129
|
+
rules += ' _xa151';
|
|
130
130
|
} else if (props.size === "L") {
|
|
131
|
-
rules += '
|
|
132
|
-
rules += '
|
|
131
|
+
rules += ' xb151';
|
|
132
|
+
rules += ' _xa151';
|
|
133
133
|
} else if (props.size === "M") {
|
|
134
|
-
rules += '
|
|
135
|
-
rules += '
|
|
134
|
+
rules += ' xb151';
|
|
135
|
+
rules += ' _xa151';
|
|
136
136
|
} else if (props.size === "S") {
|
|
137
|
-
rules += '
|
|
138
|
-
rules += '
|
|
137
|
+
rules += ' xb151';
|
|
138
|
+
rules += ' _xa151';
|
|
139
139
|
}
|
|
140
140
|
if (props.size === "XL") {
|
|
141
|
-
rules += '
|
|
142
|
-
rules += '
|
|
141
|
+
rules += ' _Fd151';
|
|
142
|
+
rules += ' _FnuYUweb151';
|
|
143
143
|
} else if (props.size === "L") {
|
|
144
|
-
rules += '
|
|
145
|
-
rules += '
|
|
144
|
+
rules += ' _Fd151';
|
|
145
|
+
rules += ' _FnuYUweb151';
|
|
146
146
|
} else if (props.size === "M") {
|
|
147
|
-
rules += '
|
|
148
|
-
rules += '
|
|
147
|
+
rules += ' _Fd151';
|
|
148
|
+
rules += ' _FnuYUweb151';
|
|
149
149
|
} else if (props.size === "S") {
|
|
150
|
-
rules += '
|
|
151
|
-
rules += '
|
|
150
|
+
rules += ' _Fd151';
|
|
151
|
+
rules += ' _FnuYUweb151';
|
|
152
152
|
}
|
|
153
|
-
if (props.isDisabled) rules += '
|
|
153
|
+
if (props.isDisabled) rules += ' pp151';
|
|
154
154
|
else {
|
|
155
|
-
if (props.isPressed) rules += '
|
|
156
|
-
else if (props.isFocusVisible) rules += '
|
|
157
|
-
else if (props.isHovered) rules += '
|
|
158
|
-
else rules += '
|
|
155
|
+
if (props.isPressed) rules += ' po151';
|
|
156
|
+
else if (props.isFocusVisible) rules += ' po151';
|
|
157
|
+
else if (props.isHovered) rules += ' po151';
|
|
158
|
+
else rules += ' pt151';
|
|
159
159
|
}
|
|
160
|
-
rules += '
|
|
161
|
-
rules += '
|
|
162
|
-
rules += '
|
|
163
|
-
rules += '
|
|
164
|
-
rules += '
|
|
165
|
-
rules += '
|
|
166
|
-
rules += '
|
|
167
|
-
if (props.size === "XL") rules += '
|
|
168
|
-
else if (props.size === "L") rules += '
|
|
169
|
-
else if (props.size === "M") rules += '
|
|
170
|
-
else if (props.size === "S") rules += '
|
|
171
|
-
rules += '
|
|
172
|
-
rules += '
|
|
173
|
-
rules += '
|
|
174
|
-
rules += '
|
|
175
|
-
rules += '
|
|
176
|
-
rules += '
|
|
177
|
-
rules += '
|
|
178
|
-
rules += '
|
|
179
|
-
rules += '
|
|
180
|
-
rules += '
|
|
181
|
-
if (props.isDisabled) rules += '
|
|
182
|
-
else if (props.isOpen) rules += '
|
|
160
|
+
rules += ' pla151';
|
|
161
|
+
rules += ' ri151';
|
|
162
|
+
rules += ' sd151';
|
|
163
|
+
rules += ' _Wa151';
|
|
164
|
+
rules += ' _je151';
|
|
165
|
+
rules += ' eb151';
|
|
166
|
+
rules += ' _Ca151';
|
|
167
|
+
if (props.size === "XL") rules += ' ZC151';
|
|
168
|
+
else if (props.size === "L") rules += ' Zo151';
|
|
169
|
+
else if (props.size === "M") rules += ' Zm151';
|
|
170
|
+
else if (props.size === "S") rules += ' Zu151';
|
|
171
|
+
rules += ' Fd151';
|
|
172
|
+
rules += ' Iw151';
|
|
173
|
+
rules += ' fa151';
|
|
174
|
+
rules += ' _va151';
|
|
175
|
+
rules += ' Yd151';
|
|
176
|
+
rules += ' Yle151';
|
|
177
|
+
rules += ' Xb151';
|
|
178
|
+
rules += ' Xlb151';
|
|
179
|
+
rules += ' _2b151';
|
|
180
|
+
rules += ' _2lb151';
|
|
181
|
+
if (props.isDisabled) rules += ' gH151';
|
|
182
|
+
else if (props.isOpen) rules += ' gF151';
|
|
183
183
|
else {
|
|
184
|
-
if (props.isPressed) rules += '
|
|
185
|
-
else if (props.isFocusVisible) rules += '
|
|
186
|
-
else if (props.isHovered) rules += '
|
|
187
|
-
else rules += '
|
|
184
|
+
if (props.isPressed) rules += ' gF151';
|
|
185
|
+
else if (props.isFocusVisible) rules += ' gF151';
|
|
186
|
+
else if (props.isHovered) rules += ' gF151';
|
|
187
|
+
else rules += ' gH151';
|
|
188
188
|
}
|
|
189
|
-
if (props.isDisabled) rules += '
|
|
190
|
-
else if (props.isOpen) rules += '
|
|
191
|
-
else if (props.isHovered) rules += '
|
|
192
|
-
else rules += '
|
|
189
|
+
if (props.isDisabled) rules += ' gld151';
|
|
190
|
+
else if (props.isOpen) rules += ' gle151';
|
|
191
|
+
else if (props.isHovered) rules += ' gle151';
|
|
192
|
+
else rules += ' glc151';
|
|
193
193
|
return rules;
|
|
194
194
|
};
|
|
195
|
-
const $1196aa313ab37be1$export$5320dd0e349ed44d = "
|
|
195
|
+
const $1196aa313ab37be1$export$5320dd0e349ed44d = " _vb151 _ua151 Na151 Ze4mUs151";
|
|
196
196
|
const $1196aa313ab37be1$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $djrek$forwardRef)(function DatePicker(props1, ref) {
|
|
197
197
|
[props1, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props1, ref, $1196aa313ab37be1$export$cf316c7f3b44c11e);
|
|
198
198
|
let stringFormatter = (0, $djrek$useLocalizedStringFormatter)((0, ($parcel$interopDefault($djrek$intlStringsmjs))), '@react-spectrum/s2');
|
|
@@ -214,51 +214,51 @@ const $1196aa313ab37be1$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $djrek$forwa
|
|
|
214
214
|
if (p[1] === "y") gridColumnEnd = true;
|
|
215
215
|
rules += p[0];
|
|
216
216
|
}
|
|
217
|
-
rules += '
|
|
217
|
+
rules += ' se151';
|
|
218
218
|
if (props.isInForm) {
|
|
219
|
-
if (!gridColumnStart) rules += '
|
|
219
|
+
if (!gridColumnStart) rules += ' z2mU151';
|
|
220
220
|
}
|
|
221
221
|
if (props.isInForm) {
|
|
222
222
|
if (props.labelPosition === "side") {
|
|
223
|
-
if (!gridColumnEnd) rules += '
|
|
223
|
+
if (!gridColumnEnd) rules += ' yvoofG151';
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
if (props.isInForm) rules += '
|
|
226
|
+
if (props.isInForm) rules += ' DLwlgod151';
|
|
227
227
|
else {
|
|
228
|
-
if (props.labelPosition === "side") rules += '
|
|
229
|
-
else if (props.labelPosition === "top") rules += '
|
|
228
|
+
if (props.labelPosition === "side") rules += ' DPlN5qb151';
|
|
229
|
+
else if (props.labelPosition === "top") rules += ' DM8Mfn151';
|
|
230
230
|
}
|
|
231
|
-
if (props.labelPosition === "side") rules += '
|
|
232
|
-
else if (props.labelPosition === "top") rules += '
|
|
233
|
-
if (props.labelPosition === "side") rules += '
|
|
234
|
-
else if (props.labelPosition === "top") rules += '
|
|
231
|
+
if (props.labelPosition === "side") rules += ' EPlN5qb151';
|
|
232
|
+
else if (props.labelPosition === "top") rules += ' E4w1sLc151';
|
|
233
|
+
if (props.labelPosition === "side") rules += ' CbRM95c151';
|
|
234
|
+
else if (props.labelPosition === "top") rules += ' Cxaocre151';
|
|
235
235
|
if (props.size === "XL") {
|
|
236
|
-
rules += ' -_6BNtrc-
|
|
237
|
-
rules += '
|
|
236
|
+
rules += ' -_6BNtrc-e151';
|
|
237
|
+
rules += ' vx151';
|
|
238
238
|
} else if (props.size === "L") {
|
|
239
|
-
rules += ' -_6BNtrc-
|
|
240
|
-
rules += '
|
|
239
|
+
rules += ' -_6BNtrc-d151';
|
|
240
|
+
rules += ' vx151';
|
|
241
241
|
} else if (props.size === "S") {
|
|
242
|
-
rules += ' -_6BNtrc-
|
|
243
|
-
rules += '
|
|
242
|
+
rules += ' -_6BNtrc-b151';
|
|
243
|
+
rules += ' vx151';
|
|
244
244
|
} else if (props.size === "XS") {
|
|
245
|
-
rules += ' -_6BNtrc-
|
|
246
|
-
rules += '
|
|
245
|
+
rules += ' -_6BNtrc-a151';
|
|
246
|
+
rules += ' vx151';
|
|
247
247
|
} else {
|
|
248
|
-
rules += ' -_6BNtrc-
|
|
249
|
-
rules += '
|
|
248
|
+
rules += ' -_6BNtrc-c151';
|
|
249
|
+
rules += ' vx151';
|
|
250
250
|
}
|
|
251
|
-
rules += '
|
|
252
|
-
rules += '
|
|
253
|
-
rules += '
|
|
254
|
-
if (props.size === "XL") rules += ' -BhX7R-
|
|
255
|
-
else if (props.size === "L") rules += ' -BhX7R-
|
|
256
|
-
else if (props.size === "S") rules += ' -BhX7R-
|
|
257
|
-
else if (props.size === "XS") rules += ' -BhX7R-
|
|
258
|
-
else rules += ' -BhX7R-
|
|
259
|
-
rules += ' -AJjOLd-
|
|
260
|
-
rules += '
|
|
261
|
-
rules += '
|
|
251
|
+
rules += ' ea151';
|
|
252
|
+
rules += ' _Fd151';
|
|
253
|
+
rules += ' _FnuYUweb151';
|
|
254
|
+
if (props.size === "XL") rules += ' -BhX7R-Fz151';
|
|
255
|
+
else if (props.size === "L") rules += ' -BhX7R-Fv151';
|
|
256
|
+
else if (props.size === "S") rules += ' -BhX7R-Fp151';
|
|
257
|
+
else if (props.size === "XS") rules += ' -BhX7R-Fn151';
|
|
258
|
+
else rules += ' -BhX7R-Fx151';
|
|
259
|
+
rules += ' -AJjOLd-UVkF0Db151';
|
|
260
|
+
rules += ' qg151';
|
|
261
|
+
rules += ' __ca151';
|
|
262
262
|
return rules;
|
|
263
263
|
}({
|
|
264
264
|
isInForm: !!formContext,
|
|
@@ -295,30 +295,30 @@ const $1196aa313ab37be1$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $djrek$forwa
|
|
|
295
295
|
size: size,
|
|
296
296
|
styles: function anonymous(props) {
|
|
297
297
|
let rules = " ";
|
|
298
|
-
rules += '
|
|
299
|
-
rules += '
|
|
300
|
-
rules += '
|
|
301
|
-
rules += '
|
|
302
|
-
if (props.size === "XL") rules += '
|
|
303
|
-
else if (props.size === "L") rules += '
|
|
304
|
-
else if (props.size === "S") rules += '
|
|
305
|
-
else if (props.size === "XS") rules += '
|
|
306
|
-
else rules += '
|
|
307
|
-
if (props.isQuiet) rules += '
|
|
308
|
-
else rules += '
|
|
309
|
-
if (props.size === "XL") rules += ' -Anxdcc-
|
|
310
|
-
else if (props.size === "L") rules += ' -Anxdcc-
|
|
311
|
-
else if (props.size === "S") rules += ' -Anxdcc-
|
|
312
|
-
else rules += ' -Anxdcc-
|
|
313
|
-
rules += '
|
|
314
|
-
rules += '
|
|
315
|
-
rules += '
|
|
316
|
-
rules += '
|
|
317
|
-
rules += ' -S_-
|
|
318
|
-
if (props.size === "XL") rules += ' -R_-
|
|
319
|
-
else if (props.size === "L") rules += ' -R_-
|
|
320
|
-
else if (props.size === "M") rules += ' -R_-
|
|
321
|
-
else if (props.size === "S") rules += ' -R_-
|
|
298
|
+
rules += ' zXcEWr151';
|
|
299
|
+
rules += ' yXcEWr151';
|
|
300
|
+
rules += ' BXcEWr151';
|
|
301
|
+
rules += ' AXcEWr151';
|
|
302
|
+
if (props.size === "XL") rules += ' Nl151';
|
|
303
|
+
else if (props.size === "L") rules += ' Nj151';
|
|
304
|
+
else if (props.size === "S") rules += ' Nf151';
|
|
305
|
+
else if (props.size === "XS") rules += ' Ne151';
|
|
306
|
+
else rules += ' Nk151';
|
|
307
|
+
if (props.isQuiet) rules += ' _qd151';
|
|
308
|
+
else rules += ' _qtb151';
|
|
309
|
+
if (props.size === "XL") rules += ' -Anxdcc-Zt151';
|
|
310
|
+
else if (props.size === "L") rules += ' -Anxdcc-ZStdtne151';
|
|
311
|
+
else if (props.size === "S") rules += ' -Anxdcc-Zr151';
|
|
312
|
+
else rules += ' -Anxdcc-Z3fn9H151';
|
|
313
|
+
rules += ' __v6TNLWb151';
|
|
314
|
+
rules += ' __Wb151';
|
|
315
|
+
rules += ' SMBFGYc151';
|
|
316
|
+
rules += ' RfBFGYc151';
|
|
317
|
+
rules += ' -S_-Sv151';
|
|
318
|
+
if (props.size === "XL") rules += ' -R_-RWJpoB151';
|
|
319
|
+
else if (props.size === "L") rules += ' -R_-RWJpoB151';
|
|
320
|
+
else if (props.size === "M") rules += ' -R_-Rp151';
|
|
321
|
+
else if (props.size === "S") rules += ' -R_-Rj151';
|
|
322
322
|
return rules;
|
|
323
323
|
}({
|
|
324
324
|
size: size
|
|
@@ -347,7 +347,7 @@ const $1196aa313ab37be1$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $djrek$forwa
|
|
|
347
347
|
errorMessage: resolvedErrorMessage
|
|
348
348
|
}),
|
|
349
349
|
showTimeField && /*#__PURE__*/ (0, $djrek$jsx)("div", {
|
|
350
|
-
className: "
|
|
350
|
+
className: " sd151 Ul151 ql151 _qb151",
|
|
351
351
|
children: /*#__PURE__*/ (0, $djrek$jsx)((0, $a4c1b812c7e17006$export$5eaee2322dd727eb), {
|
|
352
352
|
styles: $1196aa313ab37be1$export$5320dd0e349ed44d,
|
|
353
353
|
label: stringFormatter.format('datepicker.time'),
|
|
@@ -382,7 +382,7 @@ function $1196aa313ab37be1$export$f3ce207574a3cffe(props) {
|
|
|
382
382
|
hideArrow: true,
|
|
383
383
|
padding: "none",
|
|
384
384
|
children: /*#__PURE__*/ (0, $djrek$jsx)("div", {
|
|
385
|
-
className: "
|
|
385
|
+
className: " Sf151 Rf151 Th151 Qh151 _Na151 Pa151 sd151 _ta151 Ul151 ql151 _oa151 Za151 Fb151",
|
|
386
386
|
children: /*#__PURE__*/ (0, $djrek$jsx)((0, $djrek$Dialog), {
|
|
387
387
|
children: /*#__PURE__*/ (0, $djrek$jsx)((0, $djrek$Provider), {
|
|
388
388
|
values: [
|
|
@@ -417,7 +417,7 @@ function $1196aa313ab37be1$export$adb29da0ac001538(props) {
|
|
|
417
417
|
[
|
|
418
418
|
(0, $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed),
|
|
419
419
|
{
|
|
420
|
-
styles: " -_8sjo0b-
|
|
420
|
+
styles: " -_8sjo0b-t5ZbAob151 Za8Mfn151 Fa8Mfn151"
|
|
421
421
|
}
|
|
422
422
|
]
|
|
423
423
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AA+EM,MAAM,0DACX,CAAA,GAAA,oBAAY,EAA+D;AAE7E,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDC,MAAM;AAWN,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,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AEO,SAAS,0CACd,KAA6D;IAE7D,qBACE,gBAAC,CAAA,GAAA,yCAAM;QAAG,GAAG,KAAK;QAAE,SAAS;QAAC,SAAQ;kBACpC,cAAA,gBAAC;YACC,SAAS;sBAUT,cAAA,gBAAC,CAAA,GAAA,aAAK;0BACJ,cAAA,gBAAC,CAAA,GAAA,eAAO;oBAAE,QAAQ;wBAAC;4BAAC,CAAA,GAAA,iCAAyB;4BAAG;yBAAK;qBAAC;8BAAG,MAAM,QAAQ;;;;;AAKjF;AAEO,SAAS,0CAAe,KAI9B;IACC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAqB;IAC1C,IAAI,UAAC,MAAM,QAAE,IAAI,qBAAE,iBAAiB,EAAC,GAAG;IACxC,qBACE,gBAAC,CAAA,GAAA,aAAK;QACJ,KAAK;QACL,8DAA8D;QAC9D,aAAa;QACb,WAAW;QACX,eAAe;QACf,OAAO,CAAA,GAAA,yCAAS,EAAE;QAClB,WAAW,CAAA,cACT,kCAAY;gBACV,GAAG,WAAW;sBACd;wBACA;YACF;kBAEF,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBACE,CAAA,GAAA,yCAAU;oBACV;wBACE,MAAM;oBAOR;iBACD;aACF;sBACD,cAAA,gBAAC,CAAA,GAAA,wCAAW;;;AAIpB","sources":["packages/@react-spectrum/s2/src/DatePicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {\n DatePicker as AriaDatePicker,\n DatePickerProps as AriaDatePickerProps,\n DateValue\n} from 'react-aria-components/DatePicker';\nimport {baseColor, focusRing, fontRelative, space, style} from '../style' with {type: 'macro'};\nimport {Button, ButtonRenderProps} from 'react-aria-components/Button';\nimport {Calendar, CalendarProps} from './Calendar';\nimport CalendarIcon from '../s2wf-icons/S2_Icon_Calendar_20_N.svg';\nimport {ContextValue, Provider} from 'react-aria-components/slots';\nimport {\n controlBorderRadius,\n field,\n fieldInput,\n getAllowedOverrides,\n StyleProps\n} from './style-utils' with {type: 'macro'};\nimport {\n createContext,\n forwardRef,\n ReactElement,\n ReactNode,\n Ref,\n useContext,\n useRef,\n useState\n} from 'react';\nimport {DateInput, DateInputContainer, InvalidIndicator} from './DateField';\nimport {Dialog, OverlayTriggerStateContext} from 'react-aria-components/Dialog';\nimport {FieldGroup, FieldLabel, HelpText} from './Field';\nimport {FormContext} from 'react-aria-components/Form';\nimport {\n forwardRefType,\n GlobalDOMAttributes,\n HelpTextProps,\n SpectrumLabelableProps\n} from '@react-types/shared';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Popover} from './Popover';\nimport {PopoverProps} from 'react-aria-components/Popover';\nimport {pressScale} from './pressScale';\nimport {TimeField} from './TimeField';\nimport {TimeValue} from 'react-aria-components/TimeField';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DatePickerProps<T extends DateValue>\n extends\n Omit<\n AriaDatePickerProps<T>,\n 'children' | 'className' | 'style' | 'render' | keyof GlobalDOMAttributes\n >,\n Pick<\n CalendarProps<T>,\n 'createCalendar' | 'pageBehavior' | 'firstDayOfWeek' | 'isDateUnavailable'\n >,\n Pick<PopoverProps, 'shouldFlip'>,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps {\n /**\n * The size of the DateField.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL';\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n}\n\nexport const DatePickerContext =\n createContext<ContextValue<Partial<DatePickerProps<any>>, HTMLDivElement>>(null);\n\nconst inputButton = style<ButtonRenderProps & {isOpen: boolean; size: 'S' | 'M' | 'L' | 'XL'}>({\n ...focusRing(),\n ...controlBorderRadius('sm'),\n position: 'relative',\n font: {\n size: {\n S: 'ui-sm',\n M: 'ui',\n L: 'ui-lg',\n XL: 'ui-xl'\n }\n },\n cursor: 'default',\n display: 'flex',\n textAlign: 'center',\n borderStyle: 'none',\n alignItems: 'center',\n justifyContent: 'center',\n width: {\n size: {\n S: 16,\n M: 20,\n L: 24,\n XL: 32\n }\n },\n height: 'auto',\n marginStart: 'text-to-control',\n aspectRatio: 'square',\n flexShrink: 0,\n transition: {\n default: 'default',\n forcedColors: 'none'\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isOpen: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n color: {\n default: baseColor('neutral'),\n isDisabled: 'disabled',\n forcedColors: 'ButtonFace'\n }\n});\n\nexport const timeField = style({\n flexShrink: 1,\n flexGrow: 0,\n minWidth: 0,\n width: 'unset'\n});\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DatePicker<\n T extends DateValue\n>(props: DatePickerProps<T>, ref: Ref<HTMLDivElement>): ReactElement {\n [props, ref] = useSpectrumContextProps(props, ref, DatePickerContext);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n label,\n contextualHelp,\n description: descriptionMessage,\n errorMessage,\n isRequired,\n size = 'M',\n labelPosition = 'top',\n necessityIndicator,\n labelAlign = 'start',\n UNSAFE_style,\n UNSAFE_className,\n styles,\n placeholderValue,\n maxVisibleMonths = 1,\n createCalendar,\n ...dateFieldProps\n } = props;\n let formContext = useContext(FormContext);\n let [buttonHasFocus, setButtonHasFocus] = useState(false);\n\n return (\n <AriaDatePicker\n ref={ref}\n isRequired={isRequired}\n {...dateFieldProps}\n style={UNSAFE_style}\n className={\n (UNSAFE_className || '') +\n style(field(), getAllowedOverrides())(\n {\n isInForm: !!formContext,\n labelPosition,\n size\n },\n styles\n )\n }>\n {({isDisabled, isInvalid, isOpen, state}) => {\n let placeholder: DateValue | undefined = placeholderValue ?? undefined;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : undefined;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : undefined;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : undefined;\n let timeGranularity =\n state.granularity === 'hour' ||\n state.granularity === 'minute' ||\n state.granularity === 'second'\n ? state.granularity\n : undefined;\n let showTimeField = !!timeGranularity;\n\n // Ideally, we could omit errorMessage here and let S2 Calendar read it from RAC's CalendarContext which already contains the resolved value via calendarProps from useDatePicker.\n // However, RAC's CalendarProps omits errorMessage, so reading it back from the context would require an unsafe cast. Instead, we resolve it here using the same logic as useDatePicker.\n let resolvedErrorMessage =\n typeof errorMessage === 'function'\n ? errorMessage(state.displayValidation)\n : errorMessage || state.displayValidation.validationErrors.join(' ');\n return (\n <>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup\n role=\"presentation\"\n shouldTurnOffFocusRing={buttonHasFocus}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n size={size}\n styles={style({\n ...fieldInput(),\n textWrap: 'nowrap',\n paddingStart: 'edge-to-text',\n paddingEnd: {\n size: {\n S: 2,\n M: 4,\n L: space(6),\n XL: space(6)\n }\n }\n })({size})}>\n <DateInputContainer>\n <DateInput />\n </DateInputContainer>\n <InvalidIndicator isInvalid={isInvalid} isDisabled={isDisabled} />\n <CalendarButton isOpen={isOpen} size={size} setButtonHasFocus={setButtonHasFocus} />\n </FieldGroup>\n <CalendarPopover shouldFlip={props.shouldFlip}>\n <Calendar\n visibleMonths={maxVisibleMonths}\n createCalendar={createCalendar}\n errorMessage={resolvedErrorMessage}\n />\n {showTimeField && (\n <div className={style({display: 'flex', gap: 16, contain: 'inline-size'})}>\n <TimeField\n styles={timeField}\n label={stringFormatter.format('datepicker.time')}\n value={state.timeValue}\n // TODO: why do i need the cast?\n onChange={v => state.setTimeValue(v as TimeValue)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n />\n </div>\n )}\n </CalendarPopover>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {resolvedErrorMessage}\n </HelpText>\n </>\n );\n }}\n </AriaDatePicker>\n );\n});\n\nexport function CalendarPopover(\n props: Omit<PopoverProps, 'children'> & {children: ReactNode}\n): ReactElement {\n return (\n <Popover {...props} hideArrow padding=\"none\">\n <div\n className={style({\n paddingX: 16,\n paddingY: 24,\n overflow: 'auto',\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n boxSizing: 'border-box',\n size: 'full'\n })}>\n <Dialog>\n <Provider values={[[OverlayTriggerStateContext, null]]}>{props.children}</Provider>\n </Dialog>\n </div>\n </Popover>\n );\n}\n\nexport function CalendarButton(props: {\n isOpen: boolean;\n size: 'S' | 'M' | 'L' | 'XL';\n setButtonHasFocus: (hasFocus: boolean) => void;\n}): ReactElement {\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {isOpen, size, setButtonHasFocus} = props;\n return (\n <Button\n ref={buttonRef}\n // Prevent press scale from sticking while DatePicker is open.\n // @ts-ignore\n isPressed={false}\n onFocusChange={setButtonHasFocus}\n style={pressScale(buttonRef)}\n className={renderProps =>\n inputButton({\n ...renderProps,\n size,\n isOpen\n })\n }>\n <Provider\n values={[\n [\n IconContext,\n {\n styles: style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n size: fontRelative(14)\n })\n }\n ]\n ]}>\n <CalendarIcon />\n </Provider>\n </Button>\n );\n}\n"],"names":[],"version":3,"file":"DatePicker.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AA8EM,MAAM,0DACX,CAAA,GAAA,oBAAY,EAA+D;AAE7E,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDC,MAAM;AAWN,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,WAE9E,MAAyB,EAAE,GAAwB;IACnD,CAAC,QAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,QAAO,KAAK;IACnD,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,+CAAW,GAAG;IAChE,IAAI,SACF,KAAK,kBACL,cAAc,EACd,aAAa,kBAAkB,gBAC/B,YAAY,cACZ,UAAU,QACV,OAAO,oBACP,gBAAgB,2BAChB,kBAAkB,cAClB,aAAa,uBACb,YAAY,oBACZ,gBAAgB,UAChB,MAAM,oBACN,gBAAgB,oBAChB,mBAAmB,mBACnB,cAAc,EACd,GAAG,gBACJ,GAAG;IACJ,IAAI,cAAc,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,kBAAU;IACvC,IAAI,CAAC,gBAAgB,kBAAkB,GAAG,CAAA,GAAA,eAAO,EAAE;IAEnD,qBACE,gBAAC,CAAA,GAAA,iBAAa;QACZ,KAAK;QACL,YAAY;QACX,GAAG,cAAc;QAClB,OAAO;QACP,WAC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A,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBACE,CAAA,GAAA,yCAAU;oBACV;wBACE,MAAM;oBAOR;iBACD;aACF;sBACD,cAAA,gBAAC,CAAA,GAAA,wCAAW;;;AAIpB","sources":["packages/@react-spectrum/s2/src/DatePicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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\nimport {\n DatePicker as AriaDatePicker,\n DatePickerProps as AriaDatePickerProps,\n DateValue\n} from 'react-aria-components/DatePicker';\nimport {baseColor, focusRing, fontRelative, space, style} from '../style' with {type: 'macro'};\nimport {Button, ButtonRenderProps} from 'react-aria-components/Button';\nimport {Calendar, CalendarProps} from './Calendar';\nimport CalendarIcon from '../s2wf-icons/S2_Icon_Calendar_20_N.svg';\nimport {ContextValue, Provider} from 'react-aria-components/slots';\nimport {\n controlBorderRadius,\n field,\n fieldInput,\n getAllowedOverrides,\n StyleProps\n} from './style-utils' with {type: 'macro'};\nimport {\n createContext,\n forwardRef,\n ReactElement,\n ReactNode,\n Ref,\n useContext,\n useRef,\n useState\n} from 'react';\nimport {DateInput, DateInputContainer, InvalidIndicator} from './DateField';\nimport {Dialog, OverlayTriggerStateContext} from 'react-aria-components/Dialog';\nimport {FieldGroup, FieldLabel, HelpText} from './Field';\nimport {FormContext} from 'react-aria-components/Form';\nimport {\n forwardRefType,\n GlobalDOMAttributes,\n HelpTextProps,\n SpectrumLabelableProps\n} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport intlMessages from '../intl/*.json';\nimport {Popover} from './Popover';\nimport {PopoverProps} from 'react-aria-components/Popover';\nimport {pressScale} from './pressScale';\nimport {TimeField} from './TimeField';\nimport {TimeValue} from 'react-aria-components/TimeField';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DatePickerProps<T extends DateValue>\n extends\n Omit<\n AriaDatePickerProps<T>,\n 'children' | 'className' | 'style' | 'render' | keyof GlobalDOMAttributes\n >,\n Pick<\n CalendarProps<T>,\n 'createCalendar' | 'pageBehavior' | 'firstDayOfWeek' | 'isDateUnavailable'\n >,\n Pick<PopoverProps, 'shouldFlip'>,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps {\n /**\n * The size of the DateField.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL';\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n}\n\nexport const DatePickerContext =\n createContext<ContextValue<Partial<DatePickerProps<any>>, HTMLDivElement>>(null);\n\nconst inputButton = style<ButtonRenderProps & {isOpen: boolean; size: 'S' | 'M' | 'L' | 'XL'}>({\n ...focusRing(),\n ...controlBorderRadius('sm'),\n position: 'relative',\n font: {\n size: {\n S: 'ui-sm',\n M: 'ui',\n L: 'ui-lg',\n XL: 'ui-xl'\n }\n },\n cursor: 'default',\n display: 'flex',\n textAlign: 'center',\n borderStyle: 'none',\n alignItems: 'center',\n justifyContent: 'center',\n width: {\n size: {\n S: 16,\n M: 20,\n L: 24,\n XL: 32\n }\n },\n height: 'auto',\n marginStart: 'text-to-control',\n aspectRatio: 'square',\n flexShrink: 0,\n transition: {\n default: 'default',\n forcedColors: 'none'\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isOpen: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n color: {\n default: baseColor('neutral'),\n isDisabled: 'disabled',\n forcedColors: 'ButtonFace'\n }\n});\n\nexport const timeField = style({\n flexShrink: 1,\n flexGrow: 0,\n minWidth: 0,\n width: 'unset'\n});\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DatePicker<\n T extends DateValue\n>(props: DatePickerProps<T>, ref: Ref<HTMLDivElement>): ReactElement {\n [props, ref] = useSpectrumContextProps(props, ref, DatePickerContext);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n label,\n contextualHelp,\n description: descriptionMessage,\n errorMessage,\n isRequired,\n size = 'M',\n labelPosition = 'top',\n necessityIndicator,\n labelAlign = 'start',\n UNSAFE_style,\n UNSAFE_className,\n styles,\n placeholderValue,\n maxVisibleMonths = 1,\n createCalendar,\n ...dateFieldProps\n } = props;\n let formContext = useContext(FormContext);\n let [buttonHasFocus, setButtonHasFocus] = useState(false);\n\n return (\n <AriaDatePicker\n ref={ref}\n isRequired={isRequired}\n {...dateFieldProps}\n style={UNSAFE_style}\n className={\n (UNSAFE_className || '') +\n style(field(), getAllowedOverrides())(\n {\n isInForm: !!formContext,\n labelPosition,\n size\n },\n styles\n )\n }>\n {({isDisabled, isInvalid, isOpen, state}) => {\n let placeholder: DateValue | undefined = placeholderValue ?? undefined;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : undefined;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : undefined;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : undefined;\n let timeGranularity =\n state.granularity === 'hour' ||\n state.granularity === 'minute' ||\n state.granularity === 'second'\n ? state.granularity\n : undefined;\n let showTimeField = !!timeGranularity;\n\n // Ideally, we could omit errorMessage here and let S2 Calendar read it from RAC's CalendarContext which already contains the resolved value via calendarProps from useDatePicker.\n // However, RAC's CalendarProps omits errorMessage, so reading it back from the context would require an unsafe cast. Instead, we resolve it here using the same logic as useDatePicker.\n let resolvedErrorMessage =\n typeof errorMessage === 'function'\n ? errorMessage(state.displayValidation)\n : errorMessage || state.displayValidation.validationErrors.join(' ');\n return (\n <>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup\n role=\"presentation\"\n shouldTurnOffFocusRing={buttonHasFocus}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n size={size}\n styles={style({\n ...fieldInput(),\n textWrap: 'nowrap',\n paddingStart: 'edge-to-text',\n paddingEnd: {\n size: {\n S: 2,\n M: 4,\n L: space(6),\n XL: space(6)\n }\n }\n })({size})}>\n <DateInputContainer>\n <DateInput />\n </DateInputContainer>\n <InvalidIndicator isInvalid={isInvalid} isDisabled={isDisabled} />\n <CalendarButton isOpen={isOpen} size={size} setButtonHasFocus={setButtonHasFocus} />\n </FieldGroup>\n <CalendarPopover shouldFlip={props.shouldFlip}>\n <Calendar\n visibleMonths={maxVisibleMonths}\n createCalendar={createCalendar}\n errorMessage={resolvedErrorMessage}\n />\n {showTimeField && (\n <div className={style({display: 'flex', gap: 16, contain: 'inline-size'})}>\n <TimeField\n styles={timeField}\n label={stringFormatter.format('datepicker.time')}\n value={state.timeValue}\n // TODO: why do i need the cast?\n onChange={v => state.setTimeValue(v as TimeValue)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n />\n </div>\n )}\n </CalendarPopover>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {resolvedErrorMessage}\n </HelpText>\n </>\n );\n }}\n </AriaDatePicker>\n );\n});\n\nexport function CalendarPopover(\n props: Omit<PopoverProps, 'children'> & {children: ReactNode}\n): ReactElement {\n return (\n <Popover {...props} hideArrow padding=\"none\">\n <div\n className={style({\n paddingX: 16,\n paddingY: 24,\n overflow: 'auto',\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n boxSizing: 'border-box',\n size: 'full'\n })}>\n <Dialog>\n <Provider values={[[OverlayTriggerStateContext, null]]}>{props.children}</Provider>\n </Dialog>\n </div>\n </Popover>\n );\n}\n\nexport function CalendarButton(props: {\n isOpen: boolean;\n size: 'S' | 'M' | 'L' | 'XL';\n setButtonHasFocus: (hasFocus: boolean) => void;\n}): ReactElement {\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {isOpen, size, setButtonHasFocus} = props;\n return (\n <Button\n ref={buttonRef}\n // Prevent press scale from sticking while DatePicker is open.\n // @ts-ignore\n isPressed={false}\n onFocusChange={setButtonHasFocus}\n style={pressScale(buttonRef)}\n className={renderProps =>\n inputButton({\n ...renderProps,\n size,\n isOpen\n })\n }>\n <Provider\n values={[\n [\n IconContext,\n {\n styles: style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n size: fontRelative(14)\n })\n }\n ]\n ]}>\n <CalendarIcon />\n </Provider>\n </Button>\n );\n}\n"],"names":[],"version":3,"file":"DatePicker.mjs.map"}
|