@42-central/ui-react 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +36 -175
  2. package/dist/{chunk-FD6P6PLQ.js → chunk-5JHDSVEZ.js} +3 -3
  3. package/dist/{chunk-FD6P6PLQ.js.map → chunk-5JHDSVEZ.js.map} +1 -1
  4. package/dist/{chunk-QMW7D5GU.js → chunk-5OQLFX47.js} +4 -3
  5. package/dist/chunk-5OQLFX47.js.map +1 -0
  6. package/dist/{chunk-VZ2TPU4B.js → chunk-6GDMSENK.js} +3 -2
  7. package/dist/chunk-6GDMSENK.js.map +1 -0
  8. package/dist/{chunk-TNNH3FVQ.js → chunk-6OLTJYSX.js} +24 -8
  9. package/dist/chunk-6OLTJYSX.js.map +1 -0
  10. package/dist/{chunk-POKDSVQT.js → chunk-AE7QTLJ5.js} +5 -4
  11. package/dist/chunk-AE7QTLJ5.js.map +1 -0
  12. package/dist/{chunk-44OV3PNH.js → chunk-B2YJKRNQ.js} +3 -3
  13. package/dist/{chunk-44OV3PNH.js.map → chunk-B2YJKRNQ.js.map} +1 -1
  14. package/dist/{chunk-YIQI2CF3.js → chunk-CTSO6V72.js} +3 -2
  15. package/dist/chunk-CTSO6V72.js.map +1 -0
  16. package/dist/{chunk-ACE7FBWE.js → chunk-EBREIC3L.js} +5 -4
  17. package/dist/chunk-EBREIC3L.js.map +1 -0
  18. package/dist/{chunk-UNSAA7YG.js → chunk-FHG54IT5.js} +3 -2
  19. package/dist/chunk-FHG54IT5.js.map +1 -0
  20. package/dist/{chunk-3GYOIQW7.js → chunk-FZIHZT5R.js} +5 -5
  21. package/dist/{chunk-3GYOIQW7.js.map → chunk-FZIHZT5R.js.map} +1 -1
  22. package/dist/{chunk-2H46IXW4.js → chunk-HAQJQFE6.js} +28 -8
  23. package/dist/chunk-HAQJQFE6.js.map +1 -0
  24. package/dist/{chunk-IHYFYMHJ.js → chunk-HT5JAHR3.js} +6 -6
  25. package/dist/{chunk-IHYFYMHJ.js.map → chunk-HT5JAHR3.js.map} +1 -1
  26. package/dist/chunk-I4SQQIP5.js +12 -0
  27. package/dist/chunk-I4SQQIP5.js.map +1 -0
  28. package/dist/{chunk-J3PELDH3.js → chunk-JITF6I7N.js} +22 -6
  29. package/dist/chunk-JITF6I7N.js.map +1 -0
  30. package/dist/{chunk-IFWCCAQV.js → chunk-KHMFNH3X.js} +3 -2
  31. package/dist/chunk-KHMFNH3X.js.map +1 -0
  32. package/dist/{chunk-SIG4DMNZ.js → chunk-MI2WZRK3.js} +4 -4
  33. package/dist/{chunk-SIG4DMNZ.js.map → chunk-MI2WZRK3.js.map} +1 -1
  34. package/dist/{chunk-PJL4ZL5V.js → chunk-O23Y5ML4.js} +8 -8
  35. package/dist/{chunk-PJL4ZL5V.js.map → chunk-O23Y5ML4.js.map} +1 -1
  36. package/dist/{chunk-P7A3BCAC.js → chunk-OWG4BCQR.js} +3 -3
  37. package/dist/{chunk-P7A3BCAC.js.map → chunk-OWG4BCQR.js.map} +1 -1
  38. package/dist/{chunk-FUWSTUDM.js → chunk-PH354ECN.js} +4 -4
  39. package/dist/{chunk-FUWSTUDM.js.map → chunk-PH354ECN.js.map} +1 -1
  40. package/dist/{chunk-U5GW5EBR.js → chunk-RAUOFTUH.js} +12 -20
  41. package/dist/chunk-RAUOFTUH.js.map +1 -0
  42. package/dist/{chunk-2762HZYX.js → chunk-S2HWWR2H.js} +47 -25
  43. package/dist/chunk-S2HWWR2H.js.map +1 -0
  44. package/dist/{chunk-VLUKI3HL.js → chunk-S7N4LGLZ.js} +6 -13
  45. package/dist/chunk-S7N4LGLZ.js.map +1 -0
  46. package/dist/{chunk-TMMEJKLI.js → chunk-UHNRAI6V.js} +17 -4
  47. package/dist/chunk-UHNRAI6V.js.map +1 -0
  48. package/dist/{chunk-3NZXWCGF.js → chunk-WHKKN3ZK.js} +6 -6
  49. package/dist/{chunk-3NZXWCGF.js.map → chunk-WHKKN3ZK.js.map} +1 -1
  50. package/dist/{chunk-MOI7B3KH.js → chunk-WQN64ZHG.js} +5 -5
  51. package/dist/{chunk-MOI7B3KH.js.map → chunk-WQN64ZHG.js.map} +1 -1
  52. package/dist/chunk-WSIVRDRB.js +34 -0
  53. package/dist/chunk-WSIVRDRB.js.map +1 -0
  54. package/dist/{chunk-6SWK4XG5.js → chunk-YXE4B6X3.js} +2 -2
  55. package/dist/chunk-YXE4B6X3.js.map +1 -0
  56. package/dist/{chunk-NGAQITWP.js → chunk-Z2Z5EXVT.js} +10 -7
  57. package/dist/chunk-Z2Z5EXVT.js.map +1 -0
  58. package/dist/{chunk-IXKELBJA.js → chunk-ZDXQ64A7.js} +63 -44
  59. package/dist/chunk-ZDXQ64A7.js.map +1 -0
  60. package/dist/components/accordion/accordion-data.d.ts +3 -2
  61. package/dist/components/accordion/accordion-data.d.ts.map +1 -1
  62. package/dist/components/accordion/accordion.d.ts +2 -2
  63. package/dist/components/accordion/accordion.d.ts.map +1 -1
  64. package/dist/components/accordion/index.js +20 -8
  65. package/dist/components/accordion/index.js.map +1 -1
  66. package/dist/components/action-icon/action-icon.d.ts +3 -4
  67. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  68. package/dist/components/action-icon/index.js +2 -1
  69. package/dist/components/alert/alert.d.ts +18 -10
  70. package/dist/components/alert/alert.d.ts.map +1 -1
  71. package/dist/components/alert/index.js +17 -5
  72. package/dist/components/alert/index.js.map +1 -1
  73. package/dist/components/app-shell/app-shell.d.ts +3 -2
  74. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  75. package/dist/components/app-shell/index.js +4 -2
  76. package/dist/components/app-shell/index.js.map +1 -1
  77. package/dist/components/autocomplete/index.js +5 -4
  78. package/dist/components/autocomplete/index.js.map +1 -1
  79. package/dist/components/breadcrumb/breadcrumb.d.ts +3 -2
  80. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  81. package/dist/components/breadcrumb/index.js +11 -5
  82. package/dist/components/breadcrumb/index.js.map +1 -1
  83. package/dist/components/button/button.d.ts +4 -4
  84. package/dist/components/button/button.d.ts.map +1 -1
  85. package/dist/components/button/index.js +2 -1
  86. package/dist/components/button-multi-select/index.js +4 -3
  87. package/dist/components/button-multi-select/index.js.map +1 -1
  88. package/dist/components/button-select/index.js +4 -3
  89. package/dist/components/button-select/index.js.map +1 -1
  90. package/dist/components/calendar/calendar-body.d.ts.map +1 -1
  91. package/dist/components/calendar/index.js +3 -2
  92. package/dist/components/checkbox/index.js +2 -2
  93. package/dist/components/choice-card-group/index.js +1 -1
  94. package/dist/components/circular-progress/circular-progress.d.ts +3 -2
  95. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  96. package/dist/components/circular-progress/index.js +1 -0
  97. package/dist/components/circular-progress/index.js.map +1 -1
  98. package/dist/components/clipboard/clipboard.d.ts +1 -1
  99. package/dist/components/clipboard/clipboard.d.ts.map +1 -1
  100. package/dist/components/clipboard/index.js +9 -5
  101. package/dist/components/clipboard/index.js.map +1 -1
  102. package/dist/components/code-block/chrome.d.ts +4 -1
  103. package/dist/components/code-block/chrome.d.ts.map +1 -1
  104. package/dist/components/code-block/chrome.js +5 -4
  105. package/dist/components/code-block/code-block.d.ts +7 -1
  106. package/dist/components/code-block/code-block.d.ts.map +1 -1
  107. package/dist/components/code-block/index.d.ts +1 -1
  108. package/dist/components/code-block/index.js +12 -10
  109. package/dist/components/code-block/index.js.map +1 -1
  110. package/dist/components/code-block/notation.d.ts +5 -2
  111. package/dist/components/code-block/notation.d.ts.map +1 -1
  112. package/dist/components/code-block/static.d.ts +4 -1
  113. package/dist/components/code-block/static.d.ts.map +1 -1
  114. package/dist/components/code-block/static.js +5 -4
  115. package/dist/components/code-block/static.js.map +1 -1
  116. package/dist/components/collapse/collapse.d.ts +7 -3
  117. package/dist/components/collapse/collapse.d.ts.map +1 -1
  118. package/dist/components/collapse/index.js +2 -1
  119. package/dist/components/combobox/combobox.d.ts +11 -10
  120. package/dist/components/combobox/combobox.d.ts.map +1 -1
  121. package/dist/components/combobox/index.js +5 -4
  122. package/dist/components/combobox-list/index.js +6 -5
  123. package/dist/components/data-table/index.js +20 -19
  124. package/dist/components/data-table/index.js.map +1 -1
  125. package/dist/components/date-picker/index.js +12 -11
  126. package/dist/components/date-picker/index.js.map +1 -1
  127. package/dist/components/divider/divider.d.ts +3 -2
  128. package/dist/components/divider/divider.d.ts.map +1 -1
  129. package/dist/components/divider/index.js +1 -1
  130. package/dist/components/drawer/drawer.d.ts +6 -5
  131. package/dist/components/drawer/drawer.d.ts.map +1 -1
  132. package/dist/components/drawer/index.js +3 -2
  133. package/dist/components/field/field.d.ts +7 -4
  134. package/dist/components/field/field.d.ts.map +1 -1
  135. package/dist/components/field/index.js +1 -1
  136. package/dist/components/file-upload/index.js +3 -2
  137. package/dist/components/file-upload/index.js.map +1 -1
  138. package/dist/components/hover-card/index.js +1 -1
  139. package/dist/components/input/index.js +2 -2
  140. package/dist/components/input/input.d.ts +3 -2
  141. package/dist/components/input/input.d.ts.map +1 -1
  142. package/dist/components/menu/index.js +3 -2
  143. package/dist/components/menu/index.js.map +1 -1
  144. package/dist/components/menu/menu-data.d.ts +6 -1
  145. package/dist/components/menu/menu-data.d.ts.map +1 -1
  146. package/dist/components/menu/menu.d.ts +5 -5
  147. package/dist/components/menu/menu.d.ts.map +1 -1
  148. package/dist/components/modal/index.js +3 -2
  149. package/dist/components/modal/modal.d.ts +4 -3
  150. package/dist/components/modal/modal.d.ts.map +1 -1
  151. package/dist/components/multi-combobox-list/index.js +6 -5
  152. package/dist/components/multi-select/index.js +7 -6
  153. package/dist/components/multi-select/index.js.map +1 -1
  154. package/dist/components/nav-link/index.js +3 -2
  155. package/dist/components/nav-link/tanstack.js +3 -2
  156. package/dist/components/nav-link/tanstack.js.map +1 -1
  157. package/dist/components/notification/create-notifier.d.ts.map +1 -1
  158. package/dist/components/notification/index.js +8 -7
  159. package/dist/components/notification/index.js.map +1 -1
  160. package/dist/components/notification/notification.d.ts +7 -6
  161. package/dist/components/notification/notification.d.ts.map +1 -1
  162. package/dist/components/number-input/index.js +4 -4
  163. package/dist/components/overlays/index.js +5 -4
  164. package/dist/components/overlays/index.js.map +1 -1
  165. package/dist/components/password-input/index.js +2 -2
  166. package/dist/components/pill/index.js +2 -1
  167. package/dist/components/pill/pill.d.ts +4 -2
  168. package/dist/components/pill/pill.d.ts.map +1 -1
  169. package/dist/components/pills-input/index.js +5 -4
  170. package/dist/components/pills-input/pills-input.d.ts +3 -2
  171. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  172. package/dist/components/pin-input/index.js +2 -2
  173. package/dist/components/popover/index.js +1 -1
  174. package/dist/components/popover/popover.d.ts +3 -2
  175. package/dist/components/popover/popover.d.ts.map +1 -1
  176. package/dist/components/progress/index.js +1 -0
  177. package/dist/components/progress/index.js.map +1 -1
  178. package/dist/components/progress/progress.d.ts +3 -2
  179. package/dist/components/progress/progress.d.ts.map +1 -1
  180. package/dist/components/radio-group/index.js +1 -1
  181. package/dist/components/rating/index.js +2 -1
  182. package/dist/components/rating/index.js.map +1 -1
  183. package/dist/components/rating/rating.d.ts +3 -2
  184. package/dist/components/rating/rating.d.ts.map +1 -1
  185. package/dist/components/schedule/index.d.ts +4 -4
  186. package/dist/components/schedule/index.js +211 -110
  187. package/dist/components/schedule/index.js.map +1 -1
  188. package/dist/components/schedule/schedule-agenda-list.d.ts +6 -7
  189. package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -1
  190. package/dist/components/schedule/schedule-agenda-view.d.ts +19 -16
  191. package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
  192. package/dist/components/schedule/schedule-create-draft.d.ts +3 -2
  193. package/dist/components/schedule/schedule-create-draft.d.ts.map +1 -1
  194. package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
  195. package/dist/components/schedule/schedule-days-view.d.ts +3 -2
  196. package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
  197. package/dist/components/schedule/schedule-drag-ghost.d.ts +12 -5
  198. package/dist/components/schedule/schedule-drag-ghost.d.ts.map +1 -1
  199. package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
  200. package/dist/components/schedule/schedule-geometry.d.ts +16 -0
  201. package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
  202. package/dist/components/schedule/schedule-grid-gesture.d.ts +29 -6
  203. package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
  204. package/dist/components/schedule/schedule-month-view.d.ts +3 -2
  205. package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
  206. package/dist/components/schedule/schedule-next-up.d.ts +4 -3
  207. package/dist/components/schedule/schedule-next-up.d.ts.map +1 -1
  208. package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
  209. package/dist/components/schedule/schedule-toolbar.d.ts +3 -3
  210. package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
  211. package/dist/components/schedule/schedule-types.d.ts +9 -4
  212. package/dist/components/schedule/schedule-types.d.ts.map +1 -1
  213. package/dist/components/schedule/schedule-views.d.ts +2 -2
  214. package/dist/components/schedule/schedule-views.d.ts.map +1 -1
  215. package/dist/components/schedule/schedule-year-view.d.ts +3 -2
  216. package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
  217. package/dist/components/schedule/schedule.d.ts +9 -6
  218. package/dist/components/schedule/schedule.d.ts.map +1 -1
  219. package/dist/components/schedule/use-event-create.d.ts.map +1 -1
  220. package/dist/components/schedule/use-event-drag.d.ts.map +1 -1
  221. package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
  222. package/dist/components/segment-group/index.js +2 -2
  223. package/dist/components/select/index.js +4 -4
  224. package/dist/components/slider/index.js +2 -1
  225. package/dist/components/slider/index.js.map +1 -1
  226. package/dist/components/slider/slider.d.ts +3 -2
  227. package/dist/components/slider/slider.d.ts.map +1 -1
  228. package/dist/components/switch/index.js +1 -1
  229. package/dist/components/tabs/index.js +1 -1
  230. package/dist/components/tabs/tabs-data.d.ts +3 -2
  231. package/dist/components/tabs/tabs-data.d.ts.map +1 -1
  232. package/dist/components/tags-input/index.js +6 -5
  233. package/dist/components/tags-input/index.js.map +1 -1
  234. package/dist/components/text-input/index.js +2 -2
  235. package/dist/components/textarea/index.js +2 -2
  236. package/dist/components/time-input/index.js +6 -6
  237. package/dist/components/timeline/index.js +8 -5
  238. package/dist/components/timeline/index.js.map +1 -1
  239. package/dist/components/timeline/timeline.d.ts +1 -1
  240. package/dist/components/timeline/timeline.d.ts.map +1 -1
  241. package/dist/components/tooltip/index.js +1 -1
  242. package/dist/components/tooltip/tooltip.d.ts +2 -1
  243. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  244. package/dist/components/tree-multi-select/index.js +6 -5
  245. package/dist/components/tree-multi-select/index.js.map +1 -1
  246. package/dist/components/tree-select/index.js +3 -3
  247. package/dist/lib/as-child.d.ts +104 -0
  248. package/dist/lib/as-child.d.ts.map +1 -0
  249. package/dist/theme.css +9 -3
  250. package/package.json +1 -1
  251. package/src/as-child.contract.test.tsx +809 -0
  252. package/src/components/accordion/accordion-data.tsx +8 -5
  253. package/src/components/accordion/accordion.test.tsx +40 -0
  254. package/src/components/accordion/accordion.tsx +23 -6
  255. package/src/components/action-icon/action-icon.tsx +9 -24
  256. package/src/components/alert/alert.test.tsx +25 -2
  257. package/src/components/alert/alert.tsx +39 -13
  258. package/src/components/app-shell/app-shell.tsx +3 -1
  259. package/src/components/breadcrumb/breadcrumb.test.tsx +30 -0
  260. package/src/components/breadcrumb/breadcrumb.tsx +21 -12
  261. package/src/components/button/button.tsx +21 -50
  262. package/src/components/calendar/calendar-body.tsx +8 -1
  263. package/src/components/circular-progress/circular-progress.tsx +4 -1
  264. package/src/components/clipboard/clipboard.test.tsx +18 -0
  265. package/src/components/clipboard/clipboard.tsx +8 -2
  266. package/src/components/code-block/chrome.tsx +60 -36
  267. package/src/components/code-block/code-block.test.tsx +27 -0
  268. package/src/components/code-block/code-block.tsx +13 -3
  269. package/src/components/code-block/notation.test.ts +8 -0
  270. package/src/components/code-block/notation.ts +6 -3
  271. package/src/components/code-block/static.tsx +8 -2
  272. package/src/components/collapse/collapse.tsx +33 -15
  273. package/src/components/combobox/combobox.test.tsx +38 -0
  274. package/src/components/combobox/combobox.tsx +24 -10
  275. package/src/components/divider/divider.tsx +3 -1
  276. package/src/components/drawer/drawer.tsx +37 -16
  277. package/src/components/field/field.tsx +7 -3
  278. package/src/components/input/input.tsx +3 -1
  279. package/src/components/menu/menu-data.tsx +8 -1
  280. package/src/components/menu/menu.test.tsx +52 -0
  281. package/src/components/menu/menu.tsx +83 -35
  282. package/src/components/modal/close-trigger.test.tsx +38 -0
  283. package/src/components/modal/modal.tsx +29 -13
  284. package/src/components/notification/create-notifier.tsx +6 -5
  285. package/src/components/notification/notification.test.tsx +15 -0
  286. package/src/components/notification/notification.tsx +8 -5
  287. package/src/components/pill/pill.tsx +29 -20
  288. package/src/components/pills-input/pills-input.tsx +3 -1
  289. package/src/components/popover/popover.tsx +3 -1
  290. package/src/components/progress/progress.tsx +4 -1
  291. package/src/components/rating/rating.tsx +27 -23
  292. package/src/components/schedule/index.ts +1 -1
  293. package/src/components/schedule/now-cursor-line.tsx +1 -1
  294. package/src/components/schedule/schedule-agenda-list.tsx +6 -7
  295. package/src/components/schedule/schedule-agenda-view.test.tsx +105 -28
  296. package/src/components/schedule/schedule-agenda-view.tsx +46 -31
  297. package/src/components/schedule/schedule-all-day-row.tsx +1 -1
  298. package/src/components/schedule/schedule-create-draft.tsx +14 -5
  299. package/src/components/schedule/schedule-dates.test.ts +37 -52
  300. package/src/components/schedule/schedule-dates.ts +25 -27
  301. package/src/components/schedule/schedule-days-view.tsx +9 -5
  302. package/src/components/schedule/schedule-drag-ghost.tsx +27 -12
  303. package/src/components/schedule/schedule-event-chip.tsx +9 -2
  304. package/src/components/schedule/schedule-event-list-popover-content.tsx +1 -1
  305. package/src/components/schedule/schedule-geometry.ts +21 -0
  306. package/src/components/schedule/schedule-grid-gesture.test.ts +83 -1
  307. package/src/components/schedule/schedule-grid-gesture.ts +67 -28
  308. package/src/components/schedule/schedule-month-view.tsx +10 -6
  309. package/src/components/schedule/schedule-next-up.tsx +11 -5
  310. package/src/components/schedule/schedule-timed-grid.tsx +41 -3
  311. package/src/components/schedule/schedule-toolbar.test.tsx +26 -0
  312. package/src/components/schedule/schedule-toolbar.tsx +35 -17
  313. package/src/components/schedule/schedule-types.ts +9 -4
  314. package/src/components/schedule/schedule-views.ts +4 -5
  315. package/src/components/schedule/schedule-year-view.tsx +10 -6
  316. package/src/components/schedule/schedule.test.tsx +198 -36
  317. package/src/components/schedule/schedule.tsx +28 -17
  318. package/src/components/schedule/use-event-create.ts +7 -6
  319. package/src/components/schedule/use-event-drag.ts +10 -4
  320. package/src/components/schedule/use-event-resize.ts +4 -2
  321. package/src/components/slider/slider.tsx +4 -0
  322. package/src/components/tabs/tabs-data.tsx +17 -14
  323. package/src/components/timeline/timeline.tsx +102 -95
  324. package/src/components/tooltip/tooltip.tsx +2 -1
  325. package/src/lib/as-child.test.tsx +70 -0
  326. package/src/lib/as-child.ts +119 -0
  327. package/src/theme.css +9 -3
  328. package/dist/chunk-2762HZYX.js.map +0 -1
  329. package/dist/chunk-2H46IXW4.js.map +0 -1
  330. package/dist/chunk-6SWK4XG5.js.map +0 -1
  331. package/dist/chunk-ACE7FBWE.js.map +0 -1
  332. package/dist/chunk-HWNPXAEN.js +0 -31
  333. package/dist/chunk-HWNPXAEN.js.map +0 -1
  334. package/dist/chunk-IFWCCAQV.js.map +0 -1
  335. package/dist/chunk-IXKELBJA.js.map +0 -1
  336. package/dist/chunk-J3PELDH3.js.map +0 -1
  337. package/dist/chunk-NGAQITWP.js.map +0 -1
  338. package/dist/chunk-POKDSVQT.js.map +0 -1
  339. package/dist/chunk-QMW7D5GU.js.map +0 -1
  340. package/dist/chunk-TMMEJKLI.js.map +0 -1
  341. package/dist/chunk-TNNH3FVQ.js.map +0 -1
  342. package/dist/chunk-U5GW5EBR.js.map +0 -1
  343. package/dist/chunk-UNSAA7YG.js.map +0 -1
  344. package/dist/chunk-VLUKI3HL.js.map +0 -1
  345. package/dist/chunk-VZ2TPU4B.js.map +0 -1
  346. package/dist/chunk-YIQI2CF3.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { SegmentGroup } from './chunk-44OV3PNH.js';
