@slotted/react 0.1.0-beta.39 → 0.1.0-beta.40

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 (394) hide show
  1. package/dist/alert-CV8wKS-N.js +179 -0
  2. package/dist/alert.js +1 -1
  3. package/dist/{avatar-DLWElrgg.js → avatar-fHRva5zn.js} +1 -1
  4. package/dist/{avatar-group-DshHqe8B.js → avatar-group-bJaZE1_C.js} +1 -1
  5. package/dist/avatar-group.js +1 -1
  6. package/dist/avatar.js +1 -1
  7. package/dist/calendar-D3QZDlm0.js +598 -0
  8. package/dist/calendar.js +1 -1
  9. package/dist/clock-DzkQa57Q.js +290 -0
  10. package/dist/clock.js +2 -0
  11. package/dist/{dashboard-grid-B6jxBz4j.js → dashboard-grid-DAY_CjCW.js} +1 -1
  12. package/dist/dashboard-grid.js +1 -1
  13. package/dist/{data-grid-Cx0ZOf_e.js → data-grid-B7UuUvBH.js} +42 -37
  14. package/dist/data-grid.js +1 -1
  15. package/dist/{data-list-Cb2sNA6I.js → data-list-CyEq7M2D.js} +1 -1
  16. package/dist/data-list.js +1 -1
  17. package/dist/date-picker-DMcMFW_N.js +344 -0
  18. package/dist/date-picker.js +3 -2
  19. package/dist/date-range-picker-D9zo93NE.js +543 -0
  20. package/dist/date-range-picker.js +2 -2
  21. package/dist/datetime-picker-lOXZbAx_.js +462 -0
  22. package/dist/datetime-picker.js +2 -2
  23. package/dist/datetime-range-picker-DU5ctZbm.js +641 -0
  24. package/dist/datetime-range-picker.js +2 -2
  25. package/dist/divider-DUUPCIh4.js +35 -0
  26. package/dist/divider.js +1 -1
  27. package/dist/docs/alert.examples.md +500 -0
  28. package/dist/docs/alert.json +85 -37
  29. package/dist/docs/alert.md +37 -189
  30. package/dist/docs/aspect-ratio.json +40 -16
  31. package/dist/docs/aspect-ratio.md +204 -29
  32. package/dist/docs/avatar.json +125 -29
  33. package/dist/docs/avatar.md +374 -31
  34. package/dist/docs/badge.json +119 -23
  35. package/dist/docs/badge.md +436 -27
  36. package/dist/docs/calendar.json +53 -5
  37. package/dist/docs/calendar.md +7 -2
  38. package/dist/docs/card.json +98 -10
  39. package/dist/docs/card.md +468 -26
  40. package/dist/docs/clock.json +405 -0
  41. package/dist/docs/clock.md +189 -0
  42. package/dist/docs/container.json +54 -6
  43. package/dist/docs/container.md +247 -17
  44. package/dist/docs/date-picker.examples.md +143 -169
  45. package/dist/docs/date-picker.json +178 -223
  46. package/dist/docs/date-picker.md +44 -50
  47. package/dist/docs/date-range-picker.examples.md +169 -187
  48. package/dist/docs/date-range-picker.json +206 -337
  49. package/dist/docs/date-range-picker.md +52 -67
  50. package/dist/docs/datetime-picker.examples.md +75 -210
  51. package/dist/docs/datetime-picker.json +183 -410
  52. package/dist/docs/datetime-picker.md +50 -72
  53. package/dist/docs/datetime-range-picker.json +225 -502
  54. package/dist/docs/datetime-range-picker.md +250 -101
  55. package/dist/docs/divider.json +71 -7
  56. package/dist/docs/divider.md +281 -13
  57. package/dist/docs/grid.json +76 -12
  58. package/dist/docs/grid.md +376 -18
  59. package/dist/docs/index.md +1 -0
  60. package/dist/docs/inline-message.json +87 -40
  61. package/dist/docs/inline-message.md +314 -71
  62. package/dist/docs/inline.json +65 -9
  63. package/dist/docs/inline.md +276 -13
  64. package/dist/docs/kbd.json +76 -36
  65. package/dist/docs/kbd.md +346 -63
  66. package/dist/docs/link.json +65 -25
  67. package/dist/docs/link.md +317 -60
  68. package/dist/docs/progress-indicator.examples.md +522 -0
  69. package/dist/docs/progress-indicator.json +51 -27
  70. package/dist/docs/progress-indicator.md +13 -238
  71. package/dist/docs/result-state.examples.md +752 -0
  72. package/dist/docs/result-state.json +95 -47
  73. package/dist/docs/result-state.md +45 -228
  74. package/dist/docs/skeleton.json +70 -38
  75. package/dist/docs/skeleton.md +393 -71
  76. package/dist/docs/stack.json +57 -9
  77. package/dist/docs/stack.md +225 -12
  78. package/dist/docs/table.examples.md +6 -10
  79. package/dist/docs/table.json +5 -5
  80. package/dist/docs/table.md +1 -1
  81. package/dist/docs/tag.examples.md +503 -0
  82. package/dist/docs/tag.json +128 -32
  83. package/dist/docs/tag.md +27 -138
  84. package/dist/docs/time-picker.json +162 -300
  85. package/dist/docs/time-picker.md +100 -154
  86. package/dist/docs/time-range-picker.json +203 -465
  87. package/dist/docs/time-range-picker.md +125 -173
  88. package/dist/docs/toast.examples.md +690 -0
  89. package/dist/docs/toast.json +119 -71
  90. package/dist/docs/toast.md +44 -212
  91. package/dist/docs/tree.examples.md +2008 -0
  92. package/dist/docs/tree.json +283 -106
  93. package/dist/docs/tree.md +96 -328
  94. package/dist/docs/visually-hidden.json +38 -6
  95. package/dist/docs/visually-hidden.md +148 -11
  96. package/dist/{entity-picker-CwfA1wr_.js → entity-picker-BwJX0gNJ.js} +1 -1
  97. package/dist/entity-picker.js +1 -1
  98. package/dist/{filter-bar-b8bRNPs9.js → filter-bar-BQZFgV0A.js} +5 -3
  99. package/dist/filter-bar.js +1 -1
  100. package/dist/{import-export-center-C_oNc-RM.js → import-export-center-DWSEOV5Z.js} +3 -3
  101. package/dist/import-export-center.js +1 -1
  102. package/dist/index.js +101 -99
  103. package/dist/{markdown-x59MHBAa.js → markdown-7wOBMXTl.js} +1 -1
  104. package/dist/markdown.js +1 -1
  105. package/dist/picker-frame-_9ZqQOjf.js +43 -0
  106. package/dist/picker-group-CrNRKUxz.js +33 -0
  107. package/dist/picker-head-C_Z0tQGq.js +69 -0
  108. package/dist/picker-jump-BcTRIJs6.js +70 -0
  109. package/dist/picker-range-head-B4tsDOc5.js +100 -0
  110. package/dist/picker-step-MgBwF9g1.js +26 -0
  111. package/dist/read-title-id-DQZVWlMt.js +14 -0
  112. package/dist/result-state-Ct9AB01a.js +123 -0
  113. package/dist/result-state.js +1 -1
  114. package/dist/styles/app-shell.css +1 -1
  115. package/dist/styles/aspect-ratio.css +1 -1
  116. package/dist/styles/attachment.css +1 -1
  117. package/dist/styles/badge.css +1 -1
  118. package/dist/styles/calendar.css +1 -1
  119. package/dist/styles/cascader.css +1 -1
  120. package/dist/styles/chart.css +1 -1
  121. package/dist/styles/clock.css +2 -0
  122. package/dist/styles/code-block.css +1 -1
  123. package/dist/styles/command-palette.css +1 -1
  124. package/dist/styles/dashboard-grid.css +1 -1
  125. package/dist/styles/data-grid.css +14 -10
  126. package/dist/styles/data-list.css +1 -1
  127. package/dist/styles/date-picker.css +4 -2
  128. package/dist/styles/date-range-picker.css +4 -2
  129. package/dist/styles/datetime-picker.css +8 -2
  130. package/dist/styles/datetime-range-picker.css +6 -2
  131. package/dist/styles/detail-panel.css +3 -3
  132. package/dist/styles/entity-picker.css +1 -1
  133. package/dist/styles/event-calendar.css +1 -1
  134. package/dist/styles/filter-bar.css +11 -7
  135. package/dist/styles/grid.css +1 -1
  136. package/dist/styles/image.css +1 -1
  137. package/dist/styles/import-export-center.css +15 -11
  138. package/dist/styles/index.css +21 -17
  139. package/dist/styles/inline.css +1 -1
  140. package/dist/styles/loading-overlay.css +1 -1
  141. package/dist/styles/markdown.css +1 -1
  142. package/dist/styles/multi-select.css +1 -1
  143. package/dist/styles/notification-center.css +1 -1
  144. package/dist/styles/page-header.css +2 -2
  145. package/dist/styles/progress-indicator.css +1 -1
  146. package/dist/styles/side-navigation.css +2 -2
  147. package/dist/styles/skeleton.css +1 -1
  148. package/dist/styles/stack.css +1 -1
  149. package/dist/styles/stat-card.css +1 -1
  150. package/dist/styles/table-of-contents.css +1 -1
  151. package/dist/styles/table.css +14 -10
  152. package/dist/styles/time-picker.css +5 -1
  153. package/dist/styles/time-range-picker.css +5 -1
  154. package/dist/styles/toast.css +1 -1
  155. package/dist/styles/top-navigation.css +1 -1
  156. package/dist/styles/tree.css +1 -1
  157. package/dist/styles/upload.css +1 -1
  158. package/dist/styles/wizard.css +1 -1
  159. package/dist/styles.css +1 -1
  160. package/dist/{table-DqwYPHGS.js → table-MGb3iZY_.js} +11 -6
  161. package/dist/table.js +1 -1
  162. package/dist/time-picker-z4GSRuha.js +313 -0
  163. package/dist/time-picker.js +2 -2
  164. package/dist/time-range-picker-ar40oPcf.js +563 -0
  165. package/dist/time-range-picker.js +2 -2
  166. package/dist/{toast-DHDVXIew.js → toast-Cg28GkqX.js} +121 -117
  167. package/dist/toast.js +1 -1
  168. package/dist/tree-CytfCFT-.js +874 -0
  169. package/dist/tree.js +1 -1
  170. package/dist/types/alert/alert-parts.d.ts +1 -1
  171. package/dist/types/alert/alert-parts.d.ts.map +1 -1
  172. package/dist/types/alert/alert.d.ts.map +1 -1
  173. package/dist/types/alert/alert.types.d.ts +1 -1
  174. package/dist/types/alert/alert.types.d.ts.map +1 -1
  175. package/dist/types/avatar/avatar.d.ts.map +1 -1
  176. package/dist/types/badge/badge.types.d.ts +1 -1
  177. package/dist/types/badge/badge.types.d.ts.map +1 -1
  178. package/dist/types/calendar/calendar-day-cell.d.ts +3 -1
  179. package/dist/types/calendar/calendar-day-cell.d.ts.map +1 -1
  180. package/dist/types/calendar/calendar-header.d.ts +9 -5
  181. package/dist/types/calendar/calendar-header.d.ts.map +1 -1
  182. package/dist/types/calendar/calendar-month-table.d.ts +8 -3
  183. package/dist/types/calendar/calendar-month-table.d.ts.map +1 -1
  184. package/dist/types/calendar/calendar.d.ts +1 -1
  185. package/dist/types/calendar/calendar.d.ts.map +1 -1
  186. package/dist/types/calendar/calendar.types.d.ts +12 -1
  187. package/dist/types/calendar/calendar.types.d.ts.map +1 -1
  188. package/dist/types/clock/clock-body.d.ts +16 -0
  189. package/dist/types/clock/clock-body.d.ts.map +1 -0
  190. package/dist/types/clock/clock-demo.d.ts +15 -0
  191. package/dist/types/clock/clock-demo.d.ts.map +1 -0
  192. package/dist/types/clock/clock-groups.d.ts +15 -0
  193. package/dist/types/clock/clock-groups.d.ts.map +1 -0
  194. package/dist/types/clock/clock-option.d.ts +14 -0
  195. package/dist/types/clock/clock-option.d.ts.map +1 -0
  196. package/dist/types/clock/clock-units.d.ts +13 -0
  197. package/dist/types/clock/clock-units.d.ts.map +1 -0
  198. package/dist/types/clock/clock.d.ts +11 -0
  199. package/dist/types/clock/clock.d.ts.map +1 -0
  200. package/dist/types/clock/clock.types.d.ts +66 -0
  201. package/dist/types/clock/clock.types.d.ts.map +1 -0
  202. package/dist/types/clock/index.d.ts +3 -0
  203. package/dist/types/clock/index.d.ts.map +1 -0
  204. package/dist/types/clock/use-clock-grid.d.ts +28 -0
  205. package/dist/types/clock/use-clock-grid.d.ts.map +1 -0
  206. package/dist/types/clock/use-clock-view.d.ts +16 -0
  207. package/dist/types/clock/use-clock-view.d.ts.map +1 -0
  208. package/dist/types/data-grid/data-grid-filter.d.ts.map +1 -1
  209. package/dist/types/date-picker/date-panel.d.ts +32 -0
  210. package/dist/types/date-picker/date-panel.d.ts.map +1 -0
  211. package/dist/types/date-picker/date-picker-demo.d.ts +8 -15
  212. package/dist/types/date-picker/date-picker-demo.d.ts.map +1 -1
  213. package/dist/types/date-picker/date-picker-panel.d.ts +18 -0
  214. package/dist/types/date-picker/date-picker-panel.d.ts.map +1 -0
  215. package/dist/types/date-picker/date-picker.d.ts +7 -13
  216. package/dist/types/date-picker/date-picker.d.ts.map +1 -1
  217. package/dist/types/date-picker/date-picker.types.d.ts +15 -16
  218. package/dist/types/date-picker/date-picker.types.d.ts.map +1 -1
  219. package/dist/types/date-picker/index.d.ts +1 -1
  220. package/dist/types/date-picker/index.d.ts.map +1 -1
  221. package/dist/types/date-picker/month-picker.d.ts +12 -0
  222. package/dist/types/date-picker/month-picker.d.ts.map +1 -0
  223. package/dist/types/date-picker/use-date-panel.d.ts +50 -0
  224. package/dist/types/date-picker/use-date-panel.d.ts.map +1 -0
  225. package/dist/types/date-picker/use-date-picker.d.ts +24 -0
  226. package/dist/types/date-picker/use-date-picker.d.ts.map +1 -0
  227. package/dist/types/date-range-picker/date-range-control.d.ts +34 -0
  228. package/dist/types/date-range-picker/date-range-control.d.ts.map +1 -0
  229. package/dist/types/date-range-picker/date-range-panel.d.ts +24 -0
  230. package/dist/types/date-range-picker/date-range-panel.d.ts.map +1 -0
  231. package/dist/types/date-range-picker/date-range-picker-demo.d.ts +8 -15
  232. package/dist/types/date-range-picker/date-range-picker-demo.d.ts.map +1 -1
  233. package/dist/types/date-range-picker/date-range-picker.d.ts +11 -21
  234. package/dist/types/date-range-picker/date-range-picker.d.ts.map +1 -1
  235. package/dist/types/date-range-picker/date-range-picker.types.d.ts +12 -26
  236. package/dist/types/date-range-picker/date-range-picker.types.d.ts.map +1 -1
  237. package/dist/types/date-range-picker/index.d.ts +2 -2
  238. package/dist/types/date-range-picker/index.d.ts.map +1 -1
  239. package/dist/types/date-range-picker/range-words.d.ts +30 -0
  240. package/dist/types/date-range-picker/range-words.d.ts.map +1 -0
  241. package/dist/types/date-range-picker/use-date-range-picker.d.ts +32 -0
  242. package/dist/types/date-range-picker/use-date-range-picker.d.ts.map +1 -0
  243. package/dist/types/date-range-picker/use-range-draft.d.ts +39 -0
  244. package/dist/types/date-range-picker/use-range-draft.d.ts.map +1 -0
  245. package/dist/types/date-range-picker/use-range-panel.d.ts +71 -0
  246. package/dist/types/date-range-picker/use-range-panel.d.ts.map +1 -0
  247. package/dist/types/datetime-picker/datetime-picker-defaults.d.ts +3 -9
  248. package/dist/types/datetime-picker/datetime-picker-defaults.d.ts.map +1 -1
  249. package/dist/types/datetime-picker/datetime-picker-demo.d.ts +8 -31
  250. package/dist/types/datetime-picker/datetime-picker-demo.d.ts.map +1 -1
  251. package/dist/types/datetime-picker/datetime-picker-panel.d.ts +23 -0
  252. package/dist/types/datetime-picker/datetime-picker-panel.d.ts.map +1 -0
  253. package/dist/types/datetime-picker/datetime-picker.d.ts +8 -19
  254. package/dist/types/datetime-picker/datetime-picker.d.ts.map +1 -1
  255. package/dist/types/datetime-picker/datetime-picker.types.d.ts +25 -66
  256. package/dist/types/datetime-picker/datetime-picker.types.d.ts.map +1 -1
  257. package/dist/types/datetime-picker/index.d.ts +2 -2
  258. package/dist/types/datetime-picker/index.d.ts.map +1 -1
  259. package/dist/types/datetime-picker/use-datetime-panel.d.ts +69 -0
  260. package/dist/types/datetime-picker/use-datetime-panel.d.ts.map +1 -0
  261. package/dist/types/datetime-picker/use-datetime-picker.d.ts +22 -0
  262. package/dist/types/datetime-picker/use-datetime-picker.d.ts.map +1 -0
  263. package/dist/types/datetime-range-picker/datetime-range-half.d.ts +20 -0
  264. package/dist/types/datetime-range-picker/datetime-range-half.d.ts.map +1 -0
  265. package/dist/types/datetime-range-picker/datetime-range-panel.d.ts +30 -0
  266. package/dist/types/datetime-range-picker/datetime-range-panel.d.ts.map +1 -0
  267. package/dist/types/datetime-range-picker/datetime-range-picker-defaults.d.ts +5 -7
  268. package/dist/types/datetime-range-picker/datetime-range-picker-defaults.d.ts.map +1 -1
  269. package/dist/types/datetime-range-picker/datetime-range-picker-demo.d.ts +8 -24
  270. package/dist/types/datetime-range-picker/datetime-range-picker-demo.d.ts.map +1 -1
  271. package/dist/types/datetime-range-picker/datetime-range-picker.d.ts +12 -24
  272. package/dist/types/datetime-range-picker/datetime-range-picker.d.ts.map +1 -1
  273. package/dist/types/datetime-range-picker/datetime-range-picker.types.d.ts +31 -66
  274. package/dist/types/datetime-range-picker/datetime-range-picker.types.d.ts.map +1 -1
  275. package/dist/types/datetime-range-picker/datetime-range-words.d.ts +40 -0
  276. package/dist/types/datetime-range-picker/datetime-range-words.d.ts.map +1 -0
  277. package/dist/types/datetime-range-picker/index.d.ts +4 -3
  278. package/dist/types/datetime-range-picker/index.d.ts.map +1 -1
  279. package/dist/types/datetime-range-picker/use-datetime-range-draft.d.ts +43 -0
  280. package/dist/types/datetime-range-picker/use-datetime-range-draft.d.ts.map +1 -0
  281. package/dist/types/datetime-range-picker/use-datetime-range-panel.d.ts +82 -0
  282. package/dist/types/datetime-range-picker/use-datetime-range-panel.d.ts.map +1 -0
  283. package/dist/types/datetime-range-picker/use-datetime-range-picker.d.ts +28 -0
  284. package/dist/types/datetime-range-picker/use-datetime-range-picker.d.ts.map +1 -0
  285. package/dist/types/divider/divider.d.ts +1 -1
  286. package/dist/types/divider/divider.d.ts.map +1 -1
  287. package/dist/types/filter-bar/filter-bar-rules.d.ts.map +1 -1
  288. package/dist/types/index.d.ts +1 -0
  289. package/dist/types/index.d.ts.map +1 -1
  290. package/dist/types/picker-panel/picker-footer.d.ts +17 -0
  291. package/dist/types/picker-panel/picker-footer.d.ts.map +1 -0
  292. package/dist/types/picker-panel/picker-frame.d.ts +21 -0
  293. package/dist/types/picker-panel/picker-frame.d.ts.map +1 -0
  294. package/dist/types/picker-panel/picker-group.d.ts +18 -0
  295. package/dist/types/picker-panel/picker-group.d.ts.map +1 -0
  296. package/dist/types/picker-panel/picker-head.d.ts +27 -0
  297. package/dist/types/picker-panel/picker-head.d.ts.map +1 -0
  298. package/dist/types/picker-panel/picker-jump.d.ts +18 -0
  299. package/dist/types/picker-panel/picker-jump.d.ts.map +1 -0
  300. package/dist/types/picker-panel/picker-layer.d.ts +14 -0
  301. package/dist/types/picker-panel/picker-layer.d.ts.map +1 -0
  302. package/dist/types/picker-panel/picker-panel.d.ts +17 -0
  303. package/dist/types/picker-panel/picker-panel.d.ts.map +1 -0
  304. package/dist/types/picker-panel/picker-rail.d.ts +17 -0
  305. package/dist/types/picker-panel/picker-rail.d.ts.map +1 -0
  306. package/dist/types/picker-panel/picker-range-head.d.ts +37 -0
  307. package/dist/types/picker-panel/picker-range-head.d.ts.map +1 -0
  308. package/dist/types/picker-panel/picker-ruler.d.ts +14 -0
  309. package/dist/types/picker-panel/picker-ruler.d.ts.map +1 -0
  310. package/dist/types/picker-panel/picker-step.d.ts +11 -0
  311. package/dist/types/picker-panel/picker-step.d.ts.map +1 -0
  312. package/dist/types/picker-panel/picker-trigger.d.ts +16 -0
  313. package/dist/types/picker-panel/picker-trigger.d.ts.map +1 -0
  314. package/dist/types/picker-panel/use-media-query.d.ts +3 -0
  315. package/dist/types/picker-panel/use-media-query.d.ts.map +1 -0
  316. package/dist/types/picker-panel/use-picker-draft.d.ts +18 -0
  317. package/dist/types/picker-panel/use-picker-draft.d.ts.map +1 -0
  318. package/dist/types/picker-panel/use-picker-layer.d.ts +31 -0
  319. package/dist/types/picker-panel/use-picker-layer.d.ts.map +1 -0
  320. package/dist/types/picker-panel/use-picker-open.d.ts +14 -0
  321. package/dist/types/picker-panel/use-picker-open.d.ts.map +1 -0
  322. package/dist/types/picker-panel/use-picker-position.d.ts +12 -0
  323. package/dist/types/picker-panel/use-picker-position.d.ts.map +1 -0
  324. package/dist/types/picker-panel/use-picker-value.d.ts +20 -0
  325. package/dist/types/picker-panel/use-picker-value.d.ts.map +1 -0
  326. package/dist/types/result-state/result-state.d.ts +32 -2
  327. package/dist/types/result-state/result-state.d.ts.map +1 -1
  328. package/dist/types/table/table-filter.d.ts.map +1 -1
  329. package/dist/types/table/table.types.d.ts +16 -14
  330. package/dist/types/table/table.types.d.ts.map +1 -1
  331. package/dist/types/tag/tag.types.d.ts +1 -1
  332. package/dist/types/tag/tag.types.d.ts.map +1 -1
  333. package/dist/types/time-picker/index.d.ts +2 -2
  334. package/dist/types/time-picker/index.d.ts.map +1 -1
  335. package/dist/types/time-picker/time-picker-defaults.d.ts +0 -7
  336. package/dist/types/time-picker/time-picker-defaults.d.ts.map +1 -1
  337. package/dist/types/time-picker/time-picker-demo.d.ts +15 -0
  338. package/dist/types/time-picker/time-picker-demo.d.ts.map +1 -0
  339. package/dist/types/time-picker/time-picker-panel.d.ts +17 -0
  340. package/dist/types/time-picker/time-picker-panel.d.ts.map +1 -0
  341. package/dist/types/time-picker/time-picker.d.ts +6 -14
  342. package/dist/types/time-picker/time-picker.d.ts.map +1 -1
  343. package/dist/types/time-picker/time-picker.types.d.ts +21 -45
  344. package/dist/types/time-picker/time-picker.types.d.ts.map +1 -1
  345. package/dist/types/time-picker/use-time-panel.d.ts +42 -0
  346. package/dist/types/time-picker/use-time-panel.d.ts.map +1 -0
  347. package/dist/types/time-picker/use-time-picker.d.ts +27 -0
  348. package/dist/types/time-picker/use-time-picker.d.ts.map +1 -0
  349. package/dist/types/time-range-picker/index.d.ts +4 -3
  350. package/dist/types/time-range-picker/index.d.ts.map +1 -1
  351. package/dist/types/time-range-picker/time-range-panel.d.ts +23 -0
  352. package/dist/types/time-range-picker/time-range-panel.d.ts.map +1 -0
  353. package/dist/types/time-range-picker/time-range-picker-defaults.d.ts +2 -4
  354. package/dist/types/time-range-picker/time-range-picker-defaults.d.ts.map +1 -1
  355. package/dist/types/time-range-picker/time-range-picker-demo.d.ts +8 -24
  356. package/dist/types/time-range-picker/time-range-picker-demo.d.ts.map +1 -1
  357. package/dist/types/time-range-picker/time-range-picker.d.ts +12 -28
  358. package/dist/types/time-range-picker/time-range-picker.d.ts.map +1 -1
  359. package/dist/types/time-range-picker/time-range-picker.types.d.ts +24 -64
  360. package/dist/types/time-range-picker/time-range-picker.types.d.ts.map +1 -1
  361. package/dist/types/time-range-picker/time-range-words.d.ts +37 -0
  362. package/dist/types/time-range-picker/time-range-words.d.ts.map +1 -0
  363. package/dist/types/time-range-picker/use-time-range-panel.d.ts +68 -0
  364. package/dist/types/time-range-picker/use-time-range-panel.d.ts.map +1 -0
  365. package/dist/types/time-range-picker/use-time-range-picker.d.ts +25 -0
  366. package/dist/types/time-range-picker/use-time-range-picker.d.ts.map +1 -0
  367. package/dist/types/title-id/read-title-id.d.ts +15 -0
  368. package/dist/types/title-id/read-title-id.d.ts.map +1 -0
  369. package/dist/types/toast/toast.d.ts.map +1 -1
  370. package/dist/types/tree/index.d.ts +1 -1
  371. package/dist/types/tree/index.d.ts.map +1 -1
  372. package/dist/types/tree/tree-parts.d.ts +2 -0
  373. package/dist/types/tree/tree-parts.d.ts.map +1 -1
  374. package/dist/types/tree/tree.d.ts +1 -1
  375. package/dist/types/tree/tree.d.ts.map +1 -1
  376. package/dist/types/tree/tree.types.d.ts +15 -5
  377. package/dist/types/tree/tree.types.d.ts.map +1 -1
  378. package/dist/use-date-picker-DL8tRXji.js +63 -0
  379. package/dist/use-picker-draft-Bw8VFaj0.js +377 -0
  380. package/dist/{wizard-CL6u1aJb.js → wizard-BokOrtwq.js} +1 -1
  381. package/dist/wizard.js +1 -1
  382. package/package.json +10 -6
  383. package/dist/alert-Bi9s1cjV.js +0 -174
  384. package/dist/calendar-CX0wN5Bh.js +0 -564
  385. package/dist/date-picker-CLXTtQGe.js +0 -337
  386. package/dist/date-range-picker-Br0neGyT.js +0 -522
  387. package/dist/datetime-picker-CR-H_BLu.js +0 -683
  388. package/dist/datetime-range-picker-BLo58OIk.js +0 -1050
  389. package/dist/divider-ryFeK0Pi.js +0 -35
  390. package/dist/docs/datetime-range-picker.examples.md +0 -219
  391. package/dist/result-state-BMYhelu1.js +0 -128
  392. package/dist/time-picker-B4-GsO24.js +0 -436
  393. package/dist/time-range-picker-DVOWN8PF.js +0 -800
  394. package/dist/tree-D-y-0TrL.js +0 -794
