@42-central/ui-react 0.26.0 → 0.28.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 (220) hide show
  1. package/dist/{chunk-YZJUPYPO.js → chunk-2W7H43WL.js} +3 -3
  2. package/dist/{chunk-YZJUPYPO.js.map → chunk-2W7H43WL.js.map} +1 -1
  3. package/dist/{chunk-OVT2KZHY.js → chunk-3KARNPW4.js} +3 -3
  4. package/dist/{chunk-OVT2KZHY.js.map → chunk-3KARNPW4.js.map} +1 -1
  5. package/dist/chunk-6B2GNPJP.js +43 -0
  6. package/dist/chunk-6B2GNPJP.js.map +1 -0
  7. package/dist/{chunk-E52Z2FKU.js → chunk-7BY5I2RB.js} +3 -3
  8. package/dist/{chunk-E52Z2FKU.js.map → chunk-7BY5I2RB.js.map} +1 -1
  9. package/dist/{chunk-JFB6O7IY.js → chunk-7KFUFAVP.js} +4 -4
  10. package/dist/{chunk-JFB6O7IY.js.map → chunk-7KFUFAVP.js.map} +1 -1
  11. package/dist/{chunk-X3YIHN2U.js → chunk-ASKQ6N5V.js} +3 -3
  12. package/dist/{chunk-X3YIHN2U.js.map → chunk-ASKQ6N5V.js.map} +1 -1
  13. package/dist/{chunk-6IRMKF5T.js → chunk-B4GNSSHU.js} +4 -4
  14. package/dist/{chunk-6IRMKF5T.js.map → chunk-B4GNSSHU.js.map} +1 -1
  15. package/dist/{chunk-BMEJBY6H.js → chunk-B5YHYI7E.js} +22 -27
  16. package/dist/chunk-B5YHYI7E.js.map +1 -0
  17. package/dist/{chunk-PT22KEVD.js → chunk-BGDVUC3B.js} +5 -5
  18. package/dist/{chunk-PT22KEVD.js.map → chunk-BGDVUC3B.js.map} +1 -1
  19. package/dist/{chunk-7247WBTV.js → chunk-DJ72KP32.js} +3 -3
  20. package/dist/{chunk-7247WBTV.js.map → chunk-DJ72KP32.js.map} +1 -1
  21. package/dist/{chunk-7OGZT7U2.js → chunk-G3AD3NJG.js} +3 -3
  22. package/dist/{chunk-7OGZT7U2.js.map → chunk-G3AD3NJG.js.map} +1 -1
  23. package/dist/{chunk-276RL7FX.js → chunk-GJFCIG34.js} +8 -8
  24. package/dist/{chunk-276RL7FX.js.map → chunk-GJFCIG34.js.map} +1 -1
  25. package/dist/{chunk-JDPVD2YE.js → chunk-HCHGERDB.js} +3 -3
  26. package/dist/{chunk-JDPVD2YE.js.map → chunk-HCHGERDB.js.map} +1 -1
  27. package/dist/{chunk-H7WOMZXO.js → chunk-HWBFRDX7.js} +16 -8
  28. package/dist/chunk-HWBFRDX7.js.map +1 -0
  29. package/dist/{chunk-LYGOFMXJ.js → chunk-I4IJOLNA.js} +4 -4
  30. package/dist/{chunk-LYGOFMXJ.js.map → chunk-I4IJOLNA.js.map} +1 -1
  31. package/dist/{chunk-7B44J3CF.js → chunk-I53TMAV2.js} +6 -6
  32. package/dist/{chunk-7B44J3CF.js.map → chunk-I53TMAV2.js.map} +1 -1
  33. package/dist/{chunk-DSZF2TW6.js → chunk-IA6DCC3N.js} +6 -6
  34. package/dist/{chunk-DSZF2TW6.js.map → chunk-IA6DCC3N.js.map} +1 -1
  35. package/dist/{chunk-QEAF57ZQ.js → chunk-ISX3AM32.js} +3 -3
  36. package/dist/{chunk-QEAF57ZQ.js.map → chunk-ISX3AM32.js.map} +1 -1
  37. package/dist/{chunk-N42EFOML.js → chunk-K3FZHYJL.js} +6 -6
  38. package/dist/chunk-K3FZHYJL.js.map +1 -0
  39. package/dist/{chunk-ZVECQBGG.js → chunk-KNGSO7A3.js} +41 -13
  40. package/dist/chunk-KNGSO7A3.js.map +1 -0
  41. package/dist/{chunk-NLSJ6T7V.js → chunk-KYVXPSNW.js} +4 -4
  42. package/dist/{chunk-NLSJ6T7V.js.map → chunk-KYVXPSNW.js.map} +1 -1
  43. package/dist/{chunk-J2NW7JID.js → chunk-L5GH7LLD.js} +3 -3
  44. package/dist/{chunk-J2NW7JID.js.map → chunk-L5GH7LLD.js.map} +1 -1
  45. package/dist/{chunk-THGJLR5S.js → chunk-NNPSBC7O.js} +5 -5
  46. package/dist/{chunk-THGJLR5S.js.map → chunk-NNPSBC7O.js.map} +1 -1
  47. package/dist/{chunk-YMVUQ2L7.js → chunk-P7SH3XWY.js} +6 -6
  48. package/dist/chunk-P7SH3XWY.js.map +1 -0
  49. package/dist/{chunk-2CL3FKEY.js → chunk-QEMXXQQO.js} +3 -3
  50. package/dist/{chunk-2CL3FKEY.js.map → chunk-QEMXXQQO.js.map} +1 -1
  51. package/dist/{chunk-2NTCQIRP.js → chunk-QRNQQIQM.js} +5 -5
  52. package/dist/{chunk-2NTCQIRP.js.map → chunk-QRNQQIQM.js.map} +1 -1
  53. package/dist/{chunk-LKFHUDEW.js → chunk-QVOBLRCM.js} +3 -3
  54. package/dist/{chunk-LKFHUDEW.js.map → chunk-QVOBLRCM.js.map} +1 -1
  55. package/dist/{chunk-E3XLWMEB.js → chunk-RKCUXOU2.js} +4 -4
  56. package/dist/{chunk-E3XLWMEB.js.map → chunk-RKCUXOU2.js.map} +1 -1
  57. package/dist/{chunk-DMI4KS32.js → chunk-SBZJGFZ6.js} +3 -3
  58. package/dist/{chunk-DMI4KS32.js.map → chunk-SBZJGFZ6.js.map} +1 -1
  59. package/dist/{chunk-7P32XCEU.js → chunk-SLUOF7XW.js} +2 -2
  60. package/dist/chunk-SLUOF7XW.js.map +1 -0
  61. package/dist/{chunk-SCXXJDKQ.js → chunk-SP6LCCTZ.js} +21 -28
  62. package/dist/chunk-SP6LCCTZ.js.map +1 -0
  63. package/dist/{chunk-Y2G47ARQ.js → chunk-TGGNSSOJ.js} +3 -3
  64. package/dist/{chunk-Y2G47ARQ.js.map → chunk-TGGNSSOJ.js.map} +1 -1
  65. package/dist/{chunk-2TZU4LSX.js → chunk-ULF5LOBS.js} +3 -3
  66. package/dist/{chunk-2TZU4LSX.js.map → chunk-ULF5LOBS.js.map} +1 -1
  67. package/dist/{chunk-D2QIPQ74.js → chunk-W3XX7BYT.js} +2 -2
  68. package/dist/chunk-W3XX7BYT.js.map +1 -0
  69. package/dist/{chunk-F374BNL4.js → chunk-YVTM2KRR.js} +12 -8
  70. package/dist/chunk-YVTM2KRR.js.map +1 -0
  71. package/dist/colors.css +328 -0
  72. package/dist/components/action-icon/action-icon.d.ts +6 -5
  73. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  74. package/dist/components/action-icon/index.js +3 -2
  75. package/dist/components/alert/index.js +2 -2
  76. package/dist/components/app-shell/index.js +7 -6
  77. package/dist/components/app-shell/index.js.map +1 -1
  78. package/dist/components/autocomplete/index.js +4 -4
  79. package/dist/components/badge/badge.d.ts +1 -1
  80. package/dist/components/badge/badge.d.ts.map +1 -1
  81. package/dist/components/badge/index.js +2 -1
  82. package/dist/components/button/button.d.ts +11 -9
  83. package/dist/components/button/button.d.ts.map +1 -1
  84. package/dist/components/button/index.js +3 -2
  85. package/dist/components/button-multi-select/index.js +4 -3
  86. package/dist/components/button-multi-select/index.js.map +1 -1
  87. package/dist/components/button-select/index.js +4 -3
  88. package/dist/components/button-select/index.js.map +1 -1
  89. package/dist/components/calendar/index.js +4 -3
  90. package/dist/components/calendar-heatmap/index.js +2 -2
  91. package/dist/components/camera/index.js +11 -10
  92. package/dist/components/clipboard/index.js +3 -2
  93. package/dist/components/clipboard/index.js.map +1 -1
  94. package/dist/components/code-block/chrome.js +5 -5
  95. package/dist/components/code-block/index.js +6 -6
  96. package/dist/components/combobox/index.js +4 -4
  97. package/dist/components/combobox-list/index.js +6 -6
  98. package/dist/components/data-table/data-table-features.d.ts +8 -0
  99. package/dist/components/data-table/data-table-features.d.ts.map +1 -1
  100. package/dist/components/data-table/data-table-group.d.ts +128 -0
  101. package/dist/components/data-table/data-table-group.d.ts.map +1 -0
  102. package/dist/components/data-table/data-table-grouping.d.ts +72 -0
  103. package/dist/components/data-table/data-table-grouping.d.ts.map +1 -0
  104. package/dist/components/data-table/data-table-icons.d.ts +4 -2
  105. package/dist/components/data-table/data-table-icons.d.ts.map +1 -1
  106. package/dist/components/data-table/data-table-meta.d.ts +9 -0
  107. package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
  108. package/dist/components/data-table/data-table-pagination.d.ts +4 -1
  109. package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
  110. package/dist/components/data-table/data-table-schema.d.ts +4 -0
  111. package/dist/components/data-table/data-table-schema.d.ts.map +1 -1
  112. package/dist/components/data-table/data-table-stack.d.ts +16 -3
  113. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  114. package/dist/components/data-table/data-table-toolbar.d.ts +33 -2
  115. package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
  116. package/dist/components/data-table/data-table-translations.d.ts +35 -0
  117. package/dist/components/data-table/data-table-translations.d.ts.map +1 -1
  118. package/dist/components/data-table/data-table.d.ts +55 -3
  119. package/dist/components/data-table/data-table.d.ts.map +1 -1
  120. package/dist/components/data-table/index.d.ts +3 -1
  121. package/dist/components/data-table/index.d.ts.map +1 -1
  122. package/dist/components/data-table/index.js +883 -234
  123. package/dist/components/data-table/index.js.map +1 -1
  124. package/dist/components/date-picker/index.js +12 -11
  125. package/dist/components/date-picker/index.js.map +1 -1
  126. package/dist/components/download-button/index.js +4 -3
  127. package/dist/components/drawer/index.js +7 -6
  128. package/dist/components/file-item/index.js +4 -3
  129. package/dist/components/file-preview/index.js +4 -3
  130. package/dist/components/file-preview/index.js.map +1 -1
  131. package/dist/components/file-trigger/index.js +4 -3
  132. package/dist/components/file-upload/index.js +4 -3
  133. package/dist/components/file-upload/index.js.map +1 -1
  134. package/dist/components/hover-card/index.js +3 -3
  135. package/dist/components/image-cropper/index.js +4 -3
  136. package/dist/components/kbd/index.js +3 -3
  137. package/dist/components/lightbox/index.js +9 -8
  138. package/dist/components/lightbox/index.js.map +1 -1
  139. package/dist/components/menu/index.js +4 -4
  140. package/dist/components/modal/index.js +7 -6
  141. package/dist/components/multi-combobox-list/index.js +6 -6
  142. package/dist/components/multi-select/index.js +4 -4
  143. package/dist/components/nav-link/index.js +3 -3
  144. package/dist/components/nav-link/tanstack.js +3 -3
  145. package/dist/components/notification/create-notifier.d.ts.map +1 -1
  146. package/dist/components/notification/index.js +18 -6
  147. package/dist/components/notification/index.js.map +1 -1
  148. package/dist/components/notification/types.d.ts +5 -0
  149. package/dist/components/notification/types.d.ts.map +1 -1
  150. package/dist/components/number-input/index.js +4 -4
  151. package/dist/components/overlays/index.js +9 -8
  152. package/dist/components/overlays/index.js.map +1 -1
  153. package/dist/components/photo-capture/index.js +13 -12
  154. package/dist/components/photo-capture/index.js.map +1 -1
  155. package/dist/components/popover/index.js +3 -3
  156. package/dist/components/schedule/index.js +7 -6
  157. package/dist/components/schedule/index.js.map +1 -1
  158. package/dist/components/select/index.js +5 -5
  159. package/dist/components/spinner/index.js +1 -1
  160. package/dist/components/spinner/spinner.d.ts +1 -1
  161. package/dist/components/spinner/spinner.d.ts.map +1 -1
  162. package/dist/components/spotlight/index.js +11 -10
  163. package/dist/components/spotlight/index.js.map +1 -1
  164. package/dist/components/tags-input/index.js +3 -3
  165. package/dist/components/theme-icon/index.js +1 -1
  166. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  167. package/dist/components/time-input/index.js +5 -5
  168. package/dist/components/tooltip/index.js +2 -2
  169. package/dist/components/tree-multi-select/index.js +4 -4
  170. package/dist/components/tree-select/index.js +4 -4
  171. package/dist/index.js +2 -2
  172. package/dist/lib/button-colors.d.ts +25 -0
  173. package/dist/lib/button-colors.d.ts.map +1 -0
  174. package/dist/lib/overlay-container.d.ts.map +1 -1
  175. package/dist/lib/overlay-layer.d.ts +10 -3
  176. package/dist/lib/overlay-layer.d.ts.map +1 -1
  177. package/dist/theme.css +14 -6
  178. package/package.json +1 -1
  179. package/src/colors.css +328 -0
  180. package/src/components/action-icon/action-icon.test.tsx +22 -0
  181. package/src/components/action-icon/action-icon.tsx +24 -28
  182. package/src/components/badge/badge.test.tsx +53 -10
  183. package/src/components/badge/badge.tsx +64 -11
  184. package/src/components/button/button.test.tsx +41 -5
  185. package/src/components/button/button.tsx +28 -33
  186. package/src/components/data-table/data-table-features.ts +11 -0
  187. package/src/components/data-table/data-table-group.test.tsx +1007 -0
  188. package/src/components/data-table/data-table-group.tsx +474 -0
  189. package/src/components/data-table/data-table-grouping.ts +160 -0
  190. package/src/components/data-table/data-table-icons.tsx +8 -1
  191. package/src/components/data-table/data-table-meta.ts +9 -0
  192. package/src/components/data-table/data-table-pagination.tsx +5 -1
  193. package/src/components/data-table/data-table-stack.tsx +165 -43
  194. package/src/components/data-table/data-table-toolbar.tsx +110 -2
  195. package/src/components/data-table/data-table-translations.ts +44 -0
  196. package/src/components/data-table/data-table.tsx +420 -150
  197. package/src/components/data-table/index.ts +4 -0
  198. package/src/components/drawer/drawer.tsx +1 -1
  199. package/src/components/modal/modal.tsx +1 -1
  200. package/src/components/notification/create-notifier.tsx +18 -2
  201. package/src/components/notification/notify-in-modal.test.tsx +128 -0
  202. package/src/components/notification/types.ts +5 -0
  203. package/src/components/spinner/spinner.tsx +3 -3
  204. package/src/components/theme-icon/theme-icon.test.tsx +7 -0
  205. package/src/components/theme-icon/theme-icon.tsx +10 -6
  206. package/src/lib/button-colors.ts +55 -0
  207. package/src/lib/overlay-container.tsx +2 -1
  208. package/src/lib/overlay-layer.test.tsx +63 -1
  209. package/src/lib/overlay-layer.tsx +29 -6
  210. package/src/theme.css +14 -6
  211. package/src/theme.test.ts +14 -10
  212. package/dist/chunk-7P32XCEU.js.map +0 -1
  213. package/dist/chunk-BMEJBY6H.js.map +0 -1
  214. package/dist/chunk-D2QIPQ74.js.map +0 -1
  215. package/dist/chunk-F374BNL4.js.map +0 -1
  216. package/dist/chunk-H7WOMZXO.js.map +0 -1
  217. package/dist/chunk-N42EFOML.js.map +0 -1
  218. package/dist/chunk-SCXXJDKQ.js.map +0 -1
  219. package/dist/chunk-YMVUQ2L7.js.map +0 -1
  220. package/dist/chunk-ZVECQBGG.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { Context, SubContent, SubTrigger, Sub, RadioItem, RadioGroup, CheckboxItem, Separator, Divider, ItemGroupLabel, ItemGroup, Label, Item, Content, ContextTrigger, Trigger, Root } from '../../chunk-PT22KEVD.js';
