@motech-development/breeze-ui 4.3.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.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +379 -208
- package/lib/index.js.map +1 -1
- package/lib/overlays/OverlayStack.d.ts +2 -0
- package/lib/overlays/OverlayStack.d.ts.map +1 -1
- package/lib/primitives/Toast/Toast.d.ts +22 -0
- package/lib/primitives/Toast/Toast.d.ts.map +1 -0
- package/lib/provider/BreezeProvider.d.ts +3 -1
- package/lib/provider/BreezeProvider.d.ts.map +1 -1
- package/lib/styles.css +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -9,19 +9,20 @@ import { Dialog as y } from "react-aria-components/Dialog";
|
|
|
9
9
|
import { Modal as b, ModalOverlay as x } from "react-aria-components/Modal";
|
|
10
10
|
import { Popover as S } from "react-aria-components/Popover";
|
|
11
11
|
import { UNSAFE_PortalProvider as C } from "react-aria/PortalProvider";
|
|
12
|
-
import { I18nProvider as
|
|
13
|
-
import { ArrowDownLeft as
|
|
14
|
-
import {
|
|
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";
|
|
15
16
|
//#region src/provider/BreezeContext.ts
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
let e = a(
|
|
17
|
+
var H = n(null);
|
|
18
|
+
function U() {
|
|
19
|
+
let e = a(H);
|
|
19
20
|
if (e === null) throw Error("Breeze components must be rendered within BreezeProvider.");
|
|
20
21
|
return e;
|
|
21
22
|
}
|
|
22
23
|
//#endregion
|
|
23
24
|
//#region src/patterns/AppearanceControl/AppearanceControl.tsx
|
|
24
|
-
var
|
|
25
|
+
var W = {
|
|
25
26
|
base: {
|
|
26
27
|
control: "breeze:flex breeze:items-center breeze:gap-breeze-2 breeze:font-breeze-sans",
|
|
27
28
|
group: "breeze:flex breeze:items-center breeze:gap-breeze-2",
|
|
@@ -32,7 +33,7 @@ var U = {
|
|
|
32
33
|
size: {},
|
|
33
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" },
|
|
34
35
|
variant: {}
|
|
35
|
-
},
|
|
36
|
+
}, de = [
|
|
36
37
|
{
|
|
37
38
|
message: "appearanceLight",
|
|
38
39
|
value: "light"
|
|
@@ -46,30 +47,30 @@ var U = {
|
|
|
46
47
|
value: "dark"
|
|
47
48
|
}
|
|
48
49
|
];
|
|
49
|
-
function
|
|
50
|
-
return
|
|
50
|
+
function fe(e) {
|
|
51
|
+
return de.some((t) => t.value === e);
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
let { appearance: n, getMessageLocale: r, messages: i, setAppearance: a } =
|
|
53
|
+
function pe() {
|
|
54
|
+
let { appearance: n, getMessageLocale: r, messages: i, setAppearance: a } = U();
|
|
54
55
|
return /* @__PURE__ */ h("div", {
|
|
55
|
-
className:
|
|
56
|
+
className: W.base.control,
|
|
56
57
|
children: [/* @__PURE__ */ m("span", {
|
|
57
|
-
className:
|
|
58
|
+
className: W.base.label,
|
|
58
59
|
lang: r("appearance"),
|
|
59
60
|
children: i.appearance
|
|
60
61
|
}), /* @__PURE__ */ m(t, {
|
|
61
62
|
"aria-label": i.appearance,
|
|
62
|
-
className:
|
|
63
|
+
className: W.base.group,
|
|
63
64
|
disallowEmptySelection: !0,
|
|
64
65
|
lang: r("appearance"),
|
|
65
66
|
onSelectionChange: (e) => {
|
|
66
67
|
let [t] = e;
|
|
67
|
-
|
|
68
|
+
fe(t) && a(t);
|
|
68
69
|
},
|
|
69
70
|
selectedKeys: [n],
|
|
70
71
|
selectionMode: "single",
|
|
71
|
-
children:
|
|
72
|
-
className: [
|
|
72
|
+
children: de.map((t) => /* @__PURE__ */ m(e, {
|
|
73
|
+
className: [W.base.option, W.state.selected].join(" "),
|
|
73
74
|
id: t.value,
|
|
74
75
|
lang: r(t.message),
|
|
75
76
|
children: i[t.message]
|
|
@@ -79,7 +80,7 @@ function fe() {
|
|
|
79
80
|
}
|
|
80
81
|
//#endregion
|
|
81
82
|
//#region src/primitives/Skeleton/Skeleton.tsx
|
|
82
|
-
var
|
|
83
|
+
var G = {
|
|
83
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]" },
|
|
84
85
|
compound: {},
|
|
85
86
|
size: {},
|
|
@@ -90,31 +91,31 @@ var pe = {
|
|
|
90
91
|
text: "breeze:block-size-breeze-3 breeze:inline-size-full breeze:rounded-breeze-xs"
|
|
91
92
|
}
|
|
92
93
|
};
|
|
93
|
-
function
|
|
94
|
-
let { getMessageLocale: i, messages: a } =
|
|
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 = {
|
|
95
96
|
blockSize: r === "circle" ? s : e,
|
|
96
97
|
inlineSize: r === "circle" ? s : t
|
|
97
98
|
};
|
|
98
99
|
return /* @__PURE__ */ m("progress", {
|
|
99
100
|
"aria-hidden": o === void 0 || void 0,
|
|
100
101
|
"aria-label": o,
|
|
101
|
-
className: [
|
|
102
|
+
className: [G.base.skeleton, G.variant[r]].join(" "),
|
|
102
103
|
lang: o === a.loading.trim() ? i("loading") : void 0,
|
|
103
104
|
style: c
|
|
104
105
|
});
|
|
105
106
|
}
|
|
106
107
|
//#endregion
|
|
107
108
|
//#region src/primitives/VisuallyHidden/VisuallyHidden.tsx
|
|
108
|
-
var
|
|
109
|
+
var he = {
|
|
109
110
|
base: { hidden: "breeze:sr-only" },
|
|
110
111
|
compound: {},
|
|
111
112
|
size: {},
|
|
112
113
|
state: {},
|
|
113
114
|
variant: {}
|
|
114
115
|
};
|
|
115
|
-
function
|
|
116
|
+
function ge({ children: e }) {
|
|
116
117
|
return /* @__PURE__ */ m("span", {
|
|
117
|
-
className:
|
|
118
|
+
className: he.base.hidden,
|
|
118
119
|
children: e
|
|
119
120
|
});
|
|
120
121
|
}
|
|
@@ -137,17 +138,17 @@ var K = {
|
|
|
137
138
|
warning: "breeze:bg-breeze-warn-soft breeze:text-breeze-warn"
|
|
138
139
|
}
|
|
139
140
|
};
|
|
140
|
-
function
|
|
141
|
-
let { messages: 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;
|
|
142
143
|
return n ? o = /* @__PURE__ */ m("span", {
|
|
143
144
|
className: K.base.skeleton,
|
|
144
|
-
children: /* @__PURE__ */ m(
|
|
145
|
+
children: /* @__PURE__ */ m(me, {
|
|
145
146
|
blockSize: 8,
|
|
146
147
|
inlineSize: "100%",
|
|
147
148
|
label: i.loading,
|
|
148
149
|
shape: "rectangle"
|
|
149
150
|
})
|
|
150
|
-
}) : a !== void 0 && (o = /* @__PURE__ */ m(
|
|
151
|
+
}) : a !== void 0 && (o = /* @__PURE__ */ m(ge, { children: a })), /* @__PURE__ */ h("span", {
|
|
151
152
|
"aria-busy": n || void 0,
|
|
152
153
|
className: [K.base.badge, K.variant[r]].join(" "),
|
|
153
154
|
children: [/* @__PURE__ */ m("span", {
|
|
@@ -189,8 +190,8 @@ var q = {
|
|
|
189
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"
|
|
190
191
|
}
|
|
191
192
|
};
|
|
192
|
-
function
|
|
193
|
-
let e = v(_), { getMessageLocale: t, messages: n } =
|
|
193
|
+
function ve() {
|
|
194
|
+
let e = v(_), { getMessageLocale: t, messages: n } = U();
|
|
194
195
|
return /* @__PURE__ */ m("progress", {
|
|
195
196
|
"aria-label": n.loading,
|
|
196
197
|
className: q.state.loadingStatus,
|
|
@@ -198,8 +199,8 @@ function _e() {
|
|
|
198
199
|
lang: t("loading")
|
|
199
200
|
});
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
-
|
|
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();
|
|
203
204
|
let C = [
|
|
204
205
|
q.base.button,
|
|
205
206
|
q.variant[S],
|
|
@@ -233,7 +234,7 @@ function ve({ "aria-controls": e, "aria-describedby": t, "aria-expanded": n, "ar
|
|
|
233
234
|
children: [/* @__PURE__ */ m("span", {
|
|
234
235
|
className: [q.base.label, d && q.state.loadingLabel].filter(Boolean).join(" "),
|
|
235
236
|
children: s
|
|
236
|
-
}), d && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(
|
|
237
|
+
}), d && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(ve, {}), /* @__PURE__ */ m("span", {
|
|
237
238
|
"aria-hidden": "true",
|
|
238
239
|
className: [q.base.skeleton, q.compound.loading[S]].join(" "),
|
|
239
240
|
"data-breeze-skeleton": ""
|
|
@@ -251,7 +252,7 @@ function J(e, t) {
|
|
|
251
252
|
}
|
|
252
253
|
//#endregion
|
|
253
254
|
//#region src/primitives/Card/Card.tsx
|
|
254
|
-
var
|
|
255
|
+
var be = {
|
|
255
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" },
|
|
256
257
|
compound: {},
|
|
257
258
|
size: {
|
|
@@ -271,22 +272,22 @@ var ye = {
|
|
|
271
272
|
surface: "breeze:bg-breeze-surface"
|
|
272
273
|
}
|
|
273
274
|
};
|
|
274
|
-
function
|
|
275
|
+
function xe({ "aria-label": e, children: t, clipped: n = !0, element: i = "div", padding: a = 4, variant: o = "surface" }) {
|
|
275
276
|
let { accessibleLabel: s, role: c } = J(e, i);
|
|
276
277
|
return r(i, {
|
|
277
278
|
"aria-label": s,
|
|
278
279
|
className: [
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
n &&
|
|
280
|
+
be.base.card,
|
|
281
|
+
be.variant[o],
|
|
282
|
+
be.size[a],
|
|
283
|
+
n && be.state.clipped
|
|
283
284
|
].filter(Boolean).join(" "),
|
|
284
285
|
role: c
|
|
285
286
|
}, t);
|
|
286
287
|
}
|
|
287
288
|
//#endregion
|
|
288
289
|
//#region src/primitives/Container/Container.tsx
|
|
289
|
-
var
|
|
290
|
+
var Se = {
|
|
290
291
|
base: { container: "breeze:mx-auto breeze:inline-size-full breeze:min-inline-size-0" },
|
|
291
292
|
compound: {},
|
|
292
293
|
size: {
|
|
@@ -297,21 +298,21 @@ var xe = {
|
|
|
297
298
|
state: { padded: "breeze:ps-breeze-4 breeze:pe-breeze-4 breeze:breeze-md:ps-breeze-7 breeze:breeze-md:pe-breeze-7" },
|
|
298
299
|
variant: {}
|
|
299
300
|
};
|
|
300
|
-
function
|
|
301
|
+
function Ce({ "aria-label": e, children: t, element: n = "div", padded: i = !0, width: a = "page" }) {
|
|
301
302
|
let { accessibleLabel: o, role: s } = J(e, n);
|
|
302
303
|
return r(n, {
|
|
303
304
|
"aria-label": o,
|
|
304
305
|
className: [
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
i &&
|
|
306
|
+
Se.base.container,
|
|
307
|
+
Se.size[a],
|
|
308
|
+
i && Se.state.padded
|
|
308
309
|
].filter(Boolean).join(" "),
|
|
309
310
|
role: s
|
|
310
311
|
}, t);
|
|
311
312
|
}
|
|
312
313
|
//#endregion
|
|
313
314
|
//#region src/overlays/OverlayStack.ts
|
|
314
|
-
function
|
|
315
|
+
function we() {
|
|
315
316
|
let e = [], t = /* @__PURE__ */ new Set(), n = () => t.forEach((e) => e());
|
|
316
317
|
return {
|
|
317
318
|
getSnapshot: () => e,
|
|
@@ -327,9 +328,15 @@ function Ce() {
|
|
|
327
328
|
})
|
|
328
329
|
};
|
|
329
330
|
}
|
|
330
|
-
var
|
|
331
|
-
function Ee(
|
|
332
|
-
let
|
|
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();
|
|
333
340
|
if (!r) throw Error("Breeze components must be rendered within BreezeProvider.");
|
|
334
341
|
let l = f(r.subscribe, r.getSnapshot, r.getSnapshot), u = i?.id;
|
|
335
342
|
c(() => () => r.remove(o), [o, r]), c(() => {
|
|
@@ -368,12 +375,12 @@ function Ee(e, t, n) {
|
|
|
368
375
|
}
|
|
369
376
|
//#endregion
|
|
370
377
|
//#region src/overlays/OverlayProvider.tsx
|
|
371
|
-
var
|
|
372
|
-
function
|
|
373
|
-
let { direction: r } =
|
|
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);
|
|
374
381
|
return c(() => {
|
|
375
382
|
let e = t ?? document.body;
|
|
376
|
-
if (e.ownerDocument !== document || e.getRootNode() !== document) throw Error(
|
|
383
|
+
if (e.ownerDocument !== document || e.getRootNode() !== document) throw Error(Ae);
|
|
377
384
|
let n = e.ownerDocument.createElement("div");
|
|
378
385
|
return n.dataset.breezeRoot = "", n.dataset.breezePortal = "", e.append(n), o(n), () => n.remove();
|
|
379
386
|
}, [t]), c(() => {
|
|
@@ -384,17 +391,17 @@ function ke({ children: e, portalContainer: t, locale: n }) {
|
|
|
384
391
|
n
|
|
385
392
|
]), /* @__PURE__ */ m(C, {
|
|
386
393
|
getContainer: () => a,
|
|
387
|
-
children: /* @__PURE__ */ m(
|
|
394
|
+
children: /* @__PURE__ */ m(Te, {
|
|
388
395
|
value: i,
|
|
389
|
-
children: /* @__PURE__ */ m(
|
|
396
|
+
children: /* @__PURE__ */ m(ke, {
|
|
390
397
|
value: a,
|
|
391
398
|
children: e
|
|
392
399
|
})
|
|
393
400
|
})
|
|
394
401
|
});
|
|
395
402
|
}
|
|
396
|
-
function
|
|
397
|
-
return a(
|
|
403
|
+
function Me() {
|
|
404
|
+
return a(ke);
|
|
398
405
|
}
|
|
399
406
|
//#endregion
|
|
400
407
|
//#region src/overlays/OverlaySurface.tsx
|
|
@@ -413,43 +420,43 @@ var Y = {
|
|
|
413
420
|
fullscreen: "breeze-fullscreen",
|
|
414
421
|
popover: "breeze-popover"
|
|
415
422
|
}
|
|
416
|
-
},
|
|
423
|
+
}, Ne = "Breeze overlay triggers and portal containers must belong to the current document and light DOM.";
|
|
417
424
|
function X(e) {
|
|
418
425
|
return typeof e == "object" && !!e && "nodeType" in e && typeof e.contains == "function";
|
|
419
426
|
}
|
|
420
|
-
function
|
|
427
|
+
function Pe(e) {
|
|
421
428
|
return e.dataset?.breezeOverlay !== void 0;
|
|
422
429
|
}
|
|
423
|
-
function
|
|
424
|
-
let { getMessageLocale: C, messages:
|
|
425
|
-
o(() =>
|
|
426
|
-
let [
|
|
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);
|
|
427
434
|
c(() => {
|
|
428
|
-
if (
|
|
429
|
-
}, [
|
|
430
|
-
let le = l(() => r === "fullscreen" ? { current:
|
|
431
|
-
if (!e && !
|
|
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) {
|
|
432
439
|
if (ce.current) return;
|
|
433
|
-
|
|
440
|
+
O && (ce.current = !0);
|
|
434
441
|
}
|
|
435
|
-
f === void 0 &&
|
|
442
|
+
f === void 0 && re(e), s?.(e);
|
|
436
443
|
}, [
|
|
437
444
|
f,
|
|
438
445
|
s,
|
|
439
|
-
|
|
440
|
-
|
|
446
|
+
k,
|
|
447
|
+
O
|
|
441
448
|
]);
|
|
442
449
|
o(() => {
|
|
443
|
-
|
|
450
|
+
k ? ce.current = !1 : O && R(!1);
|
|
444
451
|
}, [
|
|
445
452
|
R,
|
|
446
|
-
|
|
447
|
-
|
|
453
|
+
k,
|
|
454
|
+
O
|
|
448
455
|
]), o(() => {
|
|
449
|
-
if (r !== "popover" || !
|
|
456
|
+
if (r !== "popover" || !A || !n || !L.topmost || !E) return;
|
|
450
457
|
let e = () => {
|
|
451
458
|
P.current !== null && (clearTimeout(P.current), P.current = null);
|
|
452
|
-
}, t = (e, t) => !!e && !!t && (e === t || e.contains(t) || t.contains(e)), i = (e) => e.button === 0, a = (e) => X(e) && !
|
|
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) => {
|
|
453
460
|
i(t) && (e(), I.current = null, F.current = X(t.target) ? t.target : null);
|
|
454
461
|
}, s = (n) => {
|
|
455
462
|
if (!i(n)) return;
|
|
@@ -469,72 +476,72 @@ function Ne({ children: e, defaultOpen: t = !1, dismissible: n = !0, kind: r, on
|
|
|
469
476
|
R(!1);
|
|
470
477
|
}
|
|
471
478
|
};
|
|
472
|
-
return
|
|
473
|
-
e(),
|
|
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;
|
|
474
481
|
};
|
|
475
482
|
}, [
|
|
476
483
|
R,
|
|
477
484
|
n,
|
|
478
|
-
|
|
485
|
+
E,
|
|
479
486
|
r,
|
|
480
487
|
L.topmost,
|
|
481
|
-
|
|
488
|
+
A
|
|
482
489
|
]);
|
|
483
|
-
let ue =
|
|
484
|
-
let e =
|
|
485
|
-
if (!t || !
|
|
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;
|
|
486
493
|
let r = z ? t.getElementById(z) : null;
|
|
487
494
|
if (!(n === t.body || n === r || n?.closest("[data-exiting]"))) return;
|
|
488
495
|
if (!e?.isConnected) {
|
|
489
496
|
ue?.();
|
|
490
497
|
return;
|
|
491
498
|
}
|
|
492
|
-
let i =
|
|
499
|
+
let i = E.querySelector("[data-breeze-topmost=\"true\"]");
|
|
493
500
|
(!i || i.contains(e)) && !e.closest("[inert], [aria-hidden=\"true\"]") && e.focus({ preventScroll: !0 });
|
|
494
501
|
}, [
|
|
495
|
-
|
|
502
|
+
E,
|
|
496
503
|
z,
|
|
497
504
|
ue
|
|
498
505
|
]), V = i(() => {
|
|
499
506
|
N.current !== null && (clearTimeout(N.current), N.current = null);
|
|
500
|
-
}, []),
|
|
507
|
+
}, []), H = i((e) => {
|
|
501
508
|
queueMicrotask(() => {
|
|
502
509
|
!e.isConnected || e.closest("[inert], [data-exiting]") || (V(), e.focus({ preventScroll: !0 }), N.current = setTimeout(() => {
|
|
503
510
|
let { ownerDocument: t } = e, { activeElement: n } = t;
|
|
504
|
-
e.isConnected && !e.closest("[inert], [data-exiting]") && (n === e || n === t.body) && (
|
|
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;
|
|
505
512
|
}, 500));
|
|
506
513
|
});
|
|
507
|
-
}, [V]), W = u(
|
|
514
|
+
}, [V]), W = u(A);
|
|
508
515
|
o(() => {
|
|
509
516
|
let e = W.current;
|
|
510
|
-
W.current =
|
|
517
|
+
W.current = A, !(!T || !A || e || !M.current) && H(M.current);
|
|
511
518
|
}, [
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
519
|
+
H,
|
|
520
|
+
T,
|
|
521
|
+
A
|
|
515
522
|
]);
|
|
516
523
|
let de = i((e) => {
|
|
517
|
-
|
|
524
|
+
M.current = e;
|
|
518
525
|
let t = () => {
|
|
519
|
-
V(),
|
|
526
|
+
V(), M.current = null, oe(!1), requestAnimationFrame(B);
|
|
520
527
|
};
|
|
521
528
|
if (!e) {
|
|
522
529
|
t();
|
|
523
530
|
return;
|
|
524
531
|
}
|
|
525
|
-
return
|
|
532
|
+
return oe(!0), T && H(e), t;
|
|
526
533
|
}, [
|
|
527
534
|
V,
|
|
528
|
-
|
|
529
|
-
|
|
535
|
+
H,
|
|
536
|
+
T,
|
|
530
537
|
B
|
|
531
538
|
]), fe = l(() => ({
|
|
532
539
|
id: L.id,
|
|
533
|
-
open:
|
|
540
|
+
open: A,
|
|
534
541
|
restoreFocus: B
|
|
535
542
|
}), [
|
|
536
543
|
L.id,
|
|
537
|
-
|
|
544
|
+
A,
|
|
538
545
|
B
|
|
539
546
|
]), pe = /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
|
|
540
547
|
className: Y.base.header,
|
|
@@ -543,25 +550,25 @@ function Ne({ children: e, defaultOpen: t = !1, dismissible: n = !0, kind: r, on
|
|
|
543
550
|
children: _
|
|
544
551
|
}), /* @__PURE__ */ m("span", {
|
|
545
552
|
lang: C("close"),
|
|
546
|
-
children: /* @__PURE__ */ m(
|
|
553
|
+
children: /* @__PURE__ */ m(ye, {
|
|
547
554
|
onAction: () => R(!1),
|
|
548
555
|
variant: "quiet",
|
|
549
|
-
children:
|
|
556
|
+
children: w.close
|
|
550
557
|
})
|
|
551
558
|
})]
|
|
552
|
-
}), e] }), G = /* @__PURE__ */ m(
|
|
559
|
+
}), e] }), G = /* @__PURE__ */ m(De, {
|
|
553
560
|
value: fe,
|
|
554
|
-
children:
|
|
561
|
+
children: T ? /* @__PURE__ */ m("section", {
|
|
555
562
|
"aria-label": _,
|
|
556
563
|
className: Y.base.content,
|
|
557
564
|
id: L.id,
|
|
558
565
|
onBlur: (e) => {
|
|
559
|
-
if (
|
|
566
|
+
if (se.current) {
|
|
560
567
|
e.stopPropagation();
|
|
561
568
|
return;
|
|
562
569
|
}
|
|
563
570
|
let { relatedTarget: t } = e;
|
|
564
|
-
r === "popover" && n && L.topmost && X(t) && !e.currentTarget.contains(t) && !
|
|
571
|
+
r === "popover" && n && L.topmost && X(t) && !e.currentTarget.contains(t) && !j.current?.contains(t) && (I.current = t);
|
|
565
572
|
},
|
|
566
573
|
ref: de,
|
|
567
574
|
role: "dialog",
|
|
@@ -575,26 +582,26 @@ function Ne({ children: e, defaultOpen: t = !1, dismissible: n = !0, kind: r, on
|
|
|
575
582
|
children: pe
|
|
576
583
|
})
|
|
577
584
|
});
|
|
578
|
-
return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(
|
|
579
|
-
"aria-controls":
|
|
580
|
-
"aria-expanded":
|
|
585
|
+
return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(ye, {
|
|
586
|
+
"aria-controls": A ? L.id : void 0,
|
|
587
|
+
"aria-expanded": A,
|
|
581
588
|
"aria-haspopup": "dialog",
|
|
582
|
-
onAction: () => R(!
|
|
583
|
-
ref:
|
|
589
|
+
onAction: () => R(!T || !A),
|
|
590
|
+
ref: j,
|
|
584
591
|
children: v
|
|
585
|
-
}),
|
|
592
|
+
}), E && ee && (T ? /* @__PURE__ */ m(S, {
|
|
586
593
|
className: Y.variant[r],
|
|
587
594
|
"data-breeze-overlay": r,
|
|
588
595
|
"data-breeze-topmost": L.topmost,
|
|
589
596
|
"data-breeze-interactive": L.interactive,
|
|
590
597
|
inert: !L.interactive,
|
|
591
598
|
isNonModal: !0,
|
|
592
|
-
isOpen:
|
|
599
|
+
isOpen: A,
|
|
593
600
|
isKeyboardDismissDisabled: !n || !L.topmost,
|
|
594
601
|
onOpenChange: R,
|
|
595
602
|
placement: g,
|
|
596
|
-
ref:
|
|
597
|
-
shouldCloseOnInteractOutside: (e) => r === "popover" && n && L.topmost && !
|
|
603
|
+
ref: ie,
|
|
604
|
+
shouldCloseOnInteractOutside: (e) => r === "popover" && n && L.topmost && !j.current?.contains(e),
|
|
598
605
|
style: { zIndex: L.zIndex },
|
|
599
606
|
triggerRef: le,
|
|
600
607
|
children: G
|
|
@@ -607,9 +614,9 @@ function Ne({ children: e, defaultOpen: t = !1, dismissible: n = !0, kind: r, on
|
|
|
607
614
|
inert: !L.interactive,
|
|
608
615
|
isDismissable: n && L.topmost,
|
|
609
616
|
isKeyboardDismissDisabled: !n || !L.topmost,
|
|
610
|
-
isOpen:
|
|
617
|
+
isOpen: A,
|
|
611
618
|
onOpenChange: R,
|
|
612
|
-
shouldCloseOnInteractOutside: (e) => L.topmost &&
|
|
619
|
+
shouldCloseOnInteractOutside: (e) => L.topmost && Pe(e),
|
|
613
620
|
style: { zIndex: L.zIndex },
|
|
614
621
|
children: /* @__PURE__ */ m(b, {
|
|
615
622
|
className: Y.variant[r],
|
|
@@ -619,8 +626,8 @@ function Ne({ children: e, defaultOpen: t = !1, dismissible: n = !0, kind: r, on
|
|
|
619
626
|
}
|
|
620
627
|
//#endregion
|
|
621
628
|
//#region src/primitives/Dialog/Dialog.tsx
|
|
622
|
-
function
|
|
623
|
-
return /* @__PURE__ */ m(
|
|
629
|
+
function Ie({ children: e, defaultOpen: t, dismissible: n, onOpenChange: r, open: i, title: a, trigger: o }) {
|
|
630
|
+
return /* @__PURE__ */ m(Fe, {
|
|
624
631
|
defaultOpen: t,
|
|
625
632
|
dismissible: n,
|
|
626
633
|
onOpenChange: r,
|
|
@@ -633,8 +640,8 @@ function Pe({ children: e, defaultOpen: t, dismissible: n, onOpenChange: r, open
|
|
|
633
640
|
}
|
|
634
641
|
//#endregion
|
|
635
642
|
//#region src/primitives/Drawer/Drawer.tsx
|
|
636
|
-
function
|
|
637
|
-
return /* @__PURE__ */ m(
|
|
643
|
+
function Le({ children: e, defaultOpen: t, dismissible: n, onOpenChange: r, open: i, title: a, trigger: o }) {
|
|
644
|
+
return /* @__PURE__ */ m(Fe, {
|
|
638
645
|
defaultOpen: t,
|
|
639
646
|
dismissible: n,
|
|
640
647
|
onOpenChange: r,
|
|
@@ -647,7 +654,7 @@ function Fe({ children: e, defaultOpen: t, dismissible: n, onOpenChange: r, open
|
|
|
647
654
|
}
|
|
648
655
|
//#endregion
|
|
649
656
|
//#region src/primitives/Grid/Grid.tsx
|
|
650
|
-
var
|
|
657
|
+
var Re = {
|
|
651
658
|
base: { grid: "breeze:grid breeze:min-inline-size-0" },
|
|
652
659
|
compound: { columns: {
|
|
653
660
|
1: {
|
|
@@ -683,48 +690,48 @@ var Ie = {
|
|
|
683
690
|
state: {},
|
|
684
691
|
variant: {}
|
|
685
692
|
};
|
|
686
|
-
function
|
|
693
|
+
function ze({ "aria-label": e, children: t, collapseBelow: n = "md", columns: i = 2, element: a = "div", gap: o = 4 }) {
|
|
687
694
|
let { accessibleLabel: s, role: c } = J(e, a);
|
|
688
695
|
return r(a, {
|
|
689
696
|
"aria-label": s,
|
|
690
697
|
className: [
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
698
|
+
Re.base.grid,
|
|
699
|
+
Re.compound.columns[i][n],
|
|
700
|
+
Re.size[o]
|
|
694
701
|
].join(" "),
|
|
695
702
|
role: c
|
|
696
703
|
}, t);
|
|
697
704
|
}
|
|
698
705
|
//#endregion
|
|
699
706
|
//#region src/primitives/Icon/Icon.tsx
|
|
700
|
-
var
|
|
707
|
+
var Be = {
|
|
701
708
|
add: I,
|
|
702
|
-
back:
|
|
703
|
-
building:
|
|
704
|
-
calendar:
|
|
705
|
-
camera:
|
|
706
|
-
check:
|
|
707
|
-
clock:
|
|
709
|
+
back: A,
|
|
710
|
+
building: te,
|
|
711
|
+
calendar: ne,
|
|
712
|
+
camera: re,
|
|
713
|
+
check: O,
|
|
714
|
+
clock: ie,
|
|
708
715
|
close: z,
|
|
709
716
|
delete: le,
|
|
710
|
-
document:
|
|
711
|
-
download:
|
|
712
|
-
expand:
|
|
713
|
-
forward:
|
|
717
|
+
document: oe,
|
|
718
|
+
download: M,
|
|
719
|
+
expand: k,
|
|
720
|
+
forward: j,
|
|
714
721
|
lock: P,
|
|
715
722
|
money: N,
|
|
716
|
-
moneyIn:
|
|
717
|
-
moneyOut:
|
|
718
|
-
more:
|
|
719
|
-
next:
|
|
720
|
-
notifications:
|
|
721
|
-
overview:
|
|
723
|
+
moneyIn: E,
|
|
724
|
+
moneyOut: D,
|
|
725
|
+
more: ae,
|
|
726
|
+
next: j,
|
|
727
|
+
notifications: ee,
|
|
728
|
+
overview: se,
|
|
722
729
|
people: ue,
|
|
723
730
|
settings: ce,
|
|
724
731
|
signOut: F,
|
|
725
732
|
upload: R,
|
|
726
733
|
warning: L
|
|
727
|
-
},
|
|
734
|
+
}, Ve = {
|
|
728
735
|
base: { icon: "breeze:block breeze:shrink-0" },
|
|
729
736
|
compound: {},
|
|
730
737
|
size: {
|
|
@@ -734,20 +741,20 @@ var Re = {
|
|
|
734
741
|
},
|
|
735
742
|
state: { logicalDirection: "breeze:rtl:rotate-180" },
|
|
736
743
|
variant: {}
|
|
737
|
-
},
|
|
744
|
+
}, He = /* @__PURE__ */ new Set([
|
|
738
745
|
"back",
|
|
739
746
|
"forward",
|
|
740
747
|
"next"
|
|
741
748
|
]);
|
|
742
|
-
function
|
|
743
|
-
let r =
|
|
749
|
+
function Ue({ label: e, name: t, size: n = "md" }) {
|
|
750
|
+
let r = Be[t], i = e?.trim() || void 0;
|
|
744
751
|
return /* @__PURE__ */ m(r, {
|
|
745
752
|
"aria-hidden": i === void 0 || void 0,
|
|
746
753
|
"aria-label": i,
|
|
747
754
|
className: [
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
755
|
+
Ve.base.icon,
|
|
756
|
+
Ve.size[n],
|
|
757
|
+
He.has(t) && Ve.state.logicalDirection
|
|
751
758
|
].filter(Boolean).join(" "),
|
|
752
759
|
focusable: "false",
|
|
753
760
|
role: i === void 0 ? void 0 : "img",
|
|
@@ -756,7 +763,7 @@ function Ve({ label: e, name: t, size: n = "md" }) {
|
|
|
756
763
|
}
|
|
757
764
|
//#endregion
|
|
758
765
|
//#region src/primitives/IconTile/IconTile.tsx
|
|
759
|
-
var
|
|
766
|
+
var We = {
|
|
760
767
|
base: { tile: "breeze:inline-flex breeze:shrink-0 breeze:items-center breeze:justify-center" },
|
|
761
768
|
compound: {},
|
|
762
769
|
size: {
|
|
@@ -778,15 +785,15 @@ var He = {
|
|
|
778
785
|
}
|
|
779
786
|
}
|
|
780
787
|
};
|
|
781
|
-
function
|
|
788
|
+
function Ge({ label: e, name: t, shape: n = "square", size: r = "lg", tone: i = "brand" }) {
|
|
782
789
|
return /* @__PURE__ */ m("span", {
|
|
783
790
|
className: [
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
791
|
+
We.base.tile,
|
|
792
|
+
We.variant.tone[i],
|
|
793
|
+
We.variant.shape[n],
|
|
794
|
+
We.size[r]
|
|
788
795
|
].join(" "),
|
|
789
|
-
children: /* @__PURE__ */ m(
|
|
796
|
+
children: /* @__PURE__ */ m(Ue, {
|
|
790
797
|
label: e,
|
|
791
798
|
name: t,
|
|
792
799
|
size: r === "lg" ? "md" : "sm"
|
|
@@ -825,7 +832,7 @@ var Z = {
|
|
|
825
832
|
}
|
|
826
833
|
}
|
|
827
834
|
};
|
|
828
|
-
function
|
|
835
|
+
function Ke({ "aria-label": e, children: t, element: n = "div", gap: i = 3, justify: a = "start", verticalAlign: o = "center", wrap: s = !1 }) {
|
|
829
836
|
let { accessibleLabel: c, role: l } = J(e, n);
|
|
830
837
|
return r(n, {
|
|
831
838
|
"aria-label": c,
|
|
@@ -841,8 +848,8 @@ function We({ "aria-label": e, children: t, element: n = "div", gap: i = 3, just
|
|
|
841
848
|
}
|
|
842
849
|
//#endregion
|
|
843
850
|
//#region src/primitives/Popover/Popover.tsx
|
|
844
|
-
function
|
|
845
|
-
return /* @__PURE__ */ m(
|
|
851
|
+
function qe({ children: e, defaultOpen: t, dismissible: n, onOpenChange: r, open: i, title: a, trigger: o, placement: s }) {
|
|
852
|
+
return /* @__PURE__ */ m(Fe, {
|
|
846
853
|
defaultOpen: t,
|
|
847
854
|
dismissible: n,
|
|
848
855
|
onOpenChange: r,
|
|
@@ -856,7 +863,7 @@ function Ge({ children: e, defaultOpen: t, dismissible: n, onOpenChange: r, open
|
|
|
856
863
|
}
|
|
857
864
|
//#endregion
|
|
858
865
|
//#region src/primitives/Separator/Separator.tsx
|
|
859
|
-
var
|
|
866
|
+
var Je = {
|
|
860
867
|
base: { separator: "breeze:m-0 breeze:shrink-0 breeze:border-0 breeze:bg-breeze-line breeze:forced-colors:bg-[CanvasText]" },
|
|
861
868
|
compound: {},
|
|
862
869
|
size: {},
|
|
@@ -866,15 +873,15 @@ var Ke = {
|
|
|
866
873
|
vertical: "breeze:block-size-full breeze:inline-size-breeze-px"
|
|
867
874
|
}
|
|
868
875
|
};
|
|
869
|
-
function
|
|
876
|
+
function Ye({ orientation: e = "horizontal" }) {
|
|
870
877
|
return /* @__PURE__ */ m("hr", {
|
|
871
878
|
"aria-orientation": e,
|
|
872
|
-
className: [
|
|
879
|
+
className: [Je.base.separator, Je.variant[e]].join(" ")
|
|
873
880
|
});
|
|
874
881
|
}
|
|
875
882
|
//#endregion
|
|
876
883
|
//#region src/primitives/Stack/Stack.tsx
|
|
877
|
-
var
|
|
884
|
+
var Xe = {
|
|
878
885
|
base: { stack: "breeze:flex breeze:min-inline-size-0 breeze:flex-col" },
|
|
879
886
|
compound: {},
|
|
880
887
|
size: {
|
|
@@ -896,19 +903,180 @@ var Je = {
|
|
|
896
903
|
stretch: "breeze:items-stretch"
|
|
897
904
|
}
|
|
898
905
|
};
|
|
899
|
-
function
|
|
906
|
+
function Ze({ "aria-label": e, children: t, element: n = "div", gap: i = 3, horizontalAlign: a = "stretch" }) {
|
|
900
907
|
let { accessibleLabel: o, role: s } = J(e, n);
|
|
901
908
|
return r(n, {
|
|
902
909
|
"aria-label": o,
|
|
903
910
|
className: [
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
911
|
+
Xe.base.stack,
|
|
912
|
+
Xe.variant[a],
|
|
913
|
+
Xe.size[i]
|
|
907
914
|
].join(" "),
|
|
908
915
|
role: s
|
|
909
916
|
}, t);
|
|
910
917
|
}
|
|
911
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
|
|
912
1080
|
//#region src/primitives/Typography/Typography.tsx
|
|
913
1081
|
var Q = {
|
|
914
1082
|
base: { text: "breeze:m-0 breeze:font-breeze-sans" },
|
|
@@ -946,10 +1114,10 @@ var Q = {
|
|
|
946
1114
|
}
|
|
947
1115
|
}
|
|
948
1116
|
};
|
|
949
|
-
function
|
|
1117
|
+
function lt(e) {
|
|
950
1118
|
return e === "heading" ? "h2" : e === "title" ? "h3" : e === "body" ? "p" : "span";
|
|
951
1119
|
}
|
|
952
|
-
function
|
|
1120
|
+
function ut(e, t, n, r) {
|
|
953
1121
|
let i;
|
|
954
1122
|
try {
|
|
955
1123
|
i = new Intl.NumberFormat(n, {
|
|
@@ -963,10 +1131,10 @@ function Ze(e, t, n, r) {
|
|
|
963
1131
|
}
|
|
964
1132
|
return i.map((e) => e.type === "minusSign" ? "−" : e.value).join("");
|
|
965
1133
|
}
|
|
966
|
-
function
|
|
1134
|
+
function dt(e, t, n) {
|
|
967
1135
|
let r;
|
|
968
1136
|
try {
|
|
969
|
-
r =
|
|
1137
|
+
r = V(e).toDate("UTC");
|
|
970
1138
|
} catch {
|
|
971
1139
|
return e;
|
|
972
1140
|
}
|
|
@@ -975,26 +1143,26 @@ function Qe(e, t, n) {
|
|
|
975
1143
|
timeZone: "UTC"
|
|
976
1144
|
}).format(r);
|
|
977
1145
|
}
|
|
978
|
-
function
|
|
979
|
-
return e.loading ? /* @__PURE__ */ m(
|
|
1146
|
+
function ft(e, t, n) {
|
|
1147
|
+
return e.loading ? /* @__PURE__ */ m(me, {
|
|
980
1148
|
blockSize: "1lh",
|
|
981
1149
|
inlineSize: "8em",
|
|
982
1150
|
label: n
|
|
983
|
-
}) : e.format === "currency" ?
|
|
1151
|
+
}) : e.format === "currency" ? ut(e.value, e.currency, t, e.sign ?? "auto") : e.format === "date" ? dt(e.value, t, e.dateStyle) : e.children;
|
|
984
1152
|
}
|
|
985
|
-
function
|
|
986
|
-
let { locale: t, messages: n } =
|
|
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 && [
|
|
987
1155
|
"h1",
|
|
988
1156
|
"h2",
|
|
989
1157
|
"h3",
|
|
990
1158
|
"h4"
|
|
991
|
-
].includes(v),
|
|
1159
|
+
].includes(v), T = !u && y !== void 0 && !C && !w;
|
|
992
1160
|
return !u && y !== void 0 && C && (S = /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("span", {
|
|
993
1161
|
"aria-hidden": "true",
|
|
994
1162
|
children: S
|
|
995
|
-
}), /* @__PURE__ */ m(
|
|
1163
|
+
}), /* @__PURE__ */ m(ge, { children: y })] })), r(v, {
|
|
996
1164
|
"aria-busy": u || void 0,
|
|
997
|
-
"aria-label":
|
|
1165
|
+
"aria-label": T || w ? y : void 0,
|
|
998
1166
|
className: [
|
|
999
1167
|
Q.base.text,
|
|
1000
1168
|
Q.variant.role[_],
|
|
@@ -1007,7 +1175,7 @@ function et(e) {
|
|
|
1007
1175
|
].filter(Boolean).join(" "),
|
|
1008
1176
|
id: l,
|
|
1009
1177
|
lang: t,
|
|
1010
|
-
role:
|
|
1178
|
+
role: T ? "group" : void 0
|
|
1011
1179
|
}, S);
|
|
1012
1180
|
}
|
|
1013
1181
|
//#endregion
|
|
@@ -1022,11 +1190,11 @@ var $ = {
|
|
|
1022
1190
|
};
|
|
1023
1191
|
//#endregion
|
|
1024
1192
|
//#region src/provider/BreezeProvider.tsx
|
|
1025
|
-
function
|
|
1193
|
+
function mt(e, t) {
|
|
1026
1194
|
return e === "automatic" ? t ? "dark" : "light" : e;
|
|
1027
1195
|
}
|
|
1028
|
-
function
|
|
1029
|
-
let { direction: t, locale: n } =
|
|
1196
|
+
function ht({ children: e }) {
|
|
1197
|
+
let { direction: t, locale: n } = T();
|
|
1030
1198
|
return /* @__PURE__ */ m("div", {
|
|
1031
1199
|
"data-breeze-root": "",
|
|
1032
1200
|
dir: t,
|
|
@@ -1034,30 +1202,30 @@ function nt({ children: e }) {
|
|
|
1034
1202
|
children: e
|
|
1035
1203
|
});
|
|
1036
1204
|
}
|
|
1037
|
-
function
|
|
1038
|
-
let [
|
|
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);
|
|
1039
1207
|
o(() => {
|
|
1040
|
-
if (!
|
|
1041
|
-
|
|
1208
|
+
if (!p) return;
|
|
1209
|
+
g(p.matches);
|
|
1042
1210
|
let e = (e) => {
|
|
1043
|
-
|
|
1211
|
+
g(e.matches);
|
|
1044
1212
|
};
|
|
1045
|
-
return
|
|
1046
|
-
}, [
|
|
1213
|
+
return p.addEventListener("change", e), () => p.removeEventListener("change", e);
|
|
1214
|
+
}, [p]), c(() => {
|
|
1047
1215
|
let { documentElement: e } = document, t = e.dataset.theme, n = e.style.colorScheme;
|
|
1048
|
-
return e.dataset.theme =
|
|
1216
|
+
return e.dataset.theme = b, e.style.colorScheme = b, () => {
|
|
1049
1217
|
t === void 0 ? delete e.dataset.theme : e.dataset.theme = t, e.style.colorScheme = n;
|
|
1050
1218
|
};
|
|
1051
|
-
}, [
|
|
1052
|
-
let
|
|
1053
|
-
e === void 0 &&
|
|
1054
|
-
}, [e, s]),
|
|
1055
|
-
return /* @__PURE__ */ m(
|
|
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, {
|
|
1056
1224
|
locale: r,
|
|
1057
|
-
children: /* @__PURE__ */ m(
|
|
1225
|
+
children: /* @__PURE__ */ m(H, {
|
|
1058
1226
|
value: l(() => ({
|
|
1059
|
-
appearance:
|
|
1060
|
-
getMessageLocale:
|
|
1227
|
+
appearance: y,
|
|
1228
|
+
getMessageLocale: S,
|
|
1061
1229
|
locale: r,
|
|
1062
1230
|
messages: {
|
|
1063
1231
|
appearance: a?.appearance ?? $.appearance,
|
|
@@ -1067,25 +1235,28 @@ function rt({ appearance: e, children: t, defaultAppearance: n = "automatic", lo
|
|
|
1067
1235
|
close: a?.close ?? $.close,
|
|
1068
1236
|
loading: a?.loading ?? $.loading
|
|
1069
1237
|
},
|
|
1070
|
-
resolvedAppearance:
|
|
1071
|
-
setAppearance:
|
|
1238
|
+
resolvedAppearance: b,
|
|
1239
|
+
setAppearance: x
|
|
1072
1240
|
}), [
|
|
1073
|
-
|
|
1074
|
-
|
|
1241
|
+
y,
|
|
1242
|
+
S,
|
|
1075
1243
|
r,
|
|
1076
1244
|
a,
|
|
1077
|
-
|
|
1078
|
-
|
|
1245
|
+
b,
|
|
1246
|
+
x
|
|
1079
1247
|
]),
|
|
1080
|
-
children: /* @__PURE__ */ m(
|
|
1248
|
+
children: /* @__PURE__ */ m(je, {
|
|
1081
1249
|
locale: r,
|
|
1082
1250
|
portalContainer: u,
|
|
1083
|
-
children: /* @__PURE__ */ m(
|
|
1251
|
+
children: /* @__PURE__ */ m(st, {
|
|
1252
|
+
limit: f,
|
|
1253
|
+
children: /* @__PURE__ */ m(ht, { children: t })
|
|
1254
|
+
})
|
|
1084
1255
|
})
|
|
1085
1256
|
})
|
|
1086
1257
|
});
|
|
1087
1258
|
}
|
|
1088
1259
|
//#endregion
|
|
1089
|
-
export {
|
|
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 };
|
|
1090
1261
|
|
|
1091
1262
|
//# sourceMappingURL=index.js.map
|