@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
@@ -90,9 +90,8 @@ describe("chartColors", () => {
90
90
  expect(chartColors(["#ff00aa"])).toEqual(["#ff00aa"])
91
91
  })
92
92
 
93
- it("excludes brand, gray, and neutral from the default palette", () => {
93
+ it("excludes brand and neutral from the default palette", () => {
94
94
  expect(CHART_PALETTE).not.toContain("brand")
95
- expect(CHART_PALETTE).not.toContain("gray")
96
95
  expect(CHART_PALETTE).not.toContain("neutral")
97
96
  })
98
97
  })
@@ -29,7 +29,7 @@ const resolveChartColor = (color: Color): string =>
29
29
  /**
30
30
  * Ordered categorical palette for multi-series charts, built from `COLORS`
31
31
  * (`lib/colors.ts`) minus `brand` (kept free for `color`'s own single-series
32
- * identity) and `gray`/`neutral` (already the chart's own chrome color, via
32
+ * identity) and `neutral` (already the chart's own chrome color, via
33
33
  * `styles.css`).
34
34
  *
35
35
  * The first four — `blue`/`green`/`red`/`pink` — are the only 4-combination
@@ -7,6 +7,7 @@ import {
7
7
  type Ref,
8
8
  useId,
9
9
  } from "react"
10
+ import type { ForbidAsChild } from "../../lib/as-child"
10
11
  import { cn } from "../../lib/cn"
11
12
  import type { Color } from "../../lib/colors"
12
13
  import type { GradientDir, GradientProps } from "../../lib/gradient"
@@ -93,8 +94,9 @@ type ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>
93
94
 
94
95
  export type CircularProgressProps = Omit<
95
96
  ArkRootProps,
96
- "value" | "defaultValue" | "onValueChange" | "ref" | "className" | "children"
97
+ "value" | "defaultValue" | "onValueChange" | "ref" | "className" | "children" | "asChild"
97
98
  > &
99
+ ForbidAsChild &
98
100
  VariantProps<typeof circularRange> &
99
101
  WithTestId & {
100
102
  /** Controlled value (0..max). Pass `null` for the indeterminate state. */
@@ -140,6 +142,7 @@ export const CircularProgress = ({
140
142
  classNames,
141
143
  style,
142
144
  testId,
145
+ asChild: _asChild,
143
146
  ...rest
144
147
  }: CircularProgressProps) => {
145
148
  const isGradient = variant === "gradient"
@@ -227,3 +227,21 @@ describe("Clipboard", () => {
227
227
  })
228
228
  })
229
229
  })
230
+
231
+ describe("Clipboard.Input under asChild", () => {
232
+ // `children` doubled as the trailing slot, so the consumer's input landed
233
+ // beside an Ark input that had nothing to clone, and rendered unwired.
234
+ it("wires the consumer's own input as the read-only value field", () => {
235
+ render(
236
+ <Clipboard.Root value="https://example.com/s/abc">
237
+ <Clipboard.Input asChild>
238
+ <input data-testid="custom" />
239
+ </Clipboard.Input>
240
+ </Clipboard.Root>,
241
+ )
242
+ const input = screen.getByTestId("custom") as HTMLInputElement
243
+ expect(screen.getAllByRole("textbox")).toHaveLength(1)
244
+ expect(input.value).toBe("https://example.com/s/abc")
245
+ expect(input.readOnly).toBe(true)
246
+ })
247
+ })
@@ -95,15 +95,21 @@ const Input = ({
95
95
  classNames,
96
96
  children,
97
97
  testId,
98
+ asChild,
98
99
  ...rest
99
100
  }: ClipboardInputProps) => (
100
101
  <InputBase variant={variant} size={size} readOnly className={cn(className, classNames?.root)}>
102
+ {/* `children` is the trailing slot (usually the copy trigger), except under
103
+ `asChild`, where the single child is the input element itself. */}
101
104
  <Ark.Input
105
+ asChild={asChild}
102
106
  className={cn(inputControlClasses, classNames?.input)}
103
107
  {...props({ "data-testid": testId })}
104
108
  {...rest}
105
- />
106
- {children}
109
+ >
110
+ {asChild ? children : undefined}
111
+ </Ark.Input>
112
+ {!asChild && children}
107
113
  </InputBase>
108
114
  )
