@42-central/ui-react 0.24.0 → 0.26.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 (294) hide show
  1. package/dist/{chunk-YWTOW7PZ.js → chunk-276RL7FX.js} +10 -10
  2. package/dist/{chunk-YWTOW7PZ.js.map → chunk-276RL7FX.js.map} +1 -1
  3. package/dist/{chunk-FUNTJZX7.js → chunk-2CL3FKEY.js} +3 -3
  4. package/dist/{chunk-FUNTJZX7.js.map → chunk-2CL3FKEY.js.map} +1 -1
  5. package/dist/{chunk-YPFSRZ3T.js → chunk-2NTCQIRP.js} +5 -5
  6. package/dist/{chunk-YPFSRZ3T.js.map → chunk-2NTCQIRP.js.map} +1 -1
  7. package/dist/{chunk-D3JYDAUZ.js → chunk-2TZU4LSX.js} +4 -4
  8. package/dist/{chunk-D3JYDAUZ.js.map → chunk-2TZU4LSX.js.map} +1 -1
  9. package/dist/{chunk-DJLNGWMM.js → chunk-6IRMKF5T.js} +3 -3
  10. package/dist/{chunk-DJLNGWMM.js.map → chunk-6IRMKF5T.js.map} +1 -1
  11. package/dist/{chunk-DT6LKNZF.js → chunk-7247WBTV.js} +5 -4
  12. package/dist/chunk-7247WBTV.js.map +1 -0
  13. package/dist/{chunk-F2FSHVO5.js → chunk-7B44J3CF.js} +7 -7
  14. package/dist/{chunk-F2FSHVO5.js.map → chunk-7B44J3CF.js.map} +1 -1
  15. package/dist/{chunk-6VYGK3Q3.js → chunk-7E7JNWOC.js} +16 -21
  16. package/dist/chunk-7E7JNWOC.js.map +1 -0
  17. package/dist/{chunk-7AQ4MN4M.js → chunk-7OGZT7U2.js} +14 -6
  18. package/dist/chunk-7OGZT7U2.js.map +1 -0
  19. package/dist/{chunk-UAYENYS2.js → chunk-AKXALCUN.js} +3 -3
  20. package/dist/{chunk-UAYENYS2.js.map → chunk-AKXALCUN.js.map} +1 -1
  21. package/dist/{chunk-BE2LWUHY.js → chunk-BMEJBY6H.js} +5 -3
  22. package/dist/chunk-BMEJBY6H.js.map +1 -0
  23. package/dist/{chunk-DHJB4UJD.js → chunk-DMI4KS32.js} +5 -5
  24. package/dist/{chunk-DHJB4UJD.js.map → chunk-DMI4KS32.js.map} +1 -1
  25. package/dist/{chunk-FB2G4LNH.js → chunk-DSZF2TW6.js} +7 -7
  26. package/dist/{chunk-FB2G4LNH.js.map → chunk-DSZF2TW6.js.map} +1 -1
  27. package/dist/{chunk-N66NC6QK.js → chunk-E3XLWMEB.js} +3 -3
  28. package/dist/{chunk-N66NC6QK.js.map → chunk-E3XLWMEB.js.map} +1 -1
  29. package/dist/{chunk-MXAACRWE.js → chunk-E52Z2FKU.js} +5 -5
  30. package/dist/{chunk-MXAACRWE.js.map → chunk-E52Z2FKU.js.map} +1 -1
  31. package/dist/chunk-F374BNL4.js +129 -0
  32. package/dist/chunk-F374BNL4.js.map +1 -0
  33. package/dist/{chunk-3L5GLI67.js → chunk-I4B3N3UX.js} +3 -3
  34. package/dist/{chunk-3L5GLI67.js.map → chunk-I4B3N3UX.js.map} +1 -1
  35. package/dist/{chunk-IPYHTCFL.js → chunk-IUK7OJXZ.js} +3 -3
  36. package/dist/{chunk-IPYHTCFL.js.map → chunk-IUK7OJXZ.js.map} +1 -1
  37. package/dist/{chunk-HRNWWL3Y.js → chunk-J2NW7JID.js} +61 -29
  38. package/dist/chunk-J2NW7JID.js.map +1 -0
  39. package/dist/{chunk-MRAJ45IM.js → chunk-JDPVD2YE.js} +5 -5
  40. package/dist/{chunk-MRAJ45IM.js.map → chunk-JDPVD2YE.js.map} +1 -1
  41. package/dist/{chunk-SZEOTXRZ.js → chunk-JFB6O7IY.js} +5 -5
  42. package/dist/{chunk-SZEOTXRZ.js.map → chunk-JFB6O7IY.js.map} +1 -1
  43. package/dist/{chunk-2MXWEIMD.js → chunk-KKLCHLCZ.js} +12 -11
  44. package/dist/chunk-KKLCHLCZ.js.map +1 -0
  45. package/dist/{chunk-6N6J2DOE.js → chunk-LIZWCWED.js} +3 -3
  46. package/dist/{chunk-6N6J2DOE.js.map → chunk-LIZWCWED.js.map} +1 -1
  47. package/dist/chunk-LJVIZNPE.js +9 -0
  48. package/dist/chunk-LJVIZNPE.js.map +1 -0
  49. package/dist/{chunk-HQPU73WV.js → chunk-LYGOFMXJ.js} +3 -3
  50. package/dist/{chunk-HQPU73WV.js.map → chunk-LYGOFMXJ.js.map} +1 -1
  51. package/dist/{chunk-JVG5ISPT.js → chunk-N42EFOML.js} +4 -4
  52. package/dist/{chunk-JVG5ISPT.js.map → chunk-N42EFOML.js.map} +1 -1
  53. package/dist/{chunk-C4NFRSOR.js → chunk-NF2PBGD3.js} +38 -25
  54. package/dist/chunk-NF2PBGD3.js.map +1 -0
  55. package/dist/{chunk-DA4QII2N.js → chunk-NLSJ6T7V.js} +4 -4
  56. package/dist/{chunk-DA4QII2N.js.map → chunk-NLSJ6T7V.js.map} +1 -1
  57. package/dist/{chunk-UT3TOV2Q.js → chunk-OVT2KZHY.js} +3 -3
  58. package/dist/{chunk-UT3TOV2Q.js.map → chunk-OVT2KZHY.js.map} +1 -1
  59. package/dist/{chunk-MW42XVPD.js → chunk-PBSVX5DB.js} +15 -5
  60. package/dist/chunk-PBSVX5DB.js.map +1 -0
  61. package/dist/{chunk-SVKN5ZHX.js → chunk-PEHFWGTT.js} +16 -13
  62. package/dist/chunk-PEHFWGTT.js.map +1 -0
  63. package/dist/{chunk-J44FJ7PH.js → chunk-PFZMB3US.js} +4 -4
  64. package/dist/{chunk-J44FJ7PH.js.map → chunk-PFZMB3US.js.map} +1 -1
  65. package/dist/{chunk-IRNF274I.js → chunk-PT22KEVD.js} +5 -5
  66. package/dist/{chunk-IRNF274I.js.map → chunk-PT22KEVD.js.map} +1 -1
  67. package/dist/{chunk-OZMSXYBX.js → chunk-QEAF57ZQ.js} +4 -4
  68. package/dist/{chunk-OZMSXYBX.js.map → chunk-QEAF57ZQ.js.map} +1 -1
  69. package/dist/{chunk-SWVUXEBT.js → chunk-SCXXJDKQ.js} +3 -3
  70. package/dist/{chunk-SWVUXEBT.js.map → chunk-SCXXJDKQ.js.map} +1 -1
  71. package/dist/{chunk-E5H3YWZV.js → chunk-SOUDKESO.js} +15 -8
  72. package/dist/chunk-SOUDKESO.js.map +1 -0
  73. package/dist/{chunk-4FEOMQYR.js → chunk-THGJLR5S.js} +6 -6
  74. package/dist/{chunk-4FEOMQYR.js.map → chunk-THGJLR5S.js.map} +1 -1
  75. package/dist/{chunk-TCFB23JT.js → chunk-WERJ44ZN.js} +3 -3
  76. package/dist/{chunk-TCFB23JT.js.map → chunk-WERJ44ZN.js.map} +1 -1
  77. package/dist/{chunk-QNKD2SQM.js → chunk-X3YIHN2U.js} +5 -5
  78. package/dist/{chunk-QNKD2SQM.js.map → chunk-X3YIHN2U.js.map} +1 -1
  79. package/dist/{chunk-VD6PB3VA.js → chunk-X6DESK37.js} +12 -3
  80. package/dist/chunk-X6DESK37.js.map +1 -0
  81. package/dist/{chunk-47LEAR6G.js → chunk-Y2G47ARQ.js} +6 -6
  82. package/dist/{chunk-47LEAR6G.js.map → chunk-Y2G47ARQ.js.map} +1 -1
  83. package/dist/{chunk-O7LS6OZR.js → chunk-YMVUQ2L7.js} +4 -4
  84. package/dist/{chunk-O7LS6OZR.js.map → chunk-YMVUQ2L7.js.map} +1 -1
  85. package/dist/{chunk-F342ZT7O.js → chunk-ZVECQBGG.js} +13 -7
  86. package/dist/chunk-ZVECQBGG.js.map +1 -0
  87. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  88. package/dist/components/action-icon/index.js +1 -1
  89. package/dist/components/alert/index.js +1 -1
  90. package/dist/components/ambient-background/index.js +14 -26
  91. package/dist/components/ambient-background/index.js.map +1 -1
  92. package/dist/components/ambient-background/starfield.d.ts.map +1 -1
  93. package/dist/components/app-shell/app-shell.d.ts +55 -10
  94. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  95. package/dist/components/app-shell/index.d.ts +1 -1
  96. package/dist/components/app-shell/index.d.ts.map +1 -1
  97. package/dist/components/app-shell/index.js +300 -39
  98. package/dist/components/app-shell/index.js.map +1 -1
  99. package/dist/components/autocomplete/index.js +5 -5
  100. package/dist/components/avatar/avatar.d.ts +1 -1
  101. package/dist/components/avatar/avatar.d.ts.map +1 -1
  102. package/dist/components/avatar/index.js +12 -3
  103. package/dist/components/avatar/index.js.map +1 -1
  104. package/dist/components/badge/badge.d.ts.map +1 -1
  105. package/dist/components/badge/index.js +1 -1
  106. package/dist/components/button/index.js +1 -1
  107. package/dist/components/button-group/button-group.d.ts +10 -2
  108. package/dist/components/button-group/button-group.d.ts.map +1 -1
  109. package/dist/components/button-group/index.js +1 -1
  110. package/dist/components/button-multi-select/index.js +4 -4
  111. package/dist/components/button-select/button-select-control.d.ts +4 -1
  112. package/dist/components/button-select/button-select-control.d.ts.map +1 -1
  113. package/dist/components/button-select/button-select.d.ts +4 -1
  114. package/dist/components/button-select/button-select.d.ts.map +1 -1
  115. package/dist/components/button-select/index.js +4 -4
  116. package/dist/components/calendar/index.js +4 -4
  117. package/dist/components/calendar-heatmap/index.js +2 -2
  118. package/dist/components/camera/index.js +12 -12
  119. package/dist/components/card/card.d.ts.map +1 -1
  120. package/dist/components/card/index.js +1 -1
  121. package/dist/components/carousel/index.js +2 -2
  122. package/dist/components/checkbox/checkbox.d.ts +3 -2
  123. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  124. package/dist/components/checkbox/index.js +2 -2
  125. package/dist/components/choice-card-group/index.js +2 -2
  126. package/dist/components/choice-card-group/index.js.map +1 -1
  127. package/dist/components/clipboard/index.js +3 -3
  128. package/dist/components/code-block/chrome.js +3 -3
  129. package/dist/components/code-block/code-block.d.ts +6 -3
  130. package/dist/components/code-block/code-block.d.ts.map +1 -1
  131. package/dist/components/code-block/highlighter.d.ts +16 -15
  132. package/dist/components/code-block/highlighter.d.ts.map +1 -1
  133. package/dist/components/code-block/index.d.ts +2 -1
  134. package/dist/components/code-block/index.d.ts.map +1 -1
  135. package/dist/components/code-block/index.js +85 -14
  136. package/dist/components/code-block/index.js.map +1 -1
  137. package/dist/components/code-block/languages.d.ts +61 -0
  138. package/dist/components/code-block/languages.d.ts.map +1 -0
  139. package/dist/components/code-block/static.d.ts +2 -1
  140. package/dist/components/code-block/static.d.ts.map +1 -1
  141. package/dist/components/code-block/static.js +99 -10
  142. package/dist/components/code-block/static.js.map +1 -1
  143. package/dist/components/combobox/index.js +5 -5
  144. package/dist/components/combobox-list/index.js +7 -7
  145. package/dist/components/compare/index.js +2 -2
  146. package/dist/components/data-table/index.js +32 -32
  147. package/dist/components/data-table/index.js.map +1 -1
  148. package/dist/components/date-picker/index.js +14 -14
  149. package/dist/components/download-button/index.js +2 -2
  150. package/dist/components/drawer/index.js +5 -5
  151. package/dist/components/field/field.d.ts +3 -0
  152. package/dist/components/field/field.d.ts.map +1 -1
  153. package/dist/components/field/index.js +1 -1
  154. package/dist/components/file-item/index.js +5 -5
  155. package/dist/components/file-preview/index.js +5 -5
  156. package/dist/components/file-trigger/index.js +2 -2
  157. package/dist/components/file-upload/index.js +6 -6
  158. package/dist/components/gallery/index.js +2 -2
  159. package/dist/components/geodesic/badge-frame.d.ts +13 -1
  160. package/dist/components/geodesic/badge-frame.d.ts.map +1 -1
  161. package/dist/components/geodesic/exam-badge.d.ts +4 -1
  162. package/dist/components/geodesic/exam-badge.d.ts.map +1 -1
  163. package/dist/components/geodesic/geometry.d.ts +14 -9
  164. package/dist/components/geodesic/geometry.d.ts.map +1 -1
  165. package/dist/components/geodesic/index.js +62 -23
  166. package/dist/components/geodesic/index.js.map +1 -1
  167. package/dist/components/geodesic/status.d.ts +8 -6
  168. package/dist/components/geodesic/status.d.ts.map +1 -1
  169. package/dist/components/geodesic/styles.css +15 -2
  170. package/dist/components/hover-card/index.js +2 -2
  171. package/dist/components/image-cropper/index.js +7 -7
  172. package/dist/components/indicator/index.js +24 -9
  173. package/dist/components/indicator/index.js.map +1 -1
  174. package/dist/components/indicator/indicator.d.ts +15 -6
  175. package/dist/components/indicator/indicator.d.ts.map +1 -1
  176. package/dist/components/input/index.js +2 -2
  177. package/dist/components/kbd/index.js +3 -3
  178. package/dist/components/kbd/kbd.d.ts.map +1 -1
  179. package/dist/components/lightbox/index.js +8 -8
  180. package/dist/components/menu/index.js +4 -4
  181. package/dist/components/modal/index.js +5 -5
  182. package/dist/components/multi-combobox-list/index.js +7 -7
  183. package/dist/components/multi-select/index.js +8 -8
  184. package/dist/components/nav-link/index.js +5 -1
  185. package/dist/components/nav-link/nav-link.d.ts.map +1 -1
  186. package/dist/components/nav-link/tanstack.js +5 -1
  187. package/dist/components/nav-link/tanstack.js.map +1 -1
  188. package/dist/components/number-input/index.js +5 -5
  189. package/dist/components/overlays/index.js +7 -7
  190. package/dist/components/password-input/index.js +3 -3
  191. package/dist/components/photo-capture/index.js +16 -16
  192. package/dist/components/pills-input/index.js +5 -5
  193. package/dist/components/pin-input/index.js +2 -2
  194. package/dist/components/popover/index.js +2 -2
  195. package/dist/components/radio-group/index.js +1 -1
  196. package/dist/components/rating/index.js +1 -1
  197. package/dist/components/schedule/index.js +7 -7
  198. package/dist/components/segment-group/index.js +4 -4
  199. package/dist/components/segment-group/segment-group.d.ts +6 -1
  200. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  201. package/dist/components/select/index.js +6 -6
  202. package/dist/components/slider/index.js +2 -2
  203. package/dist/components/spotlight/index.js +11 -11
  204. package/dist/components/switch/index.js +14 -19
  205. package/dist/components/switch/index.js.map +1 -1
  206. package/dist/components/switch/switch.d.ts +1 -0
  207. package/dist/components/switch/switch.d.ts.map +1 -1
  208. package/dist/components/table/index.js +1 -1
  209. package/dist/components/table/table.d.ts.map +1 -1
  210. package/dist/components/tabs/index.js +3 -3
  211. package/dist/components/tabs/tabs-data.d.ts +4 -1
  212. package/dist/components/tabs/tabs-data.d.ts.map +1 -1
  213. package/dist/components/tabs/tabs.d.ts +4 -1
  214. package/dist/components/tabs/tabs.d.ts.map +1 -1
  215. package/dist/components/tags-input/index.js +7 -7
  216. package/dist/components/text-input/index.js +2 -2
  217. package/dist/components/textarea/index.js +2 -2
  218. package/dist/components/theme-icon/index.js +1 -1
  219. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  220. package/dist/components/time-input/index.js +9 -9
  221. package/dist/components/tree-multi-select/index.js +8 -8
  222. package/dist/components/tree-select/index.js +5 -5
  223. package/dist/index.js +4 -4
  224. package/dist/lib/sidebar-rail.d.ts +21 -0
  225. package/dist/lib/sidebar-rail.d.ts.map +1 -0
  226. package/dist/theme.css +35 -35
  227. package/package.json +1 -1
  228. package/src/as-child.contract.test.tsx +6 -0
  229. package/src/components/action-icon/action-icon.tsx +3 -1
  230. package/src/components/ambient-background/starfield.tsx +18 -43
  231. package/src/components/app-shell/app-shell.test.tsx +430 -5
  232. package/src/components/app-shell/app-shell.tsx +484 -24
  233. package/src/components/app-shell/index.ts +2 -0
  234. package/src/components/avatar/avatar.test.tsx +12 -0
  235. package/src/components/avatar/avatar.tsx +9 -0
  236. package/src/components/badge/badge.tsx +11 -6
  237. package/src/components/button/button.tsx +1 -1
  238. package/src/components/button-group/button-group.test.tsx +24 -0
  239. package/src/components/button-group/button-group.tsx +21 -4
  240. package/src/components/button-multi-select/button-multi-select.test.tsx +15 -0
  241. package/src/components/button-select/button-select-control.tsx +5 -0
  242. package/src/components/button-select/button-select.test.tsx +25 -0
  243. package/src/components/button-select/button-select.tsx +13 -2
  244. package/src/components/card/card.tsx +10 -9
  245. package/src/components/checkbox/checkbox.test.tsx +17 -9
  246. package/src/components/checkbox/checkbox.tsx +26 -27
  247. package/src/components/choice-card-group/choice-card-group.tsx +3 -3
  248. package/src/components/code-block/code-block.tsx +7 -4
  249. package/src/components/code-block/highlighter.test.ts +79 -1
  250. package/src/components/code-block/highlighter.ts +76 -30
  251. package/src/components/code-block/index.ts +2 -0
  252. package/src/components/code-block/languages.ts +63 -0
  253. package/src/components/code-block/static.tsx +2 -1
  254. package/src/components/data-table/data-table-pagination.tsx +5 -5
  255. package/src/components/data-table/data-table-stack.tsx +2 -2
  256. package/src/components/field/field.tsx +14 -0
  257. package/src/components/geodesic/badge-frame.tsx +67 -13
  258. package/src/components/geodesic/exam-badge.tsx +8 -4
  259. package/src/components/geodesic/geometry.ts +8 -6
  260. package/src/components/geodesic/status.test.ts +11 -2
  261. package/src/components/geodesic/status.ts +11 -7
  262. package/src/components/geodesic/styles.css +15 -2
  263. package/src/components/indicator/indicator.test.tsx +45 -0
  264. package/src/components/indicator/indicator.tsx +40 -13
  265. package/src/components/kbd/kbd.tsx +2 -1
  266. package/src/components/nav-link/nav-link.test.tsx +121 -1
  267. package/src/components/nav-link/nav-link.tsx +78 -29
  268. package/src/components/segment-group/segment-group.test.tsx +22 -0
  269. package/src/components/segment-group/segment-group.tsx +35 -19
  270. package/src/components/switch/switch.test.tsx +15 -0
  271. package/src/components/switch/switch.tsx +27 -27
  272. package/src/components/table/table.test.tsx +1 -1
  273. package/src/components/table/table.tsx +14 -11
  274. package/src/components/tabs/tabs-data.tsx +5 -1
  275. package/src/components/tabs/tabs.test.tsx +28 -0
  276. package/src/components/tabs/tabs.tsx +14 -4
  277. package/src/components/theme-icon/theme-icon.tsx +46 -12
  278. package/src/lib/sidebar-rail.ts +24 -0
  279. package/src/theme.css +35 -35
  280. package/src/theme.test.ts +0 -1
  281. package/dist/chunk-2MXWEIMD.js.map +0 -1
  282. package/dist/chunk-6VYGK3Q3.js.map +0 -1
  283. package/dist/chunk-7AQ4MN4M.js.map +0 -1
  284. package/dist/chunk-7CNDZZZ6.js +0 -95
  285. package/dist/chunk-7CNDZZZ6.js.map +0 -1
  286. package/dist/chunk-BE2LWUHY.js.map +0 -1
  287. package/dist/chunk-C4NFRSOR.js.map +0 -1
  288. package/dist/chunk-DT6LKNZF.js.map +0 -1
  289. package/dist/chunk-E5H3YWZV.js.map +0 -1
  290. package/dist/chunk-F342ZT7O.js.map +0 -1
  291. package/dist/chunk-HRNWWL3Y.js.map +0 -1
  292. package/dist/chunk-MW42XVPD.js.map +0 -1
  293. package/dist/chunk-SVKN5ZHX.js.map +0 -1
  294. package/dist/chunk-VD6PB3VA.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA6EA,IAAM,eAAA,GAAkB,cAAoC,IAAI,CAAA;AAUzD,SAAS,WAAA,GAA6B;AAC3C,EAAA,MAAM,GAAA,GAAM,WAAW,eAAe,CAAA;AACtC,EAAA,IAAI,CAAC,GAAA,EAAK,MAAM,IAAI,MAAM,oDAAoD,CAAA;AAC9E,EAAA,OAAO,GAAA;AACT;AAOA,IAAM,WAAA,GAAc,CAAC,KAAA,EAAmB,MAAA,KAAwC;AAC9E,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,CAAA,IAAK,KAAA,CAAM,OAAA,IAAW,MAAM,OAAA,IAAW,KAAA,CAAM,QAAA,IAAY,KAAA,CAAM,MAAA,EAAQ;AAC1F,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,MAAM,IAAA,GAAO,MAAM,MAAA,YAAkB,OAAA,GAAU,MAAM,MAAA,CAAO,OAAA,CAAQ,SAAS,CAAA,GAAI,IAAA;AACjF,EAAA,OAAO,IAAA,IAAQ,IAAA,IAAQ,MAAA,EAAQ,QAAA,CAAS,IAAI,CAAA,KAAM,IAAA;AACpD,CAAA;AAaA,IAAM,eAAe,CAAC;AAAA,EACpB,UAAA,GAAa,GAAA;AAAA,EACb,SAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAqB;AACnB,EAAA,MAAM,OAAA,GAAU,OAAuB,IAAI,CAAA;AAC3C,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA;AAClD,EAAA,MAAM,QAAA,GAAW,iBAAA,CAAkB,OAAA,EAAS,UAAU,CAAA;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AAA,EACN,OAAA,EAAS,eAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAC","file":"index.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type Dispatch,\n type MouseEvent,\n type Ref,\n type SetStateAction,\n useContext,\n useId,\n useRef,\n useState,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useContainerQuery } from \"../../lib/use-container-query\"\nimport { Drawer } from \"../drawer/drawer\"\n\n/**\n * AppShell — header / sidebar / main / aside app frame, laid out with CSS\n * Grid named areas. Sidebar spans the full height on the left; Header\n * spans the rest of the top (above both Main and Aside — Header never\n * spans over Sidebar, but it does span over Aside, unlike Sidebar itself);\n * Aside sits below Header, full height only within the remaining row,\n * beside Main. No Footer — add one only once a real consumer needs it.\n *\n * Sidebar is always visible on desktop — there's no way to hide it when\n * there's room to show it. Below `breakpoint`, it becomes an overlay\n * `Drawer` instead, toggled by `AppShell.SidebarTrigger` (which renders\n * nothing on desktop — there's nothing to toggle). Aside works\n * differently: it's always mounted (no JS/container-query gating at all,\n * unlike Sidebar) and purely CSS-driven — hidden below a `@xl` container\n * breakpoint, visible above it — mirroring how fumadocs' own docs layout\n * keeps its table-of-contents rail always in the DOM. There is no\n * `variant`/`color` axis — like `Table`/`Grid`/`Flex`, this is a\n * structural primitive, not a themed surface.\n *\n * `breakpoint` and Aside's `@xl` cutoff are both measured against\n * `AppShell`'s own rendered width, not the browser viewport — so this\n * behaves correctly embedded in a panel, a resizable pane, or anything\n * narrower than the window, not just when it fills the whole page.\n *\n * <AppShell>\n * <AppShell.Sidebar>\n * <AppShell.SidebarHeader>Logo</AppShell.SidebarHeader>\n * <AppShell.SidebarBody>Nav — scrolls</AppShell.SidebarBody>\n * <AppShell.SidebarFooter>User menu</AppShell.SidebarFooter>\n * </AppShell.Sidebar>\n * <AppShell.Header>\n * <AppShell.SidebarTrigger asChild>\n * <ActionIcon variant=\"subtle\" color=\"neutral\"><PanelLeft /></ActionIcon>\n * </AppShell.SidebarTrigger>\n * </AppShell.Header>\n * <AppShell.Main>Page content</AppShell.Main>\n * <AppShell.Aside>On this page…</AppShell.Aside>\n * </AppShell>\n */\n\nexport type AppShellState = {\n /** Whether the mobile drawer is open. Always uncontrolled, never a public prop. */\n mobileOpen: boolean\n /** Opens or closes the mobile drawer — e.g. close it after a programmatic\n * navigation (`router.push`) that no link click inside the sidebar caused. */\n setMobileOpen: Dispatch<SetStateAction<boolean>>\n /** Whether `AppShell` is narrower than its `breakpoint`, so Sidebar is a drawer. */\n isMobile: boolean\n /** Id of the mobile drawer's content, which `SidebarTrigger`'s `aria-controls` points at. */\n sidebarId: string\n}\n\nconst AppShellContext = createContext<AppShellState | null>(null)\n\n/**\n * The shell's sidebar state, from any descendant of `<AppShell>`. A link\n * clicked inside the mobile drawer already closes it; reach for this only when\n * something else navigates:\n *\n * const { setMobileOpen } = useAppShell()\n * const onSubmit = async () => { await save(); router.push(\"/done\"); setMobileOpen(false) }\n */\nexport function useAppShell(): AppShellState {\n const ctx = useContext(AppShellContext)\n if (!ctx) throw new Error(\"AppShell parts must be rendered within <AppShell>.\")\n return ctx\n}\n\n/** Whether a click inside the drawer follows a link in this tab: a plain\n * primary-button click on an `<a href>`. A modified click (new tab/window,\n * download) leaves the page — and the drawer — where they are. Whether the\n * link's own handler called `preventDefault` doesn't matter: a client-side\n * router does exactly that to navigate without a page load. */\nconst followsLink = (event: MouseEvent, drawer: HTMLElement | null): boolean => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return false\n }\n const link = event.target instanceof Element ? event.target.closest(\"a[href]\") : null\n return link != null && drawer?.contains(link) === true\n}\n\nexport type AppShellProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** AppShell's own rendered width (px) below which Sidebar renders as an\n * overlay `Drawer` instead of a grid column — measured against the\n * container itself via `ResizeObserver`, not the viewport. @default 768 */\n breakpoint?: number\n /** Lands on the grid root; also used internally to measure `breakpoint`\n * against the container's own width. */\n ref?: Ref<HTMLDivElement>\n }\n\nconst AppShellRoot = ({\n breakpoint = 768,\n className,\n style,\n children,\n ref,\n testId,\n onClick,\n ...rest\n}: AppShellProps) => {\n const rootRef = useRef<HTMLDivElement>(null)\n const [mobileOpen, setMobileOpen] = useState(false)\n const isMobile = useContainerQuery(rootRef, breakpoint)\n const sidebarId = `app-shell-sidebar-${useId()}`\n\n const mergedRef = useMergedRefs(ref, rootRef)\n return (\n <AppShellContext.Provider value={{ mobileOpen, setMobileOpen, isMobile, sidebarId }}>\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n ref={mergedRef}\n // The drawer is portaled out of this element in the DOM, but React\n // still bubbles its clicks through here. Closing on a followed link\n // is what a page load would have done; a client-side router doesn't\n // reload, so without this the drawer stays open over the new page.\n onClick={(event) => {\n onClick?.(event)\n if (mobileOpen && followsLink(event, document.getElementById(sidebarId))) {\n setMobileOpen(false)\n }\n }}\n style={{ gridTemplateAreas: `\"sidebar header header\" \"sidebar main aside\"`, ...style }}\n className={cn(\n \"@container grid h-dvh grid-cols-[auto_1fr_auto] grid-rows-[auto_1fr] overflow-hidden\",\n className,\n )}\n >\n {children}\n </ark.div>\n </AppShellContext.Provider>\n )\n}\n\nconst SIDEBAR_WIDTH: Record<Size, string> = {\n xs: \"w-56\",\n sm: \"w-64\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-96\",\n}\n\nexport type AppShellSidebarProps = NoAsChild<HTMLArkProps<\"aside\">> &\n WithTestId & {\n /** Width when expanded, from the kit's Size scale. @default \"md\" */\n size?: Size\n }\n\n/**\n * Below `breakpoint`, renders through the kit's own `Drawer` instead of the\n * grid column — same `SidebarHeader`/`SidebarBody`/`SidebarFooter` children\n * either way, mirroring the desktop docked aside's layout: `Drawer`'s own\n * body normally forces every child through one scrolling container, which\n * would otherwise carry Header/Footer along with the scroll instead of\n * pinning them — `classNames.body` turns it into the same flex column\n * (Header/Footer as plain shrink-0 flex items, only SidebarBody's own\n * `overflow-y-auto` scrolls) instead. Full width, opening from the logical\n * end edge (right in LTR). `withCloseButton={false}` — at full width,\n * `Drawer`'s own generic close bar would just stack a second, redundant\n * header above `SidebarHeader`; render a `SidebarTrigger` inside\n * `SidebarHeader` itself instead for one unified bar with a visible close\n * affordance (swipe-to-dismiss on `Drawer`'s content still works too, but\n * isn't the only way out — not discoverable, and risky to rely on alone in\n * a sidebar full of tappable nav rows).\n *\n * Exclusive branch, not always-mounted-and-CSS-hidden like `Aside` — unlike\n * `Aside`, `Sidebar` has two genuinely different structural forms (a plain\n * `<aside>` vs. a portaled dialog with focus-trap/ARIA machinery), so\n * keeping both permanently mounted would mean literally duplicating\n * `children` (and any side effects inside it) into two simultaneous trees.\n * Matches fumadocs' own sidebar, which is JS-conditional for the same\n * reason — only its TOC (this component's `Aside`) goes the always-mounted\n * route. Only `size`/`className`/`children` and the `aria-label` /\n * `aria-labelledby` naming carry over to `Drawer` mode; arbitrary `<aside>`\n * props don't apply to `Drawer`'s own curated prop surface. The drawer has\n * no `title`, so without one of those it is a dialog with no name (and\n * `Drawer` warns in development).\n */\nconst AppShellSidebar = ({\n size = \"md\",\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: AppShellSidebarProps) => {\n const { isMobile, mobileOpen, setMobileOpen, sidebarId } = useAppShell()\n\n if (isMobile) {\n return (\n <Drawer\n open={mobileOpen}\n onOpenChange={setMobileOpen}\n placement=\"end\"\n withCloseButton={false}\n aria-label={rest[\"aria-label\"]}\n aria-labelledby={rest[\"aria-labelledby\"]}\n ids={{ content: sidebarId }}\n testId={testId}\n classNames={{ body: \"flex flex-col overflow-hidden p-0\" }}\n className={cn(\"w-full max-w-none\", className)}\n >\n {children}\n </Drawer>\n )\n }\n\n return (\n <ark.aside\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:sidebar] flex flex-col overflow-hidden\",\n TEXT_COLOR_CLASSES.primary,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"border-e border-brand-900/20 bg-brand-50/90 dark:border-white/15 dark:bg-brand-950/85\",\n SIDEBAR_WIDTH[size],\n className,\n )}\n >\n {children}\n </ark.aside>\n )\n}\n\n// Shared by SidebarHeader and Header so the two sit at the same height and\n// Header's bottom border lines up level with SidebarHeader's own bottom edge\n// — sizing each off its own padding + content independently (the original\n// approach) drifts out of sync as soon as one holds taller content than the\n// other.\nconst HEADER_HEIGHT_CLASS = \"h-14\"\n\nexport type AppShellSidebarHeaderProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n// Plain flex sibling, not routed through the `ark.*` factory — mirrors\n// Drawer.Header/.Body/.Footer, which aren't either.\nconst AppShellSidebarHeader = ({ className, testId, ...rest }: AppShellSidebarHeaderProps) => (\n <div\n className={cn(HEADER_HEIGHT_CLASS, \"flex shrink-0 items-center gap-2 px-4\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarBodyProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/**\n * The scroll region — the only part of Sidebar that scrolls. The mask fades\n * content at the top/bottom edges instead of clipping it on a hard line\n * (fumadocs' own docs sidebar uses the same static mask on its nav\n * viewport); `overscroll-contain` stops scrolling the list from chaining\n * into scrolling the rest of the page once it hits either end.\n */\nconst AppShellSidebarBody = ({ className, testId, ...rest }: AppShellSidebarBodyProps) => (\n <div\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain p-4\",\n \"[mask-image:linear-gradient(to_bottom,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarFooterProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nconst AppShellSidebarFooter = ({ className, testId, ...rest }: AppShellSidebarFooterProps) => (\n <div className={cn(\"shrink-0 p-4\", className)} {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellHeaderProps = HTMLArkProps<\"header\"> & WithTestId\n\nconst AppShellHeader = ({ className, testId, ...rest }: AppShellHeaderProps) => (\n <ark.header\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n HEADER_HEIGHT_CLASS,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"[grid-area:header] flex shrink-0 items-center gap-3 border-b border-brand-900/20 bg-brand-50/90 px-4 text-brand-950\",\n \"dark:border-white/15 dark:bg-brand-950/85 dark:text-white\",\n className,\n )}\n />\n)\n\nexport type AppShellMainSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\n// A local scale rather than the shared Size one: these are page widths, not\n// control widths, so they read off the kit's own `--width-*` tokens\n// (theme.css) — the vocabulary Modal already uses — instead of inventing a\n// second set. Static class strings so Tailwind's build-time scanner picks them\n// up, in the same lookup-map shape as SIDEBAR_WIDTH/ASIDE_WIDTH above.\nconst MAIN_MEASURE: Record<AppShellMainSize, string> = {\n sm: \"[--app-shell-measure:var(--width-xl)]\", // 48rem / 768px\n md: \"[--app-shell-measure:var(--width-2xl)]\", // 64rem / 1024px\n lg: \"[--app-shell-measure:var(--width-3xl)]\", // 80rem / 1280px\n xl: \"[--app-shell-measure:var(--width-4xl)]\", // 90rem / 1440px\n}\n\nexport type AppShellMainProps = HTMLArkProps<\"main\"> &\n WithTestId & {\n /** Width of the content column, from the kit's `--width-*` tokens:\n * `sm` 48rem · `md` 64rem · `lg` 80rem · `xl` 90rem. @default \"lg\" */\n size?: AppShellMainSize\n /** Drop the content column entirely — children fill Main edge to edge, as\n * they did before the column existed. For pages whose Main *is* one\n * full-canvas component (a Schedule, a DataTable sized to the viewport)\n * rather than a document. @default false */\n fluid?: boolean\n }\n\n/**\n * The page region. By default its children sit in a centered content column,\n * so a page of prose and forms doesn't stretch to whatever width the window\n * happens to be; `AppShell.Full` opts one child out to the full width, and\n * `AppShell.Content` puts arbitrary content back in.\n *\n * The column is three grid tracks — `1fr`, the column, `1fr` — rather than\n * inline padding, which is what lets a child span *past* the gutters without\n * negative margins, `100vw`, or any JS measurement. Percentages in track\n * sizing resolve against Main's own content box, so the column is correct\n * beside a sidebar, inside a resizable pane, or in a bounded docs preview\n * frame, with no media query and no `ResizeObserver` involved. Below\n * `measure + 2 × gutter` the middle track collapses to `100% - 2 × gutter`\n * and the `1fr` tracks land exactly on the gutter, so the column degrades\n * into plain padding continuously, without a breakpoint.\n *\n * `align-content: start` is load-bearing: grid's default (`normal`, i.e.\n * `stretch`) hands leftover vertical space to every auto row, which would\n * space a short page's blocks out down the viewport.\n *\n * <AppShell.Main>\n * <Title>Quarterly sales</Title>\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n * </AppShell.Main>\n */\nconst AppShellMain = ({\n size = \"lg\",\n fluid = false,\n className,\n testId,\n ...rest\n}: AppShellMainProps) => (\n <ark.main\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:main] min-h-0 overflow-y-auto\",\n !fluid && [\n // Gutter doubles as Main's block padding, so content never butts\n // against Header. Overridable per page with\n // `className=\"[--app-shell-gutter:2rem]\"`; both vars inherit, which is\n // what lets `AppShell.Content` re-derive the column at any depth.\n \"[--app-shell-gutter:1.5rem] py-(--app-shell-gutter)\",\n MAIN_MEASURE[size],\n \"grid content-start grid-cols-[1fr_min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))_1fr]\",\n // Both placement rules are authored here, on the same element, so\n // their relative weight is decided by specificity — `.main > [data-full]`\n // (0,2,0) over `.main > *` (0,1,0) — and never by where Tailwind\n // happens to sort two same-weight utilities. `min-w-0` stops a wide\n // child (a DataTable) overflowing the column, and zeroes a spanning\n // child's min-content contribution so it can't inflate the gutters.\n \"[&>*]:col-start-2 [&>*]:min-w-0\",\n \"[&>[data-full]]:col-span-full\",\n ],\n className,\n )}\n />\n)\n\nexport type AppShellFullProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Opts one child of `AppShell.Main` out of the content column, spanning every\n * track so it reaches Main's true edges — for the things a column actively\n * hurts: data tables, carousels, heroes, full-width backgrounds.\n *\n * Carries no layout class of its own; it only marks itself with `data-full`,\n * and Main's own rule does the placement (see `AppShellMain`). `asChild`\n * merges that marker onto the component itself, so nothing extra lands in the\n * DOM:\n *\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n *\n * Only works as a *direct* child of Main — breaking out of a grid means being\n * in it. Wrap content in a `Full` band and use `AppShell.Content` inside it\n * rather than nesting `Full` deeper.\n */\nconst AppShellFull = ({ testId, ...rest }: AppShellFullProps) => (\n <ark.div data-full=\"\" {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellContentProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Puts content back into Main's column — the counterpart to `AppShell.Full`,\n * for a full-width band whose *text* should still line up with the rest of the\n * page:\n *\n * <AppShell.Full asChild>\n * <section className=\"bg-brand-50 py-16\">\n * <AppShell.Content>\n * <Title>Welcome back</Title>\n * </AppShell.Content>\n * </section>\n * </AppShell.Full>\n *\n * The width expression is the same one Main gives its middle track, resolved\n * against this element's own containing block, so the edges line up exactly at\n * both ends of the range — full measure when there's room, gutter-only when\n * there isn't. Reading the inherited custom properties rather than using\n * `subgrid` is deliberate: subgrid would only reach one level down, only from\n * an element spanning every track, and would break on any wrapper in between.\n * This works at any depth, including inside a `fluid` Main.\n */\nconst AppShellContent = ({ className, testId, ...rest }: AppShellContentProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"mx-auto w-[min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))]\",\n className,\n )}\n />\n)\n\nconst ASIDE_WIDTH: Record<Size, string> = {\n xs: \"@xl:w-56\",\n sm: \"@xl:w-64\",\n md: \"@xl:w-72\",\n lg: \"@xl:w-80\",\n xl: \"@xl:w-96\",\n}\n\nexport type AppShellAsideProps = HTMLArkProps<\"aside\"> &\n WithTestId & {\n /** Width when visible, from the kit's Size scale. @default \"md\" */\n size?: Size\n }\n\n/**\n * The right region, below `Header` (unlike `Sidebar`, which spans the full\n * height beside it). Unlike `Sidebar`, always mounted — hidden below a\n * `@xl` *container* breakpoint (1280px of `AppShell`'s own width, via\n * Tailwind's native container queries — `AppShell`'s root carries\n * `@container`) and shown above it, purely via static classes, no\n * `useContainerQuery`/context involved. Matches fumadocs' own docs layout,\n * which keeps its table-of-contents rail always in the DOM rather than\n * conditionally unmounting it — no hydration mismatch is possible when\n * nothing renders differently based on client-only state. Fixed to `@xl`\n * rather than a configurable prop like Sidebar's `breakpoint`: Sidebar's is\n * JS-driven and can take any pixel value at runtime, but a static Tailwind\n * class can't take an arbitrary runtime breakpoint without breaking the\n * build-time class scanner.\n */\nconst AppShellAside = ({ size = \"md\", className, testId, ...rest }: AppShellAsideProps) => (\n <ark.aside\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:aside] hidden flex-col overflow-y-auto\",\n TEXT_COLOR_CLASSES.primary,\n \"@xl:flex\",\n ASIDE_WIDTH[size],\n className,\n )}\n />\n)\n\nexport type AppShellSidebarTriggerProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * Opens/closes the mobile `Drawer`. Renders nothing above `breakpoint` —\n * Sidebar is always visible on desktop, so there's nothing to toggle.\n * `asChild`-able, like every other kit trigger. Carries `aria-expanded` and\n * `aria-controls` (the drawer's content), like any disclosure button.\n */\nconst AppShellSidebarTrigger = ({ onClick, testId, ...rest }: AppShellSidebarTriggerProps) => {\n const { isMobile, mobileOpen, setMobileOpen, sidebarId } = useAppShell()\n\n if (!isMobile) return null\n\n return (\n <ark.button\n type=\"button\"\n aria-expanded={mobileOpen}\n aria-controls={sidebarId}\n {...props({ \"data-testid\": testId })}\n {...rest}\n onClick={(event) => {\n onClick?.(event)\n setMobileOpen((open) => !open)\n }}\n />\n )\n}\n\nexport const AppShell = Object.assign(AppShellRoot, {\n Sidebar: AppShellSidebar,\n SidebarHeader: AppShellSidebarHeader,\n SidebarBody: AppShellSidebarBody,\n SidebarFooter: AppShellSidebarFooter,\n SidebarTrigger: AppShellSidebarTrigger,\n Header: AppShellHeader,\n Main: AppShellMain,\n Full: AppShellFull,\n Content: AppShellContent,\n Aside: AppShellAside,\n})\n"]}
