@react-spectrum/s2 3.0.0-nightly-63d4359d6-250427 → 3.0.0-nightly-1dd65ffc5-250429

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.
Files changed (365) hide show
  1. package/dist/Accordion.cjs +4 -5
  2. package/dist/Accordion.cjs.map +1 -1
  3. package/dist/Accordion.css +2 -4
  4. package/dist/Accordion.css.map +1 -1
  5. package/dist/Accordion.mjs +4 -5
  6. package/dist/Accordion.mjs.map +1 -1
  7. package/dist/ActionBar.cjs +72 -63
  8. package/dist/ActionBar.cjs.map +1 -1
  9. package/dist/ActionBar.css +70 -63
  10. package/dist/ActionBar.css.map +1 -1
  11. package/dist/ActionBar.mjs +72 -63
  12. package/dist/ActionBar.mjs.map +1 -1
  13. package/dist/ActionButton.cjs +161 -160
  14. package/dist/ActionButton.cjs.map +1 -1
  15. package/dist/ActionButton.css +174 -168
  16. package/dist/ActionButton.css.map +1 -1
  17. package/dist/ActionButton.mjs +161 -160
  18. package/dist/ActionButton.mjs.map +1 -1
  19. package/dist/ActionButtonGroup.cjs +17 -18
  20. package/dist/ActionButtonGroup.cjs.map +1 -1
  21. package/dist/ActionButtonGroup.css +9 -11
  22. package/dist/ActionButtonGroup.css.map +1 -1
  23. package/dist/ActionButtonGroup.mjs +17 -18
  24. package/dist/ActionButtonGroup.mjs.map +1 -1
  25. package/dist/AlertDialog.cjs +4 -4
  26. package/dist/AlertDialog.css +3 -5
  27. package/dist/AlertDialog.css.map +1 -1
  28. package/dist/AlertDialog.mjs +4 -4
  29. package/dist/Avatar.cjs +21 -21
  30. package/dist/Avatar.css +14 -16
  31. package/dist/Avatar.css.map +1 -1
  32. package/dist/Avatar.mjs +21 -21
  33. package/dist/AvatarGroup.cjs +131 -110
  34. package/dist/AvatarGroup.cjs.map +1 -1
  35. package/dist/AvatarGroup.css +43 -49
  36. package/dist/AvatarGroup.css.map +1 -1
  37. package/dist/AvatarGroup.mjs +131 -110
  38. package/dist/AvatarGroup.mjs.map +1 -1
  39. package/dist/Badge.cjs +150 -149
  40. package/dist/Badge.cjs.map +1 -1
  41. package/dist/Badge.css +140 -134
  42. package/dist/Badge.css.map +1 -1
  43. package/dist/Badge.mjs +150 -149
  44. package/dist/Badge.mjs.map +1 -1
  45. package/dist/Breadcrumbs.cjs +169 -154
  46. package/dist/Breadcrumbs.cjs.map +1 -1
  47. package/dist/Breadcrumbs.css +119 -105
  48. package/dist/Breadcrumbs.css.map +1 -1
  49. package/dist/Breadcrumbs.mjs +169 -154
  50. package/dist/Breadcrumbs.mjs.map +1 -1
  51. package/dist/Button.cjs +321 -275
  52. package/dist/Button.cjs.map +1 -1
  53. package/dist/Button.css +245 -215
  54. package/dist/Button.css.map +1 -1
  55. package/dist/Button.mjs +321 -275
  56. package/dist/Button.mjs.map +1 -1
  57. package/dist/ButtonGroup.cjs +27 -25
  58. package/dist/ButtonGroup.cjs.map +1 -1
  59. package/dist/ButtonGroup.css +15 -17
  60. package/dist/ButtonGroup.css.map +1 -1
  61. package/dist/ButtonGroup.mjs +27 -25
  62. package/dist/ButtonGroup.mjs.map +1 -1
  63. package/dist/Card.cjs +316 -299
  64. package/dist/Card.cjs.map +1 -1
  65. package/dist/Card.css +242 -215
  66. package/dist/Card.css.map +1 -1
  67. package/dist/Card.mjs +316 -299
  68. package/dist/Card.mjs.map +1 -1
  69. package/dist/CardView.cjs +29 -30
  70. package/dist/CardView.cjs.map +1 -1
  71. package/dist/CardView.css +19 -19
  72. package/dist/CardView.mjs +29 -30
  73. package/dist/CardView.mjs.map +1 -1
  74. package/dist/CenterBaseline.cjs +2 -2
  75. package/dist/CenterBaseline.css +3 -5
  76. package/dist/CenterBaseline.css.map +1 -1
  77. package/dist/CenterBaseline.mjs +2 -2
  78. package/dist/Checkbox.cjs +114 -112
  79. package/dist/Checkbox.cjs.map +1 -1
  80. package/dist/Checkbox.css +99 -93
  81. package/dist/Checkbox.css.map +1 -1
  82. package/dist/Checkbox.mjs +114 -112
  83. package/dist/Checkbox.mjs.map +1 -1
  84. package/dist/CheckboxGroup.cjs +54 -54
  85. package/dist/CheckboxGroup.css +42 -42
  86. package/dist/CheckboxGroup.mjs +54 -54
  87. package/dist/ClearButton.cjs +19 -19
  88. package/dist/ClearButton.css +19 -21
  89. package/dist/ClearButton.css.map +1 -1
  90. package/dist/ClearButton.mjs +19 -19
  91. package/dist/CloseButton.cjs +64 -62
  92. package/dist/CloseButton.cjs.map +1 -1
  93. package/dist/CloseButton.css +48 -48
  94. package/dist/CloseButton.mjs +64 -62
  95. package/dist/CloseButton.mjs.map +1 -1
  96. package/dist/ColorArea.cjs +28 -28
  97. package/dist/ColorArea.css +17 -17
  98. package/dist/ColorArea.mjs +28 -28
  99. package/dist/ColorField.cjs +41 -41
  100. package/dist/ColorField.css +33 -33
  101. package/dist/ColorField.mjs +41 -41
  102. package/dist/ColorHandle.cjs +29 -29
  103. package/dist/ColorHandle.css +45 -45
  104. package/dist/ColorHandle.mjs +29 -29
  105. package/dist/ColorSlider.cjs +68 -64
  106. package/dist/ColorSlider.cjs.map +1 -1
  107. package/dist/ColorSlider.css +64 -58
  108. package/dist/ColorSlider.css.map +1 -1
  109. package/dist/ColorSlider.mjs +68 -64
  110. package/dist/ColorSlider.mjs.map +1 -1
  111. package/dist/ColorSwatch.cjs +44 -38
  112. package/dist/ColorSwatch.cjs.map +1 -1
  113. package/dist/ColorSwatch.css +29 -31
  114. package/dist/ColorSwatch.css.map +1 -1
  115. package/dist/ColorSwatch.mjs +44 -38
  116. package/dist/ColorSwatch.mjs.map +1 -1
  117. package/dist/ColorSwatchPicker.cjs +31 -32
  118. package/dist/ColorSwatchPicker.cjs.map +1 -1
  119. package/dist/ColorSwatchPicker.css +48 -48
  120. package/dist/ColorSwatchPicker.css.map +1 -1
  121. package/dist/ColorSwatchPicker.mjs +31 -32
  122. package/dist/ColorSwatchPicker.mjs.map +1 -1
  123. package/dist/ColorWheel.cjs +28 -28
  124. package/dist/ColorWheel.css +18 -18
  125. package/dist/ColorWheel.mjs +28 -28
  126. package/dist/ComboBox.cjs +108 -108
  127. package/dist/ComboBox.css +101 -101
  128. package/dist/ComboBox.mjs +108 -108
  129. package/dist/ContextualHelp.cjs +5 -5
  130. package/dist/ContextualHelp.css +58 -44
  131. package/dist/ContextualHelp.css.map +1 -1
  132. package/dist/ContextualHelp.mjs +5 -5
  133. package/dist/CustomDialog.cjs +38 -38
  134. package/dist/CustomDialog.css +26 -26
  135. package/dist/CustomDialog.mjs +38 -38
  136. package/dist/Dialog.cjs +18 -18
  137. package/dist/Dialog.css +86 -72
  138. package/dist/Dialog.css.map +1 -1
  139. package/dist/Dialog.mjs +18 -18
  140. package/dist/Disclosure.cjs +139 -133
  141. package/dist/Disclosure.cjs.map +1 -1
  142. package/dist/Disclosure.css +144 -120
  143. package/dist/Disclosure.css.map +1 -1
  144. package/dist/Disclosure.mjs +139 -133
  145. package/dist/Disclosure.mjs.map +1 -1
  146. package/dist/Divider.cjs +47 -47
  147. package/dist/Divider.css +26 -26
  148. package/dist/Divider.mjs +47 -47
  149. package/dist/DropZone.cjs +68 -64
  150. package/dist/DropZone.cjs.map +1 -1
  151. package/dist/DropZone.css +66 -60
  152. package/dist/DropZone.css.map +1 -1
  153. package/dist/DropZone.mjs +68 -64
  154. package/dist/DropZone.mjs.map +1 -1
  155. package/dist/Field.cjs +192 -186
  156. package/dist/Field.cjs.map +1 -1
  157. package/dist/Field.css +167 -159
  158. package/dist/Field.css.map +1 -1
  159. package/dist/Field.mjs +192 -186
  160. package/dist/Field.mjs.map +1 -1
  161. package/dist/Form.cjs +11 -12
  162. package/dist/Form.cjs.map +1 -1
  163. package/dist/Form.css +9 -11
  164. package/dist/Form.css.map +1 -1
  165. package/dist/Form.mjs +11 -12
  166. package/dist/Form.mjs.map +1 -1
  167. package/dist/FullscreenDialog.cjs +5 -5
  168. package/dist/FullscreenDialog.css +94 -80
  169. package/dist/FullscreenDialog.css.map +1 -1
  170. package/dist/FullscreenDialog.mjs +5 -5
  171. package/dist/IllustratedMessage.cjs +185 -160
  172. package/dist/IllustratedMessage.cjs.map +1 -1
  173. package/dist/IllustratedMessage.css +93 -91
  174. package/dist/IllustratedMessage.css.map +1 -1
  175. package/dist/IllustratedMessage.mjs +185 -160
  176. package/dist/IllustratedMessage.mjs.map +1 -1
  177. package/dist/Image.cjs +14 -14
  178. package/dist/Image.css +14 -16
  179. package/dist/Image.css.map +1 -1
  180. package/dist/Image.mjs +14 -14
  181. package/dist/InlineAlert.cjs +130 -122
  182. package/dist/InlineAlert.cjs.map +1 -1
  183. package/dist/InlineAlert.css +109 -95
  184. package/dist/InlineAlert.css.map +1 -1
  185. package/dist/InlineAlert.mjs +130 -122
  186. package/dist/InlineAlert.mjs.map +1 -1
  187. package/dist/Link.cjs +57 -47
  188. package/dist/Link.cjs.map +1 -1
  189. package/dist/Link.css +52 -44
  190. package/dist/Link.css.map +1 -1
  191. package/dist/Link.mjs +57 -47
  192. package/dist/Link.mjs.map +1 -1
  193. package/dist/Menu.cjs +353 -325
  194. package/dist/Menu.cjs.map +1 -1
  195. package/dist/Menu.css +189 -189
  196. package/dist/Menu.css.map +1 -1
  197. package/dist/Menu.mjs +353 -325
  198. package/dist/Menu.mjs.map +1 -1
  199. package/dist/Meter.cjs +116 -114
  200. package/dist/Meter.cjs.map +1 -1
  201. package/dist/Meter.css +106 -104
  202. package/dist/Meter.css.map +1 -1
  203. package/dist/Meter.mjs +116 -114
  204. package/dist/Meter.mjs.map +1 -1
  205. package/dist/Modal.cjs +62 -59
  206. package/dist/Modal.cjs.map +1 -1
  207. package/dist/Modal.css +52 -51
  208. package/dist/Modal.css.map +1 -1
  209. package/dist/Modal.mjs +62 -59
  210. package/dist/Modal.mjs.map +1 -1
  211. package/dist/NotificationBadge.cjs +66 -62
  212. package/dist/NotificationBadge.cjs.map +1 -1
  213. package/dist/NotificationBadge.css +78 -72
  214. package/dist/NotificationBadge.css.map +1 -1
  215. package/dist/NotificationBadge.mjs +66 -62
  216. package/dist/NotificationBadge.mjs.map +1 -1
  217. package/dist/NumberField.cjs +133 -133
  218. package/dist/NumberField.css +120 -120
  219. package/dist/NumberField.mjs +133 -133
  220. package/dist/Picker.cjs +209 -207
  221. package/dist/Picker.cjs.map +1 -1
  222. package/dist/Picker.css +179 -173
  223. package/dist/Picker.css.map +1 -1
  224. package/dist/Picker.mjs +209 -207
  225. package/dist/Picker.mjs.map +1 -1
  226. package/dist/Popover.cjs +124 -93
  227. package/dist/Popover.cjs.map +1 -1
  228. package/dist/Popover.css +67 -83
  229. package/dist/Popover.css.map +1 -1
  230. package/dist/Popover.mjs +124 -93
  231. package/dist/Popover.mjs.map +1 -1
  232. package/dist/ProgressBar.cjs +132 -130
  233. package/dist/ProgressBar.cjs.map +1 -1
  234. package/dist/ProgressBar.css +119 -117
  235. package/dist/ProgressBar.css.map +1 -1
  236. package/dist/ProgressBar.mjs +132 -130
  237. package/dist/ProgressBar.mjs.map +1 -1
  238. package/dist/ProgressCircle.cjs +32 -32
  239. package/dist/ProgressCircle.css +20 -20
  240. package/dist/ProgressCircle.css.map +1 -1
  241. package/dist/ProgressCircle.mjs +32 -32
  242. package/dist/Provider.cjs +11 -11
  243. package/dist/Provider.css +9 -11
  244. package/dist/Provider.css.map +1 -1
  245. package/dist/Provider.mjs +11 -11
  246. package/dist/Radio.cjs +101 -99
  247. package/dist/Radio.cjs.map +1 -1
  248. package/dist/Radio.css +101 -95
  249. package/dist/Radio.css.map +1 -1
  250. package/dist/Radio.mjs +101 -99
  251. package/dist/Radio.mjs.map +1 -1
  252. package/dist/RadioGroup.cjs +52 -52
  253. package/dist/RadioGroup.css +42 -42
  254. package/dist/RadioGroup.mjs +52 -52
  255. package/dist/SearchField.cjs +52 -52
  256. package/dist/SearchField.css +54 -54
  257. package/dist/SearchField.mjs +52 -52
  258. package/dist/SegmentedControl.cjs +123 -119
  259. package/dist/SegmentedControl.cjs.map +1 -1
  260. package/dist/SegmentedControl.css +110 -104
  261. package/dist/SegmentedControl.css.map +1 -1
  262. package/dist/SegmentedControl.mjs +123 -119
  263. package/dist/SegmentedControl.mjs.map +1 -1
  264. package/dist/Slider.cjs +251 -248
  265. package/dist/Slider.cjs.map +1 -1
  266. package/dist/Slider.css +166 -157
  267. package/dist/Slider.css.map +1 -1
  268. package/dist/Slider.mjs +251 -248
  269. package/dist/Slider.mjs.map +1 -1
  270. package/dist/StatusLight.cjs +74 -70
  271. package/dist/StatusLight.cjs.map +1 -1
  272. package/dist/StatusLight.css +70 -64
  273. package/dist/StatusLight.css.map +1 -1
  274. package/dist/StatusLight.mjs +74 -70
  275. package/dist/StatusLight.mjs.map +1 -1
  276. package/dist/Switch.cjs +110 -108
  277. package/dist/Switch.cjs.map +1 -1
  278. package/dist/Switch.css +86 -80
  279. package/dist/Switch.css.map +1 -1
  280. package/dist/Switch.mjs +110 -108
  281. package/dist/Switch.mjs.map +1 -1
  282. package/dist/TableView.cjs +334 -329
  283. package/dist/TableView.cjs.map +1 -1
  284. package/dist/TableView.css +193 -193
  285. package/dist/TableView.css.map +1 -1
  286. package/dist/TableView.mjs +334 -329
  287. package/dist/TableView.mjs.map +1 -1
  288. package/dist/Tabs.cjs +153 -149
  289. package/dist/Tabs.cjs.map +1 -1
  290. package/dist/Tabs.css +102 -96
  291. package/dist/Tabs.css.map +1 -1
  292. package/dist/Tabs.mjs +153 -149
  293. package/dist/Tabs.mjs.map +1 -1
  294. package/dist/TabsPicker.cjs +131 -129
  295. package/dist/TabsPicker.cjs.map +1 -1
  296. package/dist/TabsPicker.css +132 -126
  297. package/dist/TabsPicker.css.map +1 -1
  298. package/dist/TabsPicker.mjs +131 -129
  299. package/dist/TabsPicker.mjs.map +1 -1
  300. package/dist/TagGroup.cjs +197 -193
  301. package/dist/TagGroup.cjs.map +1 -1
  302. package/dist/TagGroup.css +164 -158
  303. package/dist/TagGroup.css.map +1 -1
  304. package/dist/TagGroup.mjs +197 -193
  305. package/dist/TagGroup.mjs.map +1 -1
  306. package/dist/TextField.cjs +67 -65
  307. package/dist/TextField.cjs.map +1 -1
  308. package/dist/TextField.css +71 -65
  309. package/dist/TextField.css.map +1 -1
  310. package/dist/TextField.mjs +67 -65
  311. package/dist/TextField.mjs.map +1 -1
  312. package/dist/Toast.cjs +138 -136
  313. package/dist/Toast.cjs.map +1 -1
  314. package/dist/Toast.css +117 -111
  315. package/dist/Toast.css.map +1 -1
  316. package/dist/Toast.mjs +138 -136
  317. package/dist/Toast.mjs.map +1 -1
  318. package/dist/ToggleButton.cjs +3 -3
  319. package/dist/ToggleButton.css +12 -14
  320. package/dist/ToggleButton.css.map +1 -1
  321. package/dist/ToggleButton.mjs +3 -3
  322. package/dist/Tooltip.cjs +99 -72
  323. package/dist/Tooltip.cjs.map +1 -1
  324. package/dist/Tooltip.css +87 -87
  325. package/dist/Tooltip.css.map +1 -1
  326. package/dist/Tooltip.mjs +99 -72
  327. package/dist/Tooltip.mjs.map +1 -1
  328. package/dist/TreeView.cjs +169 -157
  329. package/dist/TreeView.cjs.map +1 -1
  330. package/dist/TreeView.css +155 -153
  331. package/dist/TreeView.css.map +1 -1
  332. package/dist/TreeView.mjs +169 -157
  333. package/dist/TreeView.mjs.map +1 -1
  334. package/dist/types.d.ts +1 -1
  335. package/dist/types.d.ts.map +1 -1
  336. package/icons/Skeleton.cjs +3 -3
  337. package/icons/Skeleton.cjs.map +1 -1
  338. package/icons/Skeleton.css +8 -10
  339. package/icons/Skeleton.css.map +1 -1
  340. package/icons/Skeleton.mjs +3 -3
  341. package/icons/Skeleton.mjs.map +1 -1
  342. package/package.json +22 -22
  343. package/src/Card.tsx +3 -3
  344. package/src/Disclosure.tsx +3 -3
  345. package/src/TableView.tsx +1 -4
  346. package/src/style-utils.ts +0 -2
  347. package/style/__tests__/style-macro.test.js +323 -27
  348. package/style/dist/properties.cjs +4 -0
  349. package/style/dist/properties.cjs.map +1 -0
  350. package/style/dist/properties.mjs +6 -0
  351. package/style/dist/properties.mjs.map +1 -0
  352. package/style/dist/spectrum-theme.cjs +123 -124
  353. package/style/dist/spectrum-theme.cjs.map +1 -1
  354. package/style/dist/spectrum-theme.mjs +124 -125
  355. package/style/dist/spectrum-theme.mjs.map +1 -1
  356. package/style/dist/style-macro.cjs +244 -263
  357. package/style/dist/style-macro.cjs.map +1 -1
  358. package/style/dist/style-macro.mjs +240 -259
  359. package/style/dist/style-macro.mjs.map +1 -1
  360. package/style/dist/types.d.ts +84 -80
  361. package/style/dist/types.d.ts.map +1 -1
  362. package/style/properties.json +2422 -0
  363. package/style/spectrum-theme.ts +101 -110
  364. package/style/style-macro.ts +319 -220
  365. package/style/types.ts +8 -4
