@42-central/ui-react 0.17.1 → 0.18.1

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 (345) hide show
  1. package/biome/no-gray-color.grit +18 -0
  2. package/dist/{chunk-FD6P6PLQ.js → chunk-5JHDSVEZ.js} +3 -3
  3. package/dist/{chunk-FD6P6PLQ.js.map → chunk-5JHDSVEZ.js.map} +1 -1
  4. package/dist/{chunk-QMW7D5GU.js → chunk-5OQLFX47.js} +4 -3
  5. package/dist/chunk-5OQLFX47.js.map +1 -0
  6. package/dist/{chunk-VZ2TPU4B.js → chunk-6GDMSENK.js} +3 -2
  7. package/dist/chunk-6GDMSENK.js.map +1 -0
  8. package/dist/{chunk-TNNH3FVQ.js → chunk-6OLTJYSX.js} +24 -8
  9. package/dist/chunk-6OLTJYSX.js.map +1 -0
  10. package/dist/{chunk-POKDSVQT.js → chunk-AE7QTLJ5.js} +5 -4
  11. package/dist/chunk-AE7QTLJ5.js.map +1 -0
  12. package/dist/{chunk-44OV3PNH.js → chunk-B2YJKRNQ.js} +3 -3
  13. package/dist/{chunk-44OV3PNH.js.map → chunk-B2YJKRNQ.js.map} +1 -1
  14. package/dist/{chunk-YIQI2CF3.js → chunk-CTSO6V72.js} +3 -2
  15. package/dist/chunk-CTSO6V72.js.map +1 -0
  16. package/dist/{chunk-EVVMHTCL.js → chunk-EBREIC3L.js} +4 -3
  17. package/dist/chunk-EBREIC3L.js.map +1 -0
  18. package/dist/{chunk-UNSAA7YG.js → chunk-FHG54IT5.js} +3 -2
  19. package/dist/chunk-FHG54IT5.js.map +1 -0
  20. package/dist/{chunk-3GYOIQW7.js → chunk-FZIHZT5R.js} +5 -5
  21. package/dist/{chunk-3GYOIQW7.js.map → chunk-FZIHZT5R.js.map} +1 -1
  22. package/dist/{chunk-2H46IXW4.js → chunk-HAQJQFE6.js} +28 -8
  23. package/dist/chunk-HAQJQFE6.js.map +1 -0
  24. package/dist/{chunk-IHYFYMHJ.js → chunk-HT5JAHR3.js} +6 -6
  25. package/dist/{chunk-IHYFYMHJ.js.map → chunk-HT5JAHR3.js.map} +1 -1
  26. package/dist/chunk-I4SQQIP5.js +12 -0
  27. package/dist/chunk-I4SQQIP5.js.map +1 -0
  28. package/dist/{chunk-J3PELDH3.js → chunk-JITF6I7N.js} +22 -6
  29. package/dist/chunk-JITF6I7N.js.map +1 -0
  30. package/dist/{chunk-IFWCCAQV.js → chunk-KHMFNH3X.js} +3 -2
  31. package/dist/chunk-KHMFNH3X.js.map +1 -0
  32. package/dist/{chunk-SIG4DMNZ.js → chunk-MI2WZRK3.js} +4 -4
  33. package/dist/{chunk-SIG4DMNZ.js.map → chunk-MI2WZRK3.js.map} +1 -1
  34. package/dist/{chunk-YON5Y336.js → chunk-O23Y5ML4.js} +8 -8
  35. package/dist/{chunk-YON5Y336.js.map → chunk-O23Y5ML4.js.map} +1 -1
  36. package/dist/{chunk-P7A3BCAC.js → chunk-OWG4BCQR.js} +3 -3
  37. package/dist/{chunk-P7A3BCAC.js.map → chunk-OWG4BCQR.js.map} +1 -1
  38. package/dist/{chunk-FUWSTUDM.js → chunk-PH354ECN.js} +4 -4
  39. package/dist/{chunk-FUWSTUDM.js.map → chunk-PH354ECN.js.map} +1 -1
  40. package/dist/{chunk-U5GW5EBR.js → chunk-RAUOFTUH.js} +12 -20
  41. package/dist/chunk-RAUOFTUH.js.map +1 -0
  42. package/dist/{chunk-6I4R3HR6.js → chunk-RQL7FVCS.js} +3 -3
  43. package/dist/{chunk-6I4R3HR6.js.map → chunk-RQL7FVCS.js.map} +1 -1
  44. package/dist/{chunk-2762HZYX.js → chunk-S2HWWR2H.js} +47 -25
  45. package/dist/chunk-S2HWWR2H.js.map +1 -0
  46. package/dist/{chunk-VLUKI3HL.js → chunk-S7N4LGLZ.js} +6 -13
  47. package/dist/chunk-S7N4LGLZ.js.map +1 -0
  48. package/dist/{chunk-NSOA3GMZ.js → chunk-UHNRAI6V.js} +3 -3
  49. package/dist/{chunk-NSOA3GMZ.js.map → chunk-UHNRAI6V.js.map} +1 -1
  50. package/dist/{chunk-JBVFWSRQ.js → chunk-VIYVN4WF.js} +6 -4
  51. package/dist/chunk-VIYVN4WF.js.map +1 -0
  52. package/dist/{chunk-3NZXWCGF.js → chunk-WHKKN3ZK.js} +6 -6
  53. package/dist/{chunk-3NZXWCGF.js.map → chunk-WHKKN3ZK.js.map} +1 -1
  54. package/dist/{chunk-MOI7B3KH.js → chunk-WQN64ZHG.js} +5 -5
  55. package/dist/{chunk-MOI7B3KH.js.map → chunk-WQN64ZHG.js.map} +1 -1
  56. package/dist/chunk-WSIVRDRB.js +34 -0
  57. package/dist/chunk-WSIVRDRB.js.map +1 -0
  58. package/dist/{chunk-S53FHWNG.js → chunk-YWRBG23W.js} +3 -3
  59. package/dist/chunk-YWRBG23W.js.map +1 -0
  60. package/dist/{chunk-6SWK4XG5.js → chunk-YXE4B6X3.js} +2 -2
  61. package/dist/chunk-YXE4B6X3.js.map +1 -0
  62. package/dist/{chunk-NGAQITWP.js → chunk-Z2Z5EXVT.js} +10 -7
  63. package/dist/chunk-Z2Z5EXVT.js.map +1 -0
  64. package/dist/{chunk-IXKELBJA.js → chunk-ZDXQ64A7.js} +63 -44
  65. package/dist/chunk-ZDXQ64A7.js.map +1 -0
  66. package/dist/colors.css +12 -26
  67. package/dist/components/accordion/accordion-data.d.ts +3 -2
  68. package/dist/components/accordion/accordion-data.d.ts.map +1 -1
  69. package/dist/components/accordion/accordion.d.ts +2 -2
  70. package/dist/components/accordion/accordion.d.ts.map +1 -1
  71. package/dist/components/accordion/index.js +20 -8
  72. package/dist/components/accordion/index.js.map +1 -1
  73. package/dist/components/action-icon/action-icon.d.ts +3 -4
  74. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  75. package/dist/components/action-icon/index.js +2 -1
  76. package/dist/components/alert/alert.d.ts +1 -1
  77. package/dist/components/alert/alert.d.ts.map +1 -1
  78. package/dist/components/alert/index.js +16 -4
  79. package/dist/components/alert/index.js.map +1 -1
  80. package/dist/components/app-shell/app-shell.d.ts +3 -2
  81. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  82. package/dist/components/app-shell/index.js +4 -2
  83. package/dist/components/app-shell/index.js.map +1 -1
  84. package/dist/components/autocomplete/index.js +5 -4
  85. package/dist/components/autocomplete/index.js.map +1 -1
  86. package/dist/components/avatar/avatar.d.ts +3 -3
  87. package/dist/components/avatar/index.js.map +1 -1
  88. package/dist/components/breadcrumb/breadcrumb.d.ts +3 -2
  89. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  90. package/dist/components/breadcrumb/index.js +11 -5
  91. package/dist/components/breadcrumb/index.js.map +1 -1
  92. package/dist/components/button/button.d.ts +4 -4
  93. package/dist/components/button/button.d.ts.map +1 -1
  94. package/dist/components/button/index.js +2 -1
  95. package/dist/components/button-multi-select/index.js +4 -3
  96. package/dist/components/button-multi-select/index.js.map +1 -1
  97. package/dist/components/button-select/index.js +4 -3
  98. package/dist/components/button-select/index.js.map +1 -1
  99. package/dist/components/calendar/index.js +3 -2
  100. package/dist/components/chart/chart.d.ts +1 -1
  101. package/dist/components/chart/index.js +1 -1
  102. package/dist/components/chart/index.js.map +1 -1
  103. package/dist/components/checkbox/index.js +2 -2
  104. package/dist/components/choice-card-group/index.js +1 -1
  105. package/dist/components/circular-progress/circular-progress.d.ts +3 -2
  106. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  107. package/dist/components/circular-progress/index.js +1 -0
  108. package/dist/components/circular-progress/index.js.map +1 -1
  109. package/dist/components/clipboard/clipboard.d.ts +1 -1
  110. package/dist/components/clipboard/clipboard.d.ts.map +1 -1
  111. package/dist/components/clipboard/index.js +9 -5
  112. package/dist/components/clipboard/index.js.map +1 -1
  113. package/dist/components/code/index.js +1 -1
  114. package/dist/components/code-block/chrome.d.ts +4 -1
  115. package/dist/components/code-block/chrome.d.ts.map +1 -1
  116. package/dist/components/code-block/chrome.js +5 -4
  117. package/dist/components/code-block/code-block.d.ts +7 -1
  118. package/dist/components/code-block/code-block.d.ts.map +1 -1
  119. package/dist/components/code-block/index.d.ts +1 -1
  120. package/dist/components/code-block/index.js +12 -10
  121. package/dist/components/code-block/index.js.map +1 -1
  122. package/dist/components/code-block/notation.d.ts +5 -2
  123. package/dist/components/code-block/notation.d.ts.map +1 -1
  124. package/dist/components/code-block/static.d.ts +4 -1
  125. package/dist/components/code-block/static.d.ts.map +1 -1
  126. package/dist/components/code-block/static.js +5 -4
  127. package/dist/components/code-block/static.js.map +1 -1
  128. package/dist/components/collapse/collapse.d.ts +7 -3
  129. package/dist/components/collapse/collapse.d.ts.map +1 -1
  130. package/dist/components/collapse/index.js +2 -1
  131. package/dist/components/combobox/combobox.d.ts +11 -10
  132. package/dist/components/combobox/combobox.d.ts.map +1 -1
  133. package/dist/components/combobox/index.js +5 -4
  134. package/dist/components/combobox-list/index.js +6 -5
  135. package/dist/components/data-table/index.js +21 -20
  136. package/dist/components/data-table/index.js.map +1 -1
  137. package/dist/components/date-picker/index.js +12 -11
  138. package/dist/components/date-picker/index.js.map +1 -1
  139. package/dist/components/divider/divider.d.ts +3 -2
  140. package/dist/components/divider/divider.d.ts.map +1 -1
  141. package/dist/components/divider/index.js +1 -1
  142. package/dist/components/drawer/drawer.d.ts +6 -5
  143. package/dist/components/drawer/drawer.d.ts.map +1 -1
  144. package/dist/components/drawer/index.js +3 -2
  145. package/dist/components/field/field.d.ts +7 -4
  146. package/dist/components/field/field.d.ts.map +1 -1
  147. package/dist/components/field/index.js +1 -1
  148. package/dist/components/file-upload/index.js +3 -2
  149. package/dist/components/file-upload/index.js.map +1 -1
  150. package/dist/components/hover-card/index.js +1 -1
  151. package/dist/components/input/index.js +2 -2
  152. package/dist/components/input/input.d.ts +3 -2
  153. package/dist/components/input/input.d.ts.map +1 -1
  154. package/dist/components/mark/index.js +1 -1
  155. package/dist/components/mark/mark.d.ts +2 -2
  156. package/dist/components/menu/index.js +3 -2
  157. package/dist/components/menu/index.js.map +1 -1
  158. package/dist/components/menu/menu-data.d.ts +6 -1
  159. package/dist/components/menu/menu-data.d.ts.map +1 -1
  160. package/dist/components/menu/menu.d.ts +5 -5
  161. package/dist/components/menu/menu.d.ts.map +1 -1
  162. package/dist/components/modal/index.js +3 -2
  163. package/dist/components/modal/modal.d.ts +4 -3
  164. package/dist/components/modal/modal.d.ts.map +1 -1
  165. package/dist/components/multi-combobox-list/index.js +6 -5
  166. package/dist/components/multi-select/index.js +7 -6
  167. package/dist/components/multi-select/index.js.map +1 -1
  168. package/dist/components/nav-link/index.js +3 -2
  169. package/dist/components/nav-link/tanstack.js +3 -2
  170. package/dist/components/nav-link/tanstack.js.map +1 -1
  171. package/dist/components/notification/index.js +4 -3
  172. package/dist/components/notification/index.js.map +1 -1
  173. package/dist/components/notification/notification.d.ts +3 -2
  174. package/dist/components/notification/notification.d.ts.map +1 -1
  175. package/dist/components/number-input/index.js +4 -4
  176. package/dist/components/overlays/index.js +5 -4
  177. package/dist/components/overlays/index.js.map +1 -1
  178. package/dist/components/password-input/index.js +2 -2
  179. package/dist/components/pill/index.js +2 -1
  180. package/dist/components/pill/pill.d.ts +4 -2
  181. package/dist/components/pill/pill.d.ts.map +1 -1
  182. package/dist/components/pills-input/index.js +5 -4
  183. package/dist/components/pills-input/pills-input.d.ts +3 -2
  184. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  185. package/dist/components/pin-input/index.js +2 -2
  186. package/dist/components/popover/index.js +1 -1
  187. package/dist/components/popover/popover.d.ts +3 -2
  188. package/dist/components/popover/popover.d.ts.map +1 -1
  189. package/dist/components/progress/index.js +1 -0
  190. package/dist/components/progress/index.js.map +1 -1
  191. package/dist/components/progress/progress.d.ts +3 -2
  192. package/dist/components/progress/progress.d.ts.map +1 -1
  193. package/dist/components/radio-group/index.js +1 -1
  194. package/dist/components/rating/index.js +2 -1
  195. package/dist/components/rating/index.js.map +1 -1
  196. package/dist/components/rating/rating.d.ts +3 -2
  197. package/dist/components/rating/rating.d.ts.map +1 -1
  198. package/dist/components/schedule/index.d.ts +2 -2
  199. package/dist/components/schedule/index.js +50 -23
  200. package/dist/components/schedule/index.js.map +1 -1
  201. package/dist/components/schedule/schedule-agenda-list.d.ts +6 -7
  202. package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -1
  203. package/dist/components/schedule/schedule-agenda-view.d.ts +19 -16
  204. package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
  205. package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
  206. package/dist/components/schedule/schedule-days-view.d.ts +3 -2
  207. package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
  208. package/dist/components/schedule/schedule-month-view.d.ts +3 -2
  209. package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
  210. package/dist/components/schedule/schedule-next-up.d.ts +4 -3
  211. package/dist/components/schedule/schedule-next-up.d.ts.map +1 -1
  212. package/dist/components/schedule/schedule-toolbar.d.ts +1 -1
  213. package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
  214. package/dist/components/schedule/schedule-types.d.ts +6 -4
  215. package/dist/components/schedule/schedule-types.d.ts.map +1 -1
  216. package/dist/components/schedule/schedule-views.d.ts +2 -2
  217. package/dist/components/schedule/schedule-views.d.ts.map +1 -1
  218. package/dist/components/schedule/schedule-year-view.d.ts +3 -2
  219. package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
  220. package/dist/components/schedule/schedule.d.ts +9 -6
  221. package/dist/components/schedule/schedule.d.ts.map +1 -1
  222. package/dist/components/segment-group/index.js +2 -2
  223. package/dist/components/select/index.js +4 -4
  224. package/dist/components/slider/index.js +2 -1
  225. package/dist/components/slider/index.js.map +1 -1
  226. package/dist/components/slider/slider.d.ts +3 -2
  227. package/dist/components/slider/slider.d.ts.map +1 -1
  228. package/dist/components/switch/index.js +1 -1
  229. package/dist/components/tabs/index.js +1 -1
  230. package/dist/components/tabs/tabs-data.d.ts +3 -2
  231. package/dist/components/tabs/tabs-data.d.ts.map +1 -1
  232. package/dist/components/tags-input/index.js +6 -5
  233. package/dist/components/tags-input/index.js.map +1 -1
  234. package/dist/components/text-input/index.js +2 -2
  235. package/dist/components/textarea/index.js +2 -2
  236. package/dist/components/theme-icon/index.js +1 -1
  237. package/dist/components/time-input/index.js +6 -6
  238. package/dist/components/timeline/index.js +8 -5
  239. package/dist/components/timeline/index.js.map +1 -1
  240. package/dist/components/timeline/timeline.d.ts +1 -1
  241. package/dist/components/timeline/timeline.d.ts.map +1 -1
  242. package/dist/components/tooltip/index.js +1 -1
  243. package/dist/components/tooltip/tooltip.d.ts +2 -1
  244. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  245. package/dist/components/tree-multi-select/index.js +6 -5
  246. package/dist/components/tree-multi-select/index.js.map +1 -1
  247. package/dist/components/tree-select/index.js +3 -3
  248. package/dist/index.js +1 -1
  249. package/dist/lib/as-child.d.ts +104 -0
  250. package/dist/lib/as-child.d.ts.map +1 -0
  251. package/dist/lib/colors.d.ts +1 -1
  252. package/dist/lib/colors.d.ts.map +1 -1
  253. package/dist/theme.css +0 -33
  254. package/package.json +2 -1
  255. package/src/as-child.contract.test.tsx +809 -0
  256. package/src/biome-plugins.test.ts +61 -0
  257. package/src/colors.css +12 -26
  258. package/src/components/accordion/accordion-data.tsx +8 -5
  259. package/src/components/accordion/accordion.test.tsx +40 -0
  260. package/src/components/accordion/accordion.tsx +23 -6
  261. package/src/components/action-icon/action-icon.tsx +9 -24
  262. package/src/components/alert/alert.test.tsx +17 -0
  263. package/src/components/alert/alert.tsx +21 -2
  264. package/src/components/app-shell/app-shell.tsx +3 -1
  265. package/src/components/avatar/avatar.tsx +3 -3
  266. package/src/components/breadcrumb/breadcrumb.test.tsx +30 -0
  267. package/src/components/breadcrumb/breadcrumb.tsx +21 -12
  268. package/src/components/button/button.tsx +21 -50
  269. package/src/components/chart/chart.test.tsx +1 -2
  270. package/src/components/chart/chart.tsx +1 -1
  271. package/src/components/circular-progress/circular-progress.tsx +4 -1
  272. package/src/components/clipboard/clipboard.test.tsx +18 -0
  273. package/src/components/clipboard/clipboard.tsx +8 -2
  274. package/src/components/code-block/chrome.tsx +60 -36
  275. package/src/components/code-block/code-block.test.tsx +27 -0
  276. package/src/components/code-block/code-block.tsx +13 -3
  277. package/src/components/code-block/gutters.test.ts +2 -2
  278. package/src/components/code-block/notation.test.ts +8 -0
  279. package/src/components/code-block/notation.ts +6 -3
  280. package/src/components/code-block/static.tsx +8 -2
  281. package/src/components/collapse/collapse.tsx +33 -15
  282. package/src/components/combobox/combobox.test.tsx +38 -0
  283. package/src/components/combobox/combobox.tsx +24 -10
  284. package/src/components/divider/divider.tsx +3 -1
  285. package/src/components/drawer/drawer.tsx +37 -16
  286. package/src/components/field/field.tsx +7 -3
  287. package/src/components/input/input.tsx +3 -1
  288. package/src/components/mark/mark.test.tsx +4 -4
  289. package/src/components/mark/mark.tsx +3 -3
  290. package/src/components/menu/menu-data.tsx +8 -1
  291. package/src/components/menu/menu.test.tsx +52 -0
  292. package/src/components/menu/menu.tsx +83 -35
  293. package/src/components/modal/close-trigger.test.tsx +38 -0
  294. package/src/components/modal/modal.tsx +29 -13
  295. package/src/components/notification/notification.tsx +4 -1
  296. package/src/components/pill/pill.tsx +29 -20
  297. package/src/components/pills-input/pills-input.tsx +3 -1
  298. package/src/components/popover/popover.tsx +3 -1
  299. package/src/components/progress/progress.tsx +4 -1
  300. package/src/components/rating/rating.tsx +27 -23
  301. package/src/components/schedule/index.ts +1 -1
  302. package/src/components/schedule/schedule-agenda-list.tsx +6 -7
  303. package/src/components/schedule/schedule-agenda-view.test.tsx +105 -28
  304. package/src/components/schedule/schedule-agenda-view.tsx +41 -28
  305. package/src/components/schedule/schedule-dates.test.ts +37 -52
  306. package/src/components/schedule/schedule-dates.ts +22 -25
  307. package/src/components/schedule/schedule-days-view.tsx +3 -1
  308. package/src/components/schedule/schedule-month-view.tsx +3 -1
  309. package/src/components/schedule/schedule-next-up.tsx +6 -2
  310. package/src/components/schedule/schedule-toolbar.test.tsx +26 -0
  311. package/src/components/schedule/schedule-toolbar.tsx +13 -1
  312. package/src/components/schedule/schedule-types.ts +6 -4
  313. package/src/components/schedule/schedule-views.ts +4 -5
  314. package/src/components/schedule/schedule-year-view.tsx +3 -1
  315. package/src/components/schedule/schedule.test.tsx +66 -22
  316. package/src/components/schedule/schedule.tsx +22 -13
  317. package/src/components/slider/slider.tsx +4 -0
  318. package/src/components/tabs/tabs-data.tsx +17 -14
  319. package/src/components/theme-icon/theme-icon.tsx +1 -1
  320. package/src/components/timeline/timeline.tsx +102 -95
  321. package/src/components/tooltip/tooltip.tsx +2 -1
  322. package/src/lib/as-child.test.tsx +70 -0
  323. package/src/lib/as-child.ts +119 -0
  324. package/src/lib/colors.ts +4 -2
  325. package/src/theme.css +0 -33
  326. package/dist/chunk-2762HZYX.js.map +0 -1
  327. package/dist/chunk-2H46IXW4.js.map +0 -1
  328. package/dist/chunk-6SWK4XG5.js.map +0 -1
  329. package/dist/chunk-EVVMHTCL.js.map +0 -1
  330. package/dist/chunk-HWNPXAEN.js +0 -31
  331. package/dist/chunk-HWNPXAEN.js.map +0 -1
  332. package/dist/chunk-IFWCCAQV.js.map +0 -1
  333. package/dist/chunk-IXKELBJA.js.map +0 -1
  334. package/dist/chunk-J3PELDH3.js.map +0 -1
  335. package/dist/chunk-JBVFWSRQ.js.map +0 -1
  336. package/dist/chunk-NGAQITWP.js.map +0 -1
  337. package/dist/chunk-POKDSVQT.js.map +0 -1
  338. package/dist/chunk-QMW7D5GU.js.map +0 -1
  339. package/dist/chunk-S53FHWNG.js.map +0 -1
  340. package/dist/chunk-TNNH3FVQ.js.map +0 -1
  341. package/dist/chunk-U5GW5EBR.js.map +0 -1
  342. package/dist/chunk-UNSAA7YG.js.map +0 -1
  343. package/dist/chunk-VLUKI3HL.js.map +0 -1
  344. package/dist/chunk-VZ2TPU4B.js.map +0 -1
  345. package/dist/chunk-YIQI2CF3.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/accordion/acc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QAAA,EAAA;AAAA,oBAAAD,IAAC,WAAA,EAAA,EAAY,IAAA,EAAM,KAAK,IAAA,EAAM,MAAA,EAC3B,eAAK,KAAA,EACR,CAAA;AAAA,oBACAA,IAAC,WAAA,EAAA,EAAY,MAAA,EAAQ,GAAG,MAAM,CAAA,QAAA,CAAA,EAAa,eAAK,OAAA,EAAQ;AAAA,GAAA,EAAA,EAJ/C,KAAK,KAKhB,CAAA;AAEJ,CAAC,CAAA,EACH,CAAA;AAQK,IAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,kBAAA,EAAoB;AAAA,EACzD,IAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAC","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Accordion as Ark } from \"@ark-ui/react/accordion\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, type ReactNode, useContext } from \"react\"\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 { Collapse, type CollapseClassNames } from \"../collapse/collapse\"\nimport { ChevronIcon } from \"../popover/icons\"\nimport { Title, type TitleOrder } from \"../title/title\"\n\n/**\n * Accordion — a stack of expandable sections on Ark UI's Accordion machine.\n * Each item is a heading (`<h2>`..`<h6>`, via `Title`) wrapping a trigger\n * button; clicking it reveals that item's panel. Two ways to use it:\n *\n * // 1. Data-driven — the common case\n * <Accordion\n * variant=\"separated\"\n * data={[\n * { value: \"billing\", label: \"Billing\", content: <Billing /> },\n * { value: \"shipping\", label: \"Shipping\", content: <Shipping /> },\n * ]}\n * />\n *\n * // 2. Compound — for anything the data array can't express\n * <Accordion.Root defaultValue={[\"billing\"]}>\n * <Accordion.Item value=\"billing\">\n * <Accordion.ItemTrigger>Billing</Accordion.ItemTrigger>\n * <Accordion.ItemContent><Billing /></Accordion.ItemContent>\n * </Accordion.Item>\n * </Accordion.Root>\n *\n * Content never animates via Ark's own JS-measured height (the same category\n * of runtime-measurement quirk this kit already worked around for `Slider`'s\n * `thumbSize`) — `ItemContent` renders through this kit's own zero-JS\n * `Collapse` primitive instead (a CSS-grid `0fr` -> `1fr` row track), merged\n * onto Ark's part via `asChild`. Ark's own `--height`/`--width` vars go\n * unused since `Collapse`'s CSS never references them.\n *\n * `variant` / `size` / `radius` / `chevronPosition` / `chevron` / `order` all\n * live on `Root` — there's no separate `List` part the way `Tabs` has one,\n * since the root itself *is* the list — and cascade to every `Item` /\n * `ItemTrigger` / `ItemContent` through context, so a caller sets them once\n * rather than repeating them per item.\n */\n\n/** The container. `default` is a single bordered list with dividers between\n * items (the hairline `bg-white/4` + `border-brand-900/20 dark:border-white/15`\n * recipe, matching `Tabs`' own `default` tray); `separated` lays each item\n * out as its own block with a visible gap between them — `radius` only\n * applies to it, `default`'s corners are fixed to the container. */\nconst accordionRoot = cva([\"w-full\"], {\n variants: {\n variant: {\n default: [\n \"divide-y divide-brand-900/20 dark:divide-white/15\",\n \"overflow-hidden rounded-input border border-brand-900/20 dark:border-white/15\",\n \"bg-white/4\",\n ],\n separated: \"flex flex-col gap-3\",\n },\n },\n defaultVariants: { variant: \"default\" },\n})\n\n/** Each item. `default` is chromeless (the container owns the border/dividers);\n * `separated` is its own hairline-bordered card, deepening its border to a\n * solid neutral ink while open — the same palette-independent\n * `border-gray-light-900 dark:border-gray-dark-25` emphasis `ChoiceCardGroup`\n * uses for its own colorless `default` selected state, rather than a\n * `data-color`-driven CSS var (there's no `color` prop to drive one). */\nconst accordionItem = cva([\"w-full overflow-hidden\"], {\n variants: {\n variant: {\n default: \"\",\n separated: [\n \"border bg-white/4 transition-colors\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:border-gray-light-900 dark:data-[state=open]:border-gray-dark-25\",\n ],\n },\n radius: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n },\n compoundVariants: [\n { variant: \"separated\", radius: \"xs\", class: \"rounded-xs\" },\n { variant: \"separated\", radius: \"sm\", class: \"rounded-sm\" },\n { variant: \"separated\", radius: \"md\", class: \"rounded-md\" },\n { variant: \"separated\", radius: \"lg\", class: \"rounded-lg\" },\n { variant: \"separated\", radius: \"xl\", class: \"rounded-xl\" },\n ],\n defaultVariants: { variant: \"default\", radius: \"sm\" },\n})\n\n/** Each trigger — a full-width row; the expanded state deepens the chevron\n * (via `accordionIndicator` below) to a solid neutral ink. */\nconst accordionTrigger = cva(\n [\n \"group/trigger flex w-full cursor-pointer items-center gap-2 text-start font-medium\",\n \"text-gray-light-900 dark:text-gray-dark-50\",\n \"outline-none transition-colors\",\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n focusStyles(),\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n ],\n {\n variants: {\n size: {\n xs: \"px-2.5 py-2 text-xs\",\n sm: \"px-3 py-2.5 text-sm\",\n md: \"px-4 py-3 text-md\",\n lg: \"px-5 py-3.5 text-lg\",\n xl: \"px-6 py-4 text-xl\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** The label + leading-icon slot. The trigger's own base text color (near-ink\n * in light, near-white in dark) already reads as \"expanded\" alongside the\n * chevron's rotation + color below, so this slot carries no separate\n * open-state tint of its own. */\nconst accordionLabel = \"min-w-0 flex-1 truncate\"\nconst accordionIcon = \"shrink-0 [&_svg]:size-4\"\n\n/** The chevron. Rotates and deepens from a muted gray to a solid neutral ink\n * off its own `data-state` (Ark stamps one on `ItemIndicator` directly), not\n * the group — the same palette-independent `gray-light-900`/`gray-dark-25`\n * emphasis `ChoiceCardGroup` uses for its own colorless selected state. No\n * rotation-disabling escape hatch (`disableChevronRotation`) is offered;\n * swap `chevron` instead. */\nconst accordionIndicator = cn(\n \"flex shrink-0 items-center justify-center text-gray-light-500 transition-transform dark:text-gray-dark-400\",\n \"data-[state=open]:rotate-180 data-[state=open]:text-gray-light-900 dark:data-[state=open]:text-gray-dark-25\",\n \"[&_svg]:size-4\",\n)\n\n/** The panel, sized to match its trigger. */\nconst accordionContent = cva([\"text-gray-light-700 dark:text-gray-dark-300\"], {\n variants: {\n size: {\n xs: \"px-2.5 pb-2 text-xs\",\n sm: \"px-3 pb-2.5 text-sm\",\n md: \"px-4 pb-3 text-md\",\n lg: \"px-5 pb-3.5 text-lg\",\n xl: \"px-6 pb-4 text-xl\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\nexport type AccordionVariant = NonNullable<VariantProps<typeof accordionRoot>[\"variant\"]>\n/** Logical chevron position — `start` / `end`, not left/right, so it flips\n * correctly under `dir=\"rtl\"` (matching `Divider`'s `labelPosition`). */\nexport type AccordionChevronPosition = \"start\" | \"end\"\n/** A heading can't itself be a button — `order={1}` is reserved for the page's\n * own `<h1>`, so the shallowest an accordion trigger's heading goes is `<h2>`. */\nexport type AccordionOrder = Extract<TitleOrder, 2 | 3 | 4 | 5 | 6>\n\n/** Shared configuration, set once on `Root` and read by `Item` / `ItemTrigger`\n * / `ItemContent` so callers don't repeat it on every item. */\nconst AccordionStyleContext = createContext<{\n variant: AccordionVariant\n size: Size\n radius: Size\n chevronPosition: AccordionChevronPosition\n chevron: ReactNode | null | undefined\n order: AccordionOrder\n}>({\n variant: \"default\",\n size: \"md\",\n radius: \"sm\",\n chevronPosition: \"end\",\n chevron: undefined,\n order: 3,\n})\n\nexport type AccordionRootProps = Omit<Ark.RootProps, \"onValueChange\"> &\n WithTestId & {\n /** Container + item treatment. `default` is a single bordered list with\n * dividers; `separated` lays each item out as its own block. A different\n * vocabulary than the button-family `filled`/`light`/`outline`/`subtle`\n * — see the type's own doc. */\n variant?: AccordionVariant\n /** Trigger + content sizing. */\n size?: Size\n /** Corner rounding for `separated` item cards. Ignored by `default`. */\n radius?: Size\n /** Where the chevron sits on each trigger. */\n chevronPosition?: AccordionChevronPosition\n /** Custom chevron icon, replacing the default `ChevronIcon`. `null` hides\n * it entirely — there's no separate flag to keep the icon but disable its\n * open/close rotation. */\n chevron?: ReactNode | null\n /** Semantic heading level wrapping each trigger. */\n order?: AccordionOrder\n /** Fires with the next expanded values (flattened from Ark's `onValueChange`). */\n onChange?: (value: string[]) => void\n }\n\nconst Root = ({\n variant = \"default\",\n size = \"md\",\n radius = \"sm\",\n chevronPosition = \"end\",\n chevron,\n order = 3,\n orientation = \"vertical\",\n onChange,\n className,\n testId,\n ...rest\n}: AccordionRootProps) => (\n <AccordionStyleContext.Provider\n value={{ variant, size, radius, chevronPosition, chevron, order }}\n >\n <Ark.Root\n orientation={orientation}\n onValueChange={onChange ? (d) => onChange(d.value) : undefined}\n className={cn(accordionRoot({ variant }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n </AccordionStyleContext.Provider>\n)\n\nexport type AccordionItemProps = Ark.ItemProps & WithTestId\n\nconst Item = ({ className, testId, ...rest }: AccordionItemProps) => {\n const { variant, radius } = useContext(AccordionStyleContext)\n return (\n <Ark.Item\n className={cn(accordionItem({ variant, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type AccordionItemIndicatorProps = Ark.ItemIndicatorProps & WithTestId\n\nconst ItemIndicator = ({ className, testId, ...rest }: AccordionItemIndicatorProps) => (\n <Ark.ItemIndicator\n className={cn(accordionIndicator, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AccordionItemTriggerProps = Ark.ItemTriggerProps &\n WithTestId & {\n /** Leading icon, rendered before the label. */\n icon?: ReactNode\n }\n\nconst ItemTrigger = ({ icon, children, className, testId, ...rest }: AccordionItemTriggerProps) => {\n const { size, chevronPosition, chevron, order } = useContext(AccordionStyleContext)\n const indicator =\n chevron === null ? null : <ItemIndicator>{chevron ?? <ChevronIcon />}</ItemIndicator>\n\n return (\n <Title order={order} className=\"contents\">\n <Ark.ItemTrigger\n className={cn(accordionTrigger({ size }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {chevronPosition === \"start\" && indicator}\n {icon && <span className={accordionIcon}>{icon}</span>}\n <span className={accordionLabel}>{children}</span>\n {chevronPosition === \"end\" && indicator}\n </Ark.ItemTrigger>\n </Title>\n )\n}\n\nexport type AccordionItemContentProps = Ark.ItemContentProps &\n WithTestId & {\n classNames?: CollapseClassNames\n }\n\n/**\n * The panel. Bypasses Ark's own JS-measured height animation entirely —\n * `Ark.ItemContent` is merged (`asChild`) onto this kit's own `Collapse`\n * primitive, driven by the item's live `expanded` state off `Ark.ItemContext`.\n *\n * `hidden` is explicitly pinned to `false`: Ark's nested Collapsible machine\n * (every `Item` is one under the hood) drops it to `true` within a frame of\n * closing — it detects \"no CSS `animation`\" (only `Collapse`'s `transition`)\n * and immediately calls the exit \"complete\" — which would otherwise clip the\n * close animation to nothing via `display: none`. `Collapse`'s own zero-height\n * `overflow-clip` state is what actually hides the panel instead (the same\n * trade-off `NavLink` already makes for its nested items).\n *\n * The size-based padding lives on an *extra* inner `<div>` wrapping `children`\n * — not on `Collapse`'s own `classNames.content` slot — because that slot\n * *is* the CSS grid item `Collapse` collapses. A grid item's own padding\n * always occupies space regardless of `min-height: 0`, so padding placed\n * there stalls the `0fr` track a few pixels short of a true collapse (the\n * same pattern `NavLink` already uses for its nested-items padding).\n */\nconst ItemContent = ({\n children,\n className,\n classNames,\n testId,\n ...rest\n}: AccordionItemContentProps) => {\n const { size } = useContext(AccordionStyleContext)\n return (\n <Ark.ItemContext>\n {(item) => (\n <Ark.ItemContent asChild>\n <Collapse\n open={item.expanded}\n hidden={false}\n className={className}\n classNames={classNames}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <div className={accordionContent({ size })}>{children}</div>\n </Collapse>\n </Ark.ItemContent>\n )}\n </Ark.ItemContext>\n )\n}\n\nexport { Item, ItemContent, ItemIndicator, ItemTrigger, Root }\nexport const ItemContext = Ark.ItemContext\nexport const Context = Ark.Context\n","\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport {\n type AccordionRootProps,\n Item,\n ItemContent,\n ItemContext,\n ItemIndicator,\n ItemTrigger,\n Root,\n} from \"./accordion\"\n\n/**\n * Data-driven Accordion — the convenience wrapper over the composable parts,\n * for the common case of a flat list of label + panel pairs:\n *\n * <Accordion\n * data={[\n * { value: \"billing\", label: \"Billing\", content: <Billing /> },\n * { value: \"shipping\", label: \"Shipping\", content: <Shipping /> },\n * ]}\n * />\n *\n * Drop to `Accordion.Root` / `Accordion.Item` / `Accordion.ItemTrigger` /\n * `Accordion.ItemContent` for anything the flat array can't express (custom\n * trigger content, interleaved non-item elements, …).\n */\n\n/** One section: a trigger label and its panel content. */\nexport type AccordionItem = {\n value: string\n label: ReactNode\n content: ReactNode\n disabled?: boolean\n /** Leading icon on the trigger, before the label. */\n icon?: ReactNode\n /** `data-testid` on the trigger; the matching content panel gets\n * `` `${testId}-content` ``. Defaults to `` `accordion-${value}` `` /\n * `` `accordion-${value}-content` `` when omitted. */\n testId?: string\n}\n\n/** The `data` array `Accordion` is generic over. */\nexport type AccordionData = ReadonlyArray<AccordionItem>\n\nexport type AccordionProps<Data extends AccordionData = AccordionData> = Omit<\n AccordionRootProps,\n \"children\"\n> & {\n /** Sections, in order. Each needs its own `content`. */\n data: Data\n}\n\nconst AccordionComponent = <const Data extends AccordionData>({\n data,\n ...root\n}: AccordionProps<Data>) => (\n <Root {...root}>\n {data.map((item) => {\n const testId = item.testId ?? `accordion-${item.value}`\n return (\n <Item key={item.value} value={item.value} disabled={item.disabled}>\n <ItemTrigger icon={item.icon} testId={testId}>\n {item.label}\n </ItemTrigger>\n <ItemContent testId={`${testId}-content`}>{item.content}</ItemContent>\n </Item>\n )\n })}\n </Root>\n)\n\n/**\n * The public `Accordion` export — callable for the data-driven form, with the\n * composable parts attached (like `Tabs`/`Menu`). `<Accordion data={…}>` and\n * `<Accordion.Root>…</Accordion.Root>` both work from one import.\n */\nexport const Accordion = Object.assign(AccordionComponent, {\n Root,\n Item,\n ItemTrigger,\n ItemContent,\n ItemIndicator,\n ItemContext,\n})\n"]}
