@senvenli/react 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (636) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -2
  3. package/dist/action/button-group.d.ts +26 -0
  4. package/dist/action/button-group.js +12 -0
  5. package/dist/action/button-group.js.map +1 -0
  6. package/dist/action/button.d.ts +42 -0
  7. package/dist/action/button.js +58 -0
  8. package/dist/action/button.js.map +1 -0
  9. package/dist/action/close-button.d.ts +12 -0
  10. package/dist/action/close-button.js +13 -0
  11. package/dist/action/close-button.js.map +1 -0
  12. package/dist/action/copy-button.d.ts +21 -0
  13. package/dist/action/copy-button.js +38 -0
  14. package/dist/action/copy-button.js.map +1 -0
  15. package/dist/action/fab.d.ts +29 -0
  16. package/dist/action/fab.js +57 -0
  17. package/dist/action/fab.js.map +1 -0
  18. package/dist/action/files.d.ts +70 -0
  19. package/dist/action/files.js +156 -0
  20. package/dist/action/files.js.map +1 -0
  21. package/dist/action/index.d.ts +23 -0
  22. package/dist/action/index.js +16 -0
  23. package/dist/action/index.js.map +1 -0
  24. package/dist/action/language-names.d.ts +19 -0
  25. package/dist/action/language-names.js +79 -0
  26. package/dist/action/language-names.js.map +1 -0
  27. package/dist/action/language-switcher.d.ts +57 -0
  28. package/dist/action/language-switcher.js +53 -0
  29. package/dist/action/language-switcher.js.map +1 -0
  30. package/dist/action/link-button.d.ts +57 -0
  31. package/dist/action/link-button.js +48 -0
  32. package/dist/action/link-button.js.map +1 -0
  33. package/dist/action/link.d.ts +24 -0
  34. package/dist/action/link.js +18 -0
  35. package/dist/action/link.js.map +1 -0
  36. package/dist/action/pressable.d.ts +40 -0
  37. package/dist/action/pressable.js +65 -0
  38. package/dist/action/pressable.js.map +1 -0
  39. package/dist/action/styles.d.ts +60 -0
  40. package/dist/action/styles.js +109 -0
  41. package/dist/action/styles.js.map +1 -0
  42. package/dist/action/theme-script.d.ts +12 -0
  43. package/dist/action/theme-script.js +23 -0
  44. package/dist/action/theme-script.js.map +1 -0
  45. package/dist/action/theme-switcher.d.ts +43 -0
  46. package/dist/action/theme-switcher.js +260 -0
  47. package/dist/action/theme-switcher.js.map +1 -0
  48. package/dist/action/theme-toggle.d.ts +43 -0
  49. package/dist/action/theme-toggle.js +259 -0
  50. package/dist/action/theme-toggle.js.map +1 -0
  51. package/dist/action/toggle.d.ts +44 -0
  52. package/dist/action/toggle.js +28 -0
  53. package/dist/action/toggle.js.map +1 -0
  54. package/dist/action/touch-target.d.ts +9 -0
  55. package/dist/action/touch-target.js +14 -0
  56. package/dist/action/touch-target.js.map +1 -0
  57. package/dist/charts/axis-width.d.ts +186 -0
  58. package/dist/charts/axis-width.js +1262 -0
  59. package/dist/charts/axis-width.js.map +1 -0
  60. package/dist/charts/bar-public.d.ts +16 -0
  61. package/dist/charts/bar-public.js +16 -0
  62. package/dist/charts/bar-public.js.map +1 -0
  63. package/dist/charts/chart-parts.d.ts +136 -0
  64. package/dist/charts/chart-parts.js +160 -0
  65. package/dist/charts/chart-parts.js.map +1 -0
  66. package/dist/charts/core-charts.d.ts +157 -0
  67. package/dist/charts/core-charts.js +505 -0
  68. package/dist/charts/core-charts.js.map +1 -0
  69. package/dist/charts/index.d.ts +12 -0
  70. package/dist/charts/index.js +8 -0
  71. package/dist/charts/index.js.map +1 -0
  72. package/dist/charts/list-charts.d.ts +124 -0
  73. package/dist/charts/list-charts.js +308 -0
  74. package/dist/charts/list-charts.js.map +1 -0
  75. package/dist/charts/more-charts.d.ts +138 -0
  76. package/dist/charts/more-charts.js +284 -0
  77. package/dist/charts/more-charts.js.map +1 -0
  78. package/dist/charts/report-charts.d.ts +138 -0
  79. package/dist/charts/report-charts.js +370 -0
  80. package/dist/charts/report-charts.js.map +1 -0
  81. package/dist/charts/value-tick.d.ts +178 -0
  82. package/dist/charts/value-tick.js +240 -0
  83. package/dist/charts/value-tick.js.map +1 -0
  84. package/dist/collection/data-table-url-hook.d.ts +34 -0
  85. package/dist/collection/data-table-url-hook.js +70 -0
  86. package/dist/collection/data-table-url-hook.js.map +1 -0
  87. package/dist/collection/data-table-url.d.ts +30 -0
  88. package/dist/collection/data-table-url.js +48 -0
  89. package/dist/collection/data-table-url.js.map +1 -0
  90. package/dist/collection/data-table.d.ts +112 -0
  91. package/dist/collection/data-table.js +188 -0
  92. package/dist/collection/data-table.js.map +1 -0
  93. package/dist/collection/grid-list-public.d.ts +18 -0
  94. package/dist/collection/grid-list-public.js +19 -0
  95. package/dist/collection/grid-list-public.js.map +1 -0
  96. package/dist/collection/grid-list.d.ts +73 -0
  97. package/dist/collection/grid-list.js +46 -0
  98. package/dist/collection/grid-list.js.map +1 -0
  99. package/dist/collection/index.d.ts +14 -0
  100. package/dist/collection/index.js +8 -0
  101. package/dist/collection/index.js.map +1 -0
  102. package/dist/collection/list.d.ts +61 -0
  103. package/dist/collection/list.js +38 -0
  104. package/dist/collection/list.js.map +1 -0
  105. package/dist/collection/selection-checkbox.d.ts +5 -0
  106. package/dist/collection/selection-checkbox.js +13 -0
  107. package/dist/collection/selection-checkbox.js.map +1 -0
  108. package/dist/collection/table.d.ts +91 -0
  109. package/dist/collection/table.js +183 -0
  110. package/dist/collection/table.js.map +1 -0
  111. package/dist/collection/tree.d.ts +31 -0
  112. package/dist/collection/tree.js +22 -0
  113. package/dist/collection/tree.js.map +1 -0
  114. package/dist/color/color.d.ts +87 -0
  115. package/dist/color/color.js +200 -0
  116. package/dist/color/color.js.map +1 -0
  117. package/dist/color/contrast.d.ts +34 -0
  118. package/dist/color/contrast.js +44 -0
  119. package/dist/color/contrast.js.map +1 -0
  120. package/dist/color/index.d.ts +4 -0
  121. package/dist/color/index.js +5 -0
  122. package/dist/color/index.js.map +1 -0
  123. package/dist/date/calendar.d.ts +71 -0
  124. package/dist/date/calendar.js +291 -0
  125. package/dist/date/calendar.js.map +1 -0
  126. package/dist/date/fields.d.ts +174 -0
  127. package/dist/date/fields.js +250 -0
  128. package/dist/date/fields.js.map +1 -0
  129. package/dist/date/index.d.ts +7 -0
  130. package/dist/date/index.js +6 -0
  131. package/dist/date/index.js.map +1 -0
  132. package/dist/date/month-grid.d.ts +31 -0
  133. package/dist/date/month-grid.js +115 -0
  134. package/dist/date/month-grid.js.map +1 -0
  135. package/dist/date/pickers.d.ts +118 -0
  136. package/dist/date/pickers.js +176 -0
  137. package/dist/date/pickers.js.map +1 -0
  138. package/dist/date/public.d.ts +25 -0
  139. package/dist/date/public.js +24 -0
  140. package/dist/date/public.js.map +1 -0
  141. package/dist/date/segments.d.ts +153 -0
  142. package/dist/date/segments.js +433 -0
  143. package/dist/date/segments.js.map +1 -0
  144. package/dist/defaults.d.ts +74 -0
  145. package/dist/defaults.js +100 -0
  146. package/dist/defaults.js.map +1 -0
  147. package/dist/density.d.ts +2 -0
  148. package/dist/density.js +2 -0
  149. package/dist/density.js.map +1 -0
  150. package/dist/display/avatar.d.ts +29 -0
  151. package/dist/display/avatar.js +71 -0
  152. package/dist/display/avatar.js.map +1 -0
  153. package/dist/display/badge.d.ts +65 -0
  154. package/dist/display/badge.js +99 -0
  155. package/dist/display/badge.js.map +1 -0
  156. package/dist/display/card.d.ts +72 -0
  157. package/dist/display/card.js +91 -0
  158. package/dist/display/card.js.map +1 -0
  159. package/dist/display/carousel.d.ts +47 -0
  160. package/dist/display/carousel.js +214 -0
  161. package/dist/display/carousel.js.map +1 -0
  162. package/dist/display/description-list.d.ts +25 -0
  163. package/dist/display/description-list.js +36 -0
  164. package/dist/display/description-list.js.map +1 -0
  165. package/dist/display/icon-aliases.d.ts +1 -0
  166. package/dist/display/icon-aliases.js +259 -0
  167. package/dist/display/icon-aliases.js.map +1 -0
  168. package/dist/display/icon-names.d.ts +4 -0
  169. package/dist/display/icon-names.js +2 -0
  170. package/dist/display/icon-names.js.map +1 -0
  171. package/dist/display/icon.d.ts +51 -0
  172. package/dist/display/icon.js +96 -0
  173. package/dist/display/icon.js.map +1 -0
  174. package/dist/display/image-crop.d.ts +106 -0
  175. package/dist/display/image-crop.js +117 -0
  176. package/dist/display/image-crop.js.map +1 -0
  177. package/dist/display/image-cropper.d.ts +68 -0
  178. package/dist/display/image-cropper.js +284 -0
  179. package/dist/display/image-cropper.js.map +1 -0
  180. package/dist/display/image-viewer.d.ts +54 -0
  181. package/dist/display/image-viewer.js +84 -0
  182. package/dist/display/image-viewer.js.map +1 -0
  183. package/dist/display/image.d.ts +26 -0
  184. package/dist/display/image.js +17 -0
  185. package/dist/display/image.js.map +1 -0
  186. package/dist/display/index.d.ts +29 -0
  187. package/dist/display/index.js +16 -0
  188. package/dist/display/index.js.map +1 -0
  189. package/dist/display/iso-chip.d.ts +19 -0
  190. package/dist/display/iso-chip.js +21 -0
  191. package/dist/display/iso-chip.js.map +1 -0
  192. package/dist/display/kbd.d.ts +11 -0
  193. package/dist/display/kbd.js +33 -0
  194. package/dist/display/kbd.js.map +1 -0
  195. package/dist/display/lozenge.d.ts +30 -0
  196. package/dist/display/lozenge.js +55 -0
  197. package/dist/display/lozenge.js.map +1 -0
  198. package/dist/display/scroll-area.d.ts +29 -0
  199. package/dist/display/scroll-area.js +95 -0
  200. package/dist/display/scroll-area.js.map +1 -0
  201. package/dist/display/separator.d.ts +13 -0
  202. package/dist/display/separator.js +24 -0
  203. package/dist/display/separator.js.map +1 -0
  204. package/dist/display/stat.d.ts +35 -0
  205. package/dist/display/stat.js +41 -0
  206. package/dist/display/stat.js.map +1 -0
  207. package/dist/display/timeline.d.ts +44 -0
  208. package/dist/display/timeline.js +111 -0
  209. package/dist/display/timeline.js.map +1 -0
  210. package/dist/display/typography.d.ts +37 -0
  211. package/dist/display/typography.js +53 -0
  212. package/dist/display/typography.js.map +1 -0
  213. package/dist/display/visually-hidden.d.ts +14 -0
  214. package/dist/display/visually-hidden.js +10 -0
  215. package/dist/display/visually-hidden.js.map +1 -0
  216. package/dist/feedback/banner.d.ts +46 -0
  217. package/dist/feedback/banner.js +157 -0
  218. package/dist/feedback/banner.js.map +1 -0
  219. package/dist/feedback/cooldown.d.ts +17 -0
  220. package/dist/feedback/cooldown.js +59 -0
  221. package/dist/feedback/cooldown.js.map +1 -0
  222. package/dist/feedback/empty-state.d.ts +35 -0
  223. package/dist/feedback/empty-state.js +39 -0
  224. package/dist/feedback/empty-state.js.map +1 -0
  225. package/dist/feedback/index.d.ts +12 -0
  226. package/dist/feedback/index.js +11 -0
  227. package/dist/feedback/index.js.map +1 -0
  228. package/dist/feedback/meter.d.ts +33 -0
  229. package/dist/feedback/meter.js +42 -0
  230. package/dist/feedback/meter.js.map +1 -0
  231. package/dist/feedback/motion.d.ts +9 -0
  232. package/dist/feedback/motion.js +57 -0
  233. package/dist/feedback/motion.js.map +1 -0
  234. package/dist/feedback/progress.d.ts +39 -0
  235. package/dist/feedback/progress.js +68 -0
  236. package/dist/feedback/progress.js.map +1 -0
  237. package/dist/feedback/skeleton.d.ts +48 -0
  238. package/dist/feedback/skeleton.js +61 -0
  239. package/dist/feedback/skeleton.js.map +1 -0
  240. package/dist/feedback/spinner.d.ts +19 -0
  241. package/dist/feedback/spinner.js +29 -0
  242. package/dist/feedback/spinner.js.map +1 -0
  243. package/dist/feedback/status-dot.d.ts +23 -0
  244. package/dist/feedback/status-dot.js +37 -0
  245. package/dist/feedback/status-dot.js.map +1 -0
  246. package/dist/form/countries.d.ts +34 -0
  247. package/dist/form/countries.js +273 -0
  248. package/dist/form/countries.js.map +1 -0
  249. package/dist/form/data-attributes.d.ts +11 -0
  250. package/dist/form/data-attributes.js +22 -0
  251. package/dist/form/data-attributes.js.map +1 -0
  252. package/dist/form/field-parts.d.ts +113 -0
  253. package/dist/form/field-parts.js +178 -0
  254. package/dist/form/field-parts.js.map +1 -0
  255. package/dist/form/field.d.ts +36 -0
  256. package/dist/form/field.js +65 -0
  257. package/dist/form/field.js.map +1 -0
  258. package/dist/form/files.d.ts +70 -0
  259. package/dist/form/files.js +156 -0
  260. package/dist/form/files.js.map +1 -0
  261. package/dist/form/form.d.ts +40 -0
  262. package/dist/form/form.js +74 -0
  263. package/dist/form/form.js.map +1 -0
  264. package/dist/form/image-crop.d.ts +106 -0
  265. package/dist/form/image-crop.js +117 -0
  266. package/dist/form/image-crop.js.map +1 -0
  267. package/dist/form/image-cropper.d.ts +68 -0
  268. package/dist/form/image-cropper.js +284 -0
  269. package/dist/form/image-cropper.js.map +1 -0
  270. package/dist/form/index.d.ts +24 -0
  271. package/dist/form/index.js +15 -0
  272. package/dist/form/index.js.map +1 -0
  273. package/dist/form/input-group.d.ts +63 -0
  274. package/dist/form/input-group.js +63 -0
  275. package/dist/form/input-group.js.map +1 -0
  276. package/dist/form/input-otp.d.ts +35 -0
  277. package/dist/form/input-otp.js +83 -0
  278. package/dist/form/input-otp.js.map +1 -0
  279. package/dist/form/input.d.ts +36 -0
  280. package/dist/form/input.js +41 -0
  281. package/dist/form/input.js.map +1 -0
  282. package/dist/form/number-field.d.ts +84 -0
  283. package/dist/form/number-field.js +81 -0
  284. package/dist/form/number-field.js.map +1 -0
  285. package/dist/form/otp-field.d.ts +37 -0
  286. package/dist/form/otp-field.js +116 -0
  287. package/dist/form/otp-field.js.map +1 -0
  288. package/dist/form/password-field.d.ts +61 -0
  289. package/dist/form/password-field.js +61 -0
  290. package/dist/form/password-field.js.map +1 -0
  291. package/dist/form/phone-field.d.ts +104 -0
  292. package/dist/form/phone-field.js +275 -0
  293. package/dist/form/phone-field.js.map +1 -0
  294. package/dist/form/phone-paste.d.ts +24 -0
  295. package/dist/form/phone-paste.js +40 -0
  296. package/dist/form/phone-paste.js.map +1 -0
  297. package/dist/form/phone.d.ts +159 -0
  298. package/dist/form/phone.js +309 -0
  299. package/dist/form/phone.js.map +1 -0
  300. package/dist/form/search-field.d.ts +29 -0
  301. package/dist/form/search-field.js +23 -0
  302. package/dist/form/search-field.js.map +1 -0
  303. package/dist/form/styles.d.ts +31 -0
  304. package/dist/form/styles.js +43 -0
  305. package/dist/form/styles.js.map +1 -0
  306. package/dist/form/text-area.d.ts +70 -0
  307. package/dist/form/text-area.js +93 -0
  308. package/dist/form/text-area.js.map +1 -0
  309. package/dist/form/text-field.d.ts +131 -0
  310. package/dist/form/text-field.js +59 -0
  311. package/dist/form/text-field.js.map +1 -0
  312. package/dist/form/validation.d.ts +145 -0
  313. package/dist/form/validation.js +136 -0
  314. package/dist/form/validation.js.map +1 -0
  315. package/dist/i18n.d.ts +438 -0
  316. package/dist/i18n.js +948 -0
  317. package/dist/i18n.js.map +1 -0
  318. package/dist/index.d.ts +9 -0
  319. package/dist/index.js +7 -0
  320. package/dist/index.js.map +1 -0
  321. package/dist/intl-locale.d.ts +30 -0
  322. package/dist/intl-locale.js +83 -0
  323. package/dist/intl-locale.js.map +1 -0
  324. package/dist/layers.d.ts +32 -0
  325. package/dist/layers.js +33 -0
  326. package/dist/layers.js.map +1 -0
  327. package/dist/layout/auth-form-layout.d.ts +71 -0
  328. package/dist/layout/auth-form-layout.js +61 -0
  329. package/dist/layout/auth-form-layout.js.map +1 -0
  330. package/dist/layout/auth-layout.d.ts +59 -0
  331. package/dist/layout/auth-layout.js +26 -0
  332. package/dist/layout/auth-layout.js.map +1 -0
  333. package/dist/layout/box.d.ts +26 -0
  334. package/dist/layout/box.js +16 -0
  335. package/dist/layout/box.js.map +1 -0
  336. package/dist/layout/grid.d.ts +27 -0
  337. package/dist/layout/grid.js +26 -0
  338. package/dist/layout/grid.js.map +1 -0
  339. package/dist/layout/index.d.ts +16 -0
  340. package/dist/layout/index.js +12 -0
  341. package/dist/layout/index.js.map +1 -0
  342. package/dist/layout/pressable.d.ts +40 -0
  343. package/dist/layout/pressable.js +65 -0
  344. package/dist/layout/pressable.js.map +1 -0
  345. package/dist/layout/reset-sent-card.d.ts +39 -0
  346. package/dist/layout/reset-sent-card.js +22 -0
  347. package/dist/layout/reset-sent-card.js.map +1 -0
  348. package/dist/layout/scroll-area.d.ts +29 -0
  349. package/dist/layout/scroll-area.js +95 -0
  350. package/dist/layout/scroll-area.js.map +1 -0
  351. package/dist/layout/section.d.ts +41 -0
  352. package/dist/layout/section.js +22 -0
  353. package/dist/layout/section.js.map +1 -0
  354. package/dist/layout/split.d.ts +50 -0
  355. package/dist/layout/split.js +35 -0
  356. package/dist/layout/split.js.map +1 -0
  357. package/dist/layout/stack.d.ts +44 -0
  358. package/dist/layout/stack.js +36 -0
  359. package/dist/layout/stack.js.map +1 -0
  360. package/dist/layout/tokens.d.ts +33 -0
  361. package/dist/layout/tokens.js +85 -0
  362. package/dist/layout/tokens.js.map +1 -0
  363. package/dist/layout/toolbar.d.ts +37 -0
  364. package/dist/layout/toolbar.js +334 -0
  365. package/dist/layout/toolbar.js.map +1 -0
  366. package/dist/navigate-context.d.ts +12 -0
  367. package/dist/navigate-context.js +13 -0
  368. package/dist/navigate-context.js.map +1 -0
  369. package/dist/navigation/accordion.d.ts +40 -0
  370. package/dist/navigation/accordion.js +33 -0
  371. package/dist/navigation/accordion.js.map +1 -0
  372. package/dist/navigation/bottom-nav.d.ts +29 -0
  373. package/dist/navigation/bottom-nav.js +48 -0
  374. package/dist/navigation/bottom-nav.js.map +1 -0
  375. package/dist/navigation/brand-link-context.d.ts +8 -0
  376. package/dist/navigation/brand-link-context.js +9 -0
  377. package/dist/navigation/brand-link-context.js.map +1 -0
  378. package/dist/navigation/breadcrumbs.d.ts +36 -0
  379. package/dist/navigation/breadcrumbs.js +51 -0
  380. package/dist/navigation/breadcrumbs.js.map +1 -0
  381. package/dist/navigation/dock.d.ts +27 -0
  382. package/dist/navigation/dock.js +47 -0
  383. package/dist/navigation/dock.js.map +1 -0
  384. package/dist/navigation/footer.d.ts +43 -0
  385. package/dist/navigation/footer.js +43 -0
  386. package/dist/navigation/footer.js.map +1 -0
  387. package/dist/navigation/index.d.ts +22 -0
  388. package/dist/navigation/index.js +17 -0
  389. package/dist/navigation/index.js.map +1 -0
  390. package/dist/navigation/language-names.d.ts +19 -0
  391. package/dist/navigation/language-names.js +79 -0
  392. package/dist/navigation/language-names.js.map +1 -0
  393. package/dist/navigation/language-switcher.d.ts +55 -0
  394. package/dist/navigation/language-switcher.js +53 -0
  395. package/dist/navigation/language-switcher.js.map +1 -0
  396. package/dist/navigation/nav-panel.d.ts +18 -0
  397. package/dist/navigation/nav-panel.js +51 -0
  398. package/dist/navigation/nav-panel.js.map +1 -0
  399. package/dist/navigation/navbar.d.ts +73 -0
  400. package/dist/navigation/navbar.js +64 -0
  401. package/dist/navigation/navbar.js.map +1 -0
  402. package/dist/navigation/page-header.d.ts +37 -0
  403. package/dist/navigation/page-header.js +50 -0
  404. package/dist/navigation/page-header.js.map +1 -0
  405. package/dist/navigation/pagination.d.ts +25 -0
  406. package/dist/navigation/pagination.js +51 -0
  407. package/dist/navigation/pagination.js.map +1 -0
  408. package/dist/navigation/panel-header.d.ts +37 -0
  409. package/dist/navigation/panel-header.js +50 -0
  410. package/dist/navigation/panel-header.js.map +1 -0
  411. package/dist/navigation/sidebar-script.d.ts +12 -0
  412. package/dist/navigation/sidebar-script.js +20 -0
  413. package/dist/navigation/sidebar-script.js.map +1 -0
  414. package/dist/navigation/sidebar.d.ts +149 -0
  415. package/dist/navigation/sidebar.js +332 -0
  416. package/dist/navigation/sidebar.js.map +1 -0
  417. package/dist/navigation/skip-link.d.ts +12 -0
  418. package/dist/navigation/skip-link.js +30 -0
  419. package/dist/navigation/skip-link.js.map +1 -0
  420. package/dist/navigation/stepper.d.ts +50 -0
  421. package/dist/navigation/stepper.js +96 -0
  422. package/dist/navigation/stepper.js.map +1 -0
  423. package/dist/navigation/tabs.d.ts +84 -0
  424. package/dist/navigation/tabs.js +118 -0
  425. package/dist/navigation/tabs.js.map +1 -0
  426. package/dist/navigation/toolbar.d.ts +37 -0
  427. package/dist/navigation/toolbar.js +334 -0
  428. package/dist/navigation/toolbar.js.map +1 -0
  429. package/dist/overlay/alert-dialog.d.ts +63 -0
  430. package/dist/overlay/alert-dialog.js +76 -0
  431. package/dist/overlay/alert-dialog.js.map +1 -0
  432. package/dist/overlay/command-palette.d.ts +53 -0
  433. package/dist/overlay/command-palette.js +130 -0
  434. package/dist/overlay/command-palette.js.map +1 -0
  435. package/dist/overlay/command.d.ts +53 -0
  436. package/dist/overlay/command.js +129 -0
  437. package/dist/overlay/command.js.map +1 -0
  438. package/dist/overlay/context-menu.d.ts +29 -0
  439. package/dist/overlay/context-menu.js +58 -0
  440. package/dist/overlay/context-menu.js.map +1 -0
  441. package/dist/overlay/dialog.d.ts +162 -0
  442. package/dist/overlay/dialog.js +174 -0
  443. package/dist/overlay/dialog.js.map +1 -0
  444. package/dist/overlay/drawer.d.ts +41 -0
  445. package/dist/overlay/drawer.js +114 -0
  446. package/dist/overlay/drawer.js.map +1 -0
  447. package/dist/overlay/floating.d.ts +142 -0
  448. package/dist/overlay/floating.js +226 -0
  449. package/dist/overlay/floating.js.map +1 -0
  450. package/dist/overlay/hover-card.d.ts +19 -0
  451. package/dist/overlay/hover-card.js +31 -0
  452. package/dist/overlay/hover-card.js.map +1 -0
  453. package/dist/overlay/index.d.ts +18 -0
  454. package/dist/overlay/index.js +12 -0
  455. package/dist/overlay/index.js.map +1 -0
  456. package/dist/overlay/overlay-base.d.ts +105 -0
  457. package/dist/overlay/overlay-base.js +250 -0
  458. package/dist/overlay/overlay-base.js.map +1 -0
  459. package/dist/overlay/overlay.d.ts +299 -0
  460. package/dist/overlay/overlay.js +558 -0
  461. package/dist/overlay/overlay.js.map +1 -0
  462. package/dist/overlay/toast.d.ts +58 -0
  463. package/dist/overlay/toast.js +145 -0
  464. package/dist/overlay/toast.js.map +1 -0
  465. package/dist/provider.d.ts +26 -0
  466. package/dist/provider.js +30 -0
  467. package/dist/provider.js.map +1 -0
  468. package/dist/selection/autocomplete.d.ts +54 -0
  469. package/dist/selection/autocomplete.js +122 -0
  470. package/dist/selection/autocomplete.js.map +1 -0
  471. package/dist/selection/checkbox.d.ts +56 -0
  472. package/dist/selection/checkbox.js +49 -0
  473. package/dist/selection/checkbox.js.map +1 -0
  474. package/dist/selection/choice-size.d.ts +26 -0
  475. package/dist/selection/choice-size.js +50 -0
  476. package/dist/selection/choice-size.js.map +1 -0
  477. package/dist/selection/choice-text.d.ts +21 -0
  478. package/dist/selection/choice-text.js +33 -0
  479. package/dist/selection/choice-text.js.map +1 -0
  480. package/dist/selection/combobox.d.ts +173 -0
  481. package/dist/selection/combobox.js +410 -0
  482. package/dist/selection/combobox.js.map +1 -0
  483. package/dist/selection/index.d.ts +20 -0
  484. package/dist/selection/index.js +13 -0
  485. package/dist/selection/index.js.map +1 -0
  486. package/dist/selection/list-box.d.ts +30 -0
  487. package/dist/selection/list-box.js +16 -0
  488. package/dist/selection/list-box.js.map +1 -0
  489. package/dist/selection/listbox.d.ts +44 -0
  490. package/dist/selection/listbox.js +49 -0
  491. package/dist/selection/listbox.js.map +1 -0
  492. package/dist/selection/match.d.ts +20 -0
  493. package/dist/selection/match.js +57 -0
  494. package/dist/selection/match.js.map +1 -0
  495. package/dist/selection/multi-select.d.ts +72 -0
  496. package/dist/selection/multi-select.js +138 -0
  497. package/dist/selection/multi-select.js.map +1 -0
  498. package/dist/selection/radio-card.d.ts +31 -0
  499. package/dist/selection/radio-card.js +29 -0
  500. package/dist/selection/radio-card.js.map +1 -0
  501. package/dist/selection/radio.d.ts +72 -0
  502. package/dist/selection/radio.js +64 -0
  503. package/dist/selection/radio.js.map +1 -0
  504. package/dist/selection/select-public.d.ts +19 -0
  505. package/dist/selection/select-public.js +24 -0
  506. package/dist/selection/select-public.js.map +1 -0
  507. package/dist/selection/select.d.ts +72 -0
  508. package/dist/selection/select.js +69 -0
  509. package/dist/selection/select.js.map +1 -0
  510. package/dist/selection/slider.d.ts +16 -0
  511. package/dist/selection/slider.js +44 -0
  512. package/dist/selection/slider.js.map +1 -0
  513. package/dist/selection/styles.d.ts +26 -0
  514. package/dist/selection/styles.js +78 -0
  515. package/dist/selection/styles.js.map +1 -0
  516. package/dist/selection/switch.d.ts +24 -0
  517. package/dist/selection/switch.js +27 -0
  518. package/dist/selection/switch.js.map +1 -0
  519. package/dist/selection/tag-group.d.ts +38 -0
  520. package/dist/selection/tag-group.js +45 -0
  521. package/dist/selection/tag-group.js.map +1 -0
  522. package/dist/tone.d.ts +6 -0
  523. package/dist/tone.js +2 -0
  524. package/dist/tone.js.map +1 -0
  525. package/dist/utils.d.ts +9 -0
  526. package/dist/utils.js +42 -0
  527. package/dist/utils.js.map +1 -0
  528. package/manifest/component.full.schema.json +391 -0
  529. package/manifest/component.schema.json +279 -0
  530. package/manifests/accordion.json +299 -0
  531. package/manifests/alert-dialog.json +261 -0
  532. package/manifests/area-chart.json +338 -0
  533. package/manifests/autocomplete.json +299 -0
  534. package/manifests/avatar.json +253 -0
  535. package/manifests/badge.json +288 -0
  536. package/manifests/banner.json +185 -0
  537. package/manifests/bar-chart.json +454 -0
  538. package/manifests/bar-list.json +262 -0
  539. package/manifests/bottom-nav.json +139 -0
  540. package/manifests/box.json +3450 -0
  541. package/manifests/breadcrumbs.json +199 -0
  542. package/manifests/button-group.json +2294 -0
  543. package/manifests/button.json +1211 -0
  544. package/manifests/calendar-heatmap.json +218 -0
  545. package/manifests/calendar.json +299 -0
  546. package/manifests/card.json +308 -0
  547. package/manifests/carousel.json +263 -0
  548. package/manifests/chart-parts.json +309 -0
  549. package/manifests/checkbox.json +998 -0
  550. package/manifests/close-button.json +1000 -0
  551. package/manifests/color-field.json +276 -0
  552. package/manifests/color-picker.json +161 -0
  553. package/manifests/color-swatch-picker.json +220 -0
  554. package/manifests/color-swatch.json +140 -0
  555. package/manifests/combobox.json +581 -0
  556. package/manifests/command.json +275 -0
  557. package/manifests/composed-chart.json +287 -0
  558. package/manifests/context-menu.json +148 -0
  559. package/manifests/copy-button.json +192 -0
  560. package/manifests/data-table.json +334 -0
  561. package/manifests/date-field.json +302 -0
  562. package/manifests/date-picker.json +472 -0
  563. package/manifests/description-list.json +201 -0
  564. package/manifests/dialog.json +322 -0
  565. package/manifests/donut-chart.json +264 -0
  566. package/manifests/drawer.json +211 -0
  567. package/manifests/empty-state.json +185 -0
  568. package/manifests/fab.json +172 -0
  569. package/manifests/field.json +209 -0
  570. package/manifests/file-upload.json +791 -0
  571. package/manifests/form.json +829 -0
  572. package/manifests/funnel-chart.json +223 -0
  573. package/manifests/gauge-chart.json +252 -0
  574. package/manifests/grid-list.json +335 -0
  575. package/manifests/grid.json +3482 -0
  576. package/manifests/heading.json +183 -0
  577. package/manifests/heatmap.json +265 -0
  578. package/manifests/hover-card.json +172 -0
  579. package/manifests/icon.json +201 -0
  580. package/manifests/image-cropper.json +295 -0
  581. package/manifests/image-viewer.json +198 -0
  582. package/manifests/image.json +193 -0
  583. package/manifests/index.json +2035 -0
  584. package/manifests/input-group.json +3571 -0
  585. package/manifests/input.json +1557 -0
  586. package/manifests/kbd.json +98 -0
  587. package/manifests/language-switcher.json +274 -0
  588. package/manifests/line-chart.json +342 -0
  589. package/manifests/link.json +867 -0
  590. package/manifests/list-box.json +213 -0
  591. package/manifests/menu.json +453 -0
  592. package/manifests/meter.json +145 -0
  593. package/manifests/navbar.json +281 -0
  594. package/manifests/otp-field.json +1029 -0
  595. package/manifests/page-header.json +164 -0
  596. package/manifests/pagination.json +181 -0
  597. package/manifests/popover.json +205 -0
  598. package/manifests/pressable.json +367 -0
  599. package/manifests/progress.json +282 -0
  600. package/manifests/radar-chart.json +229 -0
  601. package/manifests/radial-chart.json +195 -0
  602. package/manifests/radio.json +975 -0
  603. package/manifests/scatter-chart.json +277 -0
  604. package/manifests/scroll-area.json +127 -0
  605. package/manifests/section.json +169 -0
  606. package/manifests/select.json +474 -0
  607. package/manifests/separator.json +119 -0
  608. package/manifests/sidebar.json +584 -0
  609. package/manifests/skeleton.json +235 -0
  610. package/manifests/skip-link.json +89 -0
  611. package/manifests/slider.json +706 -0
  612. package/manifests/sparkline.json +208 -0
  613. package/manifests/spinner.json +105 -0
  614. package/manifests/split.json +6618 -0
  615. package/manifests/stack.json +3541 -0
  616. package/manifests/stat.json +192 -0
  617. package/manifests/stepper.json +279 -0
  618. package/manifests/switch.json +205 -0
  619. package/manifests/table.json +375 -0
  620. package/manifests/tabs.json +438 -0
  621. package/manifests/tag-group.json +264 -0
  622. package/manifests/text-area.json +1136 -0
  623. package/manifests/text.json +244 -0
  624. package/manifests/theme-switcher.json +152 -0
  625. package/manifests/time-field.json +284 -0
  626. package/manifests/timeline.json +196 -0
  627. package/manifests/toast.json +87 -0
  628. package/manifests/toggle-button.json +1489 -0
  629. package/manifests/toolbar.json +145 -0
  630. package/manifests/tooltip.json +181 -0
  631. package/manifests/tracker.json +192 -0
  632. package/manifests/tree.json +245 -0
  633. package/manifests/visually-hidden.json +114 -0
  634. package/package.json +117 -3
  635. package/styles/base.css +56 -0
  636. package/styles/theme.css +154 -0
