@react-spectrum/s2 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.cjs +3 -3
- package/dist/Accordion.cjs.map +1 -1
- package/dist/Accordion.css +2 -2
- package/dist/Accordion.css.map +1 -1
- package/dist/Accordion.mjs +3 -3
- package/dist/Accordion.mjs.map +1 -1
- package/dist/ActionBar.cjs +62 -61
- package/dist/ActionBar.cjs.map +1 -1
- package/dist/ActionBar.css +58 -58
- package/dist/ActionBar.css.map +1 -1
- package/dist/ActionBar.mjs +62 -61
- package/dist/ActionBar.mjs.map +1 -1
- package/dist/ActionButton.cjs +234 -234
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +160 -160
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +234 -234
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/ActionButtonGroup.cjs +16 -16
- package/dist/ActionButtonGroup.css +9 -9
- package/dist/ActionButtonGroup.mjs +16 -16
- package/dist/Add.cjs +10 -10
- package/dist/Add.css +6 -6
- package/dist/Add.mjs +10 -10
- package/dist/AlertDialog.cjs +3 -3
- package/dist/AlertDialog.css +3 -3
- package/dist/AlertDialog.mjs +3 -3
- package/dist/Asterisk.cjs +6 -6
- package/dist/Asterisk.css +4 -4
- package/dist/Asterisk.mjs +6 -6
- package/dist/Avatar.cjs +17 -17
- package/dist/Avatar.css +16 -16
- package/dist/Avatar.mjs +17 -17
- package/dist/AvatarGroup.cjs +121 -121
- package/dist/AvatarGroup.css +31 -31
- package/dist/AvatarGroup.mjs +121 -121
- package/dist/Badge.cjs +197 -197
- package/dist/Badge.css +125 -125
- package/dist/Badge.mjs +197 -197
- package/dist/Breadcrumbs.cjs +235 -235
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css +100 -100
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs +235 -235
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs +333 -333
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +174 -174
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +333 -333
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs +21 -21
- package/dist/ButtonGroup.css +15 -15
- package/dist/ButtonGroup.mjs +21 -21
- package/dist/Calendar.cjs +169 -169
- package/dist/Calendar.cjs.map +1 -1
- package/dist/Calendar.css +134 -134
- package/dist/Calendar.css.map +1 -1
- package/dist/Calendar.mjs +169 -169
- package/dist/Calendar.mjs.map +1 -1
- package/dist/Card.cjs +310 -310
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css +206 -206
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +310 -310
- package/dist/Card.mjs.map +1 -1
- package/dist/CardView.cjs +19 -19
- package/dist/CardView.cjs.map +1 -1
- package/dist/CardView.css +17 -17
- package/dist/CardView.css.map +1 -1
- package/dist/CardView.mjs +19 -19
- package/dist/CardView.mjs.map +1 -1
- package/dist/CenterBaseline.cjs +1 -1
- package/dist/CenterBaseline.css +2 -2
- package/dist/CenterBaseline.mjs +1 -1
- package/dist/Checkbox.cjs +162 -162
- package/dist/Checkbox.cjs.map +1 -1
- package/dist/Checkbox.css +95 -91
- package/dist/Checkbox.css.map +1 -1
- package/dist/Checkbox.mjs +162 -162
- package/dist/Checkbox.mjs.map +1 -1
- package/dist/CheckboxGroup.cjs +44 -44
- package/dist/CheckboxGroup.cjs.map +1 -1
- package/dist/CheckboxGroup.css +37 -37
- package/dist/CheckboxGroup.css.map +1 -1
- package/dist/CheckboxGroup.mjs +44 -44
- package/dist/CheckboxGroup.mjs.map +1 -1
- package/dist/Checkmark.cjs +12 -12
- package/dist/Checkmark.css +8 -8
- package/dist/Checkmark.mjs +12 -12
- package/dist/Chevron.cjs +12 -12
- package/dist/Chevron.css +10 -10
- package/dist/Chevron.mjs +12 -12
- package/dist/ClearButton.cjs +30 -30
- package/dist/ClearButton.css +30 -30
- package/dist/ClearButton.mjs +30 -30
- package/dist/CloseButton.cjs +56 -56
- package/dist/CloseButton.css +47 -47
- package/dist/CloseButton.mjs +56 -56
- package/dist/ColorArea.cjs +17 -17
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css +16 -16
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs +17 -17
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs +32 -32
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css +27 -27
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs +32 -32
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorHandle.cjs +27 -27
- package/dist/ColorHandle.css +42 -42
- package/dist/ColorHandle.mjs +27 -27
- package/dist/ColorSlider.cjs +109 -109
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css +52 -52
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs +109 -109
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs +30 -30
- package/dist/ColorSwatch.cjs.map +1 -1
- package/dist/ColorSwatch.css +29 -29
- package/dist/ColorSwatch.css.map +1 -1
- package/dist/ColorSwatch.mjs +30 -30
- package/dist/ColorSwatch.mjs.map +1 -1
- package/dist/ColorSwatchPicker.cjs +30 -30
- package/dist/ColorSwatchPicker.css +48 -48
- package/dist/ColorSwatchPicker.mjs +30 -30
- package/dist/ColorWheel.cjs +31 -27
- package/dist/ColorWheel.cjs.map +1 -1
- package/dist/ColorWheel.css +17 -17
- package/dist/ColorWheel.css.map +1 -1
- package/dist/ColorWheel.mjs +31 -27
- package/dist/ColorWheel.mjs.map +1 -1
- package/dist/ComboBox.cjs +383 -383
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +187 -187
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +383 -383
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +5 -5
- package/dist/ContextualHelp.css +50 -50
- package/dist/ContextualHelp.mjs +5 -5
- package/dist/Cross.cjs +14 -14
- package/dist/Cross.css +10 -10
- package/dist/Cross.mjs +14 -14
- package/dist/CustomDialog.cjs +26 -26
- package/dist/CustomDialog.cjs.map +1 -1
- package/dist/CustomDialog.css +25 -25
- package/dist/CustomDialog.css.map +1 -1
- package/dist/CustomDialog.mjs +26 -26
- package/dist/CustomDialog.mjs.map +1 -1
- package/dist/Dash.cjs +10 -10
- package/dist/Dash.css +6 -6
- package/dist/Dash.mjs +10 -10
- package/dist/DateField.cjs +74 -74
- package/dist/DateField.cjs.map +1 -1
- package/dist/DateField.css +77 -77
- package/dist/DateField.css.map +1 -1
- package/dist/DateField.mjs +74 -74
- package/dist/DateField.mjs.map +1 -1
- package/dist/DatePicker.cjs +173 -173
- package/dist/DatePicker.cjs.map +1 -1
- package/dist/DatePicker.css +128 -128
- package/dist/DatePicker.css.map +1 -1
- package/dist/DatePicker.mjs +173 -173
- package/dist/DatePicker.mjs.map +1 -1
- package/dist/DateRangePicker.cjs +56 -56
- package/dist/DateRangePicker.cjs.map +1 -1
- package/dist/DateRangePicker.css +59 -59
- package/dist/DateRangePicker.css.map +1 -1
- package/dist/DateRangePicker.mjs +56 -56
- package/dist/DateRangePicker.mjs.map +1 -1
- package/dist/Dialog.cjs +17 -17
- package/dist/Dialog.cjs.map +1 -1
- package/dist/Dialog.css +70 -70
- package/dist/Dialog.css.map +1 -1
- package/dist/Dialog.mjs +17 -17
- package/dist/Dialog.mjs.map +1 -1
- package/dist/Disclosure.cjs +120 -120
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +112 -112
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +120 -120
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs +26 -26
- package/dist/Divider.cjs.map +1 -1
- package/dist/Divider.css +25 -25
- package/dist/Divider.css.map +1 -1
- package/dist/Divider.mjs +26 -26
- package/dist/Divider.mjs.map +1 -1
- package/dist/DropZone.cjs +62 -62
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css +57 -57
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs +62 -62
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs +348 -348
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +147 -147
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs +348 -348
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +10 -10
- package/dist/Form.cjs.map +1 -1
- package/dist/Form.css +9 -9
- package/dist/Form.css.map +1 -1
- package/dist/Form.mjs +10 -10
- package/dist/Form.mjs.map +1 -1
- package/dist/FullscreenDialog.cjs +5 -5
- package/dist/FullscreenDialog.cjs.map +1 -1
- package/dist/FullscreenDialog.css +78 -78
- package/dist/FullscreenDialog.css.map +1 -1
- package/dist/FullscreenDialog.mjs +5 -5
- package/dist/FullscreenDialog.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs +229 -229
- package/dist/IllustratedMessage.css +72 -72
- package/dist/IllustratedMessage.mjs +229 -229
- package/dist/Image.cjs +14 -14
- package/dist/Image.css +14 -14
- package/dist/Image.mjs +14 -14
- package/dist/InlineAlert.cjs +101 -101
- package/dist/InlineAlert.css +76 -76
- package/dist/InlineAlert.mjs +101 -101
- package/dist/Link.cjs +50 -50
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.css +41 -41
- package/dist/Link.css.map +1 -1
- package/dist/Link.mjs +50 -50
- package/dist/Link.mjs.map +1 -1
- package/dist/LinkOut.cjs +8 -8
- package/dist/LinkOut.css +8 -8
- package/dist/LinkOut.mjs +8 -8
- package/dist/Menu.cjs +446 -443
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +184 -184
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +446 -443
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +154 -154
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css +91 -91
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs +154 -154
- package/dist/Meter.mjs.map +1 -1
- package/dist/Modal.cjs +66 -66
- package/dist/Modal.cjs.map +1 -1
- package/dist/Modal.css +54 -54
- package/dist/Modal.css.map +1 -1
- package/dist/Modal.mjs +66 -66
- package/dist/Modal.mjs.map +1 -1
- package/dist/NotificationBadge.cjs +57 -57
- package/dist/NotificationBadge.css +49 -49
- package/dist/NotificationBadge.mjs +57 -57
- package/dist/NumberField.cjs +115 -115
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css +99 -99
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs +115 -115
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +275 -275
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +173 -173
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +275 -275
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +89 -89
- package/dist/Popover.cjs.map +1 -1
- package/dist/Popover.css +70 -70
- package/dist/Popover.css.map +1 -1
- package/dist/Popover.mjs +89 -89
- package/dist/Popover.mjs.map +1 -1
- package/dist/ProgressBar.cjs +164 -164
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css +99 -99
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs +164 -164
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/ProgressCircle.cjs +32 -32
- package/dist/ProgressCircle.cjs.map +1 -1
- package/dist/ProgressCircle.css +24 -24
- package/dist/ProgressCircle.css.map +1 -1
- package/dist/ProgressCircle.mjs +32 -32
- package/dist/ProgressCircle.mjs.map +1 -1
- package/dist/Provider.cjs +11 -11
- package/dist/Provider.css +10 -10
- package/dist/Provider.mjs +11 -11
- package/dist/Radio.cjs +146 -146
- package/dist/Radio.cjs.map +1 -1
- package/dist/Radio.css +78 -78
- package/dist/Radio.css.map +1 -1
- package/dist/Radio.mjs +146 -146
- package/dist/Radio.mjs.map +1 -1
- package/dist/RadioGroup.cjs +42 -42
- package/dist/RadioGroup.cjs.map +1 -1
- package/dist/RadioGroup.css +37 -37
- package/dist/RadioGroup.css.map +1 -1
- package/dist/RadioGroup.mjs +42 -42
- package/dist/RadioGroup.mjs.map +1 -1
- package/dist/RangeCalendar.cjs +8 -8
- package/dist/RangeCalendar.cjs.map +1 -1
- package/dist/RangeCalendar.css +10 -10
- package/dist/RangeCalendar.css.map +1 -1
- package/dist/RangeCalendar.mjs +8 -8
- package/dist/RangeCalendar.mjs.map +1 -1
- package/dist/SearchField.cjs +42 -42
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css +45 -45
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs +42 -42
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +180 -180
- package/dist/SegmentedControl.css +123 -123
- package/dist/SegmentedControl.mjs +180 -180
- package/dist/SelectBoxGroup.cjs +144 -144
- package/dist/SelectBoxGroup.cjs.map +1 -1
- package/dist/SelectBoxGroup.css +120 -120
- package/dist/SelectBoxGroup.css.map +1 -1
- package/dist/SelectBoxGroup.mjs +144 -144
- package/dist/SelectBoxGroup.mjs.map +1 -1
- package/dist/Slider.cjs +295 -295
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css +154 -154
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs +295 -295
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs +116 -116
- package/dist/StatusLight.css +59 -59
- package/dist/StatusLight.mjs +116 -116
- package/dist/Switch.cjs +155 -155
- package/dist/Switch.cjs.map +1 -1
- package/dist/Switch.css +74 -74
- package/dist/Switch.css.map +1 -1
- package/dist/Switch.mjs +155 -155
- package/dist/Switch.mjs.map +1 -1
- package/dist/TableView.cjs +415 -415
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css +199 -199
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs +416 -416
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +127 -127
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +105 -105
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +127 -127
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TabsPicker.cjs +127 -127
- package/dist/TabsPicker.cjs.map +1 -1
- package/dist/TabsPicker.css +108 -108
- package/dist/TabsPicker.css.map +1 -1
- package/dist/TabsPicker.mjs +127 -127
- package/dist/TabsPicker.mjs.map +1 -1
- package/dist/TagGroup.cjs +204 -204
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css +146 -146
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +204 -204
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +59 -59
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css +54 -54
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs +59 -59
- package/dist/TextField.mjs.map +1 -1
- package/dist/TimeField.cjs +52 -52
- package/dist/TimeField.cjs.map +1 -1
- package/dist/TimeField.css +47 -47
- package/dist/TimeField.css.map +1 -1
- package/dist/TimeField.mjs +52 -52
- package/dist/TimeField.mjs.map +1 -1
- package/dist/Toast.cjs +120 -120
- package/dist/Toast.cjs.map +1 -1
- package/dist/Toast.css +110 -110
- package/dist/Toast.css.map +1 -1
- package/dist/Toast.mjs +120 -120
- package/dist/Toast.mjs.map +1 -1
- package/dist/ToggleButton.cjs +3 -3
- package/dist/ToggleButton.cjs.map +1 -1
- package/dist/ToggleButton.css +12 -12
- package/dist/ToggleButton.css.map +1 -1
- package/dist/ToggleButton.mjs +3 -3
- package/dist/ToggleButton.mjs.map +1 -1
- package/dist/ToggleButtonGroup.cjs.map +1 -1
- package/dist/ToggleButtonGroup.mjs.map +1 -1
- package/dist/Tooltip.cjs +78 -78
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css +65 -65
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +78 -78
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/TreeView.cjs +144 -128
- package/dist/TreeView.cjs.map +1 -1
- package/dist/TreeView.css +131 -127
- package/dist/TreeView.css.map +1 -1
- package/dist/TreeView.mjs +144 -128
- package/dist/TreeView.mjs.map +1 -1
- package/dist/types.d.ts +68 -72
- package/dist/types.d.ts.map +1 -1
- package/icons/Icon.cjs +12 -12
- package/icons/Icon.css +9 -9
- package/icons/Icon.mjs +12 -12
- package/icons/Skeleton.cjs +2 -2
- package/icons/Skeleton.cjs.map +1 -1
- package/icons/Skeleton.css +6 -6
- package/icons/Skeleton.mjs +2 -2
- package/icons/Skeleton.mjs.map +1 -1
- package/icons/runtime.cjs +16 -3
- package/icons/runtime.cjs.map +1 -1
- package/icons/runtime.mjs +16 -3
- package/icons/runtime.mjs.map +1 -1
- package/package.json +21 -21
- package/src/Accordion.tsx +1 -1
- package/src/ActionBar.tsx +2 -2
- package/src/ActionButton.tsx +1 -1
- package/src/Breadcrumbs.tsx +2 -2
- package/src/Button.tsx +2 -2
- package/src/Calendar.tsx +1 -1
- package/src/Card.tsx +1 -1
- package/src/CardView.tsx +1 -1
- package/src/Checkbox.tsx +2 -1
- package/src/CheckboxGroup.tsx +1 -1
- package/src/CoachMark.tsx +1 -1
- package/src/ColorArea.tsx +1 -1
- package/src/ColorField.tsx +1 -1
- package/src/ColorSlider.tsx +1 -1
- package/src/ColorSwatch.tsx +1 -1
- package/src/ColorWheel.tsx +2 -2
- package/src/ComboBox.tsx +2 -2
- package/src/CustomDialog.tsx +1 -1
- package/src/DateField.tsx +1 -1
- package/src/DatePicker.tsx +1 -1
- package/src/DateRangePicker.tsx +1 -1
- package/src/Dialog.tsx +1 -1
- package/src/Disclosure.tsx +2 -2
- package/src/Divider.tsx +1 -1
- package/src/DropZone.tsx +1 -1
- package/src/Field.tsx +3 -3
- package/src/Form.tsx +1 -1
- package/src/FullscreenDialog.tsx +1 -1
- package/src/Link.tsx +1 -1
- package/src/Menu.tsx +11 -13
- package/src/Meter.tsx +1 -1
- package/src/Modal.tsx +1 -1
- package/src/NumberField.tsx +1 -1
- package/src/Picker.tsx +3 -3
- package/src/Popover.tsx +2 -1
- package/src/ProgressBar.tsx +1 -1
- package/src/ProgressCircle.tsx +1 -1
- package/src/Radio.tsx +1 -1
- package/src/RadioGroup.tsx +1 -1
- package/src/RangeCalendar.tsx +1 -1
- package/src/SearchField.tsx +1 -1
- package/src/SelectBoxGroup.tsx +1 -1
- package/src/Slider.tsx +1 -1
- package/src/Switch.tsx +1 -1
- package/src/TableView.tsx +9 -9
- package/src/Tabs.tsx +4 -4
- package/src/TabsPicker.tsx +2 -2
- package/src/TagGroup.tsx +2 -2
- package/src/TextField.tsx +1 -1
- package/src/TimeField.tsx +1 -1
- package/src/Toast.tsx +1 -1
- package/src/ToggleButton.tsx +1 -1
- package/src/ToggleButtonGroup.tsx +1 -1
- package/src/Tooltip.tsx +1 -1
- package/src/TreeView.tsx +10 -6
- package/style/__tests__/mergeStyles.test.ts +68 -0
- package/style/__tests__/style-macro.test.js +79 -59
- package/style/dist/style-macro.cjs +65 -14
- package/style/dist/style-macro.cjs.map +1 -1
- package/style/dist/style-macro.mjs +65 -14
- package/style/dist/style-macro.mjs.map +1 -1
- package/style/runtime.ts +21 -5
- package/style/style-macro.ts +81 -16
- package/style/__tests__/mergeStyles.test.js +0 -32
package/dist/TreeView.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AC4Ea;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAwEG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;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\"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","/*\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 {baseColor, colorMix, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\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 {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, 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 /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void\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\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, 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 }}>\n <TreeRendererContext.Provider value={{renderer}}>\n <Tree\n {...props}\n style={UNSAFE_style}\n className={renderProps => (UNSAFE_className ?? '') + tree({...renderProps}, props.styles)}\n selectionBehavior=\"toggle\"\n ref={domRef}>\n {props.children}\n </Tree>\n </TreeRendererContext.Provider>\n </Virtualizer>\n );\n});\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 isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 10),\n isHovered: colorMix('gray-25', 'gray-900', 10),\n isPressed: colorMix('gray-25', 'gray-900', 10)\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: {\n default: baseColor('neutral-subdued'),\n isSelected: baseColor('neutral'),\n forcedColors: 'ButtonText'\n },\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});\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 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\n return (\n <TreeItem\n {...props}\n className={(renderProps) => treeRow({\n ...renderProps,\n isLink: !!href\n }) + (renderProps.isFocusVisible ? ' ' + 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 scale = useScale();\n\n return (\n <TreeItemContent>\n {({isExpanded, hasChildItems, selectionMode, selectionBehavior, isDisabled, 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})}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n // TODO: add transition?\n <div className={treeCheckbox}>\n <Checkbox 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 </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":"AC4Ea;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAwEG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;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-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","/*\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 {baseColor, colorMix, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\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 {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, 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 /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void\n}\n\nexport interface TreeViewProps<T> extends Omit<RACTreeProps<T>, 'style' | 'className' | 'render' | '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' | 'render' | '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\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, 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 }}>\n <TreeRendererContext.Provider value={{renderer}}>\n <Tree\n {...props}\n style={UNSAFE_style}\n className={renderProps => (UNSAFE_className ?? '') + tree({...renderProps}, props.styles)}\n selectionBehavior=\"toggle\"\n ref={domRef}>\n {props.children}\n </Tree>\n </TreeRendererContext.Provider>\n </Virtualizer>\n );\n});\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 isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 10),\n isHovered: colorMix('gray-25', 'gray-900', 10),\n isPressed: colorMix('gray-25', 'gray-900', 10)\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: {\n default: baseColor('neutral-subdued'),\n isSelected: baseColor('neutral'),\n forcedColors: 'ButtonText'\n },\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});\n\nconst treeCheckbox = style({\n gridArea: 'checkbox',\n marginStart: 12,\n marginEnd: 0,\n paddingEnd: 0,\n visibility: {\n default: 'visible',\n isDisabled: 'hidden'\n }\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 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\n return (\n <TreeItem\n {...props}\n className={(renderProps) => treeRow({\n ...renderProps,\n isLink: !!href\n }) + (renderProps.isFocusVisible ? ' ' + 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 scale = useScale();\n\n return (\n <TreeItemContent>\n {({isExpanded, hasChildItems, selectionMode, selectionBehavior, isDisabled, 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})}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n // TODO: add transition?\n <div className={treeCheckbox({isDisabled: isDisabled || !state.selectionManager.canSelectItem(id) || state.disabledKeys.has(id)})}>\n <Checkbox 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, isDisabled}],\n [ActionMenuContext, {styles: treeActionMenu, isQuiet: true, isDisabled}]\n ]}>\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n </Provider>\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
|
@@ -54,7 +54,7 @@ const $03960a2740ca2b19$var$tree = function anonymous(props, overrides) {
|
|
|
54
54
|
let minWidth = false;
|
|
55
55
|
let width = false;
|
|
56
56
|
let height = false;
|
|
57
|
-
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);
|
|
57
|
+
let matches = String(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);
|
|
58
58
|
for (let p of matches){
|
|
59
59
|
if (p[1] === "M") minHeight = true;
|
|
60
60
|
if (p[1] === "N") minWidth = true;
|
|
@@ -62,23 +62,23 @@ const $03960a2740ca2b19$var$tree = function anonymous(props, overrides) {
|
|
|
62
62
|
if (p[1] === "F") height = true;
|
|
63
63
|
rules += p[0];
|
|
64
64
|
}
|
|
65
|
-
if (props.isFocusVisible) rules += '
|
|
66
|
-
else rules += '
|
|
67
|
-
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-
|
|
65
|
+
if (props.isFocusVisible) rules += ' _Lf11';
|
|
66
|
+
else rules += ' _Le11';
|
|
67
|
+
rules += ' Oh11';
|
|
68
|
+
rules += ' Olc11';
|
|
69
|
+
rules += ' _Mc11';
|
|
70
|
+
rules += ' _Kb11';
|
|
71
|
+
rules += ' _4c11';
|
|
72
|
+
if (!minHeight) rules += ' Ma11';
|
|
73
|
+
if (!minWidth) rules += ' Na11';
|
|
74
|
+
if (!width) rules += ' Za11';
|
|
75
|
+
if (!height) rules += ' Fb11';
|
|
76
|
+
rules += ' _Na11';
|
|
77
|
+
rules += ' Pa11';
|
|
78
|
+
rules += ' _oa11';
|
|
79
|
+
if (props.isEmpty) rules += ' _Ca11';
|
|
80
|
+
if (props.isEmpty) rules += ' eb11';
|
|
81
|
+
rules += ' -lPUMEc-Zu11';
|
|
82
82
|
return rules;
|
|
83
83
|
};
|
|
84
84
|
const $03960a2740ca2b19$export$6940b0d9c820eca7 = /*#__PURE__*/ (0, $iOVFT$forwardRef)(function TreeView(props, ref) {
|
|
@@ -126,84 +126,96 @@ const $03960a2740ca2b19$var$rowBackgroundColor = {
|
|
|
126
126
|
};
|
|
127
127
|
const $03960a2740ca2b19$var$treeRow = function anonymous(props) {
|
|
128
128
|
let rules = " ";
|
|
129
|
-
rules += '
|
|
130
|
-
rules += '
|
|
131
|
-
rules += '
|
|
132
|
-
rules += '
|
|
133
|
-
rules += '
|
|
134
|
-
rules += '
|
|
135
|
-
rules += '
|
|
136
|
-
rules += '
|
|
137
|
-
rules += '
|
|
138
|
-
rules += '
|
|
139
|
-
rules += '
|
|
140
|
-
rules += '
|
|
141
|
-
rules += '
|
|
142
|
-
rules += '
|
|
143
|
-
rules += ' -_6BNtrc-
|
|
144
|
-
rules += '
|
|
145
|
-
rules += '
|
|
146
|
-
rules += '
|
|
147
|
-
rules += '
|
|
148
|
-
rules += '
|
|
129
|
+
rules += ' _Pc11';
|
|
130
|
+
rules += ' sd11';
|
|
131
|
+
rules += ' Fv11';
|
|
132
|
+
rules += ' Za11';
|
|
133
|
+
rules += ' _oa11';
|
|
134
|
+
rules += ' uk11';
|
|
135
|
+
rules += ' ucJ9TBTb11';
|
|
136
|
+
rules += ' ud3Euai11';
|
|
137
|
+
rules += ' uea11';
|
|
138
|
+
rules += ' ugb11';
|
|
139
|
+
rules += ' uhd11';
|
|
140
|
+
rules += ' uje11';
|
|
141
|
+
rules += ' u2NhKxcl11';
|
|
142
|
+
rules += ' uic11';
|
|
143
|
+
rules += ' -_6BNtrc-c11';
|
|
144
|
+
rules += ' vx11';
|
|
145
|
+
rules += ' xb11';
|
|
146
|
+
rules += ' _xa11';
|
|
147
|
+
rules += ' _Fd11';
|
|
148
|
+
rules += ' _FnuYUweb11';
|
|
149
149
|
if (props.isSelected) {
|
|
150
|
-
if (props.isPressed) rules += '
|
|
151
|
-
else if (props.isFocusVisible) rules += '
|
|
152
|
-
else if (props.isHovered) rules += '
|
|
153
|
-
else rules += '
|
|
150
|
+
if (props.isPressed) rules += ' po11';
|
|
151
|
+
else if (props.isFocusVisible) rules += ' po11';
|
|
152
|
+
else if (props.isHovered) rules += ' po11';
|
|
153
|
+
else rules += ' pt11';
|
|
154
154
|
} else {
|
|
155
|
-
if (props.isPressed) rules += '
|
|
156
|
-
else if (props.isFocusVisible) rules += '
|
|
157
|
-
else if (props.isHovered) rules += '
|
|
158
|
-
else rules += '
|
|
155
|
+
if (props.isPressed) rules += ' pt11';
|
|
156
|
+
else if (props.isFocusVisible) rules += ' pt11';
|
|
157
|
+
else if (props.isHovered) rules += ' pt11';
|
|
158
|
+
else rules += ' pv11';
|
|
159
159
|
}
|
|
160
|
-
rules += '
|
|
161
|
-
rules += '
|
|
162
|
-
if (props.isLink) rules += '
|
|
163
|
-
else rules += '
|
|
160
|
+
rules += ' plb11';
|
|
161
|
+
rules += ' _Le11';
|
|
162
|
+
if (props.isLink) rules += ' ry11';
|
|
163
|
+
else rules += ' ri11';
|
|
164
164
|
if (props.isSelected) {
|
|
165
|
-
if (props.isPressed) rules += ' -qH4xad-
|
|
166
|
-
else if (props.isHovered) rules += ' -qH4xad-
|
|
167
|
-
else if (props.isFocusVisibleWithin) rules += ' -qH4xad-
|
|
168
|
-
else rules += ' -qH4xad-
|
|
169
|
-
} else if (props.isPressed) rules += ' -qH4xad-
|
|
170
|
-
else if (props.isHovered) rules += ' -qH4xad-
|
|
171
|
-
else if (props.isFocusVisibleWithin) rules += ' -qH4xad-
|
|
172
|
-
else rules += ' -qH4xad-
|
|
173
|
-
rules += ' -qH4xad-
|
|
174
|
-
rules += ' -_34HbNb-
|
|
175
|
-
rules += ' -_34HbNb-
|
|
165
|
+
if (props.isPressed) rules += ' -qH4xad-gRfT7e11';
|
|
166
|
+
else if (props.isHovered) rules += ' -qH4xad-gRfT7e11';
|
|
167
|
+
else if (props.isFocusVisibleWithin) rules += ' -qH4xad-gRfT7e11';
|
|
168
|
+
else rules += ' -qH4xad-gj1B7i11';
|
|
169
|
+
} else if (props.isPressed) rules += ' -qH4xad-gRfT7e11';
|
|
170
|
+
else if (props.isHovered) rules += ' -qH4xad-gj1B7i11';
|
|
171
|
+
else if (props.isFocusVisibleWithin) rules += ' -qH4xad-gj1B7i11';
|
|
172
|
+
else rules += ' -qH4xad-gEzkoQe11';
|
|
173
|
+
rules += ' -qH4xad-lga11';
|
|
174
|
+
rules += ' -_34HbNb-Oh11';
|
|
175
|
+
rules += ' -_34HbNb-lOc11';
|
|
176
176
|
return rules;
|
|
177
177
|
};
|
|
178
178
|
const $03960a2740ca2b19$var$treeCellGrid = function anonymous(props) {
|
|
179
179
|
let rules = " ";
|
|
180
|
-
rules += '
|
|
181
|
-
rules += '
|
|
182
|
-
rules += '
|
|
183
|
-
rules += '
|
|
184
|
-
rules += '
|
|
185
|
-
rules += '
|
|
186
|
-
rules += '
|
|
187
|
-
rules += '
|
|
188
|
-
rules += '
|
|
189
|
-
rules += '
|
|
190
|
-
rules += '
|
|
180
|
+
rules += ' se11';
|
|
181
|
+
rules += ' Za11';
|
|
182
|
+
rules += ' Fb11';
|
|
183
|
+
rules += ' _oa11';
|
|
184
|
+
rules += ' _cb11';
|
|
185
|
+
rules += ' eb11';
|
|
186
|
+
rules += ' Dw9uTxc11';
|
|
187
|
+
rules += ' EM8Mfn11';
|
|
188
|
+
rules += ' CgjMZ2c11';
|
|
189
|
+
rules += ' gs9yXOb11';
|
|
190
|
+
rules += ' Rp11';
|
|
191
191
|
if (props.isDisabled) {
|
|
192
|
-
rules += '
|
|
193
|
-
rules += '
|
|
192
|
+
rules += ' pp11';
|
|
193
|
+
rules += ' plc11';
|
|
194
194
|
}
|
|
195
|
-
if (props.isFocusVisible) rules += ' -_7xg3bb-
|
|
196
|
-
else rules += ' -_7xg3bb-
|
|
197
|
-
rules += ' -_7xg3bb-
|
|
198
|
-
rules += ' -pKMv1c-
|
|
199
|
-
rules += ' -pKMv1c-
|
|
195
|
+
if (props.isFocusVisible) rules += ' -_7xg3bb-Oh11';
|
|
196
|
+
else rules += ' -_7xg3bb-O8Izf8c11';
|
|
197
|
+
rules += ' -_7xg3bb-lOc11';
|
|
198
|
+
rules += ' -pKMv1c-Oh11';
|
|
199
|
+
rules += ' -pKMv1c-lOc11';
|
|
200
200
|
return rules;
|
|
201
201
|
};
|
|
202
|
-
const $03960a2740ca2b19$var$treeCheckbox =
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
const $03960a2740ca2b19$var$treeCheckbox = function anonymous(props) {
|
|
203
|
+
let rules = " ";
|
|
204
|
+
rules += ' zoRzcu11';
|
|
205
|
+
rules += ' yoRzcu11';
|
|
206
|
+
rules += ' BoRzcu11';
|
|
207
|
+
rules += ' AoRzcu11';
|
|
208
|
+
rules += ' Ix11';
|
|
209
|
+
rules += ' Hy11';
|
|
210
|
+
rules += ' Rd11';
|
|
211
|
+
if (props.isDisabled) rules += ' _6b11';
|
|
212
|
+
else rules += ' _6c11';
|
|
213
|
+
return rules;
|
|
214
|
+
};
|
|
215
|
+
const $03960a2740ca2b19$var$treeIcon = " z2U5Crc11 y2U5Crc11 B2U5Crc11 A2U5Crc11 Ht11 Hsu11 -_8sjo0b-t5ZbAob11";
|
|
216
|
+
const $03960a2740ca2b19$var$treeContent = " zk52g2d11 yk52g2d11 Bk52g2d11 Ak52g2d11 _Yb11 _7c11 _Nc11 Pc11";
|
|
217
|
+
const $03960a2740ca2b19$var$treeActions = " zkG38H11 ykG38H11 BkG38H11 AkG38H11 Ir11 Hs11";
|
|
218
|
+
const $03960a2740ca2b19$var$treeActionMenu = " z6Nrfjc11 y6Nrfjc11 B6Nrfjc11 A6Nrfjc11";
|
|
207
219
|
const $03960a2740ca2b19$var$treeRowFocusIndicator = "tDhuzb";
|
|
208
220
|
const $03960a2740ca2b19$export$6e77ea6719814e9c = (props)=>{
|
|
209
221
|
let { href: href } = props;
|
|
@@ -236,13 +248,15 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props)=>{
|
|
|
236
248
|
children: [
|
|
237
249
|
selectionMode !== 'none' && selectionBehavior === 'toggle' && // TODO: add transition?
|
|
238
250
|
/*#__PURE__*/ (0, $iOVFT$jsx)("div", {
|
|
239
|
-
className: $03960a2740ca2b19$var$treeCheckbox
|
|
251
|
+
className: $03960a2740ca2b19$var$treeCheckbox({
|
|
252
|
+
isDisabled: isDisabled || !state.selectionManager.canSelectItem(id) || state.disabledKeys.has(id)
|
|
253
|
+
}),
|
|
240
254
|
children: /*#__PURE__*/ (0, $iOVFT$jsx)((0, $9b405e0f8095dce0$export$48513f6b9f8ce62d), {
|
|
241
255
|
slot: "selection"
|
|
242
256
|
})
|
|
243
257
|
}),
|
|
244
258
|
/*#__PURE__*/ (0, $iOVFT$jsx)("div", {
|
|
245
|
-
className: "
|
|
259
|
+
className: " z7fSmKc11 y7fSmKc11 B7fSmKc11 A7fSmKc11 ZecPNad11"
|
|
246
260
|
}),
|
|
247
261
|
/*#__PURE__*/ (0, $iOVFT$jsx)($03960a2740ca2b19$var$ExpandableRowChevron, {
|
|
248
262
|
isDisabled: isDisabled,
|
|
@@ -265,20 +279,22 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props)=>{
|
|
|
265
279
|
slot: 'icon',
|
|
266
280
|
styles: $03960a2740ca2b19$var$treeIcon
|
|
267
281
|
}),
|
|
268
|
-
styles: "
|
|
282
|
+
styles: " ZuUmpre11 FuUmpre11 _va11"
|
|
269
283
|
}
|
|
270
284
|
],
|
|
271
285
|
[
|
|
272
286
|
(0, $10401bdc118cbc90$export$33f5f2f2cb85d743),
|
|
273
287
|
{
|
|
274
|
-
styles: $03960a2740ca2b19$var$treeActions
|
|
288
|
+
styles: $03960a2740ca2b19$var$treeActions,
|
|
289
|
+
isDisabled: isDisabled
|
|
275
290
|
}
|
|
276
291
|
],
|
|
277
292
|
[
|
|
278
293
|
(0, $8bf3cd2442eb485e$export$7f4b66acaca28bd5),
|
|
279
294
|
{
|
|
280
295
|
styles: $03960a2740ca2b19$var$treeActionMenu,
|
|
281
|
-
isQuiet: true
|
|
296
|
+
isQuiet: true,
|
|
297
|
+
isDisabled: isDisabled
|
|
282
298
|
}
|
|
283
299
|
]
|
|
284
300
|
],
|
|
@@ -291,7 +307,7 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props)=>{
|
|
|
291
307
|
}
|
|
292
308
|
});
|
|
293
309
|
};
|
|
294
|
-
const $03960a2740ca2b19$var$centeredWrapper = "
|
|
310
|
+
const $03960a2740ca2b19$var$centeredWrapper = " sd11 eb11 _Ca11 Za11 Fb11";
|
|
295
311
|
const $03960a2740ca2b19$export$6ceebe2a029205c = (props)=>{
|
|
296
312
|
let { loadingState: loadingState, onLoadMore: onLoadMore } = props;
|
|
297
313
|
let stringFormatter = (0, $iOVFT$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iOVFT$intlStringsmjs))), '@react-spectrum/s2');
|
|
@@ -299,7 +315,7 @@ const $03960a2740ca2b19$export$6ceebe2a029205c = (props)=>{
|
|
|
299
315
|
return /*#__PURE__*/ (0, $iOVFT$jsx)((0, $iOVFT$TreeLoadMoreItem), {
|
|
300
316
|
isLoading: isLoading,
|
|
301
317
|
onLoadMore: onLoadMore,
|
|
302
|
-
className: "
|
|
318
|
+
className: " Za11 Js11 Gs11",
|
|
303
319
|
children: ()=>{
|
|
304
320
|
return /*#__PURE__*/ (0, $iOVFT$jsx)("div", {
|
|
305
321
|
className: $03960a2740ca2b19$var$centeredWrapper,
|
|
@@ -313,37 +329,37 @@ const $03960a2740ca2b19$export$6ceebe2a029205c = (props)=>{
|
|
|
313
329
|
};
|
|
314
330
|
const $03960a2740ca2b19$var$expandButton = function anonymous(props) {
|
|
315
331
|
let rules = " ";
|
|
316
|
-
rules += '
|
|
317
|
-
rules += '
|
|
318
|
-
rules += '
|
|
319
|
-
rules += '
|
|
332
|
+
rules += ' z8dW5Qb11';
|
|
333
|
+
rules += ' y8dW5Qb11';
|
|
334
|
+
rules += ' B8dW5Qb11';
|
|
335
|
+
rules += ' A8dW5Qb11';
|
|
320
336
|
if (props.isDisabled) {
|
|
321
|
-
rules += '
|
|
322
|
-
rules += '
|
|
323
|
-
} else rules += '
|
|
324
|
-
rules += '
|
|
325
|
-
rules += '
|
|
326
|
-
rules += '
|
|
327
|
-
rules += '
|
|
328
|
-
rules += '
|
|
329
|
-
rules += '
|
|
330
|
-
rules += '
|
|
331
|
-
rules += '
|
|
337
|
+
rules += ' pp11';
|
|
338
|
+
rules += ' plc11';
|
|
339
|
+
} else rules += ' p40ub4c11';
|
|
340
|
+
rules += ' Fv11';
|
|
341
|
+
rules += ' Zw11';
|
|
342
|
+
rules += ' sd11';
|
|
343
|
+
rules += ' _wb11';
|
|
344
|
+
rules += ' _cb11';
|
|
345
|
+
rules += ' _Ca11';
|
|
346
|
+
rules += ' _Le11';
|
|
347
|
+
rules += ' ri11';
|
|
332
348
|
if (props.isExpanded) {
|
|
333
|
-
if (props.isRTL) rules += '
|
|
334
|
-
else rules += '
|
|
349
|
+
if (props.isRTL) rules += ' _Za11';
|
|
350
|
+
else rules += ' _Zb11';
|
|
335
351
|
}
|
|
336
|
-
rules += '
|
|
337
|
-
rules += '
|
|
338
|
-
rules += '
|
|
339
|
-
rules += '
|
|
340
|
-
rules += '
|
|
341
|
-
rules += '
|
|
342
|
-
rules += '
|
|
343
|
-
rules += '
|
|
344
|
-
rules += '
|
|
345
|
-
rules += '
|
|
346
|
-
if (props.isHidden) rules += '
|
|
352
|
+
rules += ' Td11';
|
|
353
|
+
rules += ' Qd11';
|
|
354
|
+
rules += ' Sd11';
|
|
355
|
+
rules += ' Rd11';
|
|
356
|
+
rules += ' Yd11';
|
|
357
|
+
rules += ' Xb11';
|
|
358
|
+
rules += ' _2b11';
|
|
359
|
+
rules += ' g911';
|
|
360
|
+
rules += ' _je11';
|
|
361
|
+
rules += ' __ca11';
|
|
362
|
+
if (props.isHidden) rules += ' _6b11';
|
|
347
363
|
return rules;
|
|
348
364
|
};
|
|
349
365
|
function $03960a2740ca2b19$var$ExpandableRowChevron(props1) {
|
|
@@ -369,20 +385,20 @@ function $03960a2740ca2b19$var$ExpandableRowChevron(props1) {
|
|
|
369
385
|
className: function anonymous(props) {
|
|
370
386
|
let rules = " ";
|
|
371
387
|
if (props.direction === "rtl") {
|
|
372
|
-
rules += ' -Z4Pn4c-
|
|
373
|
-
rules += '
|
|
388
|
+
rules += ' -Z4Pn4c-a11';
|
|
389
|
+
rules += ' __Ha11';
|
|
374
390
|
} else if (props.direction === "ltr") {
|
|
375
|
-
rules += ' -Z4Pn4c-
|
|
376
|
-
rules += '
|
|
391
|
+
rules += ' -Z4Pn4c-b11';
|
|
392
|
+
rules += ' __Ha11';
|
|
377
393
|
}
|
|
378
394
|
if (props.direction === "rtl") {
|
|
379
|
-
rules += ' -_04Pn4c-
|
|
380
|
-
rules += '
|
|
395
|
+
rules += ' -_04Pn4c-a11';
|
|
396
|
+
rules += ' __Ha11';
|
|
381
397
|
} else if (props.direction === "ltr") {
|
|
382
|
-
rules += ' -_04Pn4c-
|
|
383
|
-
rules += '
|
|
398
|
+
rules += ' -_04Pn4c-b11';
|
|
399
|
+
rules += ' __Ha11';
|
|
384
400
|
}
|
|
385
|
-
rules += ' -_8sjo0b-
|
|
401
|
+
rules += ' -_8sjo0b-t5ZbA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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 {baseColor, colorMix, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\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 {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, 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 /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void\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\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, 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 }}>\n <TreeRendererContext.Provider value={{renderer}}>\n <Tree\n {...props}\n style={UNSAFE_style}\n className={renderProps => (UNSAFE_className ?? '') + tree({...renderProps}, props.styles)}\n selectionBehavior=\"toggle\"\n ref={domRef}>\n {props.children}\n </Tree>\n </TreeRendererContext.Provider>\n </Virtualizer>\n );\n});\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 isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 10),\n isHovered: colorMix('gray-25', 'gray-900', 10),\n isPressed: colorMix('gray-25', 'gray-900', 10)\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: {\n default: baseColor('neutral-subdued'),\n isSelected: baseColor('neutral'),\n forcedColors: 'ButtonText'\n },\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});\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 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\n return (\n <TreeItem\n {...props}\n className={(renderProps) => treeRow({\n ...renderProps,\n isLink: !!href\n }) + (renderProps.isFocusVisible ? ' ' + 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 scale = useScale();\n\n return (\n <TreeItemContent>\n {({isExpanded, hasChildItems, selectionMode, selectionBehavior, isDisabled, 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})}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n // TODO: add transition?\n <div className={treeCheckbox}>\n <Checkbox 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 </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;;;;;;;;;;CA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,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 {baseColor, colorMix, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\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 {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, 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 /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void\n}\n\nexport interface TreeViewProps<T> extends Omit<RACTreeProps<T>, 'style' | 'className' | 'render' | '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' | 'render' | '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\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, 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 }}>\n <TreeRendererContext.Provider value={{renderer}}>\n <Tree\n {...props}\n style={UNSAFE_style}\n className={renderProps => (UNSAFE_className ?? '') + tree({...renderProps}, props.styles)}\n selectionBehavior=\"toggle\"\n ref={domRef}>\n {props.children}\n </Tree>\n </TreeRendererContext.Provider>\n </Virtualizer>\n );\n});\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 isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 10),\n isHovered: colorMix('gray-25', 'gray-900', 10),\n isPressed: colorMix('gray-25', 'gray-900', 10)\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: {\n default: baseColor('neutral-subdued'),\n isSelected: baseColor('neutral'),\n forcedColors: 'ButtonText'\n },\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});\n\nconst treeCheckbox = style({\n gridArea: 'checkbox',\n marginStart: 12,\n marginEnd: 0,\n paddingEnd: 0,\n visibility: {\n default: 'visible',\n isDisabled: 'hidden'\n }\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 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\n return (\n <TreeItem\n {...props}\n className={(renderProps) => treeRow({\n ...renderProps,\n isLink: !!href\n }) + (renderProps.isFocusVisible ? ' ' + 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 scale = useScale();\n\n return (\n <TreeItemContent>\n {({isExpanded, hasChildItems, selectionMode, selectionBehavior, isDisabled, 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})}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n // TODO: add transition?\n <div className={treeCheckbox({isDisabled: isDisabled || !state.selectionManager.canSelectItem(id) || state.disabledKeys.has(id)})}>\n <Checkbox 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, isDisabled}],\n [ActionMenuContext, {styles: treeActionMenu, isQuiet: true, isDisabled}]\n ]}>\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n </Provider>\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"}
|