1
+ {"version":3,"sources":["../../../src/components/accordion/accordion.tsx","../../../src/components/accordion/accordion-data.tsx"],"names":["Ark","jsx","jsxs"],"mappings":";;;;;;;;;;;;;AAwDA,IAAM,aAAA,GAAgB,GAAA,CAAI,CAAC,QAAQ,CAAA,EAAG;AAAA,EACpC,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,OAAA,EAAS;AAAA,QACP,mDAAA;AAAA,QACA,+EAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,SAAA,EAAW;AAAA;AACb,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,OAAA,EAAS,SAAA;AAC9B,CAAC,CAAA;AAQD,IAAM,aAAA,GAAgB,GAAA,CAAI,CAAC,wBAAwB,CAAA,EAAG;AAAA,EACpD,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,OAAA,EAAS,EAAA;AAAA,MACT,SAAA,EAAW;AAAA,QACT,qCAAA;AAAA,QACA,0CAAA;AAAA,QACA;AAAA;AACF,KACF;AAAA,IACA,MAAA,EAAQ,EAAE,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA;AAAG,GACnD;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,EAAE,OAAA,EAAS,WAAA,EAAa,MAAA,EAAQ,IAAA,EAAM,OAAO,YAAA,EAAa;AAAA,IAC1D,EAAE,OAAA,EAAS,WAAA,EAAa,MAAA,EAAQ,IAAA,EAAM,OAAO,YAAA,EAAa;AAAA,IAC1D,EAAE,OAAA,EAAS,WAAA,EAAa,MAAA,EAAQ,IAAA,EAAM,OAAO,YAAA,EAAa;AAAA,IAC1D,EAAE,OAAA,EAAS,WAAA,EAAa,MAAA,EAAQ,IAAA,EAAM,OAAO,YAAA,EAAa;AAAA,IAC1D,EAAE,OAAA,EAAS,WAAA,EAAa,MAAA,EAAQ,IAA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A,EACA,OAAA,EAAS,QAAA;AAAA,EACT,GAAG;AACL,CAAA,qBACEC,IAAC,IAAA,EAAA,EAAM,GAAG,MACP,QAAA,EAAA,IAAA,CAAK,GAAA,CAAI,CAAC,IAAA,KAAS;AAClB,EAAA,MAAM,MAAA,GAAS,IAAA,CAAK,MAAA,IAAU,CAAA,UAAA,EAAa,KAAK,KAAK,CAAA,CAAA;AACrD,EAAA,uBACEC,KAAC,IAAA,EAAA,EAAsB,KAAA,EAAO,KAAK,KAAA,EAAO,QAAA,EAAU,KAAK,QAAA,EACvD,QAAA,EAAA;AAAA,oBAAAD,IAAC,WAAA,EAAA,EAAY,IAAA,EAAM,KAAK,IAAA,EAAM,MAAA,EAC3B,eAAK,KAAA,EACR,CAAA;AAAA,oBACAA,IAAC,WAAA,EAAA,EAAY,MAAA,EAAQ,GAAG,MAAM,CAAA,QAAA,CAAA,EAAa,eAAK,OAAA,EAAQ;AAAA,GAAA,EAAA,EAJ/C,KAAK,KAKhB,CAAA;AAEJ,CAAC,CAAA,EACH,CAAA;AAQK,IAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,kBAAA,EAAoB;AAAA,EACzD,IAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAC","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Accordion as Ark } from \"@ark-ui/react/accordion\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, type ReactNode, useContext } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\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 { Collapse, type CollapseClassNames } from \"../collapse/collapse\"\nimport { ChevronIcon } from \"../popover/icons\"\nimport { Title, type TitleOrder } from \"../title/title\"\n\n/**\n * Accordion — a stack of expandable sections on Ark UI's Accordion machine.\n * Each item is a heading (`<h2>`..`<h6>`, via `Title`) wrapping a trigger\n * button; clicking it reveals that item's panel. Two ways to use it:\n *\n * // 1. Data-driven — the common case\n * <Accordion\n * variant=\"separated\"\n * data={[\n * { value: \"billing\", label: \"Billing\", content: <Billing /> },\n * { value: \"shipping\", label: \"Shipping\", content: <Shipping /> },\n * ]}\n * />\n *\n * // 2. Compound — for anything the data array can't express\n * <Accordion.Root defaultValue={[\"billing\"]}>\n * <Accordion.Item value=\"billing\">\n * <Accordion.ItemTrigger>Billing</Accordion.ItemTrigger>\n * <Accordion.ItemContent><Billing /></Accordion.ItemContent>\n * </Accordion.Item>\n * </Accordion.Root>\n *\n * Content never animates via Ark's own JS-measured height (the same category\n * of runtime-measurement quirk this kit already worked around for `Slider`'s\n * `thumbSize`) — `ItemContent` renders through this kit's own zero-JS\n * `Collapse` primitive instead (a CSS-grid `0fr` -> `1fr` row track), merged\n * onto Ark's part via `asChild`. Ark's own `--height`/`--width` vars go\n * unused since `Collapse`'s CSS never references them.\n *\n * `variant` / `size` / `radius` / `chevronPosition` / `chevron` / `order` all\n * live on `Root` — there's no separate `List` part the way `Tabs` has one,\n * since the root itself *is* the list — and cascade to every `Item` /\n * `ItemTrigger` / `ItemContent` through context, so a caller sets them once\n * rather than repeating them per item.\n */\n\n/** The container. `default` is a single bordered list with dividers between\n * items (the hairline `bg-white/4` + `border-brand-900/20 dark:border-white/15`\n * recipe, matching `Tabs`' own `default` tray); `separated` lays each item\n * out as its own block with a visible gap between them — `radius` only\n * applies to it, `default`'s corners are fixed to the container. */\nconst accordionRoot = cva([\"w-full\"], {\n variants: {\n variant: {\n default: [\n \"divide-y divide-brand-900/20 dark:divide-white/15\",\n \"overflow-hidden rounded-input border border-brand-900/20 dark:border-white/15\",\n \"bg-white/4\",\n ],\n separated: \"flex flex-col gap-3\",\n },\n },\n defaultVariants: { variant: \"default\" },\n})\n\n/** Each item. `default` is chromeless (the container owns the border/dividers);\n * `separated` is its own hairline-bordered card, deepening its border to a\n * solid neutral ink while open — the same palette-independent\n * `border-gray-light-900 dark:border-gray-dark-25` emphasis `ChoiceCardGroup`\n * uses for its own colorless `default` selected state, rather than a\n * `data-color`-driven CSS var (there's no `color` prop to drive one). */\nconst accordionItem = cva([\"w-full overflow-hidden\"], {\n variants: {\n variant: {\n default: \"\",\n separated: [\n \"border bg-white/4 transition-colors\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:border-gray-light-900 dark:data-[state=open]:border-gray-dark-25\",\n ],\n },\n radius: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n },\n compoundVariants: [\n { variant: \"separated\", radius: \"xs\", class: \"rounded-xs\" },\n { variant: \"separated\", radius: \"sm\", class: \"rounded-sm\" },\n { variant: \"separated\", radius: \"md\", class: \"rounded-md\" },\n { variant: \"separated\", radius: \"lg\", class: \"rounded-lg\" },\n { variant: \"separated\", radius: \"xl\", class: \"rounded-xl\" },\n ],\n defaultVariants: { variant: \"default\", radius: \"sm\" },\n})\n\n/** Each trigger — a full-width row; the expanded state deepens the chevron\n * (via `accordionIndicator` below) to a solid neutral ink. */\nconst accordionTrigger = cva(\n [\n \"group/trigger flex w-full cursor-pointer items-center gap-2 text-start font-medium\",\n \"text-gray-light-900 dark:text-gray-dark-50\",\n \"outline-none transition-colors\",\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n focusStyles(),\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n ],\n {\n variants: {\n size: {\n xs: \"px-2.5 py-2 text-xs\",\n sm: \"px-3 py-2.5 text-sm\",\n md: \"px-4 py-3 text-md\",\n lg: \"px-5 py-3.5 text-lg\",\n xl: \"px-6 py-4 text-xl\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** The label + leading-icon slot. The trigger's own base text color (near-ink\n * in light, near-white in dark) already reads as \"expanded\" alongside the\n * chevron's rotation + color below, so this slot carries no separate\n * open-state tint of its own. */\nconst accordionLabel = \"min-w-0 flex-1 truncate\"\nconst accordionIcon = \"shrink-0 [&_svg]:size-4\"\n\n/** The chevron. Rotates and deepens from a muted gray to a solid neutral ink\n * off its own `data-state` (Ark stamps one on `ItemIndicator` directly), not\n * the group — the same palette-independent `gray-light-900`/`gray-dark-25`\n * emphasis `ChoiceCardGroup` uses for its own colorless selected state. No\n * rotation-disabling escape hatch (`disableChevronRotation`) is offered;\n * swap `chevron` instead. */\nconst accordionIndicator = cn(\n \"flex shrink-0 items-center justify-center text-gray-light-500 transition-transform dark:text-gray-dark-400\",\n \"data-[state=open]:rotate-180 data-[state=open]:text-gray-light-900 dark:data-[state=open]:text-gray-dark-25\",\n \"[&_svg]:size-4\",\n)\n\n/** The panel, sized to match its trigger. */\nconst accordionContent = cva([\"text-gray-light-700 dark:text-gray-dark-300\"], {\n variants: {\n size: {\n xs: \"px-2.5 pb-2 text-xs\",\n sm: \"px-3 pb-2.5 text-sm\",\n md: \"px-4 pb-3 text-md\",\n lg: \"px-5 pb-3.5 text-lg\",\n xl: \"px-6 pb-4 text-xl\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\nexport type AccordionVariant = NonNullable<VariantProps<typeof accordionRoot>[\"variant\"]>\n/** Logical chevron position — `start` / `end`, not left/right, so it flips\n * correctly under `dir=\"rtl\"` (matching `Divider`'s `labelPosition`). */\nexport type AccordionChevronPosition = \"start\" | \"end\"\n/** A heading can't itself be a button — `order={1}` is reserved for the page's\n * own `<h1>`, so the shallowest an accordion trigger's heading goes is `<h2>`. */\nexport type AccordionOrder = Extract<TitleOrder, 2 | 3 | 4 | 5 | 6>\n\n/** Shared configuration, set once on `Root` and read by `Item` / `ItemTrigger`\n * / `ItemContent` so callers don't repeat it on every item. */\nconst AccordionStyleContext = createContext<{\n variant: AccordionVariant\n size: Size\n radius: Size\n chevronPosition: AccordionChevronPosition\n chevron: ReactNode | null | undefined\n order: AccordionOrder\n}>({\n variant: \"default\",\n size: \"md\",\n radius: \"sm\",\n chevronPosition: \"end\",\n chevron: undefined,\n order: 3,\n})\n\nexport type AccordionRootProps = Omit<Ark.RootProps, \"onValueChange\"> &\n WithTestId & {\n /** Container + item treatment. `default` is a single bordered list with\n * dividers; `separated` lays each item out as its own block. A different\n * vocabulary than the button-family `filled`/`light`/`outline`/`subtle`\n * — see the type's own doc. */\n variant?: AccordionVariant\n /** Trigger + content sizing. */\n size?: Size\n /** Corner rounding for `separated` item cards. Ignored by `default`. */\n radius?: Size\n /** Where the chevron sits on each trigger. */\n chevronPosition?: AccordionChevronPosition\n /** Custom chevron icon, replacing the default `ChevronIcon`. `null` hides\n * it entirely — there's no separate flag to keep the icon but disable its\n * open/close rotation. */\n chevron?: ReactNode | null\n /** Semantic heading level wrapping each trigger. */\n order?: AccordionOrder\n /** Fires with the next expanded values (flattened from Ark's `onValueChange`). */\n onChange?: (value: string[]) => void\n }\n\nconst Root = ({\n variant = \"default\",\n size = \"md\",\n radius = \"sm\",\n chevronPosition = \"end\",\n chevron,\n order = 3,\n orientation = \"vertical\",\n onChange,\n className,\n testId,\n ...rest\n}: AccordionRootProps) => (\n <AccordionStyleContext.Provider\n value={{ variant, size, radius, chevronPosition, chevron, order }}\n >\n <Ark.Root\n orientation={orientation}\n onValueChange={onChange ? (d) => onChange(d.value) : undefined}\n className={cn(accordionRoot({ variant }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n </AccordionStyleContext.Provider>\n)\n\nexport type AccordionItemProps = Ark.ItemProps & WithTestId\n\nconst Item = ({ className, testId, ...rest }: AccordionItemProps) => {\n const { variant, radius } = useContext(AccordionStyleContext)\n return (\n <Ark.Item\n className={cn(accordionItem({ variant, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type AccordionItemIndicatorProps = Ark.ItemIndicatorProps & WithTestId\n\nconst ItemIndicator = ({ className, testId, ...rest }: AccordionItemIndicatorProps) => (\n <Ark.ItemIndicator\n className={cn(accordionIndicator, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AccordionItemTriggerProps = Ark.ItemTriggerProps &\n WithTestId & {\n /** Leading icon, rendered before the label. */\n icon?: ReactNode\n }\n\nconst ItemTrigger = ({\n icon,\n children,\n className,\n testId,\n asChild,\n ...rest\n}: AccordionItemTriggerProps) => {\n const { size, chevronPosition, chevron, order } = useContext(AccordionStyleContext)\n const indicator =\n chevron === null ? null : <ItemIndicator>{chevron ?? <ChevronIcon />}</ItemIndicator>\n\n return (\n <Title order={order} className=\"contents\">\n <Ark.ItemTrigger\n asChild={asChild}\n className={cn(accordionTrigger({ size }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {chevronPosition === \"start\" && indicator}\n {icon && <span className={accordionIcon}>{icon}</span>}\n <span className={accordionLabel}>{own}</span>\n {chevronPosition === \"end\" && indicator}\n </>\n ))}\n </Ark.ItemTrigger>\n </Title>\n )\n}\n\nexport type AccordionItemContentProps = Ark.ItemContentProps &\n WithTestId & {\n classNames?: CollapseClassNames\n }\n\n/**\n * The panel. Bypasses Ark's own JS-measured height animation entirely —\n * `Ark.ItemContent` is merged (`asChild`) onto this kit's own `Collapse`\n * primitive, driven by the item's live `expanded` state off `Ark.ItemContext`.\n *\n * `hidden` is explicitly pinned to `false`: Ark's nested Collapsible machine\n * (every `Item` is one under the hood) drops it to `true` within a frame of\n * closing — it detects \"no CSS `animation`\" (only `Collapse`'s `transition`)\n * and immediately calls the exit \"complete\" — which would otherwise clip the\n * close animation to nothing via `display: none`. `Collapse`'s own zero-height\n * `overflow-clip` state is what actually hides the panel instead (the same\n * trade-off `NavLink` already makes for its nested items).\n *\n * The size-based padding lives on an *extra* inner `<div>` wrapping `children`\n * — not on `Collapse`'s own `classNames.content` slot — because that slot\n * *is* the CSS grid item `Collapse` collapses. A grid item's own padding\n * always occupies space regardless of `min-height: 0`, so padding placed\n * there stalls the `0fr` track a few pixels short of a true collapse (the\n * same pattern `NavLink` already uses for its nested-items padding).\n */\nconst ItemContent = ({\n children,\n className,\n classNames,\n testId,\n asChild,\n ...rest\n}: AccordionItemContentProps) => {\n const { size } = useContext(AccordionStyleContext)\n return (\n <Ark.ItemContext>\n {(item) => (\n <Ark.ItemContent asChild>\n <Collapse\n open={item.expanded}\n hidden={false}\n className={className}\n classNames={classNames}\n {...props({ \"data-testid\": testId })}\n {...rest}\n asChild={asChild}\n >\n {composeChildren(asChild, children, (own) => (\n <div className={accordionContent({ size })}>{own}</div>\n ))}\n </Collapse>\n </Ark.ItemContent>\n )}\n </Ark.ItemContext>\n )\n}\n\nexport { Item, ItemContent, ItemIndicator, ItemTrigger, Root }\nexport const ItemContext = Ark.ItemContext\nexport const Context = Ark.Context\n","\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport {\n type AccordionRootProps,\n Item,\n ItemContent,\n ItemContext,\n ItemIndicator,\n ItemTrigger,\n Root,\n} from \"./accordion\"\n\n/**\n * Data-driven Accordion — the convenience wrapper over the composable parts,\n * for the common case of a flat list of label + panel pairs:\n *\n * <Accordion\n * data={[\n * { value: \"billing\", label: \"Billing\", content: <Billing /> },\n * { value: \"shipping\", label: \"Shipping\", content: <Shipping /> },\n * ]}\n * />\n *\n * Drop to `Accordion.Root` / `Accordion.Item` / `Accordion.ItemTrigger` /\n * `Accordion.ItemContent` for anything the flat array can't express (custom\n * trigger content, interleaved non-item elements, …).\n */\n\n/** One section: a trigger label and its panel content. */\nexport type AccordionItem = {\n value: string\n label: ReactNode\n content: ReactNode\n disabled?: boolean\n /** Leading icon on the trigger, before the label. */\n icon?: ReactNode\n /** `data-testid` on the trigger; the matching content panel gets\n * `` `${testId}-content` ``. Defaults to `` `accordion-${value}` `` /\n * `` `accordion-${value}-content` `` when omitted. */\n testId?: string\n}\n\n/** The `data` array `Accordion` is generic over. */\nexport type AccordionData = ReadonlyArray<AccordionItem>\n\nexport type AccordionProps<Data extends AccordionData = AccordionData> = Omit<\n AccordionRootProps,\n \"children\" | \"asChild\"\n> &\n ForbidAsChild & {\n /** Sections, in order. Each needs its own `content`. */\n data: Data\n }\n\nconst AccordionComponent = <const Data extends AccordionData>({\n data,\n asChild: _asChild,\n ...root\n}: AccordionProps<Data>) => (\n <Root {...root}>\n {data.map((item) => {\n const testId = item.testId ?? `accordion-${item.value}`\n return (\n <Item key={item.value} value={item.value} disabled={item.disabled}>\n <ItemTrigger icon={item.icon} testId={testId}>\n {item.label}\n </ItemTrigger>\n <ItemContent testId={`${testId}-content`}>{item.content}</ItemContent>\n </Item>\n )\n })}\n </Root>\n)\n\n/**\n * The public `Accordion` export — callable for the data-driven form, with the\n * composable parts attached (like `Tabs`/`Menu`). `<Accordion data={…}>` and\n * `<Accordion.Root>…</Accordion.Root>` both work from one import.\n */\nexport const Accordion = Object.assign(AccordionComponent, {\n Root,\n Item,\n ItemTrigger,\n ItemContent,\n ItemIndicator,\n ItemContext,\n})\n"]}
@@ -20,10 +20,9 @@ import type { WithTestId } from "../../lib/test-id";
20
20
  * icon children are decoration.
