@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 +1 @@
1
- {"version":3,"sources":["../src/components/button-select/button-select.tsx","../src/components/button-select/button-select-items.ts","../src/components/button-select/button-select-control.tsx"],"names":["Ark","props","jsx"],"mappings":";;;;;;;;;;;AAqDA,IAAM,2BAA2B,aAAA,CAAiC;AAAA,EAChE,OAAA,EAAS,OAAA;AAAA,EACT,eAAA,EAAiB,QAAA;AAAA,EACjB,IAAA,EAAM;AACR,CAAC,CAAA;AAUD,IAAM,WAAA,GACJ,yKAAA;AAsBF,IAAM,aAAa,CAAC,CAAA,EAAsB,CAAA,KACxC,CAAA,CAAE,WAAW,CAAA,CAAE,MAAA,IAAU,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,EAAG,CAAA,KAAM,CAAA,KAAM,CAAA,CAAE,CAAC,CAAC,CAAA;AAYvD,IAAM,iBAAA,GAAoB,CAAC,KAAA,KAAsC;AAC/D,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,KAAA,CAAM,aAAA,EAAe;AAC1C,EAAA,MAAM,QAAA,GAAW,MAAM,aAAA,CAAc,aAAA;AAAA,IACnC;AAAA,GACF;AACA,EAAA,IAAI,CAAC,QAAA,EAAU;AACf,EAAA,KAAA,CAAM,eAAA,EAAgB;AACtB,EAAA,QAAA,CAAS,KAAA,CAAM,EAAE,aAAA,EAAe,IAAA,EAAM,CAAA;AACxC,CAAA;AAWA,IAAM,eAAA,GAAkB,CAAC,IAAA,KAAkB,CAAC,KAAA,KAAyC;AACnF,EAAA,MAAM,OAAO,KAAA,CAAM,aAAA;AACnB,EAAA,IAAI,KAAK,GAAA,KAAQ,KAAA,IAAS,KAAK,YAAA,CAAa,kBAAkB,MAAM,YAAA,EAAc;AAClF,EAAA,IAAI,KAAA,CAAM,GAAA,KAAQ,WAAA,IAAe,KAAA,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AAA;AAAA,YACA,eAAA;AAAA,YACA,KAAA;AAAA,YACA,EAAA;AAAA,YACA,GAAA;AAAA,YACA,MAAA;AAAA,YACA,MAAA;AAAA,YACA,SAAA,EAAW,EAAA,CAAG,SAAA,EAAW,UAAA,EAAY,IAAI,CAAA;AAAA,YAExC,QAAA,EAAA,KAAA,CAAM,GAAA,CAAI,CAAC,IAAA,qBACVA,GAAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBAEC,OAAO,IAAA,CAAK,KAAA;AAAA,gBACZ,UAAU,IAAA,CAAK,QAAA;AAAA,gBACf,OAAO,IAAA,CAAK,KAAA;AAAA,gBACZ,WAAW,IAAA,CAAK,SAAA;AAAA,gBAChB,SAAS,IAAA,CAAK,OAAA;AAAA,gBACd,cAAY,IAAA,CAAK,SAAA;AAAA,gBACjB,QAAQ,IAAA,CAAK,MAAA;AAAA,gBACb,WAAW,UAAA,EAAY,IAAA;AAAA,gBAEtB,QAAA,EAAA,UAAA,GACG,WAAW,IAAA,EAAM;AAAA,kBACf,QAAA,EAAU,KAAA,CAAM,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,kBACnC,QAAA,EAAU,OAAA,CAAQ,QAAQ,CAAA,IAAK,IAAA,CAAK;AAAA,iBACrC,IACD,IAAA,CAAK;AAAA,eAAA;AAAA,cAfJ,IAAA,CAAK;AAAA,aAiBb;AAAA;AAAA,SACH;AAAA,wBACAA,GAAAA,CAAC,YAAA,EAAA,EAAa,IAAA,EAAY,OAAc,QAAA,EAAoB;AAAA;AAAA;AAAA,GAC9D;AAEJ","file":"chunk-SIG4DMNZ.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { ToggleGroup as Ark, useToggleGroupContext } from \"@ark-ui/react/toggle-group\"\nimport {\n Children,\n cloneElement,\n createContext,\n type FocusEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useContext,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from \"../button/button\"\nimport { buttonGroupVariants } from \"../button-group/button-group\"\nimport { fieldA11yProps } from \"../field/field\"\n\n/**\n * ButtonSelect / ButtonMultiSelect — compound parts.\n *\n * A row (or column) of real `Button`s joined like `ButtonGroup`, on Ark UI's\n * ToggleGroup machine. Every item renders through `Button` itself and only its\n * `variant` changes with the selection: unselected items take `variant`, the\n * selected ones `selectedVariant`. So the item styling — every variant × color,\n * sizes, `startSlot`/`endSlot`, hover, focus ring — has exactly one source, and\n * the join (flattened inner corners, collapsed hairlines, the hover/focus z-lift\n * and the filled/subtle seams) comes from `buttonGroupVariants` rather than a copy.\n *\n * Unlike `SegmentGroup` there is no sliding pill: a pill can't follow several\n * selected items at once, and the same parts back both the single and the\n * multiple form. The machine provides the semantics — `radiogroup` / `radio` +\n * `aria-checked` for single, `group` + `aria-pressed` for multiple — plus roving\n * focus with arrow keys and Home/End.\n *\n * `variant`, `selectedVariant` and `size` travel through a small context set once\n * on `Root`, so they aren't repeated on every `Item` (the Tabs pattern). `color`\n * is a plain `data-color` on `Root`, so it cascades to every item as CSS custom\n * properties; an item's own `color` re-stamps it on that one button.\n */\n\ntype StyleContextValue = {\n variant: ButtonVariant\n selectedVariant: ButtonVariant\n size: ButtonSize\n}\n\nconst ButtonSelectStyleContext = createContext<StyleContextValue>({\n variant: \"light\",\n selectedVariant: \"filled\",\n size: \"md\",\n})\n\n/**\n * The invalid cue is a ring on the whole group rather than red item borders: the\n * borderless `filled` / `subtle` items have no border to recolor, and the group\n * seams out-specify a per-item border anyway. A `ring` (box-shadow) is used, not\n * an `outline`, because the machine writes `outline: none` inline on the root.\n * `w-fit` keeps that ring hugging the items: inside `Field`'s flex column the\n * root would otherwise stretch to the field's full width.\n */\nconst invalidRing =\n \"w-fit rounded-button data-invalid:ring-1 data-invalid:ring-red-500 data-invalid:ring-offset-2 data-invalid:ring-offset-brand-50 dark:data-invalid:ring-offset-brand-950\"\n\ntype BaseRootProps = Omit<\n Ark.RootProps,\n \"color\" | \"multiple\" | \"value\" | \"defaultValue\" | \"onValueChange\" | \"deselectable\" | \"onChange\"\n> &\n WithTestId & {\n /** Palette for every item, as a `data-color` on the group. */\n color?: Color\n /** Treatment of the unselected items. */\n variant?: ButtonVariant\n /** Treatment of the selected items. */\n selectedVariant?: ButtonVariant\n size?: ButtonSize\n /** Red invalid ring around the group. */\n invalid?: boolean\n /** Lands on the group root, which forwards focus to its active item. Ark's\n * prop types carry no `ref`, so it is declared here. */\n ref?: Ref<HTMLDivElement>\n children?: ReactNode\n }\n\nconst sameValues = (a: readonly string[], b: readonly string[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * Tab entry for a single-choice group. Every item is `tabindex=-1` while focus is\n * outside, so Tab lands on the root, and zag then forwards focus to the *first*\n * item regardless of the selection. A radio group should land on the checked\n * radio instead, so in single mode the root's own focus is caught in the capture\n * phase and sent to the selected (enabled) item. `stopPropagation` there stops\n * the native event before React's bubble listener runs, which is what keeps\n * zag's `ROOT.FOCUS` (and its deferred focus-first) from firing. With nothing\n * selected, zag's own behaviour stands.\n */\nconst focusSelectedItem = (event: FocusEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return\n const selected = event.currentTarget.querySelector<HTMLElement>(\n ':scope > [data-state=\"on\"]:not([disabled])',\n )\n if (!selected) return\n event.stopPropagation()\n selected.focus({ preventScroll: true })\n}\n\n/**\n * RTL arrow keys. zag's toggle-group reads `event.key` without passing `dir` to\n * `getEventKey` (its other machines do), so in a right-to-left locale ArrowLeft\n * moves focus visually *right*. In a horizontal RTL group the two keys are\n * caught in the capture phase, before zag's handler, and focus moves to the\n * visually adjacent enabled item instead; zag then picks up the new focus\n * through the item's own `onFocus`. `dir` is read off the root, where the\n * machine writes the locale's direction.\n */\nconst mirrorRtlArrows = (loop: boolean) => (event: KeyboardEvent<HTMLDivElement>) => {\n const root = event.currentTarget\n if (root.dir !== \"rtl\" || root.getAttribute(\"data-orientation\") !== \"horizontal\") return\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n const items = Array.from(\n root.querySelectorAll<HTMLElement>(':scope > [data-part=\"item\"]:not([disabled])'),\n )\n const index = items.indexOf(event.target as HTMLElement)\n if (index === -1) return\n event.preventDefault()\n event.stopPropagation()\n // Visually left is the next item in RTL, visually right the previous one.\n const step = event.key === \"ArrowLeft\" ? 1 : -1\n const next = loop\n ? items[(index + step + items.length) % items.length]\n : items[Math.min(Math.max(index + step, 0), items.length - 1)]\n next?.focus()\n}\n\n/** The shared root behind both `ButtonSelect.Root` and `ButtonMultiSelect.Root`. */\nexport const RootBase = ({\n multiple,\n value,\n defaultValue,\n onValueChange,\n deselectable,\n orientation = \"horizontal\",\n color,\n variant = \"light\",\n selectedVariant = \"filled\",\n size = \"md\",\n invalid,\n loopFocus = true,\n className,\n testId,\n children,\n ...rest\n}: BaseRootProps & {\n multiple: boolean\n value?: string[]\n defaultValue?: string[]\n onValueChange?: (value: string[]) => void\n deselectable?: boolean\n}) => {\n const field = useFieldContext()\n // Owned here so a change can be compared with the current value: in a\n // non-deselectable single group the machine re-emits the same value when the\n // selected item is clicked again, and that is not a change.\n const [selected, setSelected] = useUncontrolled<string[]>({\n value,\n defaultValue,\n finalValue: [],\n onChange: onValueChange,\n })\n return (\n <ButtonSelectStyleContext.Provider value={{ variant, selectedVariant, size }}>\n <Ark.Root\n multiple={multiple}\n value={selected}\n onValueChange={(details) => {\n if (!sameValues(details.value, selected)) setSelected(details.value)\n }}\n deselectable={deselectable}\n orientation={orientation}\n loopFocus={loopFocus}\n onFocusCapture={multiple ? undefined : focusSelectedItem}\n onKeyDownCapture={mirrorRtlArrows(loopFocus)}\n data-color={color}\n aria-invalid={invalid || undefined}\n {...props({ \"data-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={cn(buttonGroupVariants({ orientation }), invalidRing, className)}\n {...rest}\n >\n {children}\n </Ark.Root>\n </ButtonSelectStyleContext.Provider>\n )\n}\n\nexport type ButtonSelectRootProps = BaseRootProps & {\n /** Controlled value. `null` clears the selection. */\n value?: string | null\n /** Uncontrolled initial value. */\n defaultValue?: string | null\n /** Fires with the newly selected value — `null` only when `deselectable`. */\n onChange?: (value: string | null) => void\n /** Clicking the selected item clears the selection. Off by default, so the\n * group behaves like a radio group. */\n deselectable?: boolean\n}\n\nconst toArray = (value: string | null | undefined) =>\n value === undefined ? undefined : value === null ? [] : [value]\n\n/** Single-choice root: one selected item at most. */\nexport const Root = ({\n value,\n defaultValue,\n onChange,\n deselectable = false,\n ...rest\n}: ButtonSelectRootProps) => (\n <RootBase\n multiple={false}\n value={toArray(value)}\n defaultValue={toArray(defaultValue)}\n onValueChange={(next) => onChange?.(next[0] ?? null)}\n deselectable={deselectable}\n {...rest}\n />\n)\n\nexport type ButtonMultiSelectRootProps = BaseRootProps & {\n /** Controlled value. */\n value?: string[]\n /** Uncontrolled initial value. */\n defaultValue?: string[]\n /** Fires with every selected value, in selection order. */\n onChange?: (value: string[]) => void\n}\n\n/** Multiple-choice root: each item toggles independently. */\nexport const MultiRoot = ({ onChange, ...rest }: ButtonMultiSelectRootProps) => (\n <RootBase multiple onValueChange={onChange} {...rest} />\n)\n\n/** The props `Item` hands a custom control under `asChild`. */\ntype SelectableControlProps = { variant?: ButtonVariant; size?: ButtonSize }\n\nexport type ButtonSelectItemProps =\n | (Omit<ButtonProps, \"value\" | \"variant\" | \"size\" | \"loading\" | \"asChild\"> & {\n /** The value this item selects. */\n value: string\n asChild?: false\n })\n | {\n /** The value this item selects. */\n value: string\n disabled?: boolean\n /**\n * Render your own variant-aware control instead of a `Button` — e.g. an\n * `ActionIcon` for an icon-only toolbar. The single child receives the\n * selection-driven `variant` and the group `size` (its own `size` wins),\n * plus the machine's item props.\n */\n asChild: true\n children: ReactElement<SelectableControlProps>\n }\n\n/**\n * One option, rendered as a `Button`. Its `variant` follows the selection (from\n * `Root`'s `variant` / `selectedVariant`); every other `Button` prop — `color`,\n * `startSlot`, `endSlot`, `aria-label` for an icon-only item, `testId` — passes\n * through. The machine's item props land on the button via Ark's `asChild`.\n *\n * With `asChild`, the single child is rendered in place of the `Button` and\n * cloned with the same `variant` / `size`, so any control speaking the kit's\n * variant × size vocabulary (`ActionIcon`, a consumer's own) can be an item.\n */\nexport const Item = (props: ButtonSelectItemProps) => {\n const { variant, selectedVariant, size } = useContext(ButtonSelectStyleContext)\n const { value, disabled } = props\n const { pressed } = useToggleGroupContext().getItemState({ value, disabled })\n const resolvedVariant = pressed ? selectedVariant : variant\n if (props.asChild) {\n const child = Children.only(props.children)\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n {cloneElement(child, { variant: resolvedVariant, size: child.props.size ?? size })}\n </Ark.Item>\n )\n }\n const { value: _value, disabled: _disabled, asChild: _asChild, ...rest } = props\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n <Button variant={resolvedVariant} size={size} {...rest} />\n </Ark.Item>\n )\n}\n\n/**\n * One hidden input per selected value, so a native `<form>` submit carries the\n * selection under `name`. Rendered *beside* the root, never inside it: the join\n * selectors target the root's children by `:first-child` / `:last-child`, which a\n * trailing input would throw off.\n */\nexport const HiddenInputs = ({\n name,\n value,\n disabled,\n}: {\n name?: string\n value: readonly string[]\n disabled?: boolean\n}) =>\n name == null\n ? null\n : value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} disabled={disabled} />)\n\nexport const Context = Ark.Context\n","import type { ReactNode } from \"react\"\nimport type { Color } from \"../../lib/colors\"\n\n/**\n * One option of a data-driven `ButtonSelect` / `ButtonMultiSelect`: a bare\n * value-as-label string, or a labelled object. `payload` is arbitrary data the\n * machine ignores; it reaches `renderItem` typed off the `data` shape — the same\n * contract as `SegmentGroup` and `Select`.\n */\nexport type ButtonSelectItem<P = unknown> =\n | string\n | {\n value: string\n label?: ReactNode\n /** Content before the label, e.g. an icon (Button's `startSlot`). */\n startSlot?: ReactNode\n /** Content after the label (Button's `endSlot`). */\n endSlot?: ReactNode\n disabled?: boolean\n /** Overrides the group palette for this item. */\n color?: Color\n /** Accessible name — required when `label` is an icon only. */\n \"aria-label\"?: string\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered button. Defaults to `` `item-${value}` ``. */\n testId?: string\n }\n\n/** The `data` array both components are generic over. */\nexport type ButtonSelectData<P = unknown> = ReadonlyArray<ButtonSelectItem<P>>\n\n/** The value-string union of a `ButtonSelectData` shape; a `const` type\n * parameter narrows it to the literal union. */\nexport type ButtonSelectValue<Data extends ButtonSelectData> = ItemValue<Data[number]>\ntype ItemValue<E> = E extends string ? E : E extends { value: infer V extends string } ? V : never\n\n/** The `payload` type carried by a `ButtonSelectData` shape. */\nexport type ButtonSelectPayload<Data extends ButtonSelectData> = PayloadOf<Data[number]>\ntype PayloadOf<T> = T extends string ? never : T extends { payload?: infer P } ? P : never\n\n/** The item handed to `renderItem`, narrowed to the data's value and payload. */\nexport type RenderableButtonSelectItem<Data extends ButtonSelectData> = {\n value: ButtonSelectValue<Data>\n label: ReactNode\n disabled: boolean\n color: Color | undefined\n payload: ButtonSelectPayload<Data> | undefined\n}\n\n/** Live item state passed alongside the item to `renderItem`. */\nexport type ButtonSelectItemState = {\n selected: boolean\n disabled: boolean\n}\n\n/**\n * Render an item's label yourself. The item keeps its button, sizing, variant\n * and selection wiring; you fill its content. In an RSC tree the function must\n * live in a `\"use client\"` module.\n */\nexport type RenderButtonSelectItem<Data extends ButtonSelectData> = (\n item: RenderableButtonSelectItem<Data>,\n state: ButtonSelectItemState,\n) => ReactNode\n\n/** A fully resolved item — every field present (`label` falls back to `value`). */\nexport type NormalizedButtonSelectItem = {\n value: string\n label: ReactNode\n startSlot: ReactNode\n endSlot: ReactNode\n disabled: boolean\n color: Color | undefined\n ariaLabel: string | undefined\n payload: unknown\n testId: string\n}\n\nexport const normalizeButtonSelectItem = (item: ButtonSelectItem): NormalizedButtonSelectItem =>\n typeof item === \"string\"\n ? {\n value: item,\n label: item,\n startSlot: undefined,\n endSlot: undefined,\n disabled: false,\n color: undefined,\n ariaLabel: undefined,\n payload: undefined,\n testId: `item-${item}`,\n }\n : {\n value: item.value,\n label: item.label ?? item.value,\n startSlot: item.startSlot,\n endSlot: item.endSlot,\n disabled: item.disabled ?? false,\n color: item.color,\n ariaLabel: item[\"aria-label\"],\n payload: item.payload,\n testId: item.testId ?? `item-${item.value}`,\n }\n","\"use client\"\n\nimport type { FocusEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport type { ButtonSize, ButtonVariant } from \"../button/button\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport { HiddenInputs, Item, RootBase } from \"./button-select\"\nimport {\n type ButtonSelectData,\n normalizeButtonSelectItem,\n type RenderButtonSelectItem,\n} from \"./button-select-items\"\n\ntype ButtonSelectClassNames = {\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it. */\n label?: string\n root?: string\n item?: string\n}\n\n/** Props shared by the data-driven `ButtonSelect` and `ButtonMultiSelect`. */\nexport type ButtonSelectBaseProps<Data extends ButtonSelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Items: bare strings (`value === label`) or `{ value, label?, startSlot?, … }`. */\n data: Data\n /** Render each item's content yourself, with its typed `payload`. */\n renderItem?: RenderButtonSelectItem<Data>\n /** Lay the items in a row (default) or a column. */\n orientation?: \"horizontal\" | \"vertical\"\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Dims and blocks every item. */\n disabled?: boolean\n size?: ButtonSize\n /** Treatment of the unselected items. Defaults to `light`. */\n variant?: ButtonVariant\n /** Treatment of the selected items. Defaults to `filled`. */\n selectedVariant?: ButtonVariant\n color?: Color\n /** Renders a hidden input per selected value for native form submission. */\n name?: string\n /** Explicit id for the group root. */\n id?: string\n /** Lands on the group root, which forwards focus to its active item. */\n ref?: Ref<HTMLDivElement>\n /** Forwarded to the root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n className?: string\n classNames?: ButtonSelectClassNames\n }\n\n/**\n * The rendering both data forms share: the `Field` wrapper, the group root, one\n * `Item` per entry and the hidden inputs. The public components only adapt their\n * value shape (`V | null` or `V[]`) onto the machine's `string[]`.\n */\nexport const ButtonSelectControl = ({\n multiple,\n deselectable,\n value,\n onValueChange,\n data,\n renderItem,\n orientation,\n invalid,\n disabled,\n required,\n size = \"md\",\n variant,\n selectedVariant,\n color,\n name,\n id,\n ref,\n onBlur,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: ButtonSelectBaseProps<ButtonSelectData> & {\n multiple: boolean\n deselectable?: boolean\n value: readonly string[]\n onValueChange: (value: string[]) => void\n}) => {\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n const items = data.map(normalizeButtonSelectItem)\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n classNames={{ label: classNames?.label }}\n >\n <RootBase\n multiple={multiple}\n deselectable={deselectable}\n value={[...value]}\n onValueChange={onValueChange}\n orientation={orientation}\n disabled={disabled}\n invalid={isInvalid}\n size={size}\n variant={variant}\n selectedVariant={selectedVariant}\n color={color}\n id={id}\n ref={ref}\n onBlur={onBlur}\n testId={testId}\n className={cn(className, classNames?.root)}\n >\n {items.map((item) => (\n <Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n color={item.color}\n startSlot={item.startSlot}\n endSlot={item.endSlot}\n aria-label={item.ariaLabel}\n testId={item.testId}\n className={classNames?.item}\n >\n {renderItem\n ? renderItem(item, {\n selected: value.includes(item.value),\n disabled: Boolean(disabled) || item.disabled,\n })\n : item.label}\n </Item>\n ))}\n </RootBase>\n <HiddenInputs name={name} value={value} disabled={disabled} />\n </FieldShell>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/button-select/button-select.tsx","../src/components/button-select/button-select-items.ts","../src/components/button-select/button-select-control.tsx"],"names":["Ark","props","jsx"],"mappings":";;;;;;;;;;;AAqDA,IAAM,2BAA2B,aAAA,CAAiC;AAAA,EAChE,OAAA,EAAS,OAAA;AAAA,EACT,eAAA,EAAiB,QAAA;AAAA,EACjB,IAAA,EAAM;AACR,CAAC,CAAA;AAUD,IAAM,WAAA,GACJ,yKAAA;AAsBF,IAAM,aAAa,CAAC,CAAA,EAAsB,CAAA,KACxC,CAAA,CAAE,WAAW,CAAA,CAAE,MAAA,IAAU,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,EAAG,CAAA,KAAM,CAAA,KAAM,CAAA,CAAE,CAAC,CAAC,CAAA;AAYvD,IAAM,iBAAA,GAAoB,CAAC,KAAA,KAAsC;AAC/D,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,KAAA,CAAM,aAAA,EAAe;AAC1C,EAAA,MAAM,QAAA,GAAW,MAAM,aAAA,CAAc,aAAA;AAAA,IACnC;AAAA,GACF;AACA,EAAA,IAAI,CAAC,QAAA,EAAU;AACf,EAAA,KAAA,CAAM,eAAA,EAAgB;AACtB,EAAA,QAAA,CAAS,KAAA,CAAM,EAAE,aAAA,EAAe,IAAA,EAAM,CAAA;AACxC,CAAA;AAWA,IAAM,eAAA,GAAkB,CAAC,IAAA,KAAkB,CAAC,KAAA,KAAyC;AACnF,EAAA,MAAM,OAAO,KAAA,CAAM,aAAA;AACnB,EAAA,IAAI,KAAK,GAAA,KAAQ,KAAA,IAAS,KAAK,YAAA,CAAa,kBAAkB,MAAM,YAAA,EAAc;AAClF,EAAA,IAAI,KAAA,CAAM,GAAA,KAAQ,WAAA,IAAe,KAAA,CAAM,QAAQ,YAAA,EAAc;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A,YACA,KAAA;AAAA,YACA,EAAA;AAAA,YACA,GAAA;AAAA,YACA,MAAA;AAAA,YACA,MAAA;AAAA,YACA,SAAA,EAAW,EAAA,CAAG,SAAA,EAAW,UAAA,EAAY,IAAI,CAAA;AAAA,YAExC,QAAA,EAAA,KAAA,CAAM,GAAA,CAAI,CAAC,IAAA,qBACVA,GAAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBAEC,OAAO,IAAA,CAAK,KAAA;AAAA,gBACZ,UAAU,IAAA,CAAK,QAAA;AAAA,gBACf,OAAO,IAAA,CAAK,KAAA;AAAA,gBACZ,WAAW,IAAA,CAAK,SAAA;AAAA,gBAChB,SAAS,IAAA,CAAK,OAAA;AAAA,gBACd,cAAY,IAAA,CAAK,SAAA;AAAA,gBACjB,QAAQ,IAAA,CAAK,MAAA;AAAA,gBACb,WAAW,UAAA,EAAY,IAAA;AAAA,gBAEtB,QAAA,EAAA,UAAA,GACG,WAAW,IAAA,EAAM;AAAA,kBACf,QAAA,EAAU,KAAA,CAAM,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,kBACnC,QAAA,EAAU,OAAA,CAAQ,QAAQ,CAAA,IAAK,IAAA,CAAK;AAAA,iBACrC,IACD,IAAA,CAAK;AAAA,eAAA;AAAA,cAfJ,IAAA,CAAK;AAAA,aAiBb;AAAA;AAAA,SACH;AAAA,wBACAA,GAAAA,CAAC,YAAA,EAAA,EAAa,IAAA,EAAY,OAAc,QAAA,EAAoB;AAAA;AAAA;AAAA,GAC9D;AAEJ","file":"chunk-MI2WZRK3.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { ToggleGroup as Ark, useToggleGroupContext } from \"@ark-ui/react/toggle-group\"\nimport {\n Children,\n cloneElement,\n createContext,\n type FocusEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useContext,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from \"../button/button\"\nimport { buttonGroupVariants } from \"../button-group/button-group\"\nimport { fieldA11yProps } from \"../field/field\"\n\n/**\n * ButtonSelect / ButtonMultiSelect — compound parts.\n *\n * A row (or column) of real `Button`s joined like `ButtonGroup`, on Ark UI's\n * ToggleGroup machine. Every item renders through `Button` itself and only its\n * `variant` changes with the selection: unselected items take `variant`, the\n * selected ones `selectedVariant`. So the item styling — every variant × color,\n * sizes, `startSlot`/`endSlot`, hover, focus ring — has exactly one source, and\n * the join (flattened inner corners, collapsed hairlines, the hover/focus z-lift\n * and the filled/subtle seams) comes from `buttonGroupVariants` rather than a copy.\n *\n * Unlike `SegmentGroup` there is no sliding pill: a pill can't follow several\n * selected items at once, and the same parts back both the single and the\n * multiple form. The machine provides the semantics — `radiogroup` / `radio` +\n * `aria-checked` for single, `group` + `aria-pressed` for multiple — plus roving\n * focus with arrow keys and Home/End.\n *\n * `variant`, `selectedVariant` and `size` travel through a small context set once\n * on `Root`, so they aren't repeated on every `Item` (the Tabs pattern). `color`\n * is a plain `data-color` on `Root`, so it cascades to every item as CSS custom\n * properties; an item's own `color` re-stamps it on that one button.\n */\n\ntype StyleContextValue = {\n variant: ButtonVariant\n selectedVariant: ButtonVariant\n size: ButtonSize\n}\n\nconst ButtonSelectStyleContext = createContext<StyleContextValue>({\n variant: \"light\",\n selectedVariant: \"filled\",\n size: \"md\",\n})\n\n/**\n * The invalid cue is a ring on the whole group rather than red item borders: the\n * borderless `filled` / `subtle` items have no border to recolor, and the group\n * seams out-specify a per-item border anyway. A `ring` (box-shadow) is used, not\n * an `outline`, because the machine writes `outline: none` inline on the root.\n * `w-fit` keeps that ring hugging the items: inside `Field`'s flex column the\n * root would otherwise stretch to the field's full width.\n */\nconst invalidRing =\n \"w-fit rounded-button data-invalid:ring-1 data-invalid:ring-red-500 data-invalid:ring-offset-2 data-invalid:ring-offset-brand-50 dark:data-invalid:ring-offset-brand-950\"\n\ntype BaseRootProps = Omit<\n Ark.RootProps,\n \"color\" | \"multiple\" | \"value\" | \"defaultValue\" | \"onValueChange\" | \"deselectable\" | \"onChange\"\n> &\n WithTestId & {\n /** Palette for every item, as a `data-color` on the group. */\n color?: Color\n /** Treatment of the unselected items. */\n variant?: ButtonVariant\n /** Treatment of the selected items. */\n selectedVariant?: ButtonVariant\n size?: ButtonSize\n /** Red invalid ring around the group. */\n invalid?: boolean\n /** Lands on the group root, which forwards focus to its active item. Ark's\n * prop types carry no `ref`, so it is declared here. */\n ref?: Ref<HTMLDivElement>\n children?: ReactNode\n }\n\nconst sameValues = (a: readonly string[], b: readonly string[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * Tab entry for a single-choice group. Every item is `tabindex=-1` while focus is\n * outside, so Tab lands on the root, and zag then forwards focus to the *first*\n * item regardless of the selection. A radio group should land on the checked\n * radio instead, so in single mode the root's own focus is caught in the capture\n * phase and sent to the selected (enabled) item. `stopPropagation` there stops\n * the native event before React's bubble listener runs, which is what keeps\n * zag's `ROOT.FOCUS` (and its deferred focus-first) from firing. With nothing\n * selected, zag's own behaviour stands.\n */\nconst focusSelectedItem = (event: FocusEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return\n const selected = event.currentTarget.querySelector<HTMLElement>(\n ':scope > [data-state=\"on\"]:not([disabled])',\n )\n if (!selected) return\n event.stopPropagation()\n selected.focus({ preventScroll: true })\n}\n\n/**\n * RTL arrow keys. zag's toggle-group reads `event.key` without passing `dir` to\n * `getEventKey` (its other machines do), so in a right-to-left locale ArrowLeft\n * moves focus visually *right*. In a horizontal RTL group the two keys are\n * caught in the capture phase, before zag's handler, and focus moves to the\n * visually adjacent enabled item instead; zag then picks up the new focus\n * through the item's own `onFocus`. `dir` is read off the root, where the\n * machine writes the locale's direction.\n */\nconst mirrorRtlArrows = (loop: boolean) => (event: KeyboardEvent<HTMLDivElement>) => {\n const root = event.currentTarget\n if (root.dir !== \"rtl\" || root.getAttribute(\"data-orientation\") !== \"horizontal\") return\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n const items = Array.from(\n root.querySelectorAll<HTMLElement>(':scope > [data-part=\"item\"]:not([disabled])'),\n )\n const index = items.indexOf(event.target as HTMLElement)\n if (index === -1) return\n event.preventDefault()\n event.stopPropagation()\n // Visually left is the next item in RTL, visually right the previous one.\n const step = event.key === \"ArrowLeft\" ? 1 : -1\n const next = loop\n ? items[(index + step + items.length) % items.length]\n : items[Math.min(Math.max(index + step, 0), items.length - 1)]\n next?.focus()\n}\n\n/** The shared root behind both `ButtonSelect.Root` and `ButtonMultiSelect.Root`. */\nexport const RootBase = ({\n multiple,\n value,\n defaultValue,\n onValueChange,\n deselectable,\n orientation = \"horizontal\",\n color,\n variant = \"light\",\n selectedVariant = \"filled\",\n size = \"md\",\n invalid,\n loopFocus = true,\n className,\n testId,\n children,\n ...rest\n}: BaseRootProps & {\n multiple: boolean\n value?: string[]\n defaultValue?: string[]\n onValueChange?: (value: string[]) => void\n deselectable?: boolean\n}) => {\n const field = useFieldContext()\n // Owned here so a change can be compared with the current value: in a\n // non-deselectable single group the machine re-emits the same value when the\n // selected item is clicked again, and that is not a change.\n const [selected, setSelected] = useUncontrolled<string[]>({\n value,\n defaultValue,\n finalValue: [],\n onChange: onValueChange,\n })\n return (\n <ButtonSelectStyleContext.Provider value={{ variant, selectedVariant, size }}>\n <Ark.Root\n multiple={multiple}\n value={selected}\n onValueChange={(details) => {\n if (!sameValues(details.value, selected)) setSelected(details.value)\n }}\n deselectable={deselectable}\n orientation={orientation}\n loopFocus={loopFocus}\n onFocusCapture={multiple ? undefined : focusSelectedItem}\n onKeyDownCapture={mirrorRtlArrows(loopFocus)}\n data-color={color}\n aria-invalid={invalid || undefined}\n {...props({ \"data-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={cn(buttonGroupVariants({ orientation }), invalidRing, className)}\n {...rest}\n >\n {children}\n </Ark.Root>\n </ButtonSelectStyleContext.Provider>\n )\n}\n\nexport type ButtonSelectRootProps = BaseRootProps & {\n /** Controlled value. `null` clears the selection. */\n value?: string | null\n /** Uncontrolled initial value. */\n defaultValue?: string | null\n /** Fires with the newly selected value — `null` only when `deselectable`. */\n onChange?: (value: string | null) => void\n /** Clicking the selected item clears the selection. Off by default, so the\n * group behaves like a radio group. */\n deselectable?: boolean\n}\n\nconst toArray = (value: string | null | undefined) =>\n value === undefined ? undefined : value === null ? [] : [value]\n\n/** Single-choice root: one selected item at most. */\nexport const Root = ({\n value,\n defaultValue,\n onChange,\n deselectable = false,\n ...rest\n}: ButtonSelectRootProps) => (\n <RootBase\n multiple={false}\n value={toArray(value)}\n defaultValue={toArray(defaultValue)}\n onValueChange={(next) => onChange?.(next[0] ?? null)}\n deselectable={deselectable}\n {...rest}\n />\n)\n\nexport type ButtonMultiSelectRootProps = BaseRootProps & {\n /** Controlled value. */\n value?: string[]\n /** Uncontrolled initial value. */\n defaultValue?: string[]\n /** Fires with every selected value, in selection order. */\n onChange?: (value: string[]) => void\n}\n\n/** Multiple-choice root: each item toggles independently. */\nexport const MultiRoot = ({ onChange, ...rest }: ButtonMultiSelectRootProps) => (\n <RootBase multiple onValueChange={onChange} {...rest} />\n)\n\n/** The props `Item` hands a custom control under `asChild`. */\ntype SelectableControlProps = { variant?: ButtonVariant; size?: ButtonSize }\n\nexport type ButtonSelectItemProps =\n | (Omit<ButtonProps, \"value\" | \"variant\" | \"size\" | \"loading\" | \"asChild\"> & {\n /** The value this item selects. */\n value: string\n asChild?: false\n })\n | {\n /** The value this item selects. */\n value: string\n disabled?: boolean\n /**\n * Render your own variant-aware control instead of a `Button` — e.g. an\n * `ActionIcon` for an icon-only toolbar. The single child receives the\n * selection-driven `variant` and the group `size` (its own `size` wins),\n * plus the machine's item props.\n */\n asChild: true\n children: ReactElement<SelectableControlProps>\n }\n\n/**\n * One option, rendered as a `Button`. Its `variant` follows the selection (from\n * `Root`'s `variant` / `selectedVariant`); every other `Button` prop — `color`,\n * `startSlot`, `endSlot`, `aria-label` for an icon-only item, `testId` — passes\n * through. The machine's item props land on the button via Ark's `asChild`.\n *\n * With `asChild`, the single child is rendered in place of the `Button` and\n * cloned with the same `variant` / `size`, so any control speaking the kit's\n * variant × size vocabulary (`ActionIcon`, a consumer's own) can be an item.\n */\nexport const Item = (props: ButtonSelectItemProps) => {\n const { variant, selectedVariant, size } = useContext(ButtonSelectStyleContext)\n const { value, disabled } = props\n const { pressed } = useToggleGroupContext().getItemState({ value, disabled })\n const resolvedVariant = pressed ? selectedVariant : variant\n if (props.asChild) {\n const child = Children.only(props.children)\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n {cloneElement(child, { variant: resolvedVariant, size: child.props.size ?? size })}\n </Ark.Item>\n )\n }\n const { value: _value, disabled: _disabled, asChild: _asChild, ...rest } = props\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n <Button variant={resolvedVariant} size={size} {...rest} />\n </Ark.Item>\n )\n}\n\n/**\n * One hidden input per selected value, so a native `<form>` submit carries the\n * selection under `name`. Rendered *beside* the root, never inside it: the join\n * selectors target the root's children by `:first-child` / `:last-child`, which a\n * trailing input would throw off.\n */\nexport const HiddenInputs = ({\n name,\n value,\n disabled,\n}: {\n name?: string\n value: readonly string[]\n disabled?: boolean\n}) =>\n name == null\n ? null\n : value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} disabled={disabled} />)\n\nexport const Context = Ark.Context\n","import type { ReactNode } from \"react\"\nimport type { Color } from \"../../lib/colors\"\n\n/**\n * One option of a data-driven `ButtonSelect` / `ButtonMultiSelect`: a bare\n * value-as-label string, or a labelled object. `payload` is arbitrary data the\n * machine ignores; it reaches `renderItem` typed off the `data` shape — the same\n * contract as `SegmentGroup` and `Select`.\n */\nexport type ButtonSelectItem<P = unknown> =\n | string\n | {\n value: string\n label?: ReactNode\n /** Content before the label, e.g. an icon (Button's `startSlot`). */\n startSlot?: ReactNode\n /** Content after the label (Button's `endSlot`). */\n endSlot?: ReactNode\n disabled?: boolean\n /** Overrides the group palette for this item. */\n color?: Color\n /** Accessible name — required when `label` is an icon only. */\n \"aria-label\"?: string\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered button. Defaults to `` `item-${value}` ``. */\n testId?: string\n }\n\n/** The `data` array both components are generic over. */\nexport type ButtonSelectData<P = unknown> = ReadonlyArray<ButtonSelectItem<P>>\n\n/** The value-string union of a `ButtonSelectData` shape; a `const` type\n * parameter narrows it to the literal union. */\nexport type ButtonSelectValue<Data extends ButtonSelectData> = ItemValue<Data[number]>\ntype ItemValue<E> = E extends string ? E : E extends { value: infer V extends string } ? V : never\n\n/** The `payload` type carried by a `ButtonSelectData` shape. */\nexport type ButtonSelectPayload<Data extends ButtonSelectData> = PayloadOf<Data[number]>\ntype PayloadOf<T> = T extends string ? never : T extends { payload?: infer P } ? P : never\n\n/** The item handed to `renderItem`, narrowed to the data's value and payload. */\nexport type RenderableButtonSelectItem<Data extends ButtonSelectData> = {\n value: ButtonSelectValue<Data>\n label: ReactNode\n disabled: boolean\n color: Color | undefined\n payload: ButtonSelectPayload<Data> | undefined\n}\n\n/** Live item state passed alongside the item to `renderItem`. */\nexport type ButtonSelectItemState = {\n selected: boolean\n disabled: boolean\n}\n\n/**\n * Render an item's label yourself. The item keeps its button, sizing, variant\n * and selection wiring; you fill its content. In an RSC tree the function must\n * live in a `\"use client\"` module.\n */\nexport type RenderButtonSelectItem<Data extends ButtonSelectData> = (\n item: RenderableButtonSelectItem<Data>,\n state: ButtonSelectItemState,\n) => ReactNode\n\n/** A fully resolved item — every field present (`label` falls back to `value`). */\nexport type NormalizedButtonSelectItem = {\n value: string\n label: ReactNode\n startSlot: ReactNode\n endSlot: ReactNode\n disabled: boolean\n color: Color | undefined\n ariaLabel: string | undefined\n payload: unknown\n testId: string\n}\n\nexport const normalizeButtonSelectItem = (item: ButtonSelectItem): NormalizedButtonSelectItem =>\n typeof item === \"string\"\n ? {\n value: item,\n label: item,\n startSlot: undefined,\n endSlot: undefined,\n disabled: false,\n color: undefined,\n ariaLabel: undefined,\n payload: undefined,\n testId: `item-${item}`,\n }\n : {\n value: item.value,\n label: item.label ?? item.value,\n startSlot: item.startSlot,\n endSlot: item.endSlot,\n disabled: item.disabled ?? false,\n color: item.color,\n ariaLabel: item[\"aria-label\"],\n payload: item.payload,\n testId: item.testId ?? `item-${item.value}`,\n }\n","\"use client\"\n\nimport type { FocusEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport type { ButtonSize, ButtonVariant } from \"../button/button\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport { HiddenInputs, Item, RootBase } from \"./button-select\"\nimport {\n type ButtonSelectData,\n normalizeButtonSelectItem,\n type RenderButtonSelectItem,\n} from \"./button-select-items\"\n\ntype ButtonSelectClassNames = {\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it. */\n label?: string\n root?: string\n item?: string\n}\n\n/** Props shared by the data-driven `ButtonSelect` and `ButtonMultiSelect`. */\nexport type ButtonSelectBaseProps<Data extends ButtonSelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Items: bare strings (`value === label`) or `{ value, label?, startSlot?, … }`. */\n data: Data\n /** Render each item's content yourself, with its typed `payload`. */\n renderItem?: RenderButtonSelectItem<Data>\n /** Lay the items in a row (default) or a column. */\n orientation?: \"horizontal\" | \"vertical\"\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Dims and blocks every item. */\n disabled?: boolean\n size?: ButtonSize\n /** Treatment of the unselected items. Defaults to `light`. */\n variant?: ButtonVariant\n /** Treatment of the selected items. Defaults to `filled`. */\n selectedVariant?: ButtonVariant\n color?: Color\n /** Renders a hidden input per selected value for native form submission. */\n name?: string\n /** Explicit id for the group root. */\n id?: string\n /** Lands on the group root, which forwards focus to its active item. */\n ref?: Ref<HTMLDivElement>\n /** Forwarded to the root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n className?: string\n classNames?: ButtonSelectClassNames\n }\n\n/**\n * The rendering both data forms share: the `Field` wrapper, the group root, one\n * `Item` per entry and the hidden inputs. The public components only adapt their\n * value shape (`V | null` or `V[]`) onto the machine's `string[]`.\n */\nexport const ButtonSelectControl = ({\n multiple,\n deselectable,\n value,\n onValueChange,\n data,\n renderItem,\n orientation,\n invalid,\n disabled,\n required,\n size = \"md\",\n variant,\n selectedVariant,\n color,\n name,\n id,\n ref,\n onBlur,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: ButtonSelectBaseProps<ButtonSelectData> & {\n multiple: boolean\n deselectable?: boolean\n value: readonly string[]\n onValueChange: (value: string[]) => void\n}) => {\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n const items = data.map(normalizeButtonSelectItem)\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n classNames={{ label: classNames?.label }}\n >\n <RootBase\n multiple={multiple}\n deselectable={deselectable}\n value={[...value]}\n onValueChange={onValueChange}\n orientation={orientation}\n disabled={disabled}\n invalid={isInvalid}\n size={size}\n variant={variant}\n selectedVariant={selectedVariant}\n color={color}\n id={id}\n ref={ref}\n onBlur={onBlur}\n testId={testId}\n className={cn(className, classNames?.root)}\n >\n {items.map((item) => (\n <Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n color={item.color}\n startSlot={item.startSlot}\n endSlot={item.endSlot}\n aria-label={item.ariaLabel}\n testId={item.testId}\n className={classNames?.item}\n >\n {renderItem\n ? renderItem(item, {\n selected: value.includes(item.value),\n disabled: Boolean(disabled) || item.disabled,\n })\n : item.label}\n </Item>\n ))}\n </RootBase>\n <HiddenInputs name={name} value={value} disabled={disabled} />\n </FieldShell>\n )\n}\n"]}
@@ -1,12 +1,12 @@
1
- import { TimeRow, resolveHourCycle, timeRowMinWidth, is12Hour, to12Hour, to24Hour, dayPeriodLabels } from './chunk-FUWSTUDM.js';
2
- import { CalendarBody, calendarGridWidth, resolveCalendarTranslations } from './chunk-TMMEJKLI.js';
1
+ import { TimeRow, resolveHourCycle, timeRowMinWidth, is12Hour, to12Hour, to24Hour, dayPeriodLabels } from './chunk-PH354ECN.js';
2
+ import { CalendarBody, calendarGridWidth, resolveCalendarTranslations } from './chunk-UHNRAI6V.js';
3
3
  import { calendarValueToDate, dateToCalendarValue, fromArkValues, toArkValues } from './chunk-TCWYBVIL.js';
