@react-spectrum/s2 1.0.0 → 1.1.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.cjs.map +1 -1
- package/dist/Accordion.css +2 -2
- package/dist/Accordion.css.map +1 -1
- package/dist/Accordion.mjs +3 -3
- package/dist/Accordion.mjs.map +1 -1
- package/dist/ActionBar.cjs +62 -61
- package/dist/ActionBar.cjs.map +1 -1
- package/dist/ActionBar.css +58 -58
- package/dist/ActionBar.css.map +1 -1
- package/dist/ActionBar.mjs +62 -61
- package/dist/ActionBar.mjs.map +1 -1
- package/dist/ActionButton.cjs +234 -234
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +160 -160
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +234 -234
- 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 +17 -17
- package/dist/Avatar.css +16 -16
- package/dist/Avatar.mjs +17 -17
- package/dist/AvatarGroup.cjs +121 -121
- package/dist/AvatarGroup.css +31 -31
- package/dist/AvatarGroup.mjs +121 -121
- package/dist/Badge.cjs +197 -197
- package/dist/Badge.css +125 -125
- package/dist/Badge.mjs +197 -197
- package/dist/Breadcrumbs.cjs +235 -235
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css +100 -100
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs +235 -235
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs +333 -333
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +174 -174
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +333 -333
- 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 +169 -169
- package/dist/Calendar.cjs.map +1 -1
- package/dist/Calendar.css +134 -134
- package/dist/Calendar.css.map +1 -1
- package/dist/Calendar.mjs +169 -169
- package/dist/Calendar.mjs.map +1 -1
- package/dist/Card.cjs +310 -310
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css +206 -206
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +310 -310
- package/dist/Card.mjs.map +1 -1
- package/dist/CardView.cjs +19 -19
- package/dist/CardView.cjs.map +1 -1
- package/dist/CardView.css +17 -17
- package/dist/CardView.css.map +1 -1
- package/dist/CardView.mjs +19 -19
- 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 +162 -162
- package/dist/Checkbox.cjs.map +1 -1
- package/dist/Checkbox.css +95 -91
- package/dist/Checkbox.css.map +1 -1
- package/dist/Checkbox.mjs +162 -162
- package/dist/Checkbox.mjs.map +1 -1
- package/dist/CheckboxGroup.cjs +44 -44
- package/dist/CheckboxGroup.cjs.map +1 -1
- package/dist/CheckboxGroup.css +37 -37
- package/dist/CheckboxGroup.css.map +1 -1
- package/dist/CheckboxGroup.mjs +44 -44
- package/dist/CheckboxGroup.mjs.map +1 -1
- 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 +30 -30
- package/dist/ClearButton.css +30 -30
- package/dist/ClearButton.mjs +30 -30
- package/dist/CloseButton.cjs +56 -56
- package/dist/CloseButton.css +47 -47
- package/dist/CloseButton.mjs +56 -56
- package/dist/ColorArea.cjs +17 -17
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css +16 -16
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs +17 -17
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs +32 -32
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css +27 -27
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs +32 -32
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorHandle.cjs +27 -27
- package/dist/ColorHandle.css +42 -42
- package/dist/ColorHandle.mjs +27 -27
- package/dist/ColorSlider.cjs +109 -109
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css +52 -52
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs +109 -109
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs +30 -30
- package/dist/ColorSwatch.cjs.map +1 -1
- package/dist/ColorSwatch.css +29 -29
- package/dist/ColorSwatch.css.map +1 -1
- package/dist/ColorSwatch.mjs +30 -30
- package/dist/ColorSwatch.mjs.map +1 -1
- package/dist/ColorSwatchPicker.cjs +30 -30
- package/dist/ColorSwatchPicker.css +48 -48
- package/dist/ColorSwatchPicker.mjs +30 -30
- package/dist/ColorWheel.cjs +31 -27
- package/dist/ColorWheel.cjs.map +1 -1
- package/dist/ColorWheel.css +17 -17
- package/dist/ColorWheel.css.map +1 -1
- package/dist/ColorWheel.mjs +31 -27
- package/dist/ColorWheel.mjs.map +1 -1
- package/dist/ComboBox.cjs +383 -383
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +187 -187
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +383 -383
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +5 -5
- package/dist/ContextualHelp.css +50 -50
- package/dist/ContextualHelp.mjs +5 -5
- 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 +173 -173
- package/dist/DatePicker.cjs.map +1 -1
- package/dist/DatePicker.css +128 -128
- package/dist/DatePicker.css.map +1 -1
- package/dist/DatePicker.mjs +173 -173
- package/dist/DatePicker.mjs.map +1 -1
- package/dist/DateRangePicker.cjs +56 -56
- package/dist/DateRangePicker.cjs.map +1 -1
- package/dist/DateRangePicker.css +59 -59
- package/dist/DateRangePicker.css.map +1 -1
- package/dist/DateRangePicker.mjs +56 -56
- package/dist/DateRangePicker.mjs.map +1 -1
- package/dist/Dialog.cjs +17 -17
- package/dist/Dialog.cjs.map +1 -1
- package/dist/Dialog.css +70 -70
- package/dist/Dialog.css.map +1 -1
- package/dist/Dialog.mjs +17 -17
- package/dist/Dialog.mjs.map +1 -1
- package/dist/Disclosure.cjs +120 -120
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +112 -112
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +120 -120
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs +26 -26
- package/dist/Divider.cjs.map +1 -1
- package/dist/Divider.css +25 -25
- package/dist/Divider.css.map +1 -1
- package/dist/Divider.mjs +26 -26
- package/dist/Divider.mjs.map +1 -1
- package/dist/DropZone.cjs +62 -62
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css +57 -57
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs +62 -62
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs +348 -348
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +147 -147
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs +348 -348
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +10 -10
- package/dist/Form.cjs.map +1 -1
- package/dist/Form.css +9 -9
- package/dist/Form.css.map +1 -1
- package/dist/Form.mjs +10 -10
- package/dist/Form.mjs.map +1 -1
- package/dist/FullscreenDialog.cjs +5 -5
- package/dist/FullscreenDialog.cjs.map +1 -1
- package/dist/FullscreenDialog.css +78 -78
- package/dist/FullscreenDialog.css.map +1 -1
- package/dist/FullscreenDialog.mjs +5 -5
- package/dist/FullscreenDialog.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs +229 -229
- package/dist/IllustratedMessage.css +72 -72
- package/dist/IllustratedMessage.mjs +229 -229
- package/dist/Image.cjs +14 -14
- package/dist/Image.css +14 -14
- package/dist/Image.mjs +14 -14
- package/dist/InlineAlert.cjs +101 -101
- package/dist/InlineAlert.css +76 -76
- package/dist/InlineAlert.mjs +101 -101
- package/dist/Link.cjs +50 -50
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.css +41 -41
- package/dist/Link.css.map +1 -1
- package/dist/Link.mjs +50 -50
- package/dist/Link.mjs.map +1 -1
- package/dist/LinkOut.cjs +8 -8
- package/dist/LinkOut.css +8 -8
- package/dist/LinkOut.mjs +8 -8
- package/dist/Menu.cjs +446 -443
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +184 -184
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +446 -443
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +154 -154
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css +91 -91
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs +154 -154
- package/dist/Meter.mjs.map +1 -1
- package/dist/Modal.cjs +66 -66
- package/dist/Modal.cjs.map +1 -1
- package/dist/Modal.css +54 -54
- package/dist/Modal.css.map +1 -1
- package/dist/Modal.mjs +66 -66
- package/dist/Modal.mjs.map +1 -1
- package/dist/NotificationBadge.cjs +57 -57
- package/dist/NotificationBadge.css +49 -49
- package/dist/NotificationBadge.mjs +57 -57
- package/dist/NumberField.cjs +115 -115
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css +99 -99
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs +115 -115
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +275 -275
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +173 -173
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +275 -275
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +89 -89
- package/dist/Popover.cjs.map +1 -1
- package/dist/Popover.css +70 -70
- package/dist/Popover.css.map +1 -1
- package/dist/Popover.mjs +89 -89
- package/dist/Popover.mjs.map +1 -1
- package/dist/ProgressBar.cjs +164 -164
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css +99 -99
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs +164 -164
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/ProgressCircle.cjs +32 -32
- package/dist/ProgressCircle.cjs.map +1 -1
- package/dist/ProgressCircle.css +24 -24
- package/dist/ProgressCircle.css.map +1 -1
- package/dist/ProgressCircle.mjs +32 -32
- package/dist/ProgressCircle.mjs.map +1 -1
- package/dist/Provider.cjs +11 -11
- package/dist/Provider.css +10 -10
- package/dist/Provider.mjs +11 -11
- package/dist/Radio.cjs +146 -146
- package/dist/Radio.cjs.map +1 -1
- package/dist/Radio.css +78 -78
- package/dist/Radio.css.map +1 -1
- package/dist/Radio.mjs +146 -146
- package/dist/Radio.mjs.map +1 -1
- package/dist/RadioGroup.cjs +42 -42
- package/dist/RadioGroup.cjs.map +1 -1
- package/dist/RadioGroup.css +37 -37
- package/dist/RadioGroup.css.map +1 -1
- package/dist/RadioGroup.mjs +42 -42
- package/dist/RadioGroup.mjs.map +1 -1
- 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/SearchField.cjs +42 -42
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css +45 -45
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs +42 -42
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +180 -180
- package/dist/SegmentedControl.css +123 -123
- package/dist/SegmentedControl.mjs +180 -180
- package/dist/SelectBoxGroup.cjs +144 -144
- package/dist/SelectBoxGroup.cjs.map +1 -1
- package/dist/SelectBoxGroup.css +120 -120
- package/dist/SelectBoxGroup.css.map +1 -1
- package/dist/SelectBoxGroup.mjs +144 -144
- package/dist/SelectBoxGroup.mjs.map +1 -1
- package/dist/Slider.cjs +295 -295
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css +154 -154
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs +295 -295
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs +116 -116
- package/dist/StatusLight.css +59 -59
- package/dist/StatusLight.mjs +116 -116
- package/dist/Switch.cjs +155 -155
- package/dist/Switch.cjs.map +1 -1
- package/dist/Switch.css +74 -74
- package/dist/Switch.css.map +1 -1
- package/dist/Switch.mjs +155 -155
- package/dist/Switch.mjs.map +1 -1
- package/dist/TableView.cjs +415 -415
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css +199 -199
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs +416 -416
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +127 -127
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +105 -105
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +127 -127
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TabsPicker.cjs +127 -127
- package/dist/TabsPicker.cjs.map +1 -1
- package/dist/TabsPicker.css +108 -108
- package/dist/TabsPicker.css.map +1 -1
- package/dist/TabsPicker.mjs +127 -127
- package/dist/TabsPicker.mjs.map +1 -1
- package/dist/TagGroup.cjs +204 -204
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css +146 -146
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +204 -204
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +59 -59
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css +54 -54
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs +59 -59
- package/dist/TextField.mjs.map +1 -1
- package/dist/TimeField.cjs +52 -52
- package/dist/TimeField.cjs.map +1 -1
- package/dist/TimeField.css +47 -47
- package/dist/TimeField.css.map +1 -1
- package/dist/TimeField.mjs +52 -52
- package/dist/TimeField.mjs.map +1 -1
- package/dist/Toast.cjs +120 -120
- package/dist/Toast.cjs.map +1 -1
- package/dist/Toast.css +110 -110
- package/dist/Toast.css.map +1 -1
- package/dist/Toast.mjs +120 -120
- package/dist/Toast.mjs.map +1 -1
- package/dist/ToggleButton.cjs +3 -3
- package/dist/ToggleButton.cjs.map +1 -1
- package/dist/ToggleButton.css +12 -12
- package/dist/ToggleButton.css.map +1 -1
- package/dist/ToggleButton.mjs +3 -3
- package/dist/ToggleButton.mjs.map +1 -1
- package/dist/ToggleButtonGroup.cjs.map +1 -1
- package/dist/ToggleButtonGroup.mjs.map +1 -1
- package/dist/Tooltip.cjs +78 -78
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css +65 -65
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +78 -78
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/TreeView.cjs +144 -128
- package/dist/TreeView.cjs.map +1 -1
- package/dist/TreeView.css +131 -127
- package/dist/TreeView.css.map +1 -1
- package/dist/TreeView.mjs +144 -128
- package/dist/TreeView.mjs.map +1 -1
- package/dist/types.d.ts +68 -72
- package/dist/types.d.ts.map +1 -1
- package/icons/Icon.cjs +12 -12
- package/icons/Icon.css +9 -9
- package/icons/Icon.mjs +12 -12
- package/icons/Skeleton.cjs +2 -2
- package/icons/Skeleton.cjs.map +1 -1
- package/icons/Skeleton.css +6 -6
- package/icons/Skeleton.mjs +2 -2
- package/icons/Skeleton.mjs.map +1 -1
- package/icons/runtime.cjs +16 -3
- package/icons/runtime.cjs.map +1 -1
- package/icons/runtime.mjs +16 -3
- package/icons/runtime.mjs.map +1 -1
- package/package.json +21 -21
- package/src/Accordion.tsx +1 -1
- package/src/ActionBar.tsx +2 -2
- package/src/ActionButton.tsx +1 -1
- package/src/Breadcrumbs.tsx +2 -2
- package/src/Button.tsx +2 -2
- package/src/Calendar.tsx +1 -1
- package/src/Card.tsx +1 -1
- package/src/CardView.tsx +1 -1
- package/src/Checkbox.tsx +2 -1
- package/src/CheckboxGroup.tsx +1 -1
- package/src/CoachMark.tsx +1 -1
- package/src/ColorArea.tsx +1 -1
- package/src/ColorField.tsx +1 -1
- package/src/ColorSlider.tsx +1 -1
- package/src/ColorSwatch.tsx +1 -1
- package/src/ColorWheel.tsx +2 -2
- package/src/ComboBox.tsx +2 -2
- package/src/CustomDialog.tsx +1 -1
- package/src/DateField.tsx +1 -1
- package/src/DatePicker.tsx +1 -1
- package/src/DateRangePicker.tsx +1 -1
- package/src/Dialog.tsx +1 -1
- package/src/Disclosure.tsx +2 -2
- package/src/Divider.tsx +1 -1
- package/src/DropZone.tsx +1 -1
- package/src/Field.tsx +3 -3
- package/src/Form.tsx +1 -1
- package/src/FullscreenDialog.tsx +1 -1
- package/src/Link.tsx +1 -1
- package/src/Menu.tsx +11 -13
- package/src/Meter.tsx +1 -1
- package/src/Modal.tsx +1 -1
- package/src/NumberField.tsx +1 -1
- package/src/Picker.tsx +3 -3
- package/src/Popover.tsx +2 -1
- package/src/ProgressBar.tsx +1 -1
- package/src/ProgressCircle.tsx +1 -1
- package/src/Radio.tsx +1 -1
- package/src/RadioGroup.tsx +1 -1
- package/src/RangeCalendar.tsx +1 -1
- package/src/SearchField.tsx +1 -1
- package/src/SelectBoxGroup.tsx +1 -1
- package/src/Slider.tsx +1 -1
- package/src/Switch.tsx +1 -1
- package/src/TableView.tsx +9 -9
- package/src/Tabs.tsx +4 -4
- package/src/TabsPicker.tsx +2 -2
- package/src/TagGroup.tsx +2 -2
- package/src/TextField.tsx +1 -1
- package/src/TimeField.tsx +1 -1
- package/src/Toast.tsx +1 -1
- package/src/ToggleButton.tsx +1 -1
- package/src/ToggleButtonGroup.tsx +1 -1
- package/src/Tooltip.tsx +1 -1
- package/src/TreeView.tsx +10 -6
- package/style/__tests__/mergeStyles.test.ts +68 -0
- package/style/__tests__/style-macro.test.js +79 -59
- package/style/dist/style-macro.cjs +65 -14
- package/style/dist/style-macro.cjs.map +1 -1
- package/style/dist/style-macro.mjs +65 -14
- package/style/dist/style-macro.mjs.map +1 -1
- package/style/runtime.ts +21 -5
- package/style/style-macro.ts +81 -16
- package/style/__tests__/mergeStyles.test.js +0 -32
package/dist/Accordion.cjs
CHANGED
|
@@ -35,9 +35,9 @@ $parcel$export(module.exports, "AccordionItemPanel", () => $152a25dfd79f123a$exp
|
|
|
35
35
|
|
|
36
36
|
const $152a25dfd79f123a$var$accordion = function anonymous(props, overrides) {
|
|
37
37
|
let rules = " ";
|
|
38
|
-
rules += ((overrides || '').match(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L|F|M|K)[^\s]+/g) || []).join('');
|
|
39
|
-
rules += '
|
|
40
|
-
rules += '
|
|
38
|
+
rules += (String(overrides || '').match(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L|F|M|K)[^\s]+/g) || []).join('');
|
|
39
|
+
rules += ' sd11';
|
|
40
|
+
rules += ' _ta11';
|
|
41
41
|
return rules;
|
|
42
42
|
};
|
|
43
43
|
const $152a25dfd79f123a$export$6bd5bb82c987ab74 = /*#__PURE__*/ (0, $etdk1$react.createContext)(null);
|
package/dist/Accordion.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA8CD,MAAM;;;;;;;AAKC,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAsE;AAK3G,MAAM,0DAAY,CAAA,GAAA,uBAAS,EAAE,SAAS,UAAU,KAAqB,EAAE,GAA2B;IACvG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,gBACF,YAAY,oBACZ,mBAAmB,UACnB,OAAO,cACP,UAAU,oBACV,OAAO,EACR,GAAG;IACJ,qBACE,gCAAC,CAAA,GAAA,2CAAgB,EAAE,QAAQ;QAAC,OAAO;kBAAC;qBAAM;qBAAS;QAAO;kBACxD,cAAA,gCAAC,CAAA,GAAA,0CAAc;YACZ,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,gCAAU,MAAM,MAAM,MAAM;sBACjE,MAAM,QAAQ;;;AAIvB;AAmEO,MAAM,0DAAgB,CAAA,GAAA,uBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA2B;IACnH,qBAAO,gCAAC,CAAA,GAAA,oCAAS;QAAG,GAAG,KAAK;QAAE,KAAK;;AACrC;AAeO,MAAM,0DAAqB,CAAA,GAAA,uBAAS,EAAE,SAAS,mBAAmB,KAA8B,EAAE,GAA2B;IAClI,qBAAO,gCAAC,CAAA,GAAA,yCAAc;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC1C;AAUO,MAAM,0DAAsB,CAAA,GAAA,uBAAS,EAAE,SAAS,oBAAoB,KAA+B,EAAE,GAA2B;IACrI,qBAAO,gCAAC,CAAA,GAAA,0CAAe;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC3C;AAeO,MAAM,0DAAqB,CAAA,GAAA,uBAAS,EAAE,SAAS,mBAAmB,KAA8B,EAAE,GAA2B;IAClI,qBAAO,gCAAC,CAAA,GAAA,yCAAc;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC1C","sources":["packages/@react-spectrum/s2/src/Accordion.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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {ContextValue, DisclosureGroup, RenderProps, SlotProps} from 'react-aria-components';\nimport {\n Disclosure,\n DisclosureContext,\n DisclosureHeader,\n DisclosurePanel,\n DisclosureTitle\n} from './Disclosure';\nimport {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends UnsafeStyles, DOMProps, SlotProps {\n /** The accordion item elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion items.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** Whether multiple accordion items can be expanded at the same time. */\n allowsMultipleExpanded?: boolean,\n /** Whether all accordion items are disabled. */\n isDisabled?: boolean,\n /** The currently expanded keys in the accordion (controlled). */\n expandedKeys?: Iterable<Key>,\n /** The initial expanded keys in the accordion (uncontrolled). */\n defaultExpandedKeys?: Iterable<Key>,\n /** Handler that is called when accordion items are expanded or collapsed. */\n onExpandedChange?: (keys: Set<Key>) => any\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<Partial<AccordionProps>, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * An accordion is a container for multiple accordion items.\n */\nexport const Accordion = forwardRef(function Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n});\n\nexport interface AccordionItemState {\n /** Whether the accordion item is currently expanded. */\n readonly isExpanded: boolean,\n /** Sets whether the accordion item is expanded. */\n setExpanded(isExpanded: boolean): void,\n /** Expand the accordion item. */\n expand(): void,\n /** Collapse the accordion item. */\n collapse(): void,\n /** Toggles the accordion item's visibility. */\n toggle(): void\n}\n\nexport interface AccordionItemRenderProps {\n /**\n * Whether the accordion item is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the accordion item has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the accordion item is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the accordion item.\n */\n state: AccordionItemState\n}\n\nexport interface AccordionItemProps extends Omit<RenderProps<AccordionItemRenderProps>, 'className' | 'style'>, SlotProps, StyleProps {\n /**\n * The size of the accordion item.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion item.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion item should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the accordion item, consisting of a accordion item title and accordion item panel. */\n children: ReactNode,\n /** An id for the accordion item, matching the id used in `expandedKeys`. */\n id?: Key,\n /** Whether the accordion item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the accordion item's expanded state changes. */\n onExpandedChange?: (isExpanded: boolean) => void,\n /** Whether the accordion item is expanded (controlled). */\n isExpanded?: boolean,\n /** Whether the accordion item is expanded by default (uncontrolled). */\n defaultExpanded?: boolean\n}\n\n/**\n * A accordion item is a collapsible section of content. It is composed of a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const AccordionItem = forwardRef(function AccordionItem(props: AccordionItemProps, ref: DOMRef<HTMLDivElement>) {\n return <Disclosure {...props} ref={ref} />;\n});\n\nexport interface AccordionItemTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the accordion item title.\n *\n * @default 3\n */\n level?: number,\n /** The contents of the accordion item title. */\n children: React.ReactNode\n}\n\n/**\n * An accordion item title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const AccordionItemTitle = forwardRef(function AccordionItemTitle(props: AccordionItemTitleProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureTitle {...props} ref={ref} />;\n});\n\nexport interface AccordionItemHeaderProps extends UnsafeStyles, DOMProps {\n /** The contents of the accordion item header. */\n children: React.ReactNode\n}\n\n/**\n * A wrapper element for the accordion item title that can contain other elements not part of the trigger.\n */\nexport const AccordionItemHeader = forwardRef(function AccordionItemHeader(props: AccordionItemHeaderProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureHeader {...props} ref={ref} />;\n});\n\nexport interface AccordionItemPanelProps extends UnsafeStyles, DOMProps, AriaLabelingProps {\n /** The contents of the accordion item panel. */\n children: React.ReactNode,\n /**\n * The accessibility role for the accordion item panel.\n * @default 'group'\n */\n role?: 'group' | 'region'\n}\n\n/**\n * An accordion item panel is a collapsible section of content that is hidden until the accordion item is expanded.\n */\nexport const AccordionItemPanel = forwardRef(function AccordionItemPanel(props: AccordionItemPanelProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosurePanel {...props} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Accordion.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA8CD,MAAM;;;;;;;AAKC,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAsE;AAK3G,MAAM,0DAAY,CAAA,GAAA,uBAAS,EAAE,SAAS,UAAU,KAAqB,EAAE,GAA2B;IACvG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,gBACF,YAAY,oBACZ,mBAAmB,UACnB,OAAO,cACP,UAAU,oBACV,OAAO,EACR,GAAG;IACJ,qBACE,gCAAC,CAAA,GAAA,2CAAgB,EAAE,QAAQ;QAAC,OAAO;kBAAC;qBAAM;qBAAS;QAAO;kBACxD,cAAA,gCAAC,CAAA,GAAA,0CAAc;YACZ,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,gCAAU,MAAM,MAAM,MAAM;sBACjE,MAAM,QAAQ;;;AAIvB;AAmEO,MAAM,0DAAgB,CAAA,GAAA,uBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA2B;IACnH,qBAAO,gCAAC,CAAA,GAAA,oCAAS;QAAG,GAAG,KAAK;QAAE,KAAK;;AACrC;AAeO,MAAM,0DAAqB,CAAA,GAAA,uBAAS,EAAE,SAAS,mBAAmB,KAA8B,EAAE,GAA2B;IAClI,qBAAO,gCAAC,CAAA,GAAA,yCAAc;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC1C;AAUO,MAAM,0DAAsB,CAAA,GAAA,uBAAS,EAAE,SAAS,oBAAoB,KAA+B,EAAE,GAA2B;IACrI,qBAAO,gCAAC,CAAA,GAAA,0CAAe;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC3C;AAeO,MAAM,0DAAqB,CAAA,GAAA,uBAAS,EAAE,SAAS,mBAAmB,KAA8B,EAAE,GAA2B;IAClI,qBAAO,gCAAC,CAAA,GAAA,yCAAc;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC1C","sources":["packages/@react-spectrum/s2/src/Accordion.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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {ContextValue, DisclosureGroup, RenderProps, SlotProps} from 'react-aria-components';\nimport {\n Disclosure,\n DisclosureContext,\n DisclosureHeader,\n DisclosurePanel,\n DisclosureTitle\n} from './Disclosure';\nimport {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends UnsafeStyles, DOMProps, SlotProps {\n /** The accordion item elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion items.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** Whether multiple accordion items can be expanded at the same time. */\n allowsMultipleExpanded?: boolean,\n /** Whether all accordion items are disabled. */\n isDisabled?: boolean,\n /** The currently expanded keys in the accordion (controlled). */\n expandedKeys?: Iterable<Key>,\n /** The initial expanded keys in the accordion (uncontrolled). */\n defaultExpandedKeys?: Iterable<Key>,\n /** Handler that is called when accordion items are expanded or collapsed. */\n onExpandedChange?: (keys: Set<Key>) => any\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<Partial<AccordionProps>, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * An accordion is a container for multiple accordion items.\n */\nexport const Accordion = forwardRef(function Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n});\n\nexport interface AccordionItemState {\n /** Whether the accordion item is currently expanded. */\n readonly isExpanded: boolean,\n /** Sets whether the accordion item is expanded. */\n setExpanded(isExpanded: boolean): void,\n /** Expand the accordion item. */\n expand(): void,\n /** Collapse the accordion item. */\n collapse(): void,\n /** Toggles the accordion item's visibility. */\n toggle(): void\n}\n\nexport interface AccordionItemRenderProps {\n /**\n * Whether the accordion item is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the accordion item has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the accordion item is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the accordion item.\n */\n state: AccordionItemState\n}\n\nexport interface AccordionItemProps extends Omit<RenderProps<AccordionItemRenderProps>, 'className' | 'style' | 'render'>, SlotProps, StyleProps {\n /**\n * The size of the accordion item.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion item.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion item should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the accordion item, consisting of a accordion item title and accordion item panel. */\n children: ReactNode,\n /** An id for the accordion item, matching the id used in `expandedKeys`. */\n id?: Key,\n /** Whether the accordion item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the accordion item's expanded state changes. */\n onExpandedChange?: (isExpanded: boolean) => void,\n /** Whether the accordion item is expanded (controlled). */\n isExpanded?: boolean,\n /** Whether the accordion item is expanded by default (uncontrolled). */\n defaultExpanded?: boolean\n}\n\n/**\n * A accordion item is a collapsible section of content. It is composed of a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const AccordionItem = forwardRef(function AccordionItem(props: AccordionItemProps, ref: DOMRef<HTMLDivElement>) {\n return <Disclosure {...props} ref={ref} />;\n});\n\nexport interface AccordionItemTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the accordion item title.\n *\n * @default 3\n */\n level?: number,\n /** The contents of the accordion item title. */\n children: React.ReactNode\n}\n\n/**\n * An accordion item title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const AccordionItemTitle = forwardRef(function AccordionItemTitle(props: AccordionItemTitleProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureTitle {...props} ref={ref} />;\n});\n\nexport interface AccordionItemHeaderProps extends UnsafeStyles, DOMProps {\n /** The contents of the accordion item header. */\n children: React.ReactNode\n}\n\n/**\n * A wrapper element for the accordion item title that can contain other elements not part of the trigger.\n */\nexport const AccordionItemHeader = forwardRef(function AccordionItemHeader(props: AccordionItemHeaderProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureHeader {...props} ref={ref} />;\n});\n\nexport interface AccordionItemPanelProps extends UnsafeStyles, DOMProps, AriaLabelingProps {\n /** The contents of the accordion item panel. */\n children: React.ReactNode,\n /**\n * The accessibility role for the accordion item panel.\n * @default 'group'\n */\n role?: 'group' | 'region'\n}\n\n/**\n * An accordion item panel is a collapsible section of content that is hidden until the accordion item is expanded.\n */\nexport const AccordionItemPanel = forwardRef(function AccordionItemPanel(props: AccordionItemPanelProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosurePanel {...props} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Accordion.cjs.map"}
|
package/dist/Accordion.css
CHANGED
package/dist/Accordion.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAwDkB;EAAA;;;;EAAA","sources":["packages/@react-spectrum/s2/src/Accordion.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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {ContextValue, DisclosureGroup, RenderProps, SlotProps} from 'react-aria-components';\nimport {\n Disclosure,\n DisclosureContext,\n DisclosureHeader,\n DisclosurePanel,\n DisclosureTitle\n} from './Disclosure';\nimport {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends UnsafeStyles, DOMProps, SlotProps {\n /** The accordion item elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion items.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** Whether multiple accordion items can be expanded at the same time. */\n allowsMultipleExpanded?: boolean,\n /** Whether all accordion items are disabled. */\n isDisabled?: boolean,\n /** The currently expanded keys in the accordion (controlled). */\n expandedKeys?: Iterable<Key>,\n /** The initial expanded keys in the accordion (uncontrolled). */\n defaultExpandedKeys?: Iterable<Key>,\n /** Handler that is called when accordion items are expanded or collapsed. */\n onExpandedChange?: (keys: Set<Key>) => any\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<Partial<AccordionProps>, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * An accordion is a container for multiple accordion items.\n */\nexport const Accordion = forwardRef(function Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n});\n\nexport interface AccordionItemState {\n /** Whether the accordion item is currently expanded. */\n readonly isExpanded: boolean,\n /** Sets whether the accordion item is expanded. */\n setExpanded(isExpanded: boolean): void,\n /** Expand the accordion item. */\n expand(): void,\n /** Collapse the accordion item. */\n collapse(): void,\n /** Toggles the accordion item's visibility. */\n toggle(): void\n}\n\nexport interface AccordionItemRenderProps {\n /**\n * Whether the accordion item is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the accordion item has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the accordion item is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the accordion item.\n */\n state: AccordionItemState\n}\n\nexport interface AccordionItemProps extends Omit<RenderProps<AccordionItemRenderProps>, 'className' | 'style'>, SlotProps, StyleProps {\n /**\n * The size of the accordion item.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion item.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion item should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the accordion item, consisting of a accordion item title and accordion item panel. */\n children: ReactNode,\n /** An id for the accordion item, matching the id used in `expandedKeys`. */\n id?: Key,\n /** Whether the accordion item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the accordion item's expanded state changes. */\n onExpandedChange?: (isExpanded: boolean) => void,\n /** Whether the accordion item is expanded (controlled). */\n isExpanded?: boolean,\n /** Whether the accordion item is expanded by default (uncontrolled). */\n defaultExpanded?: boolean\n}\n\n/**\n * A accordion item is a collapsible section of content. It is composed of a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const AccordionItem = forwardRef(function AccordionItem(props: AccordionItemProps, ref: DOMRef<HTMLDivElement>) {\n return <Disclosure {...props} ref={ref} />;\n});\n\nexport interface AccordionItemTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the accordion item title.\n *\n * @default 3\n */\n level?: number,\n /** The contents of the accordion item title. */\n children: React.ReactNode\n}\n\n/**\n * An accordion item title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const AccordionItemTitle = forwardRef(function AccordionItemTitle(props: AccordionItemTitleProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureTitle {...props} ref={ref} />;\n});\n\nexport interface AccordionItemHeaderProps extends UnsafeStyles, DOMProps {\n /** The contents of the accordion item header. */\n children: React.ReactNode\n}\n\n/**\n * A wrapper element for the accordion item title that can contain other elements not part of the trigger.\n */\nexport const AccordionItemHeader = forwardRef(function AccordionItemHeader(props: AccordionItemHeaderProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureHeader {...props} ref={ref} />;\n});\n\nexport interface AccordionItemPanelProps extends UnsafeStyles, DOMProps, AriaLabelingProps {\n /** The contents of the accordion item panel. */\n children: React.ReactNode,\n /**\n * The accessibility role for the accordion item panel.\n * @default 'group'\n */\n role?: 'group' | 'region'\n}\n\n/**\n * An accordion item panel is a collapsible section of content that is hidden until the accordion item is expanded.\n */\nexport const AccordionItemPanel = forwardRef(function AccordionItemPanel(props: AccordionItemPanelProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosurePanel {...props} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Accordion.css.map"}
|
|
1
|
+
{"mappings":"AAwDkB;EAAA;;;;EAAA","sources":["packages/@react-spectrum/s2/src/Accordion.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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {ContextValue, DisclosureGroup, RenderProps, SlotProps} from 'react-aria-components';\nimport {\n Disclosure,\n DisclosureContext,\n DisclosureHeader,\n DisclosurePanel,\n DisclosureTitle\n} from './Disclosure';\nimport {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends UnsafeStyles, DOMProps, SlotProps {\n /** The accordion item elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion items.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** Whether multiple accordion items can be expanded at the same time. */\n allowsMultipleExpanded?: boolean,\n /** Whether all accordion items are disabled. */\n isDisabled?: boolean,\n /** The currently expanded keys in the accordion (controlled). */\n expandedKeys?: Iterable<Key>,\n /** The initial expanded keys in the accordion (uncontrolled). */\n defaultExpandedKeys?: Iterable<Key>,\n /** Handler that is called when accordion items are expanded or collapsed. */\n onExpandedChange?: (keys: Set<Key>) => any\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<Partial<AccordionProps>, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * An accordion is a container for multiple accordion items.\n */\nexport const Accordion = forwardRef(function Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n});\n\nexport interface AccordionItemState {\n /** Whether the accordion item is currently expanded. */\n readonly isExpanded: boolean,\n /** Sets whether the accordion item is expanded. */\n setExpanded(isExpanded: boolean): void,\n /** Expand the accordion item. */\n expand(): void,\n /** Collapse the accordion item. */\n collapse(): void,\n /** Toggles the accordion item's visibility. */\n toggle(): void\n}\n\nexport interface AccordionItemRenderProps {\n /**\n * Whether the accordion item is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the accordion item has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the accordion item is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the accordion item.\n */\n state: AccordionItemState\n}\n\nexport interface AccordionItemProps extends Omit<RenderProps<AccordionItemRenderProps>, 'className' | 'style' | 'render'>, SlotProps, StyleProps {\n /**\n * The size of the accordion item.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion item.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion item should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the accordion item, consisting of a accordion item title and accordion item panel. */\n children: ReactNode,\n /** An id for the accordion item, matching the id used in `expandedKeys`. */\n id?: Key,\n /** Whether the accordion item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the accordion item's expanded state changes. */\n onExpandedChange?: (isExpanded: boolean) => void,\n /** Whether the accordion item is expanded (controlled). */\n isExpanded?: boolean,\n /** Whether the accordion item is expanded by default (uncontrolled). */\n defaultExpanded?: boolean\n}\n\n/**\n * A accordion item is a collapsible section of content. It is composed of a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const AccordionItem = forwardRef(function AccordionItem(props: AccordionItemProps, ref: DOMRef<HTMLDivElement>) {\n return <Disclosure {...props} ref={ref} />;\n});\n\nexport interface AccordionItemTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the accordion item title.\n *\n * @default 3\n */\n level?: number,\n /** The contents of the accordion item title. */\n children: React.ReactNode\n}\n\n/**\n * An accordion item title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const AccordionItemTitle = forwardRef(function AccordionItemTitle(props: AccordionItemTitleProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureTitle {...props} ref={ref} />;\n});\n\nexport interface AccordionItemHeaderProps extends UnsafeStyles, DOMProps {\n /** The contents of the accordion item header. */\n children: React.ReactNode\n}\n\n/**\n * A wrapper element for the accordion item title that can contain other elements not part of the trigger.\n */\nexport const AccordionItemHeader = forwardRef(function AccordionItemHeader(props: AccordionItemHeaderProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureHeader {...props} ref={ref} />;\n});\n\nexport interface AccordionItemPanelProps extends UnsafeStyles, DOMProps, AriaLabelingProps {\n /** The contents of the accordion item panel. */\n children: React.ReactNode,\n /**\n * The accessibility role for the accordion item panel.\n * @default 'group'\n */\n role?: 'group' | 'region'\n}\n\n/**\n * An accordion item panel is a collapsible section of content that is hidden until the accordion item is expanded.\n */\nexport const AccordionItemPanel = forwardRef(function AccordionItemPanel(props: AccordionItemPanelProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosurePanel {...props} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Accordion.css.map"}
|
package/dist/Accordion.mjs
CHANGED
|
@@ -24,9 +24,9 @@ import {useDOMRef as $cFlas$useDOMRef} from "@react-spectrum/utils";
|
|
|
24
24
|
|
|
25
25
|
const $e0a5d45f488fa6ba$var$accordion = function anonymous(props, overrides) {
|
|
26
26
|
let rules = " ";
|
|
27
|
-
rules += ((overrides || '').match(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L|F|M|K)[^\s]+/g) || []).join('');
|
|
28
|
-
rules += '
|
|
29
|
-
rules += '
|
|
27
|
+
rules += (String(overrides || '').match(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L|F|M|K)[^\s]+/g) || []).join('');
|
|
28
|
+
rules += ' sd11';
|
|
29
|
+
rules += ' _ta11';
|
|
30
30
|
return rules;
|
|
31
31
|
};
|
|
32
32
|
const $e0a5d45f488fa6ba$export$6bd5bb82c987ab74 = /*#__PURE__*/ (0, $cFlas$createContext)(null);
|
package/dist/Accordion.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA8CD,MAAM;;;;;;;AAKC,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAsE;AAK3G,MAAM,0DAAY,CAAA,GAAA,iBAAS,EAAE,SAAS,UAAU,KAAqB,EAAE,GAA2B;IACvG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,gBACF,YAAY,oBACZ,mBAAmB,UACnB,OAAO,cACP,UAAU,oBACV,OAAO,EACR,GAAG;IACJ,qBACE,gBAAC,CAAA,GAAA,yCAAgB,EAAE,QAAQ;QAAC,OAAO;kBAAC;qBAAM;qBAAS;QAAO;kBACxD,cAAA,gBAAC,CAAA,GAAA,sBAAc;YACZ,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,gCAAU,MAAM,MAAM,MAAM;sBACjE,MAAM,QAAQ;;;AAIvB;AAmEO,MAAM,0DAAgB,CAAA,GAAA,iBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA2B;IACnH,qBAAO,gBAAC,CAAA,GAAA,yCAAS;QAAG,GAAG,KAAK;QAAE,KAAK;;AACrC;AAeO,MAAM,0DAAqB,CAAA,GAAA,iBAAS,EAAE,SAAS,mBAAmB,KAA8B,EAAE,GAA2B;IAClI,qBAAO,gBAAC,CAAA,GAAA,yCAAc;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC1C;AAUO,MAAM,0DAAsB,CAAA,GAAA,iBAAS,EAAE,SAAS,oBAAoB,KAA+B,EAAE,GAA2B;IACrI,qBAAO,gBAAC,CAAA,GAAA,yCAAe;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC3C;AAeO,MAAM,0DAAqB,CAAA,GAAA,iBAAS,EAAE,SAAS,mBAAmB,KAA8B,EAAE,GAA2B;IAClI,qBAAO,gBAAC,CAAA,GAAA,yCAAc;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC1C","sources":["packages/@react-spectrum/s2/src/Accordion.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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {ContextValue, DisclosureGroup, RenderProps, SlotProps} from 'react-aria-components';\nimport {\n Disclosure,\n DisclosureContext,\n DisclosureHeader,\n DisclosurePanel,\n DisclosureTitle\n} from './Disclosure';\nimport {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends UnsafeStyles, DOMProps, SlotProps {\n /** The accordion item elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion items.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** Whether multiple accordion items can be expanded at the same time. */\n allowsMultipleExpanded?: boolean,\n /** Whether all accordion items are disabled. */\n isDisabled?: boolean,\n /** The currently expanded keys in the accordion (controlled). */\n expandedKeys?: Iterable<Key>,\n /** The initial expanded keys in the accordion (uncontrolled). */\n defaultExpandedKeys?: Iterable<Key>,\n /** Handler that is called when accordion items are expanded or collapsed. */\n onExpandedChange?: (keys: Set<Key>) => any\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<Partial<AccordionProps>, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * An accordion is a container for multiple accordion items.\n */\nexport const Accordion = forwardRef(function Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n});\n\nexport interface AccordionItemState {\n /** Whether the accordion item is currently expanded. */\n readonly isExpanded: boolean,\n /** Sets whether the accordion item is expanded. */\n setExpanded(isExpanded: boolean): void,\n /** Expand the accordion item. */\n expand(): void,\n /** Collapse the accordion item. */\n collapse(): void,\n /** Toggles the accordion item's visibility. */\n toggle(): void\n}\n\nexport interface AccordionItemRenderProps {\n /**\n * Whether the accordion item is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the accordion item has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the accordion item is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the accordion item.\n */\n state: AccordionItemState\n}\n\nexport interface AccordionItemProps extends Omit<RenderProps<AccordionItemRenderProps>, 'className' | 'style'>, SlotProps, StyleProps {\n /**\n * The size of the accordion item.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion item.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion item should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the accordion item, consisting of a accordion item title and accordion item panel. */\n children: ReactNode,\n /** An id for the accordion item, matching the id used in `expandedKeys`. */\n id?: Key,\n /** Whether the accordion item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the accordion item's expanded state changes. */\n onExpandedChange?: (isExpanded: boolean) => void,\n /** Whether the accordion item is expanded (controlled). */\n isExpanded?: boolean,\n /** Whether the accordion item is expanded by default (uncontrolled). */\n defaultExpanded?: boolean\n}\n\n/**\n * A accordion item is a collapsible section of content. It is composed of a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const AccordionItem = forwardRef(function AccordionItem(props: AccordionItemProps, ref: DOMRef<HTMLDivElement>) {\n return <Disclosure {...props} ref={ref} />;\n});\n\nexport interface AccordionItemTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the accordion item title.\n *\n * @default 3\n */\n level?: number,\n /** The contents of the accordion item title. */\n children: React.ReactNode\n}\n\n/**\n * An accordion item title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const AccordionItemTitle = forwardRef(function AccordionItemTitle(props: AccordionItemTitleProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureTitle {...props} ref={ref} />;\n});\n\nexport interface AccordionItemHeaderProps extends UnsafeStyles, DOMProps {\n /** The contents of the accordion item header. */\n children: React.ReactNode\n}\n\n/**\n * A wrapper element for the accordion item title that can contain other elements not part of the trigger.\n */\nexport const AccordionItemHeader = forwardRef(function AccordionItemHeader(props: AccordionItemHeaderProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureHeader {...props} ref={ref} />;\n});\n\nexport interface AccordionItemPanelProps extends UnsafeStyles, DOMProps, AriaLabelingProps {\n /** The contents of the accordion item panel. */\n children: React.ReactNode,\n /**\n * The accessibility role for the accordion item panel.\n * @default 'group'\n */\n role?: 'group' | 'region'\n}\n\n/**\n * An accordion item panel is a collapsible section of content that is hidden until the accordion item is expanded.\n */\nexport const AccordionItemPanel = forwardRef(function AccordionItemPanel(props: AccordionItemPanelProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosurePanel {...props} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Accordion.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA8CD,MAAM;;;;;;;AAKC,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAsE;AAK3G,MAAM,0DAAY,CAAA,GAAA,iBAAS,EAAE,SAAS,UAAU,KAAqB,EAAE,GAA2B;IACvG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,gBACF,YAAY,oBACZ,mBAAmB,UACnB,OAAO,cACP,UAAU,oBACV,OAAO,EACR,GAAG;IACJ,qBACE,gBAAC,CAAA,GAAA,yCAAgB,EAAE,QAAQ;QAAC,OAAO;kBAAC;qBAAM;qBAAS;QAAO;kBACxD,cAAA,gBAAC,CAAA,GAAA,sBAAc;YACZ,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,gCAAU,MAAM,MAAM,MAAM;sBACjE,MAAM,QAAQ;;;AAIvB;AAmEO,MAAM,0DAAgB,CAAA,GAAA,iBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA2B;IACnH,qBAAO,gBAAC,CAAA,GAAA,yCAAS;QAAG,GAAG,KAAK;QAAE,KAAK;;AACrC;AAeO,MAAM,0DAAqB,CAAA,GAAA,iBAAS,EAAE,SAAS,mBAAmB,KAA8B,EAAE,GAA2B;IAClI,qBAAO,gBAAC,CAAA,GAAA,yCAAc;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC1C;AAUO,MAAM,0DAAsB,CAAA,GAAA,iBAAS,EAAE,SAAS,oBAAoB,KAA+B,EAAE,GAA2B;IACrI,qBAAO,gBAAC,CAAA,GAAA,yCAAe;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC3C;AAeO,MAAM,0DAAqB,CAAA,GAAA,iBAAS,EAAE,SAAS,mBAAmB,KAA8B,EAAE,GAA2B;IAClI,qBAAO,gBAAC,CAAA,GAAA,yCAAc;QAAG,GAAG,KAAK;QAAE,KAAK;;AAC1C","sources":["packages/@react-spectrum/s2/src/Accordion.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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {ContextValue, DisclosureGroup, RenderProps, SlotProps} from 'react-aria-components';\nimport {\n Disclosure,\n DisclosureContext,\n DisclosureHeader,\n DisclosurePanel,\n DisclosureTitle\n} from './Disclosure';\nimport {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends UnsafeStyles, DOMProps, SlotProps {\n /** The accordion item elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion items.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** Whether multiple accordion items can be expanded at the same time. */\n allowsMultipleExpanded?: boolean,\n /** Whether all accordion items are disabled. */\n isDisabled?: boolean,\n /** The currently expanded keys in the accordion (controlled). */\n expandedKeys?: Iterable<Key>,\n /** The initial expanded keys in the accordion (uncontrolled). */\n defaultExpandedKeys?: Iterable<Key>,\n /** Handler that is called when accordion items are expanded or collapsed. */\n onExpandedChange?: (keys: Set<Key>) => any\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<Partial<AccordionProps>, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * An accordion is a container for multiple accordion items.\n */\nexport const Accordion = forwardRef(function Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n});\n\nexport interface AccordionItemState {\n /** Whether the accordion item is currently expanded. */\n readonly isExpanded: boolean,\n /** Sets whether the accordion item is expanded. */\n setExpanded(isExpanded: boolean): void,\n /** Expand the accordion item. */\n expand(): void,\n /** Collapse the accordion item. */\n collapse(): void,\n /** Toggles the accordion item's visibility. */\n toggle(): void\n}\n\nexport interface AccordionItemRenderProps {\n /**\n * Whether the accordion item is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the accordion item has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the accordion item is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the accordion item.\n */\n state: AccordionItemState\n}\n\nexport interface AccordionItemProps extends Omit<RenderProps<AccordionItemRenderProps>, 'className' | 'style' | 'render'>, SlotProps, StyleProps {\n /**\n * The size of the accordion item.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the accordion item.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion item should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the accordion item, consisting of a accordion item title and accordion item panel. */\n children: ReactNode,\n /** An id for the accordion item, matching the id used in `expandedKeys`. */\n id?: Key,\n /** Whether the accordion item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the accordion item's expanded state changes. */\n onExpandedChange?: (isExpanded: boolean) => void,\n /** Whether the accordion item is expanded (controlled). */\n isExpanded?: boolean,\n /** Whether the accordion item is expanded by default (uncontrolled). */\n defaultExpanded?: boolean\n}\n\n/**\n * A accordion item is a collapsible section of content. It is composed of a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const AccordionItem = forwardRef(function AccordionItem(props: AccordionItemProps, ref: DOMRef<HTMLDivElement>) {\n return <Disclosure {...props} ref={ref} />;\n});\n\nexport interface AccordionItemTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the accordion item title.\n *\n * @default 3\n */\n level?: number,\n /** The contents of the accordion item title. */\n children: React.ReactNode\n}\n\n/**\n * An accordion item title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nexport const AccordionItemTitle = forwardRef(function AccordionItemTitle(props: AccordionItemTitleProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureTitle {...props} ref={ref} />;\n});\n\nexport interface AccordionItemHeaderProps extends UnsafeStyles, DOMProps {\n /** The contents of the accordion item header. */\n children: React.ReactNode\n}\n\n/**\n * A wrapper element for the accordion item title that can contain other elements not part of the trigger.\n */\nexport const AccordionItemHeader = forwardRef(function AccordionItemHeader(props: AccordionItemHeaderProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosureHeader {...props} ref={ref} />;\n});\n\nexport interface AccordionItemPanelProps extends UnsafeStyles, DOMProps, AriaLabelingProps {\n /** The contents of the accordion item panel. */\n children: React.ReactNode,\n /**\n * The accessibility role for the accordion item panel.\n * @default 'group'\n */\n role?: 'group' | 'region'\n}\n\n/**\n * An accordion item panel is a collapsible section of content that is hidden until the accordion item is expanded.\n */\nexport const AccordionItemPanel = forwardRef(function AccordionItemPanel(props: AccordionItemPanelProps, ref: DOMRef<HTMLDivElement>) {\n return <DisclosurePanel {...props} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Accordion.mjs.map"}
|
package/dist/ActionBar.cjs
CHANGED
|
@@ -48,49 +48,49 @@ $parcel$export(module.exports, "useActionBarContainer", () => $85bf454149fe9ddc$
|
|
|
48
48
|
|
|
49
49
|
const $85bf454149fe9ddc$var$actionBarStyles = function anonymous(props) {
|
|
50
50
|
let rules = " ";
|
|
51
|
-
rules += '
|
|
52
|
-
rules += '
|
|
53
|
-
rules += '
|
|
54
|
-
rules += '
|
|
55
|
-
if (props.isEmphasized) rules += ' -Ovbhqd-
|
|
56
|
-
else rules += ' -Ovbhqd-
|
|
57
|
-
rules += '
|
|
58
|
-
rules += '
|
|
59
|
-
rules += '
|
|
60
|
-
rules += '
|
|
61
|
-
rules += '
|
|
62
|
-
if (props.isEmphasized) rules += '
|
|
63
|
-
else rules += '
|
|
64
|
-
rules += '
|
|
65
|
-
rules += '
|
|
66
|
-
rules += '
|
|
67
|
-
rules += '
|
|
68
|
-
rules += '
|
|
69
|
-
rules += '
|
|
70
|
-
rules += '
|
|
71
|
-
rules += '
|
|
72
|
-
rules += '
|
|
73
|
-
if (props.isInContainer) rules += '
|
|
74
|
-
rules += '
|
|
75
|
-
rules += '
|
|
76
|
-
rules += ' -F3Iohc-
|
|
77
|
-
if (props.isInContainer) rules += '
|
|
78
|
-
else rules += '
|
|
79
|
-
rules += '
|
|
80
|
-
rules += '
|
|
81
|
-
rules += '
|
|
82
|
-
rules += '
|
|
83
|
-
rules += '
|
|
84
|
-
rules += '
|
|
51
|
+
rules += ' oc11';
|
|
52
|
+
rules += ' nc11';
|
|
53
|
+
rules += ' kc11';
|
|
54
|
+
rules += ' jc11';
|
|
55
|
+
if (props.isEmphasized) rules += ' -Ovbhqd-g011';
|
|
56
|
+
else rules += ' -Ovbhqd-g_g11';
|
|
57
|
+
rules += ' gEzkoQe11';
|
|
58
|
+
rules += ' _nLeasBb11';
|
|
59
|
+
rules += ' _oa11';
|
|
60
|
+
rules += ' _Lf11';
|
|
61
|
+
rules += ' _Mb11';
|
|
62
|
+
if (props.isEmphasized) rules += ' Oj11';
|
|
63
|
+
else rules += ' Oye39g11';
|
|
64
|
+
rules += ' Ola11';
|
|
65
|
+
rules += ' St11';
|
|
66
|
+
rules += ' Rt11';
|
|
67
|
+
rules += ' Te11';
|
|
68
|
+
rules += ' Qe11';
|
|
69
|
+
rules += ' sd11';
|
|
70
|
+
rules += ' Ul11';
|
|
71
|
+
rules += ' ql11';
|
|
72
|
+
rules += ' eb11';
|
|
73
|
+
if (props.isInContainer) rules += ' _Pa11';
|
|
74
|
+
rules += ' _lr11';
|
|
75
|
+
rules += ' _AI11';
|
|
76
|
+
rules += ' -F3Iohc-_zI11';
|
|
77
|
+
if (props.isInContainer) rules += ' Zd11';
|
|
78
|
+
else rules += ' Za11';
|
|
79
|
+
rules += ' IM11';
|
|
80
|
+
rules += ' HM11';
|
|
81
|
+
rules += ' Ll11';
|
|
82
|
+
rules += ' Yg11';
|
|
83
|
+
rules += ' Xc11';
|
|
84
|
+
rules += ' _2b11';
|
|
85
85
|
if (props.isExiting) {
|
|
86
|
-
rules += ' -_8PloMd-
|
|
87
|
-
rules += '
|
|
86
|
+
rules += ' -_8PloMd-t11';
|
|
87
|
+
rules += ' __Ya11';
|
|
88
88
|
} else if (props.isEntering) {
|
|
89
|
-
rules += ' -_8PloMd-
|
|
90
|
-
rules += '
|
|
89
|
+
rules += ' -_8PloMd-t11';
|
|
90
|
+
rules += ' __Ya11';
|
|
91
91
|
} else {
|
|
92
|
-
rules += ' -_8PloMd-
|
|
93
|
-
rules += '
|
|
92
|
+
rules += ' -_8PloMd-q11';
|
|
93
|
+
rules += ' __Ya11';
|
|
94
94
|
}
|
|
95
95
|
return rules;
|
|
96
96
|
};
|
|
@@ -156,18 +156,19 @@ const $85bf454149fe9ddc$var$ActionBarInner = /*#__PURE__*/ (0, $cRsNx$react.forw
|
|
|
156
156
|
ref: objectRef,
|
|
157
157
|
...otherProps,
|
|
158
158
|
...keyboardProps,
|
|
159
|
-
className: $85bf454149fe9ddc$var$actionBarStyles({
|
|
159
|
+
className: (props1.UNSAFE_className || '') + $85bf454149fe9ddc$var$actionBarStyles({
|
|
160
160
|
isEmphasized: isEmphasized,
|
|
161
161
|
isInContainer: !!scrollRef,
|
|
162
162
|
isEntering: isEntering,
|
|
163
163
|
isExiting: isExiting
|
|
164
164
|
}),
|
|
165
165
|
style: {
|
|
166
|
-
insetInlineEnd: `calc(var(--insetEnd) + ${scrollbarWidth}px)
|
|
166
|
+
insetInlineEnd: `calc(var(--insetEnd) + ${scrollbarWidth}px)`,
|
|
167
|
+
...props1.UNSAFE_style
|
|
167
168
|
},
|
|
168
169
|
children: [
|
|
169
170
|
/*#__PURE__*/ (0, $cRsNx$reactjsxruntime.jsx)("div", {
|
|
170
|
-
className: "
|
|
171
|
+
className: " _Jb11 IM11",
|
|
171
172
|
children: /*#__PURE__*/ (0, $cRsNx$reactjsxruntime.jsx)((0, $7a26131f6144af2b$exports.ActionButtonGroup), {
|
|
172
173
|
staticColor: isEmphasized ? 'auto' : undefined,
|
|
173
174
|
isQuiet: true,
|
|
@@ -176,7 +177,7 @@ const $85bf454149fe9ddc$var$ActionBarInner = /*#__PURE__*/ (0, $cRsNx$react.forw
|
|
|
176
177
|
})
|
|
177
178
|
}),
|
|
178
179
|
/*#__PURE__*/ (0, $cRsNx$reactjsxruntime.jsxs)("div", {
|
|
179
|
-
className: "
|
|
180
|
+
className: " _Ja11 sd11 eb11 Ub11 qb11",
|
|
180
181
|
children: [
|
|
181
182
|
/*#__PURE__*/ (0, $cRsNx$reactjsxruntime.jsx)((0, $2f907cb84c6e9e75$exports.CloseButton), {
|
|
182
183
|
staticColor: isEmphasized ? 'auto' : undefined,
|
|
@@ -186,23 +187,23 @@ const $85bf454149fe9ddc$var$ActionBarInner = /*#__PURE__*/ (0, $cRsNx$react.forw
|
|
|
186
187
|
/*#__PURE__*/ (0, $cRsNx$reactjsxruntime.jsx)("span", {
|
|
187
188
|
className: function anonymous(props) {
|
|
188
189
|
let rules = " ";
|
|
189
|
-
rules += '
|
|
190
|
-
rules += '
|
|
191
|
-
rules += '
|
|
192
|
-
rules += '
|
|
193
|
-
rules += '
|
|
194
|
-
rules += '
|
|
195
|
-
rules += '
|
|
196
|
-
rules += '
|
|
197
|
-
rules += '
|
|
198
|
-
rules += ' -_6BNtrc-
|
|
199
|
-
rules += '
|
|
200
|
-
rules += '
|
|
201
|
-
rules += '
|
|
202
|
-
rules += '
|
|
203
|
-
rules += '
|
|
204
|
-
if (props.isEmphasized) rules += '
|
|
205
|
-
else rules += '
|
|
190
|
+
rules += ' uk11';
|
|
191
|
+
rules += ' ucJ9TBTb11';
|
|
192
|
+
rules += ' ud3Euai11';
|
|
193
|
+
rules += ' uea11';
|
|
194
|
+
rules += ' ugb11';
|
|
195
|
+
rules += ' uhd11';
|
|
196
|
+
rules += ' uje11';
|
|
197
|
+
rules += ' u2NhKxcl11';
|
|
198
|
+
rules += ' uic11';
|
|
199
|
+
rules += ' -_6BNtrc-c11';
|
|
200
|
+
rules += ' vx11';
|
|
201
|
+
rules += ' xb11';
|
|
202
|
+
rules += ' _xa11';
|
|
203
|
+
rules += ' _Fd11';
|
|
204
|
+
rules += ' _FnuYUweb11';
|
|
205
|
+
if (props.isEmphasized) rules += ' pr11';
|
|
206
|
+
else rules += ' pt11';
|
|
206
207
|
return rules;
|
|
207
208
|
}({
|
|
208
209
|
isEmphasized: isEmphasized
|
package/dist/ActionBar.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"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","sources":["packages/@react-spectrum/s2/src/ActionBar.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 {ActionButtonGroup} from './ActionButtonGroup';\nimport {announce} from '@react-aria/live-announcer';\nimport {CloseButton} from './CloseButton';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, ForwardedRef, forwardRef, ReactElement, ReactNode, RefObject, useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {FocusScope, useKeyboard} from 'react-aria';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {lightDark, style} from '../style' with {type: 'macro'};\nimport {StyleProps} from './style-utils' with { type: 'macro' };\nimport {useControlledState} from '@react-stately/utils';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEnterAnimation, useExitAnimation, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nconst actionBarStyles = style({\n borderRadius: 'lg',\n '--s2-container-bg': {\n type: 'backgroundColor',\n value: {\n default: 'elevated',\n isEmphasized: 'neutral'\n }\n },\n backgroundColor: '--s2-container-bg',\n boxShadow: 'elevated',\n boxSizing: 'border-box',\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineColor: {\n default: lightDark('transparent-white-25', 'gray-200'),\n isEmphasized: 'transparent',\n forcedColors: 'ButtonBorder'\n },\n paddingX: 8,\n paddingY: 12,\n display: 'flex',\n gap: 16,\n alignItems: 'center',\n position: {\n isInContainer: 'absolute'\n },\n bottom: 0,\n insetStart: 8,\n '--insetEnd': {\n type: 'insetEnd',\n value: 8\n },\n width: {\n default: 'full',\n isInContainer: 'auto'\n },\n marginX: 'auto',\n maxWidth: 960,\n transition: 'transform',\n transitionDuration: 200,\n translateY: {\n default: -8,\n isEntering: 'full',\n isExiting: 'full'\n }\n});\n\nexport interface ActionBarProps extends SlotProps, StyleProps, DOMProps {\n /** A list of ActionButtons to display. */\n children: ReactNode,\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean,\n /** The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is hidden. */\n selectedItemCount?: number | 'all',\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection?: () => void,\n /** A ref to the scrollable element the ActionBar appears above. */\n scrollRef?: RefObject<HTMLElement | null>\n}\n\nexport const ActionBarContext = createContext<ContextValue<Partial<ActionBarProps>, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions on one or more items at the same time.\n */\nexport const ActionBar = forwardRef(function ActionBar(props: ActionBarProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionBarContext);\n let domRef = useDOMRef(ref);\n\n let isOpen = props.selectedItemCount !== 0;\n let isExiting = useExitAnimation(domRef, isOpen && props.scrollRef != null);\n if (!isOpen && !isExiting) {\n return null;\n }\n\n return <ActionBarInner {...props} ref={domRef} isExiting={isExiting} />;\n});\n\nconst ActionBarInner = forwardRef(function ActionBarInner(props: ActionBarProps & {isExiting: boolean}, ref: ForwardedRef<HTMLDivElement | null>) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {isEmphasized, selectedItemCount = 0, children, onClearSelection, isExiting, slot, scrollRef, ...otherProps} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n\n // Store the last count greater than zero so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n // Measure the width of the collection's scrollbar and offset the action bar by that amount.\n let [scrollbarWidth, setScrollbarWidth] = useState(0);\n let updateScrollbarWidth = useCallback(() => {\n let el = scrollRef?.current;\n if (el) {\n let w = el.offsetWidth - el.clientWidth;\n setScrollbarWidth(w);\n }\n }, [scrollRef]);\n\n useResizeObserver({\n ref: scrollRef,\n onResize: updateScrollbarWidth\n });\n\n let {keyboardProps} = useKeyboard({\n onKeyDown(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClearSelection?.();\n } else {\n e.continuePropagation();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current && scrollRef) {\n isInitial.current = false;\n announce(stringFormatter.format('actionbar.actionsAvailable'));\n }\n }, [stringFormatter, scrollRef]);\n\n let objectRef = useObjectRef(ref);\n let isEntering = useEnterAnimation(objectRef, !!scrollRef);\n\n return (\n <FocusScope restoreFocus>\n <div\n ref={objectRef}\n {...otherProps}\n {...keyboardProps}\n className={actionBarStyles({isEmphasized, isInContainer: !!scrollRef, isEntering, isExiting})}\n style={{insetInlineEnd: `calc(var(--insetEnd) + ${scrollbarWidth}px)`}}>\n <div className={style({order: 1, marginStart: 'auto'})}>\n <ActionButtonGroup\n staticColor={isEmphasized ? 'auto' : undefined}\n isQuiet\n aria-label={stringFormatter.format('actionbar.actions')}>\n {children}\n </ActionButtonGroup>\n </div>\n <div className={style({order: 0, display: 'flex', alignItems: 'center', gap: 4})}>\n <CloseButton\n staticColor={isEmphasized ? 'auto' : undefined}\n aria-label={stringFormatter.format('actionbar.clearSelection')}\n onPress={() => onClearSelection?.()} />\n <span className={style({font: 'ui', color: {default: 'neutral', isEmphasized: 'gray-25'}})({isEmphasized})}>\n {lastCount === 'all'\n ? stringFormatter.format('actionbar.selectedAll')\n : stringFormatter.format('actionbar.selected', {count: lastCount})}\n </span>\n </div>\n </div>\n </FocusScope>\n );\n});\n\ninterface ActionBarContainerHookProps {\n selectedKeys?: 'all' | Iterable<Key>,\n defaultSelectedKeys?: 'all' | Iterable<Key>,\n onSelectionChange?: (keys: Set<Key>) => void,\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement,\n scrollRef?: RefObject<HTMLElement | null>\n}\n\ninterface ActionBarContainerHookResult {\n selectedKeys: 'all' | Iterable<Key>,\n onSelectionChange: (keys: 'all' | Iterable<Key>) => void,\n actionBar: ReactElement,\n actionBarHeight: number\n}\n\nexport function useActionBarContainer(props: ActionBarContainerHookProps): ActionBarContainerHookResult {\n let {renderActionBar, scrollRef} = props;\n let [selectedKeys, setSelectedKeys] = useControlledState(props.selectedKeys, props.defaultSelectedKeys || new Set(), props.onSelectionChange);\n let selectedKeysSet = useMemo(() => selectedKeys === 'all' ? selectedKeys as 'all' : new Set(selectedKeys), [selectedKeys]);\n let actionBar = useMemo(() => renderActionBar?.(selectedKeysSet), [renderActionBar, selectedKeysSet]);\n let selectedItemCount = selectedKeysSet === 'all' ? 'all' as const : selectedKeysSet.size;\n let [actionBarHeight, setActionBarHeight] = useState(0);\n let actionBarRef = useCallback((ref: DOMRefValue | null) => {\n let actionBar = ref?.UNSAFE_getDOMNode();\n if (actionBar) {\n setActionBarHeight(actionBar.offsetHeight + 8);\n } else {\n setActionBarHeight(0);\n }\n }, []);\n\n let actionBarContext = useMemo(() => ({\n ref: actionBarRef,\n scrollRef,\n selectedItemCount,\n onClearSelection: () => setSelectedKeys(new Set())\n }), [scrollRef, actionBarRef, selectedItemCount, setSelectedKeys]);\n\n let wrappedActionBar = useMemo(() => (\n <ActionBarContext.Provider value={actionBarContext}>\n {actionBar}\n </ActionBarContext.Provider>\n ), [actionBarContext, actionBar]);\n\n return {\n selectedKeys,\n onSelectionChange: setSelectedKeys,\n actionBar: wrappedActionBar,\n actionBarHeight\n };\n}\n"],"names":[],"version":3,"file":"ActionBar.cjs.map"}
|
|
1
|
+
{"mappings":"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","sources":["packages/@react-spectrum/s2/src/ActionBar.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 {ActionButtonGroup} from './ActionButtonGroup';\nimport {announce} from '@react-aria/live-announcer';\nimport {CloseButton} from './CloseButton';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, ForwardedRef, forwardRef, ReactElement, ReactNode, RefObject, useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {FocusScope, useKeyboard} from 'react-aria';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {lightDark, style} from '../style' with {type: 'macro'};\nimport {StyleProps} from './style-utils' with { type: 'macro' };\nimport {useControlledState} from '@react-stately/utils';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEnterAnimation, useExitAnimation, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nconst actionBarStyles = style({\n borderRadius: 'lg',\n '--s2-container-bg': {\n type: 'backgroundColor',\n value: {\n default: 'elevated',\n isEmphasized: 'neutral'\n }\n },\n backgroundColor: '--s2-container-bg',\n boxShadow: 'elevated',\n boxSizing: 'border-box',\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineColor: {\n default: lightDark('transparent-white-25', 'gray-200'),\n isEmphasized: 'transparent',\n forcedColors: 'ButtonBorder'\n },\n paddingX: 8,\n paddingY: 12,\n display: 'flex',\n gap: 16,\n alignItems: 'center',\n position: {\n isInContainer: 'absolute'\n },\n bottom: 0,\n insetStart: 8,\n '--insetEnd': {\n type: 'insetEnd',\n value: 8\n },\n width: {\n default: 'full',\n isInContainer: 'auto'\n },\n marginX: 'auto',\n maxWidth: 960,\n transition: 'transform',\n transitionDuration: 200,\n translateY: {\n default: -8,\n isEntering: 'full',\n isExiting: 'full'\n }\n});\n\nexport interface ActionBarProps extends SlotProps, StyleProps, DOMProps {\n /** A list of ActionButtons to display. */\n children: ReactNode,\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean,\n /** The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is hidden. */\n selectedItemCount?: number | 'all',\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection?: () => void,\n /** A ref to the scrollable element the ActionBar appears above. */\n scrollRef?: RefObject<HTMLElement | null>\n}\n\nexport const ActionBarContext = createContext<ContextValue<Partial<ActionBarProps>, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions on one or more items at the same time.\n */\nexport const ActionBar = forwardRef(function ActionBar(props: ActionBarProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionBarContext);\n let domRef = useDOMRef(ref);\n\n let isOpen = props.selectedItemCount !== 0;\n let isExiting = useExitAnimation(domRef, isOpen && props.scrollRef != null);\n if (!isOpen && !isExiting) {\n return null;\n }\n\n return <ActionBarInner {...props} ref={domRef} isExiting={isExiting} />;\n});\n\nconst ActionBarInner = forwardRef(function ActionBarInner(props: ActionBarProps & {isExiting: boolean}, ref: ForwardedRef<HTMLDivElement | null>) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {isEmphasized, selectedItemCount = 0, children, onClearSelection, isExiting, slot, scrollRef, ...otherProps} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n\n // Store the last count greater than zero so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n // Measure the width of the collection's scrollbar and offset the action bar by that amount.\n let [scrollbarWidth, setScrollbarWidth] = useState(0);\n let updateScrollbarWidth = useCallback(() => {\n let el = scrollRef?.current;\n if (el) {\n let w = el.offsetWidth - el.clientWidth;\n setScrollbarWidth(w);\n }\n }, [scrollRef]);\n\n useResizeObserver({\n ref: scrollRef,\n onResize: updateScrollbarWidth\n });\n\n let {keyboardProps} = useKeyboard({\n onKeyDown(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClearSelection?.();\n } else {\n e.continuePropagation();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current && scrollRef) {\n isInitial.current = false;\n announce(stringFormatter.format('actionbar.actionsAvailable'));\n }\n }, [stringFormatter, scrollRef]);\n\n let objectRef = useObjectRef(ref);\n let isEntering = useEnterAnimation(objectRef, !!scrollRef);\n\n return (\n <FocusScope restoreFocus>\n <div\n ref={objectRef}\n {...otherProps}\n {...keyboardProps}\n className={(props.UNSAFE_className || '') + actionBarStyles({isEmphasized, isInContainer: !!scrollRef, isEntering, isExiting})}\n style={{insetInlineEnd: `calc(var(--insetEnd) + ${scrollbarWidth}px)`, ...props.UNSAFE_style}}>\n <div className={style({order: 1, marginStart: 'auto'})}>\n <ActionButtonGroup\n staticColor={isEmphasized ? 'auto' : undefined}\n isQuiet\n aria-label={stringFormatter.format('actionbar.actions')}>\n {children}\n </ActionButtonGroup>\n </div>\n <div className={style({order: 0, display: 'flex', alignItems: 'center', gap: 4})}>\n <CloseButton\n staticColor={isEmphasized ? 'auto' : undefined}\n aria-label={stringFormatter.format('actionbar.clearSelection')}\n onPress={() => onClearSelection?.()} />\n <span className={style({font: 'ui', color: {default: 'neutral', isEmphasized: 'gray-25'}})({isEmphasized})}>\n {lastCount === 'all'\n ? stringFormatter.format('actionbar.selectedAll')\n : stringFormatter.format('actionbar.selected', {count: lastCount})}\n </span>\n </div>\n </div>\n </FocusScope>\n );\n});\n\ninterface ActionBarContainerHookProps {\n selectedKeys?: 'all' | Iterable<Key>,\n defaultSelectedKeys?: 'all' | Iterable<Key>,\n onSelectionChange?: (keys: Set<Key>) => void,\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement,\n scrollRef?: RefObject<HTMLElement | null>\n}\n\ninterface ActionBarContainerHookResult {\n selectedKeys: 'all' | Iterable<Key>,\n onSelectionChange: (keys: 'all' | Iterable<Key>) => void,\n actionBar: ReactElement,\n actionBarHeight: number\n}\n\nexport function useActionBarContainer(props: ActionBarContainerHookProps): ActionBarContainerHookResult {\n let {renderActionBar, scrollRef} = props;\n let [selectedKeys, setSelectedKeys] = useControlledState(props.selectedKeys, props.defaultSelectedKeys || new Set(), props.onSelectionChange);\n let selectedKeysSet = useMemo(() => selectedKeys === 'all' ? selectedKeys as 'all' : new Set(selectedKeys), [selectedKeys]);\n let actionBar = useMemo(() => renderActionBar?.(selectedKeysSet), [renderActionBar, selectedKeysSet]);\n let selectedItemCount = selectedKeysSet === 'all' ? 'all' as const : selectedKeysSet.size;\n let [actionBarHeight, setActionBarHeight] = useState(0);\n let actionBarRef = useCallback((ref: DOMRefValue | null) => {\n let actionBar = ref?.UNSAFE_getDOMNode();\n if (actionBar) {\n setActionBarHeight(actionBar.offsetHeight + 8);\n } else {\n setActionBarHeight(0);\n }\n }, []);\n\n let actionBarContext = useMemo(() => ({\n ref: actionBarRef,\n scrollRef,\n selectedItemCount,\n onClearSelection: () => setSelectedKeys(new Set())\n }), [scrollRef, actionBarRef, selectedItemCount, setSelectedKeys]);\n\n let wrappedActionBar = useMemo(() => (\n <ActionBarContext.Provider value={actionBarContext}>\n {actionBar}\n </ActionBarContext.Provider>\n ), [actionBarContext, actionBar]);\n\n return {\n selectedKeys,\n onSelectionChange: setSelectedKeys,\n actionBar: wrappedActionBar,\n actionBarHeight\n };\n}\n"],"names":[],"version":3,"file":"ActionBar.cjs.map"}
|