@42-central/ui-react 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (591) hide show
  1. package/dist/{chunk-X6DESK37.js → chunk-2RRTT4AF.js} +17 -5
  2. package/dist/chunk-2RRTT4AF.js.map +1 -0
  3. package/dist/{chunk-TUP7WXQE.js → chunk-322I2RSV.js} +9 -6
  4. package/dist/chunk-322I2RSV.js.map +1 -0
  5. package/dist/{chunk-ISX3AM32.js → chunk-37SRSNLJ.js} +4 -4
  6. package/dist/{chunk-ISX3AM32.js.map → chunk-37SRSNLJ.js.map} +1 -1
  7. package/dist/{chunk-L5GH7LLD.js → chunk-3MFWUG5O.js} +4 -4
  8. package/dist/{chunk-L5GH7LLD.js.map → chunk-3MFWUG5O.js.map} +1 -1
  9. package/dist/{chunk-FQJNQW3G.js → chunk-3XQEOJCE.js} +8 -5
  10. package/dist/chunk-3XQEOJCE.js.map +1 -0
  11. package/dist/{chunk-JKFPRQB2.js → chunk-4LSZ5JWF.js} +3 -3
  12. package/dist/{chunk-JKFPRQB2.js.map → chunk-4LSZ5JWF.js.map} +1 -1
  13. package/dist/{chunk-V2QZG4IT.js → chunk-5HWFYYHW.js} +27 -9
  14. package/dist/chunk-5HWFYYHW.js.map +1 -0
  15. package/dist/{chunk-GEZYGBXY.js → chunk-6MVFCS46.js} +99 -42
  16. package/dist/chunk-6MVFCS46.js.map +1 -0
  17. package/dist/{chunk-NNPSBC7O.js → chunk-6WZSUS3U.js} +10 -9
  18. package/dist/chunk-6WZSUS3U.js.map +1 -0
  19. package/dist/chunk-6YRGP6PS.js +138 -0
  20. package/dist/chunk-6YRGP6PS.js.map +1 -0
  21. package/dist/{chunk-B5YHYI7E.js → chunk-ALANKV5Y.js} +23 -6
  22. package/dist/chunk-ALANKV5Y.js.map +1 -0
  23. package/dist/{chunk-IA6DCC3N.js → chunk-AUQPNDE5.js} +23 -13
  24. package/dist/chunk-AUQPNDE5.js.map +1 -0
  25. package/dist/{chunk-AKXALCUN.js → chunk-D7SW2E24.js} +4 -4
  26. package/dist/chunk-D7SW2E24.js.map +1 -0
  27. package/dist/{chunk-OXR7BXZA.js → chunk-DQIYYDFD.js} +4 -3
  28. package/dist/chunk-DQIYYDFD.js.map +1 -0
  29. package/dist/{chunk-HMNXNKDA.js → chunk-FCBYUN6F.js} +4 -4
  30. package/dist/{chunk-HMNXNKDA.js.map → chunk-FCBYUN6F.js.map} +1 -1
  31. package/dist/{chunk-2W7H43WL.js → chunk-FED6SJWM.js} +23 -14
  32. package/dist/chunk-FED6SJWM.js.map +1 -0
  33. package/dist/{chunk-7E7JNWOC.js → chunk-FEPIHXVI.js} +6 -5
  34. package/dist/chunk-FEPIHXVI.js.map +1 -0
  35. package/dist/{chunk-Y57NW6G7.js → chunk-G3YOSG3U.js} +4 -4
  36. package/dist/{chunk-Y57NW6G7.js.map → chunk-G3YOSG3U.js.map} +1 -1
  37. package/dist/chunk-GZN5CXMR.js +100 -0
  38. package/dist/chunk-GZN5CXMR.js.map +1 -0
  39. package/dist/{chunk-HCHGERDB.js → chunk-HCSZPBWV.js} +17 -115
  40. package/dist/chunk-HCSZPBWV.js.map +1 -0
  41. package/dist/{chunk-I4B3N3UX.js → chunk-HTVICHT4.js} +12 -7
  42. package/dist/chunk-HTVICHT4.js.map +1 -0
  43. package/dist/chunk-I7TC2C3I.js +163 -0
  44. package/dist/chunk-I7TC2C3I.js.map +1 -0
  45. package/dist/{chunk-7FPSQBWB.js → chunk-IBXYLO2J.js} +14 -13
  46. package/dist/chunk-IBXYLO2J.js.map +1 -0
  47. package/dist/{chunk-7KFUFAVP.js → chunk-IRYG6B5A.js} +9 -8
  48. package/dist/chunk-IRYG6B5A.js.map +1 -0
  49. package/dist/{chunk-2RQLPN4U.js → chunk-JCNEW4WJ.js} +8 -8
  50. package/dist/{chunk-2RQLPN4U.js.map → chunk-JCNEW4WJ.js.map} +1 -1
  51. package/dist/{chunk-SP6LCCTZ.js → chunk-KZDMVOL6.js} +35 -8
  52. package/dist/chunk-KZDMVOL6.js.map +1 -0
  53. package/dist/chunk-LR5U6TZZ.js +169 -0
  54. package/dist/chunk-LR5U6TZZ.js.map +1 -0
  55. package/dist/{chunk-MQHD3EJE.js → chunk-LZHZJWVM.js} +6 -4
  56. package/dist/chunk-LZHZJWVM.js.map +1 -0
  57. package/dist/{chunk-5EOMSWNO.js → chunk-MAM2X3MW.js} +5 -5
  58. package/dist/{chunk-5EOMSWNO.js.map → chunk-MAM2X3MW.js.map} +1 -1
  59. package/dist/{chunk-FSPS7TVD.js → chunk-MCMS4NMO.js} +5 -5
  60. package/dist/{chunk-FSPS7TVD.js.map → chunk-MCMS4NMO.js.map} +1 -1
  61. package/dist/{chunk-ZB5VMGKB.js → chunk-MV5DIE2T.js} +15 -4
  62. package/dist/chunk-MV5DIE2T.js.map +1 -0
  63. package/dist/chunk-NDI4HLQE.js +41 -0
  64. package/dist/chunk-NDI4HLQE.js.map +1 -0
  65. package/dist/{chunk-B4GNSSHU.js → chunk-NLJEQZQQ.js} +3 -3
  66. package/dist/{chunk-B4GNSSHU.js.map → chunk-NLJEQZQQ.js.map} +1 -1
  67. package/dist/{chunk-SBZJGFZ6.js → chunk-QHT4DCXE.js} +8 -7
  68. package/dist/chunk-QHT4DCXE.js.map +1 -0
  69. package/dist/{chunk-I4IJOLNA.js → chunk-RMUBCTEF.js} +5 -5
  70. package/dist/{chunk-I4IJOLNA.js.map → chunk-RMUBCTEF.js.map} +1 -1
  71. package/dist/{chunk-G3AD3NJG.js → chunk-RNTDM3RP.js} +9 -5
  72. package/dist/chunk-RNTDM3RP.js.map +1 -0
  73. package/dist/chunk-RPFN6ETQ.js +509 -0
  74. package/dist/chunk-RPFN6ETQ.js.map +1 -0
  75. package/dist/{chunk-HWBFRDX7.js → chunk-SI7C3W5M.js} +28 -9
  76. package/dist/chunk-SI7C3W5M.js.map +1 -0
  77. package/dist/chunk-TPOV3OCC.js +234 -0
  78. package/dist/chunk-TPOV3OCC.js.map +1 -0
  79. package/dist/{chunk-IANYMDKH.js → chunk-UBQ54W46.js} +4 -4
  80. package/dist/chunk-UBQ54W46.js.map +1 -0
  81. package/dist/{chunk-QVOBLRCM.js → chunk-UIKQ4X6W.js} +3 -3
  82. package/dist/{chunk-QVOBLRCM.js.map → chunk-UIKQ4X6W.js.map} +1 -1
  83. package/dist/chunk-UOWQH53N.js +70 -0
  84. package/dist/chunk-UOWQH53N.js.map +1 -0
  85. package/dist/{chunk-QRNQQIQM.js → chunk-WJUY6YWF.js} +52 -20
  86. package/dist/chunk-WJUY6YWF.js.map +1 -0
  87. package/dist/{chunk-3KARNPW4.js → chunk-WKIUMLRT.js} +3 -3
  88. package/dist/{chunk-3KARNPW4.js.map → chunk-WKIUMLRT.js.map} +1 -1
  89. package/dist/chunk-X6RB74JN.js +37 -0
  90. package/dist/chunk-X6RB74JN.js.map +1 -0
  91. package/dist/chunk-XQ6L2CM5.js +83 -0
  92. package/dist/chunk-XQ6L2CM5.js.map +1 -0
  93. package/dist/{chunk-RKCUXOU2.js → chunk-YUVKROMA.js} +44 -7
  94. package/dist/chunk-YUVKROMA.js.map +1 -0
  95. package/dist/components/action-icon/action-icon.d.ts +9 -2
  96. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  97. package/dist/components/action-icon/index.js +5 -1
  98. package/dist/components/alert/index.js +4 -4
  99. package/dist/components/anchor/anchor.d.ts +45 -0
  100. package/dist/components/anchor/anchor.d.ts.map +1 -0
  101. package/dist/components/anchor/index.d.ts +2 -0
  102. package/dist/components/anchor/index.d.ts.map +1 -0
  103. package/dist/components/anchor/index.js +11 -0
  104. package/dist/components/anchor/index.js.map +1 -0
  105. package/dist/components/app-shell/app-shell.d.ts +10 -6
  106. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  107. package/dist/components/app-shell/index.js +23 -24
  108. package/dist/components/app-shell/index.js.map +1 -1
  109. package/dist/components/autocomplete/autocomplete.d.ts +1 -1
  110. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  111. package/dist/components/autocomplete/index.js +15 -9
  112. package/dist/components/autocomplete/index.js.map +1 -1
  113. package/dist/components/avatar/index.js +1 -1
  114. package/dist/components/button/button.d.ts +15 -2
  115. package/dist/components/button/button.d.ts.map +1 -1
  116. package/dist/components/button/index.js +5 -1
  117. package/dist/components/button-multi-select/index.js +6 -4
  118. package/dist/components/button-multi-select/index.js.map +1 -1
  119. package/dist/components/button-select/button-select-control.d.ts.map +1 -1
  120. package/dist/components/button-select/button-select.d.ts +2 -2
  121. package/dist/components/button-select/button-select.d.ts.map +1 -1
  122. package/dist/components/button-select/index.js +6 -4
  123. package/dist/components/button-select/index.js.map +1 -1
  124. package/dist/components/calendar/aliases.d.ts +16 -0
  125. package/dist/components/calendar/aliases.d.ts.map +1 -0
  126. package/dist/components/calendar/calendar-body.d.ts +11 -1
  127. package/dist/components/calendar/calendar-body.d.ts.map +1 -1
  128. package/dist/components/calendar/calendar.d.ts +8 -4
  129. package/dist/components/calendar/calendar.d.ts.map +1 -1
  130. package/dist/components/calendar/index.d.ts +2 -1
  131. package/dist/components/calendar/index.d.ts.map +1 -1
  132. package/dist/components/calendar/index.js +15 -5
  133. package/dist/components/calendar/index.js.map +1 -1
  134. package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
  135. package/dist/components/calendar-heatmap/index.js +85 -73
  136. package/dist/components/calendar-heatmap/index.js.map +1 -1
  137. package/dist/components/camera/index.js +16 -14
  138. package/dist/components/carousel/index.js +3 -3
  139. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  140. package/dist/components/checkbox/index.js +2 -2
  141. package/dist/components/choice-card-group/index.js +2 -2
  142. package/dist/components/choice-card-group/index.js.map +1 -1
  143. package/dist/components/circular-progress/circular-progress.d.ts +22 -11
  144. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  145. package/dist/components/circular-progress/index.d.ts +1 -1
  146. package/dist/components/circular-progress/index.d.ts.map +1 -1
  147. package/dist/components/circular-progress/index.js +68 -49
  148. package/dist/components/circular-progress/index.js.map +1 -1
  149. package/dist/components/clipboard/index.js +7 -3
  150. package/dist/components/clipboard/index.js.map +1 -1
  151. package/dist/components/code/code.d.ts +10 -0
  152. package/dist/components/code/code.d.ts.map +1 -1
  153. package/dist/components/code/index.js +1 -0
  154. package/dist/components/code/index.js.map +1 -1
  155. package/dist/components/code-block/chrome.js +10 -6
  156. package/dist/components/code-block/index.js +10 -7
  157. package/dist/components/code-block/index.js.map +1 -1
  158. package/dist/components/combobox/combobox.d.ts +5 -3
  159. package/dist/components/combobox/combobox.d.ts.map +1 -1
  160. package/dist/components/combobox/index.js +12 -7
  161. package/dist/components/combobox-list/combobox-list.d.ts +1 -1
  162. package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
  163. package/dist/components/combobox-list/index.js +14 -9
  164. package/dist/components/compare/index.js +1 -1
  165. package/dist/components/data-list/data-list.d.ts +96 -0
  166. package/dist/components/data-list/data-list.d.ts.map +1 -0
  167. package/dist/components/data-list/index.d.ts +2 -0
  168. package/dist/components/data-list/index.d.ts.map +1 -0
  169. package/dist/components/data-list/index.js +147 -0
  170. package/dist/components/data-list/index.js.map +1 -0
  171. package/dist/components/data-table/data-table-group.d.ts.map +1 -1
  172. package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
  173. package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
  174. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  175. package/dist/components/data-table/data-table.d.ts +5 -2
  176. package/dist/components/data-table/data-table.d.ts.map +1 -1
  177. package/dist/components/data-table/index.js +163 -168
  178. package/dist/components/data-table/index.js.map +1 -1
  179. package/dist/components/date-picker/aliases.d.ts +16 -0
  180. package/dist/components/date-picker/aliases.d.ts.map +1 -1
  181. package/dist/components/date-picker/date-picker.d.ts +22 -8
  182. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  183. package/dist/components/date-picker/index.d.ts +2 -2
  184. package/dist/components/date-picker/index.d.ts.map +1 -1
  185. package/dist/components/date-picker/index.js +34 -28
  186. package/dist/components/date-picker/index.js.map +1 -1
  187. package/dist/components/download-button/index.js +6 -2
  188. package/dist/components/drawer/drawer.d.ts +7 -4
  189. package/dist/components/drawer/drawer.d.ts.map +1 -1
  190. package/dist/components/drawer/index.js +11 -6
  191. package/dist/components/empty-state/empty-state.d.ts +57 -0
  192. package/dist/components/empty-state/empty-state.d.ts.map +1 -0
  193. package/dist/components/empty-state/index.d.ts +2 -0
  194. package/dist/components/empty-state/index.d.ts.map +1 -0
  195. package/dist/components/empty-state/index.js +8 -0
  196. package/dist/components/empty-state/index.js.map +1 -0
  197. package/dist/components/field/field.d.ts +20 -0
  198. package/dist/components/field/field.d.ts.map +1 -1
  199. package/dist/components/field/index.js +1 -1
  200. package/dist/components/fieldset/fieldset.d.ts +103 -0
  201. package/dist/components/fieldset/fieldset.d.ts.map +1 -0
  202. package/dist/components/fieldset/index.d.ts +2 -0
  203. package/dist/components/fieldset/index.d.ts.map +1 -0
  204. package/dist/components/fieldset/index.js +150 -0
  205. package/dist/components/fieldset/index.js.map +1 -0
  206. package/dist/components/file-item/index.js +10 -7
  207. package/dist/components/file-preview/file-preview.d.ts.map +1 -1
  208. package/dist/components/file-preview/index.js +10 -18
  209. package/dist/components/file-preview/index.js.map +1 -1
  210. package/dist/components/file-trigger/index.js +6 -2
  211. package/dist/components/file-upload/file-upload.d.ts.map +1 -1
  212. package/dist/components/file-upload/index.js +18 -14
  213. package/dist/components/file-upload/index.js.map +1 -1
  214. package/dist/components/gallery/index.js +3 -3
  215. package/dist/components/geodesic/a11y.d.ts +3 -3
  216. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  217. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  218. package/dist/components/hover-card/index.js +10 -3
  219. package/dist/components/hover-card/index.js.map +1 -1
  220. package/dist/components/image/index.js +3 -3
  221. package/dist/components/image-cropper/index.js +9 -6
  222. package/dist/components/input/index.js +2 -2
  223. package/dist/components/input/input.d.ts.map +1 -1
  224. package/dist/components/kbd/index.js +3 -3
  225. package/dist/components/kbd/kbd.d.ts +4 -0
  226. package/dist/components/kbd/kbd.d.ts.map +1 -1
  227. package/dist/components/lightbox/index.js +13 -11
  228. package/dist/components/lightbox/index.js.map +1 -1
  229. package/dist/components/menu/index.js +9 -5
  230. package/dist/components/menu/index.js.map +1 -1
  231. package/dist/components/menu/menu.d.ts.map +1 -1
  232. package/dist/components/modal/index.js +11 -6
  233. package/dist/components/modal/modal.d.ts +10 -4
  234. package/dist/components/modal/modal.d.ts.map +1 -1
  235. package/dist/components/multi-combobox-list/index.js +13 -9
  236. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
  237. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
  238. package/dist/components/multi-select/index.js +13 -10
  239. package/dist/components/multi-select/index.js.map +1 -1
  240. package/dist/components/multi-select/multi-select.d.ts +1 -1
  241. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  242. package/dist/components/nav-link/index.js +4 -4
  243. package/dist/components/nav-link/tanstack.js +4 -4
  244. package/dist/components/notification/index.js +6 -6
  245. package/dist/components/notification/index.js.map +1 -1
  246. package/dist/components/number-input/index.js +11 -7
  247. package/dist/components/number-input/number-input.d.ts +1 -1
  248. package/dist/components/number-input/number-input.d.ts.map +1 -1
  249. package/dist/components/overlays/dialog-parts.d.ts +10 -1
  250. package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
  251. package/dist/components/overlays/index.js +13 -8
  252. package/dist/components/overlays/index.js.map +1 -1
  253. package/dist/components/pagination/index.d.ts +2 -0
  254. package/dist/components/pagination/index.d.ts.map +1 -0
  255. package/dist/components/pagination/index.js +362 -0
  256. package/dist/components/pagination/index.js.map +1 -0
  257. package/dist/components/pagination/pagination.d.ts +147 -0
  258. package/dist/components/pagination/pagination.d.ts.map +1 -0
  259. package/dist/components/password-input/index.js +6 -5
  260. package/dist/components/password-input/index.js.map +1 -1
  261. package/dist/components/password-input/password-input.d.ts +1 -1
  262. package/dist/components/password-input/password-input.d.ts.map +1 -1
  263. package/dist/components/phone-input/index.js +14 -11
  264. package/dist/components/phone-input/index.js.map +1 -1
  265. package/dist/components/phone-input/phone-input.d.ts +1 -1
  266. package/dist/components/phone-input/phone-input.d.ts.map +1 -1
  267. package/dist/components/photo-capture/index.js +19 -17
  268. package/dist/components/photo-capture/index.js.map +1 -1
  269. package/dist/components/pills-input/index.js +4 -4
  270. package/dist/components/pills-input/pills-input.d.ts +1 -1
  271. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  272. package/dist/components/pin-input/index.js +6 -5
  273. package/dist/components/pin-input/index.js.map +1 -1
  274. package/dist/components/pin-input/pin-input.d.ts.map +1 -1
  275. package/dist/components/popover/index.js +7 -2
  276. package/dist/components/popover/popover.d.ts +41 -16
  277. package/dist/components/popover/popover.d.ts.map +1 -1
  278. package/dist/components/progress/index.d.ts +1 -1
  279. package/dist/components/progress/index.d.ts.map +1 -1
  280. package/dist/components/progress/index.js +4 -1
  281. package/dist/components/progress/progress.d.ts +22 -14
  282. package/dist/components/progress/progress.d.ts.map +1 -1
  283. package/dist/components/prose/index.d.ts +2 -0
  284. package/dist/components/prose/index.d.ts.map +1 -0
  285. package/dist/components/prose/index.js +17 -0
  286. package/dist/components/prose/index.js.map +1 -0
  287. package/dist/components/prose/prose.d.ts +49 -0
  288. package/dist/components/prose/prose.d.ts.map +1 -0
  289. package/dist/components/prose/styles.css +593 -0
  290. package/dist/components/radio-group/index.js +9 -3
  291. package/dist/components/radio-group/index.js.map +1 -1
  292. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  293. package/dist/components/rating/index.js +3 -2
  294. package/dist/components/rating/index.js.map +1 -1
  295. package/dist/components/rating/rating.d.ts.map +1 -1
  296. package/dist/components/schedule/index.js +10 -8
  297. package/dist/components/schedule/index.js.map +1 -1
  298. package/dist/components/scroll-area/index.d.ts +2 -0
  299. package/dist/components/scroll-area/index.d.ts.map +1 -0
  300. package/dist/components/scroll-area/index.js +10 -0
  301. package/dist/components/scroll-area/index.js.map +1 -0
  302. package/dist/components/scroll-area/scroll-area.d.ts +150 -0
  303. package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
  304. package/dist/components/segment-group/index.js +2 -2
  305. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  306. package/dist/components/select/index.js +12 -8
  307. package/dist/components/select/select.d.ts +1 -1
  308. package/dist/components/select/select.d.ts.map +1 -1
  309. package/dist/components/slider/index.js +2 -2
  310. package/dist/components/slider/slider.d.ts.map +1 -1
  311. package/dist/components/splitter/index.d.ts +2 -0
  312. package/dist/components/splitter/index.d.ts.map +1 -0
  313. package/dist/components/splitter/index.js +373 -0
  314. package/dist/components/splitter/index.js.map +1 -0
  315. package/dist/components/splitter/splitter.d.ts +159 -0
  316. package/dist/components/splitter/splitter.d.ts.map +1 -0
  317. package/dist/components/spotlight/index.js +23 -22
  318. package/dist/components/spotlight/index.js.map +1 -1
  319. package/dist/components/spotlight/spotlight.d.ts.map +1 -1
  320. package/dist/components/steps/index.d.ts +4 -0
  321. package/dist/components/steps/index.d.ts.map +1 -0
  322. package/dist/components/steps/index.js +478 -0
  323. package/dist/components/steps/index.js.map +1 -0
  324. package/dist/components/steps/steps-data.d.ts +78 -0
  325. package/dist/components/steps/steps-data.d.ts.map +1 -0
  326. package/dist/components/steps/steps.d.ts +183 -0
  327. package/dist/components/steps/steps.d.ts.map +1 -0
  328. package/dist/components/switch/index.js +4 -3
  329. package/dist/components/switch/index.js.map +1 -1
  330. package/dist/components/switch/switch.d.ts.map +1 -1
  331. package/dist/components/table-of-contents/index.d.ts +2 -0
  332. package/dist/components/table-of-contents/index.d.ts.map +1 -0
  333. package/dist/components/table-of-contents/index.js +471 -0
  334. package/dist/components/table-of-contents/index.js.map +1 -0
  335. package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
  336. package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
  337. package/dist/components/tags-input/index.js +12 -9
  338. package/dist/components/tags-input/index.js.map +1 -1
  339. package/dist/components/tags-input/tags-input.d.ts +1 -1
  340. package/dist/components/tags-input/tags-input.d.ts.map +1 -1
  341. package/dist/components/text-input/index.js +2 -2
  342. package/dist/components/textarea/index.js +8 -6
  343. package/dist/components/textarea/index.js.map +1 -1
  344. package/dist/components/textarea/textarea.d.ts.map +1 -1
  345. package/dist/components/time-input/index.js +11 -9
  346. package/dist/components/time-input/index.js.map +1 -1
  347. package/dist/components/timeline/index.js +8 -1
  348. package/dist/components/timeline/index.js.map +1 -1
  349. package/dist/components/timeline/timeline.d.ts.map +1 -1
  350. package/dist/components/tooltip/index.js +1 -1
  351. package/dist/components/tooltip/tooltip.d.ts +3 -8
  352. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  353. package/dist/components/tour/conditions.d.ts +83 -0
  354. package/dist/components/tour/conditions.d.ts.map +1 -0
  355. package/dist/components/tour/create-tours.d.ts +49 -0
  356. package/dist/components/tour/create-tours.d.ts.map +1 -0
  357. package/dist/components/tour/index.d.ts +6 -0
  358. package/dist/components/tour/index.d.ts.map +1 -0
  359. package/dist/components/tour/index.js +1449 -0
  360. package/dist/components/tour/index.js.map +1 -0
  361. package/dist/components/tour/runtime.d.ts +57 -0
  362. package/dist/components/tour/runtime.d.ts.map +1 -0
  363. package/dist/components/tour/storage.d.ts +14 -0
  364. package/dist/components/tour/storage.d.ts.map +1 -0
  365. package/dist/components/tour/store.d.ts +62 -0
  366. package/dist/components/tour/store.d.ts.map +1 -0
  367. package/dist/components/tour/tour.d.ts +77 -0
  368. package/dist/components/tour/tour.d.ts.map +1 -0
  369. package/dist/components/tour/types.d.ts +680 -0
  370. package/dist/components/tour/types.d.ts.map +1 -0
  371. package/dist/components/tree/index.d.ts +3 -0
  372. package/dist/components/tree/index.d.ts.map +1 -0
  373. package/dist/components/tree/index.js +457 -0
  374. package/dist/components/tree/index.js.map +1 -0
  375. package/dist/components/tree/tree-row.d.ts +72 -0
  376. package/dist/components/tree/tree-row.d.ts.map +1 -0
  377. package/dist/components/tree/tree.d.ts +193 -0
  378. package/dist/components/tree/tree.d.ts.map +1 -0
  379. package/dist/components/tree-multi-select/index.js +31 -54
  380. package/dist/components/tree-multi-select/index.js.map +1 -1
  381. package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
  382. package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
  383. package/dist/components/tree-select/index.js +30 -24
  384. package/dist/components/tree-select/index.js.map +1 -1
  385. package/dist/components/tree-select/tree-popover.d.ts +20 -31
  386. package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
  387. package/dist/components/tree-select/tree-select.d.ts +1 -1
  388. package/dist/components/tree-select/tree-select.d.ts.map +1 -1
  389. package/dist/index.d.ts +2 -0
  390. package/dist/index.d.ts.map +1 -1
  391. package/dist/index.js +10 -8
  392. package/dist/index.js.map +1 -1
  393. package/dist/lib/date-predicates.d.ts +7 -5
  394. package/dist/lib/date-predicates.d.ts.map +1 -1
  395. package/dist/lib/date-value.d.ts +20 -0
  396. package/dist/lib/date-value.d.ts.map +1 -1
  397. package/dist/lib/floating-arrow.d.ts +53 -0
  398. package/dist/lib/floating-arrow.d.ts.map +1 -0
  399. package/dist/lib/focus-return.d.ts +53 -0
  400. package/dist/lib/focus-return.d.ts.map +1 -0
  401. package/dist/lib/meter.d.ts +104 -0
  402. package/dist/lib/meter.d.ts.map +1 -0
  403. package/dist/lib/overlay-layer.d.ts +26 -8
  404. package/dist/lib/overlay-layer.d.ts.map +1 -1
  405. package/dist/lib/pressed.d.ts +92 -0
  406. package/dist/lib/pressed.d.ts.map +1 -0
  407. package/dist/lib/tree-data.d.ts +18 -2
  408. package/dist/lib/tree-data.d.ts.map +1 -1
  409. package/dist/lib/use-pagination.d.ts +102 -0
  410. package/dist/lib/use-pagination.d.ts.map +1 -0
  411. package/dist/lib/use-scroll-spy.d.ts +126 -0
  412. package/dist/lib/use-scroll-spy.d.ts.map +1 -0
  413. package/dist/theme.css +39 -3
  414. package/package.json +1 -1
  415. package/src/as-child.contract.test.tsx +283 -1
  416. package/src/components/action-icon/action-icon.tsx +34 -4
  417. package/src/components/anchor/anchor.test.tsx +232 -0
  418. package/src/components/anchor/anchor.tsx +187 -0
  419. package/src/components/anchor/index.ts +12 -0
  420. package/src/components/app-shell/app-shell.test.tsx +15 -7
  421. package/src/components/app-shell/app-shell.tsx +27 -20
  422. package/src/components/autocomplete/autocomplete.tsx +11 -3
  423. package/src/components/button/button-pressed.test.tsx +202 -0
  424. package/src/components/button/button.tsx +48 -6
  425. package/src/components/button-select/button-select-control.tsx +2 -2
  426. package/src/components/button-select/button-select.tsx +22 -2
  427. package/src/components/calendar/aliases.tsx +28 -0
  428. package/src/components/calendar/calendar-body.tsx +310 -210
  429. package/src/components/calendar/calendar.tsx +43 -12
  430. package/src/components/calendar/index.ts +7 -1
  431. package/src/components/calendar/month-year-calendar.test.tsx +106 -0
  432. package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
  433. package/src/components/checkbox/checkbox.tsx +7 -2
  434. package/src/components/choice-card-group/choice-card-group.tsx +2 -2
  435. package/src/components/circular-progress/circular-progress.test.tsx +35 -0
  436. package/src/components/circular-progress/circular-progress.tsx +116 -59
  437. package/src/components/circular-progress/index.ts +1 -0
  438. package/src/components/code/code.test.tsx +16 -0
  439. package/src/components/code/code.tsx +11 -0
  440. package/src/components/combobox/combobox.tsx +63 -28
  441. package/src/components/combobox-list/combobox-list.tsx +11 -3
  442. package/src/components/data-list/data-list.test.tsx +149 -0
  443. package/src/components/data-list/data-list.tsx +268 -0
  444. package/src/components/data-list/index.ts +9 -0
  445. package/src/components/data-table/data-table-group.test.tsx +16 -0
  446. package/src/components/data-table/data-table-group.tsx +15 -2
  447. package/src/components/data-table/data-table-placeholder.tsx +28 -36
  448. package/src/components/data-table/data-table-stack.tsx +33 -39
  449. package/src/components/data-table/data-table.test.tsx +31 -0
  450. package/src/components/data-table/data-table.tsx +41 -42
  451. package/src/components/date-picker/aliases.tsx +28 -0
  452. package/src/components/date-picker/date-picker.test.tsx +29 -0
  453. package/src/components/date-picker/date-picker.tsx +164 -45
  454. package/src/components/date-picker/index.ts +5 -1
  455. package/src/components/date-picker/month-year-picker.test.tsx +362 -0
  456. package/src/components/drawer/drawer.test.tsx +41 -0
  457. package/src/components/drawer/drawer.tsx +7 -1
  458. package/src/components/empty-state/empty-state.test.tsx +109 -0
  459. package/src/components/empty-state/empty-state.tsx +180 -0
  460. package/src/components/empty-state/index.ts +9 -0
  461. package/src/components/field/field.tsx +35 -1
  462. package/src/components/fieldset/fieldset.test.tsx +352 -0
  463. package/src/components/fieldset/fieldset.tsx +268 -0
  464. package/src/components/fieldset/index.ts +11 -0
  465. package/src/components/file-preview/file-preview.test.tsx +2 -1
  466. package/src/components/file-preview/file-preview.tsx +7 -13
  467. package/src/components/file-upload/file-upload.tsx +14 -5
  468. package/src/components/hover-card/hover-card.tsx +5 -1
  469. package/src/components/input/input.tsx +12 -5
  470. package/src/components/kbd/kbd.test.tsx +13 -0
  471. package/src/components/kbd/kbd.tsx +6 -0
  472. package/src/components/menu/menu.tsx +6 -2
  473. package/src/components/modal/modal.test.tsx +41 -0
  474. package/src/components/modal/modal.tsx +17 -9
  475. package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
  476. package/src/components/multi-select/multi-select.tsx +11 -3
  477. package/src/components/notification/create-notifier.tsx +1 -1
  478. package/src/components/number-input/number-input.tsx +12 -3
  479. package/src/components/overlays/dialog-parts.tsx +42 -5
  480. package/src/components/pagination/index.ts +19 -0
  481. package/src/components/pagination/pagination.test.tsx +187 -0
  482. package/src/components/pagination/pagination.tsx +563 -0
  483. package/src/components/password-input/password-input.tsx +12 -3
  484. package/src/components/phone-input/phone-input.tsx +12 -3
  485. package/src/components/pills-input/pills-input.tsx +7 -2
  486. package/src/components/pin-input/pin-input.tsx +13 -4
  487. package/src/components/popover/popover.tsx +87 -17
  488. package/src/components/progress/index.ts +1 -0
  489. package/src/components/progress/progress.test.tsx +102 -0
  490. package/src/components/progress/progress.tsx +116 -62
  491. package/src/components/prose/index.ts +1 -0
  492. package/src/components/prose/prose.test.tsx +90 -0
  493. package/src/components/prose/prose.tsx +60 -0
  494. package/src/components/prose/styles.css +593 -0
  495. package/src/components/radio-group/radio-group.tsx +8 -3
  496. package/src/components/rating/rating.tsx +5 -2
  497. package/src/components/scroll-area/index.ts +18 -0
  498. package/src/components/scroll-area/scroll-area.test.tsx +184 -0
  499. package/src/components/scroll-area/scroll-area.tsx +448 -0
  500. package/src/components/segment-group/segment-group.tsx +2 -2
  501. package/src/components/select/select.tsx +37 -18
  502. package/src/components/slider/slider.tsx +2 -2
  503. package/src/components/splitter/index.ts +15 -0
  504. package/src/components/splitter/splitter.test.tsx +244 -0
  505. package/src/components/splitter/splitter.tsx +625 -0
  506. package/src/components/spotlight/spotlight.test.tsx +34 -26
  507. package/src/components/spotlight/spotlight.tsx +7 -9
  508. package/src/components/steps/index.ts +21 -0
  509. package/src/components/steps/steps-data.tsx +179 -0
  510. package/src/components/steps/steps.test.tsx +235 -0
  511. package/src/components/steps/steps.tsx +686 -0
  512. package/src/components/switch/switch.tsx +7 -2
  513. package/src/components/table-of-contents/index.ts +17 -0
  514. package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
  515. package/src/components/table-of-contents/table-of-contents.tsx +708 -0
  516. package/src/components/tags-input/tags-input.tsx +12 -3
  517. package/src/components/textarea/textarea.tsx +15 -5
  518. package/src/components/timeline/timeline.test.tsx +22 -0
  519. package/src/components/timeline/timeline.tsx +10 -1
  520. package/src/components/tooltip/tooltip.tsx +8 -17
  521. package/src/components/tour/conditions.test.ts +527 -0
  522. package/src/components/tour/conditions.ts +445 -0
  523. package/src/components/tour/create-tours.tsx +150 -0
  524. package/src/components/tour/index.ts +86 -0
  525. package/src/components/tour/runtime.ts +187 -0
  526. package/src/components/tour/storage.test.ts +68 -0
  527. package/src/components/tour/storage.ts +44 -0
  528. package/src/components/tour/store.test.tsx +784 -0
  529. package/src/components/tour/store.ts +661 -0
  530. package/src/components/tour/tour.test.tsx +318 -0
  531. package/src/components/tour/tour.tsx +773 -0
  532. package/src/components/tour/tour.types.test.ts +185 -0
  533. package/src/components/tour/types.ts +904 -0
  534. package/src/components/tree/index.ts +24 -0
  535. package/src/components/tree/tree-row.tsx +179 -0
  536. package/src/components/tree/tree.test.tsx +296 -0
  537. package/src/components/tree/tree.tsx +796 -0
  538. package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
  539. package/src/components/tree-select/tree-popover.tsx +26 -107
  540. package/src/components/tree-select/tree-select.tsx +24 -16
  541. package/src/icon-stroke.test.tsx +2 -0
  542. package/src/index.ts +16 -0
  543. package/src/lib/date-predicates.test.ts +46 -0
  544. package/src/lib/date-predicates.ts +44 -24
  545. package/src/lib/date-value.test.ts +24 -1
  546. package/src/lib/date-value.ts +42 -1
  547. package/src/lib/floating-arrow.tsx +73 -0
  548. package/src/lib/focus-return.test.tsx +143 -0
  549. package/src/lib/focus-return.ts +106 -0
  550. package/src/lib/meter.test.ts +40 -0
  551. package/src/lib/meter.ts +159 -0
  552. package/src/lib/overlay-layer.test.tsx +47 -1
  553. package/src/lib/overlay-layer.tsx +65 -8
  554. package/src/lib/pressed.ts +130 -0
  555. package/src/lib/tree-data.ts +42 -2
  556. package/src/lib/use-pagination.test.ts +105 -0
  557. package/src/lib/use-pagination.ts +179 -0
  558. package/src/lib/use-scroll-spy.test.tsx +238 -0
  559. package/src/lib/use-scroll-spy.ts +336 -0
  560. package/src/theme.css +39 -3
  561. package/src/theme.test.ts +29 -1
  562. package/src/visually-hidden-containment.test.tsx +9 -0
  563. package/dist/chunk-2W7H43WL.js.map +0 -1
  564. package/dist/chunk-7E7JNWOC.js.map +0 -1
  565. package/dist/chunk-7FPSQBWB.js.map +0 -1
  566. package/dist/chunk-7KFUFAVP.js.map +0 -1
  567. package/dist/chunk-AKXALCUN.js.map +0 -1
  568. package/dist/chunk-B5YHYI7E.js.map +0 -1
  569. package/dist/chunk-FQJNQW3G.js.map +0 -1
  570. package/dist/chunk-G3AD3NJG.js.map +0 -1
  571. package/dist/chunk-GEZYGBXY.js.map +0 -1
  572. package/dist/chunk-HCHGERDB.js.map +0 -1
  573. package/dist/chunk-HWBFRDX7.js.map +0 -1
  574. package/dist/chunk-I4B3N3UX.js.map +0 -1
  575. package/dist/chunk-IA6DCC3N.js.map +0 -1
  576. package/dist/chunk-IANYMDKH.js.map +0 -1
  577. package/dist/chunk-MQHD3EJE.js.map +0 -1
  578. package/dist/chunk-NNPSBC7O.js.map +0 -1
  579. package/dist/chunk-OXR7BXZA.js.map +0 -1
  580. package/dist/chunk-QKSLDQM2.js +0 -120
  581. package/dist/chunk-QKSLDQM2.js.map +0 -1
  582. package/dist/chunk-QRNQQIQM.js.map +0 -1
  583. package/dist/chunk-RKCUXOU2.js.map +0 -1
  584. package/dist/chunk-S5CQRCTF.js +0 -426
  585. package/dist/chunk-S5CQRCTF.js.map +0 -1
  586. package/dist/chunk-SBZJGFZ6.js.map +0 -1
  587. package/dist/chunk-SP6LCCTZ.js.map +0 -1
  588. package/dist/chunk-TUP7WXQE.js.map +0 -1
  589. package/dist/chunk-V2QZG4IT.js.map +0 -1
  590. package/dist/chunk-X6DESK37.js.map +0 -1
  591. package/dist/chunk-ZB5VMGKB.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/date-picker/date-time-text.ts","../src/components/date-picker/date-picker.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,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,E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AAClB,CAAC","file":"chunk-GEZYGBXY.js","sourcesContent":["import { CalendarDateTime, type DateValue } from \"@internationalized/date\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport {\n dayPeriodLabels,\n fromDisplayHour,\n type HourCycle,\n is12Hour,\n} 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; under `h24`, `24` is midnight. Returns `undefined` for anything that isn't a\n * real date/time (`02/30/2026`, `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 = fromDisplayHour(typedHour, readPeriod(text, options.locale) ?? \"AM\", options.hourCycle)\n } else if (typedHour === 24 && options.hourCycle === \"h24\") {\n // `h24` shows midnight as `24` (and so formats it that way) — read it back as hour 0.\n hour = 0\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, toCalendarDateTime, today } from \"@internationalized/date\"\nimport { type FocusEvent, type ReactNode, type Ref, useId, 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 dateToArkValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { capitalize } from \"../../lib/graphemes\"\nimport { useLocale, useTimeZone } from \"../../lib/intl\"\nimport { useMergedRefs } 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 { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\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 type CalendarIcons,\n calendarGridWidth,\n} from \"../calendar/calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"../calendar/calendar-zone-sync\"\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 fromDisplayHour,\n type HourCycle,\n resolveHourCycle,\n toDisplayHour,\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-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n)\n\nconst timePanelLabel = cn(\"text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\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-brand-900/70 dark:hover:text-white/80 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 * `CalendarDateTime` (what our own `dateToArkValue` produces for a `defaultValue`/`value` passed\n * in) stringifies with a time, while a plain `CalendarDate` (what a day-grid click produces)\n * stringifies as a clean date — two different formats for the same picked day depending on\n * provenance. Read the wall-calendar fields directly instead. Whether to append the time portion\n * is driven by the picker's own `withTime` flag, not by whether the value happens to carry an\n * `hour` field — a `CalendarDateTime` always has one (even at local midnight), so that structural\n * 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 * Every label but `allTime` (default `\"All time\"`) is already in the locale's words, from\n * `Intl.RelativeTimeFormat` (\"Aujourd’hui\", \"La semaine dernière\"); an override wins. */\n presets?: Partial<Record<DatePickerPresetId, string>>\n }\n\n/** The calendar's icon slots, one prop for the whole picker. */\nexport type DatePickerIcons = CalendarIcons\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 time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Calendar` and\n * `Schedule` — **not** Ark's own machine default (`\"UTC\"`). Accepts `\"auto\"` to follow the\n * host zone. */\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 * \"All time\" label, Cancel/Apply, Start/End time, and the embedded time row's Hour/Minute/\n * Second/Period labels. The other preset labels already follow `locale`, and an override\n * here still wins over them. Partial — unset keys keep their default. */\n translations?: DatePickerTranslations\n /** Replaces the calendar's default icons: `prev`, `next`, passed through to its grid like\n * `translations`. The kit's chevrons mirror under RTL; an icon passed here is drawn as given. */\n icons?: DatePickerIcons\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/** `DatePicker`'s own English wording, merged once per render (`presets` one level deeper, in\n * `presetLabels`). \"All time\" is the one non-derivable preset label; every other\n * `presets={true}` label comes from `Intl.RelativeTimeFormat`. */\nconst DATE_PICKER_DEFAULT_TRANSLATIONS = {\n cancel: \"Cancel\",\n apply: \"Apply\",\n startTime: \"Start time\",\n endTime: \"End time\",\n presets: { allTime: \"All time\" },\n} as const satisfies DatePickerTranslations\n\n/** The `presets={true}` labels: the locale's own words for each relative period\n * (`Intl.RelativeTimeFormat` with `numeric: \"auto\"` — \"Aujourd’hui\", \"La semaine dernière\"),\n * capitalised for a button, then \"All time\" from the defaults, then the consumer's\n * `translations.presets`, which win over both. */\nconst presetLabels = (\n locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): Record<DatePickerPresetId, string> => {\n const relative = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" })\n const say = (value: number, unit: Intl.RelativeTimeFormatUnit) =>\n capitalize(relative.format(value, unit), locale)\n return {\n today: say(0, \"day\"),\n yesterday: say(-1, \"day\"),\n tomorrow: say(1, \"day\"),\n nextWeek: say(1, \"week\"),\n thisWeek: say(0, \"week\"),\n lastWeek: say(-1, \"week\"),\n thisMonth: say(0, \"month\"),\n lastMonth: say(-1, \"month\"),\n thisYear: say(0, \"year\"),\n ...DATE_PICKER_DEFAULT_TRANSLATIONS.presets,\n ...overrides,\n }\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 locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): DatePreset[] => {\n const now = today(timeZone)\n const toDate = (value: typeof now) => calendarValueToDate(value, timeZone)\n const label = presetLabels(locale, overrides)\n if (!range) {\n return [\n { label: label.today, date: toDate(now) },\n { label: label.yesterday, date: toDate(now.subtract({ days: 1 })) },\n { label: label.tomorrow, date: toDate(now.add({ days: 1 })) },\n { label: label.nextWeek, date: toDate(now.add({ days: 7 })) },\n ]\n }\n const yesterday = now.subtract({ days: 1 })\n return [\n { label: label.today, range: { start: toDate(now), end: toDate(now) } },\n { label: label.yesterday, range: { start: toDate(yesterday), end: toDate(yesterday) } },\n { label: label.thisWeek, value: \"thisWeek\" },\n { label: label.lastWeek, value: \"lastWeek\" },\n { label: label.thisMonth, value: \"thisMonth\" },\n { label: label.lastMonth, value: \"lastMonth\" },\n { label: label.thisYear, value: \"thisYear\" },\n { label: label.allTime, range: null },\n ]\n}\n\nconst PresetsRail = ({\n presets,\n range,\n timeZone,\n locale,\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 /** Names the `presets === true` periods. Falls back to the `IntlProvider` locale. */\n locale?: 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 resolvedLocale = useLocale(locale)\n const resolved =\n presets === true\n ? getDefaultPresets(Boolean(range), timeZone, resolvedLocale, 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 (the cycle's own hours, + period) from the machine's own\n * `DateValue` — a plain `CalendarDate` (no time picked yet) has no `hour`, so it reads as all-null. */\nconst toDisplayTime = (value: DateValue | undefined, cycle: HourCycle): DisplayTime => {\n if (!value || !(\"hour\" in value)) return emptyDisplayTime\n const { hour, period } = toDisplayHour(value.hour, cycle)\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 cycle: HourCycle,\n): { hour: number; minute: number; second?: number } => {\n const hour = fromDisplayHour(display.hour, display.period, cycle)\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 /** Visible label above the row, which also names its `role=\"group\"` (\"Start time\" / \"End\n * time\" under `range`). Without it the group is named `translations.time` (`\"Time\"`). */\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 display = toDisplayTime(value, hourCycle)\n const patch = (partial: Partial<DisplayTime>) =>\n onSetTime(fromDisplayTime({ ...display, ...partial }, hourCycle))\n const labelId = useId()\n\n return (\n <div className={cn(\"flex flex-col gap-1\", classNames?.root)}>\n {label && (\n <span id={labelId} className={timePanelLabel}>\n {label}\n </span>\n )}\n <TimeRow\n aria-labelledby={label ? labelId : undefined}\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 {...props({ \"aria-invalid\": invalid })}\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 icons,\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 = useTimeZone(timeZone)\n const resolvedHourCycle = resolveHourCycle({ locale: resolvedLocale, format, hourCycle })\n const t = { ...DATE_PICKER_DEFAULT_TRANSLATIONS, ...translations }\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 const zoneReseed = useRef<string | null>(null)\n\n const inputMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(inputRef, ref)\n const triggerMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(triggerRef, ref)\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 // A zone change re-expresses the selection in the new zone; that echo is not a change.\n if (zoneReseed.current === hashArkValues(details.value)) {\n zoneReseed.current = null\n return\n }\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 ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(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 {/* Keeps the selection, and the typeable input's text, on the same instant when the zone\n * changes, in place rather than by remounting; see `calendar-zone-sync.tsx`. Under\n * `withConfirm` Ark's value is the staged `Date`, so it is controlled either way. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={withConfirm || value !== undefined}\n pendingRef={zoneReseed}\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={inputMergedRef}\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={inputMergedRef}\n onBlur={onBlur}\n placeholder={placeholder}\n {...props({ \"data-testid\": testId })}\n className={inputControlClasses}\n />\n )}\n </div>\n ) : (\n <Ark.Trigger\n ref={triggerMergedRef}\n onBlur={onBlur}\n {...props({ \"aria-invalid\": isInvalid, \"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 locale={resolvedLocale}\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 icons={icons}\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 ? t.startTime : 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={t.endTime}\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 {t.cancel}\n </Button>\n <Button\n size={size}\n onClick={() => {\n setCommitted(staged)\n api.setOpen(false)\n }}\n >\n {t.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 +0,0 @@
1
- {"version":3,"sources":["../src/lib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A2C;AAClE,IAAA,IAAI,KAAA,CAAM,QAAQ,WAAA,EAAa;AAC7B,MAAA,KAAA,CAAM,cAAA,EAAe;AACrB,MAAA,QAAA,CAAS,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,IACpB;AAAA,EACF,CAAA;AAIA,EAAA,MAAM,QAAA,GAAW,CAAC,KAAA,MAAmB;AAAA,IACnC,GAAA,EAAK,CAAC,EAAA,KAA2B;AAC/B,MAAA,IAAI,EAAA,EAAI,OAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,OAAO,EAAE,CAAA;AAAA,WAChC,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,KAAK,CAAA;AAAA,IACnC,CAAA;AAAA,IACA,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,KAAA,KAAU,aAAa;AAAA,GACnD,CAAA;AAEA,EAAA,OAAO,EAAE,WAAA,EAAa,cAAA,EAAgB,SAAA,EAAW,QAAA,EAAU,eAAe,eAAA,EAAgB;AAC5F","file":"chunk-HCHGERDB.js","sourcesContent":["/**\n * Shared tree model + pure helpers for the hierarchical pickers (TreeSelect,\n * TreeMultiSelect). `data` is a tree of `{ value, label, disabled?, children? }`;\n * a node with `children` is a *branch*, one without is a *leaf*. These helpers\n * are selection-agnostic — the single / multi cascade logic lives in each\n * component (mirrors `lib/select-data.ts` for the flat pickers).\n *\n * A node may carry an arbitrary, optional `payload`. Selection ignores it\n * (value / label / disabled drive everything) but it flows through to a tree\n * picker's `renderItem` as `node.payload`.\n */\n\nimport type { ReactNode } from \"react\"\nimport type { LabelSearch } from \"./select-data\"\n\nexport type TreeNodeData<P = unknown> = {\n value: string\n label: string\n disabled?: boolean\n children?: TreeNodeData<P>[]\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered row. Defaults to `` `item-${value}` `` —\n * set it explicitly when `value` isn't a safe/stable test selector on its\n * own. Unlike the Ark-machine-backed pickers, this tree is hand-rolled, so\n * there's no free `data-part` / `data-value` here — `testId` is the row's\n * only stable selector. */\n testId?: string\n}\n\n/**\n * A tree picker's `data` shape. Not generic over the node payload here (a\n * component generic over both `Data` and `P` independently defeats payload\n * inference — see `TreePayload` below); `TreeNodeData`'s own `P` still drives\n * autocomplete, extracted structurally from `Data` when needed.\n */\nexport type TreeSelectData = ReadonlyArray<TreeNodeData>\n\n/**\n * Extract the literal value union from a tree of `TreeNodeData` — the tree\n * analogue of `lib/select-data.ts`'s `SelectValue`, walking every node's\n * `value` plus its `children` (recursively) so a `const`-typed `data` prop\n * narrows `value` / `onChange` to the tree's actual node values instead of\n * plain `string`.\n */\nexport type TreeValue<Nodes extends ReadonlyArray<TreeNodeData>> = TreeNodeValue<Nodes[number]>\n\ntype TreeNodeValue<N> = N extends TreeNodeData\n ?\n | N[\"value\"]\n | (N[\"children\"] extends ReadonlyArray<TreeNodeData> ? TreeValue<N[\"children\"]> : never)\n : never\n\n/**\n * Extract the `payload` type carried by a tree — read structurally off every\n * node's own `payload` property (robust against generic-instantiation\n * inference, same approach as `lib/select-data.ts`'s `SelectPayload`),\n * recursing into `children`. Payload-less nodes contribute `never`; a\n * homogeneous payload resolves precisely, a mixed one to the union.\n */\nexport type TreePayload<Nodes extends ReadonlyArray<TreeNodeData>> = TreeNodePayload<Nodes[number]>\n\ntype TreeNodePayload<N> = N extends TreeNodeData\n ?\n | (N extends { payload: infer P } ? P : never)\n | (N[\"children\"] extends ReadonlyArray<TreeNodeData> ? TreePayload<N[\"children\"]> : never)\n : never\n\n/**\n * Live node state passed alongside the node to a tree picker's `renderItem`.\n * `depth` is 0-based (the row renders `aria-level={depth + 1}`); `leaf`\n * distinguishes selectable leaves from organizational branches.\n */\nexport type TreeSelectItemState = {\n selected: boolean\n leaf: boolean\n disabled: boolean\n depth: number\n}\n\n/** Tri-state variant for `TreeMultiSelect` — branches cascade to `indeterminate`. */\nexport type TreeMultiSelectItemState = {\n checked: boolean\n indeterminate: boolean\n leaf: boolean\n disabled: boolean\n depth: number\n}\n\n/**\n * Render a node's content yourself. The component keeps owning the row\n * (treeitem role, indent rails, roving focus, click); the callback fills the\n * content after the rails and receives the node (including its typed `payload`).\n * In an RSC tree the function must live in a `\"use client\"` module so the\n * boundary serializes it as a client reference.\n */\nexport type RenderTreeSelectItem<P = unknown> = (\n node: TreeNodeData<P>,\n state: TreeSelectItemState,\n) => ReactNode\nexport type RenderTreeMultiSelectItem<P = unknown> = (\n node: TreeNodeData<P>,\n state: TreeMultiSelectItemState,\n) => ReactNode\n\nexport const isLeaf = (node: TreeNodeData): boolean => !node.children || node.children.length === 0\n\n/** value → label (trigger display) and value → node (toggling from keyboard / filtered rows). */\nexport const buildMaps = <P>(nodes: ReadonlyArray<TreeNodeData<P>>) => {\n const labelMap = new Map<string, string>()\n const nodeMap = new Map<string, TreeNodeData<P>>()\n const walk = (ns: ReadonlyArray<TreeNodeData<P>>) => {\n for (const n of ns) {\n labelMap.set(n.value, n.label)\n nodeMap.set(n.value, n)\n if (n.children) walk(n.children)\n }\n }\n walk(nodes)\n return { labelMap, nodeMap }\n}\n\n/** Pre-order list of node values + inherited-disabled flag — drives roving focus. */\nexport const flattenTree = (\n nodes: ReadonlyArray<TreeNodeData>,\n inheritedDisabled: boolean,\n acc: { value: string; disabled: boolean }[] = [],\n): { value: string; disabled: boolean }[] => {\n for (const n of nodes) {\n const nodeDisabled = inheritedDisabled || !!n.disabled\n acc.push({ value: n.value, disabled: nodeDisabled })\n if (n.children) flattenTree(n.children, nodeDisabled, acc)\n }\n return acc\n}\n\n/**\n * Keep nodes whose label (or a descendant's) matches `query`; preserves ancestors.\n * `matches` is the pickers' shared locale-aware search (`useLabelSearch().matches`), passed in\n * because this is a plain function: accents and case fold away, Turkish keeps its i's apart.\n */\nexport const filterTree = <P>(\n nodes: ReadonlyArray<TreeNodeData<P>>,\n query: string,\n matches: LabelSearch[\"matches\"],\n): TreeNodeData<P>[] => {\n if (!query.trim()) return nodes as TreeNodeData<P>[]\n const recurse = (ns: ReadonlyArray<TreeNodeData<P>>): TreeNodeData<P>[] => {\n const out: TreeNodeData<P>[] = []\n for (const n of ns) {\n const selfMatch = matches(n.label, query)\n if (isLeaf(n)) {\n if (selfMatch) out.push(n)\n } else if (selfMatch) {\n out.push(n) // branch matches → keep its full subtree\n } else if (n.children) {\n const kids = recurse(n.children)\n if (kids.length > 0) out.push({ ...n, children: kids })\n }\n }\n return out\n }\n return recurse(nodes)\n}\n","\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { cva } from \"class-variance-authority\"\nimport {\n type ComponentProps,\n Fragment,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { ClearSectionMode } from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport type { TreeNodeData } from \"../../lib/tree-data\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { fieldA11yProps } from \"../field/field\"\nimport { inputControlClasses, inputSlot } from \"../input/input\"\nimport { Popover, popoverChevron, popoverClearTrigger, popoverEmpty } from \"../popover/popover\"\n\n/**\n * The internals `TreeSelect` and `TreeMultiSelect` share: the row styles, the\n * indent rails, the combobox trigger, the search header, the tree body and the\n * roving focus (arrows, Home / End, type-ahead). Each picker keeps only what\n * differs: what a row shows, and what activating one does.\n */\n\n/** Indent guide / connector colour, shared by rails and the elbow. */\nconst treeLine = \"bg-brand-900/20 dark:bg-white/15\"\n\n/**\n * One tree row. `interactive` rows (every TreeMultiSelect row, TreeSelect's\n * leaves) take roving focus and hover/active surfaces: neutral and\n * transparent, a low-opacity black/white wash rather than an opaque gray,\n * matching the popover surface's own background-dependent tint (no Figma\n * reference for this state yet). The others are TreeSelect's branches:\n * organizational, present for structure and levels, never focused.\n */\nexport const treeRow = cva(\n [\"group/row relative flex w-full items-center rounded-sm ps-1.5 outline-none select-none\"],\n {\n variants: {\n size: {\n xs: \"min-h-7 pe-1.5 text-xs\",\n sm: \"min-h-8 pe-2 text-sm\",\n md: \"min-h-9 pe-2 text-md\",\n lg: \"min-h-10 pe-2.5 text-lg\",\n xl: \"min-h-11 pe-3 text-xl\",\n },\n interactive: {\n true: [\n \"cursor-pointer\",\n TEXT_COLOR_CLASSES.primary,\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n \"data-active:bg-black/5 dark:data-active:bg-white/8\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n // Palette, not brand: the focused row is also the active one, and brand-500\n // measured 2.73:1 against that light fill. `--c-text` (the popover's\n // `data-color`, neutral by default) clears it in both themes.\n focusStyles({ ring: \"palette\", offset: false, inset: true }),\n ],\n false: [\"cursor-default font-medium\", TEXT_COLOR_CLASSES.secondary],\n },\n },\n defaultVariants: { size: \"md\", interactive: true },\n },\n)\n\n/** Where a node sits in the rendered tree: what its rails and set position need. */\nexport type TreePosition = {\n /** 0-based; the row renders `aria-level={depth + 1}`. */\n depth: number\n /** Per ancestor below the top level: whether it has a sibling after it (its rail continues). */\n ancestorHasNextSibling: boolean[]\n /** Last among its siblings: the connector stops at the elbow. */\n isLast: boolean\n /** 1-based index among its siblings. */\n posinset: number\n /** Number of siblings, itself included. */\n setsize: number\n}\n\n/**\n * Walk `nodes` depth-first, rendering each through `row` with its position,\n * its subtree flattened right after it: the tree is one flat list of rows,\n * its hierarchy carried by `aria-level` and the rails.\n */\nexport const renderTree = <P,>(\n nodes: ReadonlyArray<TreeNodeData<P>>,\n row: (node: TreeNodeData<P>, position: TreePosition) => ReactNode,\n depth = 0,\n ancestorHasNextSibling: boolean[] = [],\n): ReactNode =>\n nodes.map((node, i) => {\n const position = {\n depth,\n ancestorHasNextSibling,\n isLast: i === nodes.length - 1,\n posinset: i + 1,\n setsize: nodes.length,\n }\n return (\n <Fragment key={node.value}>\n {row(node, position)}\n {node.children &&\n renderTree(\n node.children,\n row,\n depth + 1,\n depth === 0 ? [] : [...ancestorHasNextSibling, !position.isLast],\n )}\n </Fragment>\n )\n })\n\n/** A row's level and set position. The tree renders flat, so the browser can't derive them. */\nexport const treeItemAria = ({ depth, setsize, posinset }: TreePosition) => ({\n \"aria-level\": depth + 1,\n \"aria-setsize\": setsize,\n \"aria-posinset\": posinset,\n})\n\n/** The indent guides before a row's content. Top-level rows sit flush. */\nexport const TreeRails = ({ depth, ancestorHasNextSibling, isLast }: TreePosition) =>\n depth > 0 && (\n <>\n {/* ancestor rails: a vertical guide where that ancestor has a sibling below */}\n {ancestorHasNextSibling.map((hasNext, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: Indentation is stable inside component, we would want to rerender anyway.\n <span key={i} aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n {hasNext && <span className={cn(\"absolute inset-y-0 inset-s-1/2 w-px\", treeLine)} />}\n </span>\n ))}\n\n {/* connector: vertical (├ continues / └ stops) + horizontal elbow */}\n <span aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n <span\n className={cn(\"absolute inset-s-1/2 top-0 w-px\", treeLine, isLast ? \"h-1/2\" : \"bottom-0\")}\n />\n <span className={cn(\"absolute inset-s-1/2 top-1/2 h-px w-1/2\", treeLine)} />\n </span>\n </>\n )\n\n/** A row's default label, after the rails. */\nexport const TreeLabel = ({ className, children }: { className?: string; children: ReactNode }) => (\n <span className={cn(\"ms-1.5 min-w-0 flex-1 truncate text-start\", className)}>{children}</span>\n)\n\ntype TreeTriggerProps = Omit<ComponentProps<\"div\">, \"role\" | \"tabIndex\" | \"color\"> &\n WithTestId & {\n open: boolean\n disabled?: boolean\n readOnly?: boolean\n invalid: boolean\n color?: Color\n startSlot?: ReactNode\n endSlot?: ReactNode\n /** Clears the value. Omit it to hide the clear button. */\n onClear?: () => void\n clearLabel: string\n clearSectionMode: ClearSectionMode\n icons: { clear: ReactNode; chevron: ReactNode }\n /** Enter, Space or ↓ on the closed trigger. */\n onOpen: () => void\n }\n\n/**\n * The real, focusable `<div role=\"combobox\">`, with its start slot, value\n * (`children`), end slot, clear button and chevron. A component of its own so\n * it reads the `Field` context from *inside* the picker's `FieldShell`: the\n * picker renders that shell, so `useFieldContext()` at its top level would\n * run too early. `Popover.Trigger` stamps its own id on the element, so the\n * `<label for>` never reaches it: the name comes from `aria-labelledby`.\n */\nexport const TreeTrigger = ({\n open,\n disabled,\n readOnly,\n invalid,\n color,\n startSlot,\n endSlot,\n onClear,\n clearLabel,\n clearSectionMode,\n icons,\n onOpen,\n testId,\n children,\n ...rest\n}: TreeTriggerProps) => {\n const field = useFieldContext()\n return (\n <Popover.Trigger asChild>\n <div\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n tabIndex={disabled ? -1 : 0}\n {...fieldA11yProps(field)}\n data-color={color}\n {...props({\n \"aria-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n \"data-invalid\": invalid,\n \"data-with-start-slot\": startSlot != null,\n // The trigger always ends in a chevron (and optional clear).\n \"data-with-end-slot\": true,\n // The shell IS the tabbable/focusable element here (no separate\n // inner control to route to), so `testId` lands directly on it.\n \"data-testid\": testId,\n })}\n onKeyDown={(event) => {\n if (disabled || readOnly) return\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"ArrowDown\") {\n event.preventDefault()\n onOpen()\n }\n }}\n {...rest}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n {children}\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {onClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onPointerDown={(event) => {\n event.preventDefault()\n event.stopPropagation()\n }}\n onClick={(event) => {\n event.stopPropagation()\n onClear()\n }}\n className={popoverClearTrigger}\n >\n {icons.clear}\n </button>\n )}\n {(clearSectionMode === \"both\" || !onClear) && (\n <span aria-hidden data-chevron className={cn(popoverChevron, open && \"rotate-180\")}>\n {icons.chevron}\n </span>\n )}\n </div>\n </Popover.Trigger>\n )\n}\n\n/** The popover's search field, in its fixed header. */\nexport const TreeSearch = ({\n ref,\n value,\n onChange,\n onKeyDown,\n placeholder,\n label,\n className,\n}: {\n ref: Ref<HTMLInputElement>\n value: string\n onChange: (value: string) => void\n onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void\n placeholder: string\n label: string\n className?: string\n}) => (\n <Popover.Header>\n <input\n ref={ref}\n type=\"text\"\n value={value}\n onChange={(event) => onChange(event.target.value)}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n aria-label={label}\n className={cn(inputControlClasses, \"text-sm\", className)}\n />\n </Popover.Header>\n)\n\n/** The scrolling body: the `role=\"tree\"` list, or `empty` when the search matched nothing. */\nexport const TreeBody = ({\n id,\n isEmpty,\n empty,\n multiselectable,\n onKeyDown,\n children,\n}: {\n id: string\n isEmpty: boolean\n empty: ReactNode\n multiselectable?: boolean\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void\n children: ReactNode\n}) => (\n <Popover.Body>\n {isEmpty ? (\n <div className={popoverEmpty}>{empty}</div>\n ) : (\n <div\n id={id}\n role=\"tree\"\n {...props({ \"aria-multiselectable\": multiselectable && \"true\" })}\n aria-orientation=\"vertical\"\n onKeyDown={onKeyDown}\n className=\"flex flex-col\"\n >\n {children}\n </div>\n )}\n </Popover.Body>\n)\n\ntype UseTreeRovingFocusOptions = {\n /** The rows that take focus (enabled, and selectable), in visual order. */\n values: readonly string[]\n /** A row's label, matched by type-ahead. */\n labelOf: (value: string) => string\n open: boolean\n searchable: boolean\n /** Space / Enter on the focused row. */\n onActivate: (value: string) => void\n}\n\n/**\n * Roving focus over a flat-rendered tree. One row is active (`tabIndex=0`,\n * `data-active`); `↑` / `↓` step through `values`, `Home` / `End` jump to\n * either end, `Space` / `Enter` activate, and printable keys type-ahead to the\n * next row whose label starts with what was typed. On open, focus lands in\n * the search field when there is one, on the active row otherwise.\n */\nexport const useTreeRovingFocus = ({\n values,\n labelOf,\n open,\n searchable,\n onActivate,\n}: UseTreeRovingFocusOptions) => {\n const [activeValueState, setActiveValue] = useState<string | null>(null)\n // A row filtered out (or disabled) since it was active falls back to the first.\n const activeValue =\n activeValueState != null && values.includes(activeValueState)\n ? activeValueState\n : (values[0] ?? null)\n\n const searchRef = useRef<HTMLInputElement>(null)\n const rowRefs = useRef(new Map<string, HTMLElement>())\n const focusRow = (next: string | null | undefined) => {\n if (next == null) return\n setActiveValue(next)\n rowRefs.current.get(next)?.focus()\n }\n\n // Type-ahead: typed characters buffer briefly and jump to the next row whose\n // label starts with the buffer. Only fires while the tree itself has focus —\n // when `searchable`, keys land in the search field instead.\n const typeahead = useRef<{ query: string; timer: ReturnType<typeof setTimeout> | null }>({\n query: \"\",\n timer: null,\n })\n useEffect(\n () => () => {\n if (typeahead.current.timer) clearTimeout(typeahead.current.timer)\n },\n [],\n )\n const typeToFocus = (char: string) => {\n const state = typeahead.current\n if (state.timer) clearTimeout(state.timer)\n state.query += char\n state.timer = setTimeout(() => {\n state.query = \"\"\n }, 500)\n\n const n = values.length\n if (n === 0) return\n const q = state.query.toLowerCase()\n // A run of the same key (\"ss\") cycles through same-initial matches.\n const repeated = q.length > 1 && [...q].every((c) => c === q.charAt(0))\n const needle = repeated ? q.charAt(0) : q\n const start = activeValue ? values.indexOf(activeValue) : -1\n const base = start === -1 ? 0 : start\n // Advance past the current row for a fresh/repeated key; keep it for a\n // growing multi-char query so the current match can still satisfy it.\n const advance = start !== -1 && (q.length === 1 || repeated) ? 1 : 0\n const match = Array.from({ length: n }, (_, i) => values[(base + advance + i) % n]).find(\n (value) => value != null && labelOf(value).toLowerCase().startsWith(needle),\n )\n focusRow(match)\n }\n\n // On open, focus the search field (or the active row). Initial focus only.\n // biome-ignore lint/correctness/useExhaustiveDependencies: re-running on activeValue would steal focus while navigating the tree.\n useEffect(() => {\n if (!open) return\n const id = requestAnimationFrame(() => {\n // preventScroll: the content is portaled, so focusing it before the\n // positioner places it would otherwise warp the page to the top.\n if (searchable) searchRef.current?.focus({ preventScroll: true })\n else if (activeValue) rowRefs.current.get(activeValue)?.focus({ preventScroll: true })\n })\n return () => cancelAnimationFrame(id)\n }, [open, searchable])\n\n const moveActive = (dir: 1 | -1) => {\n if (values.length === 0) return\n const idx = activeValue ? values.indexOf(activeValue) : -1\n const next =\n idx === -1\n ? dir === 1\n ? 0\n : values.length - 1\n : Math.min(Math.max(idx + dir, 0), values.length - 1)\n focusRow(values[next])\n }\n\n const onTreeKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault()\n moveActive(1)\n break\n case \"ArrowUp\":\n event.preventDefault()\n moveActive(-1)\n break\n case \"Home\":\n event.preventDefault()\n focusRow(values[0])\n break\n case \"End\":\n event.preventDefault()\n focusRow(values[values.length - 1])\n break\n case \" \":\n case \"Enter\":\n event.preventDefault()\n if (activeValue != null) onActivate(activeValue)\n break\n default:\n // Single printable key (no modifier) drives type-ahead. Space never\n // reaches here — it's handled above as \"activate\".\n if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n event.preventDefault()\n typeToFocus(event.key)\n }\n }\n }\n\n const onSearchKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault()\n focusRow(values[0])\n }\n }\n\n /** Spread on each focusable row: its ref and `data-active`. The row sets its own roving\n * `tabIndex={value === activeValue ? 0 : -1}`, where the a11y lint can see it. */\n const rowProps = (value: string) => ({\n ref: (el: HTMLElement | null) => {\n if (el) rowRefs.current.set(value, el)\n else rowRefs.current.delete(value)\n },\n ...props({ \"data-active\": value === activeValue }),\n })\n\n return { activeValue, setActiveValue, searchRef, rowProps, onTreeKeyDown, onSearchKeyDown }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/overlay-layer.tsx"],"names":[],"mappings":";;;;AA0CA,IAAM,WAAA,uBAAiC,GAAA,EAAI;AAE3C,IAAM,mBAAA,GAAsB,cAA6B,WAAW,C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EAAO,WAAA,CAAY,GAAA,CAAI,KAAK,CAAA;AAChC,IAAA,OAAO,MAAM;AACX,MAAA,MAAA,CAAO,OAAO,KAAK,CAAA;AACnB,MAAA,WAAA,CAAY,OAAO,KAAK,CAAA;AAAA,IAC1B,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,IAAA,EAAM,KAAA,EAAO,MAAM,CAAC,CAAA;AAC1B;AAIO,IAAM,WAAA,GAAc,CAAC,EAAE,IAAA,EAAM,OAAM,KAA0C;AAClF,EAAA,cAAA,CAAe,IAAA,EAAM,EAAE,KAAA,EAAO,CAAA;AAC9B,EAAA,OAAO,IAAA;AACT;AAOO,IAAM,kBAAkB,MAAuB;AACpD,EAAA,MAAM,MAAA,GAAS,WAAW,mBAAmB,CAAA;AAC7C,EAAA,OAAO,YAAY,MAAM,MAAA,CAAO,OAAO,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AACpD","file":"chunk-HWBFRDX7.js","sourcesContent":["\"use client\"\n\nimport { createContext, type ReactNode, useCallback, useContext, useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-layout-effect\"\n\n/**\n * One outside click dismisses one layer.\n *\n * Every dismissable surface (zag's `trackDismissableElement`) listens for\n * pointerdown on the whole document and closes itself when the target falls\n * outside it. Nested layers don't coordinate: a click on a Modal's backdrop\n * while a DatePicker inside it is open lands outside *both*, so both close —\n * the picker and the dialog the user was filling in. Zag only spares the\n * parent when the child is pointer-blocking (pickers aren't) or was removed a\n * tick earlier (the parent's listener runs first, so it never is), and its\n * `layerStack` isn't exported for us to ask.\n *\n * So the kit tracks it itself. A parent (`Modal`, `Drawer`, `Popover`) owns a\n * set of open children and vetoes its own outside-dismiss while that set is\n * non-empty; every floating panel registers with its nearest parent while\n * open. The click that would have cascaded closes the innermost layer only,\n * and the next one closes the parent.\n *\n * Context rather than DOM queries because context crosses portals: the\n * registration reaches the right parent wherever the panel was portaled to —\n * the parent's positioner, `document.body`, a custom `container`, or nowhere\n * (`withinPortal={false}`).\n *\n * Pointer-down only. Escape is already top-most-only in zag, and focus can't\n * leave a modal for a sibling layer it doesn't own.\n *\n * The same sets answer a second question: is anything open above me? A\n * component reads its nearest set with `useLayerCovered` (that is how\n * `useHotkey` yields to an overlay). Outside every overlay, the nearest set is\n * the page's own: `Modal` and `Drawer` register into it while open just like a\n * picker does, so a page-level reader sees them, and a reader inside a Modal\n * sees only what opened from that Modal.\n */\nexport type OverlayLayers = Set<symbol>\n\n/** The page's set: what a layer registers into when no overlay encloses it.\n * Nothing guards it (the page has no outside to dismiss), it only counts. */\nconst PAGE_LAYERS: OverlayLayers = new Set()\n\nconst OverlayLayerContext = createContext<OverlayLayers>(PAGE_LAYERS)\n\n/** The modal layers open right now, anywhere on the page: every open\n * `Modal`, `Drawer` and `Lightbox`, however deeply nested. Module scope, not\n * context, because its one reader (`notify()`) runs outside React. Not\n * derivable from `PAGE_LAYERS`: a Drawer opened from a page Popover\n * registers into the popover's set, not the page's. */\nconst OPEN_MODALS = new Set<symbol>()\n\n/** Whether a Modal, Drawer or Lightbox is open right now. The notifier asks\n * when a toast is created, to raise it above the modal (`--toast-raised-z`). */\nexport const isModalOpen = () => OPEN_MODALS.size > 0\n\n/** A press on a toast is never \"outside\" a layer. Toasts raised from a modal\n * paint above it, and dismissing one must not take the modal (and the form\n * in it) along. zag dispatches its outside event on the layer's own content\n * node, so the pressed node is the original event's target, in `detail`. */\nconst isToastEvent = (event: Event) => {\n const target = (event as CustomEvent<{ originalEvent?: Event }>).detail?.originalEvent?.target\n return target instanceof Element && target.closest('[data-scope=\"notifications\"]') != null\n}\n\n/** For a parent layer. Spread `onPointerDownOutside` onto the Ark root\n * (composed with the caller's own) and wrap the children that may open nested\n * layers in `OverlayLayerProvider`. A ref'd set, not state: it's read synchronously while\n * zag dispatches the outside event, and changing it must not re-render. */\nexport const useLayerGuard = <E extends Event>(onPointerDownOutside?: (event: E) => void) => {\n const layers = useRef<OverlayLayers>(new Set()).current\n const guard = useCallback(\n (event: E) => {\n onPointerDownOutside?.(event)\n if (layers.size > 0 || isToastEvent(event)) event.preventDefault()\n },\n [layers, onPointerDownOutside],\n )\n return { layers, onPointerDownOutside: guard }\n}\n\nexport const OverlayLayerProvider = ({\n value,\n children,\n}: {\n value: OverlayLayers\n children?: ReactNode\n}) => <OverlayLayerContext.Provider value={value}>{children}</OverlayLayerContext.Provider>\n\n/** For a child layer: registers with the nearest parent (the page's set when\n * none encloses it) while `open`. Keyed on\n * `open`, not presence, so a panel playing its exit animation no longer holds\n * the parent's next click. A layout effect so the registration is in place\n * before the browser can deliver the next pointerdown. `modal` marks a\n * Modal, Drawer or Lightbox, which `isModalOpen` counts. */\nexport const useNestedLayer = (open: boolean, { modal = false }: { modal?: boolean } = {}) => {\n const parent = useContext(OverlayLayerContext)\n useIsomorphicLayoutEffect(() => {\n if (!open) return\n const token = Symbol()\n parent.add(token)\n if (modal) OPEN_MODALS.add(token)\n return () => {\n parent.delete(token)\n OPEN_MODALS.delete(token)\n }\n }, [open, modal, parent])\n}\n\n/** `useNestedLayer` as an element, for call sites that only have the machine's\n * `open` inside a render prop (`<Ark.Context>{(api) => …}</Ark.Context>`). */\nexport const NestedLayer = ({ open, modal }: { open: boolean; modal?: boolean }) => {\n useNestedLayer(open, { modal })\n return null\n}\n\n/** Whether a layer is open above the component calling this, right now: a\n * Modal, Drawer, Popover or picker that opened from the same layer (from the\n * page, for a component outside every overlay). Returns a reader, not a\n * value, so it is checked when it matters (a key press) and opening a layer\n * never re-renders the caller. */\nexport const useLayerCovered = (): (() => boolean) => {\n const layers = useContext(OverlayLayerContext)\n return useCallback(() => layers.size > 0, [layers])\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/input/input.tsx"],"names":[],"mappings":";;;;;;;;;AAwCO,IAAM,mBAAA,GAAsB,EAAA;AAAA,EACjC,uEAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,6BAAA;AAAA,EACA,iCAAA;A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B,QAAA,EAAU,YAAY,KAAA,EAAO;AAAA,OAC9B,CAAA;AAAA,MAED,QAAA,kBAAA,GAAA;AAAA,QAAC,GAAA,CAAI,KAAA;AAAA,QAAJ;AAAA,UACE,GAAG,eAAA;AAAA,UACH,GAAG,eAAe,KAAK,CAAA;AAAA,UACvB,GAAG,KAAA,CAAM;AAAA,YACR,QAAA,EAAU,YAAY,KAAA,EAAO,QAAA;AAAA,YAC7B,cAAA,EAAgB,WAAW,KAAA,EAAO,OAAA;AAAA,YAClC,QAAA,EAAU,YAAY,KAAA,EAAO,QAAA;AAAA,YAC7B,aAAA,EAAe;AAAA,WAChB,CAAA;AAAA,UACD,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,UAAA,EAAY,KAAK,CAAA;AAAA,UACnD,GAAG;AAAA;AAAA;AACN;AAAA,GACF;AAEJ","file":"chunk-I4B3N3UX.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ReactNode, Ref } from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { fieldA11yProps } from \"../field/field\"\n\n/**\n * Input / InputBase — the styled input *shell* the whole form family renders\n * into (Select trigger, Combobox/Autocomplete search field, PillsInput, and\n * `TextInput`). It is deliberately the lowest layer: label / description /\n * error live in `Field`, not here — reach for `TextInput` when you want them\n * built in, which is the common case, and for `Input` when you're composing\n * the shell yourself or the control needs no accessible name of its own.\n *\n * - `InputBase` is the polymorphic shell. It draws the bordered box, the\n * focus-visible ring, the disabled / invalid states, and lays out\n * an optional `startSlot` / `endSlot` around a single control child. The\n * child can be anything — an `<input>`, a `<button>` (Select trigger), or a\n * `<div>` of pills (PillsInput). Style your control with the exported\n * `inputControlClasses` so it sits flush inside the shell.\n * - `Input` is `InputBase` wrapping a real `<input>`. Native\n * input props (`value`, `onChange`, `placeholder`, `name`, `type`, `ref`, …)\n * are forwarded straight to the element; `className` styles the shell root\n * (matching the kit's other components), and `classNames` overrides parts.\n *\n * The shell is palette-independent, so there is no `color` prop: the focus halo\n * and border are a fixed `brand-500` per the 42 UI Kit Figma (see `shellChrome`),\n * and `de33dee` removed both `color` and the `filled` variant. `invalid` swaps\n * the border / ring to red.\n */\n\n/** Inner-control reset — apply to whatever element you nest inside `InputBase`\n * (input, button, …) so it inherits the shell's font and fills the row. */\nexport const inputControlClasses = cn(\n \"w-full flex-1 min-w-0 appearance-none border-0 bg-transparent p-0 m-0\",\n // `font: inherit` is the canonical form-control reset — without it the UA\n // forces its own font-size and the shell's `size` text scale is ignored.\n // No `text-trim`: a native `<input>`'s text renders inside the UA's own\n // form-control internals, not a normal CSS line box, so `text-box-trim`\n // computes an inconsistent (content-dependent) box height there — Chrome\n // was scrolling the text vertically once its computed box stopped matching\n // the element's actual rendered height.\n \"font-[inherit] text-inherit\",\n \"outline-none focus:outline-none\",\n \"placeholder:text-black/50 dark:placeholder:text-white/50\",\n \"disabled:cursor-not-allowed\",\n)\n\n/**\n * Shared shell chrome — surface, border, focus ring, and state styling. The\n * single-line `Input` shell and the multi-line `PillsInput` shell both build on\n * these; only the layout (row vs wrap) and the sizing differ, so the visual\n * treatment (incl. the invalid red halo) lives in exactly one place.\n */\nexport const shellChrome = [\n \"group/input relative rounded-input border outline-none\",\n TEXT_COLOR_CLASSES.primary,\n \"transition-[color,box-shadow,border-color]\",\n // Fixed brand-500 focus halo + border, per the 42 UI Kit Figma — independent\n // of the instance's own `color`. The combined selector matches either shape\n // in the family: a shell wrapping a real focusable descendant (Input,\n // Select, Combobox, MultiSelect, ComboboxList, MultiComboboxList, PinInput's\n // per-cell shell) or a shell that IS the tabbable element itself (TreeSelect,\n // TreeMultiSelect). `:has()` alone only matches the former.\n \"[&:is(:focus-visible,:has(:focus-visible))]:border-brand-500 [&:is(:focus-visible,:has(:focus-visible))]:ring-[3px] [&:is(:focus-visible,:has(:focus-visible))]:ring-brand-500/15\",\n // Invalid wins over the palette: red border + red halo. Same combined\n // selector as the rule above so the two can't drift out of sync.\n \"data-invalid:border-red-500 data-invalid:[&:is(:focus-visible,:has(:focus-visible))]:border-red-500 data-invalid:[&:is(:focus-visible,:has(:focus-visible))]:ring-red-500/15\",\n // Disabled affordances on the shell.\n \"data-disabled:cursor-not-allowed data-disabled:opacity-60\",\n \"data-disabled:bg-white/8\",\n \"data-pointer:cursor-pointer\",\n // `:where()` drops every shell svg rule to zero class specificity, so it\n // sizes bare icons (the slot's own, the family's chevron / clear) while a\n // component in a slot that styles its own icons (Kbd, Badge, Spinner…), or\n // a size class on the icon itself, wins whatever the CSS order (#422).\n \"[:where(&)_svg]:pointer-events-none [:where(&)_svg]:shrink-0\",\n]\n\n/** Surface treatment per `variant`, shared across the input shells. */\nexport const shellVariants = {\n // Translucent border to go with the translucent fill: at `bg-white/4` the\n // shell has no ground of its own, so a fixed opaque hairline can vanish (on\n // a light-gray card) or over-assert (on a mid-tone host page). Same hue\n // language as Card's `default` (navy-tinted light / white-tinted dark), one\n // alpha step tighter — these render within a shade of the opaque colors\n // they replace, so the hairline keeps its weight and only gains\n // background-adaptivity.\n default: [\"bg-white/4\", \"border-brand-900/20 dark:border-white/15\"],\n // Escape hatch: strip the chrome but keep the layout (height / slots). Same\n // combined selector as `shellChrome`'s \"on\" rule so the cancel can't drift.\n unstyled: [\n \"border-transparent bg-transparent\",\n \"rounded-none [&:is(:focus-visible,:has(:focus-visible))]:ring-0\",\n ],\n}\n\n/**\n * Inline gap between the shell's slots and control, per `size`. The single\n * source for this spacing: `inputShell` applies it to the shell row, and any\n * control that lays out its *own* slots inside a nested flex (e.g. the Select\n * trigger) reuses it so adornments sit identically across the family.\n */\nexport const shellGap = {\n xs: \"gap-1.5\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-2.5\",\n xl: \"gap-3\",\n} as const\n\n/** Single-line input shell. Reused by the family's button / input controls. */\nexport const inputShell = cva([...shellChrome, \"flex w-full items-center gap-y-0.5\"], {\n variants: {\n variant: shellVariants,\n // Padding is slot-aware: the base is the tight, no-adornment inset, and each\n // side gains a step of inline padding only when `InputBase` flags an\n // adornment there (`data-with-start-slot` / `data-with-end-slot`). These are\n // self-referential `data-*` variants — the attributes live on this same\n // shell element, so a `group-*` variant (which targets descendants) wouldn't\n // match.\n size: {\n xs: [\n \"ps-1.5 pe-1.5\",\n \"data-with-start-slot:ps-2 data-with-end-slot:pe-2\",\n `min-h-7 ${shellGap.xs} text-xs [:where(&)_svg]:size-3`,\n ],\n sm: [\n \"ps-2 pe-2\",\n \"data-with-start-slot:ps-2.5 data-with-end-slot:pe-2.5\",\n `min-h-8 ${shellGap.sm} text-sm [:where(&)_svg]:size-3.5`,\n ],\n md: [\n \"ps-2 pe-2\",\n \"data-with-start-slot:ps-2.5 data-with-end-slot:pe-2.5\",\n `min-h-9 ${shellGap.md} text-md [:where(&)_svg]:size-4`,\n ],\n lg: [\n \"ps-3 pe-3\",\n \"data-with-start-slot:ps-3.5 data-with-end-slot:pe-3.5\",\n `min-h-10 ${shellGap.lg} text-lg [:where(&)_svg]:size-5`,\n ],\n xl: [\n \"ps-3.5 pe-3.5\",\n \"data-with-start-slot:ps-4 data-with-end-slot:pe-4\",\n `min-h-12 ${shellGap.xl} text-xl [:where(&)_svg]:size-6`,\n ],\n },\n },\n defaultVariants: { variant: \"default\", size: \"md\" },\n})\n\n/** Start/end adornment slot — the shared visual contract for the inline-start /\n * inline-end content the whole form family lays out (icon, chevron, clear).\n * Exported so Select / Combobox / the pills controls slot their adornments\n * identically to `InputBase` instead of re-deriving the layout. */\nexport const inputSlot = cn(\n \"inline-flex shrink-0 items-center justify-center\",\n TEXT_COLOR_CLASSES.muted,\n)\n\n/** Muted color for a component's own custom-rendered placeholder / empty-state text — a\n * `<span>` standing in for a native `::placeholder` wherever the value display isn't a real\n * `<input>` (Select's trigger, MultiSelect's non-searchable mode, TreeSelect / TreeMultiSelect's\n * trigger, DatePicker's range-mode trigger). Same color pairing as `inputControlClasses`'s native\n * `::placeholder` rule above. Kept as its own export, not folded into `inputSlot` — `inputSlot`'s\n * `inline-flex items-center justify-center shrink-0` are icon-slot layout rules; forced onto a\n * run of text they'd center it and block it from shrinking, silently breaking truncation on the\n * call sites where this color sits on the same span as `flex-1`/`truncate`. */\nexport const placeholderColor = TEXT_COLOR_CLASSES.muted\n\nexport type InputVariant = NonNullable<VariantProps<typeof inputShell>[\"variant\"]>\nexport type InputSize = NonNullable<VariantProps<typeof inputShell>[\"size\"]>\n\ntype ShellClassNames = {\n /** The shell `<div>` (also targeted by `className`). */\n root?: string\n startSlot?: string\n endSlot?: string\n}\n\n/** Props shared by the shell and the convenience `Input`. */\ntype ShellOwnProps = VariantProps<typeof inputShell> & {\n /** Red border + ring; also wires `aria-invalid` on `Input`. */\n invalid?: boolean\n /** Dims the shell and (on `Input`) disables the element. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits (on `Input`). */\n readOnly?: boolean\n /** `cursor: pointer` — for button-like triggers (Select). */\n pointer?: boolean\n /** Decorative or interactive content at the inline-start of the control. */\n startSlot?: ReactNode\n /** Content at the inline-end — chevron, clear button, spinner. */\n endSlot?: ReactNode\n}\n\nexport type InputBaseProps = NoAsChild<Omit<HTMLArkProps<\"div\">, \"color\">> &\n ShellOwnProps &\n WithTestId & {\n classNames?: ShellClassNames\n }\n\nexport const InputBase = ({\n variant,\n size,\n invalid,\n disabled,\n readOnly,\n pointer,\n startSlot,\n endSlot,\n children,\n className,\n classNames,\n testId,\n asChild: _asChild,\n ...rest\n}: InputBaseProps) => (\n <ark.div\n {...props({\n \"data-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n \"data-pointer\": pointer,\n // Drive the slot-aware padding in `inputShell`: each side gains a step of\n // inline padding when an adornment sits there (`data-with-*-slot:`).\n \"data-with-start-slot\": startSlot != null,\n \"data-with-end-slot\": endSlot != null,\n // Only meaningful when `InputBase` is used bare (no `Input`-style inner\n // control routing its own `testId`) — a `testId` given to a control that\n // wraps `InputBase` itself (Input, NumberInput, Select, …) always lands\n // on that control's real interactive element instead, never here.\n \"data-testid\": testId,\n })}\n className={cn(className, classNames?.root, inputShell({ variant, size }))}\n {...rest}\n >\n {startSlot != null && (\n <span className={cn(inputSlot, classNames?.startSlot)} aria-hidden>\n {startSlot}\n </span>\n )}\n {children}\n {endSlot != null && (\n <span className={cn(inputSlot, classNames?.endSlot)} aria-hidden>\n {endSlot}\n </span>\n )}\n </ark.div>\n)\n\nexport type InputProps = Omit<HTMLArkProps<\"input\">, \"size\" | \"color\"> &\n ShellOwnProps &\n WithTestId & {\n /** Lands on the underlying `<input>` for focus-on-error. Declared\n * explicitly because `HTMLArkProps` is `ComponentPropsWithoutRef`, so the\n * native prop types alone don't carry it — same as `Textarea`,\n * `PasswordInput`, and `NumberInput`. */\n ref?: Ref<HTMLInputElement>\n classNames?: ShellClassNames & {\n /** The inner `<input>` element. */\n input?: string\n }\n }\n\nexport const Input = ({\n variant,\n size,\n invalid,\n disabled,\n readOnly,\n pointer,\n startSlot,\n endSlot,\n className,\n classNames,\n testId,\n ...rest\n}: InputProps) => {\n // When nested in a `Field`, inherit its id / aria-describedby / state so the\n // label, description, and error wire up — exactly how Ark's own `Field.Input`\n // behaves. `useFieldContext` is null outside a Field, so this is a no-op then.\n const field = useFieldContext()\n const fieldInputProps = field?.getInputProps()\n\n return (\n <InputBase\n variant={variant}\n size={size}\n pointer={pointer}\n startSlot={startSlot}\n endSlot={endSlot}\n className={className}\n classNames={{\n root: classNames?.root,\n startSlot: classNames?.startSlot,\n endSlot: classNames?.endSlot,\n }}\n {...props({\n disabled: disabled || field?.disabled,\n invalid: invalid || field?.invalid,\n readOnly: readOnly || field?.readOnly,\n })}\n >\n <ark.input\n {...fieldInputProps}\n {...fieldA11yProps(field)}\n {...props({\n disabled: disabled || field?.disabled,\n \"aria-invalid\": invalid || field?.invalid,\n readOnly: readOnly || field?.readOnly,\n \"data-testid\": testId,\n })}\n className={cn(inputControlClasses, classNames?.input)}\n {...rest}\n />\n </InputBase>\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/select/select.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;;;;AAgJA,IAAM,UAAA,GAAa,CAAC,CAAA,KAClB,CAAA,KAAM,MAAA,GAAY,MAAA,GAAY,CAAA,KAAM,IAAA,GAAO,EAAC,GAAI,CAAC,CAAC,CAAA;AAQpD,IAAM,gBAAgB,CAAC;AAAA,EACrB,GAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,KAMmB;AACjB,EAAA,MAAM,QAAQ,eAAA,EAAgB;AAC9B,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAI,OAAA;AAAA,IAAJ;AAAA,MACC,GAAA;AAAA,MACA,MAAA;AAAA,MACC,GAAG,KAAA,CAAM,EAAE,gBAAgB,OAAA,EAAS,aAAA,EAAe,QAAQ,CAAA;AAAA,MAC3D,GAAG,eAAe,KAAK,CAAA;AAAA,MACxB,SAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAA;AAEO,IAAM,SAAS,CAA6C;AAAA,EACjE,YAAA,GAAe,IAAA;AAAA,EACf,SAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA,GAAc,cAAA;AAAA,EACd,SAAA;AAAA,EACA,gBAAA,GAAmB,SAAA;AAAA,EACnB,SAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP,OAAA,GAAU,SAAA;AAAA,EACV,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA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AAA,EAAY,EAAE,KAAA,EAAO,UAAA,EAAY,KAAA,EAAM;AAAA,MAEtC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-IA6DCC3N.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { Select as Ark } from \"@ark-ui/react/select\"\nimport {\n type ComponentProps,\n type FocusEvent,\n type ReactNode,\n type Ref,\n useMemo,\n useRef,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { NestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport {\n type ClearSectionMode,\n type NormalizedItem,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { COMBOBOX_DEFAULT_TRANSLATIONS, type ComboboxTranslations } from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n type InputSize,\n type InputVariant,\n inputShell,\n inputSlot,\n placeholderColor,\n shellGap,\n} from \"../input/input\"\nimport { CheckIcon, ChevronIcon, CloseIcon } from \"../popover/icons\"\nimport {\n popoverChevron,\n popoverClearTrigger,\n popoverContent,\n popoverGroupLabel,\n popoverIndicator,\n popoverList,\n popoverOption,\n scrollHighlightedIntoView,\n} from \"../popover/popover\"\n\n/**\n * Select — data-driven single-value picker on Ark UI's Select machine. Pass\n * `data` and it renders: a styled trigger, a popover of options, native form\n * submission (hidden `<select>`), typeahead, and full keyboard / RTL / ARIA from\n * Ark. For a *searchable* picker use `Autocomplete`; for multiple values use\n * `MultiSelect`.\n *\n * - `data` accepts `string[]`, `{ value, label?, disabled? }[]`, or grouped\n * `{ group, items }[]` (see `SelectData`).\n * - Value is a single `string | null`; the machine's array contract is hidden.\n * - Label / description / error come from the built-in `Field` wrapper, so a\n * `Select` is accessible and complete on its own.\n * - `clearable` swaps the chevron for a clear button once a value is set.\n *\n * Palette rides on `data-color`; the trigger reuses the shared input shell and\n * the popover the shared option styling, so Select and Combobox look identical.\n */\n\ntype SelectClassNames = {\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it (pair with a sibling element for a visible label\n * placed elsewhere in the layout). */\n label?: string\n control?: string\n option?: string\n popover?: string\n}\n\nexport type SelectProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled value. */\n value?: SelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: SelectValue<Data> | null\n /** Fires with the selected value (or `null` when cleared). */\n onChange?: (value: SelectValue<Data> | null) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including any check\n * affordance. Omit it to render the label + selected check.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder shown while no value is selected. */\n placeholder?: string\n /** Show a clear button (and allow deselecting) once a value is set. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the chevron / clear button. */\n endSlot?: ReactNode\n size?: InputSize\n variant?: InputVariant\n color?: Color\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Wires the hidden `<select>` into native form submission. */\n name?: string\n /** Forwarded to the trigger; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLButtonElement>) => void\n /** Lands on the trigger `<button>` for focus-on-error. */\n ref?: Ref<HTMLButtonElement>\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?: SelectClassNames\n /** Overrides the clear button's (`clearTriggerLabel`, default `\"Clear value\"`) and the\n * chevron's (`triggerLabel`, default `\"Show options\"`) accessible names — the same keys as\n * the rest of the combobox family. A partial override keeps the other default. */\n translations?: SelectTranslations\n }\n\n/** Ark's own Select `translations` type (its `clearTriggerLabel`), derived structurally rather\n * than imported from `@zag-js/select`, plus the combobox family's `triggerLabel` for the\n * kit's own chevron button. */\nexport type SelectTranslations = NonNullable<Ark.RootProps<NormalizedItem>[\"translations\"]> &\n Pick<ComboboxTranslations, \"triggerLabel\">\n\n/** Wrap a scalar value into Ark's array contract (or clear with `[]`). */\nconst toArkValue = (v: string | null | undefined): string[] | undefined =>\n v === undefined ? undefined : v === null ? [] : [v]\n\n/**\n * The real, focusable `<button role=\"combobox\">`, split out so it reads the\n * `Field` context from *inside* the wrapping `FieldShell` — `Select` itself\n * renders that shell, so calling `useFieldContext()` at its own top level\n * would run too early.\n */\nconst SelectTrigger = ({\n ref,\n onBlur,\n invalid,\n testId,\n className,\n children,\n}: {\n ref?: Ref<HTMLButtonElement>\n onBlur?: (event: FocusEvent<HTMLButtonElement>) => void\n invalid: boolean\n className?: string\n children: ReactNode\n} & WithTestId) => {\n const field = useFieldContext()\n return (\n <Ark.Trigger\n ref={ref}\n onBlur={onBlur}\n {...props({ \"aria-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={className}\n >\n {children}\n </Ark.Trigger>\n )\n}\n\nexport const Select = <const Data extends SelectData = SelectData>({\n withinPortal = true,\n container,\n data,\n value,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Pick a value\",\n clearable,\n clearSectionMode = \"replace\",\n startSlot,\n endSlot,\n size = \"md\",\n variant = \"default\",\n color,\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n ...selectProps\n}: SelectProps<Data> & Omit<ComponentProps<\"select\">, keyof SelectProps>) => {\n const resolvedTranslations = { ...COMBOBOX_DEFAULT_TRANSLATIONS, ...translations }\n const portalContainer = useOverlayContainer(container)\n const { collection, items, groups } = useMemo(() => normalizeSelectData(data), [data])\n const controlRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const mergedTriggerRef = useMergedRefs(triggerRef, ref)\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 selected = items.find(({ value: iv }) => value === iv)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Ark.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={cn(popoverOption({ size }), classNames?.option)}\n >\n {renderItem ? (\n <Ark.ItemContext>\n {(ctx) =>\n renderItem(item, {\n selected: ctx.selected,\n highlighted: ctx.highlighted,\n })\n }\n </Ark.ItemContext>\n ) : (\n <>\n <Ark.ItemText>{item.label}</Ark.ItemText>\n <Ark.ItemIndicator className={popoverIndicator}>\n <CheckIcon />\n </Ark.ItemIndicator>\n </>\n )}\n </Ark.Item>\n )\n\n const control = (\n <Ark.Root\n collection={collection}\n value={toArkValue(value)}\n defaultValue={toArkValue(defaultValue)}\n // The machine's collection is typed by value (`string`); the runtime value\n // always originates from `data`, so narrow it back to the caller's value union.\n onValueChange={\n onChange ? (d) => onChange((d.value[0] ?? null) as SelectValue<Data> | null) : undefined\n }\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n deselectable={clearable}\n translations={resolvedTranslations}\n // Ark anchors Select's positioner to the Trigger, which sits inside the\n // padded `inputShell` Control — so `sameWidth` would inset the panel. Anchor\n // to the full Control instead (matching Combobox), so the panel aligns with\n // and matches the trigger's width.\n positioning={{\n sameWidth: true,\n getAnchorRect: () => controlRef.current?.getBoundingClientRect() ?? null,\n }}\n // Content is an `overflow-hidden` clip wrapper, so the machine's native\n // auto-scroll (which needs Content scrollable) no-ops; route scrolling to\n // the inner List scroller instead.\n scrollToIndexFn={scrollHighlightedIntoView}\n data-color={color}\n // `relative` contains the absolutely positioned hidden input, which would\n // otherwise escape any scroller this control sits in.\n className={cn(\"relative w-full\", className)}\n >\n <Ark.Context>\n {(api) => {\n const showClear = Boolean(clearable) && api.hasSelectedItems && !disabled && !readOnly\n const showChevron = clearSectionMode === \"both\" || !showClear\n return (\n <Ark.Control\n ref={controlRef}\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": startSlot != null,\n // The trigger always ends in a chevron / clear control.\n \"data-with-end-slot\": true,\n })}\n // Tablet affordance: a tap on the shell's dead zones (padding) opens\n // the menu too, not just the trigger. The trigger, clear and chevron\n // are all buttons, so the helper skips them and they self-handle.\n // Inert when disabled / readOnly, so it never opens where the trigger won't.\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(inputShell({ size, variant }), \"cursor-pointer\", classNames?.control)}\n >\n <SelectTrigger\n ref={mergedTriggerRef}\n onBlur={onBlur}\n invalid={isInvalid}\n 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 // Slots live inside the trigger (not the shell), so re-apply the\n // shell's per-size gap here to space the icon from the value.\n shellGap[size],\n )}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n <span className=\"min-w-0 flex-1 truncate text-start\">\n {api.hasSelectedItems ? (\n renderItem && selected ? (\n renderItem(selected, {\n selected: false,\n highlighted: false,\n })\n ) : (\n api.valueAsString\n )\n ) : (\n <span className={placeholderColor}>{placeholder}</span>\n )}\n </span>\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n </SelectTrigger>\n {showClear && (\n <Ark.ClearTrigger className={popoverClearTrigger}>\n <CloseIcon />\n </Ark.ClearTrigger>\n )}\n {showChevron && (\n // A sibling toggle button (the value `Ark.Trigger` can't nest it\n // next to the clear button), so the chevron sits at the far edge\n // like the rest of the family. Focus the trigger first so keyboard\n // nav stays on the combobox; `preventDefault` stops the tap from\n // stealing focus to this button. `tabIndex=-1`: the trigger is the\n // tab stop.\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={resolvedTranslations.triggerLabel}\n data-chevron\n className={cn(\n popoverChevron,\n \"inline-flex cursor-pointer items-center justify-center rounded-sm data-disabled:cursor-not-allowed\",\n api.open && \"rotate-180\",\n )}\n {...props({\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n })}\n onPointerDown={(event) => event.preventDefault()}\n {...(!(disabled || readOnly) && {\n onClick: () => {\n triggerRef.current?.focus()\n api.setOpen(!api.open)\n },\n })}\n >\n <ChevronIcon />\n </button>\n )}\n </Ark.Control>\n )\n }}\n </Ark.Context>\n\n {/* Holds an enclosing Modal/Drawer/Popover open while the list is; see `lib/overlay-layer.tsx`. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content data-color={color} className={cn(popoverContent, classNames?.popover)}>\n <Ark.List className={popoverList({ withPaddingTop: true })}>\n {groups\n ? groups.map((group) => (\n <Ark.ItemGroup key={group.group}>\n <Ark.ItemGroupLabel className={popoverGroupLabel}>\n {group.group}\n </Ark.ItemGroupLabel>\n {group.items.map(renderOption)}\n </Ark.ItemGroup>\n ))\n : items.map(renderOption)}\n </Ark.List>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n\n <Ark.HiddenSelect {...selectProps} />\n </Ark.Root>\n )\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 {control}\n </FieldShell>\n )\n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A,CAAa,EAAE,SAAS,CAAA,EAAG,YAAY,SAAS;AAAA;AAAA,aAChE;AAAA,YACC,UAAA,CAAW,GAAA,CAAI,CAAC,IAAA,qBACf,IAAA;AAAA,cAACA,cAAA,CAAI,IAAA;AAAA,cAAJ;AAAA,gBAEC,OAAO,IAAA,CAAK,KAAA;AAAA,gBACZ,UAAU,IAAA,CAAK,QAAA;AAAA,gBACf,eAAa,IAAA,CAAK,MAAA;AAAA,gBAClB,SAAA,EAAW,GAAG,WAAA,CAAY,EAAE,MAAM,CAAA,EAAG,YAAY,IAAI,CAAA;AAAA,gBAErD,QAAA,EAAA;AAAA,kCAAA,GAAA;AAAA,oBAACA,cAAA,CAAI,QAAA;AAAA,oBAAJ;AAAA,sBACC,cAAY,IAAA,CAAK,KAAA;AAAA,sBACjB,SAAA,EAAW,EAAA,CAAG,OAAA,CAAQ,EAAE,IAAA,EAAM,SAAS,IAAA,EAAM,CAAA,EAAG,UAAA,EAAY,QAAQ,CAAA;AAAA,sBAInE,QAAA,EAAA,UAAA,uBACEA,cAAA,CAAI,WAAA,EAAJ,EACE,QAAA,EAAA,CAAC,GAAA,KACA,WAAW,IAAA,EAA4C;AAAA,wBACrD,SAAS,GAAA,CAAI,OAAA;AAAA,wBACb,UAAU,GAAA,CAAI;AAAA,uBACf,CAAA,EAEL,CAAA,GAEA,IAAA,CAAK;AAAA;AAAA,mBAET;AAAA,kCACA,GAAA,CAACA,cAAA,CAAI,WAAA,EAAJ,EAAgB,CAAA;AAAA,kCACjB,GAAA,CAACA,cAAA,CAAI,eAAA,EAAJ,EAAoB;AAAA;AAAA,eAAA;AAAA,cA1BhB,IAAA,CAAK;AAAA,aA4Bb;AAAA;AAAA,SAAA;AAAA,QA/EI;AAAA;AAgFP;AAAA,GACF;AAEJ","file":"chunk-IANYMDKH.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { SegmentGroup as Ark } from \"@ark-ui/react/segment-group\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { useDirectionCheck } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\n\n/**\n * SegmentGroup — a segmented single-choice control on Ark UI's SegmentGroup\n * machine (the radio-group model under the hood). It renders a row (or column)\n * of mutually exclusive segments with a sliding pill that animates to the\n * selected item. Use it as a compact, always-visible alternative to a `Select`\n * when the option set is small (2–5 items): view toggles, filters, billing\n * cadence, and the like.\n *\n * - Value is a single `string | null`; `onChange` hands it to you directly,\n * matching the kit's value-based `FormControlProps` contract.\n * - `data` accepts bare strings (`value === label`) or\n * `{ value, label?, disabled?, color?, payload? }` objects, mixed freely.\n * The component is generic over `data` (a `const` type parameter), so\n * `value` / `onChange` narrow to the literal value union and an item's\n * `payload` flows—typed—into `renderItem` (the same contract as `Select`).\n * - Label / description / error / required come from the built-in `Field`\n * wrapper, so a `SegmentGroup` is accessible and complete on its own.\n * - `name` renders a hidden radio input per item, so the selected value rides\n * a native `<form>` submission.\n *\n * `variant` mirrors the `Button` family (`filled` / `light` / `outline` /\n * `subtle` / `default`): the tray, the sliding pill, and the checked label all\n * adopt the variant's treatment off the shared `--c-*` slots. Palette rides on\n * `data-color`, so every kit color tints for free, `default` included — its pill\n * falls back to solid black/white with no color set, because `:root` defines\n * `--c-solid`/`--c-on-solid` as black/white (white/brand-950 under dark). A\n * per-item `color` overrides the group palette for whichever segment is\n * selected: it re-stamps `data-color` on that item and on the pill, so both\n * the fill and the checked label resolve from the same block.\n *\n * The moving pill is the Ark `Indicator`: Ark positions it absolutely via the\n * CSS vars `--left` / `--top` / `--width` / `--height` (the selected segment's\n * measured rect), so it sits *behind* the labels (`z-0`). Ark only re-measures\n * that rect on mount and on value change — not when `orientation` flips — so we\n * remount the root with `key={orientation}` to force a fresh measure on the new\n * axis. The value is held in `useUncontrolled` so the selection survives that\n * remount.\n */\n\n/**\n * Per-segment label: size sets the padding / text, `variant` sets the *checked*\n * text color so it reads against that variant's pill. The unchecked color is a\n * neutral gray applied at the call site.\n *\n * The checked label must come from the same source as the pill under it.\n * `default` and `filled` both paint `bg-(--c-solid)`, so both take\n * `--c-on-solid` — which resolves per-item, since each `ItemText` carries its\n * own `data-color`. Pairing a hard-coded neutral foreground with a `--c-solid`\n * fill is what broke `default` at any group `color` (#140): the pill moved with\n * the palette and the label stayed put, reaching 3.27:1 on brand. There is\n * deliberately no hover shift on the checked label — `Button`'s `filled` moves\n * only the background and keeps `--c-on-solid`, and no `--c-on-solid-hover`\n * slot exists in `colors.css`.\n */\nconst segItem = cva(\n [\n \"font-medium\",\n \"cursor-pointer rounded-input text-center whitespace-nowrap select-none\",\n TEXT_COLOR_CLASSES.secondary,\n // Only unchecked segments get the hover lift, as in Tabs. An\n // unscoped `hover:` ties on specificity with the checked foreground and\n // won on source order in dark theme, washing the checked label to\n // near-white over a colored pill.\n \"not-data-[state=checked]:hover:text-brand-950 dark:not-data-[state=checked]:hover:text-white\",\n \"transition-colors\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n \"group-data-invalid:text-red-900 dark:group-data-invalid:text-red-500\",\n ],\n {\n variants: {\n variant: {\n filled: \"data-[state=checked]:text-(--c-on-solid)\",\n light: \"data-[state=checked]:text-(--c-text)\",\n outline: \"data-[state=checked]:text-(--c-text)\",\n subtle: \"data-[state=checked]:text-(--c-text)\",\n default: \"data-[state=checked]:text-(--c-on-solid)\",\n },\n size: {\n // No vertical padding of its own — the tray's `min-h` (below) sets the\n // box height and this item stretches to fill it (the tray's default\n // `align-items: stretch` propagates all the way down), so the label\n // just needs to center itself inside that taller box. This matches an\n // `Input` / `NumberInput`'s exact box height at the same size.\n xs: \"flex items-center justify-center px-1 text-xs\",\n sm: \"flex items-center justify-center px-1.5 text-sm\",\n md: \"flex items-center justify-center px-2 text-md\",\n lg: \"flex items-center justify-center px-3 text-lg\",\n xl: \"flex items-center justify-center px-4 text-xl\",\n },\n // Fill the (grown) segment so the label centers across its whole share.\n grow: { true: \"w-full\" },\n },\n defaultVariants: { variant: \"default\", size: \"md\" },\n },\n)\n\n/**\n * Per-segment wrapper. Beyond positioning the label above the pill (`z-1`), it\n * draws a hairline separator in the gap to its leading edge (a `::before`) so\n * inactive neighbours read as divided. That rule fades out next to the active\n * pill — on the checked segment and the one right after it — and is suppressed\n * before the first segment (the indicator is child 1, so the first segment is\n * `:nth-child(2)`). It flips from a vertical rule to a horizontal one when the\n * group is laid out vertically.\n */\nconst segItemWrap = cva(\n [\n \"relative z-1 inline-flex\",\n \"before:absolute before:rounded-full before:bg-brand-900/30 dark:before:bg-white/35\",\n \"group-data-invalid:before:bg-red-500/30\",\n \"before:transition-opacity before:duration-200\",\n // Horizontal: a vertical rule centered on the leading edge, sitting in the gap. Logical\n // (`start`, `-ms-[0.5px]` to center the 1px rule), so under `dir=\"rtl\"` the rule still lands\n // between a segment and the one before it instead of on the far side.\n \"before:top-1/2 before:start-0 before:-ms-[0.5px] before:h-1/2 before:w-px before:-translate-y-1/2\",\n // Vertical: a horizontal rule centered on the top edge instead (`start-1/4` + `w-1/2` is\n // centered in either direction).\n \"in-data-[orientation=vertical]:before:top-0 in-data-[orientation=vertical]:before:start-1/4 in-data-[orientation=vertical]:before:ms-0 in-data-[orientation=vertical]:before:h-px in-data-[orientation=vertical]:before:w-1/2\",\n // No separator before the first segment, or flanking the active pill.\n \"nth-2:before:hidden\",\n \"data-[state=checked]:before:opacity-0 data-[state=checked]:[&+*]:before:opacity-0\",\n ],\n {\n variants: {\n // An even share of the tray per segment, like a tab bar.\n grow: { true: \"flex-1\" },\n },\n },\n)\n\n/**\n * The sliding pill, mirroring each `Button` surface. Its slide + color transition\n * is driven by Ark (see the `--transition-*` overrides on the element); `default`\n * follows `--c-solid` like every other variant, which falls back to solid\n * black/white with no `data-color` set. Filled/soft-fill pills (`filled`, `light`,\n * `default`) use a tighter `rounded-xxs` than the tray's own `rounded-input`, for a\n * nested-corner look inside the tray's padding; bordered/transparent pills\n * (`outline`, `subtle`) keep `rounded-input`.\n */\nconst segIndicator = cva(\n [\n \"z-0\",\n // The slide's duration, read by the inline `transition-duration` (see the\n // pill below); reduced motion zeroes it, so the pill jumps instead.\n \"[--indicator-duration:var(--duration-normal)] motion-reduce:[--indicator-duration:0s]\",\n ],\n {\n variants: {\n variant: {\n filled: \"bg-(--c-solid) rounded-xxs\",\n light: \"bg-(--c-soft) border border-(--c-soft-hover) rounded-xxs\",\n outline: \"bg-transparent border border-(--c-solid) rounded-input\",\n subtle: \"bg-(--c-soft-hover) rounded-input\",\n default: \"bg-(--c-solid) rounded-xxs\",\n },\n },\n defaultVariants: { variant: \"default\" },\n },\n)\n\n/**\n * The tray. Mirrors the `Button` variants: `filled` is a borderless neutral fill\n * so the colored pill pops (the kit's quiet `bg-black/3 dark:bg-white/4`; light\n * mode darkens because a bare `bg-white/4` vanishes on a near-white page), `light` / `default` frame the pill with the same\n * translucent surface as `Input`'s own `default` shell (`bg-white/4` + the\n * hairline `border-brand-900/20 dark:border-white/15`) rather than an opaque\n * gray step, so the tray reads correctly on any host background, `subtle` /\n * `outline` are chromeless.\n */\nconst segTray = cva(\n [\n \"relative inline-flex rounded-input border p-0.5 transition-colors max-w-fit group\",\n \"data-[orientation=vertical]:flex-col\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-60\",\n // Focus halo + accent border, driven by the active palette's `--c-solid`. Keyed\n // off Zag's `data-focus-visible` (set only when the focus came from the keyboard,\n // never a mouse click) via `:has()`, so the ring stays off when you click a segment.\n //\n // Deliberately NOT `focusStyles`. This is the *shell* idiom, not the ring\n // idiom: an accent border plus a soft `/15` halo on a wrapper whose focus\n // lives on a descendant, with a red invalid twin on the identical selector.\n // That is `input.tsx`'s `shellChrome`, not `Button`'s ring — folding it into\n // `focusStyles` would make that helper grow an alpha, a border half and a\n // concept of invalid, for one call site. The two shells are worth sharing\n // with each other instead; see the follow-up issue.\n \"has-data-focus-visible:border-(--c-solid) has-data-focus-visible:ring-2 has-data-focus-visible:ring-(--c-solid)/15\",\n // Invalid wins over the palette: red border + red halo.\n \"data-invalid:border-red-500 data-invalid:has-data-focus-visible:border-red-500 data-invalid:has-data-focus-visible:ring-red-500/15\",\n // Disabled affordances on the shell.\n ],\n {\n variants: {\n variant: {\n filled: [\"bg-black/3 dark:bg-white/4\", \"border-transparent\"],\n light: [\"bg-white/4\", \"border-brand-900/20 dark:border-white/15\"],\n outline: [\"bg-transparent border-transparent\"],\n subtle: [\"bg-transparent border-transparent\"],\n default: [\"bg-white/4\", \"border-brand-900/20 dark:border-white/15\"],\n },\n size: {\n // The exact `min-h` `inputShell` (input.tsx) uses at the same size —\n // so a `SegmentGroup` sits flush with an `Input` / `NumberInput` of\n // the same size in a row (see `TimeRow`, which composes both).\n xs: \"gap-0 min-h-7\",\n sm: \"gap-0 min-h-8\",\n md: \"gap-0 min-h-9\",\n lg: \"gap-0 min-h-10\",\n xl: \"gap-0 min-h-12\",\n },\n // Span the container instead of hugging the labels.\n grow: { true: \"flex w-full max-w-none\" },\n },\n defaultVariants: { variant: \"default\" },\n },\n)\n\nexport type SegmentGroupSize = NonNullable<VariantProps<typeof segItem>[\"size\"]>\nexport type SegmentGroupVariant = VariantProps<typeof segTray>[\"variant\"]\n\n/**\n * A single segment: a bare value-as-label string, or a labelled object. Objects\n * may carry a `payload` of arbitrary data (the machine ignores it; it flows\n * through to `renderItem`, typed off the `data` shape — the same contract as\n * `Select`'s `SelectItem`).\n */\nexport type SegmentGroupItem<P = unknown> =\n | string\n | {\n value: string\n label?: ReactNode\n disabled?: boolean\n /** Overrides the group palette for the pill + label when this item is selected. */\n color?: Color\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered segment. Defaults to `` `item-${value}` ``. */\n testId?: string\n }\n\n/** The `data` array the component is generic over. */\nexport type SegmentGroupData<P = unknown> = ReadonlyArray<SegmentGroupItem<P>>\n\n/**\n * Extract the value-string union from a `SegmentGroupData` shape — bare strings\n * and item `.value`s both contribute. A `const` type parameter narrows it to the\n * literal union, so `value` / `onChange` are typed off the data (like `Select`).\n */\nexport type SegmentGroupValue<Data extends SegmentGroupData> = ItemValue<Data[number]>\ntype ItemValue<E> = E extends string ? E : E extends { value: infer V extends string } ? V : never\n\n/**\n * Extract the `payload` type carried by a `SegmentGroupData` shape, read\n * structurally off the data's `payload` property. Bare strings contribute\n * `never`; a homogeneous payload resolves precisely, a mixed one to the union.\n */\nexport type SegmentGroupPayload<Data extends SegmentGroupData> = PayloadOf<Data[number]>\ntype PayloadOf<T> = T extends string ? never : T extends { payload?: infer P } ? P : never\n\n/**\n * The segment handed to `renderItem`: `value` narrowed to the data's value union\n * and `payload` to the data's payload type, so a `const`-typed `data` yields\n * literal values and a precise payload in the callback.\n */\nexport type RenderableSegment<Data extends SegmentGroupData> = {\n value: SegmentGroupValue<Data>\n label: ReactNode\n disabled: boolean\n color: Color | undefined\n payload: SegmentGroupPayload<Data> | undefined\n}\n\n/** Live segment state passed alongside the item to `renderItem`. */\nexport type SegmentRenderState = {\n checked: boolean\n disabled: boolean\n}\n\n/**\n * Render a segment's label content yourself. Receives the (value-narrowed) item —\n * including its typed `payload` — and its live `{ checked, disabled }` state. The\n * segment keeps its sizing, pill, and selection wiring; you fill the label. In an\n * RSC tree the function must live in a `\"use client\"` module so the boundary\n * serializes it as a client reference.\n */\nexport type RenderSegment<Data extends SegmentGroupData> = (\n item: RenderableSegment<Data>,\n state: SegmentRenderState,\n) => ReactNode\n\ntype SegmentGroupClassNames = {\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 indicator?: string\n item?: string\n itemText?: string\n}\n\nexport type SegmentGroupProps<Data extends SegmentGroupData = SegmentGroupData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Segments: bare strings (`value === label`) or `{ value, label?, disabled?, color?, payload? }`. */\n data: Data\n /** Controlled value. `null` clears the selection. */\n value?: SegmentGroupValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: SegmentGroupValue<Data> | null\n /** Fires with the selected value. */\n onChange?: (value: SegmentGroupValue<Data>) => void\n /** Render each segment's label content yourself, with its typed `payload`. */\n renderItem?: RenderSegment<Data>\n /** Lay the segments 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 interaction. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n /** `xs`–`xl` match the exact box height of an `Input` / `NumberInput` at\n * that size, so a `SegmentGroup` composes flush inline next to one (see\n * `TimeInput`'s AM/PM toggle). */\n size?: SegmentGroupSize\n variant?: SegmentGroupVariant\n color?: Color\n /** Span the container and give every segment an even share of it, like a\n * tab bar. Without it the group hugs its labels. */\n grow?: boolean\n /** Wires the hidden radio inputs into native form submission. */\n name?: string\n /** Explicit id for label association. */\n id?: string\n /** Lands on the root for focus-on-error. */\n ref?: Ref<HTMLDivElement>\n /** Forwarded to the root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n className?: string\n classNames?: SegmentGroupClassNames\n }\n\n/** A fully resolved segment — every field present (`label` falls back to `value`). */\ntype NormalizedItem = {\n value: string\n label: ReactNode\n disabled: boolean\n color: Color | undefined\n payload: unknown\n testId: string\n}\n\n/** Normalize a bare string / object into the resolved `NormalizedItem` form. */\nconst normalizeItem = (item: SegmentGroupItem): NormalizedItem =>\n typeof item === \"string\"\n ? {\n value: item,\n label: item,\n disabled: false,\n color: undefined,\n payload: undefined,\n testId: `item-${item}`,\n }\n : {\n value: item.value,\n label: item.label ?? item.value,\n disabled: item.disabled ?? false,\n color: item.color,\n payload: item.payload,\n testId: item.testId ?? `item-${item.value}`,\n }\n\n/**\n * The real `role=\"radiogroup\"` root (and, through it, each item's hidden\n * radio input), split out so it reads the `Field` context from *inside* the\n * wrapping `FieldShell` — `SegmentGroup` itself renders that shell, so\n * calling `useFieldContext()` at its own top level would run too early.\n * Takes plain `string` values rather than the outer component's `Data`-typed\n * union: it only forwards them, so no generic type parameter is needed here.\n */\nconst SegmentGroupRoot = ({\n value,\n onValueChange,\n disabled,\n readOnly,\n required,\n invalid,\n orientation,\n name,\n id,\n ref,\n onBlur,\n color,\n className,\n testId,\n children,\n}: {\n value: string | null\n onValueChange: (value: string | null) => void\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n invalid: boolean\n orientation: \"horizontal\" | \"vertical\"\n name?: string\n id?: string\n ref?: Ref<HTMLDivElement>\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n color?: Color\n className?: string\n children: ReactNode\n} & WithTestId) => {\n const field = useFieldContext()\n const checkDirection = useDirectionCheck()\n const rootRef = useMergedRefs(ref, checkDirection)\n return (\n <Ark.Root\n value={value}\n onValueChange={(d) => onValueChange(d.value)}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={invalid}\n orientation={orientation}\n name={name}\n id={id}\n ref={rootRef}\n onBlur={onBlur}\n data-color={color}\n {...props({ \"data-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={className}\n >\n {children}\n </Ark.Root>\n )\n}\n\nexport const SegmentGroup = <const Data extends SegmentGroupData = SegmentGroupData>({\n data,\n value,\n defaultValue,\n onChange,\n renderItem,\n orientation = \"horizontal\",\n invalid,\n disabled,\n readOnly,\n required,\n size = \"md\",\n variant = \"default\",\n color,\n grow,\n name,\n id,\n ref,\n onBlur,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: SegmentGroupProps<Data>) => {\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 // Own the value so the pill can read which item is selected (per-item color)\n // and so the `key={orientation}` remount below preserves the selection.\n const [selectedValue, setSelectedValue] = useUncontrolled<SegmentGroupValue<Data> | null>({\n value,\n defaultValue,\n finalValue: null,\n onChange: (v) => v != null && onChange?.(v),\n })\n\n const normalized = (data as SegmentGroupData).map(normalizeItem)\n const selected = normalized.find((item) => item.value === selectedValue)\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 // A radio group: nothing carries the label's `for` id; the root's `aria-labelledby` names it.\n composite\n >\n {/* `key={orientation}` remounts the root on an axis flip so Ark re-measures\n the indicator rect for the new layout (it only measures on mount + value\n change). `useUncontrolled` keeps the selection across that remount. */}\n <SegmentGroupRoot\n key={orientation}\n value={selectedValue}\n // Ark's value is typed by the collection (`string`); the runtime value\n // always originates from `data`, so narrow it back to the caller's union.\n onValueChange={(v) => setSelectedValue(v as SegmentGroupValue<Data> | null)}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={isInvalid}\n orientation={orientation}\n name={name}\n id={id}\n ref={ref}\n onBlur={onBlur}\n color={color}\n testId={testId}\n className={cn(segTray({ variant, size, grow }), className, classNames?.root)}\n >\n {/* The sliding pill. Ark sets `position: absolute` + `--left`/`--top`/\n `--width`/`--height` (the selected segment's rect) inline, so it\n sits behind the labels (`z-0`). It adopts the selected item's `color`\n (falling back to the group `color`), which is the same `data-color`\n that item's own label carries — so the fill and the `--c-on-solid`\n text on top of it always resolve from one block.\n\n We drive the slide ourselves rather than via Ark's gated transition.\n Ark sets `transition-property: none` whenever its `animateIndicator`\n flag is false — including the instant it receives the `transitionend`\n of ANY animated property. With several properties of differing\n end-times (a `left` redirected by an interrupting click vs. a color or\n width that already settled), that early end would null the transition\n and snap the pill mid-slide. Overriding the real `transition-*` props\n (our `style` wins via Ark's `mergeProps`) keeps the transition always\n on, so the flag is irrelevant and interruptions re-target smoothly. The\n first paint stays instant because Ark renders the pill `hidden` until\n its rect is measured, and `display:none` can't transition. The\n duration comes from `--indicator-duration` (set by a class) rather\n than an inline value, so reduced motion can zero it. */}\n <Ark.Indicator\n style={{\n width: \"var(--width)\",\n height: \"var(--height)\",\n transitionProperty: \"left, top, width, height, background-color, border-color\",\n transitionDuration: \"var(--indicator-duration)\",\n transitionTimingFunction: \"var(--ease-emphasized)\",\n }}\n {...props({ \"data-color\": selected?.color ?? color })}\n className={cn(segIndicator({ variant }), classNames?.indicator)}\n />\n {normalized.map((item) => (\n <Ark.Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n data-testid={item.testId}\n className={cn(segItemWrap({ grow }), classNames?.item)}\n >\n <Ark.ItemText\n data-color={item.color}\n className={cn(segItem({ size, variant, grow }), classNames?.itemText)}\n >\n {/* `renderItem` owns the label content (with the item's typed payload);\n the ItemText keeps its sizing, checked color, and pill wiring. */}\n {renderItem ? (\n <Ark.ItemContext>\n {(ctx) =>\n renderItem(item as unknown as RenderableSegment<Data>, {\n checked: ctx.checked,\n disabled: ctx.disabled,\n })\n }\n </Ark.ItemContext>\n ) : (\n item.label\n )}\n </Ark.ItemText>\n <Ark.ItemControl />\n <Ark.ItemHiddenInput />\n </Ark.Item>\n ))}\n </SegmentGroupRoot>\n </FieldShell>\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/drawer/drawer.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAGA,IAAM,sBAAA,GAAyB,cAA+B,KAAK,CAAA;AAEnE,IAAM,iBAAiB,GAAA,CAAI;AAAA,EACzB,8HAAA;AAAA,EACA;AACF,CAAC,CAAA;AA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,CAAC,SAAA,IAAa,CAAC,WAAA,IAAe,0BAAA;AAAA,oBAC9B,0BAAA;AAAA,oBACA,UAAA,EAAY;AAAA,mBACd;AAAA,kBAEC;AAAA;AAAA;AACH;AAAA;AAAA,SACF,EACF;AAAA,OAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,eAAA,EAAiB;AAAA,EACnD,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,QAAA,EAAU,cAAA;AAAA,EACV,UAAA,EAAY,gBAAA;AAAA,EACZ,OAAA,EAAS,aAAA;AAAA,EACT,KAAA,EAAO,WAAA;AAAA,EACP,WAAA,EAAa,iBAAA;AAAA,EACb,YAAA,EAAc,kBAAA;AAAA,EACd,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAC","file":"chunk-MQHD3EJE.js","sourcesContent":["\"use client\"\n\nimport { Drawer as Ark } from \"@ark-ui/react/drawer\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n useContext,\n useRef,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { NestedLayer, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport {\n createDialogParts,\n DIALOG_PADDING,\n type DialogCloseTriggerProps,\n type DialogIconSlot,\n type DialogIcons,\n DialogRootProviders,\n type DialogSectionProps,\n useDialogNameCheck,\n} from \"../overlays/dialog-parts\"\n\n/**\n * Drawer — edge-anchored panel on top of Ark UI's Drawer state machine. Ark\n * owns swipe-to-dismiss, snap points, focus-trap, scroll-lock and the\n * `data-state=\"open|closed\"` attribute; this wrapper adds an RTL-aware\n * `placement` (Ark has none). It is set once, on `Drawer.Root`, which derives\n * Ark's logical `swipeDirection` from it and shares it with the parts through\n * context; the positioner and content write it as `data-placement`. The slide\n * animation and the docked border are pure CSS keyed on `[data-placement]`\n * (see `theme.css`), so `start`/`end` flip automatically under `dir=\"rtl\"`.\n *\n * Mirrors `Modal`'s dual API: high-level `<Drawer open placement size … >` plus\n * low-level parts (`Drawer.Root`, `Drawer.Content`, …). Padding flows through\n * the `--drawer-px` CSS var.\n */\n\nexport type DrawerPlacement = \"start\" | \"end\" | \"top\" | \"bottom\"\n\n/** placement → Ark logical swipe axis (RTL handled by Ark for start/end). */\nconst PLACEMENT_TO_SWIPE = {\n start: \"start\",\n end: \"end\",\n top: \"up\",\n bottom: \"down\",\n} as const\n\n/** The root's placement, so the parts dock themselves without repeating it. */\nconst DrawerPlacementContext = createContext<DrawerPlacement>(\"end\")\n\nconst drawerBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst drawerPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex overflow-clip\",\n {\n variants: {\n placement: {\n start: \"items-stretch justify-start\",\n end: \"items-stretch justify-end\",\n top: \"items-start justify-stretch\",\n bottom: \"items-end justify-stretch\",\n },\n },\n defaultVariants: { placement: \"end\" },\n },\n)\n\nexport type DrawerPositionerProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Positioner>> &\n WithTestId\n\n/** Docks itself to the root's `placement`. Publishes itself as the portal\n * target for any overlay opened inside the drawer, so a Menu/Select/DatePicker\n * in a drawer body stays above the panel instead of behind it. See\n * `lib/overlay-container.tsx`. */\nconst DrawerPositioner = ({\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: DrawerPositionerProps) => {\n const placement = useContext(DrawerPlacementContext)\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner\n ref={positioner}\n className={cn(drawerPositioner({ placement }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n >\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nconst drawerContent = cva(\n [\n \"relative flex flex-col overflow-hidden\",\n \"bg-brand-50 text-brand-950 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-white\",\n \"focus:outline-none\",\n // border on the docked edge only — keyed by data-placement in theme.css\n \"data-[placement=start]:border-e data-[placement=end]:border-s\",\n \"data-[placement=top]:border-b data-[placement=bottom]:border-t\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out\",\n ],\n {\n variants: {\n // Internal: Content reads it from the root's context.\n placement: {\n start: \"h-full max-w-[90vw]\",\n end: \"h-full max-w-[90vw]\",\n top: \"w-full max-h-[90dvh]\",\n bottom: \"w-full max-h-[90dvh]\",\n },\n // Width for inline placements, height for block ones: see compoundVariants.\n size: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n // Only the two corners away from the docked edge round: see compoundVariants.\n radius: { none: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n },\n compoundVariants: [\n { placement: [\"start\", \"end\"], size: \"xs\", class: \"w-[18rem]\" },\n { placement: [\"start\", \"end\"], size: \"sm\", class: \"w-[22rem]\" },\n { placement: [\"start\", \"end\"], size: \"md\", class: \"w-[28rem]\" },\n { placement: [\"start\", \"end\"], size: \"lg\", class: \"w-[34rem]\" },\n { placement: [\"start\", \"end\"], size: \"xl\", class: \"w-[42rem]\" },\n { placement: [\"top\", \"bottom\"], size: \"xs\", class: \"h-[30dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"sm\", class: \"h-[40dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"md\", class: \"h-[55dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"lg\", class: \"h-[70dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"xl\", class: \"h-[85dvh]\" },\n // Logical corners, so `start`/`end` mirror under RTL with the panel.\n { placement: \"start\", radius: \"sm\", class: \"rounded-e-sm\" },\n { placement: \"start\", radius: \"md\", class: \"rounded-e-md\" },\n { placement: \"start\", radius: \"lg\", class: \"rounded-e-xl\" },\n { placement: \"start\", radius: \"xl\", class: \"rounded-e-2xl\" },\n { placement: \"end\", radius: \"sm\", class: \"rounded-s-sm\" },\n { placement: \"end\", radius: \"md\", class: \"rounded-s-md\" },\n { placement: \"end\", radius: \"lg\", class: \"rounded-s-xl\" },\n { placement: \"end\", radius: \"xl\", class: \"rounded-s-2xl\" },\n { placement: \"top\", radius: \"sm\", class: \"rounded-b-sm\" },\n { placement: \"top\", radius: \"md\", class: \"rounded-b-md\" },\n { placement: \"top\", radius: \"lg\", class: \"rounded-b-xl\" },\n { placement: \"top\", radius: \"xl\", class: \"rounded-b-2xl\" },\n { placement: \"bottom\", radius: \"sm\", class: \"rounded-t-sm\" },\n { placement: \"bottom\", radius: \"md\", class: \"rounded-t-md\" },\n { placement: \"bottom\", radius: \"lg\", class: \"rounded-t-xl\" },\n { placement: \"bottom\", radius: \"xl\", class: \"rounded-t-2xl\" },\n ],\n defaultVariants: { placement: \"end\", size: \"md\", radius: \"none\" },\n },\n)\n\n// ---------------------------------------------------------------------------\n// Low-level parts\n// ---------------------------------------------------------------------------\n\nexport type DrawerIconSlot = DialogIconSlot\nexport type DrawerIcons = DialogIcons\n\nexport type DrawerRootProps = ComponentPropsWithoutRef<typeof Ark.Root> & {\n /** RTL-aware docking edge, shared with `Drawer.Positioner` and `Drawer.Content`. Also\n * sets Ark's `swipeDirection`, unless you pass one. @default \"end\" */\n placement?: DrawerPlacement\n /** Replaces the default icons: `close`. `Drawer.CloseTrigger`'s `children` win over it. */\n icons?: DrawerIcons\n}\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * drawer is open, an outside click closes the picker only, not the drawer\n * under it. It is also a layer of its own while open, so a hotkey on the page\n * (or in an enclosing overlay) yields to it. See `lib/overlay-layer.tsx`. */\nconst DrawerRoot = ({\n placement = \"end\",\n swipeDirection,\n onPointerDownOutside,\n icons,\n children,\n ...rest\n}: DrawerRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root\n swipeDirection={swipeDirection ?? PLACEMENT_TO_SWIPE[placement]}\n onPointerDownOutside={guard.onPointerDownOutside}\n {...rest}\n >\n {/* A layer itself, registered with whatever it opened from (the page,\n or an enclosing overlay), so what's under it knows it's covered. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} modal />}</Ark.Context>\n <DrawerPlacementContext value={placement}>\n <DialogRootProviders icons={icons} layers={guard.layers}>\n {children}\n </DialogRootProviders>\n </DrawerPlacementContext>\n </Ark.Root>\n )\n}\nconst DrawerTrigger = Ark.Trigger\nconst DrawerContext = Ark.Context\n\nexport type DrawerBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nconst DrawerBackdrop = ({ className, testId, ...rest }: DrawerBackdropProps) => (\n <Ark.Backdrop\n className={cn(drawerBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nconst DrawerTitle = ({ className, testId, ...rest }: DrawerTitleProps) => (\n <Ark.Title\n className={cn(\"text-xl font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nconst DrawerDescription = ({ className, testId, ...rest }: DrawerDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm\", TEXT_COLOR_CLASSES.muted, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerSize = NonNullable<VariantProps<typeof drawerContent>[\"size\"]>\nexport type DrawerRadius = NonNullable<VariantProps<typeof drawerContent>[\"radius\"]>\n\nexport type DrawerContentProps = ComponentPropsWithoutRef<typeof Ark.Content> &\n WithTestId & {\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n }\n\n/** The panel. It sizes and rounds itself for the root's `placement`, and writes\n * it as `data-placement`, which the slide animation and the docked border key on. */\nconst DrawerContent = ({ className, size, radius, testId, ...rest }: DrawerContentProps) => {\n const placement = useContext(DrawerPlacementContext)\n const nameCheck = useDialogNameCheck(\"Drawer\")\n return (\n <Ark.Content\n ref={nameCheck}\n className={cn(drawerContent({ placement, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n />\n )\n}\n\nexport type DrawerCloseTriggerProps = DialogCloseTriggerProps\nexport type DrawerHeaderProps = DialogSectionProps\nexport type DrawerBodyProps = DialogSectionProps\nexport type DrawerFooterProps = DialogSectionProps\n\nconst {\n CloseTrigger: DrawerCloseTrigger,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n} = createDialogParts(\"drawer\", Ark.CloseTrigger)\n\nexport type DrawerGrabberProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Grabber>> &\n WithTestId\n\nconst DrawerGrabber = ({ className, testId, asChild: _asChild, ...rest }: DrawerGrabberProps) => (\n <Ark.Grabber\n className={cn(\n \"flex shrink-0 cursor-grab touch-none items-center justify-center py-2\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <Ark.GrabberIndicator className=\"h-1.5 w-20 rounded-full bg-brand-900/10 dark:bg-white/16\" />\n </Ark.Grabber>\n)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Drawer\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type DrawerClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"grabber\"\n | \"closeButton\",\n string\n >\n>\n\nexport type DrawerProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"swipeDirection\" | \"role\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, backdrop click, swipe, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** RTL-aware docking edge. @default \"end\" */\n placement?: DrawerPlacement\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n /** Header title; also the drawer's accessible name. */\n title?: ReactNode\n description?: ReactNode\n /** Accessible name for a drawer without a `title` (a navigation panel, say). */\n \"aria-label\"?: string\n /** Id of an element inside the drawer that names it, when there is no `title`. */\n \"aria-labelledby\"?: string\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /** Show the drag grabber handle. @default false */\n withGrabber?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--drawer-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n /** Close on a click outside the drawer. @default true, false for an `alertdialog` */\n closeOnInteractOutside?: boolean\n /** Use `alertdialog` semantics (confirm flows). @default \"dialog\" */\n role?: \"dialog\" | \"alertdialog\"\n /** Fires after the exit animation completes — the manager unmounts on this. */\n onExitComplete?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: DrawerClassNames\n /** Overrides the default close button's accessible name (`closeTriggerLabel`, default\n * `\"Close\"`). The compound `DrawerCloseTrigger` part takes a plain `aria-label` instead. */\n translations?: DrawerTranslations\n /** Replaces the default icons: `close`, the header's close button. */\n icons?: DrawerIcons\n }\n\n/** The ready-made drawer's wording — `closeTriggerLabel` follows Ark's naming for the\n * same control. */\nexport type DrawerTranslations = { closeTriggerLabel?: string }\n\nconst DrawerComponent = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n placement = \"end\",\n size,\n radius,\n title,\n description,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n withCloseButton = true,\n withGrabber = false,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n role,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n translations,\n icons,\n ...rest\n}: DrawerProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n\n return (\n <DrawerRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n placement={placement}\n closeOnEscape={closeOnEscape}\n // Spelled out to match Modal, whose Ark dialog derives this default from\n // `modal` (so the overlays manager's `withBackdrop={false}` would stop\n // outside clicks there). Ark's drawer defaults it to `true` for every role\n // instead, so here the one behaviour this changes is the `alertdialog`:\n // it stays sticky, as on Modal, unless the caller opts in explicitly.\n closeOnInteractOutside={closeOnInteractOutside ?? role !== \"alertdialog\"}\n role={role}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n icons={icons}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <DrawerBackdrop className={classNames?.backdrop} />}\n <DrawerPositioner className={classNames?.positioner}>\n <DrawerContent\n size={size}\n radius={radius}\n style={{ [\"--drawer-px\" as string]: DIALOG_PADDING[padding] }}\n className={cn(className, classNames?.content)}\n testId={testId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n {withGrabber && <DrawerGrabber className={classNames?.grabber} />}\n {hasHeader && (\n <DrawerHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && (\n <DrawerTitle className={classNames?.title}>{title}</DrawerTitle>\n )}\n {description != null && (\n <DrawerDescription className={classNames?.description}>\n {description}\n </DrawerDescription>\n )}\n </div>\n {withCloseButton && (\n <DrawerCloseTrigger\n aria-label={translations?.closeTriggerLabel}\n className={classNames?.closeButton}\n />\n )}\n </DrawerHeader>\n )}\n <DrawerBody\n className={cn(\n !hasHeader && !withGrabber && \"pt-(--drawer-px,1.25rem)\",\n \"pb-(--drawer-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </DrawerBody>\n </DrawerContent>\n </DrawerPositioner>\n </Portal>\n </DrawerRoot>\n )\n}\n\nexport const Drawer = Object.assign(DrawerComponent, {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Context: DrawerContext,\n Backdrop: DrawerBackdrop,\n Positioner: DrawerPositioner,\n Content: DrawerContent,\n Title: DrawerTitle,\n Description: DrawerDescription,\n CloseTrigger: DrawerCloseTrigger,\n Grabber: DrawerGrabber,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n})\n"]}