21
21
  *
22
22
  * `asChild` renders the single child with ActionIcon's styling. Ark's
23
- * factory uses `Children.only`, so only one element can survive the swap —
24
- * `loading`'s spinner replaces *that* element's own children (see
25
- * `withAsChildLoading` below) rather than the element itself, same trick as
26
- * `Button`'s `withAsChildContent`. The `onClick` guard (`preventWhileLoading`)
23
+ * factory clones exactly one element, so `loading`'s spinner replaces
24
+ * *that* element's own children (`withAsChildContent`, `lib/as-child.ts`)
25
+ * rather than the element itself. The `onClick` guard (`preventWhileLoading`)
27
26
  * goes on the same clone, since `disabled` doesn't do anything on an
28
27
  * arbitrary `asChild` element (e.g. an `<a>`) — same reason the `opacity-50`
29
28
  * dimming and `pointer-events-none` blocking are keyed off `data-loading`
@@ -1 +1 @@
1
- {"version":3,"file":"action-icon.d.ts","sourceRoot":"","sources":["../../../src/components/action-icon/action-icon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,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;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,kBAAkB;;;;8EAyDvB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAC/F,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AACzF,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;AAE7F,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,GACjE,YAAY,CAAC,OAAO,kBAAkB,CAAC,GACvC,UAAU,GAAG;IACX,kEAAkE;IAClE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAQH,eAAO,MAAM,UAAU,sHAcpB,eAAe,gCA8BjB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  "use client";
2
- export { ActionIcon } from '../../chunk-VLUKI3HL.js';
2
+ export { ActionIcon } from '../../chunk-S7N4LGLZ.js';
3
3
  import '../../chunk-NSDM3FEB.js';
4
+ import '../../chunk-I4SQQIP5.js';
4
5
  import '../../chunk-WYCMIIRR.js';
5
6
  import '../../chunk-B2LCHXUB.js';
6
7
  import '../../chunk-QP4I37PA.js';
@@ -72,7 +72,7 @@ export type AlertProps = Omit<AlertRootProps, "title" | "color"> & ToastHue<Aler
72
72
  * bespoke layout, compose the parts directly: `Alert.Root`, `.Icon`, `.Title`,
73
73
  * `.Description`, `.ActionTrigger`, `.CloseTrigger`.
74
74
  */
75
- declare function AlertComponent({ type, title, description, action, color: _color, icon: _icon, withCloseButton, onClose, ...rest }: AlertProps): import("react").JSX.Element;
75
+ declare function AlertComponent({ type, title, description, action, color: _color, icon: _icon, withCloseButton, onClose, asChild, children, ...rest }: AlertProps): import("react").JSX.Element;
76
76
  /**
77
77
  * `Alert` — the ready-made card (batteries-included), with the compound
78
78
  * parts attached for bespoke composition. Mirrors `Notification`: the bare
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/alert/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,aAAa,EACb,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,KAAK,EAEN,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEhE;;;;;;;;;;;;;;;;GAgBG;AAEH;6BAC6B;AAC7B,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAErD;;;;;;;;wCAQwC;AACxC,eAAO,MAAM,SAAS,oFAUpB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,KAAK,CAAC,GAC9C,UAAU,GAAG;IACX,uEAAuE;IACvE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CAC1B,CAAA;AAEH,QAAA,MAAM,IAAI,0CAA2C,cAAc,gCAOlE,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC,GAC9D,QAAQ,CAAC,SAAS,CAAC,GAAG;IACpB,8BAA8B;IAC9B,KAAK,CAAC,EA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AAM,MAAM,cAAc,GAAG,YAAY,CAAC,KAAK,CAAC,GAC9C,UAAU,GAAG;IACX,uEAAuE;IACvE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CAC1B,CAAA;AAEH,QAAA,MAAM,IAAI,0CAA2C,cAAc,gCAOlE,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC,GAC9D,QAAQ,CAAC,SAAS,CAAC,GAAG;IACpB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,mEAAmE;IACnE,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB;yEACqE;IACrE,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAEH;;;;;;;;;;GAUG;AACH,iBAAS,cAAc,CAAC,EACtB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,KAAK,EACX,eAAuB,EACvB,OAAO,EACP,OAAO,EACP,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,UAAU,+BA2CZ;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK;;;;;;;CAOhB,CAAA"}
@@ -1,15 +1,16 @@
1
1
  "use client";
2
- import { CloseTrigger, ActionTrigger, Description, Title, Icon, TOAST_STATUS } from '../../chunk-EVVMHTCL.js';
2
+ import { CloseTrigger, ActionTrigger, Description, Title, Icon, TOAST_STATUS } from '../../chunk-EBREIC3L.js';
3
3
  import '../../chunk-BEL75C7N.js';
4
4
  import '../../chunk-IG7FBZVM.js';
5
- import '../../chunk-HWNPXAEN.js';
5
+ import '../../chunk-WSIVRDRB.js';
6
6
  import '../../chunk-NSDM3FEB.js';
7
+ import { withAsChildContent } from '../../chunk-I4SQQIP5.js';
7
8
  import { props } from '../../chunk-WYCMIIRR.js';
8
9
  import { focusStyles } from '../../chunk-B2LCHXUB.js';
9
10
  import { cn } from '../../chunk-QP4I37PA.js';
10
11
  import { ark } from '@ark-ui/react';
11
12
  import { cva } from 'class-variance-authority';
12
- import { jsxs, jsx } from 'react/jsx-runtime';
13
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
13
14
 
14
15
  var alertRoot = cva([
15
16
  "flex flex-col w-full",
@@ -40,12 +41,14 @@ function AlertComponent({
40
41
  icon: _icon,
41
42
  withCloseButton = false,
42
43
  onClose,
44
+ asChild,
45
+ children,
43
46
  ...rest
44
47
  }) {
45
48
  const preset = type ? TOAST_STATUS[type] : void 0;
46
49
  const color = preset ? preset.color : _color;
47
50
  const icon = _icon === void 0 ? preset?.icon : _icon;
48
- return /* @__PURE__ */ jsxs(Root, { color, ...rest, children: [
51
+ const card = /* @__PURE__ */ jsxs(Fragment, { children: [
49
52
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-3", children: [
50
53
  icon != null && /* @__PURE__ */ jsx(Icon, { children: icon }),
51
54
  title != null ? /* @__PURE__ */ jsx(Title, { children: title }) : (
@@ -59,6 +62,15 @@ function AlertComponent({
59
62
  title != null && description != null && /* @__PURE__ */ jsx(Description, { children: description }),
60
63
  action != null && /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: action })
61
64
  ] });
65
+ return (
66
+ // Under `asChild` the card becomes the consumer's element (a link to the
67
+ // details, say), with the card's rows folded in ahead of that element's
68
+ // own content.
69
+ /* @__PURE__ */ jsx(Root, { color, asChild, ...rest, children: asChild ? withAsChildContent(children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
70
+ card,
71
+ own
72
+ ] })) : card })
73
+ );
62
74
  }
63
75
  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AA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,qBAAA,EACZ,QAAA,EAAA;AAAA,MAAA,IAAA,IAAQ,IAAA,oBAAQ,GAAA,CAAC,IAAA,EAAA,EAAM,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,MAC5B,KAAA,IAAS,IAAA,mBACR,GAAA,CAAC,KAAA,EAAA,EAAO,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA;AAAA;AAAA;AAAA,QAKd,eAAe,IAAA,oBAAQ,GAAA,CAAC,WAAA,EAAA,EAAY,SAAA,EAAU,QAAQ,QAAA,EAAA,WAAA,EAAY;AAAA,OAAA;AAAA,MAEnE,eAAA,oBAAmB,GAAA,CAAC,YAAA,EAAA,EAAa,OAAA,EAAS,OAAA,EAAS;AAAA,KAAA,EACtD,CAAA;AAAA,IACC,SAAS,IAAA,IAAQ,WAAA,IAAe,IAAA,oBAAQ,GAAA,CAAC,eAAa,QAAA,EAAA,WAAA,EAAY,CAAA;AAAA,IAClE,UAAU,IAAA,oBAAQ,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,0CAA0C,QAAA,EAAA,MAAA,EAAO;AAAA,GAAA,EACrF,CAAA;AAEJ;AAOO,IAAM,KAAA,GAAQ,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACjD,IAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAC","file":"index.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport type { ReactNode, Ref } from \"react\"\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 {\n ActionTrigger,\n CloseTrigger,\n Description,\n Icon,\n Title,\n TOAST_STATUS,\n} from \"../notification/notification\"\nimport type { ToastHue, ToastType } from \"../notification/types\"\n\n/**\n * Alert — a wide, static status card with `Notification`'s look (`type`\n * presets, the `Icon` / `Title` / `Description` / `ActionTrigger` /\n * `CloseTrigger` parts) but full-width and always-mounted — for an inline note\n * in page content (a doc callout, a form-level warning), not a floating,\n * self-dismissing toast.\n *\n * It reuses `Notification`'s parts and `type` → hue/icon presets directly (see\n * `notification.tsx`). The root surface is its own: a toast floats over\n * arbitrary content and needs its opaque, blurred panel, while an alert sits\n * on the page, so it takes a translucent tint of its hue instead.\n *\n * @example\n * ```tsx\n * <Alert type=\"warning\" title=\"Breaking change\" description=\"…\" />\n * ```\n */\n\n/** Same presets as `Notification`, minus `loading` — a static alert isn't an\n * in-flight async state. */\nexport type AlertType = Exclude<ToastType, \"loading\">\n\n/** The card surface. Full-width and flat (no toast shadow/animation) — meant\n * to sit inline in page content rather than float above it. Translucent, so\n * it blends into whatever surface hosts it: a faint `--c-solid` wash carries\n * the status across the whole card, edged by a translucent `--c-solid` (the\n * edge `ChoiceCardGroup`'s checked `filled` card uses). The wash comes from\n * `--c-solid`, not `--c-soft`: light-mode `--c-soft` is the near-white 50 step\n * for every hue but `neutral` (a 16% black), so warning/error vanished while\n * info turned into the heaviest card. `text-(--c-solid)` still tints the icon\n * and the `current`-based triggers. */\nexport const alertRoot = cva([\n \"flex flex-col w-full\",\n \"rounded-card border px-3 py-3\",\n // Any-focus outline suppression, matching the other overlay surfaces\n // (Modal, Drawer, Popover, Tooltip) — the card can take programmatic focus.\n \"focus:outline-none\",\n focusStyles({ offset: false }),\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"overflow-clip\",\n \"bg-(--c-solid)/8 dark:bg-(--c-solid)/12 border-(--c-solid)/45 text-(--c-solid)\",\n])\n\nexport type AlertRootProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** Accent palette. Drives the `--c-*` slot vars for the whole card. */\n color?: Color\n ref?: Ref<HTMLDivElement>\n }\n\nconst Root = ({ className, color, testId, ...rest }: AlertRootProps) => (\n <ark.div\n data-color={color}\n className={cn(alertRoot(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/**\n * Props for the ready-made `Alert` card — the presentational fields it\n * shares with `Notification` (`type` / `title` / `description` / `action` /\n * `color` / `icon`), minus the collapse/notifier-only plumbing\n * that only makes sense for a spawned toast.\n */\nexport type AlertProps = Omit<AlertRootProps, \"title\" | \"color\"> &\n ToastHue<AlertType> & {\n /** The header row content. */\n title?: ReactNode\n /** Secondary line, below the header row. */\n description?: ReactNode\n /** Action row (e.g. an `ActionTrigger`), below the description. */\n action?: ReactNode\n /** Override the leading glyph; `null` hides it. */\n icon?: ReactNode | null\n /** Render the close (×) button; `onClose` fires when pressed. Static by\n * default — an inline alert usually isn't meant to be dismissed. */\n withCloseButton?: boolean\n /** Invoked when the close (×) button is pressed. */\n onClose?: () => void\n }\n\n/**\n * The ready-made **`Alert` card** — the presentational body composed from a\n * status-shaped object, same as `Notification`: resolves `type` → `TOAST_STATUS`\n * (hue + leading icon), lets an explicit `color`/`icon` override\n * (`icon={null}` hides the glyph), and lays out the icon/title/close row plus\n * the description and action sections underneath.\n *\n * No store, presence, or collapse state — it's always fully mounted. For a\n * bespoke layout, compose the parts directly: `Alert.Root`, `.Icon`, `.Title`,\n * `.Description`, `.ActionTrigger`, `.CloseTrigger`.\n */\nfunction AlertComponent({\n type,\n title,\n description,\n action,\n color: _color,\n icon: _icon,\n withCloseButton = false,\n onClose,\n ...rest\n}: AlertProps) {\n const preset = type ? TOAST_STATUS[type] : undefined\n // `type` and `color` are exclusive (see `ToastHue`); the preset wins\n // should a JS caller pass both anyway.\n const color = preset ? preset.color : (_color as Color | undefined)\n // Not `??`: an explicit `icon={null}` (hide the glyph) must not fall\n // through to the preset the way an omitted (`undefined`) icon does.\n const icon = _icon === undefined ? preset?.icon : _icon\n\n return (\n <Root color={color} {...rest}>\n <div className=\"flex flex-row gap-3\">\n {icon != null && <Icon>{icon}</Icon>}\n {title != null ? (\n <Title>{title}</Title>\n ) : (\n // No title: the description takes its place in the header row\n // (still in description styling, just not stranded under a lone\n // icon) instead of sitting in its own block below.\n description != null && <Description className=\"mt-0\">{description}</Description>\n )}\n {withCloseButton && <CloseTrigger onClick={onClose} />}\n </div>\n {title != null && description != null && <Description>{description}</Description>}\n {action != null && <div className=\"mt-2 flex flex-wrap items-center gap-2\">{action}</div>}\n </Root>\n )\n}\n\n/**\n * `Alert` — the ready-made card (batteries-included), with the compound\n * parts attached for bespoke composition. Mirrors `Notification`: the bare\n * name is the convenience form; `.Root` and friends are the primitives.\n */\nexport const Alert = Object.assign(AlertComponent, {\n Root,\n Icon,\n Title,\n Description,\n ActionTrigger,\n CloseTrigger,\n})\n"]}