3
- import '../../chunk-E3XLWMEB.js';
4
- import '../../chunk-H7WOMZXO.js';
2
+ import { Context, SubContent, SubTrigger, Sub, RadioItem, RadioGroup, CheckboxItem, Separator, Divider, ItemGroupLabel, ItemGroup, Label, Item, Content, ContextTrigger, Trigger, Root } from '../../chunk-BGDVUC3B.js';
3
+ import '../../chunk-RKCUXOU2.js';
4
+ import '../../chunk-HWBFRDX7.js';
5
5
  import '../../chunk-V6PY7C6S.js';
6
- import '../../chunk-7P32XCEU.js';
6
+ import '../../chunk-SLUOF7XW.js';
7
7
  import '../../chunk-LIZWCWED.js';
8
8
  import '../../chunk-PMUCGFY5.js';
9
9
  import '../../chunk-BUIHQJGE.js';
@@ -1,13 +1,14 @@
1
1
  "use client";
2
- export { Modal } from '../../chunk-N42EFOML.js';
3
- import '../../chunk-NLSJ6T7V.js';
4
- import '../../chunk-H7WOMZXO.js';
5
- import '../../chunk-7P32XCEU.js';
6
- import '../../chunk-BMEJBY6H.js';
2
+ export { Modal } from '../../chunk-K3FZHYJL.js';
3
+ import '../../chunk-KYVXPSNW.js';
4
+ import '../../chunk-HWBFRDX7.js';
5
+ import '../../chunk-SLUOF7XW.js';
6
+ import '../../chunk-B5YHYI7E.js';
7
+ import '../../chunk-6B2GNPJP.js';
7
8
  import '../../chunk-LIZWCWED.js';