2
- import { NumberInput } from './chunk-3GYOIQW7.js';
1
+ import { SegmentGroup } from './chunk-B2YJKRNQ.js';
2
+ import { NumberInput } from './chunk-FZIHZT5R.js';
3
3
  import { cn } from './chunk-QP4I37PA.js';
4
4
  import { useLocaleContext } from '@ark-ui/react/locale';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -215,5 +215,5 @@ var TimeRow = ({
215
215
  };
216
216
 
217
217
  export { TimeRow, dayPeriodLabels, is12Hour, resolveHourCycle, timeRowMinWidth, to12Hour, to24Hour };
218
- //# sourceMappingURL=chunk-FUWSTUDM.js.map
219
- //# sourceMappingURL=chunk-FUWSTUDM.js.map
218
+ //# sourceMappingURL=chunk-PH354ECN.js.map
219
+ //# sourceMappingURL=chunk-PH354ECN.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA,KAAW,KAAK,KAAA,GAAQ,KAAA;AACzD,EAAA,OAAO,IAAA,CAAK,eAAe,MAAA,EAAQ,EAAE,MAAM,SAAA,EAAW,CAAA,CAAE,eAAA,EAAgB,CAAE,SAAA;AAC5E;AAGO,IAAM,QAAA,GAAW,CAAC,KAAA,KAA8B,KAAA,KAAU,SAAS,KAAA,KAAU;AAG7E,IAAM,QAAA,GAAW,CAAC,MAAA,MAA2D;AAAA,EAClF,IAAA,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a,EAAA;AAAG,eACxC;AAAA,cACA,KAAA,EAAO,cAAc,MAAA,IAAU,QAAA;AAAA,cAC/B,KAAA,EAAO,MAAA;AAAA,cACP,QAAA,EAAU,CAAC,KAAA,KAAU,cAAA,CAAe,KAAoB,CAAA;AAAA,cAGxD,IAAA;AAAA,cACA,QAAA;AAAA,cACA,QAAA;AAAA,cACA,OAAA;AAAA,cACA,WAAW,UAAA,EAAY,MAAA;AAAA,cAOvB,UAAA,EAAY,EAAE,KAAA,EAAO,iBAAA,EAAmB,OAAO,SAAA;AAAU;AAAA;AAC3D;AAAA;AAAA;AAEJ;AAEJ","file":"chunk-FUWSTUDM.js","sourcesContent":["export type HourCycle = \"h11\" | \"h12\" | \"h23\" | \"h24\"\n\n/**\n * Resolve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 1–12 + AM/PM (`h11`/`h12`) rather than 0–23. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** Convert a stored 24h hour (`0`–`23`) to a displayed 12h hour (`1`–`12`) + period. */\nexport const to12Hour = (hour24: number): { hour: number; period: \"AM\" | \"PM\" } => ({\n hour: hour24 % 12 || 12,\n period: hour24 < 12 ? \"AM\" : \"PM\",\n})\n\n/** Convert a displayed 12h hour (`1`–`12`) + period back to a stored 24h hour. */\nexport const to24Hour = (hour12: number, period: \"AM\" | \"PM\"): number =>\n period === \"PM\" ? (hour12 % 12) + 12 : hour12 % 12\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `to12Hour`/`to24Hour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport { dayPeriodLabels, type HourCycle, is12Hour, timeUnitLabels } from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (1–12 in 12h mode, 0–23 in 24h) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). */\nexport type TimeRowTranslations = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nconst TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\nconst timeFieldBasis: Record<Size, string> = {\n xs: `basis-[${TIME_FIELD_BASIS_PX.xs}px] min-w-[${TIME_FIELD_BASIS_PX.xs}px]`,\n sm: `basis-[${TIME_FIELD_BASIS_PX.sm}px] min-w-[${TIME_FIELD_BASIS_PX.sm}px]`,\n md: `basis-[${TIME_FIELD_BASIS_PX.md}px] min-w-[${TIME_FIELD_BASIS_PX.md}px]`,\n lg: `basis-[${TIME_FIELD_BASIS_PX.lg}px] min-w-[${TIME_FIELD_BASIS_PX.lg}px]`,\n xl: `basis-[${TIME_FIELD_BASIS_PX.xl}px] min-w-[${TIME_FIELD_BASIS_PX.xl}px]`,\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={translations?.hour ?? \"Hour\"}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={twelveHour ? 1 : 0}\n max={twelveHour ? 12 : 23}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={translations?.minute ?? \"Minute\"}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={translations?.second ?? \"Second\"}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={translations?.period ?? \"Period\"}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA,KAAW,KAAK,KAAA,GAAQ,KAAA;AACzD,EAAA,OAAO,IAAA,CAAK,eAAe,MAAA,EAAQ,EAAE,MAAM,SAAA,EAAW,CAAA,CAAE,eAAA,EAAgB,CAAE,SAAA;AAC5E;AAGO,IAAM,QAAA,GAAW,CAAC,KAAA,KAA8B,KAAA,KAAU,SAAS,KAAA,KAAU;AAG7E,IAAM,QAAA,GAAW,CAAC,MAAA,MAA2D;AAAA,EAClF,IAAA,EAAM,SAAS,EAAA,IAAM,EAAA;AAAA,EACrB,MAAA,EAAQ,MAAA,GAAS,EAAA,GAAK,IAAA,GAAO;AAC/B,CAAA;AAGO,IAAM,QAAA,GAAW,CAAC,MAAA,EAAgB,MAAA,KACvC,WAAW,IAAA,GAAQ,MAAA,GAAS,EAAA,GAAM,EAAA,GAAK,MAA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AAA,cACA,OAAA;AAAA,cACA,WAAW,UAAA,EAAY,MAAA;AAAA,cAOvB,UAAA,EAAY,EAAE,KAAA,EAAO,iBAAA,EAAmB,OAAO,SAAA;AAAU;AAAA;AAC3D;AAAA;AAAA;AAEJ;AAEJ","file":"chunk-PH354ECN.js","sourcesContent":["export type HourCycle = \"h11\" | \"h12\" | \"h23\" | \"h24\"\n\n/**\n * Resolve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 1–12 + AM/PM (`h11`/`h12`) rather than 0–23. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** Convert a stored 24h hour (`0`–`23`) to a displayed 12h hour (`1`–`12`) + period. */\nexport const to12Hour = (hour24: number): { hour: number; period: \"AM\" | \"PM\" } => ({\n hour: hour24 % 12 || 12,\n period: hour24 < 12 ? \"AM\" : \"PM\",\n})\n\n/** Convert a displayed 12h hour (`1`–`12`) + period back to a stored 24h hour. */\nexport const to24Hour = (hour12: number, period: \"AM\" | \"PM\"): number =>\n period === \"PM\" ? (hour12 % 12) + 12 : hour12 % 12\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `to12Hour`/`to24Hour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport { dayPeriodLabels, type HourCycle, is12Hour, timeUnitLabels } from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (1–12 in 12h mode, 0–23 in 24h) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). */\nexport type TimeRowTranslations = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nconst TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\nconst timeFieldBasis: Record<Size, string> = {\n xs: `basis-[${TIME_FIELD_BASIS_PX.xs}px] min-w-[${TIME_FIELD_BASIS_PX.xs}px]`,\n sm: `basis-[${TIME_FIELD_BASIS_PX.sm}px] min-w-[${TIME_FIELD_BASIS_PX.sm}px]`,\n md: `basis-[${TIME_FIELD_BASIS_PX.md}px] min-w-[${TIME_FIELD_BASIS_PX.md}px]`,\n lg: `basis-[${TIME_FIELD_BASIS_PX.lg}px] min-w-[${TIME_FIELD_BASIS_PX.lg}px]`,\n xl: `basis-[${TIME_FIELD_BASIS_PX.xl}px] min-w-[${TIME_FIELD_BASIS_PX.xl}px]`,\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={translations?.hour ?? \"Hour\"}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={twelveHour ? 1 : 0}\n max={twelveHour ? 12 : 23}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={translations?.minute ?? \"Minute\"}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={translations?.second ?? \"Second\"}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={translations?.period ?? \"Period\"}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
@@ -1,10 +1,10 @@
1
1
  import { Spinner } from './chunk-NSDM3FEB.js';
2
+ import { withAsChildContent } from './chunk-I4SQQIP5.js';
2
3
  import { props } from './chunk-WYCMIIRR.js';
3
4
  import { focusStyles } from './chunk-B2LCHXUB.js';
4
5
  import { cn } from './chunk-QP4I37PA.js';
5
6
  import { ark } from '@ark-ui/react';
6
7
  import { cva } from 'class-variance-authority';
7
- import { isValidElement, cloneElement } from 'react';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
9
 
10
10
  var buttonVariants = cva(
@@ -87,19 +87,6 @@ var preventWhileLoading = (event) => {
87
87
  event.preventDefault();
88
88
  event.stopPropagation();
89
89
  };
90
- var withAsChildContent = (child, startContent, endContent, size, loading) => {
91
- if (!startContent && !endContent && !loading) return child;
92
- if (!isValidElement(child))
93
- return child;
94
- return cloneElement(child, {
95
- onClick: loading ? preventWhileLoading : child.props.onClick,
96
- children: /* @__PURE__ */ jsxs(Fragment, { children: [
97
- startContent && /* @__PURE__ */ jsx(HiddenSlot, { className: startSlotVariants({ size }), children: startContent }),
98
- child.props.children,
99
- endContent && /* @__PURE__ */ jsx(HiddenSlot, { className: endSlotVariants({ size }), children: endContent })
100
- ] })
101
- });
102
- };
103
90
  var Button = ({
104
91
  className,
105
92
  variant,
@@ -120,6 +107,11 @@ var Button = ({
120
107
  const startContent = loading ? /* @__PURE__ */ jsx(Spinner, { label: null }) : startSlot;
121
108
  const endContent = loading ? null : endSlot;
122
109
  const resolvedOnClick = loading ? preventWhileLoading : onClick;
110
+ const content = (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
111
+ startContent && /* @__PURE__ */ jsx(HiddenSlot, { className: startSlotVariants({ size }), children: startContent }),
112
+ own,
113
+ endContent && /* @__PURE__ */ jsx(HiddenSlot, { className: endSlotVariants({ size }), children: endContent })
114
+ ] });
123
115
  return /* @__PURE__ */ jsx(
124
116
  ark.button,
125
117
  {
@@ -136,15 +128,15 @@ var Button = ({
136
128
  onClick: resolvedOnClick,
137
129
  ...props({ "data-testid": testId }),
138
130
  ...rest,
139
- children: asChild ? withAsChildContent(children, startContent, endContent, size, loading) : /* @__PURE__ */ jsxs(Fragment, { children: [
140
- startContent && /* @__PURE__ */ jsx(HiddenSlot, { className: startSlotVariants({ size }), children: startContent }),
131
+ children: asChild ? withAsChildContent(
141
132
  children,
142
- endContent && /* @__PURE__ */ jsx(HiddenSlot, { className: endSlotVariants({ size }), children: endContent })
143
- ] })
133
+ content,
134
+ loading ? { onClick: preventWhileLoading } : void 0
135
+ ) : content(children)
144
136
  }
145
137
  );
146
138
  };
147
139
 
148
140
  export { Button };
149
- //# sourceMappingURL=chunk-U5GW5EBR.js.map
150
- //# sourceMappingURL=chunk-U5GW5EBR.js.map
141
+ //# sourceMappingURL=chunk-RAUOFTUH.js.map
142
+ //# sourceMappingURL=chunk-RAUOFTUH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/button/button.tsx"],"names":[],"mappings":";;;;;;;;;AAmDA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB;AAAA,IACE,yCAAA;AAAA,IACA,+BAAA;AAAA,IACA,qCAAA;AAAA,IACA,cAAA;AAAA,IACA,0CAAA;AAAA,IACA,0BAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ,mEAAA;AAAA,IACA,4DAAA;AAAA,IACA,uCAAA;AAAA,IACA,sDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ;AAAA,UACN,oCAAA;AAA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A,MAChC,QAAA,EAAU,gBAAA;AAAA,MACV,aAAW,OAAA,IAAW,MAAA;AAAA,MACtB,iBAAe,gBAAA,IAAoB,MAAA;AAAA,MACnC,gBAAc,OAAA,IAAW,MAAA;AAAA,MACzB,YAAA,EAAY,KAAA;AAAA,MACZ,gBAAc,OAAA,IAAW,QAAA;AAAA,MACzB,aAAW,IAAA,IAAQ,IAAA;AAAA,MACnB,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,MAC1D,OAAA,EAAS,eAAA;AAAA,MACR,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA,OAAA,GACG,kBAAA;AAAA,QACE,QAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA,GAAU,EAAE,OAAA,EAAS,mBAAA,EAAoB,GAAI;AAAA,OAC/C,GACA,QAAQ,QAAQ;AAAA;AAAA,GACtB;AAEJ","file":"chunk-RAUOFTUH.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { MouseEvent, ReactNode } from \"react\"\nimport { withAsChildContent } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Spinner } from \"../spinner/spinner\"\n\n/**\n * Button — interactive but stateless primitive.\n *\n * The new (variant × color) model splits visual treatment from accent palette:\n * - `variant` picks the shape (filled / light / outline / subtle)\n * - `color` picks the palette (brand / gray / neutral / red / orange / …)\n *\n * Color is delivered through CSS variables: the component writes a\n * `data-color=\"…\"` attribute and the global rules in `colors.css` resolve\n * `--c-solid`, `--c-soft`, `--c-text` etc. for both light and dark mode. So\n * the cva matrix only enumerates variants, not (variant × color) pairs.\n * When `color` is omitted, no `data-color` attribute is rendered and the\n * slot vars cascade from `:root` — which mirrors `neutral` — so the\n * zero-config `<Button>` renders `filled` · `neutral`. Consumers retheme the\n * default for the whole app by overriding the slot vars at `:root`, no JS\n * required.\n *\n * `asChild` (inherited from `HTMLArkProps`) renders the single child element\n * with Button's styling merged in. Ark's factory clones exactly one element,\n * so only one element can survive the swap — `startSlot`/`endSlot` (and the\n * `loading` spinner, which replaces `startSlot`) are folded into *that*\n * element's own children (`withAsChildContent`, `lib/as-child.ts`) rather than\n * rendered as siblings, so they keep showing up even when the child is a\n * link. Common case: `<Button asChild startSlot={<Icon />}><a ...>Go</a></Button>`.\n *\n * `loading` doesn't use `pointer-events-none` to block interaction — that\n * also blocks `:hover`, which would make `cursor-progress` unreachable by a\n * real mouse. Instead native `disabled` handles a real `<button>` (the\n * `disabled:pointer-events-none` rule is scoped off while loading via\n * `not-data-loading:`, since `resolvedDisabled` sets native `disabled` for\n * `loading` too and would otherwise reintroduce the same dead-cursor bug),\n * and an explicit `onClick` guard (`preventWhileLoading`) handles an\n * arbitrary `asChild` element, which `disabled` doesn't affect. The dimmed\n * `opacity-50` treatment is likewise keyed off `data-loading` (not just\n * `:disabled`) for the same reason — `:disabled` never matches a non-form\n * element like an `<a>`, even with a `disabled` attribute on it, so an\n * `asChild` link would otherwise stay at full opacity while loading.\n */\nconst buttonVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"whitespace-nowrap select-none\",\n \"font-medium uppercase tracking-wide\",\n \"no-underline\",\n \"rounded-button border border-transparent\",\n \"transition-colors-radius\",\n focusStyles(),\n \"disabled:not-data-loading:pointer-events-none disabled:opacity-50\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"not-data-loading:hover:cursor-pointer\",\n \"data-loading:cursor-progress data-loading:opacity-50\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n ],\n {\n variants: {\n variant: {\n filled: [\n \"bg-(--c-solid) text-(--c-on-solid)\",\n \"not-data-loading:hover:bg-(--c-solid-hover)\",\n ],\n light: [\n \"bg-(--c-soft) text-(--c-text) border-(--c-soft-hover)\",\n \"not-data-loading:hover:bg-(--c-soft-hover) not-data-loading:hover:border-(--c-solid)\",\n ],\n outline: [\n \"bg-transparent text-(--c-text) border-(--c-solid)\",\n \"not-data-loading:hover:bg-(--c-soft)\",\n ],\n subtle: [\"bg-transparent text-(--c-text)\", \"not-data-loading:hover:bg-(--c-soft)\"],\n },\n size: {\n xs: \"h-7 px-2 text-xs [&_svg]:size-3 gap-1\",\n sm: \"h-8 px-3 text-sm [&_svg]:size-3.5 gap-1.5\",\n md: \"h-9 px-4 text-md [&_svg]:size-4 gap-2\",\n lg: \"h-10 px-4 text-lg [&_svg]:size-5 gap-3\",\n xl: \"h-12 px-5 text-xl [&_svg]:size-6 gap-3\",\n },\n },\n defaultVariants: {\n variant: \"filled\",\n size: \"md\",\n },\n },\n)\n\nconst startSlotVariants = cva(\"inline-flex shrink-0 items-center\", {\n variants: {\n size: {\n xs: \"-ms-0.5\",\n sm: \"-ms-1\",\n md: \"-ms-2\",\n lg: \"-ms-2.5\",\n xl: \"-ms-3\",\n },\n },\n})\nconst endSlotVariants = cva(\"inline-flex shrink-0 items-center\", {\n variants: {\n size: {\n xs: \"-me-0.5\",\n sm: \"-me-1\",\n md: \"-me-2\",\n lg: \"-me-2.5\",\n xl: \"-me-3\",\n },\n },\n})\n\nexport type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>[\"variant\"]>\nexport type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>[\"size\"]>\n\nexport type ButtonProps = Omit<HTMLArkProps<\"button\">, \"color\"> &\n VariantProps<typeof buttonVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /**\n * Render a spinner in place of (or before) the children and mark the\n * button as busy + non-interactive. Use for async submit handlers.\n */\n loading?: boolean\n /**\n * Optional element rendered at the inline-start of the children (e.g. an\n * icon) — left in LTR, right in RTL. Hidden from assistive tech via\n * `aria-hidden`.\n */\n startSlot?: ReactNode\n /**\n * Optional element rendered at the inline-end of the children — right in\n * LTR, left in RTL. `aria-hidden`.\n */\n endSlot?: ReactNode\n }\n\nconst HiddenSlot = ({ children, className }: { children: ReactNode; className?: string }) => (\n <span\n aria-hidden=\"true\"\n className={cn(\"inline-flex shrink-0 items-center justify-center\", className)}\n >\n {children}\n </span>\n)\n\n/**\n * Swallows the click while `loading`. Native `disabled` already blocks\n * interaction on a real `<button>` with or without this, but it's a no-op\n * on an arbitrary `asChild` element (e.g. an `<a>`) — that's the one case\n * this actually needs to do something. A stable module-level reference so\n * it never causes the clone below to look \"changed\" across renders.\n */\nconst preventWhileLoading = (event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n}\n\nexport const Button = ({\n className,\n variant,\n size,\n color,\n loading = false,\n startSlot,\n endSlot,\n children,\n disabled,\n type,\n asChild,\n testId,\n onClick,\n ...rest\n}: ButtonProps) => {\n const resolvedDisabled = disabled || loading\n const startContent = loading ? <Spinner label={null} /> : startSlot\n const endContent = loading ? null : endSlot\n const resolvedOnClick = loading ? preventWhileLoading : onClick\n const content = (own: ReactNode) => (\n <>\n {startContent && (\n <HiddenSlot className={startSlotVariants({ size })}>{startContent}</HiddenSlot>\n )}\n {own}\n {endContent && <HiddenSlot className={endSlotVariants({ size })}>{endContent}</HiddenSlot>}\n </>\n )\n\n return (\n <ark.button\n asChild={asChild}\n type={asChild ? type : (type ?? \"button\")}\n disabled={resolvedDisabled}\n aria-busy={loading || undefined}\n aria-disabled={resolvedDisabled || undefined}\n data-loading={loading || undefined}\n data-color={color}\n data-variant={variant ?? \"filled\"}\n data-size={size ?? \"md\"}\n className={cn(buttonVariants({ variant, size }), className)}\n onClick={resolvedOnClick}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {asChild\n ? withAsChildContent(\n children,\n content,\n loading ? { onClick: preventWhileLoading } : undefined,\n )\n : content(children)}\n </ark.button>\n )\n}\n"]}
@@ -1,8 +1,9 @@
1
1
  import { resolveLogicalPlacement } from './chunk-G52U24GR.js';
2
- import { popoverChrome, popoverGroupLabel, popoverIndicator, popoverChevron } from './chunk-VZ2TPU4B.js';
2
+ import { popoverChrome, popoverGroupLabel, popoverIndicator, popoverChevron } from './chunk-6GDMSENK.js';
3
3
  import { useNestedLayer } from './chunk-AIQG7IIT.js';
4
4
  import { useOverlayContainer } from './chunk-7P32XCEU.js';
5
5
  import { CheckIcon, ChevronIcon } from './chunk-IG7FBZVM.js';
6
+ import { composeChildren } from './chunk-I4SQQIP5.js';
6
7
  import { props } from './chunk-WYCMIIRR.js';
7
8
  import { cn } from './chunk-QP4I37PA.js';
8
9
  import { ark } from '@ark-ui/react/factory';
@@ -13,7 +14,7 @@ import { usePresenceContext } from '@ark-ui/react/presence';
13
14
  import { mergeProps } from '@ark-ui/react/utils';
14
15
  import { cva } from 'class-variance-authority';
15
16
  import { createContext, useContext, useId } from 'react';
16
- import { jsx, jsxs } from 'react/jsx-runtime';
17
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
17
18
 
18
19
  var menuContent = cn(
19
20
  popoverChrome,
@@ -46,6 +47,9 @@ var menuItem = cva(
46
47
  );
47
48
  var menuDivider = "-mx-1 my-1 h-px border-0 bg-brand-900/20 dark:bg-white/15";
48
49
  var MenuContext = createContext({ withinPortal: true });
50
+ var clickLink = ({ node }) => {
51
+ queueMicrotask(() => node.click());
52
+ };
49
53
  var Root = ({
50
54
  position = "bottom",
51
55
  offset,
@@ -61,6 +65,7 @@ var Root = ({
61
65
  Menu.Root,
62
66
  {
63
67
  positioning: { placement: resolveLogicalPlacement(position, dir), gutter: offset },
68
+ navigate: clickLink,
64
69
  onOpenChange: ({ open }) => {
65
70
  onOpenChange?.(open);
66
71
  if (!open) onClose?.();
@@ -97,23 +102,25 @@ var Item = ({
97
102
  className,
98
103
  children,
99
104
  testId,
105
+ asChild,
100
106
  ...rest
101
107
  }) => {
102
108
  const autoId = useId();
103
- return /* @__PURE__ */ jsxs(
109
+ return /* @__PURE__ */ jsx(
104
110
  Menu.Item,
105
111
  {
112
+ asChild,
106
113
  value: value ?? autoId,
107
114
  onSelect: onClick,
108
115
  "data-color": color,
109
116
  className: cn(menuItem({ colored: color != null }), className),
110
117
  ...props({ "data-testid": testId }),
111
118
  ...rest,
112
- children: [
119
+ children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
113
120
  startSection != null && /* @__PURE__ */ jsx(StartSection, { children: startSection }),
114
- children,
121
+ own,
115
122
  endSection != null && /* @__PURE__ */ jsx(EndSection, { children: endSection })
116
- ]
123
+ ] }))
117
124
  }
118
125
  );
119
126
  };
@@ -127,17 +134,19 @@ var ItemGroupLabel = ({
127
134
  prefix,
128
135
  children,
129
136
  testId,
137
+ asChild,
130
138
  ...rest
131
- }) => /* @__PURE__ */ jsxs(
139
+ }) => /* @__PURE__ */ jsx(
132
140
  Menu.ItemGroupLabel,
133
141
  {
142
+ asChild,
134
143
  className: cn(popoverGroupLabel, className),
135
144
  ...props({ "data-testid": testId }),
136
145
  ...rest,
137
- children: [
146
+ children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
138
147
  /* @__PURE__ */ jsx(HeadingPrefix, { prefix }),
139
- children
140
- ]
148
+ own
149
+ ] }))
141
150
  }
142
151
  );
143
152
  var Divider = ({ className, testId, ...rest }) => /* @__PURE__ */ jsx(
@@ -154,19 +163,21 @@ var CheckboxItem = ({
154
163
  className,
155
164
  children,
156
165
  testId,
166
+ asChild,
157
167
  ...rest
158
- }) => /* @__PURE__ */ jsxs(
168
+ }) => /* @__PURE__ */ jsx(
159
169
  Menu.CheckboxItem,
160
170
  {
171
+ asChild,
161
172
  "data-color": color,
162
173
  className: cn(menuItem({ colored: color != null }), className),
163
174
  ...props({ "data-testid": testId }),
164
175
  ...rest,
165
- children: [
176
+ children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
166
177
  startSection != null && /* @__PURE__ */ jsx(StartSection, { children: startSection }),
167
- children,
178
+ own,
168
179
  /* @__PURE__ */ jsx(Menu.ItemIndicator, { className: popoverIndicator, children: /* @__PURE__ */ jsx(CheckIcon, {}) })
169
- ]
180
+ ] }))
170
181
  }
171
182
  );