1
+ {"version":3,"sources":["../../../src/components/alert/alert.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAoDO,IAAM,YAAY,GAAA,CAAI;AAAA,EAC3B,sBAAA;AAAA,EACA,+BAAA;AAAA;AAAA;AAAA,EAGA,oBAAA;AAAA,EACA,WAAA,CAAY,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAA;AAAA,EAC7B,8CAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC;AASD,IAAM,IAAA,GAAO,CAAC,EAAE,SAAA,EAAW,OAAO,MAAA,EAAQ,GAAG,MAAK,qBAChD,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IACC,YAAA,EAAY,KAAA;AAAA,IACZ,SAAA,EAAW,EAAA,CAAG,SAAA,EAAU,EAAG,SAAS,CAAA;AAAA,IACnC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAqCF,SAAS,cAAA,CAAe;AAAA,EACtB,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA,EAAO,MAAA;AAAA,EACP,IAAA,EAAM,KAA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,EAAA,EAAK,KAAA,EAAc,OAAA,EAAmB,GAAG,IAAA,EACvC,QAAA,EAAA,OAAA,GACG,kBAAA,CAAmB,QAAA,EAAU,CAAC,GAAA,qBAC5B,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,IAAA;AAAA,MACA;AAAA,KAAA,EACH,CACD,IACD,IAAA,EACN;AAAA;AAEJ;AAOO,IAAM,KAAA,GAAQ,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACjD,IAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAC","file":"index.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport type { ReactNode, Ref } 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 {\n ActionTrigger,\n CloseTrigger,\n Description,\n Icon,\n Title,\n TOAST_STATUS,\n} from \"../notification/notification\"\nimport type { ToastHue, ToastType } from \"../notification/types\"\n\n/**\n * Alert — a wide, static status card with `Notification`'s look (`type`\n * presets, the `Icon` / `Title` / `Description` / `ActionTrigger` /\n * `CloseTrigger` parts) but full-width and always-mounted — for an inline note\n * in page content (a doc callout, a form-level warning), not a floating,\n * self-dismissing toast.\n *\n * It reuses `Notification`'s parts and `type` → hue/icon presets directly (see\n * `notification.tsx`). The root surface is its own: a toast floats over\n * arbitrary content and needs its opaque, blurred panel, while an alert sits\n * on the page, so it takes a translucent tint of its hue instead.\n *\n * @example\n * ```tsx\n * <Alert type=\"warning\" title=\"Breaking change\" description=\"…\" />\n * ```\n */\n\n/** Same presets as `Notification`, minus `loading` — a static alert isn't an\n * in-flight async state. */\nexport type AlertType = Exclude<ToastType, \"loading\">\n\n/** The card surface. Full-width and flat (no toast shadow/animation) — meant\n * to sit inline in page content rather than float above it. Translucent, so\n * it blends into whatever surface hosts it: a faint `--c-solid` wash carries\n * the status across the whole card, edged by a translucent `--c-solid` (the\n * edge `ChoiceCardGroup`'s checked `filled` card uses). The wash comes from\n * `--c-solid`, not `--c-soft`: light-mode `--c-soft` is the near-white 50 step\n * for every hue but `neutral` (a 16% black), so warning/error vanished while\n * info turned into the heaviest card. `text-(--c-solid)` still tints the icon\n * and the `current`-based triggers. */\nexport const alertRoot = cva([\n \"flex flex-col w-full\",\n \"rounded-card border px-3 py-3\",\n // Any-focus outline suppression, matching the other overlay surfaces\n // (Modal, Drawer, Popover, Tooltip) — the card can take programmatic focus.\n \"focus:outline-none\",\n focusStyles({ offset: false }),\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"overflow-clip\",\n \"bg-(--c-solid)/8 dark:bg-(--c-solid)/12 border-(--c-solid)/45 text-(--c-solid)\",\n])\n\nexport type AlertRootProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** Accent palette. Drives the `--c-*` slot vars for the whole card. */\n color?: Color\n ref?: Ref<HTMLDivElement>\n }\n\nconst Root = ({ className, color, testId, ...rest }: AlertRootProps) => (\n <ark.div\n data-color={color}\n className={cn(alertRoot(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/**\n * Props for the ready-made `Alert` card — the presentational fields it\n * shares with `Notification` (`type` / `title` / `description` / `action` /\n * `color` / `icon`), minus the collapse/notifier-only plumbing\n * that only makes sense for a spawned toast.\n */\nexport type AlertProps = Omit<AlertRootProps, \"title\" | \"color\"> &\n ToastHue<AlertType> & {\n /** The header row content. */\n title?: ReactNode\n /** Secondary line, below the header row. */\n description?: ReactNode\n /** Action row (e.g. an `ActionTrigger`), below the description. */\n action?: ReactNode\n /** Override the leading glyph; `null` hides it. */\n icon?: ReactNode | null\n /** Render the close (×) button; `onClose` fires when pressed. Static by\n * default — an inline alert usually isn't meant to be dismissed. */\n withCloseButton?: boolean\n /** Invoked when the close (×) button is pressed. */\n onClose?: () => void\n }\n\n/**\n * The ready-made **`Alert` card** — the presentational body composed from a\n * status-shaped object, same as `Notification`: resolves `type` → `TOAST_STATUS`\n * (hue + leading icon), lets an explicit `color`/`icon` override\n * (`icon={null}` hides the glyph), and lays out the icon/title/close row plus\n * the description and action sections underneath.\n *\n * No store, presence, or collapse state — it's always fully mounted. For a\n * bespoke layout, compose the parts directly: `Alert.Root`, `.Icon`, `.Title`,\n * `.Description`, `.ActionTrigger`, `.CloseTrigger`.\n */\nfunction AlertComponent({\n type,\n title,\n description,\n action,\n color: _color,\n icon: _icon,\n withCloseButton = false,\n onClose,\n asChild,\n children,\n ...rest\n}: AlertProps) {\n const preset = type ? TOAST_STATUS[type] : undefined\n // `type` and `color` are exclusive (see `ToastHue`); the preset wins\n // should a JS caller pass both anyway.\n const color = preset ? preset.color : (_color as Color | undefined)\n // Not `??`: an explicit `icon={null}` (hide the glyph) must not fall\n // through to the preset the way an omitted (`undefined`) icon does.\n const icon = _icon === undefined ? preset?.icon : _icon\n\n const card = (\n <>\n <div className=\"flex flex-row gap-3\">\n {icon != null && <Icon>{icon}</Icon>}\n {title != null ? (\n <Title>{title}</Title>\n ) : (\n // No title: the description takes its place in the header row\n // (still in description styling, just not stranded under a lone\n // icon) instead of sitting in its own block below.\n description != null && <Description className=\"mt-0\">{description}</Description>\n )}\n {withCloseButton && <CloseTrigger onClick={onClose} />}\n </div>\n {title != null && description != null && <Description>{description}</Description>}\n {action != null && <div className=\"mt-2 flex flex-wrap items-center gap-2\">{action}</div>}\n </>\n )\n\n return (\n // Under `asChild` the card becomes the consumer's element (a link to the\n // details, say), with the card's rows folded in ahead of that element's\n // own content.\n <Root color={color} asChild={asChild} {...rest}>\n {asChild\n ? withAsChildContent(children, (own) => (\n <>\n {card}\n {own}\n </>\n ))\n : card}\n </Root>\n )\n}\n\n/**\n * `Alert` — the ready-made card (batteries-included), with the compound\n * parts attached for bespoke composition. Mirrors `Notification`: the bare\n * name is the convenience form; `.Root` and friends are the primitives.\n */\nexport const Alert = Object.assign(AlertComponent, {\n Root,\n Icon,\n Title,\n Description,\n ActionTrigger,\n CloseTrigger,\n})\n"]}
@@ -1,5 +1,6 @@
1
1
  import { type HTMLArkProps } from "@ark-ui/react";