4
4
  import { mergeRefs } from './chunk-UVYTJQTJ.js';
5
5
  import { controlOpenProps } from './chunk-5FDOOG4J.js';
6
- import { inputSlot, inputControlClasses, shellGap, placeholderColor, inputShell } from './chunk-QMW7D5GU.js';
7
- import { FieldShell, fieldA11yProps } from './chunk-UNSAA7YG.js';
8
- import { Button } from './chunk-U5GW5EBR.js';
9
- import { Popover, popoverClearTrigger, popoverPanel } from './chunk-VZ2TPU4B.js';
6
+ import { inputSlot, inputControlClasses, shellGap, placeholderColor, inputShell } from './chunk-5OQLFX47.js';
7
+ import { FieldShell, fieldA11yProps } from './chunk-FHG54IT5.js';
8
+ import { Button } from './chunk-RAUOFTUH.js';
9
+ import { Popover, popoverClearTrigger, popoverPanel } from './chunk-6GDMSENK.js';
10
10
  import { NestedLayer } from './chunk-AIQG7IIT.js';
11
11
  import { useOverlayContainer } from './chunk-7P32XCEU.js';
12
12
  import { useUncontrolled } from './chunk-BEL75C7N.js';
@@ -635,5 +635,5 @@ var DatePicker = Object.assign(DatePickerImpl, {
635
635
  });