172
183
  var RadioGroup = ({ onChange, ...rest }) => /* @__PURE__ */ jsx(
@@ -182,17 +193,19 @@ var RadioItem = ({
182
193
  className,
183
194
  children,
184
195
  testId,
196
+ asChild,
185
197
  ...rest
186
- }) => /* @__PURE__ */ jsxs(
198
+ }) => /* @__PURE__ */ jsx(
187
199
  Menu.RadioItem,
188
200
  {
201
+ asChild,
189
202
  "data-color": color,
190
203
  className: cn(menuItem({ colored: color != null }), className),
191
204
  ...props({ "data-testid": testId }),
192
205
  ...rest,
193
- children: [
206
+ children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
194
207
  startSection != null && /* @__PURE__ */ jsx(StartSection, { children: startSection }),
195
- children,
208
+ own,
196
209
  /* @__PURE__ */ jsx(Menu.ItemIndicator, { className: popoverIndicator, children: /* @__PURE__ */ jsxs(
197
210
  "svg",
198
211
  {
@@ -213,7 +226,7 @@ var RadioItem = ({
213
226
  ]
214
227
  }
215
228
  ) })
216
- ]
229
+ ] }))
217
230
  }
218
231
  );
219
232
  var SUBMENU_ALIGN_OFFSET = -5;
