@42-central/ui-react 0.17.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/dist/{chunk-FD6P6PLQ.js → chunk-5JHDSVEZ.js} +3 -3
  2. package/dist/{chunk-FD6P6PLQ.js.map → chunk-5JHDSVEZ.js.map} +1 -1
  3. package/dist/{chunk-QMW7D5GU.js → chunk-5OQLFX47.js} +4 -3
  4. package/dist/chunk-5OQLFX47.js.map +1 -0
  5. package/dist/{chunk-VZ2TPU4B.js → chunk-6GDMSENK.js} +3 -2
  6. package/dist/chunk-6GDMSENK.js.map +1 -0
  7. package/dist/{chunk-TNNH3FVQ.js → chunk-6OLTJYSX.js} +24 -8
  8. package/dist/chunk-6OLTJYSX.js.map +1 -0
  9. package/dist/{chunk-POKDSVQT.js → chunk-AE7QTLJ5.js} +5 -4
  10. package/dist/chunk-AE7QTLJ5.js.map +1 -0
  11. package/dist/{chunk-44OV3PNH.js → chunk-B2YJKRNQ.js} +3 -3
  12. package/dist/{chunk-44OV3PNH.js.map → chunk-B2YJKRNQ.js.map} +1 -1
  13. package/dist/{chunk-YIQI2CF3.js → chunk-CTSO6V72.js} +3 -2
  14. package/dist/chunk-CTSO6V72.js.map +1 -0
  15. package/dist/{chunk-EVVMHTCL.js → chunk-EBREIC3L.js} +4 -3
  16. package/dist/chunk-EBREIC3L.js.map +1 -0
  17. package/dist/{chunk-UNSAA7YG.js → chunk-FHG54IT5.js} +3 -2
  18. package/dist/chunk-FHG54IT5.js.map +1 -0
  19. package/dist/{chunk-3GYOIQW7.js → chunk-FZIHZT5R.js} +5 -5
  20. package/dist/{chunk-3GYOIQW7.js.map → chunk-FZIHZT5R.js.map} +1 -1
  21. package/dist/{chunk-2H46IXW4.js → chunk-HAQJQFE6.js} +28 -8
  22. package/dist/chunk-HAQJQFE6.js.map +1 -0
  23. package/dist/{chunk-IHYFYMHJ.js → chunk-HT5JAHR3.js} +6 -6
  24. package/dist/{chunk-IHYFYMHJ.js.map → chunk-HT5JAHR3.js.map} +1 -1
  25. package/dist/chunk-I4SQQIP5.js +12 -0
  26. package/dist/chunk-I4SQQIP5.js.map +1 -0
  27. package/dist/{chunk-J3PELDH3.js → chunk-JITF6I7N.js} +22 -6
  28. package/dist/chunk-JITF6I7N.js.map +1 -0
  29. package/dist/{chunk-IFWCCAQV.js → chunk-KHMFNH3X.js} +3 -2
  30. package/dist/chunk-KHMFNH3X.js.map +1 -0
  31. package/dist/{chunk-SIG4DMNZ.js → chunk-MI2WZRK3.js} +4 -4
  32. package/dist/{chunk-SIG4DMNZ.js.map → chunk-MI2WZRK3.js.map} +1 -1
  33. package/dist/{chunk-YON5Y336.js → chunk-O23Y5ML4.js} +8 -8
  34. package/dist/{chunk-YON5Y336.js.map → chunk-O23Y5ML4.js.map} +1 -1
  35. package/dist/{chunk-P7A3BCAC.js → chunk-OWG4BCQR.js} +3 -3
  36. package/dist/{chunk-P7A3BCAC.js.map → chunk-OWG4BCQR.js.map} +1 -1
  37. package/dist/{chunk-FUWSTUDM.js → chunk-PH354ECN.js} +4 -4
  38. package/dist/{chunk-FUWSTUDM.js.map → chunk-PH354ECN.js.map} +1 -1
  39. package/dist/{chunk-U5GW5EBR.js → chunk-RAUOFTUH.js} +12 -20
  40. package/dist/chunk-RAUOFTUH.js.map +1 -0
  41. package/dist/{chunk-2762HZYX.js → chunk-S2HWWR2H.js} +47 -25
  42. package/dist/chunk-S2HWWR2H.js.map +1 -0
  43. package/dist/{chunk-VLUKI3HL.js → chunk-S7N4LGLZ.js} +6 -13
  44. package/dist/chunk-S7N4LGLZ.js.map +1 -0
  45. package/dist/{chunk-NSOA3GMZ.js → chunk-UHNRAI6V.js} +3 -3
  46. package/dist/{chunk-NSOA3GMZ.js.map → chunk-UHNRAI6V.js.map} +1 -1
  47. package/dist/{chunk-3NZXWCGF.js → chunk-WHKKN3ZK.js} +6 -6
  48. package/dist/{chunk-3NZXWCGF.js.map → chunk-WHKKN3ZK.js.map} +1 -1
  49. package/dist/{chunk-MOI7B3KH.js → chunk-WQN64ZHG.js} +5 -5
  50. package/dist/{chunk-MOI7B3KH.js.map → chunk-WQN64ZHG.js.map} +1 -1
  51. package/dist/chunk-WSIVRDRB.js +34 -0
  52. package/dist/chunk-WSIVRDRB.js.map +1 -0
  53. package/dist/{chunk-6SWK4XG5.js → chunk-YXE4B6X3.js} +2 -2
  54. package/dist/chunk-YXE4B6X3.js.map +1 -0
  55. package/dist/{chunk-NGAQITWP.js → chunk-Z2Z5EXVT.js} +10 -7
  56. package/dist/chunk-Z2Z5EXVT.js.map +1 -0
  57. package/dist/{chunk-IXKELBJA.js → chunk-ZDXQ64A7.js} +63 -44
  58. package/dist/chunk-ZDXQ64A7.js.map +1 -0
  59. package/dist/components/accordion/accordion-data.d.ts +3 -2
  60. package/dist/components/accordion/accordion-data.d.ts.map +1 -1
  61. package/dist/components/accordion/accordion.d.ts +2 -2
  62. package/dist/components/accordion/accordion.d.ts.map +1 -1
  63. package/dist/components/accordion/index.js +20 -8
  64. package/dist/components/accordion/index.js.map +1 -1
  65. package/dist/components/action-icon/action-icon.d.ts +3 -4
  66. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  67. package/dist/components/action-icon/index.js +2 -1
  68. package/dist/components/alert/alert.d.ts +1 -1
  69. package/dist/components/alert/alert.d.ts.map +1 -1
  70. package/dist/components/alert/index.js +16 -4
  71. package/dist/components/alert/index.js.map +1 -1
  72. package/dist/components/app-shell/app-shell.d.ts +3 -2
  73. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  74. package/dist/components/app-shell/index.js +4 -2
  75. package/dist/components/app-shell/index.js.map +1 -1
  76. package/dist/components/autocomplete/index.js +5 -4
  77. package/dist/components/autocomplete/index.js.map +1 -1
  78. package/dist/components/breadcrumb/breadcrumb.d.ts +3 -2
  79. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  80. package/dist/components/breadcrumb/index.js +11 -5
  81. package/dist/components/breadcrumb/index.js.map +1 -1
  82. package/dist/components/button/button.d.ts +4 -4
  83. package/dist/components/button/button.d.ts.map +1 -1
  84. package/dist/components/button/index.js +2 -1
  85. package/dist/components/button-multi-select/index.js +4 -3
  86. package/dist/components/button-multi-select/index.js.map +1 -1
  87. package/dist/components/button-select/index.js +4 -3
  88. package/dist/components/button-select/index.js.map +1 -1
  89. package/dist/components/calendar/index.js +3 -2
  90. package/dist/components/checkbox/index.js +2 -2
  91. package/dist/components/choice-card-group/index.js +1 -1
  92. package/dist/components/circular-progress/circular-progress.d.ts +3 -2
  93. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  94. package/dist/components/circular-progress/index.js +1 -0
  95. package/dist/components/circular-progress/index.js.map +1 -1
  96. package/dist/components/clipboard/clipboard.d.ts +1 -1
  97. package/dist/components/clipboard/clipboard.d.ts.map +1 -1
  98. package/dist/components/clipboard/index.js +9 -5
  99. package/dist/components/clipboard/index.js.map +1 -1
  100. package/dist/components/code-block/chrome.d.ts +4 -1
  101. package/dist/components/code-block/chrome.d.ts.map +1 -1
  102. package/dist/components/code-block/chrome.js +5 -4
  103. package/dist/components/code-block/code-block.d.ts +7 -1
  104. package/dist/components/code-block/code-block.d.ts.map +1 -1
  105. package/dist/components/code-block/index.d.ts +1 -1
  106. package/dist/components/code-block/index.js +12 -10
  107. package/dist/components/code-block/index.js.map +1 -1
  108. package/dist/components/code-block/notation.d.ts +5 -2
  109. package/dist/components/code-block/notation.d.ts.map +1 -1
  110. package/dist/components/code-block/static.d.ts +4 -1
  111. package/dist/components/code-block/static.d.ts.map +1 -1
  112. package/dist/components/code-block/static.js +5 -4
  113. package/dist/components/code-block/static.js.map +1 -1
  114. package/dist/components/collapse/collapse.d.ts +7 -3
  115. package/dist/components/collapse/collapse.d.ts.map +1 -1
  116. package/dist/components/collapse/index.js +2 -1
  117. package/dist/components/combobox/combobox.d.ts +11 -10
  118. package/dist/components/combobox/combobox.d.ts.map +1 -1
  119. package/dist/components/combobox/index.js +5 -4
  120. package/dist/components/combobox-list/index.js +6 -5
  121. package/dist/components/data-table/index.js +20 -19
  122. package/dist/components/data-table/index.js.map +1 -1
  123. package/dist/components/date-picker/index.js +12 -11
  124. package/dist/components/date-picker/index.js.map +1 -1
  125. package/dist/components/divider/divider.d.ts +3 -2
  126. package/dist/components/divider/divider.d.ts.map +1 -1
  127. package/dist/components/divider/index.js +1 -1
  128. package/dist/components/drawer/drawer.d.ts +6 -5
  129. package/dist/components/drawer/drawer.d.ts.map +1 -1
  130. package/dist/components/drawer/index.js +3 -2
  131. package/dist/components/field/field.d.ts +7 -4
  132. package/dist/components/field/field.d.ts.map +1 -1
  133. package/dist/components/field/index.js +1 -1
  134. package/dist/components/file-upload/index.js +3 -2
  135. package/dist/components/file-upload/index.js.map +1 -1
  136. package/dist/components/hover-card/index.js +1 -1
  137. package/dist/components/input/index.js +2 -2
  138. package/dist/components/input/input.d.ts +3 -2
  139. package/dist/components/input/input.d.ts.map +1 -1
  140. package/dist/components/menu/index.js +3 -2
  141. package/dist/components/menu/index.js.map +1 -1
  142. package/dist/components/menu/menu-data.d.ts +6 -1
  143. package/dist/components/menu/menu-data.d.ts.map +1 -1
  144. package/dist/components/menu/menu.d.ts +5 -5
  145. package/dist/components/menu/menu.d.ts.map +1 -1
  146. package/dist/components/modal/index.js +3 -2
  147. package/dist/components/modal/modal.d.ts +4 -3
  148. package/dist/components/modal/modal.d.ts.map +1 -1
  149. package/dist/components/multi-combobox-list/index.js +6 -5
  150. package/dist/components/multi-select/index.js +7 -6
  151. package/dist/components/multi-select/index.js.map +1 -1
  152. package/dist/components/nav-link/index.js +3 -2
  153. package/dist/components/nav-link/tanstack.js +3 -2
  154. package/dist/components/nav-link/tanstack.js.map +1 -1
  155. package/dist/components/notification/index.js +4 -3
  156. package/dist/components/notification/index.js.map +1 -1
  157. package/dist/components/notification/notification.d.ts +3 -2
  158. package/dist/components/notification/notification.d.ts.map +1 -1
  159. package/dist/components/number-input/index.js +4 -4
  160. package/dist/components/overlays/index.js +5 -4
  161. package/dist/components/overlays/index.js.map +1 -1
  162. package/dist/components/password-input/index.js +2 -2
  163. package/dist/components/pill/index.js +2 -1
  164. package/dist/components/pill/pill.d.ts +4 -2
  165. package/dist/components/pill/pill.d.ts.map +1 -1
  166. package/dist/components/pills-input/index.js +5 -4
  167. package/dist/components/pills-input/pills-input.d.ts +3 -2
  168. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  169. package/dist/components/pin-input/index.js +2 -2
  170. package/dist/components/popover/index.js +1 -1
  171. package/dist/components/popover/popover.d.ts +3 -2
  172. package/dist/components/popover/popover.d.ts.map +1 -1
  173. package/dist/components/progress/index.js +1 -0
  174. package/dist/components/progress/index.js.map +1 -1
  175. package/dist/components/progress/progress.d.ts +3 -2
  176. package/dist/components/progress/progress.d.ts.map +1 -1
  177. package/dist/components/radio-group/index.js +1 -1
  178. package/dist/components/rating/index.js +2 -1
  179. package/dist/components/rating/index.js.map +1 -1
  180. package/dist/components/rating/rating.d.ts +3 -2
  181. package/dist/components/rating/rating.d.ts.map +1 -1
  182. package/dist/components/schedule/index.d.ts +2 -2
  183. package/dist/components/schedule/index.js +50 -23
  184. package/dist/components/schedule/index.js.map +1 -1
  185. package/dist/components/schedule/schedule-agenda-list.d.ts +6 -7
  186. package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -1
  187. package/dist/components/schedule/schedule-agenda-view.d.ts +19 -16
  188. package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
  189. package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
  190. package/dist/components/schedule/schedule-days-view.d.ts +3 -2
  191. package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
  192. package/dist/components/schedule/schedule-month-view.d.ts +3 -2
  193. package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
  194. package/dist/components/schedule/schedule-next-up.d.ts +4 -3
  195. package/dist/components/schedule/schedule-next-up.d.ts.map +1 -1
  196. package/dist/components/schedule/schedule-toolbar.d.ts +1 -1
  197. package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
  198. package/dist/components/schedule/schedule-types.d.ts +5 -3
  199. package/dist/components/schedule/schedule-types.d.ts.map +1 -1
  200. package/dist/components/schedule/schedule-views.d.ts +2 -2
  201. package/dist/components/schedule/schedule-views.d.ts.map +1 -1
  202. package/dist/components/schedule/schedule-year-view.d.ts +3 -2
  203. package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
  204. package/dist/components/schedule/schedule.d.ts +9 -6
  205. package/dist/components/schedule/schedule.d.ts.map +1 -1
  206. package/dist/components/segment-group/index.js +2 -2
  207. package/dist/components/select/index.js +4 -4
  208. package/dist/components/slider/index.js +2 -1
  209. package/dist/components/slider/index.js.map +1 -1
  210. package/dist/components/slider/slider.d.ts +3 -2
  211. package/dist/components/slider/slider.d.ts.map +1 -1
  212. package/dist/components/switch/index.js +1 -1
  213. package/dist/components/tabs/index.js +1 -1
  214. package/dist/components/tabs/tabs-data.d.ts +3 -2
  215. package/dist/components/tabs/tabs-data.d.ts.map +1 -1
  216. package/dist/components/tags-input/index.js +6 -5
  217. package/dist/components/tags-input/index.js.map +1 -1
  218. package/dist/components/text-input/index.js +2 -2
  219. package/dist/components/textarea/index.js +2 -2
  220. package/dist/components/time-input/index.js +6 -6
  221. package/dist/components/timeline/index.js +8 -5
  222. package/dist/components/timeline/index.js.map +1 -1
  223. package/dist/components/timeline/timeline.d.ts +1 -1
  224. package/dist/components/timeline/timeline.d.ts.map +1 -1
  225. package/dist/components/tooltip/index.js +1 -1
  226. package/dist/components/tooltip/tooltip.d.ts +2 -1
  227. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  228. package/dist/components/tree-multi-select/index.js +6 -5
  229. package/dist/components/tree-multi-select/index.js.map +1 -1
  230. package/dist/components/tree-select/index.js +3 -3
  231. package/dist/lib/as-child.d.ts +104 -0
  232. package/dist/lib/as-child.d.ts.map +1 -0
  233. package/package.json +1 -1
  234. package/src/as-child.contract.test.tsx +809 -0
  235. package/src/components/accordion/accordion-data.tsx +8 -5
  236. package/src/components/accordion/accordion.test.tsx +40 -0
  237. package/src/components/accordion/accordion.tsx +23 -6
  238. package/src/components/action-icon/action-icon.tsx +9 -24
  239. package/src/components/alert/alert.test.tsx +17 -0
  240. package/src/components/alert/alert.tsx +21 -2
  241. package/src/components/app-shell/app-shell.tsx +3 -1
  242. package/src/components/breadcrumb/breadcrumb.test.tsx +30 -0
  243. package/src/components/breadcrumb/breadcrumb.tsx +21 -12
  244. package/src/components/button/button.tsx +21 -50
  245. package/src/components/circular-progress/circular-progress.tsx +4 -1
  246. package/src/components/clipboard/clipboard.test.tsx +18 -0
  247. package/src/components/clipboard/clipboard.tsx +8 -2
  248. package/src/components/code-block/chrome.tsx +60 -36
  249. package/src/components/code-block/code-block.test.tsx +27 -0
  250. package/src/components/code-block/code-block.tsx +13 -3
  251. package/src/components/code-block/notation.test.ts +8 -0
  252. package/src/components/code-block/notation.ts +6 -3
  253. package/src/components/code-block/static.tsx +8 -2
  254. package/src/components/collapse/collapse.tsx +33 -15
  255. package/src/components/combobox/combobox.test.tsx +38 -0
  256. package/src/components/combobox/combobox.tsx +24 -10
  257. package/src/components/divider/divider.tsx +3 -1
  258. package/src/components/drawer/drawer.tsx +37 -16
  259. package/src/components/field/field.tsx +7 -3
  260. package/src/components/input/input.tsx +3 -1
  261. package/src/components/menu/menu-data.tsx +8 -1
  262. package/src/components/menu/menu.test.tsx +52 -0
  263. package/src/components/menu/menu.tsx +83 -35
  264. package/src/components/modal/close-trigger.test.tsx +38 -0
  265. package/src/components/modal/modal.tsx +29 -13
  266. package/src/components/notification/notification.tsx +4 -1
  267. package/src/components/pill/pill.tsx +29 -20
  268. package/src/components/pills-input/pills-input.tsx +3 -1
  269. package/src/components/popover/popover.tsx +3 -1
  270. package/src/components/progress/progress.tsx +4 -1
  271. package/src/components/rating/rating.tsx +27 -23
  272. package/src/components/schedule/index.ts +1 -1
  273. package/src/components/schedule/schedule-agenda-list.tsx +6 -7
  274. package/src/components/schedule/schedule-agenda-view.test.tsx +105 -28
  275. package/src/components/schedule/schedule-agenda-view.tsx +41 -28
  276. package/src/components/schedule/schedule-dates.test.ts +37 -52
  277. package/src/components/schedule/schedule-dates.ts +22 -25
  278. package/src/components/schedule/schedule-days-view.tsx +3 -1
  279. package/src/components/schedule/schedule-month-view.tsx +3 -1
  280. package/src/components/schedule/schedule-next-up.tsx +6 -2
  281. package/src/components/schedule/schedule-toolbar.test.tsx +26 -0
  282. package/src/components/schedule/schedule-toolbar.tsx +13 -1
  283. package/src/components/schedule/schedule-types.ts +5 -3
  284. package/src/components/schedule/schedule-views.ts +4 -5
  285. package/src/components/schedule/schedule-year-view.tsx +3 -1
  286. package/src/components/schedule/schedule.test.tsx +66 -22
  287. package/src/components/schedule/schedule.tsx +22 -13
  288. package/src/components/slider/slider.tsx +4 -0
  289. package/src/components/tabs/tabs-data.tsx +17 -14
  290. package/src/components/timeline/timeline.tsx +102 -95
  291. package/src/components/tooltip/tooltip.tsx +2 -1
  292. package/src/lib/as-child.test.tsx +70 -0
  293. package/src/lib/as-child.ts +119 -0
  294. package/dist/chunk-2762HZYX.js.map +0 -1
  295. package/dist/chunk-2H46IXW4.js.map +0 -1
  296. package/dist/chunk-6SWK4XG5.js.map +0 -1
  297. package/dist/chunk-EVVMHTCL.js.map +0 -1
  298. package/dist/chunk-HWNPXAEN.js +0 -31
  299. package/dist/chunk-HWNPXAEN.js.map +0 -1
  300. package/dist/chunk-IFWCCAQV.js.map +0 -1
  301. package/dist/chunk-IXKELBJA.js.map +0 -1
  302. package/dist/chunk-J3PELDH3.js.map +0 -1
  303. package/dist/chunk-NGAQITWP.js.map +0 -1
  304. package/dist/chunk-POKDSVQT.js.map +0 -1
  305. package/dist/chunk-QMW7D5GU.js.map +0 -1
  306. package/dist/chunk-TNNH3FVQ.js.map +0 -1
  307. package/dist/chunk-U5GW5EBR.js.map +0 -1
  308. package/dist/chunk-UNSAA7YG.js.map +0 -1
  309. package/dist/chunk-VLUKI3HL.js.map +0 -1
  310. package/dist/chunk-VZ2TPU4B.js.map +0 -1
  311. package/dist/chunk-YIQI2CF3.js.map +0 -1