2
2
  import { type ComponentPropsWithoutRef, type Ref } from "react";
3
+ import type { NoAsChild } from "../../lib/as-child";
3
4
  import type { Size } from "../../lib/sizes";
4
5
  import type { WithTestId } from "../../lib/test-id";
5
6
  export type AppShellProps = HTMLArkProps<"div"> & WithTestId & {
@@ -12,7 +13,7 @@ export type AppShellProps = HTMLArkProps<"div"> & WithTestId & {
12
13
  ref?: Ref<HTMLDivElement>;
13
14
  };
14
15
  declare const AppShellRoot: ({ breakpoint, className, style, children, ref, testId, ...rest }: AppShellProps) => import("react").JSX.Element;
15
- export type AppShellSidebarProps = HTMLArkProps<"aside"> & WithTestId & {
16
+ export type AppShellSidebarProps = NoAsChild<HTMLArkProps<"aside">> & WithTestId & {
16
17
  /** Width when expanded, from the kit's Size scale. @default "md" */
17
18
  size?: Size;
18
19
  };
@@ -44,7 +45,7 @@ export type AppShellSidebarProps = HTMLArkProps<"aside"> & WithTestId & {
44
45
  * arbitrary `<aside>` props don't apply to `Drawer`'s own curated prop
45
46
  * surface.
46
47
  */
47
- declare const AppShellSidebar: ({ size, className, children, testId, ...rest }: AppShellSidebarProps) => import("react").JSX.Element;
48
+ declare const AppShellSidebar: ({ size, className, children, testId, asChild: _asChild, ...rest }: AppShellSidebarProps) => import("react").JSX.Element;
48
49
  export type AppShellSidebarHeaderProps = ComponentPropsWithoutRef<"div"> & WithTestId;
49
50
  declare const AppShellSidebarHeader: ({ className, testId, ...rest }: AppShellSidebarHeaderProps) => import("react").JSX.Element;
50
51
  export type AppShellSidebarBodyProps = ComponentPropsWithoutRef<"div"> & WithTestId;
@@ -1 +1 @@
1
- {"version":3,"file":"app-sh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M,sBAAsB,iCAAkC,2BAA2B,uCAgBxF,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;CAWnB,CAAA"}
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
  import { mergeRefs } from '../../chunk-UVYTJQTJ.js';
3
- import { Drawer } from '../../chunk-2H46IXW4.js';
3
+ import { Drawer } from '../../chunk-HAQJQFE6.js';
4
4
  import { useContainerQuery } from '../../chunk-P3XMBETI.js';
5
5
  import '../../chunk-AIQG7IIT.js';
6
6
  import '../../chunk-7P32XCEU.js';
7
7
  import '../../chunk-BUIHQJGE.js';
8
- import '../../chunk-VLUKI3HL.js';
8
+ import '../../chunk-S7N4LGLZ.js';
9
9
  import '../../chunk-NSDM3FEB.js';
10
+ import '../../chunk-I4SQQIP5.js';
10
11
  import { props } from '../../chunk-WYCMIIRR.js';
11
12
  import '../../chunk-B2LCHXUB.js';
12
13
  import { cn } from '../../chunk-QP4I37PA.js';
@@ -59,6 +60,7 @@ var AppShellSidebar = ({
59
60
  className,
60
61
  children,
61
62
  testId,
63
+ asChild: _asChild,
62
64
  ...rest
63
65
  }) => {
64
66
  const { isMobile, mobileOpen, setMobileOpen } = useAppShell();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAoEA,IAAM,eAAA,GAAkB,cAA2C,IAAI,CAAA;AAEvE,SAAS,WAAA,GAAoC;AAC3C,EAAA,MAAM,GAAA,GAAM,WAAW,eAAe,CAAA;AACtC,EAAA,IAAI,CAAC,GAAA,EAAK,MAAM,IAAI,MAAM,oDAAoD,CAAA;AAC9E,EAAA,OAAO,GAAA;AACT;AAaA,IAAM,eAAe,CAAC;AAAA,EACpB,UAAA,GAAa,GAAA;AAAA,EACb,SAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAqB;AACnB,EAAA,MAA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AAA,EAAY;AAEhD,EAAA,IAAI,CAAC,UAAU,OAAO,IAAA;AAEtB,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA,CAAI,MAAA;AAAA,IAAJ;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACJ,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,OAAA,EAAS,CAAC,KAAA,KAAU;AAClB,QAAA,OAAA,GAAU,KAAK,CAAA;AACf,QAAA,aAAA,CAAc,CAAC,IAAA,KAAS,CAAC,IAAI,CAAA;AAAA,MAC/B;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,QAAA,GAAW,MAAA,CAAO,MAAA,CAAO,YAAA,EAAc;AAAA,EAClD,OAAA,EAAS,eAAA;AAAA,EACT,aAAA,EAAe,qBAAA;AAAA,EACf,WAAA,EAAa,mBAAA;AAAA,EACb,aAAA,EAAe,qBAAA;AAAA,EACf,cAAA,EAAgB,sBAAA;AAAA,EAChB,MAAA,EAAQ,cAAA;AAAA,EACR,IAAA,EAAM,YAAA;AAAA,EACN,IAAA,EAAM,YAAA;AAAA,EACN,OAAA,EAAS,eAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAC","file":"index.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type Dispatch,\n type Ref,\n type SetStateAction,\n useContext,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useContainerQuery } from \"../../lib/use-container-query\"\nimport { Drawer } from \"../drawer/drawer\"\n\n/**\n * AppShell — header / sidebar / main / aside app frame, laid out with CSS\n * Grid named areas. Sidebar spans the full height on the left; Header\n * spans the rest of the top (above both Main and Aside — Header never\n * spans over Sidebar, but it does span over Aside, unlike Sidebar itself);\n * Aside sits below Header, full height only within the remaining row,\n * beside Main. No Footer — add one only once a real consumer needs it.\n *\n * Sidebar is always visible on desktop — there's no way to hide it when\n * there's room to show it. Below `breakpoint`, it becomes an overlay\n * `Drawer` instead, toggled by `AppShell.SidebarTrigger` (which renders\n * nothing on desktop — there's nothing to toggle). Aside works\n * differently: it's always mounted (no JS/container-query gating at all,\n * unlike Sidebar) and purely CSS-driven — hidden below a `@xl` container\n * breakpoint, visible above it — mirroring how fumadocs' own docs layout\n * keeps its table-of-contents rail always in the DOM. There is no\n * `variant`/`color` axis — like `Table`/`Grid`/`Flex`, this is a\n * structural primitive, not a themed surface.\n *\n * `breakpoint` and Aside's `@xl` cutoff are both measured against\n * `AppShell`'s own rendered width, not the browser viewport — so this\n * behaves correctly embedded in a panel, a resizable pane, or anything\n * narrower than the window, not just when it fills the whole page.\n *\n * <AppShell>\n * <AppShell.Sidebar>\n * <AppShell.SidebarHeader>Logo</AppShell.SidebarHeader>\n * <AppShell.SidebarBody>Nav — scrolls</AppShell.SidebarBody>\n * <AppShell.SidebarFooter>User menu</AppShell.SidebarFooter>\n * </AppShell.Sidebar>\n * <AppShell.Header>\n * <AppShell.SidebarTrigger asChild>\n * <ActionIcon variant=\"subtle\" color=\"neutral\"><PanelLeft /></ActionIcon>\n * </AppShell.SidebarTrigger>\n * </AppShell.Header>\n * <AppShell.Main>Page content</AppShell.Main>\n * <AppShell.Aside>On this page…</AppShell.Aside>\n * </AppShell>\n */\n\ntype AppShellContextValue = {\n /** Mobile drawer open state — always uncontrolled, never a public prop. */\n mobileOpen: boolean\n setMobileOpen: Dispatch<SetStateAction<boolean>>\n isMobile: boolean\n}\n\nconst AppShellContext = createContext<AppShellContextValue | null>(null)\n\nfunction useAppShell(): AppShellContextValue {\n const ctx = useContext(AppShellContext)\n if (!ctx) throw new Error(\"AppShell parts must be rendered within <AppShell>.\")\n return ctx\n}\n\nexport type AppShellProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** AppShell's own rendered width (px) below which Sidebar renders as an\n * overlay `Drawer` instead of a grid column — measured against the\n * container itself via `ResizeObserver`, not the viewport. @default 768 */\n breakpoint?: number\n /** Lands on the grid root; also used internally to measure `breakpoint`\n * against the container's own width. */\n ref?: Ref<HTMLDivElement>\n }\n\nconst AppShellRoot = ({\n breakpoint = 768,\n className,\n style,\n children,\n ref,\n testId,\n ...rest\n}: AppShellProps) => {\n const rootRef = useRef<HTMLDivElement>(null)\n const [mobileOpen, setMobileOpen] = useState(false)\n const isMobile = useContainerQuery(rootRef, breakpoint)\n\n return (\n <AppShellContext.Provider value={{ mobileOpen, setMobileOpen, isMobile }}>\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n ref={mergeRefs(ref, rootRef)}\n style={{ gridTemplateAreas: `\"sidebar header header\" \"sidebar main aside\"`, ...style }}\n className={cn(\n \"@container grid h-dvh grid-cols-[auto_1fr_auto] grid-rows-[auto_1fr] overflow-hidden\",\n className,\n )}\n >\n {children}\n </ark.div>\n </AppShellContext.Provider>\n )\n}\n\nconst SIDEBAR_WIDTH: Record<Size, string> = {\n xs: \"w-56\",\n sm: \"w-64\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-96\",\n}\n\nexport type AppShellSidebarProps = HTMLArkProps<\"aside\"> &\n WithTestId & {\n /** Width when expanded, from the kit's Size scale. @default \"md\" */\n size?: Size\n }\n\n/**\n * Below `breakpoint`, renders through the kit's own `Drawer` instead of the\n * grid column — same `SidebarHeader`/`SidebarBody`/`SidebarFooter` children\n * either way, mirroring the desktop docked aside's layout: `Drawer`'s own\n * body normally forces every child through one scrolling container, which\n * would otherwise carry Header/Footer along with the scroll instead of\n * pinning them — `classNames.body` turns it into the same flex column\n * (Header/Footer as plain shrink-0 flex items, only SidebarBody's own\n * `overflow-y-auto` scrolls) instead. Full width, opening from the logical\n * end edge (right in LTR). `withCloseButton={false}` — at full width,\n * `Drawer`'s own generic close bar would just stack a second, redundant\n * header above `SidebarHeader`; render a `SidebarTrigger` inside\n * `SidebarHeader` itself instead for one unified bar with a visible close\n * affordance (swipe-to-dismiss on `Drawer`'s content still works too, but\n * isn't the only way out — not discoverable, and risky to rely on alone in\n * a sidebar full of tappable nav rows).\n *\n * Exclusive branch, not always-mounted-and-CSS-hidden like `Aside` — unlike\n * `Aside`, `Sidebar` has two genuinely different structural forms (a plain\n * `<aside>` vs. a portaled dialog with focus-trap/ARIA machinery), so\n * keeping both permanently mounted would mean literally duplicating\n * `children` (and any side effects inside it) into two simultaneous trees.\n * Matches fumadocs' own sidebar, which is JS-conditional for the same\n * reason — only its TOC (this component's `Aside`) goes the always-mounted\n * route. Only `size`/`className`/`children` carry over to `Drawer` mode;\n * arbitrary `<aside>` props don't apply to `Drawer`'s own curated prop\n * surface.\n */\nconst AppShellSidebar = ({\n size = \"md\",\n className,\n children,\n testId,\n ...rest\n}: AppShellSidebarProps) => {\n const { isMobile, mobileOpen, setMobileOpen } = useAppShell()\n\n if (isMobile) {\n return (\n <Drawer\n open={mobileOpen}\n onOpenChange={setMobileOpen}\n placement=\"end\"\n withCloseButton={false}\n testId={testId}\n classNames={{ body: \"flex flex-col overflow-hidden p-0\" }}\n className={cn(\"w-full max-w-none\", className)}\n >\n {children}\n </Drawer>\n )\n }\n\n return (\n <ark.aside\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:sidebar] flex flex-col overflow-hidden text-gray-light-900 dark:text-gray-dark-25\",\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"border-e border-brand-900/20 bg-brand-50/90 dark:border-white/15 dark:bg-brand-950/85\",\n SIDEBAR_WIDTH[size],\n className,\n )}\n >\n {children}\n </ark.aside>\n )\n}\n\n// Shared by SidebarHeader and Header so the two sit at the same height and\n// Header's bottom border lines up level with SidebarHeader's own bottom edge\n// — sizing each off its own padding + content independently (the original\n// approach) drifts out of sync as soon as one holds taller content than the\n// other.\nconst HEADER_HEIGHT_CLASS = \"h-14\"\n\nexport type AppShellSidebarHeaderProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n// Plain flex sibling, not routed through the `ark.*` factory — mirrors\n// Drawer.Header/.Body/.Footer, which aren't either.\nconst AppShellSidebarHeader = ({ className, testId, ...rest }: AppShellSidebarHeaderProps) => (\n <div\n className={cn(HEADER_HEIGHT_CLASS, \"flex shrink-0 items-center gap-2 px-4\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarBodyProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/**\n * The scroll region — the only part of Sidebar that scrolls. The mask fades\n * content at the top/bottom edges instead of clipping it on a hard line\n * (fumadocs' own docs sidebar uses the same static mask on its nav\n * viewport); `overscroll-contain` stops scrolling the list from chaining\n * into scrolling the rest of the page once it hits either end.\n */\nconst AppShellSidebarBody = ({ className, testId, ...rest }: AppShellSidebarBodyProps) => (\n <div\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain p-4\",\n \"[mask-image:linear-gradient(to_bottom,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarFooterProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nconst AppShellSidebarFooter = ({ className, testId, ...rest }: AppShellSidebarFooterProps) => (\n <div className={cn(\"shrink-0 p-4\", className)} {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellHeaderProps = HTMLArkProps<\"header\"> & WithTestId\n\nconst AppShellHeader = ({ className, testId, ...rest }: AppShellHeaderProps) => (\n <ark.header\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n HEADER_HEIGHT_CLASS,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"[grid-area:header] flex shrink-0 items-center gap-3 border-b border-brand-900/20 bg-brand-50/90 px-4 text-gray-light-900\",\n \"dark:border-white/15 dark:bg-brand-950/85 dark:text-gray-dark-25\",\n className,\n )}\n />\n)\n\nexport type AppShellMainSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\n// A local scale rather than the shared Size one: these are page widths, not\n// control widths, so they read off the kit's own `--width-*` tokens\n// (theme.css) — the vocabulary Modal already uses — instead of inventing a\n// second set. Static class strings so Tailwind's build-time scanner picks them\n// up, in the same lookup-map shape as SIDEBAR_WIDTH/ASIDE_WIDTH above.\nconst MAIN_MEASURE: Record<AppShellMainSize, string> = {\n sm: \"[--app-shell-measure:var(--width-xl)]\", // 48rem / 768px\n md: \"[--app-shell-measure:var(--width-2xl)]\", // 64rem / 1024px\n lg: \"[--app-shell-measure:var(--width-3xl)]\", // 80rem / 1280px\n xl: \"[--app-shell-measure:var(--width-4xl)]\", // 90rem / 1440px\n}\n\nexport type AppShellMainProps = HTMLArkProps<\"main\"> &\n WithTestId & {\n /** Width of the content column, from the kit's `--width-*` tokens:\n * `sm` 48rem · `md` 64rem · `lg` 80rem · `xl` 90rem. @default \"lg\" */\n size?: AppShellMainSize\n /** Drop the content column entirely — children fill Main edge to edge, as\n * they did before the column existed. For pages whose Main *is* one\n * full-canvas component (a Schedule, a DataTable sized to the viewport)\n * rather than a document. @default false */\n fluid?: boolean\n }\n\n/**\n * The page region. By default its children sit in a centered content column,\n * so a page of prose and forms doesn't stretch to whatever width the window\n * happens to be; `AppShell.Full` opts one child out to the full width, and\n * `AppShell.Content` puts arbitrary content back in.\n *\n * The column is three grid tracks — `1fr`, the column, `1fr` — rather than\n * inline padding, which is what lets a child span *past* the gutters without\n * negative margins, `100vw`, or any JS measurement. Percentages in track\n * sizing resolve against Main's own content box, so the column is correct\n * beside a sidebar, inside a resizable pane, or in a bounded docs preview\n * frame, with no media query and no `ResizeObserver` involved. Below\n * `measure + 2 × gutter` the middle track collapses to `100% - 2 × gutter`\n * and the `1fr` tracks land exactly on the gutter, so the column degrades\n * into plain padding continuously, without a breakpoint.\n *\n * `align-content: start` is load-bearing: grid's default (`normal`, i.e.\n * `stretch`) hands leftover vertical space to every auto row, which would\n * space a short page's blocks out down the viewport.\n *\n * <AppShell.Main>\n * <Title>Quarterly sales</Title>\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n * </AppShell.Main>\n */\nconst AppShellMain = ({\n size = \"lg\",\n fluid = false,\n className,\n testId,\n ...rest\n}: AppShellMainProps) => (\n <ark.main\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:main] min-h-0 overflow-y-auto\",\n !fluid && [\n // Gutter doubles as Main's block padding, so content never butts\n // against Header. Overridable per page with\n // `className=\"[--app-shell-gutter:2rem]\"`; both vars inherit, which is\n // what lets `AppShell.Content` re-derive the column at any depth.\n \"[--app-shell-gutter:1.5rem] py-(--app-shell-gutter)\",\n MAIN_MEASURE[size],\n \"grid content-start grid-cols-[1fr_min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))_1fr]\",\n // Both placement rules are authored here, on the same element, so\n // their relative weight is decided by specificity — `.main > [data-full]`\n // (0,2,0) over `.main > *` (0,1,0) — and never by where Tailwind\n // happens to sort two same-weight utilities. `min-w-0` stops a wide\n // child (a DataTable) overflowing the column, and zeroes a spanning\n // child's min-content contribution so it can't inflate the gutters.\n \"[&>*]:col-start-2 [&>*]:min-w-0\",\n \"[&>[data-full]]:col-span-full\",\n ],\n className,\n )}\n />\n)\n\nexport type AppShellFullProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Opts one child of `AppShell.Main` out of the content column, spanning every\n * track so it reaches Main's true edges — for the things a column actively\n * hurts: data tables, carousels, heroes, full-width backgrounds.\n *\n * Carries no layout class of its own; it only marks itself with `data-full`,\n * and Main's own rule does the placement (see `AppShellMain`). `asChild`\n * merges that marker onto the component itself, so nothing extra lands in the\n * DOM:\n *\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n *\n * Only works as a *direct* child of Main — breaking out of a grid means being\n * in it. Wrap content in a `Full` band and use `AppShell.Content` inside it\n * rather than nesting `Full` deeper.\n */\nconst AppShellFull = ({ testId, ...rest }: AppShellFullProps) => (\n <ark.div data-full=\"\" {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellContentProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Puts content back into Main's column — the counterpart to `AppShell.Full`,\n * for a full-width band whose *text* should still line up with the rest of the\n * page:\n *\n * <AppShell.Full asChild>\n * <section className=\"bg-brand-50 py-16\">\n * <AppShell.Content>\n * <Title>Welcome back</Title>\n * </AppShell.Content>\n * </section>\n * </AppShell.Full>\n *\n * The width expression is the same one Main gives its middle track, resolved\n * against this element's own containing block, so the edges line up exactly at\n * both ends of the range — full measure when there's room, gutter-only when\n * there isn't. Reading the inherited custom properties rather than using\n * `subgrid` is deliberate: subgrid would only reach one level down, only from\n * an element spanning every track, and would break on any wrapper in between.\n * This works at any depth, including inside a `fluid` Main.\n */\nconst AppShellContent = ({ className, testId, ...rest }: AppShellContentProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"mx-auto w-[min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))]\",\n className,\n )}\n />\n)\n\nconst ASIDE_WIDTH: Record<Size, string> = {\n xs: \"@xl:w-56\",\n sm: \"@xl:w-64\",\n md: \"@xl:w-72\",\n lg: \"@xl:w-80\",\n xl: \"@xl:w-96\",\n}\n\nexport type AppShellAsideProps = HTMLArkProps<\"aside\"> &\n WithTestId & {\n /** Width when visible, from the kit's Size scale. @default \"md\" */\n size?: Size\n }\n\n/**\n * The right region, below `Header` (unlike `Sidebar`, which spans the full\n * height beside it). Unlike `Sidebar`, always mounted — hidden below a\n * `@xl` *container* breakpoint (1280px of `AppShell`'s own width, via\n * Tailwind's native container queries — `AppShell`'s root carries\n * `@container`) and shown above it, purely via static classes, no\n * `useContainerQuery`/context involved. Matches fumadocs' own docs layout,\n * which keeps its table-of-contents rail always in the DOM rather than\n * conditionally unmounting it — no hydration mismatch is possible when\n * nothing renders differently based on client-only state. Fixed to `@xl`\n * rather than a configurable prop like Sidebar's `breakpoint`: Sidebar's is\n * JS-driven and can take any pixel value at runtime, but a static Tailwind\n * class can't take an arbitrary runtime breakpoint without breaking the\n * build-time class scanner.\n */\nconst AppShellAside = ({ size = \"md\", className, testId, ...rest }: AppShellAsideProps) => (\n <ark.aside\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:aside] hidden flex-col overflow-y-auto text-gray-light-900 dark:text-gray-dark-25\",\n \"@xl:flex\",\n ASIDE_WIDTH[size],\n className,\n )}\n />\n)\n\nexport type AppShellSidebarTriggerProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * Opens/closes the mobile `Drawer`. Renders nothing above `breakpoint` —\n * Sidebar is always visible on desktop, so there's nothing to toggle.\n * `asChild`-able, like every other kit trigger.\n */\nconst AppShellSidebarTrigger = ({ onClick, testId, ...rest }: AppShellSidebarTriggerProps) => {\n const { isMobile, setMobileOpen } = useAppShell()\n\n if (!isMobile) return null\n\n return (\n <ark.button\n type=\"button\"\n {...props({ \"data-testid\": testId })}\n {...rest}\n onClick={(event) => {\n onClick?.(event)\n setMobileOpen((open) => !open)\n }}\n />\n )\n}\n\nexport const AppShell = Object.assign(AppShellRoot, {\n Sidebar: AppShellSidebar,\n SidebarHeader: AppShellSidebarHeader,\n SidebarBody: AppShellSidebarBody,\n SidebarFooter: AppShellSidebarFooter,\n SidebarTrigger: AppShellSidebarTrigger,\n Header: AppShellHeader,\n Main: AppShellMain,\n Full: AppShellFull,\n Content: AppShellContent,\n Aside: AppShellAside,\n})\n"]}
