@motech-development/breeze-ui 4.2.0 → 4.4.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.
package/lib/index.js CHANGED
@@ -1,23 +1,28 @@
1
1
  import { ToggleButton as e } from "react-aria-components/ToggleButton";
2
2
  import { ToggleButtonGroup as t } from "react-aria-components/ToggleButtonGroup";
3
- import { createContext as n, createElement as r, useCallback as i, useContext as a, useEffect as o, useLayoutEffect as s, useMemo as c, useState as l } from "react";
4
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
5
- import { Button as p } from "react-aria-components/Button";
6
- import { ProgressBarContext as m } from "react-aria-components/ProgressBar";
7
- import { useSlottedContext as h } from "react-aria-components/slots";
8
- import { ArrowDownLeft as g, ArrowUpRight as _, Bell as v, Building2 as y, CalendarDays as b, Camera as x, Check as S, ChevronDown as C, ChevronLeft as w, ChevronRight as T, Clock3 as ee, Download as te, Ellipsis as E, FileText as D, House as O, List as k, LockKeyhole as ne, LogOut as re, Plus as ie, Settings as ae, Trash2 as oe, TriangleAlert as se, Upload as ce, Users as le, X as ue } from "lucide-react";
9
- import { parseDate as de } from "@internationalized/date";
10
- import { I18nProvider as fe, useLocale as pe } from "react-aria-components/I18nProvider";
3
+ import { createContext as n, createElement as r, useCallback as i, useContext as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as f } from "react";
4
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
5
+ import { Button as g } from "react-aria-components/Button";
6
+ import { ProgressBarContext as _ } from "react-aria-components/ProgressBar";
7
+ import { useSlottedContext as v } from "react-aria-components/slots";
8
+ import { Dialog as y } from "react-aria-components/Dialog";
9
+ import { Modal as b, ModalOverlay as x } from "react-aria-components/Modal";
10
+ import { Popover as S } from "react-aria-components/Popover";
11
+ import { UNSAFE_PortalProvider as C } from "react-aria/PortalProvider";
12
+ import { I18nProvider as w, useLocale as T } from "react-aria-components/I18nProvider";
13
+ import { ArrowDownLeft as E, ArrowUpRight as D, Bell as ee, Building2 as te, CalendarDays as ne, Camera as re, Check as O, ChevronDown as k, ChevronLeft as A, ChevronRight as j, Clock3 as ie, Download as M, Ellipsis as ae, FileText as oe, House as se, List as N, LockKeyhole as P, LogOut as F, Plus as I, Settings as ce, Trash2 as le, TriangleAlert as L, Upload as R, Users as ue, X as z } from "lucide-react";
14
+ import { createPortal as B } from "react-dom";
15
+ import { parseDate as V } from "@internationalized/date";
11
16
  //#region src/provider/BreezeContext.ts
