@ufoui/core 0.0.5 → 0.0.40
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/assets/icons.d.ts +8 -2
- package/components/accordion/accordion.d.ts +31 -3
- package/components/accordion/accordionItem.d.ts +31 -3
- package/components/badge/badge.d.ts +2 -2
- package/components/base/boxBase.d.ts +14 -36
- package/components/base/buttonBase.d.ts +4 -4
- package/components/base/checkboxBase.d.ts +2 -2
- package/components/base/dialogBase.d.ts +111 -13
- package/components/base/fieldBase.d.ts +1 -2
- package/components/base/textBase.d.ts +1 -2
- package/components/breadcrumbs/breadcrumbs.d.ts +48 -0
- package/components/calendar/calendar.d.ts +23 -0
- package/components/calendar/calendarUtils.d.ts +18 -0
- package/components/card/card.d.ts +2 -2
- package/components/collapse/collapse.d.ts +15 -20
- package/components/dialogs/dialog.d.ts +1 -1
- package/components/dialogs/dialogActions.d.ts +19 -7
- package/components/dialogs/dialogActions.guards.d.ts +15 -0
- package/components/dialogs/dialogContent.d.ts +7 -1
- package/components/dialogs/dialogHeader.d.ts +60 -0
- package/components/dialogs/dialogTitle.d.ts +9 -5
- package/components/dialogs/drawer.d.ts +1 -1
- package/components/dialogs/index.d.ts +1 -0
- package/components/fieldset/fieldset.d.ts +1 -1
- package/components/link/link.d.ts +58 -0
- package/components/list/list.d.ts +1 -1
- package/components/menu/menu.d.ts +2 -2
- package/components/rating/rating.d.ts +68 -0
- package/components/slider/slider.d.ts +11 -0
- package/components/switch/switch.d.ts +2 -10
- package/components/themeProvider/themeProvider.d.ts +10 -15
- package/components/toast/toast.d.ts +18 -4
- package/components/toast/toastViewport.d.ts +4 -3
- package/components/tooltip/tooltip.d.ts +2 -2
- package/context/selectionContext.d.ts +18 -17
- package/hooks/index.d.ts +3 -1
- package/hooks/useAnimate.d.ts +36 -16
- package/hooks/useFocusTrap.d.ts +32 -0
- package/hooks/useFocusVisible.d.ts +16 -14
- package/hooks/useResizeObserver.d.ts +7 -3
- package/hooks/useRovingFocus.d.ts +30 -0
- package/hooks/useSelection.d.ts +10 -7
- package/hooks/useSelectionState.d.ts +29 -0
- package/hooks/useSliderKeys.d.ts +41 -0
- package/index.css +1 -1
- package/index.d.ts +4 -8
- package/index.js +4782 -0
- package/internal/controlGrid/controlGrid.d.ts +32 -0
- package/internal/controlLabel/controlLabel.d.ts +31 -0
- package/internal/description/description.d.ts +18 -0
- package/internal/icon/icon.d.ts +28 -0
- package/internal/index.d.ts +7 -0
- package/internal/inlineTooltip/index.d.ts +1 -0
- package/internal/inlineTooltip/inlineTooltipManager.d.ts +3 -3
- package/internal/slots/slot.d.ts +44 -0
- package/internal/stateLayer/stateLayer.d.ts +33 -0
- package/package.json +12 -3
- package/types/dialog.d.ts +37 -0
- package/types/index.d.ts +1 -0
- package/types/motion.d.ts +2 -2
- package/types/theme.d.ts +0 -30
- package/utils/applyThemeTokens.d.ts +10 -0
- package/utils/calculateFloatingPosition.d.ts +3 -3
- package/utils/color.d.ts +61 -216
- package/utils/colorRegistry.d.ts +44 -0
- package/utils/controlStyle.d.ts +8 -8
- package/utils/flatChildren.d.ts +17 -0
- package/utils/generateMaterialColors.d.ts +7 -7
- package/utils/getWrapperStyle.d.ts +53 -0
- package/utils/index.d.ts +5 -1
- package/utils/renderPortal.d.ts +30 -0
- package/utils/toasts/ensureViewport.d.ts +6 -1
- package/utils/toasts/toast.d.ts +66 -10
- package/utils/toasts/toastStore.d.ts +55 -1
- package/utils/utils.d.ts +67 -55
- package/hooks/useFocusState.d.ts +0 -16
- package/index.mjs +0 -4649
- package/internal/inlineTooltip/inlineTooltip.d.ts +0 -11
- package/internal/inlineTooltip/inlineTooltip2.d.ts +0 -10
- package/utils/generateSchemes.d.ts +0 -32
package/index.js
ADDED
|
@@ -0,0 +1,4782 @@
|
|
|
1
|
+
import { jsx as r, jsxs as I, Fragment as rt } from "react/jsx-runtime";
|
|
2
|
+
import Ye, { useState as q, useRef as V, useCallback as tt, useEffect as ge, createContext as Ut, useContext as Ft, forwardRef as S, isValidElement as ct, useLayoutEffect as jn, cloneElement as Rt, useMemo as pt, Children as Pn, Fragment as Lo } from "react";
|
|
3
|
+
import Bo, { createPortal as Io } from "react-dom";
|
|
4
|
+
import { argbFromHex as Gt, themeFromSourceColor as Do, hexFromArgb as $e, TonalPalette as $o } from "@material/material-color-utilities";
|
|
5
|
+
let On = {};
|
|
6
|
+
function Mo(e) {
|
|
7
|
+
On = e;
|
|
8
|
+
}
|
|
9
|
+
function _n() {
|
|
10
|
+
return On;
|
|
11
|
+
}
|
|
12
|
+
function en(e) {
|
|
13
|
+
var t;
|
|
14
|
+
return (t = _n()[e]) == null ? void 0 : t.onColor;
|
|
15
|
+
}
|
|
16
|
+
function Eo(e) {
|
|
17
|
+
const t = e === "base" || e === "border" ? ["semantic", "surface", "extended"] : [e];
|
|
18
|
+
return Object.entries(_n()).filter(([n, o]) => o != null && o.type ? t.includes(o.type) : !1).map(([n]) => n);
|
|
19
|
+
}
|
|
20
|
+
const Hn = (e) => {
|
|
21
|
+
const t = e.toLowerCase(), n = `--uui-color-${t}`, o = `--uui-color-on-${t}`;
|
|
22
|
+
return {
|
|
23
|
+
color: `var(${n})`,
|
|
24
|
+
onColor: `var(${o})`
|
|
25
|
+
};
|
|
26
|
+
}, To = (e) => [parseInt(e.slice(1, 3), 16), parseInt(e.slice(3, 5), 16), parseInt(e.slice(5, 7), 16)], Bi = (e) => [
|
|
27
|
+
parseInt(e.slice(1, 3), 16),
|
|
28
|
+
parseInt(e.slice(3, 5), 16),
|
|
29
|
+
parseInt(e.slice(5, 7), 16)
|
|
30
|
+
].join(",");
|
|
31
|
+
function Ii(e, t) {
|
|
32
|
+
const o = {
|
|
33
|
+
0: "0",
|
|
34
|
+
1: "0.05",
|
|
35
|
+
2: "0.08",
|
|
36
|
+
3: "0.11",
|
|
37
|
+
4: "0.12",
|
|
38
|
+
5: "0.14"
|
|
39
|
+
}[e] ?? 0, [i, a, s] = To(t);
|
|
40
|
+
return `rgba(${String(i)}, ${String(a)}, ${String(s)}, ${o})`;
|
|
41
|
+
}
|
|
42
|
+
function Ro(e) {
|
|
43
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
44
|
+
}
|
|
45
|
+
function zt(e) {
|
|
46
|
+
return e ?? "outlineVariant";
|
|
47
|
+
}
|
|
48
|
+
function Vt(e) {
|
|
49
|
+
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
50
|
+
}
|
|
51
|
+
function on(e, t, n, o) {
|
|
52
|
+
const i = Number(n);
|
|
53
|
+
return Number.isFinite(i) ? Math.min(t, Math.max(e, Math.round(i))) : o;
|
|
54
|
+
}
|
|
55
|
+
const Fo = (e) => ({
|
|
56
|
+
topLeft: "uui-top-left",
|
|
57
|
+
topCenter: "uui-top-center",
|
|
58
|
+
topRight: "uui-top-right",
|
|
59
|
+
topRightOut: "uui-top-right-out",
|
|
60
|
+
topLeftOut: "uui-top-left-out",
|
|
61
|
+
centerLeft: "uui-center-left",
|
|
62
|
+
center: "uui-center",
|
|
63
|
+
centerRight: "uui-center-right",
|
|
64
|
+
bottomLeft: "uui-bottom-left",
|
|
65
|
+
bottomCenter: "uui-bottom-center",
|
|
66
|
+
bottomRight: "uui-bottom-right",
|
|
67
|
+
auto: "uui-top-right"
|
|
68
|
+
})[e], _e = (e) => e ? `uui-${e}` : "", gt = (e) => `uui-${Vt(e)}`, it = (e) => {
|
|
69
|
+
const t = on(0, 4, e);
|
|
70
|
+
return t === void 0 ? "" : `uui-border-${t}`;
|
|
71
|
+
}, at = (e) => {
|
|
72
|
+
const t = on(0, 5, e);
|
|
73
|
+
return t === void 0 ? "" : `uui-elevation-${t}`;
|
|
74
|
+
}, ut = (e) => e ? `uui-${e}` : "", Le = (e) => `uui-font-${Vt(e)}`;
|
|
75
|
+
function yt(...e) {
|
|
76
|
+
return (t) => {
|
|
77
|
+
e.forEach((n) => {
|
|
78
|
+
if (typeof n == "function")
|
|
79
|
+
n(t);
|
|
80
|
+
else if (n) {
|
|
81
|
+
const o = n;
|
|
82
|
+
o.current = t;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const Lt = (e, t, n) => {
|
|
88
|
+
const o = n ?? e, i = o.querySelector(".ripple-container");
|
|
89
|
+
i && i.remove();
|
|
90
|
+
const a = e.getBoundingClientRect(), s = o.getBoundingClientRect(), d = t.clientX - a.left, l = t.clientY - a.top, m = d >= 0 && d <= a.width && l >= 0 && l <= a.height, p = m ? d : a.width / 2, u = m ? l : a.height / 2, f = Math.sqrt(a.width * a.width + a.height * a.height), c = f / 2, h = document.createElement("div");
|
|
91
|
+
h.className = "ripple-container", h.style.position = "absolute", h.style.pointerEvents = "none", h.style.overflow = "hidden", h.style.width = `${a.width}px`, h.style.height = `${a.height}px`, h.style.left = `${a.left - s.left}px`, h.style.top = `${a.top - s.top}px`, requestAnimationFrame(() => {
|
|
92
|
+
h.style.borderRadius = getComputedStyle(e).borderRadius;
|
|
93
|
+
});
|
|
94
|
+
const g = document.createElement("span");
|
|
95
|
+
g.className = "ripple", g.style.position = "absolute", g.style.width = `${f}px`, g.style.height = `${f}px`, g.style.left = `${p - c}px`, g.style.top = `${u - c}px`, h.appendChild(g), o.appendChild(h), g.addEventListener("animationend", () => {
|
|
96
|
+
h.remove();
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
function je(...e) {
|
|
100
|
+
return e.flat().filter(Boolean).join(" ");
|
|
101
|
+
}
|
|
102
|
+
function Un(e, t, n = {}) {
|
|
103
|
+
const { placement: o = "topCenter", offset: i = 8, mode: a = "tooltip" } = n, s = 12, d = {
|
|
104
|
+
tooltip: ["topCenter", "bottomCenter", "centerRight", "centerLeft"],
|
|
105
|
+
dropdown: ["bottomCenter", "topCenter", "centerRight", "centerLeft"],
|
|
106
|
+
menu: ["bottomLeft", "bottomRight", "topLeft", "topRight", "centerRight", "centerLeft"],
|
|
107
|
+
submenu: ["topRightOut", "topLeftOut", "centerRight", "centerLeft", "bottomCenter", "topCenter"]
|
|
108
|
+
}, l = o === "auto" ? d[a] : [o, ...d[a]], m = e.current, p = t.current;
|
|
109
|
+
if (!m || !p)
|
|
110
|
+
return null;
|
|
111
|
+
const u = m.getBoundingClientRect(), f = p.getBoundingClientRect(), c = window.innerWidth, h = window.innerHeight, g = (y) => {
|
|
112
|
+
let v = 0, w = 0;
|
|
113
|
+
switch (y) {
|
|
114
|
+
case "topCenter":
|
|
115
|
+
v = u.left + (u.width - f.width) / 2, w = u.top - f.height - i;
|
|
116
|
+
break;
|
|
117
|
+
case "topLeft":
|
|
118
|
+
v = u.left, w = u.top - f.height - i;
|
|
119
|
+
break;
|
|
120
|
+
case "topRight":
|
|
121
|
+
v = u.right - f.width, w = u.top - f.height - i;
|
|
122
|
+
break;
|
|
123
|
+
case "bottomCenter":
|
|
124
|
+
v = u.left + (u.width - f.width) / 2, w = u.bottom + i;
|
|
125
|
+
break;
|
|
126
|
+
case "bottomLeft":
|
|
127
|
+
v = u.left, w = u.bottom + i;
|
|
128
|
+
break;
|
|
129
|
+
case "bottomRight":
|
|
130
|
+
v = u.right - f.width, w = u.bottom + i;
|
|
131
|
+
break;
|
|
132
|
+
case "centerLeft":
|
|
133
|
+
v = u.left - f.width - i, w = u.top + (u.height - f.height) / 2;
|
|
134
|
+
break;
|
|
135
|
+
case "centerRight":
|
|
136
|
+
v = u.right + i, w = u.top + (u.height - f.height) / 2;
|
|
137
|
+
break;
|
|
138
|
+
case "center":
|
|
139
|
+
v = u.left + (u.width - f.width) / 2, w = u.top + (u.height - f.height) / 2;
|
|
140
|
+
break;
|
|
141
|
+
case "topRightOut":
|
|
142
|
+
v = u.right + i, w = u.top;
|
|
143
|
+
break;
|
|
144
|
+
case "topLeftOut":
|
|
145
|
+
v = u.left - f.width - i, w = u.top;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
return { x: v, y: w, placement: y };
|
|
149
|
+
};
|
|
150
|
+
for (const y of l) {
|
|
151
|
+
const v = g(y), w = v.x >= 0 && v.x + f.width <= c, x = v.y >= 0 && v.y + f.height <= h;
|
|
152
|
+
let k = !1;
|
|
153
|
+
if (y === "centerLeft" || y === "centerRight" ? k = w : y === "topCenter" || y === "bottomCenter" || y === "center" ? k = x : k = w && x, k)
|
|
154
|
+
return v.x = Math.max(s, Math.min(v.x, c - f.width - s)), v.y = Math.max(s, Math.min(v.y, h - f.height - s)), v;
|
|
155
|
+
}
|
|
156
|
+
const C = g(o);
|
|
157
|
+
return C.x = Math.max(s, Math.min(C.x, c - f.width - s)), C.y = Math.max(s, Math.min(C.y, h - f.height - s)), C;
|
|
158
|
+
}
|
|
159
|
+
let Mn = !1, tn = "pointer";
|
|
160
|
+
function Vo() {
|
|
161
|
+
Mn || typeof window > "u" || (Mn = !0, window.addEventListener(
|
|
162
|
+
"keydown",
|
|
163
|
+
() => {
|
|
164
|
+
tn = "keyboard";
|
|
165
|
+
},
|
|
166
|
+
!0
|
|
167
|
+
), window.addEventListener(
|
|
168
|
+
"pointerdown",
|
|
169
|
+
() => {
|
|
170
|
+
tn = "pointer";
|
|
171
|
+
},
|
|
172
|
+
!0
|
|
173
|
+
));
|
|
174
|
+
}
|
|
175
|
+
function Ao() {
|
|
176
|
+
return tn;
|
|
177
|
+
}
|
|
178
|
+
function En(e = "#6750A4", t = {}, n = {}) {
|
|
179
|
+
const o = {}, i = { light: {}, dark: {} }, a = t.primary ? Gt(t.primary) : Gt(e), s = {
|
|
180
|
+
info: "#03a9f4",
|
|
181
|
+
warning: "#ffd600",
|
|
182
|
+
success: "#689f38",
|
|
183
|
+
...t
|
|
184
|
+
}, d = [];
|
|
185
|
+
Object.keys(s).forEach((c) => {
|
|
186
|
+
d.push({
|
|
187
|
+
value: Gt(s[c]),
|
|
188
|
+
name: c,
|
|
189
|
+
blend: !0
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
const l = Do(a, d), m = ["light", "dark"], p = Object.keys(l.schemes.light.toJSON());
|
|
193
|
+
m.forEach((c) => {
|
|
194
|
+
p.forEach((h) => {
|
|
195
|
+
typeof l.schemes[c][h] == "number" && (i[c][h] = $e(
|
|
196
|
+
l.schemes[c][h]
|
|
197
|
+
));
|
|
198
|
+
});
|
|
199
|
+
}), i.light.scrim = "#00000052", i.dark.scrim = "#00000052", l.customColors.forEach((c) => {
|
|
200
|
+
const h = c.color.name[0].toUpperCase() + c.color.name.slice(1), g = {
|
|
201
|
+
color: c.color.name,
|
|
202
|
+
onColor: `on${h}`,
|
|
203
|
+
colorContainer: `${c.color.name}Container`,
|
|
204
|
+
onColorContainer: `on${h}Container`
|
|
205
|
+
};
|
|
206
|
+
o[g.color] = { type: "semantic", onColor: g.onColor }, o[g.onColor] = { type: "theme", onColor: g.color }, o[g.colorContainer] = { type: "extended", onColor: g.onColorContainer }, o[g.onColorContainer] = { type: "theme", onColor: g.colorContainer }, m.forEach((C) => {
|
|
207
|
+
Object.keys(g).forEach((y) => {
|
|
208
|
+
i[C][g[y]] = $e(c[C][y]);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
}), ["primary", "secondary", "tertiary", "error"].forEach((c) => {
|
|
212
|
+
const h = c[0].toUpperCase() + c.slice(1);
|
|
213
|
+
o[c] = { type: "semantic", onColor: `on${h}` }, o[`on${h}`] = { type: "theme", onColor: c }, o[`${c}Container`] = { type: "extended", onColor: `on${h}Container` }, o[`on${h}Container`] = { type: "theme", onColor: `${c}Container` }, m.forEach((g) => {
|
|
214
|
+
i[g][`${c}Fixed`] = $e(
|
|
215
|
+
l.palettes[c].tone(90)
|
|
216
|
+
), o[`${c}Fixed`] = { type: "extended", onColor: `on${h}Fixed` }, i[g][`${c}FixedDim`] = $e(
|
|
217
|
+
l.palettes[c].tone(80)
|
|
218
|
+
), o[`${c}FixedDim`] = { type: "extended", onColor: `on${h}FixedVariant` }, i[g][`on${h}Fixed`] = $e(
|
|
219
|
+
l.palettes[c].tone(10)
|
|
220
|
+
), o[`on${h}Fixed`] = { type: "theme", onColor: `${c}Fixed` }, i[g][`on${h}FixedVariant`] = $e(
|
|
221
|
+
l.palettes[c].tone(30)
|
|
222
|
+
), o[`on${h}FixedVariant`] = { type: "theme", onColor: `${c}FixedDim` };
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
const u = {
|
|
226
|
+
black: "#000000",
|
|
227
|
+
white: "#ffffff"
|
|
228
|
+
};
|
|
229
|
+
Object.assign(i.light, u), Object.assign(i.dark, u), o.white = { type: "surface", onColor: "black" }, o.black = { type: "surface", onColor: "white" };
|
|
230
|
+
const f = (c, h) => {
|
|
231
|
+
const g = $o.fromInt(c);
|
|
232
|
+
return $e(g.tone(h));
|
|
233
|
+
};
|
|
234
|
+
return l.customColors.forEach((c) => {
|
|
235
|
+
const h = c.color.name, g = h[0].toUpperCase() + h.slice(1);
|
|
236
|
+
o[`${h}Fixed`] = { type: "extended", onColor: `on${g}Fixed` }, o[`${h}FixedDim`] = { type: "extended", onColor: `on${g}FixedVariant` }, o[`on${g}Fixed`] = { type: "theme", onColor: `${h}Fixed` }, o[`on${g}FixedVariant`] = { type: "theme", onColor: `${h}FixedDim` }, m.forEach((C) => {
|
|
237
|
+
const y = c[C].color;
|
|
238
|
+
i[C][`${h}Fixed`] = f(y, 90), i[C][`${h}FixedDim`] = f(y, 80), i[C][`on${g}Fixed`] = f(y, 10), i[C][`on${g}FixedVariant`] = f(y, 30);
|
|
239
|
+
});
|
|
240
|
+
}), i.light.surface = $e(l.palettes.neutral.tone(99)), o.surface = { type: "surface", onColor: "onSurface" }, i.light.surfaceDim = $e(l.palettes.neutral.tone(87)), o.surfaceDim = { type: "surface", onColor: "onSurface" }, i.light.surfaceBright = $e(l.palettes.neutral.tone(99)), o.surfaceBright = { type: "surface", onColor: "onSurface" }, i.light.surfaceContainerLowest = $e(l.palettes.neutral.tone(100)), o.surfaceContainerLowest = { type: "surface", onColor: "onSurface" }, i.light.surfaceContainerLow = $e(l.palettes.neutral.tone(96)), o.surfaceContainerLow = { type: "surface", onColor: "onSurface" }, i.light.surfaceContainer = $e(l.palettes.neutral.tone(94)), o.surfaceContainer = { type: "surface", onColor: "onSurface" }, i.light.surfaceContainerHigh = $e(l.palettes.neutral.tone(92)), o.surfaceContainerHigh = { type: "surface", onColor: "onSurface" }, i.light.surfaceContainerHighest = $e(l.palettes.neutral.tone(90)), o.surfaceContainerHighest = { type: "surface", onColor: "onSurface" }, i.dark.surface = $e(l.palettes.neutral.tone(6)), i.dark.surfaceDim = $e(l.palettes.neutral.tone(6)), i.dark.surfaceBright = $e(l.palettes.neutral.tone(24)), i.dark.surfaceContainerLowest = $e(l.palettes.neutral.tone(4)), i.dark.surfaceContainerLow = $e(l.palettes.neutral.tone(10)), i.dark.surfaceContainer = $e(l.palettes.neutral.tone(12)), i.dark.surfaceContainerHigh = $e(l.palettes.neutral.tone(17)), i.dark.surfaceContainerHighest = $e(l.palettes.neutral.tone(22)), i.light.surfaceTint = $e(l.palettes.primary.tone(40)), o.surfaceTint = { type: "theme" }, i.dark.surfaceTint = $e(l.palettes.primary.tone(80)), o.surfaceVariant = { type: "surface", onColor: "onSurfaceVariant" }, o.scrim = { type: "theme" }, o.onSurface = { type: "theme", onColor: "surface" }, o.onSurfaceVariant = { type: "theme", onColor: "surfaceVariant" }, o.background = { type: "surface", onColor: "onBackground" }, o.onBackground = { type: "theme", onColor: "background" }, o.inverseSurface = { type: "surface", onColor: "inverseOnSurface" }, o.inverseOnSurface = { type: "theme", onColor: "inverseSurface" }, o.outline = { type: "surface", onColor: "surface" }, o.outlineVariant = { type: "surface", onColor: "inverseSurface" }, o.inversePrimary = { type: "theme", onColor: "onPrimaryContainer" }, o.shadow = { type: "theme" }, Mo(o), i;
|
|
241
|
+
}
|
|
242
|
+
function jo(e) {
|
|
243
|
+
if (typeof document > "u")
|
|
244
|
+
return e;
|
|
245
|
+
const t = "ufo-ui-theme";
|
|
246
|
+
let n = document.getElementById(t);
|
|
247
|
+
n || (n = document.createElement("style"), n.id = t, document.head.appendChild(n));
|
|
248
|
+
const o = [...Object.entries(e.light).map(([a, s]) => `--uui-color-${Vt(a)}: ${s};`)].join(
|
|
249
|
+
""
|
|
250
|
+
), i = Object.entries(e.dark).map(([a, s]) => `--uui-color-${Vt(a)}: ${s};`).join("");
|
|
251
|
+
return n.textContent = `:root{${o}}.dark{${i}}`, e;
|
|
252
|
+
}
|
|
253
|
+
let Ge = [], _t = [];
|
|
254
|
+
function Ot() {
|
|
255
|
+
const e = [...Ge];
|
|
256
|
+
[..._t].forEach((t) => {
|
|
257
|
+
t(e);
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
const mt = {
|
|
261
|
+
/**
|
|
262
|
+
* Subscribes to toast state updates.
|
|
263
|
+
*
|
|
264
|
+
* @function
|
|
265
|
+
*/
|
|
266
|
+
subscribe(e) {
|
|
267
|
+
return _t.push(e), e([...Ge]), () => {
|
|
268
|
+
_t = _t.filter((t) => t !== e);
|
|
269
|
+
};
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* Adds a new toast to the store.
|
|
273
|
+
*
|
|
274
|
+
* Priority toasts are inserted at the beginning
|
|
275
|
+
* so they appear before normal queued toasts.
|
|
276
|
+
*
|
|
277
|
+
* @function
|
|
278
|
+
*/
|
|
279
|
+
add(e) {
|
|
280
|
+
Ge.some((t) => t.id === e.id) || (Ge = [...Ge, e], Ot());
|
|
281
|
+
},
|
|
282
|
+
/**
|
|
283
|
+
* Updates an existing toast.
|
|
284
|
+
*
|
|
285
|
+
* @function
|
|
286
|
+
*/
|
|
287
|
+
update(e, t) {
|
|
288
|
+
const n = Ge.findIndex((i) => i.id === e);
|
|
289
|
+
if (n === -1)
|
|
290
|
+
return;
|
|
291
|
+
const o = [...Ge];
|
|
292
|
+
o[n] = { ...o[n], ...t }, Ge = o, Ot();
|
|
293
|
+
},
|
|
294
|
+
/**
|
|
295
|
+
* Removes a toast from the store.
|
|
296
|
+
*
|
|
297
|
+
* @function
|
|
298
|
+
*/
|
|
299
|
+
remove(e) {
|
|
300
|
+
const t = Ge.filter((n) => n.id !== e);
|
|
301
|
+
t.length !== Ge.length && (Ge = t, Ot());
|
|
302
|
+
},
|
|
303
|
+
/**
|
|
304
|
+
* Removes all toasts.
|
|
305
|
+
*
|
|
306
|
+
* @function
|
|
307
|
+
*/
|
|
308
|
+
clear() {
|
|
309
|
+
Ge.length !== 0 && (Ge = [], Ot());
|
|
310
|
+
},
|
|
311
|
+
/**
|
|
312
|
+
* Returns current toast list snapshot.
|
|
313
|
+
*
|
|
314
|
+
* @function
|
|
315
|
+
*/
|
|
316
|
+
getState() {
|
|
317
|
+
return [...Ge];
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
var Nt = {}, Tn;
|
|
321
|
+
function Po() {
|
|
322
|
+
if (Tn) return Nt;
|
|
323
|
+
Tn = 1;
|
|
324
|
+
var e = Bo;
|
|
325
|
+
if (process.env.NODE_ENV === "production")
|
|
326
|
+
Nt.createRoot = e.createRoot, Nt.hydrateRoot = e.hydrateRoot;
|
|
327
|
+
else {
|
|
328
|
+
var t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
329
|
+
Nt.createRoot = function(n, o) {
|
|
330
|
+
t.usingClientEntryPoint = !0;
|
|
331
|
+
try {
|
|
332
|
+
return e.createRoot(n, o);
|
|
333
|
+
} finally {
|
|
334
|
+
t.usingClientEntryPoint = !1;
|
|
335
|
+
}
|
|
336
|
+
}, Nt.hydrateRoot = function(n, o, i) {
|
|
337
|
+
t.usingClientEntryPoint = !0;
|
|
338
|
+
try {
|
|
339
|
+
return e.hydrateRoot(n, o, i);
|
|
340
|
+
} finally {
|
|
341
|
+
t.usingClientEntryPoint = !1;
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
return Nt;
|
|
346
|
+
}
|
|
347
|
+
var Oo = Po();
|
|
348
|
+
function rn(e = {}) {
|
|
349
|
+
const { initial: t = "idle" } = e, [n, o] = q("idle"), [i, a] = q(!1), { t1: s = 0, t2: d, oneShot: l = !1 } = e, m = d ?? Math.round(s * 0.67), p = V(null), u = () => p.current !== null ? (clearTimeout(p.current), p.current = null, !0) : !1, f = tt(
|
|
350
|
+
(C) => {
|
|
351
|
+
function y(w, x) {
|
|
352
|
+
p.current = window.setTimeout(() => {
|
|
353
|
+
o(w), u();
|
|
354
|
+
}, x);
|
|
355
|
+
}
|
|
356
|
+
if (u() && a(!0), l) {
|
|
357
|
+
s ? (y("open", s), o("opening")) : o((w) => w === "opening" ? "open" : "opening");
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
if (s) {
|
|
361
|
+
o((w) => {
|
|
362
|
+
const x = C === "closed" ? !0 : C === "open" ? !1 : w === "open" || w === "opening", k = x ? "closing" : "opening", B = x ? "closed" : "open";
|
|
363
|
+
return y(B, B === "open" ? s : m), k;
|
|
364
|
+
});
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
o((w) => {
|
|
368
|
+
switch (w) {
|
|
369
|
+
case "idle":
|
|
370
|
+
case "closed":
|
|
371
|
+
return "opening";
|
|
372
|
+
case "opening":
|
|
373
|
+
return "open";
|
|
374
|
+
case "open":
|
|
375
|
+
return "closing";
|
|
376
|
+
case "closing":
|
|
377
|
+
return "closed";
|
|
378
|
+
default:
|
|
379
|
+
return w;
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
},
|
|
383
|
+
[l, s, m]
|
|
384
|
+
);
|
|
385
|
+
ge(() => {
|
|
386
|
+
i && a(!1);
|
|
387
|
+
}, [i]), ge(() => {
|
|
388
|
+
t !== "idle" && f(t === "open" ? "open" : "closed");
|
|
389
|
+
}, []);
|
|
390
|
+
const c = n === "closing", h = n === "opening";
|
|
391
|
+
return {
|
|
392
|
+
opening: h,
|
|
393
|
+
closing: c,
|
|
394
|
+
animating: (h || c) && !i,
|
|
395
|
+
idle: n === "idle",
|
|
396
|
+
active: c || h,
|
|
397
|
+
animationVars: {
|
|
398
|
+
"--uui-duration": `${h ? s : m}ms`,
|
|
399
|
+
"--uui-reverse": c ? "reverse" : "normal"
|
|
400
|
+
},
|
|
401
|
+
animate: f
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
function _o(e, t, n, o) {
|
|
405
|
+
ge(() => {
|
|
406
|
+
if (!e)
|
|
407
|
+
return;
|
|
408
|
+
const i = (a) => {
|
|
409
|
+
var m, p;
|
|
410
|
+
const s = a.target;
|
|
411
|
+
if (Array.isArray(t)) {
|
|
412
|
+
const u = t.some((c) => {
|
|
413
|
+
var h;
|
|
414
|
+
return (h = c.current) == null ? void 0 : h.contains(s);
|
|
415
|
+
}), f = ((m = o == null ? void 0 : o.current) == null ? void 0 : m.contains(s)) ?? !1;
|
|
416
|
+
!u && !f && n();
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
const d = !!s.closest(t), l = ((p = o == null ? void 0 : o.current) == null ? void 0 : p.contains(s)) ?? !1;
|
|
420
|
+
!d && !l && n();
|
|
421
|
+
};
|
|
422
|
+
return document.addEventListener("mousedown", i), () => {
|
|
423
|
+
document.removeEventListener("mousedown", i);
|
|
424
|
+
};
|
|
425
|
+
}, [e, t, n, o]);
|
|
426
|
+
}
|
|
427
|
+
const ht = [], Rn = (e) => {
|
|
428
|
+
e.key === "Escape" && ht.length > 0 && (e.preventDefault(), ht[ht.length - 1]());
|
|
429
|
+
};
|
|
430
|
+
function Ho(e, t) {
|
|
431
|
+
const n = V(t);
|
|
432
|
+
n.current = t, ge(() => {
|
|
433
|
+
if (!e)
|
|
434
|
+
return;
|
|
435
|
+
const o = () => {
|
|
436
|
+
n.current();
|
|
437
|
+
};
|
|
438
|
+
return ht.push(o), ht.length === 1 && document.addEventListener("keydown", Rn), () => {
|
|
439
|
+
const i = ht.lastIndexOf(o);
|
|
440
|
+
i !== -1 && ht.splice(i, 1), ht.length === 0 && document.removeEventListener("keydown", Rn);
|
|
441
|
+
};
|
|
442
|
+
}, [e]);
|
|
443
|
+
}
|
|
444
|
+
function Bt(e, t) {
|
|
445
|
+
Vo();
|
|
446
|
+
const [n, o] = q(!1);
|
|
447
|
+
return {
|
|
448
|
+
focusVisible: Ao() === "keyboard",
|
|
449
|
+
isFocused: n,
|
|
450
|
+
focusHandlers: {
|
|
451
|
+
onFocus: (d) => {
|
|
452
|
+
o(!0), e == null || e(d);
|
|
453
|
+
},
|
|
454
|
+
onBlur: (d) => {
|
|
455
|
+
o(!1), t == null || t(d);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
function nn(e, t, n = !0, o = !1) {
|
|
461
|
+
ge(() => {
|
|
462
|
+
if (!n)
|
|
463
|
+
return;
|
|
464
|
+
const i = e.current;
|
|
465
|
+
if (!i)
|
|
466
|
+
return;
|
|
467
|
+
const a = o ? "border-box" : "content-box", s = new ResizeObserver(([d]) => {
|
|
468
|
+
let l, m;
|
|
469
|
+
o ? d.borderBoxSize.length > 0 ? [{ inlineSize: l, blockSize: m }] = d.borderBoxSize : { width: l, height: m } = d.target.getBoundingClientRect() : d.contentBoxSize.length > 0 ? [{ inlineSize: l, blockSize: m }] = d.contentBoxSize : { width: l, height: m } = d.contentRect, t({ width: l, height: m });
|
|
470
|
+
});
|
|
471
|
+
return s.observe(i, { box: a }), () => {
|
|
472
|
+
s.disconnect();
|
|
473
|
+
};
|
|
474
|
+
}, [e, t, n, o]);
|
|
475
|
+
}
|
|
476
|
+
const zn = Ut(
|
|
477
|
+
null
|
|
478
|
+
), sn = Ut(null), Wt = Ut(null), Fn = {
|
|
479
|
+
darkMode: !1,
|
|
480
|
+
schemes: { light: {}, dark: {} }
|
|
481
|
+
}, Wn = Ut(null);
|
|
482
|
+
function Kn() {
|
|
483
|
+
const e = Ft(Wt);
|
|
484
|
+
if (!e)
|
|
485
|
+
throw new Error("useSelection must be used within SelectionContext provider");
|
|
486
|
+
return e;
|
|
487
|
+
}
|
|
488
|
+
function Di() {
|
|
489
|
+
const e = Ft(Wn);
|
|
490
|
+
if (!e)
|
|
491
|
+
throw new Error("useTheme must be used within a <ThemeProvider>");
|
|
492
|
+
return e;
|
|
493
|
+
}
|
|
494
|
+
function Uo({ value: e, min: t, max: n, step: o, disabled: i, readOnly: a, onChange: s }) {
|
|
495
|
+
return { onKeyDown: tt(
|
|
496
|
+
(l) => {
|
|
497
|
+
if (i || a)
|
|
498
|
+
return;
|
|
499
|
+
let m;
|
|
500
|
+
switch (l.key) {
|
|
501
|
+
case "ArrowRight":
|
|
502
|
+
case "ArrowUp":
|
|
503
|
+
l.preventDefault(), m = Math.min(e + o, n);
|
|
504
|
+
break;
|
|
505
|
+
case "ArrowLeft":
|
|
506
|
+
case "ArrowDown":
|
|
507
|
+
l.preventDefault(), m = Math.max(e - o, t);
|
|
508
|
+
break;
|
|
509
|
+
case "Home":
|
|
510
|
+
l.preventDefault(), m = t;
|
|
511
|
+
break;
|
|
512
|
+
case "End":
|
|
513
|
+
l.preventDefault(), m = n;
|
|
514
|
+
break;
|
|
515
|
+
default:
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
s(m);
|
|
519
|
+
},
|
|
520
|
+
[e, t, n, o, i, a, s]
|
|
521
|
+
) };
|
|
522
|
+
}
|
|
523
|
+
function zo(e = "vertical", t = !0) {
|
|
524
|
+
const n = V([]), o = tt((s) => {
|
|
525
|
+
s && (n.current.includes(s) || n.current.push(s));
|
|
526
|
+
}, []), i = tt((s) => {
|
|
527
|
+
s && (n.current = n.current.filter((d) => d !== s));
|
|
528
|
+
}, []), a = tt(
|
|
529
|
+
(s) => {
|
|
530
|
+
const d = e === "vertical", l = d ? "ArrowDown" : "ArrowRight";
|
|
531
|
+
if (![l, d ? "ArrowUp" : "ArrowLeft", "Home", "End"].includes(s.key))
|
|
532
|
+
return;
|
|
533
|
+
s.preventDefault();
|
|
534
|
+
const u = [...n.current].sort((C, y) => {
|
|
535
|
+
if (C === y)
|
|
536
|
+
return 0;
|
|
537
|
+
const v = C.compareDocumentPosition(y);
|
|
538
|
+
return v & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : v & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
539
|
+
}).filter((C) => !("disabled" in C && C.disabled || C.getAttribute("aria-disabled") === "true"));
|
|
540
|
+
if (u.length === 0)
|
|
541
|
+
return;
|
|
542
|
+
const f = u.indexOf(s.currentTarget);
|
|
543
|
+
if (f === -1)
|
|
544
|
+
return;
|
|
545
|
+
if (s.key === "Home") {
|
|
546
|
+
u[0].focus();
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
if (s.key === "End") {
|
|
550
|
+
u[u.length - 1].focus();
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
const c = s.key === l ? 1 : -1, h = t ? (f + c + u.length) % u.length : f + c, g = u.at(h);
|
|
554
|
+
g && g.focus();
|
|
555
|
+
},
|
|
556
|
+
[e, t]
|
|
557
|
+
);
|
|
558
|
+
return { register: o, unregister: i, onKeyDown: a };
|
|
559
|
+
}
|
|
560
|
+
function Wo(e, t = "vertical") {
|
|
561
|
+
const [n, o] = q([]), i = zo(t), a = tt(
|
|
562
|
+
(l) => {
|
|
563
|
+
o((m) => {
|
|
564
|
+
const p = m.includes(l);
|
|
565
|
+
return e === "single" ? p ? [] : [l] : p ? m.filter((u) => u !== l) : [...m, l];
|
|
566
|
+
});
|
|
567
|
+
},
|
|
568
|
+
[e]
|
|
569
|
+
), s = tt((l) => {
|
|
570
|
+
o([l]);
|
|
571
|
+
}, []), d = tt(() => {
|
|
572
|
+
o([]);
|
|
573
|
+
}, []);
|
|
574
|
+
return {
|
|
575
|
+
values: n,
|
|
576
|
+
toggle: a,
|
|
577
|
+
set: s,
|
|
578
|
+
clear: d,
|
|
579
|
+
roving: i,
|
|
580
|
+
type: e,
|
|
581
|
+
orientation: t
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
const Ct = [], Ko = ({ ref: e, enabled: t, autoFocus: n = !0 }) => {
|
|
585
|
+
const o = V(null);
|
|
586
|
+
ge(() => {
|
|
587
|
+
if (!t || !e.current)
|
|
588
|
+
return;
|
|
589
|
+
const i = e.current;
|
|
590
|
+
o.current = document.activeElement, Ct.push(i);
|
|
591
|
+
const a = () => Array.from(
|
|
592
|
+
i.querySelectorAll(
|
|
593
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
594
|
+
)
|
|
595
|
+
).filter((l) => !l.hasAttribute("disabled") && l.getClientRects().length > 0);
|
|
596
|
+
if (n && !i.contains(document.activeElement)) {
|
|
597
|
+
const l = a();
|
|
598
|
+
(l.find((p) => p.hasAttribute("data-autofocus")) ?? l[0] ?? i).focus();
|
|
599
|
+
}
|
|
600
|
+
const s = (l) => {
|
|
601
|
+
if (l.key !== "Tab" || Ct[Ct.length - 1] !== i)
|
|
602
|
+
return;
|
|
603
|
+
const m = a();
|
|
604
|
+
if (m.length === 0) {
|
|
605
|
+
l.preventDefault();
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const p = m[0], u = m[m.length - 1];
|
|
609
|
+
l.shiftKey && document.activeElement === p ? (l.preventDefault(), u.focus()) : !l.shiftKey && document.activeElement === u && (l.preventDefault(), p.focus());
|
|
610
|
+
}, d = (l) => {
|
|
611
|
+
const m = l.target;
|
|
612
|
+
if (!i.contains(m)) {
|
|
613
|
+
if (Ct[Ct.length - 1] !== i)
|
|
614
|
+
return;
|
|
615
|
+
const u = a()[0] ?? i;
|
|
616
|
+
u !== m && u.focus({ preventScroll: !0 });
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
return document.addEventListener("keydown", s), document.addEventListener("focusin", d), () => {
|
|
620
|
+
document.removeEventListener("keydown", s), document.removeEventListener("focusin", d);
|
|
621
|
+
const l = Ct.lastIndexOf(i);
|
|
622
|
+
l !== -1 && Ct.splice(l, 1);
|
|
623
|
+
const m = o.current;
|
|
624
|
+
m && document.contains(m) && setTimeout(() => {
|
|
625
|
+
m.focus({ preventScroll: !0 });
|
|
626
|
+
}, 0);
|
|
627
|
+
};
|
|
628
|
+
}, [t, e, n]);
|
|
629
|
+
}, ln = {
|
|
630
|
+
fade: "uui-motion-fade",
|
|
631
|
+
fadeBlur: "uui-motion-fade-blur",
|
|
632
|
+
scale: "uui-motion-scale",
|
|
633
|
+
scaleBlur: "uui-motion-scale-blur",
|
|
634
|
+
popup: "uui-motion-popup",
|
|
635
|
+
slideUp: "uui-motion-slide-up",
|
|
636
|
+
slideDown: "uui-motion-slide-down",
|
|
637
|
+
slideLeft: "uui-motion-slide-left",
|
|
638
|
+
slideRight: "uui-motion-slide-right",
|
|
639
|
+
slideUpBlur: "uui-motion-slide-up-blur",
|
|
640
|
+
slideDownBlur: "uui-motion-slide-down-blur",
|
|
641
|
+
slideLeftBlur: "uui-motion-slide-left-blur",
|
|
642
|
+
slideRightBlur: "uui-motion-slide-right-blur",
|
|
643
|
+
rotate: "uui-motion-rotate",
|
|
644
|
+
rotateUpRight: "uui-motion-rotate-up-right",
|
|
645
|
+
rotateUpLeft: "uui-motion-rotate-up-left",
|
|
646
|
+
rollLeft: "uui-motion-roll-left",
|
|
647
|
+
rollRight: "uui-motion-roll-right",
|
|
648
|
+
flipX: "uui-motion-flip-x",
|
|
649
|
+
flipY: "uui-motion-flip-y",
|
|
650
|
+
bounce: "uui-motion-bounce",
|
|
651
|
+
squish: "uui-motion-squish",
|
|
652
|
+
rubber: "uui-motion-rubber",
|
|
653
|
+
popElastic: "uui-motion-pop-elastic",
|
|
654
|
+
jelly: "uui-motion-jelly"
|
|
655
|
+
};
|
|
656
|
+
function an(e) {
|
|
657
|
+
return e && e !== "none" ? ln[e] ?? "" : "";
|
|
658
|
+
}
|
|
659
|
+
function $i() {
|
|
660
|
+
return Object.keys(ln);
|
|
661
|
+
}
|
|
662
|
+
function cn(e) {
|
|
663
|
+
return e === "expressive" ? "uui-motion-expressive" : "";
|
|
664
|
+
}
|
|
665
|
+
const Kt = S((e, t) => {
|
|
666
|
+
const {
|
|
667
|
+
open: n,
|
|
668
|
+
animation: o = "fade",
|
|
669
|
+
duration: i = 220,
|
|
670
|
+
motionStyle: a = "regular",
|
|
671
|
+
className: s,
|
|
672
|
+
children: d,
|
|
673
|
+
style: l,
|
|
674
|
+
shape: m,
|
|
675
|
+
...p
|
|
676
|
+
} = e, u = V(!0), f = V(null), [c, h] = q(void 0), { animationVars: g, animate: C, animating: y } = rn({
|
|
677
|
+
t1: i
|
|
678
|
+
});
|
|
679
|
+
nn(f, ({ height: L }) => {
|
|
680
|
+
h(L), u.current = !1;
|
|
681
|
+
}, !y, !0), ge(() => {
|
|
682
|
+
u.current || C(n ? "open" : "closed");
|
|
683
|
+
}, [n]);
|
|
684
|
+
const w = ["uui-collapse", s, ...m ? [_e(m)] : []].filter(Boolean).join(" "), x = E();
|
|
685
|
+
x.merge(g), n ? c !== void 0 && x.set("height", `${c}px`) : x.set("height", "0px");
|
|
686
|
+
const k = [y && an(o), cn(a)].filter(Boolean).join(" "), B = E(l);
|
|
687
|
+
return B.merge(g), /* @__PURE__ */ r(
|
|
688
|
+
"div",
|
|
689
|
+
{
|
|
690
|
+
"aria-hidden": !n,
|
|
691
|
+
className: w,
|
|
692
|
+
...n ? {} : { inert: "" },
|
|
693
|
+
style: x.get(),
|
|
694
|
+
children: /* @__PURE__ */ r("div", { className: "uui-collapse-wrapper", ref: f, children: /* @__PURE__ */ r(Me, { ...p, className: k, ref: t, shape: m, style: B.get(), children: d }) })
|
|
695
|
+
}
|
|
696
|
+
);
|
|
697
|
+
});
|
|
698
|
+
Kt.displayName = "Collapse";
|
|
699
|
+
const Zn = S(
|
|
700
|
+
({
|
|
701
|
+
id: e,
|
|
702
|
+
title: t,
|
|
703
|
+
description: n,
|
|
704
|
+
color: o,
|
|
705
|
+
icon: i,
|
|
706
|
+
action: a,
|
|
707
|
+
content: s,
|
|
708
|
+
duration: d = 400,
|
|
709
|
+
animation: l = "flipY",
|
|
710
|
+
motionStyle: m,
|
|
711
|
+
timeout: p,
|
|
712
|
+
elevation: u = 3,
|
|
713
|
+
shape: f = "smooth",
|
|
714
|
+
status: c,
|
|
715
|
+
leaving: h,
|
|
716
|
+
onExitComplete: g,
|
|
717
|
+
className: C,
|
|
718
|
+
...y
|
|
719
|
+
}, v) => {
|
|
720
|
+
const [w, x] = q(!1), k = V(null), B = V(!1), L = () => {
|
|
721
|
+
B.current || (B.current = !0, setTimeout(() => {
|
|
722
|
+
g == null || g(e);
|
|
723
|
+
}, d));
|
|
724
|
+
};
|
|
725
|
+
ge(() => {
|
|
726
|
+
if (!(!p || p === 0))
|
|
727
|
+
return k.current = setTimeout(() => {
|
|
728
|
+
mt.remove(e), x(!1), L();
|
|
729
|
+
}, p), () => {
|
|
730
|
+
k.current && clearTimeout(k.current);
|
|
731
|
+
};
|
|
732
|
+
}, [e, L, p]);
|
|
733
|
+
const M = E();
|
|
734
|
+
M.bg(o), M.text.on(o);
|
|
735
|
+
const F = c ? `uui-toast-${c}` : void 0;
|
|
736
|
+
ge(() => {
|
|
737
|
+
x(!0);
|
|
738
|
+
}, []), ge(() => {
|
|
739
|
+
h && (k.current && clearTimeout(k.current), x(!1), L());
|
|
740
|
+
}, [h, L]);
|
|
741
|
+
const D = s ?? /* @__PURE__ */ I(rt, { children: [
|
|
742
|
+
/* @__PURE__ */ I("div", { className: "uui-toast-text", children: [
|
|
743
|
+
i && /* @__PURE__ */ r("div", { className: "uui-icon", children: i }),
|
|
744
|
+
/* @__PURE__ */ I("div", { className: "uui-toast-content", children: [
|
|
745
|
+
t && /* @__PURE__ */ r("div", { className: "uui-toast-title uui-font-label-large", children: t }),
|
|
746
|
+
n && /* @__PURE__ */ r("div", { className: "uui-toast-description", children: n })
|
|
747
|
+
] })
|
|
748
|
+
] }),
|
|
749
|
+
/* @__PURE__ */ r("div", { className: "uui-toast-actions uui-slot", children: a })
|
|
750
|
+
] });
|
|
751
|
+
return /* @__PURE__ */ r(
|
|
752
|
+
Me,
|
|
753
|
+
{
|
|
754
|
+
className: je("uui-toast", F, C),
|
|
755
|
+
elevation: u,
|
|
756
|
+
font: "bodyMedium",
|
|
757
|
+
ref: v,
|
|
758
|
+
shape: f,
|
|
759
|
+
style: M.get(),
|
|
760
|
+
...y,
|
|
761
|
+
children: /* @__PURE__ */ r(Kt, { animation: l, duration: d, motionStyle: m, open: w, children: /* @__PURE__ */ r("div", { className: "uui-toast-region", id: `${e}-content`, role: "region", children: D }) })
|
|
762
|
+
}
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
);
|
|
766
|
+
Zn.displayName = "Toast";
|
|
767
|
+
const Zo = {
|
|
768
|
+
topLeft: { top: 16, left: 16, flexDirection: "column-reverse" },
|
|
769
|
+
topCenter: { top: 16, left: "50%", transform: "translateX(-50%)", flexDirection: "column-reverse" },
|
|
770
|
+
topRight: { top: 16, right: 16, flexDirection: "column-reverse" },
|
|
771
|
+
bottomLeft: { bottom: 16, left: 16 },
|
|
772
|
+
bottomCenter: { bottom: 16, left: "50%", transform: "translateX(-50%)" },
|
|
773
|
+
bottomRight: { bottom: 16, right: 16 }
|
|
774
|
+
}, qo = ({ position: e = "bottomRight", timeout: t = 4e3, limit: n = 3 }) => {
|
|
775
|
+
const [o, i] = q([]);
|
|
776
|
+
ge(() => mt.subscribe((d) => {
|
|
777
|
+
i((l) => {
|
|
778
|
+
const m = new Map(d.map((c) => [c.id, c])), p = new Set(l.map((c) => c.id)), u = l.map((c) => {
|
|
779
|
+
const h = m.get(c.id);
|
|
780
|
+
return h ? { ...h, leaving: c.leaving } : c.leaving ? c : { ...c, leaving: !0 };
|
|
781
|
+
}), f = d.filter((c) => !p.has(c.id)).map((c) => ({ ...c, leaving: !1 }));
|
|
782
|
+
return [...u, ...f];
|
|
783
|
+
});
|
|
784
|
+
}), [n]);
|
|
785
|
+
const a = (d) => {
|
|
786
|
+
i((l) => l.filter((m) => m.id !== d));
|
|
787
|
+
}, s = n <= 0 ? o : o.slice(0, n);
|
|
788
|
+
return /* @__PURE__ */ r(
|
|
789
|
+
"div",
|
|
790
|
+
{
|
|
791
|
+
"aria-live": "polite",
|
|
792
|
+
"aria-relevant": "additions text",
|
|
793
|
+
className: "uui-toast-viewport uui-menu-scroll",
|
|
794
|
+
style: Zo[e],
|
|
795
|
+
children: s.map((d) => {
|
|
796
|
+
const { priority: l, leaving: m, ...p } = d, u = typeof p.action == "function" ? p.action(p.id) : p.action;
|
|
797
|
+
return /* @__PURE__ */ r(
|
|
798
|
+
Zn,
|
|
799
|
+
{
|
|
800
|
+
...p,
|
|
801
|
+
action: u,
|
|
802
|
+
leaving: m,
|
|
803
|
+
onExitComplete: a,
|
|
804
|
+
timeout: p.timeout ?? t
|
|
805
|
+
},
|
|
806
|
+
p.id
|
|
807
|
+
);
|
|
808
|
+
})
|
|
809
|
+
}
|
|
810
|
+
);
|
|
811
|
+
};
|
|
812
|
+
let Yt = !1;
|
|
813
|
+
function Go() {
|
|
814
|
+
if (Yt)
|
|
815
|
+
return;
|
|
816
|
+
if (document.querySelector(".uui-toast-viewport")) {
|
|
817
|
+
Yt = !0;
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
const e = document.createElement("div");
|
|
821
|
+
document.body.appendChild(e), Oo.createRoot(e).render(/* @__PURE__ */ r(qo, {})), Yt = !0;
|
|
822
|
+
}
|
|
823
|
+
function Xt(e, t) {
|
|
824
|
+
const n = typeof e == "function" ? e(t) : e;
|
|
825
|
+
return typeof n == "string" ? { description: n } : n;
|
|
826
|
+
}
|
|
827
|
+
function kt(e) {
|
|
828
|
+
Go();
|
|
829
|
+
const t = typeof e == "string" ? { description: e } : e, n = t.id ?? crypto.randomUUID();
|
|
830
|
+
return mt.add({
|
|
831
|
+
priority: !1,
|
|
832
|
+
...t,
|
|
833
|
+
id: n
|
|
834
|
+
}), n;
|
|
835
|
+
}
|
|
836
|
+
const Mi = Object.assign(kt, {
|
|
837
|
+
/** Updates an existing toast. */
|
|
838
|
+
update: mt.update,
|
|
839
|
+
/** Removes a toast by id. */
|
|
840
|
+
dismiss: mt.remove,
|
|
841
|
+
/** Removes all toasts. */
|
|
842
|
+
clear: mt.clear,
|
|
843
|
+
/** Creates a success toast. */
|
|
844
|
+
success: (e, t) => kt({ ...t, description: e, status: "success" }),
|
|
845
|
+
/** Creates an error toast. */
|
|
846
|
+
error: (e, t) => kt({ ...t, description: e, status: "error" }),
|
|
847
|
+
/** Creates an informational toast. */
|
|
848
|
+
info: (e, t) => kt({ ...t, description: e, status: "info" }),
|
|
849
|
+
/** Creates a warning toast. */
|
|
850
|
+
warning: (e, t) => kt({ ...t, description: e, status: "warning" }),
|
|
851
|
+
/**
|
|
852
|
+
* Displays toast lifecycle bound to a promise.
|
|
853
|
+
*
|
|
854
|
+
* Promise toasts use priority so the user immediately
|
|
855
|
+
* sees feedback for the triggered action.
|
|
856
|
+
*
|
|
857
|
+
* @category Toast
|
|
858
|
+
* @function
|
|
859
|
+
*/
|
|
860
|
+
async promise(e, t) {
|
|
861
|
+
const n = kt({
|
|
862
|
+
...Xt(t.loading, void 0),
|
|
863
|
+
timeout: 0,
|
|
864
|
+
priority: !0
|
|
865
|
+
});
|
|
866
|
+
return e.then(
|
|
867
|
+
(o) => {
|
|
868
|
+
const i = Xt(t.success, o);
|
|
869
|
+
return mt.update(n, {
|
|
870
|
+
timeout: void 0,
|
|
871
|
+
...i
|
|
872
|
+
}), o;
|
|
873
|
+
},
|
|
874
|
+
(o) => {
|
|
875
|
+
const i = Xt(t.error, o);
|
|
876
|
+
throw mt.update(n, {
|
|
877
|
+
timeout: void 0,
|
|
878
|
+
...i
|
|
879
|
+
}), o;
|
|
880
|
+
}
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
}), xt = (e) => (
|
|
884
|
+
// eslint-disable-next-line sonarjs/pseudo-random
|
|
885
|
+
`${e}_${Math.floor((1 + Math.random()) * 65536).toString(16).substring(1)}`
|
|
886
|
+
);
|
|
887
|
+
function E(e) {
|
|
888
|
+
const t = { ...e || {} };
|
|
889
|
+
function n(f, c) {
|
|
890
|
+
t[f] = c;
|
|
891
|
+
}
|
|
892
|
+
const o = (f) => `var(--uui-color-${f.replace(/[A-Z]/g, (c) => "-" + c.toLowerCase())})`, i = (f) => Object.assign(
|
|
893
|
+
(c) => {
|
|
894
|
+
c && f(o(c));
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
on(c) {
|
|
898
|
+
if (c) {
|
|
899
|
+
const h = en(c);
|
|
900
|
+
h !== void 0 && f(o(h));
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
container(c) {
|
|
904
|
+
c && f(o(`${c}Container`));
|
|
905
|
+
},
|
|
906
|
+
onContainer(c) {
|
|
907
|
+
c && f(o(`on${Ro(c)}Container`));
|
|
908
|
+
},
|
|
909
|
+
fixed(c) {
|
|
910
|
+
c && f(o(`${c}Fixed`));
|
|
911
|
+
},
|
|
912
|
+
fixedDim(c) {
|
|
913
|
+
c && f(o(`${c}FixedDim`));
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
), a = i((f) => {
|
|
917
|
+
n("backgroundColor", f);
|
|
918
|
+
}), s = i((f) => {
|
|
919
|
+
n("color", f);
|
|
920
|
+
}), d = i((f) => {
|
|
921
|
+
n("borderColor", f);
|
|
922
|
+
}), l = i((f) => {
|
|
923
|
+
n("outlineColor", f);
|
|
924
|
+
}), m = i((f) => {
|
|
925
|
+
n("--uui-current-color", f);
|
|
926
|
+
}), p = i((f) => {
|
|
927
|
+
n("stroke", f);
|
|
928
|
+
}), u = i((f) => {
|
|
929
|
+
n("fill", f);
|
|
930
|
+
});
|
|
931
|
+
return {
|
|
932
|
+
bg: a,
|
|
933
|
+
text: s,
|
|
934
|
+
border: d,
|
|
935
|
+
outline: l,
|
|
936
|
+
current: m,
|
|
937
|
+
stroke: p,
|
|
938
|
+
fill: u,
|
|
939
|
+
set: n,
|
|
940
|
+
get() {
|
|
941
|
+
return t;
|
|
942
|
+
},
|
|
943
|
+
merge(f) {
|
|
944
|
+
if (!f)
|
|
945
|
+
return;
|
|
946
|
+
const c = Object.fromEntries(Object.entries(f).filter(([h, g]) => g != null));
|
|
947
|
+
Object.assign(t, c);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
function Yo(e) {
|
|
952
|
+
const { m: t, mx: n, my: o, mt: i, mb: a, ml: s, mr: d, top: l, right: m, bottom: p, left: u, zIndex: f, position: c, ...h } = e;
|
|
953
|
+
return {
|
|
954
|
+
wrapperStyle: Object.fromEntries(Object.entries({
|
|
955
|
+
top: l,
|
|
956
|
+
right: m,
|
|
957
|
+
bottom: p,
|
|
958
|
+
left: u,
|
|
959
|
+
zIndex: f,
|
|
960
|
+
position: c,
|
|
961
|
+
margin: t,
|
|
962
|
+
marginTop: i ?? o,
|
|
963
|
+
marginBottom: a ?? o,
|
|
964
|
+
marginLeft: s ?? n,
|
|
965
|
+
marginRight: d ?? n
|
|
966
|
+
}).filter(([y, v]) => v != null)),
|
|
967
|
+
otherProps: h
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
const Xo = (e) => Ye.Children.toArray(e).flatMap((n) => ct(n) && n.type === Ye.Fragment ? Ye.Children.toArray(n.props.children) : [n]);
|
|
971
|
+
function Jo(e) {
|
|
972
|
+
if (typeof document > "u")
|
|
973
|
+
return null;
|
|
974
|
+
const t = document.getElementById(e);
|
|
975
|
+
if (t)
|
|
976
|
+
return t;
|
|
977
|
+
const n = document.createElement("div");
|
|
978
|
+
return n.id = e, document.body.appendChild(n), n;
|
|
979
|
+
}
|
|
980
|
+
function un(e, t) {
|
|
981
|
+
const n = Jo(e);
|
|
982
|
+
return n ? Io(t, n) : null;
|
|
983
|
+
}
|
|
984
|
+
const Me = S((e, t) => {
|
|
985
|
+
const {
|
|
986
|
+
type: n = "flex",
|
|
987
|
+
inline: o = !1,
|
|
988
|
+
color: i,
|
|
989
|
+
elevation: a,
|
|
990
|
+
shape: s,
|
|
991
|
+
border: d,
|
|
992
|
+
direction: l,
|
|
993
|
+
flow: m,
|
|
994
|
+
borderColor: p,
|
|
995
|
+
elementClass: u,
|
|
996
|
+
children: f,
|
|
997
|
+
className: c,
|
|
998
|
+
style: h,
|
|
999
|
+
font: g,
|
|
1000
|
+
fullHeight: C,
|
|
1001
|
+
fullWidth: y,
|
|
1002
|
+
grow: v,
|
|
1003
|
+
p: w,
|
|
1004
|
+
px: x,
|
|
1005
|
+
py: k,
|
|
1006
|
+
pt: B,
|
|
1007
|
+
pb: L,
|
|
1008
|
+
pl: M,
|
|
1009
|
+
pr: F,
|
|
1010
|
+
gap: D,
|
|
1011
|
+
gapX: N,
|
|
1012
|
+
gapY: H,
|
|
1013
|
+
justifyContent: G,
|
|
1014
|
+
alignItems: ee,
|
|
1015
|
+
placeItems: te,
|
|
1016
|
+
alignContent: ye,
|
|
1017
|
+
wrap: me,
|
|
1018
|
+
cols: be,
|
|
1019
|
+
rows: ae,
|
|
1020
|
+
component: j,
|
|
1021
|
+
row: Ce,
|
|
1022
|
+
col: ie,
|
|
1023
|
+
w: Ve,
|
|
1024
|
+
h: ne,
|
|
1025
|
+
...ke
|
|
1026
|
+
} = e, _ = j ?? "div", { wrapperStyle: W, otherProps: oe } = Yo(ke), ce = E(W);
|
|
1027
|
+
ce.merge(h);
|
|
1028
|
+
const Ie = {
|
|
1029
|
+
width: Ve ?? (y ? "100%" : void 0),
|
|
1030
|
+
height: ne ?? (C ? "100%" : void 0),
|
|
1031
|
+
padding: w,
|
|
1032
|
+
paddingTop: B ?? k,
|
|
1033
|
+
paddingBottom: L ?? k,
|
|
1034
|
+
paddingLeft: M ?? x,
|
|
1035
|
+
paddingRight: F ?? x,
|
|
1036
|
+
gap: D,
|
|
1037
|
+
columnGap: N,
|
|
1038
|
+
rowGap: H,
|
|
1039
|
+
justifyContent: G,
|
|
1040
|
+
alignItems: ee,
|
|
1041
|
+
placeItems: te,
|
|
1042
|
+
alignContent: ye,
|
|
1043
|
+
flexWrap: me && n === "flex" ? "wrap" : void 0,
|
|
1044
|
+
gridTemplateColumns: n === "grid" ? typeof be == "number" ? `repeat(${be}, 1fr)` : be : void 0,
|
|
1045
|
+
gridTemplateRows: n === "grid" ? typeof ae == "number" ? `repeat(${ae}, 1fr)` : ae : void 0
|
|
1046
|
+
};
|
|
1047
|
+
ce.merge(Ie), ce.border(p), ce.bg(i), ce.text.on(i);
|
|
1048
|
+
const K = Ce ? "row" : ie ? "col" : l, ve = je(
|
|
1049
|
+
c,
|
|
1050
|
+
"uui-box",
|
|
1051
|
+
u,
|
|
1052
|
+
g && Le(g),
|
|
1053
|
+
s && _e(s),
|
|
1054
|
+
a !== void 0 && at(a),
|
|
1055
|
+
d !== void 0 && it(d),
|
|
1056
|
+
v && "uui-grow",
|
|
1057
|
+
n === "flex" ? o ? "uui-flex-inline" : "uui-flex" : n === "grid" ? o ? "uui-grid-inline" : "uui-grid" : o ? "uui-inline-block" : "uui-block",
|
|
1058
|
+
K && n === "flex" && `uui-flex-${K}`,
|
|
1059
|
+
m && n === "grid" && `uui-grid-flow-${m === "col" ? "col" : "row"}`
|
|
1060
|
+
);
|
|
1061
|
+
return /* @__PURE__ */ r(_, { className: ve, ref: t, ...oe, style: ce.get(), children: f });
|
|
1062
|
+
});
|
|
1063
|
+
Me.displayName = "BoxBase";
|
|
1064
|
+
const It = ({ tooltip: e, align: t, triggerRef: n }) => {
|
|
1065
|
+
const [o, i] = q(!1), [a, s] = q(null), d = V(null);
|
|
1066
|
+
ge(() => {
|
|
1067
|
+
const p = n.current;
|
|
1068
|
+
if (!p)
|
|
1069
|
+
return;
|
|
1070
|
+
const u = () => {
|
|
1071
|
+
i(!0);
|
|
1072
|
+
}, f = () => {
|
|
1073
|
+
i(!1), s(null);
|
|
1074
|
+
}, c = (h) => {
|
|
1075
|
+
h.target.matches(":focus-visible") && i(!0);
|
|
1076
|
+
};
|
|
1077
|
+
return p.addEventListener("mouseenter", u), p.addEventListener("mouseleave", f), p.addEventListener("focus", c), p.addEventListener("blur", f), () => {
|
|
1078
|
+
p.removeEventListener("mouseenter", u), p.removeEventListener("mouseleave", f), p.removeEventListener("focus", c), p.removeEventListener("blur", f);
|
|
1079
|
+
};
|
|
1080
|
+
}, [n]), ge(() => {
|
|
1081
|
+
if (!o)
|
|
1082
|
+
return;
|
|
1083
|
+
const p = requestAnimationFrame(() => {
|
|
1084
|
+
if (!d.current || !n.current)
|
|
1085
|
+
return;
|
|
1086
|
+
const u = Un(n, d, {
|
|
1087
|
+
placement: t,
|
|
1088
|
+
offset: 8
|
|
1089
|
+
});
|
|
1090
|
+
u && s({ x: u.x, y: u.y });
|
|
1091
|
+
});
|
|
1092
|
+
return () => {
|
|
1093
|
+
cancelAnimationFrame(p);
|
|
1094
|
+
};
|
|
1095
|
+
}, [t, o, n]);
|
|
1096
|
+
const l = E({
|
|
1097
|
+
top: (a == null ? void 0 : a.y) ?? -9999,
|
|
1098
|
+
left: (a == null ? void 0 : a.x) ?? -9999,
|
|
1099
|
+
opacity: a ? 1 : 0,
|
|
1100
|
+
visibility: a && o ? "visible" : "hidden"
|
|
1101
|
+
}), m = ["uui-tooltip", "uui-font-body-small", "uui-elevation-2", "uui-corner-small"].join(" ");
|
|
1102
|
+
return un(
|
|
1103
|
+
"uui-tooltip-root",
|
|
1104
|
+
/* @__PURE__ */ r("div", { className: m, ref: d, role: "tooltip", style: l.get(), children: e })
|
|
1105
|
+
);
|
|
1106
|
+
};
|
|
1107
|
+
It.displayName = "InlineTooltipManager";
|
|
1108
|
+
const qn = ({ start: e, end: t, content: n, className: o }) => e ?? t ?? n ? /* @__PURE__ */ I("div", { className: `uui-slot ${o}`, children: [
|
|
1109
|
+
e,
|
|
1110
|
+
n,
|
|
1111
|
+
t
|
|
1112
|
+
] }) : null, dn = (e) => /* @__PURE__ */ r(qn, { ...e, className: "uui-leading" }), fn = (e) => /* @__PURE__ */ r(qn, { ...e, className: "uui-trailing" }), pn = S(
|
|
1113
|
+
({ control: e, label: t, description: n, className: o, textPlacement: i, spanDesc: a }, s) => /* @__PURE__ */ I(
|
|
1114
|
+
"div",
|
|
1115
|
+
{
|
|
1116
|
+
className: je(o, `uui-control-grid uui-control-grid-${t && (i === "start" || i === "end") ? i : "col"}`, a && "uui-spanned"),
|
|
1117
|
+
ref: s,
|
|
1118
|
+
children: [
|
|
1119
|
+
(i === "start" || i === "top") && t,
|
|
1120
|
+
e,
|
|
1121
|
+
(i === "end" || i === "bottom") && t,
|
|
1122
|
+
n
|
|
1123
|
+
]
|
|
1124
|
+
}
|
|
1125
|
+
)
|
|
1126
|
+
);
|
|
1127
|
+
pn.displayName = "ControlGrid";
|
|
1128
|
+
const Gn = ({
|
|
1129
|
+
label: e,
|
|
1130
|
+
htmlFor: t,
|
|
1131
|
+
id: n,
|
|
1132
|
+
required: o,
|
|
1133
|
+
font: i,
|
|
1134
|
+
focusRef: a,
|
|
1135
|
+
tag: s = "label"
|
|
1136
|
+
}) => {
|
|
1137
|
+
if (!e)
|
|
1138
|
+
return null;
|
|
1139
|
+
const d = je("uui-control-label", Le(i ?? "bodyMedium"));
|
|
1140
|
+
return /* @__PURE__ */ I(
|
|
1141
|
+
s,
|
|
1142
|
+
{
|
|
1143
|
+
className: d,
|
|
1144
|
+
id: n,
|
|
1145
|
+
...s === "label" ? { htmlFor: a ? void 0 : t } : {},
|
|
1146
|
+
onClick: a ? () => {
|
|
1147
|
+
var m;
|
|
1148
|
+
return (m = a.current) == null ? void 0 : m.focus();
|
|
1149
|
+
} : void 0,
|
|
1150
|
+
children: [
|
|
1151
|
+
e,
|
|
1152
|
+
o && /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "uui-required", children: "*" })
|
|
1153
|
+
]
|
|
1154
|
+
}
|
|
1155
|
+
);
|
|
1156
|
+
}, mn = ({ description: e, error: t, ...n }) => {
|
|
1157
|
+
const o = t ?? e;
|
|
1158
|
+
if (!o)
|
|
1159
|
+
return null;
|
|
1160
|
+
const i = je(
|
|
1161
|
+
"uui-support-text",
|
|
1162
|
+
Le("bodySmall"),
|
|
1163
|
+
!!t && "uui-error",
|
|
1164
|
+
!!e && !t && "uui-description"
|
|
1165
|
+
);
|
|
1166
|
+
return /* @__PURE__ */ r("div", { className: i, ...n, children: o });
|
|
1167
|
+
}, hn = ({ icon: e, className: t, color: n }) => {
|
|
1168
|
+
const o = E();
|
|
1169
|
+
return o.text(n), e ? /* @__PURE__ */ r("div", { className: je("uui-icon", t), style: o.get(), children: e }) : null;
|
|
1170
|
+
};
|
|
1171
|
+
hn.displayName = "Icon";
|
|
1172
|
+
function Qo({
|
|
1173
|
+
variant: e = "circular",
|
|
1174
|
+
inline: t,
|
|
1175
|
+
className: n
|
|
1176
|
+
}) {
|
|
1177
|
+
const o = [
|
|
1178
|
+
"uui-spinner",
|
|
1179
|
+
`uui-spinner-${e}`,
|
|
1180
|
+
t && "uui-spinner-inline",
|
|
1181
|
+
n
|
|
1182
|
+
].filter(Boolean).join(" ");
|
|
1183
|
+
return e === "circular" ? /* @__PURE__ */ r("svg", { "aria-hidden": "true", className: o, viewBox: "22 22 44 44", children: /* @__PURE__ */ r(
|
|
1184
|
+
"circle",
|
|
1185
|
+
{
|
|
1186
|
+
className: "uui-spinner-circle",
|
|
1187
|
+
cx: "44",
|
|
1188
|
+
cy: "44",
|
|
1189
|
+
fill: "none",
|
|
1190
|
+
r: "19.8",
|
|
1191
|
+
strokeWidth: "4.6"
|
|
1192
|
+
}
|
|
1193
|
+
) }) : e === "bars2" ? /* @__PURE__ */ I(
|
|
1194
|
+
"svg",
|
|
1195
|
+
{
|
|
1196
|
+
className: "uui-bars-spinner",
|
|
1197
|
+
viewBox: "0 0 48 48",
|
|
1198
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1199
|
+
children: [
|
|
1200
|
+
/* @__PURE__ */ r("rect", { height: "12", rx: "2", width: "4", x: "22" }),
|
|
1201
|
+
/* @__PURE__ */ r(
|
|
1202
|
+
"rect",
|
|
1203
|
+
{
|
|
1204
|
+
height: "12",
|
|
1205
|
+
rx: "2",
|
|
1206
|
+
transform: "rotate(-135 33.9 16.9)",
|
|
1207
|
+
width: "4",
|
|
1208
|
+
x: "33.9",
|
|
1209
|
+
y: "16.9"
|
|
1210
|
+
}
|
|
1211
|
+
),
|
|
1212
|
+
/* @__PURE__ */ r(
|
|
1213
|
+
"rect",
|
|
1214
|
+
{
|
|
1215
|
+
height: "12",
|
|
1216
|
+
rx: "2",
|
|
1217
|
+
transform: "rotate(-90 36 26)",
|
|
1218
|
+
width: "4",
|
|
1219
|
+
x: "36",
|
|
1220
|
+
y: "26"
|
|
1221
|
+
}
|
|
1222
|
+
),
|
|
1223
|
+
/* @__PURE__ */ r(
|
|
1224
|
+
"rect",
|
|
1225
|
+
{
|
|
1226
|
+
height: "12",
|
|
1227
|
+
rx: "2",
|
|
1228
|
+
transform: "rotate(-45 31.1 33.9)",
|
|
1229
|
+
width: "4",
|
|
1230
|
+
x: "31.1",
|
|
1231
|
+
y: "33.9"
|
|
1232
|
+
}
|
|
1233
|
+
),
|
|
1234
|
+
/* @__PURE__ */ r("rect", { height: "12", rx: "2", width: "4", x: "22", y: "36" }),
|
|
1235
|
+
/* @__PURE__ */ r(
|
|
1236
|
+
"rect",
|
|
1237
|
+
{
|
|
1238
|
+
height: "12",
|
|
1239
|
+
rx: "2",
|
|
1240
|
+
transform: "rotate(-135 8.4 42.4)",
|
|
1241
|
+
width: "4",
|
|
1242
|
+
x: "8.4",
|
|
1243
|
+
y: "42.4"
|
|
1244
|
+
}
|
|
1245
|
+
),
|
|
1246
|
+
/* @__PURE__ */ r(
|
|
1247
|
+
"rect",
|
|
1248
|
+
{
|
|
1249
|
+
height: "12",
|
|
1250
|
+
rx: "2",
|
|
1251
|
+
transform: "rotate(-90 0 26)",
|
|
1252
|
+
width: "4",
|
|
1253
|
+
y: "26"
|
|
1254
|
+
}
|
|
1255
|
+
),
|
|
1256
|
+
/* @__PURE__ */ r(
|
|
1257
|
+
"rect",
|
|
1258
|
+
{
|
|
1259
|
+
height: "12",
|
|
1260
|
+
rx: "2",
|
|
1261
|
+
transform: "rotate(-45 5.6 8.4)",
|
|
1262
|
+
width: "4",
|
|
1263
|
+
x: "5.6",
|
|
1264
|
+
y: "8.4"
|
|
1265
|
+
}
|
|
1266
|
+
)
|
|
1267
|
+
]
|
|
1268
|
+
}
|
|
1269
|
+
) : e === "orbit" ? /* @__PURE__ */ I(
|
|
1270
|
+
"svg",
|
|
1271
|
+
{
|
|
1272
|
+
className: "uui-orbit-spinner",
|
|
1273
|
+
viewBox: "0 0 48 48",
|
|
1274
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1275
|
+
children: [
|
|
1276
|
+
/* @__PURE__ */ r("circle", { cx: "24", cy: "4", r: "4" }),
|
|
1277
|
+
/* @__PURE__ */ r("circle", { cx: "38.1421", cy: "9.8579", r: "4" }),
|
|
1278
|
+
/* @__PURE__ */ r("circle", { cx: "44", cy: "24", r: "4" }),
|
|
1279
|
+
/* @__PURE__ */ r("circle", { cx: "38.1421", cy: "38.1421", r: "4" }),
|
|
1280
|
+
/* @__PURE__ */ r("circle", { cx: "24", cy: "44", r: "4" }),
|
|
1281
|
+
/* @__PURE__ */ r("circle", { cx: "9.8579", cy: "38.1421", r: "4" }),
|
|
1282
|
+
/* @__PURE__ */ r("circle", { cx: "4", cy: "24", r: "4" }),
|
|
1283
|
+
/* @__PURE__ */ r("circle", { cx: "9.8579", cy: "9.8579", r: "4" })
|
|
1284
|
+
]
|
|
1285
|
+
}
|
|
1286
|
+
) : e === "arc" ? /* @__PURE__ */ I(
|
|
1287
|
+
"svg",
|
|
1288
|
+
{
|
|
1289
|
+
className: "uui-ring-spinner",
|
|
1290
|
+
viewBox: "0 0 56 56",
|
|
1291
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1292
|
+
children: [
|
|
1293
|
+
/* @__PURE__ */ r(
|
|
1294
|
+
"circle",
|
|
1295
|
+
{
|
|
1296
|
+
cx: "28",
|
|
1297
|
+
cy: "28",
|
|
1298
|
+
fill: "none",
|
|
1299
|
+
opacity: "0.25",
|
|
1300
|
+
r: "22",
|
|
1301
|
+
stroke: "currentColor",
|
|
1302
|
+
strokeWidth: "8"
|
|
1303
|
+
}
|
|
1304
|
+
),
|
|
1305
|
+
/* @__PURE__ */ r(
|
|
1306
|
+
"circle",
|
|
1307
|
+
{
|
|
1308
|
+
cx: "28",
|
|
1309
|
+
cy: "28",
|
|
1310
|
+
fill: "none",
|
|
1311
|
+
r: "22",
|
|
1312
|
+
stroke: "currentColor",
|
|
1313
|
+
strokeDasharray: "69 69",
|
|
1314
|
+
strokeDashoffset: "0",
|
|
1315
|
+
strokeLinecap: "butt",
|
|
1316
|
+
strokeWidth: "8"
|
|
1317
|
+
}
|
|
1318
|
+
)
|
|
1319
|
+
]
|
|
1320
|
+
}
|
|
1321
|
+
) : e === "stepBar" ? /* @__PURE__ */ I("svg", { className: "uui-bars-steps", viewBox: "0 0 48 48", children: [
|
|
1322
|
+
/* @__PURE__ */ r("rect", { height: "8", rx: "4", width: "8", x: "6", y: "20" }),
|
|
1323
|
+
/* @__PURE__ */ r("rect", { height: "8", rx: "4", width: "8", x: "20", y: "20" }),
|
|
1324
|
+
/* @__PURE__ */ r("rect", { height: "8", rx: "4", width: "8", x: "34", y: "20" })
|
|
1325
|
+
] }) : /* @__PURE__ */ I(
|
|
1326
|
+
"svg",
|
|
1327
|
+
{
|
|
1328
|
+
className: "uui-dots2-spinner",
|
|
1329
|
+
viewBox: "0 0 48 48",
|
|
1330
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1331
|
+
children: [
|
|
1332
|
+
/* @__PURE__ */ r("circle", { cx: "10", cy: "24", r: "4" }),
|
|
1333
|
+
/* @__PURE__ */ r("circle", { cx: "24", cy: "24", r: "4" }),
|
|
1334
|
+
/* @__PURE__ */ r("circle", { cx: "38", cy: "24", r: "4" })
|
|
1335
|
+
]
|
|
1336
|
+
}
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1339
|
+
const Dt = S((e, t) => {
|
|
1340
|
+
const {
|
|
1341
|
+
color: n,
|
|
1342
|
+
selectedColor: o,
|
|
1343
|
+
className: i,
|
|
1344
|
+
label: a,
|
|
1345
|
+
title: s,
|
|
1346
|
+
type: d = "button",
|
|
1347
|
+
size: l = "small",
|
|
1348
|
+
border: m,
|
|
1349
|
+
borderColor: p,
|
|
1350
|
+
hoverEffects: u = ["overlay", "elevate"],
|
|
1351
|
+
pressedEffects: f = ["overlay", "elevate"],
|
|
1352
|
+
touchEffects: c = ["ripple"],
|
|
1353
|
+
selectedEffects: h = ["morph", "color"],
|
|
1354
|
+
focusEffects: g = ["ring", "overlay"],
|
|
1355
|
+
children: C,
|
|
1356
|
+
outlined: y = !1,
|
|
1357
|
+
filled: v = !1,
|
|
1358
|
+
tonal: w = !1,
|
|
1359
|
+
elevated: x = !1,
|
|
1360
|
+
flat: k = !1,
|
|
1361
|
+
elevation: B,
|
|
1362
|
+
disabled: L,
|
|
1363
|
+
textColor: M,
|
|
1364
|
+
selectedTextColor: F,
|
|
1365
|
+
shape: D = "round",
|
|
1366
|
+
selectedShape: N = "rounded",
|
|
1367
|
+
icon: H,
|
|
1368
|
+
selectedIcon: G,
|
|
1369
|
+
leading: ee,
|
|
1370
|
+
endIcon: te,
|
|
1371
|
+
trailing: ye,
|
|
1372
|
+
onClick: me,
|
|
1373
|
+
elementClass: be,
|
|
1374
|
+
font: ae = "labelLarge",
|
|
1375
|
+
upload: j,
|
|
1376
|
+
uploadAccept: Ce,
|
|
1377
|
+
uploadMultiple: ie,
|
|
1378
|
+
onUploadChange: Ve,
|
|
1379
|
+
id: ne = "",
|
|
1380
|
+
name: ke = "",
|
|
1381
|
+
loading: _,
|
|
1382
|
+
fullWidth: W = !1,
|
|
1383
|
+
link: oe,
|
|
1384
|
+
selected: ce,
|
|
1385
|
+
defaultSelected: Ie,
|
|
1386
|
+
toggle: K = !1,
|
|
1387
|
+
tooltipAlign: ve = "auto",
|
|
1388
|
+
density: Ee,
|
|
1389
|
+
style: Be,
|
|
1390
|
+
"aria-label": Y,
|
|
1391
|
+
...Z
|
|
1392
|
+
} = e, Te = ce !== void 0, [X, ue] = q(Ie ?? !1), xe = Te ? ce : X, de = V(null), U = V(null), Re = V(null), Pe = V(xt("button")), De = ne || ke || Pe.current, se = oe ? Ye.cloneElement(oe, { ref: U, style: { display: "none" } }) : null, P = [
|
|
1393
|
+
be,
|
|
1394
|
+
i,
|
|
1395
|
+
"uui-bb",
|
|
1396
|
+
ut(Ee),
|
|
1397
|
+
...W ? ["uui-w-full"] : []
|
|
1398
|
+
].filter(Boolean).join(" "), we = [
|
|
1399
|
+
"uui-btn-control",
|
|
1400
|
+
Le(ae),
|
|
1401
|
+
...v ? ["uui-filled"] : [],
|
|
1402
|
+
...x ? ["uui-elevated"] : [],
|
|
1403
|
+
...w ? ["uui-tonal"] : [],
|
|
1404
|
+
...y ? ["uui-outlined"] : [],
|
|
1405
|
+
...g.includes("ring") ? ["uui-focus-ring"] : [],
|
|
1406
|
+
...g.includes("overlay") ? ["uui-focus-overlay"] : [],
|
|
1407
|
+
...u.includes("overlay") ? ["uui-hover-overlay"] : [],
|
|
1408
|
+
...f.includes("overlay") ? ["uui-pressed-overlay"] : [],
|
|
1409
|
+
...h.includes("overlay") ? ["uui-selected-overlay"] : [],
|
|
1410
|
+
..._ ? ["uui-loading"] : [],
|
|
1411
|
+
...W ? ["uui-w-full"] : [],
|
|
1412
|
+
...C ? [] : [gt(l)],
|
|
1413
|
+
...xe ? ["uui-selected"] : []
|
|
1414
|
+
], re = ["uui-state"], Se = K && xe && h.includes("morph") ? _e(N) : _e(D);
|
|
1415
|
+
we.push(Se), re.push(Se);
|
|
1416
|
+
const he = "uui-icon", J = K && xe ? G ?? ee ?? H : ee ?? H, fe = _ ? /* @__PURE__ */ r("div", { className: he, children: /* @__PURE__ */ r(Qo, {}) }) : J && /* @__PURE__ */ r("div", { className: he, children: J }), Oe = (ye ?? te) && /* @__PURE__ */ r("div", { className: he, children: ye ?? te });
|
|
1417
|
+
let Ne;
|
|
1418
|
+
if (C) {
|
|
1419
|
+
const Q = ["uui-btn-content uui-overflow-hidden", Se, Le(ae)].filter(Boolean).join(" ");
|
|
1420
|
+
Ne = /* @__PURE__ */ r("div", { className: Q, children: C });
|
|
1421
|
+
} else
|
|
1422
|
+
Ne = /* @__PURE__ */ I("div", { className: "uui-btn-content", children: [
|
|
1423
|
+
fe,
|
|
1424
|
+
a && /* @__PURE__ */ r("span", { className: "uui-label " + Le(ae), children: a }),
|
|
1425
|
+
Oe
|
|
1426
|
+
] });
|
|
1427
|
+
const $ = E(Be), R = E();
|
|
1428
|
+
if (y || m !== void 0) {
|
|
1429
|
+
$.border(zt(p));
|
|
1430
|
+
const He = it(m ?? (y ? 1 : 0));
|
|
1431
|
+
we.push(He);
|
|
1432
|
+
}
|
|
1433
|
+
let Ae = B;
|
|
1434
|
+
B === void 0 && (w || v ? k || (Ae = x ? 1 : 0) : x && (Ae = 1));
|
|
1435
|
+
const O = [
|
|
1436
|
+
...u.includes("elevate") && !k ? ["uui-hover-elevate"] : [],
|
|
1437
|
+
...f.includes("elevate") && !k ? ["uui-pressed-elevate"] : []
|
|
1438
|
+
];
|
|
1439
|
+
we.push(...O, at(Ae));
|
|
1440
|
+
const Ke = () => {
|
|
1441
|
+
v ? ($.bg(n ?? "primary"), R.bg.on(n ?? "primary"), M ? $.text(M) : $.text.on(n ?? "primary")) : w ? ($.bg.container("secondary"), R.bg.onContainer("secondary"), M ? $.text(M) : $.text.onContainer("secondary")) : x ? ($.bg("surfaceContainerLow"), $.text(M ?? n ?? "primary"), R.bg(n ?? "primary")) : y && !M ? ($.text.on("surfaceVariant"), R.bg.on("surfaceVariant")) : ($.text(M ?? n), R.bg(M ?? n));
|
|
1442
|
+
}, ze = () => {
|
|
1443
|
+
n ? ($.bg(n), R.bg.on(n), $.text.on(n)) : v ? ($.bg("surfaceContainer"), R.bg.on("surfaceContainer"), $.text.on("surfaceVariant")) : x ? ($.bg("surfaceContainerLow"), R.bg.on("surfaceContainerLow"), $.text("primary")) : w ? ($.bg.container("secondary"), R.bg("secondary"), $.text.onContainer("secondary")) : y && !M ? ($.text.on("surfaceVariant"), R.bg.on("surfaceVariant")) : ($.text(M ?? n ?? "primary"), R.bg(M ?? n ?? "primary")), M && $.text(M);
|
|
1444
|
+
}, Ue = () => {
|
|
1445
|
+
const Q = o ?? n ?? "primary";
|
|
1446
|
+
w && !o ? ($.bg("secondary"), R.bg.on("secondary"), F ? $.text(F) : $.text.on("secondary")) : y && !o ? ($.bg("inverseSurface"), R.bg.on("inverseSurface"), F ? $.text(F) : $.text.on("inverseSurface")) : ($.bg(Q), R.bg.on(Q), F ? $.text(F) : $.text.on(Q));
|
|
1447
|
+
};
|
|
1448
|
+
K && h.includes("color") ? xe ? Ue() : ze() : Ke();
|
|
1449
|
+
const Je = (Q) => {
|
|
1450
|
+
var He;
|
|
1451
|
+
if (!L) {
|
|
1452
|
+
if (K) {
|
|
1453
|
+
const Xe = !xe;
|
|
1454
|
+
Te || ue(Xe), (He = e.onChange) == null || He.call(e, {
|
|
1455
|
+
...Q,
|
|
1456
|
+
target: {
|
|
1457
|
+
...Q.target,
|
|
1458
|
+
name: ke,
|
|
1459
|
+
value: Xe
|
|
1460
|
+
}
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
if (U.current) {
|
|
1464
|
+
U.current.click();
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
if (j && de.current) {
|
|
1468
|
+
de.current.click();
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1471
|
+
me && me(Q), c.includes("ripple") && Lt(Q.currentTarget, Q);
|
|
1472
|
+
}
|
|
1473
|
+
}, Qe = s ? /* @__PURE__ */ r("div", { id: `${De}-tip`, children: s }) : null;
|
|
1474
|
+
let z;
|
|
1475
|
+
a && C && (z = a), !a && !C && (z = s);
|
|
1476
|
+
const pe = Y ?? z;
|
|
1477
|
+
return /* @__PURE__ */ I("div", { className: P, children: [
|
|
1478
|
+
j && /* @__PURE__ */ r(
|
|
1479
|
+
"input",
|
|
1480
|
+
{
|
|
1481
|
+
accept: Ce,
|
|
1482
|
+
"aria-labelledby": De,
|
|
1483
|
+
multiple: ie,
|
|
1484
|
+
onChange: Ve,
|
|
1485
|
+
ref: de,
|
|
1486
|
+
style: { display: "none" },
|
|
1487
|
+
type: "file"
|
|
1488
|
+
}
|
|
1489
|
+
),
|
|
1490
|
+
/* @__PURE__ */ I(
|
|
1491
|
+
"button",
|
|
1492
|
+
{
|
|
1493
|
+
"aria-busy": _,
|
|
1494
|
+
"aria-describedby": s ? `${De}-tip` : void 0,
|
|
1495
|
+
"aria-haspopup": j ? "dialog" : void 0,
|
|
1496
|
+
"aria-label": pe,
|
|
1497
|
+
"aria-pressed": K ? xe : void 0,
|
|
1498
|
+
className: we.join(" "),
|
|
1499
|
+
disabled: L,
|
|
1500
|
+
id: De,
|
|
1501
|
+
name: ke || void 0,
|
|
1502
|
+
onClick: Je,
|
|
1503
|
+
ref: yt(t, Re),
|
|
1504
|
+
style: $.get(),
|
|
1505
|
+
type: d,
|
|
1506
|
+
...Z,
|
|
1507
|
+
children: [
|
|
1508
|
+
/* @__PURE__ */ r("div", { className: re.join(" "), style: R.get() }),
|
|
1509
|
+
Ne
|
|
1510
|
+
]
|
|
1511
|
+
}
|
|
1512
|
+
),
|
|
1513
|
+
se,
|
|
1514
|
+
Qe && /* @__PURE__ */ r(It, { align: ve, tooltip: Qe, triggerRef: Re })
|
|
1515
|
+
] });
|
|
1516
|
+
});
|
|
1517
|
+
Dt.displayName = "ButtonBase";
|
|
1518
|
+
const gn = S((e, t) => {
|
|
1519
|
+
const {
|
|
1520
|
+
elementClass: n,
|
|
1521
|
+
density: o,
|
|
1522
|
+
icon: i,
|
|
1523
|
+
disabled: a,
|
|
1524
|
+
elevation: s,
|
|
1525
|
+
checked: d,
|
|
1526
|
+
children: l,
|
|
1527
|
+
color: m,
|
|
1528
|
+
uncheckedColor: p,
|
|
1529
|
+
defaultChecked: u,
|
|
1530
|
+
indeterminate: f,
|
|
1531
|
+
hoverEffects: c = ["overlay"],
|
|
1532
|
+
touchEffects: h = ["ripple"],
|
|
1533
|
+
focusEffects: g = ["ring"],
|
|
1534
|
+
selectedEffects: C = [],
|
|
1535
|
+
pressedEffects: y = ["overlay"],
|
|
1536
|
+
id: v,
|
|
1537
|
+
name: w,
|
|
1538
|
+
label: x,
|
|
1539
|
+
font: k,
|
|
1540
|
+
border: B,
|
|
1541
|
+
borderColor: L,
|
|
1542
|
+
uncheckedBorder: M,
|
|
1543
|
+
uncheckedBorderColor: F,
|
|
1544
|
+
onChange: D,
|
|
1545
|
+
onFocus: N,
|
|
1546
|
+
onBlur: H,
|
|
1547
|
+
onClick: G,
|
|
1548
|
+
type: ee,
|
|
1549
|
+
required: te,
|
|
1550
|
+
shape: ye = "smooth",
|
|
1551
|
+
title: me,
|
|
1552
|
+
filled: be,
|
|
1553
|
+
value: ae,
|
|
1554
|
+
size: j = "small",
|
|
1555
|
+
uncheckedIcon: Ce,
|
|
1556
|
+
indeterminateIcon: ie,
|
|
1557
|
+
description: Ve,
|
|
1558
|
+
descriptionColor: ne,
|
|
1559
|
+
descriptionFont: ke,
|
|
1560
|
+
className: _,
|
|
1561
|
+
error: W,
|
|
1562
|
+
animation: oe,
|
|
1563
|
+
duration: ce = 150,
|
|
1564
|
+
motionStyle: Ie = "regular",
|
|
1565
|
+
focusColor: K,
|
|
1566
|
+
labelColor: ve,
|
|
1567
|
+
textColor: Ee,
|
|
1568
|
+
readOnly: Be,
|
|
1569
|
+
tooltipAlign: Y = "auto",
|
|
1570
|
+
textPlacement: Z = "end",
|
|
1571
|
+
"aria-label": Te,
|
|
1572
|
+
...X
|
|
1573
|
+
} = e, { animationVars: ue, animate: xe, animating: de } = rn({
|
|
1574
|
+
t1: ce,
|
|
1575
|
+
oneShot: !0
|
|
1576
|
+
}), U = Ft(zn), Re = ee === "radio" ? w ?? (U == null ? void 0 : U.name) : w, Pe = Ft(sn), De = a ?? (Pe == null ? void 0 : Pe.disabled), { focusVisible: se, isFocused: P, focusHandlers: we } = Bt(N, H), re = V(null), Se = V(null), he = V(null), J = V(xt("check")), fe = v ?? J.current, Oe = d !== void 0, [Ne, $] = q(u ?? !1);
|
|
1577
|
+
let R;
|
|
1578
|
+
Oe ? R = !!d : (U == null ? void 0 : U.value) !== void 0 ? R = U.value === ae : R = Ne;
|
|
1579
|
+
const Ae = f ? "indeterminate" : R ? "checked" : "unchecked", [O, Ke] = q(Ae), ze = Te ?? (x ? void 0 : me), Ue = W ? "error" : !R && !f && p ? p : m, Je = me ? /* @__PURE__ */ r("div", { id: `${fe}-tip`, children: me }) : null, Qe = (qe) => {
|
|
1580
|
+
if (Be) {
|
|
1581
|
+
qe.preventDefault();
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
const jt = qe.currentTarget;
|
|
1585
|
+
Oe || (ee === "radio" && (U != null && U.setValue) && U.setValue(jt.value), $(jt.checked)), D == null || D(qe);
|
|
1586
|
+
}, z = (qe) => {
|
|
1587
|
+
if (Be) {
|
|
1588
|
+
qe.preventDefault();
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
h.includes("ripple") && he.current && Se.current && Lt(he.current, qe, Se.current), G == null || G(qe);
|
|
1592
|
+
};
|
|
1593
|
+
ge(() => {
|
|
1594
|
+
Ae !== O && oe && xe();
|
|
1595
|
+
}, [Ae, O, oe, xe]), ge(() => {
|
|
1596
|
+
de || Ke(Ae);
|
|
1597
|
+
}, [de, Ae]);
|
|
1598
|
+
const pe = E(), Q = [
|
|
1599
|
+
n,
|
|
1600
|
+
"uui-cb",
|
|
1601
|
+
ut(o),
|
|
1602
|
+
_,
|
|
1603
|
+
De && "uui-disabled",
|
|
1604
|
+
...l ? [] : [gt(j)]
|
|
1605
|
+
].filter(Boolean).join(" "), He = [
|
|
1606
|
+
"uui-cb-control",
|
|
1607
|
+
R && "uui-checked",
|
|
1608
|
+
f && "uui-indeterminate",
|
|
1609
|
+
be && "uui-filled",
|
|
1610
|
+
...c.includes("overlay") && !Be ? ["uui-hover-overlay"] : [],
|
|
1611
|
+
...g.includes("overlay") && se && P ? ["uui-focus-overlay"] : [],
|
|
1612
|
+
...C.includes("overlay") ? ["uui-selected-overlay"] : [],
|
|
1613
|
+
...y.includes("overlay") && !Be ? ["uui-pressed-overlay"] : [],
|
|
1614
|
+
...l ? [_e(ye)] : ["uui-round"]
|
|
1615
|
+
].filter(Boolean).join(" "), Xe = E();
|
|
1616
|
+
K && se && P && Xe.set("--uui-focus-color", Hn(K).color);
|
|
1617
|
+
const $t = [
|
|
1618
|
+
"uui-input",
|
|
1619
|
+
g.includes("ring") && se && P && "uui-focus-visible uui-focus-ring"
|
|
1620
|
+
].filter(Boolean).join(" "), We = ["uui-state"].filter(Boolean).join(" "), Mt = E();
|
|
1621
|
+
Mt.bg(Ue);
|
|
1622
|
+
const Ze = [
|
|
1623
|
+
"uui-cb-glyph",
|
|
1624
|
+
at(s),
|
|
1625
|
+
_e(ye),
|
|
1626
|
+
it(R ? B : M)
|
|
1627
|
+
].filter(Boolean).join(" "), le = E(), ft = an(oe), Et = ["uui-icon", de && ft, cn(Ie)].filter(Boolean).join(" "), et = E();
|
|
1628
|
+
et.merge(ue), R || f || p ? (le.border(W ? "error" : L), be ? (!R && !Ce && !f || le.bg(Ue), et.text.on(Ue)) : et.text(Ue)) : (be && Ce ? (et.text(W ? "onError" : "surface"), le.bg(W ? "error" : "onSurfaceVariant")) : Ce && et.text(W ? "error" : "onSurfaceVariant"), le.border(W ? "error" : F));
|
|
1629
|
+
let wt;
|
|
1630
|
+
if (l) {
|
|
1631
|
+
const qe = ["uui-cb-content uui-overflow-hidden", _e(ye), it(B)].filter(Boolean).join(" ");
|
|
1632
|
+
wt = /* @__PURE__ */ r("div", { className: qe, children: l });
|
|
1633
|
+
} else {
|
|
1634
|
+
const qe = O === "indeterminate" ? ie : O === "checked" ? i : Ce;
|
|
1635
|
+
wt = /* @__PURE__ */ r("div", { className: Ze, style: le.get(), children: /* @__PURE__ */ r("div", { className: Et, style: et.get(), children: qe }) });
|
|
1636
|
+
}
|
|
1637
|
+
const bt = E();
|
|
1638
|
+
bt.text((W ? "error" : void 0) ?? ve ?? Ee ?? "onSurface");
|
|
1639
|
+
const At = [Le(k ?? "bodyMedium"), "uui-cb-label"].join(" "), st = x && /* @__PURE__ */ I("label", { className: At, htmlFor: fe, style: bt.get(), children: [
|
|
1640
|
+
x,
|
|
1641
|
+
te && /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "uui-required", children: "*" })
|
|
1642
|
+
] }), ot = E(), vt = E();
|
|
1643
|
+
Z === "end" ? (bt.set("gridColumn", 2), ot.set("gridColumn", 2), vt.set("gridColumn", 1)) : Z === "start" ? (bt.set("gridColumn", 1), ot.set("gridColumn", 1), vt.set("gridColumn", 2), vt.set("gridRow", 1)) : (pe.set("gridTemplateColumns", "1fr"), pe.set("justifyItems", "start")), Z === "top" && (vt.set("order", 1), ot.set("order", 2));
|
|
1644
|
+
const Tt = /* @__PURE__ */ r(mn, { description: Ve, error: W, style: ot.get() }), qt = (st ?? Tt) && /* @__PURE__ */ I(rt, { children: [
|
|
1645
|
+
st,
|
|
1646
|
+
Tt
|
|
1647
|
+
] });
|
|
1648
|
+
return /* @__PURE__ */ I("div", { className: Q, style: pe.get(), children: [
|
|
1649
|
+
/* @__PURE__ */ r("div", { className: "uui-cb-control-wrapper", style: vt.get(), children: /* @__PURE__ */ I("div", { className: He, ref: Se, style: Xe.get(), children: [
|
|
1650
|
+
/* @__PURE__ */ r(
|
|
1651
|
+
"input",
|
|
1652
|
+
{
|
|
1653
|
+
...we,
|
|
1654
|
+
"aria-label": ze,
|
|
1655
|
+
"aria-readonly": Be === !0 ? !0 : void 0,
|
|
1656
|
+
checked: !!R,
|
|
1657
|
+
className: $t,
|
|
1658
|
+
disabled: De,
|
|
1659
|
+
id: fe,
|
|
1660
|
+
name: Re,
|
|
1661
|
+
onChange: Qe,
|
|
1662
|
+
onClick: z,
|
|
1663
|
+
readOnly: Be,
|
|
1664
|
+
ref: yt(re, t),
|
|
1665
|
+
type: ee,
|
|
1666
|
+
value: ae,
|
|
1667
|
+
...X
|
|
1668
|
+
}
|
|
1669
|
+
),
|
|
1670
|
+
/* @__PURE__ */ r("div", { className: We, ref: he, style: Mt.get() }),
|
|
1671
|
+
wt
|
|
1672
|
+
] }) }),
|
|
1673
|
+
qt,
|
|
1674
|
+
Je && /* @__PURE__ */ r(It, { align: Y, tooltip: Je, triggerRef: re })
|
|
1675
|
+
] });
|
|
1676
|
+
});
|
|
1677
|
+
gn.displayName = "CheckBoxBase";
|
|
1678
|
+
const er = S((e, t) => /* @__PURE__ */ r(Zt, { ref: t, ...e, elementClass: "uui-dialog" }));
|
|
1679
|
+
er.displayName = "Dialog";
|
|
1680
|
+
const Yn = Symbol.for("uui.dialogAction");
|
|
1681
|
+
function tr(e) {
|
|
1682
|
+
return ct(e) && typeof e.type != "string" && !!e.type[Yn];
|
|
1683
|
+
}
|
|
1684
|
+
const yn = ({
|
|
1685
|
+
actions: e,
|
|
1686
|
+
className: t,
|
|
1687
|
+
placement: n,
|
|
1688
|
+
align: o,
|
|
1689
|
+
stack: i,
|
|
1690
|
+
maxActions: a,
|
|
1691
|
+
moreLabel: s
|
|
1692
|
+
}) => {
|
|
1693
|
+
const d = Xo(e).filter(tr), l = E(), m = je(
|
|
1694
|
+
"uui-dialog-actions",
|
|
1695
|
+
n && `uui-actions-${n}`,
|
|
1696
|
+
o && o !== "end" && `uui-actions-${o}`,
|
|
1697
|
+
i && "uui-actions-stack",
|
|
1698
|
+
t
|
|
1699
|
+
);
|
|
1700
|
+
return d.length ? /* @__PURE__ */ r("div", { className: m, style: l.get(), children: d }) : null;
|
|
1701
|
+
};
|
|
1702
|
+
yn.displayName = "DialogActions";
|
|
1703
|
+
const Xn = ({ children: e, iconSlot: t, icon: n, showIcon: o, iconColor: i, className: a }) => {
|
|
1704
|
+
const s = je("uui-dialog-content", a);
|
|
1705
|
+
return e ? /* @__PURE__ */ I("div", { className: s, children: [
|
|
1706
|
+
o !== !1 && n && (t === "contentLeft" || t === "contentRight") && /* @__PURE__ */ r(hn, { className: `uui-icon-${t}`, color: i, icon: n }),
|
|
1707
|
+
/* @__PURE__ */ r("div", { className: "uui-content", children: e })
|
|
1708
|
+
] }) : null;
|
|
1709
|
+
};
|
|
1710
|
+
Xn.displayName = "DialogContent";
|
|
1711
|
+
const Jn = ({
|
|
1712
|
+
label: e,
|
|
1713
|
+
icon: t,
|
|
1714
|
+
iconSlot: n,
|
|
1715
|
+
className: o,
|
|
1716
|
+
iconColor: i,
|
|
1717
|
+
showIcon: a,
|
|
1718
|
+
align: s = "start",
|
|
1719
|
+
font: d = "headlineSmall"
|
|
1720
|
+
}) => {
|
|
1721
|
+
const l = a !== !1 && t && (n === "top" || n === "leading");
|
|
1722
|
+
return e || l ? /* @__PURE__ */ I("div", { className: je("uui-dialog-title", `uui-title-${n}`, o, Le(d)), children: [
|
|
1723
|
+
l && /* @__PURE__ */ r(hn, { className: `uui-icon-${n}`, color: i, icon: t }),
|
|
1724
|
+
e && /* @__PURE__ */ r("div", { className: `uui-title uui-title-${s}`, children: e })
|
|
1725
|
+
] }) : null;
|
|
1726
|
+
};
|
|
1727
|
+
Jn.displayName = "DialogTitle";
|
|
1728
|
+
const Qn = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M10 17V7L15 12L10 17Z" }) }), nr = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z" }) }), or = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M7.825 13L13.425 18.6L12 20L4 12L12 4L13.425 5.4L7.825 11H20V13H7.825Z" }) }), rr = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "3 3 18 18", children: /* @__PURE__ */ r("path", { d: "M10 16.4L6 12.4L7.4 11L10 13.6L16.6 7L18 8.4L10 16.4Z" }) }), ir = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "3 3 18 18", children: /* @__PURE__ */ r("path", { d: "M6 13V11H18V13H6Z" }) }), sr = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "2 2 20 20", children: /* @__PURE__ */ r("path", { d: "M12 17C13.3833 17 14.5625 16.5125 15.5375 15.5375C16.5125 14.5625 17 13.3833 17 12C17 10.6167 16.5125 9.4375 15.5375 8.4625C14.5625 7.4875 13.3833 7 12 7C10.6167 7 9.4375 7.4875 8.4625 8.4625C7.4875 9.4375 7 10.6167 7 12C7 13.3833 7.4875 14.5625 8.4625 15.5375C9.4375 16.5125 10.6167 17 12 17Z" }) }), lr = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M9.5501 18L3.8501 12.3L5.2751 10.875L9.5501 15.15L18.7251 5.97498L20.1501 7.39998L9.5501 18Z" }) }), ar = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M9.5501 18L3.8501 12.3L5.2751 10.875L9.5501 15.15L18.7251 5.97498L20.1501 7.39998L9.5501 18Z" }) }), eo = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M12 17C13.3833 17 14.5625 16.5125 15.5375 15.5375C16.5125 14.5625 17 13.3833 17 12C17 10.6167 16.5125 9.4375 15.5375 8.4625C14.5625 7.4875 13.3833 7 12 7C10.6167 7 9.4375 7.4875 8.4625 8.4625C7.4875 9.4375 7 10.6167 7 12C7 13.3833 7.4875 14.5625 8.4625 15.5375C9.4375 16.5125 10.6167 17 12 17ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z" }) }), to = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z" }) }), cr = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M12 15.0833L7 10.0833L8.16667 8.91663L12 12.7499L15.8333 8.91663L17 10.0833L12 15.0833Z" }) }), ur = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M8.85 16.825L12 14.925L15.15 16.85L14.325 13.25L17.1 10.85L13.45 10.525L12 7.125L10.55 10.5L6.9 10.825L9.675 13.25L8.85 16.825ZM5.825 21L7.45 13.975L2 9.25L9.2 8.625L12 2L14.8 8.625L22 9.25L16.55 13.975L18.175 21L12 17.275L5.825 21Z" }) }), dr = /* @__PURE__ */ r("svg", { fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { d: "M5.825 21L7.45 13.975L2 9.25L9.2 8.625L12 2L14.8 8.625L22 9.25L16.55 13.975L18.175 21L12 17.275L5.825 21Z" }) }), Ht = S(
|
|
1729
|
+
({
|
|
1730
|
+
"aria-label": e,
|
|
1731
|
+
endIcon: t,
|
|
1732
|
+
trailing: n,
|
|
1733
|
+
loading: o,
|
|
1734
|
+
size: i = "small",
|
|
1735
|
+
shape: a = "round",
|
|
1736
|
+
label: s,
|
|
1737
|
+
title: d,
|
|
1738
|
+
children: l,
|
|
1739
|
+
...m
|
|
1740
|
+
}, p) => /* @__PURE__ */ r(
|
|
1741
|
+
Dt,
|
|
1742
|
+
{
|
|
1743
|
+
ref: p,
|
|
1744
|
+
...m,
|
|
1745
|
+
"aria-label": e ?? s,
|
|
1746
|
+
elementClass: "uui-icon-button",
|
|
1747
|
+
loading: o,
|
|
1748
|
+
shape: a,
|
|
1749
|
+
size: i,
|
|
1750
|
+
title: d,
|
|
1751
|
+
children: !o && l
|
|
1752
|
+
}
|
|
1753
|
+
)
|
|
1754
|
+
);
|
|
1755
|
+
Ht.displayName = "IconButton";
|
|
1756
|
+
const no = ({
|
|
1757
|
+
leading: e,
|
|
1758
|
+
showBack: t,
|
|
1759
|
+
onBack: n,
|
|
1760
|
+
backIcon: o,
|
|
1761
|
+
icon: i,
|
|
1762
|
+
showIcon: a,
|
|
1763
|
+
iconColor: s,
|
|
1764
|
+
iconSlot: d,
|
|
1765
|
+
titleAlign: l,
|
|
1766
|
+
label: m,
|
|
1767
|
+
actions: p,
|
|
1768
|
+
actionsAlign: u,
|
|
1769
|
+
actionsStack: f,
|
|
1770
|
+
maxActions: c,
|
|
1771
|
+
moreLabel: h,
|
|
1772
|
+
moreIcon: g,
|
|
1773
|
+
trailing: C,
|
|
1774
|
+
showClose: y,
|
|
1775
|
+
onClose: v,
|
|
1776
|
+
closeIcon: w,
|
|
1777
|
+
font: x
|
|
1778
|
+
}) => {
|
|
1779
|
+
const k = n ?? v, B = o ?? or, L = w ?? nr, M = t && /* @__PURE__ */ r(Ht, { icon: B, onClick: k }), F = y && /* @__PURE__ */ r(Ht, { icon: L, onClick: v });
|
|
1780
|
+
return /* @__PURE__ */ I("div", { className: je("uui-dialog-header"), children: [
|
|
1781
|
+
/* @__PURE__ */ r(dn, { content: e, start: M }),
|
|
1782
|
+
/* @__PURE__ */ r(
|
|
1783
|
+
Jn,
|
|
1784
|
+
{
|
|
1785
|
+
align: l,
|
|
1786
|
+
font: x,
|
|
1787
|
+
icon: i,
|
|
1788
|
+
iconColor: s,
|
|
1789
|
+
iconSlot: d,
|
|
1790
|
+
label: m,
|
|
1791
|
+
showIcon: a
|
|
1792
|
+
}
|
|
1793
|
+
),
|
|
1794
|
+
/* @__PURE__ */ r(
|
|
1795
|
+
yn,
|
|
1796
|
+
{
|
|
1797
|
+
actions: p,
|
|
1798
|
+
align: u,
|
|
1799
|
+
maxActions: c,
|
|
1800
|
+
moreIcon: g,
|
|
1801
|
+
moreLabel: h,
|
|
1802
|
+
placement: "inline",
|
|
1803
|
+
stack: f
|
|
1804
|
+
}
|
|
1805
|
+
),
|
|
1806
|
+
/* @__PURE__ */ r(fn, { content: C, end: F })
|
|
1807
|
+
] });
|
|
1808
|
+
};
|
|
1809
|
+
no.displayName = "DialogHeader";
|
|
1810
|
+
const fr = S((e, t) => /* @__PURE__ */ r(Zt, { ref: t, ...e, elementClass: "uui-drawer", type: "dockRight" }));
|
|
1811
|
+
fr.displayName = "Drawer";
|
|
1812
|
+
const pr = S((e, t) => /* @__PURE__ */ r(Zt, { ref: t, ...e, elementClass: "uui-bottom-sheet", type: "dockBottom" }));
|
|
1813
|
+
pr.displayName = "BottomSheet";
|
|
1814
|
+
const mr = {
|
|
1815
|
+
basic: "scale",
|
|
1816
|
+
fullscreen: "fade",
|
|
1817
|
+
dockBottom: "slideUp",
|
|
1818
|
+
dockTop: "slideDown",
|
|
1819
|
+
dockRight: "slideRight",
|
|
1820
|
+
dockLeft: "slideLeft"
|
|
1821
|
+
}, hr = (e, t) => t === "none" ? void 0 : t ?? mr[e], Zt = S(
|
|
1822
|
+
({
|
|
1823
|
+
open: e,
|
|
1824
|
+
onClose: t,
|
|
1825
|
+
type: n = "basic",
|
|
1826
|
+
color: o,
|
|
1827
|
+
elevation: i,
|
|
1828
|
+
shape: a,
|
|
1829
|
+
fullWidth: s,
|
|
1830
|
+
fullHeight: d,
|
|
1831
|
+
size: l,
|
|
1832
|
+
animation: m,
|
|
1833
|
+
fit: p,
|
|
1834
|
+
detached: u,
|
|
1835
|
+
duration: f = 500,
|
|
1836
|
+
closeOnBackdrop: c = !0,
|
|
1837
|
+
closeOnEsc: h = !0,
|
|
1838
|
+
children: g,
|
|
1839
|
+
label: C,
|
|
1840
|
+
icon: y,
|
|
1841
|
+
showIcon: v,
|
|
1842
|
+
iconColor: w,
|
|
1843
|
+
iconSlot: x = "leading",
|
|
1844
|
+
titleAlign: k,
|
|
1845
|
+
leading: B,
|
|
1846
|
+
trailing: L,
|
|
1847
|
+
actions: M,
|
|
1848
|
+
actionsPlacement: F,
|
|
1849
|
+
actionsAlign: D,
|
|
1850
|
+
actionsStack: N,
|
|
1851
|
+
maxActions: H,
|
|
1852
|
+
moreLabel: G,
|
|
1853
|
+
moreIcon: ee,
|
|
1854
|
+
showClose: te,
|
|
1855
|
+
closeIcon: ye,
|
|
1856
|
+
showBack: me,
|
|
1857
|
+
backIcon: be,
|
|
1858
|
+
onBack: ae,
|
|
1859
|
+
className: j,
|
|
1860
|
+
motionStyle: Ce,
|
|
1861
|
+
modal: ie,
|
|
1862
|
+
autoFocus: Ve,
|
|
1863
|
+
flush: ne,
|
|
1864
|
+
docked: ke,
|
|
1865
|
+
anchored: _,
|
|
1866
|
+
titleFont: W,
|
|
1867
|
+
...oe
|
|
1868
|
+
}, ce) => {
|
|
1869
|
+
const Ie = i ?? (n !== "fullscreen" ? 3 : void 0), K = V(null), ve = V(null), [Ee, Be] = q(!1), [Y, Z] = q(!1), [Te, X] = q(!1), { animationVars: ue, animate: xe, animating: de, idle: U, active: Re } = rn({
|
|
1870
|
+
t1: f
|
|
1871
|
+
}), De = W ?? (n === "dockLeft" || n === "dockRight" ? "titleLarge" : void 0), se = (Ne) => {
|
|
1872
|
+
if (ve.current && K.current) {
|
|
1873
|
+
const { width: $, height: R } = ve.current.getBoundingClientRect(), { width: Ae, height: O } = K.current.getBoundingClientRect(), Ke = 1;
|
|
1874
|
+
Z((n === "dockLeft" || n === "dockRight") && Ae >= $ - Ke), X((n === "dockTop" || n === "dockBottom") && O >= R - Ke);
|
|
1875
|
+
}
|
|
1876
|
+
}, P = n !== "basic" && n !== "fullscreen" && !u;
|
|
1877
|
+
nn(K, se, P && !de, !0), nn(ve, se, P && !de, !0), Ho(h && Ee, () => t == null ? void 0 : t()), Ko({
|
|
1878
|
+
ref: K,
|
|
1879
|
+
enabled: ie && Ee,
|
|
1880
|
+
autoFocus: Ve && !Re
|
|
1881
|
+
}), ge(() => {
|
|
1882
|
+
e ? (xe("open"), Be(!0), X(!1), Z(!1)) : U || (xe("closed"), Be(!1));
|
|
1883
|
+
}, [e]);
|
|
1884
|
+
const we = (Ne) => {
|
|
1885
|
+
c && Ne.target === Ne.currentTarget && (t == null || t());
|
|
1886
|
+
};
|
|
1887
|
+
ge(() => {
|
|
1888
|
+
if (Ee && ie && !_ && !ke) {
|
|
1889
|
+
const Ne = document.body.style.overflow;
|
|
1890
|
+
return document.body.style.overflow = "hidden", () => {
|
|
1891
|
+
document.body.style.overflow = Ne;
|
|
1892
|
+
};
|
|
1893
|
+
}
|
|
1894
|
+
}, [_, ke, ie, Ee]), ge(() => {
|
|
1895
|
+
Z(!1), X(!1);
|
|
1896
|
+
}, [n]);
|
|
1897
|
+
const re = E();
|
|
1898
|
+
re.merge(ue);
|
|
1899
|
+
const Se = l ?? (n === "dockLeft" || n === "dockRight" ? "small" : "medium"), he = je(
|
|
1900
|
+
"uui-dlg-backdrop",
|
|
1901
|
+
ie && "uui-modal",
|
|
1902
|
+
Ee && "uui-open",
|
|
1903
|
+
ke && "uui-docked",
|
|
1904
|
+
_ && "uui-anchored"
|
|
1905
|
+
), J = je(
|
|
1906
|
+
"uui-dlg",
|
|
1907
|
+
`uui-dlg-${Vt(n)}`,
|
|
1908
|
+
s && "uui-w-full",
|
|
1909
|
+
d && "uui-h-full",
|
|
1910
|
+
(Y || Te) && "uui-maximized",
|
|
1911
|
+
p && "uui-fit",
|
|
1912
|
+
ne && "uui-flush",
|
|
1913
|
+
u && "uui-detached",
|
|
1914
|
+
gt(Se),
|
|
1915
|
+
de && an(hr(n, m)),
|
|
1916
|
+
cn(Ce),
|
|
1917
|
+
j
|
|
1918
|
+
);
|
|
1919
|
+
if (!(Ee || Re))
|
|
1920
|
+
return null;
|
|
1921
|
+
const fe = F !== "inline" ? /* @__PURE__ */ r(
|
|
1922
|
+
yn,
|
|
1923
|
+
{
|
|
1924
|
+
actions: M,
|
|
1925
|
+
align: D,
|
|
1926
|
+
maxActions: H,
|
|
1927
|
+
moreIcon: ee,
|
|
1928
|
+
moreLabel: G,
|
|
1929
|
+
placement: F,
|
|
1930
|
+
stack: N
|
|
1931
|
+
}
|
|
1932
|
+
) : null, Oe = /* @__PURE__ */ r(
|
|
1933
|
+
"div",
|
|
1934
|
+
{
|
|
1935
|
+
className: he,
|
|
1936
|
+
onClick: we,
|
|
1937
|
+
ref: ve,
|
|
1938
|
+
role: "presentation",
|
|
1939
|
+
style: ue,
|
|
1940
|
+
children: /* @__PURE__ */ I(
|
|
1941
|
+
Me,
|
|
1942
|
+
{
|
|
1943
|
+
...oe,
|
|
1944
|
+
"aria-modal": ie ? !0 : void 0,
|
|
1945
|
+
className: J,
|
|
1946
|
+
color: o,
|
|
1947
|
+
elevation: Ie,
|
|
1948
|
+
ref: yt(ce, K),
|
|
1949
|
+
role: "dialog",
|
|
1950
|
+
shape: a,
|
|
1951
|
+
style: re.get(),
|
|
1952
|
+
children: [
|
|
1953
|
+
/* @__PURE__ */ r(
|
|
1954
|
+
no,
|
|
1955
|
+
{
|
|
1956
|
+
actions: F === "inline" && M,
|
|
1957
|
+
actionsAlign: D,
|
|
1958
|
+
actionsStack: N,
|
|
1959
|
+
backIcon: be,
|
|
1960
|
+
closeIcon: ye,
|
|
1961
|
+
font: De,
|
|
1962
|
+
icon: y,
|
|
1963
|
+
iconColor: w,
|
|
1964
|
+
iconSlot: x,
|
|
1965
|
+
label: C,
|
|
1966
|
+
leading: B,
|
|
1967
|
+
maxActions: H,
|
|
1968
|
+
moreIcon: ee,
|
|
1969
|
+
moreLabel: G,
|
|
1970
|
+
onBack: ae,
|
|
1971
|
+
onClose: t,
|
|
1972
|
+
showBack: me,
|
|
1973
|
+
showClose: te,
|
|
1974
|
+
showIcon: v,
|
|
1975
|
+
titleAlign: k,
|
|
1976
|
+
trailing: L
|
|
1977
|
+
}
|
|
1978
|
+
),
|
|
1979
|
+
/* @__PURE__ */ r(Xn, { icon: y, iconColor: w, iconSlot: x, showIcon: v, children: g }),
|
|
1980
|
+
fe
|
|
1981
|
+
]
|
|
1982
|
+
}
|
|
1983
|
+
)
|
|
1984
|
+
}
|
|
1985
|
+
);
|
|
1986
|
+
return ke || _ ? Oe : un("uui-dialog-root", Oe);
|
|
1987
|
+
}
|
|
1988
|
+
);
|
|
1989
|
+
Zt.displayName = "Dialog";
|
|
1990
|
+
const nt = S((e, t) => {
|
|
1991
|
+
const {
|
|
1992
|
+
elementClass: n,
|
|
1993
|
+
color: o,
|
|
1994
|
+
density: i,
|
|
1995
|
+
label: a,
|
|
1996
|
+
labelColor: s,
|
|
1997
|
+
labelFont: d,
|
|
1998
|
+
id: l,
|
|
1999
|
+
outlined: m,
|
|
2000
|
+
filled: p,
|
|
2001
|
+
classic: u,
|
|
2002
|
+
disabled: f,
|
|
2003
|
+
font: c,
|
|
2004
|
+
placeholderFont: h,
|
|
2005
|
+
placeholderColor: g,
|
|
2006
|
+
onFocus: C,
|
|
2007
|
+
onBlur: y,
|
|
2008
|
+
border: v,
|
|
2009
|
+
borderColor: w,
|
|
2010
|
+
shape: x,
|
|
2011
|
+
required: k,
|
|
2012
|
+
title: B,
|
|
2013
|
+
description: L,
|
|
2014
|
+
descriptionColor: M,
|
|
2015
|
+
descriptionFont: F,
|
|
2016
|
+
name: D,
|
|
2017
|
+
error: N,
|
|
2018
|
+
className: H,
|
|
2019
|
+
placeholder: G,
|
|
2020
|
+
type: ee = "text",
|
|
2021
|
+
icon: te,
|
|
2022
|
+
leading: ye,
|
|
2023
|
+
trailing: me,
|
|
2024
|
+
endIcon: be,
|
|
2025
|
+
variant: ae,
|
|
2026
|
+
value: j,
|
|
2027
|
+
textColor: Ce,
|
|
2028
|
+
defaultValue: ie,
|
|
2029
|
+
...Ve
|
|
2030
|
+
} = e, [ne, ke] = q(ie ?? ""), _ = j !== void 0, oe = (_ ? j : ne).length === 0, ce = V(null), Ie = V(null), K = l ?? xt("input"), [ve, Ee] = q(0), Be = ye ?? te, Y = ae ?? (p && "filled") ?? (m && "outlined") ?? (u && "classic") ?? "filled", { isFocused: Z, focusHandlers: Te } = Bt(C, y), X = (z) => {
|
|
2031
|
+
var pe;
|
|
2032
|
+
_ || ke(z.target.value), (pe = e.onChange) == null || pe.call(e, z);
|
|
2033
|
+
}, ue = (z) => {
|
|
2034
|
+
var pe;
|
|
2035
|
+
z.preventDefault(), (pe = ce.current) == null || pe.focus();
|
|
2036
|
+
};
|
|
2037
|
+
ge(() => {
|
|
2038
|
+
const z = ce.current;
|
|
2039
|
+
z && z.value && ke(z.value);
|
|
2040
|
+
}, []), jn(() => {
|
|
2041
|
+
const z = Ie.current, pe = ce.current;
|
|
2042
|
+
if (!z || !pe)
|
|
2043
|
+
return;
|
|
2044
|
+
const Q = z.getBoundingClientRect().left - pe.getBoundingClientRect().left + 16;
|
|
2045
|
+
Ee((He) => He === Q ? He : Q);
|
|
2046
|
+
}, [Be]);
|
|
2047
|
+
const xe = [
|
|
2048
|
+
n,
|
|
2049
|
+
H,
|
|
2050
|
+
"uui-field uui-field-wrapper",
|
|
2051
|
+
`uui-${Y}`,
|
|
2052
|
+
ut(i)
|
|
2053
|
+
], de = Be && /* @__PURE__ */ r("div", { className: "uui-leading", children: Ye.Children.map(
|
|
2054
|
+
Be,
|
|
2055
|
+
(z) => z ? /* @__PURE__ */ r(
|
|
2056
|
+
"span",
|
|
2057
|
+
{
|
|
2058
|
+
className: "uui-slot",
|
|
2059
|
+
onClick: (pe) => {
|
|
2060
|
+
pe.stopPropagation();
|
|
2061
|
+
},
|
|
2062
|
+
children: z
|
|
2063
|
+
}
|
|
2064
|
+
) : null
|
|
2065
|
+
) }), U = me ?? be, Re = U && /* @__PURE__ */ r("div", { className: "uui-trailing", children: Ye.Children.map(
|
|
2066
|
+
U,
|
|
2067
|
+
(z) => z ? /* @__PURE__ */ r(
|
|
2068
|
+
"span",
|
|
2069
|
+
{
|
|
2070
|
+
className: "uui-slot",
|
|
2071
|
+
onClick: (pe) => {
|
|
2072
|
+
pe.stopPropagation();
|
|
2073
|
+
},
|
|
2074
|
+
children: z
|
|
2075
|
+
}
|
|
2076
|
+
) : null
|
|
2077
|
+
) }), Pe = a && /* @__PURE__ */ I(rt, { children: [
|
|
2078
|
+
a,
|
|
2079
|
+
k && /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "uui-required", children: "*" })
|
|
2080
|
+
] }), De = v ?? (Y !== "filled" ? 1 : void 0), se = [
|
|
2081
|
+
"uui-field-control",
|
|
2082
|
+
Le(c ?? "bodyLarge"),
|
|
2083
|
+
_e(x ?? "rounded"),
|
|
2084
|
+
Y !== "outlined" && it(De),
|
|
2085
|
+
N && "uui-error",
|
|
2086
|
+
Z && "uui-active",
|
|
2087
|
+
f && "uui-disabled",
|
|
2088
|
+
de && "uui-has-leading",
|
|
2089
|
+
Re && "uui-has-trailing"
|
|
2090
|
+
];
|
|
2091
|
+
let P, we, re, Se;
|
|
2092
|
+
const he = E(), J = ["uui-fb-label"];
|
|
2093
|
+
if (Pe)
|
|
2094
|
+
if (Y !== "classic")
|
|
2095
|
+
Z || !oe ? (he.text((N ? "error" : void 0) ?? o ?? "primary"), J.push(Le(d ?? "bodySmall")), se.push("uui-fb-label-up")) : (he.text((N ? "error" : void 0) ?? "onSurfaceVariant"), J.push(Le(c ?? "bodyLarge"))), J.push("uui-field-float-label"), Y === "outlined" ? (re = /* @__PURE__ */ r("legend", { className: Le(d ?? "bodySmall"), children: Pe }), P = /* @__PURE__ */ r("span", { className: J.join(" "), children: Pe })) : (we = /* @__PURE__ */ r("span", { className: Le(d ?? "bodySmall"), children: " " }), P = /* @__PURE__ */ r("span", { className: J.join(" "), children: Pe }));
|
|
2096
|
+
else {
|
|
2097
|
+
he.text((N ? "error" : void 0) ?? "onSurface"), J.push(Le(d ?? "bodyMedium"));
|
|
2098
|
+
const z = J.filter(Boolean).join(" ");
|
|
2099
|
+
Se = /* @__PURE__ */ r("label", { className: z, htmlFor: K, style: he.get(), children: Pe });
|
|
2100
|
+
}
|
|
2101
|
+
let fe;
|
|
2102
|
+
if (Y === "outlined") {
|
|
2103
|
+
const z = ["uui-field-fieldset", _e(x ?? "rounded")].filter(Boolean).join(" "), pe = E(), Q = on(0, 4, v, 1);
|
|
2104
|
+
pe.set("borderWidth", `${Q}px`), pe.border(w ?? "onSurfaceVariant"), fe = /* @__PURE__ */ r("fieldset", { className: z, style: pe.get(), children: re });
|
|
2105
|
+
}
|
|
2106
|
+
const Oe = E();
|
|
2107
|
+
Oe.set("--uui-label-up-x", `${ve}px`), Y === "classic" && Oe.border(w ?? "outline"), Y === "filled" && Oe.border(w ?? "onSurfaceVariant");
|
|
2108
|
+
const Ne = ["uui-field-state"].filter(Boolean).join(" "), $ = E(), R = E();
|
|
2109
|
+
N ? R.text("error") : M ? R.text(M) : R.text.on("surfaceVariant");
|
|
2110
|
+
const Ae = [
|
|
2111
|
+
Le(F ?? "bodySmall"),
|
|
2112
|
+
N && "uui-error uui-support-text",
|
|
2113
|
+
L && !N && "uui-description uui-support-text"
|
|
2114
|
+
].filter(Boolean).join(" "), O = (L ?? N) && /* @__PURE__ */ r("div", { className: Ae, style: R.get(), children: N ?? L }), Ke = "uui-field-input", ze = E();
|
|
2115
|
+
ze.text("onSurface"), !Z && P && oe && ze.set("opacity", 0);
|
|
2116
|
+
const Ue = ["uui-field-input-wrapper"].filter(Boolean).join(" "), Je = xe.filter(Boolean).join(" "), Qe = se.filter(Boolean).join(" ");
|
|
2117
|
+
return /* @__PURE__ */ I("div", { className: Je, title: B, children: [
|
|
2118
|
+
Se,
|
|
2119
|
+
/* @__PURE__ */ I("div", { className: Qe, onPointerDown: ue, ref: Ie, style: Oe.get(), children: [
|
|
2120
|
+
de,
|
|
2121
|
+
/* @__PURE__ */ I("div", { className: Ue, children: [
|
|
2122
|
+
we,
|
|
2123
|
+
P,
|
|
2124
|
+
/* @__PURE__ */ r(
|
|
2125
|
+
"input",
|
|
2126
|
+
{
|
|
2127
|
+
...Te,
|
|
2128
|
+
...Ve,
|
|
2129
|
+
..._ ? { value: j } : { defaultValue: ie },
|
|
2130
|
+
"aria-invalid": !!N,
|
|
2131
|
+
autoComplete: "email",
|
|
2132
|
+
className: Ke,
|
|
2133
|
+
disabled: f,
|
|
2134
|
+
id: K,
|
|
2135
|
+
name: D,
|
|
2136
|
+
onChange: X,
|
|
2137
|
+
placeholder: G,
|
|
2138
|
+
ref: yt(t, ce),
|
|
2139
|
+
style: ze.get(),
|
|
2140
|
+
type: ee
|
|
2141
|
+
}
|
|
2142
|
+
)
|
|
2143
|
+
] }),
|
|
2144
|
+
Re,
|
|
2145
|
+
Y === "filled" && /* @__PURE__ */ r("div", { className: Ne, style: $.get() }),
|
|
2146
|
+
fe
|
|
2147
|
+
] }),
|
|
2148
|
+
O
|
|
2149
|
+
] });
|
|
2150
|
+
});
|
|
2151
|
+
nt.displayName = "FieldBase";
|
|
2152
|
+
const dt = S((e, t) => {
|
|
2153
|
+
const {
|
|
2154
|
+
component: n,
|
|
2155
|
+
font: o,
|
|
2156
|
+
color: i,
|
|
2157
|
+
elevation: a,
|
|
2158
|
+
shape: s,
|
|
2159
|
+
border: d,
|
|
2160
|
+
borderColor: l,
|
|
2161
|
+
elementClass: m,
|
|
2162
|
+
children: p,
|
|
2163
|
+
className: u,
|
|
2164
|
+
style: f,
|
|
2165
|
+
...c
|
|
2166
|
+
} = e, h = n ?? "span", g = E(f);
|
|
2167
|
+
g.border(l), g.bg(i), g.text.on(i);
|
|
2168
|
+
const C = je(
|
|
2169
|
+
"uui-inline",
|
|
2170
|
+
m,
|
|
2171
|
+
...o ? [Le(o)] : [],
|
|
2172
|
+
...s ? [_e(s)] : [],
|
|
2173
|
+
...a !== void 0 ? [at(a)] : [],
|
|
2174
|
+
...d !== void 0 ? [it(d)] : [],
|
|
2175
|
+
u
|
|
2176
|
+
);
|
|
2177
|
+
return /* @__PURE__ */ r(h, { className: C, ref: t, style: g.get(), ...c, children: p });
|
|
2178
|
+
});
|
|
2179
|
+
dt.displayName = "TextBase";
|
|
2180
|
+
const bn = S(
|
|
2181
|
+
({ font: e, size: t = "small", ...n }, o) => /* @__PURE__ */ r(Dt, { font: e ?? {
|
|
2182
|
+
extraSmall: "labelLarge",
|
|
2183
|
+
small: "labelLarge",
|
|
2184
|
+
medium: "titleMedium",
|
|
2185
|
+
large: "headlineSmall",
|
|
2186
|
+
extraLarge: "headlineLarge"
|
|
2187
|
+
}[t], ref: o, size: t, ...n, elementClass: "uui-button" })
|
|
2188
|
+
);
|
|
2189
|
+
bn.displayName = "Button";
|
|
2190
|
+
Object.assign(bn, { [Yn]: !0 });
|
|
2191
|
+
const gr = S(
|
|
2192
|
+
({
|
|
2193
|
+
font: e,
|
|
2194
|
+
size: t = "small",
|
|
2195
|
+
shape: n = "smooth",
|
|
2196
|
+
selectedShape: o = "smooth",
|
|
2197
|
+
borderColor: i = "outlineVariant",
|
|
2198
|
+
...a
|
|
2199
|
+
}, s) => /* @__PURE__ */ r(
|
|
2200
|
+
Dt,
|
|
2201
|
+
{
|
|
2202
|
+
borderColor: i,
|
|
2203
|
+
font: e ?? {
|
|
2204
|
+
extraSmall: "labelLarge",
|
|
2205
|
+
small: "labelLarge",
|
|
2206
|
+
medium: "titleMedium",
|
|
2207
|
+
large: "headlineSmall",
|
|
2208
|
+
extraLarge: "headlineLarge"
|
|
2209
|
+
}[t],
|
|
2210
|
+
ref: s,
|
|
2211
|
+
selectedShape: o,
|
|
2212
|
+
...a,
|
|
2213
|
+
elementClass: "uui-chip",
|
|
2214
|
+
shape: n,
|
|
2215
|
+
size: t
|
|
2216
|
+
}
|
|
2217
|
+
)
|
|
2218
|
+
);
|
|
2219
|
+
gr.displayName = "Chip";
|
|
2220
|
+
const vn = (e) => {
|
|
2221
|
+
const {
|
|
2222
|
+
children: t,
|
|
2223
|
+
className: n,
|
|
2224
|
+
border: o,
|
|
2225
|
+
borderColor: i,
|
|
2226
|
+
color: a = "error",
|
|
2227
|
+
align: s = "topRight",
|
|
2228
|
+
shape: d = "round",
|
|
2229
|
+
size: l = "medium",
|
|
2230
|
+
elevation: m,
|
|
2231
|
+
ariaLabel: p,
|
|
2232
|
+
value: u,
|
|
2233
|
+
font: f,
|
|
2234
|
+
offset: c,
|
|
2235
|
+
...h
|
|
2236
|
+
} = e, g = "uui-badge", C = f ?? (l === "extraLarge" || l === "large" ? "labelMedium" : "labelSmall"), y = [
|
|
2237
|
+
"uui-badge-control",
|
|
2238
|
+
n,
|
|
2239
|
+
_e(d),
|
|
2240
|
+
gt(l),
|
|
2241
|
+
Le(C)
|
|
2242
|
+
], v = ["uui-badge-slot", Fo(s)].filter(Boolean).join(" "), w = E();
|
|
2243
|
+
w.bg(a), w.text.on(a), c !== void 0 && w.set("--uui-badge-offset", `${c}px`), m !== void 0 && y.push(at(m)), o !== void 0 && (y.push(it(o)), w.border(zt(i)));
|
|
2244
|
+
const x = y.filter(Boolean).join(" "), k = /* @__PURE__ */ r("span", { "aria-label": p, className: x, style: w.get(), children: l !== "small" && l !== "extraSmall" && u });
|
|
2245
|
+
return t ? /* @__PURE__ */ I("span", { className: g, ...h, children: [
|
|
2246
|
+
t,
|
|
2247
|
+
/* @__PURE__ */ r("span", { className: v, children: k })
|
|
2248
|
+
] }) : k;
|
|
2249
|
+
};
|
|
2250
|
+
vn.displayName = "Badge";
|
|
2251
|
+
const yr = S(
|
|
2252
|
+
({
|
|
2253
|
+
children: e,
|
|
2254
|
+
className: t = "",
|
|
2255
|
+
color: n = "error",
|
|
2256
|
+
position: o = "topRight",
|
|
2257
|
+
shape: i = "round",
|
|
2258
|
+
size: a = "medium",
|
|
2259
|
+
value: s,
|
|
2260
|
+
...d
|
|
2261
|
+
}, l) => /* @__PURE__ */ r("span", { className: ["uui-card-wrapper"].join(" "), ref: l, ...d, children: e })
|
|
2262
|
+
);
|
|
2263
|
+
yr.displayName = "Card";
|
|
2264
|
+
const br = S(
|
|
2265
|
+
({
|
|
2266
|
+
shape: e = "smooth",
|
|
2267
|
+
border: t,
|
|
2268
|
+
uncheckedBorder: n,
|
|
2269
|
+
color: o,
|
|
2270
|
+
borderColor: i,
|
|
2271
|
+
animation: a,
|
|
2272
|
+
uncheckedBorderColor: s,
|
|
2273
|
+
uncheckedIcon: d,
|
|
2274
|
+
indeterminateIcon: l,
|
|
2275
|
+
indeterminate: m,
|
|
2276
|
+
icon: p,
|
|
2277
|
+
size: u = "small",
|
|
2278
|
+
filled: f = !0,
|
|
2279
|
+
...c
|
|
2280
|
+
}, h) => {
|
|
2281
|
+
const g = o ?? "primary", C = !p && t === void 0 ? void 0 : t;
|
|
2282
|
+
let y;
|
|
2283
|
+
return m ? y = t : y = !d && n === void 0 ? t ?? 2 : n, /* @__PURE__ */ r(
|
|
2284
|
+
gn,
|
|
2285
|
+
{
|
|
2286
|
+
animation: a ?? "scale",
|
|
2287
|
+
border: C,
|
|
2288
|
+
borderColor: i ?? g,
|
|
2289
|
+
color: g,
|
|
2290
|
+
elementClass: "uui-checkbox",
|
|
2291
|
+
filled: f,
|
|
2292
|
+
icon: p ?? rr,
|
|
2293
|
+
indeterminate: m,
|
|
2294
|
+
indeterminateIcon: l ?? ir,
|
|
2295
|
+
ref: h,
|
|
2296
|
+
shape: e,
|
|
2297
|
+
size: u,
|
|
2298
|
+
type: "checkbox",
|
|
2299
|
+
uncheckedBorder: y,
|
|
2300
|
+
uncheckedBorderColor: s ?? i ?? "onSurfaceVariant",
|
|
2301
|
+
uncheckedIcon: d,
|
|
2302
|
+
...c
|
|
2303
|
+
}
|
|
2304
|
+
);
|
|
2305
|
+
}
|
|
2306
|
+
);
|
|
2307
|
+
br.displayName = "Checkbox";
|
|
2308
|
+
const vr = S(
|
|
2309
|
+
(e, t) => /* @__PURE__ */ r(nt, { ref: t, ...e, elementClass: "uui-text-field" })
|
|
2310
|
+
);
|
|
2311
|
+
vr.displayName = "TextField";
|
|
2312
|
+
const Cr = S(
|
|
2313
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2314
|
+
nt,
|
|
2315
|
+
{
|
|
2316
|
+
ref: t,
|
|
2317
|
+
...e,
|
|
2318
|
+
elementClass: "uui-number-field",
|
|
2319
|
+
type: "number"
|
|
2320
|
+
}
|
|
2321
|
+
)
|
|
2322
|
+
);
|
|
2323
|
+
Cr.displayName = "NumberField";
|
|
2324
|
+
const xr = S(
|
|
2325
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2326
|
+
nt,
|
|
2327
|
+
{
|
|
2328
|
+
ref: t,
|
|
2329
|
+
...e,
|
|
2330
|
+
elementClass: "uui-email-field",
|
|
2331
|
+
type: "email"
|
|
2332
|
+
}
|
|
2333
|
+
)
|
|
2334
|
+
);
|
|
2335
|
+
xr.displayName = "EmailField";
|
|
2336
|
+
const wr = S(
|
|
2337
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2338
|
+
nt,
|
|
2339
|
+
{
|
|
2340
|
+
ref: t,
|
|
2341
|
+
...e,
|
|
2342
|
+
elementClass: "uui-phone-field",
|
|
2343
|
+
type: "tel"
|
|
2344
|
+
}
|
|
2345
|
+
)
|
|
2346
|
+
);
|
|
2347
|
+
wr.displayName = "PhoneField";
|
|
2348
|
+
const Nr = S(
|
|
2349
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2350
|
+
nt,
|
|
2351
|
+
{
|
|
2352
|
+
ref: t,
|
|
2353
|
+
...e,
|
|
2354
|
+
type: "password",
|
|
2355
|
+
elementClass: "uui-password-field"
|
|
2356
|
+
}
|
|
2357
|
+
)
|
|
2358
|
+
);
|
|
2359
|
+
Nr.displayName = "PasswordField";
|
|
2360
|
+
const kr = S(
|
|
2361
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2362
|
+
nt,
|
|
2363
|
+
{
|
|
2364
|
+
ref: t,
|
|
2365
|
+
...e,
|
|
2366
|
+
elementClass: "uui-date-field",
|
|
2367
|
+
type: "date"
|
|
2368
|
+
}
|
|
2369
|
+
)
|
|
2370
|
+
);
|
|
2371
|
+
kr.displayName = "DateField";
|
|
2372
|
+
const Sr = S(
|
|
2373
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2374
|
+
nt,
|
|
2375
|
+
{
|
|
2376
|
+
ref: t,
|
|
2377
|
+
...e,
|
|
2378
|
+
elementClass: "uui-datetime-field",
|
|
2379
|
+
type: "datetime-local"
|
|
2380
|
+
}
|
|
2381
|
+
)
|
|
2382
|
+
);
|
|
2383
|
+
Sr.displayName = "DateTimeField";
|
|
2384
|
+
const Lr = S(
|
|
2385
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2386
|
+
nt,
|
|
2387
|
+
{
|
|
2388
|
+
ref: t,
|
|
2389
|
+
...e,
|
|
2390
|
+
elementClass: "uui-time-field",
|
|
2391
|
+
type: "time"
|
|
2392
|
+
}
|
|
2393
|
+
)
|
|
2394
|
+
);
|
|
2395
|
+
Lr.displayName = "TimeField";
|
|
2396
|
+
const Br = S(
|
|
2397
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2398
|
+
nt,
|
|
2399
|
+
{
|
|
2400
|
+
ref: t,
|
|
2401
|
+
...e,
|
|
2402
|
+
type: "month",
|
|
2403
|
+
elementClass: "uui-month-field"
|
|
2404
|
+
}
|
|
2405
|
+
)
|
|
2406
|
+
);
|
|
2407
|
+
Br.displayName = "MonthField";
|
|
2408
|
+
const Ir = S(
|
|
2409
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2410
|
+
nt,
|
|
2411
|
+
{
|
|
2412
|
+
ref: t,
|
|
2413
|
+
...e,
|
|
2414
|
+
type: "week",
|
|
2415
|
+
elementClass: "uui-week-field"
|
|
2416
|
+
}
|
|
2417
|
+
)
|
|
2418
|
+
);
|
|
2419
|
+
Ir.displayName = "WeekField";
|
|
2420
|
+
const Dr = S(
|
|
2421
|
+
(e, t) => /* @__PURE__ */ r(nt, { ref: t, ...e, elementClass: "uui-url-field", type: "url" })
|
|
2422
|
+
);
|
|
2423
|
+
Dr.displayName = "UrlField";
|
|
2424
|
+
const $r = S(
|
|
2425
|
+
({ elevation: e = 3, font: t, size: n = "medium", shape: o = "rounded", label: i, ...a }, s) => /* @__PURE__ */ r(
|
|
2426
|
+
Dt,
|
|
2427
|
+
{
|
|
2428
|
+
ref: s,
|
|
2429
|
+
...a,
|
|
2430
|
+
elementClass: i ? "uui-fab uui-fab-extended" : "uui-fab",
|
|
2431
|
+
elevation: e,
|
|
2432
|
+
font: t ?? {
|
|
2433
|
+
extraSmall: "labelLarge",
|
|
2434
|
+
small: "titleMedium",
|
|
2435
|
+
medium: "titleMedium",
|
|
2436
|
+
large: "headlineSmall",
|
|
2437
|
+
extraLarge: "headlineLarge"
|
|
2438
|
+
}[n],
|
|
2439
|
+
label: i,
|
|
2440
|
+
shape: o,
|
|
2441
|
+
size: n
|
|
2442
|
+
}
|
|
2443
|
+
)
|
|
2444
|
+
);
|
|
2445
|
+
$r.displayName = "Fab";
|
|
2446
|
+
const Mr = S(
|
|
2447
|
+
({
|
|
2448
|
+
selected: e = !1,
|
|
2449
|
+
shape: t = "rounded",
|
|
2450
|
+
size: n = "medium",
|
|
2451
|
+
...o
|
|
2452
|
+
}, i) => /* @__PURE__ */ r(
|
|
2453
|
+
Dt,
|
|
2454
|
+
{
|
|
2455
|
+
ref: i,
|
|
2456
|
+
...o,
|
|
2457
|
+
"aria-pressed": e,
|
|
2458
|
+
elementClass: `uui-toggle-button${e ? " uui-selected" : ""}`,
|
|
2459
|
+
filled: e,
|
|
2460
|
+
shape: t,
|
|
2461
|
+
size: n
|
|
2462
|
+
}
|
|
2463
|
+
)
|
|
2464
|
+
);
|
|
2465
|
+
Mr.displayName = "ToggleButton";
|
|
2466
|
+
const oo = Symbol.for("uui.menu");
|
|
2467
|
+
function St(e) {
|
|
2468
|
+
return ct(e) && typeof e.type != "string" && !!e.type[oo];
|
|
2469
|
+
}
|
|
2470
|
+
const Cn = Symbol.for("uui.menuitem");
|
|
2471
|
+
function Jt(e) {
|
|
2472
|
+
return ct(e) && typeof e.type != "string" && !!e.type[Cn];
|
|
2473
|
+
}
|
|
2474
|
+
const ro = Symbol.for("uui.divider");
|
|
2475
|
+
function Qt(e) {
|
|
2476
|
+
return ct(e) && typeof e.type != "string" && !!e.type[ro];
|
|
2477
|
+
}
|
|
2478
|
+
const Er = (e) => e === "none" ? "none" : e === "auto" ? "scale" : e, xn = S(
|
|
2479
|
+
({
|
|
2480
|
+
anchorRef: e,
|
|
2481
|
+
open: t = !1,
|
|
2482
|
+
horizontal: n = !1,
|
|
2483
|
+
placement: o = "auto",
|
|
2484
|
+
floatingMode: i,
|
|
2485
|
+
offset: a = 4,
|
|
2486
|
+
color: s,
|
|
2487
|
+
elevation: d,
|
|
2488
|
+
dockedElevation: l,
|
|
2489
|
+
shape: m,
|
|
2490
|
+
border: p,
|
|
2491
|
+
borderColor: u,
|
|
2492
|
+
className: f,
|
|
2493
|
+
children: c,
|
|
2494
|
+
style: h,
|
|
2495
|
+
id: g,
|
|
2496
|
+
onClose: C,
|
|
2497
|
+
variant: y = "classic",
|
|
2498
|
+
animation: v = "scale",
|
|
2499
|
+
duration: w,
|
|
2500
|
+
motionStyle: x = "regular",
|
|
2501
|
+
fixedLeading: k,
|
|
2502
|
+
density: B,
|
|
2503
|
+
__level: L,
|
|
2504
|
+
__groupId: M,
|
|
2505
|
+
__closeRootMenu: F,
|
|
2506
|
+
__navigateHorizontal: D,
|
|
2507
|
+
__horizontalDepth: N,
|
|
2508
|
+
docked: H,
|
|
2509
|
+
textColor: G,
|
|
2510
|
+
descriptionColor: ee,
|
|
2511
|
+
labelColor: te,
|
|
2512
|
+
shortcutColor: ye,
|
|
2513
|
+
uncheckedIcon: me,
|
|
2514
|
+
checkedIcon: be,
|
|
2515
|
+
radioUncheckedIcon: ae,
|
|
2516
|
+
radioCheckedIcon: j,
|
|
2517
|
+
selectedColor: Ce,
|
|
2518
|
+
itemTouchEffects: ie,
|
|
2519
|
+
itemSelectedEffects: Ve,
|
|
2520
|
+
itemFocusEffects: ne,
|
|
2521
|
+
closeOnChange: ke = !1,
|
|
2522
|
+
openOnHover: _ = !0,
|
|
2523
|
+
labelFont: W,
|
|
2524
|
+
font: oe,
|
|
2525
|
+
descriptionFont: ce,
|
|
2526
|
+
shortcutFont: Ie,
|
|
2527
|
+
onFocus: K,
|
|
2528
|
+
onBlur: ve,
|
|
2529
|
+
...Ee
|
|
2530
|
+
}, Be) => {
|
|
2531
|
+
var Dn;
|
|
2532
|
+
const Y = V("closed"), [Z, Te] = q(-1), [X, ue] = q(-1), { focusVisible: xe, isFocused: de, focusHandlers: U } = Bt(K, ve), Re = L ?? 0, Pe = V(g ?? xt("menu")).current, De = M ?? Pe, se = V(xt("uui-menu-surface")).current, P = V(null), we = V(null), [re, Se] = q(null), he = Z === -1, [J, fe] = q(!1), [Oe, Ne] = q(!1), [$, R] = q("normal"), [Ae, O] = q(!1), [Ke, ze] = q(-1), Ue = s ?? (y === "modern" ? "surfaceContainerLow" : "surfaceContainer"), Je = (H ? l : void 0) ?? d ?? (y === "modern" ? 3 : 2), [Qe, z] = q(!1), pe = v !== "none" ? w ?? 220 : 0, Q = H ? 0 : pe, He = V(null), Xe = V(null), $t = V(!1), We = Z !== -1;
|
|
2533
|
+
function Mt(b) {
|
|
2534
|
+
return Jt(b) || Qt(b);
|
|
2535
|
+
}
|
|
2536
|
+
const Ze = Ye.Children.toArray(c).filter(Mt), le = Ze.reduce((b, T, A) => (Jt(T) && (T.props.disabled || b.push(A)), b), []);
|
|
2537
|
+
function ft() {
|
|
2538
|
+
We && (z(!0), Te(-1));
|
|
2539
|
+
}
|
|
2540
|
+
function Et() {
|
|
2541
|
+
C == null || C(), !C && We && (ft(), ue(-1)), Re === 0 && (e != null && e.current) && e.current.focus();
|
|
2542
|
+
}
|
|
2543
|
+
function et() {
|
|
2544
|
+
F ? F() : Et();
|
|
2545
|
+
}
|
|
2546
|
+
function wt(b) {
|
|
2547
|
+
return !P.current || b === -1 ? null : P.current.querySelector(`[data-menu-index="${String(b)}"]`);
|
|
2548
|
+
}
|
|
2549
|
+
function bt(b) {
|
|
2550
|
+
return `${se}-i${b}`;
|
|
2551
|
+
}
|
|
2552
|
+
function At(b) {
|
|
2553
|
+
const A = Ye.Children.toArray(Ze[b].props.children).find((lt) => St(lt));
|
|
2554
|
+
return ct(A) ? Ye.Children.toArray(A.props.children).filter((lt) => Qt(lt) || Mt(lt)) : void 0;
|
|
2555
|
+
}
|
|
2556
|
+
function st(b) {
|
|
2557
|
+
if (b === -1 || le.indexOf(b) === -1)
|
|
2558
|
+
return;
|
|
2559
|
+
if (We) {
|
|
2560
|
+
ze(b), ft();
|
|
2561
|
+
return;
|
|
2562
|
+
}
|
|
2563
|
+
const A = At(b);
|
|
2564
|
+
if (!A || A.length === 0)
|
|
2565
|
+
return;
|
|
2566
|
+
const Fe = wt(b);
|
|
2567
|
+
Fe && (we.current = Fe, z(!0), Te(b), setTimeout(() => {
|
|
2568
|
+
z(!1);
|
|
2569
|
+
}, pe));
|
|
2570
|
+
}
|
|
2571
|
+
function ot(b) {
|
|
2572
|
+
return b < 0 ? !1 : Ye.Children.toArray(Ze[b].props.children).some((A) => St(A));
|
|
2573
|
+
}
|
|
2574
|
+
function vt(b) {
|
|
2575
|
+
if (X === -1)
|
|
2576
|
+
return;
|
|
2577
|
+
const T = le.indexOf(X);
|
|
2578
|
+
if (T === -1)
|
|
2579
|
+
return;
|
|
2580
|
+
let A;
|
|
2581
|
+
b ? A = le[T + 1 < le.length ? T + 1 : 0] : A = T > 0 ? le[T - 1] : le[le.length - 1], A !== X && (ue(A), ot(A) ? st(A) : ft());
|
|
2582
|
+
}
|
|
2583
|
+
ge(() => {
|
|
2584
|
+
const b = $t.current, T = We;
|
|
2585
|
+
if (b && !T) {
|
|
2586
|
+
const A = window.setTimeout(() => {
|
|
2587
|
+
O(!0);
|
|
2588
|
+
}, pe * 0.67);
|
|
2589
|
+
return $t.current = T, () => {
|
|
2590
|
+
window.clearTimeout(A);
|
|
2591
|
+
};
|
|
2592
|
+
}
|
|
2593
|
+
$t.current = T;
|
|
2594
|
+
}, [pe, We]), ge(() => {
|
|
2595
|
+
var b;
|
|
2596
|
+
!We && Ae && (O(!1), Te(-1), Ke !== -1 ? (ze(-1), st(Ke)) : (b = P.current) == null || b.focus(), z(!1));
|
|
2597
|
+
}, [Ae, Ke, We]), ge(() => {
|
|
2598
|
+
t ? (Y.current = "opening", z(!0), R("normal"), fe(!0), Te(-1), Ne(!1), ue(-1)) : (Y.current = "closing", z(!0), Ne(!1), R("reverse"));
|
|
2599
|
+
}, [t]), ge(() => {
|
|
2600
|
+
if (!t || !J || !P.current)
|
|
2601
|
+
return;
|
|
2602
|
+
const b = () => {
|
|
2603
|
+
const T = i ?? (n ? "dropdown" : "menu");
|
|
2604
|
+
if (e != null && e.current) {
|
|
2605
|
+
const A = Un(e, P, {
|
|
2606
|
+
placement: o,
|
|
2607
|
+
mode: T,
|
|
2608
|
+
offset: a
|
|
2609
|
+
});
|
|
2610
|
+
A && Se({ x: A.x, y: A.y });
|
|
2611
|
+
}
|
|
2612
|
+
};
|
|
2613
|
+
return H ? Se({ x: 0, y: 0 }) : (window.addEventListener("resize", b), b()), Ne(!0), () => {
|
|
2614
|
+
H || window.removeEventListener("resize", b);
|
|
2615
|
+
};
|
|
2616
|
+
}, [e, H, i, n, a, t, o, J]), ge(() => {
|
|
2617
|
+
t && J && re && setTimeout(() => {
|
|
2618
|
+
var b;
|
|
2619
|
+
Y.current === "opening" && (z(!1), Y.current = "opened", H || (b = P.current) == null || b.focus(), ue(xe ? le[0] ?? -1 : -1));
|
|
2620
|
+
}, Q);
|
|
2621
|
+
}, [t, re, J]), ge(() => {
|
|
2622
|
+
$ === "reverse" && Y.current === "closing" && (Ne(!0), ue(-1), setTimeout(() => {
|
|
2623
|
+
Y.current === "closing" && (Y.current = "closed", fe(!1), Se(null), z(!1));
|
|
2624
|
+
}, pe * 0.67));
|
|
2625
|
+
}, [pe, $]), ge(() => {
|
|
2626
|
+
if (X < 0 || Y.current !== "opened")
|
|
2627
|
+
return;
|
|
2628
|
+
const b = wt(X);
|
|
2629
|
+
b && b.scrollIntoView({
|
|
2630
|
+
block: "nearest",
|
|
2631
|
+
inline: "nearest"
|
|
2632
|
+
});
|
|
2633
|
+
}, [X]), ge(() => {
|
|
2634
|
+
de && xe && X === -1 && Y.current === "opened" && le.length > 0 && ue(le[0]);
|
|
2635
|
+
}, [X, xe, de]), _o(
|
|
2636
|
+
t && Re === 0,
|
|
2637
|
+
`[data-menu-group="${De}"]`,
|
|
2638
|
+
() => {
|
|
2639
|
+
et();
|
|
2640
|
+
},
|
|
2641
|
+
e
|
|
2642
|
+
);
|
|
2643
|
+
function Tt(b) {
|
|
2644
|
+
var A, Fe, lt, $n;
|
|
2645
|
+
const T = b;
|
|
2646
|
+
T !== -1 && (Ze[T].props.disabled || (ue(T), ot(T) ? We && T === Z ? ft() : st(T) : Ze[T].props.type === "radio" || Ze[T].props.type === "checkbox" || Ze[T].props.type === "option" ? ((Fe = (A = Ze[T].props).onChange) == null || Fe.call(A), ke && et()) : (($n = (lt = Ze[T].props).onClick) == null || $n.call(lt), et())));
|
|
2647
|
+
}
|
|
2648
|
+
function qt(b, T) {
|
|
2649
|
+
if (Qe) {
|
|
2650
|
+
b == null || b.preventDefault();
|
|
2651
|
+
return;
|
|
2652
|
+
}
|
|
2653
|
+
Tt(T);
|
|
2654
|
+
}
|
|
2655
|
+
function qe(b, T) {
|
|
2656
|
+
if (!(!_ || xe && de)) {
|
|
2657
|
+
if (Xe.current && (clearTimeout(Xe.current), Xe.current = null), He.current && (clearTimeout(He.current), He.current = null), !ot(T)) {
|
|
2658
|
+
We && (Xe.current = window.setTimeout(() => {
|
|
2659
|
+
ft();
|
|
2660
|
+
}, 150));
|
|
2661
|
+
return;
|
|
2662
|
+
}
|
|
2663
|
+
We && Z === T || (He.current = window.setTimeout(() => {
|
|
2664
|
+
ue(T), st(T);
|
|
2665
|
+
}, 150));
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
function jt() {
|
|
2669
|
+
Xe.current && (clearTimeout(Xe.current), Xe.current = null), He.current && (clearTimeout(He.current), He.current = null);
|
|
2670
|
+
}
|
|
2671
|
+
const yo = Ze.some(
|
|
2672
|
+
(b) => b.props.icon !== void 0 || b.props.leading !== void 0 || b.props.type === "radio" || b.props.type === "checkbox"
|
|
2673
|
+
), bo = Ze.map((b, T) => {
|
|
2674
|
+
if (Jt(b)) {
|
|
2675
|
+
const A = {
|
|
2676
|
+
"data-menu-index": T,
|
|
2677
|
+
__interactionsDisabled: Qe,
|
|
2678
|
+
__index: T,
|
|
2679
|
+
id: b.props.id ?? bt(T),
|
|
2680
|
+
disabled: b.props.disabled,
|
|
2681
|
+
active: T === X && de,
|
|
2682
|
+
focusVisible: xe && de,
|
|
2683
|
+
horizontal: n,
|
|
2684
|
+
expanded: We && Z === T,
|
|
2685
|
+
fixedLeading: b.props.fixedLeading ?? (k && yo),
|
|
2686
|
+
variant: b.props.variant ?? y,
|
|
2687
|
+
shape: b.props.shape ?? m,
|
|
2688
|
+
color: b.props.color ?? s,
|
|
2689
|
+
density: b.props.density ?? B,
|
|
2690
|
+
shortcutColor: b.props.shortcutColor ?? ye,
|
|
2691
|
+
textColor: b.props.textColor ?? G,
|
|
2692
|
+
labelColor: b.props.labelColor ?? te,
|
|
2693
|
+
descriptionColor: b.props.descriptionColor ?? ee,
|
|
2694
|
+
checkedIcon: b.props.checkedIcon ?? (b.props.type === "checkbox" ? be : j),
|
|
2695
|
+
uncheckedIcon: b.props.uncheckedIcon ?? (b.props.type === "checkbox" ? me : ae),
|
|
2696
|
+
selectedColor: b.props.selectedColor ?? Ce,
|
|
2697
|
+
touchEffects: b.props.touchEffects ?? ie,
|
|
2698
|
+
selectedEffects: b.props.selectedEffects ?? Ve,
|
|
2699
|
+
focusEffects: b.props.focusEffects ?? ne,
|
|
2700
|
+
labelFont: b.props.labelFont ?? W,
|
|
2701
|
+
font: b.props.font ?? oe,
|
|
2702
|
+
descriptionFont: b.props.descriptionFont ?? ce,
|
|
2703
|
+
shortcutFont: b.props.shortcutFont ?? Ie,
|
|
2704
|
+
onClick: (Fe) => {
|
|
2705
|
+
qt(Fe, T);
|
|
2706
|
+
},
|
|
2707
|
+
onMouseEnter: (Fe) => {
|
|
2708
|
+
qe(Fe, T);
|
|
2709
|
+
},
|
|
2710
|
+
onMouseLeave: (Fe) => {
|
|
2711
|
+
jt();
|
|
2712
|
+
}
|
|
2713
|
+
};
|
|
2714
|
+
return Rt(b, {
|
|
2715
|
+
...b.props,
|
|
2716
|
+
...A
|
|
2717
|
+
});
|
|
2718
|
+
} else if (Qt(b)) {
|
|
2719
|
+
const A = en(Ue) === "onSurface" ? "outlineVariant" : en(Ue), Fe = {
|
|
2720
|
+
borderColor: b.props.borderColor ?? b.props.color ?? A ?? "outlineVariant",
|
|
2721
|
+
vertical: n,
|
|
2722
|
+
insetSize: b.props.insetSize ?? 8,
|
|
2723
|
+
spacing: b.props.spacing ?? (y === "modern" ? 5 : 8),
|
|
2724
|
+
inset: b.props.inset ?? (y === "modern" ? "middle" : void 0)
|
|
2725
|
+
};
|
|
2726
|
+
return Rt(b, { ...b.props, ...Fe });
|
|
2727
|
+
}
|
|
2728
|
+
return Rt(b, {
|
|
2729
|
+
...b.props
|
|
2730
|
+
});
|
|
2731
|
+
});
|
|
2732
|
+
function vo(b) {
|
|
2733
|
+
b.target.closest("[data-menu-index]") || We && ft();
|
|
2734
|
+
}
|
|
2735
|
+
const Co = (b) => {
|
|
2736
|
+
if (!t || Qe)
|
|
2737
|
+
return;
|
|
2738
|
+
let T = b.key;
|
|
2739
|
+
if (n) {
|
|
2740
|
+
const lt = {
|
|
2741
|
+
ArrowDown: "ArrowRight",
|
|
2742
|
+
ArrowUp: "ArrowLeft",
|
|
2743
|
+
ArrowRight: "ArrowDown",
|
|
2744
|
+
ArrowLeft: "ArrowUp"
|
|
2745
|
+
};
|
|
2746
|
+
T = lt[T] ? lt[T] : T;
|
|
2747
|
+
}
|
|
2748
|
+
if (le.length === 0 && T !== "Tab")
|
|
2749
|
+
return;
|
|
2750
|
+
const A = le.indexOf(X);
|
|
2751
|
+
let Fe;
|
|
2752
|
+
switch (T) {
|
|
2753
|
+
case "ArrowUp":
|
|
2754
|
+
b.preventDefault(), X === -1 || A === -1 ? Fe = le[le.length - 1] : Fe = A > 0 ? le[A - 1] : le[le.length - 1], ue(Fe), n && ot(Fe) && st(Fe);
|
|
2755
|
+
break;
|
|
2756
|
+
case "ArrowDown":
|
|
2757
|
+
b.preventDefault(), X === -1 || A === -1 ? Fe = le[0] : Fe = le[A + 1 < le.length ? A + 1 : 0], ue(Fe), n && ot(Fe) && st(Fe);
|
|
2758
|
+
break;
|
|
2759
|
+
case "Home":
|
|
2760
|
+
ue(le[0]);
|
|
2761
|
+
break;
|
|
2762
|
+
case "End":
|
|
2763
|
+
ue(le[le.length - 1]);
|
|
2764
|
+
break;
|
|
2765
|
+
case "Enter":
|
|
2766
|
+
case " ":
|
|
2767
|
+
b.stopPropagation(), b.preventDefault(), A >= 0 && Tt(le[A]);
|
|
2768
|
+
break;
|
|
2769
|
+
case "ArrowRight":
|
|
2770
|
+
b.preventDefault(), A >= 0 && ot(le[A]) ? st(le[A]) : D && D(!0);
|
|
2771
|
+
break;
|
|
2772
|
+
case "ArrowLeft":
|
|
2773
|
+
b.preventDefault(), D && N === 1 ? D(!1) : Et();
|
|
2774
|
+
break;
|
|
2775
|
+
case "Escape":
|
|
2776
|
+
b.preventDefault(), Et();
|
|
2777
|
+
break;
|
|
2778
|
+
case "Tab":
|
|
2779
|
+
H || (b.stopPropagation(), b.preventDefault()), et();
|
|
2780
|
+
break;
|
|
2781
|
+
}
|
|
2782
|
+
};
|
|
2783
|
+
if (!t && !J || !e && !H)
|
|
2784
|
+
return null;
|
|
2785
|
+
const xo = {
|
|
2786
|
+
"--uui-reverse": $,
|
|
2787
|
+
"--uui-duration": $ === "reverse" ? String(Q * 0.67) + "ms" : String(Q) + "ms"
|
|
2788
|
+
}, Sn = Er(v), wo = Sn === "none" ? "" : ln[Sn], No = x === "expressive" ? "uui-motion-expressive" : "", Pt = E({ ...h, ...xo });
|
|
2789
|
+
Pt.bg(Ue), Pt.text.on(Ue), p && +p > 0 && Pt.border(zt(u));
|
|
2790
|
+
const ko = [
|
|
2791
|
+
"uui-menu",
|
|
2792
|
+
`uui-menu-level-${String(Re)}`,
|
|
2793
|
+
n && "uui-menu-horizontal",
|
|
2794
|
+
he && "uui-menu-active",
|
|
2795
|
+
y === "modern" ? "uui-menu-modern" : "uui-menu-classic",
|
|
2796
|
+
Oe && wo,
|
|
2797
|
+
No,
|
|
2798
|
+
ut(B),
|
|
2799
|
+
_e(m ?? (y === "modern" ? "rounded" : "smooth")),
|
|
2800
|
+
at(Je),
|
|
2801
|
+
p !== void 0 ? it(p) : null,
|
|
2802
|
+
f
|
|
2803
|
+
].filter(Boolean).join(" "), So = de && X >= 0 && t && J ? ((Dn = Ze[X]) == null ? void 0 : Dn.props).id ?? bt(X) : void 0, Ln = /* @__PURE__ */ r(
|
|
2804
|
+
"div",
|
|
2805
|
+
{
|
|
2806
|
+
...U,
|
|
2807
|
+
"aria-orientation": n ? "horizontal" : "vertical",
|
|
2808
|
+
className: ko,
|
|
2809
|
+
"data-menu-group": De,
|
|
2810
|
+
id: g,
|
|
2811
|
+
onClick: vo,
|
|
2812
|
+
onKeyDown: Co,
|
|
2813
|
+
ref: yt(Be, P),
|
|
2814
|
+
role: "menu",
|
|
2815
|
+
style: {
|
|
2816
|
+
position: H ? "relative" : "fixed",
|
|
2817
|
+
left: (re == null ? void 0 : re.x) ?? 0,
|
|
2818
|
+
top: (re == null ? void 0 : re.y) ?? 0,
|
|
2819
|
+
zIndex: 9999,
|
|
2820
|
+
visibility: re ? "visible" : "hidden",
|
|
2821
|
+
...Pt.get()
|
|
2822
|
+
},
|
|
2823
|
+
tabIndex: 0,
|
|
2824
|
+
...Ee,
|
|
2825
|
+
"aria-activedescendant": So,
|
|
2826
|
+
children: /* @__PURE__ */ r("div", { className: "uui-menu-scroll", children: bo })
|
|
2827
|
+
}
|
|
2828
|
+
);
|
|
2829
|
+
let Bn = null;
|
|
2830
|
+
if (Z !== -1) {
|
|
2831
|
+
const b = At(Z);
|
|
2832
|
+
b && b.length > 0 && (Bn = b);
|
|
2833
|
+
}
|
|
2834
|
+
const In = un(
|
|
2835
|
+
"uui-menu-root",
|
|
2836
|
+
/* @__PURE__ */ I(rt, { children: [
|
|
2837
|
+
!H && Ln,
|
|
2838
|
+
we.current && Z !== -1 && /* @__PURE__ */ r(
|
|
2839
|
+
xn,
|
|
2840
|
+
{
|
|
2841
|
+
__closeRootMenu: F ?? et,
|
|
2842
|
+
__groupId: De,
|
|
2843
|
+
__horizontalDepth: n ? 1 : N && N + 1,
|
|
2844
|
+
__level: Re + 1,
|
|
2845
|
+
__navigateHorizontal: n ? vt : D,
|
|
2846
|
+
anchorRef: we,
|
|
2847
|
+
animation: v,
|
|
2848
|
+
"aria-orientation": "vertical",
|
|
2849
|
+
border: p,
|
|
2850
|
+
borderColor: u,
|
|
2851
|
+
checkedIcon: be,
|
|
2852
|
+
closeOnChange: ke,
|
|
2853
|
+
color: Ue,
|
|
2854
|
+
density: B,
|
|
2855
|
+
descriptionColor: ee,
|
|
2856
|
+
descriptionFont: ce,
|
|
2857
|
+
duration: w,
|
|
2858
|
+
elevation: d,
|
|
2859
|
+
fixedLeading: k,
|
|
2860
|
+
floatingMode: n ? "menu" : "submenu",
|
|
2861
|
+
font: oe,
|
|
2862
|
+
itemFocusEffects: ne,
|
|
2863
|
+
itemSelectedEffects: Ve,
|
|
2864
|
+
itemTouchEffects: ie,
|
|
2865
|
+
labelColor: te,
|
|
2866
|
+
labelFont: W,
|
|
2867
|
+
motionStyle: x,
|
|
2868
|
+
offset: 0,
|
|
2869
|
+
onClose: ft,
|
|
2870
|
+
open: t && We,
|
|
2871
|
+
openOnHover: _,
|
|
2872
|
+
placement: "auto",
|
|
2873
|
+
radioCheckedIcon: j,
|
|
2874
|
+
radioUncheckedIcon: ae,
|
|
2875
|
+
role: "menu",
|
|
2876
|
+
selectedColor: Ce,
|
|
2877
|
+
shape: m,
|
|
2878
|
+
shortcutColor: ye,
|
|
2879
|
+
shortcutFont: Ie,
|
|
2880
|
+
textColor: G,
|
|
2881
|
+
uncheckedIcon: me,
|
|
2882
|
+
variant: y,
|
|
2883
|
+
children: Bn
|
|
2884
|
+
}
|
|
2885
|
+
)
|
|
2886
|
+
] })
|
|
2887
|
+
);
|
|
2888
|
+
return H && Re === 0 ? /* @__PURE__ */ I(rt, { children: [
|
|
2889
|
+
Ln,
|
|
2890
|
+
In
|
|
2891
|
+
] }) : In;
|
|
2892
|
+
}
|
|
2893
|
+
);
|
|
2894
|
+
xn[oo] = !0;
|
|
2895
|
+
xn.displayName = "Menu";
|
|
2896
|
+
const io = S(
|
|
2897
|
+
({
|
|
2898
|
+
shape: e,
|
|
2899
|
+
touchEffects: t = ["ripple"],
|
|
2900
|
+
focusEffects: n = ["ring", "overlay"],
|
|
2901
|
+
selectedEffects: o = ["color"],
|
|
2902
|
+
checkedIcon: i,
|
|
2903
|
+
uncheckedIcon: a,
|
|
2904
|
+
selectedColor: s,
|
|
2905
|
+
textColor: d,
|
|
2906
|
+
labelColor: l,
|
|
2907
|
+
descriptionColor: m,
|
|
2908
|
+
shortcutColor: p,
|
|
2909
|
+
fixedLeading: u,
|
|
2910
|
+
color: f,
|
|
2911
|
+
icon: c,
|
|
2912
|
+
endIcon: h,
|
|
2913
|
+
leading: g,
|
|
2914
|
+
trailing: C,
|
|
2915
|
+
label: y,
|
|
2916
|
+
disabled: v = !1,
|
|
2917
|
+
className: w,
|
|
2918
|
+
onClick: x,
|
|
2919
|
+
badge: k,
|
|
2920
|
+
expanded: B,
|
|
2921
|
+
active: L,
|
|
2922
|
+
children: M,
|
|
2923
|
+
focusVisible: F,
|
|
2924
|
+
type: D = "item",
|
|
2925
|
+
checked: N,
|
|
2926
|
+
description: H,
|
|
2927
|
+
shortcut: G,
|
|
2928
|
+
density: ee,
|
|
2929
|
+
horizontal: te,
|
|
2930
|
+
labelFont: ye,
|
|
2931
|
+
font: me,
|
|
2932
|
+
descriptionFont: be,
|
|
2933
|
+
shortcutFont: ae,
|
|
2934
|
+
selected: j,
|
|
2935
|
+
__index: Ce,
|
|
2936
|
+
__interactionsDisabled: ie,
|
|
2937
|
+
onChange: Ve,
|
|
2938
|
+
variant: ne = "classic",
|
|
2939
|
+
...ke
|
|
2940
|
+
}, _) => {
|
|
2941
|
+
const W = V(null), oe = Ye.Children.toArray(M), ce = oe.find((O) => St(O)), Ie = oe.filter((O) => !St(O)), K = !!ce;
|
|
2942
|
+
let ve;
|
|
2943
|
+
D !== "item" && (D === "radio" ? ve = N ? i ?? eo : a ?? to : D === "checkbox" && (ve = N ? i ?? ar : a));
|
|
2944
|
+
const Ee = ve ?? g ?? c ?? (u && !te), Be = Ee && /* @__PURE__ */ r("div", { className: "uui-icon uui-leading", children: Ee }), Y = C ?? h;
|
|
2945
|
+
let Z;
|
|
2946
|
+
k && (typeof k == "string" || typeof k == "number" ? Z = /* @__PURE__ */ r(vn, { value: k }) : Z = k);
|
|
2947
|
+
const Te = ne === "modern" ? "labelLarge" : "bodyLarge", X = ye ?? me ?? Te, ue = be ?? (ne === "modern" ? "bodySmall" : "bodyMedium"), xe = ae ?? Te, de = E();
|
|
2948
|
+
de.text(p);
|
|
2949
|
+
const U = K && !te ? Qn : Y, Re = G && /* @__PURE__ */ r("div", { className: `uui-menu-item-shortcut ${Le(xe)}`, style: de.get(), children: G }), Pe = (G ?? k ?? U) && /* @__PURE__ */ I(rt, { children: [
|
|
2950
|
+
Re,
|
|
2951
|
+
Z,
|
|
2952
|
+
U && /* @__PURE__ */ r("div", { className: "uui-icon uui-trailing", children: U })
|
|
2953
|
+
] }), De = E();
|
|
2954
|
+
De.text(l);
|
|
2955
|
+
const se = y && /* @__PURE__ */ r("div", { className: `uui-menu-item-label ${Le(X)}`, style: De.get(), children: y }), P = E();
|
|
2956
|
+
(m || !d && ne === "classic" && (f != null && f.startsWith("surface"))) && (m ? P.text(m) : P.text.on("surfaceVariant"));
|
|
2957
|
+
const we = H && /* @__PURE__ */ r(
|
|
2958
|
+
"div",
|
|
2959
|
+
{
|
|
2960
|
+
className: `uui-menu-item-description ${Le(ue)}`,
|
|
2961
|
+
style: P.get(),
|
|
2962
|
+
children: H
|
|
2963
|
+
}
|
|
2964
|
+
), re = (se ?? we) && /* @__PURE__ */ I("div", { className: "uui-menu-item-text", children: [
|
|
2965
|
+
se,
|
|
2966
|
+
we
|
|
2967
|
+
] }), Se = (O) => {
|
|
2968
|
+
if (ie || v) {
|
|
2969
|
+
O == null || O.preventDefault();
|
|
2970
|
+
return;
|
|
2971
|
+
}
|
|
2972
|
+
x == null || x(O), t.includes("ripple") && W.current && O && Lt(W.current, O);
|
|
2973
|
+
};
|
|
2974
|
+
let he = f ?? (ne === "modern" ? "surfaceContainerLow" : "surfaceContainer");
|
|
2975
|
+
D === "option" && j && o.includes("color") && (he = s ?? (ne === "modern" ? "tertiaryContainer" : "secondaryContainer"));
|
|
2976
|
+
const J = E();
|
|
2977
|
+
J.bg.on(he);
|
|
2978
|
+
const fe = E();
|
|
2979
|
+
fe.bg(he), d ? fe.text(d) : fe.text.on(he);
|
|
2980
|
+
const Oe = [
|
|
2981
|
+
"uui-menu-item",
|
|
2982
|
+
w,
|
|
2983
|
+
ut(ee),
|
|
2984
|
+
v && "uui-disabled",
|
|
2985
|
+
ne === "modern" ? "uui-menu-item-modern" : "uui-menu-item-classic"
|
|
2986
|
+
].filter(Boolean).join(" "), Ne = _e(e ?? (ne === "modern" ? "rounded" : "smooth")), $ = [
|
|
2987
|
+
"uui-menu-item-content",
|
|
2988
|
+
Ne,
|
|
2989
|
+
...n.includes("ring") && L ? ["uui-focus-ring-in"] : [],
|
|
2990
|
+
...n.includes("overlay") && L ? ["uui-focus-overlay"] : [],
|
|
2991
|
+
L && "uui-active",
|
|
2992
|
+
L && F && "uui-focus-visible"
|
|
2993
|
+
].filter(Boolean).join(" "), R = /* @__PURE__ */ I("div", { className: $, style: fe.get(), children: [
|
|
2994
|
+
Ie.length > 0 ? /* @__PURE__ */ r("div", { className: "uui-menu-item-children", children: Ie }) : /* @__PURE__ */ I(rt, { children: [
|
|
2995
|
+
Be,
|
|
2996
|
+
re,
|
|
2997
|
+
Pe
|
|
2998
|
+
] }),
|
|
2999
|
+
/* @__PURE__ */ r("div", { className: ["uui-state", Ne].join(" "), style: J.get() })
|
|
3000
|
+
] });
|
|
3001
|
+
let Ae = "menuitem";
|
|
3002
|
+
return (D === "radio" || D === "checkbox") && (Ae = D === "radio" ? "menuitemradio" : "menuitemcheckbox"), // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events
|
|
3003
|
+
/* @__PURE__ */ r(
|
|
3004
|
+
"div",
|
|
3005
|
+
{
|
|
3006
|
+
...ke,
|
|
3007
|
+
"aria-checked": D === "radio" || D === "checkbox" ? N ?? !1 : void 0,
|
|
3008
|
+
"aria-disabled": v ? "true" : void 0,
|
|
3009
|
+
"aria-expanded": K ? B : void 0,
|
|
3010
|
+
"aria-haspopup": K ? "menu" : void 0,
|
|
3011
|
+
className: Oe,
|
|
3012
|
+
onClick: Se,
|
|
3013
|
+
ref: yt(W, _),
|
|
3014
|
+
role: Ae,
|
|
3015
|
+
tabIndex: -1,
|
|
3016
|
+
children: R
|
|
3017
|
+
}
|
|
3018
|
+
);
|
|
3019
|
+
}
|
|
3020
|
+
);
|
|
3021
|
+
io[Cn] = !0;
|
|
3022
|
+
io.displayName = "MenuItem";
|
|
3023
|
+
const so = (e) => {
|
|
3024
|
+
const {
|
|
3025
|
+
className: t,
|
|
3026
|
+
borderColor: n,
|
|
3027
|
+
color: o,
|
|
3028
|
+
border: i = 1,
|
|
3029
|
+
inset: a = "none",
|
|
3030
|
+
insetSize: s = 16,
|
|
3031
|
+
spacing: d = 8,
|
|
3032
|
+
vertical: l,
|
|
3033
|
+
variant: m = "strong",
|
|
3034
|
+
elevation: p,
|
|
3035
|
+
shape: u,
|
|
3036
|
+
style: f,
|
|
3037
|
+
height: c,
|
|
3038
|
+
...h
|
|
3039
|
+
} = e, g = V(null), [C, y] = q(!1);
|
|
3040
|
+
jn(() => {
|
|
3041
|
+
const B = g.current;
|
|
3042
|
+
if (!(B != null && B.parentElement))
|
|
3043
|
+
return;
|
|
3044
|
+
const L = getComputedStyle(B.parentElement).display;
|
|
3045
|
+
y(L.includes("flex"));
|
|
3046
|
+
}, []);
|
|
3047
|
+
const v = Math.min(4, Math.max(0, i)), w = je(
|
|
3048
|
+
"uui-divider",
|
|
3049
|
+
it(v === 0 ? 0 : 1),
|
|
3050
|
+
t,
|
|
3051
|
+
at(p),
|
|
3052
|
+
u && _e(u)
|
|
3053
|
+
), x = E(f), k = zt(n ?? o ?? "outlineVariant");
|
|
3054
|
+
if (x.border(k), x.bg(k), m !== "strong" && (m === "subtle" ? x.set("opacity", "var(--uui-subtle-opacity)") : x.set("opacity", "var(--uui-medium-opacity)")), C ? l ? x.merge({
|
|
3055
|
+
height: c,
|
|
3056
|
+
alignSelf: "stretch",
|
|
3057
|
+
width: `${v}px`,
|
|
3058
|
+
marginInline: `${d}px`
|
|
3059
|
+
}) : x.merge({
|
|
3060
|
+
flex: "1 1 auto",
|
|
3061
|
+
height: `${v}px`,
|
|
3062
|
+
marginBlock: `${d}px`
|
|
3063
|
+
}) : l ? x.merge({
|
|
3064
|
+
height: c,
|
|
3065
|
+
display: "inline-block",
|
|
3066
|
+
verticalAlign: "middle",
|
|
3067
|
+
width: `${v}px`,
|
|
3068
|
+
marginInline: `${d}px`
|
|
3069
|
+
}) : x.merge({
|
|
3070
|
+
height: `${v}px`,
|
|
3071
|
+
marginBlock: `${d}px`
|
|
3072
|
+
}), a !== "none") {
|
|
3073
|
+
const B = a === "left" || a === "top" || a === "middle", L = a === "right" || a === "bottom" || a === "middle";
|
|
3074
|
+
B && (l ? x.set("marginBlockStart", `${s}px`) : x.set("marginInlineStart", `${s}px`)), L && (l ? x.set("marginBlockEnd", `${s}px`) : x.set("marginInlineEnd", `${s}px`));
|
|
3075
|
+
}
|
|
3076
|
+
return /* @__PURE__ */ r(
|
|
3077
|
+
"div",
|
|
3078
|
+
{
|
|
3079
|
+
"aria-hidden": "true",
|
|
3080
|
+
className: w,
|
|
3081
|
+
ref: g,
|
|
3082
|
+
role: "separator",
|
|
3083
|
+
style: x.get(),
|
|
3084
|
+
...h
|
|
3085
|
+
}
|
|
3086
|
+
);
|
|
3087
|
+
};
|
|
3088
|
+
so[ro] = !0;
|
|
3089
|
+
so.displayName = "Divider";
|
|
3090
|
+
const Tr = S(
|
|
3091
|
+
({
|
|
3092
|
+
uncheckedBorder: e,
|
|
3093
|
+
border: t,
|
|
3094
|
+
color: n,
|
|
3095
|
+
borderColor: o,
|
|
3096
|
+
uncheckedBorderColor: i,
|
|
3097
|
+
shape: a = "round",
|
|
3098
|
+
size: s = "small",
|
|
3099
|
+
filled: d = !1,
|
|
3100
|
+
icon: l,
|
|
3101
|
+
uncheckedIcon: m,
|
|
3102
|
+
animation: p,
|
|
3103
|
+
...u
|
|
3104
|
+
}, f) => {
|
|
3105
|
+
const c = n ?? "primary";
|
|
3106
|
+
return /* @__PURE__ */ r(
|
|
3107
|
+
gn,
|
|
3108
|
+
{
|
|
3109
|
+
animation: p ?? "scale",
|
|
3110
|
+
border: !l && t === void 0 ? 2 : t,
|
|
3111
|
+
borderColor: o ?? c,
|
|
3112
|
+
color: c,
|
|
3113
|
+
elementClass: "uui-radio",
|
|
3114
|
+
filled: d,
|
|
3115
|
+
icon: l ?? sr,
|
|
3116
|
+
indeterminateIcon: void 0,
|
|
3117
|
+
ref: f,
|
|
3118
|
+
shape: a,
|
|
3119
|
+
size: s,
|
|
3120
|
+
type: "radio",
|
|
3121
|
+
uncheckedBorder: e ?? t ?? (m ? void 0 : 2),
|
|
3122
|
+
uncheckedBorderColor: i ?? o ?? "onSurfaceVariant",
|
|
3123
|
+
uncheckedIcon: m,
|
|
3124
|
+
...u
|
|
3125
|
+
}
|
|
3126
|
+
);
|
|
3127
|
+
}
|
|
3128
|
+
);
|
|
3129
|
+
Tr.displayName = "Radio";
|
|
3130
|
+
const Ei = ({ children: e, colorMode: t, seedColor: n, colors: o }) => {
|
|
3131
|
+
const [i, a] = q(() => {
|
|
3132
|
+
const p = t === "dark", u = En(n, o, Fn.schemes);
|
|
3133
|
+
return {
|
|
3134
|
+
darkMode: p,
|
|
3135
|
+
schemes: u
|
|
3136
|
+
};
|
|
3137
|
+
}), s = tt(
|
|
3138
|
+
(p) => {
|
|
3139
|
+
p ? document.body.classList.add("dark") : document.body.classList.remove("dark"), a((u) => ({ ...u, darkMode: p }));
|
|
3140
|
+
},
|
|
3141
|
+
[a]
|
|
3142
|
+
), d = tt(
|
|
3143
|
+
(p) => (i.darkMode ? i.schemes.dark : i.schemes.light)[p] ?? "",
|
|
3144
|
+
[i]
|
|
3145
|
+
), l = tt(
|
|
3146
|
+
(p, u) => i.schemes[p][u] ?? "",
|
|
3147
|
+
[i]
|
|
3148
|
+
);
|
|
3149
|
+
ge(() => {
|
|
3150
|
+
if (t) {
|
|
3151
|
+
const p = t === "dark";
|
|
3152
|
+
document.body.classList.toggle("dark", p), a((u) => ({ ...u, darkMode: p }));
|
|
3153
|
+
}
|
|
3154
|
+
}, [t]), ge(() => {
|
|
3155
|
+
const p = En(n, o, Fn.schemes);
|
|
3156
|
+
a((u) => ({
|
|
3157
|
+
darkMode: u.darkMode,
|
|
3158
|
+
schemes: p
|
|
3159
|
+
}));
|
|
3160
|
+
}, [o, n]), ge(() => {
|
|
3161
|
+
jo(i.schemes);
|
|
3162
|
+
}, [i.schemes]);
|
|
3163
|
+
const m = pt(
|
|
3164
|
+
() => ({
|
|
3165
|
+
theme: i,
|
|
3166
|
+
setTheme: a,
|
|
3167
|
+
darkMode: i.darkMode,
|
|
3168
|
+
setDarkMode: s,
|
|
3169
|
+
getColorValue: d,
|
|
3170
|
+
getThemeColorValue: l
|
|
3171
|
+
}),
|
|
3172
|
+
[d, l, s, i]
|
|
3173
|
+
);
|
|
3174
|
+
return /* @__PURE__ */ r(Wn.Provider, { value: m, children: e });
|
|
3175
|
+
}, Rr = S(
|
|
3176
|
+
({ children: e, className: t = "", title: n = "", align: o = "topRight", value: i, ...a }, s) => {
|
|
3177
|
+
const d = V(null);
|
|
3178
|
+
return /* @__PURE__ */ I("span", { className: "uui-tooltip-wrapper", ref: s, ...a, children: [
|
|
3179
|
+
/* @__PURE__ */ r(It, { align: o, tooltip: /* @__PURE__ */ r("div", { children: n }), triggerRef: d }),
|
|
3180
|
+
/* @__PURE__ */ r("div", { ref: d, children: e })
|
|
3181
|
+
] });
|
|
3182
|
+
}
|
|
3183
|
+
);
|
|
3184
|
+
Rr.displayName = "Tooltip";
|
|
3185
|
+
const Fr = S(
|
|
3186
|
+
({ direction: e = "col", ...t }, n) => /* @__PURE__ */ r(
|
|
3187
|
+
Me,
|
|
3188
|
+
{
|
|
3189
|
+
ref: n,
|
|
3190
|
+
...t,
|
|
3191
|
+
component: "article",
|
|
3192
|
+
direction: e,
|
|
3193
|
+
elementClass: "uui-article"
|
|
3194
|
+
}
|
|
3195
|
+
)
|
|
3196
|
+
);
|
|
3197
|
+
Fr.displayName = "Article";
|
|
3198
|
+
const Vr = S(
|
|
3199
|
+
({ direction: e = "col", ...t }, n) => /* @__PURE__ */ r(
|
|
3200
|
+
Me,
|
|
3201
|
+
{
|
|
3202
|
+
ref: n,
|
|
3203
|
+
...t,
|
|
3204
|
+
component: "aside",
|
|
3205
|
+
direction: e,
|
|
3206
|
+
elementClass: "uui-aside"
|
|
3207
|
+
}
|
|
3208
|
+
)
|
|
3209
|
+
);
|
|
3210
|
+
Vr.displayName = "Aside";
|
|
3211
|
+
const Ar = S(
|
|
3212
|
+
({ direction: e = "col", ...t }, n) => /* @__PURE__ */ r(
|
|
3213
|
+
Me,
|
|
3214
|
+
{
|
|
3215
|
+
ref: n,
|
|
3216
|
+
...t,
|
|
3217
|
+
direction: e,
|
|
3218
|
+
elementClass: "uui-article-content"
|
|
3219
|
+
}
|
|
3220
|
+
)
|
|
3221
|
+
);
|
|
3222
|
+
Ar.displayName = "Content";
|
|
3223
|
+
const jr = S((e, t) => /* @__PURE__ */ r(Me, { ...e, ref: t, type: "block" }));
|
|
3224
|
+
jr.displayName = "Div";
|
|
3225
|
+
const lo = S(
|
|
3226
|
+
({ direction: e = "row", ...t }, n) => /* @__PURE__ */ r(Me, { ...t, direction: e, ref: n, type: "flex" })
|
|
3227
|
+
);
|
|
3228
|
+
lo.displayName = "Flex";
|
|
3229
|
+
const Pr = S(
|
|
3230
|
+
({ direction: e = "row", ...t }, n) => /* @__PURE__ */ r(
|
|
3231
|
+
Me,
|
|
3232
|
+
{
|
|
3233
|
+
ref: n,
|
|
3234
|
+
...t,
|
|
3235
|
+
component: "footer",
|
|
3236
|
+
direction: e,
|
|
3237
|
+
elementClass: "uui-footer"
|
|
3238
|
+
}
|
|
3239
|
+
)
|
|
3240
|
+
);
|
|
3241
|
+
Pr.displayName = "Footer";
|
|
3242
|
+
const ao = S((e, t) => /* @__PURE__ */ r(Me, { ...e, ref: t, type: "grid" }));
|
|
3243
|
+
ao.displayName = "Grid";
|
|
3244
|
+
const Or = S(({ direction: e = "row", ...t }, n) => /* @__PURE__ */ r(Me, { ref: n, ...t, component: "header", direction: e, elementClass: "uui-header" }));
|
|
3245
|
+
Or.displayName = "Header";
|
|
3246
|
+
const _r = S(
|
|
3247
|
+
({ direction: e = "col", ...t }, n) => /* @__PURE__ */ r(
|
|
3248
|
+
Me,
|
|
3249
|
+
{
|
|
3250
|
+
ref: n,
|
|
3251
|
+
...t,
|
|
3252
|
+
component: "main",
|
|
3253
|
+
direction: e,
|
|
3254
|
+
elementClass: "uui-main"
|
|
3255
|
+
}
|
|
3256
|
+
)
|
|
3257
|
+
);
|
|
3258
|
+
_r.displayName = "Main";
|
|
3259
|
+
const Hr = S(
|
|
3260
|
+
({ direction: e = "row", ...t }, n) => /* @__PURE__ */ r(
|
|
3261
|
+
Me,
|
|
3262
|
+
{
|
|
3263
|
+
ref: n,
|
|
3264
|
+
...t,
|
|
3265
|
+
component: "nav",
|
|
3266
|
+
direction: e,
|
|
3267
|
+
elementClass: "uui-nav"
|
|
3268
|
+
}
|
|
3269
|
+
)
|
|
3270
|
+
);
|
|
3271
|
+
Hr.displayName = "Nav";
|
|
3272
|
+
const Ur = S(
|
|
3273
|
+
({ direction: e = "col", ...t }, n) => /* @__PURE__ */ r(
|
|
3274
|
+
Me,
|
|
3275
|
+
{
|
|
3276
|
+
ref: n,
|
|
3277
|
+
...t,
|
|
3278
|
+
component: "section",
|
|
3279
|
+
direction: e,
|
|
3280
|
+
elementClass: "uui-section"
|
|
3281
|
+
}
|
|
3282
|
+
)
|
|
3283
|
+
);
|
|
3284
|
+
Ur.displayName = "Section";
|
|
3285
|
+
const co = S(
|
|
3286
|
+
({
|
|
3287
|
+
description: e,
|
|
3288
|
+
error: t,
|
|
3289
|
+
font: n,
|
|
3290
|
+
label: o,
|
|
3291
|
+
disabled: i,
|
|
3292
|
+
legend: a,
|
|
3293
|
+
children: s,
|
|
3294
|
+
direction: d = "col",
|
|
3295
|
+
required: l,
|
|
3296
|
+
descriptionColor: m,
|
|
3297
|
+
descriptionFont: p,
|
|
3298
|
+
alignItems: u = "start",
|
|
3299
|
+
...f
|
|
3300
|
+
}, c) => {
|
|
3301
|
+
const h = a ?? o, g = ["uui-fieldset-legend", Le(n ?? "labelLarge")].filter(Boolean).join(" "), C = E();
|
|
3302
|
+
t ? C.text("error") : m ? C.text(m) : C.text.on("surfaceVariant");
|
|
3303
|
+
const y = [
|
|
3304
|
+
"uui-support-text",
|
|
3305
|
+
Le(p ?? "bodySmall"),
|
|
3306
|
+
t && "uui-error",
|
|
3307
|
+
e && !t && "uui-description"
|
|
3308
|
+
].filter(Boolean).join(" "), v = (e ?? t) && /* @__PURE__ */ r("div", { className: y, style: C.get(), children: t ?? e });
|
|
3309
|
+
return /* @__PURE__ */ I(rt, { children: [
|
|
3310
|
+
/* @__PURE__ */ r(sn.Provider, { value: { disabled: i }, children: /* @__PURE__ */ I(
|
|
3311
|
+
Me,
|
|
3312
|
+
{
|
|
3313
|
+
ref: c,
|
|
3314
|
+
...f,
|
|
3315
|
+
alignItems: u,
|
|
3316
|
+
component: "fieldset",
|
|
3317
|
+
direction: d,
|
|
3318
|
+
disabled: i,
|
|
3319
|
+
elementClass: "uui-fieldset",
|
|
3320
|
+
children: [
|
|
3321
|
+
h && /* @__PURE__ */ I("legend", { className: g, children: [
|
|
3322
|
+
h,
|
|
3323
|
+
l && /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "uui-required", children: "*" })
|
|
3324
|
+
] }),
|
|
3325
|
+
s
|
|
3326
|
+
]
|
|
3327
|
+
}
|
|
3328
|
+
) }),
|
|
3329
|
+
v
|
|
3330
|
+
] });
|
|
3331
|
+
}
|
|
3332
|
+
);
|
|
3333
|
+
co.displayName = "Fieldset";
|
|
3334
|
+
const zr = S(
|
|
3335
|
+
({
|
|
3336
|
+
name: e,
|
|
3337
|
+
disabled: t,
|
|
3338
|
+
onChange: n,
|
|
3339
|
+
value: o,
|
|
3340
|
+
defaultValue: i,
|
|
3341
|
+
children: a,
|
|
3342
|
+
...s
|
|
3343
|
+
}, d) => {
|
|
3344
|
+
const [l, m] = q(i), p = o !== void 0, u = p ? o : l, f = tt(
|
|
3345
|
+
(h) => {
|
|
3346
|
+
p || m(h), n == null || n(h);
|
|
3347
|
+
},
|
|
3348
|
+
[p, n]
|
|
3349
|
+
), c = pt(
|
|
3350
|
+
() => ({ name: e, value: u, setValue: f, disabled: t }),
|
|
3351
|
+
[e, u, f, t]
|
|
3352
|
+
);
|
|
3353
|
+
return /* @__PURE__ */ r(co, { disabled: t, ref: d, ...s, children: /* @__PURE__ */ r(zn.Provider, { value: c, children: a }) });
|
|
3354
|
+
}
|
|
3355
|
+
);
|
|
3356
|
+
zr.displayName = "RadioGroup";
|
|
3357
|
+
const uo = Symbol.for("uui.listItem");
|
|
3358
|
+
function Wr(e) {
|
|
3359
|
+
return ct(e) && typeof e.type != "string" && !!e.type[uo];
|
|
3360
|
+
}
|
|
3361
|
+
const Ti = ({ type: e = "single", defaultValue: t, children: n }) => {
|
|
3362
|
+
const [o, i] = q(t ? [t] : []), a = Ye.Children.toArray(n).filter(Wr);
|
|
3363
|
+
function s(p) {
|
|
3364
|
+
i((u) => {
|
|
3365
|
+
const f = u.includes(p);
|
|
3366
|
+
return e === "single" ? f ? [] : [p] : f ? u.filter((c) => c !== p) : [...u, p];
|
|
3367
|
+
});
|
|
3368
|
+
}
|
|
3369
|
+
function d(p) {
|
|
3370
|
+
i(e === "single" ? [p] : [p]);
|
|
3371
|
+
}
|
|
3372
|
+
function l() {
|
|
3373
|
+
i([]);
|
|
3374
|
+
}
|
|
3375
|
+
const m = pt(
|
|
3376
|
+
() => ({
|
|
3377
|
+
values: o,
|
|
3378
|
+
type: e,
|
|
3379
|
+
toggle: s,
|
|
3380
|
+
set: d,
|
|
3381
|
+
clear: l
|
|
3382
|
+
}),
|
|
3383
|
+
[o, e]
|
|
3384
|
+
);
|
|
3385
|
+
return /* @__PURE__ */ r(Wt.Provider, { value: m, children: /* @__PURE__ */ r("div", { "aria-orientation": "vertical", className: "uui-list uui-flex uui-flex-col", role: "listbox", children: a }) });
|
|
3386
|
+
}, wn = S(
|
|
3387
|
+
({
|
|
3388
|
+
shape: e,
|
|
3389
|
+
touchEffects: t = ["ripple"],
|
|
3390
|
+
focusEffects: n = ["ring", "overlay"],
|
|
3391
|
+
selectedEffects: o = ["color"],
|
|
3392
|
+
checkedIcon: i,
|
|
3393
|
+
uncheckedIcon: a,
|
|
3394
|
+
selectedColor: s,
|
|
3395
|
+
textColor: d,
|
|
3396
|
+
labelColor: l,
|
|
3397
|
+
descriptionColor: m,
|
|
3398
|
+
shortcutColor: p,
|
|
3399
|
+
fixedLeading: u,
|
|
3400
|
+
color: f,
|
|
3401
|
+
icon: c,
|
|
3402
|
+
endIcon: h,
|
|
3403
|
+
leading: g,
|
|
3404
|
+
trailing: C,
|
|
3405
|
+
label: y,
|
|
3406
|
+
disabled: v = !1,
|
|
3407
|
+
className: w,
|
|
3408
|
+
onClick: x,
|
|
3409
|
+
badge: k,
|
|
3410
|
+
expanded: B,
|
|
3411
|
+
active: L,
|
|
3412
|
+
children: M,
|
|
3413
|
+
focusVisible: F,
|
|
3414
|
+
type: D = "item",
|
|
3415
|
+
checked: N,
|
|
3416
|
+
description: H,
|
|
3417
|
+
shortcut: G,
|
|
3418
|
+
density: ee,
|
|
3419
|
+
horizontal: te,
|
|
3420
|
+
labelFont: ye,
|
|
3421
|
+
font: me,
|
|
3422
|
+
descriptionFont: be,
|
|
3423
|
+
shortcutFont: ae,
|
|
3424
|
+
selected: j,
|
|
3425
|
+
__index: Ce,
|
|
3426
|
+
__interactionsDisabled: ie,
|
|
3427
|
+
onChange: Ve,
|
|
3428
|
+
variant: ne = "classic",
|
|
3429
|
+
...ke
|
|
3430
|
+
}, _) => {
|
|
3431
|
+
const W = V(null), oe = Ye.Children.toArray(M), ce = oe.find((O) => St(O)), Ie = oe.filter((O) => !St(O)), K = !!ce;
|
|
3432
|
+
let ve;
|
|
3433
|
+
D !== "item" && (D === "radio" ? ve = N ? i ?? eo : a ?? to : D === "checkbox" && (ve = N ? i ?? lr : a));
|
|
3434
|
+
const Ee = ve ?? g ?? c ?? (u && !te), Be = Ee && /* @__PURE__ */ r("div", { className: "uui-icon uui-leading", children: Ee }), Y = C ?? h;
|
|
3435
|
+
let Z;
|
|
3436
|
+
k && (typeof k == "string" || typeof k == "number" ? Z = /* @__PURE__ */ r(vn, { value: k }) : Z = k);
|
|
3437
|
+
const Te = ne === "modern" ? "labelLarge" : "bodyLarge", X = ye ?? me ?? Te, ue = be ?? (ne === "modern" ? "bodySmall" : "bodyMedium"), xe = ae ?? Te, de = E();
|
|
3438
|
+
de.text(p);
|
|
3439
|
+
const U = K && !te ? Qn : Y, Re = G && /* @__PURE__ */ r("div", { className: `uui-menu-item-shortcut ${Le(xe)}`, style: de.get(), children: G }), Pe = (G ?? k ?? U) && /* @__PURE__ */ I(rt, { children: [
|
|
3440
|
+
Re,
|
|
3441
|
+
Z,
|
|
3442
|
+
U && /* @__PURE__ */ r("div", { className: "uui-icon uui-trailing", children: U })
|
|
3443
|
+
] }), De = E();
|
|
3444
|
+
De.text(l);
|
|
3445
|
+
const se = y && /* @__PURE__ */ r("div", { className: `uui-menu-item-label ${Le(X)}`, style: De.get(), children: y }), P = E();
|
|
3446
|
+
(m || !d && ne === "classic" && (f != null && f.startsWith("surface"))) && (m ? P.text(m) : P.text.on("surfaceVariant"));
|
|
3447
|
+
const we = H && /* @__PURE__ */ r(
|
|
3448
|
+
"div",
|
|
3449
|
+
{
|
|
3450
|
+
className: `uui-menu-item-description ${Le(ue)}`,
|
|
3451
|
+
style: P.get(),
|
|
3452
|
+
children: H
|
|
3453
|
+
}
|
|
3454
|
+
), re = (se ?? we) && /* @__PURE__ */ I("div", { className: "uui-menu-item-text", children: [
|
|
3455
|
+
se,
|
|
3456
|
+
we
|
|
3457
|
+
] }), Se = (O) => {
|
|
3458
|
+
if (ie || v) {
|
|
3459
|
+
O == null || O.preventDefault();
|
|
3460
|
+
return;
|
|
3461
|
+
}
|
|
3462
|
+
x == null || x(O), t.includes("ripple") && W.current && O && Lt(W.current, O);
|
|
3463
|
+
};
|
|
3464
|
+
let he = f ?? (ne === "modern" ? "surfaceContainerLow" : "surfaceContainer");
|
|
3465
|
+
D === "option" && j && o.includes("color") && (he = s ?? (ne === "modern" ? "tertiaryContainer" : "secondaryContainer"));
|
|
3466
|
+
const J = E();
|
|
3467
|
+
J.bg.on(he);
|
|
3468
|
+
const fe = E();
|
|
3469
|
+
fe.bg(he), d ? fe.text(d) : fe.text.on(he);
|
|
3470
|
+
const Oe = [
|
|
3471
|
+
"uui-menu-item",
|
|
3472
|
+
w,
|
|
3473
|
+
ut(ee),
|
|
3474
|
+
v && "uui-disabled",
|
|
3475
|
+
ne === "modern" ? "uui-menu-item-modern" : "uui-menu-item-classic"
|
|
3476
|
+
].filter(Boolean).join(" "), Ne = _e(e ?? (ne === "modern" ? "rounded" : "smooth")), $ = [
|
|
3477
|
+
"uui-menu-item-content",
|
|
3478
|
+
Ne,
|
|
3479
|
+
...n.includes("ring") && L ? ["uui-focus-ring-in"] : [],
|
|
3480
|
+
...n.includes("overlay") && L ? ["uui-focus-overlay"] : [],
|
|
3481
|
+
L && "uui-active",
|
|
3482
|
+
L && F && "uui-focus-visible"
|
|
3483
|
+
].filter(Boolean).join(" "), R = /* @__PURE__ */ I("div", { className: $, style: fe.get(), children: [
|
|
3484
|
+
Ie.length > 0 ? /* @__PURE__ */ r("div", { className: "uui-menu-item-children", children: Ie }) : /* @__PURE__ */ I(rt, { children: [
|
|
3485
|
+
Be,
|
|
3486
|
+
re,
|
|
3487
|
+
Pe
|
|
3488
|
+
] }),
|
|
3489
|
+
/* @__PURE__ */ r("div", { className: ["uui-state", Ne].join(" "), style: J.get() })
|
|
3490
|
+
] });
|
|
3491
|
+
return (
|
|
3492
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events
|
|
3493
|
+
/* @__PURE__ */ r(
|
|
3494
|
+
"div",
|
|
3495
|
+
{
|
|
3496
|
+
...ke,
|
|
3497
|
+
"aria-checked": D === "radio" || D === "checkbox" ? N ?? !1 : void 0,
|
|
3498
|
+
"aria-disabled": v ? "true" : void 0,
|
|
3499
|
+
"aria-expanded": K ? B : void 0,
|
|
3500
|
+
"aria-haspopup": K ? "menu" : void 0,
|
|
3501
|
+
className: Oe,
|
|
3502
|
+
onClick: Se,
|
|
3503
|
+
ref: yt(W, _),
|
|
3504
|
+
role: "option",
|
|
3505
|
+
tabIndex: -1,
|
|
3506
|
+
children: R
|
|
3507
|
+
}
|
|
3508
|
+
)
|
|
3509
|
+
);
|
|
3510
|
+
}
|
|
3511
|
+
);
|
|
3512
|
+
wn[uo] = !0;
|
|
3513
|
+
wn[Cn] = !0;
|
|
3514
|
+
wn.displayName = "ListItem";
|
|
3515
|
+
const Kr = S((e, t) => {
|
|
3516
|
+
const {
|
|
3517
|
+
density: n,
|
|
3518
|
+
icon: o,
|
|
3519
|
+
disabled: i,
|
|
3520
|
+
elevation: a,
|
|
3521
|
+
checked: s,
|
|
3522
|
+
children: d,
|
|
3523
|
+
color: l = "primary",
|
|
3524
|
+
uncheckedColor: m,
|
|
3525
|
+
defaultChecked: p,
|
|
3526
|
+
hoverEffects: u = ["overlay"],
|
|
3527
|
+
touchEffects: f = ["ripple"],
|
|
3528
|
+
focusEffects: c = ["ring"],
|
|
3529
|
+
selectedEffects: h = [],
|
|
3530
|
+
pressedEffects: g = ["overlay", "scale"],
|
|
3531
|
+
id: C,
|
|
3532
|
+
name: y,
|
|
3533
|
+
label: v,
|
|
3534
|
+
font: w,
|
|
3535
|
+
border: x,
|
|
3536
|
+
borderColor: k,
|
|
3537
|
+
uncheckedBorder: B,
|
|
3538
|
+
uncheckedBorderColor: L,
|
|
3539
|
+
onChange: M,
|
|
3540
|
+
onClick: F,
|
|
3541
|
+
onFocus: D,
|
|
3542
|
+
onBlur: N,
|
|
3543
|
+
required: H,
|
|
3544
|
+
shape: G = "round",
|
|
3545
|
+
title: ee,
|
|
3546
|
+
value: te,
|
|
3547
|
+
size: ye = "small",
|
|
3548
|
+
uncheckedIcon: me,
|
|
3549
|
+
description: be,
|
|
3550
|
+
className: ae,
|
|
3551
|
+
error: j,
|
|
3552
|
+
focusColor: Ce,
|
|
3553
|
+
duration: ie = 200,
|
|
3554
|
+
tooltipAlign: Ve = "auto",
|
|
3555
|
+
textPlacement: ne = "end",
|
|
3556
|
+
"aria-label": ke,
|
|
3557
|
+
readOnly: _,
|
|
3558
|
+
...W
|
|
3559
|
+
} = e, oe = V(null), ce = Ft(sn), Ie = i ?? (ce == null ? void 0 : ce.disabled), { focusVisible: K, isFocused: ve, focusHandlers: Ee } = Bt(D, N), Be = V(null), Y = V(null), Z = V(null), Te = V(xt("check")), X = C ?? Te.current, ue = s !== void 0, [xe, de] = q(p ?? !1), U = ue ? !!s : xe, Re = ke ?? (v ? void 0 : ee), Pe = j ? "error" : l, De = ee ? /* @__PURE__ */ r("div", { id: `${X}-tip`, children: ee }) : null, se = (Q) => {
|
|
3560
|
+
if (_) {
|
|
3561
|
+
Q.preventDefault();
|
|
3562
|
+
return;
|
|
3563
|
+
}
|
|
3564
|
+
const He = Q.currentTarget;
|
|
3565
|
+
ue || de(He.checked), M == null || M(Q);
|
|
3566
|
+
}, P = (Q) => {
|
|
3567
|
+
if (_) {
|
|
3568
|
+
Q.preventDefault();
|
|
3569
|
+
return;
|
|
3570
|
+
}
|
|
3571
|
+
f.includes("ripple") && (oe.current && clearTimeout(oe.current), oe.current = window.setTimeout(() => {
|
|
3572
|
+
Z.current && Y.current && (Lt(Z.current, Q, Y.current), oe.current = null);
|
|
3573
|
+
}, ie)), F == null || F(Q);
|
|
3574
|
+
}, we = [
|
|
3575
|
+
"uui-switch",
|
|
3576
|
+
ut(n),
|
|
3577
|
+
ae,
|
|
3578
|
+
j && "uui-error",
|
|
3579
|
+
Ie && "uui-disabled",
|
|
3580
|
+
...d ? [] : [gt(ye)]
|
|
3581
|
+
].filter(Boolean).join(" "), re = [
|
|
3582
|
+
"uui-switch-control",
|
|
3583
|
+
U && "uui-checked",
|
|
3584
|
+
me && "uui-symmetric-thumb",
|
|
3585
|
+
...u.includes("overlay") && !_ ? ["uui-hover-overlay"] : [],
|
|
3586
|
+
...c.includes("overlay") && K && ve ? ["uui-focus-overlay"] : [],
|
|
3587
|
+
...h.includes("overlay") ? ["uui-selected-overlay"] : [],
|
|
3588
|
+
...g.includes("overlay") && !_ ? ["uui-pressed-overlay"] : [],
|
|
3589
|
+
...g.includes("scale") && !_ ? ["uui-pressed-scale"] : [],
|
|
3590
|
+
_e(G),
|
|
3591
|
+
c.includes("ring") && K && ve && "uui-focus-visible uui-focus-ring"
|
|
3592
|
+
].filter(Boolean).join(" "), Se = E();
|
|
3593
|
+
Ce && K && ve && Se.set("--uui-focus-color", Hn(Ce).color), Se.set("--uui-switch-duration", `${ie}ms`);
|
|
3594
|
+
const he = ["uui-input"].filter(Boolean).join(" "), J = ["uui-state", _e("round")].filter(Boolean).join(" "), fe = E(), Ne = [
|
|
3595
|
+
"uui-switch-track",
|
|
3596
|
+
it(U ? x : B ?? x ?? 2),
|
|
3597
|
+
_e(G),
|
|
3598
|
+
at(a)
|
|
3599
|
+
].filter(Boolean).join(" "), $ = E(), R = ["uui-switch-thumb", _e(G)].filter(Boolean).join(" "), Ae = ["uui-icon"].filter(Boolean).join(" "), O = E(), Ke = ["uui-switch-glyph"].filter(Boolean).join(" "), ze = E(), Ue = E();
|
|
3600
|
+
$.border(j ? "error" : k ?? "outline"), Ue.border(j ? "error" : k ?? "outline"), U ? (fe.bg(Pe), $.bg(j ? "errorContainer" : l), ze.bg.on(l), O.text.onContainer(l)) : (L && ($.border(j ? "error" : L), Ue.border(j ? "error" : L)), fe.bg(j ? "error" : m ?? "onSurface"), $.bg(j ? "errorContainer" : m ?? "surfaceContainerHighest"), m ? (ze.bg.on(m), O.text.onContainer(m)) : (ze.bg(me ? "onSurfaceVariant" : "outline"), O.text("surfaceContainerHighest")));
|
|
3601
|
+
let Je;
|
|
3602
|
+
if (d) {
|
|
3603
|
+
const Q = [
|
|
3604
|
+
"uui-switch-content uui-overflow-hidden",
|
|
3605
|
+
_e(G),
|
|
3606
|
+
it(x),
|
|
3607
|
+
at(a)
|
|
3608
|
+
].filter(Boolean).join(" ");
|
|
3609
|
+
Je = /* @__PURE__ */ I("div", { className: Q, style: Ue.get(), children: [
|
|
3610
|
+
d,
|
|
3611
|
+
/* @__PURE__ */ r("div", { className: J, ref: Z, style: fe.get() })
|
|
3612
|
+
] });
|
|
3613
|
+
} else {
|
|
3614
|
+
const Q = U ? o : me;
|
|
3615
|
+
Je = /* @__PURE__ */ I(rt, { children: [
|
|
3616
|
+
/* @__PURE__ */ r("div", { className: Ne, style: $.get() }),
|
|
3617
|
+
/* @__PURE__ */ I("div", { className: R, children: [
|
|
3618
|
+
/* @__PURE__ */ r("div", { className: Ke, style: ze.get(), children: /* @__PURE__ */ r("div", { className: Ae, style: O.get(), children: Q }) }),
|
|
3619
|
+
/* @__PURE__ */ r("div", { className: J, ref: Z, style: fe.get() })
|
|
3620
|
+
] })
|
|
3621
|
+
] });
|
|
3622
|
+
}
|
|
3623
|
+
const Qe = v && /* @__PURE__ */ r(Gn, { font: w, htmlFor: X, label: v, required: H }), z = /* @__PURE__ */ r(mn, { description: be, error: j }), pe = /* @__PURE__ */ r("div", { className: "uui-switch-control-wrapper", children: /* @__PURE__ */ I("div", { className: re, ref: Y, style: Se.get(), children: [
|
|
3624
|
+
/* @__PURE__ */ r(
|
|
3625
|
+
"input",
|
|
3626
|
+
{
|
|
3627
|
+
...Ee,
|
|
3628
|
+
"aria-label": Re,
|
|
3629
|
+
"aria-readonly": _ === !0 ? !0 : void 0,
|
|
3630
|
+
checked: !!U,
|
|
3631
|
+
className: he,
|
|
3632
|
+
disabled: Ie,
|
|
3633
|
+
id: X,
|
|
3634
|
+
name: y,
|
|
3635
|
+
onChange: se,
|
|
3636
|
+
onClick: P,
|
|
3637
|
+
readOnly: _,
|
|
3638
|
+
ref: yt(Be, t),
|
|
3639
|
+
type: "checkbox",
|
|
3640
|
+
value: te,
|
|
3641
|
+
...W
|
|
3642
|
+
}
|
|
3643
|
+
),
|
|
3644
|
+
Je,
|
|
3645
|
+
De && /* @__PURE__ */ r(It, { align: Ve, tooltip: De, triggerRef: Be })
|
|
3646
|
+
] }) });
|
|
3647
|
+
return /* @__PURE__ */ r(
|
|
3648
|
+
pn,
|
|
3649
|
+
{
|
|
3650
|
+
className: we,
|
|
3651
|
+
control: pe,
|
|
3652
|
+
description: z,
|
|
3653
|
+
label: Qe,
|
|
3654
|
+
textPlacement: ne
|
|
3655
|
+
}
|
|
3656
|
+
);
|
|
3657
|
+
});
|
|
3658
|
+
Kr.displayName = "Switch";
|
|
3659
|
+
const Zr = S(
|
|
3660
|
+
({ font: e = "headlineLarge", ...t }, n) => /* @__PURE__ */ r(
|
|
3661
|
+
dt,
|
|
3662
|
+
{
|
|
3663
|
+
ref: n,
|
|
3664
|
+
...t,
|
|
3665
|
+
component: "h1",
|
|
3666
|
+
elementClass: "uui-h1",
|
|
3667
|
+
font: e
|
|
3668
|
+
}
|
|
3669
|
+
)
|
|
3670
|
+
);
|
|
3671
|
+
Zr.displayName = "H1";
|
|
3672
|
+
const qr = S(
|
|
3673
|
+
({ font: e = "headlineMedium", ...t }, n) => /* @__PURE__ */ r(
|
|
3674
|
+
dt,
|
|
3675
|
+
{
|
|
3676
|
+
ref: n,
|
|
3677
|
+
...t,
|
|
3678
|
+
component: "h2",
|
|
3679
|
+
elementClass: "uui-h2",
|
|
3680
|
+
font: e
|
|
3681
|
+
}
|
|
3682
|
+
)
|
|
3683
|
+
);
|
|
3684
|
+
qr.displayName = "H2";
|
|
3685
|
+
const Gr = S(
|
|
3686
|
+
({ font: e = "headlineSmall", ...t }, n) => /* @__PURE__ */ r(
|
|
3687
|
+
dt,
|
|
3688
|
+
{
|
|
3689
|
+
ref: n,
|
|
3690
|
+
...t,
|
|
3691
|
+
component: "h3",
|
|
3692
|
+
elementClass: "uui-h3",
|
|
3693
|
+
font: e
|
|
3694
|
+
}
|
|
3695
|
+
)
|
|
3696
|
+
);
|
|
3697
|
+
Gr.displayName = "H3";
|
|
3698
|
+
const Yr = S(
|
|
3699
|
+
({ font: e = "titleLarge", ...t }, n) => /* @__PURE__ */ r(
|
|
3700
|
+
dt,
|
|
3701
|
+
{
|
|
3702
|
+
ref: n,
|
|
3703
|
+
...t,
|
|
3704
|
+
component: "h4",
|
|
3705
|
+
elementClass: "uui-h4",
|
|
3706
|
+
font: e
|
|
3707
|
+
}
|
|
3708
|
+
)
|
|
3709
|
+
);
|
|
3710
|
+
Yr.displayName = "H4";
|
|
3711
|
+
const Xr = S(
|
|
3712
|
+
({ font: e = "titleMedium", ...t }, n) => /* @__PURE__ */ r(
|
|
3713
|
+
dt,
|
|
3714
|
+
{
|
|
3715
|
+
ref: n,
|
|
3716
|
+
...t,
|
|
3717
|
+
component: "h5",
|
|
3718
|
+
elementClass: "uui-h5",
|
|
3719
|
+
font: e
|
|
3720
|
+
}
|
|
3721
|
+
)
|
|
3722
|
+
);
|
|
3723
|
+
Xr.displayName = "H5";
|
|
3724
|
+
const Jr = S(
|
|
3725
|
+
({ font: e = "titleSmall", ...t }, n) => /* @__PURE__ */ r(
|
|
3726
|
+
dt,
|
|
3727
|
+
{
|
|
3728
|
+
ref: n,
|
|
3729
|
+
...t,
|
|
3730
|
+
component: "h6",
|
|
3731
|
+
elementClass: "uui-h6",
|
|
3732
|
+
font: e
|
|
3733
|
+
}
|
|
3734
|
+
)
|
|
3735
|
+
);
|
|
3736
|
+
Jr.displayName = "H6";
|
|
3737
|
+
const Qr = S((e, t) => /* @__PURE__ */ r(dt, { ref: t, ...e, component: "p", elementClass: "uui-p" }));
|
|
3738
|
+
Qr.displayName = "P";
|
|
3739
|
+
const ei = S((e, t) => /* @__PURE__ */ r(dt, { ref: t, ...e, component: "span", elementClass: "uui-span" }));
|
|
3740
|
+
ei.displayName = "Span";
|
|
3741
|
+
const ti = S(
|
|
3742
|
+
({ font: e = "labelLarge", ...t }, n) => /* @__PURE__ */ r(
|
|
3743
|
+
dt,
|
|
3744
|
+
{
|
|
3745
|
+
ref: n,
|
|
3746
|
+
...t,
|
|
3747
|
+
component: "label",
|
|
3748
|
+
elementClass: "uui-label",
|
|
3749
|
+
font: e
|
|
3750
|
+
}
|
|
3751
|
+
)
|
|
3752
|
+
);
|
|
3753
|
+
ti.displayName = "Label";
|
|
3754
|
+
const fo = Symbol.for("uui.accordionItem");
|
|
3755
|
+
function ni(e) {
|
|
3756
|
+
return ct(e) && typeof e.type != "string" && !!e.type[fo];
|
|
3757
|
+
}
|
|
3758
|
+
const Ri = ({
|
|
3759
|
+
type: e = "single",
|
|
3760
|
+
variant: t = "segmented",
|
|
3761
|
+
children: n,
|
|
3762
|
+
density: o,
|
|
3763
|
+
border: i,
|
|
3764
|
+
borderColor: a,
|
|
3765
|
+
elevation: s,
|
|
3766
|
+
showIcon: d,
|
|
3767
|
+
font: l,
|
|
3768
|
+
shape: m,
|
|
3769
|
+
animation: p,
|
|
3770
|
+
motionStyle: u,
|
|
3771
|
+
duration: f = 250,
|
|
3772
|
+
color: c,
|
|
3773
|
+
disabled: h
|
|
3774
|
+
}) => {
|
|
3775
|
+
const g = Wo(e, "vertical"), { values: C } = g, y = Ye.Children.toArray(n).filter(ni), x = {
|
|
3776
|
+
elevation: s,
|
|
3777
|
+
border: i ?? (t !== "text" ? 1 : void 0),
|
|
3778
|
+
borderColor: a,
|
|
3779
|
+
shape: m ?? (t !== "text" ? "round" : void 0)
|
|
3780
|
+
}, k = {
|
|
3781
|
+
density: o,
|
|
3782
|
+
variant: t,
|
|
3783
|
+
showIcon: d,
|
|
3784
|
+
font: l,
|
|
3785
|
+
animation: p,
|
|
3786
|
+
motionStyle: u,
|
|
3787
|
+
duration: f,
|
|
3788
|
+
color: c,
|
|
3789
|
+
disabled: h,
|
|
3790
|
+
...x
|
|
3791
|
+
}, B = pt(
|
|
3792
|
+
() => ({
|
|
3793
|
+
...g,
|
|
3794
|
+
config: k
|
|
3795
|
+
}),
|
|
3796
|
+
[k, g]
|
|
3797
|
+
), L = [], M = [];
|
|
3798
|
+
y.forEach((D) => {
|
|
3799
|
+
t === "pills" || t === "segmented" ? L.push([D]) : M.push(D);
|
|
3800
|
+
}), M.length && L.push(M);
|
|
3801
|
+
const F = ["uui-accordion-group", ut(o)];
|
|
3802
|
+
return /* @__PURE__ */ r(Wt.Provider, { value: B, children: /* @__PURE__ */ r("div", { className: `uui-accordion uui-accordion-${t}`, children: L.map((D, N) => {
|
|
3803
|
+
const G = D[0].props.value, ee = C.includes(G), te = N === 0, ye = N === y.length - 1, me = y[N - 1], be = y[N + 1], ae = me && C.includes(me.props.value), j = be && C.includes(be.props.value), Ce = t === "segmented", ie = Ce && !te && !ee && !ae, Ve = Ce && !ye && !ee && !j;
|
|
3804
|
+
return /* @__PURE__ */ r(
|
|
3805
|
+
Me,
|
|
3806
|
+
{
|
|
3807
|
+
...x,
|
|
3808
|
+
className: je(F, ee && "uui-open"),
|
|
3809
|
+
direction: "col",
|
|
3810
|
+
style: Ce ? {
|
|
3811
|
+
// Nakładanie ramek i odstępy
|
|
3812
|
+
// marginTop: shouldStickTop ? '0' : isFirst ? '0' : '12px',
|
|
3813
|
+
// Dynamiczne promienie (null/undefined przywraca domyślny z klasy shape)
|
|
3814
|
+
borderTopLeftRadius: ie ? 0 : void 0,
|
|
3815
|
+
borderTopRightRadius: ie ? 0 : void 0,
|
|
3816
|
+
borderBottomLeftRadius: Ve ? 0 : void 0,
|
|
3817
|
+
borderBottomRightRadius: Ve ? 0 : void 0,
|
|
3818
|
+
// overflowY: 'hidden',
|
|
3819
|
+
// clipPath: isOpen
|
|
3820
|
+
// ? 'inset(-100px -100px -100px -100px)'
|
|
3821
|
+
// : `inset(${topClip} -100px ${bottomClip} -100px)`,
|
|
3822
|
+
// Żeby cienie i ramki otwartego elementu były na wierzchu
|
|
3823
|
+
zIndex: ee ? 0 : N,
|
|
3824
|
+
position: "relative",
|
|
3825
|
+
transition: "all 250ms ease"
|
|
3826
|
+
} : void 0,
|
|
3827
|
+
children: D
|
|
3828
|
+
},
|
|
3829
|
+
G
|
|
3830
|
+
);
|
|
3831
|
+
}) }) });
|
|
3832
|
+
}, oi = ({
|
|
3833
|
+
value: e,
|
|
3834
|
+
label: t,
|
|
3835
|
+
children: n,
|
|
3836
|
+
leading: o,
|
|
3837
|
+
trailing: i,
|
|
3838
|
+
showIcon: a,
|
|
3839
|
+
icon: s,
|
|
3840
|
+
font: d,
|
|
3841
|
+
variant: l,
|
|
3842
|
+
animation: m,
|
|
3843
|
+
duration: p,
|
|
3844
|
+
motionStyle: u,
|
|
3845
|
+
flush: f,
|
|
3846
|
+
divided: c,
|
|
3847
|
+
onFocus: h,
|
|
3848
|
+
onBlur: g,
|
|
3849
|
+
color: C,
|
|
3850
|
+
disabled: y,
|
|
3851
|
+
hoverEffects: v = ["overlay"],
|
|
3852
|
+
focusEffects: w = ["ring", "overlay"],
|
|
3853
|
+
pressedEffects: x = ["overlay"],
|
|
3854
|
+
touchEffects: k = ["ripple"],
|
|
3855
|
+
selectedEffects: B = ["color"]
|
|
3856
|
+
}) => {
|
|
3857
|
+
const L = V(null), { values: M, toggle: F, roving: D, config: N } = Kn(), H = M.includes(e), { focusVisible: G, focusHandlers: ee } = Bt(h, g), te = `accordion-${e}`, ye = a ?? (N == null ? void 0 : N.showIcon) ?? !0, me = l ?? (N == null ? void 0 : N.variant) ?? "segmented", be = y ?? (N == null ? void 0 : N.disabled), ae = C ?? (N == null ? void 0 : N.color), j = ye && /* @__PURE__ */ r("div", { className: "uui-accordion-icon uui-icon", children: s ?? cr }), Ce = o && /* @__PURE__ */ r(dn, { content: o }), ie = (i ?? ye) && /* @__PURE__ */ r(fn, { content: i, end: j }), Ve = [
|
|
3858
|
+
"uui-accordion-trigger",
|
|
3859
|
+
Le(d ?? (N == null ? void 0 : N.font) ?? "labelLarge"),
|
|
3860
|
+
...w.includes("ring") && G ? ["uui-focus-ring"] : [],
|
|
3861
|
+
...w.includes("overlay") ? ["uui-focus-overlay"] : [],
|
|
3862
|
+
...v.includes("overlay") ? ["uui-hover-overlay"] : [],
|
|
3863
|
+
...x.includes("overlay") ? ["uui-pressed-overlay"] : []
|
|
3864
|
+
].filter(Boolean).join(" ");
|
|
3865
|
+
function ne(oe) {
|
|
3866
|
+
F(e), k.includes("ripple") && L.current && Lt(L.current, oe);
|
|
3867
|
+
}
|
|
3868
|
+
const ke = [
|
|
3869
|
+
`uui-accordion-item uui-accordion-item-${me}`,
|
|
3870
|
+
f && "uui-flush",
|
|
3871
|
+
c && "uui-divided"
|
|
3872
|
+
].filter(Boolean).join(" "), _ = E(), W = E();
|
|
3873
|
+
return W.bg.on(ae), _.bg(ae), _.text.on(ae), /* @__PURE__ */ I("div", { className: ke, "data-open": H, children: [
|
|
3874
|
+
/* @__PURE__ */ I("div", { className: "uui-accordion-header", ref: L, style: _.get(), children: [
|
|
3875
|
+
Ce,
|
|
3876
|
+
/* @__PURE__ */ I(
|
|
3877
|
+
"button",
|
|
3878
|
+
{
|
|
3879
|
+
...ee,
|
|
3880
|
+
"aria-controls": `${te}-content`,
|
|
3881
|
+
"aria-expanded": H,
|
|
3882
|
+
className: Ve,
|
|
3883
|
+
disabled: be,
|
|
3884
|
+
id: `${te}-trigger`,
|
|
3885
|
+
onClick: ne,
|
|
3886
|
+
onKeyDown: D == null ? void 0 : D.onKeyDown,
|
|
3887
|
+
ref: D == null ? void 0 : D.register,
|
|
3888
|
+
type: "button",
|
|
3889
|
+
children: [
|
|
3890
|
+
t,
|
|
3891
|
+
/* @__PURE__ */ r("div", { className: "uui-state", style: W.get() })
|
|
3892
|
+
]
|
|
3893
|
+
}
|
|
3894
|
+
),
|
|
3895
|
+
ie
|
|
3896
|
+
] }),
|
|
3897
|
+
/* @__PURE__ */ r(
|
|
3898
|
+
Kt,
|
|
3899
|
+
{
|
|
3900
|
+
animation: m ?? (N == null ? void 0 : N.animation),
|
|
3901
|
+
duration: p ?? (N == null ? void 0 : N.duration),
|
|
3902
|
+
motionStyle: u ?? (N == null ? void 0 : N.motionStyle),
|
|
3903
|
+
open: H,
|
|
3904
|
+
children: /* @__PURE__ */ r("div", { "aria-labelledby": `${te}-trigger`, id: `${te}-content`, role: "region", children: n })
|
|
3905
|
+
}
|
|
3906
|
+
)
|
|
3907
|
+
] });
|
|
3908
|
+
};
|
|
3909
|
+
oi[fo] = !0;
|
|
3910
|
+
const po = Symbol.for("uui.tab");
|
|
3911
|
+
function ri(e) {
|
|
3912
|
+
return ct(e) && typeof e.type != "string" && !!e.type[po];
|
|
3913
|
+
}
|
|
3914
|
+
const Fi = ({ defaultValue: e, children: t, ...n }) => {
|
|
3915
|
+
const [o, i] = q([e]), a = Pn.toArray(t).filter(ri);
|
|
3916
|
+
function s(p) {
|
|
3917
|
+
i([p]);
|
|
3918
|
+
}
|
|
3919
|
+
const d = pt(
|
|
3920
|
+
() => ({
|
|
3921
|
+
values: o,
|
|
3922
|
+
type: "single",
|
|
3923
|
+
toggle: s,
|
|
3924
|
+
set: s,
|
|
3925
|
+
clear: () => {
|
|
3926
|
+
i([]);
|
|
3927
|
+
}
|
|
3928
|
+
}),
|
|
3929
|
+
[o]
|
|
3930
|
+
);
|
|
3931
|
+
function l(p) {
|
|
3932
|
+
const u = a.findIndex((g) => o.includes(g.props.value));
|
|
3933
|
+
if (u === -1)
|
|
3934
|
+
return;
|
|
3935
|
+
let f;
|
|
3936
|
+
switch (p.key) {
|
|
3937
|
+
case "ArrowRight":
|
|
3938
|
+
f = (u + 1) % a.length;
|
|
3939
|
+
break;
|
|
3940
|
+
case "ArrowLeft":
|
|
3941
|
+
f = (u - 1 + a.length) % a.length;
|
|
3942
|
+
break;
|
|
3943
|
+
case "Home":
|
|
3944
|
+
f = 0;
|
|
3945
|
+
break;
|
|
3946
|
+
case "End":
|
|
3947
|
+
f = a.length - 1;
|
|
3948
|
+
break;
|
|
3949
|
+
default:
|
|
3950
|
+
return;
|
|
3951
|
+
}
|
|
3952
|
+
p.preventDefault();
|
|
3953
|
+
const c = a[f].props.value;
|
|
3954
|
+
s(c);
|
|
3955
|
+
const h = document.getElementById(`uui-tab-${c}-trigger`);
|
|
3956
|
+
h == null || h.focus();
|
|
3957
|
+
}
|
|
3958
|
+
const m = a.map((p) => ({
|
|
3959
|
+
label: p.props.label,
|
|
3960
|
+
value: p.props.value
|
|
3961
|
+
})).map(({ label: p, value: u }) => /* @__PURE__ */ r(
|
|
3962
|
+
"button",
|
|
3963
|
+
{
|
|
3964
|
+
"aria-controls": `uui-tab-${u}-panel`,
|
|
3965
|
+
"aria-selected": o.includes(u),
|
|
3966
|
+
className: "uui-tabs-trigger",
|
|
3967
|
+
id: `uui-tab-${u}-trigger`,
|
|
3968
|
+
onClick: () => {
|
|
3969
|
+
s(u);
|
|
3970
|
+
},
|
|
3971
|
+
role: "tab",
|
|
3972
|
+
tabIndex: o.includes(u) ? 0 : -1,
|
|
3973
|
+
children: p
|
|
3974
|
+
},
|
|
3975
|
+
u
|
|
3976
|
+
));
|
|
3977
|
+
return /* @__PURE__ */ r(Wt.Provider, { value: d, children: /* @__PURE__ */ I(Me, { direction: "col", gap: 2, ...n, children: [
|
|
3978
|
+
/* @__PURE__ */ r("div", { "aria-orientation": "horizontal", className: "uui-tabs-list", onKeyDown: l, role: "tablist", children: m }),
|
|
3979
|
+
/* @__PURE__ */ r("div", { className: "uui-tabs-panels", children: a })
|
|
3980
|
+
] }) });
|
|
3981
|
+
}, mo = ({ value: e, label: t, children: n }) => {
|
|
3982
|
+
const { values: o } = Kn(), i = o.includes(e);
|
|
3983
|
+
return /* @__PURE__ */ r(
|
|
3984
|
+
"div",
|
|
3985
|
+
{
|
|
3986
|
+
"aria-labelledby": `uui-tab-${e}-trigger`,
|
|
3987
|
+
className: "uui-tabs-panel",
|
|
3988
|
+
hidden: !i,
|
|
3989
|
+
id: `uui-tab-${e}-panel`,
|
|
3990
|
+
role: "tabpanel",
|
|
3991
|
+
children: n
|
|
3992
|
+
}
|
|
3993
|
+
);
|
|
3994
|
+
};
|
|
3995
|
+
mo[po] = !0;
|
|
3996
|
+
mo.displayName = "Tab";
|
|
3997
|
+
const ii = S(
|
|
3998
|
+
({
|
|
3999
|
+
variant: e = "docked",
|
|
4000
|
+
color: t,
|
|
4001
|
+
elevation: n,
|
|
4002
|
+
shape: o,
|
|
4003
|
+
density: i,
|
|
4004
|
+
fullWidth: a,
|
|
4005
|
+
placement: s = "bottom",
|
|
4006
|
+
fixed: d,
|
|
4007
|
+
divider: l,
|
|
4008
|
+
children: m,
|
|
4009
|
+
className: p,
|
|
4010
|
+
disabled: u,
|
|
4011
|
+
orientation: f = "horizontal",
|
|
4012
|
+
...c
|
|
4013
|
+
}, h) => {
|
|
4014
|
+
const g = e === "floating", C = n ?? (g ? 3 : 0), y = o ?? (g ? "round" : void 0), v = t ?? (e === "floating" ? "surfaceContainerHigh" : "surfaceContainer"), w = [
|
|
4015
|
+
"uui-toolbar",
|
|
4016
|
+
`uui-toolbar-${e}`,
|
|
4017
|
+
u && "uui-disabled",
|
|
4018
|
+
p,
|
|
4019
|
+
a && "uui-toolbar-full",
|
|
4020
|
+
d && "uui-toolbar-fixed",
|
|
4021
|
+
l && "uui-toolbar-divider",
|
|
4022
|
+
C && at(C),
|
|
4023
|
+
y && _e(y),
|
|
4024
|
+
i && ut(i),
|
|
4025
|
+
f === "horizontal" ? "uui-horizontal" : "uui-vertical"
|
|
4026
|
+
].filter(Boolean).join(" ");
|
|
4027
|
+
return /* @__PURE__ */ r(
|
|
4028
|
+
Me,
|
|
4029
|
+
{
|
|
4030
|
+
ref: h,
|
|
4031
|
+
...c,
|
|
4032
|
+
className: w,
|
|
4033
|
+
color: v,
|
|
4034
|
+
component: "div",
|
|
4035
|
+
"data-position": s,
|
|
4036
|
+
direction: f === "horizontal" ? "row" : "col",
|
|
4037
|
+
disabled: u,
|
|
4038
|
+
children: m
|
|
4039
|
+
}
|
|
4040
|
+
);
|
|
4041
|
+
}
|
|
4042
|
+
);
|
|
4043
|
+
ii.displayName = "Toolbar";
|
|
4044
|
+
const si = S(
|
|
4045
|
+
({
|
|
4046
|
+
variant: e = "linear",
|
|
4047
|
+
value: t,
|
|
4048
|
+
min: n = 0,
|
|
4049
|
+
max: o = 100,
|
|
4050
|
+
color: i = "primary",
|
|
4051
|
+
size: a = "medium",
|
|
4052
|
+
thickness: s,
|
|
4053
|
+
className: d,
|
|
4054
|
+
style: l,
|
|
4055
|
+
...m
|
|
4056
|
+
}, p) => {
|
|
4057
|
+
const u = typeof t == "number", f = pt(() => u ? Math.min(Math.max(t, n), o) : 0, [t, n, o, u]), c = pt(() => u ? (f - n) / (o - n) * 100 : 0, [f, n, o, u]), h = u ? {
|
|
4058
|
+
role: "progressbar",
|
|
4059
|
+
"aria-valuemin": n,
|
|
4060
|
+
"aria-valuemax": o,
|
|
4061
|
+
"aria-valuenow": f
|
|
4062
|
+
} : {
|
|
4063
|
+
role: "progressbar",
|
|
4064
|
+
"aria-valuemin": n,
|
|
4065
|
+
"aria-valuemax": o
|
|
4066
|
+
}, g = [
|
|
4067
|
+
"uui-progress",
|
|
4068
|
+
e === "circular" ? "uui-progress-circular" : "uui-progress-linear",
|
|
4069
|
+
u ? "" : "uui-progress-indeterminate",
|
|
4070
|
+
gt(a),
|
|
4071
|
+
d
|
|
4072
|
+
].filter(Boolean).join(" "), C = {
|
|
4073
|
+
...l ?? {},
|
|
4074
|
+
...s ? { "--uui-progress-thickness": `${s}px` } : {}
|
|
4075
|
+
};
|
|
4076
|
+
if (e === "circular") {
|
|
4077
|
+
const w = E(), x = E();
|
|
4078
|
+
return w.stroke.container(i), x.stroke(i), /* @__PURE__ */ r(
|
|
4079
|
+
Me,
|
|
4080
|
+
{
|
|
4081
|
+
className: g,
|
|
4082
|
+
ref: p,
|
|
4083
|
+
style: C,
|
|
4084
|
+
...h,
|
|
4085
|
+
...m,
|
|
4086
|
+
children: /* @__PURE__ */ I("svg", { className: "uui-progress-svg", viewBox: "0 0 100 100", children: [
|
|
4087
|
+
/* @__PURE__ */ r(
|
|
4088
|
+
"circle",
|
|
4089
|
+
{
|
|
4090
|
+
className: "uui-progress-track",
|
|
4091
|
+
cx: "50",
|
|
4092
|
+
cy: "50",
|
|
4093
|
+
fill: "none",
|
|
4094
|
+
r: "45",
|
|
4095
|
+
style: w.get()
|
|
4096
|
+
}
|
|
4097
|
+
),
|
|
4098
|
+
/* @__PURE__ */ r(
|
|
4099
|
+
"circle",
|
|
4100
|
+
{
|
|
4101
|
+
className: "uui-progress-indicator",
|
|
4102
|
+
cx: "50",
|
|
4103
|
+
cy: "50",
|
|
4104
|
+
fill: "none",
|
|
4105
|
+
pathLength: "100",
|
|
4106
|
+
r: "45",
|
|
4107
|
+
strokeDasharray: "100",
|
|
4108
|
+
strokeDashoffset: u ? 100 - c : void 0,
|
|
4109
|
+
style: x.get()
|
|
4110
|
+
}
|
|
4111
|
+
)
|
|
4112
|
+
] })
|
|
4113
|
+
}
|
|
4114
|
+
);
|
|
4115
|
+
}
|
|
4116
|
+
const y = E(), v = E();
|
|
4117
|
+
return y.bg.container(i), v.bg(i), /* @__PURE__ */ r(
|
|
4118
|
+
Me,
|
|
4119
|
+
{
|
|
4120
|
+
className: g,
|
|
4121
|
+
ref: p,
|
|
4122
|
+
style: C,
|
|
4123
|
+
...h,
|
|
4124
|
+
...m,
|
|
4125
|
+
children: /* @__PURE__ */ r("div", { className: "uui-progress-track", style: y.get(), children: /* @__PURE__ */ r(
|
|
4126
|
+
"div",
|
|
4127
|
+
{
|
|
4128
|
+
className: "uui-progress-indicator",
|
|
4129
|
+
style: {
|
|
4130
|
+
...v.get(),
|
|
4131
|
+
...u ? { width: `${c}%` } : {}
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
) })
|
|
4135
|
+
}
|
|
4136
|
+
);
|
|
4137
|
+
}
|
|
4138
|
+
);
|
|
4139
|
+
si.displayName = "Progress";
|
|
4140
|
+
const Nn = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), li = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth(), ai = (e) => Nn(e, /* @__PURE__ */ new Date()), ci = (e) => new Date(e.getFullYear(), e.getMonth(), 1), ui = (e) => new Date(e.getFullYear(), e.getMonth() + 1, 0), ho = (e, t = 1) => {
|
|
4141
|
+
const n = new Date(e), o = n.getDay(), i = (o < t ? 7 : 0) + o - t;
|
|
4142
|
+
return n.setDate(n.getDate() - i), n.setHours(0, 0, 0, 0), n;
|
|
4143
|
+
}, di = (e, t = 1) => {
|
|
4144
|
+
const n = ho(e, t);
|
|
4145
|
+
return n.setDate(n.getDate() + 6), n.setHours(23, 59, 59, 999), n;
|
|
4146
|
+
}, Vn = (e, t) => {
|
|
4147
|
+
const n = new Date(e);
|
|
4148
|
+
return n.setMonth(n.getMonth() + t), n;
|
|
4149
|
+
}, fi = (e, t) => {
|
|
4150
|
+
const n = ci(e), o = ui(n), i = ho(n, 1), a = di(o, 1), s = [], d = new Date(i);
|
|
4151
|
+
for (; d <= a; )
|
|
4152
|
+
s.push({
|
|
4153
|
+
date: new Date(d),
|
|
4154
|
+
isCurrentMonth: li(d, n),
|
|
4155
|
+
isToday: ai(d),
|
|
4156
|
+
isSelected: !!t && Nn(d, t)
|
|
4157
|
+
}), d.setDate(d.getDate() + 1);
|
|
4158
|
+
return s;
|
|
4159
|
+
}, pi = () => ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], mi = (e) => e.toLocaleDateString("en-US", { month: "long", year: "numeric" }), hi = S(
|
|
4160
|
+
({ value: e, onChange: t, viewDate: n, className: o, ...i }, a) => {
|
|
4161
|
+
const [s, d] = q(n || e || /* @__PURE__ */ new Date()), l = (h) => {
|
|
4162
|
+
h.preventDefault(), d(Vn(s, -1));
|
|
4163
|
+
}, m = (h) => {
|
|
4164
|
+
h.preventDefault(), d(Vn(s, 1));
|
|
4165
|
+
}, p = (h) => {
|
|
4166
|
+
t == null || t(h);
|
|
4167
|
+
}, u = fi(s, e), f = pi(), c = E();
|
|
4168
|
+
return c.bg("surfaceContainerHigh"), c.text.on("surface"), /* @__PURE__ */ I(Me, { className: je("uui-calendar", o), ...i, style: c.get(), children: [
|
|
4169
|
+
/* @__PURE__ */ I("div", { className: "uui-calendar-header", children: [
|
|
4170
|
+
/* @__PURE__ */ r("div", { className: "uui-calendar-title", children: mi(s) }),
|
|
4171
|
+
/* @__PURE__ */ I("div", { className: "uui-calendar-nav", children: [
|
|
4172
|
+
/* @__PURE__ */ r(
|
|
4173
|
+
"button",
|
|
4174
|
+
{
|
|
4175
|
+
"aria-label": "Previous month",
|
|
4176
|
+
className: "uui-calendar-nav-btn",
|
|
4177
|
+
onClick: l,
|
|
4178
|
+
type: "button",
|
|
4179
|
+
children: "<"
|
|
4180
|
+
}
|
|
4181
|
+
),
|
|
4182
|
+
/* @__PURE__ */ r(
|
|
4183
|
+
"button",
|
|
4184
|
+
{
|
|
4185
|
+
"aria-label": "Next month",
|
|
4186
|
+
className: "uui-calendar-nav-btn",
|
|
4187
|
+
onClick: m,
|
|
4188
|
+
type: "button",
|
|
4189
|
+
children: ">"
|
|
4190
|
+
}
|
|
4191
|
+
)
|
|
4192
|
+
] })
|
|
4193
|
+
] }),
|
|
4194
|
+
/* @__PURE__ */ I("div", { className: "uui-calendar-grid", children: [
|
|
4195
|
+
f.map((h) => /* @__PURE__ */ r("div", { className: "uui-calendar-weekday", children: h }, h)),
|
|
4196
|
+
u.map((h, g) => {
|
|
4197
|
+
const C = !!e && Nn(h.date, e);
|
|
4198
|
+
return /* @__PURE__ */ r(
|
|
4199
|
+
Ht,
|
|
4200
|
+
{
|
|
4201
|
+
className: je("uui-calendar-day"),
|
|
4202
|
+
disabled: !h.isCurrentMonth,
|
|
4203
|
+
filled: C,
|
|
4204
|
+
onClick: () => {
|
|
4205
|
+
p(h.date);
|
|
4206
|
+
},
|
|
4207
|
+
outlined: h.isToday,
|
|
4208
|
+
children: /* @__PURE__ */ r("span", { children: h.date.getDate() })
|
|
4209
|
+
},
|
|
4210
|
+
g
|
|
4211
|
+
);
|
|
4212
|
+
})
|
|
4213
|
+
] })
|
|
4214
|
+
] });
|
|
4215
|
+
}
|
|
4216
|
+
);
|
|
4217
|
+
hi.displayName = "Calendar";
|
|
4218
|
+
const go = Symbol.for("uui.avatar");
|
|
4219
|
+
function gi(e) {
|
|
4220
|
+
return ct(e) && typeof e.type != "string" && !!e.type[go];
|
|
4221
|
+
}
|
|
4222
|
+
const An = Eo("extended");
|
|
4223
|
+
function yi(e) {
|
|
4224
|
+
let t = 0;
|
|
4225
|
+
for (let n = 0; n < e.length; n++)
|
|
4226
|
+
t = e.charCodeAt(n) + ((t << 5) - t);
|
|
4227
|
+
return Math.abs(t);
|
|
4228
|
+
}
|
|
4229
|
+
function bi(e) {
|
|
4230
|
+
const t = e == null ? void 0 : e.trim().split(/\s+/).filter(Boolean);
|
|
4231
|
+
if (!(t != null && t.length))
|
|
4232
|
+
return "";
|
|
4233
|
+
const n = t[0][0], o = t.length > 1 ? t[t.length - 1][0] : "";
|
|
4234
|
+
return (n + o).toUpperCase();
|
|
4235
|
+
}
|
|
4236
|
+
const kn = S(
|
|
4237
|
+
({ children: e, className: t, shape: n = "round", size: o = "medium", src: i, alt: a, name: s, color: d, ...l }, m) => {
|
|
4238
|
+
const [p, u] = q(!1), f = je("uui-avatar", gt(o), t), c = !!(i && !p), h = bi(s), g = pt(() => {
|
|
4239
|
+
if (!s || c || d)
|
|
4240
|
+
return;
|
|
4241
|
+
const y = yi(s) % An.length;
|
|
4242
|
+
return An[y];
|
|
4243
|
+
}, [s, c, d]);
|
|
4244
|
+
let C;
|
|
4245
|
+
return c ? C = /* @__PURE__ */ r(
|
|
4246
|
+
"img",
|
|
4247
|
+
{
|
|
4248
|
+
alt: a ?? s ?? "",
|
|
4249
|
+
draggable: !1,
|
|
4250
|
+
onError: () => {
|
|
4251
|
+
u(!0);
|
|
4252
|
+
},
|
|
4253
|
+
src: i
|
|
4254
|
+
}
|
|
4255
|
+
) : s ? C = /* @__PURE__ */ r("span", { "aria-hidden": !0, children: h }) : C = e, /* @__PURE__ */ r(
|
|
4256
|
+
ao,
|
|
4257
|
+
{
|
|
4258
|
+
"aria-label": c ? void 0 : s,
|
|
4259
|
+
className: f,
|
|
4260
|
+
color: d ?? g,
|
|
4261
|
+
font: "labelLarge",
|
|
4262
|
+
ref: m,
|
|
4263
|
+
shape: n,
|
|
4264
|
+
...l,
|
|
4265
|
+
children: C
|
|
4266
|
+
}
|
|
4267
|
+
);
|
|
4268
|
+
}
|
|
4269
|
+
);
|
|
4270
|
+
kn[go] = !0;
|
|
4271
|
+
kn.displayName = "Avatar";
|
|
4272
|
+
const vi = S(
|
|
4273
|
+
({
|
|
4274
|
+
children: e,
|
|
4275
|
+
max: t,
|
|
4276
|
+
overlap: n = 8,
|
|
4277
|
+
size: o,
|
|
4278
|
+
shape: i,
|
|
4279
|
+
border: a,
|
|
4280
|
+
borderColor: s,
|
|
4281
|
+
overflow: d,
|
|
4282
|
+
className: l,
|
|
4283
|
+
...m
|
|
4284
|
+
}, p) => {
|
|
4285
|
+
const u = Pn.toArray(e).filter(gi), f = u.length;
|
|
4286
|
+
let c = u, h = 0;
|
|
4287
|
+
if (t !== void 0 && f > t) {
|
|
4288
|
+
const y = Math.max(t - 1, 0);
|
|
4289
|
+
c = u.slice(0, y), h = f - y;
|
|
4290
|
+
}
|
|
4291
|
+
const g = c.map(
|
|
4292
|
+
(y, v) => Rt(y, {
|
|
4293
|
+
key: y.key ?? v,
|
|
4294
|
+
size: o ?? y.props.size,
|
|
4295
|
+
shape: i ?? y.props.shape,
|
|
4296
|
+
border: a ?? y.props.border,
|
|
4297
|
+
borderColor: s ?? y.props.borderColor,
|
|
4298
|
+
style: {
|
|
4299
|
+
...y.props.style ?? {},
|
|
4300
|
+
marginInlineStart: v === 0 ? 0 : -n,
|
|
4301
|
+
zIndex: v,
|
|
4302
|
+
position: "relative"
|
|
4303
|
+
}
|
|
4304
|
+
})
|
|
4305
|
+
);
|
|
4306
|
+
if (h > 0) {
|
|
4307
|
+
const y = (d == null ? void 0 : d(h)) ?? /* @__PURE__ */ I(kn, { shape: i, size: o, children: [
|
|
4308
|
+
"+",
|
|
4309
|
+
h
|
|
4310
|
+
] });
|
|
4311
|
+
g.push(
|
|
4312
|
+
Rt(y, {
|
|
4313
|
+
key: "overflow",
|
|
4314
|
+
style: {
|
|
4315
|
+
marginInlineStart: g.length === 0 ? 0 : -n,
|
|
4316
|
+
zIndex: g.length,
|
|
4317
|
+
position: "relative"
|
|
4318
|
+
}
|
|
4319
|
+
})
|
|
4320
|
+
);
|
|
4321
|
+
}
|
|
4322
|
+
const C = ["uui-avatar-group", l].filter(Boolean).join(" ");
|
|
4323
|
+
return /* @__PURE__ */ r(lo, { alignItems: "center", ref: p, ...m, className: C, children: g });
|
|
4324
|
+
}
|
|
4325
|
+
);
|
|
4326
|
+
vi.displayName = "AvatarGroup";
|
|
4327
|
+
const Ci = S(
|
|
4328
|
+
({
|
|
4329
|
+
size: e = "small",
|
|
4330
|
+
value: t,
|
|
4331
|
+
defaultValue: n = 0,
|
|
4332
|
+
max: o = 5,
|
|
4333
|
+
step: i = 0.5,
|
|
4334
|
+
readOnly: a,
|
|
4335
|
+
disabled: s,
|
|
4336
|
+
icon: d,
|
|
4337
|
+
font: l,
|
|
4338
|
+
emptyIcon: m,
|
|
4339
|
+
color: p,
|
|
4340
|
+
name: u,
|
|
4341
|
+
id: f,
|
|
4342
|
+
label: c,
|
|
4343
|
+
description: h,
|
|
4344
|
+
error: g,
|
|
4345
|
+
required: C,
|
|
4346
|
+
density: y,
|
|
4347
|
+
onChange: v,
|
|
4348
|
+
onFocus: w,
|
|
4349
|
+
onBlur: x,
|
|
4350
|
+
title: k,
|
|
4351
|
+
textPlacement: B = "start",
|
|
4352
|
+
focusEffects: L = ["ring"],
|
|
4353
|
+
className: M,
|
|
4354
|
+
tooltipAlign: F = "auto",
|
|
4355
|
+
"aria-label": D,
|
|
4356
|
+
filled: N,
|
|
4357
|
+
...H
|
|
4358
|
+
}, G) => {
|
|
4359
|
+
const ee = V(xt("rating")).current, te = f ?? u ?? ee, ye = c ? `${te}_label` : void 0, { isFocused: me, focusHandlers: be, focusVisible: ae } = Bt(w, x), j = V(null), Ce = V(null), ie = t !== void 0, [Ve, ne] = q(n), [ke, _] = q(null), W = ie ? t ?? 0 : Ve, oe = ke ?? W, ce = Math.max(0, Math.min(oe, o)), Ie = k ? /* @__PURE__ */ r("div", { id: `${te}-tip`, children: k }) : null;
|
|
4360
|
+
function K(se) {
|
|
4361
|
+
if (!j.current)
|
|
4362
|
+
return W;
|
|
4363
|
+
const P = j.current, we = P.getBoundingClientRect(), re = P.getElementsByClassName("uui-rating-icon"), Se = se - we.left;
|
|
4364
|
+
if (Se < 5)
|
|
4365
|
+
return 0;
|
|
4366
|
+
const he = we.width / o;
|
|
4367
|
+
let J = Math.floor(Se / he);
|
|
4368
|
+
J = Math.max(0, Math.min(J, o - 1));
|
|
4369
|
+
const fe = re[J].getBoundingClientRect(), Oe = se - fe.left, Ne = Math.max(0, Math.min(1, Oe / fe.width)), $ = 1 / i, R = J + Math.ceil(Ne * $) / $;
|
|
4370
|
+
return parseFloat(Math.min(R, o).toFixed(10));
|
|
4371
|
+
}
|
|
4372
|
+
function ve(se) {
|
|
4373
|
+
ie || ne(se), v == null || v(se);
|
|
4374
|
+
}
|
|
4375
|
+
function Ee(se) {
|
|
4376
|
+
a || s || _(K(se.clientX));
|
|
4377
|
+
}
|
|
4378
|
+
function Be() {
|
|
4379
|
+
!a && !s && _(null);
|
|
4380
|
+
}
|
|
4381
|
+
function Y(se) {
|
|
4382
|
+
if (a || s)
|
|
4383
|
+
return;
|
|
4384
|
+
const P = K(se.clientX);
|
|
4385
|
+
_(null), ve(P === W ? 0 : P);
|
|
4386
|
+
}
|
|
4387
|
+
const Z = Uo({
|
|
4388
|
+
value: oe,
|
|
4389
|
+
min: 0,
|
|
4390
|
+
max: o,
|
|
4391
|
+
step: i,
|
|
4392
|
+
disabled: s,
|
|
4393
|
+
readOnly: a,
|
|
4394
|
+
onChange: ve
|
|
4395
|
+
}), Te = d ?? dr, X = m ?? (N ? Te : ur), ue = je(
|
|
4396
|
+
"uui-rating",
|
|
4397
|
+
gt(e),
|
|
4398
|
+
M,
|
|
4399
|
+
N && "uui-filled",
|
|
4400
|
+
a && "uui-read-only",
|
|
4401
|
+
g && "uui-error",
|
|
4402
|
+
s && "uui-disabled"
|
|
4403
|
+
), xe = je(
|
|
4404
|
+
"uui-rating-control",
|
|
4405
|
+
...L.includes("ring") && me && ae ? ["uui-focus-ring uui-focus-visible"] : [],
|
|
4406
|
+
ut(y)
|
|
4407
|
+
), de = g ? "error" : p, U = Array.from({ length: Math.ceil(o) }).map((se, P) => {
|
|
4408
|
+
const we = Math.min(Math.max(ce - P, 0), 1) * 100, re = E();
|
|
4409
|
+
return re.text(de), re.set("width", `${we}%`), /* @__PURE__ */ I(
|
|
4410
|
+
"div",
|
|
4411
|
+
{
|
|
4412
|
+
className: "uui-icon uui-rating-icon",
|
|
4413
|
+
style: { cursor: a || s ? "default" : "pointer", lineHeight: 0 },
|
|
4414
|
+
children: [
|
|
4415
|
+
/* @__PURE__ */ r("div", { className: "uui-rating-empty-icon", children: X }),
|
|
4416
|
+
/* @__PURE__ */ r("div", { className: "uui-rating-filled-icon", style: re.get(), children: Te })
|
|
4417
|
+
]
|
|
4418
|
+
},
|
|
4419
|
+
`${te}-star-${P}`
|
|
4420
|
+
);
|
|
4421
|
+
}), Re = /* @__PURE__ */ I(
|
|
4422
|
+
"div",
|
|
4423
|
+
{
|
|
4424
|
+
...be,
|
|
4425
|
+
"aria-disabled": s || void 0,
|
|
4426
|
+
"aria-label": c ? void 0 : D ?? k,
|
|
4427
|
+
"aria-labelledby": ye,
|
|
4428
|
+
"aria-valuemax": o,
|
|
4429
|
+
"aria-valuemin": 0,
|
|
4430
|
+
"aria-valuenow": oe,
|
|
4431
|
+
className: xe,
|
|
4432
|
+
id: te,
|
|
4433
|
+
onClick: Y,
|
|
4434
|
+
onKeyDown: Z.onKeyDown,
|
|
4435
|
+
onMouseLeave: Be,
|
|
4436
|
+
onMouseMove: Ee,
|
|
4437
|
+
ref: j,
|
|
4438
|
+
role: "slider",
|
|
4439
|
+
tabIndex: a || s ? -1 : 0,
|
|
4440
|
+
children: [
|
|
4441
|
+
/* @__PURE__ */ r("input", { disabled: s, ref: G, type: "hidden", value: W, ...H }),
|
|
4442
|
+
U,
|
|
4443
|
+
Ie && /* @__PURE__ */ r(It, { align: F, tooltip: Ie, triggerRef: Ce })
|
|
4444
|
+
]
|
|
4445
|
+
}
|
|
4446
|
+
);
|
|
4447
|
+
return /* @__PURE__ */ r(
|
|
4448
|
+
pn,
|
|
4449
|
+
{
|
|
4450
|
+
className: ue,
|
|
4451
|
+
control: Re,
|
|
4452
|
+
description: (h ?? g) && /* @__PURE__ */ r(mn, { description: h, error: g }),
|
|
4453
|
+
label: c && /* @__PURE__ */ r(Gn, { focusRef: j, font: l, id: ye, label: c, required: C, tag: "span" }),
|
|
4454
|
+
ref: Ce,
|
|
4455
|
+
spanDesc: !0,
|
|
4456
|
+
textPlacement: B
|
|
4457
|
+
}
|
|
4458
|
+
);
|
|
4459
|
+
}
|
|
4460
|
+
);
|
|
4461
|
+
Ci.displayName = "Rating";
|
|
4462
|
+
const xi = S(
|
|
4463
|
+
({
|
|
4464
|
+
items: e,
|
|
4465
|
+
children: t,
|
|
4466
|
+
separator: n = "/",
|
|
4467
|
+
maxItems: o,
|
|
4468
|
+
itemsBeforeCollapse: i = 1,
|
|
4469
|
+
itemsAfterCollapse: a = 1,
|
|
4470
|
+
renderItem: s,
|
|
4471
|
+
renderSeparator: d,
|
|
4472
|
+
renderCollapse: l,
|
|
4473
|
+
component: m = "nav",
|
|
4474
|
+
itemComponent: p = "a",
|
|
4475
|
+
animation: u = "fade",
|
|
4476
|
+
motionStyle: f = "regular",
|
|
4477
|
+
duration: c = 200,
|
|
4478
|
+
...h
|
|
4479
|
+
}, g) => {
|
|
4480
|
+
const [C, y] = q(!1), { visible: v, hidden: w } = pt(() => {
|
|
4481
|
+
if (!e || !o || e.length <= o)
|
|
4482
|
+
return { visible: e ?? [], hidden: [] };
|
|
4483
|
+
const B = e.slice(0, i), L = e.slice(e.length - a), M = e.slice(i, e.length - a);
|
|
4484
|
+
return {
|
|
4485
|
+
visible: [...B, { label: "__collapse__" }, ...L],
|
|
4486
|
+
hidden: M
|
|
4487
|
+
};
|
|
4488
|
+
}, [e, o, i, a]), x = (B, L) => {
|
|
4489
|
+
const M = B.current || L === v.length - 1;
|
|
4490
|
+
return /* @__PURE__ */ I(
|
|
4491
|
+
Me,
|
|
4492
|
+
{
|
|
4493
|
+
"aria-current": M ? "page" : void 0,
|
|
4494
|
+
component: p,
|
|
4495
|
+
disabled: B.disabled,
|
|
4496
|
+
style: {
|
|
4497
|
+
display: "inline-flex",
|
|
4498
|
+
alignItems: "center",
|
|
4499
|
+
gap: 4,
|
|
4500
|
+
opacity: B.disabled ? 0.5 : void 0,
|
|
4501
|
+
pointerEvents: B.disabled ? "none" : void 0
|
|
4502
|
+
},
|
|
4503
|
+
children: [
|
|
4504
|
+
B.icon,
|
|
4505
|
+
B.label
|
|
4506
|
+
]
|
|
4507
|
+
}
|
|
4508
|
+
);
|
|
4509
|
+
}, k = () => /* @__PURE__ */ r(
|
|
4510
|
+
bn,
|
|
4511
|
+
{
|
|
4512
|
+
onClick: () => {
|
|
4513
|
+
y((B) => !B);
|
|
4514
|
+
},
|
|
4515
|
+
style: {
|
|
4516
|
+
display: "inline-flex",
|
|
4517
|
+
alignItems: "center",
|
|
4518
|
+
paddingInline: 4,
|
|
4519
|
+
opacity: 0.7,
|
|
4520
|
+
cursor: "pointer"
|
|
4521
|
+
},
|
|
4522
|
+
type: "button",
|
|
4523
|
+
children: "…"
|
|
4524
|
+
}
|
|
4525
|
+
);
|
|
4526
|
+
return /* @__PURE__ */ I(
|
|
4527
|
+
Me,
|
|
4528
|
+
{
|
|
4529
|
+
"aria-label": "breadcrumb",
|
|
4530
|
+
component: m,
|
|
4531
|
+
ref: g,
|
|
4532
|
+
style: {
|
|
4533
|
+
display: "flex",
|
|
4534
|
+
flexWrap: "wrap",
|
|
4535
|
+
alignItems: "center",
|
|
4536
|
+
gap: 4
|
|
4537
|
+
},
|
|
4538
|
+
...h,
|
|
4539
|
+
children: [
|
|
4540
|
+
t || v.map((B, L) => {
|
|
4541
|
+
const M = B.label === "__collapse__";
|
|
4542
|
+
return /* @__PURE__ */ I(Lo, { children: [
|
|
4543
|
+
M ? l ? l(w) : k() : s ? s(B, L) : x(B, L),
|
|
4544
|
+
L < v.length - 1 && (d ? d(L) : /* @__PURE__ */ r(
|
|
4545
|
+
"span",
|
|
4546
|
+
{
|
|
4547
|
+
style: {
|
|
4548
|
+
opacity: 0.5,
|
|
4549
|
+
paddingInline: 4
|
|
4550
|
+
},
|
|
4551
|
+
children: n
|
|
4552
|
+
}
|
|
4553
|
+
))
|
|
4554
|
+
] }, L);
|
|
4555
|
+
}),
|
|
4556
|
+
/* @__PURE__ */ r(Kt, { animation: u, duration: c, motionStyle: f, open: C, children: /* @__PURE__ */ r(
|
|
4557
|
+
Me,
|
|
4558
|
+
{
|
|
4559
|
+
style: {
|
|
4560
|
+
marginTop: 4,
|
|
4561
|
+
display: "flex",
|
|
4562
|
+
flexDirection: "column",
|
|
4563
|
+
border: "1px solid",
|
|
4564
|
+
padding: 4
|
|
4565
|
+
},
|
|
4566
|
+
children: w.map((B, L) => /* @__PURE__ */ r("div", {}))
|
|
4567
|
+
}
|
|
4568
|
+
) })
|
|
4569
|
+
]
|
|
4570
|
+
}
|
|
4571
|
+
);
|
|
4572
|
+
}
|
|
4573
|
+
);
|
|
4574
|
+
xi.displayName = "Breadcrumbs";
|
|
4575
|
+
const wi = S(
|
|
4576
|
+
({
|
|
4577
|
+
as: e,
|
|
4578
|
+
children: t,
|
|
4579
|
+
leading: n,
|
|
4580
|
+
trailing: o,
|
|
4581
|
+
color: i,
|
|
4582
|
+
underline: a = "hover",
|
|
4583
|
+
font: s = "labelLarge",
|
|
4584
|
+
isExternal: d,
|
|
4585
|
+
label: l,
|
|
4586
|
+
className: m,
|
|
4587
|
+
disabled: p,
|
|
4588
|
+
hoverEffects: u = ["overlay"],
|
|
4589
|
+
focusEffects: f = ["ring", "overlay"],
|
|
4590
|
+
pressedEffects: c = ["overlay"],
|
|
4591
|
+
underlineAnimation: h,
|
|
4592
|
+
underlineOrigin: g,
|
|
4593
|
+
"aria-label": C,
|
|
4594
|
+
...y
|
|
4595
|
+
}, v) => {
|
|
4596
|
+
const w = e ?? "a", { onClick: x, ...k } = y, B = je(
|
|
4597
|
+
...f.includes("overlay") ? ["uui-focus-overlay"] : [],
|
|
4598
|
+
...u.includes("overlay") ? ["uui-hover-overlay"] : [],
|
|
4599
|
+
...c.includes("overlay") ? ["uui-pressed-overlay"] : []
|
|
4600
|
+
), L = je(
|
|
4601
|
+
"uui-link",
|
|
4602
|
+
"uui-text-trigger",
|
|
4603
|
+
Le(s),
|
|
4604
|
+
`uui-link-underline-${a}`,
|
|
4605
|
+
h && `uui-link-anim-${h}`,
|
|
4606
|
+
m,
|
|
4607
|
+
B,
|
|
4608
|
+
...f.includes("ring") ? ["uui-focus-ring"] : []
|
|
4609
|
+
), M = C ?? l ?? (typeof t == "string" ? t : void 0), F = E();
|
|
4610
|
+
F.text(i), g && F.set("--uui-underline-origin", g);
|
|
4611
|
+
const D = /* @__PURE__ */ I("span", { className: "uui-link-content", children: [
|
|
4612
|
+
n && /* @__PURE__ */ r(dn, { content: n }),
|
|
4613
|
+
/* @__PURE__ */ r("span", { className: "uui-link-text", children: t ?? l }),
|
|
4614
|
+
o && /* @__PURE__ */ r(fn, { content: o })
|
|
4615
|
+
] });
|
|
4616
|
+
return /* @__PURE__ */ r(
|
|
4617
|
+
w,
|
|
4618
|
+
{
|
|
4619
|
+
"aria-disabled": p ?? void 0,
|
|
4620
|
+
"aria-label": M,
|
|
4621
|
+
className: L,
|
|
4622
|
+
onClick: (N) => {
|
|
4623
|
+
if (p) {
|
|
4624
|
+
N.preventDefault(), N.stopPropagation();
|
|
4625
|
+
return;
|
|
4626
|
+
}
|
|
4627
|
+
x == null || x(N);
|
|
4628
|
+
},
|
|
4629
|
+
ref: v,
|
|
4630
|
+
style: F.get(),
|
|
4631
|
+
tabIndex: p ? -1 : void 0,
|
|
4632
|
+
...d && !p && {
|
|
4633
|
+
target: "_blank",
|
|
4634
|
+
rel: "noopener noreferrer"
|
|
4635
|
+
},
|
|
4636
|
+
...k,
|
|
4637
|
+
children: D
|
|
4638
|
+
}
|
|
4639
|
+
);
|
|
4640
|
+
}
|
|
4641
|
+
);
|
|
4642
|
+
wi.displayName = "Link";
|
|
4643
|
+
export {
|
|
4644
|
+
Ri as Accordion,
|
|
4645
|
+
oi as AccordionItem,
|
|
4646
|
+
Fr as Article,
|
|
4647
|
+
Vr as Aside,
|
|
4648
|
+
kn as Avatar,
|
|
4649
|
+
vi as AvatarGroup,
|
|
4650
|
+
vn as Badge,
|
|
4651
|
+
pr as BottomSheet,
|
|
4652
|
+
Me as BoxBase,
|
|
4653
|
+
xi as Breadcrumbs,
|
|
4654
|
+
bn as Button,
|
|
4655
|
+
Dt as ButtonBase,
|
|
4656
|
+
hi as Calendar,
|
|
4657
|
+
yr as Card,
|
|
4658
|
+
br as Checkbox,
|
|
4659
|
+
gn as CheckboxBase,
|
|
4660
|
+
gr as Chip,
|
|
4661
|
+
Kt as Collapse,
|
|
4662
|
+
Ar as Content,
|
|
4663
|
+
E as ControlStyle,
|
|
4664
|
+
kr as DateField,
|
|
4665
|
+
Sr as DateTimeField,
|
|
4666
|
+
er as Dialog,
|
|
4667
|
+
yn as DialogActions,
|
|
4668
|
+
Zt as DialogBase,
|
|
4669
|
+
Xn as DialogContent,
|
|
4670
|
+
no as DialogHeader,
|
|
4671
|
+
Jn as DialogTitle,
|
|
4672
|
+
jr as Div,
|
|
4673
|
+
so as Divider,
|
|
4674
|
+
fr as Drawer,
|
|
4675
|
+
xr as EmailField,
|
|
4676
|
+
$r as Fab,
|
|
4677
|
+
nt as FieldBase,
|
|
4678
|
+
co as Fieldset,
|
|
4679
|
+
sn as FieldsetContext,
|
|
4680
|
+
lo as Flex,
|
|
4681
|
+
Pr as Footer,
|
|
4682
|
+
ao as Grid,
|
|
4683
|
+
Zr as H1,
|
|
4684
|
+
qr as H2,
|
|
4685
|
+
Gr as H3,
|
|
4686
|
+
Yr as H4,
|
|
4687
|
+
Xr as H5,
|
|
4688
|
+
Jr as H6,
|
|
4689
|
+
Or as Header,
|
|
4690
|
+
ro as IS_DIVIDER,
|
|
4691
|
+
oo as IS_MENU,
|
|
4692
|
+
Cn as IS_MENU_ITEM,
|
|
4693
|
+
Ht as IconButton,
|
|
4694
|
+
ti as Label,
|
|
4695
|
+
wi as Link,
|
|
4696
|
+
Ti as List,
|
|
4697
|
+
wn as ListItem,
|
|
4698
|
+
_r as Main,
|
|
4699
|
+
xn as Menu,
|
|
4700
|
+
io as MenuItem,
|
|
4701
|
+
Br as MonthField,
|
|
4702
|
+
Hr as Nav,
|
|
4703
|
+
Cr as NumberField,
|
|
4704
|
+
Qr as P,
|
|
4705
|
+
Nr as PasswordField,
|
|
4706
|
+
wr as PhoneField,
|
|
4707
|
+
si as Progress,
|
|
4708
|
+
Tr as Radio,
|
|
4709
|
+
zr as RadioGroup,
|
|
4710
|
+
zn as RadioGroupContext,
|
|
4711
|
+
Ci as Rating,
|
|
4712
|
+
Ur as Section,
|
|
4713
|
+
Wt as SelectionContext,
|
|
4714
|
+
ei as Span,
|
|
4715
|
+
Qo as Spinner,
|
|
4716
|
+
Kr as Switch,
|
|
4717
|
+
mo as Tab,
|
|
4718
|
+
Fi as Tabs,
|
|
4719
|
+
dt as TextBase,
|
|
4720
|
+
vr as TextField,
|
|
4721
|
+
Wn as ThemeContext,
|
|
4722
|
+
Ei as ThemeProvider,
|
|
4723
|
+
Lr as TimeField,
|
|
4724
|
+
Zn as Toast,
|
|
4725
|
+
qo as ToastViewport,
|
|
4726
|
+
Mr as ToggleButton,
|
|
4727
|
+
ii as Toolbar,
|
|
4728
|
+
Rr as Tooltip,
|
|
4729
|
+
Dr as UrlField,
|
|
4730
|
+
Ir as WeekField,
|
|
4731
|
+
jo as applyThemeTokens,
|
|
4732
|
+
Un as calculateFloatingPosition,
|
|
4733
|
+
Ro as capitalize,
|
|
4734
|
+
on as clampInt,
|
|
4735
|
+
je as cn,
|
|
4736
|
+
Lt as createRipple,
|
|
4737
|
+
Fn as defaultTheme,
|
|
4738
|
+
Vo as ensureInputMethod,
|
|
4739
|
+
Jo as ensurePortalRoot,
|
|
4740
|
+
Xo as flatChildren,
|
|
4741
|
+
En as generateMaterialColors,
|
|
4742
|
+
an as getAnimationClass,
|
|
4743
|
+
$i as getAnimationList,
|
|
4744
|
+
it as getBorderClass,
|
|
4745
|
+
zt as getBorderColor,
|
|
4746
|
+
Eo as getColorNames,
|
|
4747
|
+
_n as getColorRegistry,
|
|
4748
|
+
ut as getDensityClass,
|
|
4749
|
+
at as getElevationClass,
|
|
4750
|
+
Le as getFontClass,
|
|
4751
|
+
Ao as getInputMethod,
|
|
4752
|
+
cn as getMotionStyleClass,
|
|
4753
|
+
en as getOnColorName,
|
|
4754
|
+
Fo as getPlacementClass,
|
|
4755
|
+
_e as getShapeClass,
|
|
4756
|
+
gt as getSizeClass,
|
|
4757
|
+
Hn as getSurfaceColorVar,
|
|
4758
|
+
Ii as getTintOverlayColor,
|
|
4759
|
+
Yo as getWrapperStyle,
|
|
4760
|
+
Bi as hexToRgb,
|
|
4761
|
+
To as hexToRgbValues,
|
|
4762
|
+
Qt as isDivider,
|
|
4763
|
+
St as isMenu,
|
|
4764
|
+
Jt as isMenuItem,
|
|
4765
|
+
yt as mergeRefs,
|
|
4766
|
+
ln as motionClassMap,
|
|
4767
|
+
un as renderPortal,
|
|
4768
|
+
Mo as setColorRegistry,
|
|
4769
|
+
Vt as toKebabCase,
|
|
4770
|
+
Mi as toast,
|
|
4771
|
+
xt as uniqueID,
|
|
4772
|
+
rn as useAnimate,
|
|
4773
|
+
_o as useClickOutside,
|
|
4774
|
+
Ho as useEscapeHandler,
|
|
4775
|
+
Ko as useFocusTrap,
|
|
4776
|
+
Bt as useFocusVisible,
|
|
4777
|
+
nn as useResizeObserver,
|
|
4778
|
+
Kn as useSelection,
|
|
4779
|
+
Wo as useSelectionState,
|
|
4780
|
+
Uo as useSliderKeys,
|
|
4781
|
+
Di as useTheme
|
|
4782
|
+
};
|