@@ -221,6 +234,7 @@ var Sub = ({ offset = 10, children, ...rest }) => /* @__PURE__ */ jsx(
221
234
  Menu.Root,
222
235
  {
223
236
  positioning: { offset: { mainAxis: offset, crossAxis: SUBMENU_ALIGN_OFFSET } },
237
+ navigate: clickLink,
224
238
  ...rest,
225
239
  children
226
240
  }
@@ -231,19 +245,27 @@ var SubTrigger = ({
231
245
  className,
232
246
  children,
233
247
  testId,
248
+ asChild,
234
249
  ...rest
235
- }) => /* @__PURE__ */ jsxs(
250
+ }) => /* @__PURE__ */ jsx(
236
251
  Menu.TriggerItem,
237
252
  {
253
+ asChild,
238
254
  "data-color": color,
239
255
  className: cn(menuItem({ colored: color != null }), className),
240
256
  ...props({ "data-testid": testId }),
241
257
  ...rest,
242
- children: [
258
+ children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
243
259
  startSection != null && /* @__PURE__ */ jsx(StartSection, { children: startSection }),
244
- children,
245
- /* @__PURE__ */ jsx("span", { className: cn(popoverChevron, "ms-auto -me-1 -rotate-90 rtl:rotate-90 [&_svg]:size-4"), children: /* @__PURE__ */ jsx(ChevronIcon, {}) })
246
- ]
260
+ own,
261
+ /* @__PURE__ */ jsx(
262
+ "span",
263
+ {
264
+ className: cn(popoverChevron, "ms-auto -me-1 -rotate-90 rtl:rotate-90 [&_svg]:size-4"),
265
+ children: /* @__PURE__ */ jsx(ChevronIcon, {})
266
+ }
267
+ )
268
+ ] }))
247
269
  }
