@42-central/ui-react 0.29.0 → 0.30.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 (591) hide show
  1. package/dist/{chunk-X6DESK37.js → chunk-2RRTT4AF.js} +17 -5
  2. package/dist/chunk-2RRTT4AF.js.map +1 -0
  3. package/dist/{chunk-TUP7WXQE.js → chunk-322I2RSV.js} +9 -6
  4. package/dist/chunk-322I2RSV.js.map +1 -0
  5. package/dist/{chunk-ISX3AM32.js → chunk-37SRSNLJ.js} +4 -4
  6. package/dist/{chunk-ISX3AM32.js.map → chunk-37SRSNLJ.js.map} +1 -1
  7. package/dist/{chunk-L5GH7LLD.js → chunk-3MFWUG5O.js} +4 -4
  8. package/dist/{chunk-L5GH7LLD.js.map → chunk-3MFWUG5O.js.map} +1 -1
  9. package/dist/{chunk-FQJNQW3G.js → chunk-3XQEOJCE.js} +8 -5
  10. package/dist/chunk-3XQEOJCE.js.map +1 -0
  11. package/dist/{chunk-JKFPRQB2.js → chunk-4LSZ5JWF.js} +3 -3
  12. package/dist/{chunk-JKFPRQB2.js.map → chunk-4LSZ5JWF.js.map} +1 -1
  13. package/dist/{chunk-V2QZG4IT.js → chunk-5HWFYYHW.js} +27 -9
  14. package/dist/chunk-5HWFYYHW.js.map +1 -0
  15. package/dist/{chunk-GEZYGBXY.js → chunk-6MVFCS46.js} +99 -42
  16. package/dist/chunk-6MVFCS46.js.map +1 -0
  17. package/dist/{chunk-NNPSBC7O.js → chunk-6WZSUS3U.js} +10 -9
  18. package/dist/chunk-6WZSUS3U.js.map +1 -0
  19. package/dist/chunk-6YRGP6PS.js +138 -0
  20. package/dist/chunk-6YRGP6PS.js.map +1 -0
  21. package/dist/{chunk-B5YHYI7E.js → chunk-ALANKV5Y.js} +23 -6
  22. package/dist/chunk-ALANKV5Y.js.map +1 -0
  23. package/dist/{chunk-IA6DCC3N.js → chunk-AUQPNDE5.js} +23 -13
  24. package/dist/chunk-AUQPNDE5.js.map +1 -0
  25. package/dist/{chunk-AKXALCUN.js → chunk-D7SW2E24.js} +4 -4
  26. package/dist/chunk-D7SW2E24.js.map +1 -0
  27. package/dist/{chunk-OXR7BXZA.js → chunk-DQIYYDFD.js} +4 -3
  28. package/dist/chunk-DQIYYDFD.js.map +1 -0
  29. package/dist/{chunk-HMNXNKDA.js → chunk-FCBYUN6F.js} +4 -4
  30. package/dist/{chunk-HMNXNKDA.js.map → chunk-FCBYUN6F.js.map} +1 -1
  31. package/dist/{chunk-2W7H43WL.js → chunk-FED6SJWM.js} +23 -14
  32. package/dist/chunk-FED6SJWM.js.map +1 -0
  33. package/dist/{chunk-7E7JNWOC.js → chunk-FEPIHXVI.js} +6 -5
  34. package/dist/chunk-FEPIHXVI.js.map +1 -0
  35. package/dist/{chunk-Y57NW6G7.js → chunk-G3YOSG3U.js} +4 -4
  36. package/dist/{chunk-Y57NW6G7.js.map → chunk-G3YOSG3U.js.map} +1 -1
  37. package/dist/chunk-GZN5CXMR.js +100 -0
  38. package/dist/chunk-GZN5CXMR.js.map +1 -0
  39. package/dist/{chunk-HCHGERDB.js → chunk-HCSZPBWV.js} +17 -115
  40. package/dist/chunk-HCSZPBWV.js.map +1 -0
  41. package/dist/{chunk-I4B3N3UX.js → chunk-HTVICHT4.js} +12 -7
  42. package/dist/chunk-HTVICHT4.js.map +1 -0
  43. package/dist/chunk-I7TC2C3I.js +163 -0
  44. package/dist/chunk-I7TC2C3I.js.map +1 -0
  45. package/dist/{chunk-7FPSQBWB.js → chunk-IBXYLO2J.js} +14 -13
  46. package/dist/chunk-IBXYLO2J.js.map +1 -0
  47. package/dist/{chunk-7KFUFAVP.js → chunk-IRYG6B5A.js} +9 -8
  48. package/dist/chunk-IRYG6B5A.js.map +1 -0
  49. package/dist/{chunk-2RQLPN4U.js → chunk-JCNEW4WJ.js} +8 -8
  50. package/dist/{chunk-2RQLPN4U.js.map → chunk-JCNEW4WJ.js.map} +1 -1
  51. package/dist/{chunk-SP6LCCTZ.js → chunk-KZDMVOL6.js} +35 -8
  52. package/dist/chunk-KZDMVOL6.js.map +1 -0
  53. package/dist/chunk-LR5U6TZZ.js +169 -0
  54. package/dist/chunk-LR5U6TZZ.js.map +1 -0
  55. package/dist/{chunk-MQHD3EJE.js → chunk-LZHZJWVM.js} +6 -4
  56. package/dist/chunk-LZHZJWVM.js.map +1 -0
  57. package/dist/{chunk-5EOMSWNO.js → chunk-MAM2X3MW.js} +5 -5
  58. package/dist/{chunk-5EOMSWNO.js.map → chunk-MAM2X3MW.js.map} +1 -1
  59. package/dist/{chunk-FSPS7TVD.js → chunk-MCMS4NMO.js} +5 -5
  60. package/dist/{chunk-FSPS7TVD.js.map → chunk-MCMS4NMO.js.map} +1 -1
  61. package/dist/{chunk-ZB5VMGKB.js → chunk-MV5DIE2T.js} +15 -4
  62. package/dist/chunk-MV5DIE2T.js.map +1 -0
  63. package/dist/chunk-NDI4HLQE.js +41 -0
  64. package/dist/chunk-NDI4HLQE.js.map +1 -0
  65. package/dist/{chunk-B4GNSSHU.js → chunk-NLJEQZQQ.js} +3 -3
  66. package/dist/{chunk-B4GNSSHU.js.map → chunk-NLJEQZQQ.js.map} +1 -1
  67. package/dist/{chunk-SBZJGFZ6.js → chunk-QHT4DCXE.js} +8 -7
  68. package/dist/chunk-QHT4DCXE.js.map +1 -0
  69. package/dist/{chunk-I4IJOLNA.js → chunk-RMUBCTEF.js} +5 -5
  70. package/dist/{chunk-I4IJOLNA.js.map → chunk-RMUBCTEF.js.map} +1 -1
  71. package/dist/{chunk-G3AD3NJG.js → chunk-RNTDM3RP.js} +9 -5
  72. package/dist/chunk-RNTDM3RP.js.map +1 -0
  73. package/dist/chunk-RPFN6ETQ.js +509 -0
  74. package/dist/chunk-RPFN6ETQ.js.map +1 -0
  75. package/dist/{chunk-HWBFRDX7.js → chunk-SI7C3W5M.js} +28 -9
  76. package/dist/chunk-SI7C3W5M.js.map +1 -0
  77. package/dist/chunk-TPOV3OCC.js +234 -0
  78. package/dist/chunk-TPOV3OCC.js.map +1 -0
  79. package/dist/{chunk-IANYMDKH.js → chunk-UBQ54W46.js} +4 -4
  80. package/dist/chunk-UBQ54W46.js.map +1 -0
  81. package/dist/{chunk-QVOBLRCM.js → chunk-UIKQ4X6W.js} +3 -3
  82. package/dist/{chunk-QVOBLRCM.js.map → chunk-UIKQ4X6W.js.map} +1 -1
  83. package/dist/chunk-UOWQH53N.js +70 -0
  84. package/dist/chunk-UOWQH53N.js.map +1 -0
  85. package/dist/{chunk-QRNQQIQM.js → chunk-WJUY6YWF.js} +52 -20
  86. package/dist/chunk-WJUY6YWF.js.map +1 -0
  87. package/dist/{chunk-3KARNPW4.js → chunk-WKIUMLRT.js} +3 -3
  88. package/dist/{chunk-3KARNPW4.js.map → chunk-WKIUMLRT.js.map} +1 -1
  89. package/dist/chunk-X6RB74JN.js +37 -0
  90. package/dist/chunk-X6RB74JN.js.map +1 -0
  91. package/dist/chunk-XQ6L2CM5.js +83 -0
  92. package/dist/chunk-XQ6L2CM5.js.map +1 -0
  93. package/dist/{chunk-RKCUXOU2.js → chunk-YUVKROMA.js} +44 -7
  94. package/dist/chunk-YUVKROMA.js.map +1 -0
  95. package/dist/components/action-icon/action-icon.d.ts +9 -2
  96. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  97. package/dist/components/action-icon/index.js +5 -1
  98. package/dist/components/alert/index.js +4 -4
  99. package/dist/components/anchor/anchor.d.ts +45 -0
  100. package/dist/components/anchor/anchor.d.ts.map +1 -0
  101. package/dist/components/anchor/index.d.ts +2 -0
  102. package/dist/components/anchor/index.d.ts.map +1 -0
  103. package/dist/components/anchor/index.js +11 -0
  104. package/dist/components/anchor/index.js.map +1 -0
  105. package/dist/components/app-shell/app-shell.d.ts +10 -6
  106. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  107. package/dist/components/app-shell/index.js +23 -24
  108. package/dist/components/app-shell/index.js.map +1 -1
  109. package/dist/components/autocomplete/autocomplete.d.ts +1 -1
  110. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  111. package/dist/components/autocomplete/index.js +15 -9
  112. package/dist/components/autocomplete/index.js.map +1 -1
  113. package/dist/components/avatar/index.js +1 -1
  114. package/dist/components/button/button.d.ts +15 -2
  115. package/dist/components/button/button.d.ts.map +1 -1
  116. package/dist/components/button/index.js +5 -1
  117. package/dist/components/button-multi-select/index.js +6 -4
  118. package/dist/components/button-multi-select/index.js.map +1 -1
  119. package/dist/components/button-select/button-select-control.d.ts.map +1 -1
  120. package/dist/components/button-select/button-select.d.ts +2 -2
  121. package/dist/components/button-select/button-select.d.ts.map +1 -1
  122. package/dist/components/button-select/index.js +6 -4
  123. package/dist/components/button-select/index.js.map +1 -1
  124. package/dist/components/calendar/aliases.d.ts +16 -0
  125. package/dist/components/calendar/aliases.d.ts.map +1 -0
  126. package/dist/components/calendar/calendar-body.d.ts +11 -1
  127. package/dist/components/calendar/calendar-body.d.ts.map +1 -1
  128. package/dist/components/calendar/calendar.d.ts +8 -4
  129. package/dist/components/calendar/calendar.d.ts.map +1 -1
  130. package/dist/components/calendar/index.d.ts +2 -1
  131. package/dist/components/calendar/index.d.ts.map +1 -1
  132. package/dist/components/calendar/index.js +15 -5
  133. package/dist/components/calendar/index.js.map +1 -1
  134. package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
  135. package/dist/components/calendar-heatmap/index.js +85 -73
  136. package/dist/components/calendar-heatmap/index.js.map +1 -1
  137. package/dist/components/camera/index.js +16 -14
  138. package/dist/components/carousel/index.js +3 -3
  139. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  140. package/dist/components/checkbox/index.js +2 -2
  141. package/dist/components/choice-card-group/index.js +2 -2
  142. package/dist/components/choice-card-group/index.js.map +1 -1
  143. package/dist/components/circular-progress/circular-progress.d.ts +22 -11
  144. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  145. package/dist/components/circular-progress/index.d.ts +1 -1
  146. package/dist/components/circular-progress/index.d.ts.map +1 -1
  147. package/dist/components/circular-progress/index.js +68 -49
  148. package/dist/components/circular-progress/index.js.map +1 -1
  149. package/dist/components/clipboard/index.js +7 -3
  150. package/dist/components/clipboard/index.js.map +1 -1
  151. package/dist/components/code/code.d.ts +10 -0
  152. package/dist/components/code/code.d.ts.map +1 -1
  153. package/dist/components/code/index.js +1 -0
  154. package/dist/components/code/index.js.map +1 -1
  155. package/dist/components/code-block/chrome.js +10 -6
  156. package/dist/components/code-block/index.js +10 -7
  157. package/dist/components/code-block/index.js.map +1 -1
  158. package/dist/components/combobox/combobox.d.ts +5 -3
  159. package/dist/components/combobox/combobox.d.ts.map +1 -1
  160. package/dist/components/combobox/index.js +12 -7
  161. package/dist/components/combobox-list/combobox-list.d.ts +1 -1
  162. package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
  163. package/dist/components/combobox-list/index.js +14 -9
  164. package/dist/components/compare/index.js +1 -1
  165. package/dist/components/data-list/data-list.d.ts +96 -0
  166. package/dist/components/data-list/data-list.d.ts.map +1 -0
  167. package/dist/components/data-list/index.d.ts +2 -0
  168. package/dist/components/data-list/index.d.ts.map +1 -0
  169. package/dist/components/data-list/index.js +147 -0
  170. package/dist/components/data-list/index.js.map +1 -0
  171. package/dist/components/data-table/data-table-group.d.ts.map +1 -1
  172. package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
  173. package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
  174. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  175. package/dist/components/data-table/data-table.d.ts +5 -2
  176. package/dist/components/data-table/data-table.d.ts.map +1 -1
  177. package/dist/components/data-table/index.js +163 -168
  178. package/dist/components/data-table/index.js.map +1 -1
  179. package/dist/components/date-picker/aliases.d.ts +16 -0
  180. package/dist/components/date-picker/aliases.d.ts.map +1 -1
  181. package/dist/components/date-picker/date-picker.d.ts +22 -8
  182. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  183. package/dist/components/date-picker/index.d.ts +2 -2
  184. package/dist/components/date-picker/index.d.ts.map +1 -1
  185. package/dist/components/date-picker/index.js +34 -28
  186. package/dist/components/date-picker/index.js.map +1 -1
  187. package/dist/components/download-button/index.js +6 -2
  188. package/dist/components/drawer/drawer.d.ts +7 -4
  189. package/dist/components/drawer/drawer.d.ts.map +1 -1
  190. package/dist/components/drawer/index.js +11 -6
  191. package/dist/components/empty-state/empty-state.d.ts +57 -0
  192. package/dist/components/empty-state/empty-state.d.ts.map +1 -0
  193. package/dist/components/empty-state/index.d.ts +2 -0
  194. package/dist/components/empty-state/index.d.ts.map +1 -0
  195. package/dist/components/empty-state/index.js +8 -0
  196. package/dist/components/empty-state/index.js.map +1 -0
  197. package/dist/components/field/field.d.ts +20 -0
  198. package/dist/components/field/field.d.ts.map +1 -1
  199. package/dist/components/field/index.js +1 -1
  200. package/dist/components/fieldset/fieldset.d.ts +103 -0
  201. package/dist/components/fieldset/fieldset.d.ts.map +1 -0
  202. package/dist/components/fieldset/index.d.ts +2 -0
  203. package/dist/components/fieldset/index.d.ts.map +1 -0
  204. package/dist/components/fieldset/index.js +150 -0
  205. package/dist/components/fieldset/index.js.map +1 -0
  206. package/dist/components/file-item/index.js +10 -7
  207. package/dist/components/file-preview/file-preview.d.ts.map +1 -1
  208. package/dist/components/file-preview/index.js +10 -18
  209. package/dist/components/file-preview/index.js.map +1 -1
  210. package/dist/components/file-trigger/index.js +6 -2
  211. package/dist/components/file-upload/file-upload.d.ts.map +1 -1
  212. package/dist/components/file-upload/index.js +18 -14
  213. package/dist/components/file-upload/index.js.map +1 -1
  214. package/dist/components/gallery/index.js +3 -3
  215. package/dist/components/geodesic/a11y.d.ts +3 -3
  216. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  217. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  218. package/dist/components/hover-card/index.js +10 -3
  219. package/dist/components/hover-card/index.js.map +1 -1
  220. package/dist/components/image/index.js +3 -3
  221. package/dist/components/image-cropper/index.js +9 -6
  222. package/dist/components/input/index.js +2 -2
  223. package/dist/components/input/input.d.ts.map +1 -1
  224. package/dist/components/kbd/index.js +3 -3
  225. package/dist/components/kbd/kbd.d.ts +4 -0
  226. package/dist/components/kbd/kbd.d.ts.map +1 -1
  227. package/dist/components/lightbox/index.js +13 -11
  228. package/dist/components/lightbox/index.js.map +1 -1
  229. package/dist/components/menu/index.js +9 -5
  230. package/dist/components/menu/index.js.map +1 -1
  231. package/dist/components/menu/menu.d.ts.map +1 -1
  232. package/dist/components/modal/index.js +11 -6
  233. package/dist/components/modal/modal.d.ts +10 -4
  234. package/dist/components/modal/modal.d.ts.map +1 -1
  235. package/dist/components/multi-combobox-list/index.js +13 -9
  236. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
  237. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
  238. package/dist/components/multi-select/index.js +13 -10
  239. package/dist/components/multi-select/index.js.map +1 -1
  240. package/dist/components/multi-select/multi-select.d.ts +1 -1
  241. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  242. package/dist/components/nav-link/index.js +4 -4
  243. package/dist/components/nav-link/tanstack.js +4 -4
  244. package/dist/components/notification/index.js +6 -6
  245. package/dist/components/notification/index.js.map +1 -1
  246. package/dist/components/number-input/index.js +11 -7
  247. package/dist/components/number-input/number-input.d.ts +1 -1
  248. package/dist/components/number-input/number-input.d.ts.map +1 -1
  249. package/dist/components/overlays/dialog-parts.d.ts +10 -1
  250. package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
  251. package/dist/components/overlays/index.js +13 -8
  252. package/dist/components/overlays/index.js.map +1 -1
  253. package/dist/components/pagination/index.d.ts +2 -0
  254. package/dist/components/pagination/index.d.ts.map +1 -0
  255. package/dist/components/pagination/index.js +362 -0
  256. package/dist/components/pagination/index.js.map +1 -0
  257. package/dist/components/pagination/pagination.d.ts +147 -0
  258. package/dist/components/pagination/pagination.d.ts.map +1 -0
  259. package/dist/components/password-input/index.js +6 -5
  260. package/dist/components/password-input/index.js.map +1 -1
  261. package/dist/components/password-input/password-input.d.ts +1 -1
  262. package/dist/components/password-input/password-input.d.ts.map +1 -1
  263. package/dist/components/phone-input/index.js +14 -11
  264. package/dist/components/phone-input/index.js.map +1 -1
  265. package/dist/components/phone-input/phone-input.d.ts +1 -1
  266. package/dist/components/phone-input/phone-input.d.ts.map +1 -1
  267. package/dist/components/photo-capture/index.js +19 -17
  268. package/dist/components/photo-capture/index.js.map +1 -1
  269. package/dist/components/pills-input/index.js +4 -4
  270. package/dist/components/pills-input/pills-input.d.ts +1 -1
  271. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  272. package/dist/components/pin-input/index.js +6 -5
  273. package/dist/components/pin-input/index.js.map +1 -1
  274. package/dist/components/pin-input/pin-input.d.ts.map +1 -1
  275. package/dist/components/popover/index.js +7 -2
  276. package/dist/components/popover/popover.d.ts +41 -16
  277. package/dist/components/popover/popover.d.ts.map +1 -1
  278. package/dist/components/progress/index.d.ts +1 -1
  279. package/dist/components/progress/index.d.ts.map +1 -1
  280. package/dist/components/progress/index.js +4 -1
  281. package/dist/components/progress/progress.d.ts +22 -14
  282. package/dist/components/progress/progress.d.ts.map +1 -1
  283. package/dist/components/prose/index.d.ts +2 -0
  284. package/dist/components/prose/index.d.ts.map +1 -0
  285. package/dist/components/prose/index.js +17 -0
  286. package/dist/components/prose/index.js.map +1 -0
  287. package/dist/components/prose/prose.d.ts +49 -0
  288. package/dist/components/prose/prose.d.ts.map +1 -0
  289. package/dist/components/prose/styles.css +593 -0
  290. package/dist/components/radio-group/index.js +9 -3
  291. package/dist/components/radio-group/index.js.map +1 -1
  292. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  293. package/dist/components/rating/index.js +3 -2
  294. package/dist/components/rating/index.js.map +1 -1
  295. package/dist/components/rating/rating.d.ts.map +1 -1
  296. package/dist/components/schedule/index.js +10 -8
  297. package/dist/components/schedule/index.js.map +1 -1
  298. package/dist/components/scroll-area/index.d.ts +2 -0
  299. package/dist/components/scroll-area/index.d.ts.map +1 -0
  300. package/dist/components/scroll-area/index.js +10 -0
  301. package/dist/components/scroll-area/index.js.map +1 -0
  302. package/dist/components/scroll-area/scroll-area.d.ts +150 -0
  303. package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
  304. package/dist/components/segment-group/index.js +2 -2
  305. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  306. package/dist/components/select/index.js +12 -8
  307. package/dist/components/select/select.d.ts +1 -1
  308. package/dist/components/select/select.d.ts.map +1 -1
  309. package/dist/components/slider/index.js +2 -2
  310. package/dist/components/slider/slider.d.ts.map +1 -1
  311. package/dist/components/splitter/index.d.ts +2 -0
  312. package/dist/components/splitter/index.d.ts.map +1 -0
  313. package/dist/components/splitter/index.js +373 -0
  314. package/dist/components/splitter/index.js.map +1 -0
  315. package/dist/components/splitter/splitter.d.ts +159 -0
  316. package/dist/components/splitter/splitter.d.ts.map +1 -0
  317. package/dist/components/spotlight/index.js +23 -22
  318. package/dist/components/spotlight/index.js.map +1 -1
  319. package/dist/components/spotlight/spotlight.d.ts.map +1 -1
  320. package/dist/components/steps/index.d.ts +4 -0
  321. package/dist/components/steps/index.d.ts.map +1 -0
  322. package/dist/components/steps/index.js +478 -0
  323. package/dist/components/steps/index.js.map +1 -0
  324. package/dist/components/steps/steps-data.d.ts +78 -0
  325. package/dist/components/steps/steps-data.d.ts.map +1 -0
  326. package/dist/components/steps/steps.d.ts +183 -0
  327. package/dist/components/steps/steps.d.ts.map +1 -0
  328. package/dist/components/switch/index.js +4 -3
  329. package/dist/components/switch/index.js.map +1 -1
  330. package/dist/components/switch/switch.d.ts.map +1 -1
  331. package/dist/components/table-of-contents/index.d.ts +2 -0
  332. package/dist/components/table-of-contents/index.d.ts.map +1 -0
  333. package/dist/components/table-of-contents/index.js +471 -0
  334. package/dist/components/table-of-contents/index.js.map +1 -0
  335. package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
  336. package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
  337. package/dist/components/tags-input/index.js +12 -9
  338. package/dist/components/tags-input/index.js.map +1 -1
  339. package/dist/components/tags-input/tags-input.d.ts +1 -1
  340. package/dist/components/tags-input/tags-input.d.ts.map +1 -1
  341. package/dist/components/text-input/index.js +2 -2
  342. package/dist/components/textarea/index.js +8 -6
  343. package/dist/components/textarea/index.js.map +1 -1
  344. package/dist/components/textarea/textarea.d.ts.map +1 -1
  345. package/dist/components/time-input/index.js +11 -9
  346. package/dist/components/time-input/index.js.map +1 -1
  347. package/dist/components/timeline/index.js +8 -1
  348. package/dist/components/timeline/index.js.map +1 -1
  349. package/dist/components/timeline/timeline.d.ts.map +1 -1
  350. package/dist/components/tooltip/index.js +1 -1
  351. package/dist/components/tooltip/tooltip.d.ts +3 -8
  352. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  353. package/dist/components/tour/conditions.d.ts +83 -0
  354. package/dist/components/tour/conditions.d.ts.map +1 -0
  355. package/dist/components/tour/create-tours.d.ts +49 -0
  356. package/dist/components/tour/create-tours.d.ts.map +1 -0
  357. package/dist/components/tour/index.d.ts +6 -0
  358. package/dist/components/tour/index.d.ts.map +1 -0
  359. package/dist/components/tour/index.js +1449 -0
  360. package/dist/components/tour/index.js.map +1 -0
  361. package/dist/components/tour/runtime.d.ts +57 -0
  362. package/dist/components/tour/runtime.d.ts.map +1 -0
  363. package/dist/components/tour/storage.d.ts +14 -0
  364. package/dist/components/tour/storage.d.ts.map +1 -0
  365. package/dist/components/tour/store.d.ts +62 -0
  366. package/dist/components/tour/store.d.ts.map +1 -0
  367. package/dist/components/tour/tour.d.ts +77 -0
  368. package/dist/components/tour/tour.d.ts.map +1 -0
  369. package/dist/components/tour/types.d.ts +680 -0
  370. package/dist/components/tour/types.d.ts.map +1 -0
  371. package/dist/components/tree/index.d.ts +3 -0
  372. package/dist/components/tree/index.d.ts.map +1 -0
  373. package/dist/components/tree/index.js +457 -0
  374. package/dist/components/tree/index.js.map +1 -0
  375. package/dist/components/tree/tree-row.d.ts +72 -0
  376. package/dist/components/tree/tree-row.d.ts.map +1 -0
  377. package/dist/components/tree/tree.d.ts +193 -0
  378. package/dist/components/tree/tree.d.ts.map +1 -0
  379. package/dist/components/tree-multi-select/index.js +31 -54
  380. package/dist/components/tree-multi-select/index.js.map +1 -1
  381. package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
  382. package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
  383. package/dist/components/tree-select/index.js +30 -24
  384. package/dist/components/tree-select/index.js.map +1 -1
  385. package/dist/components/tree-select/tree-popover.d.ts +20 -31
  386. package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
  387. package/dist/components/tree-select/tree-select.d.ts +1 -1
  388. package/dist/components/tree-select/tree-select.d.ts.map +1 -1
  389. package/dist/index.d.ts +2 -0
  390. package/dist/index.d.ts.map +1 -1
  391. package/dist/index.js +10 -8
  392. package/dist/index.js.map +1 -1
  393. package/dist/lib/date-predicates.d.ts +7 -5
  394. package/dist/lib/date-predicates.d.ts.map +1 -1
  395. package/dist/lib/date-value.d.ts +20 -0
  396. package/dist/lib/date-value.d.ts.map +1 -1
  397. package/dist/lib/floating-arrow.d.ts +53 -0
  398. package/dist/lib/floating-arrow.d.ts.map +1 -0
  399. package/dist/lib/focus-return.d.ts +53 -0
  400. package/dist/lib/focus-return.d.ts.map +1 -0
  401. package/dist/lib/meter.d.ts +104 -0
  402. package/dist/lib/meter.d.ts.map +1 -0
  403. package/dist/lib/overlay-layer.d.ts +26 -8
  404. package/dist/lib/overlay-layer.d.ts.map +1 -1
  405. package/dist/lib/pressed.d.ts +92 -0
  406. package/dist/lib/pressed.d.ts.map +1 -0
  407. package/dist/lib/tree-data.d.ts +18 -2
  408. package/dist/lib/tree-data.d.ts.map +1 -1
  409. package/dist/lib/use-pagination.d.ts +102 -0
  410. package/dist/lib/use-pagination.d.ts.map +1 -0
  411. package/dist/lib/use-scroll-spy.d.ts +126 -0
  412. package/dist/lib/use-scroll-spy.d.ts.map +1 -0
  413. package/dist/theme.css +39 -3
  414. package/package.json +1 -1
  415. package/src/as-child.contract.test.tsx +283 -1
  416. package/src/components/action-icon/action-icon.tsx +34 -4
  417. package/src/components/anchor/anchor.test.tsx +232 -0
  418. package/src/components/anchor/anchor.tsx +187 -0
  419. package/src/components/anchor/index.ts +12 -0
  420. package/src/components/app-shell/app-shell.test.tsx +15 -7
  421. package/src/components/app-shell/app-shell.tsx +27 -20
  422. package/src/components/autocomplete/autocomplete.tsx +11 -3
  423. package/src/components/button/button-pressed.test.tsx +202 -0
  424. package/src/components/button/button.tsx +48 -6
  425. package/src/components/button-select/button-select-control.tsx +2 -2
  426. package/src/components/button-select/button-select.tsx +22 -2
  427. package/src/components/calendar/aliases.tsx +28 -0
  428. package/src/components/calendar/calendar-body.tsx +310 -210
  429. package/src/components/calendar/calendar.tsx +43 -12
  430. package/src/components/calendar/index.ts +7 -1
  431. package/src/components/calendar/month-year-calendar.test.tsx +106 -0
  432. package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
  433. package/src/components/checkbox/checkbox.tsx +7 -2
  434. package/src/components/choice-card-group/choice-card-group.tsx +2 -2
  435. package/src/components/circular-progress/circular-progress.test.tsx +35 -0
  436. package/src/components/circular-progress/circular-progress.tsx +116 -59
  437. package/src/components/circular-progress/index.ts +1 -0
  438. package/src/components/code/code.test.tsx +16 -0
  439. package/src/components/code/code.tsx +11 -0
  440. package/src/components/combobox/combobox.tsx +63 -28
  441. package/src/components/combobox-list/combobox-list.tsx +11 -3
  442. package/src/components/data-list/data-list.test.tsx +149 -0
  443. package/src/components/data-list/data-list.tsx +268 -0
  444. package/src/components/data-list/index.ts +9 -0
  445. package/src/components/data-table/data-table-group.test.tsx +16 -0
  446. package/src/components/data-table/data-table-group.tsx +15 -2
  447. package/src/components/data-table/data-table-placeholder.tsx +28 -36
  448. package/src/components/data-table/data-table-stack.tsx +33 -39
  449. package/src/components/data-table/data-table.test.tsx +31 -0
  450. package/src/components/data-table/data-table.tsx +41 -42
  451. package/src/components/date-picker/aliases.tsx +28 -0
  452. package/src/components/date-picker/date-picker.test.tsx +29 -0
  453. package/src/components/date-picker/date-picker.tsx +164 -45
  454. package/src/components/date-picker/index.ts +5 -1
  455. package/src/components/date-picker/month-year-picker.test.tsx +362 -0
  456. package/src/components/drawer/drawer.test.tsx +41 -0
  457. package/src/components/drawer/drawer.tsx +7 -1
  458. package/src/components/empty-state/empty-state.test.tsx +109 -0
  459. package/src/components/empty-state/empty-state.tsx +180 -0
  460. package/src/components/empty-state/index.ts +9 -0
  461. package/src/components/field/field.tsx +35 -1
  462. package/src/components/fieldset/fieldset.test.tsx +352 -0
  463. package/src/components/fieldset/fieldset.tsx +268 -0
  464. package/src/components/fieldset/index.ts +11 -0
  465. package/src/components/file-preview/file-preview.test.tsx +2 -1
  466. package/src/components/file-preview/file-preview.tsx +7 -13
  467. package/src/components/file-upload/file-upload.tsx +14 -5
  468. package/src/components/hover-card/hover-card.tsx +5 -1
  469. package/src/components/input/input.tsx +12 -5
  470. package/src/components/kbd/kbd.test.tsx +13 -0
  471. package/src/components/kbd/kbd.tsx +6 -0
  472. package/src/components/menu/menu.tsx +6 -2
  473. package/src/components/modal/modal.test.tsx +41 -0
  474. package/src/components/modal/modal.tsx +17 -9
  475. package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
  476. package/src/components/multi-select/multi-select.tsx +11 -3
  477. package/src/components/notification/create-notifier.tsx +1 -1
  478. package/src/components/number-input/number-input.tsx +12 -3
  479. package/src/components/overlays/dialog-parts.tsx +42 -5
  480. package/src/components/pagination/index.ts +19 -0
  481. package/src/components/pagination/pagination.test.tsx +187 -0
  482. package/src/components/pagination/pagination.tsx +563 -0
  483. package/src/components/password-input/password-input.tsx +12 -3
  484. package/src/components/phone-input/phone-input.tsx +12 -3
  485. package/src/components/pills-input/pills-input.tsx +7 -2
  486. package/src/components/pin-input/pin-input.tsx +13 -4
  487. package/src/components/popover/popover.tsx +87 -17
  488. package/src/components/progress/index.ts +1 -0
  489. package/src/components/progress/progress.test.tsx +102 -0
  490. package/src/components/progress/progress.tsx +116 -62
  491. package/src/components/prose/index.ts +1 -0
  492. package/src/components/prose/prose.test.tsx +90 -0
  493. package/src/components/prose/prose.tsx +60 -0
  494. package/src/components/prose/styles.css +593 -0
  495. package/src/components/radio-group/radio-group.tsx +8 -3
  496. package/src/components/rating/rating.tsx +5 -2
  497. package/src/components/scroll-area/index.ts +18 -0
  498. package/src/components/scroll-area/scroll-area.test.tsx +184 -0
  499. package/src/components/scroll-area/scroll-area.tsx +448 -0
  500. package/src/components/segment-group/segment-group.tsx +2 -2
  501. package/src/components/select/select.tsx +37 -18
  502. package/src/components/slider/slider.tsx +2 -2
  503. package/src/components/splitter/index.ts +15 -0
  504. package/src/components/splitter/splitter.test.tsx +244 -0
  505. package/src/components/splitter/splitter.tsx +625 -0
  506. package/src/components/spotlight/spotlight.test.tsx +34 -26
  507. package/src/components/spotlight/spotlight.tsx +7 -9
  508. package/src/components/steps/index.ts +21 -0
  509. package/src/components/steps/steps-data.tsx +179 -0
  510. package/src/components/steps/steps.test.tsx +235 -0
  511. package/src/components/steps/steps.tsx +686 -0
  512. package/src/components/switch/switch.tsx +7 -2
  513. package/src/components/table-of-contents/index.ts +17 -0
  514. package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
  515. package/src/components/table-of-contents/table-of-contents.tsx +708 -0
  516. package/src/components/tags-input/tags-input.tsx +12 -3
  517. package/src/components/textarea/textarea.tsx +15 -5
  518. package/src/components/timeline/timeline.test.tsx +22 -0
  519. package/src/components/timeline/timeline.tsx +10 -1
  520. package/src/components/tooltip/tooltip.tsx +8 -17
  521. package/src/components/tour/conditions.test.ts +527 -0
  522. package/src/components/tour/conditions.ts +445 -0
  523. package/src/components/tour/create-tours.tsx +150 -0
  524. package/src/components/tour/index.ts +86 -0
  525. package/src/components/tour/runtime.ts +187 -0
  526. package/src/components/tour/storage.test.ts +68 -0
  527. package/src/components/tour/storage.ts +44 -0
  528. package/src/components/tour/store.test.tsx +784 -0
  529. package/src/components/tour/store.ts +661 -0
  530. package/src/components/tour/tour.test.tsx +318 -0
  531. package/src/components/tour/tour.tsx +773 -0
  532. package/src/components/tour/tour.types.test.ts +185 -0
  533. package/src/components/tour/types.ts +904 -0
  534. package/src/components/tree/index.ts +24 -0
  535. package/src/components/tree/tree-row.tsx +179 -0
  536. package/src/components/tree/tree.test.tsx +296 -0
  537. package/src/components/tree/tree.tsx +796 -0
  538. package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
  539. package/src/components/tree-select/tree-popover.tsx +26 -107
  540. package/src/components/tree-select/tree-select.tsx +24 -16
  541. package/src/icon-stroke.test.tsx +2 -0
  542. package/src/index.ts +16 -0
  543. package/src/lib/date-predicates.test.ts +46 -0
  544. package/src/lib/date-predicates.ts +44 -24
  545. package/src/lib/date-value.test.ts +24 -1
  546. package/src/lib/date-value.ts +42 -1
  547. package/src/lib/floating-arrow.tsx +73 -0
  548. package/src/lib/focus-return.test.tsx +143 -0
  549. package/src/lib/focus-return.ts +106 -0
  550. package/src/lib/meter.test.ts +40 -0
  551. package/src/lib/meter.ts +159 -0
  552. package/src/lib/overlay-layer.test.tsx +47 -1
  553. package/src/lib/overlay-layer.tsx +65 -8
  554. package/src/lib/pressed.ts +130 -0
  555. package/src/lib/tree-data.ts +42 -2
  556. package/src/lib/use-pagination.test.ts +105 -0
  557. package/src/lib/use-pagination.ts +179 -0
  558. package/src/lib/use-scroll-spy.test.tsx +238 -0
  559. package/src/lib/use-scroll-spy.ts +336 -0
  560. package/src/theme.css +39 -3
  561. package/src/theme.test.ts +29 -1
  562. package/src/visually-hidden-containment.test.tsx +9 -0
  563. package/dist/chunk-2W7H43WL.js.map +0 -1
  564. package/dist/chunk-7E7JNWOC.js.map +0 -1
  565. package/dist/chunk-7FPSQBWB.js.map +0 -1
  566. package/dist/chunk-7KFUFAVP.js.map +0 -1
  567. package/dist/chunk-AKXALCUN.js.map +0 -1
  568. package/dist/chunk-B5YHYI7E.js.map +0 -1
  569. package/dist/chunk-FQJNQW3G.js.map +0 -1
  570. package/dist/chunk-G3AD3NJG.js.map +0 -1
  571. package/dist/chunk-GEZYGBXY.js.map +0 -1
  572. package/dist/chunk-HCHGERDB.js.map +0 -1
  573. package/dist/chunk-HWBFRDX7.js.map +0 -1
  574. package/dist/chunk-I4B3N3UX.js.map +0 -1
  575. package/dist/chunk-IA6DCC3N.js.map +0 -1
  576. package/dist/chunk-IANYMDKH.js.map +0 -1
  577. package/dist/chunk-MQHD3EJE.js.map +0 -1
  578. package/dist/chunk-NNPSBC7O.js.map +0 -1
  579. package/dist/chunk-OXR7BXZA.js.map +0 -1
  580. package/dist/chunk-QKSLDQM2.js +0 -120
  581. package/dist/chunk-QKSLDQM2.js.map +0 -1
  582. package/dist/chunk-QRNQQIQM.js.map +0 -1
  583. package/dist/chunk-RKCUXOU2.js.map +0 -1
  584. package/dist/chunk-S5CQRCTF.js +0 -426
  585. package/dist/chunk-S5CQRCTF.js.map +0 -1
  586. package/dist/chunk-SBZJGFZ6.js.map +0 -1
  587. package/dist/chunk-SP6LCCTZ.js.map +0 -1
  588. package/dist/chunk-TUP7WXQE.js.map +0 -1
  589. package/dist/chunk-V2QZG4IT.js.map +0 -1
  590. package/dist/chunk-X6DESK37.js.map +0 -1
  591. package/dist/chunk-ZB5VMGKB.js.map +0 -1