1
+ {"version":3,"sources":["../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA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":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type Dispatch,\n type Ref,\n type SetStateAction,\n useContext,\n useRef,\n useState,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useContainerQuery } from \"../../lib/use-container-query\"\nimport { Drawer } from \"../drawer/drawer\"\n\n/**\n * AppShell — header / sidebar / main / aside app frame, laid out with CSS\n * Grid named areas. Sidebar spans the full height on the left; Header\n * spans the rest of the top (above both Main and Aside — Header never\n * spans over Sidebar, but it does span over Aside, unlike Sidebar itself);\n * Aside sits below Header, full height only within the remaining row,\n * beside Main. No Footer — add one only once a real consumer needs it.\n *\n * Sidebar is always visible on desktop — there's no way to hide it when\n * there's room to show it. Below `breakpoint`, it becomes an overlay\n * `Drawer` instead, toggled by `AppShell.SidebarTrigger` (which renders\n * nothing on desktop — there's nothing to toggle). Aside works\n * differently: it's always mounted (no JS/container-query gating at all,\n * unlike Sidebar) and purely CSS-driven — hidden below a `@xl` container\n * breakpoint, visible above it — mirroring how fumadocs' own docs layout\n * keeps its table-of-contents rail always in the DOM. There is no\n * `variant`/`color` axis — like `Table`/`Grid`/`Flex`, this is a\n * structural primitive, not a themed surface.\n *\n * `breakpoint` and Aside's `@xl` cutoff are both measured against\n * `AppShell`'s own rendered width, not the browser viewport — so this\n * behaves correctly embedded in a panel, a resizable pane, or anything\n * narrower than the window, not just when it fills the whole page.\n *\n * <AppShell>\n * <AppShell.Sidebar>\n * <AppShell.SidebarHeader>Logo</AppShell.SidebarHeader>\n * <AppShell.SidebarBody>Nav — scrolls</AppShell.SidebarBody>\n * <AppShell.SidebarFooter>User menu</AppShell.SidebarFooter>\n * </AppShell.Sidebar>\n * <AppShell.Header>\n * <AppShell.SidebarTrigger asChild>\n * <ActionIcon variant=\"subtle\" color=\"neutral\"><PanelLeft /></ActionIcon>\n * </AppShell.SidebarTrigger>\n * </AppShell.Header>\n * <AppShell.Main>Page content</AppShell.Main>\n * <AppShell.Aside>On this page…</AppShell.Aside>\n * </AppShell>\n */\n\ntype AppShellContextValue = {\n /** Mobile drawer open state — always uncontrolled, never a public prop. */\n mobileOpen: boolean\n setMobileOpen: Dispatch<SetStateAction<boolean>>\n isMobile: boolean\n}\n\nconst AppShellContext = createContext<AppShellContextValue | null>(null)\n\nfunction useAppShell(): AppShellContextValue {\n const ctx = useContext(AppShellContext)\n if (!ctx) throw new Error(\"AppShell parts must be rendered within <AppShell>.\")\n return ctx\n}\n\nexport type AppShellProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** AppShell's own rendered width (px) below which Sidebar renders as an\n * overlay `Drawer` instead of a grid column — measured against the\n * container itself via `ResizeObserver`, not the viewport. @default 768 */\n breakpoint?: number\n /** Lands on the grid root; also used internally to measure `breakpoint`\n * against the container's own width. */\n ref?: Ref<HTMLDivElement>\n }\n\nconst AppShellRoot = ({\n breakpoint = 768,\n className,\n style,\n children,\n ref,\n testId,\n ...rest\n}: AppShellProps) => {\n const rootRef = useRef<HTMLDivElement>(null)\n const [mobileOpen, setMobileOpen] = useState(false)\n const isMobile = useContainerQuery(rootRef, breakpoint)\n\n return (\n <AppShellContext.Provider value={{ mobileOpen, setMobileOpen, isMobile }}>\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n ref={mergeRefs(ref, rootRef)}\n style={{ gridTemplateAreas: `\"sidebar header header\" \"sidebar main aside\"`, ...style }}\n className={cn(\n \"@container grid h-dvh grid-cols-[auto_1fr_auto] grid-rows-[auto_1fr] overflow-hidden\",\n className,\n )}\n >\n {children}\n </ark.div>\n </AppShellContext.Provider>\n )\n}\n\nconst SIDEBAR_WIDTH: Record<Size, string> = {\n xs: \"w-56\",\n sm: \"w-64\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-96\",\n}\n\nexport type AppShellSidebarProps = NoAsChild<HTMLArkProps<\"aside\">> &\n WithTestId & {\n /** Width when expanded, from the kit's Size scale. @default \"md\" */\n size?: Size\n }\n\n/**\n * Below `breakpoint`, renders through the kit's own `Drawer` instead of the\n * grid column — same `SidebarHeader`/`SidebarBody`/`SidebarFooter` children\n * either way, mirroring the desktop docked aside's layout: `Drawer`'s own\n * body normally forces every child through one scrolling container, which\n * would otherwise carry Header/Footer along with the scroll instead of\n * pinning them — `classNames.body` turns it into the same flex column\n * (Header/Footer as plain shrink-0 flex items, only SidebarBody's own\n * `overflow-y-auto` scrolls) instead. Full width, opening from the logical\n * end edge (right in LTR). `withCloseButton={false}` — at full width,\n * `Drawer`'s own generic close bar would just stack a second, redundant\n * header above `SidebarHeader`; render a `SidebarTrigger` inside\n * `SidebarHeader` itself instead for one unified bar with a visible close\n * affordance (swipe-to-dismiss on `Drawer`'s content still works too, but\n * isn't the only way out — not discoverable, and risky to rely on alone in\n * a sidebar full of tappable nav rows).\n *\n * Exclusive branch, not always-mounted-and-CSS-hidden like `Aside` — unlike\n * `Aside`, `Sidebar` has two genuinely different structural forms (a plain\n * `<aside>` vs. a portaled dialog with focus-trap/ARIA machinery), so\n * keeping both permanently mounted would mean literally duplicating\n * `children` (and any side effects inside it) into two simultaneous trees.\n * Matches fumadocs' own sidebar, which is JS-conditional for the same\n * reason — only its TOC (this component's `Aside`) goes the always-mounted\n * route. Only `size`/`className`/`children` carry over to `Drawer` mode;\n * arbitrary `<aside>` props don't apply to `Drawer`'s own curated prop\n * surface.\n */\nconst AppShellSidebar = ({\n size = \"md\",\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: AppShellSidebarProps) => {\n const { isMobile, mobileOpen, setMobileOpen } = useAppShell()\n\n if (isMobile) {\n return (\n <Drawer\n open={mobileOpen}\n onOpenChange={setMobileOpen}\n placement=\"end\"\n withCloseButton={false}\n testId={testId}\n classNames={{ body: \"flex flex-col overflow-hidden p-0\" }}\n className={cn(\"w-full max-w-none\", className)}\n >\n {children}\n </Drawer>\n )\n }\n\n return (\n <ark.aside\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:sidebar] flex flex-col overflow-hidden text-gray-light-900 dark:text-gray-dark-25\",\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"border-e border-brand-900/20 bg-brand-50/90 dark:border-white/15 dark:bg-brand-950/85\",\n SIDEBAR_WIDTH[size],\n className,\n )}\n >\n {children}\n </ark.aside>\n )\n}\n\n// Shared by SidebarHeader and Header so the two sit at the same height and\n// Header's bottom border lines up level with SidebarHeader's own bottom edge\n// — sizing each off its own padding + content independently (the original\n// approach) drifts out of sync as soon as one holds taller content than the\n// other.\nconst HEADER_HEIGHT_CLASS = \"h-14\"\n\nexport type AppShellSidebarHeaderProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n// Plain flex sibling, not routed through the `ark.*` factory — mirrors\n// Drawer.Header/.Body/.Footer, which aren't either.\nconst AppShellSidebarHeader = ({ className, testId, ...rest }: AppShellSidebarHeaderProps) => (\n <div\n className={cn(HEADER_HEIGHT_CLASS, \"flex shrink-0 items-center gap-2 px-4\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarBodyProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/**\n * The scroll region — the only part of Sidebar that scrolls. The mask fades\n * content at the top/bottom edges instead of clipping it on a hard line\n * (fumadocs' own docs sidebar uses the same static mask on its nav\n * viewport); `overscroll-contain` stops scrolling the list from chaining\n * into scrolling the rest of the page once it hits either end.\n */\nconst AppShellSidebarBody = ({ className, testId, ...rest }: AppShellSidebarBodyProps) => (\n <div\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain p-4\",\n \"[mask-image:linear-gradient(to_bottom,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarFooterProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nconst AppShellSidebarFooter = ({ className, testId, ...rest }: AppShellSidebarFooterProps) => (\n <div className={cn(\"shrink-0 p-4\", className)} {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellHeaderProps = HTMLArkProps<\"header\"> & WithTestId\n\nconst AppShellHeader = ({ className, testId, ...rest }: AppShellHeaderProps) => (\n <ark.header\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n HEADER_HEIGHT_CLASS,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"[grid-area:header] flex shrink-0 items-center gap-3 border-b border-brand-900/20 bg-brand-50/90 px-4 text-gray-light-900\",\n \"dark:border-white/15 dark:bg-brand-950/85 dark:text-gray-dark-25\",\n className,\n )}\n />\n)\n\nexport type AppShellMainSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\n// A local scale rather than the shared Size one: these are page widths, not\n// control widths, so they read off the kit's own `--width-*` tokens\n// (theme.css) — the vocabulary Modal already uses — instead of inventing a\n// second set. Static class strings so Tailwind's build-time scanner picks them\n// up, in the same lookup-map shape as SIDEBAR_WIDTH/ASIDE_WIDTH above.\nconst MAIN_MEASURE: Record<AppShellMainSize, string> = {\n sm: \"[--app-shell-measure:var(--width-xl)]\", // 48rem / 768px\n md: \"[--app-shell-measure:var(--width-2xl)]\", // 64rem / 1024px\n lg: \"[--app-shell-measure:var(--width-3xl)]\", // 80rem / 1280px\n xl: \"[--app-shell-measure:var(--width-4xl)]\", // 90rem / 1440px\n}\n\nexport type AppShellMainProps = HTMLArkProps<\"main\"> &\n WithTestId & {\n /** Width of the content column, from the kit's `--width-*` tokens:\n * `sm` 48rem · `md` 64rem · `lg` 80rem · `xl` 90rem. @default \"lg\" */\n size?: AppShellMainSize\n /** Drop the content column entirely — children fill Main edge to edge, as\n * they did before the column existed. For pages whose Main *is* one\n * full-canvas component (a Schedule, a DataTable sized to the viewport)\n * rather than a document. @default false */\n fluid?: boolean\n }\n\n/**\n * The page region. By default its children sit in a centered content column,\n * so a page of prose and forms doesn't stretch to whatever width the window\n * happens to be; `AppShell.Full` opts one child out to the full width, and\n * `AppShell.Content` puts arbitrary content back in.\n *\n * The column is three grid tracks — `1fr`, the column, `1fr` — rather than\n * inline padding, which is what lets a child span *past* the gutters without\n * negative margins, `100vw`, or any JS measurement. Percentages in track\n * sizing resolve against Main's own content box, so the column is correct\n * beside a sidebar, inside a resizable pane, or in a bounded docs preview\n * frame, with no media query and no `ResizeObserver` involved. Below\n * `measure + 2 × gutter` the middle track collapses to `100% - 2 × gutter`\n * and the `1fr` tracks land exactly on the gutter, so the column degrades\n * into plain padding continuously, without a breakpoint.\n *\n * `align-content: start` is load-bearing: grid's default (`normal`, i.e.\n * `stretch`) hands leftover vertical space to every auto row, which would\n * space a short page's blocks out down the viewport.\n *\n * <AppShell.Main>\n * <Title>Quarterly sales</Title>\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n * </AppShell.Main>\n */\nconst AppShellMain = ({\n size = \"lg\",\n fluid = false,\n className,\n testId,\n ...rest\n}: AppShellMainProps) => (\n <ark.main\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:main] min-h-0 overflow-y-auto\",\n !fluid && [\n // Gutter doubles as Main's block padding, so content never butts\n // against Header. Overridable per page with\n // `className=\"[--app-shell-gutter:2rem]\"`; both vars inherit, which is\n // what lets `AppShell.Content` re-derive the column at any depth.\n \"[--app-shell-gutter:1.5rem] py-(--app-shell-gutter)\",\n MAIN_MEASURE[size],\n \"grid content-start grid-cols-[1fr_min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))_1fr]\",\n // Both placement rules are authored here, on the same element, so\n // their relative weight is decided by specificity — `.main > [data-full]`\n // (0,2,0) over `.main > *` (0,1,0) — and never by where Tailwind\n // happens to sort two same-weight utilities. `min-w-0` stops a wide\n // child (a DataTable) overflowing the column, and zeroes a spanning\n // child's min-content contribution so it can't inflate the gutters.\n \"[&>*]:col-start-2 [&>*]:min-w-0\",\n \"[&>[data-full]]:col-span-full\",\n ],\n className,\n )}\n />\n)\n\nexport type AppShellFullProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Opts one child of `AppShell.Main` out of the content column, spanning every\n * track so it reaches Main's true edges — for the things a column actively\n * hurts: data tables, carousels, heroes, full-width backgrounds.\n *\n * Carries no layout class of its own; it only marks itself with `data-full`,\n * and Main's own rule does the placement (see `AppShellMain`). `asChild`\n * merges that marker onto the component itself, so nothing extra lands in the\n * DOM:\n *\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n *\n * Only works as a *direct* child of Main — breaking out of a grid means being\n * in it. Wrap content in a `Full` band and use `AppShell.Content` inside it\n * rather than nesting `Full` deeper.\n */\nconst AppShellFull = ({ testId, ...rest }: AppShellFullProps) => (\n <ark.div data-full=\"\" {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellContentProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Puts content back into Main's column — the counterpart to `AppShell.Full`,\n * for a full-width band whose *text* should still line up with the rest of the\n * page:\n *\n * <AppShell.Full asChild>\n * <section className=\"bg-brand-50 py-16\">\n * <AppShell.Content>\n * <Title>Welcome back</Title>\n * </AppShell.Content>\n * </section>\n * </AppShell.Full>\n *\n * The width expression is the same one Main gives its middle track, resolved\n * against this element's own containing block, so the edges line up exactly at\n * both ends of the range — full measure when there's room, gutter-only when\n * there isn't. Reading the inherited custom properties rather than using\n * `subgrid` is deliberate: subgrid would only reach one level down, only from\n * an element spanning every track, and would break on any wrapper in between.\n * This works at any depth, including inside a `fluid` Main.\n */\nconst AppShellContent = ({ className, testId, ...rest }: AppShellContentProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"mx-auto w-[min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))]\",\n className,\n )}\n />\n)\n\nconst ASIDE_WIDTH: Record<Size, string> = {\n xs: \"@xl:w-56\",\n sm: \"@xl:w-64\",\n md: \"@xl:w-72\",\n lg: \"@xl:w-80\",\n xl: \"@xl:w-96\",\n}\n\nexport type AppShellAsideProps = HTMLArkProps<\"aside\"> &\n WithTestId & {\n /** Width when visible, from the kit's Size scale. @default \"md\" */\n size?: Size\n }\n\n/**\n * The right region, below `Header` (unlike `Sidebar`, which spans the full\n * height beside it). Unlike `Sidebar`, always mounted — hidden below a\n * `@xl` *container* breakpoint (1280px of `AppShell`'s own width, via\n * Tailwind's native container queries — `AppShell`'s root carries\n * `@container`) and shown above it, purely via static classes, no\n * `useContainerQuery`/context involved. Matches fumadocs' own docs layout,\n * which keeps its table-of-contents rail always in the DOM rather than\n * conditionally unmounting it — no hydration mismatch is possible when\n * nothing renders differently based on client-only state. Fixed to `@xl`\n * rather than a configurable prop like Sidebar's `breakpoint`: Sidebar's is\n * JS-driven and can take any pixel value at runtime, but a static Tailwind\n * class can't take an arbitrary runtime breakpoint without breaking the\n * build-time class scanner.\n */\nconst AppShellAside = ({ size = \"md\", className, testId, ...rest }: AppShellAsideProps) => (\n <ark.aside\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:aside] hidden flex-col overflow-y-auto text-gray-light-900 dark:text-gray-dark-25\",\n \"@xl:flex\",\n ASIDE_WIDTH[size],\n className,\n )}\n />\n)\n\nexport type AppShellSidebarTriggerProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * Opens/closes the mobile `Drawer`. Renders nothing above `breakpoint` —\n * Sidebar is always visible on desktop, so there's nothing to toggle.\n * `asChild`-able, like every other kit trigger.\n */\nconst AppShellSidebarTrigger = ({ onClick, testId, ...rest }: AppShellSidebarTriggerProps) => {\n const { isMobile, setMobileOpen } = useAppShell()\n\n if (!isMobile) return null\n\n return (\n <ark.button\n type=\"button\"\n {...props({ \"data-testid\": testId })}\n {...rest}\n onClick={(event) => {\n onClick?.(event)\n setMobileOpen((open) => !open)\n }}\n />\n )\n}\n\nexport const AppShell = Object.assign(AppShellRoot, {\n Sidebar: AppShellSidebar,\n SidebarHeader: AppShellSidebarHeader,\n SidebarBody: AppShellSidebarBody,\n SidebarFooter: AppShellSidebarFooter,\n SidebarTrigger: AppShellSidebarTrigger,\n Header: AppShellHeader,\n Main: AppShellMain,\n Full: AppShellFull,\n Content: AppShellContent,\n Aside: AppShellAside,\n})\n"]}
@@ -1,15 +1,16 @@
1
1
  "use client";