12
- var A = n(null);
13
- function j() {
14
- let e = a(A);
17
+ var H = n(null);
18
+ function U() {
19
+ let e = a(H);
15
20
  if (e === null) throw Error("Breeze components must be rendered within BreezeProvider.");
16
21
  return e;
17
22
  }
18
23
  //#endregion
19
24
  //#region src/patterns/AppearanceControl/AppearanceControl.tsx
20
- var M = {
25
+ var W = {
21
26
  base: {
22
27
  control: "breeze:flex breeze:items-center breeze:gap-breeze-2 breeze:font-breeze-sans",
23
28
  group: "breeze:flex breeze:items-center breeze:gap-breeze-2",
@@ -28,7 +33,7 @@ var M = {
28
33
  size: {},
29
34
  state: { selected: "breeze:data-[selected]:border-breeze-brand breeze:data-[selected]:bg-breeze-brand-soft breeze:data-[selected]:text-breeze-brand-text breeze:forced-colors:data-[selected]:outline-2 breeze:forced-colors:data-[selected]:outline-offset-2" },
30
35
  variant: {}
31
- }, N = [
36
+ }, de = [
32
37
  {
33
38
  message: "appearanceLight",
34
39
  value: "light"
@@ -42,30 +47,30 @@ var M = {
42
47
  value: "dark"
43
48
  }
44
49
  ];
45
- function me(e) {
46
- return N.some((t) => t.value === e);
47
- }
48
- function P() {
49
- let { appearance: n, getMessageLocale: r, messages: i, setAppearance: a } = j();
50
- return /* @__PURE__ */ f("div", {
51
- className: M.base.control,
52
- children: [/* @__PURE__ */ d("span", {
53
- className: M.base.label,
50
+ function fe(e) {
51
+ return de.some((t) => t.value === e);
52
+ }
53
+ function pe() {
54
+ let { appearance: n, getMessageLocale: r, messages: i, setAppearance: a } = U();
55
+ return /* @__PURE__ */ h("div", {
56
+ className: W.base.control,
57
+ children: [/* @__PURE__ */ m("span", {
58
+ className: W.base.label,
54
59
  lang: r("appearance"),
55
60
  children: i.appearance
56
- }), /* @__PURE__ */ d(t, {
61
+ }), /* @__PURE__ */ m(t, {
57
62
  "aria-label": i.appearance,
58
- className: M.base.group,
63
+ className: W.base.group,
59
64
  disallowEmptySelection: !0,
60
65
  lang: r("appearance"),
61
66
  onSelectionChange: (e) => {
62
67
  let [t] = e;
63
- me(t) && a(t);
68
+ fe(t) && a(t);
64
69
  },
65
70
  selectedKeys: [n],
66
71
  selectionMode: "single",
67
- children: N.map((t) => /* @__PURE__ */ d(e, {
68
- className: [M.base.option, M.state.selected].join(" "),
72
+ children: de.map((t) => /* @__PURE__ */ m(e, {
73
+ className: [W.base.option, W.state.selected].join(" "),
69
74
  id: t.value,
70
75
  lang: r(t.message),
71
76
  children: i[t.message]
@@ -75,7 +80,7 @@ function P() {
75
80
  }
76
81
  //#endregion
77
82
  //#region src/primitives/Skeleton/Skeleton.tsx
78
- var F = {
83
+ var G = {
79
84
  base: { skeleton: "breeze:block breeze:animate-pulse breeze:appearance-none breeze:bg-breeze-ink-3 breeze:pointer-events-none breeze:forced-colors:outline breeze:forced-colors:outline-1 breeze:forced-colors:outline-[CanvasText]" },
80
85
  compound: {},
81
86
  size: {},
@@ -86,37 +91,37 @@ var F = {
86
91
  text: "breeze:block-size-breeze-3 breeze:inline-size-full breeze:rounded-breeze-xs"
87
92
  }
88
93
  };
89
- function I({ blockSize: e, inlineSize: t, label: n, shape: r = "text" }) {
90
- let { getMessageLocale: i, messages: a } = j(), o = n?.trim() || void 0, s = e ?? t ?? "0.75rem", c = {
94
+ function me({ blockSize: e, inlineSize: t, label: n, shape: r = "text" }) {
95
+ let { getMessageLocale: i, messages: a } = U(), o = n?.trim() || void 0, s = e ?? t ?? "0.75rem", c = {
91
96
  blockSize: r === "circle" ? s : e,
92
97
  inlineSize: r === "circle" ? s : t
93
98
  };
94
- return /* @__PURE__ */ d("progress", {
99
+ return /* @__PURE__ */ m("progress", {
95
100
  "aria-hidden": o === void 0 || void 0,
96
101
  "aria-label": o,
97
- className: [F.base.skeleton, F.variant[r]].join(" "),
102
+ className: [G.base.skeleton, G.variant[r]].join(" "),
98
103
  lang: o === a.loading.trim() ? i("loading") : void 0,
99
104
  style: c
100
105
  });
101
106
  }
102
107
  //#endregion
103
108
  //#region src/primitives/VisuallyHidden/VisuallyHidden.tsx
104
- var L = {
109
+ var he = {
105
110
  base: { hidden: "breeze:sr-only" },
106
111
  compound: {},
107
112
  size: {},
108
113
  state: {},
109
114
  variant: {}
110
115
  };
111
- function R({ children: e }) {
112
- return /* @__PURE__ */ d("span", {
113
- className: L.base.hidden,
116
+ function ge({ children: e }) {
117
+ return /* @__PURE__ */ m("span", {
118
+ className: he.base.hidden,
114
119
  children: e
115
120
  });
116
121
  }
117
122
  //#endregion
118
123
  //#region src/primitives/Badge/Badge.tsx
119
- var z = {
124
+ var K = {
120
125
  base: {
121
126
  badge: "breeze:inline-grid breeze:shrink-0 breeze:items-center breeze:whitespace-nowrap breeze:rounded-breeze-chip breeze:ps-breeze-2 breeze:pe-breeze-2 breeze:py-breeze-px breeze:text-breeze-2xs breeze:font-bold breeze:leading-breeze-snug breeze:tracking-breeze-wide",
122
127
  content: "breeze:[grid-area:1/1]",
@@ -133,29 +138,29 @@ var z = {
133
138
  warning: "breeze:bg-breeze-warn-soft breeze:text-breeze-warn"
134
139
  }
135
140
  };
136
- function he({ "aria-label": e, children: t, loading: n = !1, variant: r = "neutral" }) {
137
- let { messages: i } = j(), a = e?.trim() || void 0, o;
138
- return n ? o = /* @__PURE__ */ d("span", {
139
- className: z.base.skeleton,
140
- children: /* @__PURE__ */ d(I, {
141
+ function _e({ "aria-label": e, children: t, loading: n = !1, variant: r = "neutral" }) {
142
+ let { messages: i } = U(), a = e?.trim() || void 0, o;
143
+ return n ? o = /* @__PURE__ */ m("span", {
144
+ className: K.base.skeleton,
145
+ children: /* @__PURE__ */ m(me, {
141
146
  blockSize: 8,
142
147
  inlineSize: "100%",
143
148
  label: i.loading,
144
149
  shape: "rectangle"
145
150
  })
146
- }) : a !== void 0 && (o = /* @__PURE__ */ d(R, { children: a })), /* @__PURE__ */ f("span", {
151
+ }) : a !== void 0 && (o = /* @__PURE__ */ m(ge, { children: a })), /* @__PURE__ */ h("span", {
147
152
  "aria-busy": n || void 0,
148
- className: [z.base.badge, z.variant[r]].join(" "),
149
- children: [/* @__PURE__ */ d("span", {
153
+ className: [K.base.badge, K.variant[r]].join(" "),
154
+ children: [/* @__PURE__ */ m("span", {
150
155
  "aria-hidden": n || a !== void 0 ? !0 : void 0,
151
- className: [z.base.content, n && z.state.contentLoading].filter(Boolean).join(" "),
156
+ className: [K.base.content, n && K.state.contentLoading].filter(Boolean).join(" "),
152
157
  children: t
153
158
  }), o]
154
159
  });
155
160
  }
156
161
  //#endregion
157
162
  //#region src/primitives/Button/Button.tsx
158
- var B = {
163
+ var q = {
159
164
  base: {
160
165
  button: "breeze:relative breeze:inline-grid breeze:items-center breeze:justify-center breeze:gap-breeze-2 breeze:border breeze:border-solid breeze:rounded-breeze-ctl breeze:font-breeze-sans breeze:text-breeze-sm breeze:leading-breeze-snug breeze:cursor-pointer breeze:select-none breeze:[text-align:center] breeze:outline-offset-2 breeze:data-[focus-visible]:outline-2 breeze:data-[focus-visible]:outline-solid breeze:data-[focus-visible]:outline-breeze-brand breeze:any-pointer-coarse:min-block-breeze-tap breeze:any-pointer-coarse:min-inline-breeze-tap",
161
166
  label: "breeze:[grid-area:1/1]",
@@ -185,25 +190,25 @@ var B = {
185
190
  secondary: "breeze:border-breeze-line-strong breeze:bg-breeze-surface breeze:text-breeze-ink breeze:data-[hovered]:bg-breeze-sunken breeze:data-[pressed]:bg-breeze-sunken"
186
191
  }
187
192
  };
188
- function ge() {
189
- let e = h(m), { getMessageLocale: t, messages: n } = j();
190
- return /* @__PURE__ */ d("progress", {
193
+ function ve() {
194
+ let e = v(_), { getMessageLocale: t, messages: n } = U();
195
+ return /* @__PURE__ */ m("progress", {
191
196
  "aria-label": n.loading,
192
- className: B.state.loadingStatus,
197
+ className: q.state.loadingStatus,
193
198
  id: e?.id,
194
199
  lang: t("loading")
195
200
  });
196
201
  }
197
- function _e({ "aria-controls": e, "aria-describedby": t, "aria-expanded": n, "aria-haspopup": i, "aria-label": a, "aria-labelledby": o, children: s, disabled: c = !1, form: l, id: m, loading: h = !1, name: g, onAction: _, ref: v, size: y = "md", type: b = "button", value: x, variant: S = "primary" }) {
198
- j();
202
+ function ye({ "aria-controls": e, "aria-describedby": t, "aria-expanded": n, "aria-haspopup": i, "aria-label": a, "aria-labelledby": o, children: s, disabled: c = !1, form: l, id: u, loading: d = !1, name: f, onAction: _, ref: v, size: y = "md", type: b = "button", value: x, variant: S = "primary" }) {
203
+ U();
199
204
  let C = [
200
- B.base.button,
201
- B.variant[S],
202
- B.size[y],
203
- c && B.state.disabled,
204
- h && B.state.loading
205
+ q.base.button,
206
+ q.variant[S],
207
+ q.size[y],
208
+ c && q.state.disabled,
209
+ d && q.state.loading
205
210
  ].filter(Boolean).join(" ");
206
- return /* @__PURE__ */ f(p, {
211
+ return /* @__PURE__ */ h(g, {
207
212
  "aria-controls": e,
208
213
  "aria-describedby": t,
209
214
  "aria-expanded": n,
@@ -212,33 +217,33 @@ function _e({ "aria-controls": e, "aria-describedby": t, "aria-expanded": n, "ar
212
217
  "aria-labelledby": o,
213
218
  className: C,
214
219
  form: l,
215
- id: m,
220
+ id: u,
216
221
  isDisabled: c,
217
- isPending: h,
218
- name: g,
222
+ isPending: d,
223
+ name: f,
219
224
  onPress: () => _?.(),
220
225
  ref: v,
221
226
  render: (e) => r("button", {
222
227
  ...e,
223
- "aria-busy": h || void 0,
224
- onClick: h ? (e) => e.preventDefault() : e.onClick,
228
+ "aria-busy": d || void 0,
229
+ onClick: d ? (e) => e.preventDefault() : e.onClick,
225
230
  type: b === "submit" ? "submit" : "button"
226
231
  }),
227
232
  type: b,
228
233
  value: x,
229
- children: [/* @__PURE__ */ d("span", {
230
- className: [B.base.label, h && B.state.loadingLabel].filter(Boolean).join(" "),
234
+ children: [/* @__PURE__ */ m("span", {
235
+ className: [q.base.label, d && q.state.loadingLabel].filter(Boolean).join(" "),
231
236
  children: s
232
- }), h && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(ge, {}), /* @__PURE__ */ d("span", {
237
+ }), d && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(ve, {}), /* @__PURE__ */ m("span", {
233
238
  "aria-hidden": "true",
234
- className: [B.base.skeleton, B.compound.loading[S]].join(" "),
239
+ className: [q.base.skeleton, q.compound.loading[S]].join(" "),
235
240
  "data-breeze-skeleton": ""
236
241
  })] })]
237
242
  });
238
243
  }
239
244
  //#endregion
240
245
  //#region src/primitives/layout.accessibility.ts
241
- function V(e, t) {
246
+ function J(e, t) {
242
247
  let n = e?.trim() || void 0;
243
248
  return {
244
249
  accessibleLabel: n,
@@ -247,7 +252,7 @@ function V(e, t) {
247
252
  }
248
253
  //#endregion
249
254
  //#region src/primitives/Card/Card.tsx
250
- var H = {
255
+ var be = {
251
256
  base: { card: "breeze:min-inline-size-0 breeze:rounded-breeze-panel breeze:border breeze:border-solid breeze:border-breeze-line breeze:shadow-breeze-panel" },
252
257
  compound: {},
253
258
  size: {
@@ -267,22 +272,22 @@ var H = {
267
272
  surface: "breeze:bg-breeze-surface"
268
273
  }
269
274
  };
270
- function ve({ "aria-label": e, children: t, clipped: n = !0, element: i = "div", padding: a = 4, variant: o = "surface" }) {
271
- let { accessibleLabel: s, role: c } = V(e, i);
275
+ function xe({ "aria-label": e, children: t, clipped: n = !0, element: i = "div", padding: a = 4, variant: o = "surface" }) {
276
+ let { accessibleLabel: s, role: c } = J(e, i);
272
277
  return r(i, {
273
278
  "aria-label": s,
274
279
  className: [
275
- H.base.card,
276
- H.variant[o],
277
- H.size[a],
278
- n && H.state.clipped
280
+ be.base.card,
281
+ be.variant[o],
282
+ be.size[a],
283
+ n && be.state.clipped
279
284
  ].filter(Boolean).join(" "),
280
285
  role: c
281
286
  }, t);
282
287
  }
283
288
  //#endregion
284
289
  //#region src/primitives/Container/Container.tsx
285
- var U = {
290
+ var Se = {
286
291
  base: { container: "breeze:mx-auto breeze:inline-size-full breeze:min-inline-size-0" },
287
292
  compound: {},
288
293
  size: {
@@ -293,21 +298,363 @@ var U = {
293
298
  state: { padded: "breeze:ps-breeze-4 breeze:pe-breeze-4 breeze:breeze-md:ps-breeze-7 breeze:breeze-md:pe-breeze-7" },
294
299
  variant: {}
295
300
  };
296
- function W({ "aria-label": e, children: t, element: n = "div", padded: i = !0, width: a = "page" }) {
297
- let { accessibleLabel: o, role: s } = V(e, n);
301
+ function Ce({ "aria-label": e, children: t, element: n = "div", padded: i = !0, width: a = "page" }) {
302
+ let { accessibleLabel: o, role: s } = J(e, n);
298
303
  return r(n, {
299
304
  "aria-label": o,
300
305
  className: [
301
- U.base.container,
302
- U.size[a],
303
- i && U.state.padded
306
+ Se.base.container,
307
+ Se.size[a],
308
+ i && Se.state.padded
304
309
  ].filter(Boolean).join(" "),
305
310
  role: s
306
311
  }, t);
307
312
  }
308
313
  //#endregion
314
+ //#region src/overlays/OverlayStack.ts
315
+ function we() {
316
+ let e = [], t = /* @__PURE__ */ new Set(), n = () => t.forEach((e) => e());
317
+ return {
318
+ getSnapshot: () => e,
319
+ remove: (t) => {
320
+ e = e.filter((e) => e.id !== t), n();
321
+ },
322
+ set: (t) => {
323
+ let r = e.find((e) => e.id === t.id);
324
+ r?.active === t.active && r.kind === t.kind && r.parent === t.parent && r.visual === t.visual || (e = r && (!t.active || r.active) ? e.map((e) => e.id === t.id ? t : e) : [...e.filter((e) => e.id !== t.id), t], n());
325
+ },
326
+ subscribe: (e) => (t.add(e), () => {
327
+ t.delete(e);
328
+ })
329
+ };
330
+ }
331
+ var Te = n(null);
332
+ function Ee() {
333
+ let e = a(Te);
334
+ if (!e) throw Error("Breeze components must be rendered within BreezeProvider.");
335
+ return 100 + f(e.subscribe, e.getSnapshot, e.getSnapshot).length * 2;
336
+ }
337
+ var De = n(null);
338
+ function Oe(e, t, n) {
339
+ let r = a(Te), i = a(De), o = s();
340
+ if (!r) throw Error("Breeze components must be rendered within BreezeProvider.");
341
+ let l = f(r.subscribe, r.getSnapshot, r.getSnapshot), u = i?.id;
342
+ c(() => () => r.remove(o), [o, r]), c(() => {
343
+ r.set({
344
+ active: t,
345
+ id: o,
346
+ kind: e,
347
+ parent: u,
348
+ visual: n
349
+ });
350
+ }, [
351
+ o,
352
+ e,
353
+ t,
354
+ u,
355
+ r,
356
+ n
357
+ ]);
358
+ let d = [], p = (e) => {
359
+ if (d.includes(e)) return;
360
+ let t = l.find((t) => t.id === e.parent);
361
+ t && p(t), d.push(e);
362
+ };
363
+ l.forEach(p);
364
+ let m = (e) => {
365
+ let t = l.find((t) => t.id === e.parent);
366
+ return e.active && (!t || m(t));
367
+ }, h = d.filter(m), g = h.findIndex((e) => e.id === o), _ = t && g !== -1 && !h.slice(g + 1).some((e) => e.kind !== "popover"), v = t && h.at(-1)?.id === o, y = h.findLast((e) => e.kind === "drawer" || e.kind === "dialog"), b = d.findLast((e) => e.visual && (e.kind === "drawer" || e.kind === "dialog"));
368
+ return {
369
+ id: o,
370
+ interactive: _,
371
+ scrim: (y ?? b)?.id === o,
372
+ topmost: v,
373
+ zIndex: 100 + Math.max(0, d.findIndex((e) => e.id === o)) * 2
374
+ };
375
+ }
376
+ //#endregion
377
+ //#region src/overlays/OverlayProvider.tsx
378
+ var ke = n(null), Ae = "BreezeProvider portalContainer must belong to the current document and light DOM.";
379
+ function je({ children: e, portalContainer: t, locale: n }) {
380
+ let { direction: r } = T(), [i] = d(we), [a, o] = d(null);
381
+ return c(() => {
382
+ let e = t ?? document.body;
383
+ if (e.ownerDocument !== document || e.getRootNode() !== document) throw Error(Ae);
384
+ let n = e.ownerDocument.createElement("div");
385
+ return n.dataset.breezeRoot = "", n.dataset.breezePortal = "", e.append(n), o(n), () => n.remove();
386
+ }, [t]), c(() => {
387
+ a && (a.lang = n, a.dir = r);
388
+ }, [
389
+ r,
390
+ a,
391
+ n
392
+ ]), /* @__PURE__ */ m(C, {
393
+ getContainer: () => a,
394
+ children: /* @__PURE__ */ m(Te, {
395
+ value: i,
396
+ children: /* @__PURE__ */ m(ke, {
397
+ value: a,
398
+ children: e
399
+ })
400
+ })
401
+ });
402
+ }
403
+ function Me() {
404
+ return a(ke);
405
+ }
406
+ //#endregion
407
+ //#region src/overlays/OverlaySurface.tsx
408
+ var Y = {
409
+ base: {
410
+ content: "breeze-overlay-content",
411
+ header: "breeze-overlay-header",
412
+ title: "breeze-overlay-title"
413
+ },
414
+ compound: {},
415
+ size: {},
416
+ state: {},
417
+ variant: {
418
+ dialog: "breeze-dialog",
419
+ drawer: "breeze-drawer",
420
+ fullscreen: "breeze-fullscreen",
421
+ popover: "breeze-popover"
422
+ }
423
+ }, Ne = "Breeze overlay triggers and portal containers must belong to the current document and light DOM.";
424
+ function X(e) {
425
+ return typeof e == "object" && !!e && "nodeType" in e && typeof e.contains == "function";
426
+ }
427
+ function Pe(e) {
428
+ return e.dataset?.breezeOverlay !== void 0;
429
+ }
430
+ function Fe({ children: e, defaultOpen: t = !1, dismissible: n = !0, kind: r, onOpenChange: s, open: f, placement: g = "bottom", title: _, trigger: v }) {
431
+ let { getMessageLocale: C, messages: w } = U(), T = r === "popover" || r === "fullscreen", E = Me(), D = a(De), [ee, te] = d(D === null);
432
+ o(() => te(!0), []);
433
+ let [ne, re] = d(t), O = f ?? ne, k = D?.open ?? !0, A = O && k, j = u(null), ie = u(null), M = u(null), [ae, oe] = d(!1), se = u(!1), N = u(null), P = u(null), F = u(null), I = u(null), ce = u(!1);
434
+ c(() => {
435
+ if (E && j.current && (j.current.ownerDocument !== document || j.current.getRootNode() !== document || E.ownerDocument !== document || E.getRootNode() !== document)) throw Error(Ne);
436
+ }, [E]);
437
+ let le = l(() => r === "fullscreen" ? { current: E } : j, [E, r]), L = Oe(r, A && ee && E !== null, A || ae), R = i((e) => {
438
+ if (!e && !k) {
439
+ if (ce.current) return;
440
+ O && (ce.current = !0);
441
+ }
442
+ f === void 0 && re(e), s?.(e);
443
+ }, [
444
+ f,
445
+ s,
446
+ k,
447
+ O
448
+ ]);
449
+ o(() => {
450
+ k ? ce.current = !1 : O && R(!1);
451
+ }, [
452
+ R,
453
+ k,
454
+ O
455
+ ]), o(() => {
456
+ if (r !== "popover" || !A || !n || !L.topmost || !E) return;
457
+ let e = () => {
458
+ P.current !== null && (clearTimeout(P.current), P.current = null);
459
+ }, t = (e, t) => !!e && !!t && (e === t || e.contains(t) || t.contains(e)), i = (e) => e.button === 0, a = (e) => X(e) && !ie.current?.contains(e) && !j.current?.contains(e), o = (t) => {
460
+ i(t) && (e(), I.current = null, F.current = X(t.target) ? t.target : null);
461
+ }, s = (n) => {
462
+ if (!i(n)) return;
463
+ let r = F.current, o = X(n.target) ? n.target : null;
464
+ !a(r) || !a(o) || (e(), P.current = setTimeout(() => {
465
+ P.current = null;
466
+ let e = I.current, n = F.current;
467
+ I.current = null, F.current = null, !(t(e, o) && t(e, n)) && R(!1);
468
+ }, 0));
469
+ }, c = () => {
470
+ e(), I.current = null, F.current = null;
471
+ }, l = (n) => {
472
+ let r = X(n.target) ? n.target : null;
473
+ if (e(), a(r)) {
474
+ let e = I.current, n = F.current;
475
+ if (I.current = null, F.current = null, t(e, r) && t(e, n)) return;
476
+ R(!1);
477
+ }
478
+ };
479
+ return E.ownerDocument.addEventListener("pointerdown", o, !0), E.ownerDocument.addEventListener("pointerup", s, !0), E.ownerDocument.addEventListener("pointercancel", c, !0), E.ownerDocument.addEventListener("click", l, !0), () => {
480
+ e(), E.ownerDocument.removeEventListener("pointerdown", o, !0), E.ownerDocument.removeEventListener("pointerup", s, !0), E.ownerDocument.removeEventListener("pointercancel", c, !0), E.ownerDocument.removeEventListener("click", l, !0), I.current = null, F.current = null;
481
+ };
482
+ }, [
483
+ R,
484
+ n,
485
+ E,
486
+ r,
487
+ L.topmost,
488
+ A
489
+ ]);
490
+ let ue = D?.restoreFocus, z = D?.id, B = i(() => {
491
+ let e = j.current, t = E?.ownerDocument, n = t?.activeElement;
492
+ if (!t || !E) return;
493
+ let r = z ? t.getElementById(z) : null;
494
+ if (!(n === t.body || n === r || n?.closest("[data-exiting]"))) return;
495
+ if (!e?.isConnected) {
496
+ ue?.();
497
+ return;
498
+ }
499
+ let i = E.querySelector("[data-breeze-topmost=\"true\"]");
500
+ (!i || i.contains(e)) && !e.closest("[inert], [aria-hidden=\"true\"]") && e.focus({ preventScroll: !0 });
501
+ }, [
502
+ E,
503
+ z,
504
+ ue
505
+ ]), V = i(() => {
506
+ N.current !== null && (clearTimeout(N.current), N.current = null);
507
+ }, []), H = i((e) => {
508
+ queueMicrotask(() => {
509
+ !e.isConnected || e.closest("[inert], [data-exiting]") || (V(), e.focus({ preventScroll: !0 }), N.current = setTimeout(() => {
510
+ let { ownerDocument: t } = e, { activeElement: n } = t;
511
+ e.isConnected && !e.closest("[inert], [data-exiting]") && (n === e || n === t.body) && (se.current = !0, e.blur(), e.focus({ preventScroll: !0 }), se.current = !1), N.current = null;
512
+ }, 500));
513
+ });
514
+ }, [V]), W = u(A);
515
+ o(() => {
516
+ let e = W.current;
517
+ W.current = A, !(!T || !A || e || !M.current) && H(M.current);
518
+ }, [
519
+ H,
520
+ T,
521
+ A
522
+ ]);
523
+ let de = i((e) => {
524
+ M.current = e;
525
+ let t = () => {
526
+ V(), M.current = null, oe(!1), requestAnimationFrame(B);
527
+ };
528
+ if (!e) {
529
+ t();
530
+ return;
531
+ }
532
+ return oe(!0), T && H(e), t;
533
+ }, [
534
+ V,
535
+ H,
536
+ T,
537
+ B
538
+ ]), fe = l(() => ({
539
+ id: L.id,
540
+ open: A,
541
+ restoreFocus: B
542
+ }), [
543
+ L.id,
544
+ A,
545
+ B
546
+ ]), pe = /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
547
+ className: Y.base.header,
548
+ children: [/* @__PURE__ */ m("h2", {
549
+ className: Y.base.title,
550
+ children: _
551
+ }), /* @__PURE__ */ m("span", {
552
+ lang: C("close"),
553
+ children: /* @__PURE__ */ m(ye, {
554
+ onAction: () => R(!1),
555
+ variant: "quiet",
556
+ children: w.close
557
+ })
558
+ })]
559
+ }), e] }), G = /* @__PURE__ */ m(De, {
560
+ value: fe,
561
+ children: T ? /* @__PURE__ */ m("section", {
562
+ "aria-label": _,
563
+ className: Y.base.content,
564
+ id: L.id,
565
+ onBlur: (e) => {
566
+ if (se.current) {
567
+ e.stopPropagation();
568
+ return;
569
+ }
570
+ let { relatedTarget: t } = e;
571
+ r === "popover" && n && L.topmost && X(t) && !e.currentTarget.contains(t) && !j.current?.contains(t) && (I.current = t);
572
+ },
573
+ ref: de,
574
+ role: "dialog",
575
+ tabIndex: -1,
576
+ children: pe
577
+ }) : /* @__PURE__ */ m(y, {
578
+ "aria-label": _,
579
+ className: Y.base.content,
580
+ id: L.id,
581
+ ref: de,
582
+ children: pe
583
+ })
584
+ });
585
+ return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(ye, {
586
+ "aria-controls": A ? L.id : void 0,
587
+ "aria-expanded": A,
588
+ "aria-haspopup": "dialog",
589
+ onAction: () => R(!T || !A),
590
+ ref: j,
591
+ children: v
592
+ }), E && ee && (T ? /* @__PURE__ */ m(S, {
593
+ className: Y.variant[r],
594
+ "data-breeze-overlay": r,
595
+ "data-breeze-topmost": L.topmost,
596
+ "data-breeze-interactive": L.interactive,
597
+ inert: !L.interactive,
598
+ isNonModal: !0,
599
+ isOpen: A,
600
+ isKeyboardDismissDisabled: !n || !L.topmost,
601
+ onOpenChange: R,
602
+ placement: g,
603
+ ref: ie,
604
+ shouldCloseOnInteractOutside: (e) => r === "popover" && n && L.topmost && !j.current?.contains(e),
605
+ style: { zIndex: L.zIndex },
606
+ triggerRef: le,
607
+ children: G
608
+ }) : /* @__PURE__ */ m(x, {
609
+ className: "breeze-overlay-backdrop",
610
+ "data-breeze-overlay": r,
611
+ "data-breeze-scrim": L.scrim,
612
+ "data-breeze-topmost": L.topmost,
613
+ "data-breeze-interactive": L.interactive,
614
+ inert: !L.interactive,
615
+ isDismissable: n && L.topmost,
616
+ isKeyboardDismissDisabled: !n || !L.topmost,
617
+ isOpen: A,
618
+ onOpenChange: R,
619
+ shouldCloseOnInteractOutside: (e) => L.topmost && Pe(e),
620
+ style: { zIndex: L.zIndex },
621
+ children: /* @__PURE__ */ m(b, {
622
+ className: Y.variant[r],
623
+ children: G
624
+ })
625
+ }))] });
626
+ }
627
+ //#endregion
628
+ //#region src/primitives/Dialog/Dialog.tsx
629
+ function Ie({ children: e, defaultOpen: t, dismissible: n, onOpenChange: r, open: i, title: a, trigger: o }) {
630
+ return /* @__PURE__ */ m(Fe, {
631
+ defaultOpen: t,
632
+ dismissible: n,
633
+ onOpenChange: r,
634
+ open: i,
635
+ title: a,
636
+ trigger: o,
637
+ kind: "dialog",
638
+ children: e
639
+ });
640
+ }
641
+ //#endregion
642
+ //#region src/primitives/Drawer/Drawer.tsx
643
+ function Le({ children: e, defaultOpen: t, dismissible: n, onOpenChange: r, open: i, title: a, trigger: o }) {
644
+ return /* @__PURE__ */ m(Fe, {
645
+ defaultOpen: t,
646
+ dismissible: n,
647
+ onOpenChange: r,
648
+ open: i,
649
+ title: a,
650
+ trigger: o,
651
+ kind: "drawer",
652
+ children: e
653
+ });
654
+ }
655
+ //#endregion
309
656
  //#region src/primitives/Grid/Grid.tsx
310
- var G = {
657
+ var Re = {
311
658
  base: { grid: "breeze:grid breeze:min-inline-size-0" },
312
659
  compound: { columns: {
313
660
  1: {
@@ -343,48 +690,48 @@ var G = {
343
690
  state: {},
344
691
  variant: {}
345
692
  };
346
- function ye({ "aria-label": e, children: t, collapseBelow: n = "md", columns: i = 2, element: a = "div", gap: o = 4 }) {
347
- let { accessibleLabel: s, role: c } = V(e, a);
693
+ function ze({ "aria-label": e, children: t, collapseBelow: n = "md", columns: i = 2, element: a = "div", gap: o = 4 }) {
694
+ let { accessibleLabel: s, role: c } = J(e, a);
348
695
  return r(a, {
349
696
  "aria-label": s,
350
697
  className: [
351
- G.base.grid,
352
- G.compound.columns[i][n],
353
- G.size[o]
698
+ Re.base.grid,
699
+ Re.compound.columns[i][n],
700
+ Re.size[o]
354
701
  ].join(" "),
355
702
  role: c
356
703
  }, t);
357
704
  }
358
705
  //#endregion
359
706
  //#region src/primitives/Icon/Icon.tsx
360
- var be = {
361
- add: ie,
362
- back: w,
363
- building: y,
364
- calendar: b,
365
- camera: x,
366
- check: S,
367
- clock: ee,
368
- close: ue,
369
- delete: oe,
370
- document: D,
371
- download: te,
372
- expand: C,
373
- forward: T,
374
- lock: ne,
375
- money: k,
376
- moneyIn: g,
377
- moneyOut: _,
378
- more: E,
379
- next: T,
380
- notifications: v,
381
- overview: O,
382
- people: le,
383
- settings: ae,
384
- signOut: re,
385
- upload: ce,
386
- warning: se
387
- }, K = {
707
+ var Be = {
708
+ add: I,
709
+ back: A,
710
+ building: te,
711
+ calendar: ne,
712
+ camera: re,
713
+ check: O,
714
+ clock: ie,
715
+ close: z,
716
+ delete: le,
717
+ document: oe,
718
+ download: M,
719
+ expand: k,
720
+ forward: j,
721
+ lock: P,
722
+ money: N,
723
+ moneyIn: E,
724
+ moneyOut: D,
725
+ more: ae,
726
+ next: j,
727
+ notifications: ee,
728
+ overview: se,
729
+ people: ue,
730
+ settings: ce,
731
+ signOut: F,
732
+ upload: R,
733
+ warning: L
734
+ }, Ve = {
388
735
  base: { icon: "breeze:block breeze:shrink-0" },
389
736
  compound: {},
390
737
  size: {
@@ -394,20 +741,20 @@ var be = {
394
741
  },
395
742
  state: { logicalDirection: "breeze:rtl:rotate-180" },
396
743
  variant: {}
397
- }, xe = /* @__PURE__ */ new Set([
744
+ }, He = /* @__PURE__ */ new Set([
398
745
  "back",
399
746
  "forward",
400
747
  "next"
401
748
  ]);
402
- function q({ label: e, name: t, size: n = "md" }) {
403
- let r = be[t], i = e?.trim() || void 0;
404
- return /* @__PURE__ */ d(r, {
749
+ function Ue({ label: e, name: t, size: n = "md" }) {
750
+ let r = Be[t], i = e?.trim() || void 0;
751
+ return /* @__PURE__ */ m(r, {
405
752
  "aria-hidden": i === void 0 || void 0,
406
753
  "aria-label": i,
407
754
  className: [
408
- K.base.icon,
409
- K.size[n],
410
- xe.has(t) && K.state.logicalDirection
755
+ Ve.base.icon,
756
+ Ve.size[n],
757
+ He.has(t) && Ve.state.logicalDirection
411
758
  ].filter(Boolean).join(" "),
412
759
  focusable: "false",
413
760
  role: i === void 0 ? void 0 : "img",
@@ -416,7 +763,7 @@ function q({ label: e, name: t, size: n = "md" }) {
416
763
  }
417
764
  //#endregion
418
765
  //#region src/primitives/IconTile/IconTile.tsx
419
- var J = {
766
+ var We = {
420
767
  base: { tile: "breeze:inline-flex breeze:shrink-0 breeze:items-center breeze:justify-center" },
421
768
  compound: {},
422
769
  size: {
@@ -438,15 +785,15 @@ var J = {
438
785
  }
439
786
  }
440
787
  };
441
- function Se({ label: e, name: t, shape: n = "square", size: r = "lg", tone: i = "brand" }) {
442
- return /* @__PURE__ */ d("span", {
788
+ function Ge({ label: e, name: t, shape: n = "square", size: r = "lg", tone: i = "brand" }) {
789
+ return /* @__PURE__ */ m("span", {
443
790
  className: [
444
- J.base.tile,
445
- J.variant.tone[i],
446
- J.variant.shape[n],
447
- J.size[r]
791
+ We.base.tile,
792
+ We.variant.tone[i],
793
+ We.variant.shape[n],
794
+ We.size[r]
448
795
  ].join(" "),
449
- children: /* @__PURE__ */ d(q, {
796
+ children: /* @__PURE__ */ m(Ue, {
450
797
  label: e,
451
798
  name: t,
452
799
  size: r === "lg" ? "md" : "sm"
@@ -455,7 +802,7 @@ function Se({ label: e, name: t, shape: n = "square", size: r = "lg", tone: i =
455
802
  }
456
803
  //#endregion
457
804
  //#region src/primitives/Inline/Inline.tsx
458
- var Y = {
805
+ var Z = {
459
806
  base: { inline: "breeze:flex breeze:min-inline-size-0" },
460
807
  compound: {},
461
808
  size: {
@@ -485,23 +832,38 @@ var Y = {
485
832
  }
486
833
  }
487
834
  };
488
- function Ce({ "aria-label": e, children: t, element: n = "div", gap: i = 3, justify: a = "start", verticalAlign: o = "center", wrap: s = !1 }) {
489
- let { accessibleLabel: c, role: l } = V(e, n);
835
+ function Ke({ "aria-label": e, children: t, element: n = "div", gap: i = 3, justify: a = "start", verticalAlign: o = "center", wrap: s = !1 }) {
836
+ let { accessibleLabel: c, role: l } = J(e, n);
490
837
  return r(n, {
491
838
  "aria-label": c,
492
839
  className: [
493
- Y.base.inline,
494
- Y.variant.align[o],
495
- Y.variant.justify[a],
496
- Y.size[i],
497
- s && Y.state.wrap
840
+ Z.base.inline,
841
+ Z.variant.align[o],
842
+ Z.variant.justify[a],
843
+ Z.size[i],
844
+ s && Z.state.wrap
498
845
  ].filter(Boolean).join(" "),
499
846
  role: l
500
847
  }, t);
501
848
  }
502
849
  //#endregion
850
+ //#region src/primitives/Popover/Popover.tsx
851
+ function qe({ children: e, defaultOpen: t, dismissible: n, onOpenChange: r, open: i, title: a, trigger: o, placement: s }) {
852
+ return /* @__PURE__ */ m(Fe, {
853
+ defaultOpen: t,
854
+ dismissible: n,
855
+ onOpenChange: r,
856
+ open: i,
857
+ title: a,
858
+ trigger: o,
859
+ placement: s,
860
+ kind: "popover",
861
+ children: e
862
+ });
863
+ }
864
+ //#endregion
503
865
  //#region src/primitives/Separator/Separator.tsx
504
- var X = {
866
+ var Je = {
505
867
  base: { separator: "breeze:m-0 breeze:shrink-0 breeze:border-0 breeze:bg-breeze-line breeze:forced-colors:bg-[CanvasText]" },
506
868
  compound: {},
507
869
  size: {},
@@ -511,15 +873,15 @@ var X = {
511
873
  vertical: "breeze:block-size-full breeze:inline-size-breeze-px"
512
874
  }
513
875
  };
514
- function we({ orientation: e = "horizontal" }) {
515
- return /* @__PURE__ */ d("hr", {
876
+ function Ye({ orientation: e = "horizontal" }) {
877
+ return /* @__PURE__ */ m("hr", {
516
878
  "aria-orientation": e,
517
- className: [X.base.separator, X.variant[e]].join(" ")
879
+ className: [Je.base.separator, Je.variant[e]].join(" ")
518
880
  });
519
881
  }
520
882
  //#endregion
521
883
  //#region src/primitives/Stack/Stack.tsx
522
- var Z = {
884
+ var Xe = {
523
885
  base: { stack: "breeze:flex breeze:min-inline-size-0 breeze:flex-col" },
524
886
  compound: {},
525
887
  size: {
@@ -541,19 +903,180 @@ var Z = {
541
903
  stretch: "breeze:items-stretch"
542
904
  }
543
905
  };
544
- function Te({ "aria-label": e, children: t, element: n = "div", gap: i = 3, horizontalAlign: a = "stretch" }) {
545
- let { accessibleLabel: o, role: s } = V(e, n);
906
+ function Ze({ "aria-label": e, children: t, element: n = "div", gap: i = 3, horizontalAlign: a = "stretch" }) {
907
+ let { accessibleLabel: o, role: s } = J(e, n);
546
908
  return r(n, {
547
909
  "aria-label": o,
548
910
  className: [
549
- Z.base.stack,
550
- Z.variant[a],
551
- Z.size[i]
911
+ Xe.base.stack,
912
+ Xe.variant[a],
913
+ Xe.size[i]
552
914
  ].join(" "),
553
915
  role: s
554
916
  }, t);
555
917
  }
556
918
  //#endregion
919
+ //#region src/primitives/Toast/Toast.tsx
920
+ var Qe = 2600, $e = "BreezeProvider toastLimit must be a positive integer.", et = "Toast components must be rendered within BreezeProvider.";
921
+ function tt(e) {
922
+ return e.isIntersecting && e.intersectionRatio >= 1;
923
+ }
924
+ function nt(e, t, n, r) {
925
+ let i = Number(e.target.dataset.breezeToastId);
926
+ t.has(i) && (tt(e) ? n(i) : r(i));
927
+ }
928
+ var rt = n(null), it = n(!0), at = n(null);
929
+ function ot({ children: e }) {
930
+ U();
931
+ let t = a(it), n = a(at), [r, i] = d(() => n?.message ?? null);
932
+ return o(() => {
933
+ if (!t || typeof document < "u" && document.hidden || r === e) return;
934
+ let a = setTimeout(() => {
935
+ i(e), n?.remember(e);
936
+ }, 0);
937
+ return () => clearTimeout(a);
938
+ }, [
939
+ e,
940
+ n,
941
+ t,
942
+ r
943
+ ]), /* @__PURE__ */ h("div", {
944
+ "aria-atomic": "true",
945
+ "aria-label": r ?? void 0,
946
+ "aria-live": "polite",
947
+ className: "breeze-toast",
948
+ role: "status",
949
+ children: [/* @__PURE__ */ m(Ue, {
950
+ name: "check",
951
+ size: "sm"
952
+ }), /* @__PURE__ */ m("span", { children: r })]
953
+ });
954
+ }
955
+ function st({ children: e, limit: t }) {
956
+ let n = Me(), r = Ee(), a = u(null), [s, l] = d(() => typeof document > "u" || !document.hidden), [f, p] = d([]), g = u(0), _ = u(/* @__PURE__ */ new Map()), v = u(/* @__PURE__ */ new Set()), y = u(/* @__PURE__ */ new Map());
957
+ if (!Number.isInteger(t) || t < 1) throw RangeError($e);
958
+ let b = i((e, t) => {
959
+ let n = y.current.get(e);
960
+ n !== void 0 && (n.message = t);
961
+ }, []), x = i((e) => {
962
+ let t = g.current;
963
+ g.current += 1, y.current.set(t, {
964
+ message: null,
965
+ remember: (e) => b(t, e)
966
+ }), p((n) => [...n, {
967
+ id: t,
968
+ message: e
969
+ }]);
970
+ }, [b]), S = i((e) => {
971
+ _.current.delete(e), v.current.delete(e), y.current.delete(e), p((t) => t.filter((t) => t.id !== e));
972
+ }, []), C = i(() => {
973
+ Array.from(_.current.values()).forEach(({ handle: e }) => {
974
+ e !== null && clearTimeout(e);
975
+ }), _.current.clear();
976
+ }, []), w = i((e, t = Date.now()) => {
977
+ let n = _.current.get(e);
978
+ n?.handle === null || n?.startedAt === null || n === void 0 || (n.remaining = Math.max(0, n.remaining - Math.max(0, t - n.startedAt)), clearTimeout(n.handle), n.handle = null, n.startedAt = null, n.remaining === 0 && S(e));
979
+ }, [S]), T = i(() => {
980
+ let e = Date.now();
981
+ Array.from(_.current.keys()).forEach((t) => {
982
+ w(t, e);
983
+ });
984
+ }, [w]), E = i((e) => {
985
+ let t = _.current.get(e);
986
+ t?.handle !== null && t?.handle !== void 0 && clearTimeout(t.handle), _.current.delete(e);
987
+ }, []), D = i((e) => {
988
+ let t = _.current.get(e);
989
+ if (!s || typeof document < "u" && document.hidden || t !== void 0 && t.handle !== null) return;
990
+ let n = t ?? {
991
+ handle: null,
992
+ remaining: Qe,
993
+ startedAt: null
994
+ };
995
+ if (n.remaining <= 0) {
996
+ S(e);
997
+ return;
998
+ }
999
+ n.startedAt = Date.now(), n.handle = setTimeout(() => S(e), n.remaining), _.current.set(e, n);
1000
+ }, [S, s]);
1001
+ o(() => {
1002
+ let e = () => {
1003
+ let e = !document.hidden;
1004
+ e || T(), l(e);
1005
+ };
1006
+ return document.addEventListener("visibilitychange", e), e(), () => document.removeEventListener("visibilitychange", e);
1007
+ }, [T]), c(() => {
1008
+ let e = f.slice(0, t), n = new Set(e.map(({ id: e }) => e)), r = new Set(f.map(({ id: e }) => e));
1009
+ e.forEach(({ id: e }) => v.current.add(e)), Array.from(_.current.keys()).forEach((e) => {
1010
+ n.has(e) || (r.has(e) ? w(e) : E(e));
1011
+ });
1012
+ }, [
1013
+ t,
1014
+ w,
1015
+ f,
1016
+ E
1017
+ ]), o(() => {
1018
+ let e = f.slice(0, t), r = new Set(e.map(({ id: e }) => e)), i = a.current;
1019
+ if (n === null || i === null || !s) return;
1020
+ if (typeof IntersectionObserver > "u") {
1021
+ e.forEach((e) => D(e.id));
1022
+ return;
1023
+ }
1024
+ let o, c = setTimeout(() => {
1025
+ o = new IntersectionObserver((e) => {
1026
+ e.forEach((e) => nt(e, r, D, w));
1027
+ }, { threshold: 1 }), Array.from(i.children).forEach((e) => {
1028
+ e instanceof HTMLElement && e.dataset.breezeToastId !== void 0 && !e.hidden && o?.observe(e);
1029
+ });
1030
+ }, 0);
1031
+ return () => {
1032
+ clearTimeout(c), o?.disconnect();
1033
+ };
1034
+ }, [
1035
+ n,
1036
+ s,
1037
+ t,
1038
+ w,
1039
+ f,
1040
+ E,
1041
+ D
1042
+ ]), o(() => C, [C]);
1043
+ let ee = f.slice(0, t), te = new Set(ee.map(({ id: e }) => e)), ne = f.filter(({ id: e }) => te.has(e) || v.current.has(e));
1044
+ return /* @__PURE__ */ m(it, {
1045
+ value: s,
1046
+ children: /* @__PURE__ */ h(rt, {
1047
+ value: x,
1048
+ children: [e, n && B(/* @__PURE__ */ m("div", {
1049
+ ref: a,
1050
+ className: "breeze-toast-region",
1051
+ "data-breeze-toast-region": "",
1052
+ "data-live-announcer": "",
1053
+ "data-react-aria-top-layer": "",
1054
+ style: { zIndex: r },
1055
+ children: ne.map(({ id: e, message: t }) => {
1056
+ let n = !te.has(e);
1057
+ return /* @__PURE__ */ m("div", {
1058
+ "aria-hidden": n ? "true" : void 0,
1059
+ "data-breeze-toast-id": e,
1060
+ hidden: n,
1061
+ children: /* @__PURE__ */ m(at, {
1062
+ value: y.current.get(e) ?? null,
1063
+ children: /* @__PURE__ */ m(it, {
1064
+ value: s && !n,
1065
+ children: /* @__PURE__ */ m(ot, { children: t })
1066
+ })
1067
+ })
1068
+ }, e);
1069
+ })
1070
+ }), n)]
1071
+ })
1072
+ });
1073
+ }
1074
+ function ct() {
1075
+ let e = a(rt);
1076
+ if (e === null) throw Error(et);
1077
+ return e;
1078
+ }
1079
+ //#endregion
557
1080
  //#region src/primitives/Typography/Typography.tsx
558
1081
  var Q = {
559
1082
  base: { text: "breeze:m-0 breeze:font-breeze-sans" },
@@ -591,10 +1114,10 @@ var Q = {
591
1114
  }
592
1115
  }
593
1116
  };
594
- function Ee(e) {
1117
+ function lt(e) {
595
1118
  return e === "heading" ? "h2" : e === "title" ? "h3" : e === "body" ? "p" : "span";
596
1119
  }
597
- function De(e, t, n, r) {
1120
+ function ut(e, t, n, r) {
598
1121
  let i;
599
1122
  try {
600
1123
  i = new Intl.NumberFormat(n, {
@@ -608,10 +1131,10 @@ function De(e, t, n, r) {
608
1131
  }
609
1132
  return i.map((e) => e.type === "minusSign" ? "−" : e.value).join("");
610
1133
  }
611
- function Oe(e, t, n) {
1134
+ function dt(e, t, n) {
612
1135
  let r;
613
1136
  try {
614
- r = de(e).toDate("UTC");
1137
+ r = V(e).toDate("UTC");
615
1138
  } catch {
616
1139
  return e;
617
1140
  }
@@ -620,34 +1143,34 @@ function Oe(e, t, n) {
620
1143
  timeZone: "UTC"
621
1144
  }).format(r);
622
1145
  }
623
- function ke(e, t, n) {
624
- return e.loading ? /* @__PURE__ */ d(I, {
1146
+ function ft(e, t, n) {
1147
+ return e.loading ? /* @__PURE__ */ m(me, {
625
1148
  blockSize: "1lh",
626
1149
  inlineSize: "8em",
627
1150
  label: n
628
- }) : e.format === "currency" ? De(e.value, e.currency, t, e.sign ?? "auto") : e.format === "date" ? Oe(e.value, t, e.dateStyle) : e.children;
1151
+ }) : e.format === "currency" ? ut(e.value, e.currency, t, e.sign ?? "auto") : e.format === "date" ? dt(e.value, t, e.dateStyle) : e.children;
629
1152
  }
630
- function Ae(e) {
631
- let { locale: t, messages: n } = j(), { "aria-label": i, align: a, children: o, element: s, format: c, id: l, loading: p = !1, numeric: m = !1, tone: h = "default", truncate: g = !1, variant: _ = "body" } = e, v = s ?? Ee(_), y = i?.trim() || void 0, b = a ?? (_ === "money" || m ? "end" : "start"), x = a !== void 0 || _ === "money" || m, S = ke(e, t, n.loading), C = c !== void 0 || typeof o == "string" || typeof o == "number", w = !p && y !== void 0 && !C && [
1153
+ function pt(e) {
1154
+ let { locale: t, messages: n } = U(), { "aria-label": i, align: a, children: o, element: s, format: c, id: l, loading: u = !1, numeric: d = !1, tone: f = "default", truncate: g = !1, variant: _ = "body" } = e, v = s ?? lt(_), y = i?.trim() || void 0, b = a ?? (_ === "money" || d ? "end" : "start"), x = a !== void 0 || _ === "money" || d, S = ft(e, t, n.loading), C = c !== void 0 || typeof o == "string" || typeof o == "number", w = !u && y !== void 0 && !C && [
632
1155
  "h1",
633
1156
  "h2",
634
1157
  "h3",
635
1158
  "h4"
636
- ].includes(v), T = !p && y !== void 0 && !C && !w;
637
- return !p && y !== void 0 && C && (S = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", {
1159
+ ].includes(v), T = !u && y !== void 0 && !C && !w;
1160
+ return !u && y !== void 0 && C && (S = /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("span", {
638
1161
  "aria-hidden": "true",
639
1162
  children: S
640
- }), /* @__PURE__ */ d(R, { children: y })] })), r(v, {
641
- "aria-busy": p || void 0,
1163
+ }), /* @__PURE__ */ m(ge, { children: y })] })), r(v, {
1164
+ "aria-busy": u || void 0,
642
1165
  "aria-label": T || w ? y : void 0,
643
1166
  className: [
644
1167
  Q.base.text,
645
1168
  Q.variant.role[_],
646
- Q.variant.tone[h],
1169
+ Q.variant.tone[f],
647
1170
  Q.variant.align[b],
648
1171
  x && Q.state.aligned,
649
- p && v === "span" && !x && Q.state.inlineLoading,
650
- m && _ !== "money" && Q.state.numeric,
1172
+ u && v === "span" && !x && Q.state.inlineLoading,
1173
+ d && _ !== "money" && Q.state.numeric,
651
1174
  g && Q.state.truncate
652
1175
  ].filter(Boolean).join(" "),
653
1176
  id: l,
@@ -662,69 +1185,78 @@ var $ = {
662
1185
  appearanceAutomatic: "Auto",
663
1186
  appearanceDark: "Dark",
664
1187
  appearanceLight: "Light",
1188
+ close: "Close",
665
1189
  loading: "Loading"
666
1190
  };
667
1191
  //#endregion
668
1192
  //#region src/provider/BreezeProvider.tsx
669
- function je(e, t) {
1193
+ function mt(e, t) {
670
1194
  return e === "automatic" ? t ? "dark" : "light" : e;
671
1195
  }
672
- function Me({ children: e }) {
673
- let { direction: t, locale: n } = pe();
674
- return /* @__PURE__ */ d("div", {
1196
+ function ht({ children: e }) {
1197
+ let { direction: t, locale: n } = T();
1198
+ return /* @__PURE__ */ m("div", {
675
1199
  "data-breeze-root": "",
676
1200
  dir: t,
677
1201
  lang: n,
678
1202
  children: e
679
1203
  });
680
1204
  }
681
- function Ne({ appearance: e, children: t, defaultAppearance: n = "automatic", locale: r, messages: a, onAppearanceChange: u }) {
682
- let [f] = l(() => typeof window > "u" || !window.matchMedia ? null : window.matchMedia("(prefers-color-scheme: dark)")), [p, m] = l(() => f?.matches ?? !1), [h, g] = l(n), _ = e ?? h, v = je(_, p);
1205
+ function gt({ appearance: e, children: t, defaultAppearance: n = "automatic", locale: r, messages: a, onAppearanceChange: s, portalContainer: u, toastLimit: f = 3 }) {
1206
+ let [p] = d(() => typeof window > "u" || !window.matchMedia ? null : window.matchMedia("(prefers-color-scheme: dark)")), [h, g] = d(() => p?.matches ?? !1), [_, v] = d(n), y = e ?? _, b = mt(y, h);
683
1207
  o(() => {
684
- if (!f) return;
685
- m(f.matches);
1208
+ if (!p) return;
1209
+ g(p.matches);
686
1210
  let e = (e) => {
687
- m(e.matches);
1211
+ g(e.matches);
688
1212
  };
689
- return f.addEventListener("change", e), () => f.removeEventListener("change", e);
690
- }, [f]), s(() => {
1213
+ return p.addEventListener("change", e), () => p.removeEventListener("change", e);
1214
+ }, [p]), c(() => {
691
1215
  let { documentElement: e } = document, t = e.dataset.theme, n = e.style.colorScheme;
692
- return e.dataset.theme = v, e.style.colorScheme = v, () => {
1216
+ return e.dataset.theme = b, e.style.colorScheme = b, () => {
693
1217
  t === void 0 ? delete e.dataset.theme : e.dataset.theme = t, e.style.colorScheme = n;
694
1218
  };
695
- }, [v]);
696
- let y = i((t) => {
697
- e === void 0 && g(t), u?.(t);
698
- }, [e, u]), b = i((e) => a?.[e] === void 0 ? "en-GB" : r, [r, a]);
699
- return /* @__PURE__ */ d(fe, {
1219
+ }, [b]);
1220
+ let x = i((t) => {
1221
+ e === void 0 && v(t), s?.(t);
1222
+ }, [e, s]), S = i((e) => a?.[e] === void 0 ? "en-GB" : r, [r, a]);
1223
+ return /* @__PURE__ */ m(w, {
700
1224
  locale: r,
701
- children: /* @__PURE__ */ d(A, {
702
- value: c(() => ({
703
- appearance: _,
704
- getMessageLocale: b,
1225
+ children: /* @__PURE__ */ m(H, {
1226
+ value: l(() => ({
1227
+ appearance: y,
1228
+ getMessageLocale: S,
705
1229
  locale: r,
706
1230
  messages: {
707
1231
  appearance: a?.appearance ?? $.appearance,
708
1232
  appearanceAutomatic: a?.appearanceAutomatic ?? $.appearanceAutomatic,
709
1233
  appearanceDark: a?.appearanceDark ?? $.appearanceDark,
710
1234
  appearanceLight: a?.appearanceLight ?? $.appearanceLight,
1235
+ close: a?.close ?? $.close,
711
1236
  loading: a?.loading ?? $.loading
712
1237
  },
713
- resolvedAppearance: v,
714
- setAppearance: y
1238
+ resolvedAppearance: b,
1239
+ setAppearance: x
715
1240
  }), [
716
- _,
717
- b,
1241
+ y,
1242
+ S,
718
1243
  r,
719
1244
  a,
720
- v,
721
- y
1245
+ b,
1246
+ x
722
1247
  ]),
723
- children: /* @__PURE__ */ d(Me, { children: t })
1248
+ children: /* @__PURE__ */ m(je, {
1249
+ locale: r,
1250
+ portalContainer: u,
1251
+ children: /* @__PURE__ */ m(st, {
1252
+ limit: f,
1253
+ children: /* @__PURE__ */ m(ht, { children: t })
1254
+ })
1255
+ })
724
1256
  })
725
1257
  });
726
1258
  }
727
1259
  //#endregion
728
- export { P as AppearanceControl, he as Badge, Ne as BreezeProvider, _e as Button, ve as Card, W as Container, ye as Grid, q as Icon, Se as IconTile, Ce as Inline, we as Separator, I as Skeleton, Te as Stack, Ae as Typography, R as VisuallyHidden };
1260
+ export { pe as AppearanceControl, _e as Badge, gt as BreezeProvider, ye as Button, xe as Card, Ce as Container, Ie as Dialog, Le as Drawer, ze as Grid, Ue as Icon, Ge as IconTile, Ke as Inline, qe as Popover, Ye as Separator, me as Skeleton, Ze as Stack, ot as Toast, pt as Typography, ge as VisuallyHidden, ct as useToast };
729
1261
 
730
1262
  //# sourceMappingURL=index.js.map