@@ -174,91 +174,91 @@
174
174
  "part": "root",
175
175
  "element": "div, or the element render returns",
176
176
  "required": true,
177
- "purpose": "The box around the tree. It carries data-ui=\"tree\" and every axis, it is the query container the indent answers, and under the flat structure it is the scroller as well."
177
+ "purpose": "The box around the tree. It carries data-ui=\"tree\" and every axis, it is the container the indent adapts to, and in the flat structure it is also the scroller."
178
178
  },
179
179
  {
180
180
  "part": "canvas",
181
181
  "element": "ul with role=\"tree\"",
182
182
  "required": true,
183
- "purpose": "The tree itself: the accessible name, aria-multiselectable, the one tab stop the whole set has, and — while windowed — the block size of the list it holds a slice of."
183
+ "purpose": "The tree itself: the accessible name, aria-multiselectable and the single tab stop. While virtual it also holds the full height of the list."
184
184
  },
185
185
  {
186
186
  "part": "node",
187
187
  "element": "li with role=\"treeitem\"",
188
188
  "required": true,
189
- "purpose": "One node. It carries the key, the depth, aria-expanded on a branch, the selection attribute, and aria-labelledby to its own label, so a folder is not announced as the whole subtree under it."
189
+ "purpose": "One node. It carries the key, the depth, aria-expanded on a branch and the selection attribute, and it is named by its own label, so a branch is not announced as everything under it."
190
190
  },