8
9
  import '../../chunk-BUIHQJGE.js';
9
10
  import '../../chunk-XXOR34T4.js';
10
- import '../../chunk-D2QIPQ74.js';
11
+ import '../../chunk-W3XX7BYT.js';
11
12
  import '../../chunk-R5LYFTHA.js';
12
13
  import '../../chunk-WYCMIIRR.js';
13
14
  import '../../chunk-C6NVU4F7.js';
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- export { MultiComboboxList } from '../../chunk-JFB6O7IY.js';
3
- import '../../chunk-QEAF57ZQ.js';
2
+ export { MultiComboboxList } from '../../chunk-7KFUFAVP.js';
3
+ import '../../chunk-ISX3AM32.js';
4
4
  import '../../chunk-NLOBBJAA.js';
5
5
  import '../../chunk-7TDHT3QD.js';
6
- import '../../chunk-2NTCQIRP.js';
6
+ import '../../chunk-QRNQQIQM.js';
7
7
  import '../../chunk-I4B3N3UX.js';
8
8
  import '../../chunk-X6DESK37.js';
9
- import '../../chunk-E3XLWMEB.js';
10
- import '../../chunk-H7WOMZXO.js';
9
+ import '../../chunk-RKCUXOU2.js';
10
+ import '../../chunk-HWBFRDX7.js';
11
11
  import '../../chunk-V6PY7C6S.js';
