@mortenbrudvik/waveui 0.11.0 → 0.13.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 (210) hide show
  1. package/README.md +157 -13
  2. package/dist/components/button/Link.cjs +1 -1
  3. package/dist/components/button/Link.cjs.map +1 -1
  4. package/dist/components/button/Link.mjs +4 -4
  5. package/dist/components/data-display/Avatar.cjs +1 -1
  6. package/dist/components/data-display/Avatar.cjs.map +1 -1
  7. package/dist/components/data-display/Avatar.colors.cjs +2 -0
  8. package/dist/components/data-display/Avatar.colors.cjs.map +1 -0
  9. package/dist/components/data-display/Avatar.colors.mjs +45 -0
  10. package/dist/components/data-display/Avatar.colors.mjs.map +1 -0
  11. package/dist/components/data-display/Avatar.context.cjs +1 -1
  12. package/dist/components/data-display/Avatar.context.cjs.map +1 -1
  13. package/dist/components/data-display/Avatar.context.mjs +4 -2
  14. package/dist/components/data-display/Avatar.context.mjs.map +1 -1
  15. package/dist/components/data-display/Avatar.mjs +103 -96
  16. package/dist/components/data-display/Avatar.mjs.map +1 -1
  17. package/dist/components/data-display/Avatar.sizes.cjs +2 -0
  18. package/dist/components/data-display/Avatar.sizes.cjs.map +1 -0
  19. package/dist/components/data-display/Avatar.sizes.mjs +41 -0
  20. package/dist/components/data-display/Avatar.sizes.mjs.map +1 -0
  21. package/dist/components/data-display/AvatarGroup.cjs +1 -1
  22. package/dist/components/data-display/AvatarGroup.cjs.map +1 -1
  23. package/dist/components/data-display/AvatarGroup.context.cjs +2 -0
  24. package/dist/components/data-display/AvatarGroup.context.cjs.map +1 -0
  25. package/dist/components/data-display/AvatarGroup.context.mjs +9 -0
  26. package/dist/components/data-display/AvatarGroup.context.mjs.map +1 -0
  27. package/dist/components/data-display/AvatarGroup.mjs +65 -122
  28. package/dist/components/data-display/AvatarGroup.mjs.map +1 -1
  29. package/dist/components/data-display/AvatarGroup.partition.cjs +2 -0
  30. package/dist/components/data-display/AvatarGroup.partition.cjs.map +1 -0
  31. package/dist/components/data-display/AvatarGroup.partition.mjs +14 -0
  32. package/dist/components/data-display/AvatarGroup.partition.mjs.map +1 -0
  33. package/dist/components/data-display/AvatarGroup.parts.cjs +2 -0
  34. package/dist/components/data-display/AvatarGroup.parts.cjs.map +1 -0
  35. package/dist/components/data-display/AvatarGroup.parts.mjs +178 -0
  36. package/dist/components/data-display/AvatarGroup.parts.mjs.map +1 -0
  37. package/dist/components/data-display/InfoButton.cjs +1 -1
  38. package/dist/components/data-display/InfoButton.cjs.map +1 -1
  39. package/dist/components/data-display/InfoButton.mjs +12 -12
  40. package/dist/components/data-display/InteractionTag.cjs +1 -1
  41. package/dist/components/data-display/InteractionTag.cjs.map +1 -1
  42. package/dist/components/data-display/InteractionTag.mjs +36 -33
  43. package/dist/components/data-display/InteractionTag.mjs.map +1 -1
  44. package/dist/components/data-display/Persona.cjs +1 -1
  45. package/dist/components/data-display/Persona.cjs.map +1 -1
  46. package/dist/components/data-display/Persona.mjs +96 -37
  47. package/dist/components/data-display/Persona.mjs.map +1 -1
  48. package/dist/components/data-display/PresenceBadge.cjs +1 -1
  49. package/dist/components/data-display/PresenceBadge.cjs.map +1 -1
  50. package/dist/components/data-display/PresenceBadge.mjs +42 -28
  51. package/dist/components/data-display/PresenceBadge.mjs.map +1 -1
  52. package/dist/components/data-display/Tag.cjs +1 -1
  53. package/dist/components/data-display/Tag.cjs.map +1 -1
  54. package/dist/components/data-display/Tag.mjs +111 -108
  55. package/dist/components/data-display/Tag.mjs.map +1 -1
  56. package/dist/components/feedback/Toaster.cjs +1 -1
  57. package/dist/components/feedback/Toaster.cjs.map +1 -1
  58. package/dist/components/feedback/Toaster.mjs +235 -235
  59. package/dist/components/feedback/Toaster.mjs.map +1 -1
  60. package/dist/components/input/Combobox.cjs +1 -1
  61. package/dist/components/input/Combobox.cjs.map +1 -1
  62. package/dist/components/input/Combobox.mjs +176 -175
  63. package/dist/components/input/Combobox.mjs.map +1 -1
  64. package/dist/components/input/DatePicker.cjs +1 -1
  65. package/dist/components/input/DatePicker.cjs.map +1 -1
  66. package/dist/components/input/DatePicker.mjs +188 -187
  67. package/dist/components/input/DatePicker.mjs.map +1 -1
  68. package/dist/components/input/Dropdown.cjs +1 -1
  69. package/dist/components/input/Dropdown.cjs.map +1 -1
  70. package/dist/components/input/Dropdown.mjs +41 -40
  71. package/dist/components/input/Dropdown.mjs.map +1 -1
  72. package/dist/components/input/Option.cjs +1 -1
  73. package/dist/components/input/Option.cjs.map +1 -1
  74. package/dist/components/input/Option.mjs +89 -87
  75. package/dist/components/input/Option.mjs.map +1 -1
  76. package/dist/components/input/TagPicker.root.cjs +1 -1
  77. package/dist/components/input/TagPicker.root.cjs.map +1 -1
  78. package/dist/components/input/TagPicker.root.mjs +136 -135
  79. package/dist/components/input/TagPicker.root.mjs.map +1 -1
  80. package/dist/components/input/TimePicker.cjs +1 -1
  81. package/dist/components/input/TimePicker.cjs.map +1 -1
  82. package/dist/components/input/TimePicker.mjs +156 -154
  83. package/dist/components/input/TimePicker.mjs.map +1 -1
  84. package/dist/components/layout/Card.cjs +1 -1
  85. package/dist/components/layout/Card.cjs.map +1 -1
  86. package/dist/components/layout/Card.context.cjs +2 -0
  87. package/dist/components/layout/Card.context.cjs.map +1 -0
  88. package/dist/components/layout/Card.context.mjs +14 -0
  89. package/dist/components/layout/Card.context.mjs.map +1 -0
  90. package/dist/components/layout/Card.mjs +138 -92
  91. package/dist/components/layout/Card.mjs.map +1 -1
  92. package/dist/components/layout/Card.preview.cjs +2 -0
  93. package/dist/components/layout/Card.preview.cjs.map +1 -0
  94. package/dist/components/layout/Card.preview.mjs +22 -0
  95. package/dist/components/layout/Card.preview.mjs.map +1 -0
  96. package/dist/components/layout/Carousel.button.cjs +2 -0
  97. package/dist/components/layout/Carousel.button.cjs.map +1 -0
  98. package/dist/components/layout/Carousel.button.mjs +34 -0
  99. package/dist/components/layout/Carousel.button.mjs.map +1 -0
  100. package/dist/components/layout/Carousel.cjs +1 -1
  101. package/dist/components/layout/Carousel.cjs.map +1 -1
  102. package/dist/components/layout/Carousel.context.cjs +2 -0
  103. package/dist/components/layout/Carousel.context.cjs.map +1 -0
  104. package/dist/components/layout/Carousel.context.mjs +24 -0
  105. package/dist/components/layout/Carousel.context.mjs.map +1 -0
  106. package/dist/components/layout/Carousel.drag.cjs +2 -0
  107. package/dist/components/layout/Carousel.drag.cjs.map +1 -0
  108. package/dist/components/layout/Carousel.drag.mjs +79 -0
  109. package/dist/components/layout/Carousel.drag.mjs.map +1 -0
  110. package/dist/components/layout/Carousel.groups.cjs +2 -0
  111. package/dist/components/layout/Carousel.groups.cjs.map +1 -0
  112. package/dist/components/layout/Carousel.groups.mjs +23 -0
  113. package/dist/components/layout/Carousel.groups.mjs.map +1 -0
  114. package/dist/components/layout/Carousel.mjs +288 -150
  115. package/dist/components/layout/Carousel.mjs.map +1 -1
  116. package/dist/components/layout/Carousel.styles.cjs +2 -0
  117. package/dist/components/layout/Carousel.styles.cjs.map +1 -0
  118. package/dist/components/layout/Carousel.styles.mjs +30 -0
  119. package/dist/components/layout/Carousel.styles.mjs.map +1 -0
  120. package/dist/components/layout/TabList.cjs +1 -1
  121. package/dist/components/layout/TabList.cjs.map +1 -1
  122. package/dist/components/layout/TabList.mjs +163 -124
  123. package/dist/components/layout/TabList.mjs.map +1 -1
  124. package/dist/components/navigation/Menu.popover.cjs +1 -1
  125. package/dist/components/navigation/Menu.popover.cjs.map +1 -1
  126. package/dist/components/navigation/Menu.popover.mjs +137 -127
  127. package/dist/components/navigation/Menu.popover.mjs.map +1 -1
  128. package/dist/components/navigation/Menu.root.cjs +1 -1
  129. package/dist/components/navigation/Menu.root.cjs.map +1 -1
  130. package/dist/components/navigation/Menu.root.mjs +4 -4
  131. package/dist/components/overlays/Dialog.cjs +1 -1
  132. package/dist/components/overlays/Dialog.cjs.map +1 -1
  133. package/dist/components/overlays/Dialog.mjs +123 -123
  134. package/dist/components/overlays/Dialog.mjs.map +1 -1
  135. package/dist/components/overlays/Drawer.panel.cjs +1 -1
  136. package/dist/components/overlays/Drawer.panel.cjs.map +1 -1
  137. package/dist/components/overlays/Drawer.panel.mjs +12 -12
  138. package/dist/components/overlays/Drawer.panel.mjs.map +1 -1
  139. package/dist/components/overlays/Popover.cjs +1 -1
  140. package/dist/components/overlays/Popover.cjs.map +1 -1
  141. package/dist/components/overlays/Popover.mjs +173 -162
  142. package/dist/components/overlays/Popover.mjs.map +1 -1
  143. package/dist/components/overlays/TeachingPopover.cjs +1 -1
  144. package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
  145. package/dist/components/overlays/TeachingPopover.mjs +96 -91
  146. package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
  147. package/dist/components/overlays/Tooltip.cjs +1 -1
  148. package/dist/components/overlays/Tooltip.cjs.map +1 -1
  149. package/dist/components/overlays/Tooltip.mjs +47 -47
  150. package/dist/components/overlays/Tooltip.mjs.map +1 -1
  151. package/dist/components/portal/Portal.cjs +1 -1
  152. package/dist/components/portal/Portal.cjs.map +1 -1
  153. package/dist/components/portal/Portal.mjs +5 -5
  154. package/dist/components/table/DataGrid.cjs +1 -1
  155. package/dist/components/table/DataGrid.cjs.map +1 -1
  156. package/dist/components/table/DataGrid.mjs +1 -1
  157. package/dist/hooks/useDismiss.cjs.map +1 -1
  158. package/dist/hooks/useDismiss.mjs.map +1 -1
  159. package/dist/hooks/useFocusTrap.cjs.map +1 -1
  160. package/dist/hooks/useFocusTrap.mjs.map +1 -1
  161. package/dist/hooks/useFocusVisible.cjs +2 -0
  162. package/dist/hooks/useFocusVisible.cjs.map +1 -0
  163. package/dist/hooks/useFocusVisible.mjs +49 -0
  164. package/dist/hooks/useFocusVisible.mjs.map +1 -0
  165. package/dist/hooks/useFocusableGroup.cjs +2 -0
  166. package/dist/hooks/useFocusableGroup.cjs.map +1 -0
  167. package/dist/hooks/useFocusableGroup.mjs +70 -0
  168. package/dist/hooks/useFocusableGroup.mjs.map +1 -0
  169. package/dist/hooks/useModalLayer.cjs +1 -1
  170. package/dist/hooks/useModalLayer.cjs.map +1 -1
  171. package/dist/hooks/useModalLayer.mjs +4 -4
  172. package/dist/hooks/useModalOpen.cjs +2 -0
  173. package/dist/hooks/useModalOpen.cjs.map +1 -0
  174. package/dist/hooks/useModalOpen.mjs +14 -0
  175. package/dist/hooks/useModalOpen.mjs.map +1 -0
  176. package/dist/hooks/usePopupPosition.cjs +1 -1
  177. package/dist/hooks/usePopupPosition.cjs.map +1 -1
  178. package/dist/hooks/usePopupPosition.mjs +82 -53
  179. package/dist/hooks/usePopupPosition.mjs.map +1 -1
  180. package/dist/hooks/useResolvedTarget.cjs +2 -0
  181. package/dist/hooks/useResolvedTarget.cjs.map +1 -0
  182. package/dist/hooks/useResolvedTarget.mjs +37 -0
  183. package/dist/hooks/useResolvedTarget.mjs.map +1 -0
  184. package/dist/hooks/useRovingGrid.cjs +1 -1
  185. package/dist/hooks/useRovingGrid.cjs.map +1 -1
  186. package/dist/hooks/useRovingGrid.mjs +8 -57
  187. package/dist/hooks/useRovingGrid.mjs.map +1 -1
  188. package/dist/hooks/useRovingTabIndex.cjs +1 -1
  189. package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
  190. package/dist/hooks/useRovingTabIndex.mjs +142 -107
  191. package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
  192. package/dist/index.cjs +1 -1
  193. package/dist/index.d.cts +1364 -66
  194. package/dist/index.d.ts +1364 -66
  195. package/dist/index.mjs +132 -115
  196. package/dist/lib/classNames.cjs +1 -1
  197. package/dist/lib/classNames.cjs.map +1 -1
  198. package/dist/lib/classNames.mjs +112 -92
  199. package/dist/lib/classNames.mjs.map +1 -1
  200. package/dist/lib/initials.cjs +2 -0
  201. package/dist/lib/initials.cjs.map +1 -0
  202. package/dist/lib/initials.mjs +21 -0
  203. package/dist/lib/initials.mjs.map +1 -0
  204. package/dist/lib/layers.cjs +1 -1
  205. package/dist/lib/layers.cjs.map +1 -1
  206. package/dist/lib/layers.mjs +112 -109
  207. package/dist/lib/layers.mjs.map +1 -1
  208. package/dist/styles.css +1 -1
  209. package/package.json +1 -1
  210. package/src/styles/tokens.css +102 -0