191
191
  {
192
192
  "part": "row",
193
193
  "element": "div",
194
194
  "required": true,
195
- "purpose": "The line a reader sees and presses: the band, the indent, and the cells. It is a second element because the node has to contain the group holding its children, and a target that contained the subtree would select a folder when a file three levels down was clicked."
195
+ "purpose": "The line that is shown and pressed. It is separate from the node, which also contains the children, so a press on a child does not press its parent."
196
196
  },
197
197
  {
198
198
  "part": "guide",
199
199
  "element": "span",
200
200
  "required": false,
201
- "purpose": "One element per row, drawing one line per ancestor level under the chevron of the level above it. Absent at the root level and when guides is false."
201
+ "purpose": "One line per ancestor level, under the chevron of that level. It is absent at the root level and when guides is false."
202
202
  },
203
203
  {
204
204
  "part": "expander",
205
205
  "element": "span",
206
206
  "required": true,
207
- "purpose": "The chevron. It is not a button: a button here is a second tab stop inside a widget whose pattern has exactly one. A leaf keeps the box and draws nothing, so every name at one depth starts in one column."
207
+ "purpose": "The chevron. It is not a button, because a tree has one tab stop. A leaf keeps the cell empty, so the names at one depth start in one column."
208
208
  },
209
209
  {
210
210
  "part": "indicator",
211
211
  "element": "span",
212
212
  "required": false,
213
- "purpose": "The box, under selectionIndicator=\"checkbox\". It is the box the checkbox family draws, value for value. Under highlight and none there is no cell at all."
213
+ "purpose": "The checkbox, under selectionIndicator=\"checkbox\". The other indicators draw no cell."
214
214
  },
215
215
  {
216
216
  "part": "icon",
217
217
  "element": "span",
218
218
  "required": false,
219
- "purpose": "The leading picture, which the consumer owns whole — the family has no folder glyph. A tree holding at least one icon opens the same cell on every row, so names stay in one column."
219
+ "purpose": "The leading icon, which you supply. One node with an icon reserves the same cell on every row."
220
220
  },
221
221
  {
222
222
  "part": "label",
223
223
  "element": "span",
224
224
  "required": true,
225
- "purpose": "The name. It is what names the node, what typeahead matches, and the only part that gives way: a long or unbroken name truncates and stays whole in the DOM."
225
+ "purpose": "The name. It names the node, it is what typeahead matches, and a long name truncates while staying whole in the DOM."
226
226
  },
227
227
  {
228
228
  "part": "description",
229
229
  "element": "span",
230
230
  "required": false,
231
- "purpose": "A second line beside the name. It is hidden below 240 pixels, where it has no room."
231
+ "purpose": "A second, muted text after the name. It is hidden when the tree is narrower than 240 pixels."
232
232
  },
233
233
  {
234
234
  "part": "meta",
235
235
  "element": "span",
236
236
  "required": false,
237
- "purpose": "The trailing count, size or badge. It keeps its intrinsic width, so a name twice as long in translation pushes on itself rather than on the number."
237
+ "purpose": "The trailing count, size or badge. It keeps its own width, so a long name truncates before it."
238
238
  },
239
239
  {
240
240
  "part": "loader",
241
241
  "element": "span with data-ui=\"spinner\"",
242
242
  "required": false,
243
- "purpose": "The wait, in the chevron's own cell and at its size, so a branch that starts fetching moves neither its own name nor the rows below it. It is progress-indicator's ring and not an arc of the tree's own."
243
+ "purpose": "The spinner of a branch whose children are arriving. It takes the cell and the size of the chevron, so nothing moves."
244
244
  },
245
245
  {
246
246
  "part": "actions",
247
247
  "element": "div",
248
248
  "required": false,
249
- "purpose": "The trailing controls. They stay in the DOM and stay reachable: revealing them on hover alone puts a control behind a gesture a touch reader does not have."
249
+ "purpose": "The trailing controls. They are always in the DOM, and the keys and clicks they receive are not the row's."
250
250
  },
251
251
  {
252
252
  "part": "group",
253
253
  "element": "ul with role=\"group\"",
254
254
  "required": false,
255
- "purpose": "The children of an open branch. It is rendered only while the branch is open, so a collapsed branch contributes no rows to the reading order the family counts."
255
+ "purpose": "The children of an open branch. A closed branch renders none."
256
256
  },
257
257
  {
258
258
  "part": "empty",
259
259
  "element": "div",
260
260
  "required": false,
261
- "purpose": "What the tree shows when it holds nothing, or when a query matches nothing."
261
+ "purpose": "What the tree shows when it holds no node or the query matches none."
262
262
  }
263
263
  ],
264
264
  "api": [
@@ -267,399 +267,406 @@
267
267
  "type": "string | readonly string[] | null",
268
268
  "defaultValue": "—",
269
269
  "appliesTo": "Tree",
270
- "description": "The chosen key, or the set of them in multiple. Present means controlled, for the life of the component"
270
+ "description": "The chosen key, or the set of chosen keys in multiple. When it is present the selection is controlled."
271
271
  },
272
272
  {
273
273
  "name": "defaultValue",
274
274
  "type": "string | readonly string[] | null",
275
275
  "defaultValue": "—",
276
276
  "appliesTo": "Tree",
277
- "description": "What an uncontrolled tree starts from, read once"
277
+ "description": "The selection an uncontrolled tree starts with."
278
278
  },
279
279
  {
280
280
  "name": "expandedKeys",
281
281
  "type": "readonly string[]",
282
282
  "defaultValue": "—",
283
283
  "appliesTo": "Tree",
284
- "description": "Which branches are open. Present means controlled; a filter never moves it"
284
+ "description": "The keys of the open branches. When it is present the expansion is controlled. A query never changes it."
285
285
  },
286
286
  {
287
287
  "name": "defaultExpandedKeys",
288
288
  "type": "readonly string[]",
289
289
  "defaultValue": "—",
290
290
  "appliesTo": "Tree",
291
- "description": "The set an uncontrolled tree opens with"
291
+ "description": "The branches an uncontrolled tree starts with open."
292
292
  },
293
293
  {
294
294
  "name": "activeKey",
295
295
  "type": "string | null",
296
296
  "defaultValue": "—",
297
297
  "appliesTo": "Tree",
298
- "description": "The node the keyboard is on. It is not the selection, and the pattern says so"
298
+ "description": "The node the keyboard is on, which is separate from the selection. When it is present the position is controlled."
299
299
  },
300
300
  {
301
301
  "name": "defaultActiveKey",
302
302
  "type": "string | null",
303
303
  "defaultValue": "—",
304
304
  "appliesTo": "Tree",
305
- "description": "Where the keyboard starts in an uncontrolled tree"
305
+ "description": "The node the keyboard starts on in an uncontrolled tree."
306
306
  },
307
307
  {
308
308
  "name": "size",
309
309
  "type": "'sm' | 'md' | 'lg'",
310
310
  "defaultValue": "md",
311
311
  "appliesTo": "Tree",
312
- "description": "The type step the rows sit at"
312
+ "description": "The row height, the type size, the glyph size and the indent, which move together."
313
313
  },
314
314
  {
315
315
  "name": "variant",
316
316
  "type": "'plain' | 'framed'",
317
317
  "defaultValue": "plain",
318
318
  "appliesTo": "Tree",
319
- "description": "Whether the tree draws its own box"
319
+ "description": "Whether the tree draws its own box. plain draws none and framed draws an edge, a radius and a shadow."
320
320
  },
321
321
  {
322
322
  "name": "structure",
323
323
  "type": "'auto' | 'nested' | 'flat'",
324
324
  "defaultValue": "auto",
325
325
  "appliesTo": "Tree",
326
- "description": "Whether the nodes nest in groups or lie flat with their level stated. auto answers flat while windowed"
326
+ "description": "Whether the nodes nest in groups or lie flat with their level stated. auto is flat while virtual and nested otherwise. Only a tree built from nodes can be flat."
327
327
  },
328
328
  {
329
329
  "name": "selectionMode",
330
330
  "type": "'none' | 'single' | 'multiple'",
331
331
  "defaultValue": "single",
332
332
  "appliesTo": "Tree",
333
- "description": "How many nodes may be chosen at once"
333
+ "description": "How many nodes can be chosen at once. none writes no selection attribute on any node."
334
334
  },
335
335
  {
336
336
  "name": "selectionBehavior",
337
337
  "type": "'toggle' | 'replace'",
338
338
  "defaultValue": "toggle",
339
339
  "appliesTo": "Tree",
340
- "description": "Which of the two models the pattern offers is in force. toggle is the one it recommends"
340
+ "description": "What a plain press does. toggle changes one node and needs no modifier key; replace collapses the selection onto the node pressed, and Ctrl, Command and Shift extend it."
341
341
  },
342
342
  {
343
343
  "name": "selectionIndicator",
344
344
  "type": "'auto' | 'highlight' | 'checkbox' | 'none'",
345
345
  "defaultValue": "auto",
346
346
  "appliesTo": "Tree",
347
- "description": "How the selection is drawn, and which attribute states it. auto reads the mode beside it"
347
+ "description": "How the selection is drawn and which attribute states it. highlight writes aria-selected, checkbox writes aria-checked, and auto draws a checkbox in multiple and a highlight in single."
348
348
  },
