@42-central/ui-react 0.20.0 → 0.20.2

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 (253) hide show
  1. package/dist/{chunk-P276SCCV.js → chunk-2BNIHOMT.js} +6 -6
  2. package/dist/{chunk-P276SCCV.js.map → chunk-2BNIHOMT.js.map} +1 -1
  3. package/dist/{chunk-PAFS7TED.js → chunk-2HIX6DKN.js} +3 -3
  4. package/dist/{chunk-PAFS7TED.js.map → chunk-2HIX6DKN.js.map} +1 -1
  5. package/dist/{chunk-Z5WYYDG2.js → chunk-2MXWEIMD.js} +7 -4
  6. package/dist/chunk-2MXWEIMD.js.map +1 -0
  7. package/dist/{chunk-VVM7JMZS.js → chunk-37VQGKD6.js} +8 -8
  8. package/dist/{chunk-VVM7JMZS.js.map → chunk-37VQGKD6.js.map} +1 -1
  9. package/dist/{chunk-7R4CDHBK.js → chunk-45QRQKRC.js} +4 -4
  10. package/dist/{chunk-7R4CDHBK.js.map → chunk-45QRQKRC.js.map} +1 -1
  11. package/dist/{chunk-FZNPJAGJ.js → chunk-45TG7H5Q.js} +5 -5
  12. package/dist/{chunk-FZNPJAGJ.js.map → chunk-45TG7H5Q.js.map} +1 -1
  13. package/dist/{chunk-MKJKCBRE.js → chunk-47LEAR6G.js} +6 -6
  14. package/dist/{chunk-MKJKCBRE.js.map → chunk-47LEAR6G.js.map} +1 -1
  15. package/dist/chunk-4ASNIDV7.js +17 -0
  16. package/dist/chunk-4ASNIDV7.js.map +1 -0
  17. package/dist/{chunk-WFHY6NRQ.js → chunk-5CNVVA7I.js} +11 -11
  18. package/dist/{chunk-WFHY6NRQ.js.map → chunk-5CNVVA7I.js.map} +1 -1
  19. package/dist/{chunk-2TM7UVM2.js → chunk-6M6YZ3PQ.js} +4 -4
  20. package/dist/{chunk-2TM7UVM2.js.map → chunk-6M6YZ3PQ.js.map} +1 -1
  21. package/dist/{chunk-4BGU2UQB.js → chunk-6VYGK3Q3.js} +6 -6
  22. package/dist/{chunk-4BGU2UQB.js.map → chunk-6VYGK3Q3.js.map} +1 -1
  23. package/dist/{chunk-ZFUTGBJC.js → chunk-6YNLRQ25.js} +3 -3
  24. package/dist/{chunk-ZFUTGBJC.js.map → chunk-6YNLRQ25.js.map} +1 -1
  25. package/dist/{chunk-6OV6EJQ2.js → chunk-7AQ4MN4M.js} +6 -6
  26. package/dist/{chunk-6OV6EJQ2.js.map → chunk-7AQ4MN4M.js.map} +1 -1
  27. package/dist/{chunk-5337N3FE.js → chunk-7BOSX65U.js} +3 -3
  28. package/dist/{chunk-5337N3FE.js.map → chunk-7BOSX65U.js.map} +1 -1
  29. package/dist/{chunk-THLMW5IU.js → chunk-7CNDZZZ6.js} +4 -4
  30. package/dist/{chunk-THLMW5IU.js.map → chunk-7CNDZZZ6.js.map} +1 -1
  31. package/dist/{chunk-LJ3GHC4V.js → chunk-BE2LWUHY.js} +5 -5
  32. package/dist/{chunk-LJ3GHC4V.js.map → chunk-BE2LWUHY.js.map} +1 -1
  33. package/dist/{chunk-2KN3MI7I.js → chunk-C4NFRSOR.js} +4 -4
  34. package/dist/{chunk-2KN3MI7I.js.map → chunk-C4NFRSOR.js.map} +1 -1
  35. package/dist/{chunk-3REFDGOM.js → chunk-C6NVU4F7.js} +3 -3
  36. package/dist/{chunk-3REFDGOM.js.map → chunk-C6NVU4F7.js.map} +1 -1
  37. package/dist/{chunk-LSIX2PVU.js → chunk-C74TV64U.js} +7 -7
  38. package/dist/{chunk-LSIX2PVU.js.map → chunk-C74TV64U.js.map} +1 -1
  39. package/dist/{chunk-HVOEVB4E.js → chunk-D2QIPQ74.js} +3 -3
  40. package/dist/{chunk-HVOEVB4E.js.map → chunk-D2QIPQ74.js.map} +1 -1
  41. package/dist/{chunk-4EU6FGGB.js → chunk-DA4QII2N.js} +4 -4
  42. package/dist/{chunk-4EU6FGGB.js.map → chunk-DA4QII2N.js.map} +1 -1
  43. package/dist/{chunk-LZWA7V62.js → chunk-DJLNGWMM.js} +5 -5
  44. package/dist/{chunk-LZWA7V62.js.map → chunk-DJLNGWMM.js.map} +1 -1
  45. package/dist/{chunk-HEQ2H6VO.js → chunk-DT6LKNZF.js} +4 -4
  46. package/dist/{chunk-HEQ2H6VO.js.map → chunk-DT6LKNZF.js.map} +1 -1
  47. package/dist/{chunk-BUFALAEK.js → chunk-E5H3YWZV.js} +4 -4
  48. package/dist/{chunk-BUFALAEK.js.map → chunk-E5H3YWZV.js.map} +1 -1
  49. package/dist/{chunk-H7INUXZD.js → chunk-F342ZT7O.js} +4 -4
  50. package/dist/{chunk-H7INUXZD.js.map → chunk-F342ZT7O.js.map} +1 -1
  51. package/dist/{chunk-KOT4PWGE.js → chunk-FDCPMUJK.js} +6 -6
  52. package/dist/{chunk-KOT4PWGE.js.map → chunk-FDCPMUJK.js.map} +1 -1
  53. package/dist/{chunk-VALQ2XVA.js → chunk-H3PYSAWN.js} +3 -3
  54. package/dist/{chunk-VALQ2XVA.js.map → chunk-H3PYSAWN.js.map} +1 -1
  55. package/dist/{chunk-WR444JRU.js → chunk-HQPU73WV.js} +7 -7
  56. package/dist/{chunk-WR444JRU.js.map → chunk-HQPU73WV.js.map} +1 -1
  57. package/dist/{chunk-Q5ZO2O25.js → chunk-HRNWWL3Y.js} +6 -6
  58. package/dist/{chunk-Q5ZO2O25.js.map → chunk-HRNWWL3Y.js.map} +1 -1
  59. package/dist/{chunk-HBFN5W7Q.js → chunk-JVG5ISPT.js} +4 -4
  60. package/dist/{chunk-HBFN5W7Q.js.map → chunk-JVG5ISPT.js.map} +1 -1
  61. package/dist/{chunk-JL4QMM46.js → chunk-LFQDB5OD.js} +5 -5
  62. package/dist/{chunk-JL4QMM46.js.map → chunk-LFQDB5OD.js.map} +1 -1
  63. package/dist/{chunk-U2PNMMDB.js → chunk-LKFHUDEW.js} +7 -7
  64. package/dist/{chunk-U2PNMMDB.js.map → chunk-LKFHUDEW.js.map} +1 -1
  65. package/dist/{chunk-2SVX3MQQ.js → chunk-MW42XVPD.js} +3 -3
  66. package/dist/{chunk-2SVX3MQQ.js.map → chunk-MW42XVPD.js.map} +1 -1
  67. package/dist/{chunk-S4TRYMCU.js → chunk-MXAACRWE.js} +6 -6
  68. package/dist/{chunk-S4TRYMCU.js.map → chunk-MXAACRWE.js.map} +1 -1
  69. package/dist/{chunk-ZN3WYGIQ.js → chunk-N66NC6QK.js} +121 -25
  70. package/dist/chunk-N66NC6QK.js.map +1 -0
  71. package/dist/{chunk-DUPE2CRU.js → chunk-NKOTA5TM.js} +3 -3
  72. package/dist/{chunk-DUPE2CRU.js.map → chunk-NKOTA5TM.js.map} +1 -1
  73. package/dist/{chunk-RGLNH7A5.js → chunk-NLOBBJAA.js} +3 -3
  74. package/dist/{chunk-RGLNH7A5.js.map → chunk-NLOBBJAA.js.map} +1 -1
  75. package/dist/{chunk-FXDLS23K.js → chunk-NS6RGPWR.js} +3 -3
  76. package/dist/{chunk-FXDLS23K.js.map → chunk-NS6RGPWR.js.map} +1 -1
  77. package/dist/{chunk-ZWOZL4XX.js → chunk-O5W3QWJ6.js} +5 -5
  78. package/dist/{chunk-ZWOZL4XX.js.map → chunk-O5W3QWJ6.js.map} +1 -1
  79. package/dist/{chunk-PD4FX34E.js → chunk-O7LS6OZR.js} +4 -4
  80. package/dist/{chunk-PD4FX34E.js.map → chunk-O7LS6OZR.js.map} +1 -1
  81. package/dist/{chunk-K6BHDFX3.js → chunk-QKSLDQM2.js} +3 -3
  82. package/dist/{chunk-K6BHDFX3.js.map → chunk-QKSLDQM2.js.map} +1 -1
  83. package/dist/{chunk-CDHIF2NV.js → chunk-QNKD2SQM.js} +8 -8
  84. package/dist/{chunk-CDHIF2NV.js.map → chunk-QNKD2SQM.js.map} +1 -1
  85. package/dist/{chunk-SE3CGQRO.js → chunk-RLOWPCGG.js} +3 -3
  86. package/dist/{chunk-SE3CGQRO.js.map → chunk-RLOWPCGG.js.map} +1 -1
  87. package/dist/{chunk-R57QP43T.js → chunk-SVKN5ZHX.js} +4 -4
  88. package/dist/{chunk-R57QP43T.js.map → chunk-SVKN5ZHX.js.map} +1 -1
  89. package/dist/{chunk-NJ4RO3CT.js → chunk-SWVUXEBT.js} +5 -5
  90. package/dist/{chunk-NJ4RO3CT.js.map → chunk-SWVUXEBT.js.map} +1 -1
  91. package/dist/{chunk-GGT4GJD6.js → chunk-TWNIAF7K.js} +3 -3
  92. package/dist/{chunk-GGT4GJD6.js.map → chunk-TWNIAF7K.js.map} +1 -1
  93. package/dist/{chunk-4TCTMRR5.js → chunk-UAYENYS2.js} +5 -5
  94. package/dist/{chunk-4TCTMRR5.js.map → chunk-UAYENYS2.js.map} +1 -1
  95. package/dist/{chunk-DHTSVJ4G.js → chunk-UCCJUFOG.js} +9 -9
  96. package/dist/{chunk-DHTSVJ4G.js.map → chunk-UCCJUFOG.js.map} +1 -1
  97. package/dist/{chunk-HDRC6ITF.js → chunk-UT3TOV2Q.js} +3 -3
  98. package/dist/{chunk-HDRC6ITF.js.map → chunk-UT3TOV2Q.js.map} +1 -1
  99. package/dist/{chunk-6KER77RS.js → chunk-UVQXRDRO.js} +7 -7
  100. package/dist/{chunk-6KER77RS.js.map → chunk-UVQXRDRO.js.map} +1 -1
  101. package/dist/{chunk-R52P43LZ.js → chunk-UXPINIDN.js} +3 -3
  102. package/dist/{chunk-R52P43LZ.js.map → chunk-UXPINIDN.js.map} +1 -1
  103. package/dist/chunk-V6PY7C6S.js +18 -0
  104. package/dist/chunk-V6PY7C6S.js.map +1 -0
  105. package/dist/{chunk-45DFYIK5.js → chunk-VD6PB3VA.js} +3 -3
  106. package/dist/{chunk-45DFYIK5.js.map → chunk-VD6PB3VA.js.map} +1 -1
  107. package/dist/{chunk-7AWOMWCQ.js → chunk-WXL5RP6P.js} +7 -7
  108. package/dist/{chunk-7AWOMWCQ.js.map → chunk-WXL5RP6P.js.map} +1 -1
  109. package/dist/{chunk-IMP5VHEN.js → chunk-XKDL4QS6.js} +3 -3
  110. package/dist/{chunk-IMP5VHEN.js.map → chunk-XKDL4QS6.js.map} +1 -1
  111. package/dist/{chunk-H26K66EU.js → chunk-Y57NW6G7.js} +3 -3
  112. package/dist/{chunk-H26K66EU.js.map → chunk-Y57NW6G7.js.map} +1 -1
  113. package/dist/{chunk-2OQP7UY4.js → chunk-YZJUPYPO.js} +5 -5
  114. package/dist/{chunk-2OQP7UY4.js.map → chunk-YZJUPYPO.js.map} +1 -1
  115. package/dist/{chunk-JYK6JVR3.js → chunk-Z4MBCKG5.js} +8 -8
  116. package/dist/{chunk-JYK6JVR3.js.map → chunk-Z4MBCKG5.js.map} +1 -1
  117. package/dist/components/accordion/index.js +5 -5
  118. package/dist/components/action-icon/index.js +4 -4
  119. package/dist/components/alert/index.js +6 -6
  120. package/dist/components/ambient-background/index.js +1 -1
  121. package/dist/components/app-shell/index.js +6 -6
  122. package/dist/components/aspect-ratio/index.js +1 -1
  123. package/dist/components/autocomplete/index.js +7 -6
  124. package/dist/components/autocomplete/index.js.map +1 -1
  125. package/dist/components/avatar/index.js +1 -1
  126. package/dist/components/badge/index.js +3 -3
  127. package/dist/components/breadcrumb/index.js +1 -1
  128. package/dist/components/button/index.js +4 -4
  129. package/dist/components/button-group/index.js +2 -2
  130. package/dist/components/button-multi-select/index.js +7 -7
  131. package/dist/components/button-select/index.js +7 -7
  132. package/dist/components/calendar/index.js +6 -6
  133. package/dist/components/camera/index.js +15 -14
  134. package/dist/components/card/card.d.ts.map +1 -1
  135. package/dist/components/card/index.js +2 -2
  136. package/dist/components/carousel/index.js +3 -3
  137. package/dist/components/chart/index.js +1 -1
  138. package/dist/components/checkbox/index.js +6 -6
  139. package/dist/components/choice-card-group/index.js +5 -5
  140. package/dist/components/circular-progress/index.js +1 -1
  141. package/dist/components/clipboard/index.js +6 -6
  142. package/dist/components/code/index.js +2 -2
  143. package/dist/components/code-block/chrome.js +7 -7
  144. package/dist/components/code-block/index.js +8 -8
  145. package/dist/components/code-block/static.js +4 -1
  146. package/dist/components/code-block/static.js.map +1 -1
  147. package/dist/components/collapse/index.js +2 -2
  148. package/dist/components/combobox/index.js +7 -6
  149. package/dist/components/combobox-list/index.js +9 -8
  150. package/dist/components/compare/index.js +2 -2
  151. package/dist/components/container/index.js +1 -1
  152. package/dist/components/data-table/index.js +33 -33
  153. package/dist/components/date-picker/index.js +16 -15
  154. package/dist/components/date-picker/index.js.map +1 -1
  155. package/dist/components/divider/index.js +2 -2
  156. package/dist/components/download-button/index.js +5 -5
  157. package/dist/components/drawer/index.js +6 -6
  158. package/dist/components/field/index.js +2 -2
  159. package/dist/components/figure/index.js +2 -2
  160. package/dist/components/file-item/index.js +8 -8
  161. package/dist/components/file-preview/index.js +6 -6
  162. package/dist/components/file-queue-summary/index.js +2 -2
  163. package/dist/components/file-trigger/index.js +5 -5
  164. package/dist/components/file-upload/index.js +10 -10
  165. package/dist/components/flex/index.js +2 -2
  166. package/dist/components/gallery/index.js +4 -4
  167. package/dist/components/grid/index.js +1 -1
  168. package/dist/components/hover-card/hover-card.d.ts +44 -26
  169. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  170. package/dist/components/hover-card/index.js +36 -54
  171. package/dist/components/hover-card/index.js.map +1 -1
  172. package/dist/components/image/index.js +2 -2
  173. package/dist/components/image-cropper/index.js +7 -7
  174. package/dist/components/indicator/index.js +1 -1
  175. package/dist/components/input/index.js +3 -3
  176. package/dist/components/kbd/index.js +3 -3
  177. package/dist/components/lightbox/index.js +9 -9
  178. package/dist/components/mark/index.js +2 -2
  179. package/dist/components/menu/index.js +5 -5
  180. package/dist/components/modal/index.js +6 -6
  181. package/dist/components/multi-combobox-list/index.js +11 -10
  182. package/dist/components/multi-select/index.js +10 -9
  183. package/dist/components/multi-select/index.js.map +1 -1
  184. package/dist/components/nav-link/index.js +5 -5
  185. package/dist/components/nav-link/tanstack.js +5 -5
  186. package/dist/components/notification/index.js +7 -7
  187. package/dist/components/number-input/index.js +7 -6
  188. package/dist/components/overlays/index.js +8 -8
  189. package/dist/components/password-input/index.js +4 -4
  190. package/dist/components/photo-capture/index.js +18 -17
  191. package/dist/components/photo-capture/index.js.map +1 -1
  192. package/dist/components/pill/index.js +3 -3
  193. package/dist/components/pills-input/index.js +6 -6
  194. package/dist/components/pin-input/index.js +3 -3
  195. package/dist/components/popover/index.d.ts +1 -1
  196. package/dist/components/popover/index.d.ts.map +1 -1
  197. package/dist/components/popover/index.js +3 -2
  198. package/dist/components/popover/popover.d.ts +44 -29
  199. package/dist/components/popover/popover.d.ts.map +1 -1
  200. package/dist/components/progress/index.js +2 -2
  201. package/dist/components/radio-group/index.js +4 -4
  202. package/dist/components/rating/index.js +3 -3
  203. package/dist/components/schedule/index.js +10 -10
  204. package/dist/components/segment-group/index.js +3 -3
  205. package/dist/components/select/index.js +8 -7
  206. package/dist/components/skeleton/index.js +2 -2
  207. package/dist/components/slider/index.js +4 -4
  208. package/dist/components/spinner/index.js +2 -2
  209. package/dist/components/spotlight/index.js +16 -15
  210. package/dist/components/spotlight/index.js.map +1 -1
  211. package/dist/components/switch/index.js +3 -3
  212. package/dist/components/table/index.js +3 -3
  213. package/dist/components/tabs/index.js +3 -3
  214. package/dist/components/tags-input/index.js +9 -8
  215. package/dist/components/tags-input/index.js.map +1 -1
  216. package/dist/components/text/index.js +2 -2
  217. package/dist/components/text-input/index.js +3 -3
  218. package/dist/components/textarea/index.js +3 -3
  219. package/dist/components/theme-icon/index.js +3 -3
  220. package/dist/components/time-input/index.js +9 -8
  221. package/dist/components/time-input/index.js.map +1 -1
  222. package/dist/components/timeline/index.js +1 -1
  223. package/dist/components/title/index.js +2 -2
  224. package/dist/components/tooltip/index.js +4 -4
  225. package/dist/components/tree-multi-select/index.js +11 -10
  226. package/dist/components/tree-multi-select/index.js.map +1 -1
  227. package/dist/components/tree-select/index.js +8 -7
  228. package/dist/components/tree-select/index.js.map +1 -1
  229. package/dist/index.js +2 -2
  230. package/dist/lib/cn.d.ts.map +1 -1
  231. package/dist/lib/cn.js +1 -1
  232. package/dist/lib/placement.d.ts +42 -1
  233. package/dist/lib/placement.d.ts.map +1 -1
  234. package/dist/lib/slide-on-switch.d.ts +69 -0
  235. package/dist/lib/slide-on-switch.d.ts.map +1 -0
  236. package/package.json +1 -1
  237. package/src/components/card/card.test.tsx +10 -0
  238. package/src/components/card/card.tsx +4 -1
  239. package/src/components/hover-card/hover-card.tsx +89 -167
  240. package/src/components/popover/index.ts +2 -0
  241. package/src/components/popover/popover.test.tsx +131 -0
  242. package/src/components/popover/popover.tsx +191 -53
  243. package/src/lib/cn.test.ts +9 -0
  244. package/src/lib/cn.ts +9 -1
  245. package/src/lib/placement.test.ts +37 -0
  246. package/src/lib/placement.ts +60 -1
  247. package/src/lib/slide-on-switch.ts +99 -0
  248. package/dist/chunk-G52U24GR.js +0 -10
  249. package/dist/chunk-G52U24GR.js.map +0 -1
  250. package/dist/chunk-QP4I37PA.js +0 -14
  251. package/dist/chunk-QP4I37PA.js.map +0 -1
  252. package/dist/chunk-Z5WYYDG2.js.map +0 -1
  253. package/dist/chunk-ZN3WYGIQ.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA,KAAW,KAAK,KAAA,GAAQ,KAAA;AACzD,EAAA,OAAO,IAAA,CAAK,eAAe,MAAA,EAAQ,EAAE,MAAM,SAAA,EAAW,CAAA,CAAE,eAAA,EAAgB,CAAE,SAAA;AAC5E;AAGO,IAAM,QAAA,GAAW,CAAC,KAAA,KAA8B,KAAA,KAAU,SAAS,KAAA,KAAU;AAI7E,IAAM,WAAA,GAA+D;AAAA,EAC1E,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA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AAA;AAAU;AAAA;AAC3D;AAAA;AAAA;AAEJ;AAEJ","file":"chunk-JL4QMM46.js","sourcesContent":["export type HourCycle = \"h11\" | \"h12\" | \"h23\" | \"h24\"\n\n/**\n * Resolve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 12 hours + AM/PM (`h11`/`h12`) rather than all 24. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** The hours each cycle displays: `h11` 0–11, `h12` 1–12, `h23` 0–23, `h24` 1–24. In the two\n * cycles that start at 1, midnight (and, for `h12`, noon) reads as the top of the range. */\nexport const HOUR_RANGES: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 },\n}\n\n/** Convert a stored 24h hour (`0`–`23`) to the hour `cycle` displays, plus its period in the\n * 12-hour cycles (`null` otherwise) — e.g. midnight is `12` AM in `h12`, `0` AM in `h11`, `0` in\n * `h23` and `24` in `h24`. */\nexport const toDisplayHour = (\n hour24: number,\n cycle: HourCycle,\n): { hour: number; period: \"AM\" | \"PM\" | null } => {\n const twelveHour = is12Hour(cycle)\n const hour = twelveHour ? hour24 % 12 : hour24\n return {\n hour: hour === 0 && HOUR_RANGES[cycle].min === 1 ? HOUR_RANGES[cycle].max : hour,\n period: twelveHour ? (hour24 < 12 ? \"AM\" : \"PM\") : null,\n }\n}\n\n/** The inverse of `toDisplayHour`: a displayed hour (+ period in the 12-hour cycles) back to a\n * stored 24h hour. A missing hour reads as the start of its half of the day — midnight, or noon\n * once PM is picked — and a missing period as AM. */\nexport const fromDisplayHour = (\n hour: number | null,\n period: \"AM\" | \"PM\" | null,\n cycle: HourCycle,\n): number => {\n const offset = is12Hour(cycle) && period === \"PM\" ? 12 : 0\n if (hour === null) return offset\n return is12Hour(cycle) ? (hour % 12) + offset : hour % 24\n}\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `toDisplayHour`/`fromDisplayHour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput, type NumberInputTranslations } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport {\n dayPeriodLabels,\n HOUR_RANGES,\n type HourCycle,\n is12Hour,\n timeUnitLabels,\n} from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (the cycle's own hours — 0–11, 1–12, 0–23 or 1–24) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). `incrementLabel`/`decrementLabel` are `NumberInput`'s own\n * keys, forwarded to each field's steppers (defaults `\"Increment\"` / `\"Decrement\"`). */\nexport type TimeRowTranslations = Pick<\n NumberInputTranslations,\n \"incrementLabel\" | \"decrementLabel\"\n> & {\n /** The whole row's group name when nothing visible labels it. Default `\"Time\"`. */\n time?: string\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** The row's English accessible names, merged once under `translations`. `NumberInput` keeps\n * its own stepper defaults. */\nconst TIME_ROW_DEFAULT_TRANSLATIONS = {\n time: \"Time\",\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n period: \"Period\",\n} as const satisfies TimeRowTranslations\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nexport const TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\n/** The same widths as Tailwind classes, written out in full: Tailwind finds classes by scanning\n * source text (a consumer's build scans the shipped `dist`), so a class assembled from a template\n * literal is never generated. `time-row.test.ts` keeps these in step with `TIME_FIELD_BASIS_PX`. */\nexport const timeFieldBasis: Record<Size, string> = {\n xs: \"basis-[64px] min-w-[64px]\",\n sm: \"basis-[72px] min-w-[72px]\",\n md: \"basis-[78px] min-w-[78px]\",\n lg: \"basis-[86px] min-w-[86px]\",\n xl: \"basis-[100px] min-w-[100px]\",\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Names the row's `role=\"group\"` directly when no visible label points at it. Defaults to\n * `translations.time` (`\"Time\"`), so the group is never anonymous. */\n \"aria-label\"?: string\n /** Names the row's `role=\"group\"` from a visible label, e.g. `TimeInput`'s field label or\n * `DatePicker`'s \"Start time\" / \"End time\". Without a name a screen reader enters the group\n * hearing only \"Hour\". */\n \"aria-labelledby\"?: string\n /** Helper / error text read after the group's name. */\n \"aria-describedby\"?: string\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n const t = { ...TIME_ROW_DEFAULT_TRANSLATIONS, ...translations }\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? t.time)}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={t.hour}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={HOUR_RANGES[hourCycle].min}\n max={HOUR_RANGES[hourCycle].max}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n translations={t}\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={t.minute}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={t.second}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={t.period}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA,KAAW,KAAK,KAAA,GAAQ,KAAA;AACzD,EAAA,OAAO,IAAA,CAAK,eAAe,MAAA,EAAQ,EAAE,MAAM,SAAA,EAAW,CAAA,CAAE,eAAA,EAAgB,CAAE,SAAA;AAC5E;AAGO,IAAM,QAAA,GAAW,CAAC,KAAA,KAA8B,KAAA,KAAU,SAAS,KAAA,KAAU;AAI7E,IAAM,WAAA,GAA+D;AAAA,EAC1E,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA;AACtB,CAAA;AAKO,IAAM,aAAA,GAAgB,CAC3B,MAAA,EACA,KAAA,KACiD;AACjD,EAAA,MAAM,UAAA,GAAa,SAAS,KAAK,CAAA;AACjC,EAAA,MAAM,IAAA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;AAAA,cACA,OAAA;AAAA,cACA,QAAA;AAAA,cACA,QAAA;AAAA,cACA,OAAA;AAAA,cACA,YAAA,EAAc,CAAA;AAAA,cACd,QAAQ,KAAA,CAAM,MAAA;AAAA,cACd,WAAW,UAAA,EAAY,MAAA;AAAA,cACvB,UAAA,EAAY;AAAA,gBACV,KAAA,EAAO,EAAA,CAAG,QAAA,EAAU,cAAA,CAAe,IAAI,CAAC,CAAA;AAAA,gBACxC,KAAA,EAAO,SAAA;AAAA,gBACP,KAAA,EAAO;AAAA;AACT;AAAA,WACF;AAAA,UAED,cAAc,YAAA,oBACb,GAAA;AAAA,YAAC,YAAA;AAAA,YAAA;AAAA,cACC,IAAA,EAAM;AAAA,gBACJ,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,aAAa,EAAA,EAAG;AAAA,gBACtC,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,aAAa,EAAA;AAAG,eACxC;AAAA,cACA,OAAO,CAAA,CAAE,MAAA;AAAA,cACT,KAAA,EAAO,MAAA;AAAA,cACP,QAAA,EAAU,CAAC,KAAA,KAAU,cAAA,CAAe,KAAoB,CAAA;AAAA,cAGxD,IAAA;AAAA,cACA,QAAA;AAAA,cACA,QAAA;AAAA,cACA,OAAA;AAAA,cACA,WAAW,UAAA,EAAY,MAAA;AAAA,cAOvB,UAAA,EAAY,EAAE,KAAA,EAAO,iBAAA,EAAmB,OAAO,SAAA;AAAU;AAAA;AAC3D;AAAA;AAAA;AAEJ;AAEJ","file":"chunk-LFQDB5OD.js","sourcesContent":["export type HourCycle = \"h11\" | \"h12\" | \"h23\" | \"h24\"\n\n/**\n * Resolve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 12 hours + AM/PM (`h11`/`h12`) rather than all 24. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** The hours each cycle displays: `h11` 0–11, `h12` 1–12, `h23` 0–23, `h24` 1–24. In the two\n * cycles that start at 1, midnight (and, for `h12`, noon) reads as the top of the range. */\nexport const HOUR_RANGES: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 },\n}\n\n/** Convert a stored 24h hour (`0`–`23`) to the hour `cycle` displays, plus its period in the\n * 12-hour cycles (`null` otherwise) — e.g. midnight is `12` AM in `h12`, `0` AM in `h11`, `0` in\n * `h23` and `24` in `h24`. */\nexport const toDisplayHour = (\n hour24: number,\n cycle: HourCycle,\n): { hour: number; period: \"AM\" | \"PM\" | null } => {\n const twelveHour = is12Hour(cycle)\n const hour = twelveHour ? hour24 % 12 : hour24\n return {\n hour: hour === 0 && HOUR_RANGES[cycle].min === 1 ? HOUR_RANGES[cycle].max : hour,\n period: twelveHour ? (hour24 < 12 ? \"AM\" : \"PM\") : null,\n }\n}\n\n/** The inverse of `toDisplayHour`: a displayed hour (+ period in the 12-hour cycles) back to a\n * stored 24h hour. A missing hour reads as the start of its half of the day — midnight, or noon\n * once PM is picked — and a missing period as AM. */\nexport const fromDisplayHour = (\n hour: number | null,\n period: \"AM\" | \"PM\" | null,\n cycle: HourCycle,\n): number => {\n const offset = is12Hour(cycle) && period === \"PM\" ? 12 : 0\n if (hour === null) return offset\n return is12Hour(cycle) ? (hour % 12) + offset : hour % 24\n}\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `toDisplayHour`/`fromDisplayHour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput, type NumberInputTranslations } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport {\n dayPeriodLabels,\n HOUR_RANGES,\n type HourCycle,\n is12Hour,\n timeUnitLabels,\n} from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (the cycle's own hours — 0–11, 1–12, 0–23 or 1–24) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). `incrementLabel`/`decrementLabel` are `NumberInput`'s own\n * keys, forwarded to each field's steppers (defaults `\"Increment\"` / `\"Decrement\"`). */\nexport type TimeRowTranslations = Pick<\n NumberInputTranslations,\n \"incrementLabel\" | \"decrementLabel\"\n> & {\n /** The whole row's group name when nothing visible labels it. Default `\"Time\"`. */\n time?: string\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** The row's English accessible names, merged once under `translations`. `NumberInput` keeps\n * its own stepper defaults. */\nconst TIME_ROW_DEFAULT_TRANSLATIONS = {\n time: \"Time\",\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n period: \"Period\",\n} as const satisfies TimeRowTranslations\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nexport const TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\n/** The same widths as Tailwind classes, written out in full: Tailwind finds classes by scanning\n * source text (a consumer's build scans the shipped `dist`), so a class assembled from a template\n * literal is never generated. `time-row.test.ts` keeps these in step with `TIME_FIELD_BASIS_PX`. */\nexport const timeFieldBasis: Record<Size, string> = {\n xs: \"basis-[64px] min-w-[64px]\",\n sm: \"basis-[72px] min-w-[72px]\",\n md: \"basis-[78px] min-w-[78px]\",\n lg: \"basis-[86px] min-w-[86px]\",\n xl: \"basis-[100px] min-w-[100px]\",\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Names the row's `role=\"group\"` directly when no visible label points at it. Defaults to\n * `translations.time` (`\"Time\"`), so the group is never anonymous. */\n \"aria-label\"?: string\n /** Names the row's `role=\"group\"` from a visible label, e.g. `TimeInput`'s field label or\n * `DatePicker`'s \"Start time\" / \"End time\". Without a name a screen reader enters the group\n * hearing only \"Hour\". */\n \"aria-labelledby\"?: string\n /** Helper / error text read after the group's name. */\n \"aria-describedby\"?: string\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n const t = { ...TIME_ROW_DEFAULT_TRANSLATIONS, ...translations }\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? t.time)}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={t.hour}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={HOUR_RANGES[hourCycle].min}\n max={HOUR_RANGES[hourCycle].max}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n translations={t}\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={t.minute}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={t.second}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={t.period}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
@@ -1,12 +1,12 @@
1
1
  import { useUncontrolled } from './chunk-PMUCGFY5.js';
2
- import { CloseIcon } from './chunk-ZFUTGBJC.js';
3
- import { Collapse } from './chunk-DUPE2CRU.js';
2
+ import { CloseIcon } from './chunk-6YNLRQ25.js';
3
+ import { Collapse } from './chunk-NKOTA5TM.js';
4
4
  import { mergeIcons, iconStroke } from './chunk-XXOR34T4.js';
5
- import { Spinner } from './chunk-HVOEVB4E.js';
5
+ import { Spinner } from './chunk-D2QIPQ74.js';
6
6
  import { props } from './chunk-WYCMIIRR.js';
7
- import { focusStyles } from './chunk-3REFDGOM.js';
7
+ import { focusStyles } from './chunk-C6NVU4F7.js';
8
8
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
9
- import { cn } from './chunk-QP4I37PA.js';
9
+ import { cn } from './chunk-4ASNIDV7.js';
10
10
  import { ark } from '@ark-ui/react';
11
11
  import { cva } from 'class-variance-authority';
12
12
  import { ChevronDownIcon, InfoIcon, TriangleAlertIcon, AlertCircleIcon, CheckCircleIcon } from 'lucide-react';
@@ -238,5 +238,5 @@ var Notification = Object.assign(NotificationComponent, {
238
238
  });
239
239
 
240
240
  export { ActionTrigger, CloseTrigger, Description, Icon, NOTIFICATION_DEFAULT_TRANSLATIONS, Notification, TOAST_STATUS, Title, notificationRoot };
241
- //# sourceMappingURL=chunk-U2PNMMDB.js.map
242
- //# sourceMappingURL=chunk-U2PNMMDB.js.map
241
+ //# sourceMappingURL=chunk-LKFHUDEW.js.map
242
+ //# sourceMappingURL=chunk-LKFHUDEW.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/notification/notification.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmDO,IAAM,mBAAA,GAAsB;AAAA,EACjC,qCAAA;AAAA,EACA;AACF,CAAA;AAMO,IAAM,mBAAmB,GAAA,CAAI;AAAA,EAClC,0EAAA;AAAA,EACA,iEAAA;AAAA;AAAA,EAEA,mCAAA;AAAA,EACA,+BAAA;AAAA;AAAA;AAAA,EAGA,oBAAA;AAAA,EACA,WA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AA,EAAU,wCAAA,EAA0C,QAAA,EAAA,MAAA,IAAU,UAAA,CAAW,SAAQ,CAAA,EACxF;AAAA,GAAA,EACF,CAAA;AAEJ;AAOO,IAAM,YAAA,GAAe,MAAA,CAAO,MAAA,CAAO,qBAAA,EAAuB;AAAA,EAC/D,IAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAC","file":"chunk-U2PNMMDB.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n AlertCircleIcon,\n CheckCircleIcon,\n ChevronDownIcon,\n InfoIcon,\n TriangleAlertIcon,\n} from \"lucide-react\"\nimport { type ComponentPropsWithoutRef, type ReactNode, type Ref, useRef } from \"react\"\nimport { match } from \"ts-pattern\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\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 { Collapse } from \"../collapse/collapse\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { Spinner } from \"../spinner/spinner\"\nimport type { ToastFields, ToastHue, ToastType } from \"./types\"\n\n/**\n * Notification — the kit's **toast**: transient, non-blocking feedback spawned\n * imperatively from anywhere (`notify.success(\"Saved\")`) via `createNotifier`.\n *\n * This module holds the *visual* compound (`Notification.Root` / `Icon` /\n * `Title` / `Description` / `ActionTrigger` / `CloseTrigger` /\n * `CollapseTrigger`) and the ready-made `Notification` card composed from a\n * toast-shaped object (`type` → hue + icon, `title` / `description` /\n * `action`). It is deliberately dumb: the toaster behavior that drives it —\n * store, presence, height measurement, swipe-to-dismiss, stacking — lives in\n * `store.ts` / `create-notifier.tsx`, so the card is equally usable on its own\n * (e.g. a page-level alert).\n *\n * The surface is a single outline recipe; `color` (a `data-color` attribute\n * resolved to the `--c-*` slot vars) is the only styling axis. Status presets\n * map a `type` onto a hue + a leading icon.\n * Enter/exit is driven by Ark Presence → `data-state` → the `toast-in/out`\n * keyframes (like modal/drawer/popover).\n */\n\n/** The outline surface. Deliberately opaque and blurred: a toast floats over\n * arbitrary content. `Alert` (the inline sibling) shares the parts but not\n * this surface — it sits on the page and takes a translucent tint instead.\n * `color` tints the border, text and icon through `--c-solid`. */\nexport const notificationSurface = [\n \"bg-brand-50/90 dark:bg-brand-950/85\",\n \"text-(--c-solid) border-(--c-solid) backdrop-blur-lg\",\n]\n\n/** The toast card. Enter/exit via `data-state` keyframes (Ark Presence sets\n * `data-state`); stacking position via the `[data-scope=notifications]` rules\n * in theme.css (driven by the `--index`/`--offset`/`--height` vars the toaster\n * sets on each card — see create-notifier). */\nexport const notificationRoot = cva([\n \"data-[state=open]:animate-toast-in data-[state=closed]:animate-toast-out\",\n \"pointer-events-auto flex flex-col w-88 max-w-[calc(100vw-2rem)]\",\n // Phones (< xs): fill the full-bleed bottom region (see createNotifier).\n \"max-xs:w-full! max-xs:max-w-none!\",\n \"rounded-card border px-3 py-3\",\n // Any-focus outline suppression, matching the other overlay surfaces\n // (Modal, Drawer, Popover, Tooltip) — the card can take programmatic focus.\n \"focus:outline-none\",\n focusStyles({ offset: false }),\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"shadow-2xl shadow-white dark:shadow-black/80\",\n \"overflow-clip\",\n notificationSurface,\n])\n\n/** `type` → hue + default leading icon. There are no status color *tokens* in\n * the kit — status maps onto existing hues, reusing the same `--c-*` slots as\n * Badge/Button. `loading` uses the kit Spinner. Exported so `Alert` (which\n * drops the toast-only `loading` type) resolves the same presets. */\nexport const TOAST_STATUS: Record<ToastType, { color: Color; icon: ReactNode }> = {\n success: { color: \"green\", icon: <CheckCircleIcon className={iconStroke} /> },\n error: { color: \"red\", icon: <AlertCircleIcon className={iconStroke} /> },\n warning: { color: \"orange\", icon: <TriangleAlertIcon className={iconStroke} /> },\n info: { color: \"neutral\", icon: <InfoIcon className={iconStroke} /> },\n loading: { color: \"neutral\", icon: <Spinner size=\"md\" label={null} /> },\n}\n\nexport type NotificationIconSlot = ToastType | \"close\" | \"collapse\"\n/**\n * The card's icons: one per status `type` (`success`, `error`, `warning`,\n * `info`, `loading`), the close ×, and the collapse chevron, which turns half\n * a turn while the card is folded. A toast's own `icon` still wins over its\n * status icon.\n */\nexport type NotificationIcons = IconMap<NotificationIconSlot>\n\nexport const DEFAULT_ICONS: Record<NotificationIconSlot, ReactNode> = {\n success: TOAST_STATUS.success.icon,\n error: TOAST_STATUS.error.icon,\n warning: TOAST_STATUS.warning.icon,\n info: TOAST_STATUS.info.icon,\n loading: TOAST_STATUS.loading.icon,\n close: <CloseIcon />,\n collapse: <ChevronDownIcon className={iconStroke} />,\n}\n\n/** Turns the collapse icon half a turn while the card is folded. */\nconst Turn = ({ open, children }: { open: boolean; children: ReactNode }) => (\n <span\n data-open={open}\n className=\"inline-flex transition-transform data-[open=true]:rotate-0 data-[open=false]:rotate-180\"\n >\n {children}\n </span>\n)\n\nexport type NotificationRootProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** Accent palette. Drives the `--c-*` slot vars for the whole toast. */\n color?: Color\n /** Forwarded to the underlying element (used by Presence for enter/exit). */\n ref?: Ref<HTMLDivElement>\n }\n\nconst Root = ({ className, color, testId, ...rest }: NotificationRootProps) => (\n <ark.div\n data-color={color}\n className={cn(notificationRoot(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** Leading-glyph slot. Inherits the Root's text color (the `color` hue) and\n * sizes any child svg to match the text.\n * Exported (like the parts below) so `Alert` reuses it as-is — these are\n * width-agnostic, so nothing about them is toast-specific. */\nexport const Icon = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"span\"> & WithTestId) => (\n <span\n className={cn(\"inline-flex [&_svg]:size-5\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Title = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\"text-sm font-bold\", TEXT_COLOR_CLASSES.primary, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Description = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\n \"mt-1 text-sm font-normal text-brand-900/70 opacity-90 dark:text-white/80\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const ActionTrigger = ({\n className,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n className={cn(\n \"inline-flex h-7 cursor-pointer items-center rounded-input px-2 text-xs font-medium\",\n \"border border-current/30 hover:bg-current/10\",\n focusStyles({ ring: \"palette\", offset: false }),\n \"transition-colors\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** The card's control names. `closeTriggerLabel` follows Ark's own Toast key. The ready-made\n * card takes them as `translations`; the compound parts (`CloseTrigger`, `CollapseTrigger`)\n * default to the same English names and take a plain `aria-label` to override. */\nexport type NotificationTranslations = {\n /** The close (×) button. Default `\"Dismiss\"`. */\n closeTriggerLabel?: string\n /** The collapse chevron while the card is open. Default `\"Collapse\"`. */\n collapseLabel?: string\n /** The collapse chevron while the card is folded. Default `\"Expand\"`. */\n expandLabel?: string\n}\n\n/** The one source of the card's English names: the compound parts' defaults, and the base the\n * ready-made card (and `Alert`, `<Notifications>`) merge a partial override onto. */\nexport const NOTIFICATION_DEFAULT_TRANSLATIONS = {\n closeTriggerLabel: \"Dismiss\",\n collapseLabel: \"Collapse\",\n expandLabel: \"Expand\",\n} as const satisfies Required<NotificationTranslations>\n\n/** The close and collapse buttons share one look: a small round control resting at 70%. */\nconst triggerClass = [\n \"ms-auto inline-flex size-5 shrink-0 cursor-pointer items-center justify-center\",\n \"rounded-full opacity-70 hover:opacity-100 [&_svg]:size-4\",\n focusStyles({ ring: \"palette\", offset: false }),\n // The button rests at 70% opacity, which would fade its ring with it.\n \"focus-visible:opacity-100\",\n \"transition-colors\",\n]\n\nexport const CloseTrigger = ({\n className,\n children,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n aria-label={NOTIFICATION_DEFAULT_TRANSLATIONS.closeTriggerLabel}\n className={cn(triggerClass, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? DEFAULT_ICONS.close}\n </button>\n)\n\n/**\n * The chevron that folds the card's description and action rows away — the\n * collapse counterpart to `CloseTrigger`, and what the ready-made card renders\n * for `withCollapse`.\n *\n * It is presentational only: `open` drives the label, `aria-expanded` and the\n * chevron's rotation, but the state itself belongs to the caller. The button\n * owns the layout, the opacity and any `className`; the default icon carries\n * nothing but its rotation, so passing a `className` tints or spaces the\n * control once rather than twice.\n */\nexport const CollapseTrigger = ({\n className,\n children,\n type,\n open,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId & { open: boolean }) => (\n <button\n type={type ?? \"button\"}\n aria-label={\n open\n ? NOTIFICATION_DEFAULT_TRANSLATIONS.collapseLabel\n : NOTIFICATION_DEFAULT_TRANSLATIONS.expandLabel\n }\n aria-expanded={open}\n className={cn(triggerClass, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? <Turn open={open}>{DEFAULT_ICONS.collapse}</Turn>}\n </button>\n)\n\n/**\n * Props for the ready-made `Notification` card. The presentational fields it\n * shares with a spawned toast (`type` / `title` / `description` / `action` /\n * `color` / `icon` / `withCloseButton`) plus its own collapse controls;\n * the Notifier-managed plumbing (`id` / `status` / `duration`) is optional, so a\n * standalone card is just `<Notification type=\"success\" title=\"Saved\" />`.\n */\nexport type NotificationProps = Omit<NotificationRootProps, \"title\" | \"color\" | \"asChild\"> &\n ForbidAsChild &\n Omit<ToastFields, \"id\" | \"status\" | \"duration\"> &\n Partial<Pick<ToastFields, \"id\" | \"status\" | \"duration\">> &\n ToastHue & {\n /** Invoked when the close (×) button is pressed. */\n onClose?: () => void\n /** Swap the close (×) button for a chevron that folds the description and\n * action rows away. `withCloseButton` takes precedence over this. */\n withCollapse?: boolean\n /** Uncontrolled initial open state — collapsed by default when `withCollapse`,\n * open otherwise. Pair with `withCollapse`. */\n defaultOpen?: boolean\n /** Controlled open state — pair with `onOpenChange`. */\n open?: boolean\n /** Fired when the collapse toggle is pressed. */\n onOpenChange?: (open: boolean) => void\n /** Overrides the close and collapse buttons' accessible names. A partial override keeps\n * the other defaults. */\n translations?: NotificationTranslations\n /** Replaces the default icons: the status icons by `type`, `close` and `collapse`. A missing\n * key keeps its default; `icon` wins over the status icon, and `null` drops a status icon. */\n icons?: NotificationIcons\n }\n\n/**\n * The ready-made **`Notification` card** — the presentational body composed from\n * a toast-shaped object: resolves `type` → `TOAST_STATUS` (hue + leading icon), lets\n * an explicit `color`/`icon` override (`icon={null}` hides the glyph),\n * and lays out the icon/title/close row plus the independently-collapsing\n * description and action sections.\n *\n * Owns no store, presence or gesture state — the Notifier's render body drives\n * it by forwarding a `ref`, stacking style vars, pointer handlers and `onClose`\n * straight through to the `Root`. Rendered on its own it is just a status card\n * (e.g. a page-level alert). For a bespoke layout, compose the parts directly:\n * `Notification.Root`, `.Icon`, `.Title`, `.Description`, `.ActionTrigger`,\n * `.CloseTrigger`.\n *\n * **Announcements are the toaster's job, not the card's.** A toast spawned\n * through `createNotifier` is its own live region: `role=\"status\"`, or\n * `role=\"alert\"` for an `error`, set by the notifier as it renders the card.\n * A standalone card carries no role: rendered with the page it is content to\n * read, not news, and a live region there would only re-announce whatever it\n * holds on every mount. A card you insert in response to an event *is* news:\n * pass the role yourself (`role=\"status\"`, or `role=\"alert\"` for a failure)\n * and it lands on the `Root`, or mount it into a region that's already live.\n */\nfunction NotificationComponent({\n type,\n title,\n description,\n action,\n color: _color,\n icon: _icon,\n withCloseButton = true,\n withCollapse = false,\n defaultOpen,\n open: _open,\n onOpenChange,\n onClose,\n translations,\n icons: iconsProp,\n // Notifier-managed plumbing — not rendered onto the card.\n status: _status,\n duration: _duration,\n asChild: _asChild,\n ...rest\n}: NotificationProps) {\n const resolvedTranslations = { ...NOTIFICATION_DEFAULT_TRANSLATIONS, ...translations }\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n // `type` and `color` are exclusive (see `ToastHue`), and testing the destructured `type`\n // narrows `color` with it: no cast. The preset wins should a JS caller pass both anyway.\n const color = type === undefined ? _color : TOAST_STATUS[type].color\n // Not `??`: an explicit `icon={null}` (hide the glyph) must not fall\n // through to the preset the way an omitted (`undefined`) icon does.\n const icon = _icon === undefined ? type && icons[type] : _icon\n\n const [open, setOpen] = useUncontrolled({\n defaultValue: defaultOpen,\n value: _open,\n finalValue: match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => true)\n .with({ withCollapse: true }, () => false)\n .with({ withCollapse: false }, () => true)\n .exhaustive(),\n onChange: onOpenChange,\n })\n\n // Keep the last-present description / action mounted through their collapse so\n // each reveal has content to animate *out* (removed content unmounts instantly\n // otherwise). Cached independently so the two sections animate separately.\n const lastDescription = useRef(description)\n if (description != null) lastDescription.current = description\n const lastAction = useRef(action)\n if (action != null) lastAction.current = action\n\n return (\n <Root color={color} {...rest}>\n <div className=\"flex flex-row gap-3\">\n {icon != null && <Icon>{icon}</Icon>}\n {title != null && <Title>{title}</Title>}\n {match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => (\n <CloseTrigger aria-label={resolvedTranslations.closeTriggerLabel} onClick={onClose}>\n {icons.close}\n </CloseTrigger>\n ))\n .with({ withCollapse: true }, () => (\n <CollapseTrigger\n open={open}\n aria-label={\n open ? resolvedTranslations.collapseLabel : resolvedTranslations.expandLabel\n }\n onClick={() => setOpen(!open)}\n >\n <Turn open={open}>{icons.collapse}</Turn>\n </CollapseTrigger>\n ))\n .with({ withCollapse: false }, () => null)\n .exhaustive()}\n </div>\n {/* Description and action are independent Collapse sections. */}\n <Collapse open={description != null && open}>\n <Description>{description ?? lastDescription.current}</Description>\n </Collapse>\n <Collapse open={action != null && open}>\n <div className=\"mt-2 flex flex-wrap items-center gap-2\">{action ?? lastAction.current}</div>\n </Collapse>\n </Root>\n )\n}\n\n/**\n * `Notification` — the ready-made card (batteries-included), with the compound\n * parts attached for bespoke composition. Mirrors `Tooltip`/`Modal`: the bare\n * name is the convenience form; `.Root` and friends are the primitives.\n */\nexport const Notification = Object.assign(NotificationComponent, {\n Root,\n Icon,\n Title,\n Description,\n ActionTrigger,\n CloseTrigger,\n CollapseTrigger,\n})\n"]}
1
+ {"version":3,"sources":["../src/components/notification/notification.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmDO,IAAM,mBAAA,GAAsB;AAAA,EACjC,qCAAA;AAAA,EACA;AACF,CAAA;AAMO,IAAM,mBAAmB,GAAA,CAAI;AAAA,EAClC,0EAAA;AAAA,EACA,iEAAA;AAAA;AAAA,EAEA,mCAAA;AAAA,EACA,+BAAA;AAAA;AAAA;AAAA,EAGA,oBAAA;AAAA,EACA,WAAA,CAAY,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAA;AAAA,EAC7B,8CAAA;AAAA,EACA,8CAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,YAAA,GAAqE;AAAA,EAChF,OAAA,EAAS,EAAE,KAAA,EAAO,OAAA,EAAS,sBAAM,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAW,UAAA,EAAY,CAAA,EAAG;AAAA,EAC5E,KAAA,EAAO,EAAE,KAAA,EAAO,KAAA,EAAO,sBAAM,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAA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nimport { cva } from \"class-variance-authority\"\nimport {\n AlertCircleIcon,\n CheckCircleIcon,\n ChevronDownIcon,\n InfoIcon,\n TriangleAlertIcon,\n} from \"lucide-react\"\nimport { type ComponentPropsWithoutRef, type ReactNode, type Ref, useRef } from \"react\"\nimport { match } from \"ts-pattern\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\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 { Collapse } from \"../collapse/collapse\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { Spinner } from \"../spinner/spinner\"\nimport type { ToastFields, ToastHue, ToastType } from \"./types\"\n\n/**\n * Notification — the kit's **toast**: transient, non-blocking feedback spawned\n * imperatively from anywhere (`notify.success(\"Saved\")`) via `createNotifier`.\n *\n * This module holds the *visual* compound (`Notification.Root` / `Icon` /\n * `Title` / `Description` / `ActionTrigger` / `CloseTrigger` /\n * `CollapseTrigger`) and the ready-made `Notification` card composed from a\n * toast-shaped object (`type` → hue + icon, `title` / `description` /\n * `action`). It is deliberately dumb: the toaster behavior that drives it —\n * store, presence, height measurement, swipe-to-dismiss, stacking — lives in\n * `store.ts` / `create-notifier.tsx`, so the card is equally usable on its own\n * (e.g. a page-level alert).\n *\n * The surface is a single outline recipe; `color` (a `data-color` attribute\n * resolved to the `--c-*` slot vars) is the only styling axis. Status presets\n * map a `type` onto a hue + a leading icon.\n * Enter/exit is driven by Ark Presence → `data-state` → the `toast-in/out`\n * keyframes (like modal/drawer/popover).\n */\n\n/** The outline surface. Deliberately opaque and blurred: a toast floats over\n * arbitrary content. `Alert` (the inline sibling) shares the parts but not\n * this surface — it sits on the page and takes a translucent tint instead.\n * `color` tints the border, text and icon through `--c-solid`. */\nexport const notificationSurface = [\n \"bg-brand-50/90 dark:bg-brand-950/85\",\n \"text-(--c-solid) border-(--c-solid) backdrop-blur-lg\",\n]\n\n/** The toast card. Enter/exit via `data-state` keyframes (Ark Presence sets\n * `data-state`); stacking position via the `[data-scope=notifications]` rules\n * in theme.css (driven by the `--index`/`--offset`/`--height` vars the toaster\n * sets on each card — see create-notifier). */\nexport const notificationRoot = cva([\n \"data-[state=open]:animate-toast-in data-[state=closed]:animate-toast-out\",\n \"pointer-events-auto flex flex-col w-88 max-w-[calc(100vw-2rem)]\",\n // Phones (< xs): fill the full-bleed bottom region (see createNotifier).\n \"max-xs:w-full! max-xs:max-w-none!\",\n \"rounded-card border px-3 py-3\",\n // Any-focus outline suppression, matching the other overlay surfaces\n // (Modal, Drawer, Popover, Tooltip) — the card can take programmatic focus.\n \"focus:outline-none\",\n focusStyles({ offset: false }),\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"shadow-2xl shadow-white dark:shadow-black/80\",\n \"overflow-clip\",\n notificationSurface,\n])\n\n/** `type` → hue + default leading icon. There are no status color *tokens* in\n * the kit — status maps onto existing hues, reusing the same `--c-*` slots as\n * Badge/Button. `loading` uses the kit Spinner. Exported so `Alert` (which\n * drops the toast-only `loading` type) resolves the same presets. */\nexport const TOAST_STATUS: Record<ToastType, { color: Color; icon: ReactNode }> = {\n success: { color: \"green\", icon: <CheckCircleIcon className={iconStroke} /> },\n error: { color: \"red\", icon: <AlertCircleIcon className={iconStroke} /> },\n warning: { color: \"orange\", icon: <TriangleAlertIcon className={iconStroke} /> },\n info: { color: \"neutral\", icon: <InfoIcon className={iconStroke} /> },\n loading: { color: \"neutral\", icon: <Spinner size=\"md\" label={null} /> },\n}\n\nexport type NotificationIconSlot = ToastType | \"close\" | \"collapse\"\n/**\n * The card's icons: one per status `type` (`success`, `error`, `warning`,\n * `info`, `loading`), the close ×, and the collapse chevron, which turns half\n * a turn while the card is folded. A toast's own `icon` still wins over its\n * status icon.\n */\nexport type NotificationIcons = IconMap<NotificationIconSlot>\n\nexport const DEFAULT_ICONS: Record<NotificationIconSlot, ReactNode> = {\n success: TOAST_STATUS.success.icon,\n error: TOAST_STATUS.error.icon,\n warning: TOAST_STATUS.warning.icon,\n info: TOAST_STATUS.info.icon,\n loading: TOAST_STATUS.loading.icon,\n close: <CloseIcon />,\n collapse: <ChevronDownIcon className={iconStroke} />,\n}\n\n/** Turns the collapse icon half a turn while the card is folded. */\nconst Turn = ({ open, children }: { open: boolean; children: ReactNode }) => (\n <span\n data-open={open}\n className=\"inline-flex transition-transform data-[open=true]:rotate-0 data-[open=false]:rotate-180\"\n >\n {children}\n </span>\n)\n\nexport type NotificationRootProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** Accent palette. Drives the `--c-*` slot vars for the whole toast. */\n color?: Color\n /** Forwarded to the underlying element (used by Presence for enter/exit). */\n ref?: Ref<HTMLDivElement>\n }\n\nconst Root = ({ className, color, testId, ...rest }: NotificationRootProps) => (\n <ark.div\n data-color={color}\n className={cn(notificationRoot(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** Leading-glyph slot. Inherits the Root's text color (the `color` hue) and\n * sizes any child svg to match the text.\n * Exported (like the parts below) so `Alert` reuses it as-is — these are\n * width-agnostic, so nothing about them is toast-specific. */\nexport const Icon = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"span\"> & WithTestId) => (\n <span\n className={cn(\"inline-flex [&_svg]:size-5\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Title = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\"text-sm font-bold\", TEXT_COLOR_CLASSES.primary, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Description = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\n \"mt-1 text-sm font-normal text-brand-900/70 opacity-90 dark:text-white/80\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const ActionTrigger = ({\n className,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n className={cn(\n \"inline-flex h-7 cursor-pointer items-center rounded-input px-2 text-xs font-medium\",\n \"border border-current/30 hover:bg-current/10\",\n focusStyles({ ring: \"palette\", offset: false }),\n \"transition-colors\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** The card's control names. `closeTriggerLabel` follows Ark's own Toast key. The ready-made\n * card takes them as `translations`; the compound parts (`CloseTrigger`, `CollapseTrigger`)\n * default to the same English names and take a plain `aria-label` to override. */\nexport type NotificationTranslations = {\n /** The close (×) button. Default `\"Dismiss\"`. */\n closeTriggerLabel?: string\n /** The collapse chevron while the card is open. Default `\"Collapse\"`. */\n collapseLabel?: string\n /** The collapse chevron while the card is folded. Default `\"Expand\"`. */\n expandLabel?: string\n}\n\n/** The one source of the card's English names: the compound parts' defaults, and the base the\n * ready-made card (and `Alert`, `<Notifications>`) merge a partial override onto. */\nexport const NOTIFICATION_DEFAULT_TRANSLATIONS = {\n closeTriggerLabel: \"Dismiss\",\n collapseLabel: \"Collapse\",\n expandLabel: \"Expand\",\n} as const satisfies Required<NotificationTranslations>\n\n/** The close and collapse buttons share one look: a small round control resting at 70%. */\nconst triggerClass = [\n \"ms-auto inline-flex size-5 shrink-0 cursor-pointer items-center justify-center\",\n \"rounded-full opacity-70 hover:opacity-100 [&_svg]:size-4\",\n focusStyles({ ring: \"palette\", offset: false }),\n // The button rests at 70% opacity, which would fade its ring with it.\n \"focus-visible:opacity-100\",\n \"transition-colors\",\n]\n\nexport const CloseTrigger = ({\n className,\n children,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n aria-label={NOTIFICATION_DEFAULT_TRANSLATIONS.closeTriggerLabel}\n className={cn(triggerClass, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? DEFAULT_ICONS.close}\n </button>\n)\n\n/**\n * The chevron that folds the card's description and action rows away — the\n * collapse counterpart to `CloseTrigger`, and what the ready-made card renders\n * for `withCollapse`.\n *\n * It is presentational only: `open` drives the label, `aria-expanded` and the\n * chevron's rotation, but the state itself belongs to the caller. The button\n * owns the layout, the opacity and any `className`; the default icon carries\n * nothing but its rotation, so passing a `className` tints or spaces the\n * control once rather than twice.\n */\nexport const CollapseTrigger = ({\n className,\n children,\n type,\n open,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId & { open: boolean }) => (\n <button\n type={type ?? \"button\"}\n aria-label={\n open\n ? NOTIFICATION_DEFAULT_TRANSLATIONS.collapseLabel\n : NOTIFICATION_DEFAULT_TRANSLATIONS.expandLabel\n }\n aria-expanded={open}\n className={cn(triggerClass, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? <Turn open={open}>{DEFAULT_ICONS.collapse}</Turn>}\n </button>\n)\n\n/**\n * Props for the ready-made `Notification` card. The presentational fields it\n * shares with a spawned toast (`type` / `title` / `description` / `action` /\n * `color` / `icon` / `withCloseButton`) plus its own collapse controls;\n * the Notifier-managed plumbing (`id` / `status` / `duration`) is optional, so a\n * standalone card is just `<Notification type=\"success\" title=\"Saved\" />`.\n */\nexport type NotificationProps = Omit<NotificationRootProps, \"title\" | \"color\" | \"asChild\"> &\n ForbidAsChild &\n Omit<ToastFields, \"id\" | \"status\" | \"duration\"> &\n Partial<Pick<ToastFields, \"id\" | \"status\" | \"duration\">> &\n ToastHue & {\n /** Invoked when the close (×) button is pressed. */\n onClose?: () => void\n /** Swap the close (×) button for a chevron that folds the description and\n * action rows away. `withCloseButton` takes precedence over this. */\n withCollapse?: boolean\n /** Uncontrolled initial open state — collapsed by default when `withCollapse`,\n * open otherwise. Pair with `withCollapse`. */\n defaultOpen?: boolean\n /** Controlled open state — pair with `onOpenChange`. */\n open?: boolean\n /** Fired when the collapse toggle is pressed. */\n onOpenChange?: (open: boolean) => void\n /** Overrides the close and collapse buttons' accessible names. A partial override keeps\n * the other defaults. */\n translations?: NotificationTranslations\n /** Replaces the default icons: the status icons by `type`, `close` and `collapse`. A missing\n * key keeps its default; `icon` wins over the status icon, and `null` drops a status icon. */\n icons?: NotificationIcons\n }\n\n/**\n * The ready-made **`Notification` card** — the presentational body composed from\n * a toast-shaped object: resolves `type` → `TOAST_STATUS` (hue + leading icon), lets\n * an explicit `color`/`icon` override (`icon={null}` hides the glyph),\n * and lays out the icon/title/close row plus the independently-collapsing\n * description and action sections.\n *\n * Owns no store, presence or gesture state — the Notifier's render body drives\n * it by forwarding a `ref`, stacking style vars, pointer handlers and `onClose`\n * straight through to the `Root`. Rendered on its own it is just a status card\n * (e.g. a page-level alert). For a bespoke layout, compose the parts directly:\n * `Notification.Root`, `.Icon`, `.Title`, `.Description`, `.ActionTrigger`,\n * `.CloseTrigger`.\n *\n * **Announcements are the toaster's job, not the card's.** A toast spawned\n * through `createNotifier` is its own live region: `role=\"status\"`, or\n * `role=\"alert\"` for an `error`, set by the notifier as it renders the card.\n * A standalone card carries no role: rendered with the page it is content to\n * read, not news, and a live region there would only re-announce whatever it\n * holds on every mount. A card you insert in response to an event *is* news:\n * pass the role yourself (`role=\"status\"`, or `role=\"alert\"` for a failure)\n * and it lands on the `Root`, or mount it into a region that's already live.\n */\nfunction NotificationComponent({\n type,\n title,\n description,\n action,\n color: _color,\n icon: _icon,\n withCloseButton = true,\n withCollapse = false,\n defaultOpen,\n open: _open,\n onOpenChange,\n onClose,\n translations,\n icons: iconsProp,\n // Notifier-managed plumbing — not rendered onto the card.\n status: _status,\n duration: _duration,\n asChild: _asChild,\n ...rest\n}: NotificationProps) {\n const resolvedTranslations = { ...NOTIFICATION_DEFAULT_TRANSLATIONS, ...translations }\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n // `type` and `color` are exclusive (see `ToastHue`), and testing the destructured `type`\n // narrows `color` with it: no cast. The preset wins should a JS caller pass both anyway.\n const color = type === undefined ? _color : TOAST_STATUS[type].color\n // Not `??`: an explicit `icon={null}` (hide the glyph) must not fall\n // through to the preset the way an omitted (`undefined`) icon does.\n const icon = _icon === undefined ? type && icons[type] : _icon\n\n const [open, setOpen] = useUncontrolled({\n defaultValue: defaultOpen,\n value: _open,\n finalValue: match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => true)\n .with({ withCollapse: true }, () => false)\n .with({ withCollapse: false }, () => true)\n .exhaustive(),\n onChange: onOpenChange,\n })\n\n // Keep the last-present description / action mounted through their collapse so\n // each reveal has content to animate *out* (removed content unmounts instantly\n // otherwise). Cached independently so the two sections animate separately.\n const lastDescription = useRef(description)\n if (description != null) lastDescription.current = description\n const lastAction = useRef(action)\n if (action != null) lastAction.current = action\n\n return (\n <Root color={color} {...rest}>\n <div className=\"flex flex-row gap-3\">\n {icon != null && <Icon>{icon}</Icon>}\n {title != null && <Title>{title}</Title>}\n {match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => (\n <CloseTrigger aria-label={resolvedTranslations.closeTriggerLabel} onClick={onClose}>\n {icons.close}\n </CloseTrigger>\n ))\n .with({ withCollapse: true }, () => (\n <CollapseTrigger\n open={open}\n aria-label={\n open ? resolvedTranslations.collapseLabel : resolvedTranslations.expandLabel\n }\n onClick={() => setOpen(!open)}\n >\n <Turn open={open}>{icons.collapse}</Turn>\n </CollapseTrigger>\n ))\n .with({ withCollapse: false }, () => null)\n .exhaustive()}\n </div>\n {/* Description and action are independent Collapse sections. */}\n <Collapse open={description != null && open}>\n <Description>{description ?? lastDescription.current}</Description>\n </Collapse>\n <Collapse open={action != null && open}>\n <div className=\"mt-2 flex flex-wrap items-center gap-2\">{action ?? lastAction.current}</div>\n </Collapse>\n </Root>\n )\n}\n\n/**\n * `Notification` — the ready-made card (batteries-included), with the compound\n * parts attached for bespoke composition. Mirrors `Tooltip`/`Modal`: the bare\n * name is the convenience form; `.Root` and friends are the primitives.\n */\nexport const Notification = Object.assign(NotificationComponent, {\n Root,\n Icon,\n Title,\n Description,\n ActionTrigger,\n CloseTrigger,\n CollapseTrigger,\n})\n"]}
@@ -1,5 +1,5 @@
1
1
  import { props } from './chunk-WYCMIIRR.js';
2
- import { cn } from './chunk-QP4I37PA.js';
2
+ import { cn } from './chunk-4ASNIDV7.js';
3
3
  import { ark } from '@ark-ui/react';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import { jsx } from 'react/jsx-runtime';
@@ -74,5 +74,5 @@ var ButtonGroup = ({ className, orientation, testId, ...rest }) => /* @__PURE__
74
74
  );
75
75
 
76
76
  export { ButtonGroup, buttonGroupVariants };
77
- //# sourceMappingURL=chunk-2SVX3MQQ.js.map
78
- //# sourceMappingURL=chunk-2SVX3MQQ.js.map
77
+ //# sourceMappingURL=chunk-MW42XVPD.js.map
78
+ //# sourceMappingURL=chunk-MW42XVPD.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/button-group/button-group.tsx"],"names":[],"mappings":";;;;;;AA6CO,IAAM,mBAAA,GAAsB,GAAA;AAAA,EACjC;AAAA,IACE,mCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,IACA,kBAAA;AAAA,IACA,kDAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,WAAA,EAAa;AAAA,QACX,UAAA,EAAY;AAAA,UACV,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMA,oBAAA;AAAA,UACA,gIAAA;AAAA,UACA,8EAAA;AAAA,UACA,gCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMA,4FAAA;AAAA,UACA,2FAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKA;AAAA,SACF;AAAA,QACA,QAAA,EAAU;AAAA,UACR,UAAA;AAAA,UACA,8EAAA;AAAA,UACA,gCAAA;AAAA,UACA,4FAAA;AAAA,UACA,2FAAA;AAAA,UACA;AAAA;AACF;AACF,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,WAAA,EAAa,YAAA;AAAa;AAEjD;AAUO,IAAM,WAAA,GAAc,CAAC,EAAE,SAAA,EAAW,aAAa,MAAA,EAAQ,GAAG,MAAK,qBACpE,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IACC,IAAA,EAAK,OAAA;AAAA,IACL,oBAAkB,WAAA,IAAe,YAAA;AAAA,IACjC,WAAW,EAAA,CAAG,mBAAA,CAAoB,EAAE,WAAA,EAAa,GAAG,SAAS,CAAA;AAAA,IAC5D,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN","file":"chunk-2SVX3MQQ.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * ButtonGroup — joins a row (or column) of `Button` / `ActionIcon` siblings into\n * a single segmented control: the inner corners are flattened and adjacent\n * borders collapse to one hairline, so the children read as one unit (toolbars,\n * split actions, view switchers).\n *\n * Pure layout wrapper — a React Server Component like `Flex`. It deliberately\n * does NOT touch its children's props: give every child the same `size` (and\n * usually the same `variant` / `color`) so their edges align. `asChild` is\n * inherited from the `ark.div` factory.\n *\n * The join is done with arbitrary-variant selectors that target the children by\n * position *from the group itself*, rather than mutating each child's own\n * classes:\n * - They carry higher specificity than the child's own `rounded-*`, so they\n * win regardless of source order — and they sidestep the fact that plain\n * `tailwind-merge` doesn't recognise the custom `rounded-button` /\n * `rounded-action-icon` utilities (the overriding class never lands on the\n * child, so there's nothing to (fail to) merge).\n * - Only the inner corners are flattened; the outer corners keep whatever\n * radius each child already uses, so retheming still flows through.\n *\n * Adjacent borders overlap by 1px (`-ms-px` / `-mt-px`) into a single hairline\n * for the bordered `outline` / `light` / `default` variants. The borderless\n * `filled` / `subtle` variants (which have `border-transparent`, so there's\n * nothing to collapse) instead get an adaptive divider on both shared inner\n * edges: a translucent `currentColor` line, targeted via each child's\n * `data-variant`. Because it follows the text color it reads as a soft light\n * seam on a `filled` fill and a faint neutral one on `subtle`, correct on every\n * palette and in dark mode. It lives on both edges — not one — so both\n * neighbours carry the shared seam and it stays symmetric regardless of which\n * child is on top. `isolate` + a per-child `z-10` lift the hovered / focused\n * child above its neighbours, so its border (all four sides) and focus ring paint\n * over the shared edges rather than being covered by the neighbour that owns them.\n *\n * `orientation=\"horizontal\"` (default) flattens the inline edges — logical\n * `rounded-s` / `rounded-e` + `-ms`, so it flips correctly under RTL — while\n * `\"vertical\"` flattens the block edges.\n */\nexport const buttonGroupVariants = cva(\n [\n \"inline-flex isolate items-stretch\",\n // Overlapped borders stack in DOM order; lift the active child on hover and\n // focus so its own border (all four sides) and its focus ring paint above its\n // neighbours. Without the lift the shared edge stays owned by the neighbour on\n // top, so a hover/focus border change wouldn't show on that side. The\n // double-sided seam keeps the divider symmetric regardless of which is on top.\n \"*:relative\",\n \"[&>*:hover]:z-10\",\n \"[&>*:focus-visible]:z-10 [&>*:focus-within]:z-10\",\n // Border changes are instant inside a group. Button/ActionIcon animate\n // border-color (via `transition-colors-radius`), but `z-index` can't\n // transition — so on hover-out the lifted child snaps back while its border\n // is still mid-fade, flashing the shared seams. Keep the bg/text fade, drop\n // the border(-radius) transition. Targets the children via their data-variant.\n \"*:data-variant:[transition-property:color,background-color]\",\n ],\n {\n variants: {\n orientation: {\n horizontal: [\n \"flex-row\",\n // Equalize row heights to the tallest child. Buttons size themselves with\n // a fixed `h-*` (no vertical padding), which flexbox won't stretch — so\n // drop it (`h-auto`) and restore the size as a `min-height` floor keyed off\n // `data-size`, letting `items-stretch` grow shorter buttons to the tallest.\n // Same-size rows are unchanged; ActionIcon keeps its fixed square height.\n \"*:data-size:h-auto\",\n \"*:data-[size=xs]:min-h-7 *:data-[size=sm]:min-h-8 *:data-[size=md]:min-h-9 *:data-[size=lg]:min-h-10 *:data-[size=xl]:min-h-12\",\n \"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none\",\n \"[&>*:not(:first-child)]:-ms-px\",\n // Borderless variants have no border to collapse — draw an adaptive\n // currentColor seam on the shared inner edges instead. It goes on BOTH\n // sides (start of non-first, end of non-last) so whichever child ends\n // up on top after the z-10 hover/focus lift still owns a border on the\n // shared edge; a one-sided seam gets covered by the lifted child's fill.\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:first-child)]:border-s-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:last-child)]:border-e-current/20\",\n // The divider lives on the inline borders; zero the (transparent) block\n // borders so it has nothing to miter against — otherwise the seam's\n // top/bottom ends render as a 1px chamfer. box-sizing:border-box keeps\n // the height, so grouped filled/subtle stay aligned with bordered ones.\n \"[&>:is([data-variant=filled],[data-variant=subtle])]:border-y-0\",\n ],\n vertical: [\n \"flex-col\",\n \"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none\",\n \"[&>*:not(:first-child)]:-mt-px\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:first-child)]:border-t-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:last-child)]:border-b-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle])]:border-x-0\",\n ],\n },\n },\n defaultVariants: { orientation: \"horizontal\" },\n },\n)\n\nexport type ButtonGroupOrientation = NonNullable<\n VariantProps<typeof buttonGroupVariants>[\"orientation\"]\n>\n\nexport type ButtonGroupProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof buttonGroupVariants> &\n WithTestId\n\nexport const ButtonGroup = ({ className, orientation, testId, ...rest }: ButtonGroupProps) => (\n <ark.div\n role=\"group\"\n data-orientation={orientation ?? \"horizontal\"}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n"]}
1
+ {"version":3,"sources":["../src/components/button-group/button-group.tsx"],"names":[],"mappings":";;;;;;AA6CO,IAAM,mBAAA,GAAsB,GAAA;AAAA,EACjC;AAAA,IACE,mCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,IACA,kBAAA;AAAA,IACA,kDAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,WAAA,EAAa;AAAA,QACX,UAAA,EAAY;AAAA,UACV,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMA,oBAAA;AAAA,UACA,gIAAA;AAAA,UACA,8EAAA;AAAA,UACA,gCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMA,4FAAA;AAAA,UACA,2FAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKA;AAAA,SACF;AAAA,QACA,QAAA,EAAU;AAAA,UACR,UAAA;AAAA,UACA,8EAAA;AAAA,UACA,gCAAA;AAAA,UACA,4FAAA;AAAA,UACA,2FAAA;AAAA,UACA;AAAA;AACF;AACF,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,WAAA,EAAa,YAAA;AAAa;AAEjD;AAUO,IAAM,WAAA,GAAc,CAAC,EAAE,SAAA,EAAW,aAAa,MAAA,EAAQ,GAAG,MAAK,qBACpE,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IACC,IAAA,EAAK,OAAA;AAAA,IACL,oBAAkB,WAAA,IAAe,YAAA;AAAA,IACjC,WAAW,EAAA,CAAG,mBAAA,CAAoB,EAAE,WAAA,EAAa,GAAG,SAAS,CAAA;AAAA,IAC5D,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN","file":"chunk-MW42XVPD.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * ButtonGroup — joins a row (or column) of `Button` / `ActionIcon` siblings into\n * a single segmented control: the inner corners are flattened and adjacent\n * borders collapse to one hairline, so the children read as one unit (toolbars,\n * split actions, view switchers).\n *\n * Pure layout wrapper — a React Server Component like `Flex`. It deliberately\n * does NOT touch its children's props: give every child the same `size` (and\n * usually the same `variant` / `color`) so their edges align. `asChild` is\n * inherited from the `ark.div` factory.\n *\n * The join is done with arbitrary-variant selectors that target the children by\n * position *from the group itself*, rather than mutating each child's own\n * classes:\n * - They carry higher specificity than the child's own `rounded-*`, so they\n * win regardless of source order — and they sidestep the fact that plain\n * `tailwind-merge` doesn't recognise the custom `rounded-button` /\n * `rounded-action-icon` utilities (the overriding class never lands on the\n * child, so there's nothing to (fail to) merge).\n * - Only the inner corners are flattened; the outer corners keep whatever\n * radius each child already uses, so retheming still flows through.\n *\n * Adjacent borders overlap by 1px (`-ms-px` / `-mt-px`) into a single hairline\n * for the bordered `outline` / `light` / `default` variants. The borderless\n * `filled` / `subtle` variants (which have `border-transparent`, so there's\n * nothing to collapse) instead get an adaptive divider on both shared inner\n * edges: a translucent `currentColor` line, targeted via each child's\n * `data-variant`. Because it follows the text color it reads as a soft light\n * seam on a `filled` fill and a faint neutral one on `subtle`, correct on every\n * palette and in dark mode. It lives on both edges — not one — so both\n * neighbours carry the shared seam and it stays symmetric regardless of which\n * child is on top. `isolate` + a per-child `z-10` lift the hovered / focused\n * child above its neighbours, so its border (all four sides) and focus ring paint\n * over the shared edges rather than being covered by the neighbour that owns them.\n *\n * `orientation=\"horizontal\"` (default) flattens the inline edges — logical\n * `rounded-s` / `rounded-e` + `-ms`, so it flips correctly under RTL — while\n * `\"vertical\"` flattens the block edges.\n */\nexport const buttonGroupVariants = cva(\n [\n \"inline-flex isolate items-stretch\",\n // Overlapped borders stack in DOM order; lift the active child on hover and\n // focus so its own border (all four sides) and its focus ring paint above its\n // neighbours. Without the lift the shared edge stays owned by the neighbour on\n // top, so a hover/focus border change wouldn't show on that side. The\n // double-sided seam keeps the divider symmetric regardless of which is on top.\n \"*:relative\",\n \"[&>*:hover]:z-10\",\n \"[&>*:focus-visible]:z-10 [&>*:focus-within]:z-10\",\n // Border changes are instant inside a group. Button/ActionIcon animate\n // border-color (via `transition-colors-radius`), but `z-index` can't\n // transition — so on hover-out the lifted child snaps back while its border\n // is still mid-fade, flashing the shared seams. Keep the bg/text fade, drop\n // the border(-radius) transition. Targets the children via their data-variant.\n \"*:data-variant:[transition-property:color,background-color]\",\n ],\n {\n variants: {\n orientation: {\n horizontal: [\n \"flex-row\",\n // Equalize row heights to the tallest child. Buttons size themselves with\n // a fixed `h-*` (no vertical padding), which flexbox won't stretch — so\n // drop it (`h-auto`) and restore the size as a `min-height` floor keyed off\n // `data-size`, letting `items-stretch` grow shorter buttons to the tallest.\n // Same-size rows are unchanged; ActionIcon keeps its fixed square height.\n \"*:data-size:h-auto\",\n \"*:data-[size=xs]:min-h-7 *:data-[size=sm]:min-h-8 *:data-[size=md]:min-h-9 *:data-[size=lg]:min-h-10 *:data-[size=xl]:min-h-12\",\n \"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none\",\n \"[&>*:not(:first-child)]:-ms-px\",\n // Borderless variants have no border to collapse — draw an adaptive\n // currentColor seam on the shared inner edges instead. It goes on BOTH\n // sides (start of non-first, end of non-last) so whichever child ends\n // up on top after the z-10 hover/focus lift still owns a border on the\n // shared edge; a one-sided seam gets covered by the lifted child's fill.\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:first-child)]:border-s-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:last-child)]:border-e-current/20\",\n // The divider lives on the inline borders; zero the (transparent) block\n // borders so it has nothing to miter against — otherwise the seam's\n // top/bottom ends render as a 1px chamfer. box-sizing:border-box keeps\n // the height, so grouped filled/subtle stay aligned with bordered ones.\n \"[&>:is([data-variant=filled],[data-variant=subtle])]:border-y-0\",\n ],\n vertical: [\n \"flex-col\",\n \"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none\",\n \"[&>*:not(:first-child)]:-mt-px\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:first-child)]:border-t-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:last-child)]:border-b-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle])]:border-x-0\",\n ],\n },\n },\n defaultVariants: { orientation: \"horizontal\" },\n },\n)\n\nexport type ButtonGroupOrientation = NonNullable<\n VariantProps<typeof buttonGroupVariants>[\"orientation\"]\n>\n\nexport type ButtonGroupProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof buttonGroupVariants> &\n WithTestId\n\nexport const ButtonGroup = ({ className, orientation, testId, ...rest }: ButtonGroupProps) => (\n <ark.div\n role=\"group\"\n data-orientation={orientation ?? \"horizontal\"}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n"]}
@@ -1,14 +1,14 @@
1
1
  import { calendarValueToDate, dateToArkValue, fromArkValues, toArkValues } from './chunk-ZB5VMGKB.js';