@@ -1 +1 @@
1
- {"mappings":"ACwEa;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqFG;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2BK;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAoDA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAOJ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EASG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAOA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAOG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeO;;;;;;;;;;;;;EAgEL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAWC;;;;EAAA;;;;EAAA;;;;EAOuD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAgB5D;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkDF;;;;;EAAA;;;;;EAAA;;;;;EAAA;;;;;EAAA;;;;;AArWN;EAqFG;;;;EAAA;;;;;AArFH;EAAA;IAqFG;;;;IAAA;;;;IA2BK;;;;IAAA;;;;IAmL4D;;;;IAgB5D;;;;;;AA9NL;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAsFC","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","/*\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 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, Key} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {isAndroid} from '@react-aria/utils';\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} from 'react-aria';\nimport {useScale} from './utils';\n\ninterface S2TreeProps {\n // Only detatched is supported right now with the current styles from Spectrum\n isDetached?: boolean,\n onAction?: (key: Key) => void,\n // not fully supported yet\n isEmphasized?: boolean\n}\n\nexport interface TreeViewProps extends Omit<RACTreeProps<any>, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks'>, UnsafeStyles, S2TreeProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nexport interface TreeViewItemProps extends Omit<RACTreeItemProps, 'className' | 'style'> {\n /** Whether this item has children, even if not loaded yet. */\n hasChildItems?: boolean\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\nfunction TreeView(props: TreeViewProps, 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\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 {/* TODO: revisit when we do async loading, at the moment hasChildItems will only cause the chevron to be rendered, no aria/data attributes indicating the row's expandability are added */}\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\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, isDisabled, scale, isHidden} = fullProps;\n let {direction} = useLocale();\n isDisabled = isDisabled || isHidden;\n\n return (\n <Button\n {...props}\n ref={ref}\n slot=\"chevron\"\n // Override tabindex so that grid keyboard nav skips over it. Needs -1 so android talkback can actually \"focus\" it\n excludeFromTabOrder={isAndroid() && !isDisabled}\n preventFocusOnPress\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\n/**\n * A tree view provides users with a way to navigate nested hierarchical information.\n */\nconst _TreeView = forwardRef(TreeView);\nexport {_TreeView as TreeView};\n"],"names":[],"version":3,"file":"TreeView.css.map"}
1
+ {"mappings":"ACwEa;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqFG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2BK;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;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2/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","/*\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 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, Key} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {isAndroid} from '@react-aria/utils';\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} from 'react-aria';\nimport {useScale} from './utils';\n\ninterface S2TreeProps {\n // Only detatched is supported right now with the current styles from Spectrum\n isDetached?: boolean,\n onAction?: (key: Key) => void,\n // not fully supported yet\n isEmphasized?: boolean\n}\n\nexport interface TreeViewProps extends Omit<RACTreeProps<any>, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks'>, UnsafeStyles, S2TreeProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nexport interface TreeViewItemProps extends Omit<RACTreeItemProps, 'className' | 'style'> {\n /** Whether this item has children, even if not loaded yet. */\n hasChildItems?: boolean\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\nfunction TreeView(props: TreeViewProps, 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\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 {/* TODO: revisit when we do async loading, at the moment hasChildItems will only cause the chevron to be rendered, no aria/data attributes indicating the row's expandability are added */}\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\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, isDisabled, scale, isHidden} = fullProps;\n let {direction} = useLocale();\n isDisabled = isDisabled || isHidden;\n\n return (\n <Button\n {...props}\n ref={ref}\n slot=\"chevron\"\n // Override tabindex so that grid keyboard nav skips over it. Needs -1 so android talkback can actually \"focus\" it\n excludeFromTabOrder={isAndroid() && !isDisabled}\n preventFocusOnPress\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\n/**\n * A tree view provides users with a way to navigate nested hierarchical information.\n */\nconst _TreeView = forwardRef(TreeView);\nexport {_TreeView as TreeView};\n"],"names":[],"version":3,"file":"TreeView.css.map"}
package/dist/TreeView.mjs CHANGED
@@ -44,36 +44,36 @@ let $03960a2740ca2b19$var$InternalTreeContext = /*#__PURE__*/ (0, $iOVFT$createC
44
44
  // keyboard focus ring. Perhaps find a different way of rendering the outlines since the top of the item doesn't
45
45
  // scroll into view due to how the ring is offset. Alternatively, have the tree render the top/bottom outline like it does in Listview
46
46
  const $03960a2740ca2b19$var$tree = function anonymous(props, overrides) {
47
- let rules = " .";
48
- let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|__a|_9|h|_6|_5|__B|__d|__e|__b|__c|V|__R|Y|_a|W|X|l|q|r|k|o|p)[^\s]+/g) || [];
49
- rules += matches.join('');
50
- let $o = false;
51
- let $q = false;
52
- let $l = false;
53
- let $k = false;
47
+ let rules = " ";
48
+ let minHeight = false;
49
+ let minWidth = false;
50
+ let width = false;
51
+ let height = false;
52
+ let matches = (overrides || '').matchAll(/(?:^|\s)(j|l|h|i|_H|_r|M|__f|_X|_M|L|N|_f|_d|K|__B|H|G|J|I|f|u|_l|e|s|_w)[^\s]+/g);
54
53
  for (let p of matches){
55
- if (/^\s*o/.test(p)) $o = true;
56
- if (/^\s*q/.test(p)) $q = true;
57
- if (/^\s*l/.test(p)) $l = true;
58
- if (/^\s*k/.test(p)) $k = true;
54
+ if (p[1] === "s") minHeight = true;
55
+ if (p[1] === "u") minWidth = true;
56
+ if (p[1] === "f") width = true;
57
+ if (p[1] === "e") height = true;
58
+ rules += p[0];
59
59
  }