1
+ {"version":3,"sources":["../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+FA,IAAM,eAAA,GAAkB,cAAoC,IAAI,CAAA;AAUzD,SAAS,WAAA,GAA6B;AAC3C,EAAA,MAAM,GAAA,GAAM,WAAW,eAAe,CAAA;AACtC,EAAA,IAAI,CAAC,GAAA,EAAK,MAAM,IAAI,MAAM,oDAAoD,CAAA;AAC9E,EAAA,OAAO,GAAA;AACT;AAOA,IAAM,WAAA,GAAc,CAAC,KAAA,EAAmB,MAAA,KAAwC;AAC9E,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,CAAA,IAAK,KAAA,CAAM,OAAA,IAAW,MAAM,OAAA,IAAW,KAAA,CAAM,QAAA,IAAY,KAAA,CAAM,MAAA,EAAQ;AAC1F,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,MAAM,IAAA,GAAO,MAAM,MAAA,YAAkB,OAAA,GAAU,MAAM,MAAA,CAAO,OAAA,CAAQ,SAAS,CAAA,GAAI,IAAA;AACjF,EAAA,OAAO,IAAA,IAAQ,IAAA,IAAQ,MAAA,EAAQ,QAAA,CAAS,IAAI,CAAA,KAAM,IA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AAA,CAAO,OAAA,CAAQ,SAAS,CAAA,EAAG;AACxC,UAAA,MAAM,OAAA,GAAU;AAAA,YACd,GAAI,QAAQ,aAAA,EAAe,gBAAA;AAAA,cACzB;AAAA,iBACG;AAAC,WACR,CAAE,KAAK,CAAC,OAAA,KAAY,CAAC,OAAA,CAAQ,QAAA,CAAS,OAAO,CAAC,CAAA;AAC9C,UAAA,OAAA,EAAS,KAAA,EAAM;AAAA,QACjB;AAAA,MACF;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,QAAA,GAAW,MAAA,CAAO,MAAA,CAAO,YAAA,EAAc;AAAA,EAClD,OAAA,EAAS,eAAA;AAAA,EACT,aAAA,EAAe,qBAAA;AAAA,EACf,WAAA,EAAa,mBAAA;AAAA,EACb,aAAA,EAAe,qBAAA;AAAA,EACf,cAAA,EAAgB,sBAAA;AAAA,EAChB,sBAAA,EAAwB,8BAAA;AAAA,EACxB,MAAA,EAAQ,cAAA;AAAA,EACR,IAAA,EAAM,YAAA;AAAA,EACN,IAAA,EAAM,YAAA;AAAA,EACN,OAAA,EAAS,eAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAC","file":"index.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type Dispatch,\n type MouseEvent,\n type PointerEvent,\n type Ref,\n type RefObject,\n type SetStateAction,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\"\nimport { flushSync } from \"react-dom\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport { SidebarRailContext } from \"../../lib/sidebar-rail\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useContainerQuery } from \"../../lib/use-container-query\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\nimport { type Updater, useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Drawer } from \"../drawer/drawer\"\n\n/**\n * AppShell — header / sidebar / main / aside app frame, laid out with CSS\n * Grid named areas. Sidebar spans the full height on the left; Header\n * spans the rest of the top (above both Main and Aside — Header never\n * spans over Sidebar, but it does span over Aside, unlike Sidebar itself);\n * Aside sits below Header, full height only within the remaining row,\n * beside Main. No Footer — add one only once a real consumer needs it.\n *\n * On desktop, Sidebar is a grid column that can be collapsed — opt in by\n * rendering an `AppShell.SidebarCollapseTrigger` (or driving `collapsed`):\n * the column animates to zero and the sidebar slides off the start edge,\n * coming back as a floating card while the pointer rests on that edge\n * (fumadocs' docs sidebar behaves the same way). Below `breakpoint`, it\n * becomes an overlay `Drawer` instead, toggled by `AppShell.SidebarTrigger`\n * (which renders nothing on desktop — `SidebarCollapseTrigger` is its\n * desktop counterpart, and renders nothing on mobile). Aside works\n * differently: it's always mounted (no JS/container-query gating at all,\n * unlike Sidebar) and purely CSS-driven — hidden below a `@xl` container\n * breakpoint, visible above it — mirroring how fumadocs' own docs layout\n * keeps its table-of-contents rail always in the DOM. There is no\n * `variant`/`color` axis — like `Table`/`Grid`/`Flex`, this is a\n * structural primitive, not a themed surface.\n *\n * `breakpoint` and Aside's `@xl` cutoff are both measured against\n * `AppShell`'s own rendered width, not the browser viewport — so this\n * behaves correctly embedded in a panel, a resizable pane, or anything\n * narrower than the window, not just when it fills the whole page.\n *\n * <AppShell>\n * <AppShell.Sidebar>\n * <AppShell.SidebarHeader>Logo</AppShell.SidebarHeader>\n * <AppShell.SidebarBody>Nav — scrolls</AppShell.SidebarBody>\n * <AppShell.SidebarFooter>User menu</AppShell.SidebarFooter>\n * </AppShell.Sidebar>\n * <AppShell.Header>\n * <AppShell.SidebarTrigger asChild>\n * <ActionIcon variant=\"subtle\" color=\"neutral\"><PanelLeft /></ActionIcon>\n * </AppShell.SidebarTrigger>\n * </AppShell.Header>\n * <AppShell.Main>Page content</AppShell.Main>\n * <AppShell.Aside>On this page…</AppShell.Aside>\n * </AppShell>\n */\n\nexport type AppShellState = {\n /** Whether the mobile drawer is open. Always uncontrolled, never a public prop. */\n mobileOpen: boolean\n /** Opens or closes the mobile drawer — e.g. close it after a programmatic\n * navigation (`router.push`) that no link click inside the sidebar caused. */\n setMobileOpen: Dispatch<SetStateAction<boolean>>\n /** Whether `AppShell` is narrower than its `breakpoint`, so Sidebar is a drawer. */\n isMobile: boolean\n /** Whether the desktop sidebar is collapsed. Has no effect below\n * `breakpoint`, where the sidebar is a drawer either way. */\n collapsed: boolean\n /** Collapses or expands the desktop sidebar — e.g. from a keyboard\n * shortcut. Goes through `onCollapsedChange` when `collapsed` is controlled. */\n setCollapsed: (updater: Updater<boolean>) => void\n /** Id of the sidebar — the drawer's content on mobile, the docked column on\n * desktop — which both triggers' `aria-controls` point at. */\n sidebarId: string\n}\n\nconst AppShellContext = createContext<AppShellState | null>(null)\n\n/**\n * The shell's sidebar state, from any descendant of `<AppShell>`. A link\n * clicked inside the mobile drawer already closes it; reach for this only when\n * something else navigates:\n *\n * const { setMobileOpen } = useAppShell()\n * const onSubmit = async () => { await save(); router.push(\"/done\"); setMobileOpen(false) }\n */\nexport function useAppShell(): AppShellState {\n const ctx = useContext(AppShellContext)\n if (!ctx) throw new Error(\"AppShell parts must be rendered within <AppShell>.\")\n return ctx\n}\n\n/** Whether a click inside the drawer follows a link in this tab: a plain\n * primary-button click on an `<a href>`. A modified click (new tab/window,\n * download) leaves the page — and the drawer — where they are. Whether the\n * link's own handler called `preventDefault` doesn't matter: a client-side\n * router does exactly that to navigate without a page load. */\nconst followsLink = (event: MouseEvent, drawer: HTMLElement | null): boolean => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return false\n }\n const link = event.target instanceof Element ? event.target.closest(\"a[href]\") : null\n return link != null && drawer?.contains(link) === true\n}\n\nexport type AppShellProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** AppShell's own rendered width (px) below which Sidebar renders as an\n * overlay `Drawer` instead of a grid column — measured against the\n * container itself via `ResizeObserver`, not the viewport. @default 768 */\n breakpoint?: number\n /** Whether the desktop sidebar is collapsed (controlled). Ignored below\n * `breakpoint`. */\n collapsed?: boolean\n /** Initial collapsed state (uncontrolled). @default false */\n defaultCollapsed?: boolean\n /** Called when a `SidebarCollapseTrigger` (or `useAppShell().setCollapsed`)\n * collapses or expands the desktop sidebar. */\n onCollapsedChange?: (collapsed: boolean) => void\n /** Lands on the grid root; also used internally to measure `breakpoint`\n * against the container's own width. */\n ref?: Ref<HTMLDivElement>\n }\n\nconst AppShellRoot = ({\n breakpoint = 768,\n collapsed: collapsedProp,\n defaultCollapsed,\n onCollapsedChange,\n className,\n style,\n children,\n ref,\n testId,\n onClick,\n ...rest\n}: AppShellProps) => {\n const rootRef = useRef<HTMLDivElement>(null)\n const [mobileOpen, setMobileOpen] = useState(false)\n const [collapsed, setCollapsed] = useUncontrolled({\n value: collapsedProp,\n defaultValue: defaultCollapsed,\n finalValue: false,\n onChange: onCollapsedChange,\n })\n const isMobile = useContainerQuery(rootRef, breakpoint)\n const sidebarId = `app-shell-sidebar-${useId()}`\n\n const mergedRef = useMergedRefs(ref, rootRef)\n return (\n <AppShellContext.Provider\n value={{ mobileOpen, setMobileOpen, isMobile, collapsed, setCollapsed, sidebarId }}\n >\n <ark.div\n {...props({\n \"data-testid\": testId,\n \"data-sidebar-collapsed\": collapsed && !isMobile,\n })}\n {...rest}\n ref={mergedRef}\n // The drawer is portaled out of this element in the DOM, but React\n // still bubbles its clicks through here. Closing on a followed link\n // is what a page load would have done; a client-side router doesn't\n // reload, so without this the drawer stays open over the new page.\n onClick={(event) => {\n onClick?.(event)\n if (mobileOpen && followsLink(event, document.getElementById(sidebarId))) {\n setMobileOpen(false)\n }\n }}\n style={{ gridTemplateAreas: `\"sidebar header header\" \"sidebar main aside\"`, ...style }}\n className={cn(\n \"@container grid h-dvh grid-cols-[auto_1fr_auto] grid-rows-[auto_1fr] overflow-hidden\",\n className,\n )}\n >\n {children}\n </ark.div>\n </AppShellContext.Provider>\n )\n}\n\nconst SIDEBAR_WIDTH: Record<Size, string> = {\n xs: \"w-56\",\n sm: \"w-64\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-96\",\n}\n\n/** The icon rail's width: exactly the expanded sidebar's icon column —\n * SidebarBody's 16px padding + NavLink's 10px row padding on each side of a\n * 16px icon, plus the aside's 1px end border. At this width nothing has to re-lay out on a rail: every icon\n * (and the header's trigger, and the footer's avatar) sits where it does\n * when expanded, so opening and closing only animates the width, with\n * nothing jumping as the labels come and go. A NavLink row is then a 36px\n * square by itself. */\nconst RAIL_WIDTH = \"w-[calc(--spacing(17)+1px)]\"\n\n/** How long (ms) the pointer must stay *still* on an icon rail before it\n * peeks open. Any movement past `RAIL_REST_TOLERANCE` restarts the count, so\n * travelling across the icons (and reading their tooltips, 200ms) never opens\n * it — only a deliberate rest does. */\nconst RAIL_PEEK_DELAY = 1200\n/** How far (px) the pointer may drift and still count as resting — a hand on\n * a mouse or trackpad is never perfectly still. */\nconst RAIL_REST_TOLERANCE = 4\n\nexport type AppShellSidebarCollapse = \"hide\" | \"icons\"\n\nexport type AppShellSidebarProps = NoAsChild<HTMLArkProps<\"aside\">> &\n WithTestId & {\n /** Width when expanded, from the kit's Size scale. @default \"md\" */\n size?: Size\n /** What collapsing does on desktop. `\"hide\"` slides the sidebar off the\n * edge, peeking back as a card on hover at the edge. `\"icons\"` shrinks it\n * to a 68px icon rail: labels turn into tooltips, and resting on the rail\n * peeks the full sidebar over the page. @default \"hide\" */\n collapse?: AppShellSidebarCollapse\n }\n\n/**\n * Below `breakpoint`, renders through the kit's own `Drawer` instead of the\n * grid column — same `SidebarHeader`/`SidebarBody`/`SidebarFooter` children\n * either way, mirroring the desktop docked aside's layout: `Drawer`'s own\n * body normally forces every child through one scrolling container, which\n * would otherwise carry Header/Footer along with the scroll instead of\n * pinning them — `classNames.body` turns it into the same flex column\n * (Header/Footer as plain shrink-0 flex items, only SidebarBody's own\n * `overflow-y-auto` scrolls) instead. Full width, opening from the logical\n * end edge (right in LTR). `withCloseButton={false}` — at full width,\n * `Drawer`'s own generic close bar would just stack a second, redundant\n * header above `SidebarHeader`; render a `SidebarTrigger` inside\n * `SidebarHeader` itself instead for one unified bar with a visible close\n * affordance (swipe-to-dismiss on `Drawer`'s content still works too, but\n * isn't the only way out — not discoverable, and risky to rely on alone in\n * a sidebar full of tappable nav rows).\n *\n * Exclusive branch, not always-mounted-and-CSS-hidden like `Aside` — unlike\n * `Aside`, `Sidebar` has two genuinely different structural forms (a plain\n * `<aside>` vs. a portaled dialog with focus-trap/ARIA machinery), so\n * keeping both permanently mounted would mean literally duplicating\n * `children` (and any side effects inside it) into two simultaneous trees.\n * Matches fumadocs' own sidebar, which is JS-conditional for the same\n * reason — only its TOC (this component's `Aside`) goes the always-mounted\n * route. Only `size`/`className`/`children` and the `aria-label` /\n * `aria-labelledby` naming carry over to `Drawer` mode; arbitrary `<aside>`\n * props don't apply to `Drawer`'s own curated prop surface. The drawer has\n * no `title`, so without one of those it is a dialog with no name (and\n * `Drawer` warns in development).\n */\nconst AppShellSidebar = ({\n size = \"md\",\n collapse = \"hide\",\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: AppShellSidebarProps) => {\n const { isMobile, mobileOpen, setMobileOpen, collapsed, sidebarId } = useAppShell()\n const columnRef = useRef<HTMLDivElement>(null)\n const asideRef = useRef<HTMLElement>(null)\n const icons = collapse === \"icons\"\n const { peeking, restPoint, onPointerEnter, onPointerMove, onPointerLeave, onScrollActivity } =\n useSidebarPeek(collapsed, columnRef, asideRef, icons ? RAIL_PEEK_DELAY : 0)\n // Icons only: collapsed to the rail and not peeking.\n const rail = icons && collapsed && !peeking\n useRailAnchor(icons && collapsed && !isMobile, peeking, asideRef, restPoint)\n\n if (isMobile) {\n return (\n <Drawer\n open={mobileOpen}\n onOpenChange={setMobileOpen}\n placement=\"end\"\n withCloseButton={false}\n aria-label={rest[\"aria-label\"]}\n aria-labelledby={rest[\"aria-labelledby\"]}\n ids={{ content: sidebarId }}\n testId={testId}\n classNames={{ body: \"flex flex-col overflow-hidden p-0\" }}\n className={cn(\"w-full max-w-none\", className)}\n >\n {children}\n </Drawer>\n )\n }\n\n // Two layers, as in fumadocs: the column is what the grid track sizes\n // itself to (and what animates to zero), while the aside is positioned\n // inside it at a fixed width — so its content never reflows mid-collapse,\n // and the same element can float back out as a card while collapsed.\n return (\n <div\n ref={columnRef}\n id={sidebarId}\n className={cn(\n \"[grid-area:sidebar] relative z-10\",\n \"transition-[width] duration-250 ease-out motion-reduce:transition-none\",\n collapsed ? (icons ? RAIL_WIDTH : \"w-0\") : SIDEBAR_WIDTH[size],\n )}\n >\n {collapsed && !icons && (\n // The hot strip along the start edge that brings the card back. Before\n // the aside in the DOM so a peeking card paints over it.\n <div\n aria-hidden\n data-sidebar-edge=\"\"\n className=\"absolute inset-y-0 inset-s-0 w-4\"\n onPointerEnter={onPointerEnter}\n onPointerLeave={onPointerLeave}\n />\n )}\n <ark.aside\n {...props({\n \"data-testid\": testId,\n \"data-collapsed\": collapsed,\n \"data-peeking\": peeking,\n \"data-sidebar-rail\": rail,\n })}\n {...rest}\n ref={asideRef}\n // Off-screen links must not take Tab focus, nor be read out. A rail\n // is on screen, so it stays interactive.\n inert={collapsed && !icons && !peeking}\n onPointerEnter={(event) => {\n rest.onPointerEnter?.(event)\n onPointerEnter(event)\n }}\n // Capture: `scroll` doesn't bubble from SidebarBody, and a wheel\n // that can't scroll (at an end) is still the user scrolling.\n onWheelCapture={(event) => {\n rest.onWheelCapture?.(event)\n onScrollActivity()\n }}\n onScrollCapture={(event) => {\n rest.onScrollCapture?.(event)\n onScrollActivity()\n }}\n onPointerMove={(event) => {\n rest.onPointerMove?.(event)\n onPointerMove(event)\n }}\n onPointerLeave={(event) => {\n rest.onPointerLeave?.(event)\n onPointerLeave(event)\n }}\n className={cn(\n \"absolute inset-y-0 inset-s-0 flex flex-col overflow-hidden\",\n TEXT_COLOR_CLASSES.primary,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"border-e border-brand-900/20 bg-brand-50/90 dark:border-white/15 dark:bg-brand-950/85\",\n \"transition-[width,translate,inset-block,border-radius,box-shadow] duration-250 ease-out motion-reduce:transition-none\",\n rail ? RAIL_WIDTH : SIDEBAR_WIDTH[size],\n // A peeking rail widens in place, over the page.\n icons && peeking && \"shadow-lg backdrop-blur-sm\",\n collapsed &&\n !icons && [\n // Collapsed, it's a floating panel over scrolling content — so it\n // takes Popover's blur, which the docked column doesn't need.\n \"inset-y-2 rounded-xl border backdrop-blur-sm\",\n peeking\n ? \"translate-x-2 shadow-lg rtl:-translate-x-2\"\n : \"-translate-x-full rtl:translate-x-full\",\n ],\n className,\n )}\n >\n <SidebarRailContext.Provider value={icons ? { active: rail } : null}>\n {children}\n </SidebarRailContext.Provider>\n </ark.aside>\n </div>\n )\n}\n\n/** Pointer-leave grace period (ms) when the pointer leaves near the shell's\n * edge — overshooting the window edge shouldn't snap the card shut. */\nconst PEEK_LEAVE_DELAY = 500\n/** How close to the shell's edge (px) a pointer-leave counts as \"near\". */\nconst PEEK_EDGE_DISTANCE = 100\n\n/**\n * Hover-to-peek for a collapsed sidebar, ported from fumadocs'\n * `SidebarContent`. Entering the edge strip (or the card itself) shows the\n * card; leaving hides it — at once when the pointer heads into the page, after\n * a grace period when it leaves near the edge. An icon rail (`enterDelay`)\n * instead waits for the pointer to come to rest: the count restarts whenever\n * it moves more than `RAIL_REST_TOLERANCE`, and leaving cancels it. Touch is\n * ignored (there is no hover to end it), and so is arming while the aside is\n * still animating —\n * otherwise collapsing with the pointer over the sidebar would peek it right\n * back. Leaving is never ignored, so a card can't get stuck open.\n */\nfunction useSidebarPeek(\n collapsed: boolean,\n columnRef: RefObject<HTMLElement | null>,\n asideRef: RefObject<HTMLElement | null>,\n /** How long the pointer must stay before the card shows — 0 at the hide\n * mode's edge strip, a dwell on an icon rail, where hovering an icon\n * should show its tooltip first. */\n enterDelay: number,\n) {\n const [hovered, setHovered] = useState(false)\n const [wasCollapsed, setWasCollapsed] = useState(collapsed)\n const timer = useRef<number | undefined>(undefined)\n /** Where the pointer was when the current rest began; null when not armed. */\n const restOrigin = useRef<{ x: number; y: number } | null>(null)\n /** Where the pointer rested when the rail last peeked open. */\n const restPoint = useRef<{ x: number; y: number } | null>(null)\n\n // Any collapse or expand starts from a hidden card.\n if (wasCollapsed !== collapsed) {\n setWasCollapsed(collapsed)\n setHovered(false)\n }\n useEffect(() => () => window.clearTimeout(timer.current), [])\n\n const ignored = (event: PointerEvent<HTMLElement>) =>\n !collapsed ||\n event.pointerType === \"touch\" ||\n (asideRef.current?.getAnimations?.().length ?? 0) > 0\n\n /** (Re)start the rest count from where the pointer is now. */\n const armRest = (event: PointerEvent<HTMLElement>) => {\n restOrigin.current = { x: event.clientX, y: event.clientY }\n restartRest()\n }\n\n const restartRest = () => {\n window.clearTimeout(timer.current)\n timer.current = window.setTimeout(() => {\n restPoint.current = restOrigin.current\n restOrigin.current = null\n setHovered(true)\n }, enterDelay)\n }\n\n const onPointerEnter = (event: PointerEvent<HTMLElement>) => {\n if (ignored(event)) return\n if (enterDelay > 0) return armRest(event)\n window.clearTimeout(timer.current)\n setHovered(true)\n }\n\n const onPointerMove = (event: PointerEvent<HTMLElement>) => {\n if (enterDelay === 0 || hovered || ignored(event)) return\n const origin = restOrigin.current\n // Also arms a rest the enter couldn't (the pointer was already over the\n // aside when it finished animating).\n if (\n !origin ||\n Math.hypot(event.clientX - origin.x, event.clientY - origin.y) > RAIL_REST_TOLERANCE\n ) {\n armRest(event)\n }\n }\n\n /**\n * Scrolling the rail is not resting on it, even with the pointer parked:\n * the rows are sliding under it, and the one it ends on is the one the user\n * means. So a wheel or scroll restarts the count, and the rail opens only\n * once both the pointer *and* the list have been still — not mid-scroll, on\n * whichever row happened to be passing. Only while a rest is pending (the\n * pointer is over the rail), so the anchoring's own scrolling, which runs\n * while open or after the pointer left, never arms one.\n */\n const onScrollActivity = () => {\n if (enterDelay === 0 || hovered || !restOrigin.current) return\n restartRest()\n }\n\n const onPointerLeave = (event: PointerEvent<HTMLElement>) => {\n if (!collapsed || event.pointerType === \"touch\") return\n restOrigin.current = null\n window.clearTimeout(timer.current)\n // Measured against the shell, not the viewport: AppShell may be embedded.\n const shell = columnRef.current?.parentElement ?? document.documentElement\n const { left, right } = shell.getBoundingClientRect()\n const fromEdge = Math.min(event.clientX - left, right - event.clientX)\n timer.current = window.setTimeout(\n () => setHovered(false),\n fromEdge > PEEK_EDGE_DISTANCE ? 0 : PEEK_LEAVE_DELAY,\n )\n }\n\n return {\n peeking: collapsed && hovered,\n restPoint,\n onPointerEnter,\n onPointerMove,\n onPointerLeave,\n onScrollActivity,\n }\n}\n\n/** The nearest scrolling ancestor of `node` inside `within` — SidebarBody,\n * unless a consumer put the row in a scroller of their own. */\nfunction scrollerOf(node: Element, within: Element): HTMLElement | null {\n for (let el = node.parentElement; el && el !== within; el = el.parentElement) {\n const { overflowY } = getComputedStyle(el)\n if (overflowY === \"auto\" || overflowY === \"scroll\") return el\n }\n return null\n}\n\n/** Longest gap (ms) between wheel events that still counts as one stream —\n * trackpad momentum fires every frame or so; a new, deliberate scroll starts\n * after a pause. */\nconst WHEEL_STREAM_GAP = 150\n\n/** Safety stop (ms) for the anchoring: it normally ends with the transition's\n * own animations (width 250ms, Collapse 300ms). */\nconst ANCHOR_MAX_DURATION = 1000\n\n/**\n * Keeps the row under the pointer where it is while an icon rail peeks open,\n * and while it closes again. Opening unfolds nested rows (NavLink's Collapse)\n * above it, which would otherwise push it down and out from under the pointer;\n * so every time the scroller's content resizes during the transition, the\n * scroller scrolls by exactly the distance it drifted. Self-correcting (it\n * re-measures against the starting position each time), it follows the\n * transition until its animations finish. Meanwhile it owns the list's scroll:\n * wheel events wait the ~300ms out (trackpad momentum would otherwise fight\n * it).\n *\n * The element is picked once, under the pointer at the moment the rail opens,\n * and reused on close: folding everything back above the same element walks\n * the scroll back to where the rail was, so a rail is never left scrolled.\n * Where the list is too short to scroll that far, it stays as close as the\n * scroll allows.\n */\nfunction useRailAnchor(\n enabled: boolean,\n peeking: boolean,\n asideRef: RefObject<HTMLElement | null>,\n restPoint: RefObject<{ x: number; y: number } | null>,\n) {\n const anchor = useRef<Element | null>(null)\n\n // A layout effect: it runs before the first frame of the transition paints,\n // while everything still sits where it did, so the starting position is\n // the true pre-open one.\n useIsomorphicLayoutEffect(() => {\n const aside = asideRef.current\n if (!enabled || !aside) return\n if (peeking) {\n const point = restPoint.current\n const hit = point ? document.elementFromPoint?.(point.x, point.y) : null\n anchor.current = hit && aside.contains(hit) ? hit : null\n }\n const target = anchor.current\n if (!peeking) anchor.current = null\n if (!target?.isConnected) return\n const scroller = scrollerOf(target, aside)\n if (!scroller) return\n\n const top = target.getBoundingClientRect().top\n // No \"a scroll we didn't make means the user took over\" check: the\n // browser makes some itself. Scrolled to the bottom, anything that changes\n // the scroller's height mid-transition (a footer whose text rewraps as the\n // rail widens) clamps the scroll and fires one, and treating that as the\n // user dropped the correction halfway, at random. The wheel is held below,\n // and nothing else scrolls a sidebar in a 300ms window.\n const correct = () => {\n const drift = target.getBoundingClientRect().top - top\n if (drift !== 0) scroller.scrollTop += drift\n }\n // A ResizeObserver, not requestAnimationFrame: its callbacks run after\n // layout and before paint, so each frame is corrected before it's drawn.\n // rAF runs before layout, sees the previous frame, and always lags one —\n // visible as a jolt on Collapse's fast-starting first frame.\n const observer = new ResizeObserver(correct)\n // The scroller too, not just its content: its own height changing (a\n // footer rewrapping) can move the row as well.\n observer.observe(scroller)\n for (const child of scroller.children) observer.observe(child)\n // The browser's own scroll anchoring would adjust the same scroll from its\n // own anchor node; keep it out while this one runs.\n const overflowAnchor = scroller.style.overflowAnchor\n scroller.style.overflowAnchor = \"none\"\n // Wheel scrolling waits out the transition (~300ms), and any wheel stream\n // already running through it. A trackpad keeps sending momentum wheel\n // events for a second or more after a flick: the user has stopped\n // scrolling, but the events still scroll the list (which, corrected, is no\n // longer resting against the edge that absorbed them), and nothing in a\n // WheelEvent tells inertia from intent. Letting them through dragged the\n // row out from under the pointer, at random. Momentum is one unbroken\n // stream, so the first wheel event after a pause is the user's again.\n let stopped = false\n let lastWheel = Number.NEGATIVE_INFINITY\n const holdWheel = (event: WheelEvent) => {\n const continuing = event.timeStamp - lastWheel < WHEEL_STREAM_GAP\n lastWheel = event.timeStamp\n if (!stopped || continuing) event.preventDefault()\n else releaseWheel()\n }\n const releaseWheel = () => scroller.removeEventListener(\"wheel\", holdWheel)\n const stop = () => {\n if (stopped) return\n stopped = true\n observer.disconnect()\n scroller.style.overflowAnchor = overflowAnchor\n }\n scroller.addEventListener(\"wheel\", holdWheel, { passive: false })\n // Done once the transition is: reading the animations here also flushes\n // the style change, so the width and Collapse transitions already exist.\n // Without getAnimations, only the timeout ends it.\n let settle = 0\n if (aside.getAnimations) {\n const running = aside.getAnimations({ subtree: true })\n Promise.allSettled(running.map((animation) => animation.finished)).then(() => {\n // One frame late, on purpose. `finished` resolves at the start of the\n // final frame, before that frame lays out the animations' end values;\n // stopping right away skipped the last few px of the unfold, leaving\n // the row 3px off (more or less, by frame timing). The next frame's\n // rAF runs after that layout and its ResizeObserver correction.\n settle = requestAnimationFrame(stop)\n })\n }\n const timeout = window.setTimeout(stop, ANCHOR_MAX_DURATION)\n return () => {\n stop()\n releaseWheel()\n window.clearTimeout(timeout)\n cancelAnimationFrame(settle)\n }\n }, [enabled, peeking])\n}\n\n// Shared by SidebarHeader and Header so the two sit at the same height and\n// Header's bottom border lines up level with SidebarHeader's own bottom edge\n// — sizing each off its own padding + content independently (the original\n// approach) drifts out of sync as soon as one holds taller content than the\n// other.\nconst HEADER_HEIGHT_CLASS = \"h-14\"\n\nexport type AppShellSidebarHeaderProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n// Plain flex sibling, not routed through the `ark.*` factory — mirrors\n// Drawer.Header/.Body/.Footer, which aren't either.\nconst AppShellSidebarHeader = ({ className, testId, ...rest }: AppShellSidebarHeaderProps) => (\n <div\n className={cn(HEADER_HEIGHT_CLASS, \"flex shrink-0 items-center gap-2 px-4\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarBodyProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/**\n * The scroll region — the only part of Sidebar that scrolls. On an icon rail\n * its scrollbar is hidden (no room for one). The mask fades\n * content at the top/bottom edges instead of clipping it on a hard line\n * (fumadocs' own docs sidebar uses the same static mask on its nav\n * viewport); `overscroll-contain` stops scrolling the list from chaining\n * into scrolling the rest of the page once it hits either end.\n */\nconst AppShellSidebarBody = ({ className, testId, ...rest }: AppShellSidebarBodyProps) => (\n <div\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain p-4\",\n // A classic (non-overlay) scrollbar would take ~15px of a 68px rail and\n // push the icons off-centre. The rail still scrolls by wheel, touch and\n // focus, and the edge mask below still shows there's more.\n \"sidebar-rail:[scrollbar-width:none]\",\n \"[mask-image:linear-gradient(to_bottom,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarFooterProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nconst AppShellSidebarFooter = ({ className, testId, ...rest }: AppShellSidebarFooterProps) => (\n <div className={cn(\"shrink-0 p-4\", className)} {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellHeaderProps = HTMLArkProps<\"header\"> & WithTestId\n\nconst AppShellHeader = ({ className, testId, ...rest }: AppShellHeaderProps) => (\n <ark.header\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n HEADER_HEIGHT_CLASS,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"[grid-area:header] flex shrink-0 items-center gap-3 border-b border-brand-900/20 bg-brand-50/90 px-4 text-brand-950\",\n \"dark:border-white/15 dark:bg-brand-950/85 dark:text-white\",\n className,\n )}\n />\n)\n\nexport type AppShellMainSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\n// A local scale rather than the shared Size one: these are page widths, not\n// control widths, so they read off the kit's own `--width-*` tokens\n// (theme.css) — the vocabulary Modal already uses — instead of inventing a\n// second set. Static class strings so Tailwind's build-time scanner picks them\n// up, in the same lookup-map shape as SIDEBAR_WIDTH/ASIDE_WIDTH above.\nconst MAIN_MEASURE: Record<AppShellMainSize, string> = {\n sm: \"[--app-shell-measure:var(--width-xl)]\", // 48rem / 768px\n md: \"[--app-shell-measure:var(--width-2xl)]\", // 64rem / 1024px\n lg: \"[--app-shell-measure:var(--width-3xl)]\", // 80rem / 1280px\n xl: \"[--app-shell-measure:var(--width-4xl)]\", // 90rem / 1440px\n}\n\nexport type AppShellMainProps = HTMLArkProps<\"main\"> &\n WithTestId & {\n /** Width of the content column, from the kit's `--width-*` tokens:\n * `sm` 48rem · `md` 64rem · `lg` 80rem · `xl` 90rem. @default \"lg\" */\n size?: AppShellMainSize\n /** Drop the content column entirely — children fill Main edge to edge, as\n * they did before the column existed. For pages whose Main *is* one\n * full-canvas component (a Schedule, a DataTable sized to the viewport)\n * rather than a document. @default false */\n fluid?: boolean\n }\n\n/**\n * The page region. By default its children sit in a centered content column,\n * so a page of prose and forms doesn't stretch to whatever width the window\n * happens to be; `AppShell.Full` opts one child out to the full width, and\n * `AppShell.Content` puts arbitrary content back in.\n *\n * The column is three grid tracks — `1fr`, the column, `1fr` — rather than\n * inline padding, which is what lets a child span *past* the gutters without\n * negative margins, `100vw`, or any JS measurement. Percentages in track\n * sizing resolve against Main's own content box, so the column is correct\n * beside a sidebar, inside a resizable pane, or in a bounded docs preview\n * frame, with no media query and no `ResizeObserver` involved. Below\n * `measure + 2 × gutter` the middle track collapses to `100% - 2 × gutter`\n * and the `1fr` tracks land exactly on the gutter, so the column degrades\n * into plain padding continuously, without a breakpoint.\n *\n * `align-content: start` is load-bearing: grid's default (`normal`, i.e.\n * `stretch`) hands leftover vertical space to every auto row, which would\n * space a short page's blocks out down the viewport.\n *\n * <AppShell.Main>\n * <Title>Quarterly sales</Title>\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n * </AppShell.Main>\n */\nconst AppShellMain = ({\n size = \"lg\",\n fluid = false,\n className,\n testId,\n ...rest\n}: AppShellMainProps) => (\n <ark.main\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:main] min-h-0 overflow-y-auto\",\n !fluid && [\n // Gutter doubles as Main's block padding, so content never butts\n // against Header. Overridable per page with\n // `className=\"[--app-shell-gutter:2rem]\"`; both vars inherit, which is\n // what lets `AppShell.Content` re-derive the column at any depth.\n \"[--app-shell-gutter:1.5rem] py-(--app-shell-gutter)\",\n MAIN_MEASURE[size],\n \"grid content-start grid-cols-[1fr_min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))_1fr]\",\n // Both placement rules are authored here, on the same element, so\n // their relative weight is decided by specificity — `.main > [data-full]`\n // (0,2,0) over `.main > *` (0,1,0) — and never by where Tailwind\n // happens to sort two same-weight utilities. `min-w-0` stops a wide\n // child (a DataTable) overflowing the column, and zeroes a spanning\n // child's min-content contribution so it can't inflate the gutters.\n \"[&>*]:col-start-2 [&>*]:min-w-0\",\n \"[&>[data-full]]:col-span-full\",\n ],\n className,\n )}\n />\n)\n\nexport type AppShellFullProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Opts one child of `AppShell.Main` out of the content column, spanning every\n * track so it reaches Main's true edges — for the things a column actively\n * hurts: data tables, carousels, heroes, full-width backgrounds.\n *\n * Carries no layout class of its own; it only marks itself with `data-full`,\n * and Main's own rule does the placement (see `AppShellMain`). `asChild`\n * merges that marker onto the component itself, so nothing extra lands in the\n * DOM:\n *\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n *\n * Only works as a *direct* child of Main — breaking out of a grid means being\n * in it. Wrap content in a `Full` band and use `AppShell.Content` inside it\n * rather than nesting `Full` deeper.\n */\nconst AppShellFull = ({ testId, ...rest }: AppShellFullProps) => (\n <ark.div data-full=\"\" {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellContentProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Puts content back into Main's column — the counterpart to `AppShell.Full`,\n * for a full-width band whose *text* should still line up with the rest of the\n * page:\n *\n * <AppShell.Full asChild>\n * <section className=\"bg-brand-50 py-16\">\n * <AppShell.Content>\n * <Title>Welcome back</Title>\n * </AppShell.Content>\n * </section>\n * </AppShell.Full>\n *\n * The width expression is the same one Main gives its middle track, resolved\n * against this element's own containing block, so the edges line up exactly at\n * both ends of the range — full measure when there's room, gutter-only when\n * there isn't. Reading the inherited custom properties rather than using\n * `subgrid` is deliberate: subgrid would only reach one level down, only from\n * an element spanning every track, and would break on any wrapper in between.\n * This works at any depth, including inside a `fluid` Main.\n */\nconst AppShellContent = ({ className, testId, ...rest }: AppShellContentProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"mx-auto w-[min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))]\",\n className,\n )}\n />\n)\n\nconst ASIDE_WIDTH: Record<Size, string> = {\n xs: \"@xl:w-56\",\n sm: \"@xl:w-64\",\n md: \"@xl:w-72\",\n lg: \"@xl:w-80\",\n xl: \"@xl:w-96\",\n}\n\nexport type AppShellAsideProps = HTMLArkProps<\"aside\"> &\n WithTestId & {\n /** Width when visible, from the kit's Size scale. @default \"md\" */\n size?: Size\n }\n\n/**\n * The right region, below `Header` (unlike `Sidebar`, which spans the full\n * height beside it). Unlike `Sidebar`, always mounted — hidden below a\n * `@xl` *container* breakpoint (1280px of `AppShell`'s own width, via\n * Tailwind's native container queries — `AppShell`'s root carries\n * `@container`) and shown above it, purely via static classes, no\n * `useContainerQuery`/context involved. Matches fumadocs' own docs layout,\n * which keeps its table-of-contents rail always in the DOM rather than\n * conditionally unmounting it — no hydration mismatch is possible when\n * nothing renders differently based on client-only state. Fixed to `@xl`\n * rather than a configurable prop like Sidebar's `breakpoint`: Sidebar's is\n * JS-driven and can take any pixel value at runtime, but a static Tailwind\n * class can't take an arbitrary runtime breakpoint without breaking the\n * build-time class scanner.\n */\nconst AppShellAside = ({ size = \"md\", className, testId, ...rest }: AppShellAsideProps) => (\n <ark.aside\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:aside] hidden flex-col overflow-y-auto\",\n TEXT_COLOR_CLASSES.primary,\n \"@xl:flex\",\n ASIDE_WIDTH[size],\n className,\n )}\n />\n)\n\nexport type AppShellSidebarTriggerProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * Opens/closes the mobile `Drawer`. Renders nothing above `breakpoint`,\n * where the sidebar is a grid column — `SidebarCollapseTrigger` is the\n * desktop counterpart that collapses it.\n * `asChild`-able, like every other kit trigger. Carries `aria-expanded` and\n * `aria-controls` (the drawer's content), like any disclosure button.\n */\nconst AppShellSidebarTrigger = ({ onClick, testId, ...rest }: AppShellSidebarTriggerProps) => {\n const { isMobile, mobileOpen, setMobileOpen, sidebarId } = useAppShell()\n\n if (!isMobile) return null\n\n return (\n <ark.button\n type=\"button\"\n aria-expanded={mobileOpen}\n aria-controls={sidebarId}\n {...props({ \"data-testid\": testId })}\n {...rest}\n onClick={(event) => {\n onClick?.(event)\n setMobileOpen((open) => !open)\n }}\n />\n )\n}\n\nexport type AppShellSidebarCollapseTriggerProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * Collapses/expands the desktop sidebar — `SidebarTrigger`'s desktop\n * counterpart, and its mirror image: renders nothing below `breakpoint`,\n * where the sidebar is a drawer and there's nothing to collapse. Rendering one\n * is what opts a shell into collapsing. `asChild`-able; carries\n * `aria-expanded`, `aria-controls` and `data-collapsed`.\n *\n * Usually rendered twice: in `SidebarHeader` to collapse, and in `Header` to\n * expand again (the one in the sidebar slides away with it) — the Header one\n * often only while `useAppShell().collapsed`. Collapsing from the one inside\n * the sidebar hands focus to a collapse trigger outside it, including one\n * that only just rendered, since the collapsed sidebar is `inert` and would\n * otherwise drop focus on the floor.\n */\nconst AppShellSidebarCollapseTrigger = ({\n onClick,\n testId,\n ...rest\n}: AppShellSidebarCollapseTriggerProps) => {\n const { isMobile, collapsed, setCollapsed, sidebarId } = useAppShell()\n\n if (isMobile) return null\n\n return (\n <ark.button\n type=\"button\"\n aria-expanded={!collapsed}\n aria-controls={sidebarId}\n data-app-shell-collapse-trigger=\"\"\n {...props({ \"data-testid\": testId, \"data-collapsed\": collapsed })}\n {...rest}\n onClick={(event) => {\n onClick?.(event)\n const button = event.currentTarget\n // Commit synchronously, so a trigger that only renders while\n // collapsed (an \"expand\" button in Header) exists to take focus.\n flushSync(() => setCollapsed((value) => !value))\n // Collapsed out of sight (`collapse=\"hide\"`), the sidebar is now\n // inert and this button with it. A rail stays usable, so focus stays.\n const sidebar = document.getElementById(sidebarId)\n if (sidebar && button.closest(\"[inert]\")) {\n const outside = [\n ...(sidebar.parentElement?.querySelectorAll<HTMLElement>(\n \"[data-app-shell-collapse-trigger]\",\n ) ?? []),\n ].find((trigger) => !sidebar.contains(trigger))\n outside?.focus()\n }\n }}\n />\n )\n}\n\nexport const AppShell = Object.assign(AppShellRoot, {\n Sidebar: AppShellSidebar,\n SidebarHeader: AppShellSidebarHeader,\n SidebarBody: AppShellSidebarBody,\n SidebarFooter: AppShellSidebarFooter,\n SidebarTrigger: AppShellSidebarTrigger,\n SidebarCollapseTrigger: AppShellSidebarCollapseTrigger,\n Header: AppShellHeader,\n Main: AppShellMain,\n Full: AppShellFull,\n Content: AppShellContent,\n Aside: AppShellAside,\n})\n"]}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { normalizeSelectData, useLabelSearch, filterSelectData } from '../../chunk-7TDHT3QD.js';
3
- import { resolveComboboxTranslations, Combobox } from '../../chunk-YPFSRZ3T.js';
3
+ import { resolveComboboxTranslations, Combobox } from '../../chunk-2NTCQIRP.js';
4
4
  import { controlOpenProps } from '../../chunk-5FDOOG4J.js';
