@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 +0,0 @@
1
- {"version":3,"sources":["../src/components/button-select/button-select.tsx","../src/components/button-select/button-select-items.ts","../src/components/button-select/button-select-control.tsx"],"names":["Ark","props","jsx"],"mappings":";;;;;;;;;;;AAqDA,IAAM,2BAA2B,aAAA,CAAiC;AAAA,EAChE,OAAA,EAAS,OAAA;AAAA,EACT,eAAA,EAAiB,QAAA;AAAA,EACjB,IAAA,EAAM;AACR,CAAC,CAAA;AAUD,IAAM,WAAA,GACJ,yKAAA;AAsBF,IAAM,aAAa,CAAC,CAAA,EAAsB,CAAA,KACxC,CAAA,CAAE,WAAW,CAAA,CAAE,MAAA,IAAU,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,EAAG,CAAA,KAAM,CAAA,KAAM,CAAA,CAAE,CAAC,CAAC,CAAA;AAYvD,IAAM,iBAAA,GAAoB,CAAC,KAAA,KAAsC;AAC/D,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,KAAA,CAAM,aAAA,EAAe;AAC1C,EAAA,MAAM,QAAA,GAAW,MAAM,aAAA,CAAc,aAAA;AAAA,IACnC;AAAA,GACF;AACA,EAAA,IAAI,CAAC,QAAA,EAAU;AACf,EAAA,KAAA,CAAM,eAAA,EAAgB;AACtB,EAAA,QAAA,CAAS,KAAA,CAAM,EAAE,aAAA,EAAe,IAAA,EAAM,CAAA;AACxC,CAAA;AAWA,IAAM,eAAA,GAAkB,CAAC,IAAA,KAAkB,CAAC,KAAA,KAAyC;AACnF,EAAA,MAAM,OAAO,KAAA,CAAM,aAAA;AACnB,EAAA,IAAI,KAAK,GAAA,KAAQ,KAAA,IAAS,KAAK,YAAA,CAAa,kBAAkB,MAAM,YAAA,EAAc;AAClF,EAAA,IAAI,KAAA,CAAM,GAAA,KAAQ,WAAA,IAAe,KAAA,CAAM,QAAQ,YAAA,EAAc;AAC7D,EAAA,MAAM,QAAQ,KAA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AAAA,YACA,MAAA;AAAA,YACA,MAAA;AAAA,YACA,SAAA,EAAW,EAAA,CAAG,SAAA,EAAW,UAAA,EAAY,IAAI,CAAA;AAAA,YAExC,QAAA,EAAA,KAAA,CAAM,GAAA,CAAI,CAAC,IAAA,qBACVA,GAAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBAEC,OAAO,IAAA,CAAK,KAAA;AAAA,gBACZ,UAAU,IAAA,CAAK,QAAA;AAAA,gBACf,OAAO,IAAA,CAAK,KAAA;AAAA,gBACZ,WAAW,IAAA,CAAK,SAAA;AAAA,gBAChB,SAAS,IAAA,CAAK,OAAA;AAAA,gBACd,cAAY,IAAA,CAAK,SAAA;AAAA,gBACjB,QAAQ,IAAA,CAAK,MAAA;AAAA,gBACb,WAAW,UAAA,EAAY,IAAA;AAAA,gBAEtB,QAAA,EAAA,UAAA,GACG,WAAW,IAAA,EAAM;AAAA,kBACf,QAAA,EAAU,KAAA,CAAM,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,kBACnC,QAAA,EAAU,OAAA,CAAQ,QAAQ,CAAA,IAAK,IAAA,CAAK;AAAA,iBACrC,IACD,IAAA,CAAK;AAAA,eAAA;AAAA,cAfJ,IAAA,CAAK;AAAA,aAiBb;AAAA;AAAA,SACH;AAAA,wBACAA,GAAAA,CAAC,YAAA,EAAA,EAAa,IAAA,EAAY,OAAc,QAAA,EAAoB;AAAA;AAAA;AAAA,GAC9D;AAEJ","file":"chunk-7AQ4MN4M.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { ToggleGroup as Ark, useToggleGroupContext } from \"@ark-ui/react/toggle-group\"\nimport {\n Children,\n cloneElement,\n createContext,\n type FocusEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useContext,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from \"../button/button\"\nimport { buttonGroupVariants } from \"../button-group/button-group\"\nimport { fieldA11yProps } from \"../field/field\"\n\n/**\n * ButtonSelect / ButtonMultiSelect — compound parts.\n *\n * A row (or column) of real `Button`s joined like `ButtonGroup`, on Ark UI's\n * ToggleGroup machine. Every item renders through `Button` itself and only its\n * `variant` changes with the selection: unselected items take `variant`, the\n * selected ones `selectedVariant`. So the item styling — every variant × color,\n * sizes, `startSlot`/`endSlot`, hover, focus ring — has exactly one source, and\n * the join (flattened inner corners, collapsed hairlines, the hover/focus z-lift\n * and the filled/subtle seams) comes from `buttonGroupVariants` rather than a copy.\n *\n * Unlike `SegmentGroup` there is no sliding pill: a pill can't follow several\n * selected items at once, and the same parts back both the single and the\n * multiple form. The machine provides the semantics — `radiogroup` / `radio` +\n * `aria-checked` for single, `group` + `aria-pressed` for multiple — plus roving\n * focus with arrow keys and Home/End.\n *\n * `variant`, `selectedVariant` and `size` travel through a small context set once\n * on `Root`, so they aren't repeated on every `Item` (the Tabs pattern). `color`\n * is a plain `data-color` on `Root`, so it cascades to every item as CSS custom\n * properties; an item's own `color` re-stamps it on that one button.\n */\n\ntype StyleContextValue = {\n variant: ButtonVariant\n selectedVariant: ButtonVariant\n size: ButtonSize\n}\n\nconst ButtonSelectStyleContext = createContext<StyleContextValue>({\n variant: \"light\",\n selectedVariant: \"filled\",\n size: \"md\",\n})\n\n/**\n * The invalid cue is a ring on the whole group rather than red item borders: the\n * borderless `filled` / `subtle` items have no border to recolor, and the group\n * seams out-specify a per-item border anyway. A `ring` (box-shadow) is used, not\n * an `outline`, because the machine writes `outline: none` inline on the root.\n * `w-fit` keeps that ring hugging the items: inside `Field`'s flex column the\n * root would otherwise stretch to the field's full width.\n */\nconst invalidRing =\n \"w-fit rounded-button data-invalid:ring-1 data-invalid:ring-red-500 data-invalid:ring-offset-2 data-invalid:ring-offset-brand-50 dark:data-invalid:ring-offset-brand-950\"\n\ntype BaseRootProps = Omit<\n Ark.RootProps,\n \"color\" | \"multiple\" | \"value\" | \"defaultValue\" | \"onValueChange\" | \"deselectable\" | \"onChange\"\n> &\n WithTestId & {\n /** Palette for every item, as a `data-color` on the group. */\n color?: Color\n /** Treatment of the unselected items. */\n variant?: ButtonVariant\n /** Treatment of the selected items. */\n selectedVariant?: ButtonVariant\n size?: ButtonSize\n /** Red invalid ring around the group. */\n invalid?: boolean\n /** Lands on the group root, which forwards focus to its active item. Ark's\n * prop types carry no `ref`, so it is declared here. */\n ref?: Ref<HTMLDivElement>\n children?: ReactNode\n }\n\nconst sameValues = (a: readonly string[], b: readonly string[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * Tab entry for a single-choice group. Every item is `tabindex=-1` while focus is\n * outside, so Tab lands on the root, and zag then forwards focus to the *first*\n * item regardless of the selection. A radio group should land on the checked\n * radio instead, so in single mode the root's own focus is caught in the capture\n * phase and sent to the selected (enabled) item. `stopPropagation` there stops\n * the native event before React's bubble listener runs, which is what keeps\n * zag's `ROOT.FOCUS` (and its deferred focus-first) from firing. With nothing\n * selected, zag's own behaviour stands.\n */\nconst focusSelectedItem = (event: FocusEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return\n const selected = event.currentTarget.querySelector<HTMLElement>(\n ':scope > [data-state=\"on\"]:not([disabled])',\n )\n if (!selected) return\n event.stopPropagation()\n selected.focus({ preventScroll: true })\n}\n\n/**\n * RTL arrow keys. zag's toggle-group reads `event.key` without passing `dir` to\n * `getEventKey` (its other machines do), so in a right-to-left locale ArrowLeft\n * moves focus visually *right*. In a horizontal RTL group the two keys are\n * caught in the capture phase, before zag's handler, and focus moves to the\n * visually adjacent enabled item instead; zag then picks up the new focus\n * through the item's own `onFocus`. `dir` is read off the root, where the\n * machine writes the locale's direction.\n */\nconst mirrorRtlArrows = (loop: boolean) => (event: KeyboardEvent<HTMLDivElement>) => {\n const root = event.currentTarget\n if (root.dir !== \"rtl\" || root.getAttribute(\"data-orientation\") !== \"horizontal\") return\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n const items = Array.from(\n root.querySelectorAll<HTMLElement>(':scope > [data-part=\"item\"]:not([disabled])'),\n )\n const index = items.indexOf(event.target as HTMLElement)\n if (index === -1) return\n event.preventDefault()\n event.stopPropagation()\n // Visually left is the next item in RTL, visually right the previous one.\n const step = event.key === \"ArrowLeft\" ? 1 : -1\n const next = loop\n ? items[(index + step + items.length) % items.length]\n : items[Math.min(Math.max(index + step, 0), items.length - 1)]\n next?.focus()\n}\n\n/** The shared root behind both `ButtonSelect.Root` and `ButtonMultiSelect.Root`. */\nexport const RootBase = ({\n multiple,\n value,\n defaultValue,\n onValueChange,\n deselectable,\n orientation = \"horizontal\",\n color,\n variant = \"light\",\n selectedVariant = \"filled\",\n size = \"md\",\n invalid,\n loopFocus = true,\n className,\n testId,\n children,\n ...rest\n}: BaseRootProps & {\n multiple: boolean\n value?: string[]\n defaultValue?: string[]\n onValueChange?: (value: string[]) => void\n deselectable?: boolean\n}) => {\n const field = useFieldContext()\n // Owned here so a change can be compared with the current value: in a\n // non-deselectable single group the machine re-emits the same value when the\n // selected item is clicked again, and that is not a change.\n const [selected, setSelected] = useUncontrolled<string[]>({\n value,\n defaultValue,\n finalValue: [],\n onChange: onValueChange,\n })\n return (\n <ButtonSelectStyleContext.Provider value={{ variant, selectedVariant, size }}>\n <Ark.Root\n multiple={multiple}\n value={selected}\n onValueChange={(details) => {\n if (!sameValues(details.value, selected)) setSelected(details.value)\n }}\n deselectable={deselectable}\n orientation={orientation}\n loopFocus={loopFocus}\n onFocusCapture={multiple ? undefined : focusSelectedItem}\n onKeyDownCapture={mirrorRtlArrows(loopFocus)}\n data-color={color}\n {...props({ \"aria-invalid\": invalid, \"data-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={cn(buttonGroupVariants({ orientation }), invalidRing, className)}\n {...rest}\n >\n {children}\n </Ark.Root>\n </ButtonSelectStyleContext.Provider>\n )\n}\n\nexport type ButtonSelectRootProps = BaseRootProps & {\n /** Controlled value. `null` clears the selection. */\n value?: string | null\n /** Uncontrolled initial value. */\n defaultValue?: string | null\n /** Fires with the newly selected value — `null` only when `deselectable`. */\n onChange?: (value: string | null) => void\n /** Clicking the selected item clears the selection. Off by default, so the\n * group behaves like a radio group. */\n deselectable?: boolean\n}\n\nconst toArray = (value: string | null | undefined) =>\n value === undefined ? undefined : value === null ? [] : [value]\n\n/** Single-choice root: one selected item at most. */\nexport const Root = ({\n value,\n defaultValue,\n onChange,\n deselectable = false,\n ...rest\n}: ButtonSelectRootProps) => (\n <RootBase\n multiple={false}\n value={toArray(value)}\n defaultValue={toArray(defaultValue)}\n onValueChange={(next) => onChange?.(next[0] ?? null)}\n deselectable={deselectable}\n {...rest}\n />\n)\n\nexport type ButtonMultiSelectRootProps = BaseRootProps & {\n /** Controlled value. */\n value?: string[]\n /** Uncontrolled initial value. */\n defaultValue?: string[]\n /** Fires with every selected value, in selection order. */\n onChange?: (value: string[]) => void\n}\n\n/** Multiple-choice root: each item toggles independently. */\nexport const MultiRoot = ({ onChange, ...rest }: ButtonMultiSelectRootProps) => (\n <RootBase multiple onValueChange={onChange} {...rest} />\n)\n\n/** The props `Item` hands a custom control under `asChild`. */\ntype SelectableControlProps = { variant?: ButtonVariant; size?: ButtonSize }\n\nexport type ButtonSelectItemProps =\n | (Omit<ButtonProps, \"value\" | \"variant\" | \"size\" | \"loading\" | \"asChild\"> & {\n /** The value this item selects. */\n value: string\n asChild?: false\n })\n | {\n /** The value this item selects. */\n value: string\n disabled?: boolean\n /**\n * Render your own variant-aware control instead of a `Button` — e.g. an\n * `ActionIcon` for an icon-only toolbar. The single child receives the\n * selection-driven `variant` and the group `size` (its own `size` wins),\n * plus the machine's item props.\n */\n asChild: true\n children: ReactElement<SelectableControlProps>\n }\n\n/**\n * One option, rendered as a `Button`. Its `variant` follows the selection (from\n * `Root`'s `variant` / `selectedVariant`); every other `Button` prop — `color`,\n * `startSlot`, `endSlot`, `aria-label` for an icon-only item, `testId` — passes\n * through. The machine's item props land on the button via Ark's `asChild`.\n *\n * With `asChild`, the single child is rendered in place of the `Button` and\n * cloned with the same `variant` / `size`, so any control speaking the kit's\n * variant × size vocabulary (`ActionIcon`, a consumer's own) can be an item.\n */\nexport const Item = (props: ButtonSelectItemProps) => {\n const { variant, selectedVariant, size } = useContext(ButtonSelectStyleContext)\n const { value, disabled } = props\n const { pressed } = useToggleGroupContext().getItemState({ value, disabled })\n const resolvedVariant = pressed ? selectedVariant : variant\n if (props.asChild) {\n const child = Children.only(props.children)\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n {cloneElement(child, { variant: resolvedVariant, size: child.props.size ?? size })}\n </Ark.Item>\n )\n }\n const { value: _value, disabled: _disabled, asChild: _asChild, ...rest } = props\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n <Button variant={resolvedVariant} size={size} {...rest} />\n </Ark.Item>\n )\n}\n\n/**\n * One hidden input per selected value, so a native `<form>` submit carries the\n * selection under `name`. Rendered *beside* the root, never inside it: the join\n * selectors target the root's children by `:first-child` / `:last-child`, which a\n * trailing input would throw off.\n */\nexport const HiddenInputs = ({\n name,\n value,\n disabled,\n}: {\n name?: string\n value: readonly string[]\n disabled?: boolean\n}) =>\n name == null\n ? null\n : value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} disabled={disabled} />)\n\nexport const Context = Ark.Context\n","import type { ReactNode } from \"react\"\nimport type { Color } from \"../../lib/colors\"\n\n/**\n * One option of a data-driven `ButtonSelect` / `ButtonMultiSelect`: a bare\n * value-as-label string, or a labelled object. `payload` is arbitrary data the\n * machine ignores; it reaches `renderItem` typed off the `data` shape — the same\n * contract as `SegmentGroup` and `Select`.\n */\nexport type ButtonSelectItem<P = unknown> =\n | string\n | {\n value: string\n label?: ReactNode\n /** Content before the label, e.g. an icon (Button's `startSlot`). */\n startSlot?: ReactNode\n /** Content after the label (Button's `endSlot`). */\n endSlot?: ReactNode\n disabled?: boolean\n /** Overrides the group palette for this item. */\n color?: Color\n /** Accessible name — required when `label` is an icon only. */\n \"aria-label\"?: string\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered button. Defaults to `` `item-${value}` ``. */\n testId?: string\n }\n\n/** The `data` array both components are generic over. */\nexport type ButtonSelectData<P = unknown> = ReadonlyArray<ButtonSelectItem<P>>\n\n/** The value-string union of a `ButtonSelectData` shape; a `const` type\n * parameter narrows it to the literal union. */\nexport type ButtonSelectValue<Data extends ButtonSelectData> = ItemValue<Data[number]>\ntype ItemValue<E> = E extends string ? E : E extends { value: infer V extends string } ? V : never\n\n/** The `payload` type carried by a `ButtonSelectData` shape. */\nexport type ButtonSelectPayload<Data extends ButtonSelectData> = PayloadOf<Data[number]>\ntype PayloadOf<T> = T extends string ? never : T extends { payload?: infer P } ? P : never\n\n/** The item handed to `renderItem`, narrowed to the data's value and payload. */\nexport type RenderableButtonSelectItem<Data extends ButtonSelectData> = {\n value: ButtonSelectValue<Data>\n label: ReactNode\n disabled: boolean\n color: Color | undefined\n payload: ButtonSelectPayload<Data> | undefined\n}\n\n/** Live item state passed alongside the item to `renderItem`. */\nexport type ButtonSelectItemState = {\n selected: boolean\n disabled: boolean\n}\n\n/**\n * Render an item's label yourself. The item keeps its button, sizing, variant\n * and selection wiring; you fill its content. In an RSC tree the function must\n * live in a `\"use client\"` module.\n */\nexport type RenderButtonSelectItem<Data extends ButtonSelectData> = (\n item: RenderableButtonSelectItem<Data>,\n state: ButtonSelectItemState,\n) => ReactNode\n\n/** A fully resolved item — every field present (`label` falls back to `value`). */\nexport type NormalizedButtonSelectItem = {\n value: string\n label: ReactNode\n startSlot: ReactNode\n endSlot: ReactNode\n disabled: boolean\n color: Color | undefined\n ariaLabel: string | undefined\n payload: unknown\n testId: string\n}\n\nexport const normalizeButtonSelectItem = (item: ButtonSelectItem): NormalizedButtonSelectItem =>\n typeof item === \"string\"\n ? {\n value: item,\n label: item,\n startSlot: undefined,\n endSlot: undefined,\n disabled: false,\n color: undefined,\n ariaLabel: undefined,\n payload: undefined,\n testId: `item-${item}`,\n }\n : {\n value: item.value,\n label: item.label ?? item.value,\n startSlot: item.startSlot,\n endSlot: item.endSlot,\n disabled: item.disabled ?? false,\n color: item.color,\n ariaLabel: item[\"aria-label\"],\n payload: item.payload,\n testId: item.testId ?? `item-${item.value}`,\n }\n","\"use client\"\n\nimport type { FocusEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport type { ButtonSize, ButtonVariant } from \"../button/button\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport { HiddenInputs, Item, RootBase } from \"./button-select\"\nimport {\n type ButtonSelectData,\n normalizeButtonSelectItem,\n type RenderButtonSelectItem,\n} from \"./button-select-items\"\n\ntype ButtonSelectClassNames = {\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it. */\n label?: string\n root?: string\n item?: string\n}\n\n/** Props shared by the data-driven `ButtonSelect` and `ButtonMultiSelect`. */\nexport type ButtonSelectBaseProps<Data extends ButtonSelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Items: bare strings (`value === label`) or `{ value, label?, startSlot?, … }`. */\n data: Data\n /** Render each item's content yourself, with its typed `payload`. */\n renderItem?: RenderButtonSelectItem<Data>\n /** Lay the items in a row (default) or a column. */\n orientation?: \"horizontal\" | \"vertical\"\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Dims and blocks every item. */\n disabled?: boolean\n size?: ButtonSize\n /** Treatment of the unselected items. Defaults to `light`. */\n variant?: ButtonVariant\n /** Treatment of the selected items. Defaults to `filled`. */\n selectedVariant?: ButtonVariant\n color?: Color\n /** Renders a hidden input per selected value for native form submission. */\n name?: string\n /** Explicit id for the group root. */\n id?: string\n /** Lands on the group root, which forwards focus to its active item. */\n ref?: Ref<HTMLDivElement>\n /** Forwarded to the root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n className?: string\n classNames?: ButtonSelectClassNames\n }\n\n/**\n * The rendering both data forms share: the `Field` wrapper, the group root, one\n * `Item` per entry and the hidden inputs. The public components only adapt their\n * value shape (`V | null` or `V[]`) onto the machine's `string[]`.\n */\nexport const ButtonSelectControl = ({\n multiple,\n deselectable,\n value,\n onValueChange,\n data,\n renderItem,\n orientation,\n invalid,\n disabled,\n required,\n size = \"md\",\n variant,\n selectedVariant,\n color,\n name,\n id,\n ref,\n onBlur,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: ButtonSelectBaseProps<ButtonSelectData> & {\n multiple: boolean\n deselectable?: boolean\n value: readonly string[]\n onValueChange: (value: string[]) => void\n}) => {\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n const items = data.map(normalizeButtonSelectItem)\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n classNames={{ label: classNames?.label }}\n >\n <RootBase\n multiple={multiple}\n deselectable={deselectable}\n value={[...value]}\n onValueChange={onValueChange}\n orientation={orientation}\n disabled={disabled}\n invalid={isInvalid}\n size={size}\n variant={variant}\n selectedVariant={selectedVariant}\n color={color}\n id={id}\n ref={ref}\n onBlur={onBlur}\n testId={testId}\n className={cn(className, classNames?.root)}\n >\n {items.map((item) => (\n <Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n color={item.color}\n startSlot={item.startSlot}\n endSlot={item.endSlot}\n aria-label={item.ariaLabel}\n testId={item.testId}\n className={classNames?.item}\n >\n {renderItem\n ? renderItem(item, {\n selected: value.includes(item.value),\n disabled: Boolean(disabled) || item.disabled,\n })\n : item.label}\n </Item>\n ))}\n </RootBase>\n <HiddenInputs name={name} value={value} disabled={disabled} />\n </FieldShell>\n )\n}\n"]}
@@ -1,95 +0,0 @@
1
- import { props } from './chunk-WYCMIIRR.js';
2
- import { focusStyles } from './chunk-C6NVU4F7.js';
3
- import { cn } from './chunk-4ASNIDV7.js';
4
- import { ark } from '@ark-ui/react';
5
- import { cva } from 'class-variance-authority';
6
- import { jsx } from 'react/jsx-runtime';
7
-
8
- var themeIconVariants = cva(
9
- [
10
- "inline-flex items-center justify-center",
11
- "aspect-square shrink-0 select-none",
12
- "rounded-lg border",
13
- "[&_svg]:shrink-0 [&_svg]:pointer-events-none",
14
- // Inert on the default non-focusable <div>; applies once `asChild`
15
- // renders ThemeIcon onto a real <a>/<button>. See `focusStyles`.
16
- focusStyles()
17
- ],
18
- {
19
- variants: {
20
- variant: {
21
- // A translucent wash of `--c-solid` (not the opaque token) so the
22
- // fill blends with whatever surface it sits on instead of reading
23
- // as a painted CTA block. The border mixes in black on top of that
24
- // same var — a fixed darkening, not another opacity step of it —
25
- // so it reads as a recessed edge in both themes; some colors (neutral
26
- // in particular) have a dark-mode `--c-solid` that's lighter than
27
- // its own soft/text steps, which would flip a same-var-opacity
28
- // border the wrong way. This is the ThemeIcon-specific reading of
29
- // "filled": raised, not loud. Button/Badge/ActionIcon's `filled`
30
- // (opaque bg-(--c-solid)) would look like a button here —
31
- // intentionally not reused.
32
- filled: "bg-(--c-solid)/15 text-(--c-text) border-[color-mix(in_oklab,var(--c-solid)_35%,black_65%)]",
33
- light: "bg-(--c-soft) text-(--c-text) border-transparent",
34
- outline: "bg-transparent text-(--c-text) border-(--c-solid)",
35
- subtle: "bg-transparent text-(--c-text) border-transparent",
36
- // Palette-independent neutral surface. Unlike ActionIcon's
37
- // high-contrast inverted `default` (a black/white button look),
38
- // this stays a muted card in both themes. It sits on the kit's
39
- // translucent surface recipe (the quiet `bg-black/3 dark:bg-white/4`
40
- // fill plus the hairline `border-brand-900/20 dark:border-white/15`,
41
- // as `Kbd` and `Card` do) rather than an opaque gray step, so the tile
42
- // reads on whatever surface hosts it. Light mode darkens because a
43
- // bare `bg-white/4` vanishes on a near-white page.
44
- default: [
45
- "bg-black/3 text-brand-900/70 border-brand-900/20",
46
- "dark:bg-white/4 dark:text-white/80 dark:border-white/15"
47
- ]
48
- },
49
- size: {
50
- xs: "h-7 [&_svg]:size-5",
51
- sm: "h-8 [&_svg]:size-5.5",
52
- md: "h-9 [&_svg]:size-6",
53
- lg: "h-10 [&_svg]:size-7",
54
- xl: "h-12 [&_svg]:size-8"
55
- },
56
- radius: {
57
- xs: "rounded-xs",
58
- sm: "rounded-sm",
59
- md: "rounded-md",
60
- lg: "rounded-lg",
61
- xl: "rounded-xl",
62
- full: "rounded-full"
63
- }
64
- },
65
- defaultVariants: {
66
- variant: "default",
67
- size: "md",
68
- radius: "md"
69
- }
70
- }
71
- );
72
- var ThemeIcon = ({
73
- className,
74
- variant,
75
- size,
76
- radius,
77
- color,
78
- asChild,
79
- testId,
80
- ...rest
81
- }) => /* @__PURE__ */ jsx(
82
- ark.div,
83
- {
84
- asChild,
85
- "data-color": color,
86
- "data-variant": variant ?? "default",
87
- className: cn(themeIconVariants({ variant, size, radius }), className),
88
- ...props({ "data-testid": testId }),
89
- ...rest
90
- }
91
- );
92
-
93
- export { ThemeIcon };
94
- //# sourceMappingURL=chunk-7CNDZZZ6.js.map
95
- //# sourceMappingURL=chunk-7CNDZZZ6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/theme-icon/theme-icon.tsx"],"names":[],"mappings":";;;;;;;AAuBA,IAAM,iBAAA,GAAoB,GAAA;AAAA,EACxB;AAAA,IACE,yCAAA;AAAA,IACA,oCAAA;AAAA,IACA,mBAAA;AAAA,IACA,8CAAA;AAAA;AAAA;AAAA,IAGA,WAAA;AAAY,GACd;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QA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AAA,IAClC,GAAG;AAAA;AACN","file":"chunk-7CNDZZZ6.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * ThemeIcon — square, non-interactive icon-display box. Visually related to\n * `ActionIcon` (same size/radius scales) but deliberately **not** its\n * (variant × color) look: every variant here is a muted, low-saturation\n * surface — just enough contrast to read as \"raised above the page,\" never\n * a vivid CTA-style fill. There's no hover state and no cursor affordance,\n * because this is a display, not a control.\n *\n * `asChild` renders the single child as the root, so it composes on top of\n * an interactive element (e.g. wrap a `Link`) when the icon itself needs to\n * be clickable. The kit's focus ring (`focusStyles`) rides along for that\n * case and stays inert on the default `<div>` — but reach for `ActionIcon`\n * when an interactive icon is the common case, since it also supplies the\n * `aria-label`, disabled and loading handling a real trigger needs.\n */\nconst themeIconVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"aspect-square shrink-0 select-none\",\n \"rounded-lg border\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n // Inert on the default non-focusable <div>; applies once `asChild`\n // renders ThemeIcon onto a real <a>/<button>. See `focusStyles`.\n focusStyles(),\n ],\n {\n variants: {\n variant: {\n // A translucent wash of `--c-solid` (not the opaque token) so the\n // fill blends with whatever surface it sits on instead of reading\n // as a painted CTA block. The border mixes in black on top of that\n // same var — a fixed darkening, not another opacity step of it —\n // so it reads as a recessed edge in both themes; some colors (neutral\n // in particular) have a dark-mode `--c-solid` that's lighter than\n // its own soft/text steps, which would flip a same-var-opacity\n // border the wrong way. This is the ThemeIcon-specific reading of\n // \"filled\": raised, not loud. Button/Badge/ActionIcon's `filled`\n // (opaque bg-(--c-solid)) would look like a button here —\n // intentionally not reused.\n filled:\n \"bg-(--c-solid)/15 text-(--c-text) border-[color-mix(in_oklab,var(--c-solid)_35%,black_65%)]\",\n light: \"bg-(--c-soft) text-(--c-text) border-transparent\",\n outline: \"bg-transparent text-(--c-text) border-(--c-solid)\",\n subtle: \"bg-transparent text-(--c-text) border-transparent\",\n // Palette-independent neutral surface. Unlike ActionIcon's\n // high-contrast inverted `default` (a black/white button look),\n // this stays a muted card in both themes. It sits on the kit's\n // translucent surface recipe (the quiet `bg-black/3 dark:bg-white/4`\n // fill plus the hairline `border-brand-900/20 dark:border-white/15`,\n // as `Kbd` and `Card` do) rather than an opaque gray step, so the tile\n // reads on whatever surface hosts it. Light mode darkens because a\n // bare `bg-white/4` vanishes on a near-white page.\n default: [\n \"bg-black/3 text-brand-900/70 border-brand-900/20\",\n \"dark:bg-white/4 dark:text-white/80 dark:border-white/15\",\n ],\n },\n size: {\n xs: \"h-7 [&_svg]:size-5\",\n sm: \"h-8 [&_svg]:size-5.5\",\n md: \"h-9 [&_svg]:size-6\",\n lg: \"h-10 [&_svg]:size-7\",\n xl: \"h-12 [&_svg]:size-8\",\n },\n radius: {\n xs: \"rounded-xs\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n radius: \"md\",\n },\n },\n)\n\nexport type ThemeIconVariant = NonNullable<VariantProps<typeof themeIconVariants>[\"variant\"]>\nexport type ThemeIconSize = NonNullable<VariantProps<typeof themeIconVariants>[\"size\"]>\nexport type ThemeIconRadius = NonNullable<VariantProps<typeof themeIconVariants>[\"radius\"]>\n\nexport type ThemeIconProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof themeIconVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n }\n\nexport const ThemeIcon = ({\n className,\n variant,\n size,\n radius,\n color,\n asChild,\n testId,\n ...rest\n}: ThemeIconProps) => (\n <ark.div\n asChild={asChild}\n data-color={color}\n data-variant={variant ?? \"default\"}\n className={cn(themeIconVariants({ variant, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/action-icon/action-icon.tsx"],"names":[],"mappings":";;;;;;;;;AAuCA,IAAM,kBAAA,GAAqB,GAAA;AAAA,EACzB;AAAA,IACE,yCAAA;AAAA,IACA,oCAAA;AAAA,IACA,qCAAA;AAAA,IACA,cAAA;AAAA,IACA,+CAAA;AAAA,IACA,0BAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ,mEAAA;AAAA,IACA,4DAAA;AAAA,IACA,uCAAA;AAAA,IACA,sDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ;AAAA,UACN,oCAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,KAAA,EAAO;AAAA,UACL,uDAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,OAAA,EAAS;AAAA,UACP,mDAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,MAAA,EAAQ,CAAC,gCAAA,EAAkC,sCAAsC,CAAA;AAAA,QACjF,OAAA,EAAS;AAAA,UACP,8EAAA;AAAA,UACA;AAAA;AACF,OACF;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,4BAAA;AAAA,QACJ,EAAA,EAAI,8BAAA;AAAA,QACJ,EAAA,EAAI,4BAAA;AAAA,QACJ,EAAA,EAAI,6BAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACN;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,IAAA,EAAM;AAAA;AACR,KACF;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B,QAAA,EAAU,sBAAM,GAAA,CAAC,OAAA,EAAA,EAAQ,KAAA,EAAO,IAAA,EAAM,CAAA,EAAI;AAAA,QAC3D,OAAA,EAAS;AAAA,OACV,CAAA,GACC,OAAA,uBACD,OAAA,EAAA,EAAQ,KAAA,EAAO,MAAM,CAAA,GAEtB;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-BE2LWUHY.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { MouseEvent } from \"react\"\nimport { withAsChildContent } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Spinner } from \"../spinner/spinner\"\n\n/**\n * ActionIcon — square, icon-only sibling of `Button`.\n *\n * Same (variant × color) model as `Button`:\n * - `variant` picks the shape (filled / light / outline / subtle / default)\n * - `color` picks the palette (brand / gray / red / …)\n * - Color is delivered via `data-color` + the slot vars in `colors.css`,\n * so dark mode shade-shifts happen at the CSS layer.\n *\n * What's specific to ActionIcon:\n * - Forced 1:1 aspect ratio.\n * - Own `radius` scale (incl. `full` for circular FABs / like-buttons).\n * - Wider size scale (xs..xl) than Button — toolbar density matters here.\n *\n * The accessible name MUST come from `aria-label` (or `aria-labelledby`); the\n * icon children are decoration.\n *\n * `asChild` renders the single child with ActionIcon's styling. Ark's\n * factory clones exactly one element, so `loading`'s spinner replaces\n * *that* element's own children (`withAsChildContent`, `lib/as-child.ts`)\n * rather than the element itself. The `onClick` guard (`preventWhileLoading`)\n * goes on the same clone, since `disabled` doesn't do anything on an\n * arbitrary `asChild` element (e.g. an `<a>`) — same reason the `opacity-50`\n * dimming and `pointer-events-none` blocking are keyed off `data-loading`\n * rather than `:disabled` (see `Button`'s note on this).\n */\nconst actionIconVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"aspect-square shrink-0 select-none\",\n \"font-medium uppercase tracking-wide\",\n \"no-underline\",\n \"rounded-action-icon border border-transparent\",\n \"transition-colors-radius\",\n focusStyles(),\n \"disabled:not-data-loading:pointer-events-none disabled:opacity-50\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"not-data-loading:hover:cursor-pointer\",\n \"data-loading:cursor-progress data-loading:opacity-50\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n ],\n {\n variants: {\n variant: {\n filled: [\n \"bg-(--c-solid) text-(--c-on-solid)\",\n \"not-data-loading:hover:bg-(--c-solid-hover)\",\n ],\n light: [\n \"bg-(--c-soft) text-(--c-text) border-(--c-soft-hover)\",\n \"not-data-loading:hover:bg-(--c-soft-hover) not-data-loading:hover:border-(--c-solid)\",\n ],\n outline: [\n \"bg-transparent text-(--c-text) border-(--c-solid)\",\n \"not-data-loading:hover:bg-(--c-soft)\",\n ],\n subtle: [\"bg-transparent text-(--c-text)\", \"not-data-loading:hover:bg-(--c-soft)\"],\n default: [\n \"bg-brand-950 text-white border-brand-800 not-data-loading:hover:bg-brand-800\",\n \"dark:bg-white dark:text-brand-950 dark:border-white/80 dark:not-data-loading:hover:bg-white/80\",\n ],\n },\n size: {\n xs: \"h-7 text-xs [&_svg]:size-5\",\n sm: \"h-8 text-sm [&_svg]:size-5.5\",\n md: \"h-9 text-md [&_svg]:size-6\",\n lg: \"h-10 text-lg [&_svg]:size-7\",\n xl: \"h-12 text-xl [&_svg]:size-8\",\n },\n radius: {\n xs: \"rounded-xs\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n)\n\nexport type ActionIconVariant = NonNullable<VariantProps<typeof actionIconVariants>[\"variant\"]>\nexport type ActionIconSize = NonNullable<VariantProps<typeof actionIconVariants>[\"size\"]>\nexport type ActionIconRadius = NonNullable<VariantProps<typeof actionIconVariants>[\"radius\"]>\n\nexport type ActionIconProps = Omit<HTMLArkProps<\"button\">, \"color\"> &\n VariantProps<typeof actionIconVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /**\n * Replace the icon with a spinner, mark the element as busy, and suppress\n * pointer interactions. Mirrors `Button`'s `loading`.\n */\n loading?: boolean\n }\n\n/** Mirrors `Button`'s `preventWhileLoading` — see the note there. */\nconst preventWhileLoading = (event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n}\n\nexport const ActionIcon = ({\n className,\n variant,\n size,\n radius,\n color,\n loading = false,\n children,\n disabled,\n type,\n asChild,\n testId,\n onClick,\n ...rest\n}: ActionIconProps) => {\n const resolvedDisabled = disabled || loading\n const resolvedOnClick = loading ? preventWhileLoading : onClick\n\n return (\n <ark.button\n asChild={asChild}\n type={asChild ? type : (type ?? \"button\")}\n disabled={resolvedDisabled}\n data-color={color}\n data-variant={variant ?? \"default\"}\n className={cn(actionIconVariants({ variant, size, radius }), className)}\n onClick={resolvedOnClick}\n {...props({\n \"aria-busy\": loading,\n \"aria-disabled\": resolvedDisabled,\n \"data-loading\": loading,\n \"data-testid\": testId,\n })}\n {...rest}\n >\n {asChild && loading ? (\n withAsChildContent(children, () => <Spinner label={null} />, {\n onClick: preventWhileLoading,\n })\n ) : loading ? (\n <Spinner label={null} />\n ) : (\n children\n )}\n </ark.button>\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/segment-group/segment-group.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAsEA,IAAM,OAAA,GAAU,GAAA;AAAA,EACd;AAAA,IACE,aAAA;AAAA,IACA,wEAAA;AAAA,IACA,kBAAA,CAAmB,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKnB,8FAAA;AAAA,IACA,mBAAA;AAAA,IACA,2DAAA;AAAA,IACA;AAAA,GACF;AAAA,E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I7D,QAAA,EAAA,UAAA,uBACEA,cAAA,CAAI,WAAA,EAAJ,EACE,QAAA,EAAA,CAAC,GAAA,KACA,WAAW,IAAA,EAA4C;AAAA,wBACrD,SAAS,GAAA,CAAI,OAAA;AAAA,wBACb,UAAU,GAAA,CAAI;AAAA,uBACf,CAAA,EAEL,CAAA,GAEA,IAAA,CAAK;AAAA;AAAA,mBAET;AAAA,kCACA,GAAA,CAACA,cAAA,CAAI,WAAA,EAAJ,EAAgB,CAAA;AAAA,kCACjB,GAAA,CAACA,cAAA,CAAI,eAAA,EAAJ,EAAoB;AAAA;AAAA,eAAA;AAAA,cA1BhB,IAAA,CAAK;AAAA,aA4Bb;AAAA;AAAA,SAAA;AAAA,QA/EI;AAAA;AAgFP;AAAA,GACF;AAEJ","file":"chunk-C4NFRSOR.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { SegmentGroup as Ark } from \"@ark-ui/react/segment-group\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { useDirectionCheck } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\n\n/**\n * SegmentGroup — a segmented single-choice control on Ark UI's SegmentGroup\n * machine (the radio-group model under the hood). It renders a row (or column)\n * of mutually exclusive segments with a sliding pill that animates to the\n * selected item. Use it as a compact, always-visible alternative to a `Select`\n * when the option set is small (2–5 items): view toggles, filters, billing\n * cadence, and the like.\n *\n * - Value is a single `string | null`; `onChange` hands it to you directly,\n * matching the kit's value-based `FormControlProps` contract.\n * - `data` accepts bare strings (`value === label`) or\n * `{ value, label?, disabled?, color?, payload? }` objects, mixed freely.\n * The component is generic over `data` (a `const` type parameter), so\n * `value` / `onChange` narrow to the literal value union and an item's\n * `payload` flows—typed—into `renderItem` (the same contract as `Select`).\n * - Label / description / error / required come from the built-in `Field`\n * wrapper, so a `SegmentGroup` is accessible and complete on its own.\n * - `name` renders a hidden radio input per item, so the selected value rides\n * a native `<form>` submission.\n *\n * `variant` mirrors the `Button` family (`filled` / `light` / `outline` /\n * `subtle` / `default`): the tray, the sliding pill, and the checked label all\n * adopt the variant's treatment off the shared `--c-*` slots. Palette rides on\n * `data-color`, so every kit color tints for free, `default` included — its pill\n * falls back to solid black/white with no color set, because `:root` defines\n * `--c-solid`/`--c-on-solid` as black/white (white/brand-950 under dark). A\n * per-item `color` overrides the group palette for whichever segment is\n * selected: it re-stamps `data-color` on that item and on the pill, so both\n * the fill and the checked label resolve from the same block.\n *\n * The moving pill is the Ark `Indicator`: Ark positions it absolutely via the\n * CSS vars `--left` / `--top` / `--width` / `--height` (the selected segment's\n * measured rect), so it sits *behind* the labels (`z-0`). Ark only re-measures\n * that rect on mount and on value change — not when `orientation` flips — so we\n * remount the root with `key={orientation}` to force a fresh measure on the new\n * axis. The value is held in `useUncontrolled` so the selection survives that\n * remount.\n */\n\n/**\n * Per-segment label: size sets the padding / text, `variant` sets the *checked*\n * text color so it reads against that variant's pill. The unchecked color is a\n * neutral gray applied at the call site.\n *\n * The checked label must come from the same source as the pill under it.\n * `default` and `filled` both paint `bg-(--c-solid)`, so both take\n * `--c-on-solid` — which resolves per-item, since each `ItemText` carries its\n * own `data-color`. Pairing a hard-coded neutral foreground with a `--c-solid`\n * fill is what broke `default` at any group `color` (#140): the pill moved with\n * the palette and the label stayed put, reaching 3.27:1 on brand. There is\n * deliberately no hover shift on the checked label — `Button`'s `filled` moves\n * only the background and keeps `--c-on-solid`, and no `--c-on-solid-hover`\n * slot exists in `colors.css`.\n */\nconst segItem = cva(\n [\n \"font-medium\",\n \"cursor-pointer rounded-input text-center whitespace-nowrap select-none\",\n TEXT_COLOR_CLASSES.secondary,\n // Only unchecked segments get the hover lift, as in Tabs. An\n // unscoped `hover:` ties on specificity with the checked foreground and\n // won on source order in dark theme, washing the checked label to\n // near-white over a colored pill.\n \"not-data-[state=checked]:hover:text-brand-950 dark:not-data-[state=checked]:hover:text-white\",\n \"transition-colors\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n \"group-data-invalid:text-red-900 dark:group-data-invalid:text-red-500\",\n ],\n {\n variants: {\n variant: {\n filled: \"data-[state=checked]:text-(--c-on-solid)\",\n light: \"data-[state=checked]:text-(--c-text)\",\n outline: \"data-[state=checked]:text-(--c-text)\",\n subtle: \"data-[state=checked]:text-(--c-text)\",\n default: \"data-[state=checked]:text-(--c-on-solid)\",\n },\n size: {\n // No vertical padding of its own — the tray's `min-h` (below) sets the\n // box height and this item stretches to fill it (the tray's default\n // `align-items: stretch` propagates all the way down), so the label\n // just needs to center itself inside that taller box. This matches an\n // `Input` / `NumberInput`'s exact box height at the same size.\n xs: \"flex items-center justify-center px-1 text-xs\",\n sm: \"flex items-center justify-center px-1.5 text-sm\",\n md: \"flex items-center justify-center px-2 text-md\",\n lg: \"flex items-center justify-center px-3 text-lg\",\n xl: \"flex items-center justify-center px-4 text-xl\",\n },\n },\n defaultVariants: { variant: \"default\", size: \"md\" },\n },\n)\n\n/**\n * Per-segment wrapper. Beyond positioning the label above the pill (`z-1`), it\n * draws a hairline separator in the gap to its leading edge (a `::before`) so\n * inactive neighbours read as divided. That rule fades out next to the active\n * pill — on the checked segment and the one right after it — and is suppressed\n * before the first segment (the indicator is child 1, so the first segment is\n * `:nth-child(2)`). It flips from a vertical rule to a horizontal one when the\n * group is laid out vertically.\n */\nconst segItemWrap = cva([\n \"relative z-1 inline-flex\",\n \"before:absolute before:rounded-full before:bg-brand-900/30 dark:before:bg-white/35\",\n \"group-data-invalid:before:bg-red-500/30\",\n \"before:transition-opacity before:duration-200\",\n // Horizontal: a vertical rule centered on the leading edge, sitting in the gap. Logical\n // (`start`, `-ms-[0.5px]` to center the 1px rule), so under `dir=\"rtl\"` the rule still lands\n // between a segment and the one before it instead of on the far side.\n \"before:top-1/2 before:start-0 before:-ms-[0.5px] before:h-1/2 before:w-px before:-translate-y-1/2\",\n // Vertical: a horizontal rule centered on the top edge instead (`start-1/4` + `w-1/2` is\n // centered in either direction).\n \"in-data-[orientation=vertical]:before:top-0 in-data-[orientation=vertical]:before:start-1/4 in-data-[orientation=vertical]:before:ms-0 in-data-[orientation=vertical]:before:h-px in-data-[orientation=vertical]:before:w-1/2\",\n // No separator before the first segment, or flanking the active pill.\n \"nth-2:before:hidden\",\n \"data-[state=checked]:before:opacity-0 data-[state=checked]:[&+*]:before:opacity-0\",\n])\n\n/**\n * The sliding pill, mirroring each `Button` surface. Its slide + color transition\n * is driven by Ark (see the `--transition-*` overrides on the element); `default`\n * follows `--c-solid` like every other variant, which falls back to solid\n * black/white with no `data-color` set. Filled/soft-fill pills (`filled`, `light`,\n * `default`) use a tighter `rounded-xxs` than the tray's own `rounded-input`, for a\n * nested-corner look inside the tray's padding; bordered/transparent pills\n * (`outline`, `subtle`) keep `rounded-input`.\n */\nconst segIndicator = cva(\n [\n \"z-0\",\n // The slide's duration, read by the inline `transition-duration` (see the\n // pill below); reduced motion zeroes it, so the pill jumps instead.\n \"[--indicator-duration:var(--duration-normal)] motion-reduce:[--indicator-duration:0s]\",\n ],\n {\n variants: {\n variant: {\n filled: \"bg-(--c-solid) rounded-xxs\",\n light: \"bg-(--c-soft) border border-(--c-soft-hover) rounded-xxs\",\n outline: \"bg-transparent border border-(--c-solid) rounded-input\",\n subtle: \"bg-(--c-soft-hover) rounded-input\",\n default: \"bg-(--c-solid) rounded-xxs\",\n },\n },\n defaultVariants: { variant: \"default\" },\n },\n)\n\n/**\n * The tray. Mirrors the `Button` variants: `filled` is a borderless neutral fill\n * so the colored pill pops (the kit's quiet `bg-black/3 dark:bg-white/4`; light\n * mode darkens because a bare `bg-white/4` vanishes on a near-white page), `light` / `default` frame the pill with the same\n * translucent surface as `Input`'s own `default` shell (`bg-white/4` + the\n * hairline `border-brand-900/20 dark:border-white/15`) rather than an opaque\n * gray step, so the tray reads correctly on any host background, `subtle` /\n * `outline` are chromeless.\n */\nconst segTray = cva(\n [\n \"relative inline-flex rounded-input border p-0.5 transition-colors max-w-fit group\",\n \"data-[orientation=vertical]:flex-col\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-60\",\n // Focus halo + accent border, driven by the active palette's `--c-solid`. Keyed\n // off Zag's `data-focus-visible` (set only when the focus came from the keyboard,\n // never a mouse click) via `:has()`, so the ring stays off when you click a segment.\n //\n // Deliberately NOT `focusStyles`. This is the *shell* idiom, not the ring\n // idiom: an accent border plus a soft `/15` halo on a wrapper whose focus\n // lives on a descendant, with a red invalid twin on the identical selector.\n // That is `input.tsx`'s `shellChrome`, not `Button`'s ring — folding it into\n // `focusStyles` would make that helper grow an alpha, a border half and a\n // concept of invalid, for one call site. The two shells are worth sharing\n // with each other instead; see the follow-up issue.\n \"has-data-focus-visible:border-(--c-solid) has-data-focus-visible:ring-2 has-data-focus-visible:ring-(--c-solid)/15\",\n // Invalid wins over the palette: red border + red halo.\n \"data-invalid:border-red-500 data-invalid:has-data-focus-visible:border-red-500 data-invalid:has-data-focus-visible:ring-red-500/15\",\n // Disabled affordances on the shell.\n ],\n {\n variants: {\n variant: {\n filled: [\"bg-black/3 dark:bg-white/4\", \"border-transparent\"],\n light: [\"bg-white/4\", \"border-brand-900/20 dark:border-white/15\"],\n outline: [\"bg-transparent border-transparent\"],\n subtle: [\"bg-transparent border-transparent\"],\n default: [\"bg-white/4\", \"border-brand-900/20 dark:border-white/15\"],\n },\n size: {\n // The exact `min-h` `inputShell` (input.tsx) uses at the same size —\n // so a `SegmentGroup` sits flush with an `Input` / `NumberInput` of\n // the same size in a row (see `TimeRow`, which composes both).\n xs: \"gap-0 min-h-7\",\n sm: \"gap-0 min-h-8\",\n md: \"gap-0 min-h-9\",\n lg: \"gap-0 min-h-10\",\n xl: \"gap-0 min-h-12\",\n },\n },\n defaultVariants: { variant: \"default\" },\n },\n)\n\nexport type SegmentGroupSize = NonNullable<VariantProps<typeof segItem>[\"size\"]>\nexport type SegmentGroupVariant = VariantProps<typeof segTray>[\"variant\"]\n\n/**\n * A single segment: a bare value-as-label string, or a labelled object. Objects\n * may carry a `payload` of arbitrary data (the machine ignores it; it flows\n * through to `renderItem`, typed off the `data` shape — the same contract as\n * `Select`'s `SelectItem`).\n */\nexport type SegmentGroupItem<P = unknown> =\n | string\n | {\n value: string\n label?: ReactNode\n disabled?: boolean\n /** Overrides the group palette for the pill + label when this item is selected. */\n color?: Color\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered segment. Defaults to `` `item-${value}` ``. */\n testId?: string\n }\n\n/** The `data` array the component is generic over. */\nexport type SegmentGroupData<P = unknown> = ReadonlyArray<SegmentGroupItem<P>>\n\n/**\n * Extract the value-string union from a `SegmentGroupData` shape — bare strings\n * and item `.value`s both contribute. A `const` type parameter narrows it to the\n * literal union, so `value` / `onChange` are typed off the data (like `Select`).\n */\nexport type SegmentGroupValue<Data extends SegmentGroupData> = ItemValue<Data[number]>\ntype ItemValue<E> = E extends string ? E : E extends { value: infer V extends string } ? V : never\n\n/**\n * Extract the `payload` type carried by a `SegmentGroupData` shape, read\n * structurally off the data's `payload` property. Bare strings contribute\n * `never`; a homogeneous payload resolves precisely, a mixed one to the union.\n */\nexport type SegmentGroupPayload<Data extends SegmentGroupData> = PayloadOf<Data[number]>\ntype PayloadOf<T> = T extends string ? never : T extends { payload?: infer P } ? P : never\n\n/**\n * The segment handed to `renderItem`: `value` narrowed to the data's value union\n * and `payload` to the data's payload type, so a `const`-typed `data` yields\n * literal values and a precise payload in the callback.\n */\nexport type RenderableSegment<Data extends SegmentGroupData> = {\n value: SegmentGroupValue<Data>\n label: ReactNode\n disabled: boolean\n color: Color | undefined\n payload: SegmentGroupPayload<Data> | undefined\n}\n\n/** Live segment state passed alongside the item to `renderItem`. */\nexport type SegmentRenderState = {\n checked: boolean\n disabled: boolean\n}\n\n/**\n * Render a segment's label content yourself. Receives the (value-narrowed) item —\n * including its typed `payload` — and its live `{ checked, disabled }` state. The\n * segment keeps its sizing, pill, and selection wiring; you fill the label. In an\n * RSC tree the function must live in a `\"use client\"` module so the boundary\n * serializes it as a client reference.\n */\nexport type RenderSegment<Data extends SegmentGroupData> = (\n item: RenderableSegment<Data>,\n state: SegmentRenderState,\n) => ReactNode\n\ntype SegmentGroupClassNames = {\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it. */\n label?: string\n root?: string\n indicator?: string\n item?: string\n itemText?: string\n}\n\nexport type SegmentGroupProps<Data extends SegmentGroupData = SegmentGroupData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Segments: bare strings (`value === label`) or `{ value, label?, disabled?, color?, payload? }`. */\n data: Data\n /** Controlled value. `null` clears the selection. */\n value?: SegmentGroupValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: SegmentGroupValue<Data> | null\n /** Fires with the selected value. */\n onChange?: (value: SegmentGroupValue<Data>) => void\n /** Render each segment's label content yourself, with its typed `payload`. */\n renderItem?: RenderSegment<Data>\n /** Lay the segments in a row (default) or a column. */\n orientation?: \"horizontal\" | \"vertical\"\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Dims and blocks interaction. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n /** `xs`–`xl` match the exact box height of an `Input` / `NumberInput` at\n * that size, so a `SegmentGroup` composes flush inline next to one (see\n * `TimeInput`'s AM/PM toggle). */\n size?: SegmentGroupSize\n variant?: SegmentGroupVariant\n color?: Color\n /** Wires the hidden radio inputs into native form submission. */\n name?: string\n /** Explicit id for label association. */\n id?: string\n /** Lands on the root for focus-on-error. */\n ref?: Ref<HTMLDivElement>\n /** Forwarded to the root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n className?: string\n classNames?: SegmentGroupClassNames\n }\n\n/** A fully resolved segment — every field present (`label` falls back to `value`). */\ntype NormalizedItem = {\n value: string\n label: ReactNode\n disabled: boolean\n color: Color | undefined\n payload: unknown\n testId: string\n}\n\n/** Normalize a bare string / object into the resolved `NormalizedItem` form. */\nconst normalizeItem = (item: SegmentGroupItem): NormalizedItem =>\n typeof item === \"string\"\n ? {\n value: item,\n label: item,\n disabled: false,\n color: undefined,\n payload: undefined,\n testId: `item-${item}`,\n }\n : {\n value: item.value,\n label: item.label ?? item.value,\n disabled: item.disabled ?? false,\n color: item.color,\n payload: item.payload,\n testId: item.testId ?? `item-${item.value}`,\n }\n\n/**\n * The real `role=\"radiogroup\"` root (and, through it, each item's hidden\n * radio input), split out so it reads the `Field` context from *inside* the\n * wrapping `FieldShell` — `SegmentGroup` itself renders that shell, so\n * calling `useFieldContext()` at its own top level would run too early.\n * Takes plain `string` values rather than the outer component's `Data`-typed\n * union: it only forwards them, so no generic type parameter is needed here.\n */\nconst SegmentGroupRoot = ({\n value,\n onValueChange,\n disabled,\n readOnly,\n required,\n invalid,\n orientation,\n name,\n id,\n ref,\n onBlur,\n color,\n className,\n testId,\n children,\n}: {\n value: string | null\n onValueChange: (value: string | null) => void\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n invalid: boolean\n orientation: \"horizontal\" | \"vertical\"\n name?: string\n id?: string\n ref?: Ref<HTMLDivElement>\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n color?: Color\n className?: string\n children: ReactNode\n} & WithTestId) => {\n const field = useFieldContext()\n const checkDirection = useDirectionCheck()\n const rootRef = useMergedRefs(ref, checkDirection)\n return (\n <Ark.Root\n value={value}\n onValueChange={(d) => onValueChange(d.value)}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={invalid}\n orientation={orientation}\n name={name}\n id={id}\n ref={rootRef}\n onBlur={onBlur}\n data-color={color}\n {...props({ \"data-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={className}\n >\n {children}\n </Ark.Root>\n )\n}\n\nexport const SegmentGroup = <const Data extends SegmentGroupData = SegmentGroupData>({\n data,\n value,\n defaultValue,\n onChange,\n renderItem,\n orientation = \"horizontal\",\n invalid,\n disabled,\n readOnly,\n required,\n size = \"md\",\n variant = \"default\",\n color,\n name,\n id,\n ref,\n onBlur,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: SegmentGroupProps<Data>) => {\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n // Own the value so the pill can read which item is selected (per-item color)\n // and so the `key={orientation}` remount below preserves the selection.\n const [selectedValue, setSelectedValue] = useUncontrolled<SegmentGroupValue<Data> | null>({\n value,\n defaultValue,\n finalValue: null,\n onChange: (v) => v != null && onChange?.(v),\n })\n\n const normalized = (data as SegmentGroupData).map(normalizeItem)\n const selected = normalized.find((item) => item.value === selectedValue)\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n classNames={{ label: classNames?.label }}\n // A radio group: nothing carries the label's `for` id; the root's `aria-labelledby` names it.\n composite\n >\n {/* `key={orientation}` remounts the root on an axis flip so Ark re-measures\n the indicator rect for the new layout (it only measures on mount + value\n change). `useUncontrolled` keeps the selection across that remount. */}\n <SegmentGroupRoot\n key={orientation}\n value={selectedValue}\n // Ark's value is typed by the collection (`string`); the runtime value\n // always originates from `data`, so narrow it back to the caller's union.\n onValueChange={(v) => setSelectedValue(v as SegmentGroupValue<Data> | null)}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={isInvalid}\n orientation={orientation}\n name={name}\n id={id}\n ref={ref}\n onBlur={onBlur}\n color={color}\n testId={testId}\n className={cn(segTray({ variant, size }), className, classNames?.root)}\n >\n {/* The sliding pill. Ark sets `position: absolute` + `--left`/`--top`/\n `--width`/`--height` (the selected segment's rect) inline, so it\n sits behind the labels (`z-0`). It adopts the selected item's `color`\n (falling back to the group `color`), which is the same `data-color`\n that item's own label carries — so the fill and the `--c-on-solid`\n text on top of it always resolve from one block.\n\n We drive the slide ourselves rather than via Ark's gated transition.\n Ark sets `transition-property: none` whenever its `animateIndicator`\n flag is false — including the instant it receives the `transitionend`\n of ANY animated property. With several properties of differing\n end-times (a `left` redirected by an interrupting click vs. a color or\n width that already settled), that early end would null the transition\n and snap the pill mid-slide. Overriding the real `transition-*` props\n (our `style` wins via Ark's `mergeProps`) keeps the transition always\n on, so the flag is irrelevant and interruptions re-target smoothly. The\n first paint stays instant because Ark renders the pill `hidden` until\n its rect is measured, and `display:none` can't transition. The\n duration comes from `--indicator-duration` (set by a class) rather\n than an inline value, so reduced motion can zero it. */}\n <Ark.Indicator\n style={{\n width: \"var(--width)\",\n height: \"var(--height)\",\n transitionProperty: \"left, top, width, height, background-color, border-color\",\n transitionDuration: \"var(--indicator-duration)\",\n transitionTimingFunction: \"var(--ease-emphasized)\",\n }}\n {...props({ \"data-color\": selected?.color ?? color })}\n className={cn(segIndicator({ variant }), classNames?.indicator)}\n />\n {normalized.map((item) => (\n <Ark.Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n data-testid={item.testId}\n className={cn(segItemWrap(), classNames?.item)}\n >\n <Ark.ItemText\n data-color={item.color}\n className={cn(segItem({ size, variant }), classNames?.itemText)}\n >\n {/* `renderItem` owns the label content (with the item's typed payload);\n the ItemText keeps its sizing, checked color, and pill wiring. */}\n {renderItem ? (\n <Ark.ItemContext>\n {(ctx) =>\n renderItem(item as unknown as RenderableSegment<Data>, {\n checked: ctx.checked,\n disabled: ctx.disabled,\n })\n }\n </Ark.ItemContext>\n ) : (\n item.label\n )}\n </Ark.ItemText>\n <Ark.ItemControl />\n <Ark.ItemHiddenInput />\n </Ark.Item>\n ))}\n </SegmentGroupRoot>\n </FieldShell>\n )\n}\n"]}
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KAAuB;AACzC,EAAA,IAAI,SAAS,MAAA,KAAW,MAAA,yBAAkB,GAAA,CAAC,QAAA,EAAA,EAAU,GAAG,QAAA,EAAU,CAAA;AAClE,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA;AAAA,IACA,MAAA,EAAQ,OAAA;AAAA,IACR,YAAA,EAAc,aAAA;AAAA,IACd,GAAG;AAAA,GACL,GAAI,QAAA;AACJ,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA,CAAI,GAAA;AAAA,IAAJ;AAAA,MACC,YAAA,EAAY,KAAA;AAAA,MACX,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,GAAG,WAAA,CAAY,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS;AAAA;AAAA,GACzD;AAEJ","file":"chunk-DT6LKNZF.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ReactElement } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { hotkeyCaps, type KbdTranslations, useApplePlatform } from \"../../lib/use-hotkey\"\n\n/**\n * Kbd — a keyboard-key / shortcut indicator (`<kbd>`).\n *\n * A client component only for `hotkey`, whose keys depend on the platform\n * (`[⌘] [K]` vs `[Ctrl] [K]`). It borrows Button's (variant × color) system so\n * a shortcut hint speaks the same accent language as the action it labels — but\n * unlike Button it is non-interactive: no hover treatment, no click handling,\n * just a key cap.\n *\n * The shape axis is the exact set Button exposes (filled / light / outline /\n * subtle / default), wired through the same `--c-*` slot vars — `color` routes\n * via a `data-color` attribute resolved in `colors.css`, so the cva matrix\n * enumerates variants only, never (variant × color) pairs. The default\n * treatment is the `default` variant: a neutral, bordered key-cap surface that\n * reads as a physical key regardless of `color` (pairing `default` with a color\n * is a no-op, mirroring Button/Badge).\n *\n * Sizing keeps single-character keys square via a per-size `min-w` equal to the\n * height, while wider labels (`Enter`, `Esc`, `⌘N`) grow horizontally. Padding\n * is symmetric, so a key reads the same in RTL.\n *\n * `asChild` (from `HTMLArkProps`) renders the single child as the root with\n * Kbd's styling merged in — e.g. `<Kbd asChild><a href=\"…\">⌘K</a></Kbd>`. The\n * kit's focus ring (`focusStyles`) comes along with it, so a Kbd composed onto\n * a real control is keyboard-visible without the caller restyling anything; on\n * a plain `<kbd>` those classes never match.\n *\n * `hotkey` draws a key combination the way the HTML spec marks one up: an\n * outer `<kbd>` for the whole combination holding one inner `<kbd>` per key,\n * with no `+` between them. The outer one is an unstyled inline-flex row;\n * each key is a full cap (`variant` / `size` / `color` apply to every cap),\n * so `\"mod+k\"` is two square caps. The rest of the props (`className`,\n * `testId`, `asChild`, `aria-*`, …) land on the outer `<kbd>`, which is the\n * element a layout positions; `color` is set there too and every cap reads\n * its slot vars from it. The words the caps show and speak (\"Ctrl\", \"Esc\",\n * \"Command\", \"Up Arrow\") are English unless `translations` replaces them, per\n * key (`KbdTranslations`); `formatHotkey` takes the same object.\n */\nconst kbdVariants = cva(\n [\n \"inline-flex items-center justify-center gap-1\",\n \"whitespace-nowrap select-none\",\n // Regular weight, not medium: the mono face (Kode Mono) has no ⌘ ⇧ ⌥ ↵\n // glyphs, so they fall back to a system font — and a 500 weight makes that\n // fallback resolve to its *bold* face (Menlo Bold), a heavy blot next to\n // the regular letters around it.\n \"font-mono font-normal leading-none\",\n \"rounded-md border border-transparent\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n // A 1.5px stroke at every size: the icon is sized by CSS, so a stroke in\n // viewBox units would thin out at `size-3`. `non-scaling-stroke` keeps it in\n // screen pixels (lucide's `absoluteStrokeWidth` ignores CSS sizing).\n \"[&_svg]:stroke-[1.5] [&_svg_*]:[vector-effect:non-scaling-stroke]\",\n // A lone icon is narrower than the cap is tall, but the side padding\n // would push it past `min-w`: drop the padding so the cap stays square.\n \"has-[>svg:only-child]:px-0\",\n // Inert on the default non-focusable <kbd>; applies once `asChild`\n // renders Kbd onto a real <button>/<a>. See `focusStyles`.\n focusStyles(),\n ],\n {\n variants: {\n variant: {\n filled: \"bg-(--c-solid) text-(--c-on-solid)\",\n light: \"bg-(--c-soft) text-(--c-text)\",\n outline: \"bg-transparent text-(--c-text) border-(--c-solid)\",\n subtle: \"bg-transparent text-(--c-text)\",\n // The key cap sits on the kit's translucent surface recipe — a 3%/4%\n // overlay plus the hairline `border-brand-900/20 dark:border-white/15`,\n // the same pair `Input`'s default shell, `Card`, `Tabs` and\n // `ChoiceCardGroup` use. An opaque gray step can only ever be right on\n // the one background it was picked against, and a `Kbd` is most often\n // inlined into a Button, a Menu row or a tinted panel. Light mode\n // darkens (`bg-black/3`) because `bg-white/4` on a near-white page is\n // invisible; dark mode lightens. A 1px inset shade along the bottom\n // edge is the key-cap depth cue — the lip of a physical key — without\n // adding height. The label is the kit's secondary text, not full\n // contrast: a shortcut hint annotates the action, it is not the action.\n default: [\n \"bg-black/3 text-brand-900/70 border-brand-900/20\",\n \"shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.08)]\",\n \"dark:bg-white/4 dark:text-white/80 dark:border-white/15\",\n \"dark:shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.35)]\",\n ],\n },\n // Type is one Tailwind step per size (12 / 14 / 16px), the scale of\n // the text a key sits beside — a 10px label left ⌘ and ↵ unreadable.\n //\n // A single character must fit `min-w` (= height) to stay square. Kode\n // Mono advances 0.6em per glyph, so glyph + 2 × padding + 2 × 1px border:\n // sm: 7.2 + 2 × 5 + 2 = 19.2 ≤ 20 (px-1.5 gave 21.2: one px too wide)\n // md: 8.4 + 2 × 6 + 2 = 22.4 ≤ 24\n // lg: 9.6 + 2 × 8 + 2 = 27.6 ≤ 28\n // Re-check these sums after a font, type step or padding change.\n size: {\n sm: \"h-5 min-w-5 px-1.25 text-xs [&_svg]:size-3\",\n md: \"h-6 min-w-6 px-1.5 text-sm [&_svg]:size-3.5\",\n lg: \"h-7 min-w-7 px-2 text-base [&_svg]:size-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n)\n\nexport type KbdVariant = NonNullable<VariantProps<typeof kbdVariants>[\"variant\"]>\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>[\"size\"]>\n\n/** The outer `<kbd>` of a `hotkey` combination: a row of caps, unstyled itself.\n * `align-middle` sits it on the text it annotates the way a lone cap does. */\nconst kbdGroup = \"inline-flex items-center gap-0.5 align-middle\"\n\n/** With `hotkey`: the key words, merged per key onto `KBD_DEFAULT_TRANSLATIONS`. */\ntype KbdHotkeyTranslations = {\n /** The words the caps read as and are spoken by, merged per key onto the English\n * `KBD_DEFAULT_TRANSLATIONS`: `{ ctrl: \"Strg\", enter: \"Eingabe\" }`. Pass the same\n * object to `formatHotkey` / `hotkeyKeys` so plain text reads the same. */\n translations?: Partial<KbdTranslations>\n}\n\ntype KbdHotkeyProps =\n | { hotkey?: undefined; translations?: undefined }\n | (KbdHotkeyTranslations & {\n /** A `useHotkey` string to draw, one cap per key, the way the visitor's\n * platform writes it: `\"mod+k\"` is `[⌘] [K]` on Apple platforms and\n * `[Ctrl] [K]` elsewhere (see `hotkeyKeys`). A key with an icon (Shift,\n * Enter, Tab, the arrows, and ⌘ ⌥ ⌃ ⌫ on Apple) is drawn as one, with a\n * spoken name; Ctrl, Alt, Esc, Space (and Backspace off Apple) stay\n * words. Server-rendered as the non-Apple caps, then corrected on\n * hydration. The caps are the content, so it takes no children. */\n hotkey: string\n asChild?: false\n children?: never\n })\n | (KbdHotkeyTranslations & {\n hotkey: string\n /** With `hotkey`: the single child becomes the outer `<kbd>` of the\n * combination, the caps rendered inside it. */\n asChild: true\n children: ReactElement\n })\n\nexport type KbdProps = HTMLArkProps<\"kbd\"> &\n VariantProps<typeof kbdVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n } & KbdHotkeyProps\n\ntype KbdComboProps = KbdProps & { hotkey: string }\n\n/** `<Kbd hotkey>`: the combination's outer `<kbd>`, one cap per key inside. */\nconst KbdCombo = ({\n className,\n variant,\n size,\n color,\n testId,\n hotkey,\n translations,\n asChild,\n children,\n ...rest\n}: KbdComboProps) => {\n const apple = useApplePlatform()\n const caps = hotkeyCaps(hotkey, apple, translations).map(({ id, label, icon: Icon, name }) => (\n // A symbol is drawn (an icon, or the glyph where there is none) and its\n // name spoken: an svg says nothing, and `⌘` alone reads inconsistently.\n // `relative` holds the absolutely positioned `sr-only` inside the cap.\n // An icon cap drops its side padding to stay square, as a lone icon does\n // (the `sr-only` name beside the svg keeps `:only-child` from matching).\n <kbd\n key={id}\n className={cn(kbdVariants({ variant, size }), name && \"relative\", Icon && \"px-0\")}\n >\n {name ? (\n <>\n {Icon ? <Icon aria-hidden /> : <span aria-hidden>{label}</span>}\n <span className=\"sr-only\">{name}</span>\n </>\n ) : (\n label\n )}\n </kbd>\n ))\n return (\n <ark.kbd\n // A combination reads left to right in either direction, like the\n // single string it replaces.\n dir=\"ltr\"\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n asChild={asChild}\n className={cn(kbdGroup, className)}\n >\n {composeChildren(asChild, children, () => caps)}\n </ark.kbd>\n )\n}\n\nexport const Kbd = (allProps: KbdProps) => {\n if (allProps.hotkey !== undefined) return <KbdCombo {...allProps} />\n const {\n className,\n variant,\n size,\n color,\n testId,\n hotkey: _hotkey,\n translations: _translations,\n ...rest\n } = allProps\n return (\n <ark.kbd\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(kbdVariants({ variant, size }), className)}\n />\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/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IAEJ,QAAA,EAAA;AAAA,sBAAA,IAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAkB,IAAA,EAAY,KAAA,EAClC,QAAA,EAAA;AAAA,wBAAAC,IAAC,SAAA,EAAA,EAAU,CAAA;AAAA,QACV,IAAA,CAAK,GAAA,CAAI,CAAC,IAAA,qBACTA,GAAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YAEC,OAAO,IAAA,CAAK,KAAA;AAAA,YACZ,UAAU,IAAA,CAAK,QAAA;AAAA,YACf,OAAO,IAAA,CAAK,KAAA;AAAA,YACZ,MAAA,EAAQ,IAAA,CAAK,MAAA,IAAU,CAAA,IAAA,EAAO,KAAK,KAAK,CAAA,CAAA;AAAA,YAEvC,QAAA,EAAA,IAAA,CAAK;AAAA,WAAA;AAAA,UAND,IAAA,CAAK;AAAA,SAQb;AAAA,OAAA,EACH,CAAA;AAAA,MACC,IAAA,CAAK,GAAA,CAAI,CAAC,IAAA,qBACTA,GAAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UAEC,OAAO,IAAA,CAAK,KAAA;AAAA,UACZ,QAAQ,CAAA,EAAG,IAAA,CAAK,UAAU,CAAA,IAAA,EAAO,IAAA,CAAK,KAAK,CAAA,CAAE,CAAA,MAAA,CAAA;AAAA,UAE5C,QAAA,EAAA,IAAA,CAAK;AAAA,SAAA;AAAA,QAJD,IAAA,CAAK;AAAA,OAMb;AAAA;AAAA;AACH,CAAA;AAQK,IAAM,IAAA,GAAO,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EAC/C,IAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAC","file":"chunk-E5H3YWZV.js","sourcesContent":["\"use client\"\n\nimport { Tabs as Ark, useTabsContext } from \"@ark-ui/react/tabs\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useDirectionCheck } from \"../../lib/intl\"\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\"\n\n/**\n * Tabs — a navigation control on Ark UI's Tabs machine: a row (or column) of\n * triggers, each revealing its own content panel, over a hairline baseline\n * that spans the whole list. An indicator slides to the active trigger. Two\n * classic looks:\n *\n * - `underline` (default) — a 2px bar on the baseline under the active label.\n * - `enclosed` — the active tab is a hairline box (top + sides) that opens the\n * baseline beneath it, so the tab reads as attached to its panel.\n *\n * For a segmented pill tray, use `SegmentGroup` instead: Tabs is navigation\n * between content panels, not a single-choice value, and has no `Field`\n * integration (no label/description/error/name).\n *\n * Two ways to use it:\n *\n * // 1. Data-driven — the common case\n * <Tabs\n * color=\"brand\"\n * defaultValue=\"overview\"\n * data={[\n * { value: \"overview\", label: \"Overview\", content: <Overview /> },\n * { value: \"activity\", label: \"Activity\", content: <Activity /> },\n * ]}\n * />\n *\n * // 2. Compound — for anything the data array can't express\n * <Tabs.Root defaultValue=\"overview\">\n * <Tabs.List variant=\"enclosed\" color=\"brand\">\n * <Tabs.Indicator />\n * <Tabs.Trigger value=\"overview\">Overview</Tabs.Trigger>\n * <Tabs.Trigger value=\"activity\">Activity</Tabs.Trigger>\n * </Tabs.List>\n * <Tabs.Content value=\"overview\"><Overview /></Tabs.Content>\n * <Tabs.Content value=\"activity\"><Activity /></Tabs.Content>\n * </Tabs.Root>\n *\n * `variant`, `size` and `color` all live on `List` and apply to the baseline,\n * every trigger, and the indicator — set them once on `List` rather than\n * repeating them on each `Trigger`. `color` is a `data-color` attribute, so it\n * is scoped to the strip: it deliberately does *not* sit on `Root`, which also\n * wraps every `Content` panel and would leak the palette into whatever those\n * panels render — an uncoloured `Button` inside a panel would silently adopt\n * the tab's palette (#140).\n */\n\n/** The list: a full-width row (or column) with a hairline baseline on the\n * block-end edge when horizontal and the inline-end edge when vertical\n * (logical, so it flips under RTL). No tray fill, no inset, no separators.\n *\n * `underline` paints the baseline as the list's own border, in the kit's\n * hairline recipe (`border-brand-900/20 dark:border-white/15`). `enclosed`\n * keeps the same 1px border *transparent* — the geometry is identical, but\n * the line itself is drawn by the indicator (see `tabsIndicator`), which\n * needs the list to clip it at its two ends along the main axis. `clip`\n * rather than `hidden`: it creates no scroll container, and leaves the cross\n * axis visible. */\nconst tabsList = cva(\n [\n \"relative flex\",\n \"data-[orientation=horizontal]:border-b\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:border-e\",\n ],\n {\n variants: {\n variant: {\n underline: \"border-brand-900/20 dark:border-white/15\",\n enclosed: [\n \"border-transparent\",\n \"data-[orientation=horizontal]:overflow-x-clip data-[orientation=vertical]:overflow-y-clip\",\n ],\n },\n size: {\n xs: \"gap-1\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-3\",\n xl: \"gap-4\",\n },\n },\n defaultVariants: { variant: \"underline\", size: \"md\" },\n },\n)\n\n/**\n * Each trigger. Every label sits on the page surface, never on a colored fill,\n * so there is no `--c-on-solid` branch. An unselected label is Figma's\n * `Text/text-secondary` (`TEXT_COLOR_CLASSES.secondary`), and the selected one\n * is `Text/text-primary`, or `--c-text` when the trigger or its list has a\n * `color`.\n *\n * The hover lift is scoped to unselected triggers: the selected label already\n * has its final color, and an unscoped `hover:` would tie on specificity and\n * win on source order alone, overriding `--c-text` with the neutral text.\n * Mirrors `Button`'s own `not-data-loading:hover:` scoping.\n *\n * Before the indicator is measured: Ark renders the indicator `hidden` with\n * no rect on the server, and shows it only once it has measured the selected\n * trigger on the client. Until then (`tabs-unmeasured:`, theme.css) the\n * selected trigger draws a static copy of the indicator from its own\n * pseudo-elements: the bar for `underline`; the box and the baseline around\n * it for `enclosed`, whose baseline would otherwise not exist at all. The\n * geometry is always there and only the paint is gated, and Ark unhides the\n * indicator in the same render it sets the rect, so the copy and the real\n * thing swap within one frame, in the same place and color. The indicator\n * doesn't slide in from 0,0 either: it comes out of `display: none`, which\n * starts no transition.\n */\nconst tabsTrigger = cva(\n [\n \"relative z-1 cursor-pointer text-center font-medium whitespace-nowrap select-none\",\n \"data-[orientation=vertical]:text-start\",\n TEXT_COLOR_CLASSES.secondary,\n \"not-data-selected:hover:text-brand-950 dark:not-data-selected:hover:text-white\",\n \"transition-colors\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n ],\n {\n variants: {\n variant: {\n // The trigger paints nothing of its own (the bar is the indicator's\n // border), so its radius only shapes the focus ring: the same `xs`\n // the enclosed ring follows.\n underline: [\n focusStyles(),\n \"rounded-xs\",\n // Static bar (see \"Before the indicator is measured\" above): the\n // indicator's 2px border, one pixel past the trigger's edge.\n \"after:pointer-events-none after:absolute\",\n \"data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5\",\n \"data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:-end-px data-[orientation=vertical]:after:w-0.5\",\n ],\n // The enclosed list clips along its main axis, which would cut an\n // outset ring off the first and last triggers, so the ring goes\n // inside, rounded like the indicator box it matches.\n enclosed: [\n focusStyles({ inset: true, offset: false }),\n \"data-[orientation=horizontal]:rounded-t-xs data-[orientation=vertical]:rounded-s-xs\",\n // Static box (`::after`): the indicator's rect, shifted one pixel\n // toward the baseline, open on that side.\n \"after:pointer-events-none after:absolute after:border after:border-transparent\",\n \"data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:top-px data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:border-b-0 data-[orientation=horizontal]:after:rounded-t-xs\",\n \"data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:start-px data-[orientation=vertical]:after:-end-px data-[orientation=vertical]:after:border-e-0 data-[orientation=vertical]:after:rounded-s-xs\",\n \"tabs-unmeasured:data-selected:after:border-(color:--default-border-color)\",\n // Static baseline (`::before`): a strip reaching 100vmax past both\n // ends of the trigger, painted by two backgrounds that each stop at\n // the trigger's edge, so it is open exactly under the box — the\n // indicator's two segments, in one pseudo-element. The list clips\n // it, as it clips the indicator's.\n \"before:pointer-events-none before:absolute before:bg-no-repeat\",\n \"data-[orientation=horizontal]:before:-inset-x-[100vmax] data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:h-px data-[orientation=horizontal]:before:bg-[length:100vmax_1px] data-[orientation=horizontal]:before:bg-[position:left_bottom,right_bottom]\",\n \"data-[orientation=vertical]:before:-inset-y-[100vmax] data-[orientation=vertical]:before:-end-px data-[orientation=vertical]:before:w-px data-[orientation=vertical]:before:bg-[length:1px_100vmax] data-[orientation=vertical]:before:bg-[position:top,bottom]\",\n \"tabs-unmeasured:data-selected:before:bg-[image:linear-gradient(var(--default-border-color),var(--default-border-color)),linear-gradient(var(--default-border-color),var(--default-border-color))]\",\n ],\n },\n colored: {\n true: \"data-selected:text-(--c-text)\",\n false: \"data-selected:text-brand-950 dark:data-selected:text-white\",\n },\n size: {\n xs: \"px-2 py-0.5 text-xs\",\n sm: \"px-2.5 py-1 text-sm\",\n md: \"px-3 py-1.5 text-md\",\n lg: \"px-4 py-2 text-lg\",\n xl: \"px-5 py-2.5 text-xl\",\n },\n },\n // The static bar's color, chosen once per case like the indicator's.\n // Uncolored, `currentColor` is the selected label's `Text/text-primary`,\n // the same pair the indicator's `Border/border-full` bar paints.\n compoundVariants: [\n {\n variant: \"underline\",\n colored: false,\n className: \"tabs-unmeasured:data-selected:after:bg-current\",\n },\n {\n variant: \"underline\",\n colored: true,\n className: \"tabs-unmeasured:data-selected:after:bg-(--c-solid)\",\n },\n ],\n defaultVariants: { variant: \"underline\", colored: false, size: \"md\" },\n },\n)\n\n/**\n * The sliding indicator. It always covers the active trigger's rect, shifted\n * one pixel outward so its edge lands *on* the baseline row rather than beside\n * it (down when horizontal; toward the inline end when vertical, which is the\n * left edge under RTL, hence the `ltr:`/`rtl:` pair — `translate` has no\n * logical form).\n *\n * - `underline`: the 2px bar is the box's own block-end (or inline-end)\n * border, so one rect drives both axes and logical borders handle RTL. It\n * paints `--c-solid` with a `color`, and Figma's `Border/border-full`\n * (the selected label's `Text/text-primary` pair) without one.\n * - `enclosed`: a hairline box open on the baseline side. The baseline is\n * drawn by the box itself, as two 1px segments (`::before` / `::after`)\n * running from its corners out past both ends of the list, which clips them\n * (`tabsList`). So the line is open exactly under the active tab and the gap\n * slides with it, without painting over anything: an opaque patch over a\n * list-drawn baseline would have to guess the surface color, and showed as\n * a dark hole on a translucent `Card` or a colored one. Each segment starts\n * one pixel past the box's side border so the two never overlap (the\n * hairline is translucent, and an overlap would darken the corner pixel).\n * `100vmax` is \"longer than any list\": the clip trims it.\n */\nconst tabsIndicator = cva(\n [\n \"z-0 box-border\",\n // The slide's duration, read by the inline `transition-duration` (see\n // `Indicator`); reduced motion zeroes it, so the bar jumps instead.\n \"[--indicator-duration:var(--duration-normal)] motion-reduce:[--indicator-duration:0s]\",\n // Ark measures with offsetLeft/offsetWidth, which round to whole pixels.\n // On the cross axis every trigger fills the list, so pin it to the list's\n // exact box instead: a vertical list is often a fractional width, and the\n // rounded rect pushed the baseline half a pixel off the list's edge (and\n // off the static copy the SSR HTML draws).\n \"data-[orientation=horizontal]:[--tabs-top:0px] data-[orientation=horizontal]:[--tabs-height:100%]\",\n \"data-[orientation=vertical]:[--tabs-left:0px] data-[orientation=vertical]:[--tabs-width:100%]\",\n \"data-[orientation=horizontal]:translate-y-px\",\n \"data-[orientation=vertical]:ltr:translate-x-px data-[orientation=vertical]:rtl:-translate-x-px\",\n ],\n {\n variants: {\n variant: {\n underline:\n \"data-[orientation=horizontal]:border-b-2 data-[orientation=vertical]:border-e-2\",\n enclosed: [\n \"border border-brand-900/20 dark:border-white/15\",\n \"before:absolute before:bg-brand-900/20 dark:before:bg-white/15\",\n \"after:absolute after:bg-brand-900/20 dark:after:bg-white/15\",\n \"data-[orientation=horizontal]:rounded-t-xs data-[orientation=horizontal]:border-b-0\",\n \"data-[orientation=horizontal]:before:bottom-0 data-[orientation=horizontal]:before:right-[calc(100%+1px)] data-[orientation=horizontal]:before:h-px data-[orientation=horizontal]:before:w-[100vmax]\",\n \"data-[orientation=horizontal]:after:bottom-0 data-[orientation=horizontal]:after:left-[calc(100%+1px)] data-[orientation=horizontal]:after:h-px data-[orientation=horizontal]:after:w-[100vmax]\",\n \"data-[orientation=vertical]:rounded-s-xs data-[orientation=vertical]:border-e-0\",\n \"data-[orientation=vertical]:before:end-0 data-[orientation=vertical]:before:bottom-[calc(100%+1px)] data-[orientation=vertical]:before:w-px data-[orientation=vertical]:before:h-[100vmax]\",\n \"data-[orientation=vertical]:after:end-0 data-[orientation=vertical]:after:top-[calc(100%+1px)] data-[orientation=vertical]:after:w-px data-[orientation=vertical]:after:h-[100vmax]\",\n ],\n },\n colored: { true: \"\", false: \"\" },\n },\n // The bar's color is chosen in exactly one place per case: with both a\n // neutral border color and `border-(--c-solid)` in the list,\n // tailwind-merge can't tell that a bare `border-(--var)` is a color (it\n // could be a width), keeps both, and the stylesheet's order picks one.\n compoundVariants: [\n {\n variant: \"underline\",\n colored: false,\n className: \"border-brand-950 dark:border-white\",\n },\n { variant: \"underline\", colored: true, className: \"border-(--c-solid)\" },\n ],\n defaultVariants: { variant: \"underline\", colored: false },\n },\n)\n\n/** The root. Vertical tabs put the list *beside* the panels, so the baseline\n * on the list's inline-end edge runs between the two; horizontal stays a\n * plain block, list over panel. */\nconst tabsRoot = \"data-[orientation=vertical]:flex\"\n\n/** The content panel, spaced off the baseline: below it when horizontal,\n * after it (and filling the rest of the row) when vertical. Ark makes the\n * active panel focusable (roving from its trigger), so it gets its own focus\n * ring, matching the kit-wide convention. */\nconst tabsContent = cn(\n \"rounded-xs data-[orientation=horizontal]:mt-3\",\n \"data-[orientation=vertical]:ms-4 data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1\",\n focusStyles(),\n)\n\nexport type TabsVariant = NonNullable<VariantProps<typeof tabsList>[\"variant\"]>\n\n/** Shared strip configuration, set once on `List` and read by `Trigger` and\n * `Indicator` so callers don't repeat `variant` / `size` on every trigger.\n *\n * `color` is *this* list's own palette, never an ancestor's: an ancestor's\n * `data-color` (a colored `Card` around the tabs) must not turn the selected\n * label and the bar into that palette, so \"is it colored\" can't be a\n * `[data-color]` selector — it is whether a `color` was passed here or on\n * the trigger.\n *\n * `colors` maps each trigger's value to its own `color`, for the triggers\n * that set one. `Indicator` reads it to paint itself in the selected tab's\n * palette. Triggers write it through `setTriggerColor` from an effect, so\n * the map is empty during SSR and the first client render; that is\n * harmless, because Ark keeps the indicator `hidden` until it has measured\n * the selected trigger, which also happens in an effect, after the\n * triggers' own (children's effects run first). */\ntype TabsStyle = {\n variant: TabsVariant\n size: Size\n color: Color | undefined\n colors: Readonly<Record<string, Color>>\n setTriggerColor: (value: string, color: Color | undefined) => void\n}\n\nconst TabsStyleContext = createContext<TabsStyle>({\n variant: \"underline\",\n size: \"md\",\n color: undefined,\n colors: {},\n setTriggerColor: () => {},\n})\n\n/** `color` is deliberately omitted, not merely absent: React's `HTMLAttributes`\n * carries a legacy `color?: string`, so without the `Omit` a stale\n * `<Tabs.Root color=\"brand\">` would still compile and fall through `...rest`\n * onto the div as the deprecated HTML attribute — silently losing the palette.\n * Omitting it turns every such call site into a compile error pointing at the\n * line to change. Same convention as `Button` / `ActionIcon` (code-style.md). */\nexport type TabsRootProps = Omit<Ark.RootProps, \"color\"> & WithTestId\n\nconst Root = ({ orientation = \"horizontal\", className, testId, ...rest }: TabsRootProps) => {\n const checkDirection = useDirectionCheck()\n return (\n // `key={orientation}` remounts on an axis flip so Ark re-measures the\n // indicator rect for the new layout (it only measures on mount + value\n // change, mirroring the same limitation `SegmentGroup` works around) — at\n // the cost of resetting an *uncontrolled* value on that flip. Pass a\n // controlled `value` if the orientation can change at runtime and the\n // selection must survive it.\n <Ark.Root\n key={orientation}\n orientation={orientation}\n ref={checkDirection}\n className={cn(tabsRoot, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type TabsListProps = Omit<Ark.ListProps, \"color\"> &\n WithTestId & {\n variant?: TabsVariant\n size?: Size\n /** Palette for the underline bar + active-trigger text. Sets `data-color`\n * on the list, so the `--c-*` slots reach the triggers and the indicator\n * without reaching the `Content` panels. */\n color?: Color\n }\n\nconst List = ({\n variant = \"underline\",\n size = \"md\",\n color,\n className,\n testId,\n ...rest\n}: TabsListProps) => {\n const [colors, setColors] = useState<Readonly<Record<string, Color>>>({})\n const setTriggerColor = useCallback((value: string, triggerColor: Color | undefined) => {\n setColors((prev) => {\n if (prev[value] === triggerColor) return prev\n const { [value]: _dropped, ...others } = prev\n return triggerColor === undefined ? others : { ...others, [value]: triggerColor }\n })\n }, [])\n const style = useMemo(\n () => ({ variant, size, color, colors, setTriggerColor }),\n [variant, size, color, colors, setTriggerColor],\n )\n return (\n <TabsStyleContext.Provider value={style}>\n <Ark.List\n className={cn(tabsList({ variant, size }), className)}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n </TabsStyleContext.Provider>\n )\n}\n\n/** `color` is omitted from Ark's props for the same reason as on `Root`\n * (React's legacy HTML `color?: string`) and re-added as the kit's palette. */\nexport type TabsTriggerProps = Omit<Ark.TriggerProps, \"color\"> &\n WithTestId & {\n /** This tab's own palette for its selected label and, while it is\n * selected, the indicator. Beats `List`'s `color`. Sets `data-color` on\n * the trigger only, so it never reaches the panels. */\n color?: Color\n }\n\nconst Trigger = ({ color, className, testId, ...rest }: TabsTriggerProps) => {\n const { variant, size, color: listColor, setTriggerColor } = useContext(TabsStyleContext)\n const { value } = rest\n useEffect(() => {\n setTriggerColor(value, color)\n return () => setTriggerColor(value, undefined)\n }, [value, color, setTriggerColor])\n return (\n <Ark.Trigger\n className={cn(\n tabsTrigger({ variant, size, colored: (color ?? listColor) !== undefined }),\n className,\n )}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type TabsContentProps = Ark.ContentProps & WithTestId\n\nconst Content = ({ className, testId, ...rest }: TabsContentProps) => (\n <Ark.Content\n className={cn(tabsContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type TabsIndicatorProps = Ark.IndicatorProps & WithTestId\n\n/** The sliding indicator. Ark sets `position: absolute` + `--left`/`--top`/\n * `--width`/`--height` (the selected trigger's rect) inline, so it sits\n * behind the labels (`z-0`). Ark only places the main axis (`left` when\n * horizontal, `top` when vertical) and leaves the other at its static\n * position; we pin both, because the box must line up with the trigger's\n * edge on the baseline side, not wherever the flow happens to put it.\n *\n * We drive the slide transition ourselves rather than via Ark's gated\n * `animateIndicator` flag — the same fix `SegmentGroup` uses: Ark sets\n * `transition-property: none` whenever that flag is false, including the\n * instant it receives the `transitionend` of ANY animated property. With\n * several properties of differing end-times (a `left` redirected by an\n * interrupting click vs. a color/width that already settled), that early end\n * would null the transition and snap the indicator mid-slide. Overriding the real\n * `transition-*` props (our `style` wins via Ark's `mergeProps`) keeps the\n * transition always on, so interruptions re-target smoothly.\n *\n * The duration is read from `--indicator-duration` rather than written inline,\n * so the `motion-reduce:` class on `tabsIndicator` can zero it: an inline value\n * would beat any class, and the slide would play under reduced motion. */\nconst Indicator = ({ className, style, testId, ...rest }: TabsIndicatorProps) => {\n const { variant, color: listColor, colors } = useContext(TabsStyleContext)\n const { value } = useTabsContext()\n // The selected tab's own color, else the list's. Set as the indicator's own\n // `data-color` so its `--c-*` slots switch with the selection, and the\n // `border-color` transition below cross-fades the bar as it slides.\n const color = (value ? colors[value] : undefined) ?? listColor\n return (\n <Ark.Indicator\n data-color={color}\n style={{\n left: \"var(--tabs-left, var(--left))\",\n top: \"var(--tabs-top, var(--top))\",\n width: \"var(--tabs-width, var(--width))\",\n height: \"var(--tabs-height, var(--height))\",\n transitionProperty: \"left, top, width, height, background-color, border-color\",\n transitionDuration: \"var(--indicator-duration)\",\n transitionTimingFunction: \"var(--ease-emphasized)\",\n ...style,\n }}\n className={cn(tabsIndicator({ variant, colored: color !== undefined }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport { Content, Indicator, List, Root, Trigger }\nexport const Context = Ark.Context\n","\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport type { Color } from \"../../lib/colors\"\nimport type { Size } from \"../../lib/sizes\"\nimport {\n Content,\n Context,\n Indicator,\n List,\n Root,\n type TabsRootProps,\n type TabsVariant,\n Trigger,\n} from \"./tabs\"\n\n/**\n * Data-driven Tabs — the convenience wrapper over the composable parts, for\n * the common case of a flat list of label + panel pairs:\n *\n * <Tabs\n * data={[\n * { value: \"overview\", label: \"Overview\", content: <Overview /> },\n * { value: \"activity\", label: \"Activity\", content: <Activity /> },\n * ]}\n * />\n *\n * Generic over `const data`, so an item's `value` narrows `onChange`. The\n * first item is selected by default when neither `value` nor `defaultValue`\n * is given — the low-level `Root` part has no `data` to default from, so this\n * only happens here. Drop to `Tabs.Root` / `Tabs.List` / `Tabs.Trigger` /\n * `Tabs.Content` for anything the flat array can't express (custom trigger\n * content, interleaved non-tab elements, …).\n */\n\n/** One tab: a trigger label and its panel content. */\nexport type TabsItem = {\n value: string\n label: ReactNode\n content: ReactNode\n disabled?: boolean\n /** This tab's own palette: its selected label, and the underline bar while\n * it is selected. Beats the `color` prop. */\n color?: Color\n /** `data-testid` on the trigger; the matching content panel gets\n * `` `${testId}-panel` ``. Defaults to `` `tab-${value}` `` / `` `tab-${value}-panel` ``\n * when omitted. Ark's own `data-value={value}` is also always present on the\n * trigger as a complementary, zero-config selector. */\n testId?: string\n}\n\n/** The `data` array `Tabs` is generic over. */\nexport type TabsData = ReadonlyArray<TabsItem>\n\n/** Extract the value-string union from a `TabsData` shape, for a typed `onChange`. */\nexport type TabsValue<Data extends TabsData> = Data[number][\"value\"]\n\nexport type TabsProps<Data extends TabsData = TabsData> = Omit<\n TabsRootProps,\n \"children\" | \"onValueChange\" | \"onChange\" | \"asChild\"\n> &\n ForbidAsChild & {\n /** Tabs, in order. Each needs its own `content`. */\n data: Data\n /** `underline` (default): a bar under the active tab. `enclosed`: the\n * active tab is a box attached to its panel. */\n variant?: TabsVariant\n /** Trigger size. */\n size?: Size\n /** Palette for the underline bar + active-trigger text. Scoped to the\n * strip (it lands on the `List`), so it never tints the panel content. */\n color?: Color\n /** Fires with the selected value (narrowed to the data value union). */\n onChange?: (value: TabsValue<Data>) => void\n }\n\nconst TabsComponent = <const Data extends TabsData>({\n data,\n variant,\n size,\n color,\n value,\n defaultValue,\n onChange,\n asChild: _asChild,\n ...root\n}: TabsProps<Data>) => (\n <Root\n value={value}\n defaultValue={defaultValue ?? data[0]?.value}\n onValueChange={onChange ? (d) => onChange(d.value as TabsValue<Data>) : undefined}\n {...root}\n >\n <List variant={variant} size={size} color={color}>\n <Indicator />\n {data.map((item) => (\n <Trigger\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n color={item.color}\n testId={item.testId ?? `tab-${item.value}`}\n >\n {item.label}\n </Trigger>\n ))}\n </List>\n {data.map((item) => (\n <Content\n key={item.value}\n value={item.value}\n testId={`${item.testId ?? `tab-${item.value}`}-panel`}\n >\n {item.content}\n </Content>\n ))}\n </Root>\n)\n\n/**\n * The public `Tabs` export — callable for the data-driven form, with the\n * composable parts attached (like `Menu`). `<Tabs data={…}>` and\n * `<Tabs.Root>…</Tabs.Root>` both work from one import.\n */\nexport const Tabs = Object.assign(TabsComponent, {\n Root,\n List,\n Trigger,\n Content,\n Indicator,\n Context,\n})\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/badge/badge.tsx"],"names":[],"mappings":";;;;;;;;;AAsCA,IAAM,aAAA,GAAgB,GAAA;AAAA,EACpB;AAAA,IACE,0BAAA;AAAA,IACA,+BAAA;AAAA,IACA,uBAAA;AAAA,IACA,2BAAA;AAAA,IACA,8CAAA;AAAA;AAA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KAAA,EAAM,GAAI,KAAA;AAAA,MAC/E,SAAA,EAAW,EAAA;AAAA,QACT,aAAA,CAAc,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA;AAAA,QAC/B,UAAA,IAAc,QAAA,EAAU,GAAA,IAAO,kBAAA,CAAmB,SAAS,GAAG,CAAA;AAAA,QAC9D;AAAA,OACF;AAAA,MACC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-F342ZT7O.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport {\n buildGradientVars,\n GRADIENT_DIR_CLASS,\n type GradientDir,\n type GradientProps,\n} from \"../../lib/gradient\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * Badge — compact inline label for a status, a count or a tag.\n *\n * Pure React Server Component. It borrows Button's (variant × color) system so\n * a chip and an action speak the same accent language, but it is a display\n * element: no hover treatment, no click handling, and it renders a `<span>`.\n *\n * `asChild` (from `HTMLArkProps`) renders the single child as the root with\n * Badge's styling merged in, which is how a badge becomes a real control —\n * either standalone or collapsed into another component's trigger:\n *\n * ```tsx\n * <HoverCard.Trigger asChild>\n * <Badge asChild variant=\"light\" aria-label=\"12 campuses\">\n * <button type=\"button\">12</button>\n * </Badge>\n * </HoverCard.Trigger>\n * ```\n *\n * That yields one DOM node that *is* the badge, keyboard-reachable, carrying\n * the kit's focus ring (`focusStyles`) and Badge's own radius — the caller\n * supplies no `className` for any of it.\n */\nconst badgeVariants = cva(\n [\n \"inline-flex items-center\",\n \"whitespace-nowrap select-none\",\n \"font-sans font-medium\",\n \"border border-transparent\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n // Inert on the default non-focusable <span> — `:focus-visible` never\n // matches it — and lights up as soon as `asChild` renders Badge onto a\n // real <button>/<a>, which is the composition the docs recommend.\n focusStyles(),\n ],\n {\n variants: {\n variant: {\n filled: \"bg-(--c-solid) text-(--c-on-solid)\",\n // Neutral by default; a `data-color` tint overrides it. Those rules\n // compile to `&[data-color]` (specificity 0,2,0), which beats both\n // the plain and the `dark:` neutral classes below (0,1,0 — `dark:`\n // is a `:where()` variant) regardless of source order.\n //\n // Figma (node 14950-143827) tints a hued badge with its solid shade\n // at 30% and borders it with the solid shade itself. `--c-soft` is\n // the wrong base for that: it is the -50/-950 end of the scale, so\n // at any opacity it fades into the page in both themes. Neutral is\n // the exception — Figma fills it with the translucent overlay that\n // neutral's own `--c-soft` already is (white/16 dark, black/16\n // light), so it takes that slot as-is.\n light: [\n \"bg-black/8 dark:bg-white/16\",\n TEXT_COLOR_CLASSES.primary,\n \"border-black/8 dark:border-white/15\",\n \"data-color:bg-(--c-solid)/30 data-color:text-(--c-text) data-color:border-(--c-solid)\",\n \"data-[color=neutral]:bg-(--c-soft)\",\n ],\n outline: \"bg-transparent text-(--c-text) border-(--c-solid)\",\n subtle: \"bg-transparent text-(--c-text)\",\n // from-*/to-* are the CSS defaults for --tw-gradient-from/to and the\n // --tw-gradient-stops composition chain. Props only override the individual\n // vars they provide — the chain resolves them lazily without JS defaults.\n gradient:\n \"bg-origin-border bg-linear-to-r from-purple-300 to-pink-400 text-black border-white/20\",\n },\n // Figma (node 14950-143827) defines sm/md/lg; xs/xl extrapolate one\n // step past either end. Radius follows Figma on every step\n // (`rounded-badge`, 4px), as do md's height and padding. The rest of\n // the scale departs from Figma on purpose (3b408c4c), so there the\n // design catches up to the kit, not the reverse: sm is 12px text, 3px gap, 22px tall\n // (Figma 10/4/20); md has a 6px gap (4); lg is 16px text, 8px gap,\n // 8px padding (14/4/10). Icon size ([&_svg]:size-*) isn't in the\n // Figma spec — scaled by eye to each step, same convention as\n // Button's own size variant.\n size: {\n xs: \"min-h-5 px-0.5 text-[10px] leading-2.5 gap-0.5 rounded-badge [&_svg]:size-2.5\",\n sm: \"min-h-5.5 px-1 text-xs gap-0.75 rounded-badge [&_svg]:size-3\",\n md: \"min-h-6 px-1.5 text-sm gap-1.5 rounded-badge [&_svg]:size-3\",\n lg: \"min-h-7 px-2 text-md gap-2 rounded-badge [&_svg]:size-3.5\",\n xl: \"min-h-8 px-2.5 text-lg gap-3.5 rounded-badge [&_svg]:size-4\",\n },\n },\n defaultVariants: {\n variant: \"light\",\n size: \"md\",\n },\n },\n)\n\nexport type BadgeVariant = NonNullable<VariantProps<typeof badgeVariants>[\"variant\"]>\nexport type BadgeSize = NonNullable<VariantProps<typeof badgeVariants>[\"size\"]>\n\nexport type { GradientDir, GradientProps }\n\nexport type BadgeProps = Omit<HTMLArkProps<\"span\">, \"color\"> &\n VariantProps<typeof badgeVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /**\n * Gradient config. Only applied when `variant=\"gradient\"`.\n * Mirrors Tailwind's from-* / to-* / via-* utilities: sets the individual\n * CSS vars so the existing --tw-gradient-stops chain picks them up.\n * Unset fields fall back to the CVA defaults (purple-300 → pink-400, to-r).\n */\n gradient?: GradientProps\n }\n\nexport const Badge = ({\n className,\n variant,\n size,\n color,\n gradient,\n style,\n testId,\n ...rest\n}: BadgeProps) => {\n const isGradient = variant === \"gradient\"\n\n return (\n <ark.span\n data-color={!isGradient ? color : undefined}\n style={isGradient && gradient ? { ...buildGradientVars(gradient), ...style } : style}\n className={cn(\n badgeVariants({ variant, size }),\n isGradient && gradient?.dir && GRADIENT_DIR_CLASS[gradient.dir],\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/nav-link/nav-link.tsx","../src/components/nav-link/navigation.tsx"],"names":["props","jsx"],"mappings":";;;;;;;;;;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AAA,EAAe,YAAY,CAAC,CAAA,EAClF,CAAA;AAEJ;AAIO,SAAS,WAAWD,MAAAA,EAAmC;AAC5D,EAAA,uBAAOC,GAAAA,CAAC,cAAA,EAAA,EAAgB,GAAGD,MAAAA,EAAO,CAAA;AACpC","file":"chunk-HRNWWL3Y.js","sourcesContent":["\"use client\"\n\nimport { cva } from \"class-variance-authority\"\nimport { type ElementType, type ReactNode, useId } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useLinkComponent } from \"../../lib/link-component\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Collapse } from \"../collapse/collapse\"\nimport { ChevronIcon } from \"../popover/icons\"\n\n/**\n * NavLink — a single sidebar/nav row: leading `startSlot`, `label`, trailing\n * `endSlot`, current-page treatment, and self-nesting via `children` for\n * arbitrary-depth sub-navigation (each nested `<NavLink>` renders indented,\n * revealed with `Collapse` when the parent is `open`).\n *\n * Router-agnostic: pass whatever the target link needs as `linkOptions` (a\n * plain `{ href }` for a bare `<a>`, or a framework router's own shape, e.g.\n * TanStack Router's `{ to, params }`) — it's spread verbatim onto whatever\n * renders the link. `linkComponent` picks what that is; if omitted, it falls\n * back to the app-wide `<LinkComponentProvider>` (see `lib/link-component`),\n * then to a plain `<a>`. Generic over `linkOptions`'s shape so a router's own\n * type-safety utilities can validate/autocomplete it — see\n * `nav-link/tanstack.tsx` for a TanStack Router–typed wrapper built this way.\n *\n * A row with no `linkOptions` (a pure category / toggle heading) renders as a\n * `<button>` instead of a link. A row with both `linkOptions` and nested\n * children renders the link and its expand/collapse toggle as two separate\n * controls (a link nested inside a button, or vice versa, isn't valid HTML).\n *\n * A `disabled` link row drops its target: it renders a plain `<a role=\"link\"\n * aria-disabled=\"true\">` with no `href` (and so no tab stop), bypassing\n * `linkComponent` — a router's `Link` would put the `href` straight back.\n *\n * <NavLink label=\"Dashboard\" startSlot={<Home />} linkOptions={{ href: \"/dashboard\" }} />\n * <NavLink label=\"Settings\" startSlot={<Settings />} defaultOpen>\n * <NavLink label=\"Profile\" linkOptions={{ href: \"/settings/profile\" }} />\n * <NavLink label=\"Security\" linkOptions={{ href: \"/settings/security\" }} />\n * </NavLink>\n */\n\nconst navLinkRow = cva(\n [\n \"flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2.5 py-2 text-start text-sm\",\n \"outline-none transition-colors\",\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n focusStyles(),\n \"aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n ],\n {\n variants: {\n current: {\n true: \"bg-black/5 font-medium text-brand-950 dark:bg-white/8 dark:text-white\",\n false: TEXT_COLOR_CLASSES.secondary,\n },\n },\n defaultVariants: { current: false },\n },\n)\n\nconst chevronButton = cn(\n \"flex shrink-0 cursor-pointer items-center justify-center rounded-md p-2 text-black/50 transition-colors\",\n \"hover:bg-black/5 dark:text-white/50 dark:hover:bg-white/8\",\n focusStyles(),\n)\n\nconst chevron = (open: boolean) => (\n <span\n aria-hidden=\"true\"\n data-state={open ? \"open\" : \"closed\"}\n className=\"ms-auto flex shrink-0 transition-transform data-[state=open]:rotate-180 [&_svg]:size-4\"\n >\n <ChevronIcon />\n </span>\n)\n\nexport type NavLinkClassNames = {\n /** The link/button row itself. */\n row?: string\n /** The indented container holding nested `<NavLink>` children. */\n items?: string\n}\n\n/** The expand/collapse chevron's accessible names — the same keys as `Notification`'s. Only\n * rendered for a row that is both a link and has children (a pure toggle row is its own\n * button, named by its label). */\nexport type NavLinkTranslations = {\n /** While the children are revealed. Default `\"Collapse\"`. */\n collapseLabel?: string\n /** While the children are hidden. Default `\"Expand\"`. */\n expandLabel?: string\n}\n\nexport type NavLinkProps<TOptions = unknown> = WithTestId & {\n label: ReactNode\n /** Leading slot (icon, avatar, etc). */\n startSlot?: ReactNode\n /** Trailing slot (e.g. a count or status badge). */\n endSlot?: ReactNode\n /** Marks this as the active/current page. */\n current?: boolean\n /** Not interactive: a link row loses its `href` and tab stop, a toggle row\n * its button behaviour; both keep `aria-disabled` so they're announced. */\n disabled?: boolean\n /** Whether nested `children` are revealed. Uncontrolled by default. */\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** The router's own link options — e.g. `{ href: \"/x\" }` for a plain `<a>`,\n * or `{ to: \"/x\", params: {...} }` for TanStack Router. Omit for a pure\n * category/toggle row with no link of its own. */\n linkOptions?: TOptions\n /** Overrides the `<LinkComponentProvider>` for this row only. */\n linkComponent?: ElementType\n classNames?: NavLinkClassNames\n className?: string\n /** Overrides the expand/collapse chevron's accessible names. A partial override keeps the\n * other default. */\n translations?: NavLinkTranslations\n /** Nested `<NavLink>` elements, revealed when `open`. */\n children?: ReactNode\n}\n\nfunction NavLinkImpl({\n label,\n startSlot,\n endSlot,\n current,\n disabled,\n open,\n defaultOpen,\n onOpenChange,\n linkOptions,\n linkComponent,\n classNames,\n className,\n translations,\n children,\n testId,\n}: NavLinkProps) {\n const [isOpen, setOpen] = useUncontrolled<boolean>({\n value: open,\n defaultValue: defaultOpen,\n finalValue: false,\n onChange: onOpenChange,\n })\n const hasChildren = children != null\n const isLink = linkOptions != null\n const Comp = useLinkComponent(linkComponent) ?? \"a\"\n const itemsId = `nav-link-items-${useId()}`\n\n const content = (\n <>\n {startSlot}\n <span className=\"min-w-0 flex-1 truncate\">{label}</span>\n {endSlot}\n </>\n )\n\n const rowClassName = cn(navLinkRow({ current }), classNames?.row, className)\n const rowState = props({\n \"aria-current\": current && \"page\",\n \"aria-disabled\": disabled,\n \"data-testid\": testId,\n })\n\n return (\n <div>\n <div className=\"flex items-stretch gap-1\">\n {isLink && disabled ? (\n // No `href`, so no tab stop and nothing for Enter to follow; the\n // explicit role keeps it announced as a (disabled) link.\n <a role=\"link\" {...rowState} className={rowClassName}>\n {content}\n </a>\n ) : isLink ? (\n <Comp {...linkOptions} {...rowState} className={rowClassName}>\n {content}\n </Comp>\n ) : (\n <button\n type=\"button\"\n {...rowState}\n aria-expanded={hasChildren ? isOpen : undefined}\n {...props({ \"aria-controls\": hasChildren && itemsId })}\n disabled={disabled}\n onClick={() => hasChildren && setOpen(!isOpen)}\n className={rowClassName}\n >\n {content}\n {hasChildren && chevron(isOpen)}\n </button>\n )}\n {hasChildren && isLink && (\n <button\n type=\"button\"\n aria-expanded={isOpen}\n aria-controls={itemsId}\n aria-label={\n isOpen\n ? (translations?.collapseLabel ?? \"Collapse\")\n : (translations?.expandLabel ?? \"Expand\")\n }\n onClick={() => setOpen(!isOpen)}\n className={chevronButton}\n >\n {chevron(isOpen)}\n </button>\n )}\n </div>\n {hasChildren && (\n <Collapse open={isOpen}>\n <div\n id={itemsId}\n className={cn(\n \"ms-4.5 space-y-0.5 border-s border-brand-900/20 ps-2 pt-0.5 dark:border-white/15\",\n classNames?.items,\n )}\n >\n {children}\n </div>\n </Collapse>\n )}\n </div>\n )\n}\n\n/**\n * `NavLink<TOptions>` — generic so a router's own type-safety utility (e.g.\n * TanStack Router's `ValidateLinkOptions`) can validate `linkOptions` when\n * explicitly parameterized. The implementation itself stays untyped/loose\n * (the generic can't be forwarded through the JSX body); see\n * TanStack Router's own documented pattern for this exact split.\n */\nexport function NavLink<TOptions = unknown>(props: NavLinkProps<TOptions>): ReactNode\nexport function NavLink(props: NavLinkProps): ReactNode {\n return <NavLinkImpl {...props} />\n}\n","\"use client\"\n\nimport type { ElementType, ReactNode } from \"react\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { NavLink, type NavLinkClassNames, type NavLinkTranslations } from \"./nav-link\"\n\n/**\n * `Navigation` — the `data`-driven convenience wrapper over `NavLink` (same\n * relationship as `menu-data.tsx` to `menu.tsx`): pass a `data` array, get a\n * fully wired, arbitrarily-nested nav tree.\n *\n * <Navigation\n * data={[\n * { label: \"Dashboard\", startSlot: <Home />, linkOptions: { href: \"/dashboard\" } },\n * { label: \"Settings\", startSlot: <Settings />, items: [\n * { label: \"Profile\", linkOptions: { href: \"/settings/profile\" } },\n * { label: \"Security\", linkOptions: { href: \"/settings/security\" } },\n * ]},\n * ]}\n * />\n *\n * Generic over the same `TOptions` as `NavLink` — parameterize it (e.g. with\n * `TanStackLinkOptions` from `nav-link/tanstack`) to get a router's own\n * type-safety utilities validating every entry's `linkOptions`.\n *\n * Renders a real list — a `<ul>` of `<li>`, nested `<ul>`s for `items` — so a\n * screen reader announces how many entries each level holds. List styles are\n * reset, so it looks the same as composing `NavLink`s by hand.\n */\nexport type NavigationItem<TOptions = unknown> = {\n label: ReactNode\n startSlot?: ReactNode\n endSlot?: ReactNode\n current?: boolean\n disabled?: boolean\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n linkOptions?: TOptions\n classNames?: NavLinkClassNames\n /** `data-testid` on this entry's row (its link or button). */\n testId?: string\n /** Nested entries — an item with `items` renders its children indented,\n * revealed on expand/collapse. Recursive: nests to any depth. */\n items?: readonly NavigationItem<TOptions>[]\n}\n\nexport type NavigationProps<TOptions = unknown> = WithTestId & {\n /** The nav entries, in order. */\n data: readonly NavigationItem<TOptions>[]\n /** Overrides the app-wide `<LinkComponentProvider>` for every generated row. */\n linkComponent?: ElementType\n /** `NavLink`'s chevron names, forwarded to every generated row. */\n translations?: NavLinkTranslations\n}\n\n/** The `<ul>` reset: no bullets, no indent, so the list is invisible. */\nconst listClasses = \"m-0 list-none p-0\"\n\nconst renderItem = (\n item: NavigationItem,\n key: string,\n linkComponent: ElementType | undefined,\n translations: NavLinkTranslations | undefined,\n): ReactNode => (\n <li key={key}>\n <NavLink\n label={item.label}\n startSlot={item.startSlot}\n endSlot={item.endSlot}\n current={item.current}\n disabled={item.disabled}\n open={item.open}\n defaultOpen={item.defaultOpen}\n onOpenChange={item.onOpenChange}\n linkOptions={item.linkOptions}\n linkComponent={linkComponent}\n classNames={item.classNames}\n translations={translations}\n testId={item.testId}\n >\n {item.items && item.items.length > 0 ? (\n // NavLink spaces its direct children; the list is now that one child,\n // so it carries the same spacing for its own items.\n <ul className={`${listClasses} space-y-0.5`}>\n {item.items.map((child, i) =>\n renderItem(child, `${key}.${i}`, linkComponent, translations),\n )}\n </ul>\n ) : undefined}\n </NavLink>\n </li>\n)\n\nfunction NavigationImpl({ data, linkComponent, translations, testId }: NavigationProps) {\n return (\n <ul className={listClasses} {...props({ \"data-testid\": testId })}>\n {data.map((item, i) => renderItem(item, `nav-${i}`, linkComponent, translations))}\n </ul>\n )\n}\n\n/** Generic for the same reason as `NavLink` — see its doc comment. */\nexport function Navigation<TOptions = unknown>(props: NavigationProps<TOptions>): ReactNode\nexport function Navigation(props: NavigationProps): ReactNode {\n return <NavigationImpl {...props} />\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/button-group/button-group.tsx"],"names":[],"mappings":";;;;;;AA6CO,IAAM,mBAAA,GAAsB,GAAA;AAAA,EACjC;AAAA,IACE,mCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,IACA,kBAAA;AAAA,IACA,kDAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,WAAA,EAAa;AAAA,QACX,UAAA,EAAY;AAAA,UACV,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMA,oBAAA;AAAA,UACA,gIAAA;AAAA,UACA,8EAAA;AAAA,UACA,gCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMA,4FAAA;AAAA,UACA,2FAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKA;AAAA,SACF;AAAA,QACA,QAAA,EAAU;AAAA,UACR,UAAA;AAAA,UACA,8EAAA;AAAA,UACA,gCAAA;AAAA,UACA,4FAAA;AAAA,UACA,2FAAA;AAAA,UACA;AAAA;AACF;AACF,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,WAAA,EAAa,YAAA;AAAa;AAEjD;AAUO,IAAM,WAAA,GAAc,CAAC,EAAE,SAAA,EAAW,aAAa,MAAA,EAAQ,GAAG,MAAK,qBACpE,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IACC,IAAA,EAAK,OAAA;AAAA,IACL,oBAAkB,WAAA,IAAe,YAAA;AAAA,IACjC,WAAW,EAAA,CAAG,mBAAA,CAAoB,EAAE,WAAA,EAAa,GAAG,SAAS,CAAA;AAAA,IAC5D,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN","file":"chunk-MW42XVPD.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * ButtonGroup — joins a row (or column) of `Button` / `ActionIcon` siblings into\n * a single segmented control: the inner corners are flattened and adjacent\n * borders collapse to one hairline, so the children read as one unit (toolbars,\n * split actions, view switchers).\n *\n * Pure layout wrapper — a React Server Component like `Flex`. It deliberately\n * does NOT touch its children's props: give every child the same `size` (and\n * usually the same `variant` / `color`) so their edges align. `asChild` is\n * inherited from the `ark.div` factory.\n *\n * The join is done with arbitrary-variant selectors that target the children by\n * position *from the group itself*, rather than mutating each child's own\n * classes:\n * - They carry higher specificity than the child's own `rounded-*`, so they\n * win regardless of source order — and they sidestep the fact that plain\n * `tailwind-merge` doesn't recognise the custom `rounded-button` /\n * `rounded-action-icon` utilities (the overriding class never lands on the\n * child, so there's nothing to (fail to) merge).\n * - Only the inner corners are flattened; the outer corners keep whatever\n * radius each child already uses, so retheming still flows through.\n *\n * Adjacent borders overlap by 1px (`-ms-px` / `-mt-px`) into a single hairline\n * for the bordered `outline` / `light` / `default` variants. The borderless\n * `filled` / `subtle` variants (which have `border-transparent`, so there's\n * nothing to collapse) instead get an adaptive divider on both shared inner\n * edges: a translucent `currentColor` line, targeted via each child's\n * `data-variant`. Because it follows the text color it reads as a soft light\n * seam on a `filled` fill and a faint neutral one on `subtle`, correct on every\n * palette and in dark mode. It lives on both edges — not one — so both\n * neighbours carry the shared seam and it stays symmetric regardless of which\n * child is on top. `isolate` + a per-child `z-10` lift the hovered / focused\n * child above its neighbours, so its border (all four sides) and focus ring paint\n * over the shared edges rather than being covered by the neighbour that owns them.\n *\n * `orientation=\"horizontal\"` (default) flattens the inline edges — logical\n * `rounded-s` / `rounded-e` + `-ms`, so it flips correctly under RTL — while\n * `\"vertical\"` flattens the block edges.\n */\nexport const buttonGroupVariants = cva(\n [\n \"inline-flex isolate items-stretch\",\n // Overlapped borders stack in DOM order; lift the active child on hover and\n // focus so its own border (all four sides) and its focus ring paint above its\n // neighbours. Without the lift the shared edge stays owned by the neighbour on\n // top, so a hover/focus border change wouldn't show on that side. The\n // double-sided seam keeps the divider symmetric regardless of which is on top.\n \"*:relative\",\n \"[&>*:hover]:z-10\",\n \"[&>*:focus-visible]:z-10 [&>*:focus-within]:z-10\",\n // Border changes are instant inside a group. Button/ActionIcon animate\n // border-color (via `transition-colors-radius`), but `z-index` can't\n // transition — so on hover-out the lifted child snaps back while its border\n // is still mid-fade, flashing the shared seams. Keep the bg/text fade, drop\n // the border(-radius) transition. Targets the children via their data-variant.\n \"*:data-variant:[transition-property:color,background-color]\",\n ],\n {\n variants: {\n orientation: {\n horizontal: [\n \"flex-row\",\n // Equalize row heights to the tallest child. Buttons size themselves with\n // a fixed `h-*` (no vertical padding), which flexbox won't stretch — so\n // drop it (`h-auto`) and restore the size as a `min-height` floor keyed off\n // `data-size`, letting `items-stretch` grow shorter buttons to the tallest.\n // Same-size rows are unchanged; ActionIcon keeps its fixed square height.\n \"*:data-size:h-auto\",\n \"*:data-[size=xs]:min-h-7 *:data-[size=sm]:min-h-8 *:data-[size=md]:min-h-9 *:data-[size=lg]:min-h-10 *:data-[size=xl]:min-h-12\",\n \"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none\",\n \"[&>*:not(:first-child)]:-ms-px\",\n // Borderless variants have no border to collapse — draw an adaptive\n // currentColor seam on the shared inner edges instead. It goes on BOTH\n // sides (start of non-first, end of non-last) so whichever child ends\n // up on top after the z-10 hover/focus lift still owns a border on the\n // shared edge; a one-sided seam gets covered by the lifted child's fill.\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:first-child)]:border-s-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:last-child)]:border-e-current/20\",\n // The divider lives on the inline borders; zero the (transparent) block\n // borders so it has nothing to miter against — otherwise the seam's\n // top/bottom ends render as a 1px chamfer. box-sizing:border-box keeps\n // the height, so grouped filled/subtle stay aligned with bordered ones.\n \"[&>:is([data-variant=filled],[data-variant=subtle])]:border-y-0\",\n ],\n vertical: [\n \"flex-col\",\n \"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none\",\n \"[&>*:not(:first-child)]:-mt-px\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:first-child)]:border-t-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:last-child)]:border-b-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle])]:border-x-0\",\n ],\n },\n },\n defaultVariants: { orientation: \"horizontal\" },\n },\n)\n\nexport type ButtonGroupOrientation = NonNullable<\n VariantProps<typeof buttonGroupVariants>[\"orientation\"]\n>\n\nexport type ButtonGroupProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof buttonGroupVariants> &\n WithTestId\n\nexport const ButtonGroup = ({ className, orientation, testId, ...rest }: ButtonGroupProps) => (\n <ark.div\n role=\"group\"\n data-orientation={orientation ?? \"horizontal\"}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n"]}
@@ -1 +0,0 @@
1
-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AAA,GAAI;AAAA;AACzC,CAAA;AAGK,IAAM,KAAA,GAAQ,MAAA,CAAO,MAAA,CAAO,SAAA,EAAW;AAAA,EAC5C,OAAA,EAAS,YAAA;AAAA,EACT,KAAA,EAAO,UAAA;AAAA,EACP,OAAA,EAAS,YAAA;AAAA,EACT,IAAA,EAAM,SAAA;AAAA,EACN,IAAA,EAAM,SAAA;AAAA,EACN,IAAA,EAAM,SAAA;AAAA,EACN,GAAA,EAAK,QAAA;AAAA,EACL,UAAA,EAAY,eAAA;AAAA,EACZ,IAAA,EAAM;AACR,CAAC","file":"chunk-SVKN5ZHX.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\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\"\n\n/**\n * The outermost element: a bordered, rounded surface that `overflow-hidden`\n * clips. Clipping is what keeps the rounded corners intact once the inner\n * scroll region shows a scrollbar (a scrollbar on the *rounded* element would\n * otherwise square off its corners). `flex flex-col` lets an optional\n * `Table.Toolbar` stack above the scroll region.\n *\n * `contain-layout` stops a bug that only shows up when this sits inside an\n * ancestor chain with no *definite* height (e.g. a CSS Grid track sized off\n * `min-height`, not `height` — common when a page fills the viewport via a\n * grid). Without it, a browser can size that indefinite ancestor off this\n * box's unclipped descendants' natural size — the *actual* content behind\n * an internal `overflow-auto`/`max-h-*` scroll region, not its rendered,\n * already-clipped size — inflating the whole page's scroll height in\n * proportion to row count despite this box's own height staying correct.\n * `contain: layout` declares this subtree's size as fully self-contained, so\n * an indefinite ancestor sizes off its real (bounded) box instead. Doesn't\n * affect `stickyHeader`/`stickyFooter` (governed by the nearest *scrolling*\n * ancestor, not containing-block/layout-containment rules) or the absolute-\n * positioned `.table-fade-*` overlays (already resolve against\n * `.table-scroll-frame`'s own `position: relative` in theme.css).\n */\nconst tableContainer = cn(\n \"flex w-full flex-col overflow-hidden contain-layout\",\n // Brand-derived border, matching InputBase/Popover/Modal/Drawer's shell\n // (border-brand-900/20 dark:border-white/15) rather than a neutral gray.\n \"rounded-sm border border-brand-900/20 dark:border-white/15\",\n)\n\n/**\n * All table styling rides on the container as descendant-selector classes, so\n * the part components stay dumb and `size` / `striped` / sticky can live on\n * `<Table>` (the root) without React context — keeping the whole thing a pure\n * Server Component. Every variant value is a static class string so Tailwind\n * v4's scanner keeps it.\n *\n * The `<table>` uses `border-collapse: separate` (see `TableContent`): collapsed\n * borders detach from sticky `<thead>` / `<tfoot>` while scrolling, so the\n * header/footer separators are cell borders (`thead th` bottom, `tfoot td/th`\n * top) that stay put when pinned.\n */\nconst tableVariants = cva(\n [\n // Row separators — on cells, since separate-mode ignores <tr> borders.\n \"[&_tbody_tr:not(:last-child)_td]:border-b\",\n \"[&_tbody_td]:border-brand-900/20 dark:[&_tbody_td]:border-white/15\",\n // Cells\n \"[&_td]:align-middle\",\n \"[&_th]:text-start [&_th]:align-middle [&_th]:font-medium [&_th]:text-brand-950 dark:[&_th]:text-white\",\n // Header — subtle fill + a bottom separator that survives sticky. Same\n // brand-tinted fill Popover/Modal/Drawer use for their own surface, at\n // the same /90 light /85 dark opacity recipe.\n \"[&_thead]:bg-brand-50/90 dark:[&_thead]:bg-brand-950/85\",\n \"[&_thead_th]:border-b [&_thead_th]:border-brand-900/20 dark:[&_thead_th]:border-white/15\",\n // Footer — subtle fill + a top separator that survives sticky.\n \"[&_tfoot]:bg-brand-50/90 dark:[&_tfoot]:bg-brand-950/85 [&_tfoot]:font-medium\",\n \"[&_tfoot_th]:border-t [&_tfoot_td]:border-t\",\n \"[&_tfoot_th]:border-brand-900/20 [&_tfoot_td]:border-brand-900/20 dark:[&_tfoot_th]:border-white/15 dark:[&_tfoot_td]:border-white/15\",\n // Excludes a `data-placeholder` row (an empty/error/loading state, e.g.\n // `DataTable`'s) — it has no row to hover, so it shouldn't tint like one.\n // Black/white wash, same convention as Popover/Menu/TreeSelect's own row\n // highlight — background-dependent instead of a fixed per-theme gray.\n \"[&_tbody_tr:not([data-placeholder]):hover]:bg-black/5! dark:[&_tbody_tr:not([data-placeholder]):hover]:bg-white/8! [&_tbody_tr]:transition-colors\",\n ],\n {\n variants: {\n // Cell padding + text scale, keyed to the kit's canonical `Size` scale.\n size: {\n xs: \"text-xs [&_th]:px-2 [&_td]:px-2 [&_th]:py-1 [&_td]:py-1\",\n sm: \"text-sm [&_th]:px-2.5 [&_td]:px-2.5 [&_th]:py-1.5 [&_td]:py-1.5\",\n md: \"text-sm [&_th]:px-3 [&_td]:px-3 [&_th]:py-2.5 [&_td]:py-2.5\",\n lg: \"text-base [&_th]:px-4 [&_td]:px-4 [&_th]:py-3 [&_td]:py-3\",\n xl: \"text-base [&_th]:px-4 [&_td]:px-4 [&_th]:py-4 [&_td]:py-4\",\n },\n striped: {\n true: \"[&_tbody_tr:nth-child(even)]:bg-black/3 dark:[&_tbody_tr:nth-child(even)]:bg-white/4\",\n false: \"\",\n },\n },\n defaultVariants: { size: \"md\", striped: false },\n },\n)\n\n/** Pin the whole `<thead>` to the top of the scroll region; `backdrop-blur`\n * keeps scrolled body rows legible behind the translucent header fill. */\nconst stickyHeaderClasses =\n \"[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10 [&_thead]:backdrop-blur-lg\"\n\n/** Pin the whole `<tfoot>` (e.g. a totals row) to the bottom of the scroll region. */\nconst stickyFooterClasses =\n \"[&_tfoot]:sticky [&_tfoot]:bottom-0 [&_tfoot]:z-10 [&_tfoot]:backdrop-blur-lg\"\n\n/** `Table`'s density scale — the kit's canonical `Size` (xs–xl). */\nexport type TableSize = Size\n\nexport type TableProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof tableVariants> &\n WithTestId & {\n /** Pins the header row during vertical scroll. Needs a bounded height —\n * set `max-h-*` on `Table` or `Table.Content`. */\n stickyHeader?: boolean\n /** Pins a `Table.Foot` row (e.g. totals) to the bottom during vertical\n * scroll. Same bounded-height requirement as `stickyHeader`. */\n stickyFooter?: boolean\n }\n\n/**\n * Table — a dumb, styled semantic `<table>` inside a bordered, rounded surface.\n * Pure React Server Component (no `\"use client\"`): static markup, no state, so\n * it's safe in an RSC tree and usable for static / MDX tables. Composed from\n * namespaced parts: an optional non-table header (`Table.Toolbar` +\n * `Table.Title` for a title and actions), a `Table.Content` scroll region that\n * holds the `<table>`, and the semantic parts `Table.Head` / `Table.Body` /\n * `Table.Foot` / `Table.Row` / `Table.HeaderCell` / `Table.Cell`.\n *\n * Density (`size`), `striped`, and `stickyHeader` / `stickyFooter` ride on\n * `<Table>` and style the table via descendant selectors. To pin a header or\n * footer, give the scroll region a bounded height (`max-h-*` on `Table` or\n * `Table.Content`). The rounded border is `overflow-hidden`, so the corners\n * stay intact even once a scrollbar appears. There is no `variant`×`color`\n * axis — a table retints from `:root` slot vars via CSS.\n *\n * <Table striped size=\"sm\" stickyHeader className=\"max-h-80\">\n * <Table.Toolbar>\n * <Table.Title>Users</Table.Title>\n * <Button size=\"sm\">Add</Button>\n * </Table.Toolbar>\n * <Table.Content>\n * <Table.Head>\n * <Table.Row>\n * <Table.HeaderCell>Name</Table.HeaderCell>\n * <Table.HeaderCell className=\"text-right\">Age</Table.HeaderCell>\n * </Table.Row>\n * </Table.Head>\n * <Table.Body>\n * <Table.Row>\n * <Table.Cell>Ada</Table.Cell>\n * <Table.Cell className=\"text-right\">36</Table.Cell>\n * </Table.Row>\n * </Table.Body>\n * </Table.Content>\n * </Table>\n */\nconst TableRoot = ({\n className,\n size,\n striped,\n stickyHeader,\n stickyFooter,\n testId,\n ...rest\n}: TableProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n tableContainer,\n tableVariants({ size, striped }),\n stickyHeader && stickyHeaderClasses,\n stickyFooter && stickyFooterClasses,\n className,\n )}\n />\n)\n\nexport type TableToolbarProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** Non-`<table>` header bar: a title + actions row above the scroll region,\n * separated by a bottom border. `shrink-0` so it never collapses when the\n * content scrolls. */\nconst TableToolbar = ({ className, testId, ...rest }: TableToolbarProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"flex shrink-0 items-center justify-between gap-2 border-b border-brand-900/20 px-3 ps-5 py-3 dark:border-white/15\",\n className,\n )}\n />\n)\n\nexport type TableTitleProps = HTMLArkProps<\"h3\"> & WithTestId\n\nconst TableTitle = ({ className, testId, ...rest }: TableTitleProps) => (\n <ark.h3\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\"font-semibold tracking-normal\", className)}\n />\n)\n\nexport type TableContentProps = HTMLArkProps<\"table\"> &\n WithTestId & {\n /** Style the inner `<table>` element; `className` targets the scroll region. */\n classNames?: { table?: string }\n }\n\n/** The scroll region + the `<table>`, framed so horizontal scroll affordances\n * (soft edge shadows on each side with more to scroll) can overlay it. `className`\n * bounds the scroll surface (`max-h-*` here bounds a sticky header/footer);\n * `classNames.table` styles the `<table>`. `border-separate` keeps sticky\n * header/footer borders. The `table-scroll-*` / `table-fade-*` classes are the\n * scroll-driven-animation affordance defined in theme.css. */\nconst TableContent = ({ className, classNames, testId, ...rest }: TableContentProps) => (\n <div className={cn(\"table-scroll-frame flex min-h-0 flex-1 flex-col\", className)}>\n <section\n // A scroller must be reachable by keyboard, or arrow keys can't scroll it\n // (axe `scrollable-region-focusable`). Always, not only once it overflows:\n // knowing that would take a layout read, and this part is a Server Component.\n // biome-ignore lint/a11y/noNoninteractiveTabindex: a scroll region must be reachable by keyboard\n tabIndex={0}\n // A `<section>` is a region landmark only once it has a name, and it takes the\n // table's own: name the table (`aria-labelledby` a `Table.Title`'s id) and the\n // region says the same thing. Unnamed, it stays a plain focusable scroller.\n {...props({ \"aria-labelledby\": rest[\"aria-labelledby\"], \"aria-label\": rest[\"aria-label\"] })}\n className=\"peer table-scroll-x min-h-0 w-full flex-1 overflow-auto focus-visible:outline-none\"\n >\n <ark.table\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"w-full border-separate border-spacing-0 text-start\",\n TEXT_COLOR_CLASSES.primary,\n classNames?.table,\n )}\n />\n </section>\n {/* Horizontal scroll affordance — a soft shadow on each side that still has\n content to scroll to (pure CSS, hidden where unsupported). Pinned to the\n inline edges; a gradient has no logical direction, so `rtl:-scale-x-100`\n mirrors each shadow to fade inward from its own edge. The scroll-driven\n reveal needs no flip: its timeline's progress runs from the inline start\n in either direction. */}\n <div\n aria-hidden=\"true\"\n className=\"table-fade-start pointer-events-none absolute inset-y-0 start-0 w-6 rtl:-scale-x-100\"\n />\n <div\n aria-hidden=\"true\"\n className=\"table-fade-end pointer-events-none absolute inset-y-0 end-0 w-6 rtl:-scale-x-100\"\n />\n {/* The scroller's focus ring, on an overlay that doesn't scroll: a ring on the\n scroller itself is a box-shadow under its own content, hidden by the header\n and footer fills (and by the pinned rows, which are positioned). */}\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 z-20\",\n focusStyles({ source: \"peer-focus-visible\", inset: true, offset: false }),\n )}\n />\n </div>\n)\n\nexport type TableHeadProps = HTMLArkProps<\"thead\"> & WithTestId\n\n// Parts are dumb: all styling is driven by the root's descendant selectors, so\n// they just forward a caller className (through `cn` when present).\nconst TableHead = ({ className, testId, ...rest }: TableHeadProps) => (\n <ark.thead\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableBodyProps = HTMLArkProps<\"tbody\"> & WithTestId\n\nconst TableBody = ({ className, testId, ...rest }: TableBodyProps) => (\n <ark.tbody\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableFootProps = HTMLArkProps<\"tfoot\"> & WithTestId\n\nconst TableFoot = ({ className, testId, ...rest }: TableFootProps) => (\n <ark.tfoot\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableRowProps = HTMLArkProps<\"tr\"> & WithTestId\n\nconst TableRow = ({ className, testId, ...rest }: TableRowProps) => (\n <ark.tr\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableHeaderCellProps = HTMLArkProps<\"th\"> & WithTestId\n\nconst TableHeaderCell = ({ className, scope = \"col\", testId, ...rest }: TableHeaderCellProps) => (\n <ark.th\n scope={scope}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableCellProps = HTMLArkProps<\"td\"> & WithTestId\n\nconst TableCell = ({ className, testId, ...rest }: TableCellProps) => (\n <ark.td\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport const Table = Object.assign(TableRoot, {\n Toolbar: TableToolbar,\n Title: TableTitle,\n Content: TableContent,\n Head: TableHead,\n Body: TableBody,\n Foot: TableFoot,\n Row: TableRow,\n HeaderCell: TableHeaderCell,\n Cell: TableCell,\n})\n"]}