60
- if (props.isFocusVisible) rules += ' _Mb';
61
- else rules += ' _Ma';
62
- rules += ' da_____M';
63
- rules += ' dx';
64
- rules += ' _Oc';
65
- rules += ' _N-3hmpw';
66
- rules += ' __Ea';
67
- if (!$o) rules += ' oo';
68
- if (!$q) rules += ' qo';
69
- if (!$l) rules += ' lb';
70
- if (!$k) rules += ' kb';
71
- rules += ' __wa';
72
- rules += ' __xa';
73
- rules += ' __oa';
74
- if (props.isEmpty) rules += ' _3d';
75
- if (props.isEmpty) rules += ' _2c';
76
- rules += ' -_11sb0gx_l-E';
60
+ if (props.isFocusVisible) rules += ' tb';
61
+ else rules += ' ta';
62
+ rules += ' Bb';
63
+ rules += ' Bba';
64
+ rules += ' _ga';
65
+ rules += ' _yb';
66
+ rules += ' _Qa';
67
+ if (!minHeight) rules += ' sf';
68
+ if (!minWidth) rules += ' uf';
69
+ if (!width) rules += ' fa';
70
+ if (!height) rules += ' ef';
71
+ rules += ' _ob';
72
+ rules += ' _hb';
73
+ rules += ' _qa';
74
+ if (props.isEmpty) rules += ' _pa';
75
+ if (props.isEmpty) rules += ' Fa';
76
+ rules += ' -lPUMEc-ff';
77
77
  return rules;
