@42-central/ui-react 0.18.2 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/dist/{chunk-YXE4B6X3.js → chunk-2NNZHVKD.js} +3 -3
  2. package/dist/{chunk-YXE4B6X3.js.map → chunk-2NNZHVKD.js.map} +1 -1
  3. package/dist/{chunk-5JHDSVEZ.js → chunk-4NNGTNPV.js} +10 -8
  4. package/dist/chunk-4NNGTNPV.js.map +1 -0
  5. package/dist/{chunk-7NZSTCJO.js → chunk-57BTVRRB.js} +4 -9
  6. package/dist/chunk-57BTVRRB.js.map +1 -0
  7. package/dist/{chunk-S2HWWR2H.js → chunk-64T6Z7BA.js} +3 -3
  8. package/dist/{chunk-S2HWWR2H.js.map → chunk-64T6Z7BA.js.map} +1 -1
  9. package/dist/{chunk-MI2WZRK3.js → chunk-A6MYJTJI.js} +4 -4
  10. package/dist/{chunk-MI2WZRK3.js.map → chunk-A6MYJTJI.js.map} +1 -1
  11. package/dist/{chunk-RQL7FVCS.js → chunk-BTFBBNRW.js} +11 -6
  12. package/dist/chunk-BTFBBNRW.js.map +1 -0
  13. package/dist/{chunk-OWG4BCQR.js → chunk-CYWMES5P.js} +4 -4
  14. package/dist/{chunk-OWG4BCQR.js.map → chunk-CYWMES5P.js.map} +1 -1
  15. package/dist/{chunk-YBJB7FGE.js → chunk-CZEKZ5HR.js} +6 -6
  16. package/dist/chunk-CZEKZ5HR.js.map +1 -0
  17. package/dist/{chunk-HAQJQFE6.js → chunk-DBTJEBMO.js} +11 -4
  18. package/dist/{chunk-HAQJQFE6.js.map → chunk-DBTJEBMO.js.map} +1 -1
  19. package/dist/{chunk-AE7QTLJ5.js → chunk-FAOBC4IS.js} +4 -4
  20. package/dist/{chunk-AE7QTLJ5.js.map → chunk-FAOBC4IS.js.map} +1 -1
  21. package/dist/{chunk-NF5JM2YO.js → chunk-FOMR74VE.js} +3 -3
  22. package/dist/{chunk-NF5JM2YO.js.map → chunk-FOMR74VE.js.map} +1 -1
  23. package/dist/{chunk-FZIHZT5R.js → chunk-GCGX4FEF.js} +16 -10
  24. package/dist/chunk-GCGX4FEF.js.map +1 -0
  25. package/dist/{chunk-B2YJKRNQ.js → chunk-HCYULRWT.js} +13 -9
  26. package/dist/chunk-HCYULRWT.js.map +1 -0
  27. package/dist/{chunk-B2LCHXUB.js → chunk-INJUILCN.js} +9 -4
  28. package/dist/chunk-INJUILCN.js.map +1 -0
  29. package/dist/{chunk-ZDXQ64A7.js → chunk-K5UWVH6P.js} +5 -5
  30. package/dist/{chunk-ZDXQ64A7.js.map → chunk-K5UWVH6P.js.map} +1 -1
  31. package/dist/{chunk-6GDMSENK.js → chunk-LM6F6DLR.js} +3 -24
  32. package/dist/chunk-LM6F6DLR.js.map +1 -0
  33. package/dist/{chunk-KHMFNH3X.js → chunk-MQO42HZL.js} +7 -7
  34. package/dist/chunk-MQO42HZL.js.map +1 -0
  35. package/dist/chunk-OC7I2CTA.js +8 -0
  36. package/dist/chunk-OC7I2CTA.js.map +1 -0
  37. package/dist/{chunk-O23Y5ML4.js → chunk-OGJFDNIS.js} +249 -231
  38. package/dist/chunk-OGJFDNIS.js.map +1 -0
  39. package/dist/{chunk-6OLTJYSX.js → chunk-PINENGML.js} +12 -5
  40. package/dist/chunk-PINENGML.js.map +1 -0
  41. package/dist/{chunk-NSDM3FEB.js → chunk-PS2PZFXH.js} +5 -3
  42. package/dist/chunk-PS2PZFXH.js.map +1 -0
  43. package/dist/{chunk-RAUOFTUH.js → chunk-QIDAXFKK.js} +4 -4
  44. package/dist/{chunk-RAUOFTUH.js.map → chunk-QIDAXFKK.js.map} +1 -1
  45. package/dist/{chunk-S7N4LGLZ.js → chunk-RIP5G47F.js} +4 -4
  46. package/dist/{chunk-S7N4LGLZ.js.map → chunk-RIP5G47F.js.map} +1 -1
  47. package/dist/{chunk-Z2Z5EXVT.js → chunk-RKYXG6X7.js} +3 -3
  48. package/dist/{chunk-Z2Z5EXVT.js.map → chunk-RKYXG6X7.js.map} +1 -1
  49. package/dist/{chunk-WQN64ZHG.js → chunk-SVKU3GUN.js} +10 -6
  50. package/dist/chunk-SVKU3GUN.js.map +1 -0
  51. package/dist/{chunk-FHG54IT5.js → chunk-TBTSEPGP.js} +13 -4
  52. package/dist/chunk-TBTSEPGP.js.map +1 -0
  53. package/dist/{chunk-HT5JAHR3.js → chunk-UJZIF2BA.js} +20 -9
  54. package/dist/chunk-UJZIF2BA.js.map +1 -0
  55. package/dist/{chunk-UHNRAI6V.js → chunk-VZBUQNLX.js} +68 -29
  56. package/dist/chunk-VZBUQNLX.js.map +1 -0
  57. package/dist/{chunk-JITF6I7N.js → chunk-WJOHNCYY.js} +11 -4
  58. package/dist/{chunk-JITF6I7N.js.map → chunk-WJOHNCYY.js.map} +1 -1
  59. package/dist/{chunk-EBREIC3L.js → chunk-YQHOKMSV.js} +26 -8
  60. package/dist/chunk-YQHOKMSV.js.map +1 -0
  61. package/dist/{chunk-WHKKN3ZK.js → chunk-YW6Q6ERX.js} +10 -8
  62. package/dist/chunk-YW6Q6ERX.js.map +1 -0
  63. package/dist/{chunk-PH354ECN.js → chunk-Z43YWH4R.js} +13 -4
  64. package/dist/chunk-Z43YWH4R.js.map +1 -0
  65. package/dist/{chunk-5OQLFX47.js → chunk-Z6RPMRFH.js} +3 -3
  66. package/dist/{chunk-5OQLFX47.js.map → chunk-Z6RPMRFH.js.map} +1 -1
  67. package/dist/{chunk-TCWYBVIL.js → chunk-ZB5VMGKB.js} +10 -7
  68. package/dist/chunk-ZB5VMGKB.js.map +1 -0
  69. package/dist/components/accordion/index.js +1 -1
  70. package/dist/components/action-icon/index.js +3 -3
  71. package/dist/components/alert/index.js +3 -3
  72. package/dist/components/app-shell/index.js +4 -4
  73. package/dist/components/autocomplete/autocomplete.d.ts +8 -1
  74. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  75. package/dist/components/autocomplete/index.d.ts +1 -1
  76. package/dist/components/autocomplete/index.d.ts.map +1 -1
  77. package/dist/components/autocomplete/index.js +10 -7
  78. package/dist/components/autocomplete/index.js.map +1 -1
  79. package/dist/components/badge/index.js +1 -1
  80. package/dist/components/button/index.js +3 -3
  81. package/dist/components/button-multi-select/index.js +5 -5
  82. package/dist/components/button-select/index.js +5 -5
  83. package/dist/components/calendar/calendar-zone-sync.d.ts +41 -0
  84. package/dist/components/calendar/calendar-zone-sync.d.ts.map +1 -0
  85. package/dist/components/calendar/calendar.d.ts +6 -5
  86. package/dist/components/calendar/calendar.d.ts.map +1 -1
  87. package/dist/components/calendar/index.js +8 -5
  88. package/dist/components/chart/chart.d.ts +17 -10
  89. package/dist/components/chart/chart.d.ts.map +1 -1
  90. package/dist/components/chart/index.js +50 -7
  91. package/dist/components/chart/index.js.map +1 -1
  92. package/dist/components/chart/styles.css +100 -0
  93. package/dist/components/checkbox/index.js +4 -4
  94. package/dist/components/choice-card-group/index.d.ts.map +1 -1
  95. package/dist/components/choice-card-group/index.js +4 -3
  96. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  97. package/dist/components/circular-progress/index.js.map +1 -1
  98. package/dist/components/clipboard/clipboard.d.ts.map +1 -1
  99. package/dist/components/clipboard/copy.d.ts.map +1 -1
  100. package/dist/components/clipboard/index.js +5 -5
  101. package/dist/components/clipboard/index.js.map +1 -1
  102. package/dist/components/code-block/chrome.js +4 -4
  103. package/dist/components/code-block/index.js +5 -5
  104. package/dist/components/combobox/combobox.d.ts +20 -1
  105. package/dist/components/combobox/combobox.d.ts.map +1 -1
  106. package/dist/components/combobox/index.d.ts +1 -1
  107. package/dist/components/combobox/index.d.ts.map +1 -1
  108. package/dist/components/combobox/index.js +4 -4
  109. package/dist/components/combobox-list/combobox-list.d.ts +8 -1
  110. package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
  111. package/dist/components/combobox-list/index.d.ts +1 -1
  112. package/dist/components/combobox-list/index.d.ts.map +1 -1
  113. package/dist/components/combobox-list/index.js +5 -5
  114. package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts.map +1 -1
  115. package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts +4 -1
  116. package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts.map +1 -1
  117. package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts +4 -1
  118. package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts.map +1 -1
  119. package/dist/components/data-table/data-table-filter/index.d.ts +5 -1
  120. package/dist/components/data-table/data-table-filter/index.d.ts.map +1 -1
  121. package/dist/components/data-table/data-table-header-cell.d.ts +11 -15
  122. package/dist/components/data-table/data-table-header-cell.d.ts.map +1 -1
  123. package/dist/components/data-table/data-table-meta.d.ts +2 -2
  124. package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
  125. package/dist/components/data-table/data-table-pagination.d.ts +3 -0
  126. package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
  127. package/dist/components/data-table/data-table-stack.d.ts +5 -2
  128. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  129. package/dist/components/data-table/data-table-toolbar.d.ts +3 -1
  130. package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
  131. package/dist/components/data-table/data-table-translations.d.ts +68 -0
  132. package/dist/components/data-table/data-table-translations.d.ts.map +1 -0
  133. package/dist/components/data-table/data-table.d.ts +5 -8
  134. package/dist/components/data-table/data-table.d.ts.map +1 -1
  135. package/dist/components/data-table/index.d.ts +2 -1
  136. package/dist/components/data-table/index.d.ts.map +1 -1
  137. package/dist/components/data-table/index.js +162 -79
  138. package/dist/components/data-table/index.js.map +1 -1
  139. package/dist/components/date-picker/date-picker.d.ts +13 -9
  140. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  141. package/dist/components/date-picker/index.js +16 -15
  142. package/dist/components/date-picker/index.js.map +1 -1
  143. package/dist/components/drawer/drawer.d.ts +9 -1
  144. package/dist/components/drawer/drawer.d.ts.map +1 -1
  145. package/dist/components/drawer/index.d.ts +1 -1
  146. package/dist/components/drawer/index.d.ts.map +1 -1
  147. package/dist/components/drawer/index.js +4 -4
  148. package/dist/components/field/field.d.ts +9 -2
  149. package/dist/components/field/field.d.ts.map +1 -1
  150. package/dist/components/field/index.js +1 -1
  151. package/dist/components/file-upload/file-upload.d.ts +13 -2
  152. package/dist/components/file-upload/file-upload.d.ts.map +1 -1
  153. package/dist/components/file-upload/index.d.ts +1 -1
  154. package/dist/components/file-upload/index.d.ts.map +1 -1
  155. package/dist/components/file-upload/index.js +16 -7
  156. package/dist/components/file-upload/index.js.map +1 -1
  157. package/dist/components/hover-card/index.js +1 -1
  158. package/dist/components/input/index.js +2 -2
  159. package/dist/components/kbd/index.js +1 -1
  160. package/dist/components/menu/index.js +2 -2
  161. package/dist/components/modal/index.d.ts +1 -1
  162. package/dist/components/modal/index.d.ts.map +1 -1
  163. package/dist/components/modal/index.js +4 -4
  164. package/dist/components/modal/modal.d.ts +9 -1
  165. package/dist/components/modal/modal.d.ts.map +1 -1
  166. package/dist/components/multi-combobox-list/index.d.ts +1 -1
  167. package/dist/components/multi-combobox-list/index.d.ts.map +1 -1
  168. package/dist/components/multi-combobox-list/index.js +7 -5
  169. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +8 -1
  170. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
  171. package/dist/components/multi-select/index.d.ts +1 -1
  172. package/dist/components/multi-select/index.d.ts.map +1 -1
  173. package/dist/components/multi-select/index.js +20 -9
  174. package/dist/components/multi-select/index.js.map +1 -1
  175. package/dist/components/multi-select/multi-select.d.ts +11 -1
  176. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  177. package/dist/components/nav-link/index.d.ts +1 -1
  178. package/dist/components/nav-link/index.d.ts.map +1 -1
  179. package/dist/components/nav-link/index.js +2 -2
  180. package/dist/components/nav-link/nav-link.d.ts +12 -0
  181. package/dist/components/nav-link/nav-link.d.ts.map +1 -1
  182. package/dist/components/nav-link/navigation.d.ts +3 -1
  183. package/dist/components/nav-link/navigation.d.ts.map +1 -1
  184. package/dist/components/nav-link/tanstack.js +2 -2
  185. package/dist/components/notification/create-notifier.d.ts +12 -1
  186. package/dist/components/notification/create-notifier.d.ts.map +1 -1
  187. package/dist/components/notification/index.d.ts +2 -2
  188. package/dist/components/notification/index.d.ts.map +1 -1
  189. package/dist/components/notification/index.js +9 -6
  190. package/dist/components/notification/index.js.map +1 -1
  191. package/dist/components/notification/notification.d.ts +14 -1
  192. package/dist/components/notification/notification.d.ts.map +1 -1
  193. package/dist/components/number-input/index.d.ts +1 -1
  194. package/dist/components/number-input/index.d.ts.map +1 -1
  195. package/dist/components/number-input/index.js +4 -4
  196. package/dist/components/number-input/number-input.d.ts +20 -2
  197. package/dist/components/number-input/number-input.d.ts.map +1 -1
  198. package/dist/components/overlays/index.js +6 -6
  199. package/dist/components/password-input/index.d.ts +1 -1
  200. package/dist/components/password-input/index.d.ts.map +1 -1
  201. package/dist/components/password-input/index.js +68 -7
  202. package/dist/components/password-input/index.js.map +1 -1
  203. package/dist/components/password-input/password-input.d.ts +45 -6
  204. package/dist/components/password-input/password-input.d.ts.map +1 -1
  205. package/dist/components/pill/index.js +2 -2
  206. package/dist/components/pills-input/index.js +5 -5
  207. package/dist/components/pin-input/index.js +2 -2
  208. package/dist/components/popover/index.js +1 -1
  209. package/dist/components/popover/popover.d.ts +0 -10
  210. package/dist/components/popover/popover.d.ts.map +1 -1
  211. package/dist/components/progress/index.js.map +1 -1
  212. package/dist/components/progress/progress.d.ts.map +1 -1
  213. package/dist/components/radio-group/index.js +3 -3
  214. package/dist/components/rating/index.js +2 -2
  215. package/dist/components/rating/index.js.map +1 -1
  216. package/dist/components/rating/rating.d.ts.map +1 -1
  217. package/dist/components/schedule/index.js +60 -48
  218. package/dist/components/schedule/index.js.map +1 -1
  219. package/dist/components/schedule/now-cursor-line.d.ts +10 -5
  220. package/dist/components/schedule/now-cursor-line.d.ts.map +1 -1
  221. package/dist/components/schedule/schedule-dates.d.ts +11 -26
  222. package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
  223. package/dist/components/schedule/schedule-event-chip.d.ts +4 -1
  224. package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
  225. package/dist/components/schedule/schedule-event-details.d.ts +3 -2
  226. package/dist/components/schedule/schedule-event-details.d.ts.map +1 -1
  227. package/dist/components/schedule/schedule-geometry.d.ts +20 -21
  228. package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
  229. package/dist/components/schedule/schedule-grid-gesture.d.ts +5 -9
  230. package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
  231. package/dist/components/schedule/schedule-segments.d.ts +2 -3
  232. package/dist/components/schedule/schedule-segments.d.ts.map +1 -1
  233. package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
  234. package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
  235. package/dist/components/segment-group/index.js +4 -3
  236. package/dist/components/segment-group/segment-group.d.ts +3 -2
  237. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  238. package/dist/components/select/index.d.ts +1 -1
  239. package/dist/components/select/index.d.ts.map +1 -1
  240. package/dist/components/select/index.js +6 -4
  241. package/dist/components/select/select.d.ts +12 -2
  242. package/dist/components/select/select.d.ts.map +1 -1
  243. package/dist/components/slider/index.js +2 -2
  244. package/dist/components/spinner/index.js +1 -1
  245. package/dist/components/spinner/spinner.d.ts.map +1 -1
  246. package/dist/components/switch/index.js +2 -2
  247. package/dist/components/table/index.js +1 -1
  248. package/dist/components/table/table.d.ts.map +1 -1
  249. package/dist/components/tabs/index.js +4 -3
  250. package/dist/components/tabs/tabs.d.ts +3 -1
  251. package/dist/components/tabs/tabs.d.ts.map +1 -1
  252. package/dist/components/tags-input/index.d.ts +1 -1
  253. package/dist/components/tags-input/index.d.ts.map +1 -1
  254. package/dist/components/tags-input/index.js +9 -7
  255. package/dist/components/tags-input/index.js.map +1 -1
  256. package/dist/components/tags-input/tags-input.d.ts +9 -2
  257. package/dist/components/tags-input/tags-input.d.ts.map +1 -1
  258. package/dist/components/text-input/index.js +2 -2
  259. package/dist/components/textarea/index.js +2 -2
  260. package/dist/components/theme-icon/index.js +2 -2
  261. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  262. package/dist/components/time-input/index.js +24 -8
  263. package/dist/components/time-input/index.js.map +1 -1
  264. package/dist/components/time-input/time-input.d.ts.map +1 -1
  265. package/dist/components/time-input/time-row.d.ts +16 -3
  266. package/dist/components/time-input/time-row.d.ts.map +1 -1
  267. package/dist/components/timeline/index.js +6 -3
  268. package/dist/components/timeline/index.js.map +1 -1
  269. package/dist/components/timeline/timeline.d.ts.map +1 -1
  270. package/dist/components/tooltip/index.js +2 -2
  271. package/dist/components/tree-multi-select/index.d.ts +1 -1
  272. package/dist/components/tree-multi-select/index.d.ts.map +1 -1
  273. package/dist/components/tree-multi-select/index.js +62 -44
  274. package/dist/components/tree-multi-select/index.js.map +1 -1
  275. package/dist/components/tree-multi-select/tree-multi-select.d.ts +10 -1
  276. package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
  277. package/dist/components/tree-select/index.d.ts +1 -1
  278. package/dist/components/tree-select/index.d.ts.map +1 -1
  279. package/dist/components/tree-select/index.js +45 -15
  280. package/dist/components/tree-select/index.js.map +1 -1
  281. package/dist/components/tree-select/tree-select.d.ts +10 -1
  282. package/dist/components/tree-select/tree-select.d.ts.map +1 -1
  283. package/dist/index.js +3 -2
  284. package/dist/index.js.map +1 -1
  285. package/dist/lib/date-value.d.ts +14 -1
  286. package/dist/lib/date-value.d.ts.map +1 -1
  287. package/dist/lib/focus-styles.d.ts +13 -5
  288. package/dist/lib/focus-styles.d.ts.map +1 -1
  289. package/dist/theme.css +1 -2
  290. package/package.json +1 -1
  291. package/src/components/autocomplete/autocomplete.test.tsx +32 -0
  292. package/src/components/autocomplete/autocomplete.tsx +17 -5
  293. package/src/components/autocomplete/index.ts +5 -1
  294. package/src/components/button/button.test.tsx +6 -0
  295. package/src/components/calendar/calendar-zone-sync.tsx +79 -0
  296. package/src/components/calendar/calendar.test.tsx +134 -14
  297. package/src/components/calendar/calendar.tsx +36 -22
  298. package/src/components/chart/chart.test.tsx +115 -8
  299. package/src/components/chart/chart.tsx +115 -25
  300. package/src/components/chart/styles.css +100 -0
  301. package/src/components/choice-card-group/index.ts +2 -0
  302. package/src/components/circular-progress/circular-progress.tsx +2 -0
  303. package/src/components/clipboard/clipboard.test.tsx +54 -22
  304. package/src/components/clipboard/clipboard.tsx +2 -0
  305. package/src/components/clipboard/copy.tsx +2 -0
  306. package/src/components/clipboard/index.ts +3 -3
  307. package/src/components/combobox/combobox.test.tsx +22 -0
  308. package/src/components/combobox/combobox.tsx +20 -0
  309. package/src/components/combobox/index.ts +1 -0
  310. package/src/components/combobox-list/combobox-list.test.tsx +19 -0
  311. package/src/components/combobox-list/combobox-list.tsx +16 -2
  312. package/src/components/combobox-list/index.ts +5 -1
  313. package/src/components/data-table/data-table-filter/data-table-date-filter.tsx +5 -4
  314. package/src/components/data-table/data-table-filter/data-table-number-filter.tsx +16 -2
  315. package/src/components/data-table/data-table-filter/data-table-select-filter.tsx +9 -1
  316. package/src/components/data-table/data-table-filter/index.tsx +15 -1
  317. package/src/components/data-table/data-table-filter.test.tsx +33 -0
  318. package/src/components/data-table/data-table-header-cell.tsx +37 -22
  319. package/src/components/data-table/data-table-meta.ts +2 -2
  320. package/src/components/data-table/data-table-pagination.tsx +6 -0
  321. package/src/components/data-table/data-table-stack.tsx +26 -14
  322. package/src/components/data-table/data-table-toolbar.tsx +4 -1
  323. package/src/components/data-table/data-table-translations.ts +105 -0
  324. package/src/components/data-table/data-table.test.tsx +121 -0
  325. package/src/components/data-table/data-table.tsx +37 -17
  326. package/src/components/data-table/index.ts +9 -1
  327. package/src/components/date-picker/date-picker.test.tsx +197 -5
  328. package/src/components/date-picker/date-picker.tsx +42 -16
  329. package/src/components/drawer/drawer.tsx +14 -1
  330. package/src/components/drawer/index.ts +1 -0
  331. package/src/components/field/field.tsx +29 -3
  332. package/src/components/file-upload/file-upload.test.tsx +21 -0
  333. package/src/components/file-upload/file-upload.tsx +26 -3
  334. package/src/components/file-upload/index.ts +1 -1
  335. package/src/components/modal/index.ts +1 -0
  336. package/src/components/modal/modal-translations.test.tsx +27 -0
  337. package/src/components/modal/modal.tsx +14 -1
  338. package/src/components/multi-combobox-list/index.ts +5 -1
  339. package/src/components/multi-combobox-list/multi-combobox-list.test.tsx +19 -0
  340. package/src/components/multi-combobox-list/multi-combobox-list.tsx +26 -4
  341. package/src/components/multi-select/index.ts +1 -1
  342. package/src/components/multi-select/multi-select.test.tsx +38 -0
  343. package/src/components/multi-select/multi-select.tsx +28 -4
  344. package/src/components/nav-link/index.ts +6 -1
  345. package/src/components/nav-link/nav-link.test.tsx +16 -0
  346. package/src/components/nav-link/nav-link.tsx +19 -1
  347. package/src/components/nav-link/navigation.test.tsx +18 -0
  348. package/src/components/nav-link/navigation.tsx +8 -4
  349. package/src/components/notification/create-notifier.tsx +20 -4
  350. package/src/components/notification/index.ts +7 -1
  351. package/src/components/notification/notification.test.tsx +49 -0
  352. package/src/components/notification/notification.tsx +39 -5
  353. package/src/components/number-input/index.ts +1 -1
  354. package/src/components/number-input/number-input.test.tsx +37 -0
  355. package/src/components/number-input/number-input.tsx +33 -4
  356. package/src/components/password-input/index.ts +5 -1
  357. package/src/components/password-input/password-input.test.tsx +201 -4
  358. package/src/components/password-input/password-input.tsx +162 -13
  359. package/src/components/popover/popover.tsx +0 -29
  360. package/src/components/progress/index.ts +3 -3
  361. package/src/components/progress/progress.tsx +2 -0
  362. package/src/components/rating/rating.tsx +2 -0
  363. package/src/components/schedule/now-cursor-line.test.tsx +56 -28
  364. package/src/components/schedule/now-cursor-line.tsx +30 -16
  365. package/src/components/schedule/schedule-agenda-view.test.tsx +1 -1
  366. package/src/components/schedule/schedule-dates.test.ts +19 -0
  367. package/src/components/schedule/schedule-dates.ts +16 -30
  368. package/src/components/schedule/schedule-details-popover.test.tsx +77 -6
  369. package/src/components/schedule/schedule-event-chip.tsx +17 -6
  370. package/src/components/schedule/schedule-event-details.test.tsx +38 -0
  371. package/src/components/schedule/schedule-event-details.tsx +7 -5
  372. package/src/components/schedule/schedule-geometry.test.ts +21 -18
  373. package/src/components/schedule/schedule-geometry.ts +37 -24
  374. package/src/components/schedule/schedule-grid-gesture.ts +5 -9
  375. package/src/components/schedule/schedule-segments.ts +2 -3
  376. package/src/components/schedule/schedule-timed-grid.tsx +43 -20
  377. package/src/components/schedule/schedule.test.tsx +34 -11
  378. package/src/components/schedule/use-event-resize.ts +6 -13
  379. package/src/components/segment-group/segment-group.test.tsx +23 -0
  380. package/src/components/segment-group/segment-group.tsx +13 -7
  381. package/src/components/select/index.ts +1 -1
  382. package/src/components/select/select.test.tsx +32 -0
  383. package/src/components/select/select.tsx +15 -1
  384. package/src/components/spinner/spinner.test.tsx +26 -0
  385. package/src/components/spinner/spinner.tsx +4 -1
  386. package/src/components/table/table.test.tsx +13 -0
  387. package/src/components/table/table.tsx +9 -5
  388. package/src/components/tabs/tabs.test.tsx +11 -0
  389. package/src/components/tabs/tabs.tsx +6 -4
  390. package/src/components/tags-input/index.ts +1 -1
  391. package/src/components/tags-input/tags-input.test.tsx +28 -0
  392. package/src/components/tags-input/tags-input.tsx +17 -1
  393. package/src/components/theme-icon/theme-icon.tsx +8 -3
  394. package/src/components/time-input/time-input.test.tsx +75 -0
  395. package/src/components/time-input/time-input.tsx +27 -3
  396. package/src/components/time-input/time-row.tsx +27 -3
  397. package/src/components/timeline/timeline.tsx +6 -3
  398. package/src/components/tree-multi-select/index.ts +5 -1
  399. package/src/components/tree-multi-select/tree-multi-select.test.tsx +72 -0
  400. package/src/components/tree-multi-select/tree-multi-select.tsx +156 -115
  401. package/src/components/tree-select/index.ts +1 -1
  402. package/src/components/tree-select/tree-select.test.tsx +69 -0
  403. package/src/components/tree-select/tree-select.tsx +128 -74
  404. package/src/lib/date-value.test.ts +19 -0
  405. package/src/lib/date-value.ts +21 -5
  406. package/src/lib/focus-styles.test.ts +21 -2
  407. package/src/lib/focus-styles.ts +24 -5
  408. package/src/theme.css +1 -2
  409. package/src/use-client-barrels.test.ts +80 -0
  410. package/dist/chunk-5JHDSVEZ.js.map +0 -1
  411. package/dist/chunk-6GDMSENK.js.map +0 -1
  412. package/dist/chunk-6OLTJYSX.js.map +0 -1
  413. package/dist/chunk-7NZSTCJO.js.map +0 -1
  414. package/dist/chunk-B2LCHXUB.js.map +0 -1
  415. package/dist/chunk-B2YJKRNQ.js.map +0 -1
  416. package/dist/chunk-EBREIC3L.js.map +0 -1
  417. package/dist/chunk-FHG54IT5.js.map +0 -1
  418. package/dist/chunk-FZIHZT5R.js.map +0 -1
  419. package/dist/chunk-HT5JAHR3.js.map +0 -1
  420. package/dist/chunk-KHMFNH3X.js.map +0 -1
  421. package/dist/chunk-NSDM3FEB.js.map +0 -1
  422. package/dist/chunk-O23Y5ML4.js.map +0 -1
  423. package/dist/chunk-PH354ECN.js.map +0 -1
  424. package/dist/chunk-RQL7FVCS.js.map +0 -1
  425. package/dist/chunk-TCWYBVIL.js.map +0 -1
  426. package/dist/chunk-UHNRAI6V.js.map +0 -1
  427. package/dist/chunk-WHKKN3ZK.js.map +0 -1
  428. package/dist/chunk-WQN64ZHG.js.map +0 -1
  429. package/dist/chunk-YBJB7FGE.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/notification/store.ts","../../../src/components/notification/create-notifier.tsx"],"names":["promise","max"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,IAAM,kBAAmC,MAAA,CAAO,MAAA,CAAO,EAAE,MAAA,EAAQ,IAAI,CAAA;AAI9D,SAAS,gBAAA,CAAiB,MAAA,GAA0B,EAAE,GAAA,EAAK,GAAE,EAAe;AACjF,EAAA,IAAI,KAAA,GAAyB,EAAE,MAAA,EAAQ,EAAC,EAAE;AAC1C,EAAA,MAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,EAAA,MAAM,MAAA,uBAAa,GAAA,EAAoB;AAC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EAAY,QAAA,EAAA,MAAA,EAAO,CAAA;AAAA,EACpF,CAAA;AAEA,EAAA,OAAO,EAAE,QAAQ,aAAA,EAAc;AACjC","file":"index.js","sourcesContent":["import type { ToastData, ToastId } from \"./types\"\n\n/**\n * Framework-agnostic toast store — a tiny vanilla pub/sub modelled on the kit's\n * overlay store (`components/overlays/store.ts`). Holds the live toast stack;\n * the React renderer (`Notifications`) subscribes via `useSyncExternalStore`,\n * and the bound `notify` controller wraps its mutators. No React here, so it's\n * safe to call from anywhere (event handlers, utils).\n *\n * Every mutation produces a fresh `state` + `toasts` array, so `getSnapshot`\n * returns a stable reference between mutations — the contract\n * `useSyncExternalStore` relies on to avoid tearing / render loops.\n *\n * Auto-dismiss timers live here (plain `setTimeout`), with remaining-time\n * bookkeeping so `pauseAll`/`resumeAll` (driven by the renderer on hover /\n * tab-hidden) can freeze and resume them. DOM listeners do NOT live here.\n */\n\nexport interface ToastStoreState {\n toasts: ToastData[]\n}\n\nexport interface ToastStore {\n subscribe: (listener: () => void) => () => void\n getSnapshot: () => ToastStoreState\n getServerSnapshot: () => ToastStoreState\n /** Upsert by id: a new id prepends (and starts its timer); an existing id\n * merges in place and restarts its timer (used for status transitions). */\n create: (data: ToastData) => ToastId\n /** Shallow-merge a patch into a live toast without touching its timer/status. */\n update: (id: ToastId, patch: Partial<ToastData>) => void\n /** Flip a toast to `dismissing` so its exit animation plays (all if no id). */\n dismiss: (id?: ToastId) => void\n /** Hard-remove a toast — called once its exit animation completes. */\n remove: (id: ToastId) => void\n /** Freeze every auto-dismiss timer (hover / tab hidden). */\n pauseAll: () => void\n /** Resume every frozen timer from its remaining time. */\n resumeAll: () => void\n has: (id: ToastId) => boolean\n}\n\n/** Frozen, module-stable empty stack for SSR — toasts are runtime-only, so the\n * server snapshot is always empty and matches the client's first render. */\nconst SERVER_SNAPSHOT: ToastStoreState = Object.freeze({ toasts: [] })\n\ntype Timer = { remaining: number; startedAt: number; handle: ReturnType<typeof setTimeout> | null }\n\nexport function createToastStore(config: { max: number } = { max: 5 }): ToastStore {\n let state: ToastStoreState = { toasts: [] }\n const listeners = new Set<() => void>()\n const timers = new Map<ToastId, Timer>()\n let paused = false\n\n const emit = () => {\n for (const listener of listeners) listener()\n }\n const set = (toasts: ToastData[]) => {\n state = { toasts }\n emit()\n }\n\n const clearTimer = (id: ToastId) => {\n const timer = timers.get(id)\n if (timer?.handle) clearTimeout(timer.handle)\n timers.delete(id)\n }\n\n const startTimer = (id: ToastId, duration: number) => {\n clearTimer(id)\n if (!Number.isFinite(duration)) return // loading / sticky toasts never expire\n const timer: Timer = { remaining: duration, startedAt: Date.now(), handle: null }\n if (!paused) timer.handle = setTimeout(() => dismiss(id), duration)\n timers.set(id, timer)\n }\n\n const dismiss: ToastStore[\"dismiss\"] = (id) => {\n if (id == null) {\n for (const toast of state.toasts) clearTimer(toast.id)\n set(state.toasts.map((t) => (t.status === \"open\" ? { ...t, status: \"dismissing\" } : t)))\n return\n }\n if (!state.toasts.some((t) => t.id === id)) return\n clearTimer(id)\n set(state.toasts.map((t) => (t.id === id ? { ...t, status: \"dismissing\" } : t)))\n }\n\n return {\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n getSnapshot() {\n return state\n },\n getServerSnapshot() {\n return SERVER_SNAPSHOT\n },\n create(data) {\n const exists = state.toasts.some((t) => t.id === data.id)\n if (exists) {\n set(state.toasts.map((t) => (t.id === data.id ? { ...t, ...data } : t)))\n } else {\n // Newest first (index 0 = front). Cap the number of *open* toasts at\n // `max` by dismissing the oldest beyond the limit.\n const next = [data, ...state.toasts]\n const open = next.filter((t) => t.status === \"open\")\n if (open.length > config.max) {\n const overflow = new Set(open.slice(config.max).map((t) => t.id))\n for (const id of overflow) clearTimer(id)\n set(next.map((t) => (overflow.has(t.id) ? { ...t, status: \"dismissing\" } : t)))\n } else {\n set(next)\n }\n }\n startTimer(data.id, data.duration)\n return data.id\n },\n update(id, patch) {\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.map((t) => (t.id === id ? { ...t, ...patch } : t)))\n },\n dismiss,\n remove(id) {\n clearTimer(id)\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.filter((t) => t.id !== id))\n },\n pauseAll() {\n if (paused) return\n paused = true\n const now = Date.now()\n for (const timer of timers.values()) {\n if (!timer.handle) continue\n clearTimeout(timer.handle)\n timer.remaining -= now - timer.startedAt\n timer.handle = null\n }\n },\n resumeAll() {\n if (!paused) return\n paused = false\n const now = Date.now()\n for (const [id, timer] of timers) {\n if (timer.remaining <= 0) {\n dismiss(id)\n continue\n }\n timer.startedAt = now\n timer.handle = setTimeout(() => dismiss(id), timer.remaining)\n }\n },\n has(id) {\n return state.toasts.some((t) => t.id === id)\n },\n }\n}\n","\"use client\"\n\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresence } from \"@ark-ui/react/presence\"\nimport { customAlphabet } from \"nanoid\"\nimport {\n isValidElement,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\"\nimport type { UnavailableProps } from \"../../lib/available-if\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { Notification } from \"./notification\"\nimport { createToastStore, type ToastStore } from \"./store\"\nimport type { ColorWithTypeReason, ToastData, ToastHue, ToastId, ToastType } from \"./types\"\n\n/**\n * `createNotifier` — the imperative toast manager, modelled on the kit's\n * `createOverlays` (a framework-agnostic `useSyncExternalStore` store + a\n * once-mounted renderer + a bound controller).\n *\n * ```tsx\n * // notifier.ts — one instance for the app\n * export const { notify, Notifications } = createNotifier({ placement: \"bottom-end\" })\n *\n * // app root — mount the region once\n * <Notifications />\n *\n * // anywhere\n * notify(\"Copied to clipboard\") // neutral / custom toast\n * notify.success(\"Saved\")\n * notify.error({ title: \"Upload failed\", action: { label: \"Retry\", onClick: retry } })\n * notify.promise(save(), { loading: \"Saving…\", success: \"Saved\", error: \"Failed\" })\n *\n * const id = notify.loading(\"Uploading…\") // keep the id to update it\n * notify.update(id, { description: \"Halfway…\" }) // patch in place\n * notify.success({ id, title: \"Uploaded\" }) // …or transition its status\n * ```\n */\n\nexport type NotifyPlacement =\n | \"top-start\"\n | \"top\"\n | \"top-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"bottom-end\"\n\n/** The fields every toast input shares. A bare `ReactNode` (string/element)\n * is shorthand for `{ title }`. */\ntype NotifyFields = {\n title?: ReactNode\n description?: ReactNode\n /** ms until auto-dismiss. Omit for the notifier default; `loading` never\n * auto-dismisses. */\n duration?: number\n /** Provide to update/dedupe an existing toast (mint via a returned id, or\n * cast your own: `\"upload\" as ToastId`). */\n id?: ToastId\n /** Render a close button. @default true */\n withCloseButton?: boolean\n /** The action section — any `ReactNode` (e.g. an Undo `Notification.ActionTrigger`),\n * revealed independently of the description. */\n action?: ReactNode\n /** Custom leading glyph; `null` hides the default status icon. */\n icon?: ReactNode | null\n}\n\n/** Full options for a neutral `notify(...)` toast — the one call with no\n * status, so the one that takes a `color`. */\nexport type NotifyOptions = NotifyFields & {\n /** Accent palette for a custom toast. */\n color?: Color\n}\n\n/** Options for a status helper (`notify.success(...)`, …). The status sets\n * the hue, so `color` is refused — see `ToastHue`. */\nexport type NotifyStatusOptions = NotifyFields &\n UnavailableProps<Pick<NotifyOptions, \"color\">, ColorWithTypeReason>\n\n/** Options for `notify.update`. It keeps the toast's status and hue, so\n * `color` is refused; re-call `notify({ id, color })` to recolor. */\nexport type NotifyUpdateOptions = NotifyFields &\n UnavailableProps<\n Pick<NotifyOptions, \"color\">,\n \"`update` keeps the hue — re-call `notify({ id, color })` to recolor\"\n >\n\nexport type NotifyInput = ReactNode | NotifyOptions\nexport type NotifyStatusInput = ReactNode | NotifyStatusOptions\nexport type NotifyUpdateInput = ReactNode | NotifyUpdateOptions\n\nexport type CreateNotifierOptions = {\n /** Corner/edge the stack anchors to. @default \"bottom-end\" */\n placement?: NotifyPlacement\n /** Max toasts on screen before the oldest is dismissed. @default 5 */\n max?: number\n /** Default auto-dismiss duration (ms). @default 5000 */\n duration?: number\n /** Expand the collapsed deck into a column on hover/focus. @default true */\n expand?: boolean\n /** Render the region in a Portal (escape clipping ancestors). @default true */\n withinPortal?: boolean\n /** Portal target. @default document.body */\n container?: HTMLElement | null\n}\n\ntype StatusFn = (input: NotifyStatusInput) => ToastId\n\n/** The `promise` sugar: a single toast tracking an async lifecycle. */\nexport type NotifyPromise = <T>(\n promise: Promise<T> | (() => Promise<T>),\n messages: {\n loading: NotifyStatusInput\n success?: NotifyStatusInput | ((value: T) => NotifyStatusInput)\n error?: NotifyStatusInput | ((error: unknown) => NotifyStatusInput)\n },\n) => { id: ToastId; unwrap: () => Promise<T> }\n\n/** Patch a live toast by id, accepting the same shorthand. Only the fields you\n * pass change (title/description/icon/duration/withCloseButton);\n * status/type and the hue are preserved. To change status, re-call a status helper with\n * the same `id` (e.g. `notify.success({ id })`). */\nexport type NotifyUpdate = (id: ToastId, input: NotifyUpdateInput) => ToastId\n\n/** The bound controller. Callable for a neutral toast; status helpers +\n * `promise` + `update` + `dismiss`/`remove` on top. */\nexport type Notify = ((input: NotifyInput) => ToastId) & {\n success: StatusFn\n error: StatusFn\n warning: StatusFn\n info: StatusFn\n loading: StatusFn\n promise: NotifyPromise\n update: NotifyUpdate\n /** Dismiss a toast (plays its exit); all toasts if no id. */\n dismiss: (id?: ToastId) => void\n /** Immediately remove a toast (no exit animation). */\n remove: (id: ToastId) => void\n /** Whether a toast with this id is still live (open or dismissing). */\n has: (id: ToastId) => boolean\n /** Snapshot of the live toasts (advanced / testing). */\n getToasts: () => ToastData[]\n}\n\nexport type Notifier = {\n notify: Notify\n Notifications: () => ReactNode\n}\n\n/** A bare node (string/number/element/array) is a title; any other object is\n * a full `NotifyOptions`. */\n/** Any of the three option shapes; they differ only in whether `color` is accepted. */\ntype AnyOptions = NotifyOptions | NotifyStatusOptions | NotifyUpdateOptions\n\nconst isOptions = <O extends AnyOptions>(input: ReactNode | O): input is O =>\n input != null && typeof input === \"object\" && !isValidElement(input) && !Array.isArray(input)\n\nconst nanoid = customAlphabet(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\", 8)\n/** Mint a branded `ToastId` (the one place a plain string becomes a `ToastId`). */\nconst generateId = (): ToastId => nanoid() as ToastId\n\n/** px gap between toasts when the stack is expanded. */\nconst GAP = 12\n\n/** Region positioning (fixed + anchored edge) per placement. The stacking\n * geometry itself lives in theme.css, keyed on `data-placement`. `start`/`end`\n * are logical insets, so they follow the document's `dir` (end = left in RTL). */\nconst REGION_POSITION = {\n \"top-start\": \"top-4 inset-s-4\",\n top: \"top-4 left-1/2 -translate-x-1/2\",\n \"top-end\": \"top-4 inset-e-4\",\n \"bottom-start\": \"bottom-4 inset-s-4\",\n bottom: \"bottom-4 left-1/2 -translate-x-1/2\",\n \"bottom-end\": \"bottom-4 inset-e-4\",\n} as const satisfies Record<NotifyPlacement, string>\n/** Fields `notify.update` copies from the input onto a live toast — the keys\n * shared by `NotifyOptions` and `ToastData` (excludes `id`/`status`/`type`). */\nconst NOTIFICATION_REMOVABLE_PROPS = [\n \"title\",\n \"description\",\n \"action\",\n \"icon\",\n \"duration\",\n \"withCloseButton\",\n] as const satisfies (keyof NotifyUpdateOptions & keyof ToastData)[]\n\n/** px a pointer must travel to count as a dismiss-swipe. */\nconst SWIPE_THRESHOLD = 60\n/** px of movement under which a press counts as a click (→ dismiss). */\nconst CLICK_SLOP = 5\n\ntype ToasterItemProps = {\n toast: ToastData\n store: ToastStore\n /** Position from the front (0 = newest). */\n index: number\n /** Σ heights + gaps of the newer toasts in front (expanded-column offset), px. */\n offset: number\n /** This toast's measured height, px. */\n height: number\n /** The front toast's height, px (for top-aligned collapsed peeks). */\n frontHeight: number\n onMeasure: (id: string, height: number) => void\n}\n\n/**\n * A single live toast inside the stack. Owns the toaster behavior the card\n * itself stays free of — enter/exit via Ark Presence, height measurement for the\n * stacking layout, and swipe/click-to-dismiss — then renders the presentational\n * `Notification`, forwarding the merged ref, stacking style vars and gesture\n * handlers straight onto its `Root`.\n */\nfunction ToasterItem({\n toast,\n store,\n index,\n offset,\n height,\n frontHeight,\n onMeasure,\n}: ToasterItemProps) {\n const { id } = toast\n // The store keeps `type` and `color` side by side; the card takes one or the\n // other. At most one is ever set (see `toData`), so pick whichever is.\n const { type, color, ...fields } = toast\n const hue: ToastHue = type ? { type } : { color }\n\n const presence = usePresence({\n present: toast.status === \"open\",\n lazyMount: true,\n unmountOnExit: true,\n onExitComplete: () => store.remove(id),\n })\n\n // Report the card's natural height so the renderer can lay out the stack.\n const measureRef = useRef<HTMLDivElement | null>(null)\n useEffect(() => {\n const node = measureRef.current\n if (!node) return\n onMeasure(id, node.offsetHeight)\n const observer = new ResizeObserver(() => onMeasure(id, node.offsetHeight))\n observer.observe(node)\n return () => observer.disconnect()\n }, [id, onMeasure])\n\n // Swipe / click to dismiss. Dragging past the threshold flicks the toast away\n // (`--swipe-x`/`--swipe-opacity` track the pointer, transition off for 1:1);\n // a click that barely moves dismisses too. Presses that start on an\n // interactive child (close / action) are left to that control.\n const drag = useRef<{ startX: number; interactive: boolean } | null>(null)\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return\n const interactive =\n (event.target as Element).closest(\"button, a, input, [role='button']\") != null\n drag.current = { startX: event.clientX, interactive }\n if (!interactive) event.currentTarget.setPointerCapture(event.pointerId)\n }\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"none\"\n el.style.setProperty(\"--swipe-x\", `${dx}px`)\n el.style.setProperty(\"--swipe-opacity\", `${Math.max(0.15, 1 - Math.abs(dx) / 240)}`)\n }\n const onPointerEnd = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n drag.current = null\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"\"\n if (Math.abs(dx) > SWIPE_THRESHOLD || Math.abs(dx) < CLICK_SLOP) {\n store.dismiss(id)\n } else {\n el.style.setProperty(\"--swipe-x\", \"0px\")\n el.style.setProperty(\"--swipe-opacity\", \"1\")\n }\n }\n\n if (presence.unmounted) return null\n\n return (\n <Notification\n ref={mergeRefs(presence.ref, measureRef)}\n {...fields}\n {...hue}\n {...presence.getPresenceProps()}\n data-part=\"toast\"\n onClose={() => store.dismiss(id)}\n // `cursor-grab` lives here (not in the shared cva) so only swipeable\n // toaster toasts show it — a standalone `Notification.Root` doesn't.\n className=\"cursor-grab touch-none select-none active:cursor-grabbing\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerEnd}\n onPointerCancel={onPointerEnd}\n style={{\n [\"--index\" as string]: index,\n [\"--offset\" as string]: `${offset}px`,\n [\"--height\" as string]: `${height}px`,\n [\"--front-height\" as string]: `${frontHeight}px`,\n }}\n />\n )\n}\n\nexport function createNotifier(options: CreateNotifierOptions = {}): Notifier {\n const {\n placement = \"bottom-end\",\n max = 5,\n duration: defaultDuration = 5000,\n expand = true,\n withinPortal = true,\n container,\n } = options\n\n const store = createToastStore({ max })\n\n // Generic so each call site keeps its own shape (a status input stays a\n // status input). `{ title }` alone is a valid instance of every shape.\n const normalize = <O extends AnyOptions>(input: ReactNode | O): O =>\n isOptions(input) ? input : ({ title: input as ReactNode } as O)\n\n const toData = (input: NotifyInput | NotifyStatusInput, type?: ToastType): ToastData => {\n const o = normalize(input)\n return {\n id: o.id ?? generateId(),\n status: \"open\",\n type,\n title: o.title,\n description: o.description,\n action: o.action,\n // A status sets the hue: drop any `color` a JS caller slipped past the\n // types, and clear a previous one when a status re-call dedupes by id.\n color: type === undefined ? (o as NotifyOptions).color : undefined,\n icon: o.icon,\n duration: o.duration ?? (type === \"loading\" ? Number.POSITIVE_INFINITY : defaultDuration),\n withCloseButton: o.withCloseButton ?? true,\n }\n }\n\n const status =\n (type: ToastType): StatusFn =>\n (input) =>\n store.create(toData(input, type))\n\n const show = (input: NotifyInput) => store.create(toData(input))\n\n const update: NotifyUpdate = (id, input) => {\n const o = normalize(input)\n // Copy keys that are *present* (not just defined) so an explicit\n // `{ description: undefined }` clears the field rather than being ignored.\n // An omitted key leaves the current value untouched.\n const patch: Partial<ToastData> = {}\n for (const prop of NOTIFICATION_REMOVABLE_PROPS) {\n // TS can't correlate `prop` with `o[prop]`/`patch[prop]` across a union\n // key on writes (the target collapses to their intersection, `undefined`).\n // The prop list is constrained to keys shared by NotifyOptions & ToastData\n // with compatible value types, so this write is safe.\n if (prop in o) (patch as Record<string, unknown>)[prop] = o[prop]\n }\n store.update(id, patch)\n return id\n }\n\n const promise: NotifyPromise = (promise, messages) => {\n const id = generateId()\n const resolve = (input: NotifyStatusInput, type: ToastType) =>\n store.create(toData({ ...normalize(input), id }, type))\n status(\"loading\")({ ...normalize(messages.loading), id })\n const run = typeof promise === \"function\" ? promise() : promise\n run.then(\n (value) => {\n if (messages.success === undefined) return store.dismiss(id)\n resolve(\n typeof messages.success === \"function\" ? messages.success(value) : messages.success,\n \"success\",\n )\n },\n (error) => {\n if (messages.error === undefined) return store.dismiss(id)\n resolve(\n typeof messages.error === \"function\" ? messages.error(error) : messages.error,\n \"error\",\n )\n },\n )\n return { id, unwrap: () => run }\n }\n\n const notify = Object.assign(show, {\n success: status(\"success\"),\n error: status(\"error\"),\n warning: status(\"warning\"),\n info: status(\"info\"),\n loading: status(\"loading\"),\n promise,\n update,\n dismiss: store.dismiss,\n remove: store.remove,\n has: store.has,\n getToasts: () => store.getSnapshot().toasts,\n }) as Notify\n\n const Notifications = () => {\n const { toasts } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n )\n const [heights, setHeights] = useState<Record<string, number>>({})\n\n const onMeasure = useCallback((id: string, height: number) => {\n setHeights((prev) => (prev[id] === height ? prev : { ...prev, [id]: height }))\n }, [])\n\n // Pause auto-dismiss while the tab is hidden so toasts don't expire unseen.\n useEffect(() => {\n const onVisibility = () => (document.hidden ? store.pauseAll() : store.resumeAll())\n document.addEventListener(\"visibilitychange\", onVisibility)\n return () => document.removeEventListener(\"visibilitychange\", onVisibility)\n }, [])\n\n // Toasts are absolutely stacked; the collapsed deck (top-aligned peeks) and\n // the hover-expanded column are both derived in CSS (theme.css) from these\n // measured px vars. `offset` = Σ heights + gaps of the *newer* toasts in\n // front of this one (its position in the expanded column).\n const heightOf = (toast: ToastData) => heights[toast.id] ?? 0\n const frontHeight = toasts[0] ? heightOf(toasts[0]) : 0\n const items = toasts.map((toast, index) => ({\n toast,\n index,\n height: heightOf(toast),\n offset: toasts.slice(0, index).reduce((sum, newer) => sum + heightOf(newer) + GAP, 0),\n }))\n const expandedHeight =\n toasts.reduce((sum, toast) => sum + heightOf(toast), 0) + GAP * Math.max(0, toasts.length - 1)\n // A toast behind the front that's taller overflows *below* it (toward the\n // bottom edge) in bottom placements. That strip is a hit target collapsed,\n // but expanding slides it into the column as the stack grows the other way,\n // stranding the pointer over a gap → the deck blinks open/closed. Size a\n // stationary ghost hover-bridge under the front toast to cover the strip\n // (overestimates by the peek offsets, which is harmless — see theme.css).\n const maxHeight = toasts.reduce((max, toast) => Math.max(max, heightOf(toast)), 0)\n const stackOverflow = placement.startsWith(\"bottom\") ? Math.max(0, maxHeight - frontHeight) : 0\n\n const region = (\n <section\n aria-label=\"Notifications\"\n data-scope=\"notifications\"\n data-placement={placement}\n data-expand={expand ? \"\" : undefined}\n // Slide direction for the enter/exit keyframes: from below for bottom\n // placements, from above for top.\n style={{ [\"--toast-from\" as string]: placement.startsWith(\"top\") ? \"-100%\" : \"100%\" }}\n className={cn(\n \"pointer-events-none fixed z-(--toast-z,100) justify-center flex\",\n REGION_POSITION[placement],\n // Phones (< xs): pin to the bottom, full-bleed, above the safe area.\n \"max-xs:inset-x-0! max-xs:bottom-[calc(1rem+env(safe-area-inset-bottom))]! max-xs:top-auto! max-xs:translate-x-0!\",\n )}\n >\n {/* pointer-events-auto only on the stack, so the region never blocks the\n page. Hover here pauses timers + expands the deck (enter/leave don't\n fire when moving between toasts inside). */}\n <div\n data-part=\"stack\"\n onPointerEnter={() => store.pauseAll()}\n onPointerLeave={() => store.resumeAll()}\n style={{\n [\"--stack-collapsed-h\" as string]: `${frontHeight}px`,\n [\"--stack-expanded-h\" as string]: `${expandedHeight}px`,\n }}\n className=\"pointer-events-auto relative min-w-88 max-xs:min-w-0 max-w-[calc(100vw-2rem)] max-xs:w-screen\"\n >\n {items.map(({ toast, index, offset, height }) => (\n <ToasterItem\n key={toast.id}\n toast={toast}\n store={store}\n index={index}\n offset={offset}\n height={height}\n frontHeight={frontHeight}\n onMeasure={onMeasure}\n />\n ))}\n {/* The stationary ghost hover-bridge sized by `stackOverflow` above:\n an invisible hit-area glued just below the front toast so `:hover`\n on the stack stays put through the collapse↔expand morph (see\n theme.css). Nonzero only for bottom placements with overflow. */}\n {stackOverflow > 0 && (\n <span\n aria-hidden\n data-part=\"ghost\"\n style={{ [\"--ghost-h\" as string]: `${stackOverflow}px` }}\n />\n )}\n </div>\n </section>\n )\n\n if (!withinPortal) return region\n return <Portal container={container ? { current: container } : undefined}>{region}</Portal>\n }\n\n return { notify, Notifications }\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/notification/store.ts","../../../src/components/notification/create-notifier.tsx"],"names":["promise","max"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,IAAM,kBAAmC,MAAA,CAAO,MAAA,CAAO,EAAE,MAAA,EAAQ,IAAI,CAAA;AAI9D,SAAS,gBAAA,CAAiB,MAAA,GAA0B,EAAE,GAAA,EAAK,GAAE,EAAe;AACjF,EAAA,IAAI,KAAA,GAAyB,EAAE,MAAA,EAAQ,EAAC,EAAE;AAC1C,EAAA,MAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,EAAA,MAAM,MAAA,uBAAa,GAAA,EAAoB;AACvC,EAAA,IAAI,MAAA,GAAS,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A,CAAC,UAAO,SAAA,EAAW,SAAA,GAAY,EAAE,OAAA,EAAS,SAAA,EAAU,GAAI,MAAA,EAAY,QAAA,EAAA,MAAA,EAAO,CAAA;AAAA,EACpF,CAAA;AAEA,EAAA,OAAO,EAAE,QAAQ,aAAA,EAAc;AACjC","file":"index.js","sourcesContent":["import type { ToastData, ToastId } from \"./types\"\n\n/**\n * Framework-agnostic toast store — a tiny vanilla pub/sub modelled on the kit's\n * overlay store (`components/overlays/store.ts`). Holds the live toast stack;\n * the React renderer (`Notifications`) subscribes via `useSyncExternalStore`,\n * and the bound `notify` controller wraps its mutators. No React here, so it's\n * safe to call from anywhere (event handlers, utils).\n *\n * Every mutation produces a fresh `state` + `toasts` array, so `getSnapshot`\n * returns a stable reference between mutations — the contract\n * `useSyncExternalStore` relies on to avoid tearing / render loops.\n *\n * Auto-dismiss timers live here (plain `setTimeout`), with remaining-time\n * bookkeeping so `pauseAll`/`resumeAll` (driven by the renderer on hover /\n * tab-hidden) can freeze and resume them. DOM listeners do NOT live here.\n */\n\nexport interface ToastStoreState {\n toasts: ToastData[]\n}\n\nexport interface ToastStore {\n subscribe: (listener: () => void) => () => void\n getSnapshot: () => ToastStoreState\n getServerSnapshot: () => ToastStoreState\n /** Upsert by id: a new id prepends (and starts its timer); an existing id\n * merges in place and restarts its timer (used for status transitions). */\n create: (data: ToastData) => ToastId\n /** Shallow-merge a patch into a live toast without touching its timer/status. */\n update: (id: ToastId, patch: Partial<ToastData>) => void\n /** Flip a toast to `dismissing` so its exit animation plays (all if no id). */\n dismiss: (id?: ToastId) => void\n /** Hard-remove a toast — called once its exit animation completes. */\n remove: (id: ToastId) => void\n /** Freeze every auto-dismiss timer (hover / tab hidden). */\n pauseAll: () => void\n /** Resume every frozen timer from its remaining time. */\n resumeAll: () => void\n has: (id: ToastId) => boolean\n}\n\n/** Frozen, module-stable empty stack for SSR — toasts are runtime-only, so the\n * server snapshot is always empty and matches the client's first render. */\nconst SERVER_SNAPSHOT: ToastStoreState = Object.freeze({ toasts: [] })\n\ntype Timer = { remaining: number; startedAt: number; handle: ReturnType<typeof setTimeout> | null }\n\nexport function createToastStore(config: { max: number } = { max: 5 }): ToastStore {\n let state: ToastStoreState = { toasts: [] }\n const listeners = new Set<() => void>()\n const timers = new Map<ToastId, Timer>()\n let paused = false\n\n const emit = () => {\n for (const listener of listeners) listener()\n }\n const set = (toasts: ToastData[]) => {\n state = { toasts }\n emit()\n }\n\n const clearTimer = (id: ToastId) => {\n const timer = timers.get(id)\n if (timer?.handle) clearTimeout(timer.handle)\n timers.delete(id)\n }\n\n const startTimer = (id: ToastId, duration: number) => {\n clearTimer(id)\n if (!Number.isFinite(duration)) return // loading / sticky toasts never expire\n const timer: Timer = { remaining: duration, startedAt: Date.now(), handle: null }\n if (!paused) timer.handle = setTimeout(() => dismiss(id), duration)\n timers.set(id, timer)\n }\n\n const dismiss: ToastStore[\"dismiss\"] = (id) => {\n if (id == null) {\n for (const toast of state.toasts) clearTimer(toast.id)\n set(state.toasts.map((t) => (t.status === \"open\" ? { ...t, status: \"dismissing\" } : t)))\n return\n }\n if (!state.toasts.some((t) => t.id === id)) return\n clearTimer(id)\n set(state.toasts.map((t) => (t.id === id ? { ...t, status: \"dismissing\" } : t)))\n }\n\n return {\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n getSnapshot() {\n return state\n },\n getServerSnapshot() {\n return SERVER_SNAPSHOT\n },\n create(data) {\n const exists = state.toasts.some((t) => t.id === data.id)\n if (exists) {\n set(state.toasts.map((t) => (t.id === data.id ? { ...t, ...data } : t)))\n } else {\n // Newest first (index 0 = front). Cap the number of *open* toasts at\n // `max` by dismissing the oldest beyond the limit.\n const next = [data, ...state.toasts]\n const open = next.filter((t) => t.status === \"open\")\n if (open.length > config.max) {\n const overflow = new Set(open.slice(config.max).map((t) => t.id))\n for (const id of overflow) clearTimer(id)\n set(next.map((t) => (overflow.has(t.id) ? { ...t, status: \"dismissing\" } : t)))\n } else {\n set(next)\n }\n }\n startTimer(data.id, data.duration)\n return data.id\n },\n update(id, patch) {\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.map((t) => (t.id === id ? { ...t, ...patch } : t)))\n },\n dismiss,\n remove(id) {\n clearTimer(id)\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.filter((t) => t.id !== id))\n },\n pauseAll() {\n if (paused) return\n paused = true\n const now = Date.now()\n for (const timer of timers.values()) {\n if (!timer.handle) continue\n clearTimeout(timer.handle)\n timer.remaining -= now - timer.startedAt\n timer.handle = null\n }\n },\n resumeAll() {\n if (!paused) return\n paused = false\n const now = Date.now()\n for (const [id, timer] of timers) {\n if (timer.remaining <= 0) {\n dismiss(id)\n continue\n }\n timer.startedAt = now\n timer.handle = setTimeout(() => dismiss(id), timer.remaining)\n }\n },\n has(id) {\n return state.toasts.some((t) => t.id === id)\n },\n }\n}\n","\"use client\"\n\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresence } from \"@ark-ui/react/presence\"\nimport { customAlphabet } from \"nanoid\"\nimport {\n isValidElement,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\"\nimport type { UnavailableProps } from \"../../lib/available-if\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { Notification, type NotificationTranslations } from \"./notification\"\nimport { createToastStore, type ToastStore } from \"./store\"\nimport type { ColorWithTypeReason, ToastData, ToastHue, ToastId, ToastType } from \"./types\"\n\n/**\n * `createNotifier` — the imperative toast manager, modelled on the kit's\n * `createOverlays` (a framework-agnostic `useSyncExternalStore` store + a\n * once-mounted renderer + a bound controller).\n *\n * ```tsx\n * // notifier.ts — one instance for the app\n * export const { notify, Notifications } = createNotifier({ placement: \"bottom-end\" })\n *\n * // app root — mount the region once\n * <Notifications />\n *\n * // anywhere\n * notify(\"Copied to clipboard\") // neutral / custom toast\n * notify.success(\"Saved\")\n * notify.error({ title: \"Upload failed\", action: { label: \"Retry\", onClick: retry } })\n * notify.promise(save(), { loading: \"Saving…\", success: \"Saved\", error: \"Failed\" })\n *\n * const id = notify.loading(\"Uploading…\") // keep the id to update it\n * notify.update(id, { description: \"Halfway…\" }) // patch in place\n * notify.success({ id, title: \"Uploaded\" }) // …or transition its status\n * ```\n */\n\nexport type NotifyPlacement =\n | \"top-start\"\n | \"top\"\n | \"top-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"bottom-end\"\n\n/** The fields every toast input shares. A bare `ReactNode` (string/element)\n * is shorthand for `{ title }`. */\ntype NotifyFields = {\n title?: ReactNode\n description?: ReactNode\n /** ms until auto-dismiss. Omit for the notifier default; `loading` never\n * auto-dismisses. */\n duration?: number\n /** Provide to update/dedupe an existing toast (mint via a returned id, or\n * cast your own: `\"upload\" as ToastId`). */\n id?: ToastId\n /** Render a close button. @default true */\n withCloseButton?: boolean\n /** The action section — any `ReactNode` (e.g. an Undo `Notification.ActionTrigger`),\n * revealed independently of the description. */\n action?: ReactNode\n /** Custom leading glyph; `null` hides the default status icon. */\n icon?: ReactNode | null\n}\n\n/** Full options for a neutral `notify(...)` toast — the one call with no\n * status, so the one that takes a `color`. */\nexport type NotifyOptions = NotifyFields & {\n /** Accent palette for a custom toast. */\n color?: Color\n}\n\n/** Options for a status helper (`notify.success(...)`, …). The status sets\n * the hue, so `color` is refused — see `ToastHue`. */\nexport type NotifyStatusOptions = NotifyFields &\n UnavailableProps<Pick<NotifyOptions, \"color\">, ColorWithTypeReason>\n\n/** Options for `notify.update`. It keeps the toast's status and hue, so\n * `color` is refused; re-call `notify({ id, color })` to recolor. */\nexport type NotifyUpdateOptions = NotifyFields &\n UnavailableProps<\n Pick<NotifyOptions, \"color\">,\n \"`update` keeps the hue — re-call `notify({ id, color })` to recolor\"\n >\n\nexport type NotifyInput = ReactNode | NotifyOptions\nexport type NotifyStatusInput = ReactNode | NotifyStatusOptions\nexport type NotifyUpdateInput = ReactNode | NotifyUpdateOptions\n\nexport type CreateNotifierOptions = {\n /** Corner/edge the stack anchors to. @default \"bottom-end\" */\n placement?: NotifyPlacement\n /** Max toasts on screen before the oldest is dismissed. @default 5 */\n max?: number\n /** Default auto-dismiss duration (ms). @default 5000 */\n duration?: number\n /** Expand the collapsed deck into a column on hover/focus. @default true */\n expand?: boolean\n /** Render the region in a Portal (escape clipping ancestors). @default true */\n withinPortal?: boolean\n /** Portal target. @default document.body */\n container?: HTMLElement | null\n}\n\ntype StatusFn = (input: NotifyStatusInput) => ToastId\n\n/** The `promise` sugar: a single toast tracking an async lifecycle. */\nexport type NotifyPromise = <T>(\n promise: Promise<T> | (() => Promise<T>),\n messages: {\n loading: NotifyStatusInput\n success?: NotifyStatusInput | ((value: T) => NotifyStatusInput)\n error?: NotifyStatusInput | ((error: unknown) => NotifyStatusInput)\n },\n) => { id: ToastId; unwrap: () => Promise<T> }\n\n/** Patch a live toast by id, accepting the same shorthand. Only the fields you\n * pass change (title/description/icon/duration/withCloseButton);\n * status/type and the hue are preserved. To change status, re-call a status helper with\n * the same `id` (e.g. `notify.success({ id })`). */\nexport type NotifyUpdate = (id: ToastId, input: NotifyUpdateInput) => ToastId\n\n/** The bound controller. Callable for a neutral toast; status helpers +\n * `promise` + `update` + `dismiss`/`remove` on top. */\nexport type Notify = ((input: NotifyInput) => ToastId) & {\n success: StatusFn\n error: StatusFn\n warning: StatusFn\n info: StatusFn\n loading: StatusFn\n promise: NotifyPromise\n update: NotifyUpdate\n /** Dismiss a toast (plays its exit); all toasts if no id. */\n dismiss: (id?: ToastId) => void\n /** Immediately remove a toast (no exit animation). */\n remove: (id: ToastId) => void\n /** Whether a toast with this id is still live (open or dismissing). */\n has: (id: ToastId) => boolean\n /** Snapshot of the live toasts (advanced / testing). */\n getToasts: () => ToastData[]\n}\n\n/** The toast region's name (`regionLabel`, default `\"Notifications\"`), plus the card's own\n * keys, forwarded to every toast it renders. */\nexport type NotificationsTranslations = NotificationTranslations & {\n regionLabel?: string\n}\n\nexport type NotificationsProps = {\n /** Overrides the region's and the toasts' accessible names. A partial override keeps the\n * other defaults. */\n translations?: NotificationsTranslations\n}\n\nexport type Notifier = {\n notify: Notify\n Notifications: (props: NotificationsProps) => ReactNode\n}\n\n/** A bare node (string/number/element/array) is a title; any other object is\n * a full `NotifyOptions`. */\n/** Any of the three option shapes; they differ only in whether `color` is accepted. */\ntype AnyOptions = NotifyOptions | NotifyStatusOptions | NotifyUpdateOptions\n\nconst isOptions = <O extends AnyOptions>(input: ReactNode | O): input is O =>\n input != null && typeof input === \"object\" && !isValidElement(input) && !Array.isArray(input)\n\nconst nanoid = customAlphabet(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\", 8)\n/** Mint a branded `ToastId` (the one place a plain string becomes a `ToastId`). */\nconst generateId = (): ToastId => nanoid() as ToastId\n\n/** px gap between toasts when the stack is expanded. */\nconst GAP = 12\n\n/** Region positioning (fixed + anchored edge) per placement. The stacking\n * geometry itself lives in theme.css, keyed on `data-placement`. `start`/`end`\n * are logical insets, so they follow the document's `dir` (end = left in RTL). */\nconst REGION_POSITION = {\n \"top-start\": \"top-4 inset-s-4\",\n top: \"top-4 left-1/2 -translate-x-1/2\",\n \"top-end\": \"top-4 inset-e-4\",\n \"bottom-start\": \"bottom-4 inset-s-4\",\n bottom: \"bottom-4 left-1/2 -translate-x-1/2\",\n \"bottom-end\": \"bottom-4 inset-e-4\",\n} as const satisfies Record<NotifyPlacement, string>\n/** Fields `notify.update` copies from the input onto a live toast — the keys\n * shared by `NotifyOptions` and `ToastData` (excludes `id`/`status`/`type`). */\nconst NOTIFICATION_REMOVABLE_PROPS = [\n \"title\",\n \"description\",\n \"action\",\n \"icon\",\n \"duration\",\n \"withCloseButton\",\n] as const satisfies (keyof NotifyUpdateOptions & keyof ToastData)[]\n\n/** px a pointer must travel to count as a dismiss-swipe. */\nconst SWIPE_THRESHOLD = 60\n/** px of movement under which a press counts as a click (→ dismiss). */\nconst CLICK_SLOP = 5\n\ntype ToasterItemProps = {\n toast: ToastData\n translations?: NotificationTranslations\n store: ToastStore\n /** Position from the front (0 = newest). */\n index: number\n /** Σ heights + gaps of the newer toasts in front (expanded-column offset), px. */\n offset: number\n /** This toast's measured height, px. */\n height: number\n /** The front toast's height, px (for top-aligned collapsed peeks). */\n frontHeight: number\n onMeasure: (id: string, height: number) => void\n}\n\n/**\n * A single live toast inside the stack. Owns the toaster behavior the card\n * itself stays free of — enter/exit via Ark Presence, height measurement for the\n * stacking layout, and swipe/click-to-dismiss — then renders the presentational\n * `Notification`, forwarding the merged ref, stacking style vars and gesture\n * handlers straight onto its `Root`.\n */\nfunction ToasterItem({\n toast,\n translations,\n store,\n index,\n offset,\n height,\n frontHeight,\n onMeasure,\n}: ToasterItemProps) {\n const { id } = toast\n // The store keeps `type` and `color` side by side; the card takes one or the\n // other. At most one is ever set (see `toData`), so pick whichever is.\n const { type, color, ...fields } = toast\n const hue: ToastHue = type ? { type } : { color }\n\n const presence = usePresence({\n present: toast.status === \"open\",\n lazyMount: true,\n unmountOnExit: true,\n onExitComplete: () => store.remove(id),\n })\n\n // Report the card's natural height so the renderer can lay out the stack.\n const measureRef = useRef<HTMLDivElement | null>(null)\n useEffect(() => {\n const node = measureRef.current\n if (!node) return\n onMeasure(id, node.offsetHeight)\n const observer = new ResizeObserver(() => onMeasure(id, node.offsetHeight))\n observer.observe(node)\n return () => observer.disconnect()\n }, [id, onMeasure])\n\n // Swipe / click to dismiss. Dragging past the threshold flicks the toast away\n // (`--swipe-x`/`--swipe-opacity` track the pointer, transition off for 1:1);\n // a click that barely moves dismisses too. Presses that start on an\n // interactive child (close / action) are left to that control.\n const drag = useRef<{ startX: number; interactive: boolean } | null>(null)\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return\n const interactive =\n (event.target as Element).closest(\"button, a, input, [role='button']\") != null\n drag.current = { startX: event.clientX, interactive }\n if (!interactive) event.currentTarget.setPointerCapture(event.pointerId)\n }\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"none\"\n el.style.setProperty(\"--swipe-x\", `${dx}px`)\n el.style.setProperty(\"--swipe-opacity\", `${Math.max(0.15, 1 - Math.abs(dx) / 240)}`)\n }\n const onPointerEnd = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n drag.current = null\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"\"\n if (Math.abs(dx) > SWIPE_THRESHOLD || Math.abs(dx) < CLICK_SLOP) {\n store.dismiss(id)\n } else {\n el.style.setProperty(\"--swipe-x\", \"0px\")\n el.style.setProperty(\"--swipe-opacity\", \"1\")\n }\n }\n\n if (presence.unmounted) return null\n\n return (\n <Notification\n ref={mergeRefs(presence.ref, measureRef)}\n {...fields}\n {...hue}\n {...presence.getPresenceProps()}\n data-part=\"toast\"\n translations={translations}\n onClose={() => store.dismiss(id)}\n // `cursor-grab` lives here (not in the shared cva) so only swipeable\n // toaster toasts show it — a standalone `Notification.Root` doesn't.\n className=\"cursor-grab touch-none select-none active:cursor-grabbing\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerEnd}\n onPointerCancel={onPointerEnd}\n style={{\n [\"--index\" as string]: index,\n [\"--offset\" as string]: `${offset}px`,\n [\"--height\" as string]: `${height}px`,\n [\"--front-height\" as string]: `${frontHeight}px`,\n }}\n />\n )\n}\n\nexport function createNotifier(options: CreateNotifierOptions = {}): Notifier {\n const {\n placement = \"bottom-end\",\n max = 5,\n duration: defaultDuration = 5000,\n expand = true,\n withinPortal = true,\n container,\n } = options\n\n const store = createToastStore({ max })\n\n // Generic so each call site keeps its own shape (a status input stays a\n // status input). `{ title }` alone is a valid instance of every shape.\n const normalize = <O extends AnyOptions>(input: ReactNode | O): O =>\n isOptions(input) ? input : ({ title: input as ReactNode } as O)\n\n const toData = (input: NotifyInput | NotifyStatusInput, type?: ToastType): ToastData => {\n const o = normalize(input)\n return {\n id: o.id ?? generateId(),\n status: \"open\",\n type,\n title: o.title,\n description: o.description,\n action: o.action,\n // A status sets the hue: drop any `color` a JS caller slipped past the\n // types, and clear a previous one when a status re-call dedupes by id.\n color: type === undefined ? (o as NotifyOptions).color : undefined,\n icon: o.icon,\n duration: o.duration ?? (type === \"loading\" ? Number.POSITIVE_INFINITY : defaultDuration),\n withCloseButton: o.withCloseButton ?? true,\n }\n }\n\n const status =\n (type: ToastType): StatusFn =>\n (input) =>\n store.create(toData(input, type))\n\n const show = (input: NotifyInput) => store.create(toData(input))\n\n const update: NotifyUpdate = (id, input) => {\n const o = normalize(input)\n // Copy keys that are *present* (not just defined) so an explicit\n // `{ description: undefined }` clears the field rather than being ignored.\n // An omitted key leaves the current value untouched.\n const patch: Partial<ToastData> = {}\n for (const prop of NOTIFICATION_REMOVABLE_PROPS) {\n // TS can't correlate `prop` with `o[prop]`/`patch[prop]` across a union\n // key on writes (the target collapses to their intersection, `undefined`).\n // The prop list is constrained to keys shared by NotifyOptions & ToastData\n // with compatible value types, so this write is safe.\n if (prop in o) (patch as Record<string, unknown>)[prop] = o[prop]\n }\n store.update(id, patch)\n return id\n }\n\n const promise: NotifyPromise = (promise, messages) => {\n const id = generateId()\n const resolve = (input: NotifyStatusInput, type: ToastType) =>\n store.create(toData({ ...normalize(input), id }, type))\n status(\"loading\")({ ...normalize(messages.loading), id })\n const run = typeof promise === \"function\" ? promise() : promise\n run.then(\n (value) => {\n if (messages.success === undefined) return store.dismiss(id)\n resolve(\n typeof messages.success === \"function\" ? messages.success(value) : messages.success,\n \"success\",\n )\n },\n (error) => {\n if (messages.error === undefined) return store.dismiss(id)\n resolve(\n typeof messages.error === \"function\" ? messages.error(error) : messages.error,\n \"error\",\n )\n },\n )\n return { id, unwrap: () => run }\n }\n\n const notify = Object.assign(show, {\n success: status(\"success\"),\n error: status(\"error\"),\n warning: status(\"warning\"),\n info: status(\"info\"),\n loading: status(\"loading\"),\n promise,\n update,\n dismiss: store.dismiss,\n remove: store.remove,\n has: store.has,\n getToasts: () => store.getSnapshot().toasts,\n }) as Notify\n\n const Notifications = ({ translations }: NotificationsProps = {}) => {\n const { toasts } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n )\n const [heights, setHeights] = useState<Record<string, number>>({})\n\n const onMeasure = useCallback((id: string, height: number) => {\n setHeights((prev) => (prev[id] === height ? prev : { ...prev, [id]: height }))\n }, [])\n\n // Pause auto-dismiss while the tab is hidden so toasts don't expire unseen.\n useEffect(() => {\n const onVisibility = () => (document.hidden ? store.pauseAll() : store.resumeAll())\n document.addEventListener(\"visibilitychange\", onVisibility)\n return () => document.removeEventListener(\"visibilitychange\", onVisibility)\n }, [])\n\n // Toasts are absolutely stacked; the collapsed deck (top-aligned peeks) and\n // the hover-expanded column are both derived in CSS (theme.css) from these\n // measured px vars. `offset` = Σ heights + gaps of the *newer* toasts in\n // front of this one (its position in the expanded column).\n const heightOf = (toast: ToastData) => heights[toast.id] ?? 0\n const frontHeight = toasts[0] ? heightOf(toasts[0]) : 0\n const items = toasts.map((toast, index) => ({\n toast,\n index,\n height: heightOf(toast),\n offset: toasts.slice(0, index).reduce((sum, newer) => sum + heightOf(newer) + GAP, 0),\n }))\n const expandedHeight =\n toasts.reduce((sum, toast) => sum + heightOf(toast), 0) + GAP * Math.max(0, toasts.length - 1)\n // A toast behind the front that's taller overflows *below* it (toward the\n // bottom edge) in bottom placements. That strip is a hit target collapsed,\n // but expanding slides it into the column as the stack grows the other way,\n // stranding the pointer over a gap → the deck blinks open/closed. Size a\n // stationary ghost hover-bridge under the front toast to cover the strip\n // (overestimates by the peek offsets, which is harmless — see theme.css).\n const maxHeight = toasts.reduce((max, toast) => Math.max(max, heightOf(toast)), 0)\n const stackOverflow = placement.startsWith(\"bottom\") ? Math.max(0, maxHeight - frontHeight) : 0\n\n const region = (\n <section\n aria-label={translations?.regionLabel ?? \"Notifications\"}\n data-scope=\"notifications\"\n data-placement={placement}\n data-expand={expand ? \"\" : undefined}\n // Slide direction for the enter/exit keyframes: from below for bottom\n // placements, from above for top.\n style={{ [\"--toast-from\" as string]: placement.startsWith(\"top\") ? \"-100%\" : \"100%\" }}\n className={cn(\n \"pointer-events-none fixed z-(--toast-z,100) justify-center flex\",\n REGION_POSITION[placement],\n // Phones (< xs): pin to the bottom, full-bleed, above the safe area.\n \"max-xs:inset-x-0! max-xs:bottom-[calc(1rem+env(safe-area-inset-bottom))]! max-xs:top-auto! max-xs:translate-x-0!\",\n )}\n >\n {/* pointer-events-auto only on the stack, so the region never blocks the\n page. Hover here pauses timers + expands the deck (enter/leave don't\n fire when moving between toasts inside). */}\n <div\n data-part=\"stack\"\n onPointerEnter={() => store.pauseAll()}\n onPointerLeave={() => store.resumeAll()}\n style={{\n [\"--stack-collapsed-h\" as string]: `${frontHeight}px`,\n [\"--stack-expanded-h\" as string]: `${expandedHeight}px`,\n }}\n className=\"pointer-events-auto relative min-w-88 max-xs:min-w-0 max-w-[calc(100vw-2rem)] max-xs:w-screen\"\n >\n {items.map(({ toast, index, offset, height }) => (\n <ToasterItem\n key={toast.id}\n toast={toast}\n translations={translations}\n store={store}\n index={index}\n offset={offset}\n height={height}\n frontHeight={frontHeight}\n onMeasure={onMeasure}\n />\n ))}\n {/* The stationary ghost hover-bridge sized by `stackOverflow` above:\n an invisible hit-area glued just below the front toast so `:hover`\n on the stack stays put through the collapse↔expand morph (see\n theme.css). Nonzero only for bottom placements with overflow. */}\n {stackOverflow > 0 && (\n <span\n aria-hidden\n data-part=\"ghost\"\n style={{ [\"--ghost-h\" as string]: `${stackOverflow}px` }}\n />\n )}\n </div>\n </section>\n )\n\n if (!withinPortal) return region\n return <Portal container={container ? { current: container } : undefined}>{region}</Portal>\n }\n\n return { notify, Notifications }\n}\n"]}