349
349
  {
350
350
  "name": "selectionCascade",
351
351
  "type": "'none' | 'descendants'",
352
352
  "defaultValue": "none",
353
353
  "appliesTo": "Tree",
354
- "description": "Whether pressing a branch takes its enabled descendants with it. Needs nodes"
354
+ "description": "Whether choosing a branch also chooses its enabled descendants. descendants needs nodes."
355
355
  },
356
356
  {
357
357
  "name": "expandOn",
358
358
  "type": "'row' | 'expander'",
359
359
  "defaultValue": "row",
360
360
  "appliesTo": "Tree",
361
- "description": "What a press on the row does to a branch"
361
+ "description": "What opens a branch. row gives the whole row and the chevron that job; expander leaves it to the chevron alone."
362
362
  },
363
363
  {
364
364
  "name": "focusMode",
365
365
  "type": "'auto' | 'roving' | 'activedescendant'",
366
366
  "defaultValue": "auto",
367
367
  "appliesTo": "Tree",
368
- "description": "How the keyboard position is expressed. auto answers activedescendant while windowed"
368
+ "description": "How the position of the keyboard is expressed. auto is activedescendant while virtual and a roving tab stop otherwise."
369
369
  },
370
370
  {
371
371
  "name": "guides",
372
372
  "type": "boolean",
373
373
  "defaultValue": "true",
374
374
  "appliesTo": "Tree",
375
- "description": "Whether the lines that say which parent a row belongs to are drawn"
375
+ "description": "Whether the lines that tie a row to its parent are drawn."
376
376
  },
377
377
  {
378
378
  "name": "loop",
379
379
  "type": "boolean",
380
380
  "defaultValue": "false",
381
381
  "appliesTo": "Tree",
382
- "description": "Whether the arrows wrap past the ends"
382
+ "description": "Whether the arrow keys wrap past the first and the last node."
383
383
  },
384
384
  {
385
385
  "name": "typeahead",
386
386
  "type": "boolean",
387
387
  "defaultValue": "true",
388
388
  "appliesTo": "Tree",
389
- "description": "Whether typing a name moves the keyboard to it"
389
+ "description": "Whether typing a name moves the keyboard to the node that starts with it."
390
390
  },
391
391
  {
392
392
  "name": "typeaheadTimeout",
393
393
  "type": "number",
394
394
  "defaultValue": "500",
395
395
  "appliesTo": "Tree",
396
- "description": "Milliseconds of silence before a new search begins"
396
+ "description": "The milliseconds of silence that start a new typeahead search."
397
397
  },
398
398
  {
399
399
  "name": "selectOnFocus",
400
400
  "type": "boolean",
401
401
  "defaultValue": "false",
402
402
  "appliesTo": "Tree",
403
- "description": "Whether moving the keyboard also chooses"
403
+ "description": "Whether moving the keyboard also chooses the node it lands on."
404
404
  },
405
405
  {
406
406
  "name": "navigateDisabled",
407
407
  "type": "boolean",
408
408
  "defaultValue": "false",
409
409
  "appliesTo": "Tree",
410
- "description": "Whether the arrows land on a disabled node"
410
+ "description": "Whether the arrow keys land on a disabled node."
411
411
  },
412
412
  {
413
413
  "name": "disallowEmptySelection",
414
414
  "type": "boolean",
415
415
  "defaultValue": "false",
416
416
  "appliesTo": "Tree",
417
- "description": "Whether the last chosen node may be unchosen"
417
+ "description": "Whether the last chosen node stays chosen when it is pressed again."
418
418
  },
419
419
  {
420
420
  "name": "disallowSelectAll",
421
421
  "type": "boolean",
422
422
  "defaultValue": "false",
423
423
  "appliesTo": "Tree",
424
- "description": "Whether Control and A may take the whole set"
424
+ "description": "Whether Control+A is kept from choosing every visible node."
425
425
  },
426
426
  {
427
427
  "name": "pageSize",
428
428
  "type": "number",
429
429
  "defaultValue": "10",
430
430
  "appliesTo": "Tree",
431
- "description": "How far the page keys travel"
431
+ "description": "How many nodes Page Up and Page Down move by."
432
432
  },
433
433
  {
434
434
  "name": "virtual",
435
435
  "type": "boolean",
436
436
  "defaultValue": "false",
437
437
  "appliesTo": "Tree",
438
- "description": "Whether only the rows the viewport covers are rendered"
438
+ "description": "Whether only the rows in view are rendered. It needs nodes and itemSize, and it lays the rows flat."
439
439
  },
440
440
  {
441
441
  "name": "itemSize",
442
442
  "type": "number",
443
443
  "defaultValue": "32",
444
444
  "appliesTo": "Tree",
445
- "description": "The block size of one row, in pixels. Required whenever virtual"
445
+ "description": "The height of one row in pixels, read while virtual."
446
446
  },
447
447
  {
448
448
  "name": "overscan",
449
449
  "type": "number",
450
450
  "defaultValue": "4",
451
451
  "appliesTo": "Tree",
452
- "description": "Rows rendered either side of the viewport"
452
+ "description": "How many rows are rendered on each side of the rows in view, while virtual."
453
453
  },
454
454
  {
455
455
  "name": "disabled",
456
456
  "type": "boolean",
457
457
  "defaultValue": "false",
458
458
  "appliesTo": "Tree",
459
- "description": "Whether the whole tree refuses the reader"
459
+ "description": "Whether the whole tree is disabled."
460
460
  },
461
461
  {
462
462
  "name": "readOnly",
463
463
  "type": "boolean",
464
464
  "defaultValue": "false",
465
465
  "appliesTo": "Tree",
466
- "description": "Whether the tree may be read and not moved"
466
+ "description": "Whether the selection is fixed while the tree can still be opened and walked."
467
467
  },
468
468
  {
469
469
  "name": "required",
470
470
  "type": "boolean",
471
471
  "defaultValue": "false",
472
472
  "appliesTo": "Tree",
473
- "description": "Whether a choice is required of the form around it"
473
+ "description": "Whether the tree states that a choice is required."
474
474
  },
475
475
  {
476
476
  "name": "invalid",
477
477
  "type": "boolean",
478
478
  "defaultValue": "false",
479
479
  "appliesTo": "Tree",
480
- "description": "Whether the tree is in error"
480
+ "description": "Whether the tree is drawn and announced as being in error."
481
481
  },
482
482
  {
483
483
  "name": "loading",
484
484
  "type": "boolean",
485
485
  "defaultValue": "false",
486
486
  "appliesTo": "Tree",
487
- "description": "Whether the set is still arriving. Writes aria-busy"
487
+ "description": "Whether the nodes of the tree are still arriving. It writes aria-busy on the tree."
488
488
  },
489
489
  {
490
490
  "name": "name",
491
491
  "type": "string",
492
492
  "defaultValue": "—",
493
493
  "appliesTo": "Tree",
494
- "description": "Submits one hidden input per chosen key"
494
+ "description": "The form name. The tree renders one hidden input per chosen key under it."
495
495
  },
496
496
  {
497
497
  "name": "nodes",
498
498
  "type": "readonly T[]",
499
499
  "defaultValue": "—",
500
500
  "appliesTo": "Tree",
501
- "description": "The hierarchy the tree holds. What a cascade, expandAll and the filter read"
501
+ "description": "The hierarchy the tree renders. selectionCascade, expandAll, query and virtual read it."
502
502
  },
503
503
  {
504
504
  "name": "getKey",
505
505
  "type": "(node: T) => string",
506
506
  "defaultValue": "—",
507
507
  "appliesTo": "Tree",
508
- "description": "The identity that survives a reorder"
508
+ "description": "Returns the key of a node. It is required with nodes."
509
509
  },
510
510
  {
511
511
  "name": "getLabel",
512
512
  "type": "(node: T) => string",
513
513
  "defaultValue": "—",
514
514
  "appliesTo": "Tree",
515
- "description": "What the reader sees and what typeahead matches"
515
+ "description": "Returns the name of a node, which is what the row shows and what typeahead and query match."
516
516
  },
517
517
  {
518
518
  "name": "getChildren",
519
519
  "type": "(node: T) => readonly T[] | undefined",
520
520
  "defaultValue": "—",
521
521
  "appliesTo": "Tree",
522
- "description": "The children, in the nested shape"
522
+ "description": "Returns the children of a node, for a nested hierarchy."
523
523
  },
524
524
  {
525
525
  "name": "getLevel",
526
526
  "type": "(node: T) => number",
527
527
  "defaultValue": "—",
528
528
  "appliesTo": "Tree",
529
- "description": "The depth, in the already-flat shape a rowset backend returns"
529
+ "description": "Returns the depth of a node, for nodes that arrive as a flat list in reading order."
530
530
  },
531
531
  {
532
532
  "name": "hasChildren",
533
533
  "type": "(node: T) => boolean",
534
534
  "defaultValue": "—",
535
535
  "appliesTo": "Tree",
536
- "description": "Whether a node is a branch before it can prove it"
536
+ "description": "Returns whether a node is a branch before its children have arrived."
537
537
  },
538
538
  {
539
539
  "name": "getChildrenCount",
540
540
  "type": "(node: T) => number | undefined",
541
541
  "defaultValue": "—",
542
542
  "appliesTo": "Tree",
543
- "description": "How many children will arrive, which draws the placeholder"
543
+ "description": "Returns how many children a branch will have. Until all of them arrive, the ones present state the size of the whole set."
544
544
  },
545
545
  {
546
546
  "name": "isNodeDisabled",
547
547
  "type": "(node: T) => boolean",
548
548
  "defaultValue": "—",
549
549
  "appliesTo": "Tree",
550
- "description": "Which nodes refuse the reader"
550
+ "description": "Returns whether a node is disabled."
551
551
  },
552
552
  {
553
553
  "name": "isNodeLoading",
554
554
  "type": "(node: T) => boolean",
555
555
  "defaultValue": "—",
556
556
  "appliesTo": "Tree",
557
- "description": "Which branches are fetching their children"
557
+ "description": "Returns whether the children of a node are arriving."
558
558
  },
559
559
  {
560
- "name": "renderNode",
561
- "type": "(node: T, key: string) => ReactNode",
560
+ "name": "query",
561
+ "type": "string",
562
562
  "defaultValue": "—",
563
563
  "appliesTo": "Tree",
564
- "description": "The content of one row. The family renders the row around it"
564
+ "description": "The text the tree filters nodes by. The field it is typed into is yours."
565
565
  },
566
566
  {
567
- "name": "query",
568
- "type": "string",
567
+ "name": "renderCells",
568
+ "type": "(node: T, key: string) => TreeNodeCells",
569
+ "defaultValue": "—",
570
+ "appliesTo": "Tree",
571
+ "description": "Returns the icon, label, description, meta and actions of one row of nodes. A cell left out is not drawn, and a label left out is the name getLabel returns."
572
+ },
573
+ {
574
+ "name": "messages",
575
+ "type": "PartialMessages<TreeMessages>",
569
576
  "defaultValue": "—",
570
577
  "appliesTo": "Tree",
571
- "description": "What the tree filters by. The consumer owns the string and the field"
578
+ "description": "The words the tree announces, over the ones of the language in force."
572
579
  },
573
580
  {
574
581
  "name": "emptyContent",
575
582
  "type": "ReactNode",
576
583
  "defaultValue": "—",
577
584
  "appliesTo": "Tree",
578
- "description": "What the tree shows when it holds nothing"
585
+ "description": "What the tree shows when it holds no node or the query matches none."
579
586
  },
580
587
  {
581
588
  "name": "render",
582
589
  "type": "(props: TreeRootProps) => ReactNode",
583
590
  "defaultValue": "—",
584
591
  "appliesTo": "Tree",
585
- "description": "Substitutes the element the root renders"
592
+ "description": "Renders the root as another element."
586
593
  },
587
594
  {
588
595
  "name": "handleRef",
589
596
  "type": "Ref<TreeHandle>",
590
597
  "defaultValue": "—",
591
598
  "appliesTo": "Tree",
592
- "description": "focus, scrollToKey, expand, collapse, expandAll, collapseAll, getActiveKey, getElement"
599
+ "description": "The imperative handle: focus, scrollToKey, expand, collapse, expandAll, collapseAll, getActiveKey and getElement."
593
600
  },
594
601
  {
595
602
  "name": "label",
596
603
  "type": "ReactNode",
597
604
  "defaultValue": "—",
598
605
  "appliesTo": "TreeNode",
599
- "description": "The node's name, and what names it"
606
+ "description": "The name of the node, which is also its accessible name."
600
607
  },
601
608
  {
602
609
  "name": "description",
603
610
  "type": "ReactNode",
604
611
  "defaultValue": "—",
605
612
  "appliesTo": "TreeNode",
606
- "description": "A second line beside the name"
613
+ "description": "A second, muted text after the name. It is hidden when the tree is narrower than 240 pixels."
607
614
  },
608
615
  {
609
616
  "name": "icon",
610
617
  "type": "ReactNode",
611
618
  "defaultValue": "—",
612
619
  "appliesTo": "TreeNode",
613
- "description": "The leading picture, which the consumer owns whole"
620
+ "description": "The leading icon. One node with an icon reserves the same cell on every row."
614
621
  },