78
78
  };
79
79
  function $03960a2740ca2b19$var$TreeView(props, ref) {
@@ -112,8 +112,8 @@ function $03960a2740ca2b19$var$TreeView(props, ref) {
112
112
  })
113
113
  });
114
114
  }
115
- const $03960a2740ca2b19$var$selectedBackground = "[light-dark(color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(59, 99, 251), rgb(86, 129, 255)) 10%), color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(93, 137, 255), rgb(52, 91, 248)) 10%))]";
116
- const $03960a2740ca2b19$var$selectedActiveBackground = "[light-dark(color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(59, 99, 251), rgb(86, 129, 255)) 15%), color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(93, 137, 255), rgb(52, 91, 248)) 15%))]";
115
+ const $03960a2740ca2b19$var$selectedBackground = "[light-dark(c, c)]";
116
+ const $03960a2740ca2b19$var$selectedActiveBackground = "[light-dark(c, c)]";
117
117
  const $03960a2740ca2b19$var$rowBackgroundColor = {
118
118
  default: '--s2-container-bg',
119
119
  isFocusVisibleWithin: "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 7%)]",
@@ -140,92 +140,94 @@ const $03960a2740ca2b19$var$rowBackgroundColor = {
140
140
  }
141
141
  };
142
142
  const $03960a2740ca2b19$var$treeRow = function anonymous(props) {
143
- let rules = " .";
144
- rules += ' Vc';
145
- rules += ' _0d';
146
- rules += ' k2';
147
- rules += ' lb';
148
- rules += ' __oa';
149
- rules += ' _d-bc1l9oh';
150
- rules += ' _d-1uotwbwg';
151
- rules += ' _d-eo0c6sf';
152
- rules += ' _d-enzzrge';
153
- rules += ' _d-enzykdd';
154
- rules += ' _d-enzwzjc';
155
- rules += ' _d-enzrfpb';
156
- rules += ' _da';
157
- rules += ' _ebf';
158
- rules += ' _ee';
159
- rules += ' _fb';
160
- rules += ' _g-1x99dlob';
161
- rules += ' _ga';
162
- rules += ' an';
163
- rules += ' _Ma';
164
- if (props.isLink) rules += ' __Ic';
165
- else rules += ' __Ib';
166
- rules += ' -_19jpv4m_b-a_____H';
143
+ let rules = " ";
144
+ rules += ' Ka';
145
+ rules += ' ma';
146
+ rules += ' ed';
147
+ rules += ' fa';
148
+ rules += ' _qa';
149
+ rules += ' bh';
150
+ rules += ' bdf';
151
+ rules += ' beg';
152
+ rules += ' bfa';
153
+ rules += ' bgb';
154
+ rules += ' bhd';
155
+ rules += ' bje';
156
+ rules += ' bic';
157
+ rules += ' aa';
158
+ rules += ' aab';
159
+ rules += ' Da';
160
+ rules += ' Ea';
161
+ rules += ' Ca';
162
+ rules += ' gb';
163
+ rules += ' gca';
164
+ rules += ' da';
165
+ rules += ' ta';
166
+ if (props.isLink) rules += ' Ab';
167
+ else rules += ' Aa';
167
168
  if (props.isSelected) {
168
169
  if (props.isPressed) {
169
- if (props.isEmphasized) rules += ' -_19jpv4m_b--1hocwbr';
170
- else rules += ' -_19jpv4m_b--17nxj1';
170
+ if (props.isEmphasized) rules += ' -qH4xad-cxABkr';
171
+ else rules += ' -qH4xad-cRfT7e';
171
172
  } else if (props.isHovered) {
172
- if (props.isEmphasized) rules += ' -_19jpv4m_b--1hocwbr';
173
- else rules += ' -_19jpv4m_b--17nxj1';
173
+ if (props.isEmphasized) rules += ' -qH4xad-cxABkr';
174
+ else rules += ' -qH4xad-cRfT7e';
174
175
  } else if (props.isFocusVisibleWithin) {
175
- if (props.isEmphasized) rules += ' -_19jpv4m_b--1hocwbr';
176
- else rules += ' -_19jpv4m_b--17nxj1';
177
- } else if (props.isEmphasized) rules += ' -_19jpv4m_b--sogeql';
178
- else rules += ' -_19jpv4m_b--26tcdv';
179
- } else if (props.isPressed) rules += ' -_19jpv4m_b--17nxj1';
180
- else if (props.isHovered) rules += ' -_19jpv4m_b--26tcdv';
181
- else if (props.isFocusVisibleWithin) rules += ' -_19jpv4m_b--26tcdv';
182
- else rules += ' -_19jpv4m_b--1de2x0q';
183
- rules += ' -oorfdf_d-a_____M';
184
- rules += ' -oorfdf_d-x';
176
+ if (props.isEmphasized) rules += ' -qH4xad-cxABkr';
177
+ else rules += ' -qH4xad-cRfT7e';
178
+ } else if (props.isEmphasized) rules += ' -qH4xad-cxABkr';
179
+ else rules += ' -qH4xad-cj1B7i';
180
+ } else if (props.isPressed) rules += ' -qH4xad-cRfT7e';
181
+ else if (props.isHovered) rules += ' -qH4xad-cj1B7i';
182
+ else if (props.isFocusVisibleWithin) rules += ' -qH4xad-cj1B7i';
183
+ else rules += ' -qH4xad-cEzkoQe';
184
+ rules += ' -qH4xad-bcx';
185
+ rules += ' -_34HbNb-Bb';
186
+ rules += ' -_34HbNb-bBa';
185
187
  return rules;