12
- import '../../chunk-7P32XCEU.js';
12
+ import '../../chunk-SLUOF7XW.js';
13
13
  import '../../chunk-PMUCGFY5.js';
14
14
  import '../../chunk-BUIHQJGE.js';
15
15
  import '../../chunk-6YNLRQ25.js';
@@ -2,16 +2,16 @@
2
2
  import { usePillOverflow, PillOverflowCounter, pillsContent, pillsShell } from '../../chunk-PFZMB3US.js';
3
3
  import { Pill } from '../../chunk-6M6YZ3PQ.js';
4
4
  import { normalizeSelectData, useLabelSearch, filterSelectData } from '../../chunk-7TDHT3QD.js';
5
- import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from '../../chunk-2NTCQIRP.js';
5
+ import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from '../../chunk-QRNQQIQM.js';
6
6
  import { controlOpenProps } from '../../chunk-5FDOOG4J.js';
7
7
  import { inputSlot, inputControlClasses, placeholderColor, inputShell } from '../../chunk-I4B3N3UX.js';
8
8
  import { FieldShell } from '../../chunk-X6DESK37.js';
9
9
  import '../../chunk-2LI3VPDP.js';
10
10
  import '../../chunk-IUK7OJXZ.js';
11
- import '../../chunk-E3XLWMEB.js';
12
- import '../../chunk-H7WOMZXO.js';
11
+ import '../../chunk-RKCUXOU2.js';
12
+ import '../../chunk-HWBFRDX7.js';
13
13
  import '../../chunk-V6PY7C6S.js';
14
- import '../../chunk-7P32XCEU.js';
14
+ import '../../chunk-SLUOF7XW.js';
15
15
  import '../../chunk-LIZWCWED.js';
16
16
  import { useUncontrolled } from '../../chunk-PMUCGFY5.js';
17
17
  import '../../chunk-BUIHQJGE.js';
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- export { NavLink, Navigation } from '../../chunk-J2NW7JID.js';
2
+ export { NavLink, Navigation } from '../../chunk-L5GH7LLD.js';
3
3
  import '../../chunk-LJVIZNPE.js';
4
4
  import '../../chunk-GTKKRV5N.js';
5
- import '../../chunk-YZJUPYPO.js';
5
+ import '../../chunk-2W7H43WL.js';
6
6
  import '../../chunk-V6PY7C6S.js';
7
- import '../../chunk-7P32XCEU.js';
7
+ import '../../chunk-SLUOF7XW.js';
8
8
  import '../../chunk-PMUCGFY5.js';
9
9
  import '../../chunk-BUIHQJGE.js';
10
10
  import '../../chunk-6YNLRQ25.js';
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { NavLink, Navigation } from '../../chunk-J2NW7JID.js';
2
+ import { NavLink, Navigation } from '../../chunk-L5GH7LLD.js';
3
3
  import '../../chunk-LJVIZNPE.js';
4
4
  import '../../chunk-GTKKRV5N.js';
5
- import '../../chunk-YZJUPYPO.js';
5
+ import '../../chunk-2W7H43WL.js';
6
6
  import '../../chunk-V6PY7C6S.js';
7
- import '../../chunk-7P32XCEU.js';
7
+ import '../../chunk-SLUOF7XW.js';
8
8
  import '../../chunk-PMUCGFY5.js';