615
622
  {
616
623
  "name": "meta",
617
624
  "type": "ReactNode",
618
625
  "defaultValue": "—",
619
626
  "appliesTo": "TreeNode",
620
- "description": "The trailing count, size or badge"
627
+ "description": "The trailing count, size or badge."
621
628
  },
622
629
  {
623
630
  "name": "actions",
624
631
  "type": "ReactNode",
625
632
  "defaultValue": "—",
626
633
  "appliesTo": "TreeNode",
627
- "description": "The trailing controls, which stay reachable"
634
+ "description": "The trailing controls. A press on one of them does not choose or open the row."
628
635
  },
629
636
  {
630
637
  "name": "textValue",
631
638
  "type": "string",
632
639
  "defaultValue": "—",
633
640
  "appliesTo": "TreeNode",
634
- "description": "What typeahead matches, when the label is not plain text"
641
+ "description": "The text typeahead matches, for a label that is not plain text."
635
642
  },
636
643
  {
637
644
  "name": "match",
638
645
  "type": "'hit' | 'ancestor'",
639
646
  "defaultValue": "—",
640
647
  "appliesTo": "TreeNode",
641
- "description": "Whether a query matched this name or one below it"
648
+ "description": "Whether a query matched this node or one below it. The tree writes it on the rows of nodes; a tree you write by hand states it."
642
649
  },
643
650
  {
644
651
  "name": "pinned",
645
652
  "type": "boolean",
646
653
  "defaultValue": "—",
647
654
  "appliesTo": "TreeNode",
648
- "description": "Rendered at its own place on the canvas, outside the window"
655
+ "description": "Whether the node is placed outside the rows in view. The tree sets it while virtual."
649
656
  },
650
657
  {
651
658
  "name": "offset",
652
659
  "type": "number",
653
660
  "defaultValue": "—",
654
661
  "appliesTo": "TreeNode",
655
- "description": "Where a pinned row sits on the canvas, in pixels"
662
+ "description": "Where a pinned row sits, in pixels. The tree sets it while virtual."
656
663
  },
657
664
  {
658
665
  "name": "depth",
659
666
  "type": "number",
660
667
  "defaultValue": "—",
661
668
  "appliesTo": "TreeNode",
662
- "description": "Stated only by the flat shape; elsewhere the markup says it"
669
+ "description": "The depth of the node in the flat structure. Elsewhere the markup states it."
663
670
  }
664
671
  ],
665
672
  "composition": [
@@ -668,73 +675,75 @@
668
675
  "type": "{ size, variant, expandOn, … }",
669
676
  "defaultValue": "—",
670
677
  "appliesTo": "a subtree",
671
- "description": "Sets twenty-one axes once for every tree under it. An explicit prop still wins"
678
+ "description": "Sets the axes once for every tree under it. A prop on a tree still wins."
672
679
  },
673
680
  {
674
681
  "name": "render",
675
682
  "type": "(props) => ReactNode",
676
683
  "defaultValue": "—",
677
684
  "appliesTo": "Tree, TreeNode",
678
- "description": "Renders the part into another element, keeping every attribute and handler it was given"
685
+ "description": "Renders the part as another element with the attributes and handlers it receives."
679
686
  },
680
687
  {
681
688
  "name": "label, description, icon, meta, actions",
682
689
  "type": "ReactNode",
683
690
  "defaultValue": "—",
684
691
  "appliesTo": "TreeNode",
685
- "description": "The cells of a row, each one whatever the consumer renders. The family owns no folder glyph of its own"
692
+ "description": "The cells of a row written by hand. Each takes any content."
686
693
  },
687
694
  {
688
695
  "name": "handleRef",
689
696
  "type": "Ref<TreeHandle>",
690
697
  "defaultValue": "—",
691
698
  "appliesTo": "Tree",
692
- "description": "focus, scrollToKey, expand, collapse, expandAll, collapseAll, getActiveKey and getElement — the actions a consumer cannot express declaratively"
699
+ "description": "Reaches focus, scrollToKey, expand, collapse, expandAll, collapseAll, getActiveKey and getElement."
693
700
  },
694
701
  {
695
702
  "name": "onClick",
696
703
  "type": "(event: MouseEvent) => void",
697
704
  "defaultValue": "—",
698
705
  "appliesTo": "TreeNode",
699
- "description": "Runs before the family acts, and preventDefault stops it. Every handler composes rather than replaces"
706
+ "description": "Runs before the row acts, and preventDefault keeps the row from acting."
700
707
  },
701
708
  {
702
709
  "name": "data-expanded, data-selected, data-loading",
703
710
  "type": "attribute",
704
711
  "defaultValue": "—",
705
712
  "appliesTo": "the node",
706
- "description": "Every state the contract declares is in the DOM, so an icon can be swapped by state in CSS alone with no prop for it"
713
+ "description": "The state of a node in the DOM, which lets CSS change an icon by state."
707
714
  }
708
715
  ],
709
716
  "events": [
710
717
  {
711
718
  "name": "onValueChange",
712
719
  "payload": "(value: string | readonly string[] | null, request: ChangeRequest)",
713
- "when": "Before the selection moves. The value is one key in single and none, and the set in multiple. The request carries the value it replaces, the reason — pointer, keyboard, select, clear or programmatic — the originating event, and cancel()."
720
+ "when": "Before the selection changes. The value is one key, or the set in multiple. The request carries the previous value, the reason (pointer, keyboard, select, clear or programmatic), the originating event and cancel()."
714
721
  },
715
722
  {
716
723
  "name": "onExpandedKeysChange",
717
724
  "payload": "(keys: readonly string[], request: ChangeRequest)",
718
- "when": "Before a branch opens or closes. Reasons: pointer, keyboard, programmatic. A filter is not among them: it holds a path open without moving the set."
725
+ "when": "Before a branch opens or closes. The reasons are pointer, keyboard and programmatic. A query holds branches open without this event."
719
726
  },
720
727
  {
721
728
  "name": "onActiveKeyChange",
722
729
  "payload": "(key: string | null, request: ChangeRequest)",
723
- "when": "Before the node the keyboard is on moves. Reasons: pointer, keyboard, programmatic. Closing a branch that holds the active node emits this first, so the pair stays coherent."
730
+ "when": "Before the keyboard moves to another node. The reasons are pointer, keyboard and programmatic. Closing a branch that holds the active node emits this event first."
724
731
  },
725
732
  {
726
733
  "name": "onNodeActivate",
727
734
  "payload": "(key: string, reason: 'pointer' | 'keyboard')",
728
- "when": "When a node is pressed, or Enter is pressed on it. It is not the selection: a navigation tree opens a page here and chooses nothing."
735
+ "when": "When a node is pressed, or Enter is pressed on it. Use it to open what the node stands for; it does not depend on the selection."
729
736
  }
730
737
  ],
731
738
  "accessibility": [
732
- "The tree carries its own accessible name, which the pattern requires: aria-label or aria-labelledby reaches the element with role=\"tree\".",
733
- "Each node is named by its own label through aria-labelledby, because a treeitem contains the group holding its children and a name computed from its contents is the whole subtree read aloud.",
734
- "aria-expanded is on branches and never on leaves: a leaf carrying it is announced as a parent.",
735
- "Selection is stated with aria-selected or with aria-checked and never with both, which the pattern allows only under three conditions it calls extremely rare.",
736
- "aria-level, aria-setsize and aria-posinset are written only while the rows are flat — the condition the pattern names — because the nesting is what the browser computes them from otherwise.",
737
- "The whole tree is one tab stop. Focus lands on the chosen node when there is one and on the first node otherwise, and a windowed tree keeps the active node in the document rather than letting a recycled row take it away."
739
+ "The tree takes its accessible name from aria-label or aria-labelledby, which reach the element with role=\"tree\".",
740
+ "Each node is named by its own label through aria-labelledby. A treeitem contains its children, so a name computed from its contents would be everything under it.",
741
+ "aria-expanded is written on branches and never on leaves, which would otherwise be announced as parents.",
742
+ "Selection is stated with aria-selected under the highlight and with aria-checked under the checkbox, and never with both.",
743
+ "aria-level, aria-setsize and aria-posinset are written while the rows are flat. A nested tree leaves them to the browser, except on the children of a branch that is still missing some of them.",
744
+ "The whole tree is one tab stop. Focus lands on the chosen node when there is one and on the first node otherwise, and a virtual tree keeps the active node in the document.",
745
+ "A control in the trailing cell of a row is a tab stop of its own and receives its own keys.",
746
+ "A branch whose children are arriving has aria-busy, and a polite live region announces the branch and how many items arrived."
738
747
  ]
739
748
  }
740
749
  },
@@ -832,8 +841,8 @@
832
841
  "title": "Opening and closing a branch",
833
842
  "note": "The row opens the branch by default; the second tree gives that job to the chevron alone. Press each of them, then use the sideways arrows on both.",
834
843
  "language": "tsx",
835
- "source": "<Tree aria-label=\"Files\" expandOn=\"expander\" defaultExpandedKeys={['src']}>\n {nodes}\n</Tree>;\n",
836
- "verdict": "excerpt"
844
+ "source": "import { Grid } from '@slotted/react/grid';\nimport { Stack } from '@slotted/react/stack';\nimport { Tree } from '@slotted/react/tree';\nimport { Text } from '@slotted/react/typography';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeExpansion() {\n return (\n <Grid columns={2} gap={6} minItemWidth=\"xs\">\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n The whole row\n </Text>\n <Tree\n aria-label=\"Categories, opened by the row\"\n defaultExpandedKeys={['beverages']}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n The chevron alone\n </Text>\n <Tree\n aria-label=\"Categories, opened by the chevron\"\n expandOn=\"expander\"\n defaultExpandedKeys={['beverages']}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n </Stack>\n </Grid>\n );\n}\n",
845
+ "verdict": "example"
837
846
  },
838
847
  {
839
848
  "id": "selection",
@@ -848,24 +857,24 @@
848
857
  "title": "A branch that takes its descendants with it",
849
858
  "note": "Press the folder and watch every enabled file under it follow, including the ones inside a branch that is closed. The locked file is left exactly where it was.",
850
859
  "language": "tsx",
851
- "source": "<Tree\n aria-label=\"Permissions\"\n selectionMode=\"multiple\"\n selectionCascade=\"descendants\"\n nodes={roots}\n getKey={(node) => node.id}\n getLabel={(node) => node.name}\n getChildren={(node) => node.children}\n/>;\n",
852
- "verdict": "excerpt"
860
+ "source": "import { Tree } from '@slotted/react/tree';\n\ninterface Scope {\n id: string;\n name: string;\n locked?: boolean;\n children?: Scope[];\n}\n\nconst SCOPES: Scope[] = [\n {\n id: 'orders',\n name: 'Orders',\n children: [\n { id: 'orders.view', name: 'View orders' },\n { id: 'orders.edit', name: 'Edit orders' },\n { id: 'orders.refund', name: 'Issue refunds' },\n ],\n },\n {\n id: 'finance',\n name: 'Finance',\n children: [\n { id: 'finance.invoices', name: 'View invoices' },\n { id: 'finance.payouts', name: 'Approve payouts', locked: true },\n ],\n },\n { id: 'reports', name: 'Reports' },\n];\n\nexport default function TreeCascade() {\n return (\n <Tree\n aria-label=\"Role permissions\"\n selectionCascade=\"descendants\"\n selectionMode=\"multiple\"\n expandOn=\"expander\"\n defaultExpandedKeys={['orders', 'finance']}\n defaultValue={['orders.view']}\n isNodeDisabled={(scope) => scope.locked === true}\n nodes={SCOPES}\n getKey={(scope) => scope.id}\n getLabel={(scope) => scope.name}\n getChildren={(scope) => scope.children}\n />\n );\n}\n",
861
+ "verdict": "example"
853
862
  },
854
863
  {
855
864
  "id": "indicator",
856
865
  "title": "How the selection is said",
857
866
  "note": "The same value under the two indicators. The box states aria-checked and is the box the checkbox family draws; the highlight states aria-selected and spends no cell at all.",
858
867
  "language": "tsx",
859
- "source": "<Tree aria-label=\"Files\" selectionIndicator=\"checkbox\" defaultValue=\"index.ts\">\n {nodes}\n</Tree>;\n",
860
- "verdict": "excerpt"
868
+ "source": "import { Tree } from '@slotted/react/tree';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeIndicator() {\n return (\n <Tree\n aria-label=\"Default category\"\n selectionIndicator=\"checkbox\"\n defaultExpandedKeys={['beverages']}\n defaultValue=\"tea\"\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n );\n}\n",
869
+ "verdict": "example"
861
870
  },