186
188
  };
187
189
  const $03960a2740ca2b19$var$treeCellGrid = function anonymous(props) {
188
- let rules = " .";
189
- rules += ' _0f';
190
- rules += ' lb';
191
- rules += ' kb';
192
- rules += ' __oa';
193
- rules += ' _1b';
194
- rules += ' _2c';
195
- rules += ' __i-22ig44';
196
- rules += ' __j-2wzs0i';
197
- rules += ' __k-17p9pp0';
198
- rules += ' b-19jpv4m';
199
- rules += ' Dc';
190
+ let rules = " ";
191
+ rules += ' mb';
192
+ rules += ' fa';
193
+ rules += ' ef';
194
+ rules += ' _qa';
195
+ rules += ' _Ja';
196
+ rules += ' Fa';
197
+ rules += ' Sw9uTxc';
198
+ rules += ' _FM8Mfn';
199
+ rules += ' _ugjMZ2c';
200
+ rules += ' cs9yXOb';
201
+ rules += ' ne';
200
202
  if (props.isDisabled) {
201
- rules += ' aa_____O';
202
- rules += ' aj';
203
+ rules += ' dc';
204
+ rules += ' dbe';
203
205
  }
204
- rules += ' -fm23a5_d-a_____M';
205
- if (props.isFocusVisible) rules += ' -fm23a5_d-x';
206
- else rules += ' -fm23a5_d-n';
207
- rules += ' -_17c7snb_d-a_____M';
208
- rules += ' -_17c7snb_d-x';
206
+ if (props.isFocusVisible) rules += ' -_7xg3bb-Bb';
207
+ else rules += ' -_7xg3bb-Bj';
208
+ rules += ' -_7xg3bb-bBa';
209
+ rules += ' -pKMv1c-Bb';
210
+ rules += ' -pKMv1c-bBa';
209
211
  if (props.isDetached) {
210
- if (props.isSelected) rules += ' c-fm23a5';
211
- else rules += ' ca';
212
+ if (props.isSelected) rules += ' qBGbjub';
213
+ else rules += ' qe';
212
214
  }
213
- if (props.isDetached) rules += ' ub';
214
- if (props.isDetached) rules += ' vb';
215
- if (props.isDetached) rules += ' sb';
216
- if (props.isDetached) rules += ' tb';
217
- if (props.isDetached) rules += ' _wc';
218
- if (props.isDetached) rules += ' _xc';
219
- if (props.isDetached) rules += ' _yc';
220
- if (props.isDetached) rules += ' _zc';
221
- if (props.isDetached) rules += ' wa';
215
+ if (props.isDetached) rules += ' _nc';
216
+ if (props.isDetached) rules += ' _mb';
217
+ if (props.isDetached) rules += ' _tc';
218
+ if (props.isDetached) rules += ' _sc';
219
+ if (props.isDetached) rules += ' zc';
220
+ if (props.isDetached) rules += ' xc';
221
+ if (props.isDetached) rules += ' wc';
222
+ if (props.isDetached) rules += ' yc';
223
+ if (props.isDetached) rules += ' Ra';
222
224
  return rules;
223
225
  };