2
2
  import { useTimeZone } from './chunk-IPYHTCFL.js';
3
- import { ActionIcon } from './chunk-LJ3GHC4V.js';
3
+ import { ActionIcon } from './chunk-BE2LWUHY.js';
4
4
  import { warnRenamedProp } from './chunk-6N6J2DOE.js';
5
5
  import { useIsomorphicLayoutEffect } from './chunk-BUIHQJGE.js';
6
- import { ChevronRightIcon, ChevronLeftIcon } from './chunk-ZFUTGBJC.js';
6
+ import { ChevronRightIcon, ChevronLeftIcon } from './chunk-6YNLRQ25.js';
7
7
  import { mergeIcons } from './chunk-XXOR34T4.js';
8
8
  import { props } from './chunk-WYCMIIRR.js';
9
- import { focusStyles } from './chunk-3REFDGOM.js';
9
+ import { focusStyles } from './chunk-C6NVU4F7.js';
10
10
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
11
- import { cn } from './chunk-QP4I37PA.js';
11
+ import { cn } from './chunk-4ASNIDV7.js';
12
12
  import { DatePicker, useDatePickerContext } from '@ark-ui/react/date-picker';
13
13
  import { useLocaleContext } from '@ark-ui/react/locale';
14
14
  import { useRef } from 'react';
@@ -422,5 +422,5 @@ var Calendar = ({
422
422
  };
423
423
 
424
424
  export { Calendar, CalendarBody, CalendarZoneSync, calendarGridWidth, hashArkValues, resolveCalendarTranslations };
425
- //# sourceMappingURL=chunk-S4TRYMCU.js.map
426
- //# sourceMappingURL=chunk-S4TRYMCU.js.map
425
+ //# sourceMappingURL=chunk-MXAACRWE.js.map
426
+ //# sourceMappingURL=chunk-MXAACRWE.js.map