9
9
  import '../../chunk-BUIHQJGE.js';
10
10
  import '../../chunk-6YNLRQ25.js';
@@ -1 +1 @@
1
- {"version":3,"file":"create-notifier.d.ts","sourceRoot":"","sources":["../../../src/components/notification/create-notifier.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,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AAE,QAAQ,CAAA;IACjB,IAAI,EAAE,QAAQ,CAAA;IACd,OAAO,EAAE,QAAQ,CAAA;IACjB,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,YAAY,CAAA;IACpB,6DAA6D;IAC7D,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/B,sDAAsD;IACtD,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7B,uEAAuE;IACvE,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAA;IAC7B,wDAAwD;IACxD,SAAS,EAAE,MAAM,SAAS,EAAE,CAAA;CAC7B,CAAA;AAED;iDACiD;AACjD,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,GAAG;IACjE,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B;0BACsB;IACtB,YAAY,CAAC,EAAE,yBAAyB,CAAA;IACxC;2CACuC;IACvC,KAAK,CAAC,EAAE,iBAAiB,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAA;CACxD,CAAA;AAmLD,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,QAAQ,CA6O5E"}
1
+ {"version":3,"file":"create-notifier.d.ts","sourceRoot":"","sources":["../../../src/components/notification/create-notifier.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAI7C,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC9B,MAAM,gBAA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,EAAE,QAAQ,CAAA;IACjB,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,YAAY,CAAA;IACpB,6DAA6D;IAC7D,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/B,sDAAsD;IACtD,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7B,uEAAuE;IACvE,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAA;IAC7B,wDAAwD;IACxD,SAAS,EAAE,MAAM,SAAS,EAAE,CAAA;CAC7B,CAAA;AAED;iDACiD;AACjD,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,GAAG;IACjE,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B;0BACsB;IACtB,YAAY,CAAC,EAAE,yBAAyB,CAAA;IACxC;2CACuC;IACvC,KAAK,CAAC,EAAE,iBAAiB,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAA;CACxD,CAAA;AAoLD,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,QAAQ,CA2P5E"}
@@ -1,14 +1,15 @@
1
1
  "use client";
2
2
  import { useDocumentVisibility } from '../../chunk-WG3BCIU4.js';
3
3
  import { useMergedRefs } from '../../chunk-HBWV5EPU.js';
4
- import { NOTIFICATION_DEFAULT_TRANSLATIONS, Notification } from '../../chunk-LKFHUDEW.js';
5
- export { Notification, notificationRoot } from '../../chunk-LKFHUDEW.js';
4
+ import { isModalOpen } from '../../chunk-HWBFRDX7.js';
5
+ import { NOTIFICATION_DEFAULT_TRANSLATIONS, Notification } from '../../chunk-QVOBLRCM.js';
6
+ export { Notification, notificationRoot } from '../../chunk-QVOBLRCM.js';
6
7
  import '../../chunk-PMUCGFY5.js';
7
8
  import '../../chunk-BUIHQJGE.js';
8
9
  import '../../chunk-6YNLRQ25.js';
9
10
  import '../../chunk-NKOTA5TM.js';
10
11
  import '../../chunk-XXOR34T4.js';
11
- import '../../chunk-D2QIPQ74.js';
12
+ import '../../chunk-W3XX7BYT.js';
12
13
  import '../../chunk-R5LYFTHA.js';
13
14
  import '../../chunk-WYCMIIRR.js';
14
15
  import '../../chunk-C6NVU4F7.js';
@@ -165,7 +166,7 @@ function ToasterItem({
165
166
  joined
166
167
  }) {
167
168
  const { id } = toast;
168
- const { type, color, ...fields } = toast;
169
+ const { type, color, raised: _raised, ...fields } = toast;
169
170
  const hue = type ? { type } : { color };
170
171
  const presence = usePresence({
171
172
  present: toast.status === "open",
@@ -266,7 +267,12 @@ function createNotifier(options = {}) {
266
267
  color: type === void 0 ? o.color : void 0,
267
268
  icon: o.icon,
268
269
  duration: o.duration ?? (type === "loading" ? Number.POSITIVE_INFINITY : defaultDuration),
269
- withCloseButton: o.withCloseButton ?? true
270
+ withCloseButton: o.withCloseButton ?? true,
271
+ // A toast is feedback on what the user just did, so if they did it in a
272
+ // modal it must show over the modal. Only ever set, never cleared: the
273
+ // store merges a re-create by id, so a promise settling after the modal
274
+ // closed keeps its place. See `--toast-raised-z` in theme.css.
275
+ ...isModalOpen() && { raised: true }
270
276
  };
271
277
  };
272
278
  const status = (type) => (input) => store.create(toData(input, type));
@@ -359,6 +365,7 @@ function createNotifier(options = {}) {
359
365
  const expandedHeight = toasts.reduce((sum, toast) => sum + heightOf(toast), 0) + GAP * Math.max(0, toasts.length - 1);
360
366
  const maxHeight = toasts.reduce((max2, toast) => Math.max(max2, heightOf(toast)), 0);
361
367
  const stackOverflow = placement.startsWith("bottom") ? Math.max(0, maxHeight - frontHeight) : 0;
368
+ const raised = toasts.some((toast) => toast.raised);
362
369
  const region = /* @__PURE__ */ jsx(
363
370
  "section",
364
371
  {
@@ -366,9 +373,14 @@ function createNotifier(options = {}) {
366
373
  "data-scope": "notifications",
367
374
  "data-placement": placement,
368
375
  "data-expand": expand ? "" : void 0,
376
+ "data-raised": raised ? "" : void 0,
377
+ "data-live-announcer": "",
369
378
  style: { ["--toast-from"]: placement.startsWith("top") ? "-100%" : "100%" },
370
379
  className: cn(
371
- "pointer-events-none fixed z-(--toast-z,100) justify-center flex",
380
+ "pointer-events-none fixed justify-center flex",
381
+ // Under modals by default; above them while it holds a toast created
382
+ // from inside one (theme.css, OVERLAY STACKING).
383
+ raised ? "z-(--toast-raised-z,200)" : "z-(--toast-z,100)",
372
384
  REGION_POSITION[placement],
373
385
  // Phones (< xs): pin to the bottom, full-bleed, above the safe area.
374
386
  "max-xs:inset-x-0! max-xs:bottom-[calc(1rem+env(safe-area-inset-bottom))]! max-xs:top-auto! max-xs:translate-x-0!"
@@ -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;AACvC,EAAA,IAAI,MAAA,GAAS,KAAA;AAEb,EAAA,MAAM,OAAO,MAAM;AACjB,IAAA,KAAA,MAAW,QAAA,IAAY,WAAW,QAAA,EAAS;AAAA,EAC7C,CAAA;AACA,EAAA,MAAM,GAAA,GAAM,CAAC,MAAA,KAAwB;AACnC,IAAA,KAAA,GAAQ,EAAE,MAAA,EAAO;AACjB,IAAA,IAAA,EAAK;AAAA,EACP,CAAA;AAEA,EAAA,MAAM,UAAA,GAAa,CAAC,EA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A,EAAG,aAAa,CAAA,EAAA,CAAA;AAAK;AAAA;AACzD;AAAA;AAAA;AAEJ;AAAA,KACF;AAGF,IAAA,IAAI,CAAC,cAAc,OAAO,MAAA;AAC1B,IAAA,uBAAO,GAAA,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 { useMergedRefs } from \"../../lib/merge-refs\"\nimport { useDocumentVisibility } from \"../../lib/use-document-visibility\"\nimport {\n NOTIFICATION_DEFAULT_TRANSLATIONS,\n Notification,\n type NotificationIcons,\n type NotificationTranslations,\n} from \"./notification\"\nimport { createToastStore, type ToastStore } from \"./store\"\nimport type { ColorWithTypeReason, ToastData, ToastHue, ToastId, ToastType } from \"./types\"\n\n/** The region's name plus the card's own names: the base a `<Notifications translations>`\n * override is merged onto, once, before it reaches every toast. */\nconst NOTIFICATIONS_DEFAULT_TRANSLATIONS = {\n ...NOTIFICATION_DEFAULT_TRANSLATIONS,\n regionLabel: \"Notifications\",\n} as const satisfies Required<NotificationsTranslations>\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 /** Replaces every toast's default icons (see `Notification`'s `icons`); a toast's own `icon`\n * still wins over its status icon. */\n icons?: NotificationIcons\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 icons?: NotificationIcons\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 /** Already live when the region mounted (a remount on navigation, say), so it was announced\n * when it first arrived: it joins politely rather than as an alert. */\n joined: boolean\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 icons,\n store,\n index,\n offset,\n height,\n frontHeight,\n onMeasure,\n joined,\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 const itemRef = useMergedRefs(presence.ref, measureRef)\n if (presence.unmounted) return null\n\n return (\n <Notification\n ref={itemRef}\n {...fields}\n {...hue}\n {...presence.getPresenceProps()}\n data-part=\"toast\"\n // Every toast is its own live region, so it's announced as it arrives and again,\n // whole, when it changes in place (`notify.update`, a promise settling): title,\n // description and action together. An error interrupts; anything else waits its\n // turn. A toast that was live before the region mounted was announced back then, and\n // a fresh `alert` would interrupt to repeat it, so it rejoins as a polite status.\n role={type === \"error\" && !joined ? \"alert\" : \"status\"}\n aria-atomic\n translations={translations}\n icons={icons}\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: overrides, icons }: NotificationsProps = {}) => {\n const translations = { ...NOTIFICATIONS_DEFAULT_TRANSLATIONS, ...overrides }\n const { toasts } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n )\n const [heights, setHeights] = useState<Record<string, number>>({})\n // The toasts live before this region mounted (see `ToasterItemProps.joined`).\n const [joined] = useState(() => new Set(store.getSnapshot().toasts.map((toast) => toast.id)))\n\n const onMeasure = useCallback((id: string, height: number) => {\n setHeights((prev) => (prev[id] === height ? prev : { ...prev, [id]: height }))\n }, [])\n\n // Auto-dismiss holds while anything needs the toasts to stay: the pointer over the stack,\n // keyboard focus inside it (WCAG 2.2.1: a keyboard user reaching an Undo gets the time\n // a hovering mouse does), or a hidden tab, so nothing expires unseen. Each source is\n // tracked apart, so one ending (the pointer leaving) can't resume timers another still\n // holds (focus on that Undo).\n const stackRef = useRef<HTMLDivElement>(null)\n const holds = useRef<Record<\"pointer\" | \"focus\" | \"hidden\", boolean>>({\n pointer: false,\n focus: false,\n hidden: false,\n })\n const hold = useCallback((source: keyof typeof holds.current, on: boolean) => {\n if (holds.current[source] === on) return\n holds.current[source] = on\n if (Object.values(holds.current).some(Boolean)) store.pauseAll()\n else store.resumeAll()\n }, [])\n\n const visibility = useDocumentVisibility()\n useEffect(() => {\n hold(\"hidden\", visibility === \"hidden\")\n }, [visibility, hold])\n\n // A focused toast can leave without a blur reaching the stack (its close button removes\n // it), so re-check focus whenever the stack changes rather than hold the timers forever.\n // biome-ignore lint/correctness/useExhaustiveDependencies: `toasts` is the trigger, not an input — any change to the stack may have taken the focused toast with it.\n useEffect(() => {\n if (!holds.current.focus) return\n if (!stackRef.current?.contains(document.activeElement)) hold(\"focus\", false)\n }, [toasts, hold])\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}\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); so does focus, which only\n lets go once it leaves the stack, not when it moves between toasts. */}\n <div\n ref={stackRef}\n data-part=\"stack\"\n onPointerEnter={() => hold(\"pointer\", true)}\n onPointerLeave={() => hold(\"pointer\", false)}\n onFocusCapture={() => hold(\"focus\", true)}\n onBlurCapture={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget)) hold(\"focus\", false)\n }}\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 icons={icons}\n store={store}\n index={index}\n offset={offset}\n height={height}\n frontHeight={frontHeight}\n onMeasure={onMeasure}\n joined={joined.has(toast.id)}\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,KAAA;AAEb,EAAA,MAAM,OAAO,MAAM;AACjB,IAAA,KAAA,MAAW,QAAA,IAAY,WAAW,QAAA,EAAS;AAAA,EAC7C,CAAA;AACA,EAAA,MAAM,GAAA,GAAM,CAAC,MAAA,KAAwB;AACnC,IAAA,KAAA,GAAQ,EAAE,MAAA,EAAO;AACjB,IAAA,IAAA,EAAK;AAAA,EACP,CAAA;AAEA,EAAA,MAAM,UAAA,GAAa,CAAC,EAAA,KAAgB;AAClC,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,GAAA,CAAI,EAAE,CAAA;A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AAM,EAAE;AAAA,iBAAA;AAAA,gBAVtB,KAAA,CAAM;AAAA,eAYd,CAAA;AAAA,cAKA,gBAAgB,CAAA,oBACf,GAAA;AAAA,gBAAC,MAAA;AAAA,gBAAA;AAAA,kBACC,aAAA,EAAW,IAAA;AAAA,kBACX,WAAA,EAAU,OAAA;AAAA,kBACV,OAAO,EAAE,CAAC,WAAqB,GAAG,CAAA,EAAG,aAAa,CAAA,EAAA,CAAA;AAAK;AAAA;AACzD;AAAA;AAAA;AAEJ;AAAA,KACF;AAGF,IAAA,IAAI,CAAC,cAAc,OAAO,MAAA;AAC1B,IAAA,uBAAO,GAAA,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 { useMergedRefs } from \"../../lib/merge-refs\"\nimport { isModalOpen } from \"../../lib/overlay-layer\"\nimport { useDocumentVisibility } from \"../../lib/use-document-visibility\"\nimport {\n NOTIFICATION_DEFAULT_TRANSLATIONS,\n Notification,\n type NotificationIcons,\n type NotificationTranslations,\n} from \"./notification\"\nimport { createToastStore, type ToastStore } from \"./store\"\nimport type { ColorWithTypeReason, ToastData, ToastHue, ToastId, ToastType } from \"./types\"\n\n/** The region's name plus the card's own names: the base a `<Notifications translations>`\n * override is merged onto, once, before it reaches every toast. */\nconst NOTIFICATIONS_DEFAULT_TRANSLATIONS = {\n ...NOTIFICATION_DEFAULT_TRANSLATIONS,\n regionLabel: \"Notifications\",\n} as const satisfies Required<NotificationsTranslations>\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 /** Replaces every toast's default icons (see `Notification`'s `icons`); a toast's own `icon`\n * still wins over its status icon. */\n icons?: NotificationIcons\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 icons?: NotificationIcons\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 /** Already live when the region mounted (a remount on navigation, say), so it was announced\n * when it first arrived: it joins politely rather than as an alert. */\n joined: boolean\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 icons,\n store,\n index,\n offset,\n height,\n frontHeight,\n onMeasure,\n joined,\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 // `raised` is the region's business, not the card's.\n const { type, color, raised: _raised, ...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 const itemRef = useMergedRefs(presence.ref, measureRef)\n if (presence.unmounted) return null\n\n return (\n <Notification\n ref={itemRef}\n {...fields}\n {...hue}\n {...presence.getPresenceProps()}\n data-part=\"toast\"\n // Every toast is its own live region, so it's announced as it arrives and again,\n // whole, when it changes in place (`notify.update`, a promise settling): title,\n // description and action together. An error interrupts; anything else waits its\n // turn. A toast that was live before the region mounted was announced back then, and\n // a fresh `alert` would interrupt to repeat it, so it rejoins as a polite status.\n role={type === \"error\" && !joined ? \"alert\" : \"status\"}\n aria-atomic\n translations={translations}\n icons={icons}\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 // A toast is feedback on what the user just did, so if they did it in a\n // modal it must show over the modal. Only ever set, never cleared: the\n // store merges a re-create by id, so a promise settling after the modal\n // closed keeps its place. See `--toast-raised-z` in theme.css.\n ...(isModalOpen() && { raised: 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: overrides, icons }: NotificationsProps = {}) => {\n const translations = { ...NOTIFICATIONS_DEFAULT_TRANSLATIONS, ...overrides }\n const { toasts } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n )\n const [heights, setHeights] = useState<Record<string, number>>({})\n // The toasts live before this region mounted (see `ToasterItemProps.joined`).\n const [joined] = useState(() => new Set(store.getSnapshot().toasts.map((toast) => toast.id)))\n\n const onMeasure = useCallback((id: string, height: number) => {\n setHeights((prev) => (prev[id] === height ? prev : { ...prev, [id]: height }))\n }, [])\n\n // Auto-dismiss holds while anything needs the toasts to stay: the pointer over the stack,\n // keyboard focus inside it (WCAG 2.2.1: a keyboard user reaching an Undo gets the time\n // a hovering mouse does), or a hidden tab, so nothing expires unseen. Each source is\n // tracked apart, so one ending (the pointer leaving) can't resume timers another still\n // holds (focus on that Undo).\n const stackRef = useRef<HTMLDivElement>(null)\n const holds = useRef<Record<\"pointer\" | \"focus\" | \"hidden\", boolean>>({\n pointer: false,\n focus: false,\n hidden: false,\n })\n const hold = useCallback((source: keyof typeof holds.current, on: boolean) => {\n if (holds.current[source] === on) return\n holds.current[source] = on\n if (Object.values(holds.current).some(Boolean)) store.pauseAll()\n else store.resumeAll()\n }, [])\n\n const visibility = useDocumentVisibility()\n useEffect(() => {\n hold(\"hidden\", visibility === \"hidden\")\n }, [visibility, hold])\n\n // A focused toast can leave without a blur reaching the stack (its close button removes\n // it), so re-check focus whenever the stack changes rather than hold the timers forever.\n // biome-ignore lint/correctness/useExhaustiveDependencies: `toasts` is the trigger, not an input — any change to the stack may have taken the focused toast with it.\n useEffect(() => {\n if (!holds.current.focus) return\n if (!stackRef.current?.contains(document.activeElement)) hold(\"focus\", false)\n }, [toasts, hold])\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 raised = toasts.some((toast) => toast.raised)\n\n const region = (\n <section\n aria-label={translations.regionLabel}\n data-scope=\"notifications\"\n data-placement={placement}\n data-expand={expand ? \"\" : undefined}\n data-raised={raised ? \"\" : undefined}\n // zag's modal dialog aria-hides everything outside it, which would\n // silence a toast raised from inside it. It skips live announcers.\n data-live-announcer=\"\"\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 justify-center flex\",\n // Under modals by default; above them while it holds a toast created\n // from inside one (theme.css, OVERLAY STACKING).\n raised ? \"z-(--toast-raised-z,200)\" : \"z-(--toast-z,100)\",\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); so does focus, which only\n lets go once it leaves the stack, not when it moves between toasts. */}\n <div\n ref={stackRef}\n data-part=\"stack\"\n onPointerEnter={() => hold(\"pointer\", true)}\n onPointerLeave={() => hold(\"pointer\", false)}\n onFocusCapture={() => hold(\"focus\", true)}\n onBlurCapture={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget)) hold(\"focus\", false)\n }}\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 icons={icons}\n store={store}\n index={index}\n offset={offset}\n height={height}\n frontHeight={frontHeight}\n onMeasure={onMeasure}\n joined={joined.has(toast.id)}\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"]}
@@ -58,5 +58,10 @@ export type ToastFields = {
58
58
  /** Render the close (×) button. Takes precedence over `withCollapse` (on the
59
59
  * ready-made `Notification`). */
60
60
  withCloseButton?: boolean;
61
+ /** Created while a Modal, Drawer or Lightbox was open: the region paints
62
+ * above modals (`--toast-raised-z`) while this toast is on screen. Set by the
63
+ * notifier, never by the caller, and kept once set, so a toast that was
64
+ * above a modal never drops under it mid-life. */
65
+ raised?: boolean;
61
66
  };
62
67
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/notification/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAE7C;0EAC0E;AAC1E,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAE9C;wEACwE;AACxE,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;AAE5E,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAC7B,6EAA6E,CAAA;AAE/E;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,SAAS,SAAS,GAAG,SAAS,IACnD;IACE,8DAA8D;IAC9D,IAAI,EAAE,IAAI,CAAA;IACV,mEAAmE;IACnE,KAAK,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAA;CACrD,GACD;IACE,wCAAwC;IACxC,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,uEAAuE;IACvE,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAEL;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IAAE,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AAE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,CAAA;IAChB,uEAAuE;IACvE,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAEL;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IAAE,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AAEzE,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,MAAM,GAAG,YAAY,CAAA;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;wFACoF;IACpF,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,kEAAkE;IAClE,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAA;IAChB;sCACkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;uDAGmD;IACnD,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA"}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import '../../chunk-R5GMMWAY.js';
3
- export { NumberInput } from '../../chunk-DMI4KS32.js';
3
+ export { NumberInput } from '../../chunk-SBZJGFZ6.js';
4
4
  import '../../chunk-I4B3N3UX.js';
5
5
  import '../../chunk-X6DESK37.js';
6
6
  import '../../chunk-HBWV5EPU.js';
7
- import '../../chunk-E3XLWMEB.js';
8
- import '../../chunk-H7WOMZXO.js';
7
+ import '../../chunk-RKCUXOU2.js';
8
+ import '../../chunk-HWBFRDX7.js';
9
9
  import '../../chunk-V6PY7C6S.js';
10
- import '../../chunk-7P32XCEU.js';
10
+ import '../../chunk-SLUOF7XW.js';
11
11
  import '../../chunk-PMUCGFY5.js';
12
12
  import '../../chunk-BUIHQJGE.js';
13
13
  import '../../chunk-6YNLRQ25.js';
@@ -1,15 +1,16 @@
1
1
  "use client";
2
- import { Modal } from '../../chunk-N42EFOML.js';
3
- import { Drawer } from '../../chunk-YMVUQ2L7.js';
4
- import '../../chunk-NLSJ6T7V.js';
5
- import { Button } from '../../chunk-SCXXJDKQ.js';
6
- import '../../chunk-H7WOMZXO.js';
7
- import '../../chunk-7P32XCEU.js';
8
- import '../../chunk-BMEJBY6H.js';
2
+ import { Modal } from '../../chunk-K3FZHYJL.js';
3
+ import { Drawer } from '../../chunk-P7SH3XWY.js';
4
+ import '../../chunk-KYVXPSNW.js';
5
+ import { Button } from '../../chunk-SP6LCCTZ.js';
6
+ import '../../chunk-HWBFRDX7.js';
7
+ import '../../chunk-SLUOF7XW.js';
8
+ import '../../chunk-B5YHYI7E.js';
9
+ import '../../chunk-6B2GNPJP.js';
9
10
  import { devWarn } from '../../chunk-LIZWCWED.js';
10
11
  import '../../chunk-BUIHQJGE.js';
11
12
  import '../../chunk-XXOR34T4.js';
12
- import '../../chunk-D2QIPQ74.js';
13
+ import '../../chunk-W3XX7BYT.js';
13
14
  import '../../chunk-R5LYFTHA.js';
14
15
  import '../../chunk-WYCMIIRR.js';
15
16
  import '../../chunk-C6NVU4F7.js';