224
- const $03960a2740ca2b19$var$treeCheckbox = " __b-5dolv4 __c-5dolv4 __d-5dolv4 __e-5dolv4 ye za Da";
225
- const $03960a2740ca2b19$var$treeIcon = " __b-qb5q8i __c-qb5q8i __d-qb5q8i __e-qb5q8i zG zbH -rwx0fg_e-b";
226
- const $03960a2740ca2b19$var$treeContent = " __b-drkpd0 __c-drkpd0 __d-drkpd0 __e-drkpd0 _na _qb __wb __xb";
227
- const $03960a2740ca2b19$var$treeActions = " __b-1k7szui __c-1k7szui __d-1k7szui __e-1k7szui yb zc";
228
- const $03960a2740ca2b19$var$treeActionMenu = " __b-2npmt8 __c-2npmt8 __d-2npmt8 __e-2npmt8";
226
+ const $03960a2740ca2b19$var$treeCheckbox = " LoRzcu NoRzcu _foRzcu _doRzcu ho ia na";
227
+ const $03960a2740ca2b19$var$treeIcon = " L2U5Crc N2U5Crc _f2U5Crc _d2U5Crc ic iad -_8sjo0b-Oa";
228
+ const $03960a2740ca2b19$var$treeContent = " Lk52g2d Nk52g2d _fk52g2d _dk52g2d _Ta _za _oa _ha";
229
+ const $03960a2740ca2b19$var$treeActions = " LkG38H NkG38H _fkG38H _dkG38H hn ib";
230
+ const $03960a2740ca2b19$var$treeActionMenu = " L6Nrfjc N6Nrfjc _f6Nrfjc _d6Nrfjc";
229
231
  const $03960a2740ca2b19$var$cellFocus = {
230
232
  outlineStyle: {
231
233
  default: 'none',
@@ -236,7 +238,7 @@ const $03960a2740ca2b19$var$cellFocus = {
236
238
  outlineColor: 'focus-ring',
237
239
  borderRadius: '[6px]'
238
240
  };
239
- const $03960a2740ca2b19$var$treeRowFocusIndicator = "-lc8e11";
241
+ const $03960a2740ca2b19$var$treeRowFocusIndicator = "tDhuzb";
240
242
  const $03960a2740ca2b19$export$6e77ea6719814e9c = (props)=>{
241
243
  let { href: href } = props;
242
244
  let { isDetached: isDetached, isEmphasized: isEmphasized } = (0, $iOVFT$useContext)($03960a2740ca2b19$var$InternalTreeContext);
@@ -279,7 +281,7 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props1)=>{
279
281
  })
280
282
  }),