@@ -78,6 +78,16 @@ export declare const CollapseTrigger: ({ className, children, type, open, testId
78
78
  * the Notifier-managed plumbing (`id` / `status` / `duration`) is optional, so a
79
79
  * standalone card is just `<Notification type="success" title="Saved" />`.
80
80
  */
81
+ /** The ready-made card's control names. `closeTriggerLabel` follows Ark's own Toast key; the
82
+ * compound parts (`CloseTrigger`, `CollapseTrigger`) take a plain `aria-label` instead. */
83
+ export type NotificationTranslations = {
84
+ /** The close (×) button. Default `"Dismiss"`. */
85
+ closeTriggerLabel?: string;
86
+ /** The collapse chevron while the card is open. Default `"Collapse"`. */
87
+ collapseLabel?: string;
88
+ /** The collapse chevron while the card is folded. Default `"Expand"`. */
89
+ expandLabel?: string;
90
+ };
81
91
  export type NotificationProps = Omit<NotificationRootProps, "title" | "color" | "asChild"> & ForbidAsChild & Omit<ToastFields, "id" | "status" | "duration"> & Partial<Pick<ToastFields, "id" | "status" | "duration">> & ToastHue & {
82
92
  /** Invoked when the close (×) button is pressed. */
83
93
  onClose?: () => void;
@@ -91,6 +101,9 @@ export type NotificationProps = Omit<NotificationRootProps, "title" | "color" |
91
101
  open?: boolean;
92
102
  /** Fired when the collapse toggle is pressed. */
93
103
  onOpenChange?: (open: boolean) => void;
104
+ /** Overrides the close and collapse buttons' accessible names. A partial override keeps
105
+ * the other defaults. */
106
+ translations?: NotificationTranslations;
94
107
  };
95
108
  /**
96
109
  * The ready-made **`Notification` card** — the presentational body composed from
@@ -106,7 +119,7 @@ export type NotificationProps = Omit<NotificationRootProps, "title" | "color" |
106
119
  * `Notification.Root`, `.Icon`, `.Title`, `.Description`, `.ActionTrigger`,
107
120
  * `.CloseTrigger`.
108
121
  */
109
- declare function NotificationComponent({ type, title, description, action, color: _color, icon: _icon, withCloseButton, withCollapse, defaultOpen, open: _open, onOpenChange, onClose, status: _status, duration: _duration, asChild: _asChild, ...rest }: NotificationProps): import("react").JSX.Element;
122
+ declare function NotificationComponent({ type, title, description, action, color: _color, icon: _icon, withCloseButton, withCollapse, defaultOpen, open: _open, onOpenChange, onClose, translations, status: _status, duration: _duration, asChild: _asChild, ...rest }: NotificationProps): import("react").JSX.Element;
110
123
  /**
111
124
  * `Notification` — the ready-made card (batteries-included), with the compound
112
125
  * parts attached for bespoke composition. Mirrors `Tooltip`/`Modal`: the bare
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/components/notification/notification.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAStD,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAU,MAAM,OAAO,CAAA;AAEvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAKnD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;mEAGmE;AACnE,eAAO,MAAM,mBAAmB,UAG/B,CAAA;AAED;;;gDAGgD;AAChD,eAAO,MAAM,gBAAgB,oFAc3B,CAAA;AAEF;;;sEAGsE;AACtE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAM7E,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,KAAK,CAAC,GACrD,UAAU,GAAG;IACX,wEAAwE;IACxE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,6EAA6E;IAC7E,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CAC1B,CAAA;AAEH,QAAA,MAAM,IAAI,0CAA2C,qBAAqB,gCAOzE,CAAA;AAED;;;+DAG+D;AAC/D,eAAO,MAAM,IAAI,mCAId,wBAAw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AAK,EAAE,MAAM,EACb,IAAI,EAAE,KAAK,EACX,eAAsB,EACtB,YAAoB,EACpB,WAAW,EACX,IAAI,EAAE,KAAK,EACX,YAAY,EACZ,OAAO,EAEP,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,QAAQ,EACjB,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAkDnB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAQvB,CAAA"}
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/components/notification/notification.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAStD,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAU,MAAM,OAAO,CAAA;AAEvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAKnD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;mEAGmE;AACnE,eAAO,MAAM,mBAAmB,UAG/B,CAAA;AAED;;;gDAGgD;AAChD,eAAO,MAAM,gBAAgB,oFAc3B,CAAA;AAEF;;;sEAGsE;AACtE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAM7E,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,KAAK,CAAC,GACrD,UAAU,GAAG;IACX,wEAAwE;IACxE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,6EAA6E;IAC7E,GAAG,CA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CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;0EACsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;oDACgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,wDAAwD;IACxD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC;8BAC0B;IAC1B,YAAY,CAAC,EAAE,wBAAwB,CAAA;CACxC,CAAA;AAEH;;;;;;;;;;;;;GAaG;AACH,iBAAS,qBAAqB,CAAC,EAC7B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,KAAK,EACX,eAAsB,EACtB,YAAoB,EACpB,WAAW,EACX,IAAI,EAAE,KAAK,EACX,YAAY,EACZ,OAAO,EACP,YAAY,EAEZ,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,QAAQ,EACjB,GAAG,IAAI,EACR,EAAE,iBAAiB,+BA2DnB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAQvB,CAAA"}
@@ -1,2 +1,2 @@
1
- export { NumberInput, type NumberInputProps } from "./number-input";
1
+ export { NumberInput, type NumberInputProps, type NumberInputTranslations } from "./number-input";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/number-input/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/number-input/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import '../../chunk-R5GMMWAY.js';
3
- export { NumberInput } from '../../chunk-FZIHZT5R.js';
3
+ export { NumberInput } from '../../chunk-GCGX4FEF.js';
4
4
  import '../../chunk-UVYTJQTJ.js';
5
- import '../../chunk-5OQLFX47.js';
6
- import '../../chunk-FHG54IT5.js';
7
- import '../../chunk-6GDMSENK.js';
5
+ import '../../chunk-Z6RPMRFH.js';
6
+ import '../../chunk-TBTSEPGP.js';
7
+ import '../../chunk-LM6F6DLR.js';
8
8
  import '../../chunk-AIQG7IIT.js';
9
9
  import '../../chunk-7P32XCEU.js';
10
10
  import '../../chunk-BUIHQJGE.js';
@@ -1,7 +1,20 @@
1
- import { type FocusEvent, type ReactNode, type Ref } from "react";
1
+ import { NumberInput as Ark } from "@ark-ui/react/number-input";
2
+ import { type ComponentProps, type FocusEvent, type ReactNode, type Ref } from "react";
2
3
  import type { WithTestId } from "../../lib/test-id";
3
4
  import { type FieldProps } from "../field/field";
4
5
  import { type InputSize, type InputVariant } from "../input/input";
6
+ /** Ark's own NumberInput `translations` type (`incrementLabel`, `decrementLabel`, and
7
+ * `valueText` for `aria-valuetext`), derived structurally rather than imported from
8
+ * `@zag-js/number-input`, plus the combobox family's `clearTriggerLabel` for the kit's own
9
+ * clear button. */
10
+ export type NumberInputTranslations = NonNullable<ComponentProps<typeof Ark.Root>["translations"]> & {
11
+ clearTriggerLabel?: string;
12
+ };
13
+ export declare const NUMBER_INPUT_DEFAULT_TRANSLATIONS: {
14
+ readonly incrementLabel: "Increment";
15
+ readonly decrementLabel: "Decrement";
16
+ readonly clearTriggerLabel: "Clear value";
17
+ };
5
18
  /**
6
19
  * NumberInput — a numeric `<input>` with increment / decrement steppers on Ark
7
20
  * UI's NumberInput machine. It lives on the same shell as [`Input`](/docs/input)
@@ -99,7 +112,12 @@ export type NumberInputProps = Pick<FieldProps, "label" | "description" | "error
99
112
  onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
100
113
  className?: string;
101
114
  classNames?: NumberInputClassNames;
115
+ /** Overrides the steppers' (`incrementLabel`, `decrementLabel`, default `"Increment"` /
116
+ * `"Decrement"`) and the clear button's (`clearTriggerLabel`, default `"Clear value"`)
117
+ * accessible names, and sets `valueText` (the input's `aria-valuetext`). A partial override
118
+ * keeps the other defaults. */
119
+ translations?: NumberInputTranslations;
102
120
  };
103
- export declare const NumberInput: ({ value, defaultValue, onChange, min, max, step, placeholder, formatOptions, allowMouseWheel, clampValueOnBlur, wrap, hideControls, clearable, name, invalid, disabled, readOnly, required, label, description, error, variant, size, startSlot, suffix, id, ref, onBlur, className, classNames, testId, }: NumberInputProps) => import("react").JSX.Element;
121
+ export declare const NumberInput: ({ value, defaultValue, onChange, min, max, step, placeholder, formatOptions, allowMouseWheel, clampValueOnBlur, wrap, hideControls, clearable, name, invalid, disabled, readOnly, required, label, description, error, variant, size, startSlot, suffix, id, ref, onBlur, className, classNames, testId, translations, }: NumberInputProps) => import("react").JSX.Element;
104
122
  export {};
105
123
  //# sourceMappingURL=number-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"number-input.d.ts","sourceRoot":"","sources":["../../../src/components/number-input/number-input.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAsB,KAAK,SAAS,EAAE,KAAK,GAAG,EAAU,MAAM,OAAO,CAAA;AAI7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,UAAU,EAA8B,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,YAAY,EAGlB,MAAM,gBAAgB,CAAA;AAIvB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,KAAK,qBAAqB,GAAG;IAC3B,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;gFAC4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,m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IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;;;2CAKuC;IACvC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,yCAAyC;IACzC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,iDAAiD;IACjD,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAC3B,qEAAqE;IACrE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,qBAAqB,CAAA;CACnC,CAAA;AAkGH,eAAO,MAAM,WAAW,+SAgCrB,gBAAgB,gCA2JlB,CAAA"}
1
+ {"version":3,"file":"number-input.d.ts","sourceRoot":"","sources":["../../../src/components/number-input/number-input.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,IAAI,GAAG,EAAyB,MAAM,4BAA4B,CAAA;AAEtF,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,UAAU,EAEf,KAAK,SAAS,EACd,KAAK,GAAG,EAET,MAAM,OAAO,CAAA;AAId,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,UAAU,EAA8B,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,YAAY,EAGlB,MAAM,gBAAgB,CAAA;AAIvB;;;oBAGoB;AACpB,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAC/C,cAAc,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAChD,GAAG;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,iCAAiC;6BAC5B,WAAW;6BACX,WAAW;gCACR,aAAa;CACU,CAAA;AAE5C;;;;;;;;;;;;;;;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b,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;;;2CAKuC;IACvC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,yCAAyC;IACzC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,iDAAiD;IACjD,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAC3B,qEAAqE;IACrE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAClC;;;oCAGgC;IAChC,YAAY,CAAC,EAAE,uBAAuB,CAAA;CACvC,CAAA;AAkGH,eAAO,MAAM,WAAW,6TAiCrB,gBAAgB,gCA2JlB,CAAA"}
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import { Modal } from '../../chunk-JITF6I7N.js';
3
- import { Drawer } from '../../chunk-HAQJQFE6.js';
4
- import { Button } from '../../chunk-RAUOFTUH.js';
2
+ import { Modal } from '../../chunk-WJOHNCYY.js';
3
+ import { Drawer } from '../../chunk-DBTJEBMO.js';
4
+ import { Button } from '../../chunk-QIDAXFKK.js';
5
5
  import '../../chunk-AIQG7IIT.js';
6
6
  import '../../chunk-7P32XCEU.js';
7
7
  import '../../chunk-BUIHQJGE.js';
8
- import '../../chunk-S7N4LGLZ.js';
9
- import '../../chunk-NSDM3FEB.js';
8
+ import '../../chunk-RIP5G47F.js';
9
+ import '../../chunk-PS2PZFXH.js';
10
10
  import '../../chunk-I4SQQIP5.js';
11
11
  import '../../chunk-WYCMIIRR.js';
12
- import '../../chunk-B2LCHXUB.js';
12
+ import '../../chunk-INJUILCN.js';
13
13
  import { cn } from '../../chunk-QP4I37PA.js';
14
14
  import { customAlphabet } from 'nanoid';
15
15
  import { useSyncExternalStore, useMemo, useState } from 'react';
@@ -1,2 +1,2 @@
1
- export { PasswordInput, type PasswordInputProps } from "./password-input";
1
+ export { PasswordInput, type PasswordInputProps, type PasswordInputTranslations, } from "./password-input";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/password-input/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/password-input/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,GAC/B,MAAM,kBAAkB,CAAA"}
@@ -1,11 +1,14 @@
1
1
  "use client";
2
- import { InputBase, inputControlClasses, inputSlot } from '../../chunk-5OQLFX47.js';
3
- import { FieldShell, fieldA11yProps } from '../../chunk-FHG54IT5.js';
2
+ import { InputBase, inputControlClasses, inputSlot } from '../../chunk-Z6RPMRFH.js';
3
+ import { FieldShell, fieldA11yProps } from '../../chunk-TBTSEPGP.js';
4
+ import { devWarn } from '../../chunk-OC7I2CTA.js';
4
5
  import { props } from '../../chunk-WYCMIIRR.js';
6
+ import { focusStyles } from '../../chunk-INJUILCN.js';
5
7
  import { cn } from '../../chunk-QP4I37PA.js';
6
8
  import { useFieldContext } from '@ark-ui/react/field';
7
- import { PasswordInput as PasswordInput$1 } from '@ark-ui/react/password-input';
9
+ import { PasswordInput as PasswordInput$1, usePasswordInputContext } from '@ark-ui/react/password-input';
8
10
  import { EyeOff, Eye } from 'lucide-react';
11
+ import { useRef, useEffect } from 'react';
9
12
  import { jsx, jsxs } from 'react/jsx-runtime';
10
13
 
11
14
  var PasswordInputField = ({
@@ -36,6 +39,41 @@ var PasswordInputField = ({
36
39
  }
37
40
  );
38
41
  };
42
+ var PasswordInputToggle = ({
43
+ tabIndex,
44
+ custom,
45
+ className,
46
+ children
47
+ }) => {
48
+ const api = usePasswordInputContext();
49
+ const { "aria-expanded": _expanded, ...trigger } = api.getVisibilityTriggerProps();
50
+ const label = trigger["aria-label"];
51
+ const ref = useRef(null);
52
+ useEffect(() => {
53
+ if (!custom) return;
54
+ const text = ref.current?.textContent?.trim() ?? "";
55
+ if (!/\p{L}/u.test(text)) return;
56
+ if (label?.toLocaleLowerCase().includes(text.toLocaleLowerCase())) return;
57
+ devWarn(
58
+ `PasswordInput: \`renderToggle\` renders the text "${text}", but the button's accessible name is "${label}". Pass \`translations.visibilityTrigger\` returning a label that contains the visible text (WCAG 2.5.3, Label in Name).`
59
+ );
60
+ }, [custom, label]);
61
+ const interactive = !api.disabled && !api.getInputProps().readOnly;
62
+ return /* @__PURE__ */ jsx(
63
+ "button",
64
+ {
65
+ ...trigger,
66
+ ref,
67
+ tabIndex,
68
+ className,
69
+ onClick: (event) => {
70
+ if (event.detail !== 0 || !interactive) return;
71
+ api.toggleVisible();
72
+ },
73
+ children
74
+ }
75
+ );
76
+ };
39
77
  var PasswordInput = ({
40
78
  value,
41
79
  defaultValue,
@@ -51,6 +89,13 @@ var PasswordInput = ({
51
89
  label,
52
90
  description,
53
91
  error,
92
+ visible,
93
+ defaultVisible,
94
+ onVisibleChange,
95
+ renderToggle,
96
+ hideToggle,
97
+ toggleTabIndex = 0,
98
+ translations,
54
99
  startSlot,
55
100
  id,
56
101
  ref,
@@ -78,6 +123,10 @@ var PasswordInput = ({
78
123
  disabled,
79
124
  readOnly,
80
125
  required,
126
+ visible,
127
+ defaultVisible,
128
+ onVisibilityChange: (details) => onVisibleChange?.(details.visible),
129
+ translations,
81
130
  children: /* @__PURE__ */ jsxs(
82
131
  InputBase,
83
132
  {
@@ -104,11 +153,23 @@ var PasswordInput = ({
104
153
  className: cn(inputControlClasses, classNames?.input)
105
154
  }
106
155
  ),
107
- /* @__PURE__ */ jsx(
108
- PasswordInput$1.VisibilityTrigger,
156
+ !hideToggle && /* @__PURE__ */ jsx(
157
+ PasswordInputToggle,
109
158
  {
110
- className: cn(inputSlot, "cursor-pointer", classNames?.visibilityTrigger),
111
- children: /* @__PURE__ */ jsx(PasswordInput$1.Indicator, { fallback: /* @__PURE__ */ jsx(Eye, {}), children: /* @__PURE__ */ jsx(EyeOff, {}) })
159
+ tabIndex: toggleTabIndex,
160
+ custom: renderToggle !== void 0,
161
+ className: cn(
162
+ inputSlot,
163
+ "cursor-pointer rounded-xs",
164
+ // Its own ring, not just the shell's: the shell's `:has()`
165
+ // halo is already on while the input is focused, so it can't
166
+ // tell a keyboard user that focus moved onto the toggle. No
167
+ // offset — the gap would be painted in the page color, a hole
168
+ // punched in the shell's own fill.
169
+ focusStyles({ offset: false }),
170
+ classNames?.visibilityTrigger
171
+ ),
172
+ children: renderToggle ? /* @__PURE__ */ jsx(PasswordInput$1.Context, { children: (api) => renderToggle(api.visible) }) : /* @__PURE__ */ jsx(PasswordInput$1.Indicator, { fallback: /* @__PURE__ */ jsx(Eye, {}), children: /* @__PURE__ */ jsx(EyeOff, {}) })
112
173
  }
113
174
  )
114
175
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/password-input/password-input.tsx"],"names":["Ark"],"mappings":";;;;;;;;;AAgFA,IAAM,qBAAqB,CAAC;AAAA,EAC1B,GAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAG+B;AAC7B,EAAA,MAAM,QAAQ,eAAA,EAAgB;AAC9B,EAAA,uBACE,GAAA;AAAA,IAACA,eAAA,CAAI,KAAA;AAAA,IAAJ;AAAA,M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AAA;AAAA,cACA,SAAA;AAAA,cACA,UAAA,EAAY,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAK;AAAA,cAErC,QAAA,EAAA;AAAA,gCAAA,GAAA;AAAA,kBAAC,kBAAA;AAAA,kBAAA;AAAA,oBACC,GAAA;AAAA,oBACA,KAAA;AAAA,oBACA,YAAA;AAAA,oBACA,QAAA;AAAA,oBACA,MAAA;AAAA,oBACA,IAAA;AAAA,oBACA,WAAA;AAAA,oBACA,MAAA;AAAA,oBACA,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,UAAA,EAAY,KAAK;AAAA;AAAA,iBACtD;AAAA,gCAIA,GAAA;AAAA,kBAACA,eAAA,CAAI,iBAAA;AAAA,kBAAJ;AAAA,oBACC,SAAA,EAAW,EAAA,CAAG,SAAA,EAAW,gBAAA,EAAkB,YAAY,iBAAiB,CAAA;AAAA,oBAExE,QAAA,kBAAA,GAAA,CAACA,eAAA,CAAI,SAAA,EAAJ,EAAc,QAAA,sBAAW,GAAA,EAAA,EAAI,CAAA,EAC5B,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,CAAA,EACV;AAAA;AAAA;AACF;AAAA;AAAA;AACF;AAAA;AACF;AAAA,GACF;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { PasswordInput as Ark } from \"@ark-ui/react/password-input\"\nimport { Eye, EyeOff } from \"lucide-react\"\nimport type { ChangeEvent, FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n InputBase,\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputSlot,\n} from \"../input/input\"\n\n/**\n * PasswordInput — a native password field with a built-in show / hide toggle.\n * Like {@link Input} it is **event-based**: `value` / `onChange` / `name`\n * forward to the underlying `<input>` (so RHF's `register` and a plain\n * `onChange` handler work as usual). Like the rest of the family it carries its\n * own `label` / `description` / `error` / `required` via [`Field`](/docs/field),\n * so it's complete on its own; `error` flips it to the invalid (red) state.\n *\n * The reveal toggle is owned by Ark's `PasswordInput` machine — it flips the\n * input `type` between `password` and `text` and swaps the indicator icon. The\n * machine is field-aware, so nested in the built-in `Field` it inherits the\n * `id`, `aria-describedby`, and disabled / invalid / read-only state.\n *\n * The toggle renders as a real `<button>` sibling of the input — NOT via the\n * shell's decorative `endSlot`, whose wrapper span is `aria-hidden` and would\n * hide the control from assistive tech. As a direct child it stays clickable\n * and exposed to AT (with `aria-controls` / `aria-expanded` from the machine).\n * Ark deliberately sets `tabIndex={-1}` on it: the input itself is the focus\n * stop, and the toggle is a redundant pointer convenience.\n */\n\nexport type PasswordInputProps = Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Controlled value, forwarded to the native input. */\n value?: string\n /** Uncontrolled initial value. */\n defaultValue?: string\n /** Native change event (forwarded straight to the `<input>`). */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void\n /** Field name for native form submission. */\n name?: string\n /** Placeholder shown while the field is empty. */\n placeholder?: string\n /** Shell treatment: bordered (`default`), soft-filled, or chrome-less. */\n variant?: InputVariant\n /** Height step / control font / slot icon size. */\n size?: InputSize\n /** Red border + ring; also wires `aria-invalid`. OR'd with `error`. */\n invalid?: boolean\n /** Dims the shell and disables the input + toggle. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n /** Decorative or interactive content at the inline-start of the control. */\n startSlot?: ReactNode\n /** Explicit id for label association. */\n id?: string\n /** Lands on the underlying `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the input; drives touched / blurred validation. */\n onBlur?: (e: FocusEvent<HTMLInputElement>) => void\n /** Styles the shell root. */\n className?: string\n /** Per-part class overrides. */\n classNames?: { field?: string; root?: string; input?: string; visibilityTrigger?: string }\n }\n\n/**\n * The real `<input>`, split out so it reads the `Field` context from *inside*\n * the wrapping `FieldShell` — `PasswordInput` itself renders that shell, so\n * calling `useFieldContext()` at its own top level would run too early.\n */\nconst PasswordInputField = ({\n ref,\n value,\n defaultValue,\n onChange,\n onBlur,\n name,\n placeholder,\n testId,\n className,\n}: Pick<\n PasswordInputProps,\n \"ref\" | \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"name\" | \"placeholder\" | \"testId\"\n> & { className?: string }) => {\n const field = useFieldContext()\n return (\n <Ark.Input\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n onBlur={onBlur}\n name={name}\n placeholder={placeholder}\n {...fieldA11yProps(field)}\n {...props({ \"data-testid\": testId })}\n className={className}\n />\n )\n}\n\nexport const PasswordInput = ({\n value,\n defaultValue,\n onChange,\n name,\n placeholder,\n variant,\n size,\n invalid,\n disabled,\n readOnly,\n required,\n label,\n description,\n error,\n startSlot,\n id,\n ref,\n onBlur,\n className,\n classNames,\n testId,\n}: PasswordInputProps) => {\n // Drive the red state independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n >\n <InputBase\n variant={variant}\n size={size}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n startSlot={startSlot}\n className={className}\n classNames={{ root: classNames?.root }}\n >\n <PasswordInputField\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n onBlur={onBlur}\n name={name}\n placeholder={placeholder}\n testId={testId}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {/* Rendered as a direct sibling — NOT via InputBase's `endSlot`, whose\n wrapper span is `aria-hidden` — so the toggle button stays clickable\n and keyboard-focusable / announced to assistive tech. */}\n <Ark.VisibilityTrigger\n className={cn(inputSlot, \"cursor-pointer\", classNames?.visibilityTrigger)}\n >\n <Ark.Indicator fallback={<Eye />}>\n <EyeOff />\n </Ark.Indicator>\n </Ark.VisibilityTrigger>\n </InputBase>\n </Ark.Root>\n </FieldShell>\n )\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/password-input/password-input.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAmIA,IAAM,qBAAqB,CAAC;AAAA,EAC1B,GAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAG+B;AAC7B,EAAA,MAAM,QAAQ,eAAA,EAAgB;AAC9B,EAAA,uBACE,GAAA;AAAA,IAACA,eAAA,CAAI,KAAA;AAAA,IAAJ;AAAA,MACC,GAAA;AAAA,MACA,KAAA;AAAA,MACA,YAAA;AAAA,MACA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAA;AAAA,MACC,GAAG,eAAe,KAAK,CAAA;AAAA,MACvB,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MACnC;AAAA;AAAA,GACF;AAEJ,CAAA;AAyBA,IAAM,sBAAsB,CAAC;AAAA,EAC3B,QAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,KAKM;AACJ,EAAA,MAAM,MAAM,uBAAA,EAAwB;AACpC,EAAA,MAAM,EAAE,eAAA,EAAiB,SAAA,EAAW,GAAG,OAAA,EAAQ,GAAI,IAAI,yBAAA,EAA0B;AACjF,EAAA,MAAM,KAAA,GAAQ,QAAQ,YAAY,CAAA;AAClC,EAAA,MAAM,GAAA,GAAM,OAA0B,IAAI,CAAA;AAC1C,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,MAAA,EAAQ;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AA,iBACtD;AAAA,gBAIC,CAAC,UAAA,oBACA,GAAA;AAAA,kBAAC,mBAAA;AAAA,kBAAA;AAAA,oBACC,QAAA,EAAU,cAAA;AAAA,oBACV,QAAQ,YAAA,KAAiB,MAAA;AAAA,oBACzB,SAAA,EAAW,EAAA;AAAA,sBACT,SAAA;AAAA,sBACA,2BAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAMA,WAAA,CAAY,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAA;AAAA,sBAC7B,UAAA,EAAY;AAAA,qBACd;AAAA,oBAEC,QAAA,EAAA,YAAA,uBACEA,eAAA,CAAI,OAAA,EAAJ,EAAa,QAAA,EAAA,CAAC,GAAA,KAAQ,YAAA,CAAa,GAAA,CAAI,OAAO,CAAA,EAAE,oBAEjD,GAAA,CAACA,eAAA,CAAI,WAAJ,EAAc,QAAA,sBAAW,GAAA,EAAA,EAAI,CAAA,EAC5B,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,CAAA,EACV;AAAA;AAAA;AAEJ;AAAA;AAAA;AAEJ;AAAA;AACF;AAAA,GACF;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { PasswordInput as Ark, usePasswordInputContext } from \"@ark-ui/react/password-input\"\nimport { Eye, EyeOff } from \"lucide-react\"\nimport type {\n ChangeEvent,\n ComponentPropsWithoutRef,\n FocusEvent,\n MouseEvent,\n ReactNode,\n Ref,\n} from \"react\"\nimport { useEffect, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { devWarn } from \"../../lib/dev-warn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n InputBase,\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputSlot,\n} from \"../input/input\"\n\n/**\n * PasswordInput — a native password field with a built-in show / hide toggle.\n * Like {@link Input} it is **event-based**: `value` / `onChange` / `name`\n * forward to the underlying `<input>` (so RHF's `register` and a plain\n * `onChange` handler work as usual). Like the rest of the family it carries its\n * own `label` / `description` / `error` / `required` via [`Field`](/docs/field),\n * so it's complete on its own; `error` flips it to the invalid (red) state.\n *\n * The reveal toggle is owned by Ark's `PasswordInput` machine — it flips the\n * input `type` between `password` and `text` and swaps the indicator icon. The\n * machine is field-aware, so nested in the built-in `Field` it inherits the\n * `id`, `aria-describedby`, and disabled / invalid / read-only state.\n *\n * The toggle renders as a real `<button>` sibling of the input — NOT via the\n * shell's decorative `endSlot`, whose wrapper span is `aria-hidden` and would\n * hide the control from assistive tech. As a direct child it stays clickable\n * and exposed to AT, with `aria-controls` pointing at the input. It is a tab\n * stop by default (zag ships it at `tabIndex={-1}`, which left keyboard users\n * no way to reveal the value); `toggleTabIndex={-1}` restores that.\n *\n * The reveal state can be lifted out (`visible` / `defaultVisible` /\n * `onVisibleChange`), e.g. to drive several fields from one \"Show\n * passwords\" checkbox. `renderToggle` swaps what renders *inside* the kit's\n * button — which keeps its a11y wiring — and `hideToggle` drops the button so\n * an external control owns the state.\n */\n\n/** Ark's own `translations` prop type, derived structurally rather than imported by name —\n * `IntlTranslations` lives in `@zag-js/password-input`, a transitive dependency of the\n * `@ark-ui/react` peer dep, not one this package declares itself. */\nexport type PasswordInputTranslations = NonNullable<\n ComponentPropsWithoutRef<typeof Ark.Root>[\"translations\"]\n>\n\nexport type PasswordInputProps = Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Controlled value, forwarded to the native input. */\n value?: string\n /** Uncontrolled initial value. */\n defaultValue?: string\n /** Native change event (forwarded straight to the `<input>`). */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void\n /** Field name for native form submission. */\n name?: string\n /** Placeholder shown while the field is empty. */\n placeholder?: string\n /** Shell treatment: bordered (`default`), soft-filled, or chrome-less. */\n variant?: InputVariant\n /** Height step / control font / slot icon size. */\n size?: InputSize\n /** Red border + ring; also wires `aria-invalid`. OR'd with `error`. */\n invalid?: boolean\n /** Dims the shell and disables the input + toggle. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n /** Controlled reveal state: `true` shows the value as plain text. */\n visible?: boolean\n /** Uncontrolled initial reveal state. */\n defaultVisible?: boolean\n /** Fires with the next reveal state when the toggle is pressed. */\n onVisibleChange?: (visible: boolean) => void\n /**\n * Content of the reveal button, called with the current state — the button\n * itself (and its `aria-*` wiring) stays the kit's. Its accessible name\n * still comes from `translations`: if you render visible text, pass\n * `translations` whose label contains that text (WCAG 2.5.3).\n */\n renderToggle?: (visible: boolean) => ReactNode\n /**\n * Renders no reveal button at all; pair it with `visible` driven by your\n * own control. `renderToggle` is ignored while it is set.\n */\n hideToggle?: boolean\n /**\n * `tabIndex` of the reveal button. Defaults to `0`, so keyboard users can\n * reach it; `-1` takes it out of the tab order, leaving it a pointer-only\n * convenience.\n */\n toggleTabIndex?: number\n /** Localized accessible label of the reveal button. It names the button\n * even when `renderToggle` renders text, so it must contain that text. */\n translations?: PasswordInputTranslations\n /** Decorative or interactive content at the inline-start of the control. */\n startSlot?: ReactNode\n /** Explicit id for label association. */\n id?: string\n /** Lands on the underlying `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the input; drives touched / blurred validation. */\n onBlur?: (e: FocusEvent<HTMLInputElement>) => void\n /** Styles the shell root. */\n className?: string\n /** Per-part class overrides. `visibilityTrigger` lands on the reveal\n * button, merged after the kit's own classes so it can override them. */\n classNames?: { field?: string; root?: string; input?: string; visibilityTrigger?: string }\n }\n\n/**\n * The real `<input>`, split out so it reads the `Field` context from *inside*\n * the wrapping `FieldShell` — `PasswordInput` itself renders that shell, so\n * calling `useFieldContext()` at its own top level would run too early.\n */\nconst PasswordInputField = ({\n ref,\n value,\n defaultValue,\n onChange,\n onBlur,\n name,\n placeholder,\n testId,\n className,\n}: Pick<\n PasswordInputProps,\n \"ref\" | \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"name\" | \"placeholder\" | \"testId\"\n> & { className?: string }) => {\n const field = useFieldContext()\n return (\n <Ark.Input\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n onBlur={onBlur}\n name={name}\n placeholder={placeholder}\n {...fieldA11yProps(field)}\n {...props({ \"data-testid\": testId })}\n className={className}\n />\n )\n}\n\n/**\n * The reveal button. Built from the machine's trigger props rather than Ark's\n * `VisibilityTrigger` part, because two of those props are wrong for a\n * reveal toggle and `mergeProps` can't remove a key, only override it:\n *\n * - `tabIndex: -1` — overridden by `tabIndex` (default `0`).\n * - `aria-expanded` — dropped. Showing a value isn't expanding anything, so\n * AT announced \"Hide password, expanded\". The state already lives in the\n * label, which flips between \"Show password\" and \"Hide password\"; an\n * `aria-pressed` on top would read \"Hide password, pressed\", which the\n * ARIA APG advises against for a toggle whose label changes with state.\n *\n * zag toggles on `pointerdown` only, so a keyboard press (Enter / Space) or an\n * AT \"click\" — both a `click` with `detail === 0` — did nothing. `onClick`\n * covers them, with the same read-only / disabled guard the machine applies.\n *\n * The `aria-label` always comes from `translations` (zag's English default\n * otherwise), so it overrides whatever `renderToggle` renders. For an icon\n * that's what you want; for visible text it fails WCAG 2.5.3 (Label in Name)\n * unless the label contains that text — a voice-control user saying \"click\n * Afficher\" can't hit a button named \"Show password\". Content can't be read\n * at render time, so `custom` turns on a dev-only check of the rendered DOM.\n */\nconst PasswordInputToggle = ({\n tabIndex,\n custom,\n className,\n children,\n}: {\n tabIndex: number\n custom: boolean\n className: string\n children: ReactNode\n}) => {\n const api = usePasswordInputContext()\n const { \"aria-expanded\": _expanded, ...trigger } = api.getVisibilityTriggerProps()\n const label = trigger[\"aria-label\"]\n const ref = useRef<HTMLButtonElement>(null)\n useEffect(() => {\n if (!custom) return\n const text = ref.current?.textContent?.trim() ?? \"\"\n // Only real words count — an icon contributes no text content.\n if (!/\\p{L}/u.test(text)) return\n if (label?.toLocaleLowerCase().includes(text.toLocaleLowerCase())) return\n devWarn(\n `PasswordInput: \\`renderToggle\\` renders the text \"${text}\", but the button's accessible name is \"${label}\". ` +\n \"Pass `translations.visibilityTrigger` returning a label that contains the visible text (WCAG 2.5.3, Label in Name).\",\n )\n }, [custom, label])\n // The machine's own resolved read-only state (prop or Field) — the trigger\n // props only carry it as an untyped `data-readonly`.\n const interactive = !api.disabled && !api.getInputProps().readOnly\n return (\n <button\n {...trigger}\n ref={ref}\n tabIndex={tabIndex}\n className={className}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n // Pointer clicks were already handled on pointerdown.\n if (event.detail !== 0 || !interactive) return\n api.toggleVisible()\n }}\n >\n {children}\n </button>\n )\n}\n\nexport const PasswordInput = ({\n value,\n defaultValue,\n onChange,\n name,\n placeholder,\n variant,\n size,\n invalid,\n disabled,\n readOnly,\n required,\n label,\n description,\n error,\n visible,\n defaultVisible,\n onVisibleChange,\n renderToggle,\n hideToggle,\n toggleTabIndex = 0,\n translations,\n startSlot,\n id,\n ref,\n onBlur,\n className,\n classNames,\n testId,\n}: PasswordInputProps) => {\n // Drive the red state independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n visible={visible}\n defaultVisible={defaultVisible}\n onVisibilityChange={(details) => onVisibleChange?.(details.visible)}\n translations={translations}\n >\n <InputBase\n variant={variant}\n size={size}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n startSlot={startSlot}\n className={className}\n classNames={{ root: classNames?.root }}\n >\n <PasswordInputField\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n onBlur={onBlur}\n name={name}\n placeholder={placeholder}\n testId={testId}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {/* Rendered as a direct sibling — NOT via InputBase's `endSlot`, whose\n wrapper span is `aria-hidden` — so the toggle button stays clickable\n and keyboard-focusable / announced to assistive tech. */}\n {!hideToggle && (\n <PasswordInputToggle\n tabIndex={toggleTabIndex}\n custom={renderToggle !== undefined}\n className={cn(\n inputSlot,\n \"cursor-pointer rounded-xs\",\n // Its own ring, not just the shell's: the shell's `:has()`\n // halo is already on while the input is focused, so it can't\n // tell a keyboard user that focus moved onto the toggle. No\n // offset — the gap would be painted in the page color, a hole\n // punched in the shell's own fill.\n focusStyles({ offset: false }),\n classNames?.visibilityTrigger,\n )}\n >\n {renderToggle ? (\n <Ark.Context>{(api) => renderToggle(api.visible)}</Ark.Context>\n ) : (\n <Ark.Indicator fallback={<Eye />}>\n <EyeOff />\n </Ark.Indicator>\n )}\n </PasswordInputToggle>\n )}\n </InputBase>\n </Ark.Root>\n </FieldShell>\n )\n}\n"]}