@@ -1,10 +1,11 @@
1
1
  "use client";
2
- import { Context, Item, Root, ButtonSelectControl } from '../../chunk-SIG4DMNZ.js';
3
- import '../../chunk-UNSAA7YG.js';
4
- import '../../chunk-U5GW5EBR.js';
2
+ import { Context, Item, Root, ButtonSelectControl } from '../../chunk-MI2WZRK3.js';
3
+ import '../../chunk-FHG54IT5.js';
4
+ import '../../chunk-RAUOFTUH.js';
5
5
  import '../../chunk-2SVX3MQQ.js';
6
6
  import { useUncontrolled } from '../../chunk-BEL75C7N.js';
7
7
  import '../../chunk-NSDM3FEB.js';
8
+ import '../../chunk-I4SQQIP5.js';
8
9
  import '../../chunk-WYCMIIRR.js';
9
10
  import '../../chunk-B2LCHXUB.js';
10
11
  import '../../chunk-QP4I37PA.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/button-select/button-select-data.tsx"],"names":[],"mappings":";;;;;;;;;;;AAoDA,IAAM,wBAAwB,CAG5B;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA6C;AAC3C,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,eAAA,CAAgD;AAAA,IAC9E,KAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA,EAAY,IAAA;AAAA;AAAA;AAAA,IAGZ,QAAA,EAAU,CAAC,IAAA,KAAS,QAAA,GAAW,IAA+B;AAAA,GAC/D,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU,KAAA;AAAA,MACV,YAAA,EAAc,QAAQ,YAAY,CAAA;AAAA,MAClC,OAAO,QAAA,IAAY,IAAA,GAAO,EAAC,GAAI,CAAC,QAAQ,CAAA;AAAA,MAGxC,eAAe,CAAC,IAAA,KAAS,YAAa,IAAA,CAAK,CAAC,KAAK,IAAuC,CAAA;AAAA,MACxF,UAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAA;AAWO,IAAM,YAAA,GAAe,OAAO,MAAA,CAAO,qBAAA,EAAuB,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS","file":"index.js","sourcesContent":["\"use client\"\n\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Context, Item, Root } from \"./button-select\"\nimport { type ButtonSelectBaseProps, ButtonSelectControl } from \"./button-select-control\"\nimport type {\n ButtonSelectData,\n ButtonSelectValue,\n RenderButtonSelectItem,\n} from \"./button-select-items\"\n\n/**\n * ButtonSelect — pick one value from a row of joined `Button`s. The selected\n * item flips to `selectedVariant` (default `filled`), the rest stay in `variant`\n * (default `light`). Reach for it over `SegmentGroup` when the options want to\n * look like buttons — icons, per-item colors, toolbar-style rows — and over\n * `Select` when the set is small enough to show all at once.\n *\n * - `data` takes bare strings or `{ value, label?, startSlot?, endSlot?,\n * disabled?, color?, payload? }` objects. The component is generic over it, so\n * `value` / `onChange` narrow to the literal value union and `payload` flows,\n * typed, into `renderItem`.\n * - Radio-like by default: clicking the selected item keeps it. `deselectable`\n * lets it clear, and only then does `onChange` receive `null` — at the type\n * level too.\n * - Label / description / error / required come from the built-in `Field`;\n * `name` submits the value through a hidden input.\n *\n * For several values at once, see `ButtonMultiSelect`.\n */\nexport type ButtonSelectProps<\n Data extends ButtonSelectData = ButtonSelectData,\n Deselectable extends boolean = false,\n> = ButtonSelectBaseProps<Data> & {\n /** Controlled value. `null` clears the selection. */\n value?: ButtonSelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: ButtonSelectValue<Data> | null\n /** Clicking the selected item clears the selection. */\n deselectable?: Deselectable\n /**\n * Fires with the selected value. It can only be `null` when `deselectable` is\n * set: `[D] extends [false]` keeps an unresolved `boolean` on the nullable\n * side, the safe direction.\n */\n onChange?: (\n value: [Deselectable] extends [false]\n ? ButtonSelectValue<Data>\n : ButtonSelectValue<Data> | null,\n ) => void\n}\n\nconst ButtonSelectComponent = <\n const Data extends ButtonSelectData = ButtonSelectData,\n Deselectable extends boolean = false,\n>({\n value,\n defaultValue,\n onChange,\n deselectable,\n renderItem,\n ...rest\n}: ButtonSelectProps<Data, Deselectable>) => {\n const [selected, setSelected] = useUncontrolled<ButtonSelectValue<Data> | null>({\n value,\n defaultValue,\n finalValue: null,\n // `null` only ever comes out of the machine when `deselectable` is on, which\n // is exactly when the callback's parameter type admits it.\n onChange: (next) => onChange?.(next as ButtonSelectValue<Data>),\n })\n\n return (\n <ButtonSelectControl\n multiple={false}\n deselectable={Boolean(deselectable)}\n value={selected == null ? [] : [selected]}\n // The machine's values are `string`s that always originate from `data`,\n // so they narrow back to the caller's union.\n onValueChange={(next) => setSelected((next[0] ?? null) as ButtonSelectValue<Data> | null)}\n renderItem={renderItem as RenderButtonSelectItem<ButtonSelectData> | undefined}\n {...rest}\n />\n )\n}\n\n/**\n * The public `ButtonSelect` — callable for the data-driven form, with the\n * composable parts attached (like `Tabs`):\n *\n * <ButtonSelect.Root defaultValue=\"week\" variant=\"subtle\" color=\"brand\">\n * <ButtonSelect.Item value=\"day\">Day</ButtonSelect.Item>\n * <ButtonSelect.Item value=\"week\" startSlot={<CalendarIcon />}>Week</ButtonSelect.Item>\n * </ButtonSelect.Root>\n */\nexport const ButtonSelect = Object.assign(ButtonSelectComponent, { Root, Item, Context })\n"]}
1
+ {"version":3,"sources":["../../../src/components/button-select/button-select-data.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAoDA,IAAM,wBAAwB,CAG5B;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA6C;AAC3C,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,eAAA,CAAgD;AAAA,IAC9E,KAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA,EAAY,IAAA;AAAA;AAAA;AAAA,IAGZ,QAAA,EAAU,CAAC,IAAA,KAAS,QAAA,GAAW,IAA+B;AAAA,GAC/D,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU,KAAA;AAAA,MACV,YAAA,EAAc,QAAQ,YAAY,CAAA;AAAA,MAClC,OAAO,QAAA,IAAY,IAAA,GAAO,EAAC,GAAI,CAAC,QAAQ,CAAA;AAAA,MAGxC,eAAe,CAAC,IAAA,KAAS,YAAa,IAAA,CAAK,CAAC,KAAK,IAAuC,CAAA;AAAA,MACxF,UAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAA;AAWO,IAAM,YAAA,GAAe,OAAO,MAAA,CAAO,qBAAA,EAAuB,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS","file":"index.js","sourcesContent":["\"use client\"\n\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Context, Item, Root } from \"./button-select\"\nimport { type ButtonSelectBaseProps, ButtonSelectControl } from \"./button-select-control\"\nimport type {\n ButtonSelectData,\n ButtonSelectValue,\n RenderButtonSelectItem,\n} from \"./button-select-items\"\n\n/**\n * ButtonSelect — pick one value from a row of joined `Button`s. The selected\n * item flips to `selectedVariant` (default `filled`), the rest stay in `variant`\n * (default `light`). Reach for it over `SegmentGroup` when the options want to\n * look like buttons — icons, per-item colors, toolbar-style rows — and over\n * `Select` when the set is small enough to show all at once.\n *\n * - `data` takes bare strings or `{ value, label?, startSlot?, endSlot?,\n * disabled?, color?, payload? }` objects. The component is generic over it, so\n * `value` / `onChange` narrow to the literal value union and `payload` flows,\n * typed, into `renderItem`.\n * - Radio-like by default: clicking the selected item keeps it. `deselectable`\n * lets it clear, and only then does `onChange` receive `null` — at the type\n * level too.\n * - Label / description / error / required come from the built-in `Field`;\n * `name` submits the value through a hidden input.\n *\n * For several values at once, see `ButtonMultiSelect`.\n */\nexport type ButtonSelectProps<\n Data extends ButtonSelectData = ButtonSelectData,\n Deselectable extends boolean = false,\n> = ButtonSelectBaseProps<Data> & {\n /** Controlled value. `null` clears the selection. */\n value?: ButtonSelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: ButtonSelectValue<Data> | null\n /** Clicking the selected item clears the selection. */\n deselectable?: Deselectable\n /**\n * Fires with the selected value. It can only be `null` when `deselectable` is\n * set: `[D] extends [false]` keeps an unresolved `boolean` on the nullable\n * side, the safe direction.\n */\n onChange?: (\n value: [Deselectable] extends [false]\n ? ButtonSelectValue<Data>\n : ButtonSelectValue<Data> | null,\n ) => void\n}\n\nconst ButtonSelectComponent = <\n const Data extends ButtonSelectData = ButtonSelectData,\n Deselectable extends boolean = false,\n>({\n value,\n defaultValue,\n onChange,\n deselectable,\n renderItem,\n ...rest\n}: ButtonSelectProps<Data, Deselectable>) => {\n const [selected, setSelected] = useUncontrolled<ButtonSelectValue<Data> | null>({\n value,\n defaultValue,\n finalValue: null,\n // `null` only ever comes out of the machine when `deselectable` is on, which\n // is exactly when the callback's parameter type admits it.\n onChange: (next) => onChange?.(next as ButtonSelectValue<Data>),\n })\n\n return (\n <ButtonSelectControl\n multiple={false}\n deselectable={Boolean(deselectable)}\n value={selected == null ? [] : [selected]}\n // The machine's values are `string`s that always originate from `data`,\n // so they narrow back to the caller's union.\n onValueChange={(next) => setSelected((next[0] ?? null) as ButtonSelectValue<Data> | null)}\n renderItem={renderItem as RenderButtonSelectItem<ButtonSelectData> | undefined}\n {...rest}\n />\n )\n}\n\n/**\n * The public `ButtonSelect` — callable for the data-driven form, with the\n * composable parts attached (like `Tabs`):\n *\n * <ButtonSelect.Root defaultValue=\"week\" variant=\"subtle\" color=\"brand\">\n * <ButtonSelect.Item value=\"day\">Day</ButtonSelect.Item>\n * <ButtonSelect.Item value=\"week\" startSlot={<CalendarIcon />}>Week</ButtonSelect.Item>\n * </ButtonSelect.Root>\n */\nexport const ButtonSelect = Object.assign(ButtonSelectComponent, { Root, Item, Context })\n"]}
@@ -1,9 +1,10 @@
1
1
  "use client";
2
- export { Calendar } from '../../chunk-NSOA3GMZ.js';
2
+ export { Calendar } from '../../chunk-UHNRAI6V.js';
3
3
  import '../../chunk-TCWYBVIL.js';
4
- import '../../chunk-VLUKI3HL.js';
4
+ import '../../chunk-S7N4LGLZ.js';
5
5
  import '../../chunk-IG7FBZVM.js';
6
6
  import '../../chunk-NSDM3FEB.js';
7
+ import '../../chunk-I4SQQIP5.js';
7
8
  import '../../chunk-WYCMIIRR.js';
8
9
  import '../../chunk-B2LCHXUB.js';
9
10
  import '../../chunk-QP4I37PA.js';
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- export { Checkbox } from '../../chunk-P7A3BCAC.js';
2
+ export { Checkbox } from '../../chunk-OWG4BCQR.js';
3
3
  import '../../chunk-NF5JM2YO.js';
4
- import '../../chunk-UNSAA7YG.js';
4
+ import '../../chunk-FHG54IT5.js';
5
5
  import '../../chunk-IG7FBZVM.js';
6
6
  import '../../chunk-WYCMIIRR.js';
7
7
  import '../../chunk-B2LCHXUB.js';
@@ -1,5 +1,5 @@
1
1
  import { controlIndicator } from '../../chunk-NF5JM2YO.js';
2
- import { FieldShell } from '../../chunk-UNSAA7YG.js';
2
+ import { FieldShell } from '../../chunk-FHG54IT5.js';
3
3
  import { CheckIcon } from '../../chunk-IG7FBZVM.js';
4
4
  import { props } from '../../chunk-WYCMIIRR.js';
5
5
  import { focusStyles } from '../../chunk-B2LCHXUB.js';
@@ -1,6 +1,7 @@
1
1
  import { Progress as Ark } from "@ark-ui/react/progress";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  import { type ComponentPropsWithoutRef, type CSSProperties, type ReactNode, type Ref } from "react";
4
+ import type { ForbidAsChild } from "../../lib/as-child";
4
5
  import type { Color } from "../../lib/colors";
5
6
  import type { GradientDir, GradientProps } from "../../lib/gradient";
6
7
  import type { Size } from "../../lib/sizes";
@@ -19,7 +20,7 @@ type CircularProgressClassNames = {
19
20
  label?: string;
20
21
  };
21
22
  type ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>;
22
- export type CircularProgressProps = Omit<ArkRootProps, "value" | "defaultValue" | "onValueChange" | "ref" | "className" | "children"> & VariantProps<typeof circularRange> & WithTestId & {
23
+ export type CircularProgressProps = Omit<ArkRootProps, "value" | "defaultValue" | "onValueChange" | "ref" | "className" | "children" | "asChild"> & ForbidAsChild & VariantProps<typeof circularRange> & WithTestId & {
23
24
  /** Controlled value (0..max). Pass `null` for the indeterminate state. */
24
25
  value?: number | null;
25
26
  /** Uncontrolled initial value. Pass `null` to start indeterminate. */
@@ -45,5 +46,5 @@ export type CircularProgressProps = Omit<ArkRootProps, "value" | "defaultValue"
45
46
  classNames?: CircularProgressClassNames;
46
47
  style?: CSSProperties;
47
48
  };
48
- export declare const CircularProgress: ({ value, defaultValue, onChange, variant, size, thickness, color, gradient, min, max, children, ref, className, classNames, style, testId, ...rest }: CircularProgressProps) => import("react").JSX.Element;
49
+ export declare const CircularProgress: ({ value, defaultValue, onChange, variant, size, thickness, color, gradient, min, max, children, ref, className, classNames, style, testId, asChild: _asChild, ...rest }: CircularProgressProps) => import("react").JSX.Element;
49
50
  //# sourceMappingURL=circular-progress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"circular-progress.d.ts","sourceRoot":"","sources":["../../../src/components/circular-progress/circular-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,GAAG,EAET,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,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AA;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,oEAAoE;IACpE,GAAG,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,0BAA0B,CAAA;IACvC,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAEH,eAAO,MAAM,gBAAgB,yJAkB1B,qBAAqB,gCAsEvB,CAAA"}
1
+ {"version":3,"file":"circular-progress.d.ts","sourceRoot":"","sources":["../../../src/components/circular-progress/circular-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,GAAG,EAET,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AA8CnD,QAAA,MAAM,aAAa;;8EAgBlB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAChG,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAA;AAEvC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,CAAA;AAE1C,KAAK,0BA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53,7 @@ var CircularProgress = ({
53
53
  classNames,
54
54
  style,
55
55
  testId,
56
+ asChild: _asChild,
56
57
  ...rest
57
58
  }) => {
58
59
  const isGradient = variant === "gradient";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/circular-progress/circular-progress.tsx"],"names":["Ark"],"mappings":";;;;;;;AAkCA,IAAM,mBAAA,GAAyE;AAAA,EAC7E,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA,EAAE;AAAA,EAC7B,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA,EAAE;AAAA,EAC7B,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA,EAAE;AAAA,EAC7B,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA,EAAE;AAAA,EAC7B,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA;AAC7B,CAAA;AASA,IAAM,gBAAA,GAAmB,CACvB,KAAA,EACA,GAAA,EACA,YAAA,KACG;AACH,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,EAAU,OAAO,KAAA;AACtC,EAAA,IAAI,SAAS,IAAA,EAAM,OAAO,mBAAA,CAAoB,KAAK,EAAE,GAAG,CAAA;AACxD,EAAA,MAAM,QAAA,GAAW,OAAO,YAAA,KAAiB,QAAA,GAAW,OAAQ,YAAA,IAAgB,IAAA;AAC5E,EAAA,OAAO,mBAAA,CAAoB,QAAQ,CAAA,CAAE,GAAG,CAAA;AAC1C,CAAA;AAEA,IAAM,aAAA,GAAgB,GAAA;AAAA;AAAA;AAAA;AAAA,EAIpB,CAAC,aAAa,uEAAuE,CAAA;AAAA,EACrF;AAAA,IACE,QAAA,EAAU;AAAA;AAAA;AAAA,MAGR,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ,oBAAA;AAAA,QACR,QAAA,EAAU;AAAA;AACZ,KACF;AAAA,IACA,eAAA,EAAiB,E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AAQ,CAAA,KAAA,EAAQ,UAAU,KAAI,GAAI;AAAA;AAAA;AAC1D;AAAA;AAAA,SACF;AAAA,QAEC,YAAY,IAAA,oBACX,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAW,EAAA,CAAG,mDAAA,EAAqD,UAAA,EAAY,KAAK,CAAA;AAAA,YAEnF;AAAA;AAAA;AACH;AAAA;AAAA,GAEJ;AAEJ","file":"index.js","sourcesContent":["import { Progress as Ark } from \"@ark-ui/react/progress\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type ReactNode,\n type Ref,\n useId,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport type { GradientDir, GradientProps } from \"../../lib/gradient\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * CircularProgress — ring progress indicator on top of Ark UI's Progress state\n * machine (the circular counterpart of `Progress`). Ark owns the value/percent\n * math, the indeterminate flag, the `role=\"progressbar\"` + ARIA wiring, and the\n * SVG ring geometry (`Circle` → `CircleTrack` + `CircleRange`, sized by the\n * `--size` / `--thickness` vars we set on the root).\n *\n * The arc is a stroked SVG circle (`stroke-dasharray` driven by Ark), so it\n * clips by construction — no masking. The gradient is the circular equivalent\n * of the linear bar's track-spanning fill: an SVG gradient is fixed to the\n * ring's extent and the arc reveals it, so the complete `from`→`to` only shows\n * once the ring closes at 100%. `filled` / `light` stroke a single palette\n * color (`--c-solid` / `--c-soft`) instead.\n *\n * Palette comes through the kit's `data-color` + slot-var system, so a new\n * color in `colors.css` works here for free.\n */\n\nconst CIRCULAR_DIMENSIONS: Record<Size, { size: number; thickness: number }> = {\n xs: { size: 24, thickness: 3 },\n sm: { size: 32, thickness: 3 },\n md: { size: 44, thickness: 4 },\n lg: { size: 60, thickness: 5 },\n xl: { size: 80, thickness: 6 },\n}\n\n/**\n * Resolves `size` / `thickness` to a px number: a raw number passes through\n * verbatim, a tee-shirt size looks up its own `key` from `CIRCULAR_DIMENSIONS`,\n * and `undefined` falls back through `fallbackSize` (itself defaulting to\n * `\"md\"` when that's a raw number, since a numeric `size` has no tee-shirt\n * dimensions of its own to fall back to for `thickness`).\n */\nconst resolveDimension = (\n value: CircularProgressSize | number | undefined,\n key: \"size\" | \"thickness\",\n fallbackSize: CircularProgressSize | number | undefined,\n) => {\n if (typeof value === \"number\") return value\n if (value != null) return CIRCULAR_DIMENSIONS[value][key]\n const fallback = typeof fallbackSize === \"number\" ? \"md\" : (fallbackSize ?? \"md\")\n return CIRCULAR_DIMENSIONS[fallback][key]\n}\n\nconst circularRange = cva(\n // Transition both the dash length and offset so toggling indeterminate morphs\n // the arc (value arc ↔ fixed 25% spinner arc) instead of snapping. The spin\n // itself lives on the <svg> (base rotation 0), so it starts seamlessly.\n [\"fill-none\", \"[transition:stroke-dasharray_300ms_ease,stroke-dashoffset_300ms_ease]\"],\n {\n variants: {\n // `gradient` strokes the SVG gradient (set inline); the palette variants\n // stroke a slot var.\n variant: {\n filled: \"stroke-(--c-solid)\",\n gradient: \"\",\n },\n },\n defaultVariants: { variant: \"filled\" },\n },\n)\n\nexport type CircularProgressVariant = NonNullable<VariantProps<typeof circularRange>[\"variant\"]>\nexport type CircularProgressSize = Size\n\nexport type { GradientDir, GradientProps }\n\ntype CircularProgressClassNames = {\n root?: string\n circle?: string\n track?: string\n range?: string\n label?: string\n}\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type CircularProgressProps = Omit<\n ArkRootProps,\n \"value\" | \"defaultValue\" | \"onValueChange\" | \"ref\" | \"className\" | \"children\"\n> &\n VariantProps<typeof circularRange> &\n WithTestId & {\n /** Controlled value (0..max). Pass `null` for the indeterminate state. */\n value?: number | null\n /** Uncontrolled initial value. Pass `null` to start indeterminate. */\n defaultValue?: number | null\n /** Fires on every value change. */\n onChange?: (value: number | null) => void\n size?: CircularProgressSize | number\n /** Stroke width in px, a tee-shirt size, or omitted for a per-size default. */\n thickness?: CircularProgressSize | number\n /** Accent palette. Ignored when `variant=\"gradient\"`. */\n color?: Color\n /**\n * Gradient stops; only applied when `variant=\"gradient\"`. `from` / `to` /\n * `via` are CSS colors (default purple-300 → pink-400). `dir` is ignored —\n * the SVG sweep direction is fixed (top-left → bottom-right).\n */\n gradient?: GradientProps\n /** Centered content, e.g. a percentage label. */\n children?: ReactNode\n /** Lands on the ring `<svg>` — the `role=\"progressbar\"` element. */\n ref?: Ref<SVGSVGElement>\n className?: string\n classNames?: CircularProgressClassNames\n style?: CSSProperties\n }\n\nexport const CircularProgress = ({\n value,\n defaultValue,\n onChange,\n variant,\n size,\n thickness,\n color,\n gradient,\n min = 0,\n max = 100,\n children,\n ref,\n className,\n classNames,\n style,\n testId,\n ...rest\n}: CircularProgressProps) => {\n const isGradient = variant === \"gradient\"\n const gradientId = useId()\n\n return (\n <Ark.Root\n // `undefined` → uncontrolled (Ark's own default). `null` → indeterminate.\n // The two must NOT be coalesced, so each is forwarded verbatim.\n value={value}\n defaultValue={defaultValue}\n onValueChange={onChange ? ({ value: v }) => onChange(v) : undefined}\n min={min}\n max={max}\n data-color={!isGradient ? color : undefined}\n className={cn(\"group/cprogress relative inline-flex\", className, classNames?.root)}\n style={\n {\n \"--size\": `${resolveDimension(size, \"size\", size)}px`,\n \"--thickness\": `${resolveDimension(thickness, \"thickness\", size)}px`,\n ...style,\n } as CSSProperties\n }\n {...rest}\n >\n <Ark.Circle\n ref={ref}\n className={cn(\n // Ark's CircleRange already rotates the arc to start at 12 o'clock.\n \"block\",\n // Indeterminate: Ark drops the dash, so the range below pins a fixed\n // arc; spin the whole ring. Gated under reduced motion in theme.css.\n \"group-data-[state=indeterminate]/cprogress:animate-progress-spin\",\n classNames?.circle,\n )}\n {...props({ \"data-testid\": testId })}\n >\n {isGradient && (\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n <stop offset=\"0%\" stopColor={gradient?.from ?? \"var(--color-purple-300)\"} />\n {gradient?.via && <stop offset=\"50%\" stopColor={gradient.via} />}\n <stop offset=\"100%\" stopColor={gradient?.to ?? \"var(--color-pink-400)\"} />\n </linearGradient>\n </defs>\n )}\n <Ark.CircleTrack\n className={cn(\"fill-none stroke-black/3 dark:stroke-white/4\", classNames?.track)}\n />\n <Ark.CircleRange\n strokeLinecap=\"round\"\n className={cn(\n circularRange({ variant }),\n // Indeterminate: pin a fixed 25% arc (Ark omits the dash here).\n \"group-data-[state=indeterminate]/cprogress:[stroke-dasharray:calc(var(--circumference)*0.25)_var(--circumference)]\",\n \"group-data-[state=indeterminate]/cprogress:[stroke-dashoffset:0]\",\n classNames?.range,\n )}\n style={isGradient ? { stroke: `url(#${gradientId})` } : undefined}\n />\n </Ark.Circle>\n\n {children != null && (\n <span\n className={cn(\"absolute inset-0 flex items-center justify-center\", classNames?.label)}\n >\n {children}\n </span>\n )}\n </Ark.Root>\n )\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/circular-progress/circular-progress.tsx"],"names":["Ark"],"mappings":";;;;;;;AAmCA,IAAM,mBAAA,GAAyE;AAAA,EAC7E,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA,EAAE;AAAA,EAC7B,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA,EAAE;AAAA,EAC7B,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA,EAAE;AAAA,EAC7B,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA,EAAE;AAAA,EAC7B,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,EAAI,WAAW,CAAA;AAC7B,CAAA;AASA,IAAM,gBAAA,GAAmB,CACvB,KAAA,EACA,GAAA,EACA,YAAA,KACG;AACH,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,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,EAAK,MAAA,EAAO,QAAO,SAAA,EAAW,QAAA,EAAU,MAAM,uBAAA,EAAyB;AAAA,eAAA,EAC1E,CAAA,EACF,CAAA;AAAA,8BAEF,GAAA;AAAA,gBAACA,QAAA,CAAI,WAAA;AAAA,gBAAJ;AAAA,kBACC,SAAA,EAAW,EAAA,CAAG,8CAAA,EAAgD,UAAA,EAAY,KAAK;AAAA;AAAA,eACjF;AAAA,8BACA,GAAA;AAAA,gBAACA,QAAA,CAAI,WAAA;AAAA,gBAAJ;AAAA,kBACC,aAAA,EAAc,OAAA;AAAA,kBACd,SAAA,EAAW,EAAA;AAAA,oBACT,aAAA,CAAc,EAAE,OAAA,EAAS,CAAA;AAAA;AAAA,oBAEzB,oHAAA;AAAA,oBACA,kEAAA;AAAA,oBACA,UAAA,EAAY;AAAA,mBACd;AAAA,kBACA,OAAO,UAAA,GAAa,EAAE,QAAQ,CAAA,KAAA,EAAQ,UAAU,KAAI,GAAI;AAAA;AAAA;AAC1D;AAAA;AAAA,SACF;AAAA,QAEC,YAAY,IAAA,oBACX,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAW,EAAA,CAAG,mDAAA,EAAqD,UAAA,EAAY,KAAK,CAAA;AAAA,YAEnF;AAAA;AAAA;AACH;AAAA;AAAA,GAEJ;AAEJ","file":"index.js","sourcesContent":["import { Progress as Ark } from \"@ark-ui/react/progress\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type ReactNode,\n type Ref,\n useId,\n} from \"react\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport type { GradientDir, GradientProps } from \"../../lib/gradient\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * CircularProgress — ring progress indicator on top of Ark UI's Progress state\n * machine (the circular counterpart of `Progress`). Ark owns the value/percent\n * math, the indeterminate flag, the `role=\"progressbar\"` + ARIA wiring, and the\n * SVG ring geometry (`Circle` → `CircleTrack` + `CircleRange`, sized by the\n * `--size` / `--thickness` vars we set on the root).\n *\n * The arc is a stroked SVG circle (`stroke-dasharray` driven by Ark), so it\n * clips by construction — no masking. The gradient is the circular equivalent\n * of the linear bar's track-spanning fill: an SVG gradient is fixed to the\n * ring's extent and the arc reveals it, so the complete `from`→`to` only shows\n * once the ring closes at 100%. `filled` / `light` stroke a single palette\n * color (`--c-solid` / `--c-soft`) instead.\n *\n * Palette comes through the kit's `data-color` + slot-var system, so a new\n * color in `colors.css` works here for free.\n */\n\nconst CIRCULAR_DIMENSIONS: Record<Size, { size: number; thickness: number }> = {\n xs: { size: 24, thickness: 3 },\n sm: { size: 32, thickness: 3 },\n md: { size: 44, thickness: 4 },\n lg: { size: 60, thickness: 5 },\n xl: { size: 80, thickness: 6 },\n}\n\n/**\n * Resolves `size` / `thickness` to a px number: a raw number passes through\n * verbatim, a tee-shirt size looks up its own `key` from `CIRCULAR_DIMENSIONS`,\n * and `undefined` falls back through `fallbackSize` (itself defaulting to\n * `\"md\"` when that's a raw number, since a numeric `size` has no tee-shirt\n * dimensions of its own to fall back to for `thickness`).\n */\nconst resolveDimension = (\n value: CircularProgressSize | number | undefined,\n key: \"size\" | \"thickness\",\n fallbackSize: CircularProgressSize | number | undefined,\n) => {\n if (typeof value === \"number\") return value\n if (value != null) return CIRCULAR_DIMENSIONS[value][key]\n const fallback = typeof fallbackSize === \"number\" ? \"md\" : (fallbackSize ?? \"md\")\n return CIRCULAR_DIMENSIONS[fallback][key]\n}\n\nconst circularRange = cva(\n // Transition both the dash length and offset so toggling indeterminate morphs\n // the arc (value arc ↔ fixed 25% spinner arc) instead of snapping. The spin\n // itself lives on the <svg> (base rotation 0), so it starts seamlessly.\n [\"fill-none\", \"[transition:stroke-dasharray_300ms_ease,stroke-dashoffset_300ms_ease]\"],\n {\n variants: {\n // `gradient` strokes the SVG gradient (set inline); the palette variants\n // stroke a slot var.\n variant: {\n filled: \"stroke-(--c-solid)\",\n gradient: \"\",\n },\n },\n defaultVariants: { variant: \"filled\" },\n },\n)\n\nexport type CircularProgressVariant = NonNullable<VariantProps<typeof circularRange>[\"variant\"]>\nexport type CircularProgressSize = Size\n\nexport type { GradientDir, GradientProps }\n\ntype CircularProgressClassNames = {\n root?: string\n circle?: string\n track?: string\n range?: string\n label?: string\n}\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type CircularProgressProps = Omit<\n ArkRootProps,\n \"value\" | \"defaultValue\" | \"onValueChange\" | \"ref\" | \"className\" | \"children\" | \"asChild\"\n> &\n ForbidAsChild &\n VariantProps<typeof circularRange> &\n WithTestId & {\n /** Controlled value (0..max). Pass `null` for the indeterminate state. */\n value?: number | null\n /** Uncontrolled initial value. Pass `null` to start indeterminate. */\n defaultValue?: number | null\n /** Fires on every value change. */\n onChange?: (value: number | null) => void\n size?: CircularProgressSize | number\n /** Stroke width in px, a tee-shirt size, or omitted for a per-size default. */\n thickness?: CircularProgressSize | number\n /** Accent palette. Ignored when `variant=\"gradient\"`. */\n color?: Color\n /**\n * Gradient stops; only applied when `variant=\"gradient\"`. `from` / `to` /\n * `via` are CSS colors (default purple-300 → pink-400). `dir` is ignored —\n * the SVG sweep direction is fixed (top-left → bottom-right).\n */\n gradient?: GradientProps\n /** Centered content, e.g. a percentage label. */\n children?: ReactNode\n /** Lands on the ring `<svg>` — the `role=\"progressbar\"` element. */\n ref?: Ref<SVGSVGElement>\n className?: string\n classNames?: CircularProgressClassNames\n style?: CSSProperties\n }\n\nexport const CircularProgress = ({\n value,\n defaultValue,\n onChange,\n variant,\n size,\n thickness,\n color,\n gradient,\n min = 0,\n max = 100,\n children,\n ref,\n className,\n classNames,\n style,\n testId,\n asChild: _asChild,\n ...rest\n}: CircularProgressProps) => {\n const isGradient = variant === \"gradient\"\n const gradientId = useId()\n\n return (\n <Ark.Root\n // `undefined` → uncontrolled (Ark's own default). `null` → indeterminate.\n // The two must NOT be coalesced, so each is forwarded verbatim.\n value={value}\n defaultValue={defaultValue}\n onValueChange={onChange ? ({ value: v }) => onChange(v) : undefined}\n min={min}\n max={max}\n data-color={!isGradient ? color : undefined}\n className={cn(\"group/cprogress relative inline-flex\", className, classNames?.root)}\n style={\n {\n \"--size\": `${resolveDimension(size, \"size\", size)}px`,\n \"--thickness\": `${resolveDimension(thickness, \"thickness\", size)}px`,\n ...style,\n } as CSSProperties\n }\n {...rest}\n >\n <Ark.Circle\n ref={ref}\n className={cn(\n // Ark's CircleRange already rotates the arc to start at 12 o'clock.\n \"block\",\n // Indeterminate: Ark drops the dash, so the range below pins a fixed\n // arc; spin the whole ring. Gated under reduced motion in theme.css.\n \"group-data-[state=indeterminate]/cprogress:animate-progress-spin\",\n classNames?.circle,\n )}\n {...props({ \"data-testid\": testId })}\n >\n {isGradient && (\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n <stop offset=\"0%\" stopColor={gradient?.from ?? \"var(--color-purple-300)\"} />\n {gradient?.via && <stop offset=\"50%\" stopColor={gradient.via} />}\n <stop offset=\"100%\" stopColor={gradient?.to ?? \"var(--color-pink-400)\"} />\n </linearGradient>\n </defs>\n )}\n <Ark.CircleTrack\n className={cn(\"fill-none stroke-black/3 dark:stroke-white/4\", classNames?.track)}\n />\n <Ark.CircleRange\n strokeLinecap=\"round\"\n className={cn(\n circularRange({ variant }),\n // Indeterminate: pin a fixed 25% arc (Ark omits the dash here).\n \"group-data-[state=indeterminate]/cprogress:[stroke-dasharray:calc(var(--circumference)*0.25)_var(--circumference)]\",\n \"group-data-[state=indeterminate]/cprogress:[stroke-dashoffset:0]\",\n classNames?.range,\n )}\n style={isGradient ? { stroke: `url(#${gradientId})` } : undefined}\n />\n </Ark.Circle>\n\n {children != null && (\n <span\n className={cn(\"absolute inset-0 flex items-center justify-center\", classNames?.label)}\n >\n {children}\n </span>\n )}\n </Ark.Root>\n )\n}\n"]}
@@ -71,7 +71,7 @@ export type ClipboardInputProps = Omit<ComponentProps<typeof Ark.Input>, "size"
71
71
  * Always read-only: Ark's own machine already sets `readOnly` on the real
72
72
  * `<input>` it renders; the `readOnly` given to `InputBase` here just mirrors
73
73
  * that onto the shell's own `data-readonly` hook. */
74
- declare const Input: ({ variant, size, className, classNames, children, testId, ...rest }: ClipboardInputProps) => import("react").JSX.Element;
74
+ declare const Input: ({ variant, size, className, classNames, children, testId, asChild, ...rest }: ClipboardInputProps) => import("react").JSX.Element;
75
75
  export declare const Clipboard: {
76
76
  Root: typeof Root;
77
77
  /** Ark's raw `Label` part — a real `<label>`; unstyled by default, size/style
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../src/components/clipboard/clipboard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,YAAY,EAAuB,MAAM,gBAAgB,CAAA;AAElG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;kEAOkE;AAClE,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAA;AAEhG,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,EAC/B,UAAU,GAAG,eAAe,GAAG,gBAAgB,CAChD,GACC,UAAU,GAAG;IACX,uEAAuE;IACvE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC;;;4DAGw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AAO,GAAG,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAA;AAEhG,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,EAC/B,UAAU,GAAG,eAAe,GAAG,gBAAgB,CAChD,GACC,UAAU,GAAG;IACX,uEAAuE;IACvE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC;;;4DAGwD;IACxD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;CAC3C,CAAA;AAEH;2DAC2D;AAC3D,QAAA,MAAM,IAAI,kDAAmD,kBAAkB,gCAO9E,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,GAC3F,UAAU,GAAG;IACX,iDAAiD;IACjD,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;;kFAG8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,UAAU,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/C,CAAA;AAEH;;;;;;;;sDAQsD;AACtD,QAAA,MAAM,KAAK,iFASR,mBAAmB,gCAcrB,CAAA;AAED,eAAO,MAAM,SAAS;;IAEpB;+EAC2E;;IAE3E;iFAC6E;;;IAG7E;qDACiD;;IAEjD;8EAC0E;;IAE1E;mEAC+D;;CAEhE,CAAA"}
@@ -1,8 +1,9 @@
1
1
  "use client";
2
- import { InputBase, inputControlClasses } from '../../chunk-QMW7D5GU.js';
3
- import '../../chunk-UNSAA7YG.js';
4
- import { ActionIcon } from '../../chunk-VLUKI3HL.js';
2
+ import { InputBase, inputControlClasses } from '../../chunk-5OQLFX47.js';
3
+ import '../../chunk-FHG54IT5.js';
4
+ import { ActionIcon } from '../../chunk-S7N4LGLZ.js';
5
5
  import '../../chunk-NSDM3FEB.js';
6
+ import '../../chunk-I4SQQIP5.js';
6
7
  import { props } from '../../chunk-WYCMIIRR.js';
7
8
  import '../../chunk-B2LCHXUB.js';
8
9
  import { cn } from '../../chunk-QP4I37PA.js';
@@ -26,17 +27,20 @@ var Input = ({
26
27
  classNames,
27
28
  children,
28
29
  testId,
30
+ asChild,
29
31
  ...rest
30
32
  }) => /* @__PURE__ */ jsxs(InputBase, { variant, size, readOnly: true, className: cn(className, classNames?.root), children: [
31
33
  /* @__PURE__ */ jsx(
32
34
  Clipboard$1.Input,
33
35
  {
36
+ asChild,
34
37
  className: cn(inputControlClasses, classNames?.input),
35
38
  ...props({ "data-testid": testId }),
36
- ...rest
39
+ ...rest,
40
+ children: asChild ? children : void 0
37
41
  }
38
42
  ),
39
- children
43
+ !asChild && children
40
44
  ] });
41
45
  var Clipboard = {
42
46
  Root,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/clipboard/clipboard.tsx","../../../src/components/clipboard/copy.tsx"],"names":["Ark","jsxs","jsx"],"mappings":";;;;;;;;;;;AA0DA,IAAM,IAAA,GAAO,CAAC,EAAE,QAAA,EAAU,gBAAgB,MAAA,EAAQ,GAAG,MAAK,qBACxD,GAAA;AAAA,EAACA,WAAA,CAAI,IAAA;AAAA,EAAJ;AAAA,IACC,eAAe,QAAA,GAAW,CAAC,YAAY,QAAA,CAAS,OAAA,CAAQ,KAAK,CAAA,GAAI,MAAA;AAAA,IACjE,gBAAgB,cAAA,GAAiB,CAAC,YAAY,cAAA,CAAe,OAAA,CAAQ,MAAM,CAAA,GAAI,MAAA;AAAA,IAC9E,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AA0BF,IAAM,QAAQ,CAAC;AAAA,EACb,OA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AA,GAAA,EAC3E,CAAA;AAEJ,CAAA;AAmBA,IAAM,cAAA,GAAiB,CAAC,EAAE,QAAA,EAAS,KAA2D;AAC5F,EAAA,MAAM,EAAE,MAAA,EAAQ,IAAA,EAAK,GAAI,mBAAA,EAAoB;AAC7C,EAAA,OAAO,QAAA,CAAS,EAAE,MAAA,EAAQ,IAAA,EAAM,CAAA;AAClC,CAAA;AA4DO,IAAM,OAAO,CAAC;AAAA,EACnB,KAAA;AAAA,EACA,OAAA;AAAA,EACA,cAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,qBACEA,GAAAA,CAAC,SAAA,CAAU,IAAA,EAAV,EAAe,OAAc,OAAA,EAAkB,cAAA,EAC7C,QAAA,EAAA,OAAO,QAAA,KAAa,6BACnBA,GAAAA,CAAC,cAAA,EAAA,EAAgB,QAAA,EAAS,oBAE1BA,GAAAA,CAAC,SAAA,CAAU,OAAA,EAAV,EAAkB,OAAA,EAAO,IAAA,EACxB,QAAA,kBAAAA,GAAAA,CAAC,cAAW,OAAA,EAAkB,IAAA,EAAY,MAAA,EAAgB,KAAA,EAAc,QACtE,QAAA,kBAAAA,GAAAA,CAAC,aAAA,EAAA,EAAc,CAAA,EACjB,GACF,CAAA,EAEJ","file":"index.js","sourcesContent":["import { Clipboard as Ark } from \"@ark-ui/react/clipboard\"\nimport type { ComponentProps, ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { InputBase, type InputSize, type InputVariant, inputControlClasses } from \"../input/input\"\n\n/**\n * Clipboard — a styled compound over Ark UI's Clipboard machine, for the\n * \"read-only value + copy button\" field pattern (share links, API keys,\n * invite codes). `Object.assign`-free parts namespace only, no bare-invocation\n * convenience form — matches `Popover`'s shape, since a rich field like this\n * isn't a single-prop drop-in the way `Copy` (this package's simple icon-button\n * preset) is.\n *\n * <Clipboard.Root value={link}>\n * <Clipboard.Label>Share link</Clipboard.Label>\n * <Clipboard.Input>\n * <Clipboard.Trigger asChild>\n * <ActionIcon variant=\"subtle\" aria-label=\"Copy link\">\n * <Clipboard.Indicator copied={<CheckIcon />}>\n * <CopyIcon />\n * </Clipboard.Indicator>\n * </ActionIcon>\n * </Clipboard.Trigger>\n * </Clipboard.Input>\n * </Clipboard.Root>\n *\n * For the common \"just an icon button, no visible value\" case, reach for\n * `Copy` instead — it composes this same machine with `ActionIcon` internally.\n */\n\n/** Ark's own `translations` prop type, derived structurally rather than imported\n * by name — `IntlTranslations` lives in `@zag-js/clipboard`, a transitive\n * dependency of the `@ark-ui/react` peer dep, not one this package declares\n * itself (same derivation `Calendar` uses for its own translations type).\n * Unlike `Calendar`'s translations, this shape is already fully partial (a\n * single optional `triggerLabel`) and Ark's own machine merges it over its own\n * English default internally, so — unlike `Calendar` — no default-merging\n * helper is needed here; `Root` forwards it straight through. */\nexport type ClipboardTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\nexport type ClipboardRootProps = Omit<\n ComponentProps<typeof Ark.Root>,\n \"onChange\" | \"onValueChange\" | \"onStatusChange\"\n> &\n WithTestId & {\n /** Flattened from Ark's `onValueChange` — the next clipboard value. */\n onChange?: (value: string) => void\n /** Flattened from Ark's `onStatusChange` — fires `true` once the value is\n * copied. Ark's machine only emits this on copy, not on the automatic\n * revert to idle after `timeout` — read `Clipboard.Indicator` (or its\n * `copied` render prop) for the live state instead. */\n onCopiedChange?: (copied: boolean) => void\n }\n\n/** Owns open-ended clipboard state (value + copied/idle) and renders the real\n * `<div>` the rest of the compound reads context from. */\nconst Root = ({ onChange, onCopiedChange, testId, ...rest }: ClipboardRootProps) => (\n <Ark.Root\n onValueChange={onChange ? (details) => onChange(details.value) : undefined}\n onStatusChange={onCopiedChange ? (details) => onCopiedChange(details.copied) : undefined}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ClipboardInputProps = Omit<ComponentProps<typeof Ark.Input>, \"size\" | \"readOnly\"> &\n WithTestId & {\n /** Shell treatment — same scale as `Input`'s. */\n variant?: InputVariant\n /** Height step — same scale as `Input`'s. */\n size?: InputSize\n /** The copy `Trigger`, rendered as a real sibling of the input inside the\n * shell — pass it as `children`, not via a decorative `endSlot` (whose\n * wrapper is `aria-hidden` and would hide an interactive trigger from\n * assistive tech; see `PasswordInput`'s reveal toggle for the same call). */\n children?: ReactNode\n classNames?: { root?: string; input?: string }\n }\n\n/** The clipboard value, in the kit's shared `InputBase` shell — reused\n * directly (like `Input` / `PasswordInput` do), rather than through a\n * separate `Clipboard.Control` shell. `Clipboard.Control` (Ark's raw part,\n * re-exported below) stays available for consumers who want a different\n * layout and just need its `data-copied` attribute.\n *\n * Always read-only: Ark's own machine already sets `readOnly` on the real\n * `<input>` it renders; the `readOnly` given to `InputBase` here just mirrors\n * that onto the shell's own `data-readonly` hook. */\nconst Input = ({\n variant,\n size,\n className,\n classNames,\n children,\n testId,\n ...rest\n}: ClipboardInputProps) => (\n <InputBase variant={variant} size={size} readOnly className={cn(className, classNames?.root)}>\n <Ark.Input\n className={cn(inputControlClasses, classNames?.input)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n {children}\n </InputBase>\n)\n\nexport const Clipboard = {\n Root,\n /** Ark's raw `Label` part — a real `<label>`; unstyled by default, size/style\n * it like any other field label (or reuse `Field`'s own `fieldLabel`). */\n Label: Ark.Label,\n /** Ark's raw `Control` part — wraps `Input` (+ `Trigger`) when you want a\n * different shell than `InputBase`; carries `data-copied` for that case. */\n Control: Ark.Control,\n Input,\n /** Ark's raw `Trigger` part — a real `<button>`; `asChild` to swap in\n * `ActionIcon` or any other trigger element. */\n Trigger: Ark.Trigger,\n /** Ark's raw `Indicator` part — pass `copied={<CheckIcon />}` to swap content\n * once the value is copied, reverting once the state returns to idle. */\n Indicator: Ark.Indicator,\n /** Ark's raw `ValueText` part — renders the live value as plain (non-input)\n * text, for a read-only display that isn't a form control. */\n ValueText: Ark.ValueText,\n}\n","import { useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport { CheckIcon, CopyIcon } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { ActionIcon, type ActionIconProps } from \"../action-icon/action-icon\"\nimport { Clipboard } from \"./clipboard\"\n\n/** Reads the live `copied` flag off the enclosing `Clipboard.Root` — context,\n * not the one-shot `onStatusChange` callback, which never fires `false` on the\n * automatic revert to idle — and drives the icon swap off a `data-state`\n * attribute + Tailwind `data-[state=…]` variants, never a boolean threaded\n * into a conditional class string. Mirrors `ActionIcon`'s own\n * `data-loading`-driven state, and for the same reason: a `data-*` attribute\n * keeps working regardless of what element ends up rendered underneath. */\nconst CopyIndicator = () => {\n const { copied } = useClipboardContext()\n const state = copied ? \"copied\" : \"idle\"\n return (\n <>\n <CopyIcon data-state={state} className=\"data-[state=copied]:hidden\" />\n <CheckIcon data-state={state} className=\"not-data-[state=copied]:hidden\" />\n </>\n )\n}\n\nexport type CopyRenderState = {\n /** Whether `value` was just copied to the clipboard — flips back to\n * `false` once `timeout` elapses. */\n copied: boolean\n /** Writes `value` to the clipboard — the exact same action `Clipboard.Trigger`\n * itself calls on click. Wire it to your own trigger's `onClick`; `Copy`\n * doesn't attach it for you. */\n copy: () => void\n}\n\n/** Reads `{ copied, copy }` off the enclosing `Clipboard.Root` context and hands\n * them straight to the render-prop `children` — no markup of its own, so the\n * consumer's returned JSX is the only thing rendered. `copy` is Ark's own\n * `copy()` action (`send({ type: \"COPY\" })`), so calling it behaves\n * identically to clicking the default `Clipboard.Trigger`: it writes `value`\n * to the clipboard, flips `copied`, fires `Root`'s `onCopiedChange`, and\n * reverts after `timeout`. */\nconst CopyRenderProp = ({ children }: { children: (state: CopyRenderState) => ReactNode }) => {\n const { copied, copy } = useClipboardContext()\n return children({ copied, copy })\n}\n\nexport type CopyProps = Pick<\n ActionIconProps,\n \"variant\" | \"size\" | \"radius\" | \"color\" | \"testId\"\n> & {\n /** The value copied to the clipboard on click. */\n value: string\n /** Ms before the copied state reverts to idle. Ark's own default (3000). */\n timeout?: number\n /** Fires `true` once the value is copied — flattened from Ark's\n * `onStatusChange`. Ark's machine only emits this on copy, never on the\n * automatic revert to idle after `timeout` (an upstream characteristic of\n * the machine, not a gap in this wrapper). */\n onCopiedChange?: (copied: boolean) => void\n /** Omit for the default rendering (an icon-button `ActionIcon` whose icon\n * swaps to a checkmark on copy). Pass a function instead to go fully\n * headless: `Copy` renders none of its own markup and instead calls this\n * with `{ copied, copy }`, letting you render whatever trigger you want —\n * your own button, a text link, a custom icon — wiring `copy` to its\n * `onClick` yourself. `copied` and `copy` still ride the same `timeout` /\n * `onCopiedChange` behavior as the default button.\n *\n * <Copy value={value}>\n * {({ copied, copy }) => (\n * <button type=\"button\" onClick={copy}>\n * {copied ? \"Copied!\" : \"Copy\"}\n * </button>\n * )}\n * </Copy>\n */\n children?: (state: CopyRenderState) => ReactNode\n}\n\n/**\n * Copy — a one-line preset: `Clipboard.Root` + `Clipboard.Trigger` wrapping this\n * kit's own `ActionIcon`. No visible input, just an icon button whose icon\n * swaps to a checkmark on copy and reverts to the copy icon after `timeout`.\n * `variant` / `size` / `radius` / `color` forward straight to `ActionIcon` — see\n * its own docs for that model.\n *\n * <Copy value=\"https://example.com/s/abc123\" />\n *\n * The accessible name comes from Ark's own `\"Copy to clipboard\"` /\n * `\"Copied to clipboard\"` translations. `Copy` is a closed leaf preset — it\n * owns its `ActionIcon` outright and doesn't accept `asChild` or a custom\n * `aria-label`; compose `Clipboard.Root` / `Clipboard.Trigger` directly (see\n * the `Clipboard` docs) for a different trigger element or translated text.\n *\n * For anything else — a text link, a custom icon, your own button styling —\n * pass a function as `children` instead and go headless: `Copy` then renders\n * only the function's own return value, no `ActionIcon`/icon-swap markup of\n * its own, and hands you `{ copied, copy }` to build the trigger yourself.\n *\n * <Copy value=\"https://example.com/s/abc123\">\n * {({ copied, copy }) => (\n * <button type=\"button\" onClick={copy}>{copied ? \"Copied!\" : \"Copy\"}</button>\n * )}\n * </Copy>\n */\nexport const Copy = ({\n value,\n timeout,\n onCopiedChange,\n variant,\n size,\n radius,\n color,\n testId,\n children,\n}: CopyProps) => (\n <Clipboard.Root value={value} timeout={timeout} onCopiedChange={onCopiedChange}>\n {typeof children === \"function\" ? (\n <CopyRenderProp>{children}</CopyRenderProp>\n ) : (\n <Clipboard.Trigger asChild>\n <ActionIcon variant={variant} size={size} radius={radius} color={color} testId={testId}>\n <CopyIndicator />\n </ActionIcon>\n </Clipboard.Trigger>\n )}\n </Clipboard.Root>\n)\n"]}
1
+ {"version":3,"sources":["../../../src/components/clipboard/clipboard.tsx","../../../src/components/clipboard/copy.tsx"],"names":["Ark","jsxs","jsx"],"mappings":";;;;;;;;;;;;AA0DA,IAAM,IAAA,GAAO,CAAC,EAAE,QAAA,EAAU,gBAAgB,MAAA,EAAQ,GAAG,MAAK,qBACxD,GAAA;AAAA,EAACA,WAAA,CAAI,IAAA;AAAA,EAAJ;AAAA,IACC,eAAe,QAAA,GAAW,CAAC,YAAY,QAAA,CAAS,OAAA,CAAQ,KAAK,CAAA,GAAI,MAAA;AAAA,IACjE,gBAAgB,cAAA,GAAiB,CAAC,YAAY,cAAA,CAAe,OAAA,CAAQ,MAAM,CAAA,GAAI,MAAA;AAAA,IAC9E,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AA0BF,IAAM,QAAQ,CAAC;AAAA,EACb,OAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,IAAA,CAAC,SAAA,EAAA,EAAU,OAAA,EAAkB,IAAA,EAAY,QAAA,EAAQ,IAAA,EAAC,SAAA,EAAW,EAAA,CAAG,SAAA,EAAW,UAAA,EAAY,IAAI,CAAA,EAGzF,QAAA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AE,MAAA,EAAQ,IAAA,EAAM,CAAA;AAClC,CAAA;AA4DO,IAAM,OAAO,CAAC;AAAA,EACnB,KAAA;AAAA,EACA,OAAA;AAAA,EACA,cAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,qBACEA,GAAAA,CAAC,SAAA,CAAU,IAAA,EAAV,EAAe,OAAc,OAAA,EAAkB,cAAA,EAC7C,QAAA,EAAA,OAAO,QAAA,KAAa,6BACnBA,GAAAA,CAAC,cAAA,EAAA,EAAgB,QAAA,EAAS,oBAE1BA,GAAAA,CAAC,SAAA,CAAU,OAAA,EAAV,EAAkB,OAAA,EAAO,IAAA,EACxB,QAAA,kBAAAA,GAAAA,CAAC,cAAW,OAAA,EAAkB,IAAA,EAAY,MAAA,EAAgB,KAAA,EAAc,QACtE,QAAA,kBAAAA,GAAAA,CAAC,aAAA,EAAA,EAAc,CAAA,EACjB,GACF,CAAA,EAEJ","file":"index.js","sourcesContent":["import { Clipboard as Ark } from \"@ark-ui/react/clipboard\"\nimport type { ComponentProps, ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { InputBase, type InputSize, type InputVariant, inputControlClasses } from \"../input/input\"\n\n/**\n * Clipboard — a styled compound over Ark UI's Clipboard machine, for the\n * \"read-only value + copy button\" field pattern (share links, API keys,\n * invite codes). `Object.assign`-free parts namespace only, no bare-invocation\n * convenience form — matches `Popover`'s shape, since a rich field like this\n * isn't a single-prop drop-in the way `Copy` (this package's simple icon-button\n * preset) is.\n *\n * <Clipboard.Root value={link}>\n * <Clipboard.Label>Share link</Clipboard.Label>\n * <Clipboard.Input>\n * <Clipboard.Trigger asChild>\n * <ActionIcon variant=\"subtle\" aria-label=\"Copy link\">\n * <Clipboard.Indicator copied={<CheckIcon />}>\n * <CopyIcon />\n * </Clipboard.Indicator>\n * </ActionIcon>\n * </Clipboard.Trigger>\n * </Clipboard.Input>\n * </Clipboard.Root>\n *\n * For the common \"just an icon button, no visible value\" case, reach for\n * `Copy` instead — it composes this same machine with `ActionIcon` internally.\n */\n\n/** Ark's own `translations` prop type, derived structurally rather than imported\n * by name — `IntlTranslations` lives in `@zag-js/clipboard`, a transitive\n * dependency of the `@ark-ui/react` peer dep, not one this package declares\n * itself (same derivation `Calendar` uses for its own translations type).\n * Unlike `Calendar`'s translations, this shape is already fully partial (a\n * single optional `triggerLabel`) and Ark's own machine merges it over its own\n * English default internally, so — unlike `Calendar` — no default-merging\n * helper is needed here; `Root` forwards it straight through. */\nexport type ClipboardTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\nexport type ClipboardRootProps = Omit<\n ComponentProps<typeof Ark.Root>,\n \"onChange\" | \"onValueChange\" | \"onStatusChange\"\n> &\n WithTestId & {\n /** Flattened from Ark's `onValueChange` — the next clipboard value. */\n onChange?: (value: string) => void\n /** Flattened from Ark's `onStatusChange` — fires `true` once the value is\n * copied. Ark's machine only emits this on copy, not on the automatic\n * revert to idle after `timeout` — read `Clipboard.Indicator` (or its\n * `copied` render prop) for the live state instead. */\n onCopiedChange?: (copied: boolean) => void\n }\n\n/** Owns open-ended clipboard state (value + copied/idle) and renders the real\n * `<div>` the rest of the compound reads context from. */\nconst Root = ({ onChange, onCopiedChange, testId, ...rest }: ClipboardRootProps) => (\n <Ark.Root\n onValueChange={onChange ? (details) => onChange(details.value) : undefined}\n onStatusChange={onCopiedChange ? (details) => onCopiedChange(details.copied) : undefined}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ClipboardInputProps = Omit<ComponentProps<typeof Ark.Input>, \"size\" | \"readOnly\"> &\n WithTestId & {\n /** Shell treatment — same scale as `Input`'s. */\n variant?: InputVariant\n /** Height step — same scale as `Input`'s. */\n size?: InputSize\n /** The copy `Trigger`, rendered as a real sibling of the input inside the\n * shell — pass it as `children`, not via a decorative `endSlot` (whose\n * wrapper is `aria-hidden` and would hide an interactive trigger from\n * assistive tech; see `PasswordInput`'s reveal toggle for the same call). */\n children?: ReactNode\n classNames?: { root?: string; input?: string }\n }\n\n/** The clipboard value, in the kit's shared `InputBase` shell — reused\n * directly (like `Input` / `PasswordInput` do), rather than through a\n * separate `Clipboard.Control` shell. `Clipboard.Control` (Ark's raw part,\n * re-exported below) stays available for consumers who want a different\n * layout and just need its `data-copied` attribute.\n *\n * Always read-only: Ark's own machine already sets `readOnly` on the real\n * `<input>` it renders; the `readOnly` given to `InputBase` here just mirrors\n * that onto the shell's own `data-readonly` hook. */\nconst Input = ({\n variant,\n size,\n className,\n classNames,\n children,\n testId,\n asChild,\n ...rest\n}: ClipboardInputProps) => (\n <InputBase variant={variant} size={size} readOnly className={cn(className, classNames?.root)}>\n {/* `children` is the trailing slot (usually the copy trigger), except under\n `asChild`, where the single child is the input element itself. */}\n <Ark.Input\n asChild={asChild}\n className={cn(inputControlClasses, classNames?.input)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {asChild ? children : undefined}\n </Ark.Input>\n {!asChild && children}\n </InputBase>\n)\n\nexport const Clipboard = {\n Root,\n /** Ark's raw `Label` part — a real `<label>`; unstyled by default, size/style\n * it like any other field label (or reuse `Field`'s own `fieldLabel`). */\n Label: Ark.Label,\n /** Ark's raw `Control` part — wraps `Input` (+ `Trigger`) when you want a\n * different shell than `InputBase`; carries `data-copied` for that case. */\n Control: Ark.Control,\n Input,\n /** Ark's raw `Trigger` part — a real `<button>`; `asChild` to swap in\n * `ActionIcon` or any other trigger element. */\n Trigger: Ark.Trigger,\n /** Ark's raw `Indicator` part — pass `copied={<CheckIcon />}` to swap content\n * once the value is copied, reverting once the state returns to idle. */\n Indicator: Ark.Indicator,\n /** Ark's raw `ValueText` part — renders the live value as plain (non-input)\n * text, for a read-only display that isn't a form control. */\n ValueText: Ark.ValueText,\n}\n","import { useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport { CheckIcon, CopyIcon } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { ActionIcon, type ActionIconProps } from \"../action-icon/action-icon\"\nimport { Clipboard } from \"./clipboard\"\n\n/** Reads the live `copied` flag off the enclosing `Clipboard.Root` — context,\n * not the one-shot `onStatusChange` callback, which never fires `false` on the\n * automatic revert to idle — and drives the icon swap off a `data-state`\n * attribute + Tailwind `data-[state=…]` variants, never a boolean threaded\n * into a conditional class string. Mirrors `ActionIcon`'s own\n * `data-loading`-driven state, and for the same reason: a `data-*` attribute\n * keeps working regardless of what element ends up rendered underneath. */\nconst CopyIndicator = () => {\n const { copied } = useClipboardContext()\n const state = copied ? \"copied\" : \"idle\"\n return (\n <>\n <CopyIcon data-state={state} className=\"data-[state=copied]:hidden\" />\n <CheckIcon data-state={state} className=\"not-data-[state=copied]:hidden\" />\n </>\n )\n}\n\nexport type CopyRenderState = {\n /** Whether `value` was just copied to the clipboard — flips back to\n * `false` once `timeout` elapses. */\n copied: boolean\n /** Writes `value` to the clipboard — the exact same action `Clipboard.Trigger`\n * itself calls on click. Wire it to your own trigger's `onClick`; `Copy`\n * doesn't attach it for you. */\n copy: () => void\n}\n\n/** Reads `{ copied, copy }` off the enclosing `Clipboard.Root` context and hands\n * them straight to the render-prop `children` — no markup of its own, so the\n * consumer's returned JSX is the only thing rendered. `copy` is Ark's own\n * `copy()` action (`send({ type: \"COPY\" })`), so calling it behaves\n * identically to clicking the default `Clipboard.Trigger`: it writes `value`\n * to the clipboard, flips `copied`, fires `Root`'s `onCopiedChange`, and\n * reverts after `timeout`. */\nconst CopyRenderProp = ({ children }: { children: (state: CopyRenderState) => ReactNode }) => {\n const { copied, copy } = useClipboardContext()\n return children({ copied, copy })\n}\n\nexport type CopyProps = Pick<\n ActionIconProps,\n \"variant\" | \"size\" | \"radius\" | \"color\" | \"testId\"\n> & {\n /** The value copied to the clipboard on click. */\n value: string\n /** Ms before the copied state reverts to idle. Ark's own default (3000). */\n timeout?: number\n /** Fires `true` once the value is copied — flattened from Ark's\n * `onStatusChange`. Ark's machine only emits this on copy, never on the\n * automatic revert to idle after `timeout` (an upstream characteristic of\n * the machine, not a gap in this wrapper). */\n onCopiedChange?: (copied: boolean) => void\n /** Omit for the default rendering (an icon-button `ActionIcon` whose icon\n * swaps to a checkmark on copy). Pass a function instead to go fully\n * headless: `Copy` renders none of its own markup and instead calls this\n * with `{ copied, copy }`, letting you render whatever trigger you want —\n * your own button, a text link, a custom icon — wiring `copy` to its\n * `onClick` yourself. `copied` and `copy` still ride the same `timeout` /\n * `onCopiedChange` behavior as the default button.\n *\n * <Copy value={value}>\n * {({ copied, copy }) => (\n * <button type=\"button\" onClick={copy}>\n * {copied ? \"Copied!\" : \"Copy\"}\n * </button>\n * )}\n * </Copy>\n */\n children?: (state: CopyRenderState) => ReactNode\n}\n\n/**\n * Copy — a one-line preset: `Clipboard.Root` + `Clipboard.Trigger` wrapping this\n * kit's own `ActionIcon`. No visible input, just an icon button whose icon\n * swaps to a checkmark on copy and reverts to the copy icon after `timeout`.\n * `variant` / `size` / `radius` / `color` forward straight to `ActionIcon` — see\n * its own docs for that model.\n *\n * <Copy value=\"https://example.com/s/abc123\" />\n *\n * The accessible name comes from Ark's own `\"Copy to clipboard\"` /\n * `\"Copied to clipboard\"` translations. `Copy` is a closed leaf preset — it\n * owns its `ActionIcon` outright and doesn't accept `asChild` or a custom\n * `aria-label`; compose `Clipboard.Root` / `Clipboard.Trigger` directly (see\n * the `Clipboard` docs) for a different trigger element or translated text.\n *\n * For anything else — a text link, a custom icon, your own button styling —\n * pass a function as `children` instead and go headless: `Copy` then renders\n * only the function's own return value, no `ActionIcon`/icon-swap markup of\n * its own, and hands you `{ copied, copy }` to build the trigger yourself.\n *\n * <Copy value=\"https://example.com/s/abc123\">\n * {({ copied, copy }) => (\n * <button type=\"button\" onClick={copy}>{copied ? \"Copied!\" : \"Copy\"}</button>\n * )}\n * </Copy>\n */\nexport const Copy = ({\n value,\n timeout,\n onCopiedChange,\n variant,\n size,\n radius,\n color,\n testId,\n children,\n}: CopyProps) => (\n <Clipboard.Root value={value} timeout={timeout} onCopiedChange={onCopiedChange}>\n {typeof children === \"function\" ? (\n <CopyRenderProp>{children}</CopyRenderProp>\n ) : (\n <Clipboard.Trigger asChild>\n <ActionIcon variant={variant} size={size} radius={radius} color={color} testId={testId}>\n <CopyIndicator />\n </ActionIcon>\n </Clipboard.Trigger>\n )}\n </Clipboard.Root>\n)\n"]}
@@ -9,6 +9,7 @@ export type CodeBlockTranslations = {
9
9
  };
10
10
  export type CodeBlockClassNames = {
11
11
  root?: string;
12
+ title?: string;
12
13
  pre?: string;
13
14
  controls?: string;
14
15
  copyButton?: string;
@@ -42,6 +43,8 @@ export type CodeBlockChromeProps = WithTestId & {
42
43
  /** The tail half's already-rendered content — only read when
43
44
  * `isCollapsible`. */
44
45
  tailContent?: ReactNode;
46
+ /** Header row above the code; hosts the toolbar when set. */
47
+ title?: ReactNode;
45
48
  /** @default true */
46
49
  withCopyButton?: boolean;
47
50
  /** `null` hides it. @default <CopyIcon/> */
@@ -73,5 +76,5 @@ export type CodeBlockChromeProps = WithTestId & {
73
76
  * import from a Server Component) can render it without pulling in
74
77
  * `code-block.tsx`'s own client-only highlighting logic.
75
78
  */
76
- export declare function CodeBlockChrome({ code, isCollapsible, headContent, tailContent, withCopyButton, copyIcon, copiedIcon, onCopy, defaultExpanded, expanded: expandedProp, onExpandedChange, expandIcon, collapseIcon, controls, translations, testId, className, classNames, }: CodeBlockChromeProps): import("react").JSX.Element;
79
+ export declare function CodeBlockChrome({ code, isCollapsible, headContent, tailContent, title, withCopyButton, copyIcon, copiedIcon, onCopy, defaultExpanded, expanded: expandedProp, onExpandedChange, expandIcon, collapseIcon, controls, translations, testId, className, classNames, }: CodeBlockChromeProps): import("react").JSX.Element;
77
80
  //# sourceMappingURL=chrome.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../../src/components/code-block/chrome.tsx"],"names":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B,UAAU,CAAC,EAAE,mBAAmB,CAAA;CACjC,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,aAAa,EACb,WAAW,EACX,WAAW,EACX,KAAK,EACL,cAAqB,EACrB,QAAQ,EACR,UAAU,EACV,MAAM,EACN,eAAuB,EACvB,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,SAAS,EACT,UAAU,GACX,EAAE,oBAAoB,+BAsHtB"}
@@ -1,13 +1,14 @@
1
1
  "use client";
2
- export { CodeBlockButton, CodeBlockChrome } from '../../chunk-IXKELBJA.js';
3
- import '../../chunk-6SWK4XG5.js';
2
+ export { CodeBlockButton, CodeBlockChrome } from '../../chunk-ZDXQ64A7.js';
3
+ import '../../chunk-YXE4B6X3.js';
4
4
  import '../../chunk-G52U24GR.js';
5
- import '../../chunk-VZ2TPU4B.js';
5
+ import '../../chunk-6GDMSENK.js';
6
6
  import '../../chunk-AIQG7IIT.js';
7
7
  import '../../chunk-7P32XCEU.js';
8
8
  import '../../chunk-BUIHQJGE.js';
9
9
  import '../../chunk-BEL75C7N.js';
10
- import '../../chunk-HWNPXAEN.js';
10
+ import '../../chunk-WSIVRDRB.js';
11
+ import '../../chunk-I4SQQIP5.js';
11
12
  import '../../chunk-WYCMIIRR.js';
12
13
  import '../../chunk-B2LCHXUB.js';
13
14
  import '../../chunk-QP4I37PA.js';
@@ -58,6 +58,12 @@ export type CodeBlockProps = WithTestId & {
58
58
  * `registerTheme` (exported from `@42/ui-react/code-block`) for
59
59
  * registering a custom language/theme the bundled set doesn't ship. */
60
60
  transformers?: ShikiTransformer[];
61
+ /** Parse `// [!code tag]` markers. `false` renders them verbatim instead —
62
+ * for a snippet that teaches the notation itself. @default true */
63
+ notation?: boolean;
64
+ /** Header row above the code (e.g. a filename). When set, the toolbar
65
+ * moves into the header instead of floating over the code. */
66
+ title?: ReactNode;
61
67
  /** @default true */
62
68
  withCopyButton?: boolean;
63
69
  /** `null` hides it. @default <CopyIcon/> */
@@ -84,7 +90,7 @@ export type CodeBlockProps = WithTestId & {
84
90
  className?: string;
85
91
  classNames?: CodeBlockClassNames;
86
92
  };
87
- declare function CodeBlockComponent({ code, language, themes, tags, gutters, transformers, collapsedLines, className, classNames, ...chromeProps }: CodeBlockProps): import("react").JSX.Element;
93
+ declare function CodeBlockComponent({ code, language, themes, tags, gutters, transformers, notation: notationEnabled, collapsedLines, className, classNames, ...chromeProps }: CodeBlockProps): import("react").JSX.Element;
88
94
  /** `CodeBlock.Button` is `CodeBlockButton` itself (chrome.tsx) — attached
89
95
  * for discoverable composition when building a custom `controls` button
90
96
  * (`<CodeBlock.Button>`), mirroring `Code.Mark`'s same "attach, don't
@@ -1 +1 @@
1
- {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../src/components/code-block/code-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAE7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,eAAe,EAEf,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC3B,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,KAAK,iBAAiB,EAAiB,MAAM,eAAe,CAAA;AAGrE,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,UAAU,CAAA;AACjB,YAAY,EACV,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,M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4ED,iBAAS,kBAAkB,CAAC,EAC1B,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,cAAc,EACd,SAAS,EACT,UAAU,EACV,GAAG,WAAW,EACf,EAAE,cAAc,+BAkDhB;AAED;;;;;;;4BAO4B;AAC5B,eAAO,MAAM,SAAS;;CAAiE,CAAA"}
1
+ {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../src/components/code-block/code-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAE7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,eAAe,EAEf,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC3B,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,KAAK,iBAAiB,EAAiB,MAAM,eAAe,CAAA;AAGrE,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,UAAU,CAAA;AACjB,YAAY,EACV,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAA;IACZ,0GAA0G;IAC1G,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gHAAgH;IAChH,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC;kFAC8E;IAC9E,IAAI,CAAC,E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f,EAAE,cAAc,+BAkDhB;AAED;;;;;;;4BAO4B;AAC5B,eAAO,MAAM,SAAS;;CAAiE,CAAA"}
@@ -14,7 +14,7 @@ import { CodeBlockStatic, type CodeBlockStaticProps } from "./static";
14
14
  * `"use client"` `CodeBlock` and the Server-Component-only
15
15
  * `CodeBlockStatic` under the one object consumers import.
16
16
  */
17
- export declare const CodeBlock: (({ code, language, themes, tags, gutters, transformers, collapsedLines, className, classNames, ...chromeProps }: CodeBlockProps) => import("react").JSX.Element) & {
17
+ export declare const CodeBlock: (({ code, language, themes, tags, gutters, transformers, notation: notationEnabled, collapsedLines, className, classNames, ...chromeProps }: CodeBlockProps) => import("react").JSX.Element) & {
18
18
  Button: typeof CodeBlockButton;
19
19
  } & {
20
20
  Static: typeof CodeBlockStatic;
@@ -1,13 +1,14 @@
1
- import { CodeBlockButton, CodeBlockChrome } from '../../chunk-IXKELBJA.js';
2
- export { CodeBlockButton } from '../../chunk-IXKELBJA.js';
3
- import '../../chunk-6SWK4XG5.js';
1
+ import { CodeBlockButton, CodeBlockChrome } from '../../chunk-ZDXQ64A7.js';
2
+ export { CodeBlockButton } from '../../chunk-ZDXQ64A7.js';
3
+ import '../../chunk-YXE4B6X3.js';
4
4
  import '../../chunk-G52U24GR.js';
5
- import '../../chunk-VZ2TPU4B.js';
5
+ import '../../chunk-6GDMSENK.js';
6
6
  import '../../chunk-AIQG7IIT.js';
7
7
  import '../../chunk-7P32XCEU.js';
8
8
  import '../../chunk-BUIHQJGE.js';
9
9
  import '../../chunk-BEL75C7N.js';
10
- import '../../chunk-HWNPXAEN.js';
10
+ import '../../chunk-WSIVRDRB.js';
11
+ import '../../chunk-I4SQQIP5.js';
11
12
  import '../../chunk-WYCMIIRR.js';
12
13
  import '../../chunk-B2LCHXUB.js';
13
14
  import { cn } from '../../chunk-QP4I37PA.js';
@@ -206,8 +207,8 @@ function parseLine(line) {
206
207
  if (continuation) return continuation;
207
208
  return NO_MATCH;
208
209
  }
209
- function parseNotation(code) {
210
- return { perLine: code.split("\n").map(parseLine) };
210
+ function parseNotation(code, enabled = true) {
211
+ return { perLine: code.split("\n").map((line) => enabled ? parseLine(line) : NO_MATCH) };
211
212
  }
212
213
 
213
214
  // src/components/code-block/highlighter.ts
@@ -382,12 +383,12 @@ function HighlightedPre({
382
383
  themes
383
384
  ]);
384
385
  if (html) {
385
- return /* @__PURE__ */ jsx("div", { className, dangerouslySetInnerHTML: { __html: html } });
386
+ return /* @__PURE__ */ jsx("div", { dir: "ltr", className, dangerouslySetInnerHTML: { __html: html } });
386
387
  }
387
388
  return (
388
389
  // The plain fallback has no `.line` spans of its own to carry padding,
389
390
  // so it keeps the horizontal inset directly.
390
- /* @__PURE__ */ jsx("pre", { className: cn(className, "px-4"), children: /* @__PURE__ */ jsx("code", { children: code }) })
391
+ /* @__PURE__ */ jsx("pre", { dir: "ltr", className: cn(className, "px-4"), children: /* @__PURE__ */ jsx("code", { children: code }) })
391
392
  );
392
393
  }
393
394
  function CodeBlockComponent({
@@ -397,6 +398,7 @@ function CodeBlockComponent({
397
398
  tags,
398
399
  gutters,
399
400
  transformers,
401
+ notation: notationEnabled = true,
400
402
  collapsedLines,
401
403
  className,
402
404
  classNames,
@@ -406,7 +408,7 @@ function CodeBlockComponent({
406
408
  const isCollapsible = collapsedLines != null && lines.length > collapsedLines;
407
409
  const headCode = isCollapsible ? lines.slice(0, collapsedLines).join("\n") : code;
408
410
  const tailCode = isCollapsible ? lines.slice(collapsedLines).join("\n") : "";
409
- const notation = useMemo(() => parseNotation(code), [code]);
411
+ const notation = useMemo(() => parseNotation(code, notationEnabled), [code, notationEnabled]);
410
412
  const preClassName = cn("overflow-x-auto py-3 text-sm leading-relaxed font-mono", classNames?.pre);
411
413
  return /* @__PURE__ */ jsx(
412
414
  CodeBlockChrome,