2
2
  import { controlOpenProps } from '../../chunk-5FDOOG4J.js';
3
3
  import { normalizeSelectData, filterSelectData } from '../../chunk-TWGCWKRV.js';
4
- import { Combobox } from '../../chunk-TNNH3FVQ.js';
5
- import { inputControlClasses, inputSlot } from '../../chunk-QMW7D5GU.js';
6
- import { FieldShell } from '../../chunk-UNSAA7YG.js';
7
- import { popoverClearTrigger } from '../../chunk-VZ2TPU4B.js';
4
+ import { Combobox } from '../../chunk-6OLTJYSX.js';
5
+ import { inputControlClasses, inputSlot } from '../../chunk-5OQLFX47.js';
6
+ import { FieldShell } from '../../chunk-FHG54IT5.js';
7
+ import { popoverClearTrigger } from '../../chunk-6GDMSENK.js';
8
8
  import '../../chunk-AIQG7IIT.js';
9
9
  import '../../chunk-7P32XCEU.js';
10
10
  import '../../chunk-BUIHQJGE.js';
11
11
  import { useUncontrolled } from '../../chunk-BEL75C7N.js';
12
12
  import { CloseIcon } from '../../chunk-IG7FBZVM.js';
13
+ import '../../chunk-I4SQQIP5.js';
13
14
  import { props } from '../../chunk-WYCMIIRR.js';