636
636
 
637
637
  export { DatePicker, serializeDateValue };
638
- //# sourceMappingURL=chunk-PJL4ZL5V.js.map
639
- //# sourceMappingURL=chunk-PJL4ZL5V.js.map
638
+ //# sourceMappingURL=chunk-O23Y5ML4.js.map
639
+ //# sourceMappingURL=chunk-O23Y5ML4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/date-picker/date-time-text.ts","../src/components/date-picker/date-picker.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAM,SAAA,GAAY,CAAC,EAAE,MAAA,EAAQ,SAAA,EAAW,WAAA,EAAY,EAAwB,QAAA,KAC1E,IAAI,IAAA,CAAK,cAAA,CAAe,MAAA,EAAQ;AAAA,EAC9B,IAAA,EAAM,SAAA;AAAA,EACN,KAAA,EAAO,SAAA;AAAA,EACP,GAAA,EAAK,SAAA;AAAA,EACL,IAAA,EAAM,SAAA;AAAA,EACN,MAAA,EAAQ,SAAA;AAAA,EACR,MAAA,EAAQ,cAAc,SAAA,GAAY,MAAA;AAAA,EAClC,SAAA;AAAA;AAAA,EAEA,eAAA,EAAiB,MAAA;AAAA,EACjB;AACF,CAAC,CAAA;AAEI,IAAM,kBAAA,GAAqB,CAChC,KAAA,EACA,OAAA,EACA,QAAA,KACW,SAAA,CAAU,OAAA,EAAS,QAAQ,CAAA,CAAE,MAAA,CAAO,mBAAA,CAAoB,KAAA,EAAO,QAAQ,CAAC,CAAA;AAGrF,IAAM,cAAA,mBAAiB,IAAI,GAAA,CAAY,CAAC,MAAA,EAAQ,SAAS,KAAA,EAAO,MAAA,EAAQ,QAAA,EAAU,QAAQ,CAAC,CAAA;AAG3F,IAAM,UAAA,GAAa,CAAC,OAAA,KAClB,SAAA,CAAU,SAAS,KAAK,CAAA,CACrB,aAAA,CAAc,IAAI,IAAA,CAAK,IAAA,CAAK,GAAA,CAAI,IAAA,EAAM,IAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAE,CAAC,CAAC,CAAA,CAC1D,GAAA,CAAI,CAAC,IAAA,KAAS,IAAA,CAAK,IAAI,CAAA,CACvB,OAAO,CAAC,IAAA,KAA+B,cAA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;AAAA,EACV,SAAA,EAAW,OAAA;AAAA,EACX,YAAA;AAAA,EACA,QAAQ,OAAA,CAAQ;AAClB,CAAC","file":"chunk-PJL4ZL5V.js","sourcesContent":["import { CalendarDateTime, type DateValue } from \"@internationalized/date\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport { dayPeriodLabels, type HourCycle, is12Hour, to24Hour } from \"../time-input/hour-cycle\"\n\n/**\n * The typed text format for `typeable` + `withTime` — all-numeric, in the locale's own field order\n * (`10/20/2026, 02:30 PM` en-US, `20/10/2026 14:30` fr-FR), so what the field shows is exactly\n * what can be typed back. Ark's own `Input` part can't carry a time: it strips every character\n * but digits and the date separator while typing, and re-applies the previous value's time over\n * whatever its `parse` returns (`preserveTime`) — so `DatePicker` renders its own `<input>` on\n * top of these two helpers instead.\n */\n\ntype DateTimeTextOptions = {\n locale: string\n hourCycle: HourCycle\n withSeconds?: boolean\n}\n\nconst formatter = ({ locale, hourCycle, withSeconds }: DateTimeTextOptions, timeZone: string) =>\n new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: withSeconds ? \"2-digit\" : undefined,\n hourCycle,\n // `parseDateTimeText` reads ASCII digits; keep the display in the same digits it can parse.\n numberingSystem: \"latn\",\n timeZone,\n })\n\nexport const formatDateTimeText = (\n value: DateValue,\n options: DateTimeTextOptions,\n timeZone: string,\n): string => formatter(options, timeZone).format(calendarValueToDate(value, timeZone))\n\ntype NumericField = \"year\" | \"month\" | \"day\" | \"hour\" | \"minute\" | \"second\"\nconst NUMERIC_FIELDS = new Set<string>([\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"])\n\n/** The locale's numeric field order, read off the same formatter `formatDateTimeText` uses. */\nconst fieldOrder = (options: DateTimeTextOptions): NumericField[] =>\n formatter(options, \"UTC\")\n .formatToParts(new Date(Date.UTC(2001, 10, 22, 13, 44, 55)))\n .map((part) => part.type)\n .filter((type): type is NumericField => NUMERIC_FIELDS.has(type))\n\n/** \"AM\"/\"PM\" from the locale's own labels (`dayPeriodLabels`), falling back to a Latin `a`/`p`. */\nconst readPeriod = (text: string, locale: string): \"AM\" | \"PM\" | undefined => {\n const lower = text.toLowerCase()\n const labels = dayPeriodLabels(locale)\n if (lower.includes(labels.PM.toLowerCase())) return \"PM\"\n if (lower.includes(labels.AM.toLowerCase())) return \"AM\"\n if (/\\bp\\.?\\s?m?\\.?\\b/.test(lower)) return \"PM\"\n if (/\\ba\\.?\\s?m?\\.?\\b/.test(lower)) return \"AM\"\n return undefined\n}\n\nconst inRange = (n: number, min: number, max: number) => Number.isInteger(n) && n >= min && n <= max\n\n/**\n * Parse typed text back into a `CalendarDateTime`. Reads digit runs in the locale's field order\n * (so any separator works — `20/10/2026 14:30`, `20.10.2026 14h30` — but run-together digits like\n * `1430` read as one number); the\n * date is required, the time is optional — omitted fields keep `fallbackTime` (the current\n * value's), else midnight. In 12h mode a missing period reads AM, and a 13–23 hour is taken as\n * 24h as-typed. Returns `undefined` for anything that isn't a real date/time (`02/30/2026`,\n * `25:00`), never a silently constrained one.\n */\nexport const parseDateTimeText = (\n text: string,\n options: DateTimeTextOptions,\n fallbackTime?: { hour: number; minute: number; second: number },\n): CalendarDateTime | undefined => {\n const numbers = text.match(/\\d+/g)?.map(Number) ?? []\n const order = fieldOrder(options)\n const field = (name: NumericField) => {\n const index = order.indexOf(name)\n return index === -1 ? undefined : numbers[index]\n }\n\n const rawYear = field(\"year\")\n const month = field(\"month\")\n const day = field(\"day\")\n if (rawYear === undefined || month === undefined || day === undefined) return undefined\n const year = rawYear < 100 ? 2000 + rawYear : rawYear\n\n const typedHour = field(\"hour\")\n let hour = typedHour ?? fallbackTime?.hour ?? 0\n if (typedHour !== undefined && is12Hour(options.hourCycle) && inRange(typedHour, 0, 12)) {\n hour = to24Hour(typedHour, readPeriod(text, options.locale) ?? \"AM\")\n }\n const minute = field(\"minute\") ?? (typedHour === undefined ? fallbackTime?.minute : 0) ?? 0\n const second = field(\"second\") ?? (typedHour === undefined ? fallbackTime?.second : 0) ?? 0\n\n if (!inRange(month, 1, 12) || !inRange(day, 1, 31) || !inRange(year, 1, 9999)) return undefined\n if (!inRange(hour, 0, 23) || !inRange(minute, 0, 59) || !inRange(second, 0, 59)) return undefined\n const value = new CalendarDateTime(year, month, day, hour, minute, second)\n // `CalendarDateTime` constrains out-of-range days (Feb 30 → Feb 28) instead of rejecting them.\n return value.day === day ? value : undefined\n}\n","\"use client\"\n\nimport {\n DatePicker as Ark,\n type DatePickerDateRangePreset as DateRangePreset,\n type DateValue,\n type DatePickerDateView as DateView,\n type UseDatePickerContext,\n} from \"@ark-ui/react/date-picker\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { DateFormatter, getLocalTimeZone, toCalendarDateTime, today } from \"@internationalized/date\"\nimport { type FocusEvent, type ReactNode, type Ref, useRef, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport type { DatePredicate } from \"../../lib/date-predicates\"\nimport {\n calendarValueToDate,\n type DateRangeValue,\n dateToCalendarValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { NestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button } from \"../button/button\"\nimport { type CalendarTranslations, resolveCalendarTranslations } from \"../calendar/calendar\"\nimport {\n CalendarBody,\n type CalendarBodyClassNames,\n calendarGridWidth,\n} from \"../calendar/calendar-body\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n shellGap,\n} from \"../input/input\"\nimport { CalendarIcon, CloseIcon } from \"../popover/icons\"\nimport { Popover, popoverClearTrigger, popoverPanel } from \"../popover/popover\"\nimport {\n type HourCycle,\n is12Hour,\n resolveHourCycle,\n to12Hour,\n to24Hour,\n} from \"../time-input/hour-cycle\"\nimport { TimeRow, type TimeRowTranslations, timeRowMinWidth } from \"../time-input/time-row\"\nimport { formatDateTimeText, parseDateTimeText } from \"./date-time-text\"\n\n/**\n * DatePicker — a trigger + popover calendar on Ark UI's `date-picker` machine, composing\n * `Calendar`'s shared grid module (`calendar-body.tsx`) and `TimeInput`'s shared time row\n * (`time-row.tsx`). `range` and `withTime` cover all four date combinations; `DateRangePicker`,\n * `DateTimePicker`, and `DateTimeRangePicker` are thin named presets pinning those two flags.\n *\n * - Value is a native `Date | null` (or `{ start, end }` under `range`) — the machine's\n * `DateValue` array contract never leaks out; `lib/date-value.ts` is the one conversion\n * boundary both directions go through, exactly as `Calendar` uses it.\n * - `withConfirm` stages the selection in local state; only Apply calls the outer `onChange`,\n * Cancel reverts. Without it, single dates commit + close on pick and ranges commit on the\n * second click (both Ark-native) — except under `withTime`, where a pick commits but keeps\n * the panel open so the time row can still be set (outside click / Escape closes it).\n * - `presets` renders a sidebar of quick-pick shortcuts — range shortcuts (Ark's own\n * `DateRangePreset` union, or a custom `{ range }`) under `range`; single-date shortcuts\n * (a custom `{ date }`) otherwise. `true` resolves to a mode-appropriate default set.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s; pair with `lib/date-predicates.ts`'s\n * helpers (`disablePast()`, `disableWeekends()`, …), re-exported from this same barrel.\n * - `typeable` swaps the plain button trigger for a text input, so a date can be typed (and\n * parsed on blur / Enter) in addition to picked from the calendar — the leading icon becomes a\n * real open-calendar button alongside it. Opt-in (default `false`); single dates only (see\n * the prop's own doc comment). Under `withTime` the input carries the time too\n * (`date-time-text.ts`).\n *\n * <DatePicker label=\"Start date\" value={date} onChange={setDate} clearable />\n * <DateRangePicker withTime presets withConfirm value={range} onChange={setRange} />\n */\n\nconst datePickerPresets = cn(\n \"flex shrink-0 flex-col gap-0.5 border-e p-1\",\n \"border-brand-900/20 dark:border-white/15\",\n)\n\nconst presetTrigger = cn(\n \"w-full cursor-pointer rounded-xs px-2 py-1.5 text-start text-sm whitespace-nowrap transition-colors\",\n \"hover:bg-gray-light-100 dark:hover:bg-gray-dark-800\",\n focusStyles({ offset: false }),\n)\n\nconst timePanelLabel = \"text-xs font-medium text-gray-light-500 dark:text-gray-dark-400\"\n\n/** `typeable`'s leading calendar icon, promoted from a decorative span (the button-trigger case)\n * to a real open-calendar button — same base look as `inputSlot`, plus the family's interactive-\n * icon treatment (compare `popoverClearTrigger`). `outline-none`: the shell's own `:has()` rule\n * (`shellChrome` in `input.tsx`) already rings the *whole* control on this button's focus-visible\n * state, so its own native outline would just double up. */\nconst datePickerIconTrigger = cn(\n inputSlot,\n \"cursor-pointer rounded-xs outline-none transition-colors hover:text-gray-light-700 dark:hover:text-gray-dark-200 disabled:cursor-not-allowed\",\n)\n\n/** The main column (calendar + time row footer) has no explicit width of its own, and neither\n * does the popover above it — deliberately, so the popover sizes to its content. But once the\n * time row's Hour/Minute/(Second) fields are `flex-1` (grow to fill the row), that becomes\n * circular: the row wants to size off \"however much space is available,\" and with nothing\n * concrete above it to measure against, browsers resolve a flex container's own intrinsic width\n * generously when it holds `flex-grow` items — the row (and everything above it) ends up far\n * wider than the calendar actually needs, even for a single time row. Giving the column an\n * explicit width tied to the calendar's own geometry (`calendarGridWidth`, shared with\n * `calendar-body.tsx`'s own month/year grids) breaks that circularity: the row now grows to\n * fill a *real* width instead of an ambiguous one.\n *\n * That width is only ever tied to the *calendar* grid, though — under `withTime`, the column\n * must be at least as wide as the time row itself needs (`timeRowMinWidth`), or the same\n * `flex-1` + `min-w-0` fields that motivated a fixed width in the first place shrink below their\n * content size instead of growing: with the AM/PM toggle present at a single month, the\n * calendar-only width is narrower than Hour+Minute+Period need, and the `<input>`s get starved. */\n\nconst pad = (n: number) => String(n).padStart(2, \"0\")\n\n/** Hidden-input serialization. `DateValue#toString()` isn't safe to call directly here: a\n * `ZonedDateTime` (what our own `dateToCalendarValue` produces for a `defaultValue`/`value`\n * passed in) stringifies with a full offset + IANA zone suffix, while a plain `CalendarDate`\n * (what a day-grid click produces) stringifies as a clean date — two different formats for the\n * same picked day depending on provenance. Read the wall-calendar fields directly instead.\n * Whether to append the time portion is driven by the picker's own `withTime` flag, not by\n * whether the value happens to carry an `hour` field — a `ZonedDateTime` always has one (even\n * at local midnight), so that structural check can't tell \"date-only\" from \"with time\" apart. */\nexport const serializeDateValue = (value: DateValue, withTime: boolean): string => {\n const date = `${value.year}-${pad(value.month)}-${pad(value.day)}`\n if (!withTime) return date\n const time = \"hour\" in value ? value : { hour: 0, minute: 0, second: 0 }\n return `${date}T${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}`\n}\n\nexport type DatePickerClassNames = {\n field?: string\n control?: string\n content?: string\n presets?: string\n calendar?: CalendarBodyClassNames\n timePanel?: { hour?: string; minute?: string; second?: string; period?: string }\n footer?: string\n}\n\n/** `value`/`range`-shaped entries are for `range` mode; `date`-shaped entries are for single-date\n * mode. Nothing prevents mixing them for the picker's current mode — the shape you pass is\n * trusted, not validated at runtime (a mismatched entry just doesn't produce useful behavior;\n * `api.setValue`/`getRangePresetValue` are mode-agnostic in the underlying machine). */\nexport type DatePreset =\n | { label: string; value: DateRangePreset }\n | { label: string; range: { start: Date; end: Date } | null }\n | { label: string; date: Date | null }\n\n/** Identifies each entry `getDefaultPresets` builds for `presets={true}`, so a `translations`\n * override can target one label without redefining the whole set. */\nexport type DatePickerPresetId =\n | \"today\"\n | \"yesterday\"\n | \"tomorrow\"\n | \"nextWeek\"\n | \"thisWeek\"\n | \"lastWeek\"\n | \"thisMonth\"\n | \"lastMonth\"\n | \"thisYear\"\n | \"allTime\"\n\n/** One unified `translations` prop rather than one per string source — Ark's own accessible\n * names, the `presets={true}` default labels, and the embedded time row's strings all belong to\n * the same `DatePicker` instance a consumer is localizing. English defaults throughout;\n * unset keys keep their built-in text. */\nexport type DatePickerTranslations = Partial<CalendarTranslations> &\n TimeRowTranslations & {\n /** The `withConfirm` footer's revert button. Default `\"Cancel\"`. */\n cancel?: string\n /** The `withConfirm` footer's commit button. Default `\"Apply\"`. */\n apply?: string\n /** The embedded time row's label under `range` + `withTime` (first row). Default `\"Start time\"`. */\n startTime?: string\n /** The embedded time row's label under `range` + `withTime` (second row). Default `\"End time\"`. */\n endTime?: string\n /** Individual `presets={true}` default-set labels, keyed by id — override just the ones you\n * need without redefining the whole array. Pass your own `DatePreset[]` for full control. */\n presets?: Partial<Record<DatePickerPresetId, string>>\n }\n\nexport type DatePickerProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n // Widened from `HTMLButtonElement` alone: under `typeable` the focusable element is Ark's\n // `Input` (a real `<input>`), not the button trigger — `ref`/`onBlur` must be able to land on\n // either depending on that prop, since both are the same generic `DatePickerProps`.\n HTMLButtonElement | HTMLInputElement\n> &\n Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Adds an embedded HOUR/MINUTE (+ SECOND) time row; the value carries H/M too. */\n withTime?: boolean\n /** Months shown side by side. Default `1`, regardless of `range` — pass `2` to show a full\n * range without paging (matches `Calendar`'s own plain default). */\n numOfMonths?: number\n /** Always render 6 week rows (padding with adjacent-month days) instead of however many the\n * visible month(s) actually span (4–6) — keeps the popover's height constant while\n * navigating between months. */\n fixedWeeks?: boolean\n /** Preset sidebar — range shortcuts under `range`, single-date shortcuts otherwise. `true`\n * renders a mode-appropriate default set; an array is fully custom. See `DatePreset`. */\n presets?: DatePreset[] | boolean\n /** Stage the selection; commit only on Apply. Cancel reverts to the last committed value. */\n withConfirm?: boolean\n /** Renders a clear trigger once a value is set; emits `null` (or an all-null range). */\n clearable?: boolean\n /** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.\n * Called with this component's own resolved `timeZone` as its second argument, so a predicate\n * reads the candidate day in the same zone the grid renders it in. */\n isDateUnavailable?: DatePredicate\n /** Renders a text input (typing, blur-to-parse, `Enter`-to-commit) alongside the\n * calendar-icon trigger, instead of the plain button-only trigger. Opt-in — default `false`\n * keeps the click-to-open button.\n *\n * Without `withTime` this is Ark's own `Input` anatomy part (a numeric date). Under\n * `withTime` it shows and parses a numeric date + time in the locale's own field order\n * (`10/20/2026, 02:30 PM`, `20/10/2026 14:30`) — typing just a date keeps the current time.\n * `range` (cross-field validation across two inputs) is out of scope and falls back to the\n * button trigger. */\n typeable?: boolean\n min?: Date\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"`). */\n minView?: DateView\n maxView?: DateView\n /** Overrides the active locale context. Drives month/day names, first-day-of-week, and the\n * embedded time row's 12h/24h default. */\n locale?: string\n /** Overrides the local time zone for every `Date ↔ DateValue` conversion. Default\n * `getLocalTimeZone()` — **not** Ark's own machine default (`\"UTC\"`). */\n timeZone?: string\n /** Force 12-hour or 24-hour display for the embedded time row, overriding the locale default. */\n format?: 12 | 24\n /** Force a specific hour cycle, overriding the locale default and `format`. */\n hourCycle?: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the embedded time row's empty Hour/Minute/Second fields — see\n * TimeRow's `placeholder`. Default `\"--\"`. */\n timePlaceholder?: string\n /** Overrides built-in English strings — Ark's own accessible names, the `presets={true}`\n * default labels, Cancel/Apply, Start/End time, and the embedded time row's Hour/Minute/\n * Second/Period labels. Unlike `locale`, nothing here auto-derives. Partial — unset keys\n * keep their English default. */\n translations?: DatePickerTranslations\n /** Placeholder shown while no date is selected. */\n placeholder?: string\n /** Inline-start adornment. Defaults to a calendar icon. */\n startSlot?: ReactNode\n size?: Size\n variant?: InputVariant\n /** Render the panel in a Portal so it escapes clipping ancestors.\n * 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 className?: string\n classNames?: DatePickerClassNames\n }\n\n/** Ark's built-in `DateRangePreset` union has no \"today\" / \"yesterday\" / \"all time\" member\n * (confirmed in `@zag-js/date-utils`'s types) — those three are hand-built here from\n * `today(timeZone)`; the rest map straight to Ark's own string presets. The single-date set\n * (non-`range`) is a different shape entirely, not a trimmed-down copy of the range one — \"This\n * week\"/\"This month\"/etc. are inherently range-shaped and don't collapse to one date. */\nconst getDefaultPresets = (\n range: boolean,\n timeZone: string,\n labels?: Partial<Record<DatePickerPresetId, string>>,\n): DatePreset[] => {\n const now = today(timeZone)\n const toDate = (value: typeof now) => calendarValueToDate(value, timeZone)\n const label = (id: DatePickerPresetId, fallback: string) => labels?.[id] ?? fallback\n if (!range) {\n return [\n { label: label(\"today\", \"Today\"), date: toDate(now) },\n { label: label(\"yesterday\", \"Yesterday\"), date: toDate(now.subtract({ days: 1 })) },\n { label: label(\"tomorrow\", \"Tomorrow\"), date: toDate(now.add({ days: 1 })) },\n { label: label(\"nextWeek\", \"Next week\"), date: toDate(now.add({ days: 7 })) },\n ]\n }\n const yesterday = now.subtract({ days: 1 })\n return [\n { label: label(\"today\", \"Today\"), range: { start: toDate(now), end: toDate(now) } },\n {\n label: label(\"yesterday\", \"Yesterday\"),\n range: { start: toDate(yesterday), end: toDate(yesterday) },\n },\n { label: label(\"thisWeek\", \"This week\"), value: \"thisWeek\" },\n { label: label(\"lastWeek\", \"Last week\"), value: \"lastWeek\" },\n { label: label(\"thisMonth\", \"This month\"), value: \"thisMonth\" },\n { label: label(\"lastMonth\", \"Last month\"), value: \"lastMonth\" },\n { label: label(\"thisYear\", \"This year\"), value: \"thisYear\" },\n { label: label(\"allTime\", \"All time\"), range: null },\n ]\n}\n\nconst PresetsRail = ({\n presets,\n range,\n timeZone,\n withConfirm,\n translations,\n className,\n}: {\n presets: DatePreset[] | boolean\n /** Which default set `presets === true` resolves to — irrelevant once `presets` is a concrete array. */\n range?: boolean\n timeZone: string\n withConfirm?: boolean\n /** Overrides individual `presets={true}` default-set labels, keyed by id. No effect on a\n * custom `DatePreset[]`. */\n translations?: Partial<Record<DatePickerPresetId, string>>\n className?: string\n}) => {\n const resolved =\n presets === true\n ? getDefaultPresets(Boolean(range), timeZone, translations)\n : presets === false\n ? []\n : presets\n if (resolved.length === 0) return null\n return (\n <Ark.Context>\n {(api) => (\n <div className={cn(datePickerPresets, className)}>\n {resolved.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n // Not `Ark.PresetTrigger`: its own onClick always sends `PRESET.CLICK`, which the\n // machine transitions unconditionally to \"focused\" (closed) regardless of\n // `closeOnSelect` — there's no way to keep it open under `withConfirm`. Resolve the\n // preset's value ourselves and set it via `api.setValue`, which only sets the value\n // (no state-machine transition), then close explicitly only when not staging.\n onClick={() => {\n const values =\n \"value\" in preset\n ? api.getRangePresetValue(preset.value)\n : \"range\" in preset\n ? (toArkValues(preset.range, timeZone) ?? [])\n : (toArkValues(preset.date, timeZone) ?? [])\n api.setValue(values)\n if (!withConfirm) api.setOpen(false)\n }}\n aria-label={preset.label}\n className={presetTrigger}\n >\n {preset.label}\n </button>\n ))}\n </div>\n )}\n </Ark.Context>\n )\n}\n\ntype DisplayTime = {\n hour: number | null\n minute: number | null\n second: number | null\n period: \"AM\" | \"PM\" | null\n}\n\nconst emptyDisplayTime: DisplayTime = { hour: null, minute: null, second: null, period: null }\n\n/** Derive display-space fields (1–12 or 0–23, + period) from the machine's own `DateValue` — a\n * plain `CalendarDate` (no time picked yet) has no `hour`, so it reads as all-null. */\nconst toDisplayTime = (value: DateValue | undefined, twelveHour: boolean): DisplayTime => {\n if (!value || !(\"hour\" in value)) return emptyDisplayTime\n const { hour, period } = twelveHour ? to12Hour(value.hour) : { hour: value.hour, period: null }\n return { hour, minute: value.minute, second: value.second ?? null, period }\n}\n\n/** The inverse of `toDisplayTime` — merges a display-space edit into a `setTime`-ready payload.\n * Missing fields default to midnight, same rule `TimeInput` uses for its own first edit. */\nconst fromDisplayTime = (\n display: DisplayTime,\n twelveHour: boolean,\n): { hour: number; minute: number; second?: number } => {\n const hour = twelveHour\n ? to24Hour(display.hour ?? 12, display.period ?? \"AM\")\n : (display.hour ?? 0)\n const minute = display.minute ?? 0\n return display.second != null ? { hour, minute, second: display.second } : { hour, minute }\n}\n\n/** `api.setTime`, except that a time edit with no day picked yet lands on *today* instead of being\n * dropped — Ark's own `setTime` silently no-ops without a date at that index, so typing a time\n * first used to do nothing at all. Only the first row can hit that (the second is disabled until\n * a range has both ends). `setValue` keeps today within `min`/`max`, like Ark's `selectToday`;\n * a today that `isDateUnavailable` rules out isn't auto-picked. */\nconst setTimeOrToday = (\n api: UseDatePickerContext,\n time: { hour: number; minute: number; second?: number },\n index: number,\n timeZone: string,\n) => {\n if (api.value[index] || index !== 0) return api.setTime(time, index)\n const day = today(timeZone)\n if (api.isUnavailable(day)) return\n api.setValue([toCalendarDateTime(day).set(time)])\n}\n\nexport type TimePanelRowProps = {\n value: DateValue | undefined\n onSetTime: (time: { hour: number; minute: number; second?: number }) => void\n label?: string\n disabled?: boolean\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the row's empty Hour/Minute/Second fields — see TimeRow's\n * `placeholder`. 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 classNames?: DatePickerClassNames[\"timePanel\"] & { root?: string }\n}\n\n/** One HOUR/MINUTE(+SECOND)+AM/PM row, bridging `TimeRow`'s display-space props to a specific\n * `api.value` index via `api.setTime(time, index)` — the same shared `TimeRow` `TimeInput`\n * wraps with its own local state, wrapped here with the machine's state instead. */\nconst TimePanelRow = ({\n value,\n onSetTime,\n label,\n disabled,\n hourCycle,\n minuteStep,\n withSeconds,\n placeholder,\n locale,\n translations,\n size,\n variant,\n classNames,\n}: TimePanelRowProps) => {\n const twelveHour = is12Hour(hourCycle)\n const display = toDisplayTime(value, twelveHour)\n const patch = (partial: Partial<DisplayTime>) =>\n onSetTime(fromDisplayTime({ ...display, ...partial }, twelveHour))\n\n return (\n <div className={cn(\"flex flex-col gap-1\", classNames?.root)}>\n {label && <span className={timePanelLabel}>{label}</span>}\n <TimeRow\n hour={display.hour}\n minute={display.minute}\n second={display.second}\n onHourChange={(hour) => patch({ hour })}\n onMinuteChange={(minute) => patch({ minute })}\n onSecondChange={withSeconds ? (second) => patch({ second }) : undefined}\n period={display.period}\n onPeriodChange={(period) => patch({ period })}\n hourCycle={hourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={placeholder}\n locale={locale}\n translations={translations}\n size={size}\n variant={variant}\n disabled={disabled}\n classNames={classNames}\n />\n </div>\n )\n}\n\n/**\n * `typeable` + `withTime`'s own text input, standing in for Ark's `Input` part — which can't carry\n * a time (see `date-time-text.ts`). It still declares `data-part=\"input\"` inside the Control, so\n * the machine treats it as its input: excluded from interact-outside dismissal, focused on close,\n * and kept in sync with every value change (day pick, time row, clear) through the Root's\n * `format`, which is this same numeric text. Left uncontrolled for that reason — the only thing\n * added here is committing typed text: parsed on blur / `Enter`, then set through `api.setValue`;\n * text that doesn't parse (or lands on an unavailable day) reverts to the current value.\n */\nconst DateTimeTextInput = ({\n api,\n options,\n timeZone,\n ref,\n onBlur,\n placeholder,\n disabled,\n readOnly,\n invalid,\n testId,\n}: {\n api: UseDatePickerContext\n options: Parameters<typeof parseDateTimeText>[1]\n timeZone: string\n ref?: Ref<HTMLInputElement>\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n placeholder?: string\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n testId?: string\n}) => {\n const field = useFieldContext()\n const current = api.value[0]\n const show = (input: HTMLInputElement, value: DateValue | undefined) => {\n input.value = value ? formatDateTimeText(value, options, timeZone) : \"\"\n }\n const commit = (input: HTMLInputElement) => {\n const text = input.value.trim()\n if (text === \"\") {\n if (current) api.clearValue({ focus: false })\n return\n }\n const fallback = current && \"hour\" in current ? current : undefined\n const next = parseDateTimeText(text, options, fallback)\n if (!next || api.isUnavailable(next)) return show(input, current)\n api.setValue([next])\n api.setFocusedValue(next)\n // `setValue` is a no-op (and syncs nothing) when the parsed value equals the current one, so\n // normalize the typed text to the canonical format either way.\n show(input, next)\n }\n return (\n <input\n ref={ref}\n type=\"text\"\n data-scope=\"date-picker\"\n data-part=\"input\"\n autoComplete=\"off\"\n defaultValue={current ? formatDateTimeText(current, options, timeZone) : \"\"}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n aria-invalid={invalid || undefined}\n // Ark's own input-click handler, not `api.setOpen`: it opens with `src: \"input.click\"`,\n // which is what stops the machine from moving focus into the grid — typing has to keep\n // landing here. It also honours `openOnClick` and disabled/read-only on its own.\n onClick={api.getInputProps().onClick}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\" || event.nativeEvent.isComposing) return\n event.preventDefault()\n commit(event.currentTarget)\n }}\n onBlur={(event) => {\n if (!readOnly) commit(event.currentTarget)\n onBlur?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={inputControlClasses}\n />\n )\n}\n\nconst DatePickerImpl = <Range extends boolean = false>({\n withinPortal = true,\n container,\n range,\n withTime,\n numOfMonths = 1,\n fixedWeeks,\n presets,\n withConfirm,\n clearable,\n value,\n defaultValue,\n onChange,\n onBlur,\n isDateUnavailable,\n typeable,\n min,\n max,\n minView,\n maxView,\n locale,\n timeZone,\n format,\n hourCycle,\n minuteStep,\n withSeconds,\n timePlaceholder,\n translations,\n placeholder = \"Pick a date\",\n startSlot,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: DatePickerProps<Range>) => {\n const portalContainer = useOverlayContainer(container)\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = timeZone ?? getLocalTimeZone()\n const resolvedHourCycle = resolveHourCycle({ locale: resolvedLocale, format, hourCycle })\n const isInvalid = invalid || error != null\n const isRange = Boolean(range)\n // See `typeable`'s own doc comment: single dates only — `range` silently falls back to the\n // button trigger rather than erroring, so `typeable` composes safely with every other prop.\n // Under `withTime` the input is `DateTimeTextInput` instead of Ark's own date-only `Input`.\n const showTypeableInput = Boolean(typeable) && !isRange\n const dateTimeText = { locale: resolvedLocale, hourCycle: resolvedHourCycle, withSeconds }\n const controlRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n\n type Value = Range extends true ? DateRangeValue : Date | null\n const emptyValue = (isRange ? { start: null, end: null } : null) as Value\n\n // Reserved for the `withConfirm` staged layer only — the base value needs no local state,\n // Ark's machine natively supports controlled/uncontrolled `value`/`defaultValue`/`onValueChange`\n // the same way `Calendar` relies on it.\n const [committed, setCommitted] = useUncontrolled<Value>({\n value,\n defaultValue,\n finalValue: emptyValue,\n onChange,\n })\n const [staged, setStaged] = useState<Value>(committed)\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n // Ark's own default (`true`) auto-closes on a completed pick — under `withConfirm`\n // the picker must stay open for review until Apply/Cancel, and under `withTime` the day\n // is only half the value: closing on pick would hide the time row it still needs.\n // Otherwise leave Ark's default (single closes on pick, range on the second click).\n closeOnSelect={withConfirm || withTime ? false : undefined}\n // Ark's own default (`false`) requires the calendar-icon trigger to open the popover —\n // under `typeable` a click into the text field itself should open it too, matching the\n // combined type-or-pick affordance `typeable` is meant to offer. No-op when the Input\n // anatomy part isn't rendered (`!showTypeableInput`).\n openOnClick={showTypeableInput}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n minView={minView}\n maxView={maxView}\n value={toArkValues(withConfirm ? staged : value, resolvedTimeZone)}\n defaultValue={withConfirm ? undefined : toArkValues(defaultValue, resolvedTimeZone)}\n onValueChange={(details) => {\n const next = fromArkValues(details.value, isRange, resolvedTimeZone) as Value\n if (withConfirm) setStaged(next)\n else onChange?.(next)\n }}\n onOpenChange={(details) => {\n if (withConfirm && details.open) setStaged(committed)\n }}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(\n calendarValueToDate(dateValue, resolvedTimeZone),\n resolvedTimeZone,\n )\n : undefined\n }\n min={min ? dateToCalendarValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToCalendarValue(max, resolvedTimeZone) : undefined}\n // The typed date+time input shows (and Ark syncs into it) the same numeric text it parses.\n format={\n withTime && showTypeableInput\n ? (date) => formatDateTimeText(date, dateTimeText, resolvedTimeZone)\n : withTime\n ? (date, { locale: fmtLocale }) =>\n new DateFormatter(fmtLocale, { dateStyle: \"medium\", timeStyle: \"short\" }).format(\n calendarValueToDate(date, resolvedTimeZone),\n )\n : undefined\n }\n // Anchor to the Control (not `sameWidth`, unlike Select) — the popover hosts a full\n // calendar grid + presets rail, which needs its own intrinsic width, not the trigger's.\n positioning={{ getAnchorRect: () => controlRef.current?.getBoundingClientRect() ?? null }}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={isInvalid}\n className={cn(\"w-full\", className)}\n >\n <Ark.Context>\n {(api) => (\n <>\n <Ark.Control\n ref={controlRef}\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": true,\n \"data-with-end-slot\": true,\n })}\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(\n inputShell({ size, variant }),\n // A real `<input>` sits in the shell under `typeable` — leave the shell's own\n // cursor at the browser default (text-cursor over the input, pointer over the\n // icon trigger / clear button) instead of forcing pointer everywhere, matching\n // `Combobox`'s Control (see `combobox.tsx`) rather than `Select`'s button-only one.\n !showTypeableInput && \"cursor-pointer\",\n classNames?.control,\n )}\n >\n {showTypeableInput ? (\n <div className={cn(\"flex min-w-0 flex-1 items-center\", shellGap[size])}>\n {/* Ark sets its own accessible `aria-label` (\"Open calendar\" / \"Close\n calendar\") on the trigger regardless of children, so an icon-only button\n here is still accessible without a manual override. */}\n <Ark.Trigger className={datePickerIconTrigger}>\n {startSlot ?? <CalendarIcon />}\n </Ark.Trigger>\n {withTime ? (\n <DateTimeTextInput\n api={api}\n options={dateTimeText}\n timeZone={resolvedTimeZone}\n ref={mergeRefs<HTMLButtonElement | HTMLInputElement>(inputRef, ref)}\n onBlur={onBlur}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n invalid={isInvalid}\n testId={testId}\n />\n ) : (\n <Ark.Input\n ref={mergeRefs<HTMLButtonElement | HTMLInputElement>(inputRef, ref)}\n onBlur={onBlur}\n placeholder={placeholder}\n {...props({ \"data-testid\": testId })}\n className={inputControlClasses}\n />\n )}\n </div>\n ) : (\n <Ark.Trigger\n ref={mergeRefs<HTMLButtonElement | HTMLInputElement>(triggerRef, ref)}\n onBlur={onBlur}\n aria-invalid={isInvalid || undefined}\n {...props({ \"data-testid\": testId })}\n className={cn(\n \"flex min-w-0 flex-1 cursor-pointer items-center bg-transparent text-start outline-none disabled:cursor-not-allowed\",\n shellGap[size],\n )}\n >\n <span className={inputSlot} aria-hidden>\n {startSlot ?? <CalendarIcon />}\n </span>\n <span className=\"min-w-0 flex-1 truncate text-start\">\n {isRange ? (\n api.value.length === 0 ? (\n <span className={placeholderColor}>{placeholder}</span>\n ) : (\n // Not `Ark.RangeText`: despite the name, it renders the calendar's\n // *visible* month/year viewport (the same text the header's ViewTrigger\n // shows), not the selected range — `datePicker.visibleRangeText` in Ark's\n // own source. Build the real selected-range text from `valueAsString`\n // instead (the same per-value formatted strings `Ark.ValueText` uses).\n api.valueAsString.join(\" – \")\n )\n ) : (\n <Ark.ValueText placeholder={placeholder} />\n )}\n </span>\n </Ark.Trigger>\n )}\n {clearable && (\n // Ark's own ClearTrigger already self-hides (`hidden`) while empty.\n <Ark.ClearTrigger className={popoverClearTrigger}>\n <CloseIcon />\n </Ark.ClearTrigger>\n )}\n </Ark.Control>\n\n {/* Holds an enclosing Modal/Drawer/Popover open while the calendar is; see `lib/overlay-layer.tsx`. */}\n <NestedLayer open={api.open} />\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content\n // `max-content` sizing (no `sameWidth`, see the positioning comment above)\n // means \"as if nothing below ever wraps\" — a `flex-wrap` time-row footer\n // wider than the calendar (two side-by-side \"Start time\"/\"End time\" rows\n // under `range` + `withTime`) would never actually wrap without a real width\n // constraint to shrink against; it'd just overflow off-screen on a narrow\n // viewport instead. `92vw` is generous enough to be a no-op on any normal\n // desktop width, only kicking in once there's genuinely no room.\n className={cn(\n popoverPanel,\n \"max-w-[92vw] flex-row flex-wrap items-stretch\",\n classNames?.content,\n )}\n >\n {presets && (\n <PresetsRail\n presets={presets}\n range={isRange}\n timeZone={resolvedTimeZone}\n withConfirm={withConfirm}\n translations={translations?.presets}\n className={classNames?.presets}\n />\n )}\n <div\n className=\"flex min-w-0 flex-1 flex-col\"\n style={{\n width:\n Math.max(\n calendarGridWidth(size, numOfMonths),\n withTime ? timeRowMinWidth(size, resolvedHourCycle, withSeconds) : 0,\n ) + 16, // Take the x padding into account\n }}\n >\n <Popover.Body\n className={cn(\"p-2\", withTime || withConfirm ? \"border-b\" : undefined)}\n >\n <CalendarBody\n numOfMonths={numOfMonths}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames?.calendar}\n />\n </Popover.Body>\n {withTime && (\n <Popover.Footer\n className={cn(\n \"flex gap-x-2 gap-y-2 pb-2\",\n // Stacked by default — side by side only widens to match the extra\n // room multiple months already provide; with a single month, sitting\n // two time rows side by side would force the popover wider than the\n // calendar above them for no reason.\n numOfMonths > 1 ? \"flex-row flex-wrap\" : \"flex-col\",\n classNames?.footer,\n )}\n >\n <TimePanelRow\n value={api.value[0]}\n onSetTime={(time) => setTimeOrToday(api, time, 0, resolvedTimeZone)}\n label={isRange ? (translations?.startTime ?? \"Start time\") : undefined}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n {isRange && (\n <TimePanelRow\n value={api.value[1]}\n onSetTime={(time) => api.setTime(time, 1)}\n label={translations?.endTime ?? \"End time\"}\n disabled={api.value.length < 2}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n )}\n </Popover.Footer>\n )}\n {withConfirm && (\n <Popover.Footer className=\"flex justify-end gap-2 pb-2\">\n <Button\n variant=\"subtle\"\n color=\"neutral\"\n size={size}\n onClick={() => {\n setStaged(committed)\n api.setOpen(false)\n }}\n >\n {translations?.cancel ?? \"Cancel\"}\n </Button>\n <Button\n size={size}\n onClick={() => {\n setCommitted(staged)\n api.setOpen(false)\n }}\n >\n {translations?.apply ?? \"Apply\"}\n </Button>\n </Popover.Footer>\n )}\n </div>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n\n {name &&\n (isRange ? (\n <>\n <input\n type=\"hidden\"\n name={`${name}Start`}\n value={\n api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"\n }\n />\n <input\n type=\"hidden\"\n name={`${name}End`}\n value={\n api.value[1] ? serializeDateValue(api.value[1], Boolean(withTime)) : \"\"\n }\n />\n </>\n ) : (\n <input\n type=\"hidden\"\n name={name}\n value={api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"}\n />\n ))}\n </>\n )}\n </Ark.Context>\n </Ark.Root>\n </FieldShell>\n )\n}\n\nexport const DatePicker = Object.assign(DatePickerImpl, {\n Root: Ark.Root,\n Context: Ark.Context,\n Control: Ark.Control,\n Input: Ark.Input,\n Trigger: Ark.Trigger,\n ClearTrigger: Ark.ClearTrigger,\n Content: Ark.Content,\n Presets: PresetsRail,\n Calendar: CalendarBody,\n TimePanel: TimeRow,\n TimePanelRow: TimePanelRow,\n Footer: Popover.Footer,\n}) as (<Range extends boolean = false>(props: DatePickerProps<Range>) => ReactNode) & {\n Root: typeof Ark.Root\n Context: typeof Ark.Context\n Control: typeof Ark.Control\n Input: typeof Ark.Input\n Trigger: typeof Ark.Trigger\n ClearTrigger: typeof Ark.ClearTrigger\n Content: typeof Ark.Content\n Presets: typeof PresetsRail\n Calendar: typeof CalendarBody\n TimePanel: typeof TimeRow\n TimePanelRow: typeof TimePanelRow\n Footer: typeof Popover.Footer\n}\n"]}
1
+ {"version":3,"sources":["../src/components/date-picker/date-time-text.ts","../src/components/date-picker/date-picker.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAM,SAAA,GAAY,CAAC,EAAE,MAAA,EAAQ,SAAA,EAAW,WAAA,EAAY,EAAwB,QAAA,KAC1E,IAAI,IAAA,CAAK,cAAA,CAAe,MAAA,EAAQ;AAAA,EAC9B,IAAA,EAAM,SAAA;AAAA,EACN,KAAA,EAAO,SAAA;AAAA,EACP,GAAA,EAAK,SAAA;AAAA,EACL,IAAA,EAAM,SAAA;AAAA,EACN,MAAA,EAAQ,SAAA;AAAA,EACR,MAAA,EAAQ,cAAc,SAAA,GAAY,MAAA;AAAA,EAClC,SAAA;AAAA;AAAA,EAEA,eAAA,EAAiB,MAAA;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ACL,IAAA;AAAA,gBACA,KAAA,EAAO,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,GAAI,kBAAA,CAAmB,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,EAAG,OAAA,CAAQ,QAAQ,CAAC,CAAA,GAAI;AAAA;AAAA,aAC9E;AAAA,WAAA,EAEN,CAAA,EAEJ;AAAA;AAAA;AACF;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACtD,MAAMA,YAAA,CAAI,IAAA;AAAA,EACV,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,OAAOA,YAAA,CAAI,KAAA;AAAA,EACX,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,cAAcA,YAAA,CAAI,YAAA;AAAA,EAClB,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,OAAA,EAAS,WAAA;AAAA,EACT,QAAA,EAAU,YAAA;AAAA,EACV,SAAA,EAAW,OAAA;AAAA,EACX,YAAA;AAAA,EACA,QAAQ,OAAA,CAAQ;AAClB,CAAC","file":"chunk-O23Y5ML4.js","sourcesContent":["import { CalendarDateTime, type DateValue } from \"@internationalized/date\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport { dayPeriodLabels, type HourCycle, is12Hour, to24Hour } from \"../time-input/hour-cycle\"\n\n/**\n * The typed text format for `typeable` + `withTime` — all-numeric, in the locale's own field order\n * (`10/20/2026, 02:30 PM` en-US, `20/10/2026 14:30` fr-FR), so what the field shows is exactly\n * what can be typed back. Ark's own `Input` part can't carry a time: it strips every character\n * but digits and the date separator while typing, and re-applies the previous value's time over\n * whatever its `parse` returns (`preserveTime`) — so `DatePicker` renders its own `<input>` on\n * top of these two helpers instead.\n */\n\ntype DateTimeTextOptions = {\n locale: string\n hourCycle: HourCycle\n withSeconds?: boolean\n}\n\nconst formatter = ({ locale, hourCycle, withSeconds }: DateTimeTextOptions, timeZone: string) =>\n new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: withSeconds ? \"2-digit\" : undefined,\n hourCycle,\n // `parseDateTimeText` reads ASCII digits; keep the display in the same digits it can parse.\n numberingSystem: \"latn\",\n timeZone,\n })\n\nexport const formatDateTimeText = (\n value: DateValue,\n options: DateTimeTextOptions,\n timeZone: string,\n): string => formatter(options, timeZone).format(calendarValueToDate(value, timeZone))\n\ntype NumericField = \"year\" | \"month\" | \"day\" | \"hour\" | \"minute\" | \"second\"\nconst NUMERIC_FIELDS = new Set<string>([\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"])\n\n/** The locale's numeric field order, read off the same formatter `formatDateTimeText` uses. */\nconst fieldOrder = (options: DateTimeTextOptions): NumericField[] =>\n formatter(options, \"UTC\")\n .formatToParts(new Date(Date.UTC(2001, 10, 22, 13, 44, 55)))\n .map((part) => part.type)\n .filter((type): type is NumericField => NUMERIC_FIELDS.has(type))\n\n/** \"AM\"/\"PM\" from the locale's own labels (`dayPeriodLabels`), falling back to a Latin `a`/`p`. */\nconst readPeriod = (text: string, locale: string): \"AM\" | \"PM\" | undefined => {\n const lower = text.toLowerCase()\n const labels = dayPeriodLabels(locale)\n if (lower.includes(labels.PM.toLowerCase())) return \"PM\"\n if (lower.includes(labels.AM.toLowerCase())) return \"AM\"\n if (/\\bp\\.?\\s?m?\\.?\\b/.test(lower)) return \"PM\"\n if (/\\ba\\.?\\s?m?\\.?\\b/.test(lower)) return \"AM\"\n return undefined\n}\n\nconst inRange = (n: number, min: number, max: number) => Number.isInteger(n) && n >= min && n <= max\n\n/**\n * Parse typed text back into a `CalendarDateTime`. Reads digit runs in the locale's field order\n * (so any separator works — `20/10/2026 14:30`, `20.10.2026 14h30` — but run-together digits like\n * `1430` read as one number); the\n * date is required, the time is optional — omitted fields keep `fallbackTime` (the current\n * value's), else midnight. In 12h mode a missing period reads AM, and a 13–23 hour is taken as\n * 24h as-typed. Returns `undefined` for anything that isn't a real date/time (`02/30/2026`,\n * `25:00`), never a silently constrained one.\n */\nexport const parseDateTimeText = (\n text: string,\n options: DateTimeTextOptions,\n fallbackTime?: { hour: number; minute: number; second: number },\n): CalendarDateTime | undefined => {\n const numbers = text.match(/\\d+/g)?.map(Number) ?? []\n const order = fieldOrder(options)\n const field = (name: NumericField) => {\n const index = order.indexOf(name)\n return index === -1 ? undefined : numbers[index]\n }\n\n const rawYear = field(\"year\")\n const month = field(\"month\")\n const day = field(\"day\")\n if (rawYear === undefined || month === undefined || day === undefined) return undefined\n const year = rawYear < 100 ? 2000 + rawYear : rawYear\n\n const typedHour = field(\"hour\")\n let hour = typedHour ?? fallbackTime?.hour ?? 0\n if (typedHour !== undefined && is12Hour(options.hourCycle) && inRange(typedHour, 0, 12)) {\n hour = to24Hour(typedHour, readPeriod(text, options.locale) ?? \"AM\")\n }\n const minute = field(\"minute\") ?? (typedHour === undefined ? fallbackTime?.minute : 0) ?? 0\n const second = field(\"second\") ?? (typedHour === undefined ? fallbackTime?.second : 0) ?? 0\n\n if (!inRange(month, 1, 12) || !inRange(day, 1, 31) || !inRange(year, 1, 9999)) return undefined\n if (!inRange(hour, 0, 23) || !inRange(minute, 0, 59) || !inRange(second, 0, 59)) return undefined\n const value = new CalendarDateTime(year, month, day, hour, minute, second)\n // `CalendarDateTime` constrains out-of-range days (Feb 30 → Feb 28) instead of rejecting them.\n return value.day === day ? value : undefined\n}\n","\"use client\"\n\nimport {\n DatePicker as Ark,\n type DatePickerDateRangePreset as DateRangePreset,\n type DateValue,\n type DatePickerDateView as DateView,\n type UseDatePickerContext,\n} from \"@ark-ui/react/date-picker\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { DateFormatter, getLocalTimeZone, toCalendarDateTime, today } from \"@internationalized/date\"\nimport { type FocusEvent, type ReactNode, type Ref, useRef, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport type { DatePredicate } from \"../../lib/date-predicates\"\nimport {\n calendarValueToDate,\n type DateRangeValue,\n dateToCalendarValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { NestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button } from \"../button/button\"\nimport { type CalendarTranslations, resolveCalendarTranslations } from \"../calendar/calendar\"\nimport {\n CalendarBody,\n type CalendarBodyClassNames,\n calendarGridWidth,\n} from \"../calendar/calendar-body\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n shellGap,\n} from \"../input/input\"\nimport { CalendarIcon, CloseIcon } from \"../popover/icons\"\nimport { Popover, popoverClearTrigger, popoverPanel } from \"../popover/popover\"\nimport {\n type HourCycle,\n is12Hour,\n resolveHourCycle,\n to12Hour,\n to24Hour,\n} from \"../time-input/hour-cycle\"\nimport { TimeRow, type TimeRowTranslations, timeRowMinWidth } from \"../time-input/time-row\"\nimport { formatDateTimeText, parseDateTimeText } from \"./date-time-text\"\n\n/**\n * DatePicker — a trigger + popover calendar on Ark UI's `date-picker` machine, composing\n * `Calendar`'s shared grid module (`calendar-body.tsx`) and `TimeInput`'s shared time row\n * (`time-row.tsx`). `range` and `withTime` cover all four date combinations; `DateRangePicker`,\n * `DateTimePicker`, and `DateTimeRangePicker` are thin named presets pinning those two flags.\n *\n * - Value is a native `Date | null` (or `{ start, end }` under `range`) — the machine's\n * `DateValue` array contract never leaks out; `lib/date-value.ts` is the one conversion\n * boundary both directions go through, exactly as `Calendar` uses it.\n * - `withConfirm` stages the selection in local state; only Apply calls the outer `onChange`,\n * Cancel reverts. Without it, single dates commit + close on pick and ranges commit on the\n * second click (both Ark-native) — except under `withTime`, where a pick commits but keeps\n * the panel open so the time row can still be set (outside click / Escape closes it).\n * - `presets` renders a sidebar of quick-pick shortcuts — range shortcuts (Ark's own\n * `DateRangePreset` union, or a custom `{ range }`) under `range`; single-date shortcuts\n * (a custom `{ date }`) otherwise. `true` resolves to a mode-appropriate default set.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s; pair with `lib/date-predicates.ts`'s\n * helpers (`disablePast()`, `disableWeekends()`, …), re-exported from this same barrel.\n * - `typeable` swaps the plain button trigger for a text input, so a date can be typed (and\n * parsed on blur / Enter) in addition to picked from the calendar — the leading icon becomes a\n * real open-calendar button alongside it. Opt-in (default `false`); single dates only (see\n * the prop's own doc comment). Under `withTime` the input carries the time too\n * (`date-time-text.ts`).\n *\n * <DatePicker label=\"Start date\" value={date} onChange={setDate} clearable />\n * <DateRangePicker withTime presets withConfirm value={range} onChange={setRange} />\n */\n\nconst datePickerPresets = cn(\n \"flex shrink-0 flex-col gap-0.5 border-e p-1\",\n \"border-brand-900/20 dark:border-white/15\",\n)\n\nconst presetTrigger = cn(\n \"w-full cursor-pointer rounded-xs px-2 py-1.5 text-start text-sm whitespace-nowrap transition-colors\",\n \"hover:bg-gray-light-100 dark:hover:bg-gray-dark-800\",\n focusStyles({ offset: false }),\n)\n\nconst timePanelLabel = \"text-xs font-medium text-gray-light-500 dark:text-gray-dark-400\"\n\n/** `typeable`'s leading calendar icon, promoted from a decorative span (the button-trigger case)\n * to a real open-calendar button — same base look as `inputSlot`, plus the family's interactive-\n * icon treatment (compare `popoverClearTrigger`). `outline-none`: the shell's own `:has()` rule\n * (`shellChrome` in `input.tsx`) already rings the *whole* control on this button's focus-visible\n * state, so its own native outline would just double up. */\nconst datePickerIconTrigger = cn(\n inputSlot,\n \"cursor-pointer rounded-xs outline-none transition-colors hover:text-gray-light-700 dark:hover:text-gray-dark-200 disabled:cursor-not-allowed\",\n)\n\n/** The main column (calendar + time row footer) has no explicit width of its own, and neither\n * does the popover above it — deliberately, so the popover sizes to its content. But once the\n * time row's Hour/Minute/(Second) fields are `flex-1` (grow to fill the row), that becomes\n * circular: the row wants to size off \"however much space is available,\" and with nothing\n * concrete above it to measure against, browsers resolve a flex container's own intrinsic width\n * generously when it holds `flex-grow` items — the row (and everything above it) ends up far\n * wider than the calendar actually needs, even for a single time row. Giving the column an\n * explicit width tied to the calendar's own geometry (`calendarGridWidth`, shared with\n * `calendar-body.tsx`'s own month/year grids) breaks that circularity: the row now grows to\n * fill a *real* width instead of an ambiguous one.\n *\n * That width is only ever tied to the *calendar* grid, though — under `withTime`, the column\n * must be at least as wide as the time row itself needs (`timeRowMinWidth`), or the same\n * `flex-1` + `min-w-0` fields that motivated a fixed width in the first place shrink below their\n * content size instead of growing: with the AM/PM toggle present at a single month, the\n * calendar-only width is narrower than Hour+Minute+Period need, and the `<input>`s get starved. */\n\nconst pad = (n: number) => String(n).padStart(2, \"0\")\n\n/** Hidden-input serialization. `DateValue#toString()` isn't safe to call directly here: a\n * `ZonedDateTime` (what our own `dateToCalendarValue` produces for a `defaultValue`/`value`\n * passed in) stringifies with a full offset + IANA zone suffix, while a plain `CalendarDate`\n * (what a day-grid click produces) stringifies as a clean date — two different formats for the\n * same picked day depending on provenance. Read the wall-calendar fields directly instead.\n * Whether to append the time portion is driven by the picker's own `withTime` flag, not by\n * whether the value happens to carry an `hour` field — a `ZonedDateTime` always has one (even\n * at local midnight), so that structural check can't tell \"date-only\" from \"with time\" apart. */\nexport const serializeDateValue = (value: DateValue, withTime: boolean): string => {\n const date = `${value.year}-${pad(value.month)}-${pad(value.day)}`\n if (!withTime) return date\n const time = \"hour\" in value ? value : { hour: 0, minute: 0, second: 0 }\n return `${date}T${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}`\n}\n\nexport type DatePickerClassNames = {\n field?: string\n control?: string\n content?: string\n presets?: string\n calendar?: CalendarBodyClassNames\n timePanel?: { hour?: string; minute?: string; second?: string; period?: string }\n footer?: string\n}\n\n/** `value`/`range`-shaped entries are for `range` mode; `date`-shaped entries are for single-date\n * mode. Nothing prevents mixing them for the picker's current mode — the shape you pass is\n * trusted, not validated at runtime (a mismatched entry just doesn't produce useful behavior;\n * `api.setValue`/`getRangePresetValue` are mode-agnostic in the underlying machine). */\nexport type DatePreset =\n | { label: string; value: DateRangePreset }\n | { label: string; range: { start: Date; end: Date } | null }\n | { label: string; date: Date | null }\n\n/** Identifies each entry `getDefaultPresets` builds for `presets={true}`, so a `translations`\n * override can target one label without redefining the whole set. */\nexport type DatePickerPresetId =\n | \"today\"\n | \"yesterday\"\n | \"tomorrow\"\n | \"nextWeek\"\n | \"thisWeek\"\n | \"lastWeek\"\n | \"thisMonth\"\n | \"lastMonth\"\n | \"thisYear\"\n | \"allTime\"\n\n/** One unified `translations` prop rather than one per string source — Ark's own accessible\n * names, the `presets={true}` default labels, and the embedded time row's strings all belong to\n * the same `DatePicker` instance a consumer is localizing. English defaults throughout;\n * unset keys keep their built-in text. */\nexport type DatePickerTranslations = Partial<CalendarTranslations> &\n TimeRowTranslations & {\n /** The `withConfirm` footer's revert button. Default `\"Cancel\"`. */\n cancel?: string\n /** The `withConfirm` footer's commit button. Default `\"Apply\"`. */\n apply?: string\n /** The embedded time row's label under `range` + `withTime` (first row). Default `\"Start time\"`. */\n startTime?: string\n /** The embedded time row's label under `range` + `withTime` (second row). Default `\"End time\"`. */\n endTime?: string\n /** Individual `presets={true}` default-set labels, keyed by id — override just the ones you\n * need without redefining the whole array. Pass your own `DatePreset[]` for full control. */\n presets?: Partial<Record<DatePickerPresetId, string>>\n }\n\nexport type DatePickerProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n // Widened from `HTMLButtonElement` alone: under `typeable` the focusable element is Ark's\n // `Input` (a real `<input>`), not the button trigger — `ref`/`onBlur` must be able to land on\n // either depending on that prop, since both are the same generic `DatePickerProps`.\n HTMLButtonElement | HTMLInputElement\n> &\n Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Adds an embedded HOUR/MINUTE (+ SECOND) time row; the value carries H/M too. */\n withTime?: boolean\n /** Months shown side by side. Default `1`, regardless of `range` — pass `2` to show a full\n * range without paging (matches `Calendar`'s own plain default). */\n numOfMonths?: number\n /** Always render 6 week rows (padding with adjacent-month days) instead of however many the\n * visible month(s) actually span (4–6) — keeps the popover's height constant while\n * navigating between months. */\n fixedWeeks?: boolean\n /** Preset sidebar — range shortcuts under `range`, single-date shortcuts otherwise. `true`\n * renders a mode-appropriate default set; an array is fully custom. See `DatePreset`. */\n presets?: DatePreset[] | boolean\n /** Stage the selection; commit only on Apply. Cancel reverts to the last committed value. */\n withConfirm?: boolean\n /** Renders a clear trigger once a value is set; emits `null` (or an all-null range). */\n clearable?: boolean\n /** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.\n * Called with this component's own resolved `timeZone` as its second argument, so a predicate\n * reads the candidate day in the same zone the grid renders it in. */\n isDateUnavailable?: DatePredicate\n /** Renders a text input (typing, blur-to-parse, `Enter`-to-commit) alongside the\n * calendar-icon trigger, instead of the plain button-only trigger. Opt-in — default `false`\n * keeps the click-to-open button.\n *\n * Without `withTime` this is Ark's own `Input` anatomy part (a numeric date). Under\n * `withTime` it shows and parses a numeric date + time in the locale's own field order\n * (`10/20/2026, 02:30 PM`, `20/10/2026 14:30`) — typing just a date keeps the current time.\n * `range` (cross-field validation across two inputs) is out of scope and falls back to the\n * button trigger. */\n typeable?: boolean\n min?: Date\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"`). */\n minView?: DateView\n maxView?: DateView\n /** Overrides the active locale context. Drives month/day names, first-day-of-week, and the\n * embedded time row's 12h/24h default. */\n locale?: string\n /** Overrides the local time zone for every `Date ↔ DateValue` conversion. Default\n * `getLocalTimeZone()` — **not** Ark's own machine default (`\"UTC\"`). */\n timeZone?: string\n /** Force 12-hour or 24-hour display for the embedded time row, overriding the locale default. */\n format?: 12 | 24\n /** Force a specific hour cycle, overriding the locale default and `format`. */\n hourCycle?: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the embedded time row's empty Hour/Minute/Second fields — see\n * TimeRow's `placeholder`. Default `\"--\"`. */\n timePlaceholder?: string\n /** Overrides built-in English strings — Ark's own accessible names, the `presets={true}`\n * default labels, Cancel/Apply, Start/End time, and the embedded time row's Hour/Minute/\n * Second/Period labels. Unlike `locale`, nothing here auto-derives. Partial — unset keys\n * keep their English default. */\n translations?: DatePickerTranslations\n /** Placeholder shown while no date is selected. */\n placeholder?: string\n /** Inline-start adornment. Defaults to a calendar icon. */\n startSlot?: ReactNode\n size?: Size\n variant?: InputVariant\n /** Render the panel in a Portal so it escapes clipping ancestors.\n * 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 className?: string\n classNames?: DatePickerClassNames\n }\n\n/** Ark's built-in `DateRangePreset` union has no \"today\" / \"yesterday\" / \"all time\" member\n * (confirmed in `@zag-js/date-utils`'s types) — those three are hand-built here from\n * `today(timeZone)`; the rest map straight to Ark's own string presets. The single-date set\n * (non-`range`) is a different shape entirely, not a trimmed-down copy of the range one — \"This\n * week\"/\"This month\"/etc. are inherently range-shaped and don't collapse to one date. */\nconst getDefaultPresets = (\n range: boolean,\n timeZone: string,\n labels?: Partial<Record<DatePickerPresetId, string>>,\n): DatePreset[] => {\n const now = today(timeZone)\n const toDate = (value: typeof now) => calendarValueToDate(value, timeZone)\n const label = (id: DatePickerPresetId, fallback: string) => labels?.[id] ?? fallback\n if (!range) {\n return [\n { label: label(\"today\", \"Today\"), date: toDate(now) },\n { label: label(\"yesterday\", \"Yesterday\"), date: toDate(now.subtract({ days: 1 })) },\n { label: label(\"tomorrow\", \"Tomorrow\"), date: toDate(now.add({ days: 1 })) },\n { label: label(\"nextWeek\", \"Next week\"), date: toDate(now.add({ days: 7 })) },\n ]\n }\n const yesterday = now.subtract({ days: 1 })\n return [\n { label: label(\"today\", \"Today\"), range: { start: toDate(now), end: toDate(now) } },\n {\n label: label(\"yesterday\", \"Yesterday\"),\n range: { start: toDate(yesterday), end: toDate(yesterday) },\n },\n { label: label(\"thisWeek\", \"This week\"), value: \"thisWeek\" },\n { label: label(\"lastWeek\", \"Last week\"), value: \"lastWeek\" },\n { label: label(\"thisMonth\", \"This month\"), value: \"thisMonth\" },\n { label: label(\"lastMonth\", \"Last month\"), value: \"lastMonth\" },\n { label: label(\"thisYear\", \"This year\"), value: \"thisYear\" },\n { label: label(\"allTime\", \"All time\"), range: null },\n ]\n}\n\nconst PresetsRail = ({\n presets,\n range,\n timeZone,\n withConfirm,\n translations,\n className,\n}: {\n presets: DatePreset[] | boolean\n /** Which default set `presets === true` resolves to — irrelevant once `presets` is a concrete array. */\n range?: boolean\n timeZone: string\n withConfirm?: boolean\n /** Overrides individual `presets={true}` default-set labels, keyed by id. No effect on a\n * custom `DatePreset[]`. */\n translations?: Partial<Record<DatePickerPresetId, string>>\n className?: string\n}) => {\n const resolved =\n presets === true\n ? getDefaultPresets(Boolean(range), timeZone, translations)\n : presets === false\n ? []\n : presets\n if (resolved.length === 0) return null\n return (\n <Ark.Context>\n {(api) => (\n <div className={cn(datePickerPresets, className)}>\n {resolved.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n // Not `Ark.PresetTrigger`: its own onClick always sends `PRESET.CLICK`, which the\n // machine transitions unconditionally to \"focused\" (closed) regardless of\n // `closeOnSelect` — there's no way to keep it open under `withConfirm`. Resolve the\n // preset's value ourselves and set it via `api.setValue`, which only sets the value\n // (no state-machine transition), then close explicitly only when not staging.\n onClick={() => {\n const values =\n \"value\" in preset\n ? api.getRangePresetValue(preset.value)\n : \"range\" in preset\n ? (toArkValues(preset.range, timeZone) ?? [])\n : (toArkValues(preset.date, timeZone) ?? [])\n api.setValue(values)\n if (!withConfirm) api.setOpen(false)\n }}\n aria-label={preset.label}\n className={presetTrigger}\n >\n {preset.label}\n </button>\n ))}\n </div>\n )}\n </Ark.Context>\n )\n}\n\ntype DisplayTime = {\n hour: number | null\n minute: number | null\n second: number | null\n period: \"AM\" | \"PM\" | null\n}\n\nconst emptyDisplayTime: DisplayTime = { hour: null, minute: null, second: null, period: null }\n\n/** Derive display-space fields (1–12 or 0–23, + period) from the machine's own `DateValue` — a\n * plain `CalendarDate` (no time picked yet) has no `hour`, so it reads as all-null. */\nconst toDisplayTime = (value: DateValue | undefined, twelveHour: boolean): DisplayTime => {\n if (!value || !(\"hour\" in value)) return emptyDisplayTime\n const { hour, period } = twelveHour ? to12Hour(value.hour) : { hour: value.hour, period: null }\n return { hour, minute: value.minute, second: value.second ?? null, period }\n}\n\n/** The inverse of `toDisplayTime` — merges a display-space edit into a `setTime`-ready payload.\n * Missing fields default to midnight, same rule `TimeInput` uses for its own first edit. */\nconst fromDisplayTime = (\n display: DisplayTime,\n twelveHour: boolean,\n): { hour: number; minute: number; second?: number } => {\n const hour = twelveHour\n ? to24Hour(display.hour ?? 12, display.period ?? \"AM\")\n : (display.hour ?? 0)\n const minute = display.minute ?? 0\n return display.second != null ? { hour, minute, second: display.second } : { hour, minute }\n}\n\n/** `api.setTime`, except that a time edit with no day picked yet lands on *today* instead of being\n * dropped — Ark's own `setTime` silently no-ops without a date at that index, so typing a time\n * first used to do nothing at all. Only the first row can hit that (the second is disabled until\n * a range has both ends). `setValue` keeps today within `min`/`max`, like Ark's `selectToday`;\n * a today that `isDateUnavailable` rules out isn't auto-picked. */\nconst setTimeOrToday = (\n api: UseDatePickerContext,\n time: { hour: number; minute: number; second?: number },\n index: number,\n timeZone: string,\n) => {\n if (api.value[index] || index !== 0) return api.setTime(time, index)\n const day = today(timeZone)\n if (api.isUnavailable(day)) return\n api.setValue([toCalendarDateTime(day).set(time)])\n}\n\nexport type TimePanelRowProps = {\n value: DateValue | undefined\n onSetTime: (time: { hour: number; minute: number; second?: number }) => void\n label?: string\n disabled?: boolean\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the row's empty Hour/Minute/Second fields — see TimeRow's\n * `placeholder`. 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 classNames?: DatePickerClassNames[\"timePanel\"] & { root?: string }\n}\n\n/** One HOUR/MINUTE(+SECOND)+AM/PM row, bridging `TimeRow`'s display-space props to a specific\n * `api.value` index via `api.setTime(time, index)` — the same shared `TimeRow` `TimeInput`\n * wraps with its own local state, wrapped here with the machine's state instead. */\nconst TimePanelRow = ({\n value,\n onSetTime,\n label,\n disabled,\n hourCycle,\n minuteStep,\n withSeconds,\n placeholder,\n locale,\n translations,\n size,\n variant,\n classNames,\n}: TimePanelRowProps) => {\n const twelveHour = is12Hour(hourCycle)\n const display = toDisplayTime(value, twelveHour)\n const patch = (partial: Partial<DisplayTime>) =>\n onSetTime(fromDisplayTime({ ...display, ...partial }, twelveHour))\n\n return (\n <div className={cn(\"flex flex-col gap-1\", classNames?.root)}>\n {label && <span className={timePanelLabel}>{label}</span>}\n <TimeRow\n hour={display.hour}\n minute={display.minute}\n second={display.second}\n onHourChange={(hour) => patch({ hour })}\n onMinuteChange={(minute) => patch({ minute })}\n onSecondChange={withSeconds ? (second) => patch({ second }) : undefined}\n period={display.period}\n onPeriodChange={(period) => patch({ period })}\n hourCycle={hourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={placeholder}\n locale={locale}\n translations={translations}\n size={size}\n variant={variant}\n disabled={disabled}\n classNames={classNames}\n />\n </div>\n )\n}\n\n/**\n * `typeable` + `withTime`'s own text input, standing in for Ark's `Input` part — which can't carry\n * a time (see `date-time-text.ts`). It still declares `data-part=\"input\"` inside the Control, so\n * the machine treats it as its input: excluded from interact-outside dismissal, focused on close,\n * and kept in sync with every value change (day pick, time row, clear) through the Root's\n * `format`, which is this same numeric text. Left uncontrolled for that reason — the only thing\n * added here is committing typed text: parsed on blur / `Enter`, then set through `api.setValue`;\n * text that doesn't parse (or lands on an unavailable day) reverts to the current value.\n */\nconst DateTimeTextInput = ({\n api,\n options,\n timeZone,\n ref,\n onBlur,\n placeholder,\n disabled,\n readOnly,\n invalid,\n testId,\n}: {\n api: UseDatePickerContext\n options: Parameters<typeof parseDateTimeText>[1]\n timeZone: string\n ref?: Ref<HTMLInputElement>\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n placeholder?: string\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n testId?: string\n}) => {\n const field = useFieldContext()\n const current = api.value[0]\n const show = (input: HTMLInputElement, value: DateValue | undefined) => {\n input.value = value ? formatDateTimeText(value, options, timeZone) : \"\"\n }\n const commit = (input: HTMLInputElement) => {\n const text = input.value.trim()\n if (text === \"\") {\n if (current) api.clearValue({ focus: false })\n return\n }\n const fallback = current && \"hour\" in current ? current : undefined\n const next = parseDateTimeText(text, options, fallback)\n if (!next || api.isUnavailable(next)) return show(input, current)\n api.setValue([next])\n api.setFocusedValue(next)\n // `setValue` is a no-op (and syncs nothing) when the parsed value equals the current one, so\n // normalize the typed text to the canonical format either way.\n show(input, next)\n }\n return (\n <input\n ref={ref}\n type=\"text\"\n data-scope=\"date-picker\"\n data-part=\"input\"\n autoComplete=\"off\"\n defaultValue={current ? formatDateTimeText(current, options, timeZone) : \"\"}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n aria-invalid={invalid || undefined}\n // Ark's own input-click handler, not `api.setOpen`: it opens with `src: \"input.click\"`,\n // which is what stops the machine from moving focus into the grid — typing has to keep\n // landing here. It also honours `openOnClick` and disabled/read-only on its own.\n onClick={api.getInputProps().onClick}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\" || event.nativeEvent.isComposing) return\n event.preventDefault()\n commit(event.currentTarget)\n }}\n onBlur={(event) => {\n if (!readOnly) commit(event.currentTarget)\n onBlur?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={inputControlClasses}\n />\n )\n}\n\nconst DatePickerImpl = <Range extends boolean = false>({\n withinPortal = true,\n container,\n range,\n withTime,\n numOfMonths = 1,\n fixedWeeks,\n presets,\n withConfirm,\n clearable,\n value,\n defaultValue,\n onChange,\n onBlur,\n isDateUnavailable,\n typeable,\n min,\n max,\n minView,\n maxView,\n locale,\n timeZone,\n format,\n hourCycle,\n minuteStep,\n withSeconds,\n timePlaceholder,\n translations,\n placeholder = \"Pick a date\",\n startSlot,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: DatePickerProps<Range>) => {\n const portalContainer = useOverlayContainer(container)\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = timeZone ?? getLocalTimeZone()\n const resolvedHourCycle = resolveHourCycle({ locale: resolvedLocale, format, hourCycle })\n const isInvalid = invalid || error != null\n const isRange = Boolean(range)\n // See `typeable`'s own doc comment: single dates only — `range` silently falls back to the\n // button trigger rather than erroring, so `typeable` composes safely with every other prop.\n // Under `withTime` the input is `DateTimeTextInput` instead of Ark's own date-only `Input`.\n const showTypeableInput = Boolean(typeable) && !isRange\n const dateTimeText = { locale: resolvedLocale, hourCycle: resolvedHourCycle, withSeconds }\n const controlRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n\n type Value = Range extends true ? DateRangeValue : Date | null\n const emptyValue = (isRange ? { start: null, end: null } : null) as Value\n\n // Reserved for the `withConfirm` staged layer only — the base value needs no local state,\n // Ark's machine natively supports controlled/uncontrolled `value`/`defaultValue`/`onValueChange`\n // the same way `Calendar` relies on it.\n const [committed, setCommitted] = useUncontrolled<Value>({\n value,\n defaultValue,\n finalValue: emptyValue,\n onChange,\n })\n const [staged, setStaged] = useState<Value>(committed)\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n // Ark's own default (`true`) auto-closes on a completed pick — under `withConfirm`\n // the picker must stay open for review until Apply/Cancel, and under `withTime` the day\n // is only half the value: closing on pick would hide the time row it still needs.\n // Otherwise leave Ark's default (single closes on pick, range on the second click).\n closeOnSelect={withConfirm || withTime ? false : undefined}\n // Ark's own default (`false`) requires the calendar-icon trigger to open the popover —\n // under `typeable` a click into the text field itself should open it too, matching the\n // combined type-or-pick affordance `typeable` is meant to offer. No-op when the Input\n // anatomy part isn't rendered (`!showTypeableInput`).\n openOnClick={showTypeableInput}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n minView={minView}\n maxView={maxView}\n value={toArkValues(withConfirm ? staged : value, resolvedTimeZone)}\n defaultValue={withConfirm ? undefined : toArkValues(defaultValue, resolvedTimeZone)}\n onValueChange={(details) => {\n const next = fromArkValues(details.value, isRange, resolvedTimeZone) as Value\n if (withConfirm) setStaged(next)\n else onChange?.(next)\n }}\n onOpenChange={(details) => {\n if (withConfirm && details.open) setStaged(committed)\n }}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(\n calendarValueToDate(dateValue, resolvedTimeZone),\n resolvedTimeZone,\n )\n : undefined\n }\n min={min ? dateToCalendarValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToCalendarValue(max, resolvedTimeZone) : undefined}\n // The typed date+time input shows (and Ark syncs into it) the same numeric text it parses.\n format={\n withTime && showTypeableInput\n ? (date) => formatDateTimeText(date, dateTimeText, resolvedTimeZone)\n : withTime\n ? (date, { locale: fmtLocale }) =>\n new DateFormatter(fmtLocale, { dateStyle: \"medium\", timeStyle: \"short\" }).format(\n calendarValueToDate(date, resolvedTimeZone),\n )\n : undefined\n }\n // Anchor to the Control (not `sameWidth`, unlike Select) — the popover hosts a full\n // calendar grid + presets rail, which needs its own intrinsic width, not the trigger's.\n positioning={{ getAnchorRect: () => controlRef.current?.getBoundingClientRect() ?? null }}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={isInvalid}\n className={cn(\"w-full\", className)}\n >\n <Ark.Context>\n {(api) => (\n <>\n <Ark.Control\n ref={controlRef}\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": true,\n \"data-with-end-slot\": true,\n })}\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(\n inputShell({ size, variant }),\n // A real `<input>` sits in the shell under `typeable` — leave the shell's own\n // cursor at the browser default (text-cursor over the input, pointer over the\n // icon trigger / clear button) instead of forcing pointer everywhere, matching\n // `Combobox`'s Control (see `combobox.tsx`) rather than `Select`'s button-only one.\n !showTypeableInput && \"cursor-pointer\",\n classNames?.control,\n )}\n >\n {showTypeableInput ? (\n <div className={cn(\"flex min-w-0 flex-1 items-center\", shellGap[size])}>\n {/* Ark sets its own accessible `aria-label` (\"Open calendar\" / \"Close\n calendar\") on the trigger regardless of children, so an icon-only button\n here is still accessible without a manual override. */}\n <Ark.Trigger className={datePickerIconTrigger}>\n {startSlot ?? <CalendarIcon />}\n </Ark.Trigger>\n {withTime ? (\n <DateTimeTextInput\n api={api}\n options={dateTimeText}\n timeZone={resolvedTimeZone}\n ref={mergeRefs<HTMLButtonElement | HTMLInputElement>(inputRef, ref)}\n onBlur={onBlur}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n invalid={isInvalid}\n testId={testId}\n />\n ) : (\n <Ark.Input\n ref={mergeRefs<HTMLButtonElement | HTMLInputElement>(inputRef, ref)}\n onBlur={onBlur}\n placeholder={placeholder}\n {...props({ \"data-testid\": testId })}\n className={inputControlClasses}\n />\n )}\n </div>\n ) : (\n <Ark.Trigger\n ref={mergeRefs<HTMLButtonElement | HTMLInputElement>(triggerRef, ref)}\n onBlur={onBlur}\n aria-invalid={isInvalid || undefined}\n {...props({ \"data-testid\": testId })}\n className={cn(\n \"flex min-w-0 flex-1 cursor-pointer items-center bg-transparent text-start outline-none disabled:cursor-not-allowed\",\n shellGap[size],\n )}\n >\n <span className={inputSlot} aria-hidden>\n {startSlot ?? <CalendarIcon />}\n </span>\n <span className=\"min-w-0 flex-1 truncate text-start\">\n {isRange ? (\n api.value.length === 0 ? (\n <span className={placeholderColor}>{placeholder}</span>\n ) : (\n // Not `Ark.RangeText`: despite the name, it renders the calendar's\n // *visible* month/year viewport (the same text the header's ViewTrigger\n // shows), not the selected range — `datePicker.visibleRangeText` in Ark's\n // own source. Build the real selected-range text from `valueAsString`\n // instead (the same per-value formatted strings `Ark.ValueText` uses).\n api.valueAsString.join(\" – \")\n )\n ) : (\n <Ark.ValueText placeholder={placeholder} />\n )}\n </span>\n </Ark.Trigger>\n )}\n {clearable && (\n // Ark's own ClearTrigger already self-hides (`hidden`) while empty.\n <Ark.ClearTrigger className={popoverClearTrigger}>\n <CloseIcon />\n </Ark.ClearTrigger>\n )}\n </Ark.Control>\n\n {/* Holds an enclosing Modal/Drawer/Popover open while the calendar is; see `lib/overlay-layer.tsx`. */}\n <NestedLayer open={api.open} />\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content\n // `max-content` sizing (no `sameWidth`, see the positioning comment above)\n // means \"as if nothing below ever wraps\" — a `flex-wrap` time-row footer\n // wider than the calendar (two side-by-side \"Start time\"/\"End time\" rows\n // under `range` + `withTime`) would never actually wrap without a real width\n // constraint to shrink against; it'd just overflow off-screen on a narrow\n // viewport instead. `92vw` is generous enough to be a no-op on any normal\n // desktop width, only kicking in once there's genuinely no room.\n className={cn(\n popoverPanel,\n \"max-w-[92vw] flex-row flex-wrap items-stretch\",\n classNames?.content,\n )}\n >\n {presets && (\n <PresetsRail\n presets={presets}\n range={isRange}\n timeZone={resolvedTimeZone}\n withConfirm={withConfirm}\n translations={translations?.presets}\n className={classNames?.presets}\n />\n )}\n <div\n className=\"flex min-w-0 flex-1 flex-col\"\n style={{\n width:\n Math.max(\n calendarGridWidth(size, numOfMonths),\n withTime ? timeRowMinWidth(size, resolvedHourCycle, withSeconds) : 0,\n ) + 16, // Take the x padding into account\n }}\n >\n <Popover.Body\n className={cn(\"p-2\", withTime || withConfirm ? \"border-b\" : undefined)}\n >\n <CalendarBody\n numOfMonths={numOfMonths}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames?.calendar}\n />\n </Popover.Body>\n {withTime && (\n <Popover.Footer\n className={cn(\n \"flex gap-x-2 gap-y-2 pb-2\",\n // Stacked by default — side by side only widens to match the extra\n // room multiple months already provide; with a single month, sitting\n // two time rows side by side would force the popover wider than the\n // calendar above them for no reason.\n numOfMonths > 1 ? \"flex-row flex-wrap\" : \"flex-col\",\n classNames?.footer,\n )}\n >\n <TimePanelRow\n value={api.value[0]}\n onSetTime={(time) => setTimeOrToday(api, time, 0, resolvedTimeZone)}\n label={isRange ? (translations?.startTime ?? \"Start time\") : undefined}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n {isRange && (\n <TimePanelRow\n value={api.value[1]}\n onSetTime={(time) => api.setTime(time, 1)}\n label={translations?.endTime ?? \"End time\"}\n disabled={api.value.length < 2}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n )}\n </Popover.Footer>\n )}\n {withConfirm && (\n <Popover.Footer className=\"flex justify-end gap-2 pb-2\">\n <Button\n variant=\"subtle\"\n color=\"neutral\"\n size={size}\n onClick={() => {\n setStaged(committed)\n api.setOpen(false)\n }}\n >\n {translations?.cancel ?? \"Cancel\"}\n </Button>\n <Button\n size={size}\n onClick={() => {\n setCommitted(staged)\n api.setOpen(false)\n }}\n >\n {translations?.apply ?? \"Apply\"}\n </Button>\n </Popover.Footer>\n )}\n </div>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n\n {name &&\n (isRange ? (\n <>\n <input\n type=\"hidden\"\n name={`${name}Start`}\n value={\n api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"\n }\n />\n <input\n type=\"hidden\"\n name={`${name}End`}\n value={\n api.value[1] ? serializeDateValue(api.value[1], Boolean(withTime)) : \"\"\n }\n />\n </>\n ) : (\n <input\n type=\"hidden\"\n name={name}\n value={api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"}\n />\n ))}\n </>\n )}\n </Ark.Context>\n </Ark.Root>\n </FieldShell>\n )\n}\n\nexport const DatePicker = Object.assign(DatePickerImpl, {\n Root: Ark.Root,\n Context: Ark.Context,\n Control: Ark.Control,\n Input: Ark.Input,\n Trigger: Ark.Trigger,\n ClearTrigger: Ark.ClearTrigger,\n Content: Ark.Content,\n Presets: PresetsRail,\n Calendar: CalendarBody,\n TimePanel: TimeRow,\n TimePanelRow: TimePanelRow,\n Footer: Popover.Footer,\n}) as (<Range extends boolean = false>(props: DatePickerProps<Range>) => ReactNode) & {\n Root: typeof Ark.Root\n Context: typeof Ark.Context\n Control: typeof Ark.Control\n Input: typeof Ark.Input\n Trigger: typeof Ark.Trigger\n ClearTrigger: typeof Ark.ClearTrigger\n Content: typeof Ark.Content\n Presets: typeof PresetsRail\n Calendar: typeof CalendarBody\n TimePanel: typeof TimeRow\n TimePanelRow: typeof TimePanelRow\n Footer: typeof Popover.Footer\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { controlIndicator } from './chunk-NF5JM2YO.js';
2
- import { fieldLabel, FieldShell, fieldRoot } from './chunk-UNSAA7YG.js';
2
+ import { fieldLabel, FieldShell, fieldRoot } from './chunk-FHG54IT5.js';
3
3
  import { CheckIcon } from './chunk-IG7FBZVM.js';
4
4
  import { props } from './chunk-WYCMIIRR.js';
5
5
  import { cn } from './chunk-QP4I37PA.js';
@@ -89,5 +89,5 @@ var Checkbox = ({
89
89
  };
90
90
 
91
91
  export { Checkbox };
92
- //# sourceMappingURL=chunk-P7A3BCAC.js.map
93
- //# sourceMappingURL=chunk-P7A3BCAC.js.map
92
+ //# sourceMappingURL=chunk-OWG4BCQR.js.map
93
+ //# sourceMappingURL=chunk-OWG4BCQR.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/checkbox/checkbox.tsx"],"names":["Ark"],"mappings":";;;;;;;;;AAmFO,IAAM,WAAW,CAAC;AAAA,EACvB,OAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP,OAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,KAAqB;AAGnB,EAAA,MAAM,SAAA,GAAY,WAAW,KAAA,IAAS,IAAA;AAKtC,EAAA,MAAM,QAAA,GAAW,KAAA,IAAS,IAAA,KAAS,WAAA,IAAe,QAAQ,KAAA,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AU,CAAA,EACb,CAAA;AAAA,0BACA,GAAA,CAACA,WAAI,SAAA,EAAJ,EAAc,eAAa,IAAA,EAC1B,QAAA,kBAAA,GAAA,CAAC,SAAM,CAAA,EACT;AAAA,SAAA,EACF,CAAA;AAAA,QAEC,QAAA,mBACC,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,SAAA,CAAU,EAAE,IAAA,EAAM,CAAA,EAAG,UAAA,EAAY,KAAK,CAAA,EACtD,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,0BACD,GAAA,CAAC,UAAA,EAAA,EAAW,WAAA,EAA0B,KAAA,EAAc,IAAA,EAClD,QAAA,kBAAA,GAAA,CAACA,UAAA,CAAI,WAAA,EAAJ,EAAgB,GAAA,EAAU,MAAA,EAAgB,CAAA,EAC7C;AAAA,SAAA,EACF,oBAEA,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,0BACD,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,WAAA;AAAA,cACA,KAAA;AAAA,cACA,IAAA;AAAA,cACA,WAAW,UAAA,EAAY,KAAA;AAAA,cAEvB,QAAA,kBAAA,GAAA,CAACA,UAAA,CAAI,WAAA,EAAJ,EAAgB,KAAU,MAAA,EAAgB;AAAA;AAAA;AAC7C,SAAA,EACF;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-P7A3BCAC.js","sourcesContent":["\"use client\"\n\nimport { Checkbox as Ark } from \"@ark-ui/react/checkbox\"\nimport { Minus } from \"lucide-react\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { FieldShell, fieldLabel, fieldRoot } from \"../field/field\"\nimport { CheckIcon } from \"../popover/icons\"\nimport { type ControlIndicatorVariant, controlIndicator } from \"./control\"\n\n/**\n * Checkbox — a single boolean (or tri-state) control on Ark UI's Checkbox\n * machine. The label sits inline beside the box, rendered through the\n * checkbox's own `Ark.Label` part (not `Field`'s) so it stays correctly\n * wired to the hidden input's `aria-labelledby` and — critically — carries no\n * layout footprint when it's visually hidden (e.g. `classNames.label:\n * \"sr-only\"`): an absolutely-positioned flex child isn't a flex item at all,\n * so it can't pick up the root's `gap-2`. `description` / `error` live below\n * it via the shared `Field` scaffold, so a `Checkbox` is accessible and\n * complete on its own. Implements the kit's `FormControlProps` contract: the\n * `ref` and `onBlur` land on the submittable hidden `<input>`, and `name`\n * wires it into native form submission.\n *\n * - The checked state is `boolean | \"indeterminate\"`; `onCheckedChange`\n * hands you that next value directly (the indeterminate state never sets\n * itself — drive it from the parent, e.g. a \"select all\" header).\n * - `invalid` is OR'd with `error != null`, matching the rest of the family,\n * so a form library can flip the red state independently of the message.\n *\n * Two `variant`s decide the checked fill: `default` is a neutral, monochrome\n * box (palette-independent), while `filled` tints the checked fill with the\n * active palette via `data-color` + the `--c-solid` slot var. The box is\n * palette-independent at rest, and the focus ring is always the brand ring.\n */\n\nexport type CheckboxProps = WithTestId & {\n /** Controlled checked state. `\"indeterminate\"` renders the partial mark. */\n checked?: boolean | \"indeterminate\"\n /** Uncontrolled initial checked state. */\n defaultChecked?: boolean | \"indeterminate\"\n /** Fires with the next checked state (a value, not a DOM event). */\n onCheckedChange?: (checked: boolean | \"indeterminate\") => void\n /** Inline label beside the box. */\n label?: ReactNode\n /** Helper text above the control. */\n description?: ReactNode\n /** Error message below the control; its presence sets the invalid state. */\n error?: ReactNode\n /** Required flag (and, with a label, the red asterisk). */\n required?: boolean\n /** Red invalid state, OR'd with `error != null`. */\n invalid?: boolean\n /** Dims and blocks interaction. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n size?: Size\n /** Checked-fill treatment: `default` (monochrome) or `filled` (palette-colored). */\n variant?: ControlIndicatorVariant\n color?: Color\n /** Field name for native form submission. */\n name?: string\n /** Submitted value when checked (defaults to `\"on\"`). */\n value?: string\n /** Explicit id for label association. */\n id?: string\n /** Lands on the hidden `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hidden `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n className?: string\n classNames?: {\n root?: string\n control?: string\n label?: string\n field?: string\n }\n}\n\nexport const Checkbox = ({\n checked,\n defaultChecked,\n onCheckedChange,\n label,\n description,\n error,\n required,\n invalid,\n disabled,\n readOnly,\n size = \"md\",\n variant,\n color,\n name,\n value,\n id,\n ref,\n onBlur,\n className,\n classNames,\n testId,\n}: CheckboxProps) => {\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n // A visible label above description/error needs the two grouped into one\n // flex-col item, or they'd land side by side in the root's row instead of\n // stacked. Label-only (incl. sr-only) never needs this extra wrapper.\n const hasStack = label != null && (description != null || error != null)\n\n const labelNode = label != null && (\n <Ark.Label\n className={cn(fieldLabel({ size }), !hasStack && \"min-w-0 flex-1\", classNames?.label)}\n >\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ms-0.5 text-red-500\">\n *\n </span>\n )}\n </Ark.Label>\n )\n\n return (\n <Ark.Root\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange ? (d) => onCheckedChange(d.checked) : undefined}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n value={value}\n id={id}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n // `relative` contains the absolutely positioned hidden input, which would\n // otherwise escape any scroller this control sits in.\n className={cn(\n \"relative inline-flex items-center gap-2 select-none\",\n className,\n classNames?.root,\n )}\n >\n <Ark.Control className={cn(controlIndicator({ size, variant }), classNames?.control)}>\n <Ark.Indicator>\n <CheckIcon />\n </Ark.Indicator>\n <Ark.Indicator indeterminate>\n <Minus />\n </Ark.Indicator>\n </Ark.Control>\n\n {hasStack ? (\n <div className={cn(fieldRoot({ size }), classNames?.field)}>\n {labelNode}\n <FieldShell description={description} error={error} size={size}>\n <Ark.HiddenInput ref={ref} onBlur={onBlur} />\n </FieldShell>\n </div>\n ) : (\n <>\n {labelNode}\n <FieldShell\n description={description}\n error={error}\n size={size}\n className={classNames?.field}\n >\n <Ark.HiddenInput ref={ref} onBlur={onBlur} />\n </FieldShell>\n </>\n )}\n </Ark.Root>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/checkbox/checkbox.tsx"],"names":["Ark"],"mappings":";;;;;;;;;AAmFO,IAAM,WAAW,CAAC;AAAA,EACvB,OAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP,OAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,KAAqB;AAGnB,EAAA,MAAM,SAAA,GAAY,WAAW,KAAA,IAAS,IAAA;AAKtC,EAAA,MAAM,QAAA,GAAW,KAAA,IAAS,IAAA,KAAS,WAAA,IAAe,QAAQ,KAAA,IAAS,IAAA,CAAA;AAEnE,EAAA,MAAM,SAAA,GAAY,SAAS,IAAA,oBACzB,IAAA;AAAA,IAACA,UAAA,CAAI,KAAA;AAAA,IAAJ;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,UAAA,CAAW,EAAE,IAAA,EAAM,CAAA,EAAG,CAAC,QAAA,IAAY,gBAAA,EAAkB,UAAA,EAAY,KAAK,CAAA;AAAA,MAEnF,QAAA,EAAA;AAAA,QAAA,KAAA;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AA,EACtD,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,0BACD,GAAA,CAAC,UAAA,EAAA,EAAW,WAAA,EAA0B,KAAA,EAAc,IAAA,EAClD,QAAA,kBAAA,GAAA,CAACA,UAAA,CAAI,WAAA,EAAJ,EAAgB,GAAA,EAAU,MAAA,EAAgB,CAAA,EAC7C;AAAA,SAAA,EACF,oBAEA,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,0BACD,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,WAAA;AAAA,cACA,KAAA;AAAA,cACA,IAAA;AAAA,cACA,WAAW,UAAA,EAAY,KAAA;AAAA,cAEvB,QAAA,kBAAA,GAAA,CAACA,UAAA,CAAI,WAAA,EAAJ,EAAgB,KAAU,MAAA,EAAgB;AAAA;AAAA;AAC7C,SAAA,EACF;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-OWG4BCQR.js","sourcesContent":["\"use client\"\n\nimport { Checkbox as Ark } from \"@ark-ui/react/checkbox\"\nimport { Minus } from \"lucide-react\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { FieldShell, fieldLabel, fieldRoot } from \"../field/field\"\nimport { CheckIcon } from \"../popover/icons\"\nimport { type ControlIndicatorVariant, controlIndicator } from \"./control\"\n\n/**\n * Checkbox — a single boolean (or tri-state) control on Ark UI's Checkbox\n * machine. The label sits inline beside the box, rendered through the\n * checkbox's own `Ark.Label` part (not `Field`'s) so it stays correctly\n * wired to the hidden input's `aria-labelledby` and — critically — carries no\n * layout footprint when it's visually hidden (e.g. `classNames.label:\n * \"sr-only\"`): an absolutely-positioned flex child isn't a flex item at all,\n * so it can't pick up the root's `gap-2`. `description` / `error` live below\n * it via the shared `Field` scaffold, so a `Checkbox` is accessible and\n * complete on its own. Implements the kit's `FormControlProps` contract: the\n * `ref` and `onBlur` land on the submittable hidden `<input>`, and `name`\n * wires it into native form submission.\n *\n * - The checked state is `boolean | \"indeterminate\"`; `onCheckedChange`\n * hands you that next value directly (the indeterminate state never sets\n * itself — drive it from the parent, e.g. a \"select all\" header).\n * - `invalid` is OR'd with `error != null`, matching the rest of the family,\n * so a form library can flip the red state independently of the message.\n *\n * Two `variant`s decide the checked fill: `default` is a neutral, monochrome\n * box (palette-independent), while `filled` tints the checked fill with the\n * active palette via `data-color` + the `--c-solid` slot var. The box is\n * palette-independent at rest, and the focus ring is always the brand ring.\n */\n\nexport type CheckboxProps = WithTestId & {\n /** Controlled checked state. `\"indeterminate\"` renders the partial mark. */\n checked?: boolean | \"indeterminate\"\n /** Uncontrolled initial checked state. */\n defaultChecked?: boolean | \"indeterminate\"\n /** Fires with the next checked state (a value, not a DOM event). */\n onCheckedChange?: (checked: boolean | \"indeterminate\") => void\n /** Inline label beside the box. */\n label?: ReactNode\n /** Helper text above the control. */\n description?: ReactNode\n /** Error message below the control; its presence sets the invalid state. */\n error?: ReactNode\n /** Required flag (and, with a label, the red asterisk). */\n required?: boolean\n /** Red invalid state, OR'd with `error != null`. */\n invalid?: boolean\n /** Dims and blocks interaction. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n size?: Size\n /** Checked-fill treatment: `default` (monochrome) or `filled` (palette-colored). */\n variant?: ControlIndicatorVariant\n color?: Color\n /** Field name for native form submission. */\n name?: string\n /** Submitted value when checked (defaults to `\"on\"`). */\n value?: string\n /** Explicit id for label association. */\n id?: string\n /** Lands on the hidden `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hidden `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n className?: string\n classNames?: {\n root?: string\n control?: string\n label?: string\n field?: string\n }\n}\n\nexport const Checkbox = ({\n checked,\n defaultChecked,\n onCheckedChange,\n label,\n description,\n error,\n required,\n invalid,\n disabled,\n readOnly,\n size = \"md\",\n variant,\n color,\n name,\n value,\n id,\n ref,\n onBlur,\n className,\n classNames,\n testId,\n}: CheckboxProps) => {\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n // A visible label above description/error needs the two grouped into one\n // flex-col item, or they'd land side by side in the root's row instead of\n // stacked. Label-only (incl. sr-only) never needs this extra wrapper.\n const hasStack = label != null && (description != null || error != null)\n\n const labelNode = label != null && (\n <Ark.Label\n className={cn(fieldLabel({ size }), !hasStack && \"min-w-0 flex-1\", classNames?.label)}\n >\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ms-0.5 text-red-500\">\n *\n </span>\n )}\n </Ark.Label>\n )\n\n return (\n <Ark.Root\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange ? (d) => onCheckedChange(d.checked) : undefined}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n value={value}\n id={id}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n // `relative` contains the absolutely positioned hidden input, which would\n // otherwise escape any scroller this control sits in.\n className={cn(\n \"relative inline-flex items-center gap-2 select-none\",\n className,\n classNames?.root,\n )}\n >\n <Ark.Control className={cn(controlIndicator({ size, variant }), classNames?.control)}>\n <Ark.Indicator>\n <CheckIcon />\n </Ark.Indicator>\n <Ark.Indicator indeterminate>\n <Minus />\n </Ark.Indicator>\n </Ark.Control>\n\n {hasStack ? (\n <div className={cn(fieldRoot({ size }), classNames?.field)}>\n {labelNode}\n <FieldShell description={description} error={error} size={size}>\n <Ark.HiddenInput ref={ref} onBlur={onBlur} />\n </FieldShell>\n </div>\n ) : (\n <>\n {labelNode}\n <FieldShell\n description={description}\n error={error}\n size={size}\n className={classNames?.field}\n >\n <Ark.HiddenInput ref={ref} onBlur={onBlur} />\n </FieldShell>\n </>\n )}\n </Ark.Root>\n )\n}\n"]}