862
871
  {
863
872
  "id": "guides",
864
873
  "title": "The lines that say which parent a row belongs to",
865
874
  "note": "Depth four with the guides on and off. Each line sits under the chevron of the level above it, at one distance from the row it belongs to, at every size.",
866
875
  "language": "tsx",
867
- "source": "<Tree aria-label=\"Packages\" guides={false} defaultExpandedKeys={['a', 'b', 'c']}>\n {nodes}\n</Tree>;\n",
868
- "verdict": "excerpt"
876
+ "source": "import { Grid } from '@slotted/react/grid';\nimport { Tree } from '@slotted/react/tree';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeGuides() {\n return (\n <Grid columns={2} gap={6} minItemWidth=\"xs\">\n <Tree\n aria-label=\"Categories with guides\"\n defaultExpandedKeys={['pantry', 'spices']}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n <Tree\n aria-label=\"Categories without guides\"\n guides={false}\n defaultExpandedKeys={['pantry', 'spices']}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n </Grid>\n );\n}\n",
877
+ "verdict": "example"
869
878
  },
870
879
  {
871
880
  "id": "size",
@@ -888,8 +897,8 @@
888
897
  "title": "Every state a row can be in",
889
898
  "note": "At rest, hovered, where the keyboard is, chosen, both at once, out of reach, and fetching. Chosen outranks the keyboard, and disabled outranks everything.",
890
899
  "language": "tsx",
891
- "source": "<TreeNode value=\"payroll\" label=\"Payroll\" description=\"no access\" disabled />;\n",
892
- "verdict": "excerpt"
900
+ "source": "import { Grid } from '@slotted/react/grid';\nimport { Stack } from '@slotted/react/stack';\nimport { Tree } from '@slotted/react/tree';\nimport { Text } from '@slotted/react/typography';\n\ninterface Scope {\n id: string;\n name: string;\n locked?: boolean;\n children?: Scope[];\n}\n\nconst SCOPES: Scope[] = [\n {\n id: 'orders',\n name: 'Orders',\n children: [\n { id: 'orders.view', name: 'View orders' },\n { id: 'orders.edit', name: 'Edit orders' },\n { id: 'orders.refund', name: 'Issue refunds' },\n ],\n },\n {\n id: 'finance',\n name: 'Finance',\n children: [\n { id: 'finance.invoices', name: 'View invoices' },\n { id: 'finance.payouts', name: 'Approve payouts', locked: true },\n ],\n },\n { id: 'reports', name: 'Reports' },\n];\n\nexport default function TreeStates() {\n return (\n <Grid columns={2} gap={6} minItemWidth=\"xs\">\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n One node disabled\n </Text>\n <Tree\n aria-label=\"Permissions, one node disabled\"\n isNodeDisabled={(scope) => scope.locked === true}\n selectionMode=\"multiple\"\n defaultExpandedKeys={['finance']}\n defaultValue={['finance.invoices']}\n nodes={SCOPES}\n getKey={(scope) => scope.id}\n getLabel={(scope) => scope.name}\n getChildren={(scope) => scope.children}\n />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Read only\n </Text>\n <Tree\n aria-label=\"Permissions, read only\"\n readOnly\n selectionMode=\"multiple\"\n defaultExpandedKeys={['finance']}\n defaultValue={['finance.invoices']}\n nodes={SCOPES}\n getKey={(scope) => scope.id}\n getLabel={(scope) => scope.name}\n getChildren={(scope) => scope.children}\n />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Disabled\n </Text>\n <Tree\n aria-label=\"Permissions, disabled\"\n disabled\n selectionMode=\"multiple\"\n defaultExpandedKeys={['finance']}\n defaultValue={['finance.invoices']}\n nodes={SCOPES}\n getKey={(scope) => scope.id}\n getLabel={(scope) => scope.name}\n getChildren={(scope) => scope.children}\n />\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n Invalid\n </Text>\n <Tree\n aria-label=\"Permissions, invalid\"\n invalid\n variant=\"framed\"\n selectionMode=\"multiple\"\n defaultExpandedKeys={['finance']}\n defaultValue={['finance.invoices']}\n nodes={SCOPES}\n getKey={(scope) => scope.id}\n getLabel={(scope) => scope.name}\n getChildren={(scope) => scope.children}\n />\n </Stack>\n </Grid>\n );\n}\n",
901
+ "verdict": "example"
893
902
  },
894
903
  {
895
904
  "id": "empty-and-loading",
@@ -912,16 +921,16 @@
912
921
  "title": "Searching a tree without losing where things are",
913
922
  "note": "Type in the field. Every hit keeps its ancestors, the matched span is marked, and the path is held open for as long as the query lasts without moving the set the reader opened.",
914
923
  "language": "tsx",
915
- "source": "<>\n <TextField aria-label=\"Search\" value={query} onValueChange={setQuery} />\n <Tree\n aria-label=\"Files\"\n query={query}\n nodes={roots}\n getKey={(node) => node.id}\n getLabel={(node) => node.name}\n getChildren={(node) => node.children}\n />\n</>;\n",
916
- "verdict": "excerpt"
924
+ "source": "import { useState } from 'react';\nimport { Glyph, Icon } from '@slotted/react/icon';\nimport { Stack } from '@slotted/react/stack';\nimport { TextField } from '@slotted/react/text-field';\nimport { Tree } from '@slotted/react/tree';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeFiltering() {\n const [query, setQuery] = useState('spice');\n\n return (\n <Stack gap={3}>\n <TextField\n aria-label=\"Find a category\"\n clearable\n onValueChange={(next) => setQuery(next)}\n start={\n <Icon>\n <Glyph name=\"search\" />\n </Icon>\n }\n type=\"search\"\n value={query}\n />\n <Tree\n aria-label=\"Product categories\"\n emptyContent=\"No category matches\"\n query={query}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n </Stack>\n );\n}\n",
925
+ "verdict": "example"
917
926
  },
918
927
  {
919
928
  "id": "virtualization",
920
929
  "title": "Four thousand rows, and the ones on screen",
921
930
  "note": "Scroll it. Only the covered slice is rendered, the rows are laid flat with their level stated, and the node the keyboard is on stays in the document however far it is scrolled away.",
922
931
  "language": "tsx",
923
- "source": "<Tree\n aria-label=\"Regions\"\n virtual\n itemSize={32}\n nodes={roots}\n getKey={(node) => node.id}\n getLabel={(node) => node.name}\n getChildren={(node) => node.children}\n/>;\n",
924
- "verdict": "excerpt"
932
+ "source": "import { Tree } from '@slotted/react/tree';\n\ninterface OrderNode {\n id: string;\n name: string;\n children?: OrderNode[];\n}\n\nconst MONTHS: OrderNode[] = Array.from({ length: 24 }, (_, month) => {\n const id = `${2025 + Math.floor(month / 12)}-${String((month % 12) + 1).padStart(2, '0')}`;\n return {\n id,\n name: id,\n children: Array.from({ length: 150 }, (_entry, index) => ({\n id: `${id}-${index}`,\n name: `SO-${10000 + month * 150 + index}`,\n })),\n };\n});\n\nexport default function TreeVirtualization() {\n return (\n <Tree\n aria-label=\"Orders by month\"\n variant=\"framed\"\n virtual\n itemSize={34}\n defaultExpandedKeys={MONTHS.map((month) => month.id)}\n nodes={MONTHS}\n getKey={(node) => node.id}\n getLabel={(node) => node.name}\n getChildren={(node) => node.children}\n />\n );\n}\n",
933
+ "verdict": "example"
925
934
  },