14
15
  import { cn } from '../../chunk-QP4I37PA.js';
15
16
  import { Combobox as Combobox$1 } from '@ark-ui/react/combobox';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/autocomplete/autocomplete.t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O,IAAI,CAAC,KAAA,yBACT,QAAA,CAAS,KAAA,EAAT,EAAiC,KAAA,EAAO,KAAA,CAAM,KAAA,EAC5C,gBAAM,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA,EAAA,EADV,KAAA,CAAM,KAE3B,CACD,CAAA,GACD,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA;AAAA,UACzB,SAAS,IAAA,oBAAQ,GAAA,CAAC,QAAA,CAAS,KAAA,EAAT,EAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,SAAA,EAC3C;AAAA;AAAA;AAAA,GACF;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport { props } from \"../../lib/props\"\nimport {\n type ClearSectionMode,\n filterSelectData,\n type ItemRenderState,\n type NormalizedItem,\n normalizeSelectData,\n type SelectData,\n type SelectPayload,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Combobox } from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport { type InputSize, type InputVariant, inputControlClasses, inputSlot } from \"../input/input\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { popoverClearTrigger } from \"../popover/popover\"\n\n/**\n * Autocomplete — free-text input with a suggestion popover, on the `Combobox`\n * engine. Unlike `Select`, the **value is the typed string** (`allowCustomValue`):\n * `data` are only suggestions, and the user can type anything or pick one.\n *\n * - `data` accepts the same shapes as `Select` (strings / objects / groups).\n * - Suggestions filter as you type. Once the query exactly\n * matches a suggestion (e.g. right after picking one) the full list shows\n * again rather than collapsing to that single match.\n * - Label / description / error come from the built-in `Field` wrapper.\n */\n\ntype AutocompleteClassNames = {\n field?: string\n control?: string\n input?: string\n option?: string\n popover?: string\n}\n\nexport type AutocompleteProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Suggestions: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled input text (this is the value). */\n value?: string\n /** Uncontrolled initial text. */\n defaultValue?: string\n /** Fires with the input text on every change (typing or picking a suggestion). */\n onChange?: (value: string) => void\n /**\n * Render each suggestion yourself. Receives the item — including its typed\n * `payload` — and its live `{ selected, highlighted }` state; you own the whole\n * row, including any check affordance. Omit it to render the label + selected\n * check.\n */\n renderItem?: (item: NormalizedItem<SelectPayload<Data>>, state: ItemRenderState) => ReactNode\n /** Placeholder shown while the field is empty — this same field also filters the\n * suggestion list, so there's no separate search placeholder. */\n placeholder?: string\n /** Show a clear button once there's text. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the clear button / chevron. */\n endSlot?: ReactNode\n /** Message shown when no suggestion matches. Pass `null` to render nothing. */\n empty?: ReactNode\n size?: InputSize\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for the underlying input (form submission). */\n name?: string\n /** Forwarded to the input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: AutocompleteClassNames\n }\n\nexport const Autocomplete = <const Data extends SelectData = SelectData>({\n data,\n value,\n defaultValue,\n onChange,\n renderItem,\n placeholder,\n clearable,\n clearSectionMode = \"replace\",\n startSlot,\n endSlot,\n empty = \"Nothing found\",\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: AutocompleteProps<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 const [query, setQuery] = useUncontrolled({\n value,\n defaultValue,\n onChange,\n finalValue: \"\",\n })\n\n // Clear shows once there's text; in \"replace\" mode it hides the chevron.\n const showClear = Boolean(clearable && query)\n\n // Normalize once per `data`; only the filter re-runs as the query changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const { collection, items, groups } = useMemo(() => {\n const q = query.trim().toLowerCase()\n // Once the query exactly matches an option (e.g. right after\n // picking one) show the full list again rather than just that match.\n const exact = normalized.items.some((i) => i.label.toLowerCase() === q)\n const shouldFilter = q.length > 0 && !exact\n return filterSelectData(\n normalized,\n (item) => !shouldFilter || item.label.toLowerCase().includes(q),\n )\n }, [normalized, query])\n\n const renderOption = (item: NormalizedItem) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item as NormalizedItem<SelectPayload<Data>>, state)\n : item.label}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root\n collection={collection}\n inputValue={query}\n onInputValueChange={(details) => setQuery(details.inputValue)}\n allowCustomValue\n openOnClick\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={className}\n >\n <Combobox.Context>\n {(api) => (\n <Combobox.Control\n className={classNames?.control}\n startSlot={startSlot}\n {...props({ \"data-invalid\": isInvalid })}\n // Tablet affordance: a tap on the field's dead zones (start/end slots,\n // padding) opens the suggestions and focuses the input. The input,\n // clear ✕ and chevron keep their own taps. Inert when disabled/readOnly.\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n >\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on the\n real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`, replicated\n here. `onBlur` / `aria-invalid` pass straight through. */}\n <ArkCombobox.Input\n placeholder={placeholder}\n name={name}\n onBlur={onBlur}\n ref={ref}\n aria-invalid={isInvalid || undefined}\n {...props({ \"data-testid\": testId })}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {/* The value here is the typed text, not a machine selection, so Ark's\n `value`-gated ClearTrigger stays hidden — clear the input directly\n instead. A real (tabbable) button; `preventDefault` keeps focus on\n the input through the tap. */}\n {showClear && (\n <button\n type=\"button\"\n aria-label=\"Clear value\"\n onPointerDown={(event) => event.preventDefault()}\n onClick={() => setQuery(\"\")}\n className={popoverClearTrigger}\n >\n <CloseIcon />\n </button>\n )}\n {(clearSectionMode === \"both\" || !showClear) && (\n <Combobox.Trigger aria-label=\"Show options\" data-chevron />\n )}\n </Combobox.Control>\n )}\n </Combobox.Context>\n\n <Combobox.Content className={classNames?.popover}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Content>\n </Combobox.Root>\n )\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 >\n {control}\n </FieldShell>\n )\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/autocomplete/autocomplete.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;;;;;;AA6FO,IAAM,eAAe,CAA6C;AAAA,EACvE,IAAA;AAA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gBAAM,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA,EAAA,EADV,KAAA,CAAM,KAE3B,CACD,CAAA,GACD,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA;AAAA,UACzB,SAAS,IAAA,oBAAQ,GAAA,CAAC,QAAA,CAAS,KAAA,EAAT,EAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,SAAA,EAC3C;AAAA;AAAA;AAAA,GACF;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport { props } from \"../../lib/props\"\nimport {\n type ClearSectionMode,\n filterSelectData,\n type ItemRenderState,\n type NormalizedItem,\n normalizeSelectData,\n type SelectData,\n type SelectPayload,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Combobox } from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport { type InputSize, type InputVariant, inputControlClasses, inputSlot } from \"../input/input\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { popoverClearTrigger } from \"../popover/popover\"\n\n/**\n * Autocomplete — free-text input with a suggestion popover, on the `Combobox`\n * engine. Unlike `Select`, the **value is the typed string** (`allowCustomValue`):\n * `data` are only suggestions, and the user can type anything or pick one.\n *\n * - `data` accepts the same shapes as `Select` (strings / objects / groups).\n * - Suggestions filter as you type. Once the query exactly\n * matches a suggestion (e.g. right after picking one) the full list shows\n * again rather than collapsing to that single match.\n * - Label / description / error come from the built-in `Field` wrapper.\n */\n\ntype AutocompleteClassNames = {\n field?: string\n control?: string\n input?: string\n option?: string\n popover?: string\n}\n\nexport type AutocompleteProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Suggestions: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled input text (this is the value). */\n value?: string\n /** Uncontrolled initial text. */\n defaultValue?: string\n /** Fires with the input text on every change (typing or picking a suggestion). */\n onChange?: (value: string) => void\n /**\n * Render each suggestion yourself. Receives the item — including its typed\n * `payload` — and its live `{ selected, highlighted }` state; you own the whole\n * row, including any check affordance. Omit it to render the label + selected\n * check.\n */\n renderItem?: (item: NormalizedItem<SelectPayload<Data>>, state: ItemRenderState) => ReactNode\n /** Placeholder shown while the field is empty — this same field also filters the\n * suggestion list, so there's no separate search placeholder. */\n placeholder?: string\n /** Show a clear button once there's text. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the clear button / chevron. */\n endSlot?: ReactNode\n /** Message shown when no suggestion matches. Pass `null` to render nothing. */\n empty?: ReactNode\n size?: InputSize\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for the underlying input (form submission). */\n name?: string\n /** Forwarded to the input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: AutocompleteClassNames\n }\n\nexport const Autocomplete = <const Data extends SelectData = SelectData>({\n data,\n value,\n defaultValue,\n onChange,\n renderItem,\n placeholder,\n clearable,\n clearSectionMode = \"replace\",\n startSlot,\n endSlot,\n empty = \"Nothing found\",\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: AutocompleteProps<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 const [query, setQuery] = useUncontrolled({\n value,\n defaultValue,\n onChange,\n finalValue: \"\",\n })\n\n // Clear shows once there's text; in \"replace\" mode it hides the chevron.\n const showClear = Boolean(clearable && query)\n\n // Normalize once per `data`; only the filter re-runs as the query changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const { collection, items, groups } = useMemo(() => {\n const q = query.trim().toLowerCase()\n // Once the query exactly matches an option (e.g. right after\n // picking one) show the full list again rather than just that match.\n const exact = normalized.items.some((i) => i.label.toLowerCase() === q)\n const shouldFilter = q.length > 0 && !exact\n return filterSelectData(\n normalized,\n (item) => !shouldFilter || item.label.toLowerCase().includes(q),\n )\n }, [normalized, query])\n\n const renderOption = (item: NormalizedItem) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item as NormalizedItem<SelectPayload<Data>>, state)\n : item.label}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root\n collection={collection}\n inputValue={query}\n onInputValueChange={(details) => setQuery(details.inputValue)}\n allowCustomValue\n openOnClick\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={className}\n >\n <Combobox.Context>\n {(api) => (\n <Combobox.Control\n className={classNames?.control}\n startSlot={startSlot}\n {...props({ \"data-invalid\": isInvalid })}\n // Tablet affordance: a tap on the field's dead zones (start/end slots,\n // padding) opens the suggestions and focuses the input. The input,\n // clear ✕ and chevron keep their own taps. Inert when disabled/readOnly.\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n >\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on the\n real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`, replicated\n here. `onBlur` / `aria-invalid` pass straight through. */}\n <ArkCombobox.Input\n placeholder={placeholder}\n name={name}\n onBlur={onBlur}\n ref={ref}\n aria-invalid={isInvalid || undefined}\n {...props({ \"data-testid\": testId })}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {/* The value here is the typed text, not a machine selection, so Ark's\n `value`-gated ClearTrigger stays hidden — clear the input directly\n instead. A real (tabbable) button; `preventDefault` keeps focus on\n the input through the tap. */}\n {showClear && (\n <button\n type=\"button\"\n aria-label=\"Clear value\"\n onPointerDown={(event) => event.preventDefault()}\n onClick={() => setQuery(\"\")}\n className={popoverClearTrigger}\n >\n <CloseIcon />\n </button>\n )}\n {(clearSectionMode === \"both\" || !showClear) && (\n <Combobox.Trigger aria-label=\"Show options\" data-chevron />\n )}\n </Combobox.Control>\n )}\n </Combobox.Context>\n\n <Combobox.Content className={classNames?.popover}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Content>\n </Combobox.Root>\n )\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 >\n {control}\n </FieldShell>\n )\n}\n"]}
@@ -43,9 +43,9 @@ export type AvatarNameMode = "name" | "initials";
43
43
  /**
44
44
  * Default hash pool for `color="name"` / `color="initials"`. Excludes
45
45
  * `brand` (the kit's own primary/CTA identity color — auto-tinting a user
46
- * avatar with it would read as "official") and `gray`/`neutral` (muted, and
47
- * `neutral` is a composed-not-scaled tone per `lib/colors.ts`, so it would
48
- * just look washed-out for some names). Exported so a consumer can extend it,
46
+ * avatar with it would read as "official") and `neutral` (muted, and a
47
+ * composed-not-scaled tone per `lib/colors.ts`, so it would just look
48
+ * washed-out for some names). Exported so a consumer can extend it,
49
49
  * e.g. `palette={[...AVATAR_PALETTE, "brand"]}`.
50
50
  */
51
51
  export declare const AVATAR_PALETTE: Color[];