109
115
 
@@ -29,6 +29,7 @@ const DEFAULT_TRANSLATIONS: CodeBlockTranslations = {
29
29
 
30
30
  export type CodeBlockClassNames = {
31
31
  root?: string
32
+ title?: string
32
33
  pre?: string
33
34
  controls?: string
34
35
  copyButton?: string
@@ -192,6 +193,9 @@ export type CodeBlockChromeProps = WithTestId & {
192
193
  * `isCollapsible`. */
193
194
  tailContent?: ReactNode
194
195
 
196
+ /** Header row above the code; hosts the toolbar when set. */
197
+ title?: ReactNode
198
+
195
199
  /** @default true */
196
200
  withCopyButton?: boolean
197
201
  /** `null` hides it. @default <CopyIcon/> */
@@ -231,6 +235,7 @@ export function CodeBlockChrome({
231
235
  isCollapsible,
232
236
  headContent,
233
237
  tailContent,
238
+ title,
234
239
  withCopyButton = true,
235
240
  copyIcon,
236
241
  copiedIcon,
@@ -261,6 +266,53 @@ export function CodeBlockChrome({
261
266
  // gap above/below) is the correct treatment there instead.
262
267
  const isSingleLine = !code.includes("\n")
263
268
 
269
+ const toolbar = (controls != null || withCopyButton || isCollapsible) && (
270
+ <div
271
+ className={cn(
272
+ "flex items-center gap-1 p-0.5",
273
+ // In a title header the toolbar sits in-flow at the row's end;
274
+ // otherwise it floats over the code's top-right corner.
275
+ title == null && "absolute right-2 z-10",
276
+ title == null && (isSingleLine ? "top-1/2 -translate-y-1/2" : "top-2"),
277
+ // Same floating-surface chrome every other overlay panel in the
278
+ // kit uses (Popover/Menu/Select's positioner) — border-brand-900/20
279
+ // dark:border-white/15 + bg-brand-50/90 dark:bg-brand-950/85 +
280
+ // backdrop-blur-sm + shadow-lg — rather than an ad-hoc neutral
281
+ // white/gray-dark tint that doesn't match the kit's own convention
282
+ // for "a small panel floating over content." Only while floating —
283
+ // inside the title header it's part of the bar, not over content.
284
+ title == null && popoverChrome,
285
+ classNames?.controls,
286
+ )}
287
+ >
288
+ {controls}
289
+ {isCollapsible && (
290
+ <ExpandTrigger
291
+ expanded={expanded}
292
+ onToggle={() => setExpanded((prev) => !prev)}
293
+ expandLabel={t.expand}
294
+ collapseLabel={t.collapse}
295
+ expandIcon={expandIcon}
296
+ collapseIcon={collapseIcon}
297
+ className={classNames?.expandButton}
298
+ testId={testId && `${testId}-expand`}
299
+ />
300
+ )}
301
+ {withCopyButton && (
302
+ <CopyTrigger
303
+ code={code}
304
+ onCopy={onCopy}
305
+ copyLabel={t.copy}
306
+ copiedLabel={t.copied}
307
+ copyIcon={copyIcon}
308
+ copiedIcon={copiedIcon}
309
+ className={classNames?.copyButton}
310
+ testId={testId && `${testId}-copy`}
311
+ />
312
+ )}
313
+ </div>
314
+ )
315
+
264
316
  return (
265
317
  <div
266
318
  className={cn(
@@ -270,47 +322,19 @@ export function CodeBlockChrome({
270
322
  )}
271
323
  {...props({ "data-testid": testId })}
272
324
  >
273
- {(controls != null || withCopyButton || isCollapsible) && (
325
+ {title != null ? (
274
326
  <div
275
327
  className={cn(
276
- "absolute right-2 z-10 flex items-center gap-1 p-0.5",
277
- isSingleLine ? "top-1/2 -translate-y-1/2" : "top-2",
278
- // Same floating-surface chrome every other overlay panel in the
279
- // kit uses (Popover/Menu/Select's positioner) — border-brand-900/20
280
- // dark:border-white/15 + bg-brand-50/90 dark:bg-brand-950/85 +
281
- // backdrop-blur-sm + shadow-lg — rather than an ad-hoc neutral
282
- // white/gray-dark tint that doesn't match the kit's own convention
283
- // for "a small panel floating over content."
284
- popoverChrome,
285
- classNames?.controls,
328
+ "flex min-h-9 items-center gap-2 border-b border-brand-900/30 dark:border-white/10 ps-4 pe-2",
329
+ "text-xs font-mono text-gray-light-500 dark:text-gray-dark-400",
330
+ classNames?.title,
286
331
  )}
287
332
  >
288
- {controls}
289
- {isCollapsible && (
290
- <ExpandTrigger
291
- expanded={expanded}
292
- onToggle={() => setExpanded((prev) => !prev)}
293
- expandLabel={t.expand}
294
- collapseLabel={t.collapse}
295
- expandIcon={expandIcon}
296
- collapseIcon={collapseIcon}
297
- className={classNames?.expandButton}
298
- testId={testId && `${testId}-expand`}
299
- />
300
- )}
301
- {withCopyButton && (
302
- <CopyTrigger
303
- code={code}
304
- onCopy={onCopy}
305
- copyLabel={t.copy}
306
- copiedLabel={t.copied}
307
- copyIcon={copyIcon}
308
- copiedIcon={copiedIcon}
309
- className={classNames?.copyButton}
310
- testId={testId && `${testId}-copy`}
311
- />
312
- )}
333
+ <span className="min-w-0 flex-1 truncate">{title}</span>
334
+ {toolbar}
313
335
  </div>
336
+ ) : (
337
+ toolbar
314
338
  )}
315
339
 
316
340
  {headContent}
@@ -249,4 +249,31 @@ describe("CodeBlock", () => {
249
249
  expect(copy.className).toContain("focus-visible:ring-2")
250
250
  expect(copy.className).not.toContain("focus-visible:ring-(--c-solid)")
251
251
  })
252
+
253
+ it("renders a title header that hosts the toolbar in-flow instead of floating it", () => {
254
+ render(<CodeBlock code={"a\nb"} title="app.tsx" testId="snippet" />)
255
+ expect(screen.getByText("app.tsx")).toBeTruthy()
256
+ const toolbar = screen.getByTestId("snippet-copy").parentElement
257
+ expect(toolbar?.className).not.toContain("absolute")
258
+ expect(toolbar?.parentElement?.textContent).toContain("app.tsx")
259
+ })
260
+
261
+ it("passes notation={false} through as a disabled parse, keeping markers verbatim", async () => {
262
+ const code = "x // [!code highlight]"
263
+ render(<CodeBlock code={code} notation={false} />)
264
+ await waitFor(() => expect(mockedHighlightCode).toHaveBeenCalled())
265
+ const opts = mockedHighlightCode.mock.calls[0]?.[1]
266
+ expect(opts?.notation?.perLine).toEqual([{ matches: [], stripCount: 0, blank: false }])
267
+ })
268
+
269
+ it("keeps the code itself left-to-right on an RTL page, before and after highlighting", async () => {
270
+ const { container } = render(
271
+ <div dir="rtl">
272
+ <CodeBlock code="const x = 1" />
273
+ </div>,
274
+ )
275
+ expect(container.querySelector("pre")?.getAttribute("dir")).toBe("ltr")
276
+ await waitFor(() => expect(container.querySelector(".shiki")).toBeTruthy())
277
+ expect(container.querySelector(".shiki")?.parentElement?.getAttribute("dir")).toBe("ltr")
278
+ })
252
279
  })
@@ -74,6 +74,13 @@ export type CodeBlockProps = WithTestId & {
74
74
  * `registerTheme` (exported from `@42/ui-react/code-block`) for
75
75
  * registering a custom language/theme the bundled set doesn't ship. */
76
76
  transformers?: ShikiTransformer[]
77
+ /** Parse `// [!code tag]` markers. `false` renders them verbatim instead —
78
+ * for a snippet that teaches the notation itself. @default true */
79
+ notation?: boolean
80
+
81
+ /** Header row above the code (e.g. a filename). When set, the toolbar
82
+ * moves into the header instead of floating over the code. */
83
+ title?: ReactNode
77
84
 
78
85
  /** @default true */
79
86
  withCopyButton?: boolean
@@ -168,13 +175,15 @@ function HighlightedPre({
168
175
  // No horizontal padding here — `.shiki .line` (styles.css) carries its
169
176
  // own `padding-inline` instead, so a decorated line's background hugs
170
177
  // this container's edges rather than stopping short of it.
178
+ // `dir="ltr"`: source code reads left-to-right on an RTL page too — the
179
+ // chrome (title, toolbar) still follows the page direction.
171
180
  // biome-ignore lint/security/noDangerouslySetInnerHtml: trusted, deterministic Shiki output, not user input
172
- return <div className={className} dangerouslySetInnerHTML={{ __html: html }} />
181
+ return <div dir="ltr" className={className} dangerouslySetInnerHTML={{ __html: html }} />
173
182
  }
174
183
  return (
175
184
  // The plain fallback has no `.line` spans of its own to carry padding,
176
185
  // so it keeps the horizontal inset directly.
177
- <pre className={cn(className, "px-4")}>
186
+ <pre dir="ltr" className={cn(className, "px-4")}>
178
187
  <code>{code}</code>
179
188
  </pre>
180
189
  )
@@ -187,6 +196,7 @@ function CodeBlockComponent({
187
196
  tags,
188
197
  gutters,
189
198
  transformers,
199
+ notation: notationEnabled = true,
190
200
  collapsedLines,
191
201
  className,
192
202
  classNames,
@@ -201,7 +211,7 @@ function CodeBlockComponent({
201
211
  // what keeps a `skip`-aware gutter counter's numbering continuous across
202
212
  // the collapse split: each half independently derives its own starting
203
213
  // count from this one shared parse (see `gutters.ts`'s `resolveGutterColumns`).
204
- const notation = useMemo(() => parseNotation(code), [code])
214
+ const notation = useMemo(() => parseNotation(code, notationEnabled), [code, notationEnabled])
205
215
 
206
216
  const preClassName = cn("overflow-x-auto py-3 text-sm leading-relaxed font-mono", classNames?.pre)
207
217
 
@@ -262,12 +262,12 @@ describe("resolveGutterColumns", () => {
262
262
 
263
263
  it("{ text: true, color } renders the payload verbatim, still colored", () => {
264
264
  const columns: CodeBlockGutterColumn[] = [
265
- { kind: "content", tags: { blame: { text: true, color: "gray" } } },
265
+ { kind: "content", tags: { blame: { text: true, color: "neutral" } } },
266
266
  ]
267
267
  const gutters = resolveGutterColumns(columns, notationOf([]), 0)
268
268
  const span = gutters.render(line([{ tag: "blame", payload: "alice" }]))[0]!
269
269
  expect(text(span)).toBe("alice")
270
- expect(span.properties["data-color"]).toBe("gray")
270
+ expect(span.properties["data-color"]).toBe("neutral")
271
271
  })
272
272
 
273
273
  it("a content column with no color/background on the matched tag has no data-color/decoration classes", () => {
@@ -8,6 +8,14 @@ function parse(code: string, i = 0) {
8
8
  }
9
9
 
10
10
  describe("parseNotation", () => {
11
+ it("treats every line as a non-match when disabled, keeping one entry per line", () => {
12
+ const parsed = parseNotation("a // [!code highlight]\n// [!code removed]", false)
13
+ expect(parsed.perLine).toEqual([
14
+ { matches: [], stripCount: 0, blank: false },
15
+ { matches: [], stripCount: 0, blank: false },
16
+ ])
17
+ })
18
+
11
19
  it("returns a no-op parse for a line with no marker", () => {
12
20
  expect(parse("const x = 1")).toEqual({ matches: [], stripCount: 0, blank: false })
13
21
  })
@@ -227,7 +227,10 @@ function parseLine(line: string): ParsedLine {
227
227
  return NO_MATCH
228
228
  }
229
229
 
230
- /** Parses every notation marker in `code`, once, line by line. */
231
- export function parseNotation(code: string): ParsedNotation {
232
- return { perLine: code.split("\n").map(parseLine) }
230
+ /** Parses every notation marker in `code`, once, line by line. With
231
+ * `enabled: false` every line is a non-match — the markers stay in the
232
+ * rendered source verbatim (a snippet that *documents* the notation), while
233
+ * `perLine` keeps one entry per line so gutter counters still size right. */
234
+ export function parseNotation(code: string, enabled = true): ParsedNotation {
235
+ return { perLine: code.split("\n").map((line) => (enabled ? parseLine(line) : NO_MATCH)) }
233
236
  }
@@ -18,6 +18,9 @@ export type CodeBlockStaticProps = WithTestId & {
18
18
  tags?: Record<string, CodeBlockTagStyle>
19
19
  gutters?: CodeBlockGutterColumn[]
20
20
  transformers?: ShikiTransformer[]
21
+ /** @default true */
22
+ notation?: boolean
23
+ title?: ReactNode
21
24
 
22
25
  /** @default true */
23
26
  withCopyButton?: boolean
@@ -44,9 +47,11 @@ export type CodeBlockStaticProps = WithTestId & {
44
47
  * loading-fallback branch: by the time this renders, the `await` in
45
48
  * `CodeBlockStatic` below has already resolved, so there's never a
46
49
  * not-yet-highlighted state to fall back to. */
50
+ // `dir="ltr"`: source code reads left-to-right on an RTL page too — the
51
+ // chrome (title, toolbar) still follows the page direction.
47
52
  function StaticPre({ html, className }: { html: string; className?: string }) {
48
53
  // biome-ignore lint/security/noDangerouslySetInnerHtml: trusted, deterministic Shiki output, not user input
49
- return <div className={className} dangerouslySetInnerHTML={{ __html: html }} />
54
+ return <div dir="ltr" className={className} dangerouslySetInnerHTML={{ __html: html }} />
50
55
  }
51
56
 
52
57
  /**
@@ -86,6 +91,7 @@ export async function CodeBlockStatic({
86
91
  tags,
87
92
  gutters,
88
93
  transformers,
94
+ notation: notationEnabled = true,
89
95
  collapsedLines,
90
96
  className,
91
97
  classNames,
@@ -97,7 +103,7 @@ export async function CodeBlockStatic({
97
103
  const tailCode = isCollapsible ? lines.slice(collapsedLines).join("\n") : ""
98
104
  // Same "parse once over the full source, share across both halves" reason
99
105
  // as CodeBlockComponent's own `notation` — see its comment.
100
- const notation = parseNotation(code)
106
+ const notation = parseNotation(code, notationEnabled)
101
107
 
102
108
  const preClassName = cn("overflow-x-auto py-3 text-sm leading-relaxed font-mono", classNames?.pre)
103
109
 
@@ -1,4 +1,6 @@
1
- import type { ComponentPropsWithoutRef, ReactNode } from "react"
1
+ import { ark, type HTMLArkProps } from "@ark-ui/react"
2
+ import type { ReactNode } from "react"
3
+ import { composeChildren } from "../../lib/as-child"
2
4
  import { cn } from "../../lib/cn"
3
5
  import { props } from "../../lib/props"
4
6
  import type { WithTestId } from "../../lib/test-id"
@@ -42,8 +44,11 @@ export type CollapseClassNames = {
42
44
  * Override the timing with a `duration-*` / `ease-*` class on `className`
43
45
  * (tailwind-merge lets the later class win); style the sliding region — layout,
44
46
  * padding — with `classNames.content`.
47
+ *
48
+ * `asChild` makes the consumer's element the grid root, with the clipped cell
49
+ * folded inside it (`Accordion.ItemContent` merges Ark's part this way).
45
50
  */
46
- export type CollapseProps = ComponentPropsWithoutRef<"div"> &
51
+ export type CollapseProps = HTMLArkProps<"div"> &
47
52
  WithTestId & {
48
53
  /** Whether the content is revealed. Closed content is `inert`. */
49
54
  open: boolean
@@ -58,24 +63,37 @@ export const Collapse = ({
58
63
  classNames,
59
64
  children,
60
65
  testId,
66
+ asChild,
61
67
  ...rest
62
- }: CollapseProps) => (
63
- <div
64
- className={cn(
68
+ }: CollapseProps) => {
69
+ const root = {
70
+ className: cn(
65
71
  "grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]",
66
72
  "motion-reduce:transition-none",
67
73
  open ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
68
74
  className,
69
75
  classNames?.root,
70
- )}
71
- {...props({ "data-testid": testId })}
72
- {...rest}
73
- data-state={open ? "open" : "closed"}
74
- >
75
- {/* `inert` sits on the clipped cell, not the root, so a consumer keeps the
76
- root's own `inert` (and the rest of its div props) to itself. */}
76
+ ),
77
+ ...props({ "data-testid": testId }),
78
+ ...rest,
79
+ "data-state": open ? "open" : "closed",
80
+ }
81
+ // `inert` sits on the clipped cell, not the root, so a consumer keeps the
82
+ // root's own `inert` (and the rest of its div props) to itself.
83
+ const cell = composeChildren(asChild, children, (own) => (
77
84
  <div className={cn("min-h-0 min-w-0 overflow-clip", classNames?.content)} inert={!open}>
78
- {children}
85
+ {own}
79
86
  </div>
80
- </div>
81
- )
87
+ ))
88
+ // A plain `<div>` unless `asChild` is set. Collapse sits under every
89
+ // Accordion panel, Notification row and nested NavLink, and `ark.div`'s
90
+ // memo + forwardRef + ref-merging layer measured ~12% slower across 600 of
91
+ // them; only `asChild` needs Ark's factory.
92
+ return asChild ? (
93
+ <ark.div asChild {...root}>
94
+ {cell}
95
+ </ark.div>
96
+ ) : (
97
+ <div {...root}>{cell}</div>
98
+ )
99
+ }
@@ -0,0 +1,38 @@
1
+ import { render, screen } from "@testing-library/react"
2
+ import { describe, expect, it } from "vitest"
3
+ import { Combobox, createListCollection } from "."
4
+
5
+ const collection = createListCollection({ items: ["Paris", "Lyon"] })
6
+
7
+ describe("Combobox triggers under asChild", () => {
8
+ // The default icon used to be computed from `children`, which under
9
+ // `asChild` is the consumer's element, so it never showed up.
10
+ it.each([
11
+ ["Trigger", Combobox.Trigger],
12
+ ["ClearTrigger", Combobox.ClearTrigger],
13
+ ] as const)("%s puts its default icon inside an empty child", (_, Part) => {
14
+ render(
15
+ <Combobox.Root collection={collection}>
16
+ <Part asChild>
17
+ <button type="button" data-testid="custom" />
18
+ </Part>
19
+ </Combobox.Root>,
20
+ )
21
+ expect(screen.getByTestId("custom").querySelector("svg")).toBeTruthy()
22
+ })
23
+
24
+ it("keeps the child's own content instead of the default icon", () => {
25
+ render(
26
+ <Combobox.Root collection={collection}>
27
+ <Combobox.Trigger asChild>
28
+ <button type="button" data-testid="custom">
29
+ Open
30
+ </button>
31
+ </Combobox.Trigger>
32
+ </Combobox.Root>,
33
+ )
34
+ const trigger = screen.getByTestId("custom")
35
+ expect(trigger.textContent).toBe("Open")
36
+ expect(trigger.querySelector("svg")).toBeNull()
37
+ })
38
+ })
@@ -9,6 +9,7 @@ import {
9
9
  type ReactNode,
10
10
  useContext,
11
11
  } from "react"
12
+ import { composeChildren, type NoAsChild } from "../../lib/as-child"
12
13
  import { cn } from "../../lib/cn"
13
14
  import { useOverlayContainer } from "../../lib/overlay-container"
14
15
  import { useNestedLayer } from "../../lib/overlay-layer"
@@ -115,7 +116,7 @@ const Root = <T extends Ark.CollectionItem = Ark.CollectionItem>({
115
116
  </ComboboxStyleContext.Provider>
116
117
  )
117
118
 
118
- export type ComboboxControlProps = ComponentPropsWithoutRef<typeof Ark.Control> &
119
+ export type ComboboxControlProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Control>> &
119
120
  WithTestId & {
120
121
  /** Inline-start adornment (icon, label). */
121
122
  startSlot?: ReactNode
@@ -129,6 +130,7 @@ const Control = ({
129
130
  className,
130
131
  children,
131
132
  testId,
133
+ asChild: _asChild,
132
134
  ...rest
133
135
  }: ComboboxControlProps) => {
134
136
  const { size, variant } = useContext(ComboboxStyleContext)
@@ -167,6 +169,7 @@ const Input = ({ className, testId, ...rest }: ComponentProps<typeof Ark.Input>
167
169
  const Trigger = ({
168
170
  className,
169
171
  children,
172
+ asChild,
170
173
  ...rest
171
174
  }: ComponentPropsWithoutRef<typeof Ark.Trigger>) => (
172
175
  <Ark.Trigger
@@ -176,22 +179,29 @@ const Trigger = ({
176
179
  "data-[state=open]:rotate-180 disabled:cursor-not-allowed",
177
180
  className,
178
181
  )}
182
+ asChild={asChild}
179
183
  {...rest}
180
184
  >
181
- {children ?? <ChevronIcon />}
185
+ {composeChildren(asChild, children, (own) => own ?? <ChevronIcon />)}
182
186
  </Ark.Trigger>
183
187
  )
184
188
 
185
189
  const ClearTrigger = ({
186
190
  className,
187
191
  children,
192
+ asChild,
188
193
  ...rest
189
194
  }: ComponentPropsWithoutRef<typeof Ark.ClearTrigger>) => (
190
195
  // zag marks the combobox clear control `tabIndex={-1}`; surface it in the tab
191
196
  // order so keyboard users can reach it (matching Select's clear and the tree
192
197
  // clears). A caller can still override via `tabIndex` in `rest`.
193
- <Ark.ClearTrigger tabIndex={0} className={cn(popoverClearTrigger, className)} {...rest}>
194
- {children ?? <CloseIcon />}
198
+ <Ark.ClearTrigger
199
+ tabIndex={0}
200
+ className={cn(popoverClearTrigger, className)}
201
+ asChild={asChild}
202
+ {...rest}
203
+ >
204
+ {composeChildren(asChild, children, (own) => own ?? <CloseIcon />)}
195
205
  </Ark.ClearTrigger>
196
206
  )
197
207
 
@@ -201,8 +211,9 @@ const Content = ({
201
211
  withPaddingTop = true,
202
212
  withinPortal = true,
203
213
  container,
214
+ asChild: _asChild,
204
215
  ...rest
205
- }: ComponentPropsWithoutRef<typeof Ark.Content> & {
216
+ }: NoAsChild<ComponentPropsWithoutRef<typeof Ark.Content>> & {
206
217
  withPaddingTop?: boolean
207
218
  /** Render the panel in a Portal so it escapes clipping ancestors.
208
219
  * Default `true`. */
@@ -237,8 +248,9 @@ const Panel = ({
237
248
  className,
238
249
  children,
239
250
  withPaddingTop = true,
251
+ asChild: _asChild,
240
252
  ...rest
241
- }: ComponentPropsWithoutRef<typeof Ark.Content> & { withPaddingTop?: boolean }) => {
253
+ }: NoAsChild<ComponentPropsWithoutRef<typeof Ark.Content>> & { withPaddingTop?: boolean }) => {
242
254
  return (
243
255
  <Ark.Content {...rest}>
244
256
  <Ark.List className={cn(popoverList({ withPaddingTop }), className)}>{children}</Ark.List>
@@ -246,7 +258,9 @@ const Panel = ({
246
258
  )
247
259
  }
248
260
 
249
- export type ComboboxItemProps = Omit<ComponentPropsWithoutRef<typeof Ark.Item>, "children"> &
261
+ export type ComboboxItemProps = NoAsChild<
262
+ Omit<ComponentPropsWithoutRef<typeof Ark.Item>, "children">
263
+ > &
250
264
  WithTestId & {
251
265
  /**
252
266
  * Option content. A plain node renders as the label (the kit adds the check
@@ -256,7 +270,7 @@ export type ComboboxItemProps = Omit<ComponentPropsWithoutRef<typeof Ark.Item>,
256
270
  children?: ReactNode | ((state: ItemRenderState) => ReactNode)
257
271
  }
258
272
 
259
- const Item = ({ className, children, testId, ...rest }: ComboboxItemProps) => {
273
+ const Item = ({ className, children, testId, asChild: _asChild, ...rest }: ComboboxItemProps) => {
260
274
  const { size } = useContext(ComboboxStyleContext)
261
275
  return (
262
276
  <Ark.Item
@@ -280,12 +294,12 @@ const Item = ({ className, children, testId, ...rest }: ComboboxItemProps) => {
280
294
  )
281
295
  }
282
296
 
283
- export type ComboboxGroupProps = ComponentPropsWithoutRef<typeof Ark.ItemGroup> & {
297
+ export type ComboboxGroupProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.ItemGroup>> & {
284
298
  /** Group heading rendered above the options. */
285
299
  label?: ReactNode
286
300
  }
287
301
 
288
- const Group = ({ label, className, children, ...rest }: ComboboxGroupProps) => (
302
+ const Group = ({ label, className, children, asChild: _asChild, ...rest }: ComboboxGroupProps) => (
289
303
  <Ark.ItemGroup className={className} {...rest}>
290
304
  {label != null && (
291
305
  <Ark.ItemGroupLabel className={popoverGroupLabel}>{label}</Ark.ItemGroupLabel>
@@ -2,6 +2,7 @@ import { ark, type HTMLArkProps } from "@ark-ui/react"
2
2
  import { cva, type VariantProps } from "class-variance-authority"
3
3
  import type { ReactNode } from "react"
4
4
  import type { Align } from "../../lib/align"
5
+ import type { NoAsChild } from "../../lib/as-child"
5
6
  import { cn } from "../../lib/cn"
6
7
  import type { Color } from "../../lib/colors"
7
8
  import { props } from "../../lib/props"
@@ -62,7 +63,7 @@ export type DividerVariant = NonNullable<VariantProps<typeof dividerVariants>["v
62
63
  export type DividerSize = Size
63
64
  export type DividerLabelPosition = Align
64
65
 
65
- export type DividerProps = Omit<HTMLArkProps<"div">, "children"> &
66
+ export type DividerProps = NoAsChild<Omit<HTMLArkProps<"div">, "children">> &
66
67
  VariantProps<typeof dividerVariants> &
67
68
  WithTestId & {
68
69
  /**
@@ -115,6 +116,7 @@ export const Divider = ({
115
116
  label,
116
117
  labelPosition,
117
118
  testId,
119
+ asChild: _asChild,
118
120
  ...rest
119
121
  }: DividerProps) => {
120
122
  const isVertical = orientation === "vertical"