926
935
  {
927
936
  "id": "content",
@@ -962,6 +971,174 @@
962
971
  "language": "tsx",
963
972
  "source": "<Tree aria-labelledby=\"files-heading\">{nodes}</Tree>;\n",
964
973
  "verdict": "excerpt"
974
+ },
975
+ {
976
+ "id": "access-editor",
977
+ "title": "access-editor.tsx",
978
+ "note": null,
979
+ "language": "tsx",
980
+ "source": "import { useState } from 'react';\nimport { Button } from '@slotted/react/button';\nimport { Glyph, Icon } from '@slotted/react/icon';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { TextField } from '@slotted/react/text-field';\nimport { Tree } from '@slotted/react/tree';\nimport { Text } from '@slotted/react/typography';\n\ninterface Scope {\n id: string;\n name: string;\n locked?: boolean;\n children?: Scope[];\n}\n\nconst SCOPES: Scope[] = [\n {\n id: 'orders',\n name: 'Orders',\n children: [\n { id: 'orders.view', name: 'View orders' },\n { id: 'orders.edit', name: 'Edit orders' },\n { id: 'orders.refund', name: 'Issue refunds' },\n ],\n },\n {\n id: 'finance',\n name: 'Finance',\n children: [\n { id: 'finance.invoices', name: 'View invoices' },\n { id: 'finance.payouts', name: 'Approve payouts', locked: true },\n ],\n },\n { id: 'reports', name: 'Reports' },\n];\n\nexport default function TreeAccessEditor() {\n const [query, setQuery] = useState('');\n const [granted, setGranted] = useState<readonly string[]>(['orders.view', 'finance.invoices']);\n const [saved, setSaved] = useState(granted);\n const permissions = granted.filter((key) => key.includes('.') || key === 'reports').length;\n\n return (\n <Stack gap={3}>\n <TextField\n aria-label=\"Find a permission\"\n clearable\n onValueChange={(next) => setQuery(next)}\n start={\n <Icon>\n <Glyph name=\"search\" />\n </Icon>\n }\n type=\"search\"\n value={query}\n />\n <Tree\n aria-label=\"Permissions of the support role\"\n emptyContent=\"No permission matches\"\n expandOn=\"expander\"\n variant=\"framed\"\n selectionCascade=\"descendants\"\n selectionMode=\"multiple\"\n defaultExpandedKeys={['orders', 'finance']}\n isNodeDisabled={(scope) => scope.locked === true}\n onValueChange={(next) => setGranted(next as readonly string[])}\n query={query}\n value={granted}\n renderCells={(scope) => ({ description: scope.locked ? 'Owners only' : undefined })}\n nodes={SCOPES}\n getKey={(scope) => scope.id}\n getLabel={(scope) => scope.name}\n getChildren={(scope) => scope.children}\n />\n <Inline align=\"center\" gap={3}>\n <Button disabled={saved === granted} onClick={() => setSaved(granted)}>\n Save role\n </Button>\n <Text role=\"status\" size=\"sm\" tone=\"muted\">\n {permissions} permissions granted\n </Text>\n </Inline>\n </Stack>\n );\n}\n",
981
+ "verdict": "example"
982
+ },
983
+ {
984
+ "id": "actions",
985
+ "title": "actions.tsx",
986
+ "note": null,
987
+ "language": "tsx",
988
+ "source": "import { useState } from 'react';\nimport { IconButton } from '@slotted/react/button';\nimport { Glyph } from '@slotted/react/icon';\nimport { Menu, MenuContent, MenuItem, MenuTrigger } from '@slotted/react/menu';\nimport { Stack } from '@slotted/react/stack';\nimport { Tree } from '@slotted/react/tree';\nimport { Text } from '@slotted/react/typography';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeActionsExample() {\n const [last, setLast] = useState('No action yet.');\n\n return (\n <Stack gap={3}>\n <Tree\n aria-label=\"Product categories\"\n defaultExpandedKeys={['beverages']}\n renderCells={(category) => ({\n actions: (\n <Menu align=\"end\">\n <MenuTrigger\n render={(props) => (\n <IconButton\n {...props}\n aria-label={`Actions for ${category.name}`}\n size=\"sm\"\n variant=\"ghost\"\n >\n <Glyph name=\"ellipsis\" />\n </IconButton>\n )}\n />\n <MenuContent>\n <MenuItem onSelect={() => setLast(`Rename ${category.name}.`)}>Rename…</MenuItem>\n <MenuItem onSelect={() => setLast(`Add a category under ${category.name}.`)}>\n Add a category\n </MenuItem>\n </MenuContent>\n </Menu>\n ),\n })}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n <Text role=\"status\" size=\"sm\" tone=\"muted\">\n {last}\n </Text>\n </Stack>\n );\n}\n",
989
+ "verdict": "example"
990
+ },
991
+ {
992
+ "id": "basic",
993
+ "title": "basic.tsx",
994
+ "note": null,
995
+ "language": "tsx",
996
+ "source": "import { Tree, TreeNode } from '@slotted/react/tree';\n\nexport default function TreeBasic() {\n return (\n <Tree aria-label=\"Product categories\" defaultExpandedKeys={['beverages']} defaultValue=\"coffee\">\n <TreeNode value=\"beverages\" label=\"Beverages\" meta=\"148\">\n <TreeNode value=\"coffee\" label=\"Coffee\" meta=\"62\" />\n <TreeNode value=\"tea\" label=\"Tea\" meta=\"54\" />\n <TreeNode value=\"soft-drinks\" label=\"Soft drinks\" meta=\"32\" />\n </TreeNode>\n <TreeNode value=\"pantry\" label=\"Pantry\" meta=\"231\">\n <TreeNode value=\"oils\" label=\"Oils and vinegars\" meta=\"87\" />\n <TreeNode value=\"spices\" label=\"Spices\" meta=\"144\" />\n </TreeNode>\n <TreeNode value=\"household\" label=\"Household\" meta=\"76\" />\n </Tree>\n );\n}\n",
997
+ "verdict": "example"
998
+ },
999
+ {
1000
+ "id": "catalog",
1001
+ "title": "catalog.tsx",
1002
+ "note": null,
1003
+ "language": "tsx",
1004
+ "source": "import { useState } from 'react';\nimport { Grid } from '@slotted/react/grid';\nimport { List, ListEmpty } from '@slotted/react/list';\nimport {\n ListItem,\n ListItemBody,\n ListItemContent,\n ListItemEnd,\n ListItemLabel,\n} from '@slotted/react/list-item';\nimport { Tree } from '@slotted/react/tree';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nconst PRODUCTS = [\n { sku: 'BEV-104', name: 'House blend, 1 kg', category: 'coffee' },\n { sku: 'BEV-131', name: 'Decaf espresso, 500 g', category: 'coffee' },\n { sku: 'BEV-220', name: 'Earl grey, 50 bags', category: 'tea' },\n { sku: 'BEV-305', name: 'Ginger ale, 24 cans', category: 'soft-drinks' },\n { sku: 'PAN-012', name: 'Olive oil, 5 L', category: 'oils' },\n { sku: 'PAN-118', name: 'Smoked paprika, 250 g', category: 'ground-spices' },\n];\n\nfunction keysUnder(categories: Category[], key: string, inside = false): string[] {\n return categories.flatMap((category) => {\n const here = inside || category.id === key;\n return [...(here ? [category.id] : []), ...keysUnder(category.children ?? [], key, here)];\n });\n}\n\nexport default function TreeCatalog() {\n const [category, setCategory] = useState('beverages');\n const keys = keysUnder(CATEGORIES, category);\n const products = PRODUCTS.filter((product) => keys.includes(product.category));\n\n return (\n <Grid columns={2} gap={6} minItemWidth=\"xs\">\n <Tree\n aria-label=\"Product categories\"\n disallowEmptySelection\n expandOn=\"expander\"\n defaultExpandedKeys={['beverages', 'pantry']}\n onValueChange={(next) => setCategory(String(next))}\n value={category}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n <List aria-label=\"Products\" variant=\"framed\">\n {products.length === 0 && <ListEmpty>No products in this category</ListEmpty>}\n {products.map((product) => (\n <ListItem key={product.sku}>\n <ListItemContent>\n <ListItemBody>\n <ListItemLabel>{product.name}</ListItemLabel>\n </ListItemBody>\n <ListItemEnd>{product.sku}</ListItemEnd>\n </ListItemContent>\n </ListItem>\n ))}\n </List>\n </Grid>\n );\n}\n",
1005
+ "verdict": "example"
1006
+ },
1007
+ {
1008
+ "id": "cells",
1009
+ "title": "cells.tsx",
1010
+ "note": null,
1011
+ "language": "tsx",
1012
+ "source": "import { Tree } from '@slotted/react/tree';\n\ninterface Location {\n id: string;\n name: string;\n units?: number;\n status?: string;\n children?: Location[];\n}\n\nconst LOCATIONS: Location[] = [\n {\n id: 'cmh',\n name: 'Columbus, OH',\n children: [\n { id: 'cmh-a', name: 'Zone A', units: 1840 },\n { id: 'cmh-b', name: 'Zone B', units: 920, status: 'Counting' },\n ],\n },\n {\n id: 'rno',\n name: 'Reno, NV',\n children: [\n { id: 'rno-a', name: 'Zone A', units: 2310 },\n { id: 'rno-cold', name: 'Cold storage', units: 415 },\n ],\n },\n];\n\nexport default function TreeCells() {\n return (\n <Tree\n aria-label=\"Stock locations\"\n defaultExpandedKeys={['cmh']}\n renderCells={(location) => ({\n description: location.status,\n meta: location.units?.toLocaleString('en-US') ?? `${location.children?.length ?? 0} zones`,\n })}\n nodes={LOCATIONS}\n getKey={(location) => location.id}\n getLabel={(location) => location.name}\n getChildren={(location) => location.children}\n />\n );\n}\n",
1013
+ "verdict": "example"
1014
+ },
1015
+ {
1016
+ "id": "controlled",
1017
+ "title": "controlled.tsx",
1018
+ "note": null,
1019
+ "language": "tsx",
1020
+ "source": "import { useState } from 'react';\nimport { Stack } from '@slotted/react/stack';\nimport { Tree, type TreeValue } from '@slotted/react/tree';\nimport { Text } from '@slotted/react/typography';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeControlled() {\n const [value, setValue] = useState<TreeValue>('tea');\n const [open, setOpen] = useState<readonly string[]>(['beverages']);\n\n return (\n <Stack gap={3}>\n <Tree\n aria-label=\"Product categories\"\n expandedKeys={open}\n onExpandedKeysChange={(keys) => setOpen(keys)}\n onValueChange={(next) => setValue(next)}\n value={value}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n <Text size=\"sm\" tone=\"muted\">\n Chosen: {value ?? 'none'}. Open: {open.join(', ') || 'none'}.\n </Text>\n </Stack>\n );\n}\n",
1021
+ "verdict": "example"
1022
+ },
1023
+ {
1024
+ "id": "defaults",
1025
+ "title": "defaults.tsx",
1026
+ "note": null,
1027
+ "language": "tsx",
1028
+ "source": "import { Grid } from '@slotted/react/grid';\nimport { Tree, TreeDefaultsProvider } from '@slotted/react/tree';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeDefaultsExample() {\n return (\n <TreeDefaultsProvider expandOn=\"expander\" guides={false} size=\"sm\">\n <Grid columns={2} gap={6} minItemWidth=\"xs\">\n <Tree\n aria-label=\"Categories\"\n defaultExpandedKeys={['beverages']}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n <Tree\n aria-label=\"Categories with guides\"\n guides\n defaultExpandedKeys={['beverages']}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n </Grid>\n </TreeDefaultsProvider>\n );\n}\n",
1029
+ "verdict": "example"
1030
+ },
1031
+ {
1032
+ "id": "empty",
1033
+ "title": "empty.tsx",
1034
+ "note": null,
1035
+ "language": "tsx",
1036
+ "source": "import { Tree } from '@slotted/react/tree';\n\nexport default function TreeEmpty() {\n return (\n <Tree\n aria-label=\"Archived categories\"\n variant=\"framed\"\n emptyContent=\"No archived categories\"\n nodes={[] as { id: string }[]}\n getKey={(category) => category.id}\n />\n );\n}\n",
1037
+ "verdict": "example"
1038
+ },
1039
+ {
1040
+ "id": "flat-rows",
1041
+ "title": "flat-rows.tsx",
1042
+ "note": null,
1043
+ "language": "tsx",
1044
+ "source": "import { Tree } from '@slotted/react/tree';\n\ninterface AccountRow {\n code: string;\n name: string;\n level: number;\n}\n\nconst CHART: AccountRow[] = [\n { code: '1000', name: 'Assets', level: 0 },\n { code: '1100', name: 'Cash and equivalents', level: 1 },\n { code: '1110', name: 'Operating account', level: 2 },\n { code: '1120', name: 'Payroll account', level: 2 },\n { code: '1200', name: 'Receivables', level: 1 },\n { code: '2000', name: 'Liabilities', level: 0 },\n { code: '2100', name: 'Payables', level: 1 },\n];\n\nexport default function TreeFlatRows() {\n return (\n <Tree\n aria-label=\"Chart of accounts\"\n defaultExpandedKeys={['1000', '1100']}\n nodes={CHART}\n getKey={(row) => row.code}\n getLabel={(row) => row.name}\n getLevel={(row) => row.level}\n renderCells={(row) => ({ meta: row.code })}\n />\n );\n}\n",
1045
+ "verdict": "example"
1046
+ },
1047
+ {
1048
+ "id": "form",
1049
+ "title": "form.tsx",
1050
+ "note": null,
1051
+ "language": "tsx",
1052
+ "source": "import { useState } from 'react';\nimport type { SubmitEvent } from 'react';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Tree } from '@slotted/react/tree';\nimport { Text } from '@slotted/react/typography';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeForm() {\n const [saved, setSaved] = useState<string | null>(null);\n\n function handleSubmit(event: SubmitEvent<HTMLFormElement>) {\n event.preventDefault();\n const chosen = new FormData(event.currentTarget).getAll('categories');\n setSaved(`Submitted ${chosen.length} categories.`);\n }\n\n return (\n <form onSubmit={handleSubmit}>\n <Stack gap={4}>\n <Tree\n aria-label=\"Categories in this feed\"\n name=\"categories\"\n selectionMode=\"multiple\"\n defaultExpandedKeys={['beverages']}\n defaultValue={['coffee', 'tea']}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n <Inline align=\"center\" gap={3}>\n <Button type=\"submit\">Save feed</Button>\n {saved && (\n <Text size=\"sm\" tone=\"muted\">\n {saved}\n </Text>\n )}\n </Inline>\n </Stack>\n </form>\n );\n}\n",
1053
+ "verdict": "example"
1054
+ },
1055
+ {
1056
+ "id": "icon-by-state",
1057
+ "title": "icon-by-state.tsx",
1058
+ "note": null,
1059
+ "language": "tsx",
1060
+ "source": "import { useState } from 'react';\nimport { Glyph, Icon } from '@slotted/react/icon';\nimport { Tree } from '@slotted/react/tree';\n\ninterface Entry {\n id: string;\n name: string;\n children?: Entry[];\n}\n\nconst FOLDERS: Entry[] = [\n {\n id: 'contracts',\n name: 'Contracts',\n children: [\n { id: 'contoso', name: 'Contoso Foods 2026.pdf' },\n { id: 'fabrikam', name: 'Fabrikam Supply 2026.pdf' },\n { id: 'atlas', name: 'Atlas Freight renewal.pdf' },\n ],\n },\n {\n id: 'forecasts',\n name: 'Forecasts',\n children: [\n { id: 'q3', name: 'Q3 demand.xlsx' },\n { id: 'q4', name: 'Q4 demand.xlsx' },\n ],\n },\n];\n\nconst FOLDER =\n 'M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z';\nconst FOLDER_OPEN =\n 'm6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2';\n\nfunction FolderIcon({ open }: { open: boolean }) {\n return (\n <Icon>\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n >\n <path d={open ? FOLDER_OPEN : FOLDER} />\n </svg>\n </Icon>\n );\n}\n\nexport default function TreeIconByState() {\n const [open, setOpen] = useState<readonly string[]>(['contracts']);\n\n return (\n <Tree\n aria-label=\"Documents\"\n expandedKeys={open}\n onExpandedKeysChange={(keys) => setOpen(keys)}\n renderCells={(entry) => ({\n icon: entry.children ? (\n <FolderIcon open={open.includes(entry.id)} />\n ) : (\n <Icon>\n <Glyph name=\"file-text\" />\n </Icon>\n ),\n })}\n nodes={FOLDERS}\n getKey={(entry) => entry.id}\n getLabel={(entry) => entry.name}\n getChildren={(entry) => entry.children}\n />\n );\n}\n",
1061
+ "verdict": "example"
1062
+ },
1063
+ {
1064
+ "id": "lazy",
1065
+ "title": "lazy.tsx",
1066
+ "note": null,
1067
+ "language": "tsx",
1068
+ "source": "import { useState } from 'react';\nimport { Tree } from '@slotted/react/tree';\n\ninterface Account {\n id: string;\n name: string;\n orders?: number;\n children?: Account[];\n}\n\nconst ACCOUNTS: Account[] = [\n { id: 'contoso', name: 'Contoso Foods', orders: 3 },\n { id: 'fabrikam', name: 'Fabrikam Supply', orders: 2 },\n { id: 'atlas', name: 'Atlas Freight' },\n];\n\nconst ORDERS: Record<string, Account[]> = {\n contoso: [\n { id: 'SO-10482', name: 'SO-10482' },\n { id: 'SO-10496', name: 'SO-10496' },\n { id: 'SO-10511', name: 'SO-10511' },\n ],\n fabrikam: [\n { id: 'SO-10484', name: 'SO-10484' },\n { id: 'SO-10502', name: 'SO-10502' },\n ],\n};\n\nexport default function TreeLazy() {\n const [accounts, setAccounts] = useState(ACCOUNTS);\n const [open, setOpen] = useState<readonly string[]>([]);\n const [pending, setPending] = useState<readonly string[]>([]);\n\n function handleOpen(keys: readonly string[]) {\n setOpen(keys);\n for (const key of keys.filter((candidate) => !open.includes(candidate))) fetchOrders(key);\n }\n\n function fetchOrders(key: string) {\n const account = accounts.find((candidate) => candidate.id === key);\n if (account === undefined || account.children !== undefined || pending.includes(key)) return;\n\n setPending((current) => [...current, key]);\n setTimeout(() => {\n setAccounts((current) =>\n current.map((entry) =>\n entry.id === key ? { ...entry, children: ORDERS[key] ?? [] } : entry,\n ),\n );\n setPending((current) => current.filter((candidate) => candidate !== key));\n }, 1200);\n }\n\n return (\n <Tree\n aria-label=\"Orders by account\"\n expandedKeys={open}\n onExpandedKeysChange={(keys) => handleOpen(keys)}\n getChildrenCount={(account) => account.orders}\n hasChildren={(account) => account.orders !== undefined}\n isNodeLoading={(account) => pending.includes(account.id)}\n nodes={accounts}\n getKey={(account) => account.id}\n getLabel={(account) => account.name}\n getChildren={(account) => account.children}\n />\n );\n}\n",
1069
+ "verdict": "example"
1070
+ },
1071
+ {
1072
+ "id": "loading",
1073
+ "title": "loading.tsx",
1074
+ "note": null,
1075
+ "language": "tsx",
1076
+ "source": "import { useEffect, useState } from 'react';\nimport { Button } from '@slotted/react/button';\nimport { Skeleton, SkeletonRegion } from '@slotted/react/skeleton';\nimport { Stack } from '@slotted/react/stack';\nimport { Tree, TreeNode } from '@slotted/react/tree';\n\nconst ROWS = [\n { id: 'cmh', name: 'Columbus, OH' },\n { id: 'rno', name: 'Reno, NV' },\n { id: 'sav', name: 'Savannah, GA' },\n { id: 'dfw', name: 'Dallas, TX' },\n];\n\nexport default function TreeLoading() {\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n if (!loading) return;\n const timer = setTimeout(() => setLoading(false), 1500);\n return () => clearTimeout(timer);\n }, [loading]);\n\n return (\n <Stack align=\"start\" gap={3}>\n <Button size=\"sm\" variant=\"outline\" onClick={() => setLoading(true)}>\n Refresh locations\n </Button>\n <SkeletonRegion\n delay={200}\n loading={loading}\n messages={{ label: 'Loading locations' }}\n minDuration={400}\n >\n <Tree aria-label=\"Stock locations\" loading={loading}>\n {ROWS.map((row) => (\n <TreeNode\n hasChildren\n key={row.id}\n label={loading ? <Skeleton /> : row.name}\n textValue={row.name}\n value={row.id}\n />\n ))}\n </Tree>\n </SkeletonRegion>\n </Stack>\n );\n}\n",
1077
+ "verdict": "example"
1078
+ },
1079
+ {
1080
+ "id": "multiple",
1081
+ "title": "multiple.tsx",
1082
+ "note": null,
1083
+ "language": "tsx",
1084
+ "source": "import { Tree } from '@slotted/react/tree';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeMultiple() {\n return (\n <Tree\n aria-label=\"Categories on promotion\"\n selectionMode=\"multiple\"\n defaultExpandedKeys={['beverages', 'pantry']}\n defaultValue={['coffee', 'oils']}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n );\n}\n",
1085
+ "verdict": "example"
1086
+ },
1087
+ {
1088
+ "id": "navigation",
1089
+ "title": "navigation.tsx",
1090
+ "note": null,
1091
+ "language": "tsx",
1092
+ "source": "import { useState } from 'react';\nimport { Stack } from '@slotted/react/stack';\nimport { Tree } from '@slotted/react/tree';\nimport { Text } from '@slotted/react/typography';\n\ninterface Page {\n id: string;\n name: string;\n children?: Page[];\n}\n\nconst PAGES: Page[] = [\n {\n id: 'inventory',\n name: 'Inventory',\n children: [\n { id: 'stock', name: 'Stock levels' },\n { id: 'transfers', name: 'Transfers' },\n { id: 'counts', name: 'Cycle counts' },\n ],\n },\n {\n id: 'purchasing',\n name: 'Purchasing',\n children: [\n { id: 'orders', name: 'Purchase orders' },\n { id: 'suppliers', name: 'Suppliers' },\n ],\n },\n];\n\nconst NAMES = new Map(\n PAGES.flatMap((page) => [page, ...(page.children ?? [])]).map((page) => [page.id, page.name]),\n);\n\nexport default function TreeNavigation() {\n const [page, setPage] = useState('stock');\n\n return (\n <Stack gap={3}>\n <Tree\n aria-label=\"Help center\"\n expandOn=\"expander\"\n selectionMode=\"none\"\n defaultActiveKey=\"stock\"\n defaultExpandedKeys={['inventory']}\n onNodeActivate={setPage}\n nodes={PAGES}\n getKey={(entry) => entry.id}\n getLabel={(entry) => entry.name}\n getChildren={(entry) => entry.children}\n />\n <Text role=\"status\" size=\"sm\" tone=\"muted\">\n Open page: {NAMES.get(page)}\n </Text>\n </Stack>\n );\n}\n",
1093
+ "verdict": "example"
1094
+ },
1095
+ {
1096
+ "id": "nodes",
1097
+ "title": "nodes.tsx",
1098
+ "note": null,
1099
+ "language": "tsx",
1100
+ "source": "import { useRef } from 'react';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Tree, type TreeHandle } from '@slotted/react/tree';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeNodes() {\n const tree = useRef<TreeHandle>(null);\n\n return (\n <Stack gap={3}>\n <Inline gap={2}>\n <Button size=\"sm\" variant=\"outline\" onClick={() => tree.current?.expandAll()}>\n Expand all\n </Button>\n <Button size=\"sm\" variant=\"outline\" onClick={() => tree.current?.collapseAll()}>\n Collapse all\n </Button>\n </Inline>\n <Tree\n aria-label=\"Product categories\"\n handleRef={tree}\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n </Stack>\n );\n}\n",
1101
+ "verdict": "example"
1102
+ },
1103
+ {
1104
+ "id": "replace",
1105
+ "title": "replace.tsx",
1106
+ "note": null,
1107
+ "language": "tsx",
1108
+ "source": "import { Tree } from '@slotted/react/tree';\n\ninterface Entry {\n id: string;\n name: string;\n children?: Entry[];\n}\n\nconst FOLDERS: Entry[] = [\n {\n id: 'contracts',\n name: 'Contracts',\n children: [\n { id: 'contoso', name: 'Contoso Foods 2026.pdf' },\n { id: 'fabrikam', name: 'Fabrikam Supply 2026.pdf' },\n { id: 'atlas', name: 'Atlas Freight renewal.pdf' },\n ],\n },\n {\n id: 'forecasts',\n name: 'Forecasts',\n children: [\n { id: 'q3', name: 'Q3 demand.xlsx' },\n { id: 'q4', name: 'Q4 demand.xlsx' },\n ],\n },\n];\n\nexport default function TreeReplace() {\n return (\n <Tree\n aria-label=\"Documents\"\n expandOn=\"expander\"\n selectionBehavior=\"replace\"\n selectionIndicator=\"highlight\"\n selectionMode=\"multiple\"\n defaultExpandedKeys={['contracts', 'forecasts']}\n defaultValue={['contoso', 'fabrikam']}\n nodes={FOLDERS}\n getKey={(entry) => entry.id}\n getLabel={(entry) => entry.name}\n getChildren={(entry) => entry.children}\n />\n );\n}\n",
1109
+ "verdict": "example"
1110
+ },
1111
+ {
1112
+ "id": "reveal",
1113
+ "title": "reveal.tsx",
1114
+ "note": null,
1115
+ "language": "tsx",
1116
+ "source": "import { useRef, useState } from 'react';\nimport { Button } from '@slotted/react/button';\nimport { Stack } from '@slotted/react/stack';\nimport { Tree, type TreeHandle, type TreeValue } from '@slotted/react/tree';\n\ninterface Place {\n id: string;\n name: string;\n children?: Place[];\n}\n\nconst PLACES: Place[] = ['CMH', 'RNO', 'SAV'].map((site) => ({\n id: site,\n name: `Warehouse ${site}`,\n children: ['A', 'B', 'C'].map((aisle) => ({\n id: `${site}-${aisle}`,\n name: `Aisle ${aisle}`,\n children: Array.from({ length: 8 }, (_, index) => ({\n id: `${site}-${aisle}-0${index + 1}`,\n name: `Bin ${site}-${aisle}-0${index + 1}`,\n })),\n })),\n}));\n\nexport default function TreeReveal() {\n const tree = useRef<TreeHandle>(null);\n const [value, setValue] = useState<TreeValue>(null);\n\n function handleFind() {\n setValue('SAV-B-06');\n tree.current?.scrollToKey('SAV-B-06', 'center');\n }\n\n return (\n <Stack align=\"start\" gap={3}>\n <Button size=\"sm\" variant=\"outline\" onClick={handleFind}>\n Find bin SAV-B-06\n </Button>\n <Tree\n aria-label=\"Bins\"\n handleRef={tree}\n onValueChange={(next) => setValue(next)}\n value={value}\n defaultExpandedKeys={['CMH', 'CMH-A']}\n nodes={PLACES}\n getKey={(place) => place.id}\n getLabel={(place) => place.name}\n getChildren={(place) => place.children}\n />\n </Stack>\n );\n}\n",
1117
+ "verdict": "example"
1118
+ },
1119
+ {
1120
+ "id": "row-content",
1121
+ "title": "row-content.tsx",
1122
+ "note": null,
1123
+ "language": "tsx",
1124
+ "source": "import { Glyph, Icon } from '@slotted/react/icon';\nimport { Tree, TreeNode } from '@slotted/react/tree';\n\nexport default function TreeRowContent() {\n return (\n <Tree aria-label=\"Documents\" defaultExpandedKeys={['contracts', 'forecasts']}>\n <TreeNode value=\"contracts\" label=\"Contracts\" meta=\"2\">\n <TreeNode\n value=\"contoso\"\n label=\"Contoso Foods 2026.pdf\"\n description=\"Signed\"\n meta=\"1.2 MB\"\n icon={\n <Icon>\n <Glyph name=\"file-text\" />\n </Icon>\n }\n />\n <TreeNode\n value=\"fabrikam\"\n label=\"Fabrikam Supply master services agreement, amended.pdf\"\n description=\"Draft\"\n meta=\"840 kB\"\n icon={\n <Icon>\n <Glyph name=\"file-text\" />\n </Icon>\n }\n />\n </TreeNode>\n <TreeNode value=\"forecasts\" label=\"Forecasts\" meta=\"1\">\n <TreeNode\n value=\"q4\"\n label=\"Q4 demand.xlsx\"\n description=\"Edited today\"\n meta=\"96 kB\"\n icon={\n <Icon>\n <Glyph name=\"file-spreadsheet\" />\n </Icon>\n }\n />\n </TreeNode>\n </Tree>\n );\n}\n",
1125
+ "verdict": "example"
1126
+ },
1127
+ {
1128
+ "id": "sizes",
1129
+ "title": "sizes.tsx",
1130
+ "note": null,
1131
+ "language": "tsx",
1132
+ "source": "import { Grid } from '@slotted/react/grid';\nimport { Tree } from '@slotted/react/tree';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeSizes() {\n return (\n <Grid columns={3} gap={6} minItemWidth=\"xs\">\n <Tree\n aria-label=\"Categories, small\"\n size=\"sm\"\n defaultExpandedKeys={['beverages']}\n defaultValue=\"coffee\"\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n <Tree\n aria-label=\"Categories, medium\"\n size=\"md\"\n defaultExpandedKeys={['beverages']}\n defaultValue=\"coffee\"\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n <Tree\n aria-label=\"Categories, large\"\n size=\"lg\"\n defaultExpandedKeys={['beverages']}\n defaultValue=\"coffee\"\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n </Grid>\n );\n}\n",
1133
+ "verdict": "example"
1134
+ },
1135
+ {
1136
+ "id": "variants",
1137
+ "title": "variants.tsx",
1138
+ "note": null,
1139
+ "language": "tsx",
1140
+ "source": "import { Grid } from '@slotted/react/grid';\nimport { Tree } from '@slotted/react/tree';\n\ninterface Category {\n id: string;\n name: string;\n children?: Category[];\n}\n\nconst CATEGORIES: Category[] = [\n {\n id: 'beverages',\n name: 'Beverages',\n children: [\n { id: 'coffee', name: 'Coffee' },\n { id: 'tea', name: 'Tea' },\n { id: 'soft-drinks', name: 'Soft drinks' },\n ],\n },\n {\n id: 'pantry',\n name: 'Pantry',\n children: [\n { id: 'oils', name: 'Oils and vinegars' },\n {\n id: 'spices',\n name: 'Spices',\n children: [\n { id: 'ground-spices', name: 'Ground spices' },\n { id: 'whole-spices', name: 'Whole spices' },\n ],\n },\n ],\n },\n { id: 'household', name: 'Household' },\n];\n\nexport default function TreeVariants() {\n return (\n <Grid columns={2} gap={6} minItemWidth=\"xs\">\n <Tree\n aria-label=\"Categories, plain\"\n variant=\"plain\"\n defaultExpandedKeys={['beverages']}\n defaultValue=\"coffee\"\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n <Tree\n aria-label=\"Categories, framed\"\n variant=\"framed\"\n defaultExpandedKeys={['beverages']}\n defaultValue=\"coffee\"\n nodes={CATEGORIES}\n getKey={(category) => category.id}\n getLabel={(category) => category.name}\n getChildren={(category) => category.children}\n />\n </Grid>\n );\n}\n",
1141
+ "verdict": "example"
965
1142
  }
966
1143
  ]
967
1144
  }