5
- import { inputControlClasses, inputSlot } from '../../chunk-3L5GLI67.js';
6
- import { FieldShell } from '../../chunk-VD6PB3VA.js';
7
- import { popoverClearTrigger } from '../../chunk-N66NC6QK.js';
5
+ import { inputControlClasses, inputSlot } from '../../chunk-I4B3N3UX.js';
6
+ import { FieldShell } from '../../chunk-X6DESK37.js';
7
+ import { popoverClearTrigger } from '../../chunk-E3XLWMEB.js';
8
+ import '../../chunk-H7WOMZXO.js';
8
9
  import '../../chunk-V6PY7C6S.js';
9
10
  import '../../chunk-7P32XCEU.js';
10
- import '../../chunk-H7WOMZXO.js';
11
11
  import { useUncontrolled } from '../../chunk-PMUCGFY5.js';
12
12
  import '../../chunk-BUIHQJGE.js';
13
13
  import { CloseIcon } from '../../chunk-6YNLRQ25.js';
@@ -34,7 +34,7 @@ import type { WithTestId } from "../../lib/test-id";
34
34
  * set `size`/`color` per `Avatar`.
35
35
  */
36
36
  declare const avatarVariants: (props?: ({
37
- size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
37
+ size?: "2xl" | "3xl" | "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
38
38
  radius?: "full" | "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
39
39
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
40
40
  export type AvatarSize = NonNullable<VariantProps<typeof avatarVariants>["size"]>;
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAC3E,OAAO,EAAO,KAAK,YAA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AAA;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B,CAAA;AAkFH,QAAA,MAAM,eAAe,8HAgBlB,WAAW,gCAgEb,CAAA;AAiGD,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,UAAU,CAAA;AAwB9D,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,GAChD,UAAU,GAAG;IACX,qEAAqE;IACrE,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,mEAAmE;IACnE,WAAW,CAAC,EAAE,sBAAsB,CAAA;CACrC,CAAA;AAEH,QAAA,MAAM,WAAW,gEAOd,gBAAgB,gCAWlB,CAAA;AAED,gFAAgF;AAChF,eAAO,MAAM,MAAM;;CAAyD,CAAA"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { graphemes } from '../../chunk-DHM4IG2O.js';
3
- import { useLocale } from '../../chunk-IPYHTCFL.js';
4
- import '../../chunk-6N6J2DOE.js';
3
+ import { useLocale } from '../../chunk-IUK7OJXZ.js';
4
+ import '../../chunk-LIZWCWED.js';
5
5
  import { mergeIcons, iconStroke } from '../../chunk-XXOR34T4.js';
6
6
  import { props } from '../../chunk-WYCMIIRR.js';
7
7
  import { cn } from '../../chunk-4ASNIDV7.js';
@@ -40,12 +40,21 @@ var avatarVariants = cva(
40
40
  // `size`/`spacing` pairing (e.g. `md` avatars in a `spacing="xs"`
41
41
  // group) still gets a correctly-sized notch, just more or less
42
42
  // overlap.
43
+ //
44
+ // `2xl` (88px) and `3xl` (128px) sit outside the shared `SIZES` scale
45
+ // in `lib/sizes.ts`, the way Text/Title/Container declare their own
46
+ // extra steps: they're for a person shown as the subject of a screen
47
+ // rather than in a list. They keep `xl`'s proportions — initials at
48
+ // about 0.28× the diameter, the icon at 0.5× — and their own
49
+ // `--avatar-r`. `Avatar.Group`'s `spacing` stays on the shared scale.
43
50
  size: {
44
51
  xs: "size-6 text-[10px] [&_svg]:size-3.5 [--avatar-r:12]",
45
52
  sm: "size-8 text-xs [&_svg]:size-4 [--avatar-r:16]",
46
53
  md: "size-10 text-sm [&_svg]:size-5 [--avatar-r:20]",
47
54
  lg: "size-12 text-base [&_svg]:size-6 [--avatar-r:24]",
48
- xl: "size-16 text-lg [&_svg]:size-8 [--avatar-r:32]"
55
+ xl: "size-16 text-lg [&_svg]:size-8 [--avatar-r:32]",
56
+ "2xl": "size-22 text-2xl [&_svg]:size-11 [--avatar-r:44]",
57
+ "3xl": "size-32 text-4xl [&_svg]:size-16 [--avatar-r:64]"
49
58
  },
50
59
  // `--avatar-corner-r` also rides along with `radius`: it's the other
51
60
  // half of `Avatar.Group`'s notch for a non-circular avatar (see
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/avatar/avatar.tsx"],"names":["ArkAvatar"],"mappings":";;;;;;;;;;;;AA2CA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB;AAAA,IACE,2EAAA;AAAA,IACA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUA,kCAAA;AAAA,IACA,oCAAA;AAAA,IACA,qDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUR,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,qDAAA;AAAA,QACJ,EAAA,EAAI,+CAAA;AAAA,QACJ,EAAA,EAAI,gDAAA;AAAA,QACJ,EAAA,EAAI,kDAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAcA,MAAA,E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G;AAAA;AACN,CAAA;AAIK,IAAM,SAAS,MAAA,CAAO,MAAA,CAAO,iBAAiB,EAAE,KAAA,EAAO,aAAa","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Avatar as ArkAvatar, ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { UserRound } from \"lucide-react\"\nimport { type ComponentProps, type CSSProperties, type ReactNode, useId } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { graphemes } from \"../../lib/graphemes\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useLocale } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Avatar — circular (by default) image with an automatic fallback. Renders\n * `src` once it loads; falls back to `children` (custom initials or an icon)\n * when there's no image or it fails to load, or to initials/name derived from\n * `name`, or finally to a generic person icon. Wraps Ark's `Avatar` machine,\n * which already tracks image-load state (`loading → loaded/error`) — no\n * bespoke `onError` handling needed here.\n *\n * <Avatar src={user.avatarUrl} name={user.fullName} color=\"brand\" />\n *\n * `color=\"name\"` / `color=\"initials\"` deterministically hash `name` (or its\n * derived initials) into a pick from `palette` instead of a literal `Color` —\n * a stable, no-config accent per person. `display` independently controls\n * what the computed fallback shows: `\"initials\"` (default, two letters) or\n * `\"name\"` (a single leading letter — a full name would overflow the circle).\n *\n * No `asChild` — same reasoning as `Skeleton`: `children` is already\n * repurposed as fallback content, which conflicts with Ark's \"single child to\n * render as\" requirement for polymorphism.\n *\n * `Avatar.Group` overlaps a row — or, with `orientation=\"vertical\"`, a\n * column — of standalone `Avatar`s (Mantine-style stacked avatars),\n * punching a transparent notch into each one where its successor overlaps\n * it — true see-through separation instead of a painted border, so it reads\n * correctly over any page background. It's pure CSS\n * layout, like `ButtonGroup` — it doesn't resize or restyle its children, so\n * set `size`/`color` per `Avatar`.\n */\nconst avatarVariants = cva(\n [\n \"relative inline-flex shrink-0 items-center justify-center overflow-hidden\",\n \"select-none\",\n // Neutral gray by default; a `data-color` tint overrides it with the\n // palette's soft surface + text — the same treatment Pill and Badge's\n // `light` variant use. No variant axis: an avatar is always this one\n // soft-surface look, just optionally tinted. No border either: it used\n // to be border-(--c-soft) once tinted, i.e. always the exact same color\n // as its own background — invisible for every `color`, visible only for\n // the untinted default (border-brand-900/20 against bg-brand-900/6,\n // two different colors) — so whether an avatar showed a border at all\n // used to depend on `color`, not on any actual design intent.\n \"bg-brand-900/6 text-brand-900/70\",\n \"dark:bg-white/8 dark:text-white/80\",\n \"data-color:bg-(--c-soft) data-color:text-(--c-text)\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n ],\n {\n variants: {\n // `--avatar-r` (this avatar's own radius, in px, as a unitless number)\n // rides along with `size` — it's read by `Avatar.Group`'s notch/margin\n // CSS (see AVATAR_GROUP_NOTCH below) so the notch always matches\n // *this* avatar's actual rendered radius, not whatever radius\n // `Avatar.Group`'s own `spacing` happens to assume. `spacing` only\n // ever controls `--avatar-o` (the overlap amount) — a mismatched\n // `size`/`spacing` pairing (e.g. `md` avatars in a `spacing=\"xs\"`\n // group) still gets a correctly-sized notch, just more or less\n // overlap.\n size: {\n xs: \"size-6 text-[10px] [&_svg]:size-3.5 [--avatar-r:12]\",\n sm: \"size-8 text-xs [&_svg]:size-4 [--avatar-r:16]\",\n md: \"size-10 text-sm [&_svg]:size-5 [--avatar-r:20]\",\n lg: \"size-12 text-base [&_svg]:size-6 [--avatar-r:24]\",\n xl: \"size-16 text-lg [&_svg]:size-8 [--avatar-r:32]\",\n },\n // `--avatar-corner-r` also rides along with `radius`: it's the other\n // half of `Avatar.Group`'s notch for a non-circular avatar (see\n // AVATAR_GROUP_NOTCH and AvatarNotchMaskDefs below). A gradient can\n // only cut a circle/ellipse, never a true rounded rect, so\n // `radius=\"full\"` keeps using a mask-image ellipse (the shape it\n // actually needs), but every other radius instead cuts a real\n // rounded-rect *hole* via a per-instance SVG `<mask>`, using this\n // avatar's own actual radius token (`theme.css`'s\n // `--radius-xs`..`--radius-xl`, in px) as that hole's corner radius.\n // `\"full\"` deliberately has no `--avatar-corner-r` and never renders\n // that SVG mask at all — its radius (50% of the box) isn't a fixed px\n // value the way the others are, so there's nothing meaningful to plug\n // in here; the mask-image ellipse already handles it correctly.\n radius: {\n xs: \"rounded-xs [--avatar-corner-r:4]\",\n sm: \"rounded-sm [--avatar-corner-r:6]\",\n md: \"rounded-md [--avatar-corner-r:8]\",\n lg: \"rounded-lg [--avatar-corner-r:10]\",\n xl: \"rounded-xl [--avatar-corner-r:12]\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n size: \"md\",\n // Unlike ThemeIcon (a square icon surface), an avatar reads as\n // circular by default — matching Mantine's own default.\n radius: \"full\",\n },\n },\n)\n\nexport type AvatarSize = NonNullable<VariantProps<typeof avatarVariants>[\"size\"]>\nexport type AvatarRadius = NonNullable<VariantProps<typeof avatarVariants>[\"radius\"]>\n\n/** Shared by `color`'s auto-computed modes and `display`'s content mode. */\nexport type AvatarNameMode = \"name\" | \"initials\"\n\n/**\n * Default hash pool for `color=\"name\"` / `color=\"initials\"`. Excludes\n * `brand` (the kit's own primary/CTA identity color — auto-tinting a user\n * avatar with it would read as \"official\") and `neutral` (muted, and a\n * composed-not-scaled tone per `lib/colors.ts`, so it would just look\n * washed-out for some names). Exported so a consumer can extend it,\n * e.g. `palette={[...AVATAR_PALETTE, \"brand\"]}`.\n */\nexport const AVATAR_PALETTE: Color[] = [\n \"red\",\n \"orange\",\n \"yellow\",\n \"green\",\n \"teal\",\n \"cyan\",\n \"blue\",\n \"purple\",\n \"pink\",\n]\n\nexport type AvatarIconSlot = \"fallback\"\nexport type AvatarIcons = IconMap<AvatarIconSlot>\n\nconst DEFAULT_ICONS: Record<AvatarIconSlot, ReactNode> = {\n fallback: <UserRound className={iconStroke} />,\n}\n\ntype AvatarClassNames = {\n root?: string\n image?: string\n fallback?: string\n}\n\nexport type AvatarProps = Omit<ComponentProps<typeof ArkAvatar.Root>, \"color\" | \"asChild\"> &\n VariantProps<typeof avatarVariants> &\n WithTestId & {\n /** Image source. Falls back automatically when unset or on load error. */\n src?: string\n /**\n * Text alternative for the avatar. Names the image, and the fallback too when the image is\n * missing or fails, so the person isn't reduced to their initials. Defaults to `name`;\n * `alt=\"\"` marks the avatar decorative.\n */\n alt?: string\n /**\n * Accent palette. `\"name\"` / `\"initials\"` deterministically hash `name`\n * (or its derived initials) into a pick from `palette` instead of a\n * literal color. Re-exported as `Color` from `@42/ui-react`.\n */\n color?: Color | AvatarNameMode\n /**\n * Colors eligible for `color=\"name\"` / `color=\"initials\"`'s hash.\n * Ignored otherwise. Defaults to `AVATAR_PALETTE`.\n */\n palette?: Color[]\n /**\n * Full name to derive initials/color from (e.g. \"Ada Lovelace\" → \"AL\")\n * when there's no image and no explicit `children`. Explicit `children`\n * always takes precedence over `name`.\n */\n name?: string\n /**\n * What the computed fallback shows: `\"initials\"` (default, two letters)\n * or `\"name\"` (a single leading letter of `name`).\n */\n display?: AvatarNameMode\n /**\n * Fallback content — shown until the image loads, or permanently when\n * there's no `src`. Overrides the `name`/`display`-derived content.\n */\n children?: ReactNode\n /**\n * Replaces the default icons: `fallback`, the person drawn when there's\n * no image, no `children` and no `name`. `null` leaves the disc empty.\n */\n icons?: AvatarIcons\n classNames?: AvatarClassNames\n }\n\n/** First + last initial for a multi-word name; first two characters for a single word.\n * Characters are graphemes, so an emoji or an accent written as a combining mark stays whole,\n * and upper-casing follows the locale (`i` → `İ` in Turkish). */\nconst getInitials = (name: string, locale: string): string => {\n const [first, ...rest] = name.trim().split(/\\s+/).filter(Boolean)\n if (!first) return \"\"\n const last = rest.at(-1)\n const letters = last\n ? [graphemes(first, locale)[0], graphemes(last, locale)[0]]\n : graphemes(first, locale).slice(0, 2)\n return letters.join(\"\").toLocaleUpperCase(locale)\n}\n\n/** Single leading letter — `display=\"name\"`'s content; a full name would overflow the circle. */\nconst getLeadingLetter = (name: string, locale: string): string =>\n (graphemes(name.trim(), locale)[0] ?? \"\").toLocaleUpperCase(locale)\n\n/** Deterministic string hash (Java-style polynomial rolling hash). */\nconst hashString = (input: string): number => {\n let hash = 0\n for (let i = 0; i < input.length; i++) hash = (hash * 31 + input.charCodeAt(i)) | 0\n return Math.abs(hash)\n}\n\nconst pickColor = (input: string, pool: Color[]): Color | undefined =>\n input && pool.length > 0 ? pool[hashString(input) % pool.length] : undefined\n\nconst isAvatarNameMode = (value: unknown): value is AvatarNameMode =>\n value === \"name\" || value === \"initials\"\n\n/**\n * A per-instance SVG `<mask>` cutting `Avatar.Group`'s notch as a true\n * rounded-rect hole for any non-circular `radius` — see AVATAR_GROUP_NOTCH's\n * own doc comment for why a hole (not a trim/clip) is what's actually needed\n * here. Rendered *inside this avatar itself* — not shared, not on\n * `Avatar.Group` — because an SVG `<mask>`'s content resolves `var()` from\n * wherever the `<mask>` element itself sits in the DOM, not from whatever\n * element references it via `mask: url(#id)` (confirmed empirically: a single\n * shared mask read the *ancestor's* `--avatar-r`, not each differently-sized\n * avatar's own). Nesting a practically-free per-instance one inside each\n * avatar instead means it naturally inherits *that* avatar's own\n * `--avatar-r`/`--avatar-corner-r` and the group's `--avatar-o` and\n * `--avatar-dx`/`--avatar-dy`, the same way any of this avatar's own CSS\n * already does.\n *\n * The hole matches the *next* avatar's box (same-size neighbor assumed),\n * grown by a ~2px gap on every side. It sits one step of `2r - o` (diameter\n * minus overlap) along the group's direction vector `(dx, dy)` — so a single\n * mask covers ltr (`1, 0`), rtl (`-1, 0`) and vertical (`0, 1`) stacks.\n *\n * `size-0 absolute` keeps it out of layout entirely. The `<mask>` element's\n * own `x`/`y`/`width`/`height` (not the same as the hole `<rect>`'s) opt out\n * of the CSS default `objectBoundingBox` region (`-10% -10% 120% 120%` of\n * the avatar's own box) — too small to contain a hole that can extend well\n * beyond the box — for a `userSpaceOnUse` region large enough it never\n * actually clips anything; all real clipping is left to the masked avatar's\n * own box, same as everywhere else in this file.\n */\nconst AvatarNotchMaskDefs = ({ id }: { id: string }) => (\n <svg aria-hidden=\"true\" className=\"absolute size-0\">\n <defs>\n <mask id={id} maskUnits=\"userSpaceOnUse\" x={-1000} y={-1000} width={2000} height={2000}>\n <rect x={-1000} y={-1000} width={2000} height={2000} fill=\"white\" />\n <rect\n style={\n {\n x: \"calc((var(--avatar-dx) * (2 * var(--avatar-r) - var(--avatar-o)) - 2) * 1px)\",\n y: \"calc((var(--avatar-dy) * (2 * var(--avatar-r) - var(--avatar-o)) - 2) * 1px)\",\n width: \"calc((2 * var(--avatar-r) + 4) * 1px)\",\n height: \"calc((2 * var(--avatar-r) + 4) * 1px)\",\n rx: \"calc((var(--avatar-corner-r) + 2) * 1px)\",\n } as CSSProperties\n }\n fill=\"black\"\n />\n </mask>\n </defs>\n </svg>\n)\n\nconst AvatarComponent = ({\n src,\n alt,\n size,\n radius,\n color,\n palette = AVATAR_PALETTE,\n name,\n display = \"initials\",\n children,\n icons,\n className,\n classNames,\n style,\n testId,\n ...rest\n}: AvatarProps) => {\n const locale = useLocale()\n const resolvedColor = isAvatarNameMode(color)\n ? pickColor(color === \"name\" ? (name ?? \"\") : name ? getInitials(name, locale) : \"\", palette)\n : color\n\n const computed = name\n ? display === \"name\"\n ? getLeadingLetter(name, locale)\n : getInitials(name, locale)\n : \"\"\n const fallback = children ?? (computed || mergeIcons(DEFAULT_ICONS, icons).fallback)\n\n // The image and the fallback are never shown together (Ark toggles `hidden`),\n // so both carry the same text alternative: a failed image still reads as the\n // person, not as \"AL\". `role=\"img\"` makes the initials presentational, and\n // they are `aria-hidden` too (a `contents` span, so layout is untouched),\n // since Chromium still lists an img's text children. An explicit `alt=\"\"`\n // hides the fallback as decorative, like the image.\n const label = alt ?? name\n const fallbackA11y =\n label === \"\" ? { \"aria-hidden\": true } : label ? { role: \"img\", \"aria-label\": label } : null\n\n // `radius=\"full\"` (the default) uses AVATAR_GROUP_NOTCH's mask-image\n // circle instead — no rounded-rect hole to build, no id needed.\n const needsNotchMask = (radius ?? \"full\") !== \"full\"\n const maskId = useId().replace(/:/g, \"\")\n const notchMaskStyle: CSSProperties = needsNotchMask\n ? ({ \"--avatar-notch-mask\": `url(#${maskId})` } as CSSProperties)\n : {}\n\n return (\n <ArkAvatar.Root\n data-color={resolvedColor}\n className={cn(avatarVariants({ size, radius }), className, classNames?.root)}\n style={{ ...notchMaskStyle, ...style }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {needsNotchMask && <AvatarNotchMaskDefs id={maskId} />}\n {src && (\n <ArkAvatar.Image\n src={src}\n alt={label}\n className={cn(\"size-full object-cover\", classNames?.image)}\n />\n )}\n <ArkAvatar.Fallback\n className={cn(\n \"flex items-center justify-center font-medium leading-none\",\n classNames?.fallback,\n )}\n {...fallbackA11y}\n >\n {label ? (\n <span aria-hidden className=\"contents\">\n {fallback}\n </span>\n ) : (\n fallback\n )}\n </ArkAvatar.Fallback>\n </ArkAvatar.Root>\n )\n}\n\n/**\n * Overlap magnitude (px) per `Size` key — larger sizes overlap by more. The\n * only number this whole margin/notch mechanism hardcodes at the group\n * level; `--avatar-r` (each avatar's own radius) instead rides along with\n * `Avatar`'s own `size` variant above, so the notch always matches what's\n * actually rendered even when a group's `spacing` and its avatars' `size`\n * don't happen to match (`Avatar.Group` doesn't restyle children, so\n * nothing stops that).\n */\nconst AVATAR_GROUP_OVERLAP_PX: Record<Size, number> = { xs: 8, sm: 10, md: 12, lg: 14, xl: 16 }\n\n/**\n * `--avatar-o` is a unitless number, not a length — `calc()` casts a\n * unitless custom property into a real length/percentage by multiplying it\n * by `1px`/`1%` (see AVATAR_GROUP_ORIENTATION's `* -1px` and AVATAR_GROUP_NOTCH's\n * `* 1%` below), the same trick that keeps those two classes static text\n * instead of needing a copy per `spacing` value. Set here on the group root\n * and read by children via ordinary CSS custom-property inheritance —\n * `--avatar-r` is deliberately *not* set here (see above).\n */\nconst avatarGroupSpacingStyle = (spacing: Size): CSSProperties =>\n ({ \"--avatar-o\": AVATAR_GROUP_OVERLAP_PX[spacing] }) as CSSProperties\n\n/**\n * Two mutually-exclusive ways to notch every avatar but the last, selected\n * purely by the presence of the `rounded-full` class (set by `radius`\n * above) — `:not(.rounded-full)` and `.rounded-full` never both match the\n * same element, so exactly one of these ever applies to a given avatar:\n *\n * - `.rounded-full` (the default): a `mask-image` circle, unchanged from\n * before. `ellipse RX RY` (not `circle`, whose gradient radius can't be a\n * percentage) with equal `%` radii on a square avatar box renders as a\n * true circle, centered on the next avatar (assuming a same-size\n * neighbor — the same \"uniform stack\" assumption the overlap margin\n * already makes) with a radius a bit larger than that neighbor's own so\n * a thin ring of true transparency survives around it. The radius is\n * `calc((50 + 100 / var(--avatar-r)) * 1%)` — 50% is *this* avatar's own\n * radius (from its own `size` variant, not from the group's `spacing`,\n * so the notch stays correctly sized even if `spacing` and `size` don't\n * match), `100 / r` a ~2px gap expressed as a percentage of its\n * diameter. Must be a pure percentage, not `calc(50% + 2px)` — browsers\n * reject a `%`+length `calc()` as a gradient's explicit circle/ellipse\n * size (unlike almost everywhere else `<length-percentage>` is\n * accepted), so an earlier draft mixing units here silently produced an\n * invalid `mask-image` that just got dropped, with no visible error.\n *\n * - every other `radius`: a `mask-image: var(--avatar-notch-mask)` instead —\n * a real rounded-rect *hole*, cut by a per-instance SVG `<mask>` this\n * avatar renders for itself (see AvatarNotchMaskDefs above for the full\n * rationale). A CSS gradient can only cut a circle/ellipse (hence the\n * circle case above visibly curving away from a rounded-square avatar's\n * flat edges — a corner-shaped gap instead of an edge-shaped one), and\n * `clip-path` can only *keep* one shape, never subtract one — neither can\n * express a rounded-rect hole directly. An SVG `<mask>` can: the hole\n * `<rect>` is sized/positioned to match the *next* avatar's own box\n * (assuming a same-size neighbor, the same \"uniform stack\" assumption the\n * overlap margin already makes) expanded outward by a ~2px gap in every\n * direction, with `rx`/`ry` = that neighbor's own corner radius + the\n * same gap — so the hole's boundary is a true parallel offset of the next\n * avatar's actual silhouette, not an approximation of it. (An earlier\n * attempt just trimmed *this* avatar's own trailing edge with\n * `clip-path: inset(... round ...)` — cheaper, no SVG needed — but that\n * can only shape *this* avatar's own edge, blind to whatever curve the\n * *next* avatar's corner actually traces at each height, so the gap\n * between them didn't follow it: either two independently-rounded edges\n * compounding into an oversized gap at the corner, or, if this avatar's\n * own edge was flattened to avoid that, a straight cut that stayed a\n * constant distance from the next avatar's *box* while that avatar's\n * *rendered* corner receded away from it — reading as an inconsistent gap\n * width rather than a clean ring. Only shaping the hole to match the\n * neighbor's real silhouette avoids both failure modes.)\n *\n * `radius=\"full\"` deliberately isn't handled this way — see the `radius`\n * variant's own comment for why.\n *\n * Neither branch hardcodes a direction. Both place the hole one step of\n * `2r - o` (diameter minus overlap) along the group's direction vector\n * `--avatar-dx`/`--avatar-dy` (see AVATAR_GROUP_ORIENTATION below) — for the\n * circle, `50% + d * (100 - o / (2r) * 100)%` on each axis, i.e. `150 - …`\n * one way and `… - 50` the other. Physical positions (`at X% Y%`, the hole's\n * `x`/`y`) don't flip with `dir` on their own the way the margin's logical\n * `margin-inline-start` does, so rtl flips the vector instead of duplicating\n * every rule with an `rtl:` copy.\n *\n * Both — like AVATAR_GROUP_ORIENTATION's classes below — have to be static string\n * literals, not built from a template at runtime: Tailwind's build only\n * generates CSS for class names it can find verbatim in the source text, so\n * an interpolated/computed class name here would silently produce no\n * styles either, even if every interpolated piece were itself constant.\n */\nconst AVATAR_GROUP_NOTCH = cn(\n \"[&>*:not(:last-child).rounded-full]:[mask-image:radial-gradient(ellipse_calc((50_+_100_/_var(--avatar-r))_*_1%)_calc((50_+_100_/_var(--avatar-r))_*_1%)_at_calc((50_+_var(--avatar-dx)_*_(100_-_var(--avatar-o)_/_(2_*_var(--avatar-r))_*_100))_*_1%)_calc((50_+_var(--avatar-dy)_*_(100_-_var(--avatar-o)_/_(2_*_var(--avatar-r))_*_100))_*_1%),transparent_100%,black_100%)]\",\n \"[&>*:not(:last-child):not(.rounded-full)]:[mask-image:var(--avatar-notch-mask)]\",\n)\n\nexport type AvatarGroupOrientation = \"horizontal\" | \"vertical\"\n\n/**\n * Everything that depends on which way the group stacks: its flex axis,\n * every avatar but the first pulled back over the previous one by\n * `--avatar-o` px along that axis, and where the next avatar sits as the unit\n * vector `--avatar-dx`/`--avatar-dy` that AVATAR_GROUP_NOTCH and\n * AvatarNotchMaskDefs read. Horizontal goes inline-forward, so `1, 0`,\n * mirrored to `-1, 0` in rtl. Vertical goes down, `0, 1`, which `dir` doesn't\n * affect.\n */\nconst AVATAR_GROUP_ORIENTATION: Record<AvatarGroupOrientation, string> = {\n horizontal: cn(\n \"flex items-center\",\n \"[&>*:not(:first-child)]:[margin-inline-start:calc(var(--avatar-o)*-1px)]\",\n \"[--avatar-dx:1] rtl:[--avatar-dx:-1] [--avatar-dy:0]\",\n ),\n vertical: cn(\n \"flex flex-col items-center\",\n \"[&>*:not(:first-child)]:[margin-block-start:calc(var(--avatar-o)*-1px)]\",\n \"[--avatar-dx:0] [--avatar-dy:1]\",\n ),\n}\n\nexport type AvatarGroupProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** Overlap amount between avatars — larger sizes overlap by more. */\n spacing?: Size\n /** Stack direction — a row (default) or a top-to-bottom column. */\n orientation?: AvatarGroupOrientation\n }\n\nconst AvatarGroup = ({\n spacing = \"md\",\n orientation = \"horizontal\",\n className,\n style,\n testId,\n ...rest\n}: AvatarGroupProps) => (\n <ark.div\n // A group, so an `aria-label` (\"Project members\") names the stack; a plain\n // div can't carry a name.\n role=\"group\"\n data-orientation={orientation}\n className={cn(AVATAR_GROUP_ORIENTATION[orientation], AVATAR_GROUP_NOTCH, className)}\n style={{ ...avatarGroupSpacingStyle(spacing), ...style }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** `Avatar.Group` — see the doc comment above the `Avatar` component itself. */\nexport const Avatar = Object.assign(AvatarComponent, { Group: AvatarGroup })\n"]}
1
+ {"version":3,"sources":["../../../src/components/avatar/avatar.ts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A;AAaA,IAAM,wBAAA,GAAmE;AAAA,EACvE,UAAA,EAAY,EAAA;AAAA,IACV,mBAAA;AAAA,IACA,0EAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,QAAA,EAAU,EAAA;AAAA,IACR,4BAAA;AAAA,IACA,yEAAA;AAAA,IACA;AAAA;AAEJ,CAAA;AAUA,IAAM,cAAc,CAAC;AAAA,EACnB,OAAA,GAAU,IAAA;AAAA,EACV,WAAA,GAAc,YAAA;AAAA,EACd,SAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IAGC,IAAA,EAAK,OAAA;AAAA,IACL,kBAAA,EAAkB,WAAA;AAAA,IAClB,WAAW,EAAA,CAAG,wBAAA,CAAyB,WAAW,CAAA,EAAG,oBAAoB,SAAS,CAAA;AAAA,IAClF,OAAO,EAAE,GAAG,wBAAwB,OAAO,CAAA,EAAG,GAAG,KAAA,EAAM;AAAA,IACtD,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAIK,IAAM,SAAS,MAAA,CAAO,MAAA,CAAO,iBAAiB,EAAE,KAAA,EAAO,aAAa","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Avatar as ArkAvatar, ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { UserRound } from \"lucide-react\"\nimport { type ComponentProps, type CSSProperties, type ReactNode, useId } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { graphemes } from \"../../lib/graphemes\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useLocale } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Avatar — circular (by default) image with an automatic fallback. Renders\n * `src` once it loads; falls back to `children` (custom initials or an icon)\n * when there's no image or it fails to load, or to initials/name derived from\n * `name`, or finally to a generic person icon. Wraps Ark's `Avatar` machine,\n * which already tracks image-load state (`loading → loaded/error`) — no\n * bespoke `onError` handling needed here.\n *\n * <Avatar src={user.avatarUrl} name={user.fullName} color=\"brand\" />\n *\n * `color=\"name\"` / `color=\"initials\"` deterministically hash `name` (or its\n * derived initials) into a pick from `palette` instead of a literal `Color` —\n * a stable, no-config accent per person. `display` independently controls\n * what the computed fallback shows: `\"initials\"` (default, two letters) or\n * `\"name\"` (a single leading letter — a full name would overflow the circle).\n *\n * No `asChild` — same reasoning as `Skeleton`: `children` is already\n * repurposed as fallback content, which conflicts with Ark's \"single child to\n * render as\" requirement for polymorphism.\n *\n * `Avatar.Group` overlaps a row — or, with `orientation=\"vertical\"`, a\n * column — of standalone `Avatar`s (Mantine-style stacked avatars),\n * punching a transparent notch into each one where its successor overlaps\n * it — true see-through separation instead of a painted border, so it reads\n * correctly over any page background. It's pure CSS\n * layout, like `ButtonGroup` — it doesn't resize or restyle its children, so\n * set `size`/`color` per `Avatar`.\n */\nconst avatarVariants = cva(\n [\n \"relative inline-flex shrink-0 items-center justify-center overflow-hidden\",\n \"select-none\",\n // Neutral gray by default; a `data-color` tint overrides it with the\n // palette's soft surface + text — the same treatment Pill and Badge's\n // `light` variant use. No variant axis: an avatar is always this one\n // soft-surface look, just optionally tinted. No border either: it used\n // to be border-(--c-soft) once tinted, i.e. always the exact same color\n // as its own background — invisible for every `color`, visible only for\n // the untinted default (border-brand-900/20 against bg-brand-900/6,\n // two different colors) — so whether an avatar showed a border at all\n // used to depend on `color`, not on any actual design intent.\n \"bg-brand-900/6 text-brand-900/70\",\n \"dark:bg-white/8 dark:text-white/80\",\n \"data-color:bg-(--c-soft) data-color:text-(--c-text)\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n ],\n {\n variants: {\n // `--avatar-r` (this avatar's own radius, in px, as a unitless number)\n // rides along with `size` — it's read by `Avatar.Group`'s notch/margin\n // CSS (see AVATAR_GROUP_NOTCH below) so the notch always matches\n // *this* avatar's actual rendered radius, not whatever radius\n // `Avatar.Group`'s own `spacing` happens to assume. `spacing` only\n // ever controls `--avatar-o` (the overlap amount) — a mismatched\n // `size`/`spacing` pairing (e.g. `md` avatars in a `spacing=\"xs\"`\n // group) still gets a correctly-sized notch, just more or less\n // overlap.\n //\n // `2xl` (88px) and `3xl` (128px) sit outside the shared `SIZES` scale\n // in `lib/sizes.ts`, the way Text/Title/Container declare their own\n // extra steps: they're for a person shown as the subject of a screen\n // rather than in a list. They keep `xl`'s proportions — initials at\n // about 0.28× the diameter, the icon at 0.5× — and their own\n // `--avatar-r`. `Avatar.Group`'s `spacing` stays on the shared scale.\n size: {\n xs: \"size-6 text-[10px] [&_svg]:size-3.5 [--avatar-r:12]\",\n sm: \"size-8 text-xs [&_svg]:size-4 [--avatar-r:16]\",\n md: \"size-10 text-sm [&_svg]:size-5 [--avatar-r:20]\",\n lg: \"size-12 text-base [&_svg]:size-6 [--avatar-r:24]\",\n xl: \"size-16 text-lg [&_svg]:size-8 [--avatar-r:32]\",\n \"2xl\": \"size-22 text-2xl [&_svg]:size-11 [--avatar-r:44]\",\n \"3xl\": \"size-32 text-4xl [&_svg]:size-16 [--avatar-r:64]\",\n },\n // `--avatar-corner-r` also rides along with `radius`: it's the other\n // half of `Avatar.Group`'s notch for a non-circular avatar (see\n // AVATAR_GROUP_NOTCH and AvatarNotchMaskDefs below). A gradient can\n // only cut a circle/ellipse, never a true rounded rect, so\n // `radius=\"full\"` keeps using a mask-image ellipse (the shape it\n // actually needs), but every other radius instead cuts a real\n // rounded-rect *hole* via a per-instance SVG `<mask>`, using this\n // avatar's own actual radius token (`theme.css`'s\n // `--radius-xs`..`--radius-xl`, in px) as that hole's corner radius.\n // `\"full\"` deliberately has no `--avatar-corner-r` and never renders\n // that SVG mask at all — its radius (50% of the box) isn't a fixed px\n // value the way the others are, so there's nothing meaningful to plug\n // in here; the mask-image ellipse already handles it correctly.\n radius: {\n xs: \"rounded-xs [--avatar-corner-r:4]\",\n sm: \"rounded-sm [--avatar-corner-r:6]\",\n md: \"rounded-md [--avatar-corner-r:8]\",\n lg: \"rounded-lg [--avatar-corner-r:10]\",\n xl: \"rounded-xl [--avatar-corner-r:12]\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n size: \"md\",\n // Unlike ThemeIcon (a square icon surface), an avatar reads as\n // circular by default — matching Mantine's own default.\n radius: \"full\",\n },\n },\n)\n\nexport type AvatarSize = NonNullable<VariantProps<typeof avatarVariants>[\"size\"]>\nexport type AvatarRadius = NonNullable<VariantProps<typeof avatarVariants>[\"radius\"]>\n\n/** Shared by `color`'s auto-computed modes and `display`'s content mode. */\nexport type AvatarNameMode = \"name\" | \"initials\"\n\n/**\n * Default hash pool for `color=\"name\"` / `color=\"initials\"`. Excludes\n * `brand` (the kit's own primary/CTA identity color — auto-tinting a user\n * avatar with it would read as \"official\") and `neutral` (muted, and a\n * composed-not-scaled tone per `lib/colors.ts`, so it would just look\n * washed-out for some names). Exported so a consumer can extend it,\n * e.g. `palette={[...AVATAR_PALETTE, \"brand\"]}`.\n */\nexport const AVATAR_PALETTE: Color[] = [\n \"red\",\n \"orange\",\n \"yellow\",\n \"green\",\n \"teal\",\n \"cyan\",\n \"blue\",\n \"purple\",\n \"pink\",\n]\n\nexport type AvatarIconSlot = \"fallback\"\nexport type AvatarIcons = IconMap<AvatarIconSlot>\n\nconst DEFAULT_ICONS: Record<AvatarIconSlot, ReactNode> = {\n fallback: <UserRound className={iconStroke} />,\n}\n\ntype AvatarClassNames = {\n root?: string\n image?: string\n fallback?: string\n}\n\nexport type AvatarProps = Omit<ComponentProps<typeof ArkAvatar.Root>, \"color\" | \"asChild\"> &\n VariantProps<typeof avatarVariants> &\n WithTestId & {\n /** Image source. Falls back automatically when unset or on load error. */\n src?: string\n /**\n * Text alternative for the avatar. Names the image, and the fallback too when the image is\n * missing or fails, so the person isn't reduced to their initials. Defaults to `name`;\n * `alt=\"\"` marks the avatar decorative.\n */\n alt?: string\n /**\n * Accent palette. `\"name\"` / `\"initials\"` deterministically hash `name`\n * (or its derived initials) into a pick from `palette` instead of a\n * literal color. Re-exported as `Color` from `@42/ui-react`.\n */\n color?: Color | AvatarNameMode\n /**\n * Colors eligible for `color=\"name\"` / `color=\"initials\"`'s hash.\n * Ignored otherwise. Defaults to `AVATAR_PALETTE`.\n */\n palette?: Color[]\n /**\n * Full name to derive initials/color from (e.g. \"Ada Lovelace\" → \"AL\")\n * when there's no image and no explicit `children`. Explicit `children`\n * always takes precedence over `name`.\n */\n name?: string\n /**\n * What the computed fallback shows: `\"initials\"` (default, two letters)\n * or `\"name\"` (a single leading letter of `name`).\n */\n display?: AvatarNameMode\n /**\n * Fallback content — shown until the image loads, or permanently when\n * there's no `src`. Overrides the `name`/`display`-derived content.\n */\n children?: ReactNode\n /**\n * Replaces the default icons: `fallback`, the person drawn when there's\n * no image, no `children` and no `name`. `null` leaves the disc empty.\n */\n icons?: AvatarIcons\n classNames?: AvatarClassNames\n }\n\n/** First + last initial for a multi-word name; first two characters for a single word.\n * Characters are graphemes, so an emoji or an accent written as a combining mark stays whole,\n * and upper-casing follows the locale (`i` → `İ` in Turkish). */\nconst getInitials = (name: string, locale: string): string => {\n const [first, ...rest] = name.trim().split(/\\s+/).filter(Boolean)\n if (!first) return \"\"\n const last = rest.at(-1)\n const letters = last\n ? [graphemes(first, locale)[0], graphemes(last, locale)[0]]\n : graphemes(first, locale).slice(0, 2)\n return letters.join(\"\").toLocaleUpperCase(locale)\n}\n\n/** Single leading letter — `display=\"name\"`'s content; a full name would overflow the circle. */\nconst getLeadingLetter = (name: string, locale: string): string =>\n (graphemes(name.trim(), locale)[0] ?? \"\").toLocaleUpperCase(locale)\n\n/** Deterministic string hash (Java-style polynomial rolling hash). */\nconst hashString = (input: string): number => {\n let hash = 0\n for (let i = 0; i < input.length; i++) hash = (hash * 31 + input.charCodeAt(i)) | 0\n return Math.abs(hash)\n}\n\nconst pickColor = (input: string, pool: Color[]): Color | undefined =>\n input && pool.length > 0 ? pool[hashString(input) % pool.length] : undefined\n\nconst isAvatarNameMode = (value: unknown): value is AvatarNameMode =>\n value === \"name\" || value === \"initials\"\n\n/**\n * A per-instance SVG `<mask>` cutting `Avatar.Group`'s notch as a true\n * rounded-rect hole for any non-circular `radius` — see AVATAR_GROUP_NOTCH's\n * own doc comment for why a hole (not a trim/clip) is what's actually needed\n * here. Rendered *inside this avatar itself* — not shared, not on\n * `Avatar.Group` — because an SVG `<mask>`'s content resolves `var()` from\n * wherever the `<mask>` element itself sits in the DOM, not from whatever\n * element references it via `mask: url(#id)` (confirmed empirically: a single\n * shared mask read the *ancestor's* `--avatar-r`, not each differently-sized\n * avatar's own). Nesting a practically-free per-instance one inside each\n * avatar instead means it naturally inherits *that* avatar's own\n * `--avatar-r`/`--avatar-corner-r` and the group's `--avatar-o` and\n * `--avatar-dx`/`--avatar-dy`, the same way any of this avatar's own CSS\n * already does.\n *\n * The hole matches the *next* avatar's box (same-size neighbor assumed),\n * grown by a ~2px gap on every side. It sits one step of `2r - o` (diameter\n * minus overlap) along the group's direction vector `(dx, dy)` — so a single\n * mask covers ltr (`1, 0`), rtl (`-1, 0`) and vertical (`0, 1`) stacks.\n *\n * `size-0 absolute` keeps it out of layout entirely. The `<mask>` element's\n * own `x`/`y`/`width`/`height` (not the same as the hole `<rect>`'s) opt out\n * of the CSS default `objectBoundingBox` region (`-10% -10% 120% 120%` of\n * the avatar's own box) — too small to contain a hole that can extend well\n * beyond the box — for a `userSpaceOnUse` region large enough it never\n * actually clips anything; all real clipping is left to the masked avatar's\n * own box, same as everywhere else in this file.\n */\nconst AvatarNotchMaskDefs = ({ id }: { id: string }) => (\n <svg aria-hidden=\"true\" className=\"absolute size-0\">\n <defs>\n <mask id={id} maskUnits=\"userSpaceOnUse\" x={-1000} y={-1000} width={2000} height={2000}>\n <rect x={-1000} y={-1000} width={2000} height={2000} fill=\"white\" />\n <rect\n style={\n {\n x: \"calc((var(--avatar-dx) * (2 * var(--avatar-r) - var(--avatar-o)) - 2) * 1px)\",\n y: \"calc((var(--avatar-dy) * (2 * var(--avatar-r) - var(--avatar-o)) - 2) * 1px)\",\n width: \"calc((2 * var(--avatar-r) + 4) * 1px)\",\n height: \"calc((2 * var(--avatar-r) + 4) * 1px)\",\n rx: \"calc((var(--avatar-corner-r) + 2) * 1px)\",\n } as CSSProperties\n }\n fill=\"black\"\n />\n </mask>\n </defs>\n </svg>\n)\n\nconst AvatarComponent = ({\n src,\n alt,\n size,\n radius,\n color,\n palette = AVATAR_PALETTE,\n name,\n display = \"initials\",\n children,\n icons,\n className,\n classNames,\n style,\n testId,\n ...rest\n}: AvatarProps) => {\n const locale = useLocale()\n const resolvedColor = isAvatarNameMode(color)\n ? pickColor(color === \"name\" ? (name ?? \"\") : name ? getInitials(name, locale) : \"\", palette)\n : color\n\n const computed = name\n ? display === \"name\"\n ? getLeadingLetter(name, locale)\n : getInitials(name, locale)\n : \"\"\n const fallback = children ?? (computed || mergeIcons(DEFAULT_ICONS, icons).fallback)\n\n // The image and the fallback are never shown together (Ark toggles `hidden`),\n // so both carry the same text alternative: a failed image still reads as the\n // person, not as \"AL\". `role=\"img\"` makes the initials presentational, and\n // they are `aria-hidden` too (a `contents` span, so layout is untouched),\n // since Chromium still lists an img's text children. An explicit `alt=\"\"`\n // hides the fallback as decorative, like the image.\n const label = alt ?? name\n const fallbackA11y =\n label === \"\" ? { \"aria-hidden\": true } : label ? { role: \"img\", \"aria-label\": label } : null\n\n // `radius=\"full\"` (the default) uses AVATAR_GROUP_NOTCH's mask-image\n // circle instead — no rounded-rect hole to build, no id needed.\n const needsNotchMask = (radius ?? \"full\") !== \"full\"\n const maskId = useId().replace(/:/g, \"\")\n const notchMaskStyle: CSSProperties = needsNotchMask\n ? ({ \"--avatar-notch-mask\": `url(#${maskId})` } as CSSProperties)\n : {}\n\n return (\n <ArkAvatar.Root\n data-color={resolvedColor}\n className={cn(avatarVariants({ size, radius }), className, classNames?.root)}\n style={{ ...notchMaskStyle, ...style }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {needsNotchMask && <AvatarNotchMaskDefs id={maskId} />}\n {src && (\n <ArkAvatar.Image\n src={src}\n alt={label}\n className={cn(\"size-full object-cover\", classNames?.image)}\n />\n )}\n <ArkAvatar.Fallback\n className={cn(\n \"flex items-center justify-center font-medium leading-none\",\n classNames?.fallback,\n )}\n {...fallbackA11y}\n >\n {label ? (\n <span aria-hidden className=\"contents\">\n {fallback}\n </span>\n ) : (\n fallback\n )}\n </ArkAvatar.Fallback>\n </ArkAvatar.Root>\n )\n}\n\n/**\n * Overlap magnitude (px) per `Size` key — larger sizes overlap by more. The\n * only number this whole margin/notch mechanism hardcodes at the group\n * level; `--avatar-r` (each avatar's own radius) instead rides along with\n * `Avatar`'s own `size` variant above, so the notch always matches what's\n * actually rendered even when a group's `spacing` and its avatars' `size`\n * don't happen to match (`Avatar.Group` doesn't restyle children, so\n * nothing stops that).\n */\nconst AVATAR_GROUP_OVERLAP_PX: Record<Size, number> = { xs: 8, sm: 10, md: 12, lg: 14, xl: 16 }\n\n/**\n * `--avatar-o` is a unitless number, not a length — `calc()` casts a\n * unitless custom property into a real length/percentage by multiplying it\n * by `1px`/`1%` (see AVATAR_GROUP_ORIENTATION's `* -1px` and AVATAR_GROUP_NOTCH's\n * `* 1%` below), the same trick that keeps those two classes static text\n * instead of needing a copy per `spacing` value. Set here on the group root\n * and read by children via ordinary CSS custom-property inheritance —\n * `--avatar-r` is deliberately *not* set here (see above).\n */\nconst avatarGroupSpacingStyle = (spacing: Size): CSSProperties =>\n ({ \"--avatar-o\": AVATAR_GROUP_OVERLAP_PX[spacing] }) as CSSProperties\n\n/**\n * Two mutually-exclusive ways to notch every avatar but the last, selected\n * purely by the presence of the `rounded-full` class (set by `radius`\n * above) — `:not(.rounded-full)` and `.rounded-full` never both match the\n * same element, so exactly one of these ever applies to a given avatar:\n *\n * - `.rounded-full` (the default): a `mask-image` circle, unchanged from\n * before. `ellipse RX RY` (not `circle`, whose gradient radius can't be a\n * percentage) with equal `%` radii on a square avatar box renders as a\n * true circle, centered on the next avatar (assuming a same-size\n * neighbor — the same \"uniform stack\" assumption the overlap margin\n * already makes) with a radius a bit larger than that neighbor's own so\n * a thin ring of true transparency survives around it. The radius is\n * `calc((50 + 100 / var(--avatar-r)) * 1%)` — 50% is *this* avatar's own\n * radius (from its own `size` variant, not from the group's `spacing`,\n * so the notch stays correctly sized even if `spacing` and `size` don't\n * match), `100 / r` a ~2px gap expressed as a percentage of its\n * diameter. Must be a pure percentage, not `calc(50% + 2px)` — browsers\n * reject a `%`+length `calc()` as a gradient's explicit circle/ellipse\n * size (unlike almost everywhere else `<length-percentage>` is\n * accepted), so an earlier draft mixing units here silently produced an\n * invalid `mask-image` that just got dropped, with no visible error.\n *\n * - every other `radius`: a `mask-image: var(--avatar-notch-mask)` instead —\n * a real rounded-rect *hole*, cut by a per-instance SVG `<mask>` this\n * avatar renders for itself (see AvatarNotchMaskDefs above for the full\n * rationale). A CSS gradient can only cut a circle/ellipse (hence the\n * circle case above visibly curving away from a rounded-square avatar's\n * flat edges — a corner-shaped gap instead of an edge-shaped one), and\n * `clip-path` can only *keep* one shape, never subtract one — neither can\n * express a rounded-rect hole directly. An SVG `<mask>` can: the hole\n * `<rect>` is sized/positioned to match the *next* avatar's own box\n * (assuming a same-size neighbor, the same \"uniform stack\" assumption the\n * overlap margin already makes) expanded outward by a ~2px gap in every\n * direction, with `rx`/`ry` = that neighbor's own corner radius + the\n * same gap — so the hole's boundary is a true parallel offset of the next\n * avatar's actual silhouette, not an approximation of it. (An earlier\n * attempt just trimmed *this* avatar's own trailing edge with\n * `clip-path: inset(... round ...)` — cheaper, no SVG needed — but that\n * can only shape *this* avatar's own edge, blind to whatever curve the\n * *next* avatar's corner actually traces at each height, so the gap\n * between them didn't follow it: either two independently-rounded edges\n * compounding into an oversized gap at the corner, or, if this avatar's\n * own edge was flattened to avoid that, a straight cut that stayed a\n * constant distance from the next avatar's *box* while that avatar's\n * *rendered* corner receded away from it — reading as an inconsistent gap\n * width rather than a clean ring. Only shaping the hole to match the\n * neighbor's real silhouette avoids both failure modes.)\n *\n * `radius=\"full\"` deliberately isn't handled this way — see the `radius`\n * variant's own comment for why.\n *\n * Neither branch hardcodes a direction. Both place the hole one step of\n * `2r - o` (diameter minus overlap) along the group's direction vector\n * `--avatar-dx`/`--avatar-dy` (see AVATAR_GROUP_ORIENTATION below) — for the\n * circle, `50% + d * (100 - o / (2r) * 100)%` on each axis, i.e. `150 - …`\n * one way and `… - 50` the other. Physical positions (`at X% Y%`, the hole's\n * `x`/`y`) don't flip with `dir` on their own the way the margin's logical\n * `margin-inline-start` does, so rtl flips the vector instead of duplicating\n * every rule with an `rtl:` copy.\n *\n * Both — like AVATAR_GROUP_ORIENTATION's classes below — have to be static string\n * literals, not built from a template at runtime: Tailwind's build only\n * generates CSS for class names it can find verbatim in the source text, so\n * an interpolated/computed class name here would silently produce no\n * styles either, even if every interpolated piece were itself constant.\n */\nconst AVATAR_GROUP_NOTCH = cn(\n \"[&>*:not(:last-child).rounded-full]:[mask-image:radial-gradient(ellipse_calc((50_+_100_/_var(--avatar-r))_*_1%)_calc((50_+_100_/_var(--avatar-r))_*_1%)_at_calc((50_+_var(--avatar-dx)_*_(100_-_var(--avatar-o)_/_(2_*_var(--avatar-r))_*_100))_*_1%)_calc((50_+_var(--avatar-dy)_*_(100_-_var(--avatar-o)_/_(2_*_var(--avatar-r))_*_100))_*_1%),transparent_100%,black_100%)]\",\n \"[&>*:not(:last-child):not(.rounded-full)]:[mask-image:var(--avatar-notch-mask)]\",\n)\n\nexport type AvatarGroupOrientation = \"horizontal\" | \"vertical\"\n\n/**\n * Everything that depends on which way the group stacks: its flex axis,\n * every avatar but the first pulled back over the previous one by\n * `--avatar-o` px along that axis, and where the next avatar sits as the unit\n * vector `--avatar-dx`/`--avatar-dy` that AVATAR_GROUP_NOTCH and\n * AvatarNotchMaskDefs read. Horizontal goes inline-forward, so `1, 0`,\n * mirrored to `-1, 0` in rtl. Vertical goes down, `0, 1`, which `dir` doesn't\n * affect.\n */\nconst AVATAR_GROUP_ORIENTATION: Record<AvatarGroupOrientation, string> = {\n horizontal: cn(\n \"flex items-center\",\n \"[&>*:not(:first-child)]:[margin-inline-start:calc(var(--avatar-o)*-1px)]\",\n \"[--avatar-dx:1] rtl:[--avatar-dx:-1] [--avatar-dy:0]\",\n ),\n vertical: cn(\n \"flex flex-col items-center\",\n \"[&>*:not(:first-child)]:[margin-block-start:calc(var(--avatar-o)*-1px)]\",\n \"[--avatar-dx:0] [--avatar-dy:1]\",\n ),\n}\n\nexport type AvatarGroupProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** Overlap amount between avatars — larger sizes overlap by more. */\n spacing?: Size\n /** Stack direction — a row (default) or a top-to-bottom column. */\n orientation?: AvatarGroupOrientation\n }\n\nconst AvatarGroup = ({\n spacing = \"md\",\n orientation = \"horizontal\",\n className,\n style,\n testId,\n ...rest\n}: AvatarGroupProps) => (\n <ark.div\n // A group, so an `aria-label` (\"Project members\") names the stack; a plain\n // div can't carry a name.\n role=\"group\"\n data-orientation={orientation}\n className={cn(AVATAR_GROUP_ORIENTATION[orientation], AVATAR_GROUP_NOTCH, className)}\n style={{ ...avatarGroupSpacingStyle(spacing), ...style }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** `Avatar.Group` — see the doc comment above the `Avatar` component itself. */\nexport const Avatar = Object.assign(AvatarComponent, { Group: AvatarGroup })\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,EA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,QAAA,MAAM,aAAa;;;8EAsElB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AACrF,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAE/E,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,CAAA;AAE1C,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,GAC1D,YAAY,CAAC,OAAO,aAAa,CAAC,GAClC,UAAU,GAAG;IACX,kEAAkE;IAClE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAA;CACzB,CAAA;AAEH,eAAO,MAAM,KAAK,0EASf,UAAU,gCAgBZ,CAAA"}
@@ -1,4 +1,4 @@
1
- export { Badge } from '../../chunk-F342ZT7O.js';
1
+ export { Badge } from '../../chunk-ZVECQBGG.js';
2
2
  import '../../chunk-SKPM2FRX.js';
3
3
  import '../../chunk-WYCMIIRR.js';
4
4
  import '../../chunk-C6NVU4F7.js';
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import '../../chunk-ORTCK34Y.js';
3
- export { Button } from '../../chunk-SWVUXEBT.js';
3
+ export { Button } from '../../chunk-SCXXJDKQ.js';
4
4
  import '../../chunk-D2QIPQ74.js';
5
5
  import '../../chunk-R5LYFTHA.js';
6
6
  import '../../chunk-WYCMIIRR.js';
@@ -39,11 +39,19 @@ import type { WithTestId } from "../../lib/test-id";
39
39
  * `orientation="horizontal"` (default) flattens the inline edges — logical
40
40
  * `rounded-s` / `rounded-e` + `-ms`, so it flips correctly under RTL — while
41
41
  * `"vertical"` flattens the block edges.
42
+ *
43
+ * `grow` spans the container and gives every child an even share of it
44
+ * (`flex-1`), like a tab bar.
42
45
  */
43
46
  export declare const buttonGroupVariants: (props?: ({
44
47
  orientation?: "horizontal" | "vertical" | null | undefined;
48
+ grow?: boolean | null | undefined;
45
49
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
46
50
  export type ButtonGroupOrientation = NonNullable<VariantProps<typeof buttonGroupVariants>["orientation"]>;
47
- export type ButtonGroupProps = HTMLArkProps<"div"> & VariantProps<typeof buttonGroupVariants> & WithTestId;
48
- export declare const ButtonGroup: ({ className, orientation, testId, ...rest }: ButtonGroupProps) => import("react").JSX.Element;
51
+ export type ButtonGroupProps = HTMLArkProps<"div"> & Omit<VariantProps<typeof buttonGroupVariants>, "grow"> & WithTestId & {
52
+ /** Span the container and give every child an even share of it, like a
53
+ * tab bar. Without it the group hugs its children. */
54
+ grow?: boolean;
55
+ };
56
+ export declare const ButtonGroup: ({ className, orientation, grow, testId, ...rest }: ButtonGroupProps) => import("react").JSX.Element;
49
57
  //# sourceMappingURL=button-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/components/button-group/button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,mBAAmB;;8EAyD/B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAC9C,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC,aAAa,CAAC,CACxD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,GAChD,YAAY,CAAC,OAAO,mBAAmB,CAAC,GACxC,UAAU,CAAA;AAEZ,eAAO,MAAM,WAAW,gDAAiD,gBAAgB,gCAQxF,CAAA"}
1
+ {"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/components/button-group/button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,mBAAmB;;;8EA6D/B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAC9C,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC,aAAa,CAAC,CACxD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,GAChD,IAAI,CAAC,YAAY,CAAC,OAAO,mBAAmB,CAAC,EAAE,MAAM,CAAC,GACtD,UAAU,GAAG;IACX;2DACuD;IACvD,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAEH,eAAO,MAAM,WAAW,sDAMrB,gBAAgB,gCAQlB,CAAA"}
@@ -1,4 +1,4 @@
1
- export { ButtonGroup } from '../../chunk-MW42XVPD.js';
1
+ export { ButtonGroup } from '../../chunk-PBSVX5DB.js';
2
2
  import '../../chunk-WYCMIIRR.js';
3
3
  import '../../chunk-4ASNIDV7.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { Context, Item, MultiRoot, ButtonSelectControl } from '../../chunk-7AQ4MN4M.js';
3
- import '../../chunk-MW42XVPD.js';
4
- import '../../chunk-VD6PB3VA.js';
5
- import '../../chunk-SWVUXEBT.js';
2
+ import { Context, Item, MultiRoot, ButtonSelectControl } from '../../chunk-7OGZT7U2.js';
3
+ import '../../chunk-PBSVX5DB.js';
4
+ import '../../chunk-X6DESK37.js';
5
+ import '../../chunk-SCXXJDKQ.js';
6
6
  import { useUncontrolled } from '../../chunk-PMUCGFY5.js';
7
7
  import '../../chunk-BUIHQJGE.js';
8
8
  import '../../chunk-D2QIPQ74.js';
@@ -22,6 +22,9 @@ export type ButtonSelectBaseProps<Data extends ButtonSelectData> = Pick<FieldPro
22
22
  orientation?: "horizontal" | "vertical";
23
23
  /** Red invalid state, independent of (and OR'd with) `error`. */
24
24
  invalid?: boolean;
25
+ /** Span the container and give every item an even share of it, like a tab
26
+ * bar. Without it the group hugs its items. */
27
+ grow?: boolean;
25
28
  /** Dims and blocks every item. */
26
29
  disabled?: boolean;
27
30
  size?: ButtonSize;
@@ -46,7 +49,7 @@ export type ButtonSelectBaseProps<Data extends ButtonSelectData> = Pick<FieldPro
46
49
  * `Item` per entry and the hidden inputs. The public components only adapt their
47
50
  * value shape (`V | null` or `V[]`) onto the machine's `string[]`.
48
51
  */
49
- export declare const ButtonSelectControl: ({ multiple, deselectable, value, onValueChange, data, renderItem, orientation, invalid, disabled, required, size, variant, selectedVariant, color, name, id, ref, onBlur, label, description, error, className, classNames, testId, }: ButtonSelectBaseProps<ButtonSelectData> & {
52
+ export declare const ButtonSelectControl: ({ multiple, deselectable, value, onValueChange, data, renderItem, orientation, invalid, grow, disabled, required, size, variant, selectedVariant, color, name, id, ref, onBlur, label, description, error, className, classNames, testId, }: ButtonSelectBaseProps<ButtonSelectData> & {
50
53
  multiple: boolean;
51
54
  deselectable?: boolean;
52
55
  value: readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"button-select-control.d.ts","sourceRoot":"","sources":["../../../src/components/button-select/button-select-control.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CA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CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,sBAAsB,CAAA;CACpC,CAAA;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,0OAyB7B,qBAAqB,CAAC,gBAAgB,CAAC,GAAG;IAC3C,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACzC,gCA2DA,CAAA"}
1
+ {"version":3,"file":"button-select-control.d.ts","sourceRoot":"","sources":["../../../src/components/button-select/button-select-control.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,gBAAgB,CAAA;AAE5D,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAA;AAE9B,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;8BAC0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,8EAA8E;AAC9E,MAAM,MAAM,qBAAqB,CAAC,IAAI,SAAS,gBAAgB,IAAI,IAAI,CACrE,UAAU,EACV,OAAO,GAAG,aAAa,GAAG,OAAO,GAAG,UAAU,CAC/C,GACC,UAAU,GAAG;IACX,qFAAqF;IACrF,IAAI,EAAE,IAAI,CAAA;IACV,qEAAqE;IACrE,UAAU,CAAC,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAA;IACzC,oDAAoD;IACpD,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;oDACgD;IAChD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,aAAa,CAAA;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,wEAAwE;IACxE,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;IACzB,gEAAgE;IAChE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,sBAAsB,CAAA;CACpC,CAAA;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,gPA0B7B,qBAAqB,CAAC,gBAAgB,CAAC,GAAG;IAC3C,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACzC,gCA4DA,CAAA"}
@@ -13,13 +13,16 @@ type BaseRootProps = Omit<Ark.RootProps, "color" | "multiple" | "value" | "defau
13
13
  size?: ButtonSize;
14
14
  /** Red invalid ring around the group. */
15
15
  invalid?: boolean;
16
+ /** Span the container and give every item an even share of it, like a tab
17
+ * bar. Without it the group hugs its items. */
18
+ grow?: boolean;
16
19
  /** Lands on the group root, which forwards focus to its active item. Ark's
17
20
  * prop types carry no `ref`, so it is declared here. */
18
21
  ref?: Ref<HTMLDivElement>;
19
22
  children?: ReactNode;
20
23
  };
21
24
  /** The shared root behind both `ButtonSelect.Root` and `ButtonMultiSelect.Root`. */
22
- export declare const RootBase: ({ multiple, value, defaultValue, onValueChange, deselectable, orientation, color, variant, selectedVariant, size, invalid, loopFocus, className, testId, children, ...rest }: BaseRootProps & {
25
+ export declare const RootBase: ({ multiple, value, defaultValue, onValueChange, deselectable, orientation, color, variant, selectedVariant, size, invalid, grow, loopFocus, className, testId, children, ...rest }: BaseRootProps & {
23
26
  multiple: boolean;
24
27
  value?: string[];
25
28
  defaultValue?: string[];