281
283
  /*#__PURE__*/ (0, $iOVFT$jsx)("div", {
282
- className: " __b-u3oh8l __c-u3oh8l __d-u3oh8l __e-u3oh8l l-19lybgs"
284
+ className: " L7fSmKc N7fSmKc _f7fSmKc _d7fSmKc fecPNad"
283
285
  }),
284
286
  /*#__PURE__*/ (0, $iOVFT$jsx)($03960a2740ca2b19$var$ExpandableRowChevron, {
285
287
  isDisabled: isDisabled,
@@ -302,7 +304,7 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props1)=>{
302
304
  slot: 'icon',
303
305
  styles: $03960a2740ca2b19$var$treeIcon
304
306
  }),
305
- styles: " l-1sthc3k k-1sthc3k _9-3t1x"
307
+ styles: " fuUmpre euUmpre _ra"
306
308
  }
307
309
  ],
308
310
  [
@@ -324,22 +326,22 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props1)=>{
324
326
  isFocusVisible && isDetached && /*#__PURE__*/ (0, $iOVFT$jsx)("div", {
325
327
  role: "presentation",
326
328
  className: function anonymous(props) {
327
- let rules = " .";
328
- if (props.isFocusVisible) rules += ' _Mb';
329
- else rules += ' _Ma';
330
- rules += ' _N-3hmpw';
331
- rules += ' _Oc';
332
- rules += ' da_____M';
333
- rules += ' dx';
334
- rules += ' _w-3762yr';
335
- rules += ' _x-3762yr';
336
- rules += ' _y-3762yr';
337
- rules += ' _z-3762yr';
338
- rules += ' Va';
339
- rules += ' Ya';
340
- rules += ' _aa';
341
- rules += ' Wa';
342
- rules += ' Xa';
329
+ let rules = " ";
330
+ if (props.isFocusVisible) rules += ' tb';
331
+ else rules += ' ta';
332
+ rules += ' _yb';
333
+ rules += ' _ga';
334
+ rules += ' Bb';
335
+ rules += ' Bba';
336
+ rules += ' z1DOfn';
337
+ rules += ' x1DOfn';
338
+ rules += ' w1DOfn';
339
+ rules += ' y1DOfn';
340
+ rules += ' Kb';
341
+ rules += ' Ha';
342
+ rules += ' Ga';
343
+ rules += ' Ja';
344
+ rules += ' Ia';
343
345
  return rules;
344
346
  }({
345
347
  isFocusVisible: true
@@ -351,38 +353,38 @@ const $03960a2740ca2b19$export$9a5779ed3fade674 = (props1)=>{
351
353
  });
352
354
  };
353
355
  const $03960a2740ca2b19$var$expandButton = function anonymous(props) {
354
- let rules = " .";
355
- rules += ' __b-ajol1u';
356
- rules += ' __c-ajol1u';
357
- rules += ' __d-ajol1u';
358
- rules += ' __e-ajol1u';
356
+ let rules = " ";
357
+ rules += ' L8dW5Qb';
358
+ rules += ' N8dW5Qb';
359
+ rules += ' _f8dW5Qb';
360
+ rules += ' _d8dW5Qb';
359
361
  if (props.isDisabled) {
360
- rules += ' aa_____O';
361
- rules += ' aj';
362
- } else rules += ' a-17zqamw';
363
- rules += ' k2';
364
- rules += ' l2';
365
- rules += ' _0d';
366
- rules += ' _8a';
367
- rules += ' _1b';
368
- rules += ' _3d';
369
- rules += ' _Ma';
370
- rules += ' __Ib';
362
+ rules += ' dc';
363
+ rules += ' dbe';
364
+ } else rules += ' d40ub4c';
365
+ rules += ' ed';
366
+ rules += ' fi';
367
+ rules += ' ma';
368
+ rules += ' _3a';
369
+ rules += ' _Ja';
370
+ rules += ' _pa';
371
+ rules += ' ta';
372
+ rules += ' Aa';
371
373
  if (props.isExpanded) {
372
- if (props.isRTL) rules += ' U-197phm7';
373
- else rules += ' U-7hkt2a';
374
+ if (props.isRTL) rules += ' __Ma';
375
+ else rules += ' __Mb';
374
376
  }
375
- rules += ' Ea';
376
- rules += ' Fa';
377
- rules += ' Ca';
378
- rules += ' Da';
379
- rules += ' _Pa';
380
- rules += ' _R-375x7f';
381
- rules += ' _Sa';
382
- rules += ' ba';
383
- rules += ' wf';
384
- rules += ' __S-yksgrp';
385
- if (props.isHidden) rules += ' __Fb';
377
+ rules += ' ra';
378
+ rules += ' va';
379
+ rules += ' oa';
380
+ rules += ' na';
381
+ rules += ' _ia';
382
+ rules += ' _ka';
383
+ rules += ' _ea';
384
+ rules += ' cd';
385
+ rules += ' Rb';
386
+ rules += ' _Ga';
387
+ if (props.isHidden) rules += ' _8a';
386
388
  return rules;
387
389
  };
388
390
  function $03960a2740ca2b19$var$ExpandableRowChevron(props1) {
@@ -410,12 +412,22 @@ function $03960a2740ca2b19$var$ExpandableRowChevron(props1) {
410
412
  }),
411
413
  children: /*#__PURE__*/ (0, $iOVFT$jsx)((0, $4b69f02ec06b9226$export$2e2bcd8739ae039), {
412
414
  className: function anonymous(props) {
413
- let rules = " .";
414
- if (props.direction === "rtl") rules += ' S-yizn7r';
415
- else if (props.direction === "ltr") rules += ' S-375khm';
416
- if (props.direction === "rtl") rules += ' T-yizn7r';
417
- else if (props.direction === "ltr") rules += ' T-375khm';
418
- rules += ' -rwx0fg_e-b';
415
+ let rules = " ";
416
+ if (props.direction === "rtl") {
417
+ rules += ' -Z4Pn4c-zZKy';
418
+ rules += ' __oa';
419
+ } else if (props.direction === "ltr") {
420
+ rules += ' -Z4Pn4c-2mU';
421
+ rules += ' __oa';
422
+ }
423
+ if (props.direction === "rtl") {
424
+ rules += ' -_04Pn4c-zZKy';
425
+ rules += ' __oa';
426
+ } else if (props.direction === "ltr") {
427
+ rules += ' -_04Pn4c-2mU';
428
+ rules += ' __oa';
429
+ }
430
+ rules += ' -_8sjo0b-Oa';
419
431
  return rules;
420
432
  }({
421
433
  direction: direction
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAsDD,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA4B,CAAC;AAGrE,IAAI,0DAAsB,CAAA,GAAA,oBAAY,EAAkD,CAAC;AAEzF,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AAK;QACH,GAAG,MAAK;QACT,KAAK;QACL,MAAK;QACL,kHAAkH;QAClH,qBAAqB,CAAA,GAAA,gBAAQ,OAAO,CAAC;QACrC,mBAAmB;QACnB,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;AAEA;;CAEC,GACD,MAAM,0DAAY,CAAA,GAAA,iBAAS,EAAE","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 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, Key} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {isAndroid} from '@react-aria/utils';\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} from 'react-aria';\nimport {useScale} from './utils';\n\ninterface S2TreeProps {\n // Only detatched is supported right now with the current styles from Spectrum\n isDetached?: boolean,\n onAction?: (key: Key) => void,\n // not fully supported yet\n isEmphasized?: boolean\n}\n\nexport interface TreeViewProps extends Omit<RACTreeProps<any>, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks'>, UnsafeStyles, S2TreeProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nexport interface TreeViewItemProps extends Omit<RACTreeItemProps, 'className' | 'style'> {\n /** Whether this item has children, even if not loaded yet. */\n hasChildItems?: boolean\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\nfunction TreeView(props: TreeViewProps, 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\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 {/* TODO: revisit when we do async loading, at the moment hasChildItems will only cause the chevron to be rendered, no aria/data attributes indicating the row's expandability are added */}\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\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, isDisabled, scale, isHidden} = fullProps;\n let {direction} = useLocale();\n isDisabled = isDisabled || isHidden;\n\n return (\n <Button\n {...props}\n ref={ref}\n slot=\"chevron\"\n // Override tabindex so that grid keyboard nav skips over it. Needs -1 so android talkback can actually \"focus\" it\n excludeFromTabOrder={isAndroid() && !isDisabled}\n preventFocusOnPress\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\n/**\n * A tree view provides users with a way to navigate nested hierarchical information.\n */\nconst _TreeView = forwardRef(TreeView);\nexport {_TreeView as TreeView};\n"],"names":[],"version":3,"file":"TreeView.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAsDD,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA4B,CAAC;AAGrE,IAAI,0DAAsB,CAAA,GAAA,oBAAY,EAAkD,CAAC;AAEzF,4KAA4K;AAC5K,gHAAgH;AAChH,sIAAsI;AACtI,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBN,SAAS,+BAAS,KAAoB,EAAE,GAA2B;IACjE,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,OAAO;0BAAC;YAAQ;sBAC5C,cAAA,gBAAC,0CAAoB,QAAQ;gBAAC,OAAO;gCAAC;kCAAY;gBAAY;0BAC5D,cAAA,gBAAC,CAAA,GAAA,WAAG;oBACD,GAAG,KAAK;oBACT,OAAO;oBACP,WAAW,CAAA,cAAe,AAAC,CAA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;;;;;;0BAAsD;4BAAC,gBAAgB;wBAAI;;;;QAGtJ;;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,cAAE,UAAU,SAAE,KAAK,YAAE,QAAQ,EAAC,GAAG;IAChD,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAC1B,aAAa,cAAc;IAE3B,qBACE,gBAAC,CAAA,GAAA,aAAK;QACH,GAAG,MAAK;QACT,KAAK;QACL,MAAK;QACL,kHAAkH;QAClH,qBAAqB,CAAA,GAAA,gBAAQ,OAAO,CAAC;QACrC,mBAAmB;QACnB,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;AAEA;;CAEC,GACD,MAAM,0DAAY,CAAA,GAAA,iBAAS,EAAE","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 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, Key} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {isAndroid} from '@react-aria/utils';\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} from 'react-aria';\nimport {useScale} from './utils';\n\ninterface S2TreeProps {\n // Only detatched is supported right now with the current styles from Spectrum\n isDetached?: boolean,\n onAction?: (key: Key) => void,\n // not fully supported yet\n isEmphasized?: boolean\n}\n\nexport interface TreeViewProps extends Omit<RACTreeProps<any>, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks'>, UnsafeStyles, S2TreeProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nexport interface TreeViewItemProps extends Omit<RACTreeItemProps, 'className' | 'style'> {\n /** Whether this item has children, even if not loaded yet. */\n hasChildItems?: boolean\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\nfunction TreeView(props: TreeViewProps, 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\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 {/* TODO: revisit when we do async loading, at the moment hasChildItems will only cause the chevron to be rendered, no aria/data attributes indicating the row's expandability are added */}\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\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, isDisabled, scale, isHidden} = fullProps;\n let {direction} = useLocale();\n isDisabled = isDisabled || isHidden;\n\n return (\n <Button\n {...props}\n ref={ref}\n slot=\"chevron\"\n // Override tabindex so that grid keyboard nav skips over it. Needs -1 so android talkback can actually \"focus\" it\n excludeFromTabOrder={isAndroid() && !isDisabled}\n preventFocusOnPress\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\n/**\n * A tree view provides users with a way to navigate nested hierarchical information.\n */\nconst _TreeView = forwardRef(TreeView);\nexport {_TreeView as TreeView};\n"],"names":[],"version":3,"file":"TreeView.mjs.map"}
package/dist/types.d.ts CHANGED
@@ -9,7 +9,7 @@ import { ColumnSize } from "@react-types/table";
9
9
  type StyleString<P = string> = string & {
10
10
  properties: P;
11
11
  };
12
- declare const allowedOverrides: readonly ["margin", "marginStart", "marginEnd", "marginTop", "marginBottom", "marginX", "marginY", "flexGrow", "flexShrink", "flexBasis", "justifySelf", "alignSelf", "order", "gridArea", "gridRow", "gridRowStart", "gridRowEnd", "gridColumn", "gridColumnStart", "gridColumnEnd", "position", "zIndex", "top", "bottom", "inset", "insetX", "insetY", "insetStart", "insetEnd"];
12
+ declare const allowedOverrides: readonly ["margin", "marginStart", "marginEnd", "marginTop", "marginBottom", "marginX", "marginY", "flexGrow", "flexShrink", "flexBasis", "justifySelf", "alignSelf", "order", "gridArea", "gridRowStart", "gridRowEnd", "gridColumnStart", "gridColumnEnd", "position", "zIndex", "top", "bottom", "inset", "insetX", "insetY", "insetStart", "insetEnd"];
13
13
  declare const widthProperties: readonly ["width", "minWidth", "maxWidth"];
14
14
  declare const heightProperties: readonly ["size", "height", "minHeight", "maxHeight"];
15
15
  type StylesProp = StyleString<(typeof allowedOverrides)[number] | (typeof widthProperties)[number]>;