@mortenbrudvik/waveui 0.4.0 → 0.8.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.
Files changed (650) hide show
  1. package/README.md +1484 -173
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  3. package/dist/components/button/Button.cjs +2 -0
  4. package/dist/components/button/Button.cjs.map +1 -0
  5. package/dist/components/button/Button.mjs +51 -0
  6. package/dist/components/button/Button.mjs.map +1 -0
  7. package/dist/components/button/Button.semantics.cjs +2 -0
  8. package/dist/components/button/Button.semantics.cjs.map +1 -0
  9. package/dist/components/button/Button.semantics.mjs +61 -0
  10. package/dist/components/button/Button.semantics.mjs.map +1 -0
  11. package/dist/components/button/Button.slots.cjs +2 -0
  12. package/dist/components/button/Button.slots.cjs.map +1 -0
  13. package/dist/components/button/Button.slots.mjs +57 -0
  14. package/dist/components/button/Button.slots.mjs.map +1 -0
  15. package/dist/components/button/CompoundButton.cjs +2 -0
  16. package/dist/components/button/CompoundButton.cjs.map +1 -0
  17. package/dist/components/button/CompoundButton.mjs +55 -0
  18. package/dist/components/button/CompoundButton.mjs.map +1 -0
  19. package/dist/components/button/Link.cjs +2 -0
  20. package/dist/components/button/Link.cjs.map +1 -0
  21. package/dist/components/button/Link.mjs +38 -0
  22. package/dist/components/button/Link.mjs.map +1 -0
  23. package/dist/components/button/MenuButton.cjs +2 -0
  24. package/dist/components/button/MenuButton.cjs.map +1 -0
  25. package/dist/components/button/MenuButton.mjs +46 -0
  26. package/dist/components/button/MenuButton.mjs.map +1 -0
  27. package/dist/components/button/SplitButton.cjs +2 -0
  28. package/dist/components/button/SplitButton.cjs.map +1 -0
  29. package/dist/components/button/SplitButton.mjs +67 -0
  30. package/dist/components/button/SplitButton.mjs.map +1 -0
  31. package/dist/components/button/ToggleButton.cjs +2 -0
  32. package/dist/components/button/ToggleButton.cjs.map +1 -0
  33. package/dist/components/button/ToggleButton.mjs +68 -0
  34. package/dist/components/button/ToggleButton.mjs.map +1 -0
  35. package/dist/components/button/Toolbar.cjs +2 -0
  36. package/dist/components/button/Toolbar.cjs.map +1 -0
  37. package/dist/components/button/Toolbar.context.cjs +2 -0
  38. package/dist/components/button/Toolbar.context.cjs.map +1 -0
  39. package/dist/components/button/Toolbar.context.mjs +31 -0
  40. package/dist/components/button/Toolbar.context.mjs.map +1 -0
  41. package/dist/components/button/Toolbar.mjs +64 -0
  42. package/dist/components/button/Toolbar.mjs.map +1 -0
  43. package/dist/components/button/Toolbar.parts.cjs +2 -0
  44. package/dist/components/button/Toolbar.parts.cjs.map +1 -0
  45. package/dist/components/button/Toolbar.parts.mjs +126 -0
  46. package/dist/components/button/Toolbar.parts.mjs.map +1 -0
  47. package/dist/components/button/buttonStyles.cjs +2 -0
  48. package/dist/components/button/buttonStyles.cjs.map +1 -0
  49. package/dist/components/button/buttonStyles.mjs +39 -0
  50. package/dist/components/button/buttonStyles.mjs.map +1 -0
  51. package/dist/components/data-display/Avatar.cjs +2 -0
  52. package/dist/components/data-display/Avatar.cjs.map +1 -0
  53. package/dist/components/data-display/Avatar.mjs +162 -0
  54. package/dist/components/data-display/Avatar.mjs.map +1 -0
  55. package/dist/components/data-display/AvatarGroup.cjs +2 -0
  56. package/dist/components/data-display/AvatarGroup.cjs.map +1 -0
  57. package/dist/components/data-display/AvatarGroup.mjs +135 -0
  58. package/dist/components/data-display/AvatarGroup.mjs.map +1 -0
  59. package/dist/components/data-display/Badge.cjs +2 -0
  60. package/dist/components/data-display/Badge.cjs.map +1 -0
  61. package/dist/components/data-display/Badge.colors.cjs +2 -0
  62. package/dist/components/data-display/Badge.colors.cjs.map +1 -0
  63. package/dist/components/data-display/Badge.colors.mjs +58 -0
  64. package/dist/components/data-display/Badge.colors.mjs.map +1 -0
  65. package/dist/components/data-display/Badge.mjs +33 -0
  66. package/dist/components/data-display/Badge.mjs.map +1 -0
  67. package/dist/components/data-display/CounterBadge.cjs +2 -0
  68. package/dist/components/data-display/CounterBadge.cjs.map +1 -0
  69. package/dist/components/data-display/CounterBadge.mjs +29 -0
  70. package/dist/components/data-display/CounterBadge.mjs.map +1 -0
  71. package/dist/components/data-display/Divider.cjs +2 -0
  72. package/dist/components/data-display/Divider.cjs.map +1 -0
  73. package/dist/components/data-display/Divider.mjs +53 -0
  74. package/dist/components/data-display/Divider.mjs.map +1 -0
  75. package/dist/components/data-display/Image.cjs +2 -0
  76. package/dist/components/data-display/Image.cjs.map +1 -0
  77. package/dist/components/data-display/Image.mjs +33 -0
  78. package/dist/components/data-display/Image.mjs.map +1 -0
  79. package/dist/components/data-display/InfoLabel.cjs +2 -0
  80. package/dist/components/data-display/InfoLabel.cjs.map +1 -0
  81. package/dist/components/data-display/InfoLabel.mjs +105 -0
  82. package/dist/components/data-display/InfoLabel.mjs.map +1 -0
  83. package/dist/components/data-display/List.cjs +2 -0
  84. package/dist/components/data-display/List.cjs.map +1 -0
  85. package/dist/components/data-display/List.mjs +382 -0
  86. package/dist/components/data-display/List.mjs.map +1 -0
  87. package/dist/components/data-display/List.registry.cjs +2 -0
  88. package/dist/components/data-display/List.registry.cjs.map +1 -0
  89. package/dist/components/data-display/List.registry.mjs +101 -0
  90. package/dist/components/data-display/List.registry.mjs.map +1 -0
  91. package/dist/components/data-display/Persona.cjs +2 -0
  92. package/dist/components/data-display/Persona.cjs.map +1 -0
  93. package/dist/components/data-display/Persona.mjs +50 -0
  94. package/dist/components/data-display/Persona.mjs.map +1 -0
  95. package/dist/components/data-display/PresenceBadge.cjs +2 -0
  96. package/dist/components/data-display/PresenceBadge.cjs.map +1 -0
  97. package/dist/components/data-display/PresenceBadge.mjs +72 -0
  98. package/dist/components/data-display/PresenceBadge.mjs.map +1 -0
  99. package/dist/components/data-display/Tag.cjs +2 -0
  100. package/dist/components/data-display/Tag.cjs.map +1 -0
  101. package/dist/components/data-display/Tag.mjs +152 -0
  102. package/dist/components/data-display/Tag.mjs.map +1 -0
  103. package/dist/components/feedback/MessageBar.cjs +2 -0
  104. package/dist/components/feedback/MessageBar.cjs.map +1 -0
  105. package/dist/components/feedback/MessageBar.mjs +202 -0
  106. package/dist/components/feedback/MessageBar.mjs.map +1 -0
  107. package/dist/components/feedback/MessageBar.parts.cjs +2 -0
  108. package/dist/components/feedback/MessageBar.parts.cjs.map +1 -0
  109. package/dist/components/feedback/MessageBar.parts.mjs +84 -0
  110. package/dist/components/feedback/MessageBar.parts.mjs.map +1 -0
  111. package/dist/components/feedback/MessageBar.reflow.cjs +2 -0
  112. package/dist/components/feedback/MessageBar.reflow.cjs.map +1 -0
  113. package/dist/components/feedback/MessageBar.reflow.mjs +74 -0
  114. package/dist/components/feedback/MessageBar.reflow.mjs.map +1 -0
  115. package/dist/components/feedback/MessageBar.status.cjs +2 -0
  116. package/dist/components/feedback/MessageBar.status.cjs.map +1 -0
  117. package/dist/components/feedback/MessageBar.status.mjs +46 -0
  118. package/dist/components/feedback/MessageBar.status.mjs.map +1 -0
  119. package/dist/components/feedback/ProgressBar.cjs +2 -0
  120. package/dist/components/feedback/ProgressBar.cjs.map +1 -0
  121. package/dist/components/feedback/ProgressBar.mjs +73 -0
  122. package/dist/components/feedback/ProgressBar.mjs.map +1 -0
  123. package/dist/components/feedback/Skeleton.cjs +2 -0
  124. package/dist/components/feedback/Skeleton.cjs.map +1 -0
  125. package/dist/components/feedback/Skeleton.mjs +49 -0
  126. package/dist/components/feedback/Skeleton.mjs.map +1 -0
  127. package/dist/components/feedback/Spinner.cjs +2 -0
  128. package/dist/components/feedback/Spinner.cjs.map +1 -0
  129. package/dist/components/feedback/Spinner.mjs +61 -0
  130. package/dist/components/feedback/Spinner.mjs.map +1 -0
  131. package/dist/components/feedback/Toast.cjs +2 -0
  132. package/dist/components/feedback/Toast.cjs.map +1 -0
  133. package/dist/components/feedback/Toast.context.cjs +2 -0
  134. package/dist/components/feedback/Toast.context.cjs.map +1 -0
  135. package/dist/components/feedback/Toast.context.mjs +23 -0
  136. package/dist/components/feedback/Toast.context.mjs.map +1 -0
  137. package/dist/components/feedback/Toast.mjs +15 -0
  138. package/dist/components/feedback/Toast.mjs.map +1 -0
  139. package/dist/components/feedback/Toast.parts.cjs +2 -0
  140. package/dist/components/feedback/Toast.parts.cjs.map +1 -0
  141. package/dist/components/feedback/Toast.parts.mjs +98 -0
  142. package/dist/components/feedback/Toast.parts.mjs.map +1 -0
  143. package/dist/components/feedback/Toast.root.cjs +2 -0
  144. package/dist/components/feedback/Toast.root.cjs.map +1 -0
  145. package/dist/components/feedback/Toast.root.mjs +109 -0
  146. package/dist/components/feedback/Toast.root.mjs.map +1 -0
  147. package/dist/components/feedback/Toaster.cjs +2 -0
  148. package/dist/components/feedback/Toaster.cjs.map +1 -0
  149. package/dist/components/feedback/Toaster.mjs +564 -0
  150. package/dist/components/feedback/Toaster.mjs.map +1 -0
  151. package/dist/components/input/AlphaSlider.cjs +2 -0
  152. package/dist/components/input/AlphaSlider.cjs.map +1 -0
  153. package/dist/components/input/AlphaSlider.mjs +115 -0
  154. package/dist/components/input/AlphaSlider.mjs.map +1 -0
  155. package/dist/components/input/Checkbox.cjs +2 -0
  156. package/dist/components/input/Checkbox.cjs.map +1 -0
  157. package/dist/components/input/Checkbox.mjs +97 -0
  158. package/dist/components/input/Checkbox.mjs.map +1 -0
  159. package/dist/components/input/ColorArea.cjs +2 -0
  160. package/dist/components/input/ColorArea.cjs.map +1 -0
  161. package/dist/components/input/ColorArea.mjs +204 -0
  162. package/dist/components/input/ColorArea.mjs.map +1 -0
  163. package/dist/components/input/ColorPicker.cjs +6 -0
  164. package/dist/components/input/ColorPicker.cjs.map +1 -0
  165. package/dist/components/input/ColorPicker.mjs +213 -0
  166. package/dist/components/input/ColorPicker.mjs.map +1 -0
  167. package/dist/components/input/ColorPicker.parts.cjs +2 -0
  168. package/dist/components/input/ColorPicker.parts.cjs.map +1 -0
  169. package/dist/components/input/ColorPicker.parts.mjs +192 -0
  170. package/dist/components/input/ColorPicker.parts.mjs.map +1 -0
  171. package/dist/components/input/ColorSlider.cjs +2 -0
  172. package/dist/components/input/ColorSlider.cjs.map +1 -0
  173. package/dist/components/input/ColorSlider.mjs +138 -0
  174. package/dist/components/input/ColorSlider.mjs.map +1 -0
  175. package/dist/components/input/Combobox.cjs +2 -0
  176. package/dist/components/input/Combobox.cjs.map +1 -0
  177. package/dist/components/input/Combobox.expand.cjs +2 -0
  178. package/dist/components/input/Combobox.expand.cjs.map +1 -0
  179. package/dist/components/input/Combobox.expand.mjs +38 -0
  180. package/dist/components/input/Combobox.expand.mjs.map +1 -0
  181. package/dist/components/input/Combobox.mjs +192 -0
  182. package/dist/components/input/Combobox.mjs.map +1 -0
  183. package/dist/components/input/DatePicker.cjs +2 -0
  184. package/dist/components/input/DatePicker.cjs.map +1 -0
  185. package/dist/components/input/DatePicker.mjs +341 -0
  186. package/dist/components/input/DatePicker.mjs.map +1 -0
  187. package/dist/components/input/Dropdown.cjs +2 -0
  188. package/dist/components/input/Dropdown.cjs.map +1 -0
  189. package/dist/components/input/Dropdown.mjs +131 -0
  190. package/dist/components/input/Dropdown.mjs.map +1 -0
  191. package/dist/components/input/Field.cjs +2 -0
  192. package/dist/components/input/Field.cjs.map +1 -0
  193. package/dist/components/input/Field.mjs +201 -0
  194. package/dist/components/input/Field.mjs.map +1 -0
  195. package/dist/components/input/Input.cjs +2 -0
  196. package/dist/components/input/Input.cjs.map +1 -0
  197. package/dist/components/input/Input.mjs +82 -0
  198. package/dist/components/input/Input.mjs.map +1 -0
  199. package/dist/components/input/Label.cjs +2 -0
  200. package/dist/components/input/Label.cjs.map +1 -0
  201. package/dist/components/input/Label.mjs +29 -0
  202. package/dist/components/input/Label.mjs.map +1 -0
  203. package/dist/components/input/Option.cjs +2 -0
  204. package/dist/components/input/Option.cjs.map +1 -0
  205. package/dist/components/input/Option.mjs +171 -0
  206. package/dist/components/input/Option.mjs.map +1 -0
  207. package/dist/components/input/RadioGroup.cjs +2 -0
  208. package/dist/components/input/RadioGroup.cjs.map +1 -0
  209. package/dist/components/input/RadioGroup.mjs +140 -0
  210. package/dist/components/input/RadioGroup.mjs.map +1 -0
  211. package/dist/components/input/Rating.cjs +2 -0
  212. package/dist/components/input/Rating.cjs.map +1 -0
  213. package/dist/components/input/Rating.mjs +197 -0
  214. package/dist/components/input/Rating.mjs.map +1 -0
  215. package/dist/components/input/SearchBox.cjs +2 -0
  216. package/dist/components/input/SearchBox.cjs.map +1 -0
  217. package/dist/components/input/SearchBox.mjs +204 -0
  218. package/dist/components/input/SearchBox.mjs.map +1 -0
  219. package/dist/components/input/Select.cjs +2 -0
  220. package/dist/components/input/Select.cjs.map +1 -0
  221. package/dist/components/input/Select.mjs +34 -0
  222. package/dist/components/input/Select.mjs.map +1 -0
  223. package/dist/components/input/Slider.cjs +2 -0
  224. package/dist/components/input/Slider.cjs.map +1 -0
  225. package/dist/components/input/Slider.mjs +80 -0
  226. package/dist/components/input/Slider.mjs.map +1 -0
  227. package/dist/components/input/SpinButton.cjs +2 -0
  228. package/dist/components/input/SpinButton.cjs.map +1 -0
  229. package/dist/components/input/SpinButton.mjs +158 -0
  230. package/dist/components/input/SpinButton.mjs.map +1 -0
  231. package/dist/components/input/SwatchPicker.cjs +2 -0
  232. package/dist/components/input/SwatchPicker.cjs.map +1 -0
  233. package/dist/components/input/SwatchPicker.mjs +114 -0
  234. package/dist/components/input/SwatchPicker.mjs.map +1 -0
  235. package/dist/components/input/Switch.cjs +2 -0
  236. package/dist/components/input/Switch.cjs.map +1 -0
  237. package/dist/components/input/Switch.mjs +93 -0
  238. package/dist/components/input/Switch.mjs.map +1 -0
  239. package/dist/components/input/TagPicker.cjs +2 -0
  240. package/dist/components/input/TagPicker.cjs.map +1 -0
  241. package/dist/components/input/TagPicker.mjs +253 -0
  242. package/dist/components/input/TagPicker.mjs.map +1 -0
  243. package/dist/components/input/Textarea.cjs +2 -0
  244. package/dist/components/input/Textarea.cjs.map +1 -0
  245. package/dist/components/input/Textarea.mjs +33 -0
  246. package/dist/components/input/Textarea.mjs.map +1 -0
  247. package/dist/components/input/TimePicker.cjs +2 -0
  248. package/dist/components/input/TimePicker.cjs.map +1 -0
  249. package/dist/components/input/TimePicker.mjs +295 -0
  250. package/dist/components/input/TimePicker.mjs.map +1 -0
  251. package/dist/components/input/colorName.cjs +2 -0
  252. package/dist/components/input/colorName.cjs.map +1 -0
  253. package/dist/components/input/colorName.mjs +30 -0
  254. package/dist/components/input/colorName.mjs.map +1 -0
  255. package/dist/components/input/colorUtils.cjs +2 -0
  256. package/dist/components/input/colorUtils.cjs.map +1 -0
  257. package/dist/components/input/colorUtils.mjs +194 -0
  258. package/dist/components/input/colorUtils.mjs.map +1 -0
  259. package/dist/components/input/dateUtils.cjs +2 -0
  260. package/dist/components/input/dateUtils.cjs.map +1 -0
  261. package/dist/components/input/dateUtils.mjs +250 -0
  262. package/dist/components/input/dateUtils.mjs.map +1 -0
  263. package/dist/components/input/pickerStyles.cjs +2 -0
  264. package/dist/components/input/pickerStyles.cjs.map +1 -0
  265. package/dist/components/input/pickerStyles.mjs +10 -0
  266. package/dist/components/input/pickerStyles.mjs.map +1 -0
  267. package/dist/components/internal/HiddenInput.cjs +2 -0
  268. package/dist/components/internal/HiddenInput.cjs.map +1 -0
  269. package/dist/components/internal/HiddenInput.mjs +88 -0
  270. package/dist/components/internal/HiddenInput.mjs.map +1 -0
  271. package/dist/components/layout/Accordion.cjs +2 -0
  272. package/dist/components/layout/Accordion.cjs.map +1 -0
  273. package/dist/components/layout/Accordion.mjs +237 -0
  274. package/dist/components/layout/Accordion.mjs.map +1 -0
  275. package/dist/components/layout/Card.cjs +2 -0
  276. package/dist/components/layout/Card.cjs.map +1 -0
  277. package/dist/components/layout/Card.mjs +122 -0
  278. package/dist/components/layout/Card.mjs.map +1 -0
  279. package/dist/components/layout/Carousel.cjs +2 -0
  280. package/dist/components/layout/Carousel.cjs.map +1 -0
  281. package/dist/components/layout/Carousel.mjs +206 -0
  282. package/dist/components/layout/Carousel.mjs.map +1 -0
  283. package/dist/components/layout/Flex.cjs +2 -0
  284. package/dist/components/layout/Flex.cjs.map +1 -0
  285. package/dist/components/layout/Flex.mjs +55 -0
  286. package/dist/components/layout/Flex.mjs.map +1 -0
  287. package/dist/components/layout/Grid.cjs +2 -0
  288. package/dist/components/layout/Grid.cjs.map +1 -0
  289. package/dist/components/layout/Grid.mjs +63 -0
  290. package/dist/components/layout/Grid.mjs.map +1 -0
  291. package/dist/components/layout/Overflow.cjs +2 -0
  292. package/dist/components/layout/Overflow.cjs.map +1 -0
  293. package/dist/components/layout/Overflow.mjs +270 -0
  294. package/dist/components/layout/Overflow.mjs.map +1 -0
  295. package/dist/components/layout/Stack.cjs +2 -0
  296. package/dist/components/layout/Stack.cjs.map +1 -0
  297. package/dist/components/layout/Stack.mjs +40 -0
  298. package/dist/components/layout/Stack.mjs.map +1 -0
  299. package/dist/components/layout/TabList.cjs +2 -0
  300. package/dist/components/layout/TabList.cjs.map +1 -0
  301. package/dist/components/layout/TabList.mjs +239 -0
  302. package/dist/components/layout/TabList.mjs.map +1 -0
  303. package/dist/components/layout/Tree.cjs +2 -0
  304. package/dist/components/layout/Tree.cjs.map +1 -0
  305. package/dist/components/layout/Tree.context.cjs +2 -0
  306. package/dist/components/layout/Tree.context.cjs.map +1 -0
  307. package/dist/components/layout/Tree.context.mjs +33 -0
  308. package/dist/components/layout/Tree.context.mjs.map +1 -0
  309. package/dist/components/layout/Tree.core.cjs +2 -0
  310. package/dist/components/layout/Tree.core.cjs.map +1 -0
  311. package/dist/components/layout/Tree.core.mjs +416 -0
  312. package/dist/components/layout/Tree.core.mjs.map +1 -0
  313. package/dist/components/layout/Tree.itemPersonaLayout.cjs +2 -0
  314. package/dist/components/layout/Tree.itemPersonaLayout.cjs.map +1 -0
  315. package/dist/components/layout/Tree.itemPersonaLayout.mjs +46 -0
  316. package/dist/components/layout/Tree.itemPersonaLayout.mjs.map +1 -0
  317. package/dist/components/layout/Tree.mjs +12 -0
  318. package/dist/components/layout/Tree.mjs.map +1 -0
  319. package/dist/components/layout/Tree.selection.cjs +2 -0
  320. package/dist/components/layout/Tree.selection.cjs.map +1 -0
  321. package/dist/components/layout/Tree.selection.mjs +73 -0
  322. package/dist/components/layout/Tree.selection.mjs.map +1 -0
  323. package/dist/components/layout/disclosureIds.cjs +2 -0
  324. package/dist/components/layout/disclosureIds.cjs.map +1 -0
  325. package/dist/components/layout/disclosureIds.mjs +12 -0
  326. package/dist/components/layout/disclosureIds.mjs.map +1 -0
  327. package/dist/components/motion/Presence.cjs +2 -0
  328. package/dist/components/motion/Presence.cjs.map +1 -0
  329. package/dist/components/motion/Presence.mjs +35 -0
  330. package/dist/components/motion/Presence.mjs.map +1 -0
  331. package/dist/components/navigation/Breadcrumb.cjs +2 -0
  332. package/dist/components/navigation/Breadcrumb.cjs.map +1 -0
  333. package/dist/components/navigation/Breadcrumb.mjs +145 -0
  334. package/dist/components/navigation/Breadcrumb.mjs.map +1 -0
  335. package/dist/components/navigation/Menu.cjs +2 -0
  336. package/dist/components/navigation/Menu.cjs.map +1 -0
  337. package/dist/components/navigation/Menu.context.cjs +2 -0
  338. package/dist/components/navigation/Menu.context.cjs.map +1 -0
  339. package/dist/components/navigation/Menu.context.mjs +82 -0
  340. package/dist/components/navigation/Menu.context.mjs.map +1 -0
  341. package/dist/components/navigation/Menu.group.cjs +2 -0
  342. package/dist/components/navigation/Menu.group.cjs.map +1 -0
  343. package/dist/components/navigation/Menu.group.mjs +60 -0
  344. package/dist/components/navigation/Menu.group.mjs.map +1 -0
  345. package/dist/components/navigation/Menu.items.cjs +2 -0
  346. package/dist/components/navigation/Menu.items.cjs.map +1 -0
  347. package/dist/components/navigation/Menu.items.mjs +133 -0
  348. package/dist/components/navigation/Menu.items.mjs.map +1 -0
  349. package/dist/components/navigation/Menu.link.cjs +2 -0
  350. package/dist/components/navigation/Menu.link.cjs.map +1 -0
  351. package/dist/components/navigation/Menu.link.mjs +47 -0
  352. package/dist/components/navigation/Menu.link.mjs.map +1 -0
  353. package/dist/components/navigation/Menu.mjs +27 -0
  354. package/dist/components/navigation/Menu.mjs.map +1 -0
  355. package/dist/components/navigation/Menu.popover.cjs +2 -0
  356. package/dist/components/navigation/Menu.popover.cjs.map +1 -0
  357. package/dist/components/navigation/Menu.popover.mjs +232 -0
  358. package/dist/components/navigation/Menu.popover.mjs.map +1 -0
  359. package/dist/components/navigation/Menu.root.cjs +2 -0
  360. package/dist/components/navigation/Menu.root.cjs.map +1 -0
  361. package/dist/components/navigation/Menu.root.mjs +309 -0
  362. package/dist/components/navigation/Menu.root.mjs.map +1 -0
  363. package/dist/components/navigation/Menu.selectable.cjs +2 -0
  364. package/dist/components/navigation/Menu.selectable.cjs.map +1 -0
  365. package/dist/components/navigation/Menu.selectable.mjs +111 -0
  366. package/dist/components/navigation/Menu.selectable.mjs.map +1 -0
  367. package/dist/components/navigation/Menu.shared.cjs +2 -0
  368. package/dist/components/navigation/Menu.shared.cjs.map +1 -0
  369. package/dist/components/navigation/Menu.shared.mjs +23 -0
  370. package/dist/components/navigation/Menu.shared.mjs.map +1 -0
  371. package/dist/components/navigation/Menu.splitGroup.cjs +2 -0
  372. package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -0
  373. package/dist/components/navigation/Menu.splitGroup.mjs +52 -0
  374. package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -0
  375. package/dist/components/navigation/Menu.trigger.cjs +2 -0
  376. package/dist/components/navigation/Menu.trigger.cjs.map +1 -0
  377. package/dist/components/navigation/Menu.trigger.mjs +79 -0
  378. package/dist/components/navigation/Menu.trigger.mjs.map +1 -0
  379. package/dist/components/navigation/Nav.cjs +2 -0
  380. package/dist/components/navigation/Nav.cjs.map +1 -0
  381. package/dist/components/navigation/Nav.mjs +291 -0
  382. package/dist/components/navigation/Nav.mjs.map +1 -0
  383. package/dist/components/navigation/Pagination.cjs +2 -0
  384. package/dist/components/navigation/Pagination.cjs.map +1 -0
  385. package/dist/components/navigation/Pagination.mjs +118 -0
  386. package/dist/components/navigation/Pagination.mjs.map +1 -0
  387. package/dist/components/navigation/Stepper.cjs +2 -0
  388. package/dist/components/navigation/Stepper.cjs.map +1 -0
  389. package/dist/components/navigation/Stepper.mjs +205 -0
  390. package/dist/components/navigation/Stepper.mjs.map +1 -0
  391. package/dist/components/overlays/Dialog.cjs +2 -0
  392. package/dist/components/overlays/Dialog.cjs.map +1 -0
  393. package/dist/components/overlays/Dialog.mjs +181 -0
  394. package/dist/components/overlays/Dialog.mjs.map +1 -0
  395. package/dist/components/overlays/Dialog.shared.cjs +2 -0
  396. package/dist/components/overlays/Dialog.shared.cjs.map +1 -0
  397. package/dist/components/overlays/Dialog.shared.mjs +227 -0
  398. package/dist/components/overlays/Dialog.shared.mjs.map +1 -0
  399. package/dist/components/overlays/Drawer.cjs +2 -0
  400. package/dist/components/overlays/Drawer.cjs.map +1 -0
  401. package/dist/components/overlays/Drawer.mjs +193 -0
  402. package/dist/components/overlays/Drawer.mjs.map +1 -0
  403. package/dist/components/overlays/Popover.cjs +2 -0
  404. package/dist/components/overlays/Popover.cjs.map +1 -0
  405. package/dist/components/overlays/Popover.mjs +367 -0
  406. package/dist/components/overlays/Popover.mjs.map +1 -0
  407. package/dist/components/overlays/Popover.shared.cjs +2 -0
  408. package/dist/components/overlays/Popover.shared.cjs.map +1 -0
  409. package/dist/components/overlays/Popover.shared.mjs +182 -0
  410. package/dist/components/overlays/Popover.shared.mjs.map +1 -0
  411. package/dist/components/overlays/TeachingPopover.cjs +2 -0
  412. package/dist/components/overlays/TeachingPopover.cjs.map +1 -0
  413. package/dist/components/overlays/TeachingPopover.mjs +185 -0
  414. package/dist/components/overlays/TeachingPopover.mjs.map +1 -0
  415. package/dist/components/overlays/Tooltip.cjs +2 -0
  416. package/dist/components/overlays/Tooltip.cjs.map +1 -0
  417. package/dist/components/overlays/Tooltip.mjs +161 -0
  418. package/dist/components/overlays/Tooltip.mjs.map +1 -0
  419. package/dist/components/portal/Portal.cjs +2 -0
  420. package/dist/components/portal/Portal.cjs.map +1 -0
  421. package/dist/components/portal/Portal.mjs +46 -0
  422. package/dist/components/portal/Portal.mjs.map +1 -0
  423. package/dist/components/provider/WaveProvider.cjs +2 -0
  424. package/dist/components/provider/WaveProvider.cjs.map +1 -0
  425. package/dist/components/provider/WaveProvider.mjs +52 -0
  426. package/dist/components/provider/WaveProvider.mjs.map +1 -0
  427. package/dist/components/table/DataGrid.cjs +2 -0
  428. package/dist/components/table/DataGrid.cjs.map +1 -0
  429. package/dist/components/table/DataGrid.mjs +490 -0
  430. package/dist/components/table/DataGrid.mjs.map +1 -0
  431. package/dist/components/table/Table.cjs +2 -0
  432. package/dist/components/table/Table.cjs.map +1 -0
  433. package/dist/components/table/Table.mjs +100 -0
  434. package/dist/components/table/Table.mjs.map +1 -0
  435. package/dist/components/table/useGridNavigation.cjs +2 -0
  436. package/dist/components/table/useGridNavigation.cjs.map +1 -0
  437. package/dist/components/table/useGridNavigation.mjs +336 -0
  438. package/dist/components/table/useGridNavigation.mjs.map +1 -0
  439. package/dist/components/typography/Text.cjs +2 -0
  440. package/dist/components/typography/Text.cjs.map +1 -0
  441. package/dist/components/typography/Text.mjs +39 -0
  442. package/dist/components/typography/Text.mjs.map +1 -0
  443. package/dist/hooks/useAnnounce.cjs +2 -0
  444. package/dist/hooks/useAnnounce.cjs.map +1 -0
  445. package/dist/hooks/useAnnounce.mjs +88 -0
  446. package/dist/hooks/useAnnounce.mjs.map +1 -0
  447. package/dist/hooks/useCheckedValues.cjs +2 -0
  448. package/dist/hooks/useCheckedValues.cjs.map +1 -0
  449. package/dist/hooks/useCheckedValues.mjs +102 -0
  450. package/dist/hooks/useCheckedValues.mjs.map +1 -0
  451. package/dist/hooks/useContextMenuAnchor.cjs +2 -0
  452. package/dist/hooks/useContextMenuAnchor.cjs.map +1 -0
  453. package/dist/hooks/useContextMenuAnchor.mjs +132 -0
  454. package/dist/hooks/useContextMenuAnchor.mjs.map +1 -0
  455. package/dist/hooks/useControllable.cjs +2 -0
  456. package/dist/hooks/useControllable.cjs.map +1 -0
  457. package/dist/hooks/useControllable.mjs +37 -0
  458. package/dist/hooks/useControllable.mjs.map +1 -0
  459. package/dist/hooks/useDirection.cjs +2 -0
  460. package/dist/hooks/useDirection.cjs.map +1 -0
  461. package/dist/hooks/useDirection.mjs +57 -0
  462. package/dist/hooks/useDirection.mjs.map +1 -0
  463. package/dist/hooks/useDismiss.cjs +2 -0
  464. package/dist/hooks/useDismiss.cjs.map +1 -0
  465. package/dist/hooks/useDismiss.mjs +57 -0
  466. package/dist/hooks/useDismiss.mjs.map +1 -0
  467. package/dist/hooks/useEventCallback.cjs +2 -0
  468. package/dist/hooks/useEventCallback.cjs.map +1 -0
  469. package/dist/hooks/useEventCallback.mjs +16 -0
  470. package/dist/hooks/useEventCallback.mjs.map +1 -0
  471. package/dist/hooks/useFieldControl.cjs +2 -0
  472. package/dist/hooks/useFieldControl.cjs.map +1 -0
  473. package/dist/hooks/useFieldControl.mjs +62 -0
  474. package/dist/hooks/useFieldControl.mjs.map +1 -0
  475. package/dist/hooks/useFocusTrap.cjs +2 -0
  476. package/dist/hooks/useFocusTrap.cjs.map +1 -0
  477. package/dist/hooks/useFocusTrap.mjs +266 -0
  478. package/dist/hooks/useFocusTrap.mjs.map +1 -0
  479. package/dist/hooks/useFormReset.cjs +2 -0
  480. package/dist/hooks/useFormReset.cjs.map +1 -0
  481. package/dist/hooks/useFormReset.mjs +33 -0
  482. package/dist/hooks/useFormReset.mjs.map +1 -0
  483. package/dist/hooks/useHoverIntent.cjs +2 -0
  484. package/dist/hooks/useHoverIntent.cjs.map +1 -0
  485. package/dist/hooks/useHoverIntent.mjs +201 -0
  486. package/dist/hooks/useHoverIntent.mjs.map +1 -0
  487. package/dist/hooks/useId.cjs +2 -0
  488. package/dist/hooks/useId.cjs.map +1 -0
  489. package/dist/hooks/useId.mjs +11 -0
  490. package/dist/hooks/useId.mjs.map +1 -0
  491. package/dist/hooks/useIsClient.cjs +2 -0
  492. package/dist/hooks/useIsClient.cjs.map +1 -0
  493. package/dist/hooks/useIsClient.mjs +19 -0
  494. package/dist/hooks/useIsClient.mjs.map +1 -0
  495. package/dist/hooks/useListbox.cjs +2 -0
  496. package/dist/hooks/useListbox.cjs.map +1 -0
  497. package/dist/hooks/useListbox.mjs +492 -0
  498. package/dist/hooks/useListbox.mjs.map +1 -0
  499. package/dist/hooks/useMediaQuery.cjs +2 -0
  500. package/dist/hooks/useMediaQuery.cjs.map +1 -0
  501. package/dist/hooks/useMediaQuery.mjs +20 -0
  502. package/dist/hooks/useMediaQuery.mjs.map +1 -0
  503. package/dist/hooks/useMergedRefs.cjs +2 -0
  504. package/dist/hooks/useMergedRefs.cjs.map +1 -0
  505. package/dist/hooks/useMergedRefs.mjs +57 -0
  506. package/dist/hooks/useMergedRefs.mjs.map +1 -0
  507. package/dist/hooks/useModalIsolation.cjs +2 -0
  508. package/dist/hooks/useModalIsolation.cjs.map +1 -0
  509. package/dist/hooks/useModalIsolation.mjs +87 -0
  510. package/dist/hooks/useModalIsolation.mjs.map +1 -0
  511. package/dist/hooks/useModalLayer.cjs +2 -0
  512. package/dist/hooks/useModalLayer.cjs.map +1 -0
  513. package/dist/hooks/useModalLayer.mjs +30 -0
  514. package/dist/hooks/useModalLayer.mjs.map +1 -0
  515. package/dist/hooks/usePopupPosition.cjs +2 -0
  516. package/dist/hooks/usePopupPosition.cjs.map +1 -0
  517. package/dist/hooks/usePopupPosition.mjs +117 -0
  518. package/dist/hooks/usePopupPosition.mjs.map +1 -0
  519. package/dist/hooks/usePrefersReducedMotion.cjs +2 -0
  520. package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -0
  521. package/dist/hooks/usePrefersReducedMotion.mjs +10 -0
  522. package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -0
  523. package/dist/hooks/usePresence.cjs +2 -0
  524. package/dist/hooks/usePresence.cjs.map +1 -0
  525. package/dist/hooks/usePresence.mjs +136 -0
  526. package/dist/hooks/usePresence.mjs.map +1 -0
  527. package/dist/hooks/usePreserveFocus.cjs +2 -0
  528. package/dist/hooks/usePreserveFocus.cjs.map +1 -0
  529. package/dist/hooks/usePreserveFocus.mjs +50 -0
  530. package/dist/hooks/usePreserveFocus.mjs.map +1 -0
  531. package/dist/hooks/useRestoreFocus.cjs +2 -0
  532. package/dist/hooks/useRestoreFocus.cjs.map +1 -0
  533. package/dist/hooks/useRestoreFocus.mjs +271 -0
  534. package/dist/hooks/useRestoreFocus.mjs.map +1 -0
  535. package/dist/hooks/useRovingTabIndex.cjs +2 -0
  536. package/dist/hooks/useRovingTabIndex.cjs.map +1 -0
  537. package/dist/hooks/useRovingTabIndex.mjs +389 -0
  538. package/dist/hooks/useRovingTabIndex.mjs.map +1 -0
  539. package/dist/hooks/useScrollLock.cjs +2 -0
  540. package/dist/hooks/useScrollLock.cjs.map +1 -0
  541. package/dist/hooks/useScrollLock.mjs +71 -0
  542. package/dist/hooks/useScrollLock.mjs.map +1 -0
  543. package/dist/hooks/useTriggerElement.cjs +2 -0
  544. package/dist/hooks/useTriggerElement.cjs.map +1 -0
  545. package/dist/hooks/useTriggerElement.mjs +126 -0
  546. package/dist/hooks/useTriggerElement.mjs.map +1 -0
  547. package/dist/hooks/useTypeahead.cjs +2 -0
  548. package/dist/hooks/useTypeahead.cjs.map +1 -0
  549. package/dist/hooks/useTypeahead.mjs +38 -0
  550. package/dist/hooks/useTypeahead.mjs.map +1 -0
  551. package/dist/index.cjs +1 -1
  552. package/dist/index.d.cts +11086 -0
  553. package/dist/index.d.ts +10405 -1757
  554. package/dist/index.mjs +103 -5695
  555. package/dist/lib/aria.cjs +2 -0
  556. package/dist/lib/aria.cjs.map +1 -0
  557. package/dist/lib/aria.mjs +29 -0
  558. package/dist/lib/aria.mjs.map +1 -0
  559. package/dist/lib/children.cjs +2 -0
  560. package/dist/lib/children.cjs.map +1 -0
  561. package/dist/lib/children.mjs +37 -0
  562. package/dist/lib/children.mjs.map +1 -0
  563. package/dist/lib/classNames.cjs +2 -0
  564. package/dist/lib/classNames.cjs.map +1 -0
  565. package/dist/lib/classNames.mjs +415 -0
  566. package/dist/lib/classNames.mjs.map +1 -0
  567. package/dist/lib/cn.cjs +2 -0
  568. package/dist/lib/cn.cjs.map +1 -0
  569. package/dist/lib/cn.mjs +64 -0
  570. package/dist/lib/cn.mjs.map +1 -0
  571. package/dist/lib/color.cjs +2 -0
  572. package/dist/lib/color.cjs.map +1 -0
  573. package/dist/lib/color.mjs +86 -0
  574. package/dist/lib/color.mjs.map +1 -0
  575. package/dist/lib/composeEventHandlers.cjs +2 -0
  576. package/dist/lib/composeEventHandlers.cjs.map +1 -0
  577. package/dist/lib/composeEventHandlers.mjs +11 -0
  578. package/dist/lib/composeEventHandlers.mjs.map +1 -0
  579. package/dist/lib/dev.cjs +2 -0
  580. package/dist/lib/dev.cjs.map +1 -0
  581. package/dist/lib/dev.mjs +42 -0
  582. package/dist/lib/dev.mjs.map +1 -0
  583. package/dist/lib/direction.cjs +2 -0
  584. package/dist/lib/direction.cjs.map +1 -0
  585. package/dist/lib/direction.mjs +35 -0
  586. package/dist/lib/direction.mjs.map +1 -0
  587. package/dist/lib/events.cjs +2 -0
  588. package/dist/lib/events.cjs.map +1 -0
  589. package/dist/lib/events.mjs +31 -0
  590. package/dist/lib/events.mjs.map +1 -0
  591. package/dist/lib/focus.cjs +2 -0
  592. package/dist/lib/focus.cjs.map +1 -0
  593. package/dist/lib/focus.mjs +119 -0
  594. package/dist/lib/focus.mjs.map +1 -0
  595. package/dist/lib/globalRegistry.cjs +2 -0
  596. package/dist/lib/globalRegistry.cjs.map +1 -0
  597. package/dist/lib/globalRegistry.mjs +13 -0
  598. package/dist/lib/globalRegistry.mjs.map +1 -0
  599. package/dist/lib/icons.cjs +2 -0
  600. package/dist/lib/icons.cjs.map +1 -0
  601. package/dist/lib/icons.mjs +254 -0
  602. package/dist/lib/icons.mjs.map +1 -0
  603. package/dist/lib/labelInName.cjs +2 -0
  604. package/dist/lib/labelInName.cjs.map +1 -0
  605. package/dist/lib/labelInName.mjs +54 -0
  606. package/dist/lib/labelInName.mjs.map +1 -0
  607. package/dist/lib/layers.cjs +2 -0
  608. package/dist/lib/layers.cjs.map +1 -0
  609. package/dist/lib/layers.mjs +224 -0
  610. package/dist/lib/layers.mjs.map +1 -0
  611. package/dist/lib/mergeProps.cjs +2 -0
  612. package/dist/lib/mergeProps.cjs.map +1 -0
  613. package/dist/lib/mergeProps.mjs +21 -0
  614. package/dist/lib/mergeProps.mjs.map +1 -0
  615. package/dist/lib/mergeRefs.cjs +2 -0
  616. package/dist/lib/mergeRefs.cjs.map +1 -0
  617. package/dist/lib/mergeRefs.mjs +29 -0
  618. package/dist/lib/mergeRefs.mjs.map +1 -0
  619. package/dist/lib/renderTrigger.cjs +2 -0
  620. package/dist/lib/renderTrigger.cjs.map +1 -0
  621. package/dist/lib/renderTrigger.mjs +29 -0
  622. package/dist/lib/renderTrigger.mjs.map +1 -0
  623. package/dist/lib/slot.cjs +2 -0
  624. package/dist/lib/slot.cjs.map +1 -0
  625. package/dist/lib/slot.mjs +122 -0
  626. package/dist/lib/slot.mjs.map +1 -0
  627. package/dist/lib/styles.cjs +2 -0
  628. package/dist/lib/styles.cjs.map +1 -0
  629. package/dist/lib/styles.mjs +16 -0
  630. package/dist/lib/styles.mjs.map +1 -0
  631. package/dist/lib/theme.cjs +2 -0
  632. package/dist/lib/theme.cjs.map +1 -0
  633. package/dist/lib/theme.mjs +16 -0
  634. package/dist/lib/theme.mjs.map +1 -0
  635. package/dist/lib/toaster.cjs +2 -0
  636. package/dist/lib/toaster.cjs.map +1 -0
  637. package/dist/lib/toaster.mjs +77 -0
  638. package/dist/lib/toaster.mjs.map +1 -0
  639. package/dist/preflight.css +2 -0
  640. package/dist/styles.css +2 -0
  641. package/package.json +149 -100
  642. package/src/styles/animations.css +7 -39
  643. package/src/styles/base.css +103 -0
  644. package/src/styles/globals.css +10 -22
  645. package/src/styles/legacy-tokens.css +184 -0
  646. package/src/styles/preflight.css +7 -0
  647. package/src/styles/styles.css +32 -0
  648. package/src/styles/tailwind.css +17 -0
  649. package/src/styles/tokens.css +561 -221
  650. package/src/styles/variants.css +29 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.core.mjs","names":["useId","useId$1","React","EMPTY","ITEM_IN_LABEL_MESSAGE","warnDuplicateValue","value","SELECTED_WITH_MULTIPLE_MESSAGE","CHECKED_WITHOUT_MULTIPLE_MESSAGE","SINGLE_WITHOUT_SELECTED_MESSAGE","forestInTreeOrder","entries","entry","a","b","TREE_ITEM_SELECTOR","ACTION_ITEM_SELECTOR","ACTIONS_ON_ITEM_FOCUS","ASIDE_OFF_ON_ITEM_FOCUS","ACTIONS_VISIBILITY","ASIDE_OFF_WITH_ACTIONS","END_CELL_SHARED","focusFirstAction","toolbar","item","cssHidden","el","isHiddenInput","concealed","marker","TreeRoot","rest","initialExpanded","defaultExpandedItems","expandedList","setExpandedList","useControllable","expandedItems","onExpandedItemsChange","next","expanded","toggle","prev","v","expand","added","values","activate","useEventCallback","initialChecked","defaultCheckedItems","pendingDetails","checkedList","setCheckedList","checkedItems","onCheckedItemsChange","checked","topLevel","registerTopLevel","toggleChecked","forest","toggleCheck","previous","effectiveSelected","selectionMode","selected","warnOnce","hasCheckedProps","focusedItem","setFocusedItem","valueCounts","registerValue","isDev","counts","count","remaining","useRovingTabIndex","context","current","getTabIndex","focusValue","navigationMode","mergedRef","useMergedRefs","ref","containerProps","handleKeyDown","event","syncTypeaheadText","handleKeyDownCapture","handleBlur","TreeContext","TreeParentContext","TreeCheckForcedContext","cn","treeClassNames","className","composeEventHandlers","onKeyDown","onKeyDownCapture","onFocus","onBlur","TreeLabelContext","label","treeitem","personaName","text","isOwnKeyEvent","target","isOwnClick","TreeItemActions","treegrid","rovingRef","rovingKeyDown","rovingFocus","popupFocus","setPopupFocus","frame","handleToolbarFocus","handleToolbarBlur","isOwnEvent","popup","isEditableTarget","getArrowIntent","getDirection","labelledBy","isPrev","onReturn","treeItemClassNames","TreeItem","props","typeaheadText","ctx","useTreeContext","parent","insideLabel","isExpanded","labelId","asideId","ancestorListed","itemRef","layoutIds","setLayoutIds","registerLayout","ids","itemContext","nameId","nestedItems","labelContent","firstChildValue","children","child","keyed","key","isElementOfType","iconNode","icon","slotRendersContent","renderSlot","iconAfterNode","iconAfter","hasAside","aside","hasActions","actions","hasChildren","leaf","chevron","expandIcon","ChevronRightIcon","multiple","ownNode","collectItems","checkState","computeCheckStates","selectionEntry","isTopLevel","isSelected","isCurrent","handleClick","onClick","siblings","intent","focusedAction","inOwnActions","handleFocus","handleActionsBlur","action","active","checkbox","forcedColors","SubtractIcon","CheckIcon","radio","indicator","groupListed","joinIds","TreeItemContext","materialiseSlotContent"],"sources":["../../../src/components/layout/Tree.core.tsx"],"sourcesContent":["import * as React from 'react';\nimport { joinIds } from '../../lib/aria';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { treeClassNames, treeItemClassNames } from '../../lib/classNames';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { isDev, warnOnce } from '../../lib/dev';\nimport { getArrowIntent, getDirection } from '../../lib/direction';\nimport { isEditableTarget, isOwnEvent } from '../../lib/events';\nimport { isHiddenInput } from '../../lib/focus';\nimport { CheckIcon, ChevronRightIcon, SubtractIcon } from '../../lib/icons';\nimport type { SelectionMode } from '../../lib/types';\nimport { materialiseSlotContent, renderSlot, slotRendersContent, type Slot } from '../../lib/slot';\nimport { forcedColors } from '../../lib/styles';\nimport { useControllable } from '../../hooks/useControllable';\nimport { useEventCallback } from '../../hooks/useEventCallback';\nimport { useId } from '../../hooks/useId';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { isHiddenByCss, useRovingTabIndex } from '../../hooks/useRovingTabIndex';\nimport {\n TreeCheckForcedContext,\n TreeContext,\n TreeItemContext,\n TreeLabelContext,\n TreeParentContext,\n useTreeContext,\n type PersonaLayoutIds,\n type TreeContextValue,\n type TreeItemContextValue,\n type TreeSelectionEntry,\n} from './Tree.context';\nimport {\n collectItems,\n computeCheckStates,\n toggleCheck,\n type CheckState,\n type TreeNode,\n} from './Tree.selection';\n\nconst EMPTY: readonly string[] = [];\n\nconst ITEM_IN_LABEL_MESSAGE =\n 'Tree.Item was rendered inside the label of another Tree.Item, so it is not part of that ' +\n \"item's child group: the parent cannot expand, its name includes the nested text, and a \" +\n 'treeitem sits inside a label (axe aria-required-parent). A Tree.Item finds its nested items ' +\n 'among its own children (written directly, in Fragments, or returned by a render function such ' +\n 'as `children.map(renderNode)`), but not inside a component that renders Tree.Item itself. ' +\n 'Build a data-driven tree with a render function instead of a recursive component.';\n\nfunction warnDuplicateValue(value: string): void {\n warnOnce(\n `Tree:duplicate:${value}`,\n `Tree: several items share the value \"${value}\". Item values must be unique within a Tree; ` +\n 'items with the same value share their expanded, selected and focus state.',\n );\n}\n\nconst SELECTED_WITH_MULTIPLE_MESSAGE =\n 'Tree: `selected` has no effect with selectionMode=\"multiple\"; use `checkedItems`, and ' +\n '`current` for the item the user is on.';\n\nconst CHECKED_WITHOUT_MULTIPLE_MESSAGE =\n 'Tree: `checkedItems` and `defaultCheckedItems` need selectionMode=\"multiple\"; without it the ' +\n 'tree draws no checkboxes and ignores them.';\n\nconst SINGLE_WITHOUT_SELECTED_MESSAGE =\n 'Tree: selectionMode=\"single\" draws a radio on every item for `selected`; pass `selected` ' +\n '(null while nothing is selected) and update it from `onItemSelect`.';\n\n/** The registered top-level subtrees in document order, which is the tree order of their items. */\nfunction forestInTreeOrder(\n entries: ReadonlySet<React.RefObject<TreeSelectionEntry | null>> | null,\n): TreeNode[] {\n if (!entries) return [];\n return Array.from(entries, (entry) => entry.current)\n .filter((entry): entry is TreeSelectionEntry => entry !== null)\n .sort((a, b) => {\n if (!a.element || !b.element || a.element === b.element) return 0;\n return a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING\n ? -1\n : 1;\n })\n .map((entry) => entry.node);\n}\n\n/**\n * The tree's own items for the tab stop and the arrow keys: the treeitems. A row's actions are a\n * roving container of their own, which the default selector would count as one more item.\n */\nconst TREE_ITEM_SELECTOR = '[role=\"treeitem\"]';\n\n/** Every focusable control a row's actions can hold (Toolbar's rule). */\nconst ACTION_ITEM_SELECTOR = 'button, [href], input, select, textarea, [role=\"button\"], [tabindex]';\n\n/**\n * Shows a row's actions while focus is on its item (also after a click) or inside the item's own\n * row, never in its child group, so Tab and the treegrid arrows reach them. The item's\n * `:focus-within`, not its `:focus`: while focus moves from the item into an action, Chromium has\n * already ended the item's `:focus` (but keeps `:focus-within` on it, the common ancestor) when it\n * checks that the action can take focus, and a hidden action refuses it.\n */\nconst ACTIONS_ON_ITEM_FOCUS =\n '[&:focus-within:not(:has(>[role=group]_:focus))>[data-tree-row]_[data-tree-actions]]:visible';\n\n/** Makes the aside invisible while its actions show for focus, where they take its place. */\nconst ASIDE_OFF_ON_ITEM_FOCUS =\n '[@media(hover:hover)]:not-forced-colors:[&:focus-within:not(:has(>[role=group]_:focus))>[data-tree-row]_[data-tree-aside]]:invisible';\n\n/**\n * The actions stay invisible until the row is hovered or the item or an action has focus, and\n * always show in forced colors and without hover (touch). An invisible action takes no focus.\n * They also show while a surface opened from an action is open (its trigger is expanded) and\n * while focus is in such a surface (`data-focus-in-popup`), so the surface's focus return, which\n * runs after its trigger already reports it closed, reaches the action.\n */\nconst ACTIONS_VISIBILITY =\n 'invisible group-hover/row:visible focus-within:visible forced-colors:visible [@media(hover:none)]:visible has-[[aria-expanded=true]]:visible data-[focus-in-popup]:visible';\n\n/** The aside gives way to the actions where the two share one place. */\nconst ASIDE_OFF_WITH_ACTIONS =\n 'not-forced-colors:group-hover/row:invisible [@media(hover:hover)]:not-forced-colors:group-focus-within/end:invisible [@media(hover:hover)]:not-forced-colors:group-has-[[aria-expanded=true]]/end:invisible [@media(hover:hover)]:not-forced-colors:group-has-[[data-focus-in-popup]]/end:invisible';\n\n/** Aside and actions share one cell, and sit side by side where the actions always show. */\nconst END_CELL_SHARED = '[&>*]:[grid-area:1/1] forced-colors:flex [@media(hover:none)]:flex';\n\n/**\n * Focuses the first action of an item's own row that takes focus, trying them in order and\n * skipping what the roving hook skips: natively disabled, marked `data-roving-disabled`,\n * `aria-disabled` unless focusable-disabled, hidden form inputs, anything inside a `hidden` or\n * `inert` element of the toolbar, and what CSS hides (the hook's own `isHiddenByCss`). `false` when\n * focus did not move into the row's actions.\n */\nfunction focusFirstAction(item: HTMLElement): boolean {\n const toolbar = item.querySelector<HTMLElement>(':scope > [data-tree-row] [data-tree-actions]');\n if (!toolbar) return false;\n const cssHidden = new Map<Element, boolean>();\n for (const el of Array.from(toolbar.querySelectorAll<HTMLElement>(ACTION_ITEM_SELECTOR))) {\n if (isHiddenInput(el) || el.matches(':disabled')) continue;\n const concealed = el.closest('[hidden], [inert]');\n if (concealed && toolbar.contains(concealed)) continue;\n const marker = el.getAttribute('data-roving-disabled');\n if (marker !== null && marker !== 'false') continue;\n if (\n el.getAttribute('aria-disabled') === 'true' &&\n !el.hasAttribute('data-disabled-focusable')\n ) {\n continue;\n }\n if (isHiddenByCss(el, toolbar, cssHidden)) continue;\n el.focus();\n if (el.ownerDocument.activeElement === el) return true;\n }\n return false;\n}\n\n/* ------------------------------------------------------------------ */\n/* Tree */\n/* ------------------------------------------------------------------ */\n\n/** The second argument of `onCheckedItemsChange`. */\nexport interface TreeCheckedItemsChangeDetails {\n /** The item that was toggled. */\n value: string;\n /** Its new state (a toggle never leaves it mixed). */\n checked: boolean;\n /** The DOM event of the toggle: a keyboard event for Space, a mouse event for a click. */\n event: Event;\n}\n\n/** Properties for the Tree component. */\nexport interface TreeProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Controlled list of expanded item values. */\n expandedItems?: readonly string[];\n /**\n * Item values that are expanded initially (uncontrolled).\n * @default []\n */\n defaultExpandedItems?: readonly string[];\n /** Called with the new list of expanded item values when an item expands or collapses. */\n onExpandedItemsChange?: (expandedItems: string[]) => void;\n /**\n * Called with an item's value every time it is activated (a click on its row, Enter, or Space\n * unless the tree has checkboxes), also when the same item is activated again.\n */\n onItemSelect?: (value: string) => void;\n /**\n * Value of the selected item. When set (also to `null`), every item carries `aria-selected`, and\n * the selected item is where keyboard focus enters the tree. It has no effect with\n * `selectionMode=\"multiple\"` (a development warning): items carry `aria-checked` instead. With\n * `selectionMode=\"single\"` every item carries `aria-selected` even while it is not set (a\n * development warning: the radios need it).\n */\n selected?: string | null;\n /** Value of the current item (for example the open page): it gets `aria-current=\"true\"`. */\n current?: string | null;\n /**\n * How items are selected. `'none'`: activation only (0.7; `selected` highlights one item).\n * `'single'`: a radio indicator on every item for `selected`/`onItemSelect`. `'multiple'`: a\n * checkbox on every item, bound to `checkedItems`; checking an item checks its descendants, and a\n * parent shows checked, mixed or unchecked from them. Fluent's `'multiselect'` is `'multiple'`.\n * @default 'none'\n */\n selectionMode?: 'none' | SelectionMode;\n /** Controlled checked items (`selectionMode=\"multiple\"`); see the cascade rule in the component docs. */\n checkedItems?: readonly string[];\n /**\n * Initially checked items (uncontrolled).\n * @default []\n */\n defaultCheckedItems?: readonly string[];\n /**\n * Called with every checked item (in tree order) when a check changes (Fluent's `onCheckedChange`).\n * WaveUI always passes `details`; it is typed optional until 1.0.\n */\n onCheckedItemsChange?: (checkedItems: string[], details?: TreeCheckedItemsChangeDetails) => void;\n /**\n * `'tree'`: Tab from a focused item enters its actions. `'treegrid'`: the \"next\" arrow\n * (ArrowRight, ArrowLeft in RTL) moves into an item's actions and \"previous\" returns; on an\n * expanded parent \"next\" no longer moves to the first child (ArrowDown does). The roles stay\n * `tree` and `treeitem` (Fluent's `navigationMode`).\n * @default 'tree'\n */\n navigationMode?: 'tree' | 'treegrid';\n /** Ref to the `role=\"tree\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nexport const TreeRoot = ({\n expandedItems,\n defaultExpandedItems,\n onExpandedItemsChange,\n onItemSelect,\n selected,\n current,\n selectionMode = 'none',\n navigationMode = 'tree',\n checkedItems,\n defaultCheckedItems,\n onCheckedItemsChange,\n className,\n children,\n onKeyDown,\n onKeyDownCapture,\n onFocus,\n onBlur,\n ref,\n ...rest\n}: TreeProps) => {\n const [initialExpanded] = React.useState<readonly string[]>(() => defaultExpandedItems ?? EMPTY);\n const [expandedList, setExpandedList] = useControllable<readonly string[]>(\n expandedItems,\n initialExpanded,\n (next) => onExpandedItemsChange?.([...next]),\n );\n const expanded = React.useMemo(() => new Set(expandedList), [expandedList]);\n\n const toggle = React.useCallback(\n (value: string) => {\n setExpandedList((prev) =>\n prev.includes(value) ? prev.filter((v) => v !== value) : [...prev, value],\n );\n },\n [setExpandedList],\n );\n\n const expand = React.useCallback(\n (values: readonly string[]) => {\n setExpandedList((prev) => {\n const added = values.filter((v) => !prev.includes(v));\n return added.length > 0 ? [...prev, ...added] : prev;\n });\n },\n [setExpandedList],\n );\n\n const activate = useEventCallback((value: string) => {\n onItemSelect?.(value);\n });\n\n // Checked items (`selectionMode=\"multiple\"`). useControllable passes the value only, so a toggle\n // hands `details` to the change callback through a ref it writes and clears in the same event.\n const [initialChecked] = React.useState<readonly string[]>(() => defaultCheckedItems ?? EMPTY);\n const pendingDetails = React.useRef<TreeCheckedItemsChangeDetails | undefined>(undefined);\n const [checkedList, setCheckedList] = useControllable<readonly string[]>(\n checkedItems,\n initialChecked,\n (next) => onCheckedItemsChange?.([...next], pendingDetails.current),\n );\n const checked = React.useMemo(() => new Set(checkedList), [checkedList]);\n\n // The top-level items' subtrees (each item scans its own children), read when a check toggles:\n // they give the emitted list its tree order.\n const topLevel = React.useRef<Set<React.RefObject<TreeSelectionEntry | null>> | null>(null);\n const registerTopLevel = React.useCallback(\n (entry: React.RefObject<TreeSelectionEntry | null>) => {\n topLevel.current ??= new Set();\n const entries = topLevel.current;\n entries.add(entry);\n return () => {\n entries.delete(entry);\n };\n },\n [],\n );\n const toggleChecked = useEventCallback((value: string, event: Event) => {\n const forest = forestInTreeOrder(topLevel.current);\n setCheckedList((previous) => {\n const next = toggleCheck(forest, previous, value);\n pendingDetails.current = { value, checked: next.includes(value), event };\n return next;\n });\n pendingDetails.current = undefined;\n });\n\n // An item carries aria-checked or aria-selected, never both (APG); in single mode every item\n // carries aria-selected from the first render, so the radios and the state agree.\n const effectiveSelected =\n selectionMode === 'multiple'\n ? undefined\n : selectionMode === 'single'\n ? (selected ?? null)\n : selected;\n\n React.useEffect(() => {\n if (selectionMode === 'multiple' && selected !== undefined) {\n warnOnce('Tree:selected-with-multiple', SELECTED_WITH_MULTIPLE_MESSAGE);\n }\n }, [selectionMode, selected]);\n React.useEffect(() => {\n if (selectionMode === 'single' && selected === undefined) {\n warnOnce('Tree:single-without-selected', SINGLE_WITHOUT_SELECTED_MESSAGE);\n }\n }, [selectionMode, selected]);\n const hasCheckedProps = checkedItems !== undefined || defaultCheckedItems !== undefined;\n React.useEffect(() => {\n if (selectionMode !== 'multiple' && hasCheckedProps) {\n warnOnce('Tree:checked-without-multiple', CHECKED_WITHOUT_MULTIPLE_MESSAGE);\n }\n }, [selectionMode, hasCheckedProps]);\n\n // The item that has focus while focus is inside the tree: it holds the tab stop, so Shift+Tab\n // leaves the tree. Cleared when focus leaves; the next entry goes to `selected`, else the first.\n const [focusedItem, setFocusedItem] = React.useState<string | null>(null);\n\n // How many mounted items carry each value (written from the items' effects only).\n const valueCounts = React.useRef<Map<string, number> | null>(null);\n const registerValue = React.useCallback((value: string) => {\n if (!isDev) return () => {};\n valueCounts.current ??= new Map();\n const counts = valueCounts.current;\n const count = (counts.get(value) ?? 0) + 1;\n counts.set(value, count);\n if (count > 1) warnDuplicateValue(value);\n return () => {\n const remaining = (counts.get(value) ?? 1) - 1;\n if (remaining > 0) counts.set(value, remaining);\n else counts.delete(value);\n };\n }, []);\n\n const { containerProps, getTabIndex, focusValue } = useRovingTabIndex({\n activeValue: focusedItem ?? effectiveSelected ?? null,\n itemSelector: TREE_ITEM_SELECTOR,\n orientation: 'vertical',\n loop: false,\n typeahead: true,\n });\n\n const context = React.useMemo<TreeContextValue>(\n () => ({\n expanded,\n toggle,\n expand,\n activate,\n selected: effectiveSelected,\n current,\n getTabIndex,\n focusValue,\n onItemFocus: setFocusedItem,\n focusedItem,\n navigationMode,\n registerValue,\n selectionMode,\n checked,\n toggleChecked,\n registerTopLevel,\n }),\n [\n expanded,\n toggle,\n expand,\n activate,\n effectiveSelected,\n current,\n getTabIndex,\n focusValue,\n focusedItem,\n navigationMode,\n registerValue,\n selectionMode,\n checked,\n toggleChecked,\n registerTopLevel,\n ],\n );\n\n const mergedRef = useMergedRefs<HTMLDivElement>(ref, containerProps.ref);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n // Typeahead reads `data-roving-text` at key time: fill it from each item's label first.\n if (event.key.length === 1) syncTypeaheadText(event.currentTarget);\n containerProps.onKeyDown(event);\n };\n\n // A Space that continues a search is typeahead too, taken before the item would activate on it.\n const handleKeyDownCapture = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === ' ') syncTypeaheadText(event.currentTarget);\n containerProps.onKeyDownCapture(event);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLDivElement>) => {\n const next = event.relatedTarget as Node | null;\n if (!next || !event.currentTarget.contains(next)) setFocusedItem(null);\n };\n\n return (\n <TreeContext.Provider value={context}>\n <TreeParentContext.Provider value={null}>\n <TreeCheckForcedContext.Provider value={false}>\n <div\n role=\"tree\"\n data-selection-mode={selectionMode}\n aria-multiselectable={selectionMode === 'multiple' ? true : undefined}\n className={cn(treeClassNames.root, 'text-body-1', className)}\n {...rest}\n data-roving-container=\"\"\n onKeyDown={composeEventHandlers(onKeyDown, handleKeyDown)}\n onKeyDownCapture={composeEventHandlers(onKeyDownCapture, handleKeyDownCapture)}\n onFocus={composeEventHandlers(onFocus, containerProps.onFocus, {\n checkDefaultPrevented: false,\n })}\n onBlur={composeEventHandlers(onBlur, handleBlur, { checkDefaultPrevented: false })}\n ref={mergedRef}\n >\n {/* A Tree has its own items, also when it renders inside a label (a portaled popup). */}\n <TreeLabelContext.Provider value={false}>{children}</TreeLabelContext.Provider>\n </div>\n </TreeCheckForcedContext.Provider>\n </TreeParentContext.Provider>\n </TreeContext.Provider>\n );\n};\nTreeRoot.displayName = 'Tree';\n\n/* ------------------------------------------------------------------ */\n/* Tree.Item */\n/* ------------------------------------------------------------------ */\n\n/** Properties for the TreeItem sub-component. */\nexport interface TreeItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Unique value identifying this tree item. */\n value: string;\n /**\n * Icon displayed before the label. Rendered in a `<span>` hidden from assistive technology\n * (`aria-hidden`); pass a slot object (`{ className, children, … }`) to customise it. A falsy\n * icon (`''`, `0`) or a list of nothing renders no span.\n */\n icon?: Slot<'span'>;\n /** Icon after the label (decorative, `aria-hidden`; a falsy value renders nothing, as `icon`). */\n iconAfter?: Slot<'span'>;\n /**\n * Replaces the expand chevron (decorative). `null`/`undefined` keep the chevron; `false`, or\n * anything that renders nothing, hides it (`aria-expanded` still reports the state). Not rotated.\n */\n expandIcon?: Slot<'span'>;\n /**\n * Non-interactive content at the end of the row, such as a count or a badge. It describes the item\n * (`aria-describedby`); it hides while the actions show on hover or focus.\n */\n aside?: React.ReactNode;\n /**\n * Buttons at the end of the row (a toolbar named by the item's label). Shown while the row is\n * hovered or the item or its actions have focus, and always in forced colors and without hover\n * (touch). Tab reaches them from the focused item (`navigationMode=\"tree\"`), or the arrow keys do\n * (`\"treegrid\"`). Keys and clicks on them never activate or check the item.\n *\n * They also stay shown while a Menu, Popover or Dialog rendered inside them holds focus or its\n * trigger among them is expanded, so its focus return reaches the action. A dialog your app\n * renders elsewhere and opens from an action through state (a \"Delete…\" menu item that opens a\n * confirm Dialog) closes after the actions have hidden again (on devices with hover, outside\n * forced colors): a hidden action cannot take focus, so focus returns to the nearest element\n * that can, normally the item. Render such a Dialog inside `actions` (its `Dialog.Trigger`\n * there, or the controlled Dialog next to the Menu that opens it) to return focus to the action;\n * `finalFocusRef` cannot name it, since it is still hidden when the dialog closes.\n */\n actions?: React.ReactNode;\n /**\n * Renders the item as a leaf even when it has nested `Tree.Item`s: they are not rendered, and\n * the item has no `aria-expanded` and does not expand. An item is expandable only while it has\n * nested items, so `leaf={false}` does not make an item without them expandable. To load the\n * children on first expansion, give the item a placeholder child (a \"Loading…\" `Tree.Item`)\n * until they arrive.\n * @default false\n */\n leaf?: boolean;\n /** Ref to the `role=\"treeitem\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * Sets the typeahead text (`data-roving-text`, read by the roving hook) of every rendered\n * treeitem to the text of its label (a persona layout's name when the label holds one), so neither\n * the icon nor the nested items take part. A consumer `data-roving-text` on a Tree.Item is kept on\n * its label and wins.\n */\nfunction syncTypeaheadText(tree: HTMLElement): void {\n tree.querySelectorAll<HTMLElement>('[role=\"treeitem\"]').forEach((treeitem) => {\n const label = treeitem.querySelector<HTMLElement>(\n ':scope > [data-tree-row] > [data-tree-label]',\n );\n if (!label) return;\n // A persona layout's name is the item's name, so it is its typeahead text too (not the media,\n // such as an avatar's initials, or the description).\n const personaName = label.querySelector<HTMLElement>('[data-tree-persona-name]');\n const text =\n label.getAttribute('data-roving-text') ?? personaName?.textContent ?? label.textContent ?? '';\n if (treeitem.getAttribute('data-roving-text') !== text) {\n treeitem.setAttribute('data-roving-text', text);\n }\n });\n}\n\n/**\n * Whether a keyboard event belongs to this treeitem: its target (the focused element) is this\n * treeitem or inside its row, not a nested item and not the row's actions (their keys are theirs).\n */\nfunction isOwnKeyEvent(event: React.KeyboardEvent<HTMLElement>): boolean {\n const target = event.target as Element | null;\n if (target?.closest?.('[data-tree-actions]')) return false;\n return target?.closest?.('[role=\"treeitem\"]') === event.currentTarget;\n}\n\n/**\n * Whether a click landed on this treeitem's own row (or on the treeitem element itself). Clicks\n * in its child group, including the indentation gutter beside the nested rows, clicks on nested\n * items, on its checkbox and on its actions are not its own.\n */\nfunction isOwnClick(event: React.MouseEvent<HTMLElement>): boolean {\n const target = event.target as Element | null;\n if (target === event.currentTarget) return true;\n if (target?.closest?.('[data-tree-checkbox], [data-tree-actions]')) return false;\n return target?.closest?.('[data-tree-row]')?.parentElement === event.currentTarget;\n}\n\ninterface TreeItemActionsProps {\n /** Id of the element that names the item. */\n labelledBy: string;\n /**\n * `'last-focused'` while the actions hold a Tab stop (their item has focus, tree mode), else\n * `'none'`.\n */\n tabStop: 'last-focused' | 'none';\n /** `'treegrid'`: the arrows do not wrap, and \"previous\" on the first action returns to the item. */\n navigationMode: 'tree' | 'treegrid';\n /** Moves focus back to the item. */\n onReturn: () => void;\n children: React.ReactNode;\n}\n\n/**\n * A row's actions: the consumer's controls rove with the arrow keys and hold at most one Tab\n * stop. A key pressed on an action is the action's: ArrowDown and ArrowUp on an action that opens\n * a popup (`aria-haspopup`) never move focus to another item. In treegrid navigation, \"previous\"\n * on the first action returns to the item.\n */\nconst TreeItemActions = ({\n labelledBy,\n tabStop,\n navigationMode,\n onReturn,\n children,\n}: TreeItemActionsProps) => {\n const treegrid = navigationMode === 'treegrid';\n const {\n containerProps: { ref: rovingRef },\n handleKeyDown: rovingKeyDown,\n handleFocus: rovingFocus,\n } = useRovingTabIndex({\n itemSelector: ACTION_ITEM_SELECTOR,\n manageTabIndex: true,\n orientation: 'horizontal',\n loop: !treegrid,\n tabStop,\n });\n\n // Focus in a surface opened from an action (a Menu, Popover or Dialog rendered in a portal, whose\n // focus events reach the toolbar through the React tree): `'inside'`. Once focus leaves such a\n // surface for anywhere but the toolbar, `'leaving'` until the next frame, because the surface's\n // focus return comes later in that close (its layout phase, or a microtask).\n const [popupFocus, setPopupFocus] = React.useState<'inside' | 'leaving' | null>(null);\n React.useEffect(() => {\n if (popupFocus !== 'leaving') return;\n const frame = requestAnimationFrame(() => setPopupFocus(null));\n return () => cancelAnimationFrame(frame);\n }, [popupFocus]);\n\n const handleToolbarFocus = (event: React.FocusEvent<HTMLSpanElement>) => {\n rovingFocus(event);\n setPopupFocus(event.currentTarget.contains(event.target) ? null : 'inside');\n };\n\n const handleToolbarBlur = (event: React.FocusEvent<HTMLSpanElement>) => {\n // An action's own blur: its focus-within reveal decides.\n if (event.currentTarget.contains(event.target)) return;\n const next = event.relatedTarget;\n // Back to an action: its focus clears the hold.\n if (next instanceof Node && event.currentTarget.contains(next)) return;\n setPopupFocus('leaving');\n };\n\n /** Whether the key is treegrid's \"previous\" for an action (the roving order settles it). */\n const handleKeyDown = (event: React.KeyboardEvent<HTMLSpanElement>): boolean => {\n // A key from a popup an action opened reaches here through the React tree: not ours.\n if (event.defaultPrevented || !isOwnEvent(event)) return false;\n const target = event.target as HTMLElement;\n const popup = target.getAttribute('aria-haspopup');\n if (\n (event.key === 'ArrowDown' || event.key === 'ArrowUp') &&\n popup !== null &&\n popup !== 'false'\n ) {\n event.preventDefault();\n return false;\n }\n if (!treegrid || event.altKey || event.ctrlKey || event.metaKey || isEditableTarget(target)) {\n return false;\n }\n const intent = getArrowIntent(event.key, {\n orientation: 'horizontal',\n dir: getDirection(event.currentTarget),\n });\n return intent === 'prev';\n };\n\n const handleToolbarKeyDown = (event: React.KeyboardEvent<HTMLSpanElement>) => {\n const isPrev = handleKeyDown(event);\n if (event.defaultPrevented) return;\n rovingKeyDown(event);\n // \"Previous\" that the roving order did not take (the first action it reaches) returns.\n if (isPrev && event.target === document.activeElement) {\n event.preventDefault();\n onReturn();\n }\n };\n\n return (\n <span\n role=\"toolbar\"\n aria-labelledby={labelledBy}\n aria-orientation=\"horizontal\"\n data-tree-actions=\"\"\n data-roving-container=\"\"\n ref={rovingRef}\n data-focus-in-popup={popupFocus === null ? undefined : ''}\n onKeyDown={handleToolbarKeyDown}\n onFocus={handleToolbarFocus}\n onBlur={handleToolbarBlur}\n className={cn(\n treeItemClassNames.actions,\n 'inline-flex items-center gap-1',\n ACTIONS_VISIBILITY,\n )}\n >\n {children}\n </span>\n );\n};\nTreeItemActions.displayName = 'TreeItemActions';\n\n/**\n * One node of a Tree. Text and other content are the label; nested `Tree.Item` children form its\n * child group, which is shown while the item is expanded.\n *\n * Nested items must be `Tree.Item` elements among the item's own children: written directly, in\n * Fragments, or returned by a render function (`{node.children.map(renderNode)}`). A component\n * that renders `Tree.Item` itself (a recursive `<NodeView node={child} />`) is not recognised:\n * its output becomes part of the label, so the parent cannot expand (a development warning names\n * this). Render data-driven trees with a render function instead. The checks of a\n * `selectionMode=\"multiple\"` tree cascade by the same rule, so an item that such a component\n * renders is not checked with its parent.\n *\n * `ref` and every other prop land on the `role=\"treeitem\"` element, which contains the label row\n * and the child group. Its `onClick` receives only clicks on its own row (not on its child group\n * or nested items) and its `onKeyDown` only keys pressed while focus is on it or in its row; both\n * run before the built-in behaviour (call `event.preventDefault()` to skip it). In a checkbox\n * tree, a click on the item's checkbox toggles its check and is not passed to `onClick`, and\n * neither is a click on its actions; `onKeyDown` receives no keys pressed in the actions. Its\n * other event handlers (`onFocus`, `onDoubleClick`, `onContextMenu` and the rest) are not\n * filtered: as DOM events bubble, they also receive events from its child group and nested items\n * (compare `event.target` with `event.currentTarget` to tell them apart).\n *\n * `actions` render in a toolbar at the end of the row, named by the item; keys and clicks on them\n * belong to them and never activate or check the item. `aside` sits before them and describes the\n * item.\n *\n * The item is named by its label (`aria-labelledby`), not by its icon or nested items; an\n * `aria-label` or `aria-labelledby` prop replaces that name. Typeahead matches the label text too\n * (a `data-roving-text` prop replaces it).\n */\nexport const TreeItem = ({\n value,\n icon,\n iconAfter,\n expandIcon,\n aside,\n actions,\n leaf = false,\n className,\n children,\n onClick,\n onKeyDown,\n onFocus,\n onBlur,\n ref,\n ...props\n}: TreeItemProps) => {\n const { 'data-roving-text': typeaheadText, ...rest } = props as typeof props & {\n 'data-roving-text'?: string;\n };\n const ctx = useTreeContext('Tree.Item');\n const parent = React.useContext(TreeParentContext);\n const insideLabel = React.useContext(TreeLabelContext);\n const isExpanded = ctx.expanded.has(value);\n const labelId = useId('tree-item-label');\n const asideId = useId('tree-item-aside');\n const ancestorListed = React.useContext(TreeCheckForcedContext);\n const itemRef = React.useRef<HTMLDivElement>(null);\n const mergedRef = useMergedRefs<HTMLDivElement>(ref, itemRef);\n // A Tree.ItemPersonaLayout in the label registers its name and description: the item is named\n // by the name only and described by the description.\n const [layoutIds, setLayoutIds] = React.useState<PersonaLayoutIds | null>(null);\n const registerLayout = React.useCallback((ids: PersonaLayoutIds) => {\n setLayoutIds(ids);\n return () => setLayoutIds((current) => (current === ids ? null : current));\n }, []);\n const itemContext = React.useMemo<TreeItemContextValue>(\n () => ({ registerLayout }),\n [registerLayout],\n );\n const nameId = layoutIds?.nameId ?? labelId;\n\n const { registerValue, registerTopLevel } = ctx;\n React.useEffect(() => registerValue(value), [registerValue, value]);\n React.useEffect(() => {\n if (insideLabel) warnOnce('Tree.Item:inside-label', ITEM_IN_LABEL_MESSAGE);\n }, [insideLabel]);\n\n // Nested Tree.Items (and, as in 0.4, nested Trees) form the child group; the rest is the label.\n // Parts are identified through their element type, so parts written in a Server Component\n // (lazy references) count too.\n const nestedItems: React.ReactNode[] = [];\n const labelContent: React.ReactNode[] = [];\n let firstChildValue: string | undefined;\n flattenChildren(children).forEach(({ key, node: child }) => {\n const keyed = <React.Fragment key={key}>{child}</React.Fragment>;\n if (isElementOfType<TreeItemProps>(child, TreeItem)) {\n firstChildValue ??= child.props.value;\n nestedItems.push(keyed);\n } else if (isElementOfType(child, TreeRoot)) {\n nestedItems.push(keyed);\n } else {\n labelContent.push(keyed);\n }\n });\n\n // A falsy icon (`icon={name && <Icon />}` with `name` '' or a count of 0) is no icon, as in 0.4\n // and as in Avatar, and so is a collection whose items render nothing: no empty span adds a gap\n // to the row. The check does not consume a generator: renderSlot still renders its items.\n const iconNode =\n icon && slotRendersContent(icon)\n ? renderSlot(icon, 'span', cn(treeItemClassNames.icon, 'inline-flex shrink-0'), {\n 'aria-hidden': true,\n })\n : null;\n const iconAfterNode =\n iconAfter && slotRendersContent(iconAfter)\n ? renderSlot(iconAfter, 'span', cn(treeItemClassNames.iconAfter, 'inline-flex shrink-0'), {\n 'aria-hidden': true,\n })\n : null;\n // No empty aside and no empty toolbar (`actions={cond && <Button />}` with `cond` false).\n const hasAside = slotRendersContent(aside);\n const hasActions = slotRendersContent(actions);\n const hasChildren = nestedItems.length > 0 && !leaf;\n\n // The optional-indicator slot rule (C-SLOTS): `null`/`undefined` keep the chevron, `false` or\n // content that renders nothing hides it (the spacer keeps the column), and a custom glyph is\n // rendered as given, not rotated.\n let chevron: React.ReactNode = <span className=\"w-3 shrink-0\" aria-hidden=\"true\" />;\n if (hasChildren && (expandIcon === undefined || expandIcon === null)) {\n chevron = (\n <ChevronRightIcon\n className={cn(\n treeItemClassNames.expandIcon,\n 'shrink-0 transition-transform motion-reduce:transition-none',\n isExpanded ? 'rotate-90' : 'wave-rtl:-scale-x-100',\n )}\n />\n );\n } else if (hasChildren && slotRendersContent(expandIcon)) {\n chevron = renderSlot(\n expandIcon,\n 'span',\n cn(treeItemClassNames.expandIcon, 'inline-flex shrink-0'),\n { 'aria-hidden': true },\n );\n }\n\n // Checkbox tree: the item computes its state from its own subtree (the child-group rule) and\n // the checked list, so every state renders on the server and needs no other item. A top-level\n // item also hands its subtree to the root, which orders a toggle's list by it.\n const multiple = ctx.selectionMode === 'multiple';\n const ownNode = React.useMemo<TreeNode | null>(\n () =>\n multiple\n ? {\n value,\n children: leaf ? [] : collectItems(children, { item: TreeItem, tree: TreeRoot }),\n }\n : null,\n [multiple, value, leaf, children],\n );\n const checkState: CheckState | undefined = ownNode\n ? computeCheckStates([ownNode], ctx.checked, ancestorListed).get(value)\n : undefined;\n const selectionEntry = React.useRef<TreeSelectionEntry | null>(null);\n React.useLayoutEffect(() => {\n selectionEntry.current = ownNode ? { node: ownNode, element: itemRef.current } : null;\n });\n const isTopLevel = parent === null && !insideLabel;\n React.useLayoutEffect(\n () => (multiple && isTopLevel ? registerTopLevel(selectionEntry) : undefined),\n [multiple, isTopLevel, registerTopLevel],\n );\n const isSelected = ctx.selected !== undefined ? ctx.selected === value : undefined;\n const isCurrent = ctx.current !== undefined && ctx.current !== null && ctx.current === value;\n\n const activate = () => {\n if (hasChildren) ctx.toggle(value);\n ctx.activate(value);\n };\n\n const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (!isOwnClick(event)) return;\n onClick?.(event);\n if (!event.defaultPrevented) activate();\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (!isOwnKeyEvent(event)) return;\n onKeyDown?.(event);\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return;\n\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n activate();\n return;\n case ' ':\n event.preventDefault();\n // A checkbox tree toggles the focused item's check (APG); the other modes activate.\n if (checkState !== undefined) ctx.toggleChecked(value, event.nativeEvent);\n else activate();\n return;\n case '*': {\n event.preventDefault();\n const siblings = event.currentTarget.parentElement?.querySelectorAll<HTMLElement>(\n ':scope > [role=\"treeitem\"][aria-expanded=\"false\"][data-roving-value]',\n );\n ctx.expand(\n Array.from(siblings ?? [], (el) => el.getAttribute('data-roving-value') ?? '').filter(\n Boolean,\n ),\n );\n return;\n }\n default:\n }\n\n const intent = getArrowIntent(event.key, {\n orientation: 'horizontal',\n dir: getDirection(event.currentTarget),\n });\n if (intent === 'next') {\n event.preventDefault();\n if (hasChildren && !isExpanded) {\n ctx.toggle(value);\n return;\n }\n // Treegrid navigation moves into the row's actions, also from an open parent (Down reaches\n // its first child), where APG's tree moves to the first child.\n if (ctx.navigationMode === 'treegrid' && focusFirstAction(event.currentTarget)) return;\n if (hasChildren && firstChildValue !== undefined) ctx.focusValue(firstChildValue);\n } else if (intent === 'prev') {\n event.preventDefault();\n if (hasChildren && isExpanded) ctx.toggle(value);\n else if (parent !== null) ctx.focusValue(parent);\n }\n };\n\n // Focus in the actions: tracked from the events, because a removed element fires no reliable\n // blur. A blur that leaves for another element, or from an element still in the document, ends it.\n const focusedAction = React.useRef<Element | null>(null);\n const inOwnActions = (event: React.FocusEvent<HTMLElement>) =>\n (event.target as Element).closest('[data-tree-actions]')?.closest('[role=\"treeitem\"]') ===\n event.currentTarget;\n // Focus on the item, or on one of its own actions (a click), makes it the active item.\n const handleFocus = (event: React.FocusEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget || inOwnActions(event)) ctx.onItemFocus(value);\n if (inOwnActions(event)) focusedAction.current = event.target as Element;\n };\n\n const handleActionsBlur = (event: React.FocusEvent<HTMLDivElement>) => {\n if (inOwnActions(event) && (event.relatedTarget !== null || event.target.isConnected)) {\n focusedAction.current = null;\n }\n };\n // An action that had focus is gone (no longer in the document) and focus fell to the page: it\n // goes to the item instead. Focus anywhere else ends the record at the next render.\n React.useLayoutEffect(() => {\n const action = focusedAction.current;\n if (!action) return;\n const item = itemRef.current;\n const active = item?.ownerDocument.activeElement;\n if (active && active !== item.ownerDocument.body) {\n focusedAction.current = null;\n } else if (item && !action.isConnected) {\n focusedAction.current = null;\n item.focus({ preventScroll: true });\n }\n });\n\n // The checkbox never takes focus (APG: focus stays on tree items): a press on it focuses its\n // item instead, and its click toggles the check without activating the item.\n const keepFocusOnItem = (event: React.MouseEvent<HTMLSpanElement>) => {\n event.preventDefault();\n itemRef.current?.focus({ preventScroll: true });\n };\n const handleCheckboxClick = (event: React.MouseEvent<HTMLSpanElement>) => {\n ctx.toggleChecked(value, event.nativeEvent);\n };\n\n const checkbox =\n checkState === undefined ? null : (\n <span\n role=\"checkbox\"\n aria-checked={checkState === 'mixed' ? 'mixed' : checkState === 'checked'}\n aria-labelledby={nameId}\n tabIndex={-1}\n data-tree-checkbox=\"\"\n onMouseDown={keepFocusOnItem}\n onClick={handleCheckboxClick}\n className={cn(\n treeItemClassNames.indicator,\n // Checkbox's box: 16px inside a 24px target (the pseudo-element), WCAG 2.5.8.\n 'relative inline-flex size-4 shrink-0 items-center justify-center rounded-xs border transition-colors motion-reduce:transition-none',\n 'before:absolute before:-inset-1',\n checkState === 'unchecked'\n ? cn('border-stroke-accessible bg-transparent', forcedColors.control)\n : 'border-primary bg-primary text-primary-foreground forced-colors:border-[Highlight] forced-colors:bg-[Highlight]',\n )}\n >\n {checkState === 'mixed' ? (\n <SubtractIcon size={12} className={forcedColors.selectedLeaf} />\n ) : checkState === 'checked' ? (\n <CheckIcon size={12} className={forcedColors.selectedLeaf} />\n ) : null}\n </span>\n );\n\n // Single mode: a decorative radio (the treeitem's aria-selected carries the state). A click on\n // it is a click on the row, so it activates the item.\n const radio =\n ctx.selectionMode === 'single' ? (\n <span\n aria-hidden=\"true\"\n className={cn(\n treeItemClassNames.indicator,\n 'inline-flex size-4 shrink-0 items-center justify-center rounded-full border transition-colors motion-reduce:transition-none',\n isSelected\n ? 'border-2 border-primary forced-colors:border-[Highlight]'\n : cn('border-stroke-accessible', forcedColors.control),\n )}\n >\n {isSelected && (\n <span className={cn('block size-2 rounded-full bg-primary', forcedColors.selectedLeaf)} />\n )}\n </span>\n ) : null;\n // A tree item shows its checkbox in multiple mode, its radio in single mode, and nothing else.\n const indicator = checkbox ?? radio;\n\n // Items in this item's group are checked when the list checks this item or an ancestor.\n const groupListed = ancestorListed || (multiple && ctx.checked.has(value));\n\n return (\n <div\n role=\"treeitem\"\n aria-selected={isSelected}\n aria-current={isCurrent ? true : undefined}\n data-checked={checkState === 'checked' ? '' : undefined}\n data-mixed={checkState === 'mixed' ? '' : undefined}\n className={cn(\n treeItemClassNames.root,\n // The focus ring is drawn on the row: an outline on the treeitem would surround its\n // whole subtree.\n 'block outline-none',\n '[&:focus-visible>[data-tree-row]]:outline-2 [&:focus-visible>[data-tree-row]]:-outline-offset-2 [&:focus-visible>[data-tree-row]]:outline-ring',\n hasActions && ACTIONS_ON_ITEM_FOCUS,\n hasActions && hasAside && ASIDE_OFF_ON_ITEM_FOCUS,\n className,\n )}\n {...rest}\n // Named by its label only: the treeitem also contains its icon and its child group. A\n // consumer aria-labelledby or aria-label replaces it.\n aria-labelledby={\n rest['aria-labelledby'] ?? (rest['aria-label'] === undefined ? nameId : undefined)\n }\n // The aside describes the item, after a consumer description.\n aria-describedby={joinIds(\n rest['aria-describedby'],\n hasAside ? asideId : undefined,\n layoutIds?.descriptionId,\n )}\n aria-expanded={hasChildren ? isExpanded : undefined}\n // From the checked list, after the rest props, so a consumer cannot contradict it.\n aria-checked={\n checkState === undefined\n ? undefined\n : checkState === 'mixed'\n ? 'mixed'\n : checkState === 'checked'\n }\n tabIndex={ctx.getTabIndex(value)}\n data-roving-value={value}\n data-selected={isSelected ? '' : undefined}\n data-current={isCurrent ? '' : undefined}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onFocus={(event) =>\n composeEventHandlers(onFocus, handleFocus, { checkDefaultPrevented: false })(event)\n }\n onBlur={(event) =>\n composeEventHandlers(onBlur, handleActionsBlur, { checkDefaultPrevented: false })(event)\n }\n ref={mergedRef}\n >\n <div\n data-tree-row=\"\"\n className={cn(\n treeItemClassNames.row,\n 'flex cursor-pointer items-center gap-1.5 rounded px-2 py-1 hover:bg-subtle-hover',\n hasActions && 'group/row',\n isSelected && cn('bg-subtle-selected font-semibold', forcedColors.selectedContainer),\n )}\n >\n {chevron}\n {indicator}\n {iconNode}\n <span\n id={labelId}\n data-tree-label=\"\"\n data-roving-text={typeaheadText}\n // The label shrinks (and truncates) when the row has content after it.\n className={cn(\n treeItemClassNames.label,\n 'truncate',\n (iconAfterNode || hasAside || hasActions) && 'min-w-0',\n )}\n >\n <TreeCheckForcedContext.Provider value={false}>\n <TreeLabelContext.Provider value>\n <TreeItemContext.Provider value={itemContext}>\n {labelContent}\n </TreeItemContext.Provider>\n </TreeLabelContext.Provider>\n </TreeCheckForcedContext.Provider>\n </span>\n {iconAfterNode}\n {(hasAside || hasActions) && (\n <span\n data-tree-end=\"\"\n className={cn(\n 'group/end ms-auto inline-grid shrink-0 items-center gap-1',\n hasAside && hasActions && END_CELL_SHARED,\n )}\n >\n {hasAside && (\n <span\n id={asideId}\n data-tree-aside=\"\"\n className={cn(\n treeItemClassNames.aside,\n 'inline-flex items-center text-caption-1 text-muted-foreground',\n hasActions && ASIDE_OFF_WITH_ACTIONS,\n )}\n >\n {materialiseSlotContent(aside)}\n </span>\n )}\n {hasActions && (\n <TreeItemActions\n labelledBy={nameId}\n tabStop={\n ctx.navigationMode === 'tree' && ctx.focusedItem === value\n ? 'last-focused'\n : 'none'\n }\n navigationMode={ctx.navigationMode}\n onReturn={() => ctx.focusValue(value)}\n >\n {materialiseSlotContent(actions)}\n </TreeItemActions>\n )}\n </span>\n )}\n </div>\n {hasChildren && isExpanded && (\n <TreeParentContext.Provider value={value}>\n <TreeCheckForcedContext.Provider value={groupListed}>\n <TreeLabelContext.Provider value={false}>\n <div role=\"group\" className={cn(treeItemClassNames.group, 'ps-4')}>\n {nestedItems}\n </div>\n </TreeLabelContext.Provider>\n </TreeCheckForcedContext.Provider>\n </TreeParentContext.Provider>\n )}\n </div>\n );\n};\nTreeItem.displayName = 'TreeItem';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAMG,KAA2B,CAAC,GAE5BC,KACJ;AAOF,SAASC,GAAmB,GAAqB;CAC/C,EACE,kBAAkBC,KAClB,wCAAwCA,EAAM,uHAEhD;AACF;AAEA,IAAMC,KACJ,kIAGIC,KACJ,6IAGIC,KACJ;AAIF,SAASC,EACP,GACY;CAEZ,OADKC,IACE,MAAM,KAAKA,IAAU,MAAUC,EAAM,OAAO,CAAC,CACjD,QAAQ,MAAuCA,MAAU,IAAI,CAAC,CAC9D,MAAM,GAAG,MACJ,CAACC,EAAE,WAAW,CAACC,EAAE,WAAWD,EAAE,YAAYC,EAAE,UAAgB,IACzDD,EAAE,QAAQ,wBAAwBC,EAAE,OAAO,IAAI,KAAK,8BACvD,KACA,CACL,CAAC,CACD,KAAK,MAAUF,EAAM,IAAI,IATP,CAAC;AAUxB;AAMA,IAAMG,IAAqB,uBAGrBC,IAAuB,0EASvBC,KACJ,gGAGIC,KACJ,wIASIC,IACJ,8KAGIC,KACJ,uSAGIC,KAAkB;AASxB,SAASC,GAAiB,GAA4B;CACpD,IAAMC,IAAUC,EAAK,cAA2B,8CAA8C;CAC9F,IAAI,CAACD,GAAS,OAAO;CACrB,IAAME,oBAAY,IAAI,IAAsB;CAC5C,KAAK,IAAMC,KAAM,MAAM,KAAKH,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1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/slot.cjs"),r=require("../../lib/classNames.cjs"),i=require("../../hooks/useId.cjs"),a=require("./Tree.context.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=({media:e,description:c,className:l,children:u,ref:d,...f})=>{let{registerLayout:p}=a.useTreeItemContext(`Tree.ItemPersonaLayout`),m=i.useId(`tree-persona-name`),h=i.useId(`tree-persona-description`),g=n.slotRendersContent(e),_=n.slotRendersContent(c);return o.useLayoutEffect(()=>p({nameId:m,descriptionId:_?h:void 0}),[p,m,h,_]),(0,s.jsxs)(`span`,{ref:d,className:t.cn(r.treeItemPersonaLayoutClassNames.root,`flex min-w-0 items-center gap-2`,l),...f,children:[g&&(0,s.jsx)(`span`,{className:t.cn(r.treeItemPersonaLayoutClassNames.media,`inline-flex shrink-0`),children:n.materialiseSlotContent(e)}),(0,s.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,s.jsx)(`span`,{id:m,"data-tree-persona-name":``,className:t.cn(r.treeItemPersonaLayoutClassNames.main,`truncate`),children:u}),_&&(0,s.jsx)(`span`,{id:h,className:t.cn(r.treeItemPersonaLayoutClassNames.description,`truncate text-caption-1 text-muted-foreground`),children:n.materialiseSlotContent(c)})]})]})};c.displayName=`TreeItemPersonaLayout`,exports.TreeItemPersonaLayout=c;
2
+ //# sourceMappingURL=Tree.itemPersonaLayout.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.itemPersonaLayout.cjs","names":["useTreeItemContext","useId","slotRendersContent","cn","treeItemPersonaLayoutClassNames","materialiseSlotContent","require_runtime","require_cn","require_slot","require_classNames","require_useId","require_Tree_context","react","react_jsx_runtime","TreeItemPersonaLayout","rest","nameId","descriptionId","hasMedia","media","hasDescription","description","registerLayout","className"],"sources":["../../../src/components/layout/Tree.itemPersonaLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { treeItemPersonaLayoutClassNames } from '../../lib/classNames';\nimport { cn } from '../../lib/cn';\nimport { materialiseSlotContent, slotRendersContent } from '../../lib/slot';\nimport { useId } from '../../hooks/useId';\nimport { useTreeItemContext } from './Tree.context';\n\n/** Properties for the TreeItemPersonaLayout sub-component (Fluent's `TreeItemPersonaLayout`). */\nexport interface TreeItemPersonaLayoutProps extends React.HTMLAttributes<HTMLSpanElement> {\n /**\n * The person's picture, usually an Avatar (`size=\"small\"`, 32 px, fits a row). The name is shown\n * next to it, so make it decorative (`<Avatar decorative … />`).\n */\n media?: React.ReactNode;\n /** A second line under the name; it describes the item. */\n description?: React.ReactNode;\n ref?: React.Ref<HTMLSpanElement>;\n}\n\n/**\n * Lays out an item's label as a person: `media`, the name (children) and a `description` under\n * it. Use it as a Tree.Item's label content: the item is named by the name and described by the\n * description. Also exported as `TreeItemPersonaLayout` (Fluent's name; import the flat name from\n * React Server Components).\n */\nexport const TreeItemPersonaLayout = ({\n media,\n description,\n className,\n children,\n ref,\n ...rest\n}: TreeItemPersonaLayoutProps) => {\n const { registerLayout } = useTreeItemContext('Tree.ItemPersonaLayout');\n const nameId = useId('tree-persona-name');\n const descriptionId = useId('tree-persona-description');\n const hasMedia = slotRendersContent(media);\n const hasDescription = slotRendersContent(description);\n\n React.useLayoutEffect(\n () => registerLayout({ nameId, descriptionId: hasDescription ? descriptionId : undefined }),\n [registerLayout, nameId, descriptionId, hasDescription],\n );\n\n return (\n <span\n ref={ref}\n className={cn(\n treeItemPersonaLayoutClassNames.root,\n 'flex min-w-0 items-center gap-2',\n className,\n )}\n {...rest}\n >\n {hasMedia && (\n <span className={cn(treeItemPersonaLayoutClassNames.media, 'inline-flex shrink-0')}>\n {materialiseSlotContent(media)}\n </span>\n )}\n <span className=\"flex min-w-0 flex-col\">\n <span\n id={nameId}\n data-tree-persona-name=\"\"\n className={cn(treeItemPersonaLayoutClassNames.main, 'truncate')}\n >\n {children}\n </span>\n {hasDescription && (\n <span\n id={descriptionId}\n className={cn(\n treeItemPersonaLayoutClassNames.description,\n 'truncate text-caption-1 text-muted-foreground',\n )}\n >\n {materialiseSlotContent(description)}\n </span>\n )}\n </span>\n </span>\n );\n};\nTreeItemPersonaLayout.displayName = 'TreeItemPersonaLayout';\n"],"mappings":"uTAyBA,IAAac,GAAyB,CACpC,QACA,cACA,YACA,WACA,MACA,GAAGC,KAC6B,CAChC,GAAM,CAAE,kBAAmBf,EAAAA,mBAAmB,wBAAwB,EAChEgB,EAASf,EAAAA,MAAM,mBAAmB,EAClCgB,EAAgBhB,EAAAA,MAAM,0BAA0B,EAChDiB,EAAWhB,EAAAA,mBAAmBiB,CAAK,EACnCC,EAAiBlB,EAAAA,mBAAmBmB,CAAW,EAOrD,OALAT,EAAM,oBACEU,EAAe,CAAE,SAAQ,cAAeF,EAAiBH,EAAgB,IAAA,EAAU,CAAC,EAC1F,CAACK,EAAgBN,EAAQC,EAAeG,CAAc,CACxD,GAGE,EAAAP,EAAA,KAAA,CAAC,OAAD,CACO,MACL,UAAWV,EAAAA,GACTC,EAAAA,gCAAgC,KAChC,kCACAmB,CACF,EACA,GAAIR,EAPN,SAAA,CASGG,IACC,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWV,EAAAA,GAAGC,EAAAA,gCAAgC,MAAO,sBAAsB,EAC9E,SAAAC,EAAAA,uBAAuBc,CAAK,CACzB,CAAA,GAER,EAAAN,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,wBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CACE,GAAIG,EACJ,yBAAuB,GACvB,UAAWb,EAAAA,GAAGC,EAAAA,gCAAgC,KAAM,UAAU,EAE7D,UACG,CAAA,EACLgB,IACC,EAAAP,EAAA,IAAA,CAAC,OAAD,CACE,GAAII,EACJ,UAAWd,EAAAA,GACTC,EAAAA,gCAAgC,YAChC,+CACF,EAEC,SAAAC,EAAAA,uBAAuBgB,CAAW,CAC/B,CAAA,CAEJ,CACF,CAAA,CAAA,GAEV,EACA,EAAsB,YAAc"}
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { materialiseSlotContent as t, slotRendersContent as n } from "../../lib/slot.mjs";
4
+ import { treeItemPersonaLayoutClassNames as r } from "../../lib/classNames.mjs";
5
+ import { useId as i } from "../../hooks/useId.mjs";
6
+ import { useTreeItemContext as a } from "./Tree.context.mjs";
7
+ import * as o from "react";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ //#region src/components/layout/Tree.itemPersonaLayout.tsx
10
+ var l = ({ media: l, description: u, className: d, children: f, ref: p, ...m }) => {
11
+ let { registerLayout: h } = a("Tree.ItemPersonaLayout"), g = i("tree-persona-name"), _ = i("tree-persona-description"), v = n(l), y = n(u);
12
+ return o.useLayoutEffect(() => h({
13
+ nameId: g,
14
+ descriptionId: y ? _ : void 0
15
+ }), [
16
+ h,
17
+ g,
18
+ _,
19
+ y
20
+ ]), /* @__PURE__ */ c("span", {
21
+ ref: p,
22
+ className: e(r.root, "flex min-w-0 items-center gap-2", d),
23
+ ...m,
24
+ children: [v && /* @__PURE__ */ s("span", {
25
+ className: e(r.media, "inline-flex shrink-0"),
26
+ children: t(l)
27
+ }), /* @__PURE__ */ c("span", {
28
+ className: "flex min-w-0 flex-col",
29
+ children: [/* @__PURE__ */ s("span", {
30
+ id: g,
31
+ "data-tree-persona-name": "",
32
+ className: e(r.main, "truncate"),
33
+ children: f
34
+ }), y && /* @__PURE__ */ s("span", {
35
+ id: _,
36
+ className: e(r.description, "truncate text-caption-1 text-muted-foreground"),
37
+ children: t(u)
38
+ })]
39
+ })]
40
+ });
41
+ };
42
+ l.displayName = "TreeItemPersonaLayout";
43
+ //#endregion
44
+ export { l as TreeItemPersonaLayout };
45
+
46
+ //# sourceMappingURL=Tree.itemPersonaLayout.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.itemPersonaLayout.mjs","names":["useId","useId$1","React","TreeItemPersonaLayout","rest","useTreeItemContext","nameId","descriptionId","hasMedia","slotRendersContent","media","hasDescription","description","registerLayout","cn","treeItemPersonaLayoutClassNames","className","materialiseSlotContent"],"sources":["../../../src/components/layout/Tree.itemPersonaLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { treeItemPersonaLayoutClassNames } from '../../lib/classNames';\nimport { cn } from '../../lib/cn';\nimport { materialiseSlotContent, slotRendersContent } from '../../lib/slot';\nimport { useId } from '../../hooks/useId';\nimport { useTreeItemContext } from './Tree.context';\n\n/** Properties for the TreeItemPersonaLayout sub-component (Fluent's `TreeItemPersonaLayout`). */\nexport interface TreeItemPersonaLayoutProps extends React.HTMLAttributes<HTMLSpanElement> {\n /**\n * The person's picture, usually an Avatar (`size=\"small\"`, 32 px, fits a row). The name is shown\n * next to it, so make it decorative (`<Avatar decorative … />`).\n */\n media?: React.ReactNode;\n /** A second line under the name; it describes the item. */\n description?: React.ReactNode;\n ref?: React.Ref<HTMLSpanElement>;\n}\n\n/**\n * Lays out an item's label as a person: `media`, the name (children) and a `description` under\n * it. Use it as a Tree.Item's label content: the item is named by the name and described by the\n * description. Also exported as `TreeItemPersonaLayout` (Fluent's name; import the flat name from\n * React Server Components).\n */\nexport const TreeItemPersonaLayout = ({\n media,\n description,\n className,\n children,\n ref,\n ...rest\n}: TreeItemPersonaLayoutProps) => {\n const { registerLayout } = useTreeItemContext('Tree.ItemPersonaLayout');\n const nameId = useId('tree-persona-name');\n const descriptionId = useId('tree-persona-description');\n const hasMedia = slotRendersContent(media);\n const hasDescription = slotRendersContent(description);\n\n React.useLayoutEffect(\n () => registerLayout({ nameId, descriptionId: hasDescription ? descriptionId : undefined }),\n [registerLayout, nameId, descriptionId, hasDescription],\n );\n\n return (\n <span\n ref={ref}\n className={cn(\n treeItemPersonaLayoutClassNames.root,\n 'flex min-w-0 items-center gap-2',\n className,\n )}\n {...rest}\n >\n {hasMedia && (\n <span className={cn(treeItemPersonaLayoutClassNames.media, 'inline-flex shrink-0')}>\n {materialiseSlotContent(media)}\n </span>\n )}\n <span className=\"flex min-w-0 flex-col\">\n <span\n id={nameId}\n data-tree-persona-name=\"\"\n className={cn(treeItemPersonaLayoutClassNames.main, 'truncate')}\n >\n {children}\n </span>\n {hasDescription && (\n <span\n id={descriptionId}\n className={cn(\n treeItemPersonaLayoutClassNames.description,\n 'truncate text-caption-1 text-muted-foreground',\n )}\n >\n {materialiseSlotContent(description)}\n </span>\n )}\n </span>\n </span>\n );\n};\nTreeItemPersonaLayout.displayName = 'TreeItemPersonaLayout';\n"],"mappings":";;;;;;;;;AAyBA,IAAaG,KAAyB,EACpC,UACA,gBACA,cACA,aACA,QACA,GAAGC,QAC6B;CAChC,IAAM,EAAE,sBAAmBC,EAAmB,wBAAwB,GAChEC,IAASN,EAAM,mBAAmB,GAClCO,IAAgBP,EAAM,0BAA0B,GAChDQ,IAAWC,EAAmBC,CAAK,GACnCC,IAAiBF,EAAmBG,CAAW;CAOrD,OALAV,EAAM,sBACEW,EAAe;EAAE;EAAQ,eAAeF,IAAiBJ,IAAgB,KAAA;CAAU,CAAC,GAC1F;EAACM;EAAgBP;EAAQC;EAAeI;CAAc,CACxD,GAGE,kBAAC,QAAD;EACO;EACL,WAAWG,EACTC,EAAgC,MAChC,mCACAC,CACF;EACA,GAAIZ;EAPN,UAAA,CASGI,KACC,kBAAC,QAAD;GAAM,WAAWM,EAAGC,EAAgC,OAAO,sBAAsB;GAC9E,UAAAE,EAAuBP,CAAK;EACzB,CAAA,GAER,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,kBAAC,QAAD;IACE,IAAIJ;IACJ,0BAAuB;IACvB,WAAWQ,EAAGC,EAAgC,MAAM,UAAU;IAE7D;GACG,CAAA,GACLJ,KACC,kBAAC,QAAD;IACE,IAAIJ;IACJ,WAAWO,EACTC,EAAgC,aAChC,+CACF;IAEC,UAAAE,EAAuBL,CAAW;GAC/B,CAAA,CAEJ;EACF,CAAA,CAAA;;AAEV;AACA,EAAsB,cAAc"}
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { TreeItem as e, TreeRoot as t } from "./Tree.core.mjs";
3
+ import { TreeItemPersonaLayout as n } from "./Tree.itemPersonaLayout.mjs";
4
+ //#region src/components/layout/Tree.tsx
5
+ var r = /* @__PURE__ */ Object.assign(t, {
6
+ Item: e,
7
+ ItemPersonaLayout: n
8
+ });
9
+ //#endregion
10
+ export { r as Tree, e as TreeItem, n as TreeItemPersonaLayout };
11
+
12
+ //# sourceMappingURL=Tree.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.mjs","names":["Tree","TreeRoot","TreeItem","TreeItemPersonaLayout"],"sources":["../../../src/components/layout/Tree.tsx"],"sourcesContent":["import { TreeItem, TreeRoot } from './Tree.core';\nimport { TreeItemPersonaLayout } from './Tree.itemPersonaLayout';\n\nexport type { TreeCheckedItemsChangeDetails, TreeItemProps, TreeProps } from './Tree.core';\nexport type { TreeItemPersonaLayoutProps } from './Tree.itemPersonaLayout';\n\n/**\n * A hierarchical list (WAI-ARIA Tree View pattern) with a single tab stop: Up/Down move between\n * visible items, Home/End to the first/last, Right expands or moves to the first child (or into\n * the row's actions, see below), Left collapses or moves to the parent (both mirrored in RTL),\n * Enter activates (and toggles a parent), and so does Space unless the tree has checkboxes, `*`\n * expands the siblings, and typing jumps to an item by its text.\n *\n * Keyboard focus enters at the `selected` item, else the first item; while focus is inside, the\n * tab stop follows it, so Shift+Tab leaves the tree.\n *\n * `selectionMode=\"multiple\"` draws a checkbox on every item, bound to `checkedItems`: Space\n * toggles the focused item's check, a click on the checkbox toggles it, and a click elsewhere on\n * the row activates the item (as Enter does). Checks cascade: checking an item checks every item\n * nested in it, and an item shows checked when all of its nested items are checked, mixed when\n * some are. `onCheckedItemsChange` receives every checked item in tree order (fully checked parents\n * included), followed by listed values that match no item, and `details` (`value`, `checked`,\n * `event`).\n *\n * Row content: `actions` (buttons at the end of the row, in a toolbar named by the item, shown on\n * hover and focus, and always where there is no hover or colors are forced), `aside` (a count or a\n * badge that describes the item), `iconAfter` and `expandIcon`. Tab from the focused item enters\n * its actions and Shift+Tab returns. Keys and clicks on the actions never activate or check the\n * item. With `navigationMode=\"treegrid\"`, Right (Left in right-to-left layouts) moves from an\n * item into its actions and Left returns, the actions take no Tab stop, and on an open parent Right\n * moves into its actions rather than to its first child (Down does); the roles stay `tree` and\n * `treeitem`.\n *\n * Items are `Tree.Item` elements; nested items are written in their parent's children (directly,\n * in Fragments, or returned by a render function), not rendered by a component of their own.\n * Every item needs a `value` that is unique within the Tree. `Tree.ItemPersonaLayout` lays out a\n * person (media, name and description) as an item's label.\n *\n * `Tree.Item` and `Tree.ItemPersonaLayout` are also exported as `TreeItem` and\n * `TreeItemPersonaLayout` for React Server Components, which cannot use the dotted form.\n */\nexport const Tree = /* @__PURE__ */ Object.assign(TreeRoot, {\n Item: TreeItem,\n ItemPersonaLayout: TreeItemPersonaLayout,\n});\n\nexport { TreeItem, TreeItemPersonaLayout };\n"],"mappings":";;;;AAyCA,IAAaA,IAAuB,uBAAO,OAAOC,GAAU;CAC1D,MAAMC;CACN,mBAAmBC;AACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/children.cjs");let n=require("react");n=e.__toESM(n,1);function r(e,i){let a=[];for(let o of n.Children.toArray(e)){if(!n.isValidElement(o))continue;let e=t.getElementType(o,{suspend:!1});if(e===n.Fragment){a.push(...r(o.props.children,i));continue}if(e===i.tree||e!==i.item)continue;let{value:s,leaf:c,children:l}=o.props;typeof s==`string`&&a.push({value:s,children:c===!0?[]:r(l,i)})}return a}function i(e,t){for(let n of e)t(n),i(n.children,t)}function a(e,t){for(let n of e){if(n.value===t)return[n];let e=a(n.children,t);if(e)return[n,...e]}return null}function o(e,t,n=!1){let r=new Map;i(e,e=>{r.has(e.value)||r.set(e.value,e)});let a=new Map,o=(e,n)=>{let i=n||t.has(e.value),s=e.children.map(e=>o(e,i)),c;return c=i?`checked`:s.length===0?`unchecked`:s.every(e=>e===`checked`)?`checked`:s.some(e=>e!==`unchecked`)?`mixed`:`unchecked`,r.get(e.value)===e&&a.set(e.value,c),c};for(let t of e)o(t,n);return a}function s(e,t,n){let r=o(e,new Set(t)),s=new Set;for(let[e,t]of r)t===`checked`&&s.add(e);let c=new Set;i(e,e=>c.add(e.value));let l=Array.from(new Set(t.filter(e=>!c.has(e)))),u=a(e,n);if(u){let e=u[u.length-1],t=r.get(n)!==`checked`;i([e],e=>{t?s.add(e.value):s.delete(e.value)});for(let e=u.length-2;e>=0;--e){let t=u[e];t.children.every(e=>s.has(e.value))?s.add(t.value):s.delete(t.value)}}else{let e=l.indexOf(n);e===-1?l.push(n):l.splice(e,1)}let d=[],f=new Set;return i(e,e=>{s.has(e.value)&&!f.has(e.value)&&(f.add(e.value),d.push(e.value))}),[...d,...l]}exports.collectItems=r,exports.computeCheckStates=o,exports.toggleCheck=s;
2
+ //# sourceMappingURL=Tree.selection.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.selection.cjs","names":["React","getElementType","require_runtime","require_children","react","collectItems","nodes","node","children","type","types","nested","value","leaf","forEachNode","visit","findPath","below","computeCheckStates","first","candidate","states","forced","forcedAbove","listed","current","childStates","child","state","childState","top","ancestorListed","toggleCheck","checked","itemValue","known","unmatched","listedValue","path","target","turnOn","index","ancestor","at","ordered","seen"],"sources":["../../../src/components/layout/Tree.selection.ts"],"sourcesContent":["import * as React from 'react';\nimport { getElementType } from '../../lib/children';\n\n/** One Tree.Item of the cascade model: its value and the items nested in it. */\nexport interface TreeNode {\n value: string;\n children: TreeNode[];\n}\n\n/** The check state of an item in a `selectionMode=\"multiple\"` tree. */\nexport type CheckState = 'checked' | 'mixed' | 'unchecked';\n\n/** The element types the scan compares with: the item type, and the tree type (a tree of its own). */\nexport interface TreeElementTypes {\n item: unknown;\n tree: unknown;\n}\n\ninterface ItemElementProps {\n value?: unknown;\n leaf?: unknown;\n children?: React.ReactNode;\n}\n\n/**\n * The Tree.Item elements among `children`, recursively and in element order: the rule that forms\n * an item's child group (items written directly, in Fragments, or returned by a render function),\n * so the items of a collapsed item count too. A `leaf` item has none; a nested tree is a tree of\n * its own; any other element is not entered (an item that a component renders is not part of a\n * child group). A lazy type whose code is still loading is skipped instead of suspending the\n * caller (`getElementType(…, { suspend: false })`, as walks deeper than the direct children do).\n */\nexport function collectItems(children: React.ReactNode, types: TreeElementTypes): TreeNode[] {\n const nodes: TreeNode[] = [];\n for (const node of React.Children.toArray(children)) {\n if (!React.isValidElement<ItemElementProps>(node)) continue;\n const type = getElementType(node, { suspend: false });\n if (type === React.Fragment) {\n // Flattened here rather than through `flattenChildren`, which resolves lazy types with\n // suspending: a Fragment's items belong to the enclosing group.\n nodes.push(...collectItems(node.props.children, types));\n continue;\n }\n if (type === types.tree || type !== types.item) continue;\n const { value, leaf, children: nested } = node.props;\n if (typeof value !== 'string') continue;\n nodes.push({ value, children: leaf === true ? [] : collectItems(nested, types) });\n }\n return nodes;\n}\n\nfunction forEachNode(nodes: readonly TreeNode[], visit: (node: TreeNode) => void): void {\n for (const node of nodes) {\n visit(node);\n forEachNode(node.children, visit);\n }\n}\n\n/** The first item with `value` in tree order and its ancestors, from the top down; `null` if none. */\nfunction findPath(nodes: readonly TreeNode[], value: string): TreeNode[] | null {\n for (const node of nodes) {\n if (node.value === value) return [node];\n const below = findPath(node.children, value);\n if (below) return [node, ...below];\n }\n return null;\n}\n\n/**\n * The check state of every item: checked when its value is listed, when an ancestor's value is\n * listed (or `ancestorListed`), or when it has nested items and all of them are checked; mixed\n * when some of them are checked or mixed; else unchecked. For a value that several items share,\n * the first item in tree order decides the entry.\n */\nexport function computeCheckStates(\n nodes: readonly TreeNode[],\n listed: ReadonlySet<string>,\n ancestorListed = false,\n): Map<string, CheckState> {\n const first = new Map<string, TreeNode>();\n forEachNode(nodes, (candidate) => {\n if (!first.has(candidate.value)) first.set(candidate.value, candidate);\n });\n const states = new Map<string, CheckState>();\n const visit = (current: TreeNode, forcedAbove: boolean): CheckState => {\n const forced = forcedAbove || listed.has(current.value);\n const childStates = current.children.map((child) => visit(child, forced));\n let state: CheckState;\n if (forced) state = 'checked';\n else if (childStates.length === 0) state = 'unchecked';\n else if (childStates.every((childState) => childState === 'checked')) state = 'checked';\n else if (childStates.some((childState) => childState !== 'unchecked')) state = 'mixed';\n else state = 'unchecked';\n if (first.get(current.value) === current) states.set(current.value, state);\n return state;\n };\n for (const top of nodes) visit(top, ancestorListed);\n return states;\n}\n\n/**\n * The checked items after toggling `value`. A checked item and every item nested in it become\n * unchecked; an unchecked or mixed one and every item nested in it become checked; its ancestors\n * then follow their nested items. Returns every checked item in tree order (fully checked parents\n * included, mixed ones not), each value once, followed by the listed values that match no item,\n * in their order; a value that no item has is added to, or removed from, those.\n */\nexport function toggleCheck(\n nodes: readonly TreeNode[],\n listed: readonly string[],\n value: string,\n): string[] {\n const states = computeCheckStates(nodes, new Set(listed));\n const checked = new Set<string>();\n for (const [itemValue, state] of states) {\n if (state === 'checked') checked.add(itemValue);\n }\n const known = new Set<string>();\n forEachNode(nodes, (candidate) => known.add(candidate.value));\n const unmatched = Array.from(new Set(listed.filter((listedValue) => !known.has(listedValue))));\n\n const path = findPath(nodes, value);\n if (path) {\n const target = path[path.length - 1];\n const turnOn = states.get(value) !== 'checked';\n forEachNode([target], (candidate) => {\n if (turnOn) checked.add(candidate.value);\n else checked.delete(candidate.value);\n });\n for (let index = path.length - 2; index >= 0; index -= 1) {\n const ancestor = path[index];\n if (ancestor.children.every((child) => checked.has(child.value))) checked.add(ancestor.value);\n else checked.delete(ancestor.value);\n }\n } else {\n const at = unmatched.indexOf(value);\n if (at === -1) unmatched.push(value);\n else unmatched.splice(at, 1);\n }\n\n const ordered: string[] = [];\n const seen = new Set<string>();\n forEachNode(nodes, (candidate) => {\n if (checked.has(candidate.value) && !seen.has(candidate.value)) {\n seen.add(candidate.value);\n ordered.push(candidate.value);\n }\n });\n return [...ordered, ...unmatched];\n}\n"],"mappings":"iJAg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T,EAAQ,OAAOS,EAAS,KAAK,CACpC,CACF,KAAO,CACL,IAAMC,EAAKP,EAAU,QAAQxB,CAAK,EAC9B+B,IAAO,GAAIP,EAAU,KAAKxB,CAAK,EAC9BwB,EAAU,OAAOO,EAAI,CAAC,CAC7B,CAEA,IAAMC,EAAoB,CAAC,EACrBC,EAAO,IAAI,IAOjB,OANA/B,EAAYR,EAAQ,GAAc,CAC5B2B,EAAQ,IAAIb,EAAU,KAAK,GAAK,CAACyB,EAAK,IAAIzB,EAAU,KAAK,IAC3DyB,EAAK,IAAIzB,EAAU,KAAK,EACxBwB,EAAQ,KAAKxB,EAAU,KAAK,EAEhC,CAAC,EACM,CAAC,GAAGwB,EAAS,GAAGR,CAAS,CAClC"}
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { getElementType as e } from "../../lib/children.mjs";
3
+ import * as t from "react";
4
+ //#region src/components/layout/Tree.selection.ts
5
+ function n(r, i) {
6
+ let a = [];
7
+ for (let o of t.Children.toArray(r)) {
8
+ if (!t.isValidElement(o)) continue;
9
+ let r = e(o, { suspend: !1 });
10
+ if (r === t.Fragment) {
11
+ a.push(...n(o.props.children, i));
12
+ continue;
13
+ }
14
+ if (r === i.tree || r !== i.item) continue;
15
+ let { value: s, leaf: c, children: l } = o.props;
16
+ typeof s == "string" && a.push({
17
+ value: s,
18
+ children: c === !0 ? [] : n(l, i)
19
+ });
20
+ }
21
+ return a;
22
+ }
23
+ function r(e, t) {
24
+ for (let n of e) t(n), r(n.children, t);
25
+ }
26
+ function i(e, t) {
27
+ for (let n of e) {
28
+ if (n.value === t) return [n];
29
+ let e = i(n.children, t);
30
+ if (e) return [n, ...e];
31
+ }
32
+ return null;
33
+ }
34
+ function a(e, t, n = !1) {
35
+ let i = /* @__PURE__ */ new Map();
36
+ r(e, (e) => {
37
+ i.has(e.value) || i.set(e.value, e);
38
+ });
39
+ let a = /* @__PURE__ */ new Map(), o = (e, n) => {
40
+ let r = n || t.has(e.value), s = e.children.map((e) => o(e, r)), c;
41
+ return c = r ? "checked" : s.length === 0 ? "unchecked" : s.every((e) => e === "checked") ? "checked" : s.some((e) => e !== "unchecked") ? "mixed" : "unchecked", i.get(e.value) === e && a.set(e.value, c), c;
42
+ };
43
+ for (let t of e) o(t, n);
44
+ return a;
45
+ }
46
+ function o(e, t, n) {
47
+ let o = a(e, new Set(t)), s = /* @__PURE__ */ new Set();
48
+ for (let [e, t] of o) t === "checked" && s.add(e);
49
+ let c = /* @__PURE__ */ new Set();
50
+ r(e, (e) => c.add(e.value));
51
+ let l = Array.from(new Set(t.filter((e) => !c.has(e)))), u = i(e, n);
52
+ if (u) {
53
+ let e = u[u.length - 1], t = o.get(n) !== "checked";
54
+ r([e], (e) => {
55
+ t ? s.add(e.value) : s.delete(e.value);
56
+ });
57
+ for (let e = u.length - 2; e >= 0; --e) {
58
+ let t = u[e];
59
+ t.children.every((e) => s.has(e.value)) ? s.add(t.value) : s.delete(t.value);
60
+ }
61
+ } else {
62
+ let e = l.indexOf(n);
63
+ e === -1 ? l.push(n) : l.splice(e, 1);
64
+ }
65
+ let d = [], f = /* @__PURE__ */ new Set();
66
+ return r(e, (e) => {
67
+ s.has(e.value) && !f.has(e.value) && (f.add(e.value), d.push(e.value));
68
+ }), [...d, ...l];
69
+ }
70
+ //#endregion
71
+ export { n as collectItems, a as computeCheckStates, o as toggleCheck };
72
+
73
+ //# sourceMappingURL=Tree.selection.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.selection.mjs","names":["React","collectItems","nodes","node","children","type","getElementType","types","nested","value","leaf","forEachNode","visit","findPath","below","computeCheckStates","first","candidate","states","forced","forcedAbove","listed","current","childStates","child","state","childState","top","ancestorListed","toggleCheck","checked","itemValue","known","unmatched","listedValue","path","target","turnOn","index","ancestor","at","ordered","seen"],"sources":["../../../src/components/layout/Tree.selection.ts"],"sourcesContent":["import * as React from 'react';\nimport { getElementType } from '../../lib/children';\n\n/** One Tree.Item of the cascade model: its value and the items nested in it. */\nexport interface TreeNode {\n value: string;\n children: TreeNode[];\n}\n\n/** The check state of an item in a `selectionMode=\"multiple\"` tree. */\nexport type CheckState = 'checked' | 'mixed' | 'unchecked';\n\n/** The element types the scan compares with: the item type, and the tree type (a tree of its own). */\nexport interface TreeElementTypes {\n item: unknown;\n tree: unknown;\n}\n\ninterface ItemElementProps {\n value?: unknown;\n leaf?: unknown;\n children?: React.ReactNode;\n}\n\n/**\n * The Tree.Item elements among `children`, recursively and in element order: the rule that forms\n * an item's child group (items written directly, in Fragments, or returned by a render function),\n * so the items of a collapsed item count too. A `leaf` item has none; a nested tree is a tree of\n * its own; any other element is not entered (an item that a component renders is not part of a\n * child group). A lazy type whose code is still loading is skipped instead of suspending the\n * caller (`getElementType(…, { suspend: false })`, as walks deeper than the direct children do).\n */\nexport function collectItems(children: React.ReactNode, types: TreeElementTypes): TreeNode[] {\n const nodes: TreeNode[] = [];\n for (const node of React.Children.toArray(children)) {\n if (!React.isValidElement<ItemElementProps>(node)) continue;\n const type = getElementType(node, { suspend: false });\n if (type === React.Fragment) {\n // Flattened here rather than through `flattenChildren`, which resolves lazy types with\n // suspending: a Fragment's items belong to the enclosing group.\n nodes.push(...collectItems(node.props.children, types));\n continue;\n }\n if (type === types.tree || type !== types.item) continue;\n const { value, leaf, children: nested } = node.props;\n if (typeof value !== 'string') continue;\n nodes.push({ value, children: leaf === true ? [] : collectItems(nested, types) });\n }\n return nodes;\n}\n\nfunction forEachNode(nodes: readonly TreeNode[], visit: (node: TreeNode) => void): void {\n for (const node of nodes) {\n visit(node);\n forEachNode(node.children, visit);\n }\n}\n\n/** The first item with `value` in tree order and its ancestors, from the top down; `null` if none. */\nfunction findPath(nodes: readonly TreeNode[], value: string): TreeNode[] | null {\n for (const node of nodes) {\n if (node.value === value) return [node];\n const below = findPath(node.children, value);\n if (below) return [node, ...below];\n }\n return null;\n}\n\n/**\n * The check state of every item: checked when its value is listed, when an ancestor's value is\n * listed (or `ancestorListed`), or when it has nested items and all of them are checked; mixed\n * when some of them are checked or mixed; else unchecked. For a value that several items share,\n * the first item in tree order decides the entry.\n */\nexport function computeCheckStates(\n nodes: readonly TreeNode[],\n listed: ReadonlySet<string>,\n ancestorListed = false,\n): Map<string, CheckState> {\n const first = new Map<string, TreeNode>();\n forEachNode(nodes, (candidate) => {\n if (!first.has(candidate.value)) first.set(candidate.value, candidate);\n });\n const states = new Map<string, CheckState>();\n const visit = (current: TreeNode, forcedAbove: boolean): CheckState => {\n const forced = forcedAbove || listed.has(current.value);\n const childStates = current.children.map((child) => visit(child, forced));\n let state: CheckState;\n if (forced) state = 'checked';\n else if (childStates.length === 0) state = 'unchecked';\n else if (childStates.every((childState) => childState === 'checked')) state = 'checked';\n else if (childStates.some((childState) => childState !== 'unchecked')) state = 'mixed';\n else state = 'unchecked';\n if (first.get(current.value) === current) states.set(current.value, state);\n return state;\n };\n for (const top of nodes) visit(top, ancestorListed);\n return states;\n}\n\n/**\n * The checked items after toggling `value`. A checked item and every item nested in it become\n * unchecked; an unchecked or mixed one and every item nested in it become checked; its ancestors\n * then follow their nested items. Returns every checked item in tree order (fully checked parents\n * included, mixed ones not), each value once, followed by the listed values that match no item,\n * in their order; a value that no item has is added to, or removed from, those.\n */\nexport function toggleCheck(\n nodes: readonly TreeNode[],\n listed: readonly string[],\n value: string,\n): string[] {\n const states = computeCheckStates(nodes, new Set(listed));\n const checked = new Set<string>();\n for (const [itemValue, state] of states) {\n if (state === 'checked') checked.add(itemValue);\n }\n const known = new Set<string>();\n forEachNode(nodes, (candidate) => known.add(candidate.value));\n const unmatched = Array.from(new Set(listed.filter((listedValue) => !known.has(listedValue))));\n\n const path = findPath(nodes, value);\n if (path) {\n const target = path[path.length - 1];\n const turnOn = states.get(value) !== 'checked';\n forEachNode([target], (candidate) => {\n if (turnOn) checked.add(candidate.value);\n else checked.delete(candidate.value);\n });\n for (let index = path.length - 2; index >= 0; index -= 1) {\n const ancestor = path[index];\n if (ancestor.children.every((child) => checked.has(child.value))) checked.add(ancestor.value);\n else checked.delete(ancestor.value);\n }\n } else {\n const at = unmatched.indexOf(value);\n if (at === -1) unmatched.push(value);\n else unmatched.splice(at, 1);\n }\n\n const ordered: string[] = [];\n const seen = new Set<string>();\n forEachNode(nodes, (candidate) => {\n if (checked.has(candidate.value) && !seen.has(candidate.value)) {\n seen.add(candidate.value);\n ordered.push(candidate.value);\n }\n });\n return [...ordered, ...unmatched];\n}\n"],"mappings":";;;;AAgCA,SAAgBC,EAAa,GAA2B,GAAqC;CAC3F,IAAMC,IAAoB,CAAC;CAC3B,KAAK,IAAMC,KAAQH,EAAM,SAAS,QAAQI,CAAQ,GAAG;EACnD,IAAI,CAACJ,EAAM,eAAiCG,CAAI,GAAG;EACnD,IAAME,IAAOC,EAAeH,GAAM,EAAE,SAAS,GAAM,CAAC;EACpD,IAAIE,MAASL,EAAM,UAAU;GAG3B,EAAM,KAAK,GAAGC,EAAaE,EAAK,MAAM,UAAUI,CAAK,CAAC;GACtD;EACF;EACA,IAAIF,MAASE,EAAM,QAAQF,MAASE,EAAM,MAAM;EAChD,IAAM,EAAE,UAAO,SAAM,UAAUC,MAAWL,EAAK;EAC/C,AAAI,OAAOM,KAAU,YACrBP,EAAM,KAAK;GAAE;GAAO,UAAUQ,MAAS,KAAO,CAAC,IAAIT,EAAaO,GAAQD,CAAK;EAAE,CAAC;CAClF;CACA,OAAOL;AACT;AAEA,SAASS,EAAY,GAA4B,GAAuC;CACtF,KAAK,IAAMR,KAAQD,GAEjB,AADAU,EAAMT,CAAI,GACVQ,EAAYR,EAAK,UAAUS,CAAK;AAEpC;AAGA,SAASC,EAAS,GAA4B,GAAkC;CAC9E,KAAK,IAAMV,KAAQD,GAAO;EACxB,IAAIC,EAAK,UAAUM,GAAO,OAAO,CAACN,CAAI;EACtC,IAAMW,IAAQD,EAASV,EAAK,UAAUM,CAAK;EAC3C,IAAIK,GAAO,OAAO,CAACX,GAAM,GAAGW,CAAK;CACnC;CACA,OAAO;AACT;AAQA,SAAgBC,EACd,GACA,GACA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C2B,CAAM,IAAI,MAAc;GACnC,AAAIC,IAAQP,EAAQ,IAAIb,EAAU,KAAK,IAClCa,EAAQ,OAAOb,EAAU,KAAK;EACrC,CAAC;EACD,KAAK,IAAIqB,IAAQH,EAAK,SAAS,GAAGG,KAAS,GAAG,KAAY;GACxD,IAAMC,IAAWJ,EAAKG;GACtB,AAAIC,EAAS,SAAS,OAAO,MAAUT,EAAQ,IAAIN,EAAM,KAAK,CAAC,IAAGM,EAAQ,IAAIS,EAAS,KAAK,IACvFT,EAAQ,OAAOS,EAAS,KAAK;EACpC;CACF,OAAO;EACL,IAAMC,IAAKP,EAAU,QAAQxB,CAAK;EAClC,AAAI+B,MAAO,KAAIP,EAAU,KAAKxB,CAAK,IAC9BwB,EAAU,OAAOO,GAAI,CAAC;CAC7B;CAEA,IAAMC,IAAoB,CAAC,GACrBC,oBAAO,IAAI,IAAY;CAO7B,OANA/B,EAAYT,IAAQ,MAAc;EAChC,AAAI4B,EAAQ,IAAIb,EAAU,KAAK,KAAK,CAACyB,EAAK,IAAIzB,EAAU,KAAK,MAC3DyB,EAAK,IAAIzB,EAAU,KAAK,GACxBwB,EAAQ,KAAKxB,EAAU,KAAK;CAEhC,CAAC,GACM,CAAC,GAAGwB,GAAS,GAAGR,CAAS;AAClC"}
@@ -0,0 +1,2 @@
1
+ "use client";function e(e){return e.replace(/[^A-Za-z0-9-]/g,e=>`_${e.charCodeAt(0).toString(16)}_`)}function t(t,n,r){return`${t}-${n}-${e(r)}`}exports.encodeIdPart=e,exports.getPartId=t;
2
+ //# sourceMappingURL=disclosureIds.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disclosureIds.cjs","names":["encodeIdPart","value","char","getPartId","baseId","part"],"sources":["../../../src/components/layout/disclosureIds.ts"],"sourcesContent":["/*\n * Internal id helpers shared by Accordion and TabList (P09, C-IDS). Not exported from the package.\n */\n\n/**\n * Encodes a value for use inside a DOM id without collisions: every character outside\n * `[A-Za-z0-9-]` (including `_`) becomes `_<hex code>_`, so `'a b'`, `'a.b'` and `'a_b'` stay\n * distinct.\n */\nexport function encodeIdPart(value: string): string {\n return value.replace(/[^A-Za-z0-9-]/g, (char) => `_${char.charCodeAt(0).toString(16)}_`);\n}\n\n/**\n * The one id helper (C-IDS): `${baseId}-${part}-${encoded value}`. `baseId` comes from `useId`\n * (one per Accordion or TabList), `part` names the element (`'trigger'`, `'panel'`, `'tab'`) and\n * `value` is the item or tab value.\n */\nexport function getPartId(baseId: string, part: string, value: string): string {\n return `${baseId}-${part}-${encodeIdPart(value)}`;\n}\n"],"mappings":"aASA,SAAgBA,EAAa,EAAuB,CAClD,OAAOC,EAAM,QAAQ,iBAAmB,GAAS,IAAIC,EAAK,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,CACzF,CAOA,SAAgBC,EAAU,EAAgB,EAAc,EAAuB,CAC7E,MAAO,GAAGC,EAAO,GAAGC,EAAK,GAAGL,EAAaC,CAAK,GAChD"}
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ //#region src/components/layout/disclosureIds.ts
3
+ function e(e) {
4
+ return e.replace(/[^A-Za-z0-9-]/g, (e) => `_${e.charCodeAt(0).toString(16)}_`);
5
+ }
6
+ function t(t, n, r) {
7
+ return `${t}-${n}-${e(r)}`;
8
+ }
9
+ //#endregion
10
+ export { e as encodeIdPart, t as getPartId };
11
+
12
+ //# sourceMappingURL=disclosureIds.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disclosureIds.mjs","names":["encodeIdPart","value","char","getPartId","baseId","part"],"sources":["../../../src/components/layout/disclosureIds.ts"],"sourcesContent":["/*\n * Internal id helpers shared by Accordion and TabList (P09, C-IDS). Not exported from the package.\n */\n\n/**\n * Encodes a value for use inside a DOM id without collisions: every character outside\n * `[A-Za-z0-9-]` (including `_`) becomes `_<hex code>_`, so `'a b'`, `'a.b'` and `'a_b'` stay\n * distinct.\n */\nexport function encodeIdPart(value: string): string {\n return value.replace(/[^A-Za-z0-9-]/g, (char) => `_${char.charCodeAt(0).toString(16)}_`);\n}\n\n/**\n * The one id helper (C-IDS): `${baseId}-${part}-${encoded value}`. `baseId` comes from `useId`\n * (one per Accordion or TabList), `part` names the element (`'trigger'`, `'panel'`, `'tab'`) and\n * `value` is the item or tab value.\n */\nexport function getPartId(baseId: string, part: string, value: string): string {\n return `${baseId}-${part}-${encodeIdPart(value)}`;\n}\n"],"mappings":";;AASA,SAAgBA,EAAa,GAAuB;CAClD,OAAOC,EAAM,QAAQ,mBAAmB,MAAS,IAAIC,EAAK,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE;AACzF;AAOA,SAAgBC,EAAU,GAAgB,GAAc,GAAuB;CAC7E,OAAO,GAAGC,EAAO,GAAGC,EAAK,GAAGL,EAAaC,CAAK;AAChD"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/dev.cjs"),n=require("../../hooks/useMergedRefs.cjs"),r=require("../../hooks/usePresence.cjs");let i=require("react");i=e.__toESM(i,1);function a(e){return i.isValidElement(e)?e.type===i.Fragment?a(e.props.children):e:null}var o=({visible:e,children:o,appear:s,unmountOnExit:c,onEntered:l,onExited:u})=>{let{isMounted:d,phase:f,ref:p,presenceProps:m}=r.usePresence(e,{appear:s,unmountOnExit:c,onEntered:l,onExited:u}),h=typeof o==`function`,g=h?null:a(o),_=n.useMergedRefs(p,g?.props.ref),v=!h&&g===null;return i.useEffect(()=>{v&&t.warnOnce(`Presence:children`,`Presence: expected a single element or a render function as its child; other children are rendered as given, without the presence attributes, and their enter and exit phases end at once.`)},[v]),d?h?o({isMounted:d,phase:f,ref:p,presenceProps:m}):g?i.cloneElement(g,{"data-presence":m[`data-presence`],inert:m.inert??g.props.inert,hidden:m.hidden??g.props.hidden,ref:_}):o:null};o.displayName=`Presence`,exports.Presence=o;
2
+ //# sourceMappingURL=Presence.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presence.cjs","names":["React","usePresence","useMergedRefs","require_runtime","require_dev","require_useMergedRefs","require_usePresence","react","singleElement","children","Presence","visible","isRenderFunction","element","mergedRef","ref","invalidChildren","isMounted","presenceProps"],"sources":["../../../src/components/motion/Presence.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n usePresence,\n type UsePresenceOptions,\n type UsePresenceResult,\n} from '../../hooks/usePresence';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { warnOnce } from '../../lib/dev';\n\n/** Properties for the Presence component. */\nexport interface PresenceProps extends UsePresenceOptions {\n /** Whether the content is shown; changes run the enter and exit phases. */\n visible: boolean;\n /**\n * A single element, which receives the presence attributes and ref (merged with its own ref and\n * props: its own `inert` and `hidden` apply while the presence sets none), or a render function\n * that receives the presence result.\n */\n children: React.ReactElement | ((presence: UsePresenceResult) => React.ReactNode);\n}\n\ntype ChildProps = {\n ref?: React.Ref<HTMLElement>;\n inert?: boolean;\n hidden?: boolean;\n};\n\n/** The single element of `children` (a Fragment around one element is unwrapped), else `null`. */\nfunction singleElement(children: React.ReactNode): React.ReactElement<ChildProps> | null {\n if (!React.isValidElement<ChildProps & { children?: React.ReactNode }>(children)) return null;\n if (children.type !== React.Fragment) return children;\n return singleElement(children.props.children);\n}\n\n/**\n * Shows and hides its child with CSS enter and exit motion: the child stays mounted while its exit\n * motion runs, `inert` and marked `data-presence=\"exiting\"`, and unmounts when it ends (at once\n * under reduced motion or without motion). Style the phases on the child: a transition with the\n * `duration-wave-*` and `ease-wave-*` tokens, its start with the `starting:` variant gated on the\n * entering phase (`data-[presence=entering]:starting:` classes), its exit with\n * `data-[presence=exiting]:` classes, and a `motion-reduce:` counterpart (the `usePresence` JSDoc\n * and the Presence stories show complete class lists). An ungated `starting:` class also animates\n * a child that mounts `entered` (`appear={false}`, hydration): `@starting-style` applies to every\n * first style of an element.\n *\n * - The child is a single element (it must accept a `ref`, as DOM elements and ref-forwarding\n * components do), which receives `data-presence`, `inert` while exiting and the presence ref,\n * merged with its own ref and props; or a render function called with the presence result\n * (`isMounted`, `phase`, `ref`, `presenceProps`) to spread yourself.\n * - `appear` runs the enter phase on mount (never on the server or when hydrating),\n * `unmountOnExit={false}` keeps the exited child mounted, `hidden` and `inert`, and `onEntered`\n * and `onExited` report the end of a phase (see {@link usePresence}).\n * - Renders nothing while the child is not mounted. Other children (text, several elements) are\n * rendered as given, without the presence attributes, and a development warning is logged.\n *\n * @example\n * <Presence visible={open}>\n * <div className={fadeClasses}>Saved</div>\n * </Presence>\n */\nexport const Presence = ({\n visible,\n children,\n appear,\n unmountOnExit,\n onEntered,\n onExited,\n}: PresenceProps): React.ReactNode => {\n const { isMounted, phase, ref, presenceProps } = usePresence(visible, {\n appear,\n unmountOnExit,\n onEntered,\n onExited,\n });\n const isRenderFunction = typeof children === 'function';\n const element = isRenderFunction ? null : singleElement(children);\n const mergedRef = useMergedRefs<HTMLElement>(ref, element?.props.ref);\n const invalidChildren = !isRenderFunction && element === null;\n\n React.useEffect(() => {\n if (!invalidChildren) return;\n warnOnce(\n 'Presence:children',\n 'Presence: expected a single element or a render function as its child; other children are rendered as given, without the presence attributes, and their enter and exit phases end at once.',\n );\n }, [invalidChildren]);\n\n if (!isMounted) return null;\n if (isRenderFunction) return children({ isMounted, phase, ref, presenceProps });\n if (!element) return children as React.ReactNode;\n // Merged by hand (no mergeProps: the presence core stays free of the class merger).\n return React.cloneElement(element, {\n 'data-presence': presenceProps['data-presence'],\n inert: presenceProps.inert ?? element.props.inert,\n hidden: presenceProps.hidden ?? element.props.hidden,\n ref: mergedRef,\n } as ChildProps);\n};\nPresence.displayName = 'Presence';\n"],"mappings":"gOA4BA,SAASQ,EAAc,EAAkE,CAGvF,OAFKR,EAAM,eAA4DS,CAAQ,EAC3EA,EAAS,OAAST,EAAM,SACrBQ,EAAcC,EAAS,MAAM,QAAQ,EADCA,EAD4C,IAG3F,CA4BA,IAAaC,GAAY,CACvB,UACA,WACA,SACA,gBACA,YACA,cACoC,CACpC,GAAM,CAAE,YAAW,QAAO,MAAK,iBAAkBT,EAAAA,YAAYU,EAAS,CACpE,SACA,gBACA,YACA,UACF,CAAC,EACKC,EAAmB,OAAOH,GAAa,WACvCI,EAAUD,EAAmB,KAAOJ,EAAcC,CAAQ,EAC1DK,EAAYZ,EAAAA,cAA2Ba,EAAKF,GAAS,MAAM,GAAG,EAC9DG,EAAkB,CAACJ,GAAoBC,IAAY,KAczD,OAZAN,EAAM,cAAgB,CACfS,GACLZ,EAAA,SACE,oBACA,4LACF,CACF,EAAG,CAACY,CAAe,CAAC,EAEfC,EACDL,EAAyBH,EAAS,CAAE,YAAW,QAAO,MAAK,eAAc,CAAC,EACzEI,EAEEb,EAAM,aAAaa,EAAS,CACjC,gBAAiBK,EAAc,iBAC/B,MAAOA,EAAc,OAASL,EAAQ,MAAM,MAC5C,OAAQK,EAAc,QAAUL,EAAQ,MAAM,OAC9C,IAAKC,CACP,CAAe,EAPML,EAFE,IAUzB,EACA,EAAS,YAAc"}
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { warnOnce as e } from "../../lib/dev.mjs";
3
+ import { useMergedRefs as t } from "../../hooks/useMergedRefs.mjs";
4
+ import { usePresence as n } from "../../hooks/usePresence.mjs";
5
+ import * as r from "react";
6
+ //#region src/components/motion/Presence.tsx
7
+ function i(e) {
8
+ return r.isValidElement(e) ? e.type === r.Fragment ? i(e.props.children) : e : null;
9
+ }
10
+ var a = ({ visible: a, children: o, appear: s, unmountOnExit: c, onEntered: l, onExited: u }) => {
11
+ let { isMounted: d, phase: f, ref: p, presenceProps: m } = n(a, {
12
+ appear: s,
13
+ unmountOnExit: c,
14
+ onEntered: l,
15
+ onExited: u
16
+ }), h = typeof o == "function", g = h ? null : i(o), _ = t(p, g?.props.ref), v = !h && g === null;
17
+ return r.useEffect(() => {
18
+ v && e("Presence:children", "Presence: expected a single element or a render function as its child; other children are rendered as given, without the presence attributes, and their enter and exit phases end at once.");
19
+ }, [v]), d ? h ? o({
20
+ isMounted: d,
21
+ phase: f,
22
+ ref: p,
23
+ presenceProps: m
24
+ }) : g ? r.cloneElement(g, {
25
+ "data-presence": m["data-presence"],
26
+ inert: m.inert ?? g.props.inert,
27
+ hidden: m.hidden ?? g.props.hidden,
28
+ ref: _
29
+ }) : o : null;
30
+ };
31
+ a.displayName = "Presence";
32
+ //#endregion
33
+ export { a as Presence };
34
+
35
+ //# sourceMappingURL=Presence.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presence.mjs","names":["React","singleElement","children","Presence","usePresence","visible","isRenderFunction","element","mergedRef","useMergedRefs","ref","invalidChildren","warnOnce","isMounted","presenceProps"],"sources":["../../../src/components/motion/Presence.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n usePresence,\n type UsePresenceOptions,\n type UsePresenceResult,\n} from '../../hooks/usePresence';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { warnOnce } from '../../lib/dev';\n\n/** Properties for the Presence component. */\nexport interface PresenceProps extends UsePresenceOptions {\n /** Whether the content is shown; changes run the enter and exit phases. */\n visible: boolean;\n /**\n * A single element, which receives the presence attributes and ref (merged with its own ref and\n * props: its own `inert` and `hidden` apply while the presence sets none), or a render function\n * that receives the presence result.\n */\n children: React.ReactElement | ((presence: UsePresenceResult) => React.ReactNode);\n}\n\ntype ChildProps = {\n ref?: React.Ref<HTMLElement>;\n inert?: boolean;\n hidden?: boolean;\n};\n\n/** The single element of `children` (a Fragment around one element is unwrapped), else `null`. */\nfunction singleElement(children: React.ReactNode): React.ReactElement<ChildProps> | null {\n if (!React.isValidElement<ChildProps & { children?: React.ReactNode }>(children)) return null;\n if (children.type !== React.Fragment) return children;\n return singleElement(children.props.children);\n}\n\n/**\n * Shows and hides its child with CSS enter and exit motion: the child stays mounted while its exit\n * motion runs, `inert` and marked `data-presence=\"exiting\"`, and unmounts when it ends (at once\n * under reduced motion or without motion). Style the phases on the child: a transition with the\n * `duration-wave-*` and `ease-wave-*` tokens, its start with the `starting:` variant gated on the\n * entering phase (`data-[presence=entering]:starting:` classes), its exit with\n * `data-[presence=exiting]:` classes, and a `motion-reduce:` counterpart (the `usePresence` JSDoc\n * and the Presence stories show complete class lists). An ungated `starting:` class also animates\n * a child that mounts `entered` (`appear={false}`, hydration): `@starting-style` applies to every\n * first style of an element.\n *\n * - The child is a single element (it must accept a `ref`, as DOM elements and ref-forwarding\n * components do), which receives `data-presence`, `inert` while exiting and the presence ref,\n * merged with its own ref and props; or a render function called with the presence result\n * (`isMounted`, `phase`, `ref`, `presenceProps`) to spread yourself.\n * - `appear` runs the enter phase on mount (never on the server or when hydrating),\n * `unmountOnExit={false}` keeps the exited child mounted, `hidden` and `inert`, and `onEntered`\n * and `onExited` report the end of a phase (see {@link usePresence}).\n * - Renders nothing while the child is not mounted. Other children (text, several elements) are\n * rendered as given, without the presence attributes, and a development warning is logged.\n *\n * @example\n * <Presence visible={open}>\n * <div className={fadeClasses}>Saved</div>\n * </Presence>\n */\nexport const Presence = ({\n visible,\n children,\n appear,\n unmountOnExit,\n onEntered,\n onExited,\n}: PresenceProps): React.ReactNode => {\n const { isMounted, phase, ref, presenceProps } = usePresence(visible, {\n appear,\n unmountOnExit,\n onEntered,\n onExited,\n });\n const isRenderFunction = typeof children === 'function';\n const element = isRenderFunction ? null : singleElement(children);\n const mergedRef = useMergedRefs<HTMLElement>(ref, element?.props.ref);\n const invalidChildren = !isRenderFunction && element === null;\n\n React.useEffect(() => {\n if (!invalidChildren) return;\n warnOnce(\n 'Presence:children',\n 'Presence: expected a single element or a render function as its child; other children are rendered as given, without the presence attributes, and their enter and exit phases end at once.',\n );\n }, [invalidChildren]);\n\n if (!isMounted) return null;\n if (isRenderFunction) return children({ isMounted, phase, ref, presenceProps });\n if (!element) return children as React.ReactNode;\n // Merged by hand (no mergeProps: the presence core stays free of the class merger).\n return React.cloneElement(element, {\n 'data-presence': presenceProps['data-presence'],\n inert: presenceProps.inert ?? element.props.inert,\n hidden: presenceProps.hidden ?? element.props.hidden,\n ref: mergedRef,\n } as ChildProps);\n};\nPresence.displayName = 'Presence';\n"],"mappings":";;;;;;AA4BA,SAASC,EAAc,GAAkE;CAGvF,OAFKD,EAAM,eAA4DE,CAAQ,IAC3EA,EAAS,SAASF,EAAM,WACrBC,EAAcC,EAAS,MAAM,QAAQ,IADCA,IAD4C;AAG3F;AA4BA,IAAaC,KAAY,EACvB,YACA,aACA,WACA,kBACA,cACA,kBACoC;CACpC,IAAM,EAAE,cAAW,UAAO,QAAK,qBAAkBC,EAAYC,GAAS;EACpE;EACA;EACA;EACA;CACF,CAAC,GACKC,IAAmB,OAAOJ,KAAa,YACvCK,IAAUD,IAAmB,OAAOL,EAAcC,CAAQ,GAC1DM,IAAYC,EAA2BC,GAAKH,GAAS,MAAM,GAAG,GAC9DI,IAAkB,CAACL,KAAoBC,MAAY;CAczD,OAZAP,EAAM,gBAAgB;EACpB,AAAKW,KACLC,EACE,qBACA,4LACF;CACF,GAAG,CAACD,CAAe,CAAC,GAEfE,IACDP,IAAyBJ,EAAS;EAAE;EAAW;EAAO;EAAK;CAAc,CAAC,IACzEK,IAEEP,EAAM,aAAaO,GAAS;EACjC,iBAAiBO,EAAc;EAC/B,OAAOA,EAAc,SAASP,EAAQ,MAAM;EAC5C,QAAQO,EAAc,UAAUP,EAAQ,MAAM;EAC9C,KAAKC;CACP,CAAe,IAPMN,IAFE;AAUzB;AACA,EAAS,cAAc"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/children.cjs"),r=require("../../lib/dev.cjs"),i=require("../../lib/slot.cjs"),a=require("../../lib/classNames.cjs"),o=require("../../lib/aria.cjs"),s=require("../../lib/styles.cjs"),c=require("../../lib/icons.cjs"),l=require("../../hooks/useTriggerElement.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("react/jsx-runtime");var f=t.cn(`inline-flex cursor-pointer items-center text-primary no-underline not-disabled:not-aria-disabled:hover:underline`,s.focusRing,s.disabledStyles),p=`inline-flex items-center font-semibold text-foreground`,m=t.cn(p,s.focusRing,s.disabledStyles),h=`inline-flex items-center text-foreground`,g=new Set([`rel`,...Object.keys({disabled:!0,type:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,name:!0,value:!0,target:!0,download:!0,hrefLang:!0,ping:!0,media:!0,referrerPolicy:!0})]);function _(e){let t={};for(let n of Object.keys(e))g.has(n)||(t[n]=e[n]);return t}var v=({children:e,className:r,ref:i,...o})=>{let s=n.flattenChildren(e);return(0,d.jsx)(`nav`,{ref:i,"aria-label":`Breadcrumb`,...o,className:t.cn(a.breadcrumbClassNames.root,r),children:(0,d.jsx)(`ol`,{className:t.cn(a.breadcrumbClassNames.list,`m-0 flex list-none items-center gap-1 p-0 text-body-1`),children:s.map(({key:e,node:n},r)=>(0,d.jsxs)(`li`,{className:t.cn(a.breadcrumbClassNames.listItem,`flex items-center gap-1`),children:[r>0&&(0,d.jsx)(c.ChevronRightIcon,{"data-wave-breadcrumb-separator":``,className:t.cn(a.breadcrumbClassNames.divider,`shrink-0 text-muted-foreground wave-rtl:-scale-x-100`)}),n]},e))})})};v.displayName=`Breadcrumb`;function y(e){let t=n.isElementOfType(e,`a`)?{href:void 0,role:`link`,disabled:void 0}:void 0;return u.cloneElement(e,{...t,"aria-disabled":!0,tabIndex:-1,onClick:void 0})}function b({child:e,icon:t,...n}){let r=t?u.cloneElement(e,void 0,t,e.props.children):e,i=l.useTriggerElement(r,n,{componentName:`Breadcrumb.Item`});return(0,d.jsx)(d.Fragment,{children:i})}function x(e){let{href:n,current:s=!1,icon:c,asChild:l=!1,children:g,className:v,onClick:x,ref:S,...C}=e,w=c&&i.slotRendersContent(c)?i.renderSlot(c,`span`,t.cn(a.breadcrumbItemClassNames.icon,`me-1 inline-flex shrink-0`),{"aria-hidden":!0}):null,T=l&&u.isValidElement(g)?g:null,E=T?`child`:s?`current`:n===void 0?x?`button`:`text`:`link`,D=l&&T===null,O=C.disabled===!0&&(E===`text`||E===`current`),k=C[`aria-disabled`],A=T?.props??{},j=[C.disabled,k,A.disabled,A[`aria-disabled`]].some(e=>e===!0||e===`true`);if(u.useEffect(()=>{D&&r.warnOnce(`Breadcrumb.Item:asChild`,"Breadcrumb.Item: `asChild` expects a single element child (e.g. a router link); the item was rendered normally instead."),E===`text`&&r.warnOnce(`Breadcrumb.Item:no-href`,"Breadcrumb.Item: a non-current item without `href` or `onClick` renders as plain text, not a link. Pass `href` (or `onClick`, which renders a button) to make it navigable."),O&&r.warnOnce(`Breadcrumb.Item:disabled`,"Breadcrumb.Item: `disabled` applies to link, button and asChild items; it is ignored on a text or current item.")},[D,E,O]),T){let{disabled:e,...r}=C,i=n!==void 0&&!j?{href:n}:void 0;return(0,d.jsx)(b,{...r,...i,ref:S,onClick:o.preventIfDisabled(j,x),"aria-current":s?`page`:void 0,className:t.cn(a.breadcrumbItemClassNames.root,s?m:f,v),icon:w,child:j?y(T):T})}if(E===`current`)return(0,d.jsxs)(`span`,{..._(C),ref:S,"aria-current":`page`,onClick:x,className:t.cn(a.breadcrumbItemClassNames.root,p,v),children:[w,g]});if(E===`link`){let{disabled:e,...r}=C;return(0,d.jsxs)(`a`,{...r,ref:S,href:j?void 0:n,role:j?`link`:r.role,"aria-disabled":j?!0:k,tabIndex:j?-1:r.tabIndex,onClick:o.preventIfDisabled(j,x),className:t.cn(a.breadcrumbItemClassNames.root,f,v),children:[w,g]})}if(E===`button`){let{rel:e,...n}=C;return(0,d.jsxs)(`button`,{type:`button`,...n,ref:S,onClick:x,className:t.cn(a.breadcrumbItemClassNames.root,f,v),children:[w,g]})}return(0,d.jsxs)(`span`,{..._(C),ref:S,className:t.cn(a.breadcrumbItemClassNames.root,h,v),children:[w,g]})}x.displayName=`BreadcrumbItem`;var S=Object.assign(v,{Item:x});exports.Breadcrumb=S,exports.BreadcrumbItem=x;
2
+ //# sourceMappingURL=Breadcrumb.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Breadcrumb.cjs","names":["cn","focusRing","disabledStyles","flattenChildren","breadcrumbClassNames","ChevronRightIcon","isElementOfType","React","useTriggerElement","_Fragment","slotRendersContent","renderSlot","breadcrumbItemClassNames","preventIfDisabled","require_runtime","require_cn","require_children","require_dev","require_slot","require_classNames","require_aria","require_styles","require_icons","require_useTriggerElement","react","react_jsx_runtime","linkClasses","currentClasses","currentChildClasses","textClasses","controlOnlyAttributes","spanAttributes","attributes","key","rest","BreadcrumbRoot","items","children","className","child","index","disableLinkChild","anchor","BreadcrumbItemChild","itemProps","target","icon","node","BreadcrumbItem","props","renderedIcon","asChild","kind","current","href","onClick","invalidAsChild","ignoredDisabled","ariaDisabled","childProps","linkDisabled","value","_disabled","childRest","childHref","anchorRest","buttonRest","Breadcrumb"],"sources":["../../../src/components/navigation/Breadcrumb.tsx"],"sourcesContent":["import * as React from 'react';\nimport { preventIfDisabled } from '../../lib/aria';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { breadcrumbClassNames, breadcrumbItemClassNames } from '../../lib/classNames';\nimport type { Slot } from '../../lib/types';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { warnOnce } from '../../lib/dev';\nimport { ChevronRightIcon } from '../../lib/icons';\nimport { disabledStyles, focusRing } from '../../lib/styles';\nimport { useTriggerElement } from '../../hooks/useTriggerElement';\n\n/** Properties for the Breadcrumb component. */\nexport interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * Breadcrumb items to render; each one is placed in its own list item. Fragments are opened, so\n * the items of a conditional group (`{isAdmin && <>…</>}`) each get their own list item too.\n */\n children: React.ReactNode;\n /** Ref to the `<nav>` element. */\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * The props of Breadcrumb.Item that every branch shares ({@link BreadcrumbItemAnchorProps},\n * {@link BreadcrumbItemButtonProps}, {@link BreadcrumbItemDynamicProps}).\n */\nexport interface BreadcrumbItemOwnProps {\n /**\n * Whether this item represents the current page (`aria-current=\"page\"`, rendered as text).\n * @default false\n */\n current?: boolean;\n /**\n * Slot for an icon displayed before the item text. Rendered with `aria-hidden=\"true\"`. A falsy\n * icon (`''`, `0`) or a list of nothing renders no icon span.\n */\n icon?: Slot<'span'>;\n /**\n * Merge the item's props (classes, `aria-current`, handlers, ref) onto its single child element\n * instead of rendering an element — for router links:\n * `<Breadcrumb.Item asChild><RouterLink to=\"/docs\">Docs</RouterLink></Breadcrumb.Item>`.\n * The icon is rendered inside the child. The item's `href` is passed on as a default (the\n * element's own `href` wins); with a router link, give the link its destination (`to`) instead.\n * `disabled` or `aria-disabled=\"true\"`, on the item or on the element, makes it an unavailable\n * link: `aria-disabled`, out of the tab order, its own `onClick` dropped and the click cancelled\n * (a router link does not navigate); an `<a>` also loses its `href`.\n * @default false\n */\n asChild?: boolean;\n /** Label content of the breadcrumb item (with `asChild`: the link element). */\n children: React.ReactNode;\n}\n\n/**\n * The attributes only a link has (`target`, `download`, `hrefLang`, `ping`, …). Items without\n * `href` declare them as `undefined`, so they are a type error instead of landing on a `<button>`\n * or `<span>`. `rel` cannot be listed (React types it on every element, RDFa); every non-link item\n * drops it at run time instead.\n */\ntype NoAnchorOnlyAttributes = {\n [\n K in Exclude<\n keyof React.AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof React.ButtonHTMLAttributes<HTMLButtonElement>\n >\n ]?: undefined;\n};\n\n/** Breadcrumb.Item rendered as a link (`href` given): anchor attributes. */\nexport interface BreadcrumbItemAnchorProps\n extends\n BreadcrumbItemOwnProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof BreadcrumbItemOwnProps> {\n /**\n * URL the breadcrumb item links to; renders an `<a>` (unless `current`). With `asChild` it is a\n * default for the element, whose own `href` wins. Required in this branch, so `href`\n * discriminates the union and handlers without `href` are typed as button handlers.\n */\n href: string;\n /**\n * Makes the link unavailable, as Link's `disabled` does: no `href`, `role=\"link\"`,\n * `aria-disabled=\"true\"`, out of the tab order, and the click is cancelled (`onClick` is not\n * called). `aria-disabled=\"true\"` does the same.\n * @default false\n */\n disabled?: boolean;\n /** Ref to the rendered element (`<a>`, or `<span>` for the current item). */\n ref?: React.Ref<HTMLAnchorElement | HTMLSpanElement>;\n}\n\n/**\n * Breadcrumb.Item without `href`: a `<button type=\"button\">` when `onClick` is given (button\n * attributes; `disabled` gives it the disabled look), plain text otherwise. A `rel` is not\n * rendered on either.\n */\nexport interface BreadcrumbItemButtonProps\n extends\n BreadcrumbItemOwnProps,\n NoAnchorOnlyAttributes,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof BreadcrumbItemOwnProps> {\n /** Items without a link have no `href`. */\n href?: undefined;\n /** Ref to the rendered element (`<button>`, or `<span>` for text and the current item). */\n ref?: React.Ref<HTMLButtonElement | HTMLSpanElement>;\n}\n\n/**\n * Properties for the BreadcrumbItem sub-component: link props with `href`, button props without.\n *\n * A union type (0.4 had an interface): an interface cannot extend it, so extend one branch\n * (`interface X extends BreadcrumbItemAnchorProps`) or intersect\n * (`type X = BreadcrumbItemProps & { … }`). `React.ComponentProps<typeof Breadcrumb.Item>`\n * resolves to the last overload, {@link BreadcrumbItemDynamicProps}.\n */\nexport type BreadcrumbItemProps = BreadcrumbItemAnchorProps | BreadcrumbItemButtonProps;\n\n/**\n * Breadcrumb.Item with an `href` known only at run time (`string | undefined`): a link when it is\n * a string, otherwise a button (with `onClick`) or text. Handlers receive `HTMLElement` events and\n * only the attributes all kinds share are accepted (the 0.4 prop shape). Resolved after the button\n * and link signatures.\n */\nexport interface BreadcrumbItemDynamicProps\n extends\n BreadcrumbItemOwnProps,\n Omit<React.HTMLAttributes<HTMLElement>, keyof BreadcrumbItemOwnProps> {\n /** URL the breadcrumb item links to when defined. */\n href?: string;\n /**\n * Makes a link or button item unavailable (see {@link BreadcrumbItemAnchorProps} and\n * {@link BreadcrumbItemButtonProps}); ignored, with a development warning, on a text or current\n * item.\n * @default false\n */\n disabled?: boolean;\n /** Ref to the rendered element. */\n ref?: React.Ref<HTMLElement>;\n}\n\n/** The props every item kind shares at runtime (the union narrowed by `href`). */\ntype BreadcrumbEntryProps = BreadcrumbItemOwnProps &\n Omit<React.AllHTMLAttributes<HTMLElement>, keyof BreadcrumbItemOwnProps | 'ref'> & {\n ref?: React.Ref<HTMLElement>;\n };\n\n/**\n * Links, buttons and `asChild` elements. The hover underline is gated (C-TOKENS), and the\n * disabled look covers a `disabled` button and an `aria-disabled` link.\n */\nconst linkClasses = cn(\n 'inline-flex cursor-pointer items-center text-primary no-underline not-disabled:not-aria-disabled:hover:underline',\n focusRing,\n disabledStyles,\n);\nconst currentClasses = 'inline-flex items-center font-semibold text-foreground';\n/** A current `asChild` element is the consumer's link: it takes focus and can be disabled. */\nconst currentChildClasses = cn(currentClasses, focusRing, disabledStyles);\nconst textClasses = 'inline-flex items-center text-foreground';\n\n/**\n * The attributes only a `<button>` or an `<a>` has (`disabled`, `type`, `form*`, `name`, `value`;\n * `target`, `download`, `hrefLang`, `ping`, `media`, `referrerPolicy`). The button props allow\n * `disabled` without `onClick`, and a current item keeps its link attributes, so the `<span>` of\n * the text and current items drops them instead of rendering invalid markup\n * (`<span disabled>`, `<span target=\"_blank\">`). Typed as a record so a key React adds to either\n * element's attributes is a compile error until it is listed here. `rel` is dropped as well: React\n * types it on every element (RDFa), but on a breadcrumb it comes with a link.\n */\ntype ControlOnlyAttribute =\n | Exclude<\n keyof React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof React.HTMLAttributes<HTMLElement>\n >\n | Exclude<\n keyof React.AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof React.HTMLAttributes<HTMLElement> | 'href'\n >;\n\nconst controlOnlyAttributes: ReadonlySet<string> = /* @__PURE__ */ new Set([\n 'rel',\n ...Object.keys({\n disabled: true,\n type: true,\n form: true,\n formAction: true,\n formEncType: true,\n formMethod: true,\n formNoValidate: true,\n formTarget: true,\n name: true,\n value: true,\n target: true,\n download: true,\n hrefLang: true,\n ping: true,\n media: true,\n referrerPolicy: true,\n } satisfies Record<ControlOnlyAttribute, true>),\n]);\n\n/** The props that are valid on the `<span>` of a text or current item. */\nfunction spanAttributes(rest: Record<string, unknown>): React.HTMLAttributes<HTMLSpanElement> {\n const attributes: Record<string, unknown> = {};\n for (const key of Object.keys(rest)) {\n if (!controlOnlyAttributes.has(key)) attributes[key] = rest[key];\n }\n return attributes as React.HTMLAttributes<HTMLSpanElement>;\n}\n\nconst BreadcrumbRoot = ({ children, className, ref, ...rest }: BreadcrumbProps) => {\n // Fragments are opened (`{isAdmin && <>…</>}`), so every crumb gets its own list item and separator.\n const items = flattenChildren(children);\n\n return (\n <nav\n ref={ref}\n aria-label=\"Breadcrumb\"\n {...rest}\n className={cn(breadcrumbClassNames.root, className)}\n >\n <ol\n className={cn(\n breadcrumbClassNames.list,\n 'm-0 flex list-none items-center gap-1 p-0 text-body-1',\n )}\n >\n {items.map(({ key, node: child }, index) => (\n <li key={key} className={cn(breadcrumbClassNames.listItem, 'flex items-center gap-1')}>\n {index > 0 && (\n <ChevronRightIcon\n data-wave-breadcrumb-separator=\"\"\n className={cn(\n breadcrumbClassNames.divider,\n 'shrink-0 text-muted-foreground wave-rtl:-scale-x-100',\n )}\n />\n )}\n {child}\n </li>\n ))}\n </ol>\n </nav>\n );\n};\nBreadcrumbRoot.displayName = 'Breadcrumb';\n\ninterface BreadcrumbItemChildProps extends React.HTMLAttributes<HTMLElement> {\n /** The item's `href`, a default for the element (the element's own `href` wins). */\n href?: string;\n child: React.ReactElement<{ children?: React.ReactNode }>;\n icon: React.ReactNode;\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * Link's disabled contract for an `asChild` element: an `<a>` drops its `href` (it is still\n * announced as a link); any element gets `aria-disabled`, leaves the tab order and loses its own\n * `onClick`. The item's click handler cancels the click, so a router link does not navigate.\n */\nfunction disableLinkChild(\n child: React.ReactElement<{ children?: React.ReactNode }>,\n): React.ReactElement<{ children?: React.ReactNode }> {\n const anchor = isElementOfType(child, 'a')\n ? { href: undefined, role: 'link', disabled: undefined }\n : undefined;\n return React.cloneElement(child as React.ReactElement<Record<string, unknown>>, {\n ...anchor,\n 'aria-disabled': true,\n tabIndex: -1,\n onClick: undefined,\n }) as React.ReactElement<{ children?: React.ReactNode }>;\n}\n\n/**\n * `asChild` rendering: the item's props are merged onto the consumer's element with\n * `useTriggerElement` (the element's own handlers run first and its classes win conflicts; its\n * ref and the item's ref are both attached). The icon is placed inside the element.\n */\nfunction BreadcrumbItemChild({ child, icon, ...itemProps }: BreadcrumbItemChildProps) {\n const target = icon ? React.cloneElement(child, undefined, icon, child.props.children) : child;\n const node = useTriggerElement(target, itemProps, { componentName: 'Breadcrumb.Item' });\n return <>{node}</>;\n}\n\n/**\n * One step of a breadcrumb trail:\n * - `href` → a link (`<a>`, anchor attributes);\n * - `current` → the current page as text (`<span aria-current=\"page\">`);\n * - no `href` with `onClick` → a `<button type=\"button\">` styled as a link;\n * - no `href` and no `onClick` → plain text (`<span>`; development warning for a non-current item);\n * - `asChild` → the props are merged onto the single child element (router links).\n *\n * Typed by overloads, resolved in order: without `href` (button props, button events), with a\n * string `href` (anchor props, anchor events), then an `href` that may be `undefined` at run time\n * ({@link BreadcrumbItemDynamicProps}: `HTMLElement` events).\n *\n * Also exported as `BreadcrumbItem` (import the flat name from React Server Components).\n */\nfunction BreadcrumbItem(props: BreadcrumbItemButtonProps): React.ReactElement;\nfunction BreadcrumbItem(props: BreadcrumbItemAnchorProps): React.ReactElement;\nfunction BreadcrumbItem(props: BreadcrumbItemDynamicProps): React.ReactElement;\nfunction BreadcrumbItem(\n props: BreadcrumbItemProps | BreadcrumbItemDynamicProps,\n): React.ReactElement {\n const {\n href,\n current = false,\n icon,\n asChild = false,\n children,\n className,\n onClick,\n ref,\n ...rest\n } = props as BreadcrumbEntryProps;\n\n // A falsy icon (`icon={name && <Icon />}` with `name` '' or a count of 0) is no icon, as in Nav,\n // Tree and Avatar, and so is a collection whose items render nothing: no empty span and no stray\n // `me-1` margin. The check does not consume a generator: renderSlot still renders its items.\n const renderedIcon =\n icon && slotRendersContent(icon)\n ? renderSlot(icon, 'span', cn(breadcrumbItemClassNames.icon, 'me-1 inline-flex shrink-0'), {\n 'aria-hidden': true,\n })\n : null;\n const child =\n asChild && React.isValidElement<{ children?: React.ReactNode }>(children) ? children : null;\n const kind = child\n ? 'child'\n : current\n ? 'current'\n : href !== undefined\n ? 'link'\n : onClick\n ? 'button'\n : 'text';\n\n const invalidAsChild = asChild && child === null;\n const ignoredDisabled = rest.disabled === true && (kind === 'text' || kind === 'current');\n // Link and asChild items follow Link's disabled contract. `<a disabled>` does not block\n // navigation, and an `aria-disabled` link only looks disabled unless the click is cancelled.\n // With asChild the element is the link, so its own `disabled`/`aria-disabled` count too.\n const ariaDisabled = rest['aria-disabled'];\n const childProps = (child?.props ?? {}) as Record<string, unknown>;\n const linkDisabled = [\n rest.disabled,\n ariaDisabled,\n childProps.disabled,\n childProps['aria-disabled'],\n ].some((value) => value === true || value === 'true');\n React.useEffect(() => {\n if (invalidAsChild) {\n warnOnce(\n 'Breadcrumb.Item:asChild',\n 'Breadcrumb.Item: `asChild` expects a single element child (e.g. a router link); the item was rendered normally instead.',\n );\n }\n if (kind === 'text') {\n warnOnce(\n 'Breadcrumb.Item:no-href',\n 'Breadcrumb.Item: a non-current item without `href` or `onClick` renders as plain text, not a link. Pass `href` (or `onClick`, which renders a button) to make it navigable.',\n );\n }\n if (ignoredDisabled) {\n warnOnce(\n 'Breadcrumb.Item:disabled',\n 'Breadcrumb.Item: `disabled` applies to link, button and asChild items; it is ignored on a text or current item.',\n );\n }\n }, [invalidAsChild, kind, ignoredDisabled]);\n\n if (child) {\n const { disabled: _disabled, ...childRest } = rest;\n // Like the other item props, `href` is a default for the element (its own `href` wins). A\n // disabled link has no destination, so it is not passed then.\n const childHref = href !== undefined && !linkDisabled ? { href } : undefined;\n return (\n <BreadcrumbItemChild\n {...(childRest as React.HTMLAttributes<HTMLElement>)}\n {...childHref}\n ref={ref}\n onClick={preventIfDisabled(linkDisabled, onClick)}\n aria-current={current ? 'page' : undefined}\n className={cn(\n breadcrumbItemClassNames.root,\n current ? currentChildClasses : linkClasses,\n className,\n )}\n icon={renderedIcon}\n child={linkDisabled ? disableLinkChild(child) : child}\n />\n );\n }\n\n if (kind === 'current') {\n return (\n <span\n {...spanAttributes(rest)}\n ref={ref as React.Ref<HTMLSpanElement>}\n aria-current=\"page\"\n onClick={onClick}\n className={cn(breadcrumbItemClassNames.root, currentClasses, className)}\n >\n {renderedIcon}\n {children}\n </span>\n );\n }\n\n if (kind === 'link') {\n const { disabled: _disabled, ...anchorRest } = rest;\n return (\n <a\n {...(anchorRest as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={linkDisabled ? undefined : href}\n role={linkDisabled ? 'link' : anchorRest.role}\n aria-disabled={linkDisabled ? true : ariaDisabled}\n tabIndex={linkDisabled ? -1 : anchorRest.tabIndex}\n onClick={preventIfDisabled(linkDisabled, onClick)}\n className={cn(breadcrumbItemClassNames.root, linkClasses, className)}\n >\n {renderedIcon}\n {children}\n </a>\n );\n }\n\n if (kind === 'button') {\n // `rel` only belongs on a link: a button item drops it, like the text and current items.\n const { rel, ...buttonRest } = rest;\n return (\n <button\n type=\"button\"\n {...(buttonRest as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n ref={ref as React.Ref<HTMLButtonElement>}\n onClick={onClick}\n className={cn(breadcrumbItemClassNames.root, linkClasses, className)}\n >\n {renderedIcon}\n {children}\n </button>\n );\n }\n\n return (\n <span\n {...spanAttributes(rest)}\n ref={ref as React.Ref<HTMLSpanElement>}\n className={cn(breadcrumbItemClassNames.root, textClasses, className)}\n >\n {renderedIcon}\n {children}\n </span>\n );\n}\nBreadcrumbItem.displayName = 'BreadcrumbItem';\n\n/**\n * A breadcrumb trail: a `<nav aria-label=\"Breadcrumb\">` landmark with an ordered list. Each child\n * is placed in its own list item (Fragments are opened, so each of their items gets one too); from\n * the second one on, the item begins with a decorative separator chevron that is mirrored in\n * right-to-left layouts.\n *\n * `Breadcrumb.Item` is also exported as `BreadcrumbItem`: React Server Components import the flat\n * name, because dotted access needs a client file.\n *\n * @example\n * <Breadcrumb>\n * <Breadcrumb.Item href=\"/\">Home</Breadcrumb.Item>\n * <Breadcrumb.Item current>Settings</Breadcrumb.Item>\n * </Breadcrumb>\n */\nexport const Breadcrumb = /* @__PURE__ */ Object.assign(BreadcrumbRoot, {\n Item: BreadcrumbItem,\n});\n\nexport { BreadcrumbItem };\n"],"mappings":"ycAsJA,IAAM0B,EAAc1B,EAAAA,GAClB,mHACAC,EAAAA,UACAC,EAAAA,cACF,EACMyB,EAAiB,yDAEjBC,EAAsB5B,EAAAA,GAAG2B,EAAgB1B,EAAAA,UAAWC,EAAAA,cAAc,EAClE2B,EAAc,2CAqBdC,EAA6D,IAAI,IAAI,CACzE,MACA,GAAG,OAAO,KAAK,CACb,SAAU,GACV,KAAM,GACN,KAAM,GACN,WAAY,GACZ,YAAa,GACb,WAAY,GACZ,eAAgB,GAChB,WAAY,GACZ,KAAM,GACN,MAAO,GACP,OAAQ,GACR,SAAU,GACV,SAAU,GACV,KAAM,GACN,MAAO,GACP,eAAgB,EAClB,CAA8C,CAChD,CAAC,EAGD,SAASC,EAAe,EAAsE,CAC5F,IAAMC,EAAsC,CAAC,EAC7C,IAAK,IAAMC,KAAO,OAAO,KAAKC,CAAI,EAC3BJ,EAAsB,IAAIG,CAAG,IAAG,EAAWA,GAAOC,EAAKD,IAE9D,OAAOD,CACT,CAEA,IAAMG,GAAkB,CAAE,WAAU,YAAW,MAAK,GAAGD,KAA4B,CAEjF,IAAME,EAAQjC,EAAAA,gBAAgBkC,CAAQ,EAEtC,OACE,EAAAZ,EAAA,IAAA,CAAC,MAAD,CACO,MACL,aAAW,aACX,GAAIS,EACJ,UAAWlC,EAAAA,GAAGI,EAAAA,qBAAqB,KAAMkC,CAAS,EAElD,UAAA,EAAAb,EAAA,IAAA,CAAC,KAAD,CACE,UAAWzB,EAAAA,GACTI,E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