@@ -0,0 +1,332 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Button as AriaButton, Disclosure, DisclosurePanel, Link as AriaLink, useLocale, } from "react-aria-components";
5
+ import { cn } from "../utils.js";
6
+ import { MotionScope } from "../defaults.js";
7
+ import { Button } from "../action/button.js";
8
+ import { Badge } from "../display/badge.js";
9
+ import { IconGlyph } from "../display/icon.js";
10
+ import { collapseSidebarLabel, expandSidebarLabel, mainNavigationLabel } from "../i18n.js";
11
+ import { Tooltip, TooltipFor } from "../overlay/floating.js";
12
+ import { NavPanel } from "./nav-panel.js";
13
+ import { ROOT_ATTRIBUTE } from "./sidebar-script.js";
14
+ function readStored(storageKey) {
15
+ try {
16
+ const value = window.localStorage.getItem(storageKey);
17
+ return value === "collapsed" ? true : value === "expanded" ? false : undefined;
18
+ }
19
+ catch {
20
+ return undefined;
21
+ }
22
+ }
23
+ function writeStored(storageKey, collapsed) {
24
+ try {
25
+ window.localStorage.setItem(storageKey, collapsed ? "collapsed" : "expanded");
26
+ }
27
+ catch {
28
+ // Storage can be full or blocked: the choice lasts for this page only.
29
+ }
30
+ }
31
+ /**
32
+ * Collapsed styling has two sources so the first frame is right in both modes: the sidebar's own
33
+ * `data-collapsed`, or (remembered choice) the <html> attribute the head script set before React ran.
34
+ * Classes are written out in full so Tailwind finds them.
35
+ */
36
+ const WHEN_COLLAPSED = {
37
+ root: "data-[collapsed]:w-14 [:root[data-ds-sidebar=collapsed]_&]:w-14",
38
+ label: "group-data-[collapsed]/sidebar:sr-only [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:sr-only",
39
+ hidden: "group-data-[collapsed]/sidebar:hidden [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:hidden",
40
+ /** Shown only collapsed (the section separator). */
41
+ shown: "hidden group-data-[collapsed]/sidebar:block [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:block",
42
+ badge: "group-data-[collapsed]/sidebar:absolute group-data-[collapsed]/sidebar:-top-1 group-data-[collapsed]/sidebar:end-0 " +
43
+ "[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:absolute [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:-top-1 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:end-0",
44
+ /**
45
+ * The account in the 56px rail: exactly the 32px avatar, no padding around it, centred. The 8px
46
+ * padding it kept before cut the avatar in half.
47
+ */
48
+ clip: "group-data-[collapsed]/sidebar:w-8 group-data-[collapsed]/sidebar:flex-none group-data-[collapsed]/sidebar:justify-start group-data-[collapsed]/sidebar:overflow-hidden group-data-[collapsed]/sidebar:p-0 " +
49
+ "[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:w-8 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:flex-none [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-start [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:overflow-hidden [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:p-0",
50
+ /** With a `logo` or `avatar`: only that mark is left, so the 32px box centres it. */
51
+ centre: "group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center",
52
+ };
53
+ /**
54
+ * The scrollbar on the sidebar's link list, as on ScrollArea: thin, no track, its thumb shown
55
+ * only on hover, keyboard focus inside the list, or while scrolling. A long list no longer shows a grey bar the full
56
+ * height of the panel. Native underneath, so wheel, touch and keyboard scroll as before.
57
+ */
58
+ const SCROLLBAR = "[scrollbar-width:thin] [scrollbar-color:transparent_transparent] " +
59
+ "hover:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent] " +
60
+ "focus-within:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]";
61
+ /**
62
+ * The bottom block: a two-column grid, so the account and the collapse toggle share one row (the
63
+ * account takes the room, the toggle sits at its end) A divider sets
64
+ * the account row off from the links. Collapsed, the rail is one column: the account above the toggle, both centred.
65
+ * The children and their order are unchanged.
66
+ */
67
+ const BOTTOM =
68
+ // No column gap: the divider over the account and the toggle reads as one line.
69
+ "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-0 gap-y-ds-100 " +
70
+ "group-data-[collapsed]/sidebar:grid-cols-1 group-data-[collapsed]/sidebar:justify-items-center " +
71
+ "[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:grid-cols-1 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-items-center";
72
+ /** The account: the room of the row. Square, so the divider over it ends straight; its Pressable keeps its own radius. */
73
+ const FOOTER = "flex min-w-0 items-center gap-ds-100 p-ds-050";
74
+ /** The divider runs the full width of the account row: over the account and the toggle alike. */
75
+ const FOOTER_RULE = "border-t border-ds-border pt-ds-150";
76
+ /**
77
+ * `isFooterPinned`: the scrolling part between the brand and the pinned bottom. It reaches out over
78
+ * the sidebar's padding (and takes it back inside), so the scrollbar sits on the sidebar's edge; its scroll padding
79
+ * matches that inset, so a row that focus scrolls into view stops short of the edge and its ring is never clipped. Collapsed, the 56px rail has no room for a scrollbar beside the icons,
80
+ * so it is hidden there (wheel, touch and focus still scroll). Written out in full so Tailwind finds them.
81
+ */
82
+ const PINNED = {
83
+ scroll: "-mx-ds-150 -my-ds-050 flex min-h-0 flex-1 flex-col gap-ds-200 overflow-x-hidden overflow-y-auto overscroll-contain px-ds-150 py-ds-050 scroll-py-ds-050 " + SCROLLBAR + " " +
84
+ "group-data-[collapsed]/sidebar:[scrollbar-width:none] [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:[scrollbar-width:none]",
85
+ /** The phone panel: its content box has 16px padding; the list scrolls, the account stays below it. */
86
+ panelScroll: "-mx-ds-200 -my-ds-050 flex min-h-0 flex-1 flex-col gap-ds-200 overflow-y-auto overscroll-contain px-ds-200 py-ds-050 scroll-py-ds-050 " + SCROLLBAR,
87
+ };
88
+ /** The overline over a labelled section. */
89
+ const OVERLINE = "px-ds-100 pt-ds-100 pb-ds-050 text-heading-xxsmall text-ds-text-subtlest";
90
+ const ROW = "relative flex h-8 w-full items-center gap-ds-100 rounded-ds-medium px-ds-100 text-body font-medium text-ds-text-subtle outline-hidden " +
91
+ "transition-colors duration-(--ds-duration-fast) motion-reduce:transition-none " +
92
+ "data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[hovered]:text-ds-text data-[pressed]:bg-ds-background-neutral-pressed " +
93
+ "data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused " +
94
+ // The page in view: a soft neutral fill and the full text color, no edge marker (a 2px inset bent into a bracket on
95
+ // the rounded row). One step darker than the sunken sidebar ground, which equals ds-background-neutral.
96
+ "aria-[current=page]:bg-ds-background-neutral-hovered aria-[current=page]:text-ds-text aria-[current=page]:data-[hovered]:bg-ds-background-neutral-hovered " +
97
+ // Collapsed: the icon alone, centred in the 56px rail.
98
+ "group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center";
99
+ const ICON = "text-ds-icon-subtle group-aria-[current=page]/row:text-ds-icon-brand";
100
+ const contains = (item, key) => !!key && (item.id === key || !!item.children?.some((child) => contains(child, key)));
101
+ /** Every item id in the trees, depth first, repeats included. */
102
+ function itemIds(items, into = []) {
103
+ for (const item of items) {
104
+ into.push(item.id);
105
+ if (item.children)
106
+ itemIds(item.children, into);
107
+ }
108
+ return into;
109
+ }
110
+ /**
111
+ * Item ids that repeat across `items` and `sections`, said once per set of ids, in development only
112
+ * (the Table's repeated-id warning does the same). A repeated id would mark two items `aria-current="page"`.
113
+ *
114
+ */
115
+ function repeatedIds(items, sections) {
116
+ const ids = itemIds(items);
117
+ for (const section of sections ?? [])
118
+ itemIds(section.items, ids);
119
+ const seen = new Set();
120
+ const repeated = new Set();
121
+ for (const id of ids)
122
+ (seen.has(id) ? repeated : seen).add(id);
123
+ return [...repeated].map((id) => JSON.stringify(id)).join(", ");
124
+ }
125
+ function useRepeatedIdWarning(items, sections) {
126
+ // Production never warns, so it never walks the trees either; the hooks below still run in order.
127
+ const signature = process.env.NODE_ENV === "production" ? "" : repeatedIds(items, sections);
128
+ const warned = React.useRef(null);
129
+ React.useEffect(() => {
130
+ if (process.env.NODE_ENV === "production" || !signature)
131
+ return;
132
+ warned.current ??= new Set();
133
+ if (warned.current.has(signature))
134
+ return;
135
+ warned.current.add(signature);
136
+ console.warn(`Sidebar: the item ids ${signature} repeat across items and sections. Give every item its own id; currentKey marks each item with that id as the current page.`);
137
+ }, [signature]);
138
+ }
139
+ /**
140
+ * The main navigation of admin apps: brand, sections with nested items, optional
141
+ * labelled `sections` and the account. Collapses to 56px icons
142
+ * (tooltips carry the labels); under 1024px it is a menu panel from the start edge.
143
+ */
144
+ function SidebarBody({ brand: brandProp, logo: logoProp, brandHref = "/", items, children, sections, currentKey, footer: footerProp, avatar: avatarProp, isFooterPinned = false, isCollapsed, defaultCollapsed = false, onCollapsedChange, storageKey, isMobileOpen = false, onMobileOpenChange, "aria-label": label, }) {
145
+ const { locale, direction } = useLocale();
146
+ const slots = splitSlots(children);
147
+ const { nav } = slots;
148
+ const brand = brandProp ?? slots.header;
149
+ const logo = logoProp ?? slots.logo;
150
+ const footer = footerProp ?? slots.footer;
151
+ const avatar = avatarProp ?? slots.avatar;
152
+ const hasBrand = brand != null || logo != null;
153
+ const hasFooter = footer != null || avatar != null;
154
+ const name = label ?? mainNavigationLabel(locale);
155
+ const [own, setOwn] = React.useState(defaultCollapsed);
156
+ // The remembered choice is read after hydration (the head script already painted it).
157
+ React.useLayoutEffect(() => {
158
+ if (!storageKey)
159
+ return;
160
+ const stored = readStored(storageKey);
161
+ if (stored !== undefined)
162
+ setOwn(stored);
163
+ }, [storageKey]);
164
+ const collapsed = isCollapsed ?? own;
165
+ React.useLayoutEffect(() => {
166
+ if (storageKey)
167
+ document.documentElement.setAttribute(ROOT_ATTRIBUTE, collapsed ? "collapsed" : "expanded");
168
+ }, [storageKey, collapsed]);
169
+ const setCollapsed = (next) => {
170
+ if (isCollapsed === undefined)
171
+ setOwn(next);
172
+ if (storageKey)
173
+ writeStored(storageKey, next);
174
+ onCollapsedChange?.(next);
175
+ };
176
+ const toggleLabel = collapsed ? expandSidebarLabel(locale) : collapseSidebarLabel(locale);
177
+ const shared = { currentKey, collapsed, expand: () => setCollapsed(false) };
178
+ const labelled = sections && sections.length > 0 ? sections : undefined;
179
+ useRepeatedIdWarning(items ?? [], labelled);
180
+ return (_jsxs(_Fragment, { children: [_jsxs("nav", { "aria-label": name, "data-slot": "sidebar", "data-collapsed": !storageKey && collapsed ? "" : undefined, className: cn("group/sidebar sticky top-0 hidden h-dvh max-h-full w-60 shrink-0 flex-col gap-ds-200 overflow-x-hidden overflow-y-auto border-e border-ds-border bg-ds-surface-sunken px-ds-150 py-ds-200 lg:flex", "transition-[width] duration-(--ds-duration-medium) ease-ds-standard motion-reduce:transition-none", WHEN_COLLAPSED.root,
181
+ // Pinned: the nav no longer scrolls as one; its middle part does.
182
+ isFooterPinned ? "overflow-y-hidden" : SCROLLBAR), "data-footer-pinned": isFooterPinned ? "" : undefined, children: [hasBrand && _jsx(Brand, { brand: brand, logo: logo, href: brandHref }), isFooterPinned ? (_jsx("div", { "data-slot": "sidebar-scroll", className: PINNED.scroll, children: _jsx(Navigation, { items: items, nodes: nav, sections: labelled, shared: shared }) })) : (_jsx(Navigation, { items: items, nodes: nav, sections: labelled, shared: shared })), _jsxs("div", { className: cn(BOTTOM, isFooterPinned ? "shrink-0" : "mt-auto"), children: [hasFooter && _jsx(Account, { footer: footer, avatar: avatar, className: cn(FOOTER_RULE, WHEN_COLLAPSED.clip, avatar != null && WHEN_COLLAPSED.centre) }), _jsx("div", { "data-slot": "sidebar-toggle", className: cn("flex justify-end group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center",
183
+ // Beside the account, under the same divider; alone, it keeps the row's end.
184
+ hasFooter ? cn(FOOTER_RULE, "self-stretch items-center ps-ds-050 group-data-[collapsed]/sidebar:border-t-0 group-data-[collapsed]/sidebar:pt-0 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:border-t-0 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:pt-0") : "col-span-full"), children: _jsx(Tooltip, { content: toggleLabel, placement: "end", children: _jsx(Button, { variant: "subtle", size: "small", iconOnly: true,
185
+ // The panel edge is the inline start: left in LTR, right in RTL.
186
+ iconBefore: direction === "rtl"
187
+ ? collapsed ? "panel-right-open" : "panel-right-close"
188
+ : collapsed ? "panel-left-open" : "panel-left-close", "aria-label": toggleLabel, "aria-expanded": !collapsed, onPress: () => setCollapsed(!collapsed) }) }) })] })] }), _jsx(NavPanel, { isOpen: isMobileOpen, onOpenChange: (open) => onMobileOpenChange?.(open), label: name, side: "start", slot: "sidebar", header: hasBrand ? _jsx(Brand, { brand: brand, logo: logo, href: brandHref }) : undefined, children: isFooterPinned ? (
189
+ // Pinned: the list scrolls inside the panel and the account stays at its bottom edge.
190
+ _jsxs("nav", { className: "flex min-h-0 flex-1 flex-col gap-ds-200", "data-footer-pinned": "", children: [_jsx("div", { "data-slot": "sidebar-scroll", className: PINNED.panelScroll, children: _jsx(Navigation, { items: items, nodes: nav, sections: labelled, shared: { ...shared, collapsed: false } }) }), hasFooter && _jsx(Account, { footer: footer, avatar: avatar, className: cn(FOOTER_RULE, "shrink-0") })] })) : (_jsxs("nav", { className: "flex flex-1 flex-col gap-ds-200", children: [_jsx(Navigation, { items: items, nodes: nav, sections: labelled, shared: { ...shared, collapsed: false } }), hasFooter && _jsx(Account, { footer: footer, avatar: avatar, className: cn(FOOTER_RULE, "mt-auto") })] })) })] }));
191
+ }
192
+ /**
193
+ * The brand link. With a `logo`, the name is a separate span that collapses to visually hidden, so the rail
194
+ * shows the logo alone and the link keeps the name. Without one, the content is kept as given and the 32px box
195
+ * shows its start.
196
+ */
197
+ function Brand({ brand, logo, href }) {
198
+ return (_jsx(AriaLink, { href: href, "data-slot": "sidebar-brand", className: cn("flex min-w-0 shrink-0 items-center gap-ds-100 rounded-ds-medium px-ds-100 text-body-strong text-ds-text outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused", WHEN_COLLAPSED.clip, logo != null && WHEN_COLLAPSED.centre), children: logo == null ? (brand) : (_jsxs(_Fragment, { children: [_jsx("span", { "data-slot": "sidebar-brand-logo", className: "flex shrink-0 items-center", children: logo }), brand != null && _jsx("span", { "data-slot": "sidebar-brand-name", className: cn("min-w-0 truncate", WHEN_COLLAPSED.label), children: brand })] })) }));
199
+ }
200
+ /**
201
+ * The account block. With an `avatar`, the rest of the account is hidden collapsed (it may hold controls, so
202
+ * not merely visually hidden) and the rail shows the Avatar alone.
203
+ */
204
+ function Account({ footer, avatar, className }) {
205
+ return (_jsx("div", { "data-slot": "sidebar-footer", className: cn(FOOTER, className), children: avatar == null ? (footer) : (_jsxs(_Fragment, { children: [_jsx("span", { "data-slot": "sidebar-footer-avatar", className: "flex shrink-0", children: avatar }), footer != null && _jsx("div", { "data-slot": "sidebar-footer-content", className: cn("flex min-w-0 flex-1 items-center gap-ds-100", WHEN_COLLAPSED.hidden), children: footer })] })) }));
206
+ }
207
+ /**
208
+ * The top list, then the labelled sections. One child in its parent either way, so without sections the tree
209
+ * (and the server's useId ids) is exactly what it was before sections existed.
210
+ */
211
+ function Navigation({ items, nodes, sections, shared }) {
212
+ if (!items)
213
+ return _jsx(ComposedNavigation, { nodes: nodes, shared: shared });
214
+ if (!sections)
215
+ return _jsx(Tree, { items: items, shared: shared });
216
+ return (_jsxs(_Fragment, { children: [items.length > 0 && _jsx(Tree, { items: items, shared: shared }), _jsx(Sections, { sections: sections, shared: shared })] }));
217
+ }
218
+ function Sections({ sections, shared }) {
219
+ return (_jsx("div", { "data-slot": "sidebar-sections", className: "flex flex-col gap-ds-100", children: sections.map((section) => (_jsx(Section, { section: section, shared: shared }, section.id))) }));
220
+ }
221
+ /** A labelled section: an overline that names the group, plus a separator that shows only collapsed. */
222
+ function Section({ section, shared }) {
223
+ return (_jsx(SectionBlock, { id: section.id, label: section.label, children: _jsx(Tree, { items: section.items, shared: shared }) }));
224
+ }
225
+ function SectionBlock({ id: sectionId, label, children }) {
226
+ const id = React.useId();
227
+ return (_jsxs("div", { role: "group", "aria-labelledby": id, "data-slot": "sidebar-nav-section", "data-section": sectionId, className: "flex flex-col gap-0.5", children: [_jsx("span", { "aria-hidden": "true", "data-slot": "sidebar-nav-section-separator", className: cn("mx-ds-050 mb-ds-100 border-t border-ds-border", WHEN_COLLAPSED.shown) }), _jsx("span", { id: id, "data-slot": "sidebar-nav-section-label", className: cn(OVERLINE, WHEN_COLLAPSED.label), children: label }), children] }));
228
+ }
229
+ function Tree({ items, shared, nested }) {
230
+ return (_jsx("ul", { "data-slot": nested ? "sidebar-subtree" : "sidebar-tree", className: "flex flex-col gap-0.5", children: items.map((item) => (_jsx("li", { children: item.children ? (_jsx(GroupItem, { item: item, shared: shared, holdsCurrent: contains(item, shared.currentKey), children: _jsx(Tree, { items: item.children, shared: shared, nested: true }) })) : (_jsx(LinkItem, { item: item, shared: shared, nested: nested })) }, item.id))) }));
231
+ }
232
+ function Label({ item }) {
233
+ return (_jsxs(_Fragment, { children: [item.icon && _jsx(IconGlyph, { name: item.icon, "data-slot": "sidebar-item-icon", className: ICON }), _jsx("span", { "data-slot": "sidebar-item-label", className: cn("min-w-0 flex-1 truncate text-start", WHEN_COLLAPSED.label), children: item.label }), item.badge && item.badge.value > 0 && (_jsx("span", { "data-slot": "sidebar-item-badge", className: cn("ms-auto", WHEN_COLLAPSED.badge), children: _jsx(Badge, { variant: "count", value: item.badge.value, tone: item.badge.tone }) }))] }));
234
+ }
235
+ function LinkItem({ item, shared, nested }) {
236
+ const link = (_jsx(AriaLink, { href: item.href, "data-slot": "sidebar-item", "aria-current": item.isCurrent || item.id === shared.currentKey ? "page" : undefined, className: cn("group/row", ROW), children: _jsx(Label, { item: item }) }));
237
+ return shared.collapsed && !nested ? (_jsx(TooltipFor, { content: item.label, placement: "end", children: link })) : (link);
238
+ }
239
+ function GroupItem({ item, shared, holdsCurrent, children }) {
240
+ const [expanded, setExpanded] = React.useState(holdsCurrent);
241
+ // The group of the page's item stays open as the page changes.
242
+ const [wasHolding, setWasHolding] = React.useState(holdsCurrent);
243
+ if (wasHolding !== holdsCurrent) {
244
+ setWasHolding(holdsCurrent);
245
+ if (holdsCurrent)
246
+ setExpanded(true);
247
+ }
248
+ const trigger = (_jsxs(AriaButton, { slot: "trigger", "data-slot": "sidebar-group-trigger", "data-current": holdsCurrent ? "" : undefined,
249
+ // Collapsed, a group's icon opens the sidebar on that group.
250
+ onPress: shared.collapsed ? shared.expand : undefined, className: cn("group/row", ROW, "group-data-[collapsed]/sidebar:data-[current]:bg-ds-background-neutral-hovered [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:data-[current]:bg-ds-background-neutral-hovered"), children: [_jsx(Label, { item: item }), _jsx(IconGlyph, { name: "chevron-down", size: "small", "data-slot": "sidebar-group-chevron", className: cn("text-ds-icon-subtle transition-transform duration-(--ds-duration-fast) group-aria-expanded/row:rotate-180 motion-reduce:transition-none", WHEN_COLLAPSED.hidden) })] }));
251
+ return (_jsxs(Disclosure
252
+ // Collapsed, the panel is hidden, so it reports closed; pressing it opens the sidebar on the group.
253
+ , {
254
+ // Collapsed, the panel is hidden, so it reports closed; pressing it opens the sidebar on the group.
255
+ isExpanded: !shared.collapsed && expanded, onExpandedChange: (next) => setExpanded(shared.collapsed ? true : next), "data-slot": "sidebar-group", children: [shared.collapsed ? (_jsx(TooltipFor, { content: item.label, placement: "end", children: trigger })) : (trigger), _jsx(DisclosurePanel, { "data-slot": "sidebar-group-panel", className: WHEN_COLLAPSED.hidden, children: _jsx("div", { className: "mt-0.5 ps-ds-400", children: children }) })] }));
256
+ }
257
+ // ---- Composed from parts ---------------------------------------------------------------------------------------
258
+ /** The sidebar's state for its parts: the page's item, collapsed or not (never collapsed in the phone panel). */
259
+ const SharedContext = React.createContext(null);
260
+ /** True inside a `SidebarSubmenu`: its items are indented rows with no tooltip of their own. */
261
+ const NestedContext = React.createContext(false);
262
+ function useShared(part) {
263
+ const shared = React.useContext(SharedContext);
264
+ if (!shared)
265
+ throw new Error(`${part} must be inside a Sidebar.`);
266
+ return shared;
267
+ }
268
+ /** The brand at the top, as a child instead of the `brand` prop. */
269
+ export function SidebarHeader({ children }) {
270
+ return _jsx(_Fragment, { children: children });
271
+ }
272
+ /** The account at the bottom, as a child instead of the `footer` prop; it shares a row with the collapse toggle. */
273
+ export function SidebarFooter({ children }) {
274
+ return _jsx(_Fragment, { children: children });
275
+ }
276
+ /** One link in the navigation: at the top, in a `SidebarSection`, or nested in a `SidebarSubmenu`. */
277
+ export function SidebarItem(props) {
278
+ const shared = useShared("SidebarItem");
279
+ const nested = React.useContext(NestedContext);
280
+ return (_jsx("li", { children: _jsx(LinkItem, { item: props, shared: shared, nested: nested }) }));
281
+ }
282
+ /** An item that opens to nested items. It starts open, and stays open, while it holds the page in view. */
283
+ export function SidebarSubmenu({ children, ...item }) {
284
+ const shared = useShared("SidebarSubmenu");
285
+ return (_jsx("li", { children: _jsx(GroupItem, { item: item, shared: shared, holdsCurrent: holdsKey(children, shared.currentKey), children: _jsx(NestedContext.Provider, { value: true, children: _jsx("ul", { "data-slot": "sidebar-subtree", className: "flex flex-col gap-0.5", children: children }) }) }) }));
286
+ }
287
+ /** A labelled block of items with an overline; collapsed, a thin separator stands in for the overline. */
288
+ export function SidebarSection({ id, label, children }) {
289
+ useShared("SidebarSection");
290
+ return (_jsx(SectionBlock, { id: id, label: label, children: _jsx("ul", { "data-slot": "sidebar-tree", className: "flex flex-col gap-0.5", children: children }) }));
291
+ }
292
+ /** Whether an item among these elements (at any depth) is the page in view. */
293
+ function holdsKey(children, key) {
294
+ return React.Children.toArray(children).some((child) => {
295
+ if (!React.isValidElement(child))
296
+ return false;
297
+ return (!!key && child.props.id === key) || !!child.props.isCurrent || holdsKey(child.props.children, key);
298
+ });
299
+ }
300
+ /** Pulls the `SidebarHeader` and `SidebarFooter` out of the children; the rest is the navigation. */
301
+ function splitSlots(children) {
302
+ let header;
303
+ let logo;
304
+ let footer;
305
+ let avatar;
306
+ const nav = [];
307
+ for (const child of React.Children.toArray(children)) {
308
+ if (React.isValidElement(child) && child.type === SidebarHeader) {
309
+ header = child.props.children;
310
+ logo = child.props.logo;
311
+ }
312
+ else if (React.isValidElement(child) && child.type === SidebarFooter) {
313
+ footer = child.props.children;
314
+ avatar = child.props.avatar;
315
+ }
316
+ else
317
+ nav.push(child);
318
+ }
319
+ return { header, logo, footer, avatar, nav };
320
+ }
321
+ /** The composed navigation: loose items in one list, then the sections, as with `items` and `sections`. */
322
+ function ComposedNavigation({ nodes, shared }) {
323
+ const isSection = (node) => React.isValidElement(node) && node.type === SidebarSection;
324
+ const loose = nodes.filter((node) => !isSection(node));
325
+ const sections = nodes.filter(isSection);
326
+ return (_jsxs(SharedContext.Provider, { value: shared, children: [loose.length > 0 && (_jsx("ul", { "data-slot": "sidebar-tree", className: "flex flex-col gap-0.5", children: loose })), sections.length > 0 && (_jsx("div", { "data-slot": "sidebar-sections", className: "flex flex-col gap-ds-100", children: sections }))] }));
327
+ }
328
+ /** Sidebar with its own `motion` (auto, reduce or none); see SidebarBody for the component itself. */
329
+ export function Sidebar({ motion, ...props }) {
330
+ return (_jsx(MotionScope, { motion: motion, children: _jsx(SidebarBody, { ...props }) }));
331
+ }
332
+ //# sourceMappingURL=sidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../src/navigation/sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,MAAM,IAAI,UAAU,EACpB,UAAU,EACV,eAAe,EACf,IAAI,IAAI,QAAQ,EAChB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAuB,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA+FlD,SAAS,UAAU,CAAC,UAAkB;IACpC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACtD,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC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,aAClC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,0BAAc,cAAc,EAAC,SAAS,EAAC,uBAAuB,YAC3D,KAAK,GACH,CACN,EACA,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB,2BAAe,kBAAkB,EAAC,SAAS,EAAC,0BAA0B,YACnE,QAAQ,GACL,CACP,IACsB,CAC1B,CAAC;AACJ,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA6B;IACrE,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,WAAW,OAAM,KAAsB,GAAI,GAChC,CACf,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Button as AriaButton,\n Disclosure,\n DisclosurePanel,\n Link as AriaLink,\n useLocale,\n} from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { MotionScope, type WithMotion } from \"../defaults\";\nimport { Button } from \"../action/button\";\nimport { Badge, type BadgeCountTone } from \"../display/badge\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { collapseSidebarLabel, expandSidebarLabel, mainNavigationLabel } from \"../i18n\";\nimport { Tooltip, TooltipFor } from \"../overlay/floating\";\nimport { NavPanel } from \"./nav-panel\";\nimport { ROOT_ATTRIBUTE } from \"./sidebar-script\";\n\nexport type SidebarItemData = {\n id: string;\n /** A noun for the section (\"Orders\"). */\n label: string;\n /** Lucide name; top-level items carry one (it is all a collapsed sidebar shows). */\n icon?: IconName;\n /** The page; an item with `children` is a group and has none. */\n href?: string;\n /** A count (\"4 new\"): a Badge after the label, on the icon when collapsed. */\n badge?: { value: number; tone?: BadgeCountTone };\n /** Nested items, shown indented on a rail under the group. */\n children?: readonly SidebarItemData[];\n};\n\n/**\n * A labelled block of items: an overline (\"Filo\") over its own list, not collapsible. The group is\n * named by its label (role=\"group\" + aria-labelledby), also when the sidebar is collapsed: the label is then\n * visually hidden and a thin separator marks where the section starts.\n */\nexport type SidebarSectionData = {\n /** Stable key for the section; also on the DOM as `data-section`. Unique among the sections. */\n id: string;\n /** The heading over the items, already translated by the app; it is the group's accessible name. */\n label: string;\n /**\n * The section's items: links or groups with `children`, exactly as in `items`. Icons are Lucide names. Item\n * ids are unique across `items` and every section: `currentKey` marks each item with that id, so a\n * repeated id gives two `aria-current=\"page\"` items (a development warning names it).\n */\n items: readonly SidebarItemData[];\n};\n\nexport type SidebarProps = {\n /** The product name, after `logo` (or the logo and name together). It links to `brandHref`. Or a `SidebarHeader` child. */\n brand?: React.ReactNode;\n /**\n * The app's mark (an Icon or an image) before `brand`. Collapsed, the rail shows it alone, centred; the\n * name stays the link's accessible name. Without it, collapsed shows the start of `brand`.\n */\n logo?: React.ReactNode;\n brandHref?: string;\n /**\n * The top-level items (links, or groups with `children`); five to eight is the comfortable range. With\n * `sections`, these are the unlabelled items above the labelled sections (a dashboard) and may be empty. Ids\n * are unique across `items` and `sections` (a repeated id marks two items as the current page).\n * Leave it out to compose the navigation as children instead.\n */\n items?: readonly SidebarItemData[];\n /**\n * With no `items`: the navigation composed from `SidebarItem`, `SidebarSubmenu` and `SidebarSection`\n * (loose items first, then the sections), plus an optional `SidebarHeader` (instead of `brand`) and\n * `SidebarFooter` (instead of `footer`).\n */\n children?: React.ReactNode;\n /**\n * Labelled sections under `items`, in order. Each is a named group with an overline; collapsed,\n * the overline is visually hidden (the group keeps its name) and a separator stands in for it. Not\n * collapsible. Left out (or empty), the Sidebar renders exactly as before.\n */\n sections?: readonly SidebarSectionData[];\n /** The id of the page's item: marked `aria-current=\"page\"`; its group stays open. */\n currentKey?: string;\n /** The account at the bottom: name and role after `avatar` (or Avatar, name and role together). Or a `SidebarFooter` child. */\n footer?: React.ReactNode;\n /**\n * The account's Avatar before `footer`. Collapsed, the rail shows it alone, centred, and `footer` is hidden.\n * Without it, collapsed shows the start of `footer`.\n */\n avatar?: React.ReactNode;\n /**\n * Keeps the account (`footer`) and the collapse toggle in view at the bottom: the brand stays at\n * the top and only the navigation (`items`, then `sections`) scrolls between them, expanded and\n * collapsed. In the phone panel the account stays at the bottom the same way. The DOM order, and so the Tab\n * order, is the same as without it. Off by default: the whole sidebar scrolls as one, as before.\n */\n isFooterPinned?: boolean;\n /** Icons only (56px), labels in tooltips. Controlled; or `defaultCollapsed` + `onCollapsedChange`. */\n isCollapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (isCollapsed: boolean) => void;\n /**\n * Remembers the collapsed choice in localStorage under this key. Render `sidebarScript(storageKey,\n * { defaultCollapsed })` in <head> as well, with the same `defaultCollapsed`, so the first frame already\n * has the remembered width (no layout jump). Uncontrolled only: with `isCollapsed` the app owns the state.\n */\n storageKey?: string;\n /** Under 1024px the sidebar is a menu panel from the start edge; the app's menu button opens it. */\n isMobileOpen?: boolean;\n onMobileOpenChange?: (isOpen: boolean) => void;\n /** Names the navigation landmark; \"Main menu\" by default. */\n \"aria-label\"?: string;\n};\n\nfunction readStored(storageKey: string): boolean | undefined {\n try {\n const value = window.localStorage.getItem(storageKey);\n return value === \"collapsed\" ? true : value === \"expanded\" ? false : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStored(storageKey: string, collapsed: boolean) {\n try {\n window.localStorage.setItem(storageKey, collapsed ? \"collapsed\" : \"expanded\");\n } catch {\n // Storage can be full or blocked: the choice lasts for this page only.\n }\n}\n\n/**\n * Collapsed styling has two sources so the first frame is right in both modes: the sidebar's own\n * `data-collapsed`, or (remembered choice) the <html> attribute the head script set before React ran.\n * Classes are written out in full so Tailwind finds them.\n */\nconst WHEN_COLLAPSED = {\n root: \"data-[collapsed]:w-14 [:root[data-ds-sidebar=collapsed]_&]:w-14\",\n label:\n \"group-data-[collapsed]/sidebar:sr-only [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:sr-only\",\n hidden:\n \"group-data-[collapsed]/sidebar:hidden [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:hidden\",\n /** Shown only collapsed (the section separator). */\n shown:\n \"hidden group-data-[collapsed]/sidebar:block [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:block\",\n badge:\n \"group-data-[collapsed]/sidebar:absolute group-data-[collapsed]/sidebar:-top-1 group-data-[collapsed]/sidebar:end-0 \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:absolute [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:-top-1 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:end-0\",\n /**\n * The account in the 56px rail: exactly the 32px avatar, no padding around it, centred. The 8px\n * padding it kept before cut the avatar in half.\n */\n clip:\n \"group-data-[collapsed]/sidebar:w-8 group-data-[collapsed]/sidebar:flex-none group-data-[collapsed]/sidebar:justify-start group-data-[collapsed]/sidebar:overflow-hidden group-data-[collapsed]/sidebar:p-0 \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:w-8 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:flex-none [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-start [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:overflow-hidden [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:p-0\",\n /** With a `logo` or `avatar`: only that mark is left, so the 32px box centres it. */\n centre:\n \"group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center\",\n} as const;\n\n/**\n * The scrollbar on the sidebar's link list, as on ScrollArea: thin, no track, its thumb shown\n * only on hover, keyboard focus inside the list, or while scrolling. A long list no longer shows a grey bar the full\n * height of the panel. Native underneath, so wheel, touch and keyboard scroll as before.\n */\nconst SCROLLBAR =\n \"[scrollbar-width:thin] [scrollbar-color:transparent_transparent] \" +\n \"hover:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent] \" +\n \"focus-within:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]\";\n\n/**\n * The bottom block: a two-column grid, so the account and the collapse toggle share one row (the\n * account takes the room, the toggle sits at its end) A divider sets\n * the account row off from the links. Collapsed, the rail is one column: the account above the toggle, both centred.\n * The children and their order are unchanged.\n */\nconst BOTTOM =\n // No column gap: the divider over the account and the toggle reads as one line.\n \"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-0 gap-y-ds-100 \" +\n \"group-data-[collapsed]/sidebar:grid-cols-1 group-data-[collapsed]/sidebar:justify-items-center \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:grid-cols-1 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-items-center\";\n/** The account: the room of the row. Square, so the divider over it ends straight; its Pressable keeps its own radius. */\nconst FOOTER = \"flex min-w-0 items-center gap-ds-100 p-ds-050\";\n/** The divider runs the full width of the account row: over the account and the toggle alike. */\nconst FOOTER_RULE = \"border-t border-ds-border pt-ds-150\";\n\n/**\n * `isFooterPinned`: the scrolling part between the brand and the pinned bottom. It reaches out over\n * the sidebar's padding (and takes it back inside), so the scrollbar sits on the sidebar's edge; its scroll padding\n * matches that inset, so a row that focus scrolls into view stops short of the edge and its ring is never clipped. Collapsed, the 56px rail has no room for a scrollbar beside the icons,\n * so it is hidden there (wheel, touch and focus still scroll). Written out in full so Tailwind finds them.\n */\nconst PINNED = {\n scroll:\n \"-mx-ds-150 -my-ds-050 flex min-h-0 flex-1 flex-col gap-ds-200 overflow-x-hidden overflow-y-auto overscroll-contain px-ds-150 py-ds-050 scroll-py-ds-050 \" + SCROLLBAR + \" \" +\n \"group-data-[collapsed]/sidebar:[scrollbar-width:none] [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:[scrollbar-width:none]\",\n /** The phone panel: its content box has 16px padding; the list scrolls, the account stays below it. */\n panelScroll: \"-mx-ds-200 -my-ds-050 flex min-h-0 flex-1 flex-col gap-ds-200 overflow-y-auto overscroll-contain px-ds-200 py-ds-050 scroll-py-ds-050 \" + SCROLLBAR,\n} as const;\n\n/** The overline over a labelled section. */\nconst OVERLINE = \"px-ds-100 pt-ds-100 pb-ds-050 text-heading-xxsmall text-ds-text-subtlest\";\n\nconst ROW =\n \"relative flex h-8 w-full items-center gap-ds-100 rounded-ds-medium px-ds-100 text-body font-medium text-ds-text-subtle outline-hidden \" +\n \"transition-colors duration-(--ds-duration-fast) motion-reduce:transition-none \" +\n \"data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[hovered]:text-ds-text data-[pressed]:bg-ds-background-neutral-pressed \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused \" +\n // The page in view: a soft neutral fill and the full text color, no edge marker (a 2px inset bent into a bracket on\n // the rounded row). One step darker than the sunken sidebar ground, which equals ds-background-neutral.\n \"aria-[current=page]:bg-ds-background-neutral-hovered aria-[current=page]:text-ds-text aria-[current=page]:data-[hovered]:bg-ds-background-neutral-hovered \" +\n // Collapsed: the icon alone, centred in the 56px rail.\n \"group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center\";\n\nconst ICON = \"text-ds-icon-subtle group-aria-[current=page]/row:text-ds-icon-brand\";\n\nconst contains = (item: SidebarItemData, key: string | undefined): boolean =>\n !!key && (item.id === key || !!item.children?.some((child) => contains(child, key)));\n\ntype Shared = { currentKey?: string; collapsed: boolean; expand: () => void };\n\n/** Every item id in the trees, depth first, repeats included. */\nfunction itemIds(items: readonly SidebarItemData[], into: string[] = []): string[] {\n for (const item of items) {\n into.push(item.id);\n if (item.children) itemIds(item.children, into);\n }\n return into;\n}\n\n/**\n * Item ids that repeat across `items` and `sections`, said once per set of ids, in development only\n * (the Table's repeated-id warning does the same). A repeated id would mark two items `aria-current=\"page\"`.\n *\n */\nfunction repeatedIds(items: readonly SidebarItemData[], sections: readonly SidebarSectionData[] | undefined) {\n const ids = itemIds(items);\n for (const section of sections ?? []) itemIds(section.items, ids);\n const seen = new Set<string>();\n const repeated = new Set<string>();\n for (const id of ids) (seen.has(id) ? repeated : seen).add(id);\n return [...repeated].map((id) => JSON.stringify(id)).join(\", \");\n}\n\nfunction useRepeatedIdWarning(items: readonly SidebarItemData[], sections: readonly SidebarSectionData[] | undefined) {\n // Production never warns, so it never walks the trees either; the hooks below still run in order.\n const signature = process.env.NODE_ENV === \"production\" ? \"\" : repeatedIds(items, sections);\n const warned = React.useRef<Set<string> | null>(null);\n React.useEffect(() => {\n if (process.env.NODE_ENV === \"production\" || !signature) return;\n warned.current ??= new Set();\n if (warned.current.has(signature)) return;\n warned.current.add(signature);\n console.warn(`Sidebar: the item ids ${signature} repeat across items and sections. Give every item its own id; currentKey marks each item with that id as the current page.`);\n }, [signature]);\n}\n\n/**\n * The main navigation of admin apps: brand, sections with nested items, optional\n * labelled `sections` and the account. Collapses to 56px icons\n * (tooltips carry the labels); under 1024px it is a menu panel from the start edge.\n */\nfunction SidebarBody({\n brand: brandProp,\n logo: logoProp,\n brandHref = \"/\",\n items,\n children,\n sections,\n currentKey,\n footer: footerProp,\n avatar: avatarProp,\n isFooterPinned = false,\n isCollapsed,\n defaultCollapsed = false,\n onCollapsedChange,\n storageKey,\n isMobileOpen = false,\n onMobileOpenChange,\n \"aria-label\": label,\n}: SidebarProps) {\n const { locale, direction } = useLocale();\n const slots = splitSlots(children);\n const { nav } = slots;\n const brand = brandProp ?? slots.header;\n const logo = logoProp ?? slots.logo;\n const footer = footerProp ?? slots.footer;\n const avatar = avatarProp ?? slots.avatar;\n const hasBrand = brand != null || logo != null;\n const hasFooter = footer != null || avatar != null;\n const name = label ?? mainNavigationLabel(locale);\n const [own, setOwn] = React.useState(defaultCollapsed);\n // The remembered choice is read after hydration (the head script already painted it).\n React.useLayoutEffect(() => {\n if (!storageKey) return;\n const stored = readStored(storageKey);\n if (stored !== undefined) setOwn(stored);\n }, [storageKey]);\n const collapsed = isCollapsed ?? own;\n React.useLayoutEffect(() => {\n if (storageKey) document.documentElement.setAttribute(ROOT_ATTRIBUTE, collapsed ? \"collapsed\" : \"expanded\");\n }, [storageKey, collapsed]);\n const setCollapsed = (next: boolean) => {\n if (isCollapsed === undefined) setOwn(next);\n if (storageKey) writeStored(storageKey, next);\n onCollapsedChange?.(next);\n };\n const toggleLabel = collapsed ? expandSidebarLabel(locale) : collapseSidebarLabel(locale);\n const shared: Shared = { currentKey, collapsed, expand: () => setCollapsed(false) };\n const labelled = sections && sections.length > 0 ? sections : undefined;\n useRepeatedIdWarning(items ?? [], labelled);\n\n return (\n <>\n <nav\n aria-label={name}\n data-slot=\"sidebar\"\n // Remembered choice: the <html> attribute styles it, so the server and first client render agree.\n data-collapsed={!storageKey && collapsed ? \"\" : undefined}\n className={cn(\n \"group/sidebar sticky top-0 hidden h-dvh max-h-full w-60 shrink-0 flex-col gap-ds-200 overflow-x-hidden overflow-y-auto border-e border-ds-border bg-ds-surface-sunken px-ds-150 py-ds-200 lg:flex\",\n \"transition-[width] duration-(--ds-duration-medium) ease-ds-standard motion-reduce:transition-none\",\n WHEN_COLLAPSED.root,\n // Pinned: the nav no longer scrolls as one; its middle part does.\n isFooterPinned ? \"overflow-y-hidden\" : SCROLLBAR,\n )}\n data-footer-pinned={isFooterPinned ? \"\" : undefined}\n >\n {hasBrand && <Brand brand={brand} logo={logo} href={brandHref} />}\n {isFooterPinned ? (\n <div data-slot=\"sidebar-scroll\" className={PINNED.scroll}>\n <Navigation items={items} nodes={nav} sections={labelled} shared={shared} />\n </div>\n ) : (\n <Navigation items={items} nodes={nav} sections={labelled} shared={shared} />\n )}\n <div className={cn(BOTTOM, isFooterPinned ? \"shrink-0\" : \"mt-auto\")}>\n {hasFooter && <Account footer={footer} avatar={avatar} className={cn(FOOTER_RULE, WHEN_COLLAPSED.clip, avatar != null && WHEN_COLLAPSED.centre)} />}\n <div\n data-slot=\"sidebar-toggle\"\n className={cn(\n \"flex justify-end group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center\",\n // Beside the account, under the same divider; alone, it keeps the row's end.\n hasFooter ? cn(FOOTER_RULE, \"self-stretch items-center ps-ds-050 group-data-[collapsed]/sidebar:border-t-0 group-data-[collapsed]/sidebar:pt-0 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:border-t-0 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:pt-0\") : \"col-span-full\",\n )}\n >\n <Tooltip content={toggleLabel} placement=\"end\">\n <Button\n variant=\"subtle\"\n size=\"small\"\n iconOnly\n // The panel edge is the inline start: left in LTR, right in RTL.\n iconBefore={\n direction === \"rtl\"\n ? collapsed ? \"panel-right-open\" : \"panel-right-close\"\n : collapsed ? \"panel-left-open\" : \"panel-left-close\"\n }\n aria-label={toggleLabel}\n aria-expanded={!collapsed}\n onPress={() => setCollapsed(!collapsed)}\n />\n </Tooltip>\n </div>\n </div>\n </nav>\n <NavPanel\n isOpen={isMobileOpen}\n onOpenChange={(open) => onMobileOpenChange?.(open)}\n label={name}\n side=\"start\"\n slot=\"sidebar\"\n header={hasBrand ? <Brand brand={brand} logo={logo} href={brandHref} /> : undefined}\n >\n {/* The dialog already carries the name; a second landmark name would be read twice. */}\n {isFooterPinned ? (\n // Pinned: the list scrolls inside the panel and the account stays at its bottom edge.\n <nav className=\"flex min-h-0 flex-1 flex-col gap-ds-200\" data-footer-pinned=\"\">\n <div data-slot=\"sidebar-scroll\" className={PINNED.panelScroll}>\n <Navigation items={items} nodes={nav} sections={labelled} shared={{ ...shared, collapsed: false }} />\n </div>\n {hasFooter && <Account footer={footer} avatar={avatar} className={cn(FOOTER_RULE, \"shrink-0\")} />}\n </nav>\n ) : (\n <nav className=\"flex flex-1 flex-col gap-ds-200\">\n <Navigation items={items} nodes={nav} sections={labelled} shared={{ ...shared, collapsed: false }} />\n {hasFooter && <Account footer={footer} avatar={avatar} className={cn(FOOTER_RULE, \"mt-auto\")} />}\n </nav>\n )}\n </NavPanel>\n </>\n );\n}\n\n/**\n * The brand link. With a `logo`, the name is a separate span that collapses to visually hidden, so the rail\n * shows the logo alone and the link keeps the name. Without one, the content is kept as given and the 32px box\n * shows its start.\n */\nfunction Brand({ brand, logo, href }: { brand: React.ReactNode; logo: React.ReactNode; href: string }) {\n return (\n <AriaLink\n href={href}\n data-slot=\"sidebar-brand\"\n className={cn(\n \"flex min-w-0 shrink-0 items-center gap-ds-100 rounded-ds-medium px-ds-100 text-body-strong text-ds-text outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\",\n WHEN_COLLAPSED.clip,\n logo != null && WHEN_COLLAPSED.centre,\n )}\n >\n {logo == null ? (\n brand\n ) : (\n <>\n <span data-slot=\"sidebar-brand-logo\" className=\"flex shrink-0 items-center\">{logo}</span>\n {brand != null && <span data-slot=\"sidebar-brand-name\" className={cn(\"min-w-0 truncate\", WHEN_COLLAPSED.label)}>{brand}</span>}\n </>\n )}\n </AriaLink>\n );\n}\n\n/**\n * The account block. With an `avatar`, the rest of the account is hidden collapsed (it may hold controls, so\n * not merely visually hidden) and the rail shows the Avatar alone.\n */\nfunction Account({ footer, avatar, className }: { footer: React.ReactNode; avatar: React.ReactNode; className?: string }) {\n return (\n <div data-slot=\"sidebar-footer\" className={cn(FOOTER, className)}>\n {avatar == null ? (\n footer\n ) : (\n <>\n <span data-slot=\"sidebar-footer-avatar\" className=\"flex shrink-0\">{avatar}</span>\n {footer != null && <div data-slot=\"sidebar-footer-content\" className={cn(\"flex min-w-0 flex-1 items-center gap-ds-100\", WHEN_COLLAPSED.hidden)}>{footer}</div>}\n </>\n )}\n </div>\n );\n}\n\n/**\n * The top list, then the labelled sections. One child in its parent either way, so without sections the tree\n * (and the server's useId ids) is exactly what it was before sections existed.\n */\nfunction Navigation({ items, nodes, sections, shared }: { items?: readonly SidebarItemData[]; nodes: React.ReactNode[]; sections?: readonly SidebarSectionData[]; shared: Shared }) {\n if (!items) return <ComposedNavigation nodes={nodes} shared={shared} />;\n if (!sections) return <Tree items={items} shared={shared} />;\n return (\n <>\n {/* With sections, an empty top list is left out; without them it renders (also empty), as before. */}\n {items.length > 0 && <Tree items={items} shared={shared} />}\n <Sections sections={sections} shared={shared} />\n </>\n );\n}\n\nfunction Sections({ sections, shared }: { sections: readonly SidebarSectionData[]; shared: Shared }) {\n return (\n <div data-slot=\"sidebar-sections\" className=\"flex flex-col gap-ds-100\">\n {sections.map((section) => (\n <Section key={section.id} section={section} shared={shared} />\n ))}\n </div>\n );\n}\n\n/** A labelled section: an overline that names the group, plus a separator that shows only collapsed. */\nfunction Section({ section, shared }: { section: SidebarSectionData; shared: Shared }) {\n return (\n <SectionBlock id={section.id} label={section.label}>\n <Tree items={section.items} shared={shared} />\n </SectionBlock>\n );\n}\n\nfunction SectionBlock({ id: sectionId, label, children }: { id?: string; label: string; children: React.ReactNode }) {\n const id = React.useId();\n return (\n <div role=\"group\" aria-labelledby={id} data-slot=\"sidebar-nav-section\" data-section={sectionId} className=\"flex flex-col gap-0.5\">\n <span aria-hidden=\"true\" data-slot=\"sidebar-nav-section-separator\" className={cn(\"mx-ds-050 mb-ds-100 border-t border-ds-border\", WHEN_COLLAPSED.shown)} />\n <span id={id} data-slot=\"sidebar-nav-section-label\" className={cn(OVERLINE, WHEN_COLLAPSED.label)}>\n {label}\n </span>\n {children}\n </div>\n );\n}\n\nfunction Tree({ items, shared, nested }: { items: readonly SidebarItemData[]; shared: Shared; nested?: boolean }) {\n return (\n <ul data-slot={nested ? \"sidebar-subtree\" : \"sidebar-tree\"} className=\"flex flex-col gap-0.5\">\n {items.map((item) => (\n <li key={item.id}>\n {item.children ? (\n <GroupItem item={item} shared={shared} holdsCurrent={contains(item, shared.currentKey)}>\n <Tree items={item.children} shared={shared} nested />\n </GroupItem>\n ) : (\n <LinkItem item={item} shared={shared} nested={nested} />\n )}\n </li>\n ))}\n </ul>\n );\n}\n\n/** What a row shows, from data or from a `SidebarItem`/`SidebarSubmenu`. */\ntype Entry = Pick<SidebarItemData, \"id\" | \"label\" | \"icon\" | \"href\" | \"badge\"> & { isCurrent?: boolean };\n\nfunction Label({ item }: { item: Entry }) {\n return (\n <>\n {item.icon && <IconGlyph name={item.icon} data-slot=\"sidebar-item-icon\" className={ICON} />}\n <span data-slot=\"sidebar-item-label\" className={cn(\"min-w-0 flex-1 truncate text-start\", WHEN_COLLAPSED.label)}>\n {item.label}\n </span>\n {item.badge && item.badge.value > 0 && (\n <span data-slot=\"sidebar-item-badge\" className={cn(\"ms-auto\", WHEN_COLLAPSED.badge)}>\n <Badge variant=\"count\" value={item.badge.value} tone={item.badge.tone} />\n </span>\n )}\n </>\n );\n}\n\nfunction LinkItem({ item, shared, nested }: { item: Entry; shared: Shared; nested?: boolean }) {\n const link = (\n <AriaLink\n href={item.href}\n data-slot=\"sidebar-item\"\n aria-current={item.isCurrent || item.id === shared.currentKey ? \"page\" : undefined}\n className={cn(\"group/row\", ROW)}\n >\n <Label item={item} />\n </AriaLink>\n );\n return shared.collapsed && !nested ? (\n <TooltipFor content={item.label} placement=\"end\">\n {link}\n </TooltipFor>\n ) : (\n link\n );\n}\n\nfunction GroupItem({ item, shared, holdsCurrent, children }: { item: Entry; shared: Shared; holdsCurrent: boolean; children: React.ReactNode }) {\n const [expanded, setExpanded] = React.useState(holdsCurrent);\n // The group of the page's item stays open as the page changes.\n const [wasHolding, setWasHolding] = React.useState(holdsCurrent);\n if (wasHolding !== holdsCurrent) {\n setWasHolding(holdsCurrent);\n if (holdsCurrent) setExpanded(true);\n }\n const trigger = (\n <AriaButton\n slot=\"trigger\"\n data-slot=\"sidebar-group-trigger\"\n // Collapsed, the group holding the page is the only mark of where the reader is.\n data-current={holdsCurrent ? \"\" : undefined}\n // Collapsed, a group's icon opens the sidebar on that group.\n onPress={shared.collapsed ? shared.expand : undefined}\n className={cn(\n \"group/row\",\n ROW,\n \"group-data-[collapsed]/sidebar:data-[current]:bg-ds-background-neutral-hovered [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:data-[current]:bg-ds-background-neutral-hovered\",\n )}\n >\n <Label item={item} />\n <IconGlyph\n name=\"chevron-down\"\n size=\"small\"\n data-slot=\"sidebar-group-chevron\"\n className={cn(\"text-ds-icon-subtle transition-transform duration-(--ds-duration-fast) group-aria-expanded/row:rotate-180 motion-reduce:transition-none\", WHEN_COLLAPSED.hidden)}\n />\n </AriaButton>\n );\n return (\n <Disclosure\n // Collapsed, the panel is hidden, so it reports closed; pressing it opens the sidebar on the group.\n isExpanded={!shared.collapsed && expanded}\n onExpandedChange={(next) => setExpanded(shared.collapsed ? true : next)}\n data-slot=\"sidebar-group\"\n >\n {shared.collapsed ? (\n <TooltipFor content={item.label} placement=\"end\">\n {trigger}\n </TooltipFor>\n ) : (\n trigger\n )}\n <DisclosurePanel data-slot=\"sidebar-group-panel\" className={WHEN_COLLAPSED.hidden}>\n <div className=\"mt-0.5 ps-ds-400\">{children}</div>\n </DisclosurePanel>\n </Disclosure>\n );\n}\n\n\n// ---- Composed from parts ---------------------------------------------------------------------------------------\n\n/** The sidebar's state for its parts: the page's item, collapsed or not (never collapsed in the phone panel). */\nconst SharedContext = React.createContext<Shared | null>(null);\n/** True inside a `SidebarSubmenu`: its items are indented rows with no tooltip of their own. */\nconst NestedContext = React.createContext(false);\n\nfunction useShared(part: string): Shared {\n const shared = React.useContext(SharedContext);\n if (!shared) throw new Error(`${part} must be inside a Sidebar.`);\n return shared;\n}\n\nexport type SidebarHeaderProps = {\n /** The product name (or the logo and name together); it links to the Sidebar's `brandHref`. */\n children?: React.ReactNode;\n /** The app's mark before the name; collapsed, the rail shows it alone. As the Sidebar's `logo`. */\n logo?: React.ReactNode;\n};\n\n/** The brand at the top, as a child instead of the `brand` prop. */\nexport function SidebarHeader({ children }: SidebarHeaderProps) {\n return <>{children}</>;\n}\n\nexport type SidebarFooterProps = {\n /** The account's name and role (or Avatar, name and role together). */\n children?: React.ReactNode;\n /** The account's Avatar before the rest; collapsed, the rail shows it alone. As the Sidebar's `avatar`. */\n avatar?: React.ReactNode;\n};\n\n/** The account at the bottom, as a child instead of the `footer` prop; it shares a row with the collapse toggle. */\nexport function SidebarFooter({ children }: SidebarFooterProps) {\n return <>{children}</>;\n}\n\nexport type SidebarItemProps = {\n /** Unique in the sidebar; `currentKey` matches it. */\n id: string;\n /** A noun for the page (\"Orders\"); also the tooltip when the sidebar is collapsed. */\n label: string;\n /** Lucide name; top-level items carry one (it is all a collapsed sidebar shows). */\n icon?: IconName;\n href?: string;\n /** A count (\"4 new\"): a Badge after the label, on the icon when collapsed. */\n badge?: { value: number; tone?: BadgeCountTone };\n /** Marks this item as the page in view, instead of the Sidebar's `currentKey`. */\n isCurrent?: boolean;\n};\n\n/** One link in the navigation: at the top, in a `SidebarSection`, or nested in a `SidebarSubmenu`. */\nexport function SidebarItem(props: SidebarItemProps) {\n const shared = useShared(\"SidebarItem\");\n const nested = React.useContext(NestedContext);\n return (\n <li>\n <LinkItem item={props} shared={shared} nested={nested} />\n </li>\n );\n}\n\nexport type SidebarSubmenuProps = Omit<SidebarItemProps, \"href\" | \"isCurrent\"> & {\n /** The nested `SidebarItem`s, shown indented when it is open. */\n children: React.ReactNode;\n};\n\n/** An item that opens to nested items. It starts open, and stays open, while it holds the page in view. */\nexport function SidebarSubmenu({ children, ...item }: SidebarSubmenuProps) {\n const shared = useShared(\"SidebarSubmenu\");\n return (\n <li>\n <GroupItem item={item} shared={shared} holdsCurrent={holdsKey(children, shared.currentKey)}>\n <NestedContext.Provider value={true}>\n <ul data-slot=\"sidebar-subtree\" className=\"flex flex-col gap-0.5\">\n {children}\n </ul>\n </NestedContext.Provider>\n </GroupItem>\n </li>\n );\n}\n\nexport type SidebarSectionProps = {\n /** Also on the DOM as `data-section`. */\n id?: string;\n /** The overline over the items, already translated; it names the group, also when collapsed. */\n label: string;\n /** `SidebarItem`s and `SidebarSubmenu`s. */\n children: React.ReactNode;\n};\n\n/** A labelled block of items with an overline; collapsed, a thin separator stands in for the overline. */\nexport function SidebarSection({ id, label, children }: SidebarSectionProps) {\n useShared(\"SidebarSection\");\n return (\n <SectionBlock id={id} label={label}>\n <ul data-slot=\"sidebar-tree\" className=\"flex flex-col gap-0.5\">\n {children}\n </ul>\n </SectionBlock>\n );\n}\n\n/** Whether an item among these elements (at any depth) is the page in view. */\nfunction holdsKey(children: React.ReactNode, key: string | undefined): boolean {\n return React.Children.toArray(children).some((child) => {\n if (!React.isValidElement<{ id?: string; isCurrent?: boolean; children?: React.ReactNode }>(child)) return false;\n return (!!key && child.props.id === key) || !!child.props.isCurrent || holdsKey(child.props.children, key);\n });\n}\n\n/** Pulls the `SidebarHeader` and `SidebarFooter` out of the children; the rest is the navigation. */\nfunction splitSlots(children: React.ReactNode) {\n let header: React.ReactNode;\n let logo: React.ReactNode;\n let footer: React.ReactNode;\n let avatar: React.ReactNode;\n const nav: React.ReactNode[] = [];\n for (const child of React.Children.toArray(children)) {\n if (React.isValidElement<SidebarHeaderProps>(child) && child.type === SidebarHeader) {\n header = child.props.children;\n logo = child.props.logo;\n } else if (React.isValidElement<SidebarFooterProps>(child) && child.type === SidebarFooter) {\n footer = child.props.children;\n avatar = child.props.avatar;\n } else nav.push(child);\n }\n return { header, logo, footer, avatar, nav };\n}\n\n/** The composed navigation: loose items in one list, then the sections, as with `items` and `sections`. */\nfunction ComposedNavigation({ nodes, shared }: { nodes: React.ReactNode[]; shared: Shared }) {\n const isSection = (node: React.ReactNode) => React.isValidElement(node) && node.type === SidebarSection;\n const loose = nodes.filter((node) => !isSection(node));\n const sections = nodes.filter(isSection);\n return (\n <SharedContext.Provider value={shared}>\n {loose.length > 0 && (\n <ul data-slot=\"sidebar-tree\" className=\"flex flex-col gap-0.5\">\n {loose}\n </ul>\n )}\n {sections.length > 0 && (\n <div data-slot=\"sidebar-sections\" className=\"flex flex-col gap-ds-100\">\n {sections}\n </div>\n )}\n </SharedContext.Provider>\n );\n}\n\n/** Sidebar with its own `motion` (auto, reduce or none); see SidebarBody for the component itself. */\nexport function Sidebar({ motion, ...props }: SidebarProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <SidebarBody {...(props as SidebarProps)} />\n </MotionScope>\n );\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ export type SkipLinkProps = {
3
+ /** Where focus goes: the page's main region by default. */
4
+ target?: string;
5
+ /** "Skip to content" by default. */
6
+ children?: React.ReactNode;
7
+ };
8
+ /**
9
+ * The first focusable element of a page: hidden until focused, then a chip that moves focus past the
10
+ * navigation to the page's main content. The target is made focusable for the jump only.
11
+ */
12
+ export declare function SkipLink({ target, children }: SkipLinkProps): React.JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { useLocale } from "react-aria-components";
5
+ import { cn } from "../utils.js";
6
+ import { skipToContentLabel } from "../i18n.js";
7
+ import { LAYER } from "../layers.js";
8
+ /**
9
+ * The first focusable element of a page: hidden until focused, then a chip that moves focus past the
10
+ * navigation to the page's main content. The target is made focusable for the jump only.
11
+ */
12
+ export function SkipLink({ target = "main", children }) {
13
+ const { locale } = useLocale();
14
+ return (_jsx("a", {
15
+ // An id target is a real fragment link, so it works before hydration too.
16
+ href: target.startsWith("#") ? target : "#", "data-slot": "skip-link", onClick: (event) => {
17
+ const main = document.querySelector(target);
18
+ if (!main)
19
+ return;
20
+ event.preventDefault();
21
+ if (!main.hasAttribute("tabindex")) {
22
+ main.setAttribute("tabindex", "-1");
23
+ // Focusable for the jump only: the region leaves the tab order again once focus moves on.
24
+ main.addEventListener("blur", () => main.removeAttribute("tabindex"), { once: true });
25
+ }
26
+ main.focus();
27
+ main.scrollIntoView?.();
28
+ }, className: cn("sr-only rounded-ds-medium bg-ds-surface-overlay px-ds-150 py-ds-100 text-body-strong text-ds-text shadow-ds-overlay", "focus:not-sr-only focus:fixed focus:start-ds-200 focus:top-ds-200 focus:outline-hidden focus:inset-ring-2 focus:inset-ring-ds-border-focused", LAYER.skipLink), children: children ?? skipToContentLabel(locale) }));
29
+ }
30
+ //# sourceMappingURL=skip-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skip-link.js","sourceRoot":"","sources":["../../src/navigation/skip-link.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AASlC;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAiB;IACnE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,OAAO,CACL;QACE,0EAA0E;QAC1E,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,eACjC,WAAW,EACrB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAc,MAAM,CAAC,CAAC;YACzD,IAAI,CAAC,IAAI;gBAAE,OAAO;YAClB,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;gBACnC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;gBACpC,0FAA0F;gBAC1F,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YACxF,CAAC;YACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;QAC1B,CAAC,EACD,SAAS,EAAE,EAAE,CACX,qHAAqH,EACrH,8IAA8I,EAC9I,KAAK,CAAC,QAAQ,CACf,YAEA,QAAQ,IAAI,kBAAkB,CAAC,MAAM,CAAC,GACrC,CACL,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useLocale } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { skipToContentLabel } from \"../i18n\";\nimport { LAYER } from \"../layers\";\n\nexport type SkipLinkProps = {\n /** Where focus goes: the page's main region by default. */\n target?: string;\n /** \"Skip to content\" by default. */\n children?: React.ReactNode;\n};\n\n/**\n * The first focusable element of a page: hidden until focused, then a chip that moves focus past the\n * navigation to the page's main content. The target is made focusable for the jump only.\n */\nexport function SkipLink({ target = \"main\", children }: SkipLinkProps) {\n const { locale } = useLocale();\n return (\n <a\n // An id target is a real fragment link, so it works before hydration too.\n href={target.startsWith(\"#\") ? target : \"#\"}\n data-slot=\"skip-link\"\n onClick={(event) => {\n const main = document.querySelector<HTMLElement>(target);\n if (!main) return;\n event.preventDefault();\n if (!main.hasAttribute(\"tabindex\")) {\n main.setAttribute(\"tabindex\", \"-1\");\n // Focusable for the jump only: the region leaves the tab order again once focus moves on.\n main.addEventListener(\"blur\", () => main.removeAttribute(\"tabindex\"), { once: true });\n }\n main.focus();\n main.scrollIntoView?.();\n }}\n className={cn(\n \"sr-only rounded-ds-medium bg-ds-surface-overlay px-ds-150 py-ds-100 text-body-strong text-ds-text shadow-ds-overlay\",\n \"focus:not-sr-only focus:fixed focus:start-ds-200 focus:top-ds-200 focus:outline-hidden focus:inset-ring-2 focus:inset-ring-ds-border-focused\",\n LAYER.skipLink,\n )}\n >\n {children ?? skipToContentLabel(locale)}\n </a>\n );\n}\n"]}
@@ -0,0 +1,50 @@
1
+ import * as React from "react";
2
+ export type StepperStep = {
3
+ id: string;
4
+ /** The step's name ("Extras"); a noun, one or two words. */
5
+ label: string;
6
+ /** Vertical only: one line under the name ("Name, price and availability"). */
7
+ description?: string;
8
+ /** Done; by default every step before `currentStep` is. Set it on any step and only the steps marked are done. */
9
+ isDone?: boolean;
10
+ /** A journey across pages (signup → payment → setup): where this step stands, in words and an icon. */
11
+ status?: StepStatus;
12
+ /** Replaces the step's status words ("With us · 1–2 business days"). */
13
+ statusText?: string;
14
+ };
15
+ /** A step that is waiting on someone or went wrong, shown in words and an icon, never colour alone. */
16
+ export type StepStatus = "needs-you" | "with-provider" | "failed";
17
+ export type StepperProps = {
18
+ /** Three to six steps, in order. */
19
+ steps: readonly StepperStep[];
20
+ /** The step the reader is on: `aria-current="step"`. Ignored with `isComplete`. */
21
+ currentStep: string;
22
+ /**
23
+ * The flow is finished: every step shows its done state and none is current, so no step
24
+ * carries `aria-current`. The list is named with the overall state ("Progress, All steps done"),
25
+ * and the narrow one-line form reads "All steps done" over a full bar. A step's `status` or
26
+ * `statusText` still speaks for it, in the list and, under the done line, in the narrow form
27
+ * too ("Domain · With us"). A finished flow cannot also have a `failed` or `needs-you` step: that
28
+ * pairing contradicts itself and warns in development; settle the step first. Left out, nothing changes.
29
+ */
30
+ isComplete?: boolean;
31
+ /** Makes done steps pressable (back to an earlier step). Leave it out where the flow cannot go back. */
32
+ onStepPress?: (id: string) => void;
33
+ /** `horizontal` for a flow on one page (checkout, signup); `vertical` for checklists (onboarding, setup). */
34
+ orientation?: "horizontal" | "vertical";
35
+ /**
36
+ * Done and current steps say so in words too ("Done", "Now"), as on a journey across pages. On by default when
37
+ * any step has a `status`.
38
+ */
39
+ showStatus?: boolean;
40
+ /** Names the list; "Progress" by default. */
41
+ "aria-label"?: string;
42
+ };
43
+ /**
44
+ * Progress through an ordered flow and where the reader is in it. Horizontal: one 4px bar per step,
45
+ * "Step 3" over the name; in a container narrower than 36rem it becomes one line ("Step 3 / 5 · Domain")
46
+ * over a single bar, so a name never breaks letter by letter. Vertical: 24px nodes on a rail. A step's
47
+ * status is said in words and an icon, never by colour alone. `isComplete` shows a finished flow: every
48
+ * step done, none current.
49
+ */
50
+ export declare function Stepper(props: StepperProps): React.JSX.Element;