@@ -11,19 +11,19 @@ import { getFirstTabbable as u, getTabbableElements as d, isConnectedAndFocusabl
11
11
  import { useMergedRefs as p } from "../../hooks/useMergedRefs.mjs";
12
12
  import { joinIds as m } from "../../lib/aria.mjs";
13
13
  import { usePresence as ee } from "../../hooks/usePresence.mjs";
14
- import { getOpenLayers as h, isInsideLayerTree as g, subscribeLayers as _ } from "../../lib/layers.mjs";
15
- import { useDirection as te } from "../../hooks/useDirection.mjs";
16
- import { Portal as v } from "../portal/Portal.mjs";
17
- import { focusRing as ne } from "../../lib/styles.mjs";
18
- import { isEditableTarget as re, isOwnEvent as ie } from "../../lib/events.mjs";
19
- import { usePreserveFocus as ae } from "../../hooks/usePreserveFocus.mjs";
20
- import { StatusText as oe, getStatusLabel as y } from "./MessageBar.status.mjs";
21
- import { ToastContext as se, ToasterContext as b } from "./Toast.context.mjs";
22
- import { ToastRoot as ce } from "./Toast.root.mjs";
23
- import * as x from "react";
24
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
14
+ import { useDirection as h } from "../../hooks/useDirection.mjs";
15
+ import { getOpenLayers as g, isInsideLayerTree as _, subscribeLayers as v } from "../../lib/layers.mjs";
16
+ import { focusRing as te } from "../../lib/styles.mjs";
17
+ import { Portal as y } from "../portal/Portal.mjs";
18
+ import { isEditableTarget as ne, isOwnEvent as re } from "../../lib/events.mjs";
19
+ import { usePreserveFocus as ie } from "../../hooks/usePreserveFocus.mjs";
20
+ import { StatusText as ae, getStatusLabel as b } from "./MessageBar.status.mjs";
21
+ import { ToastContext as oe, ToasterContext as x } from "./Toast.context.mjs";
22
+ import { ToastRoot as se } from "./Toast.root.mjs";
23
+ import * as S from "react";
24
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
25
25
  //#region src/components/feedback/Toaster.tsx
26
- function le(e, t) {
26
+ function ce(e, t) {
27
27
  let n = 0, r = !1;
28
28
  for (let t of e) t.shown ? t.dismissed || (n += 1) : r = !0;
29
29
  return !r || n >= t ? e : e.map((e) => e.shown || n >= t ? e : (n += 1, {
@@ -31,7 +31,7 @@ function le(e, t) {
31
31
  shown: !0
32
32
  }));
33
33
  }
34
- function ue(e, t) {
34
+ function T(e, t) {
35
35
  let n = e.findIndex((e) => e.id === t);
36
36
  if (n === -1) return e;
37
37
  let r = e[n];
@@ -43,40 +43,40 @@ function ue(e, t) {
43
43
  dismissed: !0
44
44
  }, i;
45
45
  }
46
- function w(e) {
46
+ function E(e) {
47
47
  return e.every((e) => e.shown && e.dismissed) ? e : e.filter((e) => e.shown).map((e) => e.dismissed ? e : {
48
48
  ...e,
49
49
  dismissed: !0
50
50
  });
51
51
  }
52
- function T(e) {
52
+ function D(e) {
53
53
  let t;
54
54
  for (let n of e) n.shown && !n.dismissed && (!t || n.seq > t.seq) && (t = n);
55
55
  return t;
56
56
  }
57
- function E(e, t) {
58
- return e.contains(t) ? !0 : h().some((n) => {
57
+ function O(e, t) {
58
+ return e.contains(t) ? !0 : g().some((n) => {
59
59
  let r = n.getAnchor();
60
- return r !== null && e.contains(r) && g(n.id, t);
60
+ return r !== null && e.contains(r) && _(n.id, t);
61
61
  });
62
62
  }
63
- function de(e, t) {
63
+ function le(e, t) {
64
64
  let n = t?.getDismissButton() ?? null;
65
65
  return d(e).some((e) => e !== n);
66
66
  }
67
- function D(e) {
67
+ function k(e) {
68
68
  return e === void 0 ? Infinity : e >= 1 ? Math.floor(e) : 1;
69
69
  }
70
- var O = {
70
+ var A = {
71
71
  dispatchToast: (e, t) => (o(e) ? e.toastId : t?.toastId) ?? "",
72
72
  dismissToast: () => {},
73
73
  dismissAllToasts: () => {}
74
- }, k = "useToastController must be used within <Toaster>. Wrap your app (or the part of it that shows toasts) in <Toaster>: it provides the controller to its children.";
75
- function A() {
76
- return x.useContext(b) || (t("useToastController", "<Toaster>", k), O);
74
+ }, j = "useToastController must be used within <Toaster>. Wrap your app (or the part of it that shows toasts) in <Toaster>: it provides the controller to its children.";
75
+ function M() {
76
+ return S.useContext(x) || (t("useToastController", "<Toaster>", j), A);
77
77
  }
78
- var fe = 5e3;
79
- function j(e) {
78
+ var ue = 5e3;
79
+ function N(e) {
80
80
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = !1, a = !1, o = (o) => {
81
81
  let s = t.get(o);
82
82
  if (!s) return;
@@ -119,7 +119,7 @@ function j(e) {
119
119
  }
120
120
  };
121
121
  }
122
- var M = {
122
+ var P = {
123
123
  "top-start": "top-4 start-4 ms-(--wave-toaster-offset) mt-(--wave-toaster-offset-block)",
124
124
  "top-end": "top-4 end-4 me-(--wave-toaster-offset) mt-(--wave-toaster-offset-block)",
125
125
  "bottom-start": "bottom-4 start-4 ms-(--wave-toaster-offset) mb-(--wave-toaster-offset-block)",
@@ -128,36 +128,36 @@ var M = {
128
128
  "top-left": "top-4 left-4 ml-(--wave-toaster-offset) mt-(--wave-toaster-offset-block)",
129
129
  "bottom-right": "bottom-4 right-4 mr-(--wave-toaster-offset) mb-(--wave-toaster-offset-block)",
130
130
  "bottom-left": "bottom-4 left-4 ml-(--wave-toaster-offset) mb-(--wave-toaster-offset-block)"
131
- }, N = 16;
132
- function P(e, t) {
131
+ }, F = 16;
132
+ function I(e, t) {
133
133
  let n = e.slice(e.indexOf("-") + 1);
134
134
  if (n === "right" || n === "left") return n === "right";
135
135
  let r = l(t) === "rtl";
136
136
  return n === "end" ? !r : r;
137
137
  }
138
- var F = {
138
+ var L = {
139
139
  inline: 0,
140
140
  block: 0
141
141
  };
142
- function I() {
143
- return h().filter((e) => e.kind === "modal" || e.kind === "dialog");
142
+ function R() {
143
+ return g().filter((e) => e.kind === "modal" || e.kind === "dialog");
144
144
  }
145
- function pe() {
145
+ function de() {
146
146
  let e = /* @__PURE__ */ new Set();
147
- for (let t of I()) for (let n of t.getElements()) n?.isConnected && e.add(n);
147
+ for (let t of R()) for (let n of t.getElements()) n?.isConnected && e.add(n);
148
148
  return e;
149
149
  }
150
- function L(e, t) {
151
- let n = I();
152
- if (n.length === 0) return F;
150
+ function z(e, t) {
151
+ let n = R();
152
+ if (n.length === 0) return L;
153
153
  let r = e.ownerDocument, i = r.defaultView;
154
- if (!i) return F;
155
- let a = r.documentElement.clientWidth || i.innerWidth, o = r.documentElement.clientHeight || i.innerHeight, s = P(t, e), c = t.startsWith("top"), l = (t) => a - t >= e.offsetWidth + 32, u = (t) => o - t >= e.offsetHeight + 32, d = 0, f = 0;
154
+ if (!i) return L;
155
+ let a = r.documentElement.clientWidth || i.innerWidth, o = r.documentElement.clientHeight || i.innerHeight, s = I(t, e), c = t.startsWith("top"), l = (t) => a - t >= e.offsetWidth + 32, u = (t) => o - t >= e.offsetHeight + 32, d = 0, f = 0;
156
156
  for (let e of n) for (let t of e.getElements()) {
157
157
  if (!t?.isConnected) continue;
158
158
  let e = t.getBoundingClientRect();
159
159
  if (e.width <= 0 || e.height <= 0) continue;
160
- let n = s ? e.right >= a - N : e.left <= N, r = c ? e.top <= N : e.bottom >= o - N;
160
+ let n = s ? e.right >= a - F : e.left <= F, r = c ? e.top <= F : e.bottom >= o - F;
161
161
  if (!n || !r) continue;
162
162
  let i = s ? a - e.left : e.right, p = c ? e.bottom : o - e.top;
163
163
  l(i) ? d = Math.max(d, i) : u(p) && (f = Math.max(f, p));
@@ -167,36 +167,36 @@ function L(e, t) {
167
167
  block: f > 0 && u(f) ? Math.ceil(f) : 0
168
168
  };
169
169
  }
170
- var R = 2e3;
171
- function z({ text: e }) {
172
- let [t, n] = x.useState(!0);
173
- return x.useEffect(() => {
174
- let e = setTimeout(() => n(!1), R);
170
+ var B = 2e3;
171
+ function V({ text: e }) {
172
+ let [t, n] = S.useState(!0);
173
+ return S.useEffect(() => {
174
+ let e = setTimeout(() => n(!1), B);
175
175
  return () => clearTimeout(e);
176
- }, []), t ? /* @__PURE__ */ S("div", { children: e }) : null;
176
+ }, []), t ? /* @__PURE__ */ C("div", { children: e }) : null;
177
177
  }
178
- z.displayName = "LiveMessage";
179
- function B(e) {
178
+ V.displayName = "LiveMessage";
179
+ function H(e) {
180
180
  return e.kind === "title";
181
181
  }
182
- function V(e) {
182
+ function U(e) {
183
183
  return e.kind === "body";
184
184
  }
185
- function H(e) {
185
+ function W(e) {
186
186
  return e.kind === "footer";
187
187
  }
188
- var me = /* @__PURE__ */ new Set(/* @__PURE__ */ "a.abbr.b.bdi.bdo.cite.code.data.dfn.em.i.kbd.label.mark.q.s.samp.small.span.strong.sub.sup.time.u.var.wbr".split(".")), U = /* @__PURE__ */ new Set([
188
+ var fe = /* @__PURE__ */ new Set(/* @__PURE__ */ "a.abbr.b.bdi.bdo.cite.code.data.dfn.em.i.kbd.label.mark.q.s.samp.small.span.strong.sub.sup.time.u.var.wbr".split(".")), G = /* @__PURE__ */ new Set([
189
189
  "noscript",
190
190
  "script",
191
191
  "style",
192
192
  "template"
193
- ]), he = /* @__PURE__ */ new Set([
193
+ ]), pe = /* @__PURE__ */ new Set([
194
194
  "button",
195
195
  "img",
196
196
  "input",
197
197
  "select",
198
198
  "textarea"
199
- ]), W = /* @__PURE__ */ new Set([
199
+ ]), K = /* @__PURE__ */ new Set([
200
200
  "button",
201
201
  "checkbox",
202
202
  "combobox",
@@ -210,14 +210,14 @@ var me = /* @__PURE__ */ new Set(/* @__PURE__ */ "a.abbr.b.bdi.bdo.cite.code.dat
210
210
  "tab",
211
211
  "textbox"
212
212
  ]);
213
- function ge(e) {
213
+ function me(e) {
214
214
  let t = e.getAttribute("role")?.trim().split(/\s+/)[0];
215
- return t ? W.has(t) || t.startsWith("menuitem") : e.localName === "a" ? e.hasAttribute("href") : he.has(e.localName);
215
+ return t ? K.has(t) || t.startsWith("menuitem") : e.localName === "a" ? e.hasAttribute("href") : pe.has(e.localName);
216
216
  }
217
- function G(e) {
218
- return e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden") || U.has(e.localName);
217
+ function q(e) {
218
+ return e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden") || G.has(e.localName);
219
219
  }
220
- function K(e, t) {
220
+ function J(e, t) {
221
221
  if (!e) return "";
222
222
  let n = [], r = (e, i) => {
223
223
  if (e.nodeType === Node.TEXT_NODE) {
@@ -226,9 +226,9 @@ function K(e, t) {
226
226
  }
227
227
  if (e.nodeType !== Node.ELEMENT_NODE) return;
228
228
  let a = e;
229
- if (!i && t?.(a) || G(a)) return;
229
+ if (!i && t?.(a) || q(a)) return;
230
230
  let o = a.getAttribute("aria-label");
231
- if (o && ge(a)) {
231
+ if (o && me(a)) {
232
232
  n.push(` ${o} `);
233
233
  return;
234
234
  }
@@ -236,64 +236,64 @@ function K(e, t) {
236
236
  n.push(` ${a.getAttribute("alt") ?? ""} `);
237
237
  return;
238
238
  }
239
- let s = !me.has(a.localName);
239
+ let s = !fe.has(a.localName);
240
240
  s && n.push(" ");
241
241
  for (let e of Array.from(a.childNodes)) r(e, !1);
242
242
  s && n.push(" ");
243
243
  };
244
244
  return r(e, !0), n.join("").replace(/\s+/g, " ").trim();
245
245
  }
246
- function q(e) {
247
- return !e || G(e) ? [] : Array.from(e.childNodes, (e) => e.nodeType === Node.TEXT_NODE ? (e.textContent ?? "").replace(/\s+/g, " ").trim() : e.nodeType === Node.ELEMENT_NODE ? K(e) : "").filter(Boolean);
246
+ function Y(e) {
247
+ return !e || q(e) ? [] : Array.from(e.childNodes, (e) => e.nodeType === Node.TEXT_NODE ? (e.textContent ?? "").replace(/\s+/g, " ").trim() : e.nodeType === Node.ELEMENT_NODE ? J(e) : "").filter(Boolean);
248
248
  }
249
- function J(e, t, n, r) {
250
- let i = t.find(B), a = t.find(V);
249
+ function X(e, t, n, r) {
250
+ let i = t.find(H), a = t.find(U);
251
251
  if (!i && !a) {
252
252
  let t = n?.getDismissButton() ?? null;
253
- return K(e, (e) => e === t || e.id !== "" && (e.id === r || e.id === n?.statusTextId));
253
+ return J(e, (e) => e === t || e.id !== "" && (e.id === r || e.id === n?.statusTextId));
254
254
  }
255
- let o = i?.getLabel() ?? null, s = i?.getRow() ?? null, c = s ? Array.from(s.children).filter((e) => e !== o).flatMap((e) => q(e)) : [];
255
+ let o = i?.getLabel() ?? null, s = i?.getRow() ?? null, c = s ? Array.from(s.children).filter((e) => e !== o).flatMap((e) => Y(e)) : [];
256
256
  return [
257
- K(o),
258
- K(a?.getElement() ?? null),
257
+ J(o),
258
+ J(a?.getElement() ?? null),
259
259
  ...c,
260
- ...t.filter(H).flatMap((e) => q(e.getElement()))
260
+ ...t.filter(W).flatMap((e) => Y(e.getElement()))
261
261
  ].filter(Boolean).join(" ");
262
262
  }
263
- function _e({ entry: t, timers: r, onDismiss: a, onExited: o, getFocusFallback: l, announce: u, registerContainer: d }) {
264
- let { id: f, dismissed: h } = t, { isMounted: g, ref: _, presenceProps: te } = ee(!h, {
263
+ function he({ entry: t, timers: r, onDismiss: a, onExited: o, getFocusFallback: l, announce: u, registerContainer: d }) {
264
+ let { id: f, dismissed: h } = t, { isMounted: g, ref: _, presenceProps: v } = ee(!h, {
265
265
  appear: !0,
266
266
  onExited: () => o(f)
267
- }), v = x.useRef(null), b = x.useRef(null), le = x.useCallback((e) => {
268
- v.current = e, e && (b.current = e), d(f, e);
269
- }, [f, d]), ue = p(le, _);
270
- ae(v, () => l(b.current), { enabled: !h });
271
- let w = c("wave-toast-title"), T = c("wave-toast-status"), [E, D] = x.useState([]), O = x.useRef([]), k = x.useCallback((e) => (O.current = [...O.current, e], D(O.current), () => {
272
- O.current = O.current.filter((t) => t !== e), D(O.current);
273
- }), []), [A, j] = x.useState(null), M = x.useRef(null), N = x.useCallback((e) => (M.current = e, j(e), () => {
274
- M.current === e && (M.current = null, j(null));
275
- }), []), P = s(() => {
276
- M.current?.onDismiss?.(), a(f);
277
- }), F = x.useMemo(() => ({
278
- titleId: w,
279
- dismiss: P,
280
- registerPart: k,
281
- registerToast: N
267
+ }), y = S.useRef(null), x = S.useRef(null), ce = S.useCallback((e) => {
268
+ y.current = e, e && (x.current = e), d(f, e);
269
+ }, [f, d]), T = p(ce, _);
270
+ ie(y, () => l(x.current), { enabled: !h });
271
+ let E = c("wave-toast-title"), D = c("wave-toast-status"), [O, k] = S.useState([]), A = S.useRef([]), j = S.useCallback((e) => (A.current = [...A.current, e], k(A.current), () => {
272
+ A.current = A.current.filter((t) => t !== e), k(A.current);
273
+ }), []), [M, N] = S.useState(null), P = S.useRef(null), F = S.useCallback((e) => (P.current = e, N(e), () => {
274
+ P.current === e && (P.current = null, N(null));
275
+ }), []), I = s(() => {
276
+ P.current?.onDismiss?.(), a(f);
277
+ }), L = S.useMemo(() => ({
278
+ titleId: E,
279
+ dismiss: I,
280
+ registerPart: j,
281
+ registerToast: F
282
282
  }), [
283
- w,
284
- P,
285
- k,
286
- N
287
- ]), I = E.find(B), pe = E.find(V), L = t.form === "content" && A === null ? y(t.options.status ?? "info", t.options.statusLabel) : "", R = A ? A.statusTextId : L ? T : void 0;
288
- x.useLayoutEffect(() => {
289
- let e = v.current;
283
+ E,
284
+ I,
285
+ j,
286
+ F
287
+ ]), R = O.find(H), de = O.find(U), z = t.form === "content" && M === null ? b(t.options.status ?? "info", t.options.statusLabel) : "", B = M ? M.statusTextId : z ? D : void 0;
288
+ S.useLayoutEffect(() => {
289
+ let e = y.current;
290
290
  if (t.dismissed || !e) return;
291
- let n = t.options.timeout ?? (de(e, M.current) ? 0 : fe);
291
+ let n = t.options.timeout ?? (le(e, P.current) ? 0 : ue);
292
292
  r.start(t.id, t.seq, n);
293
- }, [t, r]), x.useLayoutEffect(() => {
294
- let e = v.current;
293
+ }, [t, r]), S.useLayoutEffect(() => {
294
+ let e = y.current;
295
295
  if (t.dismissed || !e) return;
296
- let n = M.current, r = n?.status ?? t.options.status ?? "info", i = n ? n.statusLabel : y(r, t.options.statusLabel), a = t.form === "content" && t.options.announcement !== void 0 ? t.options.announcement : J(e, O.current, n, T);
296
+ let n = P.current, r = n?.status ?? t.options.status ?? "info", i = n ? n.statusLabel : b(r, t.options.statusLabel), a = t.form === "content" && t.options.announcement !== void 0 ? t.options.announcement : X(e, A.current, n, D);
297
297
  u(t.id, {
298
298
  seq: t.seq,
299
299
  text: [i, a].filter(Boolean).join(" "),
@@ -302,37 +302,37 @@ function _e({ entry: t, timers: r, onDismiss: a, onExited: o, getFocusFallback:
302
302
  }, [
303
303
  t,
304
304
  u,
305
- T,
306
- A
305
+ D,
306
+ M
307
307
  ]);
308
- let z = t.form === "content" ? t.options.status : void 0;
309
- x.useEffect(() => {
310
- let e = M.current?.status;
311
- z !== void 0 && e !== void 0 && z !== e && n("Toaster:status-conflict", `Toaster: the dispatched Toast has status "${e}" but the dispatch options pass "${z}"; the Toast's status is used. Remove \`status\` from the options.`);
308
+ let V = t.form === "content" ? t.options.status : void 0;
309
+ S.useEffect(() => {
310
+ let e = P.current?.status;
311
+ V !== void 0 && e !== void 0 && V !== e && n("Toaster:status-conflict", `Toaster: the dispatched Toast has status "${e}" but the dispatch options pass "${V}"; the Toast's status is used. Remove \`status\` from the options.`);
312
312
  }, [
313
313
  t,
314
- z,
315
- A
314
+ V,
315
+ M
316
316
  ]);
317
- let H = (e) => {
318
- (e.key === "Delete" || e.key === "Backspace") && (e.defaultPrevented || !ie(e) || re(e.target) || (e.preventDefault(), a(f)));
317
+ let W = (e) => {
318
+ (e.key === "Delete" || e.key === "Backspace") && (e.defaultPrevented || !re(e) || ne(e.target) || (e.preventDefault(), a(f)));
319
319
  };
320
- return g ? /* @__PURE__ */ C("div", {
321
- ref: ue,
320
+ return g ? /* @__PURE__ */ w("div", {
321
+ ref: T,
322
322
  role: "group",
323
323
  tabIndex: -1,
324
324
  "data-wave-toast": "",
325
- "aria-labelledby": m(R, I?.id),
326
- "aria-describedby": pe?.id,
327
- className: e(i.toast, "rounded", ne),
328
- ...te,
329
- onKeyDown: H,
330
- children: [L ? /* @__PURE__ */ S(oe, {
331
- label: L,
332
- id: T
333
- }) : null, /* @__PURE__ */ S(se.Provider, {
334
- value: F,
335
- children: t.form === "options" ? /* @__PURE__ */ S(ce, {
325
+ "aria-labelledby": m(B, R?.id),
326
+ "aria-describedby": de?.id,
327
+ className: e(i.toast, "rounded", te),
328
+ ...v,
329
+ onKeyDown: W,
330
+ children: [z ? /* @__PURE__ */ C(ae, {
331
+ label: z,
332
+ id: D
333
+ }) : null, /* @__PURE__ */ C(oe.Provider, {
334
+ value: L,
335
+ children: t.form === "options" ? /* @__PURE__ */ C(se, {
336
336
  status: t.options.status,
337
337
  statusLabel: t.options.statusLabel,
338
338
  title: t.options.title,
@@ -342,25 +342,25 @@ function _e({ entry: t, timers: r, onDismiss: a, onExited: o, getFocusFallback:
342
342
  })]
343
343
  }) : null;
344
344
  }
345
- _e.displayName = "ToastContainer";
346
- var Y = ({ position: t = "bottom-end", limit: l, shortcuts: d, toaster: m, className: ee, style: g, children: ne, onFocus: re, onBlur: ae, onKeyDown: oe, onPointerEnter: y, onPointerLeave: se, onPointerOver: ce, ref: de, ...O }) => {
347
- let [k, A] = x.useState([]), [fe, N] = x.useState(() => /* @__PURE__ */ new Map()), P = x.useCallback((e, t) => {
348
- N((n) => {
345
+ he.displayName = "ToastContainer";
346
+ var Z = ({ position: t = "bottom-end", limit: l, shortcuts: d, toaster: m, className: ee, style: _, children: te, onFocus: ne, onBlur: ie, onKeyDown: ae, onPointerEnter: b, onPointerLeave: oe, onPointerOver: se, ref: le, ...A }) => {
347
+ let [j, M] = S.useState([]), [ue, F] = S.useState(() => /* @__PURE__ */ new Map()), I = S.useCallback((e, t) => {
348
+ F((n) => {
349
349
  let r = n.get(e);
350
350
  if (r && r.seq === t.seq && r.text === t.text && r.assertive === t.assertive) return n;
351
351
  let i = new Map(n);
352
352
  return i.set(e, t), i;
353
353
  });
354
- }, []), I = le(k, D(l));
355
- I !== k && A(I);
356
- let R = I.filter((e) => e.shown);
357
- x.useEffect(() => {
354
+ }, []), R = ce(j, k(l));
355
+ R !== j && M(R);
356
+ let B = R.filter((e) => e.shown);
357
+ S.useEffect(() => {
358
358
  l !== void 0 && !(l >= 1) && n("Toaster:limit", `Toaster: \`limit\` must be 1 or more (got ${String(l)}); it counts as 1.`);
359
359
  }, [l]);
360
- let B = c("toast"), V = x.useRef(0), H = x.useRef(null), me = p(de, H), U = x.useRef(null), he = te(), [W, ge] = x.useState(F);
361
- x.useLayoutEffect(() => {
360
+ let H = c("toast"), U = S.useRef(0), W = S.useRef(null), fe = p(le, W), G = S.useRef(null), pe = h(), [K, me] = S.useState(L);
361
+ S.useLayoutEffect(() => {
362
362
  let e = null, n = null, r = null, i = /* @__PURE__ */ new Set(), a = () => {
363
- let t = pe();
363
+ let t = de();
364
364
  for (let n of i) t.has(n) || e?.unobserve(n);
365
365
  for (let n of t) i.has(n) || e?.observe(n);
366
366
  let r = t.size !== i.size || [...t].some((e) => !i.has(e));
@@ -372,39 +372,39 @@ var Y = ({ position: t = "bottom-end", limit: l, shortcuts: d, toaster: m, class
372
372
  });
373
373
  }
374
374
  }, o = () => {
375
- let n = H.current;
375
+ let n = W.current;
376
376
  e && n !== r && (r && e.unobserve(r), n && e.observe(n), r = n), a();
377
- let i = n ? L(n, t) : F;
378
- ge((e) => e.inline === i.inline && e.block === i.block ? e : i);
377
+ let i = n ? z(n, t) : L;
378
+ me((e) => e.inline === i.inline && e.block === i.block ? e : i);
379
379
  };
380
380
  typeof ResizeObserver < "u" && (e = new ResizeObserver(() => o())), typeof MutationObserver < "u" && (n = new MutationObserver(o)), o();
381
- let s = _(o);
381
+ let s = v(o);
382
382
  return window.addEventListener("resize", o), document.addEventListener("transitionend", o, !0), document.addEventListener("animationend", o, !0), () => {
383
383
  s(), e?.disconnect(), n?.disconnect(), window.removeEventListener("resize", o), document.removeEventListener("transitionend", o, !0), document.removeEventListener("animationend", o, !0);
384
384
  };
385
- }, [t, he]);
386
- let [G] = x.useState(() => j((e) => A((t) => ue(t, e))));
387
- x.useEffect(() => {
388
- let e = document, t = !1, n = () => G.setInBackground(t || e.visibilityState === "hidden"), r = (e) => {
385
+ }, [t, pe]);
386
+ let [q] = S.useState(() => N((e) => M((t) => T(t, e))));
387
+ S.useEffect(() => {
388
+ let e = document, t = !1, n = () => q.setInBackground(t || e.visibilityState === "hidden"), r = (e) => {
389
389
  e.target instanceof Node || (t = !0, n());
390
390
  }, i = (e) => {
391
391
  e.target instanceof Node || (t = !1, n());
392
392
  };
393
- return n(), G.setSuspended(!1), window.addEventListener("blur", r), window.addEventListener("focus", i), e.addEventListener("visibilitychange", n), () => {
394
- window.removeEventListener("blur", r), window.removeEventListener("focus", i), e.removeEventListener("visibilitychange", n), G.setSuspended(!0);
393
+ return n(), q.setSuspended(!1), window.addEventListener("blur", r), window.addEventListener("focus", i), e.addEventListener("visibilitychange", n), () => {
394
+ window.removeEventListener("blur", r), window.removeEventListener("focus", i), e.removeEventListener("visibilitychange", n), q.setSuspended(!0);
395
395
  };
396
- }, [G]);
397
- let K = x.useCallback((e, t) => {
398
- V.current += 1;
399
- let n = V.current, r = o(e) ? {
396
+ }, [q]);
397
+ let J = S.useCallback((e, t) => {
398
+ U.current += 1;
399
+ let n = U.current, r = o(e) ? {
400
400
  form: "options",
401
401
  options: e
402
402
  } : {
403
403
  form: "content",
404
404
  content: e,
405
405
  options: t ?? {}
406
- }, i = r.options.toastId ?? `${B}-${n}`;
407
- return A((e) => {
406
+ }, i = r.options.toastId ?? `${H}-${n}`;
407
+ return M((e) => {
408
408
  let t = e.findIndex((e) => e.id === i), a = t !== -1 && e[t].shown, o = {
409
409
  ...r,
410
410
  id: i,
@@ -416,172 +416,172 @@ var Y = ({ position: t = "bottom-end", limit: l, shortcuts: d, toaster: m, class
416
416
  let s = e.slice();
417
417
  return s[t] = o, s;
418
418
  }), i;
419
- }, [B]), q = x.useCallback((e) => {
420
- G.remove(e), A((t) => ue(t, e));
421
- }, [G]), J = x.useCallback(() => {
422
- G.clear(), A((e) => w(e));
423
- }, [G]), Y = x.useCallback((e) => {
424
- A((t) => t.some((t) => t.id === e && t.dismissed) ? t.filter((t) => !(t.id === e && t.dismissed)) : t), N((t) => {
419
+ }, [H]), Y = S.useCallback((e) => {
420
+ q.remove(e), M((t) => T(t, e));
421
+ }, [q]), X = S.useCallback(() => {
422
+ q.clear(), M((e) => E(e));
423
+ }, [q]), Z = S.useCallback((e) => {
424
+ M((t) => t.some((t) => t.id === e && t.dismissed) ? t.filter((t) => !(t.id === e && t.dismissed)) : t), F((t) => {
425
425
  if (!t.has(e)) return t;
426
426
  let n = new Map(t);
427
427
  return n.delete(e), n;
428
428
  });
429
- }, []), X = x.useMemo(() => ({
430
- dispatchToast: K,
431
- dismissToast: q,
432
- dismissAllToasts: J
429
+ }, []), Q = S.useMemo(() => ({
430
+ dispatchToast: J,
431
+ dismissToast: Y,
432
+ dismissAllToasts: X
433
433
  }), [
434
- K,
435
- q,
436
- J
437
- ]), [ve] = x.useState(() => ({}));
438
- x.useLayoutEffect(() => {
434
+ J,
435
+ Y,
436
+ X
437
+ ]), [ge] = S.useState(() => ({}));
438
+ S.useLayoutEffect(() => {
439
439
  if (!m) return;
440
- let e = a(m, ve, X);
440
+ let e = a(m, ge, Q);
441
441
  if (e.status === "bound") return e.unbind;
442
442
  e.status === "taken" ? n("Toaster:handle-bound", "Toaster: this handle is already bound to another Toaster; a handle binds one Toaster. Create one handle per Toaster.") : n("Toaster:handle-unknown", "Toaster: `toaster` is not a handle from createToaster(), so nothing is bound. Pass the value createToaster() returns.");
443
443
  }, [
444
444
  m,
445
- ve,
446
- X
445
+ ge,
446
+ Q
447
447
  ]);
448
- let ye = x.useCallback((e) => {
449
- let t = H.current, n = t ? Array.from(t.children).filter((e) => e instanceof HTMLElement && e.hasAttribute("data-wave-toast")) : [], r = !!e && e.ownerDocument.activeElement === e, i = e ? n.indexOf(e) : -1, a = (t) => t !== e && t.isConnected && t.getAttribute("data-presence") !== "exiting", o = n.slice(i + 1).find(a), s = i > 0 ? n.slice(0, i).reverse().find(a) : void 0;
448
+ let _e = S.useCallback((e) => {
449
+ let t = W.current, n = t ? Array.from(t.children).filter((e) => e instanceof HTMLElement && e.hasAttribute("data-wave-toast")) : [], r = !!e && e.ownerDocument.activeElement === e, i = e ? n.indexOf(e) : -1, a = (t) => t !== e && t.isConnected && t.getAttribute("data-presence") !== "exiting", o = n.slice(i + 1).find(a), s = i > 0 ? n.slice(0, i).reverse().find(a) : void 0;
450
450
  for (let e of [o, s]) {
451
451
  if (!e) continue;
452
452
  let t = r ? e : u(e);
453
453
  if (t) return t;
454
454
  }
455
- let c = U.current;
456
- return U.current = null, c?.isConnected ? c : null;
457
- }, []), Z = s(() => {
458
- let e = H.current;
455
+ let c = G.current;
456
+ return G.current = null, c?.isConnected ? c : null;
457
+ }, []), $ = s(() => {
458
+ let e = W.current;
459
459
  if (!e) return;
460
460
  let t = e.ownerDocument;
461
461
  if (t.activeElement && t.activeElement !== t.body) return;
462
- let n = G.isPaused("focus");
463
- G.setPaused("focus", !1);
464
- let r = U.current;
465
- U.current = null, n && r && f(r) && r.focus({ preventScroll: !0 });
462
+ let n = q.isPaused("focus");
463
+ q.setPaused("focus", !1);
464
+ let r = G.current;
465
+ G.current = null, n && r && f(r) && r.focus({ preventScroll: !0 });
466
466
  });
467
- x.useLayoutEffect(() => {
468
- Z();
469
- }, [I, Z]), x.useLayoutEffect(() => _(() => queueMicrotask(Z)), [Z]);
470
- let Q = x.useRef(null);
471
- x.useEffect(() => {
467
+ S.useLayoutEffect(() => {
468
+ $();
469
+ }, [R, $]), S.useLayoutEffect(() => v(() => queueMicrotask($)), [$]);
470
+ let ve = S.useRef(null);
471
+ S.useEffect(() => {
472
472
  let e = (e) => {
473
- let t = Q.current === e;
474
- if (Q.current = null, t || !G.isPaused("hover")) return;
475
- let n = H.current;
476
- n && e.target instanceof Node && E(n, e.target) || G.setPaused("hover", !1);
473
+ let t = ve.current === e;
474
+ if (ve.current = null, t || !q.isPaused("hover")) return;
475
+ let n = W.current;
476
+ n && e.target instanceof Node && O(n, e.target) || q.setPaused("hover", !1);
477
477
  };
478
478
  return document.addEventListener("pointerover", e), () => document.removeEventListener("pointerover", e);
479
- }, [G]);
480
- let be = x.useRef(I);
481
- x.useLayoutEffect(() => {
482
- be.current = I;
479
+ }, [q]);
480
+ let ye = S.useRef(R);
481
+ S.useLayoutEffect(() => {
482
+ ye.current = R;
483
483
  });
484
- let $ = x.useRef(/* @__PURE__ */ new Map()), xe = x.useCallback((e, t) => {
485
- t ? $.current.set(e, t) : $.current.delete(e);
484
+ let be = S.useRef(/* @__PURE__ */ new Map()), xe = S.useCallback((e, t) => {
485
+ t ? be.current.set(e, t) : be.current.delete(e);
486
486
  }, []), Se = typeof d?.focus == "function", Ce = s((e) => {
487
487
  if (e.defaultPrevented || e.isComposing || !d?.focus?.(e)) return;
488
- let t = T(be.current), n = t ? $.current.get(t.id) : void 0;
488
+ let t = D(ye.current), n = t ? be.current.get(t.id) : void 0;
489
489
  if (!n?.isConnected) return;
490
490
  e.preventDefault();
491
- let r = H.current, i = n.ownerDocument.activeElement;
492
- i instanceof HTMLElement && i !== n.ownerDocument.body && !(r && E(r, i)) && (U.current = i), n.focus({ preventScroll: !1 });
491
+ let r = W.current, i = n.ownerDocument.activeElement;
492
+ i instanceof HTMLElement && i !== n.ownerDocument.body && !(r && O(r, i)) && (G.current = i), n.focus({ preventScroll: !1 });
493
493
  });
494
- x.useEffect(() => {
494
+ S.useEffect(() => {
495
495
  if (!Se) return;
496
496
  let e = (e) => Ce(e);
497
497
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
498
498
  }, [Se, Ce]);
499
499
  let we = (e) => {
500
500
  let t = e.relatedTarget;
501
- t instanceof HTMLElement && f(t) && (E(e.currentTarget, t) || (U.current = t));
501
+ t instanceof HTMLElement && f(t) && (O(e.currentTarget, t) || (G.current = t));
502
502
  }, Te = (e) => {
503
503
  let t = e.currentTarget, n = e.relatedTarget;
504
- if (!(n instanceof Node && E(t, n)) && !e.target.closest("[data-wave-toast][data-presence=\"exiting\"]")) {
504
+ if (!(n instanceof Node && O(t, n)) && !e.target.closest("[data-wave-toast][data-presence=\"exiting\"]")) {
505
505
  if (n === null) {
506
506
  let n = e.target;
507
507
  if (!n.isConnected) return;
508
508
  let r = n.ownerDocument.activeElement;
509
- if (r && E(t, r)) return;
509
+ if (r && O(t, r)) return;
510
510
  }
511
- U.current = null;
511
+ G.current = null;
512
512
  }
513
513
  }, Ee = (e) => {
514
- if (e.key !== "Escape" && e.key !== "Esc" || e.defaultPrevented || e.nativeEvent.isComposing || !ie(e)) return;
514
+ if (e.key !== "Escape" && e.key !== "Esc" || e.defaultPrevented || e.nativeEvent.isComposing || !re(e)) return;
515
515
  let t = e.currentTarget;
516
- if (h().some((e) => e.escape && t.contains(e.getAnchor()))) return;
516
+ if (g().some((e) => e.escape && t.contains(e.getAnchor()))) return;
517
517
  e.preventDefault();
518
- let n = U.current;
519
- U.current = null, n?.isConnected && n.focus({ preventScroll: !0 }), J();
518
+ let n = G.current;
519
+ G.current = null, n?.isConnected && n.focus({ preventScroll: !0 }), X();
520
520
  }, De = [], Oe = [];
521
- for (let e of R) {
521
+ for (let e of B) {
522
522
  if (e.dismissed) continue;
523
- let t = fe.get(e.id);
523
+ let t = ue.get(e.id);
524
524
  if (!t || t.seq !== e.seq || !t.text) continue;
525
- let n = /* @__PURE__ */ S(z, { text: t.text }, t.seq);
525
+ let n = /* @__PURE__ */ C(V, { text: t.text }, t.seq);
526
526
  (t.assertive ? Oe : De).push(n);
527
527
  }
528
- let ke = W.inline > 0 || W.block > 0 ? {
529
- ...g,
530
- ...W.inline > 0 && { "--wave-toaster-offset": `${W.inline}px` },
531
- ...W.block > 0 && { "--wave-toaster-offset-block": `${W.block}px` }
532
- } : g;
533
- return /* @__PURE__ */ C(b.Provider, {
534
- value: X,
535
- children: [ne, /* @__PURE__ */ S(v, {
528
+ let ke = K.inline > 0 || K.block > 0 ? {
529
+ ..._,
530
+ ...K.inline > 0 && { "--wave-toaster-offset": `${K.inline}px` },
531
+ ...K.block > 0 && { "--wave-toaster-offset-block": `${K.block}px` }
532
+ } : _;
533
+ return /* @__PURE__ */ w(x.Provider, {
534
+ value: Q,
535
+ children: [te, /* @__PURE__ */ C(y, {
536
536
  layer: "toast",
537
- children: /* @__PURE__ */ C("div", {
538
- ref: me,
537
+ children: /* @__PURE__ */ w("div", {
538
+ ref: fe,
539
539
  role: "region",
540
540
  "aria-label": "Notifications",
541
541
  "data-wave-focus-trap-allow": "",
542
542
  "data-position": t,
543
- ...O,
543
+ ...A,
544
544
  style: ke,
545
545
  onFocus: (e) => {
546
- re?.(e), we(e), G.setPaused("focus", !0);
546
+ ne?.(e), we(e), q.setPaused("focus", !0);
547
547
  },
548
548
  onBlur: (e) => {
549
- ae?.(e), Te(e);
549
+ ie?.(e), Te(e);
550
550
  let t = e.relatedTarget;
551
- t instanceof Node && E(e.currentTarget, t) || G.setPaused("focus", !1);
551
+ t instanceof Node && O(e.currentTarget, t) || q.setPaused("focus", !1);
552
552
  },
553
553
  onPointerEnter: (e) => {
554
- y?.(e), G.setPaused("hover", !0);
554
+ b?.(e), q.setPaused("hover", !0);
555
555
  },
556
556
  onPointerLeave: (e) => {
557
- se?.(e), G.setPaused("hover", !1);
557
+ oe?.(e), q.setPaused("hover", !1);
558
558
  },
559
559
  onPointerOver: (e) => {
560
- ce?.(e), Q.current = e.nativeEvent;
560
+ se?.(e), ve.current = e.nativeEvent;
561
561
  },
562
- onKeyDown: (e) => r(oe, Ee)(e),
563
- className: e(i.root, "fixed flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2", M[t], ee),
562
+ onKeyDown: (e) => r(ae, Ee)(e),
563
+ className: e(i.root, "fixed flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2", P[t], ee),
564
564
  children: [
565
- /* @__PURE__ */ S("div", {
565
+ /* @__PURE__ */ C("div", {
566
566
  role: "status",
567
567
  "aria-live": "polite",
568
568
  "aria-atomic": "false",
569
569
  className: "sr-only",
570
570
  children: De
571
571
  }),
572
- /* @__PURE__ */ S("div", {
572
+ /* @__PURE__ */ C("div", {
573
573
  "aria-live": "assertive",
574
574
  "aria-atomic": "false",
575
575
  className: "sr-only",
576
576
  children: Oe
577
577
  }),
578
- R.map((e) => /* @__PURE__ */ S(_e, {
578
+ B.map((e) => /* @__PURE__ */ C(he, {
579
579
  entry: e,
580
- timers: G,
581
- onDismiss: q,
582
- onExited: Y,
583
- getFocusFallback: ye,
584
- announce: P,
580
+ timers: q,
581
+ onDismiss: Y,
582
+ onExited: Z,
583
+ getFocusFallback: _e,
584
+ announce: I,
585
585
  registerContainer: xe
586
586
  }, e.id))
587
587
  ]
@@ -589,8 +589,8 @@ var Y = ({ position: t = "bottom-end", limit: l, shortcuts: d, toaster: m, class
589
589
  })]
590
590
  });
591
591
  };
592
- Y.displayName = "Toaster";
592
+ Z.displayName = "Toaster";
593
593
  //#endregion
594
- export { Y as Toaster, A as useToastController };
594
+ export { Z as Toaster, M as useToastController };
595
595
 
596
596
  //# sourceMappingURL=Toaster.mjs.map