@@ -1,4 +1,7 @@
1
1
  "use client";
2
+ import { meterZone, METER_ZONE_COLORS, arkValue } from '../../chunk-X6RB74JN.js';
3
+ import { useLocale } from '../../chunk-OBSZ4NE2.js';
4
+ import '../../chunk-PQZSTI3R.js';
2
5
  import { props } from '../../chunk-WYCMIIRR.js';
3
6
  import { cn } from '../../chunk-4ASNIDV7.js';
4
7
  import { Progress } from '@ark-ui/react/progress';
@@ -40,6 +43,11 @@ var CircularProgress = ({
40
43
  value,
41
44
  defaultValue,
42
45
  onChange,
46
+ meter,
47
+ low,
48
+ high,
49
+ optimum,
50
+ locale,
43
51
  variant,
44
52
  size,
45
53
  thickness,
@@ -63,14 +71,16 @@ var CircularProgress = ({
63
71
  }) => {
64
72
  const isGradient = variant === "gradient";
65
73
  const gradientId = useId();
74
+ const resolvedLocale = useLocale(locale);
66
75
  return /* @__PURE__ */ jsxs(
67
76
  Progress.Root,
68
77
  {
69
- value,
70
- defaultValue,
78
+ value: arkValue("CircularProgress", meter, value, min),
79
+ defaultValue: arkValue("CircularProgress", meter, defaultValue, min),
71
80
  onValueChange: onChange ? ({ value: v }) => onChange(v) : void 0,
72
81
  min,
73
82
  max,
83
+ locale: resolvedLocale,
74
84
  "data-color": !isGradient ? color : void 0,
75
85
  className: cn("group/cprogress relative inline-flex", className, classNames?.root),
76
86
  style: {
@@ -80,54 +90,63 @@ var CircularProgress = ({
80
90
  },
81
91
  ...rest,
82
92
  children: [
83
- /* @__PURE__ */ jsxs(
84
- Progress.Circle,
85
- {
86
- ref,
87
- className: cn(
88
- // Ark's CircleRange already rotates the arc to start at 12 o'clock.
89
- "block",
90
- // Indeterminate: Ark drops the dash, so the range below pins a fixed
91
- // arc; spin the whole ring. Gated under reduced motion in theme.css.
92
- "group-data-[state=indeterminate]/cprogress:animate-progress-spin",
93
- classNames?.circle
94
- ),
95
- ...props({
96
- "data-testid": testId,
97
- "aria-label": label,
98
- "aria-labelledby": labelledBy,
99
- "aria-describedby": describedBy,
100
- "aria-valuetext": valueText
101
- }),
102
- children: [
103
- isGradient && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
104
- /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: gradient?.from ?? "var(--color-purple-300)" }),
105
- gradient?.via && /* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: gradient.via }),
106
- /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: gradient?.to ?? "var(--color-pink-400)" })
107
- ] }) }),
108
- /* @__PURE__ */ jsx(
109
- Progress.CircleTrack,
110
- {
111
- className: cn("fill-none stroke-black/3 dark:stroke-white/4", classNames?.track)
112
- }
93
+ /* @__PURE__ */ jsx(Progress.Context, { children: (api) => {
94
+ const zone = meter ? meterZone(api.value, { min, max, low, high, optimum }) : void 0;
95
+ return /* @__PURE__ */ jsxs(
96
+ Progress.Circle,
97
+ {
98
+ ref,
99
+ ...meter ? { role: "meter" } : null,
100
+ className: cn(
101
+ // Ark's CircleRange already rotates the arc to start at 12 o'clock.
102
+ "block",
103
+ // Indeterminate: Ark drops the dash, so the range below pins a fixed
104
+ // arc; spin the whole ring. Gated under reduced motion in theme.css.
105
+ "group-data-[state=indeterminate]/cprogress:animate-progress-spin",
106
+ classNames?.circle
113
107
  ),
114
- /* @__PURE__ */ jsx(
115
- Progress.CircleRange,
116
- {
117
- strokeLinecap: "round",
118
- className: cn(
119
- circularRange({ variant }),
120
- // Indeterminate: pin a fixed 25% arc (Ark omits the dash here).
121
- "group-data-[state=indeterminate]/cprogress:[stroke-dasharray:calc(var(--circumference)*0.25)_var(--circumference)]",
122
- "group-data-[state=indeterminate]/cprogress:[stroke-dashoffset:0]",
123
- classNames?.range
124
- ),
125
- style: isGradient ? { stroke: `url(#${gradientId})` } : void 0
126
- }
127
- )
128
- ]
129
- }
130
- ),
108
+ ...props({
109
+ "data-testid": testId,
110
+ // The zone's palette lands on the ring, which the arc inherits from.
111
+ "data-color": zone && !isGradient ? METER_ZONE_COLORS[zone] : void 0,
112
+ "data-zone": zone,
113
+ "aria-label": label,
114
+ "aria-labelledby": labelledBy,
115
+ "aria-describedby": describedBy,
116
+ // A meter always says its value: Ark's locale-aware `valueAsString`, which
117
+ // `formatOptions` / `translations.value` shape, unless the caller wrote one.
118
+ "aria-valuetext": valueText ?? (meter ? api.valueAsString : void 0)
119
+ }),
120
+ children: [
121
+ isGradient && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
122
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: gradient?.from ?? "var(--color-purple-300)" }),
123
+ gradient?.via && /* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: gradient.via }),
124
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: gradient?.to ?? "var(--color-pink-400)" })
125
+ ] }) }),
126
+ /* @__PURE__ */ jsx(
127
+ Progress.CircleTrack,
128
+ {
129
+ className: cn("fill-none stroke-black/3 dark:stroke-white/4", classNames?.track)
130
+ }
131
+ ),
132
+ /* @__PURE__ */ jsx(
133
+ Progress.CircleRange,
134
+ {
135
+ strokeLinecap: "round",
136
+ className: cn(
137
+ circularRange({ variant }),
138
+ // Indeterminate: pin a fixed 25% arc (Ark omits the dash here).
139
+ "group-data-[state=indeterminate]/cprogress:[stroke-dasharray:calc(var(--circumference)*0.25)_var(--circumference)]",
140
+ "group-data-[state=indeterminate]/cprogress:[stroke-dashoffset:0]",
141
+ classNames?.range
142
+ ),
143
+ style: isGradient ? { stroke: `url(#${gradientId})` } : void 0
144
+ }
145
+ )
146
+ ]
147
+ }
148
+ );
149
+ } }),
131
150
  children != null && /* @__PURE__ */ jsx(
132
151
  "span",
133
152
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/circular-progress/circular-progress.tsx"],"names":["Ark"],"mappings":";;;;;;;AAyCA,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,EAC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-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` strokes a single palette color\n * (`--c-solid`) instead.\n *\n * Name the ring with `aria-label` or `aria-labelledby` (and `aria-valuetext`\n * for a non-numeric reading): they land on the `role=\"progressbar\"` `<svg>`,\n * not the wrapping root, so assistive tech reads them with the value.\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 /** Names the ring. Lands on the `<svg>`, the `role=\"progressbar\"` element, like the other\n * `aria-*` naming props below; without one, Ark names it by its value (\"40\"). */\n \"aria-label\"?: string\n /** Names the ring after a visible caption, by id. Wins over `aria-label`. */\n \"aria-labelledby\"?: string\n \"aria-describedby\"?: string\n /** Read instead of the number: \"Uploading\", \"3 of 8 files\". */\n \"aria-valuetext\"?: string\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 // The naming attributes describe the progressbar, which is the ring, not the root.\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-valuetext\": valueText,\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({\n \"data-testid\": testId,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-valuetext\": valueText,\n })}\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":";;;;;;;;;;AAkDA,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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EAAU,uBAAO,GAAA,CAAC,MAAA,EAAA,EAAK,QAAO,KAAA,EAAM,SAAA,EAAW,SAAS,GAAA,EAAK,CAAA;AAAA,sCAC7D,MAAA,EAAA,EAAK,MAAA,EAAO,QAAO,SAAA,EAAW,QAAA,EAAU,MAAM,uBAAA,EAAyB;AAAA,iBAAA,EAC1E,CAAA,EACF,CAAA;AAAA,gCAEF,GAAA;AAAA,kBAACA,QAAA,CAAI,WAAA;AAAA,kBAAJ;AAAA,oBACC,SAAA,EAAW,EAAA,CAAG,8CAAA,EAAgD,UAAA,EAAY,KAAK;AAAA;AAAA,iBACjF;AAAA,gCACA,GAAA;AAAA,kBAACA,QAAA,CAAI,WAAA;AAAA,kBAAJ;AAAA,oBACC,aAAA,EAAc,OAAA;AAAA,oBACd,SAAA,EAAW,EAAA;AAAA,sBACT,aAAA,CAAc,EAAE,OAAA,EAAS,CAAA;AAAA;AAAA,sBAEzB,oHAAA;AAAA,sBACA,kEAAA;AAAA,sBACA,UAAA,EAAY;AAAA,qBACd;AAAA,oBACA,OAAO,UAAA,GAAa,EAAE,QAAQ,CAAA,KAAA,EAAQ,UAAU,KAAI,GAAI;AAAA;AAAA;AAC1D;AAAA;AAAA,WACF;AAAA,QAEJ,CAAA,EACF,CAAA;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":["\"use client\"\n\nimport { 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 { useLocale } from \"../../lib/intl\"\nimport { arkValue, METER_ZONE_COLORS, type MeterProps, meterZone } from \"../../lib/meter\"\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` strokes a single palette color\n * (`--c-solid`) instead.\n *\n * Name the ring with `aria-label` or `aria-labelledby` (and `aria-valuetext`\n * for a non-numeric reading): they land on the `role=\"progressbar\"` `<svg>`,\n * not the wrapping root, so assistive tech reads them with the value.\n *\n * Pass `meter` for a measurement rather than a task (a skill score, a quota):\n * the `<svg>` becomes `role=\"meter\"` with a locale-formatted `aria-valuetext`,\n * can't be indeterminate, and optional `low` / `high` / `optimum` thresholds\n * colour the arc by zone, like HTML `<meter>` (see `lib/meter.ts`).\n *\n * <CircularProgress meter value={82} aria-label=\"Score\" low={40} high={70} optimum={100} />\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 { MeterZone } from \"../../lib/meter\"\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\n/**\n * `M` is `meter`'s literal type, inferred at the call site (see `MeterProps`).\n * Left out, it is `boolean`: every prop available, `value` plain `number | null`,\n * which is what a generic wrapper or an `Omit<CircularProgressProps, …>` should see.\n */\nexport type CircularProgressProps<M extends boolean = boolean> = Omit<\n ArkRootProps,\n | \"value\"\n | \"defaultValue\"\n | \"onValueChange\"\n // The kit's own `onChange` reports the value; a div's change event never fires here.\n | \"onChange\"\n | \"ref\"\n | \"className\"\n | \"children\"\n | \"asChild\"\n | \"locale\"\n | \"formatOptions\"\n | \"translations\"\n> &\n ForbidAsChild &\n VariantProps<typeof circularRange> &\n WithTestId &\n MeterProps<M> & {\n /** Locale the value text is formatted in: a BCP-47 tag, or `\"auto\"` for the\n * visitor's. Defaults to the `IntlProvider`'s, then `en-US`. */\n locale?: \"auto\" | (string & {})\n /** `Intl.NumberFormat` options for the value text. Defaults to a percentage;\n * `{ style: \"unit\", unit: \"gigabyte\" }` reads the raw value instead. */\n formatOptions?: ArkRootProps[\"formatOptions\"]\n /** Overrides the value text. `value` receives `{ value, min, max, percent,\n * formatter }` and returns what a screen reader says: \"Level 7, 40% to 8\". */\n translations?: ArkRootProps[\"translations\"]\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\"`, and by a meter's zones. */\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\"` (or `\"meter\"`) element. */\n ref?: Ref<SVGSVGElement>\n /** Names the ring. Lands on the `<svg>`, the `role=\"progressbar\"` element, like the other\n * `aria-*` naming props below; without one, Ark names it by its value (\"40\"). */\n \"aria-label\"?: string\n /** Names the ring after a visible caption, by id. Wins over `aria-label`. */\n \"aria-labelledby\"?: string\n \"aria-describedby\"?: string\n /** Read instead of the number: \"Uploading\", \"3 of 8 files\". A meter\n * writes its formatted value here when unset. */\n \"aria-valuetext\"?: string\n className?: string\n classNames?: CircularProgressClassNames\n style?: CSSProperties\n }\n\n// `M` defaults to `false`, not `boolean`, so a bar with no `meter` rejects thresholds.\nexport const CircularProgress = <M extends boolean = false>({\n value,\n defaultValue,\n onChange,\n meter,\n low,\n high,\n optimum,\n locale,\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 // The naming attributes describe the progressbar, which is the ring, not the root.\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-valuetext\": valueText,\n ...rest\n}: CircularProgressProps<M>) => {\n const isGradient = variant === \"gradient\"\n const gradientId = useId()\n const resolvedLocale = useLocale(locale)\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={arkValue(\"CircularProgress\", meter, value, min)}\n defaultValue={arkValue(\"CircularProgress\", meter, defaultValue, min)}\n // A meter's value is never null, so its narrower `onChange` takes Ark's value as is.\n onValueChange={\n onChange ? ({ value: v }) => (onChange as (v: number | null) => void)(v) : undefined\n }\n min={min}\n max={max}\n locale={resolvedLocale}\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.Context>\n {(api) => {\n // Meter zones read the machine's own value, so an uncontrolled meter is coloured too.\n const zone = meter ? meterZone(api.value, { min, max, low, high, optimum }) : undefined\n return (\n <Ark.Circle\n ref={ref}\n // Ark stamps `role=\"progressbar\"` here; a meter overrides it (local props win).\n {...(meter ? { role: \"meter\" } : null)}\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({\n \"data-testid\": testId,\n // The zone's palette lands on the ring, which the arc inherits from.\n \"data-color\": zone && !isGradient ? METER_ZONE_COLORS[zone] : undefined,\n \"data-zone\": zone,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n // A meter always says its value: Ark's locale-aware `valueAsString`, which\n // `formatOptions` / `translations.value` shape, unless the caller wrote one.\n \"aria-valuetext\": valueText ?? (meter ? api.valueAsString : undefined),\n })}\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 }}\n </Ark.Context>\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,10 +1,14 @@
1
1
  "use client";
2
- import { InputBase, inputControlClasses } from '../../chunk-I4B3N3UX.js';
3
- import '../../chunk-X6DESK37.js';
4
- import { ActionIcon } from '../../chunk-B5YHYI7E.js';
2
+ import { InputBase, inputControlClasses } from '../../chunk-HTVICHT4.js';
3
+ import '../../chunk-2RRTT4AF.js';
4
+ import { ActionIcon } from '../../chunk-ALANKV5Y.js';
5
+ import '../../chunk-NDI4HLQE.js';
5
6
  import '../../chunk-6B2GNPJP.js';
6
7
  import { mergeIcons, iconStroke } from '../../chunk-XXOR34T4.js';
7
8
  import '../../chunk-W3XX7BYT.js';
9
+ import '../../chunk-PQZSTI3R.js';
10
+ import '../../chunk-PMUCGFY5.js';
11
+ import '../../chunk-BUIHQJGE.js';
8
12
  import { composeChildren } from '../../chunk-R5LYFTHA.js';
9
13
  import { props } from '../../chunk-WYCMIIRR.js';
10
14
  import '../../chunk-C6NVU4F7.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/clipboard/clipboard.tsx","../../../src/components/clipboard/copy.tsx"],"names":["Ark","jsx","useClipboardContext"],"mappings":";;;;;;;;;;;;;;;AAkDA,IAAM,cAAA,GAAiB,QAAA;AAIvB,IAAM,YAAA,GAAe,CAAC,EAAE,KAAA,EAAM,KAAyB;AACrD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,mBAAA,EAAoB;AACvC,EAAA,uBACE,GAAA,CAAC,UAAK,IAAA,EAAK,QAAA,EAAS,WAAU,SAAA,EAC3B,QAAA,EAAA,MAAA,GAAS,QAAQ,EAAA,EACpB,CAAA;AAEJ,CAAA;AAuBA,IAAM,OAAO,CAAC;AAAA,EACZ,QAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA0B;AACxB,EAAA,MAAM,EAAE,MAAA,GAAS,cAAA,EAAgB,GAAG,eAAA,EAAgB,GAAI,gBAAgB,EAAC;AACzE,EAAA,uBACE,GAAA;AAAA,IAACA,WAAA,CAAI,IAAA;AAAA,IAAJ;AAAA,MACC,eAAe,QAAA,GAAW,CAAC,YAAY,QAAA,CAAS,OAAA,CAAQ,KAAK,CAAA,GAAI,MAAA;AAAA,MACjE,gBAAgB,cAAA,GAAiB,CAAC,YAAY,cAAA,CAAe,OAAA,CAAQ,MA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AAA,EAAA,EAAgB,QAAA,EAAS,CAAA,mBAE1BA,GAAAA,CAAC,SAAA,CAAU,OAAA,EAAV,EAAkB,SAAO,IAAA,EACxB,QAAA,kBAAAA,GAAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAkB,IAAA,EAAY,MAAA,EAAgB,KAAA,EAAc,QACtE,QAAA,kBAAAA,GAAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAO,UAAA,CAAW,aAAA,EAAe,KAAK,CAAA,EAAG,GAC1D,CAAA,EACF;AAAA;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Clipboard as Ark, useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport type { ComponentProps, ReactNode } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\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 * Ark's shape is already fully partial (a single optional `triggerLabel`) and\n * its machine merges it over its own English default, so `Root` forwards only\n * the keys the caller set. */\ntype ArkClipboardTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\nexport type ClipboardTranslations = ArkClipboardTranslations & {\n /** Announced through a polite `role=\"status\"` region once the value is copied. Ark's\n * `triggerLabel` swap renames the focused button, which screen readers don't re-read. */\n copied?: string\n}\n\nconst DEFAULT_COPIED = \"Copied\"\n\n/** The live region behind the icon swap: always mounted (a region that appears\n * together with its text isn't announced), filled only while `copied`. */\nconst CopiedStatus = ({ label }: { label: string }) => {\n const { copied } = useClipboardContext()\n return (\n <span role=\"status\" className=\"sr-only\">\n {copied ? label : \"\"}\n </span>\n )\n}\n\nexport type ClipboardRootProps = Omit<\n ComponentProps<typeof Ark.Root>,\n \"onChange\" | \"onValueChange\" | \"onStatusChange\" | \"translations\"\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 /** Microcopy: Ark's `triggerLabel` (the trigger's name, copied or not) and `copied`\n * (the status announced on copy). English defaults; set only the keys you translate. */\n translations?: ClipboardTranslations\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, plus the visually\n * hidden status that announces a copy (positioned, so it can't escape a\n * scroller). */\nconst Root = ({\n onChange,\n onCopiedChange,\n testId,\n translations,\n asChild,\n className,\n children,\n ...rest\n}: ClipboardRootProps) => {\n const { copied = DEFAULT_COPIED, ...arkTranslations } = translations ?? {}\n return (\n <Ark.Root\n onValueChange={onChange ? (details) => onChange(details.value) : undefined}\n onStatusChange={onCopiedChange ? (details) => onCopiedChange(details.copied) : undefined}\n translations={arkTranslations}\n asChild={asChild}\n className={cn(\"relative\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {own}\n <CopiedStatus label={copied} />\n </>\n ))}\n </Ark.Root>\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","\"use client\"\n\nimport { useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport { CheckIcon, CopyIcon } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { ActionIcon, type ActionIconProps } from \"../action-icon/action-icon\"\nimport { Clipboard, type ClipboardTranslations } from \"./clipboard\"\n\nexport type CopyIconSlot = \"copy\" | \"copied\"\nexport type CopyIcons = IconMap<CopyIconSlot>\n\n/** The default icons: the copy glyph, and the check it swaps to once copied. */\nexport const DEFAULT_ICONS: Record<CopyIconSlot, ReactNode> = {\n copy: <CopyIcon className={iconStroke} />,\n copied: <CheckIcon className={iconStroke} />,\n}\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 draws the matching icon. */\nconst CopyIndicator = ({ icons }: { icons: Record<CopyIconSlot, ReactNode> }) => {\n const { copied } = useClipboardContext()\n return copied ? icons.copied : icons.copy\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 /** Replaces the default icons: `copy`, and `copied` once the value is copied. A missing key\n * keeps its default; a function `children` renders its own trigger instead. */\n icons?: CopyIcons\n /** Microcopy: the button's `triggerLabel` and the `copied` status announced on copy. English\n * defaults; set only the keys you translate. */\n translations?: ClipboardTranslations\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, and a copy is announced as \"Copied\"\n * through a visually hidden status; both are overridable via `translations`.\n * `Copy` is a closed leaf preset — it owns its `ActionIcon` outright and\n * doesn't accept `asChild` or a custom `aria-label`; compose `Clipboard.Root` /\n * `Clipboard.Trigger` directly (see the `Clipboard` docs) for a different\n * trigger element.\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 icons,\n translations,\n children,\n}: CopyProps) => (\n <Clipboard.Root\n value={value}\n timeout={timeout}\n onCopiedChange={onCopiedChange}\n translations={translations}\n >\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 icons={mergeIcons(DEFAULT_ICONS, icons)} />\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","jsx","useClipboardContext"],"mappings":";;;;;;;;;;;;;;;;;;;AAkDA,IAAM,cAAA,GAAiB,QAAA;AAIvB,IAAM,YAAA,GAAe,CAAC,EAAE,KAAA,EAAM,KAAyB;AACrD,EAAA,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AAO,MAAA,GAAS,KAAA,CAAM,MAAA,GAAS,KAAA,CAAM,IAAA;AACvC,CAAA;AAmBA,IAAM,cAAA,GAAiB,CAAC,EAAE,QAAA,EAAS,KAA2D;AAC5F,EAAA,MAAM,EAAE,MAAA,EAAQ,IAAA,EAAK,GAAIA,mBAAAA,EAAoB;AAC7C,EAAA,OAAO,QAAA,CAAS,EAAE,MAAA,EAAQ,IAAA,EAAM,CAAA;AAClC,CAAA;AAoEO,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,KAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAA,qBACED,GAAAA;AAAA,EAAC,SAAA,CAAU,IAAA;AAAA,EAAV;AAAA,IACC,KAAA;AAAA,IACA,OAAA;AAAA,IACA,cAAA;AAAA,IACA,YAAA;AAAA,IAEC,QAAA,EAAA,OAAO,QAAA,KAAa,UAAA,mBACnBA,IAAC,cAAA,EAAA,EAAgB,QAAA,EAAS,CAAA,mBAE1BA,GAAAA,CAAC,SAAA,CAAU,OAAA,EAAV,EAAkB,SAAO,IAAA,EACxB,QAAA,kBAAAA,GAAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAkB,IAAA,EAAY,MAAA,EAAgB,KAAA,EAAc,QACtE,QAAA,kBAAAA,GAAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAO,UAAA,CAAW,aAAA,EAAe,KAAK,CAAA,EAAG,GAC1D,CAAA,EACF;AAAA;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Clipboard as Ark, useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport type { ComponentProps, ReactNode } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\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 * Ark's shape is already fully partial (a single optional `triggerLabel`) and\n * its machine merges it over its own English default, so `Root` forwards only\n * the keys the caller set. */\ntype ArkClipboardTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\nexport type ClipboardTranslations = ArkClipboardTranslations & {\n /** Announced through a polite `role=\"status\"` region once the value is copied. Ark's\n * `triggerLabel` swap renames the focused button, which screen readers don't re-read. */\n copied?: string\n}\n\nconst DEFAULT_COPIED = \"Copied\"\n\n/** The live region behind the icon swap: always mounted (a region that appears\n * together with its text isn't announced), filled only while `copied`. */\nconst CopiedStatus = ({ label }: { label: string }) => {\n const { copied } = useClipboardContext()\n return (\n <span role=\"status\" className=\"sr-only\">\n {copied ? label : \"\"}\n </span>\n )\n}\n\nexport type ClipboardRootProps = Omit<\n ComponentProps<typeof Ark.Root>,\n \"onChange\" | \"onValueChange\" | \"onStatusChange\" | \"translations\"\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 /** Microcopy: Ark's `triggerLabel` (the trigger's name, copied or not) and `copied`\n * (the status announced on copy). English defaults; set only the keys you translate. */\n translations?: ClipboardTranslations\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, plus the visually\n * hidden status that announces a copy (positioned, so it can't escape a\n * scroller). */\nconst Root = ({\n onChange,\n onCopiedChange,\n testId,\n translations,\n asChild,\n className,\n children,\n ...rest\n}: ClipboardRootProps) => {\n const { copied = DEFAULT_COPIED, ...arkTranslations } = translations ?? {}\n return (\n <Ark.Root\n onValueChange={onChange ? (details) => onChange(details.value) : undefined}\n onStatusChange={onCopiedChange ? (details) => onCopiedChange(details.copied) : undefined}\n translations={arkTranslations}\n asChild={asChild}\n className={cn(\"relative\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {own}\n <CopiedStatus label={copied} />\n </>\n ))}\n </Ark.Root>\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","\"use client\"\n\nimport { useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport { CheckIcon, CopyIcon } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { ActionIcon, type ActionIconProps } from \"../action-icon/action-icon\"\nimport { Clipboard, type ClipboardTranslations } from \"./clipboard\"\n\nexport type CopyIconSlot = \"copy\" | \"copied\"\nexport type CopyIcons = IconMap<CopyIconSlot>\n\n/** The default icons: the copy glyph, and the check it swaps to once copied. */\nexport const DEFAULT_ICONS: Record<CopyIconSlot, ReactNode> = {\n copy: <CopyIcon className={iconStroke} />,\n copied: <CheckIcon className={iconStroke} />,\n}\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 draws the matching icon. */\nconst CopyIndicator = ({ icons }: { icons: Record<CopyIconSlot, ReactNode> }) => {\n const { copied } = useClipboardContext()\n return copied ? icons.copied : icons.copy\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 /** Replaces the default icons: `copy`, and `copied` once the value is copied. A missing key\n * keeps its default; a function `children` renders its own trigger instead. */\n icons?: CopyIcons\n /** Microcopy: the button's `triggerLabel` and the `copied` status announced on copy. English\n * defaults; set only the keys you translate. */\n translations?: ClipboardTranslations\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, and a copy is announced as \"Copied\"\n * through a visually hidden status; both are overridable via `translations`.\n * `Copy` is a closed leaf preset — it owns its `ActionIcon` outright and\n * doesn't accept `asChild` or a custom `aria-label`; compose `Clipboard.Root` /\n * `Clipboard.Trigger` directly (see the `Clipboard` docs) for a different\n * trigger element.\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 icons,\n translations,\n children,\n}: CopyProps) => (\n <Clipboard.Root\n value={value}\n timeout={timeout}\n onCopiedChange={onCopiedChange}\n translations={translations}\n >\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 icons={mergeIcons(DEFAULT_ICONS, icons)} />\n </ActionIcon>\n </Clipboard.Trigger>\n )}\n </Clipboard.Root>\n)\n"]}
@@ -13,6 +13,16 @@ import { Mark } from "../mark/mark";
13
13
  * source order, same trick Badge's `light` variant uses, applied to text
14
14
  * only.
15
15
  *
16
+ * `dir="ltr"`: code reads left to right as typed, on an RTL page too. The
17
+ * attribute does two things the HTML rendering rules tie to it: it sets
18
+ * `direction: ltr` inside the chip, so neutral characters at its edges (`<`,
19
+ * `>`, `()`, `;`) resolve LTR, and it gives the element `unicode-bidi:
20
+ * isolate`, so the chip sits in the RTL flow as one unit and neither its text
21
+ * nor the text around it gets reordered across the boundary. Isolation alone
22
+ * would keep an inherited RTL base direction (`onClick()` would read
23
+ * `()onClick`); `direction: ltr` alone would let `<link>`'s `>` escape to the
24
+ * far end of an RTL line. A caller can still pass `dir` to override it.
25
+ *
16
26
  * Nesting a `<Mark>` (or `Code.Mark`) inside `Code` needs no special-case
17
27
  * code here — Mark always declares its own explicit text color, which wins
18
28
  * over any inherited color from `Code` (see `Mark`'s own doc comment).
@@ -1 +1 @@
1
- {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/components/code/code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,GAC1C,UAAU,GAAG;IACX,gFAAgF;IAChF,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAEH,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,+BAetE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI;;CAAyC,CAAA"}
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/components/code/code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,GAC1C,UAAU,GAAG;IACX,gFAAgF;IAChF,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAEH,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,+BAgBtE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI;;CAAyC,CAAA"}
@@ -9,6 +9,7 @@ function CodeComponent({ className, color, testId, ...rest }) {
9
9
  return /* @__PURE__ */ jsx(
10
10
  ark.code,
11
11
  {
12
+ dir: "ltr",
12
13
  "data-color": color,
13
14
  ...props({ "data-testid": testId }),
14
15
  ...rest,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/code/code.tsx"],"names":[],"mappings":";;;;;;;AA6BA,SAAS,cAAc,EAAE,SAAA,EAAW,OAAO,MAAA,EAAQ,GAAG,MAAK,EAAc;AACvE,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA,CAAI,IAAA;AAAA,IAAJ;AAAA,MACC,YAAA,EAAY,KAAA;AAAA,MACX,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,EAAA;AAAA,QACT,oCAAA;AAAA,QACA,wEAAA;AAAA,QACA,kBAAA,CAAmB,OAAA;AAAA,QACnB,4BAAA;AAAA,QACA;AAAA;AACF;AAAA,GACF;AAEJ;AAUO,IAAM,OAAO,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe,EAAE,MAAM","file":"index.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { Mark } from \"../mark/mark\"\n\n/**\n * Code — inline `<code>`, no syntax highlighting. Pure React Server\n * Component. No font-size utility — inline code inherits the surrounding\n * prose size (Text/Title/body copy), matching native semantics.\n *\n * `color` tints the text only — the neutral background/border pill never\n * changes, regardless of color: `data-color:text-(--c-text)` (specificity\n * 0,2,0) beats the plain + `dark:` neutral text classes (0,1,0) regardless of\n * source order, same trick Badge's `light` variant uses, applied to text\n * only.\n *\n * Nesting a `<Mark>` (or `Code.Mark`) inside `Code` needs no special-case\n * code here — Mark always declares its own explicit text color, which wins\n * over any inherited color from `Code` (see `Mark`'s own doc comment).\n */\nexport type CodeProps = HTMLArkProps<\"code\"> &\n WithTestId & {\n /** Tints the text only — background/border stay neutral regardless of color. */\n color?: Color\n }\n\nfunction CodeComponent({ className, color, testId, ...rest }: CodeProps) {\n return (\n <ark.code\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"font-mono rounded-xs px-1.5 py-0.5\",\n \"bg-black/6 border border-black/8 dark:bg-white/10 dark:border-white/10\",\n TEXT_COLOR_CLASSES.primary,\n \"data-color:text-(--c-text)\",\n className,\n )}\n />\n )\n}\n\n/**\n * `Code.Mark` is `Mark` itself — attached so marking a token inside a code\n * snippet reads as one discoverable compound API (`<Code.Mark>`), without\n * losing `Mark`'s standalone use in ordinary prose (still independently\n * exported at `@42/ui-react/mark`). Pure convenience attachment, not a\n * second implementation — mirrors how `Alert` attaches `Notification`'s\n * parts via `Object.assign`.\n */\nexport const Code = Object.assign(CodeComponent, { Mark })\n"]}
1
+ {"version":3,"sources":["../../../src/components/code/code.tsx"],"names":[],"mappings":";;;;;;;AAuCA,SAAS,cAAc,EAAE,SAAA,EAAW,OAAO,MAAA,EAAQ,GAAG,MAAK,EAAc;AACvE,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA,CAAI,IAAA;AAAA,IAAJ;AAAA,MACC,GAAA,EAAI,KAAA;AAAA,MACJ,YAAA,EAAY,KAAA;AAAA,MACX,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,EAAA;AAAA,QACT,oCAAA;AAAA,QACA,wEAAA;AAAA,QACA,kBAAA,CAAmB,OAAA;AAAA,QACnB,4BAAA;AAAA,QACA;AAAA;AACF;AAAA,GACF;AAEJ;AAUO,IAAM,OAAO,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe,EAAE,MAAM","file":"index.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { Mark } from \"../mark/mark\"\n\n/**\n * Code — inline `<code>`, no syntax highlighting. Pure React Server\n * Component. No font-size utility — inline code inherits the surrounding\n * prose size (Text/Title/body copy), matching native semantics.\n *\n * `color` tints the text only — the neutral background/border pill never\n * changes, regardless of color: `data-color:text-(--c-text)` (specificity\n * 0,2,0) beats the plain + `dark:` neutral text classes (0,1,0) regardless of\n * source order, same trick Badge's `light` variant uses, applied to text\n * only.\n *\n * `dir=\"ltr\"`: code reads left to right as typed, on an RTL page too. The\n * attribute does two things the HTML rendering rules tie to it: it sets\n * `direction: ltr` inside the chip, so neutral characters at its edges (`<`,\n * `>`, `()`, `;`) resolve LTR, and it gives the element `unicode-bidi:\n * isolate`, so the chip sits in the RTL flow as one unit and neither its text\n * nor the text around it gets reordered across the boundary. Isolation alone\n * would keep an inherited RTL base direction (`onClick()` would read\n * `()onClick`); `direction: ltr` alone would let `<link>`'s `>` escape to the\n * far end of an RTL line. A caller can still pass `dir` to override it.\n *\n * Nesting a `<Mark>` (or `Code.Mark`) inside `Code` needs no special-case\n * code here — Mark always declares its own explicit text color, which wins\n * over any inherited color from `Code` (see `Mark`'s own doc comment).\n */\nexport type CodeProps = HTMLArkProps<\"code\"> &\n WithTestId & {\n /** Tints the text only — background/border stay neutral regardless of color. */\n color?: Color\n }\n\nfunction CodeComponent({ className, color, testId, ...rest }: CodeProps) {\n return (\n <ark.code\n dir=\"ltr\"\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"font-mono rounded-xs px-1.5 py-0.5\",\n \"bg-black/6 border border-black/8 dark:bg-white/10 dark:border-white/10\",\n TEXT_COLOR_CLASSES.primary,\n \"data-color:text-(--c-text)\",\n className,\n )}\n />\n )\n}\n\n/**\n * `Code.Mark` is `Mark` itself — attached so marking a token inside a code\n * snippet reads as one discoverable compound API (`<Code.Mark>`), without\n * losing `Mark`'s standalone use in ordinary prose (still independently\n * exported at `@42/ui-react/mark`). Pure convenience attachment, not a\n * second implementation — mirrors how `Alert` attaches `Notification`'s\n * parts via `Object.assign`.\n */\nexport const Code = Object.assign(CodeComponent, { Mark })\n"]}
@@ -1,14 +1,18 @@
1
1
  "use client";
2
- export { CodeBlockButton, CodeBlockChrome, DEFAULT_ICONS } from '../../chunk-I4IJOLNA.js';
3
- import '../../chunk-RKCUXOU2.js';
4
- import '../../chunk-HWBFRDX7.js';
5
- import '../../chunk-2W7H43WL.js';
2
+ export { CodeBlockButton, CodeBlockChrome, DEFAULT_ICONS } from '../../chunk-RMUBCTEF.js';
3
+ import '../../chunk-YUVKROMA.js';
4
+ import '../../chunk-TPOV3OCC.js';
5
+ import '../../chunk-SI7C3W5M.js';
6
+ import '../../chunk-HBWV5EPU.js';
7
+ import '../../chunk-OBSZ4NE2.js';
8
+ import '../../chunk-FED6SJWM.js';
6
9
  import '../../chunk-V6PY7C6S.js';
7
10
  import '../../chunk-SLUOF7XW.js';
8
- import '../../chunk-PMUCGFY5.js';
9
- import '../../chunk-BUIHQJGE.js';
10
11
  import '../../chunk-NKOTA5TM.js';
11
12
  import '../../chunk-XXOR34T4.js';
13
+ import '../../chunk-PQZSTI3R.js';
14
+ import '../../chunk-PMUCGFY5.js';
15
+ import '../../chunk-BUIHQJGE.js';
12
16
  import '../../chunk-R5LYFTHA.js';
13
17
  import '../../chunk-WYCMIIRR.js';
14
18
  import '../../chunk-C6NVU4F7.js';
@@ -1,15 +1,18 @@
1
- import { CodeBlockButton, CodeBlockChrome } from '../../chunk-I4IJOLNA.js';
2
- export { CodeBlockButton } from '../../chunk-I4IJOLNA.js';
3
- import '../../chunk-RKCUXOU2.js';
4
- import '../../chunk-HWBFRDX7.js';
5
- import '../../chunk-2W7H43WL.js';
1
+ import { CodeBlockButton, CodeBlockChrome } from '../../chunk-RMUBCTEF.js';
2
+ export { CodeBlockButton } from '../../chunk-RMUBCTEF.js';
3
+ import '../../chunk-YUVKROMA.js';
4
+ import '../../chunk-TPOV3OCC.js';
5
+ import '../../chunk-SI7C3W5M.js';
6
+ import '../../chunk-HBWV5EPU.js';
7
+ import '../../chunk-OBSZ4NE2.js';
8
+ import '../../chunk-FED6SJWM.js';
6
9
  import '../../chunk-V6PY7C6S.js';
7
10
  import '../../chunk-SLUOF7XW.js';
11
+ import '../../chunk-NKOTA5TM.js';
12
+ import '../../chunk-XXOR34T4.js';
8
13
  import { devWarnOnce } from '../../chunk-PQZSTI3R.js';
9
14
  import '../../chunk-PMUCGFY5.js';
10
15
  import '../../chunk-BUIHQJGE.js';
11
- import '../../chunk-NKOTA5TM.js';
12
- import '../../chunk-XXOR34T4.js';
13
16
  import '../../chunk-R5LYFTHA.js';
14
17
  import '../../chunk-WYCMIIRR.js';
15
18
  import '../../chunk-C6NVU4F7.js';