@react-spectrum/s2 0.11.1 → 0.12.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/dist/Accordion.cjs +3 -3
- package/dist/Accordion.css +2 -2
- package/dist/Accordion.mjs +3 -3
- package/dist/ActionBar.cjs +61 -62
- package/dist/ActionBar.cjs.map +1 -1
- package/dist/ActionBar.css +62 -66
- package/dist/ActionBar.css.map +1 -1
- package/dist/ActionBar.mjs +61 -62
- package/dist/ActionBar.mjs.map +1 -1
- package/dist/ActionButton.cjs +356 -250
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +208 -144
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +357 -251
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/ActionButtonGroup.cjs +16 -16
- package/dist/ActionButtonGroup.css +9 -9
- package/dist/ActionButtonGroup.mjs +16 -16
- package/dist/Add.cjs +10 -10
- package/dist/Add.css +6 -6
- package/dist/Add.mjs +10 -10
- package/dist/AlertDialog.cjs +3 -3
- package/dist/AlertDialog.css +3 -3
- package/dist/AlertDialog.mjs +3 -3
- package/dist/Asterisk.cjs +6 -6
- package/dist/Asterisk.css +4 -4
- package/dist/Asterisk.mjs +6 -6
- package/dist/Avatar.cjs +20 -16
- package/dist/Avatar.cjs.map +1 -1
- package/dist/Avatar.css +22 -14
- package/dist/Avatar.css.map +1 -1
- package/dist/Avatar.mjs +20 -16
- package/dist/Avatar.mjs.map +1 -1
- package/dist/AvatarGroup.cjs +135 -135
- package/dist/AvatarGroup.css +33 -33
- package/dist/AvatarGroup.mjs +135 -135
- package/dist/Badge.cjs +207 -207
- package/dist/Badge.css +127 -127
- package/dist/Badge.mjs +207 -207
- package/dist/Breadcrumbs.cjs +255 -255
- package/dist/Breadcrumbs.css +109 -109
- package/dist/Breadcrumbs.mjs +255 -255
- package/dist/Button.cjs +356 -354
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +179 -179
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +357 -356
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs +21 -21
- package/dist/ButtonGroup.css +15 -15
- package/dist/ButtonGroup.mjs +21 -21
- package/dist/Calendar.cjs +127 -127
- package/dist/Calendar.cjs.map +1 -1
- package/dist/Calendar.css +134 -134
- package/dist/Calendar.css.map +1 -1
- package/dist/Calendar.mjs +127 -127
- package/dist/Calendar.mjs.map +1 -1
- package/dist/Card.cjs +335 -311
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css +213 -213
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +335 -311
- package/dist/Card.mjs.map +1 -1
- package/dist/CardView.cjs +25 -19
- package/dist/CardView.cjs.map +1 -1
- package/dist/CardView.css +16 -16
- package/dist/CardView.css.map +1 -1
- package/dist/CardView.mjs +26 -20
- package/dist/CardView.mjs.map +1 -1
- package/dist/CenterBaseline.cjs +1 -1
- package/dist/CenterBaseline.css +2 -2
- package/dist/CenterBaseline.mjs +1 -1
- package/dist/Checkbox.cjs +171 -171
- package/dist/Checkbox.css +92 -92
- package/dist/Checkbox.mjs +171 -171
- package/dist/CheckboxGroup.cjs +46 -46
- package/dist/CheckboxGroup.css +38 -38
- package/dist/CheckboxGroup.mjs +46 -46
- package/dist/Checkmark.cjs +12 -12
- package/dist/Checkmark.css +8 -8
- package/dist/Checkmark.mjs +12 -12
- package/dist/Chevron.cjs +12 -12
- package/dist/Chevron.css +10 -10
- package/dist/Chevron.mjs +12 -12
- package/dist/ClearButton.cjs +29 -29
- package/dist/ClearButton.css +29 -29
- package/dist/ClearButton.mjs +29 -29
- package/dist/CloseButton.cjs +55 -55
- package/dist/CloseButton.css +46 -46
- package/dist/CloseButton.mjs +55 -55
- package/dist/ColorArea.cjs +25 -18
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css +16 -16
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs +26 -19
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs +33 -33
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css +28 -28
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs +33 -33
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorHandle.cjs +27 -27
- package/dist/ColorHandle.css +43 -43
- package/dist/ColorHandle.mjs +27 -27
- package/dist/ColorSlider.cjs +122 -121
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css +54 -54
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs +122 -121
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs +30 -30
- package/dist/ColorSwatch.css +29 -29
- package/dist/ColorSwatch.mjs +30 -30
- package/dist/ColorSwatchPicker.cjs +28 -28
- package/dist/ColorSwatchPicker.css +46 -46
- package/dist/ColorSwatchPicker.mjs +28 -28
- package/dist/ColorWheel.cjs +26 -26
- package/dist/ColorWheel.css +17 -17
- package/dist/ColorWheel.mjs +26 -26
- package/dist/ComboBox.cjs +474 -452
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +213 -185
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +475 -453
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +36 -33
- package/dist/ContextualHelp.cjs.map +1 -1
- package/dist/ContextualHelp.css +68 -60
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs +37 -34
- package/dist/ContextualHelp.mjs.map +1 -1
- package/dist/Cross.cjs +14 -14
- package/dist/Cross.css +10 -10
- package/dist/Cross.mjs +14 -14
- package/dist/CustomDialog.cjs +26 -26
- package/dist/CustomDialog.cjs.map +1 -1
- package/dist/CustomDialog.css +25 -25
- package/dist/CustomDialog.css.map +1 -1
- package/dist/CustomDialog.mjs +26 -26
- package/dist/CustomDialog.mjs.map +1 -1
- package/dist/Dash.cjs +10 -10
- package/dist/Dash.css +6 -6
- package/dist/Dash.mjs +10 -10
- package/dist/DateField.cjs +74 -74
- package/dist/DateField.cjs.map +1 -1
- package/dist/DateField.css +77 -77
- package/dist/DateField.css.map +1 -1
- package/dist/DateField.mjs +74 -74
- package/dist/DateField.mjs.map +1 -1
- package/dist/DatePicker.cjs +194 -191
- package/dist/DatePicker.cjs.map +1 -1
- package/dist/DatePicker.css +138 -126
- package/dist/DatePicker.css.map +1 -1
- package/dist/DatePicker.mjs +195 -192
- package/dist/DatePicker.mjs.map +1 -1
- package/dist/DateRangePicker.cjs +57 -57
- package/dist/DateRangePicker.cjs.map +1 -1
- package/dist/DateRangePicker.css +60 -60
- package/dist/DateRangePicker.css.map +1 -1
- package/dist/DateRangePicker.mjs +57 -57
- package/dist/DateRangePicker.mjs.map +1 -1
- package/dist/Dialog.cjs +17 -17
- package/dist/Dialog.cjs.map +1 -1
- package/dist/Dialog.css +88 -84
- package/dist/Dialog.css.map +1 -1
- package/dist/Dialog.mjs +17 -17
- package/dist/Dialog.mjs.map +1 -1
- package/dist/Disclosure.cjs +128 -147
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +144 -112
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +128 -147
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs +26 -26
- package/dist/Divider.css +25 -25
- package/dist/Divider.mjs +26 -26
- package/dist/DropZone.cjs +63 -63
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css +58 -58
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs +63 -63
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs +370 -370
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +146 -142
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs +370 -370
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +10 -10
- package/dist/Form.css +9 -9
- package/dist/Form.mjs +10 -10
- package/dist/FullscreenDialog.cjs +5 -5
- package/dist/FullscreenDialog.cjs.map +1 -1
- package/dist/FullscreenDialog.css +93 -93
- package/dist/FullscreenDialog.css.map +1 -1
- package/dist/FullscreenDialog.mjs +5 -5
- package/dist/FullscreenDialog.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs +257 -257
- package/dist/IllustratedMessage.css +78 -78
- package/dist/IllustratedMessage.mjs +257 -257
- package/dist/Image.cjs +25 -17
- package/dist/Image.cjs.map +1 -1
- package/dist/Image.css +14 -14
- package/dist/Image.css.map +1 -1
- package/dist/Image.mjs +25 -17
- package/dist/Image.mjs.map +1 -1
- package/dist/InlineAlert.cjs +138 -153
- package/dist/InlineAlert.cjs.map +1 -1
- package/dist/InlineAlert.css +82 -151
- package/dist/InlineAlert.css.map +1 -1
- package/dist/InlineAlert.mjs +138 -153
- package/dist/InlineAlert.mjs.map +1 -1
- package/dist/Link.cjs +55 -55
- package/dist/Link.css +46 -46
- package/dist/Link.mjs +55 -55
- package/dist/LinkOut.cjs +8 -8
- package/dist/LinkOut.css +8 -8
- package/dist/LinkOut.mjs +8 -8
- package/dist/Menu.cjs +529 -501
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +195 -191
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +529 -502
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +164 -164
- package/dist/Meter.css +93 -93
- package/dist/Meter.mjs +164 -164
- package/dist/Modal.cjs +90 -70
- package/dist/Modal.cjs.map +1 -1
- package/dist/Modal.css +76 -60
- package/dist/Modal.css.map +1 -1
- package/dist/Modal.mjs +90 -70
- package/dist/Modal.mjs.map +1 -1
- package/dist/NotificationBadge.cjs +59 -59
- package/dist/NotificationBadge.css +51 -51
- package/dist/NotificationBadge.mjs +59 -59
- package/dist/NumberField.cjs +116 -116
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css +100 -100
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs +116 -116
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +424 -349
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +200 -180
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +428 -353
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +120 -116
- package/dist/Popover.cjs.map +1 -1
- package/dist/Popover.css +86 -82
- package/dist/Popover.css.map +1 -1
- package/dist/Popover.mjs +121 -118
- package/dist/Popover.mjs.map +1 -1
- package/dist/ProgressBar.cjs +174 -174
- package/dist/ProgressBar.css +101 -101
- package/dist/ProgressBar.mjs +174 -174
- package/dist/ProgressCircle.cjs +32 -32
- package/dist/ProgressCircle.css +24 -24
- package/dist/ProgressCircle.mjs +32 -32
- package/dist/Provider.cjs +11 -11
- package/dist/Provider.cjs.map +1 -1
- package/dist/Provider.css +13 -13
- package/dist/Provider.css.map +1 -1
- package/dist/Provider.mjs +11 -11
- package/dist/Provider.mjs.map +1 -1
- package/dist/Radio.cjs +155 -155
- package/dist/Radio.css +79 -79
- package/dist/Radio.mjs +155 -155
- package/dist/RadioGroup.cjs +43 -43
- package/dist/RadioGroup.css +38 -38
- package/dist/RadioGroup.mjs +43 -43
- package/dist/RangeCalendar.cjs +8 -8
- package/dist/RangeCalendar.cjs.map +1 -1
- package/dist/RangeCalendar.css +10 -10
- package/dist/RangeCalendar.css.map +1 -1
- package/dist/RangeCalendar.mjs +8 -8
- package/dist/RangeCalendar.mjs.map +1 -1
- package/dist/RangeSlider.cjs.map +1 -1
- package/dist/RangeSlider.mjs.map +1 -1
- package/dist/SearchField.cjs +43 -43
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css +46 -46
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs +43 -43
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +193 -224
- package/dist/SegmentedControl.cjs.map +1 -1
- package/dist/SegmentedControl.css +146 -118
- package/dist/SegmentedControl.css.map +1 -1
- package/dist/SegmentedControl.mjs +196 -227
- package/dist/SegmentedControl.mjs.map +1 -1
- package/dist/SelectBoxGroup.cjs +161 -159
- package/dist/SelectBoxGroup.cjs.map +1 -1
- package/dist/SelectBoxGroup.css +123 -123
- package/dist/SelectBoxGroup.css.map +1 -1
- package/dist/SelectBoxGroup.mjs +161 -159
- package/dist/SelectBoxGroup.mjs.map +1 -1
- package/dist/Slider.cjs +300 -300
- package/dist/Slider.css +151 -151
- package/dist/Slider.mjs +300 -300
- package/dist/StatusLight.cjs +126 -126
- package/dist/StatusLight.css +61 -61
- package/dist/StatusLight.mjs +126 -126
- package/dist/Switch.cjs +163 -163
- package/dist/Switch.css +74 -74
- package/dist/Switch.mjs +163 -163
- package/dist/TableView.cjs +340 -328
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css +176 -172
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs +340 -328
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +150 -190
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +128 -100
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +153 -193
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TabsPicker.cjs +169 -161
- package/dist/TabsPicker.cjs.map +1 -1
- package/dist/TabsPicker.css +116 -124
- package/dist/TabsPicker.css.map +1 -1
- package/dist/TabsPicker.mjs +170 -162
- package/dist/TabsPicker.mjs.map +1 -1
- package/dist/TagGroup.cjs +226 -218
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css +147 -147
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +226 -218
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +65 -63
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css +58 -54
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs +65 -63
- package/dist/TextField.mjs.map +1 -1
- package/dist/TimeField.cjs +53 -53
- package/dist/TimeField.cjs.map +1 -1
- package/dist/TimeField.css +48 -48
- package/dist/TimeField.css.map +1 -1
- package/dist/TimeField.mjs +53 -53
- package/dist/TimeField.mjs.map +1 -1
- package/dist/Toast.cjs +120 -120
- package/dist/Toast.css +108 -108
- package/dist/Toast.mjs +120 -120
- package/dist/ToggleButton.cjs +3 -3
- package/dist/ToggleButton.css +12 -12
- package/dist/ToggleButton.mjs +3 -3
- package/dist/Tooltip.cjs +84 -83
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css +74 -70
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +84 -83
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/TreeView.cjs +150 -148
- package/dist/TreeView.cjs.map +1 -1
- package/dist/TreeView.css +147 -147
- package/dist/TreeView.css.map +1 -1
- package/dist/TreeView.mjs +151 -149
- package/dist/TreeView.mjs.map +1 -1
- package/dist/ar-AE.cjs +5 -0
- package/dist/ar-AE.cjs.map +1 -1
- package/dist/ar-AE.mjs +5 -0
- package/dist/ar-AE.mjs.map +1 -1
- package/dist/bg-BG.cjs +5 -0
- package/dist/bg-BG.cjs.map +1 -1
- package/dist/bg-BG.mjs +5 -0
- package/dist/bg-BG.mjs.map +1 -1
- package/dist/cs-CZ.cjs +5 -0
- package/dist/cs-CZ.cjs.map +1 -1
- package/dist/cs-CZ.mjs +5 -0
- package/dist/cs-CZ.mjs.map +1 -1
- package/dist/da-DK.cjs +5 -0
- package/dist/da-DK.cjs.map +1 -1
- package/dist/da-DK.mjs +5 -0
- package/dist/da-DK.mjs.map +1 -1
- package/dist/de-DE.cjs +5 -0
- package/dist/de-DE.cjs.map +1 -1
- package/dist/de-DE.mjs +5 -0
- package/dist/de-DE.mjs.map +1 -1
- package/dist/el-GR.cjs +5 -0
- package/dist/el-GR.cjs.map +1 -1
- package/dist/el-GR.mjs +5 -0
- package/dist/el-GR.mjs.map +1 -1
- package/dist/en-US.cjs +21 -16
- package/dist/en-US.cjs.map +1 -1
- package/dist/en-US.mjs +21 -16
- package/dist/en-US.mjs.map +1 -1
- package/dist/es-ES.cjs +5 -0
- package/dist/es-ES.cjs.map +1 -1
- package/dist/es-ES.mjs +5 -0
- package/dist/es-ES.mjs.map +1 -1
- package/dist/et-EE.cjs +5 -0
- package/dist/et-EE.cjs.map +1 -1
- package/dist/et-EE.mjs +5 -0
- package/dist/et-EE.mjs.map +1 -1
- package/dist/fi-FI.cjs +5 -0
- package/dist/fi-FI.cjs.map +1 -1
- package/dist/fi-FI.mjs +5 -0
- package/dist/fi-FI.mjs.map +1 -1
- package/dist/fr-FR.cjs +5 -0
- package/dist/fr-FR.cjs.map +1 -1
- package/dist/fr-FR.mjs +5 -0
- package/dist/fr-FR.mjs.map +1 -1
- package/dist/he-IL.cjs +5 -0
- package/dist/he-IL.cjs.map +1 -1
- package/dist/he-IL.mjs +5 -0
- package/dist/he-IL.mjs.map +1 -1
- package/dist/hr-HR.cjs +5 -0
- package/dist/hr-HR.cjs.map +1 -1
- package/dist/hr-HR.mjs +5 -0
- package/dist/hr-HR.mjs.map +1 -1
- package/dist/hu-HU.cjs +5 -0
- package/dist/hu-HU.cjs.map +1 -1
- package/dist/hu-HU.mjs +5 -0
- package/dist/hu-HU.mjs.map +1 -1
- package/dist/it-IT.cjs +5 -0
- package/dist/it-IT.cjs.map +1 -1
- package/dist/it-IT.mjs +5 -0
- package/dist/it-IT.mjs.map +1 -1
- package/dist/ja-JP.cjs +5 -0
- package/dist/ja-JP.cjs.map +1 -1
- package/dist/ja-JP.mjs +5 -0
- package/dist/ja-JP.mjs.map +1 -1
- package/dist/ko-KR.cjs +5 -0
- package/dist/ko-KR.cjs.map +1 -1
- package/dist/ko-KR.mjs +5 -0
- package/dist/ko-KR.mjs.map +1 -1
- package/dist/lt-LT.cjs +5 -0
- package/dist/lt-LT.cjs.map +1 -1
- package/dist/lt-LT.mjs +5 -0
- package/dist/lt-LT.mjs.map +1 -1
- package/dist/lv-LV.cjs +5 -0
- package/dist/lv-LV.cjs.map +1 -1
- package/dist/lv-LV.mjs +5 -0
- package/dist/lv-LV.mjs.map +1 -1
- package/dist/main.cjs +2 -0
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +3 -3
- package/dist/module.mjs.map +1 -1
- package/dist/nb-NO.cjs +5 -0
- package/dist/nb-NO.cjs.map +1 -1
- package/dist/nb-NO.mjs +5 -0
- package/dist/nb-NO.mjs.map +1 -1
- package/dist/nl-NL.cjs +5 -0
- package/dist/nl-NL.cjs.map +1 -1
- package/dist/nl-NL.mjs +5 -0
- package/dist/nl-NL.mjs.map +1 -1
- package/dist/pl-PL.cjs +5 -0
- package/dist/pl-PL.cjs.map +1 -1
- package/dist/pl-PL.mjs +5 -0
- package/dist/pl-PL.mjs.map +1 -1
- package/dist/pt-BR.cjs +5 -0
- package/dist/pt-BR.cjs.map +1 -1
- package/dist/pt-BR.mjs +5 -0
- package/dist/pt-BR.mjs.map +1 -1
- package/dist/pt-PT.cjs +5 -0
- package/dist/pt-PT.cjs.map +1 -1
- package/dist/pt-PT.mjs +5 -0
- package/dist/pt-PT.mjs.map +1 -1
- package/dist/ro-RO.cjs +5 -0
- package/dist/ro-RO.cjs.map +1 -1
- package/dist/ro-RO.mjs +5 -0
- package/dist/ro-RO.mjs.map +1 -1
- package/dist/ru-RU.cjs +5 -0
- package/dist/ru-RU.cjs.map +1 -1
- package/dist/ru-RU.mjs +5 -0
- package/dist/ru-RU.mjs.map +1 -1
- package/dist/sk-SK.cjs +5 -0
- package/dist/sk-SK.cjs.map +1 -1
- package/dist/sk-SK.mjs +5 -0
- package/dist/sk-SK.mjs.map +1 -1
- package/dist/sl-SI.cjs +5 -0
- package/dist/sl-SI.cjs.map +1 -1
- package/dist/sl-SI.mjs +5 -0
- package/dist/sl-SI.mjs.map +1 -1
- package/dist/sr-SP.cjs +5 -0
- package/dist/sr-SP.cjs.map +1 -1
- package/dist/sr-SP.mjs +5 -0
- package/dist/sr-SP.mjs.map +1 -1
- package/dist/sv-SE.cjs +5 -0
- package/dist/sv-SE.cjs.map +1 -1
- package/dist/sv-SE.mjs +5 -0
- package/dist/sv-SE.mjs.map +1 -1
- package/dist/tr-TR.cjs +5 -0
- package/dist/tr-TR.cjs.map +1 -1
- package/dist/tr-TR.mjs +5 -0
- package/dist/tr-TR.mjs.map +1 -1
- package/dist/types.d.ts +147 -87
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.cjs +5 -0
- package/dist/uk-UA.cjs.map +1 -1
- package/dist/uk-UA.mjs +5 -0
- package/dist/uk-UA.mjs.map +1 -1
- package/dist/zh-CN.cjs +5 -0
- package/dist/zh-CN.cjs.map +1 -1
- package/dist/zh-CN.mjs +5 -0
- package/dist/zh-CN.mjs.map +1 -1
- package/dist/zh-TW.cjs +5 -0
- package/dist/zh-TW.cjs.map +1 -1
- package/dist/zh-TW.mjs +5 -0
- package/dist/zh-TW.mjs.map +1 -1
- 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 +20 -20
- package/page.css +7 -7
- package/src/ActionBar.tsx +5 -3
- package/src/ActionButton.tsx +112 -32
- package/src/Avatar.tsx +4 -1
- package/src/Button.tsx +27 -28
- package/src/Calendar.tsx +3 -0
- package/src/Card.tsx +22 -7
- package/src/CardView.tsx +9 -1
- package/src/ColorArea.tsx +10 -2
- package/src/ColorField.tsx +3 -2
- package/src/ColorSlider.tsx +3 -2
- package/src/ComboBox.tsx +69 -44
- package/src/ContextualHelp.tsx +36 -32
- package/src/CustomDialog.tsx +1 -1
- package/src/DateField.tsx +4 -0
- package/src/DatePicker.tsx +28 -20
- package/src/DateRangePicker.tsx +5 -1
- package/src/Dialog.tsx +6 -3
- package/src/Disclosure.tsx +20 -16
- package/src/DropZone.tsx +5 -2
- package/src/Field.tsx +4 -1
- package/src/FullscreenDialog.tsx +1 -1
- package/src/Image.tsx +30 -8
- package/src/InlineAlert.tsx +10 -27
- package/src/Menu.tsx +57 -45
- package/src/Modal.tsx +99 -74
- package/src/NumberField.tsx +3 -2
- package/src/Picker.tsx +114 -51
- package/src/Popover.tsx +57 -35
- package/src/Provider.tsx +1 -1
- package/src/RangeCalendar.tsx +3 -0
- package/src/RangeSlider.tsx +3 -0
- package/src/SearchField.tsx +2 -1
- package/src/SegmentedControl.tsx +16 -44
- package/src/SelectBoxGroup.tsx +21 -23
- package/src/TableView.tsx +7 -6
- package/src/Tabs.tsx +34 -70
- package/src/TabsPicker.tsx +35 -26
- package/src/TagGroup.tsx +44 -36
- package/src/TextField.tsx +11 -6
- package/src/TimeField.tsx +4 -0
- package/src/Tooltip.tsx +3 -0
- package/src/TreeView.tsx +2 -2
- package/src/index.ts +3 -2
- package/src/page.macro.ts +2 -2
- package/src/style-utils.ts +4 -3
- package/style/__tests__/style-macro.test.js +56 -56
- package/style/dist/spectrum-theme.cjs +36 -6
- package/style/dist/spectrum-theme.cjs.map +1 -1
- package/style/dist/spectrum-theme.mjs +36 -6
- package/style/dist/spectrum-theme.mjs.map +1 -1
- package/style/dist/types.d.ts +1 -0
- package/style/dist/types.d.ts.map +1 -1
- package/style/spectrum-theme.ts +10 -8
- package/style/tokens.ts +10 -0
package/src/Picker.tsx
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
ButtonRenderProps,
|
|
21
21
|
Collection,
|
|
22
22
|
ContextValue,
|
|
23
|
+
DEFAULT_SLOT,
|
|
23
24
|
ListBox,
|
|
24
25
|
ListBoxItem,
|
|
25
26
|
ListBoxItemProps,
|
|
@@ -32,9 +33,12 @@ import {
|
|
|
32
33
|
Virtualizer
|
|
33
34
|
} from 'react-aria-components';
|
|
34
35
|
import {AsyncLoadable, FocusableRef, FocusableRefValue, GlobalDOMAttributes, HelpTextProps, LoadingState, PressEvent, RefObject, SpectrumLabelableProps} from '@react-types/shared';
|
|
36
|
+
import {AvatarContext} from './Avatar';
|
|
35
37
|
import {baseColor, edgeToText, focusRing, style} from '../style' with {type: 'macro'};
|
|
38
|
+
import {box, iconStyles as checkboxIconStyles} from './Checkbox';
|
|
36
39
|
import {centerBaseline} from './CenterBaseline';
|
|
37
40
|
import {
|
|
41
|
+
checkbox,
|
|
38
42
|
checkmark,
|
|
39
43
|
description,
|
|
40
44
|
icon,
|
|
@@ -64,8 +68,9 @@ import {HeaderContext, HeadingContext, Text, TextContext} from './Content';
|
|
|
64
68
|
import {IconContext} from './Icon';
|
|
65
69
|
// @ts-ignore
|
|
66
70
|
import intlMessages from '../intl/*.json';
|
|
71
|
+
import {mergeStyles} from '../style/runtime';
|
|
67
72
|
import {Placement} from 'react-aria';
|
|
68
|
-
import {
|
|
73
|
+
import {Popover} from './Popover';
|
|
69
74
|
import {PressResponder} from '@react-aria/interactions';
|
|
70
75
|
import {pressScale} from './pressScale';
|
|
71
76
|
import {ProgressCircle} from './ProgressCircle';
|
|
@@ -73,7 +78,7 @@ import {raw} from '../style/style-macro' with {type: 'macro'};
|
|
|
73
78
|
import React, {createContext, forwardRef, ReactNode, useContext, useMemo, useRef, useState} from 'react';
|
|
74
79
|
import {useFocusableRef} from '@react-spectrum/utils';
|
|
75
80
|
import {useGlobalListeners, useSlotId} from '@react-aria/utils';
|
|
76
|
-
import {useLocalizedStringFormatter} from '@react-aria/i18n';
|
|
81
|
+
import {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';
|
|
77
82
|
import {useScale} from './utils';
|
|
78
83
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
79
84
|
|
|
@@ -91,8 +96,9 @@ export interface PickerStyleProps {
|
|
|
91
96
|
isQuiet?: boolean
|
|
92
97
|
}
|
|
93
98
|
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
type SelectionMode = 'single' | 'multiple';
|
|
100
|
+
export interface PickerProps<T extends object, M extends SelectionMode = 'single'> extends
|
|
101
|
+
Omit<AriaSelectProps<T, M>, 'children' | 'style' | 'className' | keyof GlobalDOMAttributes>,
|
|
96
102
|
PickerStyleProps,
|
|
97
103
|
StyleProps,
|
|
98
104
|
SpectrumLabelableProps,
|
|
@@ -236,6 +242,11 @@ const iconStyles = style({
|
|
|
236
242
|
}
|
|
237
243
|
});
|
|
238
244
|
|
|
245
|
+
const avatar = style({
|
|
246
|
+
gridArea: 'icon',
|
|
247
|
+
marginEnd: 'text-to-visual'
|
|
248
|
+
});
|
|
249
|
+
|
|
239
250
|
const loadingWrapperStyles = style({
|
|
240
251
|
gridColumnStart: '1',
|
|
241
252
|
gridColumnEnd: '-1',
|
|
@@ -262,7 +273,7 @@ let InsideSelectValueContext = createContext(false);
|
|
|
262
273
|
/**
|
|
263
274
|
* Pickers allow users to choose a single option from a collapsible list of options when space is limited.
|
|
264
275
|
*/
|
|
265
|
-
export const Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(function Picker<T extends object>(props: PickerProps<T>, ref: FocusableRef<HTMLButtonElement>) {
|
|
276
|
+
export const Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(function Picker<T extends object, M extends SelectionMode = 'single'>(props: PickerProps<T, M>, ref: FocusableRef<HTMLButtonElement>) {
|
|
266
277
|
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
|
|
267
278
|
[props, ref] = useSpectrumContextProps(props, ref, PickerContext);
|
|
268
279
|
let domRef = useFocusableRef(ref);
|
|
@@ -334,6 +345,8 @@ export const Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(function Pick
|
|
|
334
345
|
);
|
|
335
346
|
}
|
|
336
347
|
let scale = useScale();
|
|
348
|
+
let {direction: dir} = useLocale();
|
|
349
|
+
let RTLFlipOffset = dir === 'rtl' ? -1 : 1;
|
|
337
350
|
|
|
338
351
|
return (
|
|
339
352
|
<AriaSelect
|
|
@@ -389,49 +402,54 @@ export const Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(function Pick
|
|
|
389
402
|
estimatedHeadingHeight: 50,
|
|
390
403
|
padding: 8,
|
|
391
404
|
loaderHeight: LOADER_ROW_HEIGHTS[size][scale]}}>
|
|
392
|
-
<
|
|
405
|
+
<Popover
|
|
393
406
|
hideArrow
|
|
407
|
+
padding="none"
|
|
394
408
|
offset={menuOffset}
|
|
409
|
+
crossOffset={isQuiet ? RTLFlipOffset * -12 : undefined}
|
|
395
410
|
placement={`${direction} ${align}` as Placement}
|
|
396
411
|
shouldFlip={shouldFlip}
|
|
397
412
|
UNSAFE_style={{
|
|
398
413
|
width: menuWidth && !isQuiet ? `${menuWidth}px` : undefined
|
|
399
414
|
}}
|
|
400
415
|
styles={style({
|
|
401
|
-
marginStart: {
|
|
402
|
-
isQuiet: -12
|
|
403
|
-
},
|
|
404
416
|
minWidth: {
|
|
405
|
-
default: '
|
|
417
|
+
default: '--trigger-width',
|
|
406
418
|
isQuiet: 192
|
|
407
419
|
},
|
|
408
420
|
width: {
|
|
409
|
-
default: '
|
|
410
|
-
isQuiet: '[calc(var(--trigger-width)
|
|
421
|
+
default: '--trigger-width',
|
|
422
|
+
isQuiet: '[calc(var(--trigger-width) - 24)]'
|
|
411
423
|
}
|
|
412
424
|
})(props)}>
|
|
413
|
-
<
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
425
|
+
<div
|
|
426
|
+
className={style({
|
|
427
|
+
display: 'flex',
|
|
428
|
+
size: 'full'
|
|
429
|
+
})}>
|
|
430
|
+
<Provider
|
|
431
|
+
values={[
|
|
432
|
+
[HeaderContext, {styles: listboxHeader({size})}],
|
|
433
|
+
[HeadingContext, {
|
|
434
|
+
// @ts-ignore
|
|
435
|
+
role: 'presentation',
|
|
436
|
+
styles: sectionHeading
|
|
437
|
+
}],
|
|
438
|
+
[TextContext, {
|
|
439
|
+
slots: {
|
|
440
|
+
description: {styles: description({size})}
|
|
441
|
+
}
|
|
442
|
+
}]
|
|
443
|
+
]}>
|
|
444
|
+
<ListBox
|
|
445
|
+
dependencies={props.dependencies}
|
|
446
|
+
items={items}
|
|
447
|
+
className={listbox({size})}>
|
|
448
|
+
{renderer}
|
|
449
|
+
</ListBox>
|
|
450
|
+
</Provider>
|
|
451
|
+
</div>
|
|
452
|
+
</Popover>
|
|
435
453
|
</Virtualizer>
|
|
436
454
|
</InternalPickerContext.Provider>
|
|
437
455
|
</>
|
|
@@ -456,6 +474,13 @@ function PickerProgressCircle(props) {
|
|
|
456
474
|
);
|
|
457
475
|
}
|
|
458
476
|
|
|
477
|
+
const avatarSize = {
|
|
478
|
+
S: 16,
|
|
479
|
+
M: 20,
|
|
480
|
+
L: 22,
|
|
481
|
+
XL: 26
|
|
482
|
+
} as const;
|
|
483
|
+
|
|
459
484
|
interface PickerButtonInnerProps<T extends object> extends PickerStyleProps, Omit<AriaSelectRenderProps, 'isRequired' | 'isFocused'>, Pick<PickerProps<T>, 'loadingState'> {
|
|
460
485
|
loadingCircle: ReactNode,
|
|
461
486
|
buttonRef: RefObject<HTMLButtonElement | null>
|
|
@@ -474,6 +499,7 @@ const PickerButton = createHideableComponent(function PickerButton<T extends obj
|
|
|
474
499
|
loadingCircle,
|
|
475
500
|
buttonRef
|
|
476
501
|
} = props;
|
|
502
|
+
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
|
|
477
503
|
|
|
478
504
|
// For mouse interactions, pickers open on press start. When the popover underlay appears
|
|
479
505
|
// it covers the trigger button, causing onPressEnd to fire immediately and no press scaling
|
|
@@ -506,8 +532,8 @@ const PickerButton = createHideableComponent(function PickerButton<T extends obj
|
|
|
506
532
|
})}>
|
|
507
533
|
{(renderProps) => (
|
|
508
534
|
<>
|
|
509
|
-
<SelectValue className={valueStyles({isQuiet}) + ' ' + raw('&>
|
|
510
|
-
{({defaultChildren}) => {
|
|
535
|
+
<SelectValue className={valueStyles({isQuiet}) + ' ' + raw('&> :not([slot=icon], [slot=avatar], [slot=label], [data-slot=label]) {display: none;}')}>
|
|
536
|
+
{({selectedItems, defaultChildren}) => {
|
|
511
537
|
return (
|
|
512
538
|
<Provider
|
|
513
539
|
values={[
|
|
@@ -519,19 +545,43 @@ const PickerButton = createHideableComponent(function PickerButton<T extends obj
|
|
|
519
545
|
}
|
|
520
546
|
}
|
|
521
547
|
}],
|
|
548
|
+
[AvatarContext, {
|
|
549
|
+
slots: {
|
|
550
|
+
avatar: {
|
|
551
|
+
size: avatarSize[size ?? 'M'],
|
|
552
|
+
styles: avatar
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}],
|
|
522
556
|
[TextContext, {
|
|
523
557
|
slots: {
|
|
524
558
|
description: {},
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
559
|
+
[DEFAULT_SLOT]: {
|
|
560
|
+
styles: style({
|
|
561
|
+
display: 'block',
|
|
562
|
+
flexGrow: 1,
|
|
563
|
+
truncate: true
|
|
564
|
+
}),
|
|
565
|
+
// @ts-ignore
|
|
566
|
+
'data-slot': 'label'
|
|
567
|
+
},
|
|
568
|
+
label: {
|
|
569
|
+
styles: style({
|
|
570
|
+
display: 'block',
|
|
571
|
+
flexGrow: 1,
|
|
572
|
+
truncate: true
|
|
573
|
+
}),
|
|
574
|
+
// @ts-ignore not technically necessary, but good for consistency
|
|
575
|
+
'data-slot': 'label'
|
|
576
|
+
}
|
|
530
577
|
}
|
|
531
578
|
}],
|
|
532
579
|
[InsideSelectValueContext, true]
|
|
533
580
|
]}>
|
|
534
|
-
{
|
|
581
|
+
{selectedItems.length <= 1
|
|
582
|
+
? defaultChildren
|
|
583
|
+
: <Text slot="label">{stringFormatter.format('picker.selectedCount', {count: selectedItems.length})}</Text>
|
|
584
|
+
}
|
|
535
585
|
</Provider>
|
|
536
586
|
);
|
|
537
587
|
}}
|
|
@@ -577,6 +627,7 @@ export function PickerItem(props: PickerItemProps): ReactNode {
|
|
|
577
627
|
className={renderProps => (props.UNSAFE_className || '') + listboxItem({...renderProps, size, isLink}, props.styles)}>
|
|
578
628
|
{(renderProps) => {
|
|
579
629
|
let {children} = props;
|
|
630
|
+
let checkboxRenderProps = {...renderProps, size, isFocused: false, isFocusVisible: false, isIndeterminate: false, isReadOnly: false, isInvalid: false, isRequired: false};
|
|
580
631
|
return (
|
|
581
632
|
<DefaultProvider
|
|
582
633
|
context={IconContext}
|
|
@@ -584,15 +635,27 @@ export function PickerItem(props: PickerItemProps): ReactNode {
|
|
|
584
635
|
icon: {render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), styles: icon}
|
|
585
636
|
}}}>
|
|
586
637
|
<DefaultProvider
|
|
587
|
-
context={
|
|
588
|
-
value={{
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
638
|
+
context={AvatarContext}
|
|
639
|
+
value={{slots: {
|
|
640
|
+
avatar: {size: avatarSize[size], styles: avatar}
|
|
641
|
+
}}}>
|
|
642
|
+
<DefaultProvider
|
|
643
|
+
context={TextContext}
|
|
644
|
+
value={{
|
|
645
|
+
slots: {
|
|
646
|
+
[DEFAULT_SLOT]: {styles: label({size})},
|
|
647
|
+
label: {styles: label({size})},
|
|
648
|
+
description: {styles: description({...renderProps, size})}
|
|
649
|
+
}
|
|
650
|
+
}}>
|
|
651
|
+
{renderProps.selectionMode === 'single' && !isLink && <CheckmarkIcon size={checkmarkIconSize[size]} className={checkmark({...renderProps, size})} />}
|
|
652
|
+
{renderProps.selectionMode === 'multiple' && !isLink && (
|
|
653
|
+
<div className={mergeStyles(checkbox, box(checkboxRenderProps))}>
|
|
654
|
+
<CheckmarkIcon size={size} className={checkboxIconStyles} />
|
|
655
|
+
</div>
|
|
656
|
+
)}
|
|
657
|
+
{typeof children === 'string' ? <Text slot="label">{children}</Text> : children}
|
|
658
|
+
</DefaultProvider>
|
|
596
659
|
</DefaultProvider>
|
|
597
660
|
</DefaultProvider>
|
|
598
661
|
);
|
package/src/Popover.tsx
CHANGED
|
@@ -14,20 +14,22 @@ import {
|
|
|
14
14
|
Popover as AriaPopover,
|
|
15
15
|
PopoverProps as AriaPopoverProps,
|
|
16
16
|
composeRenderProps,
|
|
17
|
-
|
|
17
|
+
ContextValue,
|
|
18
18
|
DialogProps,
|
|
19
19
|
OverlayArrow,
|
|
20
20
|
OverlayTriggerStateContext,
|
|
21
21
|
useLocale
|
|
22
22
|
} from 'react-aria-components';
|
|
23
|
-
import {colorScheme, getAllowedOverrides,
|
|
23
|
+
import {colorScheme, getAllowedOverrides, heightProperties, UnsafeStyles, widthProperties} from './style-utils' with {type: 'macro'};
|
|
24
24
|
import {ColorSchemeContext} from './Provider';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
25
|
+
import {createContext, ForwardedRef, forwardRef, useCallback, useContext, useMemo} from 'react';
|
|
26
|
+
import {DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared';
|
|
27
|
+
import {lightDark, style} from '../style' with {type: 'macro'};
|
|
28
|
+
import {mergeRefs} from '@react-aria/utils';
|
|
27
29
|
import {mergeStyles} from '../style/runtime';
|
|
28
|
-
import {style} from '../style' with {type: 'macro'};
|
|
29
30
|
import {StyleString} from '../style/types' with {type: 'macro'};
|
|
30
31
|
import {useDOMRef} from '@react-spectrum/utils';
|
|
32
|
+
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
31
33
|
|
|
32
34
|
export interface PopoverProps extends UnsafeStyles, Omit<AriaPopoverProps, 'arrowSize' | 'isNonModal' | 'arrowBoundaryOffset' | 'isKeyboardDismissDisabled' | 'shouldCloseOnInteractOutside' | 'shouldUpdatePosition' | keyof GlobalDOMAttributes> {
|
|
33
35
|
styles?: StyleString,
|
|
@@ -62,10 +64,10 @@ let popover = style({
|
|
|
62
64
|
default: 'elevated',
|
|
63
65
|
isArrowShown: 'none'
|
|
64
66
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
default: 'gray-200',
|
|
67
|
+
outlineStyle: 'solid',
|
|
68
|
+
outlineWidth: 1,
|
|
69
|
+
outlineColor: {
|
|
70
|
+
default: lightDark('transparent-white-25', 'gray-200'),
|
|
69
71
|
forcedColors: 'ButtonBorder'
|
|
70
72
|
},
|
|
71
73
|
width: {
|
|
@@ -118,8 +120,7 @@ let popover = style({
|
|
|
118
120
|
isolation: 'isolate',
|
|
119
121
|
pointerEvents: {
|
|
120
122
|
isExiting: 'none'
|
|
121
|
-
}
|
|
122
|
-
outlineStyle: 'none'
|
|
123
|
+
}
|
|
123
124
|
}, getAllowedOverrides());
|
|
124
125
|
// TODO: animations and real Popover Arrow
|
|
125
126
|
|
|
@@ -145,12 +146,15 @@ let arrow = style({
|
|
|
145
146
|
},
|
|
146
147
|
strokeWidth: 1,
|
|
147
148
|
stroke: {
|
|
148
|
-
default: 'gray-200',
|
|
149
|
+
default: lightDark('transparent-white-25', 'gray-200'),
|
|
149
150
|
forcedColors: 'ButtonBorder'
|
|
150
151
|
}
|
|
151
152
|
});
|
|
152
153
|
|
|
153
|
-
export const
|
|
154
|
+
export const PopoverContext = createContext<ContextValue<PopoverProps, DOMRefValue<HTMLDivElement>>>(null);
|
|
155
|
+
export const InPopoverContext = createContext(false);
|
|
156
|
+
|
|
157
|
+
export const PopoverBase = forwardRef(function PopoverBase(props: PopoverProps, ref: ForwardedRef<HTMLDivElement | null>) {
|
|
154
158
|
let {
|
|
155
159
|
hideArrow = false,
|
|
156
160
|
UNSAFE_className = '',
|
|
@@ -158,18 +162,18 @@ export const PopoverBase = forwardRef(function PopoverBase(props: PopoverProps,
|
|
|
158
162
|
styles,
|
|
159
163
|
size
|
|
160
164
|
} = props;
|
|
161
|
-
let domRef = useDOMRef(ref);
|
|
162
165
|
let colorScheme = useContext(ColorSchemeContext);
|
|
163
166
|
let {locale, direction} = useLocale();
|
|
164
167
|
|
|
165
168
|
// TODO: should we pass through lang and dir props in RAC?
|
|
166
169
|
let popoverRef = useCallback((el: HTMLDivElement) => {
|
|
167
|
-
(domRef as MutableRefObject<HTMLDivElement>).current = el;
|
|
168
170
|
if (el) {
|
|
169
171
|
el.lang = locale;
|
|
170
172
|
el.dir = direction;
|
|
171
173
|
}
|
|
172
|
-
}, [locale, direction
|
|
174
|
+
}, [locale, direction]);
|
|
175
|
+
// Memoed so it doesn't break ComboBox/Picker scrolling
|
|
176
|
+
let mergedRef = useMemo(() => mergeRefs(popoverRef, ref), [ref, popoverRef]);
|
|
173
177
|
|
|
174
178
|
// On small devices, show a modal (or eventually a tray) instead of a popover.
|
|
175
179
|
// TODO: reverted this until we have trays.
|
|
@@ -198,7 +202,7 @@ export const PopoverBase = forwardRef(function PopoverBase(props: PopoverProps,
|
|
|
198
202
|
<AriaPopover
|
|
199
203
|
{...props}
|
|
200
204
|
offset={(props.offset ?? 8) + (hideArrow ? 0 : 8)}
|
|
201
|
-
ref={
|
|
205
|
+
ref={mergedRef}
|
|
202
206
|
style={{
|
|
203
207
|
...UNSAFE_style,
|
|
204
208
|
// Override default z-index from useOverlayPosition. We use isolation: isolate instead.
|
|
@@ -214,19 +218,33 @@ export const PopoverBase = forwardRef(function PopoverBase(props: PopoverProps,
|
|
|
214
218
|
</svg>
|
|
215
219
|
</OverlayArrow>
|
|
216
220
|
)}
|
|
217
|
-
|
|
221
|
+
<InPopoverContext.Provider value>
|
|
222
|
+
{children}
|
|
223
|
+
</InPopoverContext.Provider>
|
|
218
224
|
</>
|
|
219
225
|
))}
|
|
220
226
|
</AriaPopover>
|
|
221
227
|
);
|
|
222
228
|
});
|
|
223
229
|
|
|
224
|
-
|
|
230
|
+
type PopoverStylesProp = StyleString<((typeof widthProperties)[number] | (typeof heightProperties)[number])>;
|
|
231
|
+
export interface PopoverDialogProps extends Pick<PopoverProps, 'children' | 'size' | 'hideArrow'| 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset' | 'triggerRef' | 'isOpen' | 'onOpenChange'>, Omit<DialogProps, 'children' | 'className' | 'style' | keyof GlobalDOMAttributes>, UnsafeStyles {
|
|
232
|
+
/**
|
|
233
|
+
* The amount of padding around the contents of the dialog.
|
|
234
|
+
* @default 'default'
|
|
235
|
+
*/
|
|
236
|
+
padding?: 'default' | 'none',
|
|
237
|
+
/** Spectrum-defined styles, returned by the `style()` macro. */
|
|
238
|
+
styles?: PopoverStylesProp
|
|
225
239
|
}
|
|
226
240
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
241
|
+
const innerDivStyle = style({
|
|
242
|
+
padding: {
|
|
243
|
+
padding: {
|
|
244
|
+
default: 8,
|
|
245
|
+
none: 0
|
|
246
|
+
}
|
|
247
|
+
},
|
|
230
248
|
boxSizing: 'border-box',
|
|
231
249
|
outlineStyle: 'none',
|
|
232
250
|
borderRadius: 'inherit',
|
|
@@ -239,25 +257,29 @@ const dialogStyle = style({
|
|
|
239
257
|
/**
|
|
240
258
|
* A popover is an overlay element positioned relative to a trigger.
|
|
241
259
|
*/
|
|
242
|
-
export const Popover = forwardRef(function Popover(props: PopoverDialogProps, ref: DOMRef) {
|
|
260
|
+
export const Popover = forwardRef(function Popover(props: PopoverDialogProps, ref: DOMRef<HTMLDivElement>) {
|
|
261
|
+
[props, ref] = useSpectrumContextProps(props, ref, PopoverContext);
|
|
243
262
|
let domRef = useDOMRef(ref);
|
|
244
|
-
|
|
245
|
-
|
|
263
|
+
let {
|
|
264
|
+
UNSAFE_className,
|
|
265
|
+
UNSAFE_style,
|
|
266
|
+
styles,
|
|
267
|
+
padding = 'default',
|
|
268
|
+
...otherProps
|
|
269
|
+
} = props;
|
|
246
270
|
|
|
247
271
|
return (
|
|
248
|
-
<PopoverBase
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
{composeRenderProps(props.children, (children) => (
|
|
255
|
-
// Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.
|
|
272
|
+
<PopoverBase {...otherProps} ref={domRef}>
|
|
273
|
+
{composeRenderProps(props.children, (children) => (
|
|
274
|
+
<div
|
|
275
|
+
style={UNSAFE_style}
|
|
276
|
+
className={(UNSAFE_className || '') + innerDivStyle({padding}, styles)}>
|
|
277
|
+
{/* Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state. */}
|
|
256
278
|
<OverlayTriggerStateContext.Provider value={null}>
|
|
257
279
|
{children}
|
|
258
280
|
</OverlayTriggerStateContext.Provider>
|
|
259
|
-
|
|
260
|
-
|
|
281
|
+
</div>
|
|
282
|
+
))}
|
|
261
283
|
</PopoverBase>
|
|
262
284
|
);
|
|
263
285
|
});
|
package/src/Provider.tsx
CHANGED
|
@@ -51,7 +51,7 @@ export interface ProviderProps extends UnsafeStyles {
|
|
|
51
51
|
|
|
52
52
|
export const ColorSchemeContext = createContext<ColorScheme | 'light dark' | null>(null);
|
|
53
53
|
|
|
54
|
-
export function Provider(props: ProviderProps):
|
|
54
|
+
export function Provider(props: ProviderProps): JSX.Element {
|
|
55
55
|
let result = <ProviderInner {...props} />;
|
|
56
56
|
let parentColorScheme = useContext(ColorSchemeContext);
|
|
57
57
|
let colorScheme = props.colorScheme || parentColorScheme;
|
package/src/RangeCalendar.tsx
CHANGED
|
@@ -64,6 +64,9 @@ const headerStyles = style({
|
|
|
64
64
|
width: 'full'
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* RangeCalendars display a grid of days in one or more months and allow users to select a contiguous range of dates.
|
|
69
|
+
*/
|
|
67
70
|
export const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {
|
|
68
71
|
[props, ref] = useSpectrumContextProps(props, ref, RangeCalendarContext);
|
|
69
72
|
let {
|
package/src/RangeSlider.tsx
CHANGED
|
@@ -45,6 +45,9 @@ export interface RangeSliderProps extends Omit<SliderBaseProps<RangeValue<number
|
|
|
45
45
|
|
|
46
46
|
export const RangeSliderContext = createContext<ContextValue<Partial<RangeSliderProps>, FocusableRefValue<HTMLDivElement>>>(null);
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* RangeSliders allow users to quickly select a subset range. They should be used when the upper and lower bounds to the range are invariable.
|
|
50
|
+
*/
|
|
48
51
|
export const RangeSlider = /*#__PURE__*/ forwardRef(function RangeSlider(props: RangeSliderProps, ref: FocusableRef<HTMLDivElement>) {
|
|
49
52
|
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
|
|
50
53
|
[props, ref] = useSpectrumContextProps(props, ref, RangeSliderContext);
|
package/src/SearchField.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
SearchField as AriaSearchField,
|
|
15
15
|
SearchFieldProps as AriaSearchFieldProps,
|
|
16
16
|
ContextValue,
|
|
17
|
+
InputProps,
|
|
17
18
|
Provider
|
|
18
19
|
} from 'react-aria-components';
|
|
19
20
|
import {baseColor, fontRelative, style} from '../style' with {type: 'macro'};
|
|
@@ -31,7 +32,7 @@ import SearchIcon from '../s2wf-icons/S2_Icon_Search_20_N.svg';
|
|
|
31
32
|
import {TextFieldRef} from '@react-types/textfield';
|
|
32
33
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
33
34
|
|
|
34
|
-
export interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'className' | 'style' | 'children' | keyof GlobalDOMAttributes>, StyleProps, SpectrumLabelableProps, HelpTextProps {
|
|
35
|
+
export interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'className' | 'style' | 'children' | keyof GlobalDOMAttributes>, StyleProps, SpectrumLabelableProps, HelpTextProps, Pick<InputProps, 'placeholder'> {
|
|
35
36
|
/**
|
|
36
37
|
* The size of the SearchField.
|
|
37
38
|
*
|
package/src/SegmentedControl.tsx
CHANGED
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
import {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef, Key} from '@react-types/shared';
|
|
14
14
|
import {baseColor, focusRing, style} from '../style' with {type: 'macro'};
|
|
15
15
|
import {centerBaseline} from './CenterBaseline';
|
|
16
|
-
import {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SlotProps, ToggleButton, ToggleButtonGroup, ToggleButtonRenderProps, ToggleGroupStateContext} from 'react-aria-components';
|
|
16
|
+
import {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SelectionIndicator, SlotProps, ToggleButton, ToggleButtonGroup, ToggleButtonRenderProps, ToggleGroupStateContext} from 'react-aria-components';
|
|
17
17
|
import {control, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
|
|
18
|
-
import {createContext, forwardRef, ReactNode,
|
|
18
|
+
import {createContext, forwardRef, ReactNode, useCallback, useContext, useRef} from 'react';
|
|
19
19
|
import {IconContext} from './Icon';
|
|
20
20
|
import {pressScale} from './pressScale';
|
|
21
21
|
import {Text, TextContext} from './Content';
|
|
22
|
-
import {useDOMRef, useFocusableRef
|
|
22
|
+
import {useDOMRef, useFocusableRef} from '@react-spectrum/utils';
|
|
23
23
|
import {useLayoutEffect} from '@react-aria/utils';
|
|
24
24
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
25
25
|
|
|
@@ -110,9 +110,17 @@ const slider = style<{isDisabled: boolean}>({
|
|
|
110
110
|
isDisabled: 'GrayText'
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
+
top: 0,
|
|
113
114
|
left: 0,
|
|
114
115
|
width: 'full',
|
|
115
116
|
height: 'full',
|
|
117
|
+
contain: 'strict',
|
|
118
|
+
transition: {
|
|
119
|
+
default: '[translate,width]',
|
|
120
|
+
'@media (prefers-reduced-motion: reduce)': 'none'
|
|
121
|
+
},
|
|
122
|
+
transitionDuration: 200,
|
|
123
|
+
transitionTimingFunction: 'out',
|
|
116
124
|
position: 'absolute',
|
|
117
125
|
boxSizing: 'border-box',
|
|
118
126
|
borderStyle: 'solid',
|
|
@@ -130,8 +138,6 @@ const slider = style<{isDisabled: boolean}>({
|
|
|
130
138
|
|
|
131
139
|
interface InternalSegmentedControlContextProps {
|
|
132
140
|
register?: (value: Key, isDisabled?: boolean) => void,
|
|
133
|
-
prevRef?: RefObject<DOMRect | null>,
|
|
134
|
-
currentSelectedRef?: RefObject<HTMLDivElement | null>,
|
|
135
141
|
isJustified?: boolean
|
|
136
142
|
}
|
|
137
143
|
|
|
@@ -139,8 +145,6 @@ interface DefaultSelectionTrackProps {
|
|
|
139
145
|
defaultValue?: Key | null,
|
|
140
146
|
value?: Key | null,
|
|
141
147
|
children: ReactNode,
|
|
142
|
-
prevRef: RefObject<DOMRect | null>,
|
|
143
|
-
currentSelectedRef: RefObject<HTMLDivElement | null>,
|
|
144
148
|
isJustified?: boolean
|
|
145
149
|
}
|
|
146
150
|
|
|
@@ -158,14 +162,7 @@ export const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedContr
|
|
|
158
162
|
} = props;
|
|
159
163
|
let domRef = useDOMRef(ref);
|
|
160
164
|
|
|
161
|
-
let prevRef = useRef<DOMRect>(null);
|
|
162
|
-
let currentSelectedRef = useRef<HTMLDivElement>(null);
|
|
163
|
-
|
|
164
165
|
let onChange = (values: Set<Key>) => {
|
|
165
|
-
if (currentSelectedRef.current) {
|
|
166
|
-
prevRef.current = currentSelectedRef?.current.getBoundingClientRect();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
166
|
if (onSelectionChange) {
|
|
170
167
|
let firstKey = values.values().next().value;
|
|
171
168
|
if (firstKey != null) {
|
|
@@ -186,7 +183,7 @@ export const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedContr
|
|
|
186
183
|
onSelectionChange={onChange}
|
|
187
184
|
className={(props.UNSAFE_className || '') + segmentedControl(null, props.styles)}
|
|
188
185
|
aria-label={props['aria-label']}>
|
|
189
|
-
<DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey}
|
|
186
|
+
<DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} isJustified={props.isJustified}>
|
|
190
187
|
{props.children}
|
|
191
188
|
</DefaultSelectionTracker>
|
|
192
189
|
</ToggleButtonGroup>
|
|
@@ -209,7 +206,7 @@ function DefaultSelectionTracker(props: DefaultSelectionTrackProps) {
|
|
|
209
206
|
return (
|
|
210
207
|
<Provider
|
|
211
208
|
values={[
|
|
212
|
-
[InternalSegmentedControlContext, {register: register,
|
|
209
|
+
[InternalSegmentedControlContext, {register: register, isJustified: props.isJustified}]
|
|
213
210
|
]}>
|
|
214
211
|
{props.children}
|
|
215
212
|
</Provider>
|
|
@@ -222,46 +219,21 @@ function DefaultSelectionTracker(props: DefaultSelectionTrackProps) {
|
|
|
222
219
|
export const SegmentedControlItem = /*#__PURE__*/ forwardRef(function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLButtonElement>) {
|
|
223
220
|
let domRef = useFocusableRef(ref);
|
|
224
221
|
let divRef = useRef<HTMLDivElement>(null);
|
|
225
|
-
let {register,
|
|
226
|
-
let state = useContext(ToggleGroupStateContext);
|
|
227
|
-
let isSelected = state?.selectedKeys.has(props.id);
|
|
228
|
-
// do not apply animation if a user has the prefers-reduced-motion setting
|
|
229
|
-
let reduceMotion = useMediaQuery('(prefers-reduced-motion: reduce)');
|
|
222
|
+
let {register, isJustified} = useContext(InternalSegmentedControlContext);
|
|
230
223
|
|
|
231
224
|
useLayoutEffect(() => {
|
|
232
225
|
register?.(props.id);
|
|
233
226
|
}, [register, props.id]);
|
|
234
227
|
|
|
235
|
-
useLayoutEffect(() => {
|
|
236
|
-
if (isSelected && prevRef?.current && currentSelectedRef?.current && !reduceMotion) {
|
|
237
|
-
let currentItem = currentSelectedRef?.current.getBoundingClientRect();
|
|
238
|
-
|
|
239
|
-
let deltaX = prevRef?.current.left - currentItem?.left;
|
|
240
|
-
|
|
241
|
-
currentSelectedRef.current.animate(
|
|
242
|
-
[
|
|
243
|
-
{transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},
|
|
244
|
-
{transform: 'translateX(0px)', width: `${currentItem.width}px`}
|
|
245
|
-
],
|
|
246
|
-
{
|
|
247
|
-
duration: 200,
|
|
248
|
-
easing: 'ease-out'
|
|
249
|
-
}
|
|
250
|
-
);
|
|
251
|
-
|
|
252
|
-
prevRef.current = null;
|
|
253
|
-
}
|
|
254
|
-
}, [isSelected, reduceMotion, prevRef, currentSelectedRef]);
|
|
255
|
-
|
|
256
228
|
return (
|
|
257
229
|
<ToggleButton
|
|
258
230
|
{...props}
|
|
259
231
|
ref={domRef}
|
|
260
232
|
style={props.UNSAFE_style}
|
|
261
233
|
className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps, isJustified}, props.styles)} >
|
|
262
|
-
{({
|
|
234
|
+
{({isPressed, isDisabled}) => (
|
|
263
235
|
<>
|
|
264
|
-
|
|
236
|
+
<SelectionIndicator className={slider({isDisabled})} />
|
|
265
237
|
<Provider
|
|
266
238
|
values={[
|
|
267
239
|
[IconContext, {
|