248
270
  );
249
271
  var Trigger = ({ ref, value, className, ...rest }) => {
@@ -280,5 +302,5 @@ var Separator = Divider;
280
302
  var SubContent = Content;
281
303
 
282
304
  export { CheckboxItem, Content, Context, ContextTrigger, Divider, Item, ItemGroup, ItemGroupLabel, Label, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger };
283
- //# sourceMappingURL=chunk-2762HZYX.js.map
284
- //# sourceMappingURL=chunk-2762HZYX.js.map
305
+ //# sourceMappingURL=chunk-S2HWWR2H.js.map
306
+ //# sourceMappingURL=chunk-S2HWWR2H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/menu/menu.tsx"],"names":["ArkMenu"],"mappings":";;;;;;;;;;;;;;;;;;AA6DA,IAAM,WAAA,GAAc,EAAA;AAAA,EAClB,aAAA;AAAA,EACA,kCAAA;AAAA,EACA;AACF,CAAA;AAQA,IAAM,QAAA,GAAW,GAAA;AAAA,EACf;AAAA,IACE,kFAAA;AAAA,IACA,0BAAA;AAAA,IACA,kCAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAA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G,OAAA;AAAA,UACH,eAAA,EAAiB,QAAA,CAAS,SAAA,GAAY,MAAA,GAAY,QAAQ,eAAe,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKzE,WAAA,EAAa,CAAC,KAAA,KAAqB,KAAA,CAAM,cAAA;AAAe,SAC1D;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA,EAAE,GAAG,IAAA,EAAM,WAAW,EAAA,CAAG,aAAA,EAAe,SAAS,CAAA;AAAE,OACrD;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AAGO,IAAM,iBAAiBA,IAAA,CAAQ;AAC/B,IAAM,YAAYA,IAAA,CAAQ;AAC1B,IAAM,UAAUA,IAAA,CAAQ;AAExB,IAAM,SAAA,GAAY;AAElB,IAAM,UAAA,GAAa","file":"chunk-S2HWWR2H.js","sourcesContent":["\"use client\"\n\nimport { ark } from \"@ark-ui/react/factory\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Menu as ArkMenu, useMenuContext } from \"@ark-ui/react/menu\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresenceContext } from \"@ark-ui/react/presence\"\nimport { mergeProps } from \"@ark-ui/react/utils\"\nimport { cva } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type DragEvent,\n type ReactNode,\n type Ref,\n useContext,\n useId,\n} from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { useNestedLayer } from \"../../lib/overlay-layer\"\nimport { type LogicalPosition, resolveLogicalPlacement } from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { CheckIcon, ChevronIcon } from \"../popover/icons\"\nimport {\n popoverChevron,\n popoverChrome,\n popoverGroupLabel,\n popoverIndicator,\n} from \"../popover/popover\"\n\n/**\n * Menu — the kit's dropdown of actions, a styled layer over Ark UI's Menu.\n * It's the click-triggered sibling of `Popover` (a free-form panel): Ark's Menu\n * machine wires roving focus, type-ahead, `role=\"menu\"` / `menuitem`,\n * `aria-haspopup` / `aria-expanded`, submenus, and checkbox / radio selection.\n *\n * Two ways to use it — the compound parts (this file) give full control; the\n * data-driven `<Menu data={…}>` convenience (see `menu-data.tsx`) covers the\n * common action-menu case and is built on these very parts.\n *\n * <Menu.Root>\n * <Menu.Trigger asChild><Button>Open</Button></Menu.Trigger>\n * <Menu.Content>\n * <Menu.Item startSection={<User />} onClick={openProfile}>Profile</Menu.Item>\n * <Menu.Divider />\n * <Menu.Item color=\"red\" startSection={<Trash />} onClick={remove}>Delete</Menu.Item>\n * </Menu.Content>\n * </Menu.Root>\n *\n * Portaled by default (escapes `overflow:hidden` ancestors), sized to content,\n * and animated via the kit's shared `popover-in/out` tokens.\n */\n\n/** Menu surface — the shared floating chrome, sized to content and scrollable\n * when tall. Unlike the form pickers' `popoverContent` (an `overflow-hidden`\n * clip around a nested scroller) a Menu scrolls natively, so Ark needs no\n * `scrollToIndexFn` workaround. */\nconst menuContent = cn(\n popoverChrome,\n \"flex w-max min-w-40 flex-col p-1\",\n \"max-h-[min(24rem,var(--available-height,24rem))] overflow-y-auto overscroll-contain\",\n)\n\n/** A single menu row — shared by `Item`, `CheckboxItem`, `RadioItem`, and\n * `SubTrigger` so every row is visually identical. Mirrors `popoverOption`'s\n * neutral look, but the `colored` variant swaps the text + highlight tints to\n * the palette slot vars (`--c-text` / `--c-soft`) resolved from `data-color` —\n * e.g. a red \"Delete\". Highlight is `data-highlighted`, selection is\n * `data-[state=checked]`, disabled is `data-disabled`, all owned by Ark. */\nconst menuItem = cva(\n [\n \"relative flex cursor-pointer items-center gap-2 rounded-xs px-2.5 py-1.5 text-md\",\n \"select-none outline-none\",\n \"data-[state=checked]:font-medium\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n ],\n {\n variants: {\n colored: {\n // Neutral highlight is transparent — a low-opacity black/white wash,\n // not an opaque gray — matching the surface's own background-dependent\n // tint (no Figma reference for this state yet).\n false: [\n \"text-gray-light-900 dark:text-gray-dark-100\",\n \"data-highlighted:bg-black/5 dark:data-highlighted:bg-white/8\",\n ],\n // Slot vars already shift by theme (colors.css), so no `dark:` needed.\n true: [\"text-(--c-text)\", \"data-highlighted:bg-(--c-soft)\"],\n },\n },\n defaultVariants: { colored: false },\n },\n)\n\n/** Hairline between groups of items. Same shade as Popover's own\n * Header/Footer/Body slotEdge dividers (brand-900/20 / white/15) — both are\n * separator lines on the identical popoverChrome panel, so they shouldn't\n * drift to different weights. */\nconst menuDivider = \"-mx-1 my-1 h-px border-0 bg-brand-900/20 dark:bg-white/15\"\n\ntype MenuPlacement = NonNullable<NonNullable<ArkMenu.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type MenuPosition = LogicalPosition<MenuPlacement>\n\ntype MenuContextValue = {\n withinPortal: boolean\n container?: HTMLElement | null\n}\nconst MenuContext = createContext<MenuContextValue>({ withinPortal: true })\n\nexport type MenuRootProps = Omit<ArkMenu.RootProps, \"positioning\" | \"onOpenChange\"> & {\n /** Dropdown placement relative to the trigger. Prefer the logical `start` / `end`\n * sides (RTL-aware), or use any Ark placement (`bottom-start`, `top`, …).\n * Defaults to `\"bottom-start\"`. */\n position?: MenuPosition\n /** Gap in px between the trigger and the dropdown. */\n offset?: number\n /** Render the dropdown in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Called when the menu opens or closes (flattened from Ark's detail object). */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, outside interaction, item selection, or a controlled `onOpenChange`. */\n onClose?: () => void\n}\n\n/**\n * Selects a link item (`<Menu.Item asChild><Link/></Menu.Item>`) from the\n * keyboard. zag's default `navigate` dispatches `new MouseEvent(\"click\")`,\n * which doesn't bubble, so React's delegated `onClick` never sees it and a\n * router `Link` falls back to a full page load. `node.click()` dispatches a\n * bubbling click instead, which reaches the router. Deferred like zag's own,\n * so the menu settles before the navigation starts. A `navigate` prop still\n * overrides it.\n */\nconst clickLink: NonNullable<ArkMenu.RootProps[\"navigate\"]> = ({ node }) => {\n queueMicrotask(() => node.click())\n}\n\nconst Root = ({\n position = \"bottom\",\n offset,\n withinPortal = true,\n container,\n onOpenChange,\n onClose,\n children,\n ...rest\n}: MenuRootProps) => {\n const { dir } = useLocaleContext()\n return (\n <MenuContext.Provider value={{ withinPortal, container }}>\n <ArkMenu.Root\n positioning={{ placement: resolveLogicalPlacement(position, dir), gutter: offset }}\n navigate={clickLink}\n onOpenChange={({ open }) => {\n onOpenChange?.(open)\n if (!open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </ArkMenu.Root>\n </MenuContext.Provider>\n )\n}\n\nexport type MenuContentProps = ArkMenu.ContentProps & WithTestId\n\nconst Content = ({ className, children, testId, ...rest }: MenuContentProps) => {\n const { withinPortal, container } = useContext(MenuContext)\n const portalContainer = useOverlayContainer(container)\n // Holds an enclosing Modal/Drawer/Popover open while the menu is; see `lib/overlay-layer.tsx`.\n useNestedLayer(useMenuContext().open)\n const panel = (\n <ArkMenu.Positioner>\n <ArkMenu.Content\n className={cn(menuContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </ArkMenu.Content>\n </ArkMenu.Positioner>\n )\n if (!withinPortal) return panel\n return <Portal container={portalContainer}>{panel}</Portal>\n}\n\n/** Shared inline-start wrapper for a `startSection`. Sizes a bare icon to 16px\n * (`size-4`, like Button `md` / Input / Accordion) so every row's label starts\n * on the same column whatever icon it carries. Scoped to this slot — not the\n * whole row — so SVGs in `children` / `endSection` and the row's own indicator\n * or chevron keep their sizes. `:where()` drops the rule to zero class\n * specificity, so a size class on the icon itself (`className=\"size-5\"`) still\n * wins; Lucide's `size` prop is only an HTML attribute and does not. */\nconst StartSection = ({ children }: { children: ReactNode }) => (\n <span className=\"inline-flex shrink-0 items-center [:where(&)_svg]:size-4\">{children}</span>\n)\n\n/** Shared inline-end wrapper for a `endSection` (pushes it to the far edge). */\nconst EndSection = ({ children }: { children: ReactNode }) => (\n <span className=\"ms-auto inline-flex shrink-0 items-center gap-2 text-gray-light-500 dark:text-gray-dark-400\">\n {children}\n </span>\n)\n\nexport type MenuItemProps = Omit<ArkMenu.ItemProps, \"value\" | \"onClick\" | \"onSelect\"> &\n WithTestId & {\n /** Unique value — used for type-ahead + the selection detail. Auto-generated\n * when omitted (Mantine-style items need no explicit value). */\n value?: string\n /** Content before the label (usually an icon — a bare SVG is sized to 16px;\n * a size class on the icon overrides it). */\n startSection?: ReactNode\n /** Content after the label, pushed to the inline-end. */\n endSection?: ReactNode\n /** Palette for the row — colors the label + highlight tint (e.g. `\"red\"` for a\n * destructive action). Resolved from `data-color` via the slot vars. */\n color?: Color\n /** Fires when the item is selected — on click *and* keyboard activation\n * (Enter / Space), not just a pointer click. Wraps Ark's `onSelect`. */\n onClick?: () => void\n }\n\nconst Item = ({\n value,\n startSection,\n endSection,\n color,\n onClick,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuItemProps) => {\n const autoId = useId()\n return (\n <ArkMenu.Item\n asChild={asChild}\n value={value ?? autoId}\n onSelect={onClick}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSection != null && <StartSection>{startSection}</StartSection>}\n {own}\n {endSection != null && <EndSection>{endSection}</EndSection>}\n </>\n ))}\n </ArkMenu.Item>\n )\n}\n\n/** Optional decorative leader for a section heading — the code-themed `// ` from\n * `Text`'s `prefix`. Hidden from screen readers and the clipboard\n * (`aria-hidden` + `select-none`); renders nothing when unset (off by default). */\nconst HeadingPrefix = ({ prefix }: { prefix: ReactNode }) =>\n prefix === undefined ? null : (\n <span aria-hidden=\"true\" className=\"select-none\">\n {prefix}\n </span>\n )\n\nexport type MenuLabelProps = Omit<ComponentPropsWithoutRef<\"div\">, \"prefix\"> &\n WithTestId & {\n /** Decorative leader before the label (e.g. `\"// \"`). Off by default; hidden\n * from screen readers and the clipboard. */\n prefix?: ReactNode\n }\n\n/** Standalone section heading (Mantine parity). For grouped items with proper\n * ARIA wiring, prefer `Menu.ItemGroup` + `Menu.ItemGroupLabel`. */\nconst Label = ({ className, prefix, children, testId, ...rest }: MenuLabelProps) => (\n <div className={cn(popoverGroupLabel, className)} {...props({ \"data-testid\": testId })} {...rest}>\n <HeadingPrefix prefix={prefix} />\n {children}\n </div>\n)\n\nexport type MenuItemGroupLabelProps = Omit<ArkMenu.ItemGroupLabelProps, \"prefix\"> &\n WithTestId & {\n /** Decorative leader before the label (e.g. `\"// \"`). Off by default; hidden\n * from screen readers and the clipboard. */\n prefix?: ReactNode\n }\n\nconst ItemGroupLabel = ({\n className,\n prefix,\n children,\n testId,\n asChild,\n ...rest\n}: MenuItemGroupLabelProps) => (\n <ArkMenu.ItemGroupLabel\n asChild={asChild}\n className={cn(popoverGroupLabel, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n <HeadingPrefix prefix={prefix} />\n {own}\n </>\n ))}\n </ArkMenu.ItemGroupLabel>\n)\n\nconst Divider = ({ className, testId, ...rest }: ArkMenu.SeparatorProps & WithTestId) => (\n <ArkMenu.Separator\n className={cn(menuDivider, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type MenuCheckboxItemProps = ArkMenu.CheckboxItemProps &\n WithTestId & {\n startSection?: ReactNode\n color?: Color\n }\n\nconst CheckboxItem = ({\n startSection,\n color,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuCheckboxItemProps) => (\n <ArkMenu.CheckboxItem\n asChild={asChild}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSection != null && <StartSection>{startSection}</StartSection>}\n {own}\n <ArkMenu.ItemIndicator className={popoverIndicator}>\n <CheckIcon />\n </ArkMenu.ItemIndicator>\n </>\n ))}\n </ArkMenu.CheckboxItem>\n)\n\nexport type MenuRadioGroupProps = Omit<\n ArkMenu.RadioItemGroupProps,\n \"onValueChange\" | \"onChange\"\n> & {\n /** Called with the newly selected value (flattened from Ark's detail object). */\n onChange?: (value: string) => void\n}\n\nconst RadioGroup = ({ onChange, ...rest }: MenuRadioGroupProps) => (\n <ArkMenu.RadioItemGroup\n onValueChange={onChange ? ({ value }) => onChange(value) : undefined}\n {...rest}\n />\n)\n\nexport type MenuRadioItemProps = ArkMenu.RadioItemProps &\n WithTestId & {\n startSection?: ReactNode\n color?: Color\n }\n\nconst RadioItem = ({\n startSection,\n color,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuRadioItemProps) => (\n <ArkMenu.RadioItem\n asChild={asChild}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSection != null && <StartSection>{startSection}</StartSection>}\n {own}\n <ArkMenu.ItemIndicator className={popoverIndicator}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"lucide lucide-dot-big\"\n aria-hidden=\"true\"\n >\n <title>Dot big</title>\n <circle cx=\"12.1\" cy=\"12.1\" r=\"4\"></circle>\n </svg>\n </ArkMenu.ItemIndicator>\n </>\n ))}\n </ArkMenu.RadioItem>\n)\n\nexport type MenuSubProps = Omit<ArkMenu.RootProps, \"positioning\"> & {\n /** Gap in px between the trigger row and the submenu. Ark manages submenu\n * *placement* itself (RTL-aware `right-start` / `left-start`, flush to the\n * parent), so only this main-axis gap is adjustable. Defaults to `10`. */\n offset?: number\n}\n\n/** A submenu opens flush to its trigger row, so its first item lands one surface\n * inset *below* the trigger — the `menuContent` top border (1px) + top padding\n * (`p-1` = 4px). Nudging the submenu up by that inset lines the first sub-item\n * up with the trigger row. Cross-axis is the vertical axis for the (Ark-forced)\n * `right-start` / `left-start` placements, and Floating UI maps a negative value\n * to \"up\" in both directions — so one constant covers LTR and RTL. */\nconst SUBMENU_ALIGN_OFFSET = -5\n\n/** Submenu root — a nested Ark Menu whose triggering row is `Menu.SubTrigger`.\n * Inherits the parent's portal settings via context (see `Menu.SubContent`).\n *\n * Ark's menu machine hard-overrides a submenu's placement and `gutter` (to `0`),\n * so a `gutter`-based offset is silently dropped. It leaves `offset` untouched,\n * and Floating UI resolves the axes as `offset.mainAxis ?? gutter` (the gap) and\n * `offset.crossAxis` (the top alignment) — so the whole `offset` object is the\n * one path that survives the override. */\nconst Sub = ({ offset = 10, children, ...rest }: MenuSubProps) => (\n <ArkMenu.Root\n positioning={{ offset: { mainAxis: offset, crossAxis: SUBMENU_ALIGN_OFFSET } }}\n navigate={clickLink}\n {...rest}\n >\n {children}\n </ArkMenu.Root>\n)\n\nexport type MenuSubTriggerProps = ArkMenu.TriggerItemProps &\n WithTestId & {\n startSection?: ReactNode\n color?: Color\n }\n\nconst SubTrigger = ({\n startSection,\n color,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuSubTriggerProps) => (\n <ArkMenu.TriggerItem\n asChild={asChild}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSection != null && <StartSection>{startSection}</StartSection>}\n {own}\n <span\n className={cn(popoverChevron, \"ms-auto -me-1 -rotate-90 rtl:rotate-90 [&_svg]:size-4\")}\n >\n <ChevronIcon />\n </span>\n </>\n ))}\n </ArkMenu.TriggerItem>\n)\n\nexport {\n CheckboxItem,\n Content,\n Divider,\n Item,\n ItemGroupLabel,\n Label,\n RadioGroup,\n RadioItem,\n Root,\n Sub,\n SubTrigger,\n}\n\nexport type MenuTriggerProps = ArkMenu.TriggerProps & { ref?: Ref<HTMLButtonElement> }\n\n/** Ark's `Menu.Trigger` minus one handler. Zag's trigger calls `preventDefault()`\n * on `pointerdown`, which cancels the browser's own mouse-down focus of the\n * button. With no pointer-initiated focus on record, Chromium treats every\n * later *programmatic* focus as keyboard-like: Zag's `focus()` on the content\n * when the menu opens, and its `focus()` back on the trigger when it closes,\n * both match `:focus-visible`, so a mouse user gets the keyboard ring on the\n * trigger after every menu interaction (#227).\n *\n * Leaving `pointerdown` alone restores the platform behaviour — the click\n * focuses the button without a ring, and the programmatic focuses that follow\n * inherit that. Keyboard users keep the ring, since a Tab/Enter/Escape still\n * marks the focus as keyboard-driven. It's also how Zag's own Popover trigger\n * behaves (it never cancels `pointerdown`). */\nexport const Trigger = ({ ref, value, className, ...rest }: MenuTriggerProps) => {\n const menu = useMenuContext()\n const presence = usePresenceContext()\n const { onPointerDown: _cancelsNativeFocus, ...trigger } = menu.getTriggerProps({ value })\n return (\n <ark.button\n {...mergeProps(\n {\n ...trigger,\n \"aria-controls\": presence.unmounted ? undefined : trigger[\"aria-controls\"],\n // The canceled `pointerdown` also blocked a native drag as a side\n // effect: an `asChild` `<a href>`, or the `<img>` of an avatar\n // trigger, would otherwise lift a drag ghost off the trigger.\n // Canceling `dragstart` instead leaves the press, and its focus, alone.\n onDragStart: (event: DragEvent) => event.preventDefault(),\n },\n // Same side effect for text: a double-click or drag on a non-button\n // trigger (`asChild` + `<span role=\"button\">`) would select its label.\n // CSS restores that. It lands on the `asChild` child too, and the\n // consumer's `className` comes last so it can override it.\n { ...rest, className: cn(\"select-none\", className) },\n )}\n ref={ref}\n />\n )\n}\n\n/** Ark parts re-exported unchanged (no styling needed). */\nexport const ContextTrigger = ArkMenu.ContextTrigger\nexport const ItemGroup = ArkMenu.ItemGroup\nexport const Context = ArkMenu.Context\n/** Alias for `Divider` (Ark's name for the same part). */\nexport const Separator = Divider\n/** Submenu dropdown — identical surface + portalling to `Menu.Content`. */\nexport const SubContent = Content\n"]}
@@ -1,10 +1,10 @@
1
1
  import { Spinner } from './chunk-NSDM3FEB.js';
2
+ import { withAsChildContent } from './chunk-I4SQQIP5.js';
2
3
  import { props } from './chunk-WYCMIIRR.js';
3
4
  import { focusStyles } from './chunk-B2LCHXUB.js';
4
5
  import { cn } from './chunk-QP4I37PA.js';
5
6
  import { ark } from '@ark-ui/react';
6
7
  import { cva } from 'class-variance-authority';
7
- import { isValidElement, cloneElement } from 'react';
8
8
  import { jsx } from 'react/jsx-runtime';
9
9
 
10
10
  var actionIconVariants = cva(
@@ -69,15 +69,6 @@ var preventWhileLoading = (event) => {
69
69
  event.preventDefault();
70
70
  event.stopPropagation();
71
71
  };
72
- var withAsChildLoading = (child, loading) => {
73
- if (!loading) return child;
74
- if (!isValidElement(child))
75
- return child;
76
- return cloneElement(child, {
77
- onClick: preventWhileLoading,
78
- children: /* @__PURE__ */ jsx(Spinner, { label: null })
79
- });
80
- };
81
72
  var ActionIcon = ({
82
73
  className,
83
74
  variant,
@@ -110,11 +101,13 @@ var ActionIcon = ({
110
101
  onClick: resolvedOnClick,
111
102
  ...props({ "data-testid": testId }),
112
103
  ...rest,
113
- children: asChild ? withAsChildLoading(children, loading) : loading ? /* @__PURE__ */ jsx(Spinner, { label: null }) : children
104
+ children: asChild && loading ? withAsChildContent(children, () => /* @__PURE__ */ jsx(Spinner, { label: null }), {
105
+ onClick: preventWhileLoading
106
+ }) : loading ? /* @__PURE__ */ jsx(Spinner, { label: null }) : children
114
107
  }
115
108
  );
116
109
  };
117
110
 
118
111
  export { ActionIcon };
119
- //# sourceMappingURL=chunk-VLUKI3HL.js.map
120
- //# sourceMappingURL=chunk-VLUKI3HL.js.map
112
+ //# sourceMappingURL=chunk-S7N4LGLZ.js.map
113
+ //# sourceMappingURL=chunk-S7N4LGLZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/action-icon/action-icon.tsx"],"names":[],"mappings":";;;;;;;;;AAuCA,IAAM,kBAAA,GAAqB,GAAA;AAAA,EACzB;AAAA,IACE,yCAAA;AAAA,IACA,oCAAA;AAAA,IACA,qCAAA;AAAA,IACA,cAAA;AAAA,IACA,+CAAA;AAAA,IACA,0BAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ,mEAAA;AAAA,IACA,4DAAA;AAAA,IACA,uCAAA;AAAA,IACA,sDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ;AAAA,UACN,oCAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,KAAA,EAAO;AAAA,UACL,uDAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,OAAA,EAAS;AAAA,UACP,mDAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,MAAA,EAAQ,CAAC,gCAAA,EAAkC,sCAAsC,CAAA;AAAA,QACjF,OAAA,EAAS;AAAA,UACP,yHAAA;AAAA,UACA;AAAA;AACF,OACF;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,4BAAA;AAAA,QACJ,EAAA,EAAI,8BAAA;AAAA,QACJ,EAAA,EAAI,4BAAA;AAAA,QACJ,EAAA,EAAI,6BAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACN;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,E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EAAO,IAAA,EAAM,CAAA,EAAI;AAAA,QAC3D,OAAA,EAAS;AAAA,OACV,CAAA,GACC,OAAA,uBACD,OAAA,EAAA,EAAQ,KAAA,EAAO,MAAM,CAAA,GAEtB;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-S7N4LGLZ.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { MouseEvent } from \"react\"\nimport { withAsChildContent } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Spinner } from \"../spinner/spinner\"\n\n/**\n * ActionIcon — square, icon-only sibling of `Button`.\n *\n * Same (variant × color) model as `Button`:\n * - `variant` picks the shape (filled / light / outline / subtle / default)\n * - `color` picks the palette (brand / gray / red / …)\n * - Color is delivered via `data-color` + the slot vars in `colors.css`,\n * so dark mode shade-shifts happen at the CSS layer.\n *\n * What's specific to ActionIcon:\n * - Forced 1:1 aspect ratio.\n * - Own `radius` scale (incl. `full` for circular FABs / like-buttons).\n * - Wider size scale (xs..xl) than Button — toolbar density matters here.\n *\n * The accessible name MUST come from `aria-label` (or `aria-labelledby`); the\n * icon children are decoration.\n *\n * `asChild` renders the single child with ActionIcon's styling. Ark's\n * factory clones exactly one element, so `loading`'s spinner replaces\n * *that* element's own children (`withAsChildContent`, `lib/as-child.ts`)\n * rather than the element itself. The `onClick` guard (`preventWhileLoading`)\n * goes on the same clone, since `disabled` doesn't do anything on an\n * arbitrary `asChild` element (e.g. an `<a>`) — same reason the `opacity-50`\n * dimming and `pointer-events-none` blocking are keyed off `data-loading`\n * rather than `:disabled` (see `Button`'s note on this).\n */\nconst actionIconVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"aspect-square shrink-0 select-none\",\n \"font-medium uppercase tracking-wide\",\n \"no-underline\",\n \"rounded-action-icon border border-transparent\",\n \"transition-colors-radius\",\n focusStyles(),\n \"disabled:not-data-loading:pointer-events-none disabled:opacity-50\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"not-data-loading:hover:cursor-pointer\",\n \"data-loading:cursor-progress data-loading:opacity-50\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n ],\n {\n variants: {\n variant: {\n filled: [\n \"bg-(--c-solid) text-(--c-on-solid)\",\n \"not-data-loading:hover:bg-(--c-solid-hover)\",\n ],\n light: [\n \"bg-(--c-soft) text-(--c-text) border-(--c-soft-hover)\",\n \"not-data-loading:hover:bg-(--c-soft-hover) not-data-loading:hover:border-(--c-solid)\",\n ],\n outline: [\n \"bg-transparent text-(--c-text) border-(--c-solid)\",\n \"not-data-loading:hover:bg-(--c-soft)\",\n ],\n subtle: [\"bg-transparent text-(--c-text)\", \"not-data-loading:hover:bg-(--c-soft)\"],\n default: [\n \"dark:bg-gray-light-50 dark:text-gray-light-900 dark:border-gray-light-400 dark:not-data-loading:hover:bg-gray-light-300\",\n \"bg-gray-dark-900 text-gray-dark-25 border-gray-dark-800 not-data-loading:hover:bg-gray-dark-800\",\n ],\n },\n size: {\n xs: \"h-7 text-xs [&_svg]:size-5\",\n sm: \"h-8 text-sm [&_svg]:size-5.5\",\n md: \"h-9 text-md [&_svg]:size-6\",\n lg: \"h-10 text-lg [&_svg]:size-7\",\n xl: \"h-12 text-xl [&_svg]:size-8\",\n },\n radius: {\n xs: \"rounded-xs\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n)\n\nexport type ActionIconVariant = NonNullable<VariantProps<typeof actionIconVariants>[\"variant\"]>\nexport type ActionIconSize = NonNullable<VariantProps<typeof actionIconVariants>[\"size\"]>\nexport type ActionIconRadius = NonNullable<VariantProps<typeof actionIconVariants>[\"radius\"]>\n\nexport type ActionIconProps = Omit<HTMLArkProps<\"button\">, \"color\"> &\n VariantProps<typeof actionIconVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /**\n * Replace the icon with a spinner, mark the element as busy, and suppress\n * pointer interactions. Mirrors `Button`'s `loading`.\n */\n loading?: boolean\n }\n\n/** Mirrors `Button`'s `preventWhileLoading` — see the note there. */\nconst preventWhileLoading = (event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n}\n\nexport const ActionIcon = ({\n className,\n variant,\n size,\n radius,\n color,\n loading = false,\n children,\n disabled,\n type,\n asChild,\n testId,\n onClick,\n ...rest\n}: ActionIconProps) => {\n const resolvedDisabled = disabled || loading\n const resolvedOnClick = loading ? preventWhileLoading : onClick\n\n return (\n <ark.button\n asChild={asChild}\n type={asChild ? type : (type ?? \"button\")}\n disabled={resolvedDisabled}\n aria-busy={loading || undefined}\n aria-disabled={resolvedDisabled || undefined}\n data-loading={loading || undefined}\n data-color={color}\n data-variant={variant ?? \"default\"}\n className={cn(actionIconVariants({ variant, size, radius }), className)}\n onClick={resolvedOnClick}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {asChild && loading ? (\n withAsChildContent(children, () => <Spinner label={null} />, {\n onClick: preventWhileLoading,\n })\n ) : loading ? (\n <Spinner label={null} />\n ) : (\n children\n )}\n </ark.button>\n )\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { calendarValueToDate, dateToCalendarValue, fromArkValues, toArkValues } from './chunk-TCWYBVIL.js';
2
- import { ActionIcon } from './chunk-VLUKI3HL.js';
2
+ import { ActionIcon } from './chunk-S7N4LGLZ.js';
3
3
  import { ChevronLeftIcon, ChevronRightIcon } from './chunk-IG7FBZVM.js';
4
4
  import { props } from './chunk-WYCMIIRR.js';
5
5
  import { focusStyles } from './chunk-B2LCHXUB.js';
@@ -101,7 +101,20 @@ var weekdayHeader = "pb-1 text-center text-xs font-medium text-gray-light-500 da
101
101
  var weekNumberCell = cn(
102
102
  "p-1 align-top text-center text-xs font-medium text-gray-light-500 dark:text-gray-dark-400 h-full"
103
103
  );
104
- var navIcon = (direction, size, className) => /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "neutral", size, className, children: direction === "prev" ? /* @__PURE__ */ jsx(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx(ChevronRightIcon, {}) });
104
+ var navIcon = (direction, size, className) => (
105
+ // The glyphs are physical; prev sits on the inline-start edge, which is the
106
+ // right one under RTL, so both chevrons mirror to keep pointing outward.
107
+ /* @__PURE__ */ jsx(
108
+ ActionIcon,
109
+ {
110
+ variant: "subtle",
111
+ color: "neutral",
112
+ size,
113
+ className: cn("rtl:[&_svg]:rotate-180", className),
114
+ children: direction === "prev" ? /* @__PURE__ */ jsx(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx(ChevronRightIcon, {})
115
+ }
116
+ )
117
+ );
105
118
  var NAV_ICON_SIZE = { xs: 28, sm: 32, md: 36, lg: 40, xl: 48 };
106
119
  var CalendarBody = ({
107
120
  numOfMonths = 1,
@@ -359,5 +372,5 @@ var Calendar = ({
359
372
  };
360
373
 
361
374
  export { Calendar, CalendarBody, calendarGridWidth, resolveCalendarTranslations };
362
- //# sourceMappingURL=chunk-TMMEJKLI.js.map
363
- //# sourceMappingURL=chunk-TMMEJKLI.js.map
375
+ //# sourceMappingURL=chunk-UHNRAI6V.js.map
376
+ //# sourceMappingURL=chunk-UHNRAI6V.js.map