@react-spectrum/s2 0.11.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.cjs +3 -3
- package/dist/Accordion.css +2 -2
- package/dist/Accordion.mjs +3 -3
- package/dist/ActionBar.cjs +61 -62
- package/dist/ActionBar.cjs.map +1 -1
- package/dist/ActionBar.css +62 -66
- package/dist/ActionBar.css.map +1 -1
- package/dist/ActionBar.mjs +61 -62
- package/dist/ActionBar.mjs.map +1 -1
- package/dist/ActionButton.cjs +356 -250
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +208 -144
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +357 -251
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/ActionButtonGroup.cjs +16 -16
- package/dist/ActionButtonGroup.css +9 -9
- package/dist/ActionButtonGroup.mjs +16 -16
- package/dist/Add.cjs +10 -10
- package/dist/Add.css +6 -6
- package/dist/Add.mjs +10 -10
- package/dist/AlertDialog.cjs +3 -3
- package/dist/AlertDialog.css +3 -3
- package/dist/AlertDialog.mjs +3 -3
- package/dist/Asterisk.cjs +6 -6
- package/dist/Asterisk.css +4 -4
- package/dist/Asterisk.mjs +6 -6
- package/dist/Avatar.cjs +20 -16
- package/dist/Avatar.cjs.map +1 -1
- package/dist/Avatar.css +22 -14
- package/dist/Avatar.css.map +1 -1
- package/dist/Avatar.mjs +20 -16
- package/dist/Avatar.mjs.map +1 -1
- package/dist/AvatarGroup.cjs +135 -135
- package/dist/AvatarGroup.css +33 -33
- package/dist/AvatarGroup.mjs +135 -135
- package/dist/Badge.cjs +207 -207
- package/dist/Badge.css +127 -127
- package/dist/Badge.mjs +207 -207
- package/dist/Breadcrumbs.cjs +255 -255
- package/dist/Breadcrumbs.css +109 -109
- package/dist/Breadcrumbs.mjs +255 -255
- package/dist/Button.cjs +356 -354
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +179 -179
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +357 -356
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs +21 -21
- package/dist/ButtonGroup.css +15 -15
- package/dist/ButtonGroup.mjs +21 -21
- package/dist/Calendar.cjs +127 -127
- package/dist/Calendar.cjs.map +1 -1
- package/dist/Calendar.css +134 -134
- package/dist/Calendar.css.map +1 -1
- package/dist/Calendar.mjs +127 -127
- package/dist/Calendar.mjs.map +1 -1
- package/dist/Card.cjs +335 -311
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css +213 -213
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +335 -311
- package/dist/Card.mjs.map +1 -1
- package/dist/CardView.cjs +25 -19
- package/dist/CardView.cjs.map +1 -1
- package/dist/CardView.css +16 -16
- package/dist/CardView.css.map +1 -1
- package/dist/CardView.mjs +26 -20
- package/dist/CardView.mjs.map +1 -1
- package/dist/CenterBaseline.cjs +1 -1
- package/dist/CenterBaseline.css +2 -2
- package/dist/CenterBaseline.mjs +1 -1
- package/dist/Checkbox.cjs +171 -171
- package/dist/Checkbox.css +92 -92
- package/dist/Checkbox.mjs +171 -171
- package/dist/CheckboxGroup.cjs +46 -46
- package/dist/CheckboxGroup.css +38 -38
- package/dist/CheckboxGroup.mjs +46 -46
- package/dist/Checkmark.cjs +12 -12
- package/dist/Checkmark.css +8 -8
- package/dist/Checkmark.mjs +12 -12
- package/dist/Chevron.cjs +12 -12
- package/dist/Chevron.css +10 -10
- package/dist/Chevron.mjs +12 -12
- package/dist/ClearButton.cjs +29 -29
- package/dist/ClearButton.css +29 -29
- package/dist/ClearButton.mjs +29 -29
- package/dist/CloseButton.cjs +55 -55
- package/dist/CloseButton.css +46 -46
- package/dist/CloseButton.mjs +55 -55
- package/dist/ColorArea.cjs +25 -18
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css +16 -16
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs +26 -19
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs +33 -33
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css +28 -28
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs +33 -33
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorHandle.cjs +27 -27
- package/dist/ColorHandle.css +43 -43
- package/dist/ColorHandle.mjs +27 -27
- package/dist/ColorSlider.cjs +122 -121
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css +54 -54
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs +122 -121
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs +30 -30
- package/dist/ColorSwatch.css +29 -29
- package/dist/ColorSwatch.mjs +30 -30
- package/dist/ColorSwatchPicker.cjs +28 -28
- package/dist/ColorSwatchPicker.css +46 -46
- package/dist/ColorSwatchPicker.mjs +28 -28
- package/dist/ColorWheel.cjs +26 -26
- package/dist/ColorWheel.css +17 -17
- package/dist/ColorWheel.mjs +26 -26
- package/dist/ComboBox.cjs +474 -452
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +213 -185
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +475 -453
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +36 -33
- package/dist/ContextualHelp.cjs.map +1 -1
- package/dist/ContextualHelp.css +68 -60
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs +37 -34
- package/dist/ContextualHelp.mjs.map +1 -1
- package/dist/Cross.cjs +14 -14
- package/dist/Cross.css +10 -10
- package/dist/Cross.mjs +14 -14
- package/dist/CustomDialog.cjs +26 -26
- package/dist/CustomDialog.cjs.map +1 -1
- package/dist/CustomDialog.css +25 -25
- package/dist/CustomDialog.css.map +1 -1
- package/dist/CustomDialog.mjs +26 -26
- package/dist/CustomDialog.mjs.map +1 -1
- package/dist/Dash.cjs +10 -10
- package/dist/Dash.css +6 -6
- package/dist/Dash.mjs +10 -10
- package/dist/DateField.cjs +74 -74
- package/dist/DateField.cjs.map +1 -1
- package/dist/DateField.css +77 -77
- package/dist/DateField.css.map +1 -1
- package/dist/DateField.mjs +74 -74
- package/dist/DateField.mjs.map +1 -1
- package/dist/DatePicker.cjs +194 -191
- package/dist/DatePicker.cjs.map +1 -1
- package/dist/DatePicker.css +138 -126
- package/dist/DatePicker.css.map +1 -1
- package/dist/DatePicker.mjs +195 -192
- package/dist/DatePicker.mjs.map +1 -1
- package/dist/DateRangePicker.cjs +57 -57
- package/dist/DateRangePicker.cjs.map +1 -1
- package/dist/DateRangePicker.css +60 -60
- package/dist/DateRangePicker.css.map +1 -1
- package/dist/DateRangePicker.mjs +57 -57
- package/dist/DateRangePicker.mjs.map +1 -1
- package/dist/Dialog.cjs +17 -17
- package/dist/Dialog.cjs.map +1 -1
- package/dist/Dialog.css +88 -84
- package/dist/Dialog.css.map +1 -1
- package/dist/Dialog.mjs +17 -17
- package/dist/Dialog.mjs.map +1 -1
- package/dist/Disclosure.cjs +128 -147
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +144 -112
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +128 -147
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs +26 -26
- package/dist/Divider.css +25 -25
- package/dist/Divider.mjs +26 -26
- package/dist/DropZone.cjs +63 -63
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css +58 -58
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs +63 -63
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs +370 -370
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +146 -142
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs +370 -370
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +10 -10
- package/dist/Form.css +9 -9
- package/dist/Form.mjs +10 -10
- package/dist/FullscreenDialog.cjs +5 -5
- package/dist/FullscreenDialog.cjs.map +1 -1
- package/dist/FullscreenDialog.css +93 -93
- package/dist/FullscreenDialog.css.map +1 -1
- package/dist/FullscreenDialog.mjs +5 -5
- package/dist/FullscreenDialog.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs +257 -257
- package/dist/IllustratedMessage.css +78 -78
- package/dist/IllustratedMessage.mjs +257 -257
- package/dist/Image.cjs +25 -17
- package/dist/Image.cjs.map +1 -1
- package/dist/Image.css +14 -14
- package/dist/Image.css.map +1 -1
- package/dist/Image.mjs +25 -17
- package/dist/Image.mjs.map +1 -1
- package/dist/InlineAlert.cjs +138 -153
- package/dist/InlineAlert.cjs.map +1 -1
- package/dist/InlineAlert.css +82 -151
- package/dist/InlineAlert.css.map +1 -1
- package/dist/InlineAlert.mjs +138 -153
- package/dist/InlineAlert.mjs.map +1 -1
- package/dist/Link.cjs +55 -55
- package/dist/Link.css +46 -46
- package/dist/Link.mjs +55 -55
- package/dist/LinkOut.cjs +8 -8
- package/dist/LinkOut.css +8 -8
- package/dist/LinkOut.mjs +8 -8
- package/dist/Menu.cjs +529 -501
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +195 -191
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +529 -502
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +164 -164
- package/dist/Meter.css +93 -93
- package/dist/Meter.mjs +164 -164
- package/dist/Modal.cjs +90 -70
- package/dist/Modal.cjs.map +1 -1
- package/dist/Modal.css +76 -60
- package/dist/Modal.css.map +1 -1
- package/dist/Modal.mjs +90 -70
- package/dist/Modal.mjs.map +1 -1
- package/dist/NotificationBadge.cjs +59 -59
- package/dist/NotificationBadge.css +51 -51
- package/dist/NotificationBadge.mjs +59 -59
- package/dist/NumberField.cjs +116 -116
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css +100 -100
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs +116 -116
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +424 -349
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +200 -180
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +428 -353
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +120 -116
- package/dist/Popover.cjs.map +1 -1
- package/dist/Popover.css +86 -82
- package/dist/Popover.css.map +1 -1
- package/dist/Popover.mjs +121 -118
- package/dist/Popover.mjs.map +1 -1
- package/dist/ProgressBar.cjs +174 -174
- package/dist/ProgressBar.css +101 -101
- package/dist/ProgressBar.mjs +174 -174
- package/dist/ProgressCircle.cjs +32 -32
- package/dist/ProgressCircle.css +24 -24
- package/dist/ProgressCircle.mjs +32 -32
- package/dist/Provider.cjs +11 -11
- package/dist/Provider.cjs.map +1 -1
- package/dist/Provider.css +13 -13
- package/dist/Provider.css.map +1 -1
- package/dist/Provider.mjs +11 -11
- package/dist/Provider.mjs.map +1 -1
- package/dist/Radio.cjs +155 -155
- package/dist/Radio.css +79 -79
- package/dist/Radio.mjs +155 -155
- package/dist/RadioGroup.cjs +43 -43
- package/dist/RadioGroup.css +38 -38
- package/dist/RadioGroup.mjs +43 -43
- package/dist/RangeCalendar.cjs +8 -8
- package/dist/RangeCalendar.cjs.map +1 -1
- package/dist/RangeCalendar.css +10 -10
- package/dist/RangeCalendar.css.map +1 -1
- package/dist/RangeCalendar.mjs +8 -8
- package/dist/RangeCalendar.mjs.map +1 -1
- package/dist/RangeSlider.cjs.map +1 -1
- package/dist/RangeSlider.mjs.map +1 -1
- package/dist/SearchField.cjs +43 -43
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css +46 -46
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs +43 -43
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +193 -224
- package/dist/SegmentedControl.cjs.map +1 -1
- package/dist/SegmentedControl.css +146 -118
- package/dist/SegmentedControl.css.map +1 -1
- package/dist/SegmentedControl.mjs +196 -227
- package/dist/SegmentedControl.mjs.map +1 -1
- package/dist/SelectBoxGroup.cjs +161 -159
- package/dist/SelectBoxGroup.cjs.map +1 -1
- package/dist/SelectBoxGroup.css +123 -123
- package/dist/SelectBoxGroup.css.map +1 -1
- package/dist/SelectBoxGroup.mjs +161 -159
- package/dist/SelectBoxGroup.mjs.map +1 -1
- package/dist/Slider.cjs +300 -300
- package/dist/Slider.css +151 -151
- package/dist/Slider.mjs +300 -300
- package/dist/StatusLight.cjs +126 -126
- package/dist/StatusLight.css +61 -61
- package/dist/StatusLight.mjs +126 -126
- package/dist/Switch.cjs +163 -163
- package/dist/Switch.css +74 -74
- package/dist/Switch.mjs +163 -163
- package/dist/TableView.cjs +340 -328
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css +176 -172
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs +340 -328
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +150 -190
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +128 -100
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +153 -193
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TabsPicker.cjs +169 -161
- package/dist/TabsPicker.cjs.map +1 -1
- package/dist/TabsPicker.css +116 -124
- package/dist/TabsPicker.css.map +1 -1
- package/dist/TabsPicker.mjs +170 -162
- package/dist/TabsPicker.mjs.map +1 -1
- package/dist/TagGroup.cjs +226 -218
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css +147 -147
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +226 -218
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +65 -63
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css +58 -54
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs +65 -63
- package/dist/TextField.mjs.map +1 -1
- package/dist/TimeField.cjs +53 -53
- package/dist/TimeField.cjs.map +1 -1
- package/dist/TimeField.css +48 -48
- package/dist/TimeField.css.map +1 -1
- package/dist/TimeField.mjs +53 -53
- package/dist/TimeField.mjs.map +1 -1
- package/dist/Toast.cjs +120 -120
- package/dist/Toast.css +108 -108
- package/dist/Toast.mjs +120 -120
- package/dist/ToggleButton.cjs +3 -3
- package/dist/ToggleButton.css +12 -12
- package/dist/ToggleButton.mjs +3 -3
- package/dist/Tooltip.cjs +84 -83
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css +74 -70
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +84 -83
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/TreeView.cjs +150 -148
- package/dist/TreeView.cjs.map +1 -1
- package/dist/TreeView.css +147 -147
- package/dist/TreeView.css.map +1 -1
- package/dist/TreeView.mjs +151 -149
- package/dist/TreeView.mjs.map +1 -1
- package/dist/ar-AE.cjs +5 -0
- package/dist/ar-AE.cjs.map +1 -1
- package/dist/ar-AE.mjs +5 -0
- package/dist/ar-AE.mjs.map +1 -1
- package/dist/bg-BG.cjs +5 -0
- package/dist/bg-BG.cjs.map +1 -1
- package/dist/bg-BG.mjs +5 -0
- package/dist/bg-BG.mjs.map +1 -1
- package/dist/cs-CZ.cjs +5 -0
- package/dist/cs-CZ.cjs.map +1 -1
- package/dist/cs-CZ.mjs +5 -0
- package/dist/cs-CZ.mjs.map +1 -1
- package/dist/da-DK.cjs +5 -0
- package/dist/da-DK.cjs.map +1 -1
- package/dist/da-DK.mjs +5 -0
- package/dist/da-DK.mjs.map +1 -1
- package/dist/de-DE.cjs +5 -0
- package/dist/de-DE.cjs.map +1 -1
- package/dist/de-DE.mjs +5 -0
- package/dist/de-DE.mjs.map +1 -1
- package/dist/el-GR.cjs +5 -0
- package/dist/el-GR.cjs.map +1 -1
- package/dist/el-GR.mjs +5 -0
- package/dist/el-GR.mjs.map +1 -1
- package/dist/en-US.cjs +21 -16
- package/dist/en-US.cjs.map +1 -1
- package/dist/en-US.mjs +21 -16
- package/dist/en-US.mjs.map +1 -1
- package/dist/es-ES.cjs +5 -0
- package/dist/es-ES.cjs.map +1 -1
- package/dist/es-ES.mjs +5 -0
- package/dist/es-ES.mjs.map +1 -1
- package/dist/et-EE.cjs +5 -0
- package/dist/et-EE.cjs.map +1 -1
- package/dist/et-EE.mjs +5 -0
- package/dist/et-EE.mjs.map +1 -1
- package/dist/fi-FI.cjs +5 -0
- package/dist/fi-FI.cjs.map +1 -1
- package/dist/fi-FI.mjs +5 -0
- package/dist/fi-FI.mjs.map +1 -1
- package/dist/fr-FR.cjs +5 -0
- package/dist/fr-FR.cjs.map +1 -1
- package/dist/fr-FR.mjs +5 -0
- package/dist/fr-FR.mjs.map +1 -1
- package/dist/he-IL.cjs +5 -0
- package/dist/he-IL.cjs.map +1 -1
- package/dist/he-IL.mjs +5 -0
- package/dist/he-IL.mjs.map +1 -1
- package/dist/hr-HR.cjs +5 -0
- package/dist/hr-HR.cjs.map +1 -1
- package/dist/hr-HR.mjs +5 -0
- package/dist/hr-HR.mjs.map +1 -1
- package/dist/hu-HU.cjs +5 -0
- package/dist/hu-HU.cjs.map +1 -1
- package/dist/hu-HU.mjs +5 -0
- package/dist/hu-HU.mjs.map +1 -1
- package/dist/it-IT.cjs +5 -0
- package/dist/it-IT.cjs.map +1 -1
- package/dist/it-IT.mjs +5 -0
- package/dist/it-IT.mjs.map +1 -1
- package/dist/ja-JP.cjs +5 -0
- package/dist/ja-JP.cjs.map +1 -1
- package/dist/ja-JP.mjs +5 -0
- package/dist/ja-JP.mjs.map +1 -1
- package/dist/ko-KR.cjs +5 -0
- package/dist/ko-KR.cjs.map +1 -1
- package/dist/ko-KR.mjs +5 -0
- package/dist/ko-KR.mjs.map +1 -1
- package/dist/lt-LT.cjs +5 -0
- package/dist/lt-LT.cjs.map +1 -1
- package/dist/lt-LT.mjs +5 -0
- package/dist/lt-LT.mjs.map +1 -1
- package/dist/lv-LV.cjs +5 -0
- package/dist/lv-LV.cjs.map +1 -1
- package/dist/lv-LV.mjs +5 -0
- package/dist/lv-LV.mjs.map +1 -1
- package/dist/main.cjs +2 -0
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +3 -3
- package/dist/module.mjs.map +1 -1
- package/dist/nb-NO.cjs +5 -0
- package/dist/nb-NO.cjs.map +1 -1
- package/dist/nb-NO.mjs +5 -0
- package/dist/nb-NO.mjs.map +1 -1
- package/dist/nl-NL.cjs +5 -0
- package/dist/nl-NL.cjs.map +1 -1
- package/dist/nl-NL.mjs +5 -0
- package/dist/nl-NL.mjs.map +1 -1
- package/dist/pl-PL.cjs +5 -0
- package/dist/pl-PL.cjs.map +1 -1
- package/dist/pl-PL.mjs +5 -0
- package/dist/pl-PL.mjs.map +1 -1
- package/dist/pt-BR.cjs +5 -0
- package/dist/pt-BR.cjs.map +1 -1
- package/dist/pt-BR.mjs +5 -0
- package/dist/pt-BR.mjs.map +1 -1
- package/dist/pt-PT.cjs +5 -0
- package/dist/pt-PT.cjs.map +1 -1
- package/dist/pt-PT.mjs +5 -0
- package/dist/pt-PT.mjs.map +1 -1
- package/dist/ro-RO.cjs +5 -0
- package/dist/ro-RO.cjs.map +1 -1
- package/dist/ro-RO.mjs +5 -0
- package/dist/ro-RO.mjs.map +1 -1
- package/dist/ru-RU.cjs +5 -0
- package/dist/ru-RU.cjs.map +1 -1
- package/dist/ru-RU.mjs +5 -0
- package/dist/ru-RU.mjs.map +1 -1
- package/dist/sk-SK.cjs +5 -0
- package/dist/sk-SK.cjs.map +1 -1
- package/dist/sk-SK.mjs +5 -0
- package/dist/sk-SK.mjs.map +1 -1
- package/dist/sl-SI.cjs +5 -0
- package/dist/sl-SI.cjs.map +1 -1
- package/dist/sl-SI.mjs +5 -0
- package/dist/sl-SI.mjs.map +1 -1
- package/dist/sr-SP.cjs +5 -0
- package/dist/sr-SP.cjs.map +1 -1
- package/dist/sr-SP.mjs +5 -0
- package/dist/sr-SP.mjs.map +1 -1
- package/dist/sv-SE.cjs +5 -0
- package/dist/sv-SE.cjs.map +1 -1
- package/dist/sv-SE.mjs +5 -0
- package/dist/sv-SE.mjs.map +1 -1
- package/dist/tr-TR.cjs +5 -0
- package/dist/tr-TR.cjs.map +1 -1
- package/dist/tr-TR.mjs +5 -0
- package/dist/tr-TR.mjs.map +1 -1
- package/dist/types.d.ts +147 -87
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.cjs +5 -0
- package/dist/uk-UA.cjs.map +1 -1
- package/dist/uk-UA.mjs +5 -0
- package/dist/uk-UA.mjs.map +1 -1
- package/dist/zh-CN.cjs +5 -0
- package/dist/zh-CN.cjs.map +1 -1
- package/dist/zh-CN.mjs +5 -0
- package/dist/zh-CN.mjs.map +1 -1
- package/dist/zh-TW.cjs +5 -0
- package/dist/zh-TW.cjs.map +1 -1
- package/dist/zh-TW.mjs +5 -0
- package/dist/zh-TW.mjs.map +1 -1
- package/icons/Icon.cjs +10 -10
- package/icons/Icon.css +9 -9
- package/icons/Icon.mjs +10 -10
- package/icons/Skeleton.cjs +2 -2
- package/icons/Skeleton.css +6 -6
- package/icons/Skeleton.mjs +2 -2
- package/package.json +20 -20
- package/page.css +7 -7
- package/src/ActionBar.tsx +5 -3
- package/src/ActionButton.tsx +112 -32
- package/src/Avatar.tsx +4 -1
- package/src/Button.tsx +27 -28
- package/src/Calendar.tsx +3 -0
- package/src/Card.tsx +22 -7
- package/src/CardView.tsx +9 -1
- package/src/ColorArea.tsx +10 -2
- package/src/ColorField.tsx +3 -2
- package/src/ColorSlider.tsx +3 -2
- package/src/ComboBox.tsx +69 -44
- package/src/ContextualHelp.tsx +36 -32
- package/src/CustomDialog.tsx +1 -1
- package/src/DateField.tsx +4 -0
- package/src/DatePicker.tsx +28 -20
- package/src/DateRangePicker.tsx +5 -1
- package/src/Dialog.tsx +6 -3
- package/src/Disclosure.tsx +20 -16
- package/src/DropZone.tsx +5 -2
- package/src/Field.tsx +4 -1
- package/src/FullscreenDialog.tsx +1 -1
- package/src/Image.tsx +30 -8
- package/src/InlineAlert.tsx +10 -27
- package/src/Menu.tsx +57 -45
- package/src/Modal.tsx +99 -74
- package/src/NumberField.tsx +3 -2
- package/src/Picker.tsx +114 -51
- package/src/Popover.tsx +57 -35
- package/src/Provider.tsx +1 -1
- package/src/RangeCalendar.tsx +3 -0
- package/src/RangeSlider.tsx +3 -0
- package/src/SearchField.tsx +2 -1
- package/src/SegmentedControl.tsx +16 -44
- package/src/SelectBoxGroup.tsx +21 -23
- package/src/TableView.tsx +7 -6
- package/src/Tabs.tsx +34 -70
- package/src/TabsPicker.tsx +35 -26
- package/src/TagGroup.tsx +44 -36
- package/src/TextField.tsx +11 -6
- package/src/TimeField.tsx +4 -0
- package/src/Tooltip.tsx +3 -0
- package/src/TreeView.tsx +2 -2
- package/src/index.ts +3 -2
- package/src/page.macro.ts +2 -2
- package/src/style-utils.ts +4 -3
- package/style/__tests__/style-macro.test.js +56 -56
- package/style/dist/spectrum-theme.cjs +36 -6
- package/style/dist/spectrum-theme.cjs.map +1 -1
- package/style/dist/spectrum-theme.mjs +36 -6
- package/style/dist/spectrum-theme.mjs.map +1 -1
- package/style/dist/types.d.ts +1 -0
- package/style/dist/types.d.ts.map +1 -1
- package/style/spectrum-theme.ts +10 -8
- package/style/tokens.ts +10 -0
package/dist/TreeView.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"ACoFa;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAwFG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA0BK;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;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@import \"bdf071bf66df1ce3\";\n@import \"0330b2193d88b3df\";\n@import \"888ae06603582201\";\n@import \"73010de75c5ff12a\";\n@import \"6f9cf7ba5fc61169\";\n@import \"e3d8cbff54f98abf\";\n@import \"5ce50fd84b82affa\";\n@import \"e7f15e944ad73835\";\n@import \"17e37b578317afa7\";\n@import \"664b85d9761c64e2\";\n@import \"b6201a1b57a21b4e\";\n@import \"73100caf88a76f92\";\n@import \"aa285875506162cb\";\n@import \"f9799c14f2de588d\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {ActionMenuContext} from './ActionMenu';\nimport {\n Button,\n ButtonContext,\n ListLayout,\n Provider,\n TreeItemProps as RACTreeItemProps,\n TreeProps as RACTreeProps,\n Tree,\n TreeItem,\n TreeItemContent,\n TreeItemContentProps,\n TreeLoadMoreItem,\n TreeLoadMoreItemProps,\n useContextProps,\n Virtualizer\n} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Checkbox} from './Checkbox';\nimport Chevron from '../ui-icons/Chevron';\nimport {colorMix, focusRing, fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {DOMRef, forwardRefType, GlobalDOMAttributes, Key, LoadingState} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ProgressCircle} from './ProgressCircle';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, JSXElementConstructor, ReactElement, ReactNode, useContext, useRef} from 'react';\nimport {TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocale, useLocalizedStringFormatter} from 'react-aria';\nimport {useScale} from './utils';\n\ninterface S2TreeProps {\n // Only detatched is supported right now with the current styles from Spectrum\n // See https://github.com/adobe/react-spectrum/pull/7343 for what remaining combinations are left\n /** Whether the tree should be displayed with a [detached style](https://spectrum.adobe.com/page/tree-view/#Detached). */\n isDetached?: boolean,\n /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void,\n /** Whether the tree should be displayed with a [emphasized style](https://spectrum.adobe.com/page/tree-view/#Emphasis). */\n isEmphasized?: boolean\n}\n\nexport interface TreeViewProps<T> extends Omit<RACTreeProps<T>, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks' | keyof GlobalDOMAttributes>, UnsafeStyles, S2TreeProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nexport interface TreeViewItemProps extends Omit<RACTreeItemProps, 'className' | 'style' | 'onClick' | keyof GlobalDOMAttributes> {\n /** Whether this item has children, even if not loaded yet. */\n hasChildItems?: boolean\n}\n\nexport interface TreeViewLoadMoreItemProps extends Pick<TreeLoadMoreItemProps, 'onLoadMore'> {\n /** The current loading state of the TreeView or TreeView row. */\n loadingState?: LoadingState\n}\n\ninterface TreeRendererContextValue {\n renderer?: (item) => ReactElement<any, string | JSXElementConstructor<any>>\n}\nconst TreeRendererContext = createContext<TreeRendererContextValue>({});\n\n\nlet InternalTreeContext = createContext<{isDetached?: boolean, isEmphasized?: boolean}>({});\n\n// TODO: the below is needed so the borders of the top and bottom row isn't cut off if the TreeView is wrapped within a container by always reserving the 2px needed for the\n// keyboard focus ring. Perhaps find a different way of rendering the outlines since the top of the item doesn't\n// scroll into view due to how the ring is offset. Alternatively, have the tree render the top/bottom outline like it does in Listview\nconst tree = style({\n ...focusRing(),\n outlineOffset: -2, // make certain we are visible inside overflow hidden containers\n userSelect: 'none',\n minHeight: 0,\n minWidth: 0,\n width: 'full',\n height: 'full',\n overflow: 'auto',\n boxSizing: 'border-box',\n justifyContent: {\n isEmpty: 'center'\n },\n alignItems: {\n isEmpty: 'center'\n },\n '--indent': {\n type: 'width',\n value: 16\n }\n}, getAllowedOverrides({height: true}));\n\n/**\n * A tree view provides users with a way to navigate nested hierarchical information.\n */\nexport const TreeView = /*#__PURE__*/ (forwardRef as forwardRefType)(function TreeView<T extends object>(props: TreeViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {children, isDetached, isEmphasized, UNSAFE_className, UNSAFE_style} = props;\n let scale = useScale();\n\n let renderer;\n if (typeof children === 'function') {\n renderer = children;\n }\n\n let domRef = useDOMRef(ref);\n\n return (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight: scale === 'large' ? 50 : 40,\n gap: isDetached ? 2 : 0\n }}>\n <TreeRendererContext.Provider value={{renderer}}>\n <InternalTreeContext.Provider value={{isDetached, isEmphasized}}>\n <Tree\n {...props}\n style={UNSAFE_style}\n className={renderProps => (UNSAFE_className ?? '') + tree({isDetached, ...renderProps}, props.styles)}\n selectionBehavior=\"toggle\"\n ref={domRef}>\n {props.children}\n </Tree>\n </InternalTreeContext.Provider>\n </TreeRendererContext.Provider>\n </Virtualizer>\n );\n});\n\nconst selectedBackground = lightDark(colorMix('gray-25', 'informative-900', 10), colorMix('gray-25', 'informative-700', 10));\nconst selectedActiveBackground = lightDark(colorMix('gray-25', 'informative-900', 15), colorMix('gray-25', 'informative-700', 15));\n\nconst rowBackgroundColor = {\n default: '--s2-container-bg',\n isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7),\n isHovered: colorMix('gray-25', 'gray-900', 7),\n isPressed: colorMix('gray-25', 'gray-900', 10),\n isSelected: {\n default: colorMix('gray-25', 'gray-900', 7),\n isEmphasized: selectedBackground,\n isFocusVisibleWithin: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n },\n isHovered: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n },\n isPressed: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n }\n },\n forcedColors: {\n default: 'Background'\n }\n} as const;\n\nconst treeRow = style({\n position: 'relative',\n display: 'flex',\n height: 40,\n width: 'full',\n boxSizing: 'border-box',\n font: 'ui',\n color: 'body',\n outlineStyle: 'none',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--rowBackgroundColor': {\n type: 'backgroundColor',\n value: rowBackgroundColor\n },\n '--rowFocusIndicatorColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n }\n});\n\nconst treeCellGrid = style({\n display: 'grid',\n width: 'full',\n height: 'full',\n boxSizing: 'border-box',\n alignContent: 'center',\n alignItems: 'center',\n gridTemplateColumns: ['auto', 'auto', 'auto', 'auto', 'auto', '1fr', 'minmax(0, auto)', 'auto'],\n gridTemplateRows: '1fr',\n gridTemplateAreas: [\n 'drag-handle checkbox level-padding expand-button icon content actions actionmenu'\n ],\n backgroundColor: '--rowBackgroundColor',\n paddingEnd: 4, // account for any focus rings on the last item in the cell\n color: {\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n },\n '--rowSelectedBorderColor': {\n type: 'outlineColor',\n value: {\n default: 'gray-800',\n isFocusVisible: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n '--rowForcedFocusBorderColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n borderColor: {\n isDetached: {\n default: 'transparent',\n isSelected: '--rowSelectedBorderColor'\n }\n },\n borderWidth: {\n isDetached: 1\n },\n borderRadius: {\n isDetached: 'default'\n },\n borderStyle: {\n isDetached: 'solid'\n }\n});\n\nconst treeCheckbox = style({\n gridArea: 'checkbox',\n marginStart: 12,\n marginEnd: 0,\n paddingEnd: 0\n});\n\nconst treeIcon = style({\n gridArea: 'icon',\n marginEnd: 'text-to-visual',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst treeContent = style({\n gridArea: 'content',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n});\n\nconst treeActions = style({\n gridArea: 'actions',\n /* TODO: I made this one up, confirm desired behavior. These paddings are to make sure the action group has enough padding for the focus ring */\n marginStart: 2,\n marginEnd: 4\n});\n\nconst treeActionMenu = style({\n gridArea: 'actionmenu'\n});\n\nconst cellFocus = {\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineOffset: -2,\n outlineWidth: 2,\n outlineColor: 'focus-ring',\n borderRadius: '[6px]'\n} as const;\n\nconst treeRowFocusIndicator = raw(`\n &:before {\n content: \"\";\n display: inline-block;\n position: sticky;\n inset-inline-start: 0;\n width: 3px;\n height: 100%;\n margin-inline-end: -3px;\n margin-block-end: 1px;\n z-index: 3;\n background-color: var(--rowFocusIndicatorColor);\n }`\n);\n\nexport const TreeViewItem = (props: TreeViewItemProps): ReactNode => {\n let {\n href\n } = props;\n let {isDetached, isEmphasized} = useContext(InternalTreeContext);\n\n return (\n <TreeItem\n {...props}\n className={(renderProps) => treeRow({\n ...renderProps,\n isLink: !!href, isEmphasized\n }) + (renderProps.isFocusVisible && !isDetached ? ' ' + treeRowFocusIndicator : '')} />\n );\n};\n\nexport interface TreeViewItemContentProps extends Omit<TreeItemContentProps, 'children'> {\n /** Rendered contents of the tree item or child items. */\n children: ReactNode\n}\n\nexport const TreeViewItemContent = (props: TreeViewItemContentProps): ReactNode => {\n let {\n children\n } = props;\n let {isDetached, isEmphasized} = useContext(InternalTreeContext);\n let scale = useScale();\n\n return (\n <TreeItemContent>\n {({isExpanded, hasChildItems, selectionMode, selectionBehavior, isDisabled, isFocusVisible, isSelected, id, state}) => {\n let isNextSelected = false;\n let isNextFocused = false;\n let keyAfter = state.collection.getKeyAfter(id);\n if (keyAfter != null) {\n isNextSelected = state.selectionManager.isSelected(keyAfter);\n }\n let isFirst = state.collection.getFirstKey() === id;\n return (\n <div className={treeCellGrid({isDisabled, isNextSelected, isSelected, isFirst, isNextFocused, isDetached})}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n // TODO: add transition?\n <div className={treeCheckbox}>\n <Checkbox\n isEmphasized={isEmphasized}\n slot=\"selection\" />\n </div>\n )}\n <div\n className={style({\n gridArea: 'level-padding',\n width: 'calc(calc(var(--tree-item-level, 0) - 1) * var(--indent))'\n })} />\n <ExpandableRowChevron isDisabled={isDisabled} isExpanded={isExpanded} scale={scale} isHidden={!(hasChildItems)} />\n <Provider\n values={[\n [TextContext, {styles: treeContent}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: treeIcon}),\n styles: style({size: fontRelative(20), flexShrink: 0})\n }],\n [ActionButtonGroupContext, {styles: treeActions}],\n [ActionMenuContext, {styles: treeActionMenu, isQuiet: true}]\n ]}>\n {children}\n </Provider>\n {isFocusVisible && isDetached && <div role=\"presentation\" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible: true})} />}\n </div>\n );\n }}\n </TreeItemContent>\n );\n};\n\nconst centeredWrapper = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 'full',\n height: 'full'\n});\n\nexport const TreeViewLoadMoreItem = (props: TreeViewLoadMoreItemProps): ReactNode => {\n let {loadingState, onLoadMore} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n return (\n <TreeLoadMoreItem isLoading={isLoading} onLoadMore={onLoadMore} className={style({width: 'full', marginY: 4})}>\n {() => {\n return (\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loadingMore')} />\n </div>\n );\n }}\n </TreeLoadMoreItem>\n );\n};\n\ninterface ExpandableRowChevronProps {\n isExpanded?: boolean,\n isDisabled?: boolean,\n isRTL?: boolean,\n scale: 'medium' | 'large',\n isHidden?: boolean\n}\n\nconst expandButton = style<ExpandableRowChevronProps>({\n gridArea: 'expand-button',\n color: {\n default: 'inherit',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n height: 40,\n width: 40,\n display: 'flex',\n flexWrap: 'wrap',\n alignContent: 'center',\n justifyContent: 'center',\n outlineStyle: 'none',\n cursor: 'default',\n transform: {\n isExpanded: {\n default: 'rotate(90deg)',\n isRTL: 'rotate(-90deg)'\n }\n },\n padding: 0,\n transition: 'default',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n disableTapHighlight: true,\n visibility: {\n isHidden: 'hidden'\n }\n});\n\nfunction ExpandableRowChevron(props: ExpandableRowChevronProps) {\n let expandButtonRef = useRef<HTMLButtonElement>(null);\n let [fullProps, ref] = useContextProps({...props, slot: 'chevron'}, expandButtonRef, ButtonContext);\n let {isExpanded, scale, isHidden} = fullProps;\n let {direction} = useLocale();\n\n return (\n <Button\n {...props}\n ref={ref}\n slot=\"chevron\"\n className={renderProps => expandButton({...renderProps, isExpanded, isRTL: direction === 'rtl', scale, isHidden})}>\n <Chevron\n className={style({\n scale: {\n direction: {\n ltr: '1',\n rtl: '-1'\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })({direction})} />\n </Button>\n );\n}\n"],"names":[],"version":3,"file":"TreeView.css.map"}
|
|
1
|
+
{"mappings":"ACoFa;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAwFG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA0BK;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;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sources":["56ed516746d0036e","packages/@react-spectrum/s2/src/TreeView.tsx"],"sourcesContent":["@import \"9f0cb543acce7895\";\n@import \"1efe6bd9df94f465\";\n@import \"bdf071bf66df1ce3\";\n@import \"0330b2193d88b3df\";\n@import \"888ae06603582201\";\n@import \"73010de75c5ff12a\";\n@import \"6f9cf7ba5fc61169\";\n@import \"e3d8cbff54f98abf\";\n@import \"5ce50fd84b82affa\";\n@import \"e7f15e944ad73835\";\n@import \"17e37b578317afa7\";\n@import \"664b85d9761c64e2\";\n@import \"b6201a1b57a21b4e\";\n@import \"73100caf88a76f92\";\n@import \"aa285875506162cb\";\n@import \"f9799c14f2de588d\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {ActionMenuContext} from './ActionMenu';\nimport {\n Button,\n ButtonContext,\n ListLayout,\n Provider,\n TreeItemProps as RACTreeItemProps,\n TreeProps as RACTreeProps,\n Tree,\n TreeItem,\n TreeItemContent,\n TreeItemContentProps,\n TreeLoadMoreItem,\n TreeLoadMoreItemProps,\n useContextProps,\n Virtualizer\n} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Checkbox} from './Checkbox';\nimport Chevron from '../ui-icons/Chevron';\nimport {colorMix, focusRing, fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {DOMRef, forwardRefType, GlobalDOMAttributes, Key, LoadingState} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ProgressCircle} from './ProgressCircle';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, JSXElementConstructor, ReactElement, ReactNode, useContext, useRef} from 'react';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocale, useLocalizedStringFormatter} from 'react-aria';\nimport {useScale} from './utils';\n\ninterface S2TreeProps {\n // Only detatched is supported right now with the current styles from Spectrum\n // See https://github.com/adobe/react-spectrum/pull/7343 for what remaining combinations are left\n /** Whether the tree should be displayed with a [detached style](https://spectrum.adobe.com/page/tree-view/#Detached). */\n isDetached?: boolean,\n /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void,\n /** Whether the tree should be displayed with a [emphasized style](https://spectrum.adobe.com/page/tree-view/#Emphasis). */\n isEmphasized?: boolean\n}\n\nexport interface TreeViewProps<T> extends Omit<RACTreeProps<T>, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks' | keyof GlobalDOMAttributes>, UnsafeStyles, S2TreeProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nexport interface TreeViewItemProps extends Omit<RACTreeItemProps, 'className' | 'style' | 'onClick' | keyof GlobalDOMAttributes> {\n /** Whether this item has children, even if not loaded yet. */\n hasChildItems?: boolean\n}\n\nexport interface TreeViewLoadMoreItemProps extends Pick<TreeLoadMoreItemProps, 'onLoadMore'> {\n /** The current loading state of the TreeView or TreeView row. */\n loadingState?: LoadingState\n}\n\ninterface TreeRendererContextValue {\n renderer?: (item) => ReactElement<any, string | JSXElementConstructor<any>>\n}\nconst TreeRendererContext = createContext<TreeRendererContextValue>({});\n\n\nlet InternalTreeContext = createContext<{isDetached?: boolean, isEmphasized?: boolean}>({});\n\n// TODO: the below is needed so the borders of the top and bottom row isn't cut off if the TreeView is wrapped within a container by always reserving the 2px needed for the\n// keyboard focus ring. Perhaps find a different way of rendering the outlines since the top of the item doesn't\n// scroll into view due to how the ring is offset. Alternatively, have the tree render the top/bottom outline like it does in Listview\nconst tree = style({\n ...focusRing(),\n outlineOffset: -2, // make certain we are visible inside overflow hidden containers\n userSelect: 'none',\n minHeight: 0,\n minWidth: 0,\n width: 'full',\n height: 'full',\n overflow: 'auto',\n boxSizing: 'border-box',\n justifyContent: {\n isEmpty: 'center'\n },\n alignItems: {\n isEmpty: 'center'\n },\n '--indent': {\n type: 'width',\n value: 16\n }\n}, getAllowedOverrides({height: true}));\n\n/**\n * A tree view provides users with a way to navigate nested hierarchical information.\n */\nexport const TreeView = /*#__PURE__*/ (forwardRef as forwardRefType)(function TreeView<T extends object>(props: TreeViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {children, isDetached, isEmphasized, UNSAFE_className, UNSAFE_style} = props;\n let scale = useScale();\n\n let renderer;\n if (typeof children === 'function') {\n renderer = children;\n }\n\n let domRef = useDOMRef(ref);\n\n return (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight: scale === 'large' ? 50 : 40,\n gap: isDetached ? 2 : 0\n }}>\n <TreeRendererContext.Provider value={{renderer}}>\n <InternalTreeContext.Provider value={{isDetached, isEmphasized}}>\n <Tree\n {...props}\n style={UNSAFE_style}\n className={renderProps => (UNSAFE_className ?? '') + tree({isDetached, ...renderProps}, props.styles)}\n selectionBehavior=\"toggle\"\n ref={domRef}>\n {props.children}\n </Tree>\n </InternalTreeContext.Provider>\n </TreeRendererContext.Provider>\n </Virtualizer>\n );\n});\n\nconst selectedBackground = lightDark(colorMix('gray-25', 'informative-900', 10), colorMix('gray-25', 'informative-700', 10));\nconst selectedActiveBackground = lightDark(colorMix('gray-25', 'informative-900', 15), colorMix('gray-25', 'informative-700', 15));\n\nconst rowBackgroundColor = {\n default: '--s2-container-bg',\n isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7),\n isHovered: colorMix('gray-25', 'gray-900', 7),\n isPressed: colorMix('gray-25', 'gray-900', 10),\n isSelected: {\n default: colorMix('gray-25', 'gray-900', 7),\n isEmphasized: selectedBackground,\n isFocusVisibleWithin: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n },\n isHovered: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n },\n isPressed: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n }\n },\n forcedColors: {\n default: 'Background'\n }\n} as const;\n\nconst treeRow = style({\n position: 'relative',\n display: 'flex',\n height: 40,\n width: 'full',\n boxSizing: 'border-box',\n font: 'ui',\n color: 'body',\n outlineStyle: 'none',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--rowBackgroundColor': {\n type: 'backgroundColor',\n value: rowBackgroundColor\n },\n '--rowFocusIndicatorColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n }\n});\n\nconst treeCellGrid = style({\n display: 'grid',\n width: 'full',\n height: 'full',\n boxSizing: 'border-box',\n alignContent: 'center',\n alignItems: 'center',\n gridTemplateColumns: ['auto', 'auto', 'auto', 'auto', 'auto', '1fr', 'minmax(0, auto)', 'auto'],\n gridTemplateRows: '1fr',\n gridTemplateAreas: [\n 'drag-handle checkbox level-padding expand-button icon content actions actionmenu'\n ],\n backgroundColor: '--rowBackgroundColor',\n paddingEnd: 4, // account for any focus rings on the last item in the cell\n color: {\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n },\n '--rowSelectedBorderColor': {\n type: 'outlineColor',\n value: {\n default: 'gray-800',\n isFocusVisible: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n '--rowForcedFocusBorderColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n borderColor: {\n isDetached: {\n default: 'transparent',\n isSelected: '--rowSelectedBorderColor'\n }\n },\n borderWidth: {\n isDetached: 1\n },\n borderRadius: {\n isDetached: 'default'\n },\n borderStyle: {\n isDetached: 'solid'\n }\n});\n\nconst treeCheckbox = style({\n gridArea: 'checkbox',\n marginStart: 12,\n marginEnd: 0,\n paddingEnd: 0\n});\n\nconst treeIcon = style({\n gridArea: 'icon',\n marginEnd: 'text-to-visual',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst treeContent = style({\n gridArea: 'content',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n});\n\nconst treeActions = style({\n gridArea: 'actions',\n /* TODO: I made this one up, confirm desired behavior. These paddings are to make sure the action group has enough padding for the focus ring */\n marginStart: 2,\n marginEnd: 4\n});\n\nconst treeActionMenu = style({\n gridArea: 'actionmenu'\n});\n\nconst cellFocus = {\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineOffset: -2,\n outlineWidth: 2,\n outlineColor: 'focus-ring',\n borderRadius: '[6px]'\n} as const;\n\nconst treeRowFocusIndicator = raw(`\n &:before {\n content: \"\";\n display: inline-block;\n position: sticky;\n inset-inline-start: 0;\n width: 3px;\n height: 100%;\n margin-inline-end: -3px;\n margin-block-end: 1px;\n z-index: 3;\n background-color: var(--rowFocusIndicatorColor);\n }`\n);\n\nexport const TreeViewItem = (props: TreeViewItemProps): ReactNode => {\n let {\n href\n } = props;\n let {isDetached, isEmphasized} = useContext(InternalTreeContext);\n\n return (\n <TreeItem\n {...props}\n className={(renderProps) => treeRow({\n ...renderProps,\n isLink: !!href, isEmphasized\n }) + (renderProps.isFocusVisible && !isDetached ? ' ' + treeRowFocusIndicator : '')} />\n );\n};\n\nexport interface TreeViewItemContentProps extends Omit<TreeItemContentProps, 'children'> {\n /** Rendered contents of the tree item or child items. */\n children: ReactNode\n}\n\nexport const TreeViewItemContent = (props: TreeViewItemContentProps): ReactNode => {\n let {\n children\n } = props;\n let {isDetached, isEmphasized} = useContext(InternalTreeContext);\n let scale = useScale();\n\n return (\n <TreeItemContent>\n {({isExpanded, hasChildItems, selectionMode, selectionBehavior, isDisabled, isFocusVisible, isSelected, id, state}) => {\n let isNextSelected = false;\n let isNextFocused = false;\n let keyAfter = state.collection.getKeyAfter(id);\n if (keyAfter != null) {\n isNextSelected = state.selectionManager.isSelected(keyAfter);\n }\n let isFirst = state.collection.getFirstKey() === id;\n return (\n <div className={treeCellGrid({isDisabled, isNextSelected, isSelected, isFirst, isNextFocused, isDetached})}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n // TODO: add transition?\n <div className={treeCheckbox}>\n <Checkbox\n isEmphasized={isEmphasized}\n slot=\"selection\" />\n </div>\n )}\n <div\n className={style({\n gridArea: 'level-padding',\n width: 'calc(calc(var(--tree-item-level, 0) - 1) * var(--indent))'\n })} />\n <ExpandableRowChevron isDisabled={isDisabled} isExpanded={isExpanded} scale={scale} isHidden={!(hasChildItems)} />\n <Provider\n values={[\n [TextContext, {styles: treeContent}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: treeIcon}),\n styles: style({size: fontRelative(20), flexShrink: 0})\n }],\n [ActionButtonGroupContext, {styles: treeActions}],\n [ActionMenuContext, {styles: treeActionMenu, isQuiet: true}]\n ]}>\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n </Provider>\n {isFocusVisible && isDetached && <div role=\"presentation\" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible: true})} />}\n </div>\n );\n }}\n </TreeItemContent>\n );\n};\n\nconst centeredWrapper = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 'full',\n height: 'full'\n});\n\nexport const TreeViewLoadMoreItem = (props: TreeViewLoadMoreItemProps): ReactNode => {\n let {loadingState, onLoadMore} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n return (\n <TreeLoadMoreItem isLoading={isLoading} onLoadMore={onLoadMore} className={style({width: 'full', marginY: 4})}>\n {() => {\n return (\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loadingMore')} />\n </div>\n );\n }}\n </TreeLoadMoreItem>\n );\n};\n\ninterface ExpandableRowChevronProps {\n isExpanded?: boolean,\n isDisabled?: boolean,\n isRTL?: boolean,\n scale: 'medium' | 'large',\n isHidden?: boolean\n}\n\nconst expandButton = style<ExpandableRowChevronProps>({\n gridArea: 'expand-button',\n color: {\n default: 'inherit',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n height: 40,\n width: 40,\n display: 'flex',\n flexWrap: 'wrap',\n alignContent: 'center',\n justifyContent: 'center',\n outlineStyle: 'none',\n cursor: 'default',\n transform: {\n isExpanded: {\n default: 'rotate(90deg)',\n isRTL: 'rotate(-90deg)'\n }\n },\n padding: 0,\n transition: 'default',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n disableTapHighlight: true,\n visibility: {\n isHidden: 'hidden'\n }\n});\n\nfunction ExpandableRowChevron(props: ExpandableRowChevronProps) {\n let expandButtonRef = useRef<HTMLButtonElement>(null);\n let [fullProps, ref] = useContextProps({...props, slot: 'chevron'}, expandButtonRef, ButtonContext);\n let {isExpanded, scale, isHidden} = fullProps;\n let {direction} = useLocale();\n\n return (\n <Button\n {...props}\n ref={ref}\n slot=\"chevron\"\n className={renderProps => expandButton({...renderProps, isExpanded, isRTL: direction === 'rtl', scale, isHidden})}>\n <Chevron\n className={style({\n scale: {\n direction: {\n ltr: '1',\n rtl: '-1'\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })({direction})} />\n </Button>\n );\n}\n"],"names":[],"version":3,"file":"TreeView.css.map"}
|
package/dist/TreeView.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import $4b69f02ec06b9226$export$2e2bcd8739ae039 from "./Chevron.mjs";
|
|
|
7
7
|
import {IconContext as $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed} from "../icons/Icon.mjs";
|
|
8
8
|
import $iOVFT$intlStringsmjs from "./intlStrings.mjs";
|
|
9
9
|
import {ProgressCircle as $41ddd91dbbf0c389$export$c79b9d6b4cc92af7} from "./ProgressCircle.mjs";
|
|
10
|
-
import {TextContext as $8e847109a6ab556d$export$9afb8bc826b033ea} from "./Content.mjs";
|
|
10
|
+
import {Text as $8e847109a6ab556d$export$5f1af8db9871e1d6, TextContext as $8e847109a6ab556d$export$9afb8bc826b033ea} from "./Content.mjs";
|
|
11
11
|
import {useScale as $859432f3b3573fcb$export$a8d2043b2d807f4d} from "./utils.mjs";
|
|
12
12
|
import {jsx as $iOVFT$jsx, jsxs as $iOVFT$jsxs} from "react/jsx-runtime";
|
|
13
13
|
import {Virtualizer as $iOVFT$Virtualizer, ListLayout as $iOVFT$ListLayout, Tree as $iOVFT$Tree, TreeItem as $iOVFT$TreeItem, TreeItemContent as $iOVFT$TreeItemContent, Provider as $iOVFT$Provider, TreeLoadMoreItem as $iOVFT$TreeLoadMoreItem, useContextProps as $iOVFT$useContextProps, ButtonContext as $iOVFT$ButtonContext, Button as $iOVFT$Button} from "react-aria-components";
|
|
@@ -55,7 +55,7 @@ const $03960a2740ca2b19$var$tree = function anonymous(props, overrides) {
|
|
|
55
55
|
let minWidth = false;
|
|
56
56
|
let width = false;
|
|
57
57
|
let height = false;
|
|
58
|
-
let matches = (overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|Z|N|L|F|M|K)[^\s]+/g);
|
|
58
|
+
let matches = (overrides || '').matchAll(/(?:^|\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);
|
|
59
59
|
for (let p of matches){
|
|
60
60
|
if (p[1] === "M") minHeight = true;
|
|
61
61
|
if (p[1] === "N") minWidth = true;
|
|
@@ -63,22 +63,22 @@ const $03960a2740ca2b19$var$tree = function anonymous(props, overrides) {
|
|
|
63
63
|
if (p[1] === "F") height = true;
|
|
64
64
|
rules += p[0];
|
|
65
65
|
}
|
|
66
|
-
if (props.isFocusVisible) rules += '
|
|
67
|
-
else rules += '
|
|
68
|
-
rules += '
|
|
69
|
-
rules += '
|
|
70
|
-
rules += '
|
|
71
|
-
rules += '
|
|
72
|
-
if (!minHeight) rules += '
|
|
73
|
-
if (!minWidth) rules += '
|
|
74
|
-
if (!width) rules += '
|
|
75
|
-
if (!height) rules += '
|
|
76
|
-
rules += '
|
|
77
|
-
rules += '
|
|
78
|
-
rules += '
|
|
79
|
-
if (props.isEmpty) rules += '
|
|
80
|
-
if (props.isEmpty) rules += '
|
|
81
|
-
rules += ' -lPUMEc-
|
|
66
|
+
if (props.isFocusVisible) rules += ' _Lf12';
|
|
67
|
+
else rules += ' _Le12';
|
|
68
|
+
rules += ' Oh12';
|
|
69
|
+
rules += ' _Mc12';
|
|
70
|
+
rules += ' _Kb12';
|
|
71
|
+
rules += ' _4c12';
|
|
72
|
+
if (!minHeight) rules += ' Ma12';
|
|
73
|
+
if (!minWidth) rules += ' Na12';
|
|
74
|
+
if (!width) rules += ' Za12';
|
|
75
|
+
if (!height) rules += ' Fb12';
|
|
76
|
+
rules += ' _Na12';
|
|
77
|
+
rules += ' Pa12';
|
|
78
|
+
rules += ' _oa12';
|
|
79
|
+
if (props.isEmpty) rules += ' _Ca12';
|
|
80
|
+
if (props.isEmpty) rules += ' eb12';
|
|
81
|
+
rules += ' -lPUMEc-Zu12';
|
|
82
82
|
return rules;
|
|
83
83
|
};
|
|
84
84
|
const $03960a2740ca2b19$export$6940b0d9c820eca7 = /*#__PURE__*/ (0, $iOVFT$forwardRef)(function TreeView(props, ref) {
|
|
@@ -146,95 +146,95 @@ const $03960a2740ca2b19$var$rowBackgroundColor = {
|
|
|
146
146
|
};
|
|
147
147
|
const $03960a2740ca2b19$var$treeRow = function anonymous(props) {
|
|
148
148
|
let rules = " ";
|
|
149
|
-
rules += '
|
|
150
|
-
rules += '
|
|
151
|
-
rules += '
|
|
152
|
-
rules += '
|
|
153
|
-
rules += '
|
|
154
|
-
rules += '
|
|
155
|
-
rules += '
|
|
156
|
-
rules += '
|
|
157
|
-
rules += '
|
|
158
|
-
rules += '
|
|
159
|
-
rules += '
|
|
160
|
-
rules += '
|
|
161
|
-
rules += '
|
|
162
|
-
rules += '
|
|
163
|
-
rules += ' -_6BNtrc-
|
|
164
|
-
rules += '
|
|
165
|
-
rules += '
|
|
166
|
-
rules += '
|
|
167
|
-
rules += '
|
|
168
|
-
rules += '
|
|
169
|
-
rules += '
|
|
170
|
-
rules += '
|
|
171
|
-
rules += '
|
|
172
|
-
rules += '
|
|
173
|
-
if (props.isLink) rules += '
|
|
174
|
-
else rules += '
|
|
149
|
+
rules += ' _Pc12';
|
|
150
|
+
rules += ' sd12';
|
|
151
|
+
rules += ' Fv12';
|
|
152
|
+
rules += ' Za12';
|
|
153
|
+
rules += ' _oa12';
|
|
154
|
+
rules += ' uk12';
|
|
155
|
+
rules += ' uch12';
|
|
156
|
+
rules += ' udi12';
|
|
157
|
+
rules += ' uea12';
|
|
158
|
+
rules += ' ugb12';
|
|
159
|
+
rules += ' uhd12';
|
|
160
|
+
rules += ' uje12';
|
|
161
|
+
rules += ' u2NhKxcl12';
|
|
162
|
+
rules += ' uic12';
|
|
163
|
+
rules += ' -_6BNtrc-c12';
|
|
164
|
+
rules += ' vx12';
|
|
165
|
+
rules += ' wb12';
|
|
166
|
+
rules += ' xb12';
|
|
167
|
+
rules += ' _xa12';
|
|
168
|
+
rules += ' _Fd12';
|
|
169
|
+
rules += ' _FezxGHba12';
|
|
170
|
+
rules += ' _FnuYUweb12';
|
|
171
|
+
rules += ' pt12';
|
|
172
|
+
rules += ' _Le12';
|
|
173
|
+
if (props.isLink) rules += ' ry12';
|
|
174
|
+
else rules += ' ri12';
|
|
175
175
|
if (props.isSelected) {
|
|
176
176
|
if (props.isPressed) {
|
|
177
|
-
if (props.isEmphasized) rules += ' -qH4xad-
|
|
178
|
-
else rules += ' -qH4xad-
|
|
177
|
+
if (props.isEmphasized) rules += ' -qH4xad-gT9rOHd12';
|
|
178
|
+
else rules += ' -qH4xad-gRfT7e12';
|
|
179
179
|
} else if (props.isHovered) {
|
|
180
|
-
if (props.isEmphasized) rules += ' -qH4xad-
|
|
181
|
-
else rules += ' -qH4xad-
|
|
180
|
+
if (props.isEmphasized) rules += ' -qH4xad-gT9rOHd12';
|
|
181
|
+
else rules += ' -qH4xad-gRfT7e12';
|
|
182
182
|
} else if (props.isFocusVisibleWithin) {
|
|
183
|
-
if (props.isEmphasized) rules += ' -qH4xad-
|
|
184
|
-
else rules += ' -qH4xad-
|
|
185
|
-
} else if (props.isEmphasized) rules += ' -qH4xad-
|
|
186
|
-
else rules += ' -qH4xad-
|
|
187
|
-
} else if (props.isPressed) rules += ' -qH4xad-
|
|
188
|
-
else if (props.isHovered) rules += ' -qH4xad-
|
|
189
|
-
else if (props.isFocusVisibleWithin) rules += ' -qH4xad-
|
|
190
|
-
else rules += ' -qH4xad-
|
|
191
|
-
rules += ' -qH4xad-
|
|
192
|
-
rules += ' -_34HbNb-
|
|
193
|
-
rules += ' -_34HbNb-
|
|
183
|
+
if (props.isEmphasized) rules += ' -qH4xad-gT9rOHd12';
|
|
184
|
+
else rules += ' -qH4xad-gRfT7e12';
|
|
185
|
+
} else if (props.isEmphasized) rules += ' -qH4xad-gJpow3b12';
|
|
186
|
+
else rules += ' -qH4xad-gj1B7i12';
|
|
187
|
+
} else if (props.isPressed) rules += ' -qH4xad-gRfT7e12';
|
|
188
|
+
else if (props.isHovered) rules += ' -qH4xad-gj1B7i12';
|
|
189
|
+
else if (props.isFocusVisibleWithin) rules += ' -qH4xad-gj1B7i12';
|
|
190
|
+
else rules += ' -qH4xad-gEzkoQe12';
|
|
191
|
+
rules += ' -qH4xad-lga12';
|
|
192
|
+
rules += ' -_34HbNb-Oh12';
|
|
193
|
+
rules += ' -_34HbNb-lOc12';
|
|
194
194
|
return rules;
|
|
195
195
|
};
|
|
196
196
|
const $03960a2740ca2b19$var$treeCellGrid = function anonymous(props) {
|
|
197
197
|
let rules = " ";
|
|
198
|
-
rules += '
|
|
199
|
-
rules += '
|
|
200
|
-
rules += '
|
|
201
|
-
rules += '
|
|
202
|
-
rules += '
|
|
203
|
-
rules += '
|
|
204
|
-
rules += '
|
|
205
|
-
rules += '
|
|
206
|
-
rules += '
|
|
207
|
-
rules += '
|
|
208
|
-
rules += '
|
|
198
|
+
rules += ' se12';
|
|
199
|
+
rules += ' Za12';
|
|
200
|
+
rules += ' Fb12';
|
|
201
|
+
rules += ' _oa12';
|
|
202
|
+
rules += ' _cb12';
|
|
203
|
+
rules += ' eb12';
|
|
204
|
+
rules += ' Dw9uTxc12';
|
|
205
|
+
rules += ' EM8Mfn12';
|
|
206
|
+
rules += ' CgjMZ2c12';
|
|
207
|
+
rules += ' gs9yXOb12';
|
|
208
|
+
rules += ' Rp12';
|
|
209
209
|
if (props.isDisabled) {
|
|
210
|
-
rules += '
|
|
211
|
-
rules += '
|
|
210
|
+
rules += ' pp12';
|
|
211
|
+
rules += ' plc12';
|
|
212
212
|
}
|
|
213
|
-
if (props.isFocusVisible) rules += ' -_7xg3bb-
|
|
214
|
-
else rules += ' -_7xg3bb-
|
|
215
|
-
rules += ' -_7xg3bb-
|
|
216
|
-
rules += ' -pKMv1c-
|
|
217
|
-
rules += ' -pKMv1c-
|
|
213
|
+
if (props.isFocusVisible) rules += ' -_7xg3bb-Oh12';
|
|
214
|
+
else rules += ' -_7xg3bb-O8Izf8c12';
|
|
215
|
+
rules += ' -_7xg3bb-lOc12';
|
|
216
|
+
rules += ' -pKMv1c-Oh12';
|
|
217
|
+
rules += ' -pKMv1c-lOc12';
|
|
218
218
|
if (props.isDetached) {
|
|
219
|
-
if (props.isSelected) rules += '
|
|
220
|
-
else rules += '
|
|
219
|
+
if (props.isSelected) rules += ' iBGbjub12';
|
|
220
|
+
else rules += ' iA12';
|
|
221
221
|
}
|
|
222
|
-
if (props.isDetached) rules += '
|
|
223
|
-
if (props.isDetached) rules += '
|
|
224
|
-
if (props.isDetached) rules += '
|
|
225
|
-
if (props.isDetached) rules += '
|
|
226
|
-
if (props.isDetached) rules += '
|
|
227
|
-
if (props.isDetached) rules += '
|
|
228
|
-
if (props.isDetached) rules += '
|
|
229
|
-
if (props.isDetached) rules += '
|
|
230
|
-
if (props.isDetached) rules += '
|
|
222
|
+
if (props.isDetached) rules += ' _kb12';
|
|
223
|
+
if (props.isDetached) rules += ' hb12';
|
|
224
|
+
if (props.isDetached) rules += ' mb12';
|
|
225
|
+
if (props.isDetached) rules += ' lb12';
|
|
226
|
+
if (props.isDetached) rules += ' ob12';
|
|
227
|
+
if (props.isDetached) rules += ' nb12';
|
|
228
|
+
if (props.isDetached) rules += ' kb12';
|
|
229
|
+
if (props.isDetached) rules += ' jb12';
|
|
230
|
+
if (props.isDetached) rules += ' _jf12';
|
|
231
231
|
return rules;
|
|
232
232
|
};
|
|
233
|
-
const $03960a2740ca2b19$var$treeCheckbox = "
|
|
234
|
-
const $03960a2740ca2b19$var$treeIcon = "
|
|
235
|
-
const $03960a2740ca2b19$var$treeContent = "
|
|
236
|
-
const $03960a2740ca2b19$var$treeActions = "
|
|
237
|
-
const $03960a2740ca2b19$var$treeActionMenu = "
|
|
233
|
+
const $03960a2740ca2b19$var$treeCheckbox = " zoRzcu12 yoRzcu12 BoRzcu12 AoRzcu12 Ix12 Hy12 Rd12";
|
|
234
|
+
const $03960a2740ca2b19$var$treeIcon = " z2U5Crc12 y2U5Crc12 B2U5Crc12 A2U5Crc12 Ht12 Hsu12 -_8sjo0b-t5ZbAob12";
|
|
235
|
+
const $03960a2740ca2b19$var$treeContent = " zk52g2d12 yk52g2d12 Bk52g2d12 Ak52g2d12 _Yb12 _7c12 _Nc12 Pc12";
|
|
236
|
+
const $03960a2740ca2b19$var$treeActions = " zkG38H12 ykG38H12 BkG38H12 AkG38H12 Ir12 Hs12";
|
|
237
|
+
const $03960a2740ca2b19$var$treeActionMenu = " z6Nrfjc12 y6Nrfjc12 B6Nrfjc12 A6Nrfjc12";
|
|
238
238
|
const $03960a2740ca2b19$var$cellFocus = {
|
|
239
239
|
outlineStyle: {
|
|
240
240
|
default: 'none',
|
|
@@ -288,7 +288,7 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props1)=>{
|
|
|
288
288
|
})
|
|
289
289
|
}),
|
|
290
290
|
/*#__PURE__*/ (0, $iOVFT$jsx)("div", {
|
|
291
|
-
className: "
|
|
291
|
+
className: " z7fSmKc12 y7fSmKc12 B7fSmKc12 A7fSmKc12 ZecPNad12"
|
|
292
292
|
}),
|
|
293
293
|
/*#__PURE__*/ (0, $iOVFT$jsx)($03960a2740ca2b19$var$ExpandableRowChevron, {
|
|
294
294
|
isDisabled: isDisabled,
|
|
@@ -311,7 +311,7 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props1)=>{
|
|
|
311
311
|
slot: 'icon',
|
|
312
312
|
styles: $03960a2740ca2b19$var$treeIcon
|
|
313
313
|
}),
|
|
314
|
-
styles: "
|
|
314
|
+
styles: " ZuUmpre12 FuUmpre12 _va12"
|
|
315
315
|
}
|
|
316
316
|
],
|
|
317
317
|
[
|
|
@@ -328,26 +328,28 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props1)=>{
|
|
|
328
328
|
}
|
|
329
329
|
]
|
|
330
330
|
],
|
|
331
|
-
children: children
|
|
331
|
+
children: typeof children === 'string' ? /*#__PURE__*/ (0, $iOVFT$jsx)((0, $8e847109a6ab556d$export$5f1af8db9871e1d6), {
|
|
332
|
+
children: children
|
|
333
|
+
}) : children
|
|
332
334
|
}),
|
|
333
335
|
isFocusVisible && isDetached && /*#__PURE__*/ (0, $iOVFT$jsx)("div", {
|
|
334
336
|
role: "presentation",
|
|
335
337
|
className: function anonymous(props) {
|
|
336
338
|
let rules = " ";
|
|
337
|
-
if (props.isFocusVisible) rules += '
|
|
338
|
-
else rules += '
|
|
339
|
-
rules += '
|
|
340
|
-
rules += '
|
|
341
|
-
rules += '
|
|
342
|
-
rules += '
|
|
343
|
-
rules += '
|
|
344
|
-
rules += '
|
|
345
|
-
rules += '
|
|
346
|
-
rules += '
|
|
347
|
-
rules += '
|
|
348
|
-
rules += '
|
|
349
|
-
rules += '
|
|
350
|
-
rules += '
|
|
339
|
+
if (props.isFocusVisible) rules += ' _Lf12';
|
|
340
|
+
else rules += ' _Le12';
|
|
341
|
+
rules += ' _Kb12';
|
|
342
|
+
rules += ' _Mc12';
|
|
343
|
+
rules += ' Oh12';
|
|
344
|
+
rules += ' of12';
|
|
345
|
+
rules += ' nf12';
|
|
346
|
+
rules += ' kf12';
|
|
347
|
+
rules += ' jf12';
|
|
348
|
+
rules += ' _Pa12';
|
|
349
|
+
rules += ' Wr12';
|
|
350
|
+
rules += ' _lr12';
|
|
351
|
+
rules += ' _Ar12';
|
|
352
|
+
rules += ' _zr12';
|
|
351
353
|
return rules;
|
|
352
354
|
}({
|
|
353
355
|
isFocusVisible: true
|
|
@@ -358,7 +360,7 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props1)=>{
|
|
|
358
360
|
}
|
|
359
361
|
});
|
|
360
362
|
};
|
|
361
|
-
const $03960a2740ca2b19$var$centeredWrapper = "
|
|
363
|
+
const $03960a2740ca2b19$var$centeredWrapper = " sd12 eb12 _Ca12 Za12 Fb12";
|
|
362
364
|
const $03960a2740ca2b19$export$6ceebe2a029205c = (props)=>{
|
|
363
365
|
let { loadingState: loadingState, onLoadMore: onLoadMore } = props;
|
|
364
366
|
let stringFormatter = (0, $iOVFT$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iOVFT$intlStringsmjs))), '@react-spectrum/s2');
|
|
@@ -366,7 +368,7 @@ const $03960a2740ca2b19$export$6ceebe2a029205c = (props)=>{
|
|
|
366
368
|
return /*#__PURE__*/ (0, $iOVFT$jsx)((0, $iOVFT$TreeLoadMoreItem), {
|
|
367
369
|
isLoading: isLoading,
|
|
368
370
|
onLoadMore: onLoadMore,
|
|
369
|
-
className: "
|
|
371
|
+
className: " Za12 Js12 Gs12",
|
|
370
372
|
children: ()=>{
|
|
371
373
|
return /*#__PURE__*/ (0, $iOVFT$jsx)("div", {
|
|
372
374
|
className: $03960a2740ca2b19$var$centeredWrapper,
|
|
@@ -380,37 +382,37 @@ const $03960a2740ca2b19$export$6ceebe2a029205c = (props)=>{
|
|
|
380
382
|
};
|
|
381
383
|
const $03960a2740ca2b19$var$expandButton = function anonymous(props) {
|
|
382
384
|
let rules = " ";
|
|
383
|
-
rules += '
|
|
384
|
-
rules += '
|
|
385
|
-
rules += '
|
|
386
|
-
rules += '
|
|
385
|
+
rules += ' z8dW5Qb12';
|
|
386
|
+
rules += ' y8dW5Qb12';
|
|
387
|
+
rules += ' B8dW5Qb12';
|
|
388
|
+
rules += ' A8dW5Qb12';
|
|
387
389
|
if (props.isDisabled) {
|
|
388
|
-
rules += '
|
|
389
|
-
rules += '
|
|
390
|
-
} else rules += '
|
|
391
|
-
rules += '
|
|
392
|
-
rules += '
|
|
393
|
-
rules += '
|
|
394
|
-
rules += '
|
|
395
|
-
rules += '
|
|
396
|
-
rules += '
|
|
397
|
-
rules += '
|
|
398
|
-
rules += '
|
|
390
|
+
rules += ' pp12';
|
|
391
|
+
rules += ' plc12';
|
|
392
|
+
} else rules += ' p40ub4c12';
|
|
393
|
+
rules += ' Fv12';
|
|
394
|
+
rules += ' Zw12';
|
|
395
|
+
rules += ' sd12';
|
|
396
|
+
rules += ' _wb12';
|
|
397
|
+
rules += ' _cb12';
|
|
398
|
+
rules += ' _Ca12';
|
|
399
|
+
rules += ' _Le12';
|
|
400
|
+
rules += ' ri12';
|
|
399
401
|
if (props.isExpanded) {
|
|
400
|
-
if (props.isRTL) rules += '
|
|
401
|
-
else rules += '
|
|
402
|
+
if (props.isRTL) rules += ' _Za12';
|
|
403
|
+
else rules += ' _Zb12';
|
|
402
404
|
}
|
|
403
|
-
rules += '
|
|
404
|
-
rules += '
|
|
405
|
-
rules += '
|
|
406
|
-
rules += '
|
|
407
|
-
rules += '
|
|
408
|
-
rules += '
|
|
409
|
-
rules += '
|
|
410
|
-
rules += '
|
|
411
|
-
rules += '
|
|
412
|
-
rules += '
|
|
413
|
-
if (props.isHidden) rules += '
|
|
405
|
+
rules += ' Td12';
|
|
406
|
+
rules += ' Qd12';
|
|
407
|
+
rules += ' Sd12';
|
|
408
|
+
rules += ' Rd12';
|
|
409
|
+
rules += ' Yd12';
|
|
410
|
+
rules += ' Xb12';
|
|
411
|
+
rules += ' _2b12';
|
|
412
|
+
rules += ' g912';
|
|
413
|
+
rules += ' _je12';
|
|
414
|
+
rules += ' __ca12';
|
|
415
|
+
if (props.isHidden) rules += ' _6b12';
|
|
414
416
|
return rules;
|
|
415
417
|
};
|
|
416
418
|
function $03960a2740ca2b19$var$ExpandableRowChevron(props1) {
|
|
@@ -436,20 +438,20 @@ function $03960a2740ca2b19$var$ExpandableRowChevron(props1) {
|
|
|
436
438
|
className: function anonymous(props) {
|
|
437
439
|
let rules = " ";
|
|
438
440
|
if (props.direction === "rtl") {
|
|
439
|
-
rules += ' -Z4Pn4c-
|
|
440
|
-
rules += '
|
|
441
|
+
rules += ' -Z4Pn4c-a12';
|
|
442
|
+
rules += ' __Ha12';
|
|
441
443
|
} else if (props.direction === "ltr") {
|
|
442
|
-
rules += ' -Z4Pn4c-
|
|
443
|
-
rules += '
|
|
444
|
+
rules += ' -Z4Pn4c-b12';
|
|
445
|
+
rules += ' __Ha12';
|
|
444
446
|
}
|
|
445
447
|
if (props.direction === "rtl") {
|
|
446
|
-
rules += ' -_04Pn4c-
|
|
447
|
-
rules += '
|
|
448
|
+
rules += ' -_04Pn4c-a12';
|
|
449
|
+
rules += ' __Ha12';
|
|
448
450
|
} else if (props.direction === "ltr") {
|
|
449
|
-
rules += ' -_04Pn4c-
|
|
450
|
-
rules += '
|
|
451
|
+
rules += ' -_04Pn4c-b12';
|
|
452
|
+
rules += ' __Ha12';
|
|
451
453
|
}
|
|
452
|
-
rules += ' -_8sjo0b-
|
|
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IAAI,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAG;IACjC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,+CAAW,GAAG;IAChE,IAAI,YAAY,iBAAiB,aAAa,iBAAiB;IAC/D,qBACE,gBAAC,CAAA,GAAA,uBAAe;QAAE,WAAW;QAAW,YAAY;QAAY,SAAS;kBACtE;YACC,qBACE,gBAAC;gBAAI,WAAW;0BACd,cAAA,gBAAC,CAAA,GAAA,yCAAa;oBACZ,eAAe;oBACf,cAAY,gBAAgB,MAAM,CAAC;;;QAG3C;;AAGN;AAUA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCN,SAAS,2CAAqB,MAAgC;IAC5D,IAAI,kBAAkB,CAAA,GAAA,aAAK,EAAqB;IAChD,IAAI,CAAC,WAAW,IAAI,GAAG,CAAA,GAAA,sBAAc,EAAE;QAAC,GAAG,MAAK;QAAE,MAAM;IAAS,GAAG,iBAAiB,CAAA,GAAA,oBAAY;IACjG,IAAI,cAAC,UAAU,SAAE,KAAK,YAAE,QAAQ,EAAC,GAAG;IACpC,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAE1B,qBACE,gBAAC,CAAA,GAAA,aAAK;QACH,GAAG,MAAK;QACT,KAAK;QACL,MAAK;QACL,WAAW,CAAA,cAAe,mCAAa;gBAAC,GAAG,WAAW;4BAAE;gBAAY,OAAO,cAAc;uBAAO;0BAAO;YAAQ;kBAC/G,cAAA,gBAAC,CAAA,GAAA,wCAAM;YACL,WAAW;;;;;;;;;;;;;;;;;;cAWR;2BAAC;YAAS;;;AAGrB","sources":["packages/@react-spectrum/s2/src/TreeView.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 {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {ActionMenuContext} from './ActionMenu';\nimport {\n Button,\n ButtonContext,\n ListLayout,\n Provider,\n TreeItemProps as RACTreeItemProps,\n TreeProps as RACTreeProps,\n Tree,\n TreeItem,\n TreeItemContent,\n TreeItemContentProps,\n TreeLoadMoreItem,\n TreeLoadMoreItemProps,\n useContextProps,\n Virtualizer\n} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Checkbox} from './Checkbox';\nimport Chevron from '../ui-icons/Chevron';\nimport {colorMix, focusRing, fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {DOMRef, forwardRefType, GlobalDOMAttributes, Key, LoadingState} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ProgressCircle} from './ProgressCircle';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, JSXElementConstructor, ReactElement, ReactNode, useContext, useRef} from 'react';\nimport {TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocale, useLocalizedStringFormatter} from 'react-aria';\nimport {useScale} from './utils';\n\ninterface S2TreeProps {\n // Only detatched is supported right now with the current styles from Spectrum\n // See https://github.com/adobe/react-spectrum/pull/7343 for what remaining combinations are left\n /** Whether the tree should be displayed with a [detached style](https://spectrum.adobe.com/page/tree-view/#Detached). */\n isDetached?: boolean,\n /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void,\n /** Whether the tree should be displayed with a [emphasized style](https://spectrum.adobe.com/page/tree-view/#Emphasis). */\n isEmphasized?: boolean\n}\n\nexport interface TreeViewProps<T> extends Omit<RACTreeProps<T>, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks' | keyof GlobalDOMAttributes>, UnsafeStyles, S2TreeProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nexport interface TreeViewItemProps extends Omit<RACTreeItemProps, 'className' | 'style' | 'onClick' | keyof GlobalDOMAttributes> {\n /** Whether this item has children, even if not loaded yet. */\n hasChildItems?: boolean\n}\n\nexport interface TreeViewLoadMoreItemProps extends Pick<TreeLoadMoreItemProps, 'onLoadMore'> {\n /** The current loading state of the TreeView or TreeView row. */\n loadingState?: LoadingState\n}\n\ninterface TreeRendererContextValue {\n renderer?: (item) => ReactElement<any, string | JSXElementConstructor<any>>\n}\nconst TreeRendererContext = createContext<TreeRendererContextValue>({});\n\n\nlet InternalTreeContext = createContext<{isDetached?: boolean, isEmphasized?: boolean}>({});\n\n// TODO: the below is needed so the borders of the top and bottom row isn't cut off if the TreeView is wrapped within a container by always reserving the 2px needed for the\n// keyboard focus ring. Perhaps find a different way of rendering the outlines since the top of the item doesn't\n// scroll into view due to how the ring is offset. Alternatively, have the tree render the top/bottom outline like it does in Listview\nconst tree = style({\n ...focusRing(),\n outlineOffset: -2, // make certain we are visible inside overflow hidden containers\n userSelect: 'none',\n minHeight: 0,\n minWidth: 0,\n width: 'full',\n height: 'full',\n overflow: 'auto',\n boxSizing: 'border-box',\n justifyContent: {\n isEmpty: 'center'\n },\n alignItems: {\n isEmpty: 'center'\n },\n '--indent': {\n type: 'width',\n value: 16\n }\n}, getAllowedOverrides({height: true}));\n\n/**\n * A tree view provides users with a way to navigate nested hierarchical information.\n */\nexport const TreeView = /*#__PURE__*/ (forwardRef as forwardRefType)(function TreeView<T extends object>(props: TreeViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {children, isDetached, isEmphasized, UNSAFE_className, UNSAFE_style} = props;\n let scale = useScale();\n\n let renderer;\n if (typeof children === 'function') {\n renderer = children;\n }\n\n let domRef = useDOMRef(ref);\n\n return (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight: scale === 'large' ? 50 : 40,\n gap: isDetached ? 2 : 0\n }}>\n <TreeRendererContext.Provider value={{renderer}}>\n <InternalTreeContext.Provider value={{isDetached, isEmphasized}}>\n <Tree\n {...props}\n style={UNSAFE_style}\n className={renderProps => (UNSAFE_className ?? '') + tree({isDetached, ...renderProps}, props.styles)}\n selectionBehavior=\"toggle\"\n ref={domRef}>\n {props.children}\n </Tree>\n </InternalTreeContext.Provider>\n </TreeRendererContext.Provider>\n </Virtualizer>\n );\n});\n\nconst selectedBackground = lightDark(colorMix('gray-25', 'informative-900', 10), colorMix('gray-25', 'informative-700', 10));\nconst selectedActiveBackground = lightDark(colorMix('gray-25', 'informative-900', 15), colorMix('gray-25', 'informative-700', 15));\n\nconst rowBackgroundColor = {\n default: '--s2-container-bg',\n isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7),\n isHovered: colorMix('gray-25', 'gray-900', 7),\n isPressed: colorMix('gray-25', 'gray-900', 10),\n isSelected: {\n default: colorMix('gray-25', 'gray-900', 7),\n isEmphasized: selectedBackground,\n isFocusVisibleWithin: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n },\n isHovered: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n },\n isPressed: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n }\n },\n forcedColors: {\n default: 'Background'\n }\n} as const;\n\nconst treeRow = style({\n position: 'relative',\n display: 'flex',\n height: 40,\n width: 'full',\n boxSizing: 'border-box',\n font: 'ui',\n color: 'body',\n outlineStyle: 'none',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--rowBackgroundColor': {\n type: 'backgroundColor',\n value: rowBackgroundColor\n },\n '--rowFocusIndicatorColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n }\n});\n\nconst treeCellGrid = style({\n display: 'grid',\n width: 'full',\n height: 'full',\n boxSizing: 'border-box',\n alignContent: 'center',\n alignItems: 'center',\n gridTemplateColumns: ['auto', 'auto', 'auto', 'auto', 'auto', '1fr', 'minmax(0, auto)', 'auto'],\n gridTemplateRows: '1fr',\n gridTemplateAreas: [\n 'drag-handle checkbox level-padding expand-button icon content actions actionmenu'\n ],\n backgroundColor: '--rowBackgroundColor',\n paddingEnd: 4, // account for any focus rings on the last item in the cell\n color: {\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n },\n '--rowSelectedBorderColor': {\n type: 'outlineColor',\n value: {\n default: 'gray-800',\n isFocusVisible: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n '--rowForcedFocusBorderColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n borderColor: {\n isDetached: {\n default: 'transparent',\n isSelected: '--rowSelectedBorderColor'\n }\n },\n borderWidth: {\n isDetached: 1\n },\n borderRadius: {\n isDetached: 'default'\n },\n borderStyle: {\n isDetached: 'solid'\n }\n});\n\nconst treeCheckbox = style({\n gridArea: 'checkbox',\n marginStart: 12,\n marginEnd: 0,\n paddingEnd: 0\n});\n\nconst treeIcon = style({\n gridArea: 'icon',\n marginEnd: 'text-to-visual',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst treeContent = style({\n gridArea: 'content',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n});\n\nconst treeActions = style({\n gridArea: 'actions',\n /* TODO: I made this one up, confirm desired behavior. These paddings are to make sure the action group has enough padding for the focus ring */\n marginStart: 2,\n marginEnd: 4\n});\n\nconst treeActionMenu = style({\n gridArea: 'actionmenu'\n});\n\nconst cellFocus = {\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineOffset: -2,\n outlineWidth: 2,\n outlineColor: 'focus-ring',\n borderRadius: '[6px]'\n} as const;\n\nconst treeRowFocusIndicator = raw(`\n &:before {\n content: \"\";\n display: inline-block;\n position: sticky;\n inset-inline-start: 0;\n width: 3px;\n height: 100%;\n margin-inline-end: -3px;\n margin-block-end: 1px;\n z-index: 3;\n background-color: var(--rowFocusIndicatorColor);\n }`\n);\n\nexport const TreeViewItem = (props: TreeViewItemProps): ReactNode => {\n let {\n href\n } = props;\n let {isDetached, isEmphasized} = useContext(InternalTreeContext);\n\n return (\n <TreeItem\n {...props}\n className={(renderProps) => treeRow({\n ...renderProps,\n isLink: !!href, isEmphasized\n }) + (renderProps.isFocusVisible && !isDetached ? ' ' + treeRowFocusIndicator : '')} />\n );\n};\n\nexport interface TreeViewItemContentProps extends Omit<TreeItemContentProps, 'children'> {\n /** Rendered contents of the tree item or child items. */\n children: ReactNode\n}\n\nexport const TreeViewItemContent = (props: TreeViewItemContentProps): ReactNode => {\n let {\n children\n } = props;\n let {isDetached, isEmphasized} = useContext(InternalTreeContext);\n let scale = useScale();\n\n return (\n <TreeItemContent>\n {({isExpanded, hasChildItems, selectionMode, selectionBehavior, isDisabled, isFocusVisible, isSelected, id, state}) => {\n let isNextSelected = false;\n let isNextFocused = false;\n let keyAfter = state.collection.getKeyAfter(id);\n if (keyAfter != null) {\n isNextSelected = state.selectionManager.isSelected(keyAfter);\n }\n let isFirst = state.collection.getFirstKey() === id;\n return (\n <div className={treeCellGrid({isDisabled, isNextSelected, isSelected, isFirst, isNextFocused, isDetached})}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n // TODO: add transition?\n <div className={treeCheckbox}>\n <Checkbox\n isEmphasized={isEmphasized}\n slot=\"selection\" />\n </div>\n )}\n <div\n className={style({\n gridArea: 'level-padding',\n width: 'calc(calc(var(--tree-item-level, 0) - 1) * var(--indent))'\n })} />\n <ExpandableRowChevron isDisabled={isDisabled} isExpanded={isExpanded} scale={scale} isHidden={!(hasChildItems)} />\n <Provider\n values={[\n [TextContext, {styles: treeContent}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: treeIcon}),\n styles: style({size: fontRelative(20), flexShrink: 0})\n }],\n [ActionButtonGroupContext, {styles: treeActions}],\n [ActionMenuContext, {styles: treeActionMenu, isQuiet: true}]\n ]}>\n {children}\n </Provider>\n {isFocusVisible && isDetached && <div role=\"presentation\" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible: true})} />}\n </div>\n );\n }}\n </TreeItemContent>\n );\n};\n\nconst centeredWrapper = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 'full',\n height: 'full'\n});\n\nexport const TreeViewLoadMoreItem = (props: TreeViewLoadMoreItemProps): ReactNode => {\n let {loadingState, onLoadMore} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n return (\n <TreeLoadMoreItem isLoading={isLoading} onLoadMore={onLoadMore} className={style({width: 'full', marginY: 4})}>\n {() => {\n return (\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loadingMore')} />\n </div>\n );\n }}\n </TreeLoadMoreItem>\n );\n};\n\ninterface ExpandableRowChevronProps {\n isExpanded?: boolean,\n isDisabled?: boolean,\n isRTL?: boolean,\n scale: 'medium' | 'large',\n isHidden?: boolean\n}\n\nconst expandButton = style<ExpandableRowChevronProps>({\n gridArea: 'expand-button',\n color: {\n default: 'inherit',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n height: 40,\n width: 40,\n display: 'flex',\n flexWrap: 'wrap',\n alignContent: 'center',\n justifyContent: 'center',\n outlineStyle: 'none',\n cursor: 'default',\n transform: {\n isExpanded: {\n default: 'rotate(90deg)',\n isRTL: 'rotate(-90deg)'\n }\n },\n padding: 0,\n transition: 'default',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n disableTapHighlight: true,\n visibility: {\n isHidden: 'hidden'\n }\n});\n\nfunction ExpandableRowChevron(props: ExpandableRowChevronProps) {\n let expandButtonRef = useRef<HTMLButtonElement>(null);\n let [fullProps, ref] = useContextProps({...props, slot: 'chevron'}, expandButtonRef, ButtonContext);\n let {isExpanded, scale, isHidden} = fullProps;\n let {direction} = useLocale();\n\n return (\n <Button\n {...props}\n ref={ref}\n slot=\"chevron\"\n className={renderProps => expandButton({...renderProps, isExpanded, isRTL: direction === 'rtl', scale, isHidden})}>\n <Chevron\n className={style({\n scale: {\n direction: {\n ltr: '1',\n rtl: '-1'\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })({direction})} />\n </Button>\n );\n}\n"],"names":[],"version":3,"file":"TreeView.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AAkED,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA4B,CAAC;AAGrE,IAAI,0DAAsB,CAAA,GAAA,oBAAY,EAAkD,CAAC;AAEzF,4KAA4K;AAC5K,gHAAgH;AAChH,sIAAsI;AACtI,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBC,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAA2B,KAAuB,EAAE,GAA2B;IAC3J,IAAI,YAAC,QAAQ,cAAE,UAAU,gBAAE,YAAY,oBAAE,gBAAgB,gBAAE,YAAY,EAAC,GAAG;IAC3E,IAAI,QAAQ,CAAA,GAAA,yCAAO;IAEnB,IAAI;IACJ,IAAI,OAAO,aAAa,YACtB,WAAW;IAGb,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gBAAC,CAAA,GAAA,kBAAU;QACT,QAAQ,CAAA,GAAA,iBAAS;QACjB,eAAe;YACb,WAAW,UAAU,UAAU,KAAK;YACpC,KAAK,aAAa,IAAI;QACxB;kBACA,cAAA,gBAAC,0CAAoB,QAAQ;YAAC,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WAAW;4BAAE;gBAAY,OAAO,cAAc;uBAAO;0BAAO;YAAQ;kBAC/G,cAAA,gBAAC,CAAA,GAAA,wCAAM;YACL,WAAW;;;;;;;;;;;;;;;;;;cAWR;2BAAC;YAAS;;;AAGrB","sources":["packages/@react-spectrum/s2/src/TreeView.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 {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {ActionMenuContext} from './ActionMenu';\nimport {\n Button,\n ButtonContext,\n ListLayout,\n Provider,\n TreeItemProps as RACTreeItemProps,\n TreeProps as RACTreeProps,\n Tree,\n TreeItem,\n TreeItemContent,\n TreeItemContentProps,\n TreeLoadMoreItem,\n TreeLoadMoreItemProps,\n useContextProps,\n Virtualizer\n} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Checkbox} from './Checkbox';\nimport Chevron from '../ui-icons/Chevron';\nimport {colorMix, focusRing, fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {DOMRef, forwardRefType, GlobalDOMAttributes, Key, LoadingState} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ProgressCircle} from './ProgressCircle';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, JSXElementConstructor, ReactElement, ReactNode, useContext, useRef} from 'react';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocale, useLocalizedStringFormatter} from 'react-aria';\nimport {useScale} from './utils';\n\ninterface S2TreeProps {\n // Only detatched is supported right now with the current styles from Spectrum\n // See https://github.com/adobe/react-spectrum/pull/7343 for what remaining combinations are left\n /** Whether the tree should be displayed with a [detached style](https://spectrum.adobe.com/page/tree-view/#Detached). */\n isDetached?: boolean,\n /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void,\n /** Whether the tree should be displayed with a [emphasized style](https://spectrum.adobe.com/page/tree-view/#Emphasis). */\n isEmphasized?: boolean\n}\n\nexport interface TreeViewProps<T> extends Omit<RACTreeProps<T>, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks' | keyof GlobalDOMAttributes>, UnsafeStyles, S2TreeProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nexport interface TreeViewItemProps extends Omit<RACTreeItemProps, 'className' | 'style' | 'onClick' | keyof GlobalDOMAttributes> {\n /** Whether this item has children, even if not loaded yet. */\n hasChildItems?: boolean\n}\n\nexport interface TreeViewLoadMoreItemProps extends Pick<TreeLoadMoreItemProps, 'onLoadMore'> {\n /** The current loading state of the TreeView or TreeView row. */\n loadingState?: LoadingState\n}\n\ninterface TreeRendererContextValue {\n renderer?: (item) => ReactElement<any, string | JSXElementConstructor<any>>\n}\nconst TreeRendererContext = createContext<TreeRendererContextValue>({});\n\n\nlet InternalTreeContext = createContext<{isDetached?: boolean, isEmphasized?: boolean}>({});\n\n// TODO: the below is needed so the borders of the top and bottom row isn't cut off if the TreeView is wrapped within a container by always reserving the 2px needed for the\n// keyboard focus ring. Perhaps find a different way of rendering the outlines since the top of the item doesn't\n// scroll into view due to how the ring is offset. Alternatively, have the tree render the top/bottom outline like it does in Listview\nconst tree = style({\n ...focusRing(),\n outlineOffset: -2, // make certain we are visible inside overflow hidden containers\n userSelect: 'none',\n minHeight: 0,\n minWidth: 0,\n width: 'full',\n height: 'full',\n overflow: 'auto',\n boxSizing: 'border-box',\n justifyContent: {\n isEmpty: 'center'\n },\n alignItems: {\n isEmpty: 'center'\n },\n '--indent': {\n type: 'width',\n value: 16\n }\n}, getAllowedOverrides({height: true}));\n\n/**\n * A tree view provides users with a way to navigate nested hierarchical information.\n */\nexport const TreeView = /*#__PURE__*/ (forwardRef as forwardRefType)(function TreeView<T extends object>(props: TreeViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {children, isDetached, isEmphasized, UNSAFE_className, UNSAFE_style} = props;\n let scale = useScale();\n\n let renderer;\n if (typeof children === 'function') {\n renderer = children;\n }\n\n let domRef = useDOMRef(ref);\n\n return (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight: scale === 'large' ? 50 : 40,\n gap: isDetached ? 2 : 0\n }}>\n <TreeRendererContext.Provider value={{renderer}}>\n <InternalTreeContext.Provider value={{isDetached, isEmphasized}}>\n <Tree\n {...props}\n style={UNSAFE_style}\n className={renderProps => (UNSAFE_className ?? '') + tree({isDetached, ...renderProps}, props.styles)}\n selectionBehavior=\"toggle\"\n ref={domRef}>\n {props.children}\n </Tree>\n </InternalTreeContext.Provider>\n </TreeRendererContext.Provider>\n </Virtualizer>\n );\n});\n\nconst selectedBackground = lightDark(colorMix('gray-25', 'informative-900', 10), colorMix('gray-25', 'informative-700', 10));\nconst selectedActiveBackground = lightDark(colorMix('gray-25', 'informative-900', 15), colorMix('gray-25', 'informative-700', 15));\n\nconst rowBackgroundColor = {\n default: '--s2-container-bg',\n isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7),\n isHovered: colorMix('gray-25', 'gray-900', 7),\n isPressed: colorMix('gray-25', 'gray-900', 10),\n isSelected: {\n default: colorMix('gray-25', 'gray-900', 7),\n isEmphasized: selectedBackground,\n isFocusVisibleWithin: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n },\n isHovered: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n },\n isPressed: {\n default: colorMix('gray-25', 'gray-900', 10),\n isEmphasized: selectedActiveBackground\n }\n },\n forcedColors: {\n default: 'Background'\n }\n} as const;\n\nconst treeRow = style({\n position: 'relative',\n display: 'flex',\n height: 40,\n width: 'full',\n boxSizing: 'border-box',\n font: 'ui',\n color: 'body',\n outlineStyle: 'none',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--rowBackgroundColor': {\n type: 'backgroundColor',\n value: rowBackgroundColor\n },\n '--rowFocusIndicatorColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n }\n});\n\nconst treeCellGrid = style({\n display: 'grid',\n width: 'full',\n height: 'full',\n boxSizing: 'border-box',\n alignContent: 'center',\n alignItems: 'center',\n gridTemplateColumns: ['auto', 'auto', 'auto', 'auto', 'auto', '1fr', 'minmax(0, auto)', 'auto'],\n gridTemplateRows: '1fr',\n gridTemplateAreas: [\n 'drag-handle checkbox level-padding expand-button icon content actions actionmenu'\n ],\n backgroundColor: '--rowBackgroundColor',\n paddingEnd: 4, // account for any focus rings on the last item in the cell\n color: {\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n },\n '--rowSelectedBorderColor': {\n type: 'outlineColor',\n value: {\n default: 'gray-800',\n isFocusVisible: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n '--rowForcedFocusBorderColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n borderColor: {\n isDetached: {\n default: 'transparent',\n isSelected: '--rowSelectedBorderColor'\n }\n },\n borderWidth: {\n isDetached: 1\n },\n borderRadius: {\n isDetached: 'default'\n },\n borderStyle: {\n isDetached: 'solid'\n }\n});\n\nconst treeCheckbox = style({\n gridArea: 'checkbox',\n marginStart: 12,\n marginEnd: 0,\n paddingEnd: 0\n});\n\nconst treeIcon = style({\n gridArea: 'icon',\n marginEnd: 'text-to-visual',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst treeContent = style({\n gridArea: 'content',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n});\n\nconst treeActions = style({\n gridArea: 'actions',\n /* TODO: I made this one up, confirm desired behavior. These paddings are to make sure the action group has enough padding for the focus ring */\n marginStart: 2,\n marginEnd: 4\n});\n\nconst treeActionMenu = style({\n gridArea: 'actionmenu'\n});\n\nconst cellFocus = {\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineOffset: -2,\n outlineWidth: 2,\n outlineColor: 'focus-ring',\n borderRadius: '[6px]'\n} as const;\n\nconst treeRowFocusIndicator = raw(`\n &:before {\n content: \"\";\n display: inline-block;\n position: sticky;\n inset-inline-start: 0;\n width: 3px;\n height: 100%;\n margin-inline-end: -3px;\n margin-block-end: 1px;\n z-index: 3;\n background-color: var(--rowFocusIndicatorColor);\n }`\n);\n\nexport const TreeViewItem = (props: TreeViewItemProps): ReactNode => {\n let {\n href\n } = props;\n let {isDetached, isEmphasized} = useContext(InternalTreeContext);\n\n return (\n <TreeItem\n {...props}\n className={(renderProps) => treeRow({\n ...renderProps,\n isLink: !!href, isEmphasized\n }) + (renderProps.isFocusVisible && !isDetached ? ' ' + treeRowFocusIndicator : '')} />\n );\n};\n\nexport interface TreeViewItemContentProps extends Omit<TreeItemContentProps, 'children'> {\n /** Rendered contents of the tree item or child items. */\n children: ReactNode\n}\n\nexport const TreeViewItemContent = (props: TreeViewItemContentProps): ReactNode => {\n let {\n children\n } = props;\n let {isDetached, isEmphasized} = useContext(InternalTreeContext);\n let scale = useScale();\n\n return (\n <TreeItemContent>\n {({isExpanded, hasChildItems, selectionMode, selectionBehavior, isDisabled, isFocusVisible, isSelected, id, state}) => {\n let isNextSelected = false;\n let isNextFocused = false;\n let keyAfter = state.collection.getKeyAfter(id);\n if (keyAfter != null) {\n isNextSelected = state.selectionManager.isSelected(keyAfter);\n }\n let isFirst = state.collection.getFirstKey() === id;\n return (\n <div className={treeCellGrid({isDisabled, isNextSelected, isSelected, isFirst, isNextFocused, isDetached})}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n // TODO: add transition?\n <div className={treeCheckbox}>\n <Checkbox\n isEmphasized={isEmphasized}\n slot=\"selection\" />\n </div>\n )}\n <div\n className={style({\n gridArea: 'level-padding',\n width: 'calc(calc(var(--tree-item-level, 0) - 1) * var(--indent))'\n })} />\n <ExpandableRowChevron isDisabled={isDisabled} isExpanded={isExpanded} scale={scale} isHidden={!(hasChildItems)} />\n <Provider\n values={[\n [TextContext, {styles: treeContent}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: treeIcon}),\n styles: style({size: fontRelative(20), flexShrink: 0})\n }],\n [ActionButtonGroupContext, {styles: treeActions}],\n [ActionMenuContext, {styles: treeActionMenu, isQuiet: true}]\n ]}>\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n </Provider>\n {isFocusVisible && isDetached && <div role=\"presentation\" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible: true})} />}\n </div>\n );\n }}\n </TreeItemContent>\n );\n};\n\nconst centeredWrapper = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 'full',\n height: 'full'\n});\n\nexport const TreeViewLoadMoreItem = (props: TreeViewLoadMoreItemProps): ReactNode => {\n let {loadingState, onLoadMore} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n return (\n <TreeLoadMoreItem isLoading={isLoading} onLoadMore={onLoadMore} className={style({width: 'full', marginY: 4})}>\n {() => {\n return (\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loadingMore')} />\n </div>\n );\n }}\n </TreeLoadMoreItem>\n );\n};\n\ninterface ExpandableRowChevronProps {\n isExpanded?: boolean,\n isDisabled?: boolean,\n isRTL?: boolean,\n scale: 'medium' | 'large',\n isHidden?: boolean\n}\n\nconst expandButton = style<ExpandableRowChevronProps>({\n gridArea: 'expand-button',\n color: {\n default: 'inherit',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n height: 40,\n width: 40,\n display: 'flex',\n flexWrap: 'wrap',\n alignContent: 'center',\n justifyContent: 'center',\n outlineStyle: 'none',\n cursor: 'default',\n transform: {\n isExpanded: {\n default: 'rotate(90deg)',\n isRTL: 'rotate(-90deg)'\n }\n },\n padding: 0,\n transition: 'default',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n disableTapHighlight: true,\n visibility: {\n isHidden: 'hidden'\n }\n});\n\nfunction ExpandableRowChevron(props: ExpandableRowChevronProps) {\n let expandButtonRef = useRef<HTMLButtonElement>(null);\n let [fullProps, ref] = useContextProps({...props, slot: 'chevron'}, expandButtonRef, ButtonContext);\n let {isExpanded, scale, isHidden} = fullProps;\n let {direction} = useLocale();\n\n return (\n <Button\n {...props}\n ref={ref}\n slot=\"chevron\"\n className={renderProps => expandButton({...renderProps, isExpanded, isRTL: direction === 'rtl', scale, isHidden})}>\n <Chevron\n className={style({\n scale: {\n direction: {\n ltr: '1',\n rtl: '-1'\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })({direction})} />\n </Button>\n );\n}\n"],"names":[],"version":3,"file":"TreeView.mjs.map"}
|
package/dist/ar-AE.cjs
CHANGED
|
@@ -32,6 +32,11 @@ module.exports = {
|
|
|
32
32
|
"notificationbadge.indicatorOnly": `\u{646}\u{634}\u{627}\u{637} \u{62C}\u{62F}\u{64A}\u{62F}`,
|
|
33
33
|
"notificationbadge.plus": (args)=>`${args.notifications}+`,
|
|
34
34
|
"picker.placeholder": `\u{62A}\u{62D}\u{62F}\u{64A}\u{62F}\u{2026}`,
|
|
35
|
+
"picker.selectedCount": (args, formatter)=>`${formatter.plural(args.count, {
|
|
36
|
+
"=0": `\u{644}\u{645} \u{64A}\u{62A}\u{645} \u{62A}\u{62D}\u{62F}\u{64A}\u{62F} \u{639}\u{646}\u{627}\u{635}\u{631}`,
|
|
37
|
+
one: ()=>`${formatter.number(args.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`,
|
|
38
|
+
other: ()=>`${formatter.number(args.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`
|
|
39
|
+
})}`,
|
|
35
40
|
"slider.maximum": `\u{623}\u{642}\u{635}\u{649}`,
|
|
36
41
|
"slider.minimum": `\u{623}\u{62F}\u{646}\u{649}`,
|
|
37
42
|
"table.loading": `\u{62C}\u{627}\u{631}\u{64D} \u{627}\u{644}\u{62A}\u{62D}\u{645}\u{64A}\u{644}...`,
|