@juwel-development/design-system 3.9.1 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -298
- package/dist/design-system.js +1026 -582
- package/dist/index.css +1 -1
- package/dist/types/Arrangement/ColumnLayout/ColumnLayout.d.ts +92 -0
- package/dist/types/Arrangement/ColumnLayout/ColumnLayoutCompositionError.d.ts +3 -0
- package/dist/types/Arrangement/ColumnLayout/ColumnLayoutConfigurationError.d.ts +3 -0
- package/dist/types/Arrangement/FieldRow/FieldRow.d.ts +87 -0
- package/dist/types/Arrangement/FieldRow/FieldRowCompositionError.d.ts +3 -0
- package/dist/types/Arrangement/FieldRow/FieldRowConfigurationError.d.ts +3 -0
- package/dist/types/Arrangement/FieldRow/IControlEdge.d.ts +6 -0
- package/dist/types/Arrangement/FieldRow/alignControlEdges.d.ts +7 -0
- package/dist/types/Display/Box/Box.d.ts +41 -0
- package/dist/types/Display/Brandmark/Brandmark.d.ts +1 -1
- package/dist/types/Display/DefinitionList/DefinitionList.d.ts +59 -9
- package/dist/types/Display/DefinitionList/DefinitionListConfigurationError.d.ts +3 -0
- package/dist/types/Display/Figure/Figure.d.ts +2 -2
- package/dist/types/Display/Icon/Icon.d.ts +26 -0
- package/dist/types/Display/Table/Table.d.ts +118 -8
- package/dist/types/Display/Table/TableConfigurationError.d.ts +3 -0
- package/dist/types/Display/Typography/Eyebrow/Eyebrow.d.ts +1 -1
- package/dist/types/Display/Typography/H1/H1.d.ts +3 -2
- package/dist/types/Display/Typography/H2/H2.d.ts +3 -2
- package/dist/types/Display/Typography/H3/H3.d.ts +3 -2
- package/dist/types/Display/Typography/H4/H4.d.ts +3 -2
- package/dist/types/Display/Typography/H5/H5.d.ts +3 -2
- package/dist/types/Display/Typography/H6/H6.d.ts +3 -2
- package/dist/types/Display/Typography/Note/Note.d.ts +1 -1
- package/dist/types/Display/Typography/P/P.d.ts +3 -2
- package/dist/types/Display/Typography/Prose/Prose.d.ts +1 -1
- package/dist/types/Interaction/Button/Button.d.ts +23 -3
- package/dist/types/Interaction/Tabs/Tabs.d.ts +31 -6
- package/dist/types/Layout/Header/Header.d.ts +67 -8
- package/dist/types/Layout/ScrollContainer/ScrollContainer.d.ts +37 -0
- package/dist/types/Layout/Section/Section.d.ts +1 -1
- package/dist/types/Layout/Sidebar/Sidebar.d.ts +4 -0
- package/dist/types/Theme/Palette.d.ts +31 -7
- package/dist/types/index.d.ts +6 -0
- package/package.json +1 -1
- package/src/Arrangement/ColumnLayout/ColumnLayout.tsx +249 -0
- package/src/Arrangement/ColumnLayout/ColumnLayoutCompositionError.ts +8 -0
- package/src/Arrangement/ColumnLayout/ColumnLayoutConfigurationError.ts +6 -0
- package/src/Arrangement/FieldRow/FieldRow.tsx +313 -0
- package/src/Arrangement/FieldRow/FieldRowCompositionError.ts +6 -0
- package/src/Arrangement/FieldRow/FieldRowConfigurationError.ts +6 -0
- package/src/Arrangement/FieldRow/IControlEdge.ts +6 -0
- package/src/Arrangement/FieldRow/alignControlEdges.ts +35 -0
- package/src/Display/Box/Box.tsx +77 -0
- package/src/Display/Checklist/Checklist.tsx +1 -1
- package/src/Display/DefinitionList/DefinitionList.tsx +164 -22
- package/src/Display/DefinitionList/DefinitionListConfigurationError.ts +6 -0
- package/src/Display/Icon/Icon.tsx +63 -0
- package/src/Display/Table/Table.tsx +434 -44
- package/src/Display/Table/TableConfigurationError.ts +6 -0
- package/src/Display/Typography/H1/H1.tsx +3 -2
- package/src/Display/Typography/H2/H2.tsx +3 -2
- package/src/Display/Typography/H3/H3.tsx +3 -2
- package/src/Display/Typography/H4/H4.tsx +3 -2
- package/src/Display/Typography/H5/H5.tsx +3 -2
- package/src/Display/Typography/H6/H6.tsx +3 -2
- package/src/Display/Typography/P/P.tsx +3 -2
- package/src/Display/Typography/Prose/Prose.tsx +3 -3
- package/src/Interaction/Button/Button.tsx +45 -17
- package/src/Interaction/Input/Input.tsx +1 -1
- package/src/Interaction/MultiSelect/MultiSelect.tsx +1 -1
- package/src/Interaction/NumberInput/NumberInput.tsx +1 -1
- package/src/Interaction/Select/Select.tsx +1 -1
- package/src/Interaction/Tabs/Tabs.tsx +38 -11
- package/src/Interaction/TextArea/TextArea.tsx +1 -1
- package/src/Layout/Dialog/Dialog.tsx +4 -3
- package/src/Layout/Header/Header.tsx +139 -39
- package/src/Layout/PageHead/PageHead.tsx +6 -5
- package/src/Layout/ScrollContainer/ScrollContainer.tsx +149 -0
- package/src/Layout/Sidebar/Sidebar.tsx +8 -4
- package/src/Theme/Palette.ts +37 -9
- package/src/Theme/renderTokens.ts +101 -5
- package/src/index.ts +6 -0
- package/src/tokens.css +68 -4
- package/src/tokens.dark.css +66 -4
- package/src/tokens.light.css +64 -2
package/dist/design-system.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Children as
|
|
1
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { Children as r, Fragment as i, createContext as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l, useId as u, useLayoutEffect as d, useReducer as f, useRef as p, useState as m } from "react";
|
|
3
3
|
import './index.css';//#region node_modules/clsx/dist/clsx.mjs
|
|
4
|
-
function
|
|
4
|
+
function h(e) {
|
|
5
5
|
var t, n, r = "";
|
|
6
6
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
7
7
|
else if (typeof e == "object") {
|
|
8
8
|
if (Array.isArray(e)) {
|
|
9
9
|
var i = e.length;
|
|
10
|
-
for (t = 0; t < i; t++) e[t] && (n =
|
|
10
|
+
for (t = 0; t < i; t++) e[t] && (n = h(e[t])) && (r && (r += " "), r += n);
|
|
11
11
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
12
12
|
}
|
|
13
13
|
return r;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
15
|
+
function g() {
|
|
16
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = h(e)) && (r && (r += " "), r += t);
|
|
17
17
|
return r;
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region node_modules/class-variance-authority/dist/index.mjs
|
|
21
|
-
var
|
|
22
|
-
if (t?.variants == null) return
|
|
21
|
+
var _ = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, v = g, y = (e, t) => (n) => {
|
|
22
|
+
if (t?.variants == null) return v(e, n?.class, n?.className);
|
|
23
23
|
let { variants: r, defaultVariants: i } = t, a = Object.keys(r).map((e) => {
|
|
24
24
|
let t = n?.[e], a = i?.[e];
|
|
25
25
|
if (t === null) return null;
|
|
26
|
-
let o =
|
|
26
|
+
let o = _(t) || _(a);
|
|
27
27
|
return r[e][o];
|
|
28
28
|
}), o = n && Object.entries(n).reduce((e, t) => {
|
|
29
29
|
let [n, r] = t;
|
|
30
30
|
return r === void 0 || (e[n] = r), e;
|
|
31
31
|
}, {});
|
|
32
|
-
return
|
|
32
|
+
return v(e, a, t?.compoundVariants?.reduce((e, t) => {
|
|
33
33
|
let { class: n, className: r, ...a } = t;
|
|
34
34
|
return Object.entries(a).every((e) => {
|
|
35
35
|
let [t, n] = e;
|
|
@@ -46,7 +46,7 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
46
46
|
r
|
|
47
47
|
] : e;
|
|
48
48
|
}, []), n?.class, n?.className);
|
|
49
|
-
},
|
|
49
|
+
}, b = y("flex flex-wrap items-baseline gap-y-[var(--space-stack)]", {
|
|
50
50
|
variants: {
|
|
51
51
|
gap: {
|
|
52
52
|
stack: "gap-x-[var(--space-stack)]",
|
|
@@ -61,14 +61,179 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
61
61
|
gap: "region",
|
|
62
62
|
justify: "start"
|
|
63
63
|
}
|
|
64
|
-
}),
|
|
65
|
-
className:
|
|
66
|
-
gap:
|
|
64
|
+
}), x = ({ gap: e, justify: n, children: r, testId: i }) => /* @__PURE__ */ t("div", {
|
|
65
|
+
className: b({
|
|
66
|
+
gap: e,
|
|
67
67
|
justify: n
|
|
68
68
|
}),
|
|
69
69
|
"data-testid": i,
|
|
70
70
|
children: r
|
|
71
|
-
}),
|
|
71
|
+
}), S = class extends Error {
|
|
72
|
+
constructor() {
|
|
73
|
+
super("ColumnLayout.Column must be a direct child of ColumnLayout.Root (arrays and fragments are fine; a wrapping component or a nested Column is not)"), this.name = "ColumnLayoutCompositionError";
|
|
74
|
+
}
|
|
75
|
+
}, C = class extends Error {
|
|
76
|
+
constructor(e) {
|
|
77
|
+
super(`ColumnLayout configuration is invalid: ${e}`), this.name = "ColumnLayoutConfigurationError";
|
|
78
|
+
}
|
|
79
|
+
}, w = y("flex flex-wrap items-start", {
|
|
80
|
+
variants: { gap: {
|
|
81
|
+
stack: "gap-[var(--space-stack)] [--column-layout-gap:var(--space-stack)]",
|
|
82
|
+
region: "gap-[var(--space-region)] [--column-layout-gap:var(--space-region)]"
|
|
83
|
+
} },
|
|
84
|
+
defaultVariants: { gap: "region" }
|
|
85
|
+
}), T = y("min-w-0 grow-[var(--column-layout-weight)] basis-[clamp(0px,(var(--column-layout-threshold)-100%)*1000000,100%)]"), E = a(!1), D = /^--[A-Za-z0-9_-]+$/, ee = (e, t) => {
|
|
86
|
+
let { weight: n, minWidth: r } = e.props;
|
|
87
|
+
if (!Number.isFinite(n) || n <= 0) throw new C(`column ${t + 1} needs a positive finite weight (got ${n})`);
|
|
88
|
+
if (!D.test(r)) throw new C(`column ${t + 1} needs a custom-property name such as --main-column-min-width for minWidth (got ${JSON.stringify(r)})`);
|
|
89
|
+
return {
|
|
90
|
+
weight: n,
|
|
91
|
+
minWidth: r
|
|
92
|
+
};
|
|
93
|
+
}, O = (e) => {
|
|
94
|
+
let t = e.reduce((e, t) => e + t.weight, 0), n = e.map((e) => `var(${e.minWidth}) * ${t / e.weight}`);
|
|
95
|
+
return `calc(${e.length - 1} * var(--column-layout-gap) + max(${n.join(", ")}))`;
|
|
96
|
+
}, k = (e) => o(e) && e.type === i, te = (e) => o(e) && e.type === j, ne = (e) => r.toArray(e).flatMap((e) => k(e) ? ne(e.props.children) : te(e) ? [e] : []), A = (e) => r.map(e, (e) => k(e) ? /* @__PURE__ */ t(i, { children: A(e.props.children) }) : te(e) ? /* @__PURE__ */ t(E.Provider, {
|
|
97
|
+
value: !0,
|
|
98
|
+
children: e
|
|
99
|
+
}) : e), re = ({ gap: e, children: n, testId: r }) => {
|
|
100
|
+
let i = ne(n).map(ee), a = i.length === 0 ? void 0 : { "--column-layout-threshold": O(i) };
|
|
101
|
+
return /* @__PURE__ */ t("div", {
|
|
102
|
+
className: w({ gap: e }),
|
|
103
|
+
style: a,
|
|
104
|
+
"data-testid": r,
|
|
105
|
+
children: A(n)
|
|
106
|
+
});
|
|
107
|
+
}, j = ({ weight: e, children: n, testId: r }) => {
|
|
108
|
+
if (!c(E)) throw new S();
|
|
109
|
+
let i = { "--column-layout-weight": e };
|
|
110
|
+
return /* @__PURE__ */ t("div", {
|
|
111
|
+
className: T(),
|
|
112
|
+
style: i,
|
|
113
|
+
"data-testid": r,
|
|
114
|
+
children: /* @__PURE__ */ t(E.Provider, {
|
|
115
|
+
value: !1,
|
|
116
|
+
children: n
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
}, ie = {
|
|
120
|
+
Root: re,
|
|
121
|
+
Column: j
|
|
122
|
+
}, M = .5, N = (e, t) => Math.abs(e - t) <= M, P = (e) => {
|
|
123
|
+
let t = [];
|
|
124
|
+
for (let { top: n } of e) t.some((e) => N(e, n)) || t.push(n);
|
|
125
|
+
let n = t.map((t) => Math.max(...e.filter((e) => N(t, e.top)).map((e) => e.controlEdge)));
|
|
126
|
+
return e.map(({ top: e, controlEdge: r }) => {
|
|
127
|
+
let i = t.findIndex((t) => N(t, e));
|
|
128
|
+
return (n[i] ?? r) - r;
|
|
129
|
+
});
|
|
130
|
+
}, F = class extends Error {
|
|
131
|
+
constructor(e) {
|
|
132
|
+
super(`FieldRow.${e} must be composed inside FieldRow.Root`), this.name = "FieldRowCompositionError";
|
|
133
|
+
}
|
|
134
|
+
}, I = class extends Error {
|
|
135
|
+
constructor(e) {
|
|
136
|
+
super(`FieldRow configuration: ${e}`), this.name = "FieldRowConfigurationError";
|
|
137
|
+
}
|
|
138
|
+
}, L = y("flex flex-wrap items-start gap-y-[var(--space-stack)]", {
|
|
139
|
+
variants: { gap: {
|
|
140
|
+
stack: "gap-x-[var(--space-stack)]",
|
|
141
|
+
region: "gap-x-[var(--space-region)]"
|
|
142
|
+
} },
|
|
143
|
+
defaultVariants: { gap: "stack" }
|
|
144
|
+
}), ae = y("shrink basis-0"), R = y("", {
|
|
145
|
+
variants: { part: {
|
|
146
|
+
item: "min-w-0 max-w-full flex-none",
|
|
147
|
+
group: "flex flex-wrap items-end gap-[var(--space-stack)]"
|
|
148
|
+
} },
|
|
149
|
+
defaultVariants: { part: "item" }
|
|
150
|
+
}), z = /^--[A-Za-z0-9_-]+$/, B = ":scope > [data-field-row-item]", V = a(void 0), H = (e) => {
|
|
151
|
+
let t = c(V);
|
|
152
|
+
if (t === void 0) throw new F(e);
|
|
153
|
+
return t;
|
|
154
|
+
}, oe = (e) => {
|
|
155
|
+
if (!(Number.isFinite(e) && e > 0)) throw new I(`weight must be a positive finite number, got ${e}`);
|
|
156
|
+
}, se = (e) => {
|
|
157
|
+
if (!z.test(e)) throw new I(`minWidth must name a CSS custom property such as --search-field-min-width, got ${JSON.stringify(e)}`);
|
|
158
|
+
}, ce = (e) => {
|
|
159
|
+
let t = e.querySelector("label[for]")?.getAttribute("for");
|
|
160
|
+
if (!t) return;
|
|
161
|
+
let n = e.ownerDocument.getElementById(t);
|
|
162
|
+
return n !== null && e.contains(n) ? n : void 0;
|
|
163
|
+
}, U = (e) => getComputedStyle(e).position !== "static", le = (e, t) => {
|
|
164
|
+
if (getComputedStyle(e).position !== "absolute") return e;
|
|
165
|
+
let n = e.parentElement;
|
|
166
|
+
for (; n !== null && n !== t && !U(n);) n = n.parentElement;
|
|
167
|
+
return n ?? e;
|
|
168
|
+
}, ue = (e) => {
|
|
169
|
+
let t = e.getBoundingClientRect().top, n = e.firstElementChild;
|
|
170
|
+
if (n === null) return {
|
|
171
|
+
top: t,
|
|
172
|
+
controlEdge: 0
|
|
173
|
+
};
|
|
174
|
+
let r = n.getBoundingClientRect(), i = ce(n);
|
|
175
|
+
return {
|
|
176
|
+
top: t,
|
|
177
|
+
controlEdge: (i === void 0 ? r.bottom : le(i, n).getBoundingClientRect().bottom) - r.top
|
|
178
|
+
};
|
|
179
|
+
}, W = (e) => {
|
|
180
|
+
let t = Array.from(e.querySelectorAll(B)), n = P(t.map(ue));
|
|
181
|
+
t.forEach((e, t) => {
|
|
182
|
+
let r = n[t] ?? 0, i = Number.parseFloat(e.style.paddingTop) || 0;
|
|
183
|
+
Math.abs(i - r) > .01 && (e.style.paddingTop = r === 0 ? "" : `${r}px`);
|
|
184
|
+
});
|
|
185
|
+
}, de = {
|
|
186
|
+
Root: ({ gap: e, children: n, testId: r }) => {
|
|
187
|
+
let i = p(null), a = p(void 0), o = p(/* @__PURE__ */ new WeakSet()), s = () => {
|
|
188
|
+
i.current && W(i.current);
|
|
189
|
+
}, c = (e) => {
|
|
190
|
+
e && a.current && !o.current.has(e) && (o.current.add(e), a.current.observe(e));
|
|
191
|
+
};
|
|
192
|
+
return d(() => {
|
|
193
|
+
let e = i.current;
|
|
194
|
+
if (e !== null && (W(e), !(typeof ResizeObserver > "u"))) {
|
|
195
|
+
a.current ??= new ResizeObserver(() => W(e));
|
|
196
|
+
for (let t of e.querySelectorAll(B)) {
|
|
197
|
+
let e = t.firstElementChild ?? void 0;
|
|
198
|
+
c(e), c(e?.querySelector("label[for]") ?? void 0);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}), d(() => () => a.current?.disconnect(), []), /* @__PURE__ */ t("div", {
|
|
202
|
+
ref: i,
|
|
203
|
+
className: L({ gap: e }),
|
|
204
|
+
"data-testid": r,
|
|
205
|
+
children: /* @__PURE__ */ t(V, {
|
|
206
|
+
value: { align: s },
|
|
207
|
+
children: n
|
|
208
|
+
})
|
|
209
|
+
});
|
|
210
|
+
},
|
|
211
|
+
Field: ({ children: e, weight: n = 1, minWidth: r, testId: i }) => {
|
|
212
|
+
let { align: a } = H("Field");
|
|
213
|
+
return oe(n), se(r), d(() => a()), /* @__PURE__ */ t("div", {
|
|
214
|
+
"data-field-row-item": !0,
|
|
215
|
+
className: ae(),
|
|
216
|
+
"data-testid": i,
|
|
217
|
+
style: {
|
|
218
|
+
flexGrow: n,
|
|
219
|
+
minWidth: `min(var(${r}), 100%)`
|
|
220
|
+
},
|
|
221
|
+
children: /* @__PURE__ */ t("div", { children: e })
|
|
222
|
+
});
|
|
223
|
+
},
|
|
224
|
+
Actions: ({ children: e, testId: n }) => {
|
|
225
|
+
let { align: r } = H("Actions");
|
|
226
|
+
return d(() => r()), /* @__PURE__ */ t("div", {
|
|
227
|
+
"data-field-row-item": !0,
|
|
228
|
+
className: R(),
|
|
229
|
+
"data-testid": n,
|
|
230
|
+
children: /* @__PURE__ */ t("div", {
|
|
231
|
+
className: R({ part: "group" }),
|
|
232
|
+
children: e
|
|
233
|
+
})
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}, fe = y("flex", {
|
|
72
237
|
variants: {
|
|
73
238
|
gap: {
|
|
74
239
|
stack: "gap-[var(--space-stack)]",
|
|
@@ -93,82 +258,126 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
93
258
|
measure: !1,
|
|
94
259
|
direction: "column"
|
|
95
260
|
}
|
|
96
|
-
}),
|
|
97
|
-
className:
|
|
98
|
-
gap:
|
|
261
|
+
}), pe = ({ gap: e, measure: n, direction: r, align: i, children: a, testId: o }) => /* @__PURE__ */ t("div", {
|
|
262
|
+
className: fe({
|
|
263
|
+
gap: e,
|
|
99
264
|
measure: n,
|
|
100
265
|
direction: r,
|
|
101
266
|
align: i
|
|
102
267
|
}),
|
|
103
268
|
"data-testid": o,
|
|
104
269
|
children: a
|
|
105
|
-
}),
|
|
270
|
+
}), G = y(["min-w-0 border border-solid border-border bg-surface text-foreground", "p-[var(--space-box-inset)] [overflow-wrap:anywhere]"].join(" ")), me = ({ children: e, name: n, testId: r }) => n === void 0 || n === "" ? /* @__PURE__ */ t("div", {
|
|
271
|
+
className: G(),
|
|
272
|
+
"data-testid": r,
|
|
273
|
+
children: e
|
|
274
|
+
}) : /* @__PURE__ */ t("div", {
|
|
275
|
+
className: G(),
|
|
276
|
+
role: "group",
|
|
277
|
+
"aria-label": n,
|
|
278
|
+
"data-testid": r,
|
|
279
|
+
children: e
|
|
280
|
+
}), he = y("inline-flex", { variants: { cut: {
|
|
106
281
|
full: "",
|
|
107
282
|
compact: ""
|
|
108
|
-
} } }),
|
|
283
|
+
} } }), ge = ({ name: e, cut: n, children: r, testId: i }) => e === "" ? /* @__PURE__ */ t("span", {
|
|
109
284
|
"aria-hidden": "true",
|
|
110
285
|
"data-cut": n,
|
|
111
|
-
className:
|
|
286
|
+
className: he({ cut: n }),
|
|
112
287
|
"data-testid": i,
|
|
113
288
|
children: r
|
|
114
|
-
}) : /* @__PURE__ */
|
|
289
|
+
}) : /* @__PURE__ */ t("span", {
|
|
115
290
|
role: "img",
|
|
116
|
-
"aria-label":
|
|
291
|
+
"aria-label": e,
|
|
117
292
|
"data-cut": n,
|
|
118
|
-
className:
|
|
293
|
+
className: he({ cut: n }),
|
|
119
294
|
"data-testid": i,
|
|
120
295
|
children: r
|
|
121
|
-
}),
|
|
122
|
-
"flex items-start gap-3 font-
|
|
296
|
+
}), _e = y("m-0 list-none p-0"), ve = y([
|
|
297
|
+
"flex items-start gap-3 font-body text-body leading-body text-foreground",
|
|
123
298
|
"before:mt-[0.35em] before:size-[calc(var(--tick-length)*0.7)] before:shrink-0 before:rotate-45 before:[border-top:var(--tick-thickness)_solid_var(--color-rule)] before:[border-right:var(--tick-thickness)_solid_var(--color-rule)] before:content-['']",
|
|
124
299
|
"[&:not(:first-child)]:mt-[var(--space-stack)] [&:not(:first-child)]:border-border [&:not(:first-child)]:border-t [&:not(:first-child)]:border-solid [&:not(:first-child)]:pt-[var(--space-stack)]"
|
|
125
|
-
].join(" ")),
|
|
126
|
-
Root: ({ children:
|
|
127
|
-
className:
|
|
300
|
+
].join(" ")), ye = {
|
|
301
|
+
Root: ({ children: e, testId: n }) => /* @__PURE__ */ t("ul", {
|
|
302
|
+
className: _e(),
|
|
128
303
|
role: "list",
|
|
129
304
|
"data-testid": n,
|
|
130
|
-
children:
|
|
305
|
+
children: e
|
|
131
306
|
}),
|
|
132
|
-
Item: ({ children:
|
|
133
|
-
className:
|
|
134
|
-
children:
|
|
307
|
+
Item: ({ children: e }) => /* @__PURE__ */ t("li", {
|
|
308
|
+
className: ve(),
|
|
309
|
+
children: e
|
|
135
310
|
})
|
|
136
|
-
},
|
|
137
|
-
Root: ({ children:
|
|
138
|
-
className:
|
|
311
|
+
}, be = y("m-0 list-none p-0"), xe = y("py-[var(--space-collection-item)] [&+li]:border-t [&+li]:border-solid [&+li]:border-border"), Se = {
|
|
312
|
+
Root: ({ children: e, testId: n }) => /* @__PURE__ */ t("ul", {
|
|
313
|
+
className: be(),
|
|
139
314
|
role: "list",
|
|
140
315
|
"data-testid": n,
|
|
141
|
-
children:
|
|
316
|
+
children: e
|
|
142
317
|
}),
|
|
143
|
-
Item: ({ children:
|
|
144
|
-
className:
|
|
318
|
+
Item: ({ children: e, testId: n }) => /* @__PURE__ */ t("li", {
|
|
319
|
+
className: xe(),
|
|
145
320
|
"data-testid": n,
|
|
146
|
-
children:
|
|
321
|
+
children: e
|
|
147
322
|
})
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
"
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
323
|
+
}, Ce = class extends Error {
|
|
324
|
+
constructor(e) {
|
|
325
|
+
super(`DefinitionList configuration is invalid: ${e}`), this.name = "DefinitionListConfigurationError";
|
|
326
|
+
}
|
|
327
|
+
}, we = y("@container", {
|
|
328
|
+
variants: { density: {
|
|
329
|
+
comfortable: "[&>div]:py-[var(--space-definition-item)]",
|
|
330
|
+
compact: "[&>div]:py-[var(--space-definition-item-compact)]"
|
|
331
|
+
} },
|
|
332
|
+
defaultVariants: { density: "comfortable" }
|
|
333
|
+
}), Te = y([
|
|
334
|
+
"grid grid-flow-row-dense gap-[var(--space-stack)] border-b border-solid border-border first:border-t",
|
|
335
|
+
"[--definition-stack:clamp(0px,(var(--definition-threshold)-100%)*1000000,100%)]",
|
|
336
|
+
"[--definition-shortfall:clamp(0px,(var(--definition-threshold)-100cqi)*1000000,1px)]",
|
|
337
|
+
"grid-cols-[max(calc((100%-var(--space-definition-column))*var(--definition-term-share)),var(--definition-stack))_minmax(0,1fr)]",
|
|
338
|
+
"gap-x-[max(0px,var(--space-definition-column)-var(--definition-stack))]",
|
|
339
|
+
"[&>dt]:col-start-1 [&>dt]:self-baseline [&>dd]:col-span-full [&>dd]:self-baseline",
|
|
340
|
+
"[&>dd]:col-start-[calc(2-tan(atan2(var(--definition-shortfall),1px)))]"
|
|
341
|
+
].join(" ")), Ee = y("font-body text-subtitle leading-subtitle text-foreground wrap-break-word"), De = y("font-body text-body leading-body text-muted max-w-[var(--measure)] wrap-break-word"), Oe = {
|
|
342
|
+
weight: 1,
|
|
343
|
+
minWidth: "--definition-term-min-width"
|
|
344
|
+
}, ke = {
|
|
345
|
+
weight: 2,
|
|
346
|
+
minWidth: "--definition-description-min-width"
|
|
347
|
+
}, Ae = /^--[A-Za-z0-9_-]+$/, je = (e, t) => {
|
|
348
|
+
if (!Number.isFinite(t.weight) || t.weight <= 0) throw new Ce(`${e} needs a positive finite weight (got ${t.weight})`);
|
|
349
|
+
if (!Ae.test(t.minWidth)) throw new Ce(`${e} needs a custom-property name such as --summary-term-min-width for minWidth (got ${JSON.stringify(t.minWidth)})`);
|
|
350
|
+
return t;
|
|
351
|
+
}, Me = (e, t) => {
|
|
352
|
+
let n = e.weight + t.weight;
|
|
353
|
+
return `calc(var(--space-definition-column) + max(var(${e.minWidth}) * ${n / e.weight}, var(${t.minWidth}) * ${n / t.weight}))`;
|
|
354
|
+
}, Ne = {
|
|
355
|
+
Root: ({ density: e, termColumn: n = Oe, descriptionColumn: r = ke, children: i, testId: a }) => {
|
|
356
|
+
let o = je("termColumn", n), s = je("descriptionColumn", r), c = {
|
|
357
|
+
"--definition-threshold": Me(o, s),
|
|
358
|
+
"--definition-term-share": `calc(${o.weight} / ${o.weight + s.weight})`
|
|
359
|
+
};
|
|
360
|
+
return /* @__PURE__ */ t("dl", {
|
|
361
|
+
className: we({ density: e }),
|
|
362
|
+
style: c,
|
|
363
|
+
"data-testid": a,
|
|
364
|
+
children: i
|
|
365
|
+
});
|
|
366
|
+
},
|
|
367
|
+
Item: ({ children: e, testId: n }) => /* @__PURE__ */ t("div", {
|
|
368
|
+
className: Te(),
|
|
160
369
|
"data-testid": n,
|
|
161
|
-
children:
|
|
370
|
+
children: e
|
|
162
371
|
}),
|
|
163
|
-
Term: ({ children:
|
|
164
|
-
className:
|
|
165
|
-
children:
|
|
372
|
+
Term: ({ children: e }) => /* @__PURE__ */ t("dt", {
|
|
373
|
+
className: Ee(),
|
|
374
|
+
children: e
|
|
166
375
|
}),
|
|
167
|
-
Description: ({ children:
|
|
168
|
-
className:
|
|
169
|
-
children:
|
|
376
|
+
Description: ({ children: e }) => /* @__PURE__ */ t("dd", {
|
|
377
|
+
className: De(),
|
|
378
|
+
children: e
|
|
170
379
|
})
|
|
171
|
-
},
|
|
380
|
+
}, Pe = y("block w-full object-cover bg-backing", {
|
|
172
381
|
variants: {
|
|
173
382
|
ratio: {
|
|
174
383
|
portrait: "aspect-portrait",
|
|
@@ -185,13 +394,13 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
185
394
|
}
|
|
186
395
|
},
|
|
187
396
|
defaultVariants: { focus: "center" }
|
|
188
|
-
}),
|
|
189
|
-
let p = u != null && typeof u != "boolean", m = /* @__PURE__ */
|
|
190
|
-
src:
|
|
397
|
+
}), Fe = ({ src: e, alt: r, width: i, height: a, ratio: o, focus: s, responsive: c, caption: l, overlay: u, priority: d, testId: f }) => {
|
|
398
|
+
let p = u != null && typeof u != "boolean", m = /* @__PURE__ */ t("img", {
|
|
399
|
+
src: e,
|
|
191
400
|
alt: r,
|
|
192
401
|
width: i,
|
|
193
402
|
height: a,
|
|
194
|
-
className:
|
|
403
|
+
className: Pe({
|
|
195
404
|
ratio: o,
|
|
196
405
|
focus: s
|
|
197
406
|
}),
|
|
@@ -201,84 +410,170 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
201
410
|
fetchPriority: d ? "high" : void 0,
|
|
202
411
|
decoding: "async",
|
|
203
412
|
"data-testid": l === void 0 && !p ? f : void 0
|
|
204
|
-
}), h = p ? /* @__PURE__ */
|
|
413
|
+
}), h = p ? /* @__PURE__ */ n("div", {
|
|
205
414
|
className: "relative",
|
|
206
415
|
"data-testid": l === void 0 ? f : void 0,
|
|
207
416
|
children: [m, u]
|
|
208
417
|
}) : m;
|
|
209
|
-
return l === void 0 ? h : /* @__PURE__ */
|
|
418
|
+
return l === void 0 ? h : /* @__PURE__ */ n("figure", {
|
|
210
419
|
className: "flex flex-col gap-[var(--space-stack)]",
|
|
211
420
|
"data-testid": f,
|
|
212
|
-
children: [h, /* @__PURE__ */
|
|
421
|
+
children: [h, /* @__PURE__ */ t("figcaption", {
|
|
213
422
|
className: "font-secondary text-label tracking-label text-muted",
|
|
214
423
|
children: l
|
|
215
424
|
})]
|
|
216
425
|
});
|
|
217
|
-
},
|
|
426
|
+
}, Ie = y("inline-block shrink-0 align-[-0.125em]"), Le = {
|
|
427
|
+
sort: [
|
|
428
|
+
"M5.5 13V3",
|
|
429
|
+
"M3 5.5l2.5-2.5L8 5.5",
|
|
430
|
+
"M10.5 3v10",
|
|
431
|
+
"M8 10.5l2.5 2.5 2.5-2.5"
|
|
432
|
+
],
|
|
433
|
+
"sort-ascending": ["M8 13V3", "M4 7l4-4 4 4"],
|
|
434
|
+
"sort-descending": ["M8 3v10", "M4 9l4 4 4-4"]
|
|
435
|
+
}, Re = ({ name: e, testId: n }) => /* @__PURE__ */ t("svg", {
|
|
436
|
+
"aria-hidden": !0,
|
|
437
|
+
focusable: !1,
|
|
438
|
+
viewBox: "0 0 16 16",
|
|
439
|
+
width: "1em",
|
|
440
|
+
height: "1em",
|
|
441
|
+
className: Ie(),
|
|
442
|
+
"data-testid": n,
|
|
443
|
+
children: Le[e].map((e) => /* @__PURE__ */ t("path", {
|
|
444
|
+
d: e,
|
|
445
|
+
fill: "none",
|
|
446
|
+
stroke: "currentColor",
|
|
447
|
+
strokeWidth: 1.5,
|
|
448
|
+
strokeLinecap: "round",
|
|
449
|
+
strokeLinejoin: "round"
|
|
450
|
+
}, e))
|
|
451
|
+
}), K = class extends Error {
|
|
218
452
|
constructor(e) {
|
|
219
453
|
super(`Meter configuration is invalid: ${e}`), this.name = "MeterConfigurationError";
|
|
220
454
|
}
|
|
221
|
-
},
|
|
455
|
+
}, ze = y("w-full h-[var(--meter-track-thickness)] bg-meter-track border border-solid border-rule"), Be = y("h-full w-[calc(var(--meter-level)*100%)]", {
|
|
222
456
|
variants: { treatment: {
|
|
223
457
|
neutral: "bg-meter-fill",
|
|
224
458
|
depleting: "bg-[color-mix(in_oklab,var(--color-meter-fill)_calc(var(--meter-level)*100%),var(--color-error))]"
|
|
225
459
|
} },
|
|
226
460
|
defaultVariants: { treatment: "neutral" }
|
|
227
|
-
}),
|
|
228
|
-
if (!Number.isFinite(
|
|
229
|
-
if (n >= r) throw new
|
|
230
|
-
if (
|
|
231
|
-
let c = { "--meter-level": (
|
|
232
|
-
return /* @__PURE__ */
|
|
461
|
+
}), Ve = ({ value: e, min: n = 0, max: r, treatment: i, label: a, valueText: o, testId: s }) => {
|
|
462
|
+
if (!Number.isFinite(e) || !Number.isFinite(n) || !Number.isFinite(r)) throw new K(`value, min and max must be finite numbers (got value=${e}, min=${n}, max=${r})`);
|
|
463
|
+
if (n >= r) throw new K(`min must be less than max (got min=${n}, max=${r})`);
|
|
464
|
+
if (e < n || e > r) throw new K(`value must lie within [min, max] (got value=${e}, min=${n}, max=${r})`);
|
|
465
|
+
let c = { "--meter-level": (e - n) / (r - n) };
|
|
466
|
+
return /* @__PURE__ */ t("div", {
|
|
233
467
|
role: "meter",
|
|
234
|
-
"aria-valuenow":
|
|
468
|
+
"aria-valuenow": e,
|
|
235
469
|
"aria-valuemin": n,
|
|
236
470
|
"aria-valuemax": r,
|
|
237
471
|
"aria-label": a,
|
|
238
472
|
"aria-valuetext": o,
|
|
239
473
|
"data-testid": s,
|
|
240
|
-
className:
|
|
474
|
+
className: ze(),
|
|
241
475
|
style: c,
|
|
242
|
-
children: /* @__PURE__ */
|
|
476
|
+
children: /* @__PURE__ */ t("div", {
|
|
243
477
|
"aria-hidden": "true",
|
|
244
|
-
className:
|
|
478
|
+
className: Be({ treatment: i })
|
|
245
479
|
})
|
|
246
480
|
});
|
|
247
|
-
},
|
|
248
|
-
Root: ({ children:
|
|
249
|
-
className:
|
|
481
|
+
}, He = y(["grid gap-[var(--space-stack)]", "lg:grid-cols-[10rem_minmax(0,1fr)] lg:items-start lg:gap-x-12"].join(" ")), Ue = y("lg:sticky lg:top-6"), We = y("block border-b border-solid border-border pb-1 font-secondary text-label tracking-label text-muted"), Ge = y("block pt-1 font-secondary text-label tracking-label text-foreground"), Ke = {
|
|
482
|
+
Root: ({ children: e, testId: n }) => /* @__PURE__ */ t("div", {
|
|
483
|
+
className: He(),
|
|
250
484
|
"data-testid": n,
|
|
251
|
-
children:
|
|
485
|
+
children: e
|
|
252
486
|
}),
|
|
253
|
-
Index: ({ number:
|
|
254
|
-
className:
|
|
487
|
+
Index: ({ number: e, children: r, testId: i }) => /* @__PURE__ */ n("div", {
|
|
488
|
+
className: Ue(),
|
|
255
489
|
"data-testid": i,
|
|
256
490
|
"aria-hidden": "true",
|
|
257
|
-
children: [
|
|
258
|
-
className:
|
|
259
|
-
children:
|
|
260
|
-
}), /* @__PURE__ */
|
|
261
|
-
className:
|
|
491
|
+
children: [e !== void 0 && /* @__PURE__ */ t("span", {
|
|
492
|
+
className: We(),
|
|
493
|
+
children: e
|
|
494
|
+
}), /* @__PURE__ */ t("span", {
|
|
495
|
+
className: Ge(),
|
|
262
496
|
children: r
|
|
263
497
|
})]
|
|
264
498
|
}),
|
|
265
|
-
Content: ({ children:
|
|
499
|
+
Content: ({ children: e, testId: n }) => /* @__PURE__ */ t("div", {
|
|
266
500
|
"data-testid": n,
|
|
267
|
-
children:
|
|
501
|
+
children: e
|
|
268
502
|
})
|
|
269
|
-
},
|
|
270
|
-
|
|
503
|
+
}, qe = class extends Error {
|
|
504
|
+
constructor(e) {
|
|
505
|
+
super(`Table configuration is invalid: ${e}`), this.name = "TableConfigurationError";
|
|
506
|
+
}
|
|
507
|
+
}, q = "comfortable", Je = y([
|
|
508
|
+
"overflow-x-auto",
|
|
509
|
+
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
271
510
|
"[&>table]:w-full [&>table]:border-collapse [&>table]:text-left",
|
|
272
511
|
"[&_caption]:pb-3 [&_caption]:text-left [&_caption]:font-secondary [&_caption]:text-label [&_caption]:tracking-label [&_caption]:text-muted",
|
|
273
512
|
"[&>table>*:nth-child(2)>tr:first-child]:border-rule",
|
|
274
|
-
"[&[data-notes=supplementary]_[data-variant=note]]:max-md:hidden",
|
|
275
|
-
"[&[data-notes=content]>table]:max-md:block",
|
|
276
|
-
"[&[data-notes=content]_thead]:max-md:block [&[data-notes=content]_tbody]:max-md:block [&[data-notes=content]_tfoot]:max-md:block",
|
|
277
|
-
"[&[data-notes=content]_tr]:max-md:block [&[data-notes=content]_td]:max-md:block [&[data-notes=content]_th]:max-md:block"
|
|
278
|
-
|
|
513
|
+
"[&[data-notes=supplementary]:not([data-columns])_[data-variant=note]]:max-md:hidden",
|
|
514
|
+
"[&[data-notes=content]:not([data-columns])>table]:max-md:block",
|
|
515
|
+
"[&[data-notes=content]:not([data-columns])_thead]:max-md:block [&[data-notes=content]:not([data-columns])_tbody]:max-md:block [&[data-notes=content]:not([data-columns])_tfoot]:max-md:block",
|
|
516
|
+
"[&[data-notes=content]:not([data-columns])_tr]:max-md:block [&[data-notes=content]:not([data-columns])_td]:max-md:block [&[data-notes=content]:not([data-columns])_th]:max-md:block",
|
|
517
|
+
"[&[data-columns]>table]:grid [&[data-columns]>table]:grid-cols-[var(--table-columns)]",
|
|
518
|
+
"[&[data-columns]>table>caption]:col-span-full",
|
|
519
|
+
"[&[data-columns]>table>*:not(caption)]:col-span-full [&[data-columns]>table>*:not(caption)]:grid [&[data-columns]>table>*:not(caption)]:grid-cols-subgrid",
|
|
520
|
+
"[&[data-columns]>table>*>tr]:col-span-full [&[data-columns]>table>*>tr]:grid [&[data-columns]>table>*>tr]:grid-cols-subgrid",
|
|
521
|
+
"[&[data-columns]>table>*>tr>td]:wrap-anywhere [&[data-columns]>table>*>tr>th]:wrap-anywhere",
|
|
522
|
+
"[&:has([aria-selected])_tr>*:first-child]:pl-[var(--table-cell-padding-inline)]",
|
|
523
|
+
"[&:has(tr[tabindex])]:p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))]",
|
|
524
|
+
"[&:has(tr[tabindex])]:m-[calc(-1*(var(--focus-ring-width)+var(--focus-ring-offset)))]",
|
|
525
|
+
"[&:has(tr[tabindex])]:scroll-p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))]"
|
|
526
|
+
].join(" "), {
|
|
527
|
+
variants: { density: {
|
|
528
|
+
comfortable: "[--table-cell-padding-inline:var(--table-cell-inset-inline)] [--table-cell-padding-block:var(--table-cell-inset-block)]",
|
|
529
|
+
compact: "[--table-cell-padding-inline:var(--table-cell-inset-inline-compact)] [--table-cell-padding-block:var(--table-cell-inset-block-compact)]"
|
|
530
|
+
} },
|
|
531
|
+
defaultVariants: { density: q }
|
|
532
|
+
}), Ye = y([
|
|
533
|
+
"border-t border-solid border-border",
|
|
534
|
+
"[&[aria-selected=true]>*:first-child]:relative",
|
|
535
|
+
"[&[aria-selected=true]>*:first-child]:before:absolute [&[aria-selected=true]>*:first-child]:before:inset-y-0 [&[aria-selected=true]>*:first-child]:before:left-0",
|
|
536
|
+
"[&[aria-selected=true]>*:first-child]:before:border-l-[length:var(--table-selection-marker-thickness)] [&[aria-selected=true]>*:first-child]:before:border-solid [&[aria-selected=true]>*:first-child]:before:border-foreground"
|
|
537
|
+
].join(" "), {
|
|
538
|
+
variants: { interactive: {
|
|
539
|
+
true: "cursor-pointer outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
540
|
+
false: ""
|
|
541
|
+
} },
|
|
542
|
+
defaultVariants: { interactive: !1 }
|
|
543
|
+
}), Xe = [
|
|
544
|
+
"a[href]",
|
|
545
|
+
"button",
|
|
546
|
+
"input",
|
|
547
|
+
"select",
|
|
548
|
+
"textarea",
|
|
549
|
+
"summary",
|
|
550
|
+
"label",
|
|
551
|
+
"[contenteditable]",
|
|
552
|
+
"[tabindex]",
|
|
553
|
+
"[role=\"button\"]",
|
|
554
|
+
"[role=\"link\"]",
|
|
555
|
+
"[role=\"checkbox\"]",
|
|
556
|
+
"[role=\"radio\"]",
|
|
557
|
+
"[role=\"switch\"]",
|
|
558
|
+
"[role=\"menuitem\"]",
|
|
559
|
+
"[role=\"menuitemcheckbox\"]",
|
|
560
|
+
"[role=\"menuitemradio\"]",
|
|
561
|
+
"[role=\"tab\"]",
|
|
562
|
+
"[role=\"option\"]",
|
|
563
|
+
"[role=\"treeitem\"]",
|
|
564
|
+
"[role=\"combobox\"]",
|
|
565
|
+
"[role=\"textbox\"]",
|
|
566
|
+
"[role=\"searchbox\"]",
|
|
567
|
+
"[role=\"slider\"]",
|
|
568
|
+
"[role=\"spinbutton\"]"
|
|
569
|
+
].join(", "), Ze = (e, t) => {
|
|
570
|
+
if (!(t instanceof Element)) return !1;
|
|
571
|
+
let n = t.closest(Xe);
|
|
572
|
+
return n !== null && n !== e && e.contains(n);
|
|
573
|
+
}, Qe = /* @__PURE__ */ new Set(["Enter", " "]), $e = y("px-[var(--table-cell-padding-inline)] py-[var(--table-cell-padding-block)] text-small first:pl-0 last:pr-0", {
|
|
279
574
|
variants: {
|
|
280
575
|
variant: {
|
|
281
|
-
value: "font-
|
|
576
|
+
value: "font-body text-foreground tabular-nums",
|
|
282
577
|
note: "font-secondary text-muted"
|
|
283
578
|
},
|
|
284
579
|
align: {
|
|
@@ -291,51 +586,124 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
291
586
|
variant: "value",
|
|
292
587
|
align: "left"
|
|
293
588
|
}
|
|
294
|
-
}),
|
|
589
|
+
}), et = y("px-[var(--table-cell-padding-inline)] py-[var(--table-cell-padding-block)] font-secondary font-medium text-label text-muted tracking-label first:pl-0 last:pr-0", {
|
|
295
590
|
variants: { align: {
|
|
296
591
|
left: "text-left",
|
|
297
592
|
right: "text-right",
|
|
298
593
|
center: "text-center"
|
|
299
594
|
} },
|
|
300
595
|
defaultVariants: { align: "left" }
|
|
301
|
-
}),
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
596
|
+
}), tt = (e) => `var(--table-column-${e})`, nt = (e, t) => {
|
|
597
|
+
let n = e.minWidth === void 0 ? void 0 : tt(e.minWidth);
|
|
598
|
+
if (e.width !== void 0) {
|
|
599
|
+
let t = tt(e.width);
|
|
600
|
+
return n === void 0 ? t : `max(${n}, ${t})`;
|
|
601
|
+
}
|
|
602
|
+
if (!Number.isFinite(e.weight) || e.weight <= 0) throw new qe(`column ${t + 1} needs a positive finite weight (got ${e.weight})`);
|
|
603
|
+
return `minmax(${n ?? "0"}, ${e.weight}fr)`;
|
|
604
|
+
}, rt = (e) => e === void 0 || e.length === 0 ? void 0 : e.map(nt).join(" "), it = (e, t, n) => {
|
|
605
|
+
let [r, i] = m(!0);
|
|
606
|
+
return d(() => {
|
|
607
|
+
let r = e.current;
|
|
608
|
+
if (r === null) return;
|
|
609
|
+
let a = () => i(r.scrollWidth > r.clientWidth || r === document.activeElement);
|
|
610
|
+
a();
|
|
611
|
+
let o = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(a);
|
|
612
|
+
o?.observe(r);
|
|
613
|
+
for (let e of [t.current, n.current]) e !== null && o?.observe(e);
|
|
614
|
+
return window.addEventListener("resize", a), r.addEventListener("blur", a), () => {
|
|
615
|
+
o?.disconnect(), window.removeEventListener("resize", a), r.removeEventListener("blur", a);
|
|
616
|
+
};
|
|
617
|
+
}, [
|
|
618
|
+
e,
|
|
619
|
+
t,
|
|
620
|
+
n
|
|
621
|
+
]), r;
|
|
622
|
+
}, at = {
|
|
623
|
+
Root: ({ caption: e, notes: r, columns: i, density: a, children: o, testId: s }) => {
|
|
624
|
+
let c = p(null), l = p(null), u = p(null), d = rt(i), f = it(c, l, u), m = d === void 0 ? void 0 : { "--table-columns": d }, h = d === void 0 ? void 0 : i?.length, g = /* @__PURE__ */ n("table", {
|
|
625
|
+
ref: l,
|
|
626
|
+
role: "table",
|
|
627
|
+
children: [/* @__PURE__ */ t("caption", {
|
|
628
|
+
ref: u,
|
|
629
|
+
children: e
|
|
630
|
+
}), o]
|
|
631
|
+
});
|
|
632
|
+
return r === void 0 ? /* @__PURE__ */ t("section", {
|
|
633
|
+
className: Je({ density: a }),
|
|
634
|
+
style: m,
|
|
635
|
+
"data-columns": h,
|
|
636
|
+
"data-density": a ?? q,
|
|
637
|
+
"data-testid": s,
|
|
638
|
+
"aria-label": e,
|
|
308
639
|
tabIndex: 0,
|
|
309
|
-
children:
|
|
310
|
-
}) : /* @__PURE__ */
|
|
311
|
-
|
|
640
|
+
children: g
|
|
641
|
+
}) : /* @__PURE__ */ t("div", {
|
|
642
|
+
ref: c,
|
|
643
|
+
className: Je({ density: a }),
|
|
644
|
+
style: m,
|
|
312
645
|
"data-notes": r,
|
|
313
|
-
"data-
|
|
314
|
-
|
|
646
|
+
"data-columns": h,
|
|
647
|
+
"data-density": a ?? q,
|
|
648
|
+
"data-testid": s,
|
|
649
|
+
role: f ? "group" : void 0,
|
|
650
|
+
"aria-label": f ? e : void 0,
|
|
651
|
+
tabIndex: f ? 0 : void 0,
|
|
652
|
+
children: g
|
|
315
653
|
});
|
|
316
654
|
},
|
|
317
|
-
Head: ({ children:
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
Row: ({ children: t, testId: n }) => /* @__PURE__ */ e("tr", {
|
|
321
|
-
className: V(),
|
|
322
|
-
"data-testid": n,
|
|
323
|
-
children: t
|
|
655
|
+
Head: ({ children: e }) => /* @__PURE__ */ t("thead", {
|
|
656
|
+
role: "rowgroup",
|
|
657
|
+
children: e
|
|
324
658
|
}),
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
children: r
|
|
659
|
+
Body: ({ children: e }) => /* @__PURE__ */ t("tbody", {
|
|
660
|
+
role: "rowgroup",
|
|
661
|
+
children: e
|
|
329
662
|
}),
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
663
|
+
Footer: ({ children: e }) => /* @__PURE__ */ t("tfoot", {
|
|
664
|
+
role: "rowgroup",
|
|
665
|
+
children: e
|
|
666
|
+
}),
|
|
667
|
+
Row: ({ children: e, testId: n, onClick$: r, isSelected$: i }) => {
|
|
668
|
+
let [a, o] = m(!1);
|
|
669
|
+
d(() => {
|
|
670
|
+
o(!1);
|
|
671
|
+
let e = i?.subscribe((e) => o(e));
|
|
672
|
+
return () => e?.unsubscribe();
|
|
673
|
+
}, [i]);
|
|
674
|
+
let s = (e) => {
|
|
675
|
+
Ze(e.currentTarget, e.target) || r?.next();
|
|
676
|
+
}, c = (e) => {
|
|
677
|
+
e.target !== e.currentTarget || !Qe.has(e.key) || (e.key === " " && e.preventDefault(), e.repeat || r?.next());
|
|
678
|
+
}, l = r !== void 0;
|
|
679
|
+
return /* @__PURE__ */ t("tr", {
|
|
680
|
+
role: "row",
|
|
681
|
+
className: Ye({ interactive: l }),
|
|
682
|
+
"data-testid": n,
|
|
683
|
+
tabIndex: l ? 0 : void 0,
|
|
684
|
+
"aria-selected": i === void 0 ? void 0 : a,
|
|
685
|
+
onClick: l ? s : void 0,
|
|
686
|
+
onKeyDown: l ? c : void 0,
|
|
687
|
+
children: e
|
|
688
|
+
});
|
|
689
|
+
},
|
|
690
|
+
HeaderCell: ({ scope: e, align: n, ariaSort: r, children: i }) => /* @__PURE__ */ t("th", {
|
|
691
|
+
role: e === "row" ? "rowheader" : "columnheader",
|
|
692
|
+
scope: e,
|
|
693
|
+
"aria-sort": r,
|
|
694
|
+
className: et({ align: n }),
|
|
695
|
+
children: i
|
|
696
|
+
}),
|
|
697
|
+
Cell: ({ variant: e, align: n, children: r }) => /* @__PURE__ */ t("td", {
|
|
698
|
+
role: "cell",
|
|
699
|
+
className: $e({
|
|
700
|
+
variant: e,
|
|
333
701
|
align: n
|
|
334
702
|
}),
|
|
335
|
-
"data-variant":
|
|
703
|
+
"data-variant": e ?? "value",
|
|
336
704
|
children: r
|
|
337
705
|
})
|
|
338
|
-
},
|
|
706
|
+
}, ot = y("font-secondary text-label tracking-label font-medium", {
|
|
339
707
|
variants: { color: {
|
|
340
708
|
foreground: "text-foreground",
|
|
341
709
|
muted: "text-muted",
|
|
@@ -345,11 +713,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
345
713
|
info: "text-info"
|
|
346
714
|
} },
|
|
347
715
|
defaultVariants: { color: "muted" }
|
|
348
|
-
}),
|
|
349
|
-
className:
|
|
716
|
+
}), st = ({ children: e, color: n, testId: r }) => /* @__PURE__ */ t("p", {
|
|
717
|
+
className: ot({ color: n }),
|
|
350
718
|
"data-testid": r,
|
|
351
|
-
children:
|
|
352
|
-
}),
|
|
719
|
+
children: e
|
|
720
|
+
}), ct = y("font-heading text-display leading-display tracking-optical max-w-[var(--measure-display)]", {
|
|
353
721
|
variants: { color: {
|
|
354
722
|
foreground: "text-foreground",
|
|
355
723
|
muted: "text-muted",
|
|
@@ -359,11 +727,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
359
727
|
info: "text-info"
|
|
360
728
|
} },
|
|
361
729
|
defaultVariants: { color: "foreground" }
|
|
362
|
-
}),
|
|
363
|
-
className:
|
|
730
|
+
}), lt = ({ children: e, color: n, testId: r }) => /* @__PURE__ */ t("h1", {
|
|
731
|
+
className: ct({ color: n }),
|
|
364
732
|
"data-testid": r,
|
|
365
|
-
children:
|
|
366
|
-
}),
|
|
733
|
+
children: e
|
|
734
|
+
}), ut = y("font-heading text-title leading-title tracking-optical", {
|
|
367
735
|
variants: { color: {
|
|
368
736
|
foreground: "text-foreground",
|
|
369
737
|
muted: "text-muted",
|
|
@@ -373,11 +741,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
373
741
|
info: "text-info"
|
|
374
742
|
} },
|
|
375
743
|
defaultVariants: { color: "foreground" }
|
|
376
|
-
}),
|
|
377
|
-
className:
|
|
744
|
+
}), dt = ({ children: e, color: n, testId: r }) => /* @__PURE__ */ t("h2", {
|
|
745
|
+
className: ut({ color: n }),
|
|
378
746
|
"data-testid": r,
|
|
379
|
-
children:
|
|
380
|
-
}),
|
|
747
|
+
children: e
|
|
748
|
+
}), ft = y("font-heading text-subtitle leading-subtitle", {
|
|
381
749
|
variants: { color: {
|
|
382
750
|
foreground: "text-foreground",
|
|
383
751
|
muted: "text-muted",
|
|
@@ -387,11 +755,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
387
755
|
info: "text-info"
|
|
388
756
|
} },
|
|
389
757
|
defaultVariants: { color: "foreground" }
|
|
390
|
-
}),
|
|
391
|
-
className:
|
|
758
|
+
}), pt = ({ children: e, color: n, testId: r }) => /* @__PURE__ */ t("h3", {
|
|
759
|
+
className: ft({ color: n }),
|
|
392
760
|
"data-testid": r,
|
|
393
|
-
children:
|
|
394
|
-
}),
|
|
761
|
+
children: e
|
|
762
|
+
}), mt = y("font-heading text-body leading-body font-bold", {
|
|
395
763
|
variants: { color: {
|
|
396
764
|
foreground: "text-foreground",
|
|
397
765
|
muted: "text-muted",
|
|
@@ -401,11 +769,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
401
769
|
info: "text-info"
|
|
402
770
|
} },
|
|
403
771
|
defaultVariants: { color: "foreground" }
|
|
404
|
-
}),
|
|
405
|
-
className:
|
|
772
|
+
}), ht = ({ children: e, color: n, testId: r }) => /* @__PURE__ */ t("h4", {
|
|
773
|
+
className: mt({ color: n }),
|
|
406
774
|
"data-testid": r,
|
|
407
|
-
children:
|
|
408
|
-
}),
|
|
775
|
+
children: e
|
|
776
|
+
}), gt = y("font-heading text-body leading-body font-semibold", {
|
|
409
777
|
variants: { color: {
|
|
410
778
|
foreground: "text-foreground",
|
|
411
779
|
muted: "text-muted",
|
|
@@ -415,11 +783,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
415
783
|
info: "text-info"
|
|
416
784
|
} },
|
|
417
785
|
defaultVariants: { color: "foreground" }
|
|
418
|
-
}),
|
|
419
|
-
className:
|
|
786
|
+
}), _t = ({ children: e, color: n, testId: r }) => /* @__PURE__ */ t("h5", {
|
|
787
|
+
className: gt({ color: n }),
|
|
420
788
|
"data-testid": r,
|
|
421
|
-
children:
|
|
422
|
-
}),
|
|
789
|
+
children: e
|
|
790
|
+
}), vt = y("font-heading text-body leading-body font-medium", {
|
|
423
791
|
variants: { color: {
|
|
424
792
|
foreground: "text-foreground",
|
|
425
793
|
muted: "text-muted",
|
|
@@ -429,11 +797,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
429
797
|
info: "text-info"
|
|
430
798
|
} },
|
|
431
799
|
defaultVariants: { color: "foreground" }
|
|
432
|
-
}),
|
|
433
|
-
className:
|
|
800
|
+
}), yt = ({ children: e, color: n, testId: r }) => /* @__PURE__ */ t("h6", {
|
|
801
|
+
className: vt({ color: n }),
|
|
434
802
|
"data-testid": r,
|
|
435
|
-
children:
|
|
436
|
-
}),
|
|
803
|
+
children: e
|
|
804
|
+
}), bt = y("font-secondary text-small", {
|
|
437
805
|
variants: { color: {
|
|
438
806
|
foreground: "text-foreground",
|
|
439
807
|
muted: "text-muted",
|
|
@@ -443,11 +811,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
443
811
|
info: "text-info"
|
|
444
812
|
} },
|
|
445
813
|
defaultVariants: { color: "foreground" }
|
|
446
|
-
}),
|
|
447
|
-
className:
|
|
814
|
+
}), xt = ({ children: e, color: n, testId: r }) => /* @__PURE__ */ t("p", {
|
|
815
|
+
className: bt({ color: n }),
|
|
448
816
|
"data-testid": r,
|
|
449
|
-
children:
|
|
450
|
-
}),
|
|
817
|
+
children: e
|
|
818
|
+
}), St = y("font-body text-body leading-body", {
|
|
451
819
|
variants: { color: {
|
|
452
820
|
foreground: "text-foreground",
|
|
453
821
|
muted: "text-muted",
|
|
@@ -457,11 +825,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
457
825
|
info: "text-info"
|
|
458
826
|
} },
|
|
459
827
|
defaultVariants: { color: "foreground" }
|
|
460
|
-
}),
|
|
461
|
-
className:
|
|
828
|
+
}), Ct = ({ children: e, color: n, testId: r }) => /* @__PURE__ */ t("p", {
|
|
829
|
+
className: St({ color: n }),
|
|
462
830
|
"data-testid": r,
|
|
463
|
-
children:
|
|
464
|
-
}),
|
|
831
|
+
children: e
|
|
832
|
+
}), wt = y("flex max-w-[var(--measure)] flex-col gap-[var(--space-stack)]"), Tt = y("font-body text-lede leading-lede text-foreground"), Et = y("font-body text-body leading-body", {
|
|
465
833
|
variants: { color: {
|
|
466
834
|
foreground: "text-foreground",
|
|
467
835
|
muted: "text-muted",
|
|
@@ -471,119 +839,122 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
471
839
|
info: "text-info"
|
|
472
840
|
} },
|
|
473
841
|
defaultVariants: { color: "foreground" }
|
|
474
|
-
}),
|
|
475
|
-
Root: ({ children:
|
|
476
|
-
className:
|
|
842
|
+
}), Dt = y("font-body text-small text-muted"), Ot = {
|
|
843
|
+
Root: ({ children: e, testId: n }) => /* @__PURE__ */ t("div", {
|
|
844
|
+
className: wt(),
|
|
477
845
|
"data-testid": n,
|
|
478
|
-
children:
|
|
846
|
+
children: e
|
|
479
847
|
}),
|
|
480
|
-
Lede: ({ children:
|
|
481
|
-
className:
|
|
482
|
-
children:
|
|
848
|
+
Lede: ({ children: e }) => /* @__PURE__ */ t("p", {
|
|
849
|
+
className: Tt(),
|
|
850
|
+
children: e
|
|
483
851
|
}),
|
|
484
|
-
Body: ({ color:
|
|
485
|
-
className:
|
|
852
|
+
Body: ({ color: e, children: n }) => /* @__PURE__ */ t("p", {
|
|
853
|
+
className: Et({ color: e }),
|
|
486
854
|
children: n
|
|
487
855
|
}),
|
|
488
|
-
Tail: ({ children:
|
|
489
|
-
className:
|
|
490
|
-
children:
|
|
856
|
+
Tail: ({ children: e }) => /* @__PURE__ */ t("p", {
|
|
857
|
+
className: Dt(),
|
|
858
|
+
children: e
|
|
491
859
|
})
|
|
492
|
-
},
|
|
860
|
+
}, J = "font-control text-body text-balance wrap-anywhere rounded-[var(--radius-control)] select-none inline-flex flex-row items-center justify-center gap-2", kt = y("transition-colors duration-[var(--motion-duration-color)] cursor-pointer disabled:cursor-not-allowed outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]", {
|
|
493
861
|
variants: { variant: {
|
|
494
|
-
primary:
|
|
495
|
-
secondary:
|
|
496
|
-
ghost:
|
|
862
|
+
primary: `${J} px-4 sm:px-6 py-2 min-w-[min(var(--control-min-width),100%)] bg-primary text-primary-foreground hover:bg-primary-hover disabled:bg-disabled disabled:hover:bg-disabled-hover forced-colors:border`,
|
|
863
|
+
secondary: `${J} px-4 sm:px-6 py-2 min-w-[min(var(--control-min-width),100%)] bg-secondary text-secondary-foreground hover:bg-secondary-hover disabled:bg-disabled disabled:hover:bg-disabled-hover forced-colors:border`,
|
|
864
|
+
ghost: `${J} px-2 py-2 min-w-0 bg-transparent text-foreground hover:underline hover:decoration-[length:var(--underline-thickness)] hover:underline-offset-[var(--underline-offset)] disabled:bg-disabled disabled:hover:bg-disabled-hover`,
|
|
865
|
+
outlined: `${J} px-[calc(1rem_-_1px)] sm:px-[calc(1.5rem_-_1px)] py-[calc(0.5rem_-_1px)] min-w-[min(var(--control-min-width),100%)] border border-solid border-secondary bg-transparent text-secondary hover:bg-backing disabled:border-disabled disabled:text-muted disabled:hover:bg-transparent`,
|
|
866
|
+
destructive: `${J} px-4 sm:px-6 py-2 min-w-[min(var(--control-min-width),100%)] bg-error text-error-foreground hover:bg-error-hover disabled:bg-disabled disabled:hover:bg-disabled-hover forced-colors:border`,
|
|
867
|
+
plain: "inline p-0 min-w-0 max-w-full whitespace-normal wrap-anywhere bg-transparent [font:inherit] [letter-spacing:inherit] [color:inherit] [text-align:inherit] disabled:text-disabled"
|
|
497
868
|
} },
|
|
498
869
|
defaultVariants: { variant: "primary" }
|
|
499
|
-
}),
|
|
870
|
+
}), At = ({ children: e, disabled: n, testId: r, variant: i, onClick$: a, ariaLabel: o, type: s = "button" }) => /* @__PURE__ */ t("button", {
|
|
500
871
|
type: s,
|
|
501
872
|
"data-testid": r,
|
|
502
|
-
className:
|
|
873
|
+
className: kt({ variant: i }),
|
|
503
874
|
onClick: () => a?.next(),
|
|
504
875
|
disabled: n,
|
|
505
876
|
"aria-label": o,
|
|
506
|
-
children:
|
|
507
|
-
}),
|
|
877
|
+
children: e
|
|
878
|
+
}), jt = class extends Error {
|
|
508
879
|
constructor(e) {
|
|
509
880
|
super(`Choices.${e} must be composed inside Choices.Root`), this.name = "ChoicesCompositionError";
|
|
510
881
|
}
|
|
511
|
-
},
|
|
882
|
+
}, Mt = y("flex flex-col gap-[var(--space-stack)]"), Nt = y([
|
|
512
883
|
"group/choice flex w-full flex-row items-start gap-3 text-left",
|
|
513
884
|
"rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent aria-checked:border-foreground",
|
|
514
885
|
"px-3 py-2",
|
|
515
886
|
"cursor-pointer disabled:cursor-not-allowed",
|
|
516
887
|
"transition-colors duration-[var(--motion-duration-color)]",
|
|
517
888
|
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]"
|
|
518
|
-
].join(" ")),
|
|
519
|
-
let t =
|
|
520
|
-
if (t === void 0) throw new
|
|
889
|
+
].join(" ")), Pt = a(void 0), Ft = (e) => {
|
|
890
|
+
let t = c(Pt);
|
|
891
|
+
if (t === void 0) throw new jt(e);
|
|
521
892
|
return t;
|
|
522
|
-
},
|
|
893
|
+
}, It = (e, t) => {
|
|
523
894
|
let n = e.closest("[role=\"radiogroup\"]");
|
|
524
895
|
if (n === null) return;
|
|
525
896
|
let r = Array.from(n.querySelectorAll(":scope > [role=\"radio\"]"));
|
|
526
897
|
return r[(r.indexOf(e) + t + r.length) % r.length];
|
|
527
|
-
},
|
|
898
|
+
}, Lt = {
|
|
528
899
|
ArrowDown: 1,
|
|
529
900
|
ArrowRight: 1,
|
|
530
901
|
ArrowUp: -1,
|
|
531
902
|
ArrowLeft: -1
|
|
532
|
-
},
|
|
533
|
-
Root: ({ selected:
|
|
903
|
+
}, Rt = {
|
|
904
|
+
Root: ({ selected: e, onSelect$: n, label: r, inert: i, children: a, testId: o }) => /* @__PURE__ */ t(Pt.Provider, {
|
|
534
905
|
value: {
|
|
535
|
-
selected:
|
|
906
|
+
selected: e,
|
|
536
907
|
onSelect$: n,
|
|
537
908
|
inert: i === !0
|
|
538
909
|
},
|
|
539
|
-
children: /* @__PURE__ */
|
|
910
|
+
children: /* @__PURE__ */ t("div", {
|
|
540
911
|
role: "radiogroup",
|
|
541
912
|
"aria-label": r,
|
|
542
913
|
"aria-disabled": i === !0 ? "true" : void 0,
|
|
543
|
-
className:
|
|
914
|
+
className: Mt(),
|
|
544
915
|
"data-testid": o,
|
|
545
916
|
children: a
|
|
546
917
|
})
|
|
547
918
|
}),
|
|
548
|
-
Choice: ({ value:
|
|
549
|
-
let { selected: o, onSelect$: s, inert: c } =
|
|
550
|
-
return /* @__PURE__ */
|
|
919
|
+
Choice: ({ value: e, children: r, description: i, testId: a }) => {
|
|
920
|
+
let { selected: o, onSelect$: s, inert: c } = Ft("Choice"), l = o === e, d = u(), f = `${d}-name`, p = `${d}-description`;
|
|
921
|
+
return /* @__PURE__ */ n("button", {
|
|
551
922
|
type: "button",
|
|
552
923
|
role: "radio",
|
|
553
|
-
"aria-checked":
|
|
924
|
+
"aria-checked": l,
|
|
554
925
|
"aria-labelledby": f,
|
|
555
926
|
"aria-describedby": p,
|
|
556
|
-
tabIndex:
|
|
927
|
+
tabIndex: l && !c ? 0 : -1,
|
|
557
928
|
disabled: c,
|
|
558
|
-
"data-value":
|
|
929
|
+
"data-value": e,
|
|
559
930
|
"data-testid": a,
|
|
560
|
-
className:
|
|
931
|
+
className: Nt(),
|
|
561
932
|
onClick: () => {
|
|
562
|
-
|
|
933
|
+
l || s.next(e);
|
|
563
934
|
},
|
|
564
935
|
onKeyDown: (e) => {
|
|
565
|
-
let t =
|
|
936
|
+
let t = Lt[e.key];
|
|
566
937
|
if (t === void 0 || c) return;
|
|
567
938
|
e.preventDefault();
|
|
568
|
-
let n =
|
|
939
|
+
let n = It(e.currentTarget, t);
|
|
569
940
|
if (n === void 0) return;
|
|
570
941
|
n.focus();
|
|
571
942
|
let r = n.dataset.value;
|
|
572
943
|
r !== void 0 && r !== o && s.next(r);
|
|
573
944
|
},
|
|
574
|
-
children: [/* @__PURE__ */
|
|
945
|
+
children: [/* @__PURE__ */ t("span", {
|
|
575
946
|
className: "mt-[0.3rem] flex size-[var(--choice-marker-size)] shrink-0 items-center justify-center rounded-[var(--radius-control)] border border-solid border-control-border",
|
|
576
|
-
children:
|
|
947
|
+
children: l && /* @__PURE__ */ t("span", {
|
|
577
948
|
"data-choice-marker-dot": !0,
|
|
578
949
|
className: "size-[var(--choice-marker-dot-size)] rounded-[var(--radius-control)] bg-foreground"
|
|
579
950
|
})
|
|
580
|
-
}), /* @__PURE__ */
|
|
951
|
+
}), /* @__PURE__ */ n("span", {
|
|
581
952
|
className: "flex min-w-0 flex-col",
|
|
582
|
-
children: [/* @__PURE__ */
|
|
953
|
+
children: [/* @__PURE__ */ t("span", {
|
|
583
954
|
id: f,
|
|
584
955
|
className: "font-secondary font-medium text-body text-foreground group-disabled/choice:text-muted",
|
|
585
956
|
children: r
|
|
586
|
-
}), /* @__PURE__ */
|
|
957
|
+
}), /* @__PURE__ */ t("span", {
|
|
587
958
|
id: p,
|
|
588
959
|
className: "font-secondary text-muted text-small",
|
|
589
960
|
children: i
|
|
@@ -591,61 +962,61 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
591
962
|
})]
|
|
592
963
|
});
|
|
593
964
|
}
|
|
594
|
-
},
|
|
965
|
+
}, zt = y("block w-full rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent px-3 py-2 font-control text-body text-foreground transition-colors duration-[var(--motion-duration-color)] outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)] [&:user-invalid]:border-error aria-[invalid=true]:border-error disabled:cursor-not-allowed disabled:border-disabled disabled:text-muted", {
|
|
595
966
|
variants: { variant: {
|
|
596
967
|
text: "",
|
|
597
968
|
email: "",
|
|
598
969
|
url: ""
|
|
599
970
|
} },
|
|
600
971
|
defaultVariants: { variant: "text" }
|
|
601
|
-
}),
|
|
602
|
-
let b =
|
|
603
|
-
return
|
|
972
|
+
}), Bt = ({ label: e, name: r, variant: i, required: a, optionalLabel: o, invalid: s, disabled: c, defaultValue: d, placeholder: f, autocomplete: m, hint: h, errorMessage: g, onInput$: _, reset$: v, testId: y }) => {
|
|
973
|
+
let b = u(), x = `${b}-control`, S = `${b}-hint`, C = `${b}-error`, w = [h ? S : void 0, s ? C : void 0].filter(Boolean).join(" ") || void 0, T = p(null);
|
|
974
|
+
return l(() => {
|
|
604
975
|
let e = v?.subscribe(() => {
|
|
605
976
|
T.current && (T.current.value = "");
|
|
606
977
|
});
|
|
607
978
|
return () => e?.unsubscribe();
|
|
608
|
-
}, [v]), /* @__PURE__ */
|
|
979
|
+
}, [v]), /* @__PURE__ */ n("div", {
|
|
609
980
|
className: "flex flex-col gap-[var(--space-stack)]",
|
|
610
981
|
children: [
|
|
611
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ t("label", {
|
|
612
983
|
htmlFor: x,
|
|
613
984
|
className: "font-secondary font-medium text-body text-foreground",
|
|
614
|
-
children:
|
|
985
|
+
children: e
|
|
615
986
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ t("input", {
|
|
617
988
|
ref: T,
|
|
618
989
|
id: x,
|
|
619
990
|
name: r,
|
|
620
991
|
type: i ?? "text",
|
|
621
|
-
className:
|
|
992
|
+
className: zt({ variant: i }),
|
|
622
993
|
required: a,
|
|
623
|
-
disabled:
|
|
994
|
+
disabled: c,
|
|
624
995
|
defaultValue: d,
|
|
625
|
-
placeholder:
|
|
996
|
+
placeholder: f,
|
|
626
997
|
autoComplete: m,
|
|
627
998
|
"aria-invalid": s || void 0,
|
|
628
999
|
"aria-describedby": w,
|
|
629
1000
|
"data-testid": y,
|
|
630
1001
|
onInput: (e) => _?.next(e.currentTarget.value)
|
|
631
1002
|
}),
|
|
632
|
-
!a && o && /* @__PURE__ */
|
|
1003
|
+
!a && o && /* @__PURE__ */ t("span", {
|
|
633
1004
|
className: "font-secondary text-muted text-small",
|
|
634
1005
|
children: o
|
|
635
1006
|
}),
|
|
636
|
-
h && /* @__PURE__ */
|
|
1007
|
+
h && /* @__PURE__ */ t("p", {
|
|
637
1008
|
id: S,
|
|
638
1009
|
className: "font-secondary text-muted text-small",
|
|
639
1010
|
children: h
|
|
640
1011
|
}),
|
|
641
|
-
s && /* @__PURE__ */
|
|
1012
|
+
s && /* @__PURE__ */ t("p", {
|
|
642
1013
|
id: C,
|
|
643
1014
|
className: "font-secondary text-error text-small",
|
|
644
1015
|
children: g
|
|
645
1016
|
})
|
|
646
1017
|
]
|
|
647
1018
|
});
|
|
648
|
-
},
|
|
1019
|
+
}, Vt = y("outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]", {
|
|
649
1020
|
variants: { treatment: {
|
|
650
1021
|
prose: "text-link underline decoration-[length:var(--underline-thickness)] underline-offset-[var(--underline-offset)] hover:decoration-[length:var(--underline-thickness-hover)]",
|
|
651
1022
|
quiet: "font-secondary text-muted no-underline decoration-[length:var(--underline-thickness)] underline-offset-[var(--underline-offset)] transition-colors duration-[var(--motion-duration-color)] hover:text-foreground hover:underline",
|
|
@@ -653,15 +1024,15 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
653
1024
|
graphic: "text-inherit no-underline"
|
|
654
1025
|
} },
|
|
655
1026
|
defaultVariants: { treatment: "prose" }
|
|
656
|
-
}),
|
|
657
|
-
href:
|
|
658
|
-
className:
|
|
1027
|
+
}), Ht = ({ href: e, children: n, treatment: r, external: i, current: a, testId: o }) => /* @__PURE__ */ t("a", {
|
|
1028
|
+
href: e,
|
|
1029
|
+
className: Vt({ treatment: r }),
|
|
659
1030
|
target: i ? "_blank" : void 0,
|
|
660
1031
|
rel: i ? "noopener noreferrer" : void 0,
|
|
661
1032
|
"aria-current": a ? "page" : void 0,
|
|
662
1033
|
"data-testid": o,
|
|
663
1034
|
children: n
|
|
664
|
-
}),
|
|
1035
|
+
}), Ut = (e, t, n, r) => {
|
|
665
1036
|
let i = Math.max(e.length - 1, 0) * r;
|
|
666
1037
|
if (e.reduce((e, t) => e + t, 0) + i <= n) return e.length;
|
|
667
1038
|
let a = 0, o = t;
|
|
@@ -670,11 +1041,11 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
670
1041
|
o += t + r, a += 1;
|
|
671
1042
|
}
|
|
672
1043
|
return a;
|
|
673
|
-
},
|
|
1044
|
+
}, Wt = class extends Error {
|
|
674
1045
|
constructor(e) {
|
|
675
1046
|
super(`MultiSelect.${e} must be composed inside MultiSelect.Root`), this.name = "MultiSelectCompositionError";
|
|
676
1047
|
}
|
|
677
|
-
},
|
|
1048
|
+
}, Gt = "outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]", Kt = `relative inline-flex shrink-0 cursor-pointer items-center rounded-[var(--radius-control)] bg-backing px-2 py-0.5 font-secondary text-small text-foreground disabled:cursor-not-allowed disabled:text-muted pointer-events-auto ${Gt}`, Y = y("", {
|
|
678
1049
|
variants: { part: {
|
|
679
1050
|
root: [
|
|
680
1051
|
"relative flex flex-col gap-[var(--space-stack)]",
|
|
@@ -684,10 +1055,10 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
684
1055
|
field: [
|
|
685
1056
|
"group/field relative flex items-center gap-1",
|
|
686
1057
|
"rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent px-3 py-2",
|
|
687
|
-
"font-
|
|
1058
|
+
"font-control text-body text-foreground transition-colors duration-[var(--motion-duration-color)]",
|
|
688
1059
|
"data-[disabled]:border-disabled data-[disabled]:text-muted"
|
|
689
1060
|
].join(" "),
|
|
690
|
-
trigger: `absolute inset-0 flex cursor-pointer items-center justify-end rounded-[var(--radius-control)] bg-transparent px-3 text-muted disabled:cursor-not-allowed ${
|
|
1061
|
+
trigger: `absolute inset-0 flex cursor-pointer items-center justify-end rounded-[var(--radius-control)] bg-transparent px-3 text-muted disabled:cursor-not-allowed ${Gt}`,
|
|
691
1062
|
clip: "relative min-w-0 flex-1 overflow-hidden p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))] -m-[calc(var(--focus-ring-width)+var(--focus-ring-offset))] pointer-events-none",
|
|
692
1063
|
track: "relative flex min-h-[calc(var(--text-body)*var(--leading-body))] items-center gap-1",
|
|
693
1064
|
chip: [
|
|
@@ -695,9 +1066,9 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
695
1066
|
"rounded-[var(--radius-control)] bg-backing py-0.5 pr-0.5 pl-2 font-secondary text-small text-foreground",
|
|
696
1067
|
"group-data-[disabled]/field:text-muted data-[overflow]:invisible data-[overflow]:absolute"
|
|
697
1068
|
].join(" "),
|
|
698
|
-
count:
|
|
699
|
-
countMeasure: `${
|
|
700
|
-
iconButton: `relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-[var(--radius-control)] text-muted transition-colors duration-[var(--motion-duration-color)] hover:text-foreground disabled:cursor-not-allowed disabled:hover:text-muted ${
|
|
1069
|
+
count: Kt,
|
|
1070
|
+
countMeasure: `${Kt} invisible absolute`,
|
|
1071
|
+
iconButton: `relative inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-[var(--radius-control)] text-muted transition-colors duration-[var(--motion-duration-color)] hover:text-foreground disabled:cursor-not-allowed disabled:hover:text-muted ${Gt}`,
|
|
701
1072
|
surface: [
|
|
702
1073
|
"absolute left-0 right-0 z-10 flex flex-col gap-1 overflow-y-auto p-1",
|
|
703
1074
|
"rounded-[var(--radius-control)] border border-solid border-border bg-surface shadow-[var(--elevation-floating)]",
|
|
@@ -706,22 +1077,22 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
706
1077
|
].join(" ")
|
|
707
1078
|
} },
|
|
708
1079
|
defaultVariants: { part: "root" }
|
|
709
|
-
}),
|
|
1080
|
+
}), qt = y([
|
|
710
1081
|
"group/option flex w-full flex-row items-center gap-3 text-left",
|
|
711
1082
|
"rounded-[var(--radius-control)] bg-transparent px-3 py-2 hover:bg-backing",
|
|
712
1083
|
"cursor-pointer disabled:cursor-not-allowed",
|
|
713
1084
|
"transition-colors duration-[var(--motion-duration-color)]",
|
|
714
1085
|
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]"
|
|
715
|
-
].join(" ")),
|
|
716
|
-
let t =
|
|
717
|
-
if (t === void 0) throw new
|
|
1086
|
+
].join(" ")), Jt = 8, Yt = a(void 0), Xt = (e) => {
|
|
1087
|
+
let t = c(Yt);
|
|
1088
|
+
if (t === void 0) throw new Wt(e);
|
|
718
1089
|
return t;
|
|
719
|
-
},
|
|
1090
|
+
}, X = (e) => (t) => {
|
|
720
1091
|
e.current = t ?? void 0;
|
|
721
|
-
},
|
|
722
|
-
if (!
|
|
723
|
-
if (e.type ===
|
|
724
|
-
if (e.type ===
|
|
1092
|
+
}, Zt = (e) => e.getBoundingClientRect().width, Qt = (e) => r.toArray(e).flatMap((e) => {
|
|
1093
|
+
if (!o(e)) return [];
|
|
1094
|
+
if (e.type === i) return Qt(e.props.children);
|
|
1095
|
+
if (e.type === cn) {
|
|
725
1096
|
let { value: t, children: n } = e.props;
|
|
726
1097
|
return [{
|
|
727
1098
|
value: t,
|
|
@@ -729,75 +1100,75 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
729
1100
|
}];
|
|
730
1101
|
}
|
|
731
1102
|
return [];
|
|
732
|
-
}),
|
|
1103
|
+
}), $t = (e) => Array.from(e.querySelectorAll("[data-multiselect-chip]:not([data-overflow]) button")), en = (e) => {
|
|
733
1104
|
let t = document.activeElement;
|
|
734
1105
|
return !e.contains(t) || t instanceof Element && t.closest("[data-overflow]") !== null;
|
|
735
|
-
},
|
|
1106
|
+
}, tn = (e) => e.querySelector("[role=\"checkbox\"][aria-checked=\"true\"]") ?? e.querySelector("[role=\"checkbox\"]") ?? void 0, nn = (e, t) => [...new Set(e.map(({ value: e }) => e).filter((e) => t.has(e)))], rn = (e) => e.kind === "firstOption" || !e.control.isConnected, an = (e, t, n, r) => {
|
|
736
1107
|
switch (e.kind) {
|
|
737
|
-
case "firstOption": return r === void 0 ? void 0 :
|
|
1108
|
+
case "firstOption": return r === void 0 ? void 0 : tn(r);
|
|
738
1109
|
case "afterRemoval": {
|
|
739
|
-
let r =
|
|
1110
|
+
let r = $t(t);
|
|
740
1111
|
return r[e.index] ?? r[e.index - 1] ?? n;
|
|
741
1112
|
}
|
|
742
1113
|
case "afterClear": return n;
|
|
743
1114
|
}
|
|
744
|
-
},
|
|
1115
|
+
}, on = () => /* @__PURE__ */ t("svg", {
|
|
745
1116
|
"aria-hidden": !0,
|
|
746
1117
|
focusable: !1,
|
|
747
1118
|
viewBox: "0 0 16 16",
|
|
748
1119
|
className: "size-3",
|
|
749
|
-
children: /* @__PURE__ */
|
|
1120
|
+
children: /* @__PURE__ */ t("path", {
|
|
750
1121
|
d: "M4 4l8 8M12 4l-8 8",
|
|
751
1122
|
fill: "none",
|
|
752
1123
|
stroke: "currentColor",
|
|
753
1124
|
strokeWidth: 1.5,
|
|
754
1125
|
strokeLinecap: "round"
|
|
755
1126
|
})
|
|
756
|
-
}),
|
|
757
|
-
let y =
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
let e = r.subscribe((e) =>
|
|
1127
|
+
}), sn = ({ label: e, selected$: r, onChange$: i, emptyLabel: a, removeLabel: o, clearLabel: s, overflowLabel: c, hint: h, disabled: g, testId: _, children: v }) => {
|
|
1128
|
+
let y = u(), b = `${y}-label`, x = `${y}-trigger`, S = `${y}-options`, C = `${y}-hint`, w = `${y}-empty`, T = g === !0, [E, D] = m([]), [ee, O] = m(!1), [k, te] = m(void 0), [ne, A] = m("below"), [, re] = f((e) => e + 1, 0), j = p(void 0), ie = p(void 0), M = p(void 0), N = p(void 0), P = p(void 0), F = p(void 0), I = p(!1), L = ee && !T, ae = Qt(v), R = new Set(E), z = ae.filter((e) => R.has(e.value)), B = k === void 0 ? z.length : Math.min(k, z.length), V = z.length - B;
|
|
1129
|
+
d(() => {
|
|
1130
|
+
D([]);
|
|
1131
|
+
let e = r.subscribe((e) => D(e));
|
|
761
1132
|
return () => e.unsubscribe();
|
|
762
|
-
}, [r]),
|
|
763
|
-
T &&
|
|
764
|
-
}, [T]),
|
|
765
|
-
let e =
|
|
1133
|
+
}, [r]), l(() => {
|
|
1134
|
+
T && O(!1);
|
|
1135
|
+
}, [T]), d(() => {
|
|
1136
|
+
let e = N.current;
|
|
766
1137
|
if (e === void 0 || typeof ResizeObserver > "u") return;
|
|
767
|
-
let t = new ResizeObserver(() =>
|
|
1138
|
+
let t = new ResizeObserver(() => re());
|
|
768
1139
|
return t.observe(e), () => t.disconnect();
|
|
769
|
-
}, []),
|
|
770
|
-
let e =
|
|
1140
|
+
}, []), d(() => {
|
|
1141
|
+
let e = N.current;
|
|
771
1142
|
if (e === void 0) return;
|
|
772
|
-
let t = Array.from(e.querySelectorAll("[data-multiselect-chip]")), n = e.querySelector("[data-multiselect-count]"), r = Number.parseFloat(getComputedStyle(e).columnGap) || 0, i =
|
|
773
|
-
|
|
774
|
-
}),
|
|
775
|
-
let e =
|
|
776
|
-
if (!
|
|
777
|
-
let n = e.getBoundingClientRect(), r = window.innerHeight - n.bottom -
|
|
778
|
-
t.style.setProperty("--multiselect-surface-max-height", `${Math.max(a ? i : r, 0)}px`),
|
|
779
|
-
}),
|
|
780
|
-
if (!
|
|
1143
|
+
let t = Array.from(e.querySelectorAll("[data-multiselect-chip]")), n = e.querySelector("[data-multiselect-count]"), r = Number.parseFloat(getComputedStyle(e).columnGap) || 0, i = Ut(t.map(Zt), n === null ? 0 : Zt(n), Zt(e), r);
|
|
1144
|
+
te((e) => e === i ? e : i);
|
|
1145
|
+
}), d(() => {
|
|
1146
|
+
let e = ie.current, t = P.current;
|
|
1147
|
+
if (!L || e === void 0 || t === void 0) return;
|
|
1148
|
+
let n = e.getBoundingClientRect(), r = window.innerHeight - n.bottom - Jt, i = n.top - Jt, a = t.scrollHeight > r && i > r;
|
|
1149
|
+
t.style.setProperty("--multiselect-surface-max-height", `${Math.max(a ? i : r, 0)}px`), A(a ? "above" : "below");
|
|
1150
|
+
}), l(() => {
|
|
1151
|
+
if (!L) return;
|
|
781
1152
|
let e = (e) => {
|
|
782
|
-
let t =
|
|
783
|
-
t !== void 0 && e.target instanceof Node && !t.contains(e.target) && (
|
|
1153
|
+
let t = j.current;
|
|
1154
|
+
t !== void 0 && e.target instanceof Node && !t.contains(e.target) && (I.current = !1, F.current = void 0, O(!1));
|
|
784
1155
|
};
|
|
785
1156
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
786
|
-
}, [
|
|
787
|
-
let e =
|
|
1157
|
+
}, [L]), d(() => {
|
|
1158
|
+
let e = j.current, t = M.current;
|
|
788
1159
|
if (e === void 0 || t === void 0) return;
|
|
789
|
-
let n =
|
|
790
|
-
n !== void 0 &&
|
|
1160
|
+
let n = F.current;
|
|
1161
|
+
n !== void 0 && rn(n) ? (F.current = void 0, an(n, e, t, L ? P.current : void 0)?.focus()) : n === void 0 && I.current && en(e) && t.focus(), I.current = e.contains(document.activeElement);
|
|
791
1162
|
});
|
|
792
1163
|
let H = (e) => {
|
|
793
|
-
i.next(
|
|
1164
|
+
i.next(nn(ae, e));
|
|
794
1165
|
}, oe = (e) => {
|
|
795
1166
|
if (T) return;
|
|
796
1167
|
let t = new Set(R);
|
|
797
1168
|
t.delete(e) || t.add(e), H(t);
|
|
798
1169
|
}, se = (e, t) => (n) => {
|
|
799
1170
|
if (T) return;
|
|
800
|
-
document.activeElement === n.currentTarget && (
|
|
1171
|
+
document.activeElement === n.currentTarget && (F.current = {
|
|
801
1172
|
kind: "afterRemoval",
|
|
802
1173
|
index: t,
|
|
803
1174
|
control: n.currentTarget
|
|
@@ -805,68 +1176,68 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
805
1176
|
let r = new Set(R);
|
|
806
1177
|
r.delete(e), H(r);
|
|
807
1178
|
}, ce = (e) => {
|
|
808
|
-
T || (document.activeElement === e.currentTarget && (
|
|
1179
|
+
T || (document.activeElement === e.currentTarget && (F.current = {
|
|
809
1180
|
kind: "afterClear",
|
|
810
1181
|
control: e.currentTarget
|
|
811
1182
|
}), i.next([]));
|
|
812
1183
|
}, U = (e) => {
|
|
813
|
-
T || (e.detail === 0 && (
|
|
1184
|
+
T || (e.detail === 0 && (F.current = { kind: "firstOption" }), O(!0));
|
|
814
1185
|
}, le = (e) => {
|
|
815
|
-
|
|
1186
|
+
L ? O(!1) : U(e);
|
|
816
1187
|
}, ue = (e) => {
|
|
817
1188
|
if (e.key !== "ArrowDown" || T) return;
|
|
818
1189
|
e.preventDefault();
|
|
819
|
-
let t =
|
|
820
|
-
|
|
1190
|
+
let t = P.current;
|
|
1191
|
+
L && t !== void 0 ? tn(t)?.focus() : (F.current = { kind: "firstOption" }, O(!0));
|
|
821
1192
|
}, W = (e) => {
|
|
822
|
-
e.key !== "Escape" || !
|
|
1193
|
+
e.key !== "Escape" || !L || (e.preventDefault(), e.stopPropagation(), O(!1), M.current?.focus());
|
|
823
1194
|
}, de = (e) => {
|
|
824
|
-
|
|
825
|
-
let t =
|
|
826
|
-
t !== void 0 && t.kind !== "firstOption" && e.target !== t.control && (
|
|
1195
|
+
I.current = !0;
|
|
1196
|
+
let t = F.current;
|
|
1197
|
+
t !== void 0 && t.kind !== "firstOption" && e.target !== t.control && (F.current = void 0);
|
|
827
1198
|
}, fe = (e) => {
|
|
828
|
-
let t =
|
|
829
|
-
t !== void 0 && n instanceof Node && t.contains(n) || e.target.isConnected && (
|
|
1199
|
+
let t = j.current, n = e.relatedTarget;
|
|
1200
|
+
t !== void 0 && n instanceof Node && t.contains(n) || e.target.isConnected && (I.current = !1, F.current = void 0, O(!1));
|
|
830
1201
|
}, pe = (e) => {
|
|
831
1202
|
(!(e.target instanceof Element) || e.target.closest("button") === null) && e.preventDefault();
|
|
832
|
-
},
|
|
833
|
-
return /* @__PURE__ */
|
|
834
|
-
ref:
|
|
835
|
-
className:
|
|
1203
|
+
}, G = [z.length === 0 ? w : void 0, h ? C : void 0].filter(Boolean).join(" ") || void 0;
|
|
1204
|
+
return /* @__PURE__ */ n("div", {
|
|
1205
|
+
ref: X(j),
|
|
1206
|
+
className: Y(),
|
|
836
1207
|
onKeyDown: W,
|
|
837
1208
|
onFocus: de,
|
|
838
1209
|
onBlur: fe,
|
|
839
1210
|
children: [
|
|
840
|
-
/* @__PURE__ */
|
|
1211
|
+
/* @__PURE__ */ t("label", {
|
|
841
1212
|
id: b,
|
|
842
1213
|
htmlFor: x,
|
|
843
|
-
children:
|
|
1214
|
+
children: e
|
|
844
1215
|
}),
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
ref:
|
|
1216
|
+
/* @__PURE__ */ n("div", {
|
|
1217
|
+
ref: X(ie),
|
|
847
1218
|
"data-multiselect-field": !0,
|
|
848
1219
|
"data-disabled": T || void 0,
|
|
849
|
-
className:
|
|
1220
|
+
className: Y({ part: "field" }),
|
|
850
1221
|
children: [
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
ref:
|
|
1222
|
+
/* @__PURE__ */ t("button", {
|
|
1223
|
+
ref: X(M),
|
|
853
1224
|
id: x,
|
|
854
1225
|
type: "button",
|
|
855
1226
|
"aria-labelledby": b,
|
|
856
|
-
"aria-expanded":
|
|
857
|
-
"aria-controls":
|
|
858
|
-
"aria-describedby":
|
|
1227
|
+
"aria-expanded": L,
|
|
1228
|
+
"aria-controls": L ? S : void 0,
|
|
1229
|
+
"aria-describedby": G,
|
|
859
1230
|
disabled: T,
|
|
860
1231
|
"data-testid": _,
|
|
861
|
-
className:
|
|
1232
|
+
className: Y({ part: "trigger" }),
|
|
862
1233
|
onClick: le,
|
|
863
1234
|
onKeyDown: ue,
|
|
864
|
-
children: /* @__PURE__ */
|
|
1235
|
+
children: /* @__PURE__ */ t("svg", {
|
|
865
1236
|
"aria-hidden": !0,
|
|
866
1237
|
focusable: !1,
|
|
867
1238
|
viewBox: "0 0 16 16",
|
|
868
1239
|
className: "size-4",
|
|
869
|
-
children: /* @__PURE__ */
|
|
1240
|
+
children: /* @__PURE__ */ t("path", {
|
|
870
1241
|
d: "M3 6l5 5 5-5",
|
|
871
1242
|
fill: "none",
|
|
872
1243
|
stroke: "currentColor",
|
|
@@ -876,80 +1247,80 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
876
1247
|
})
|
|
877
1248
|
})
|
|
878
1249
|
}),
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
className:
|
|
881
|
-
children: /* @__PURE__ */
|
|
882
|
-
ref:
|
|
1250
|
+
/* @__PURE__ */ t("div", {
|
|
1251
|
+
className: Y({ part: "clip" }),
|
|
1252
|
+
children: /* @__PURE__ */ n("div", {
|
|
1253
|
+
ref: X(N),
|
|
883
1254
|
"data-multiselect-track": !0,
|
|
884
|
-
className:
|
|
1255
|
+
className: Y({ part: "track" }),
|
|
885
1256
|
children: [
|
|
886
|
-
z.length === 0 && /* @__PURE__ */
|
|
1257
|
+
z.length === 0 && /* @__PURE__ */ t("span", {
|
|
887
1258
|
id: w,
|
|
888
1259
|
className: "truncate text-muted",
|
|
889
1260
|
children: a
|
|
890
1261
|
}),
|
|
891
|
-
z.map(({ value:
|
|
1262
|
+
z.map(({ value: e, label: r }, i) => {
|
|
892
1263
|
let a = i >= B;
|
|
893
|
-
return /* @__PURE__ */
|
|
1264
|
+
return /* @__PURE__ */ n("span", {
|
|
894
1265
|
"data-multiselect-chip": !0,
|
|
895
1266
|
"data-overflow": a || void 0,
|
|
896
1267
|
"aria-hidden": a || void 0,
|
|
897
1268
|
inert: a || void 0,
|
|
898
|
-
className:
|
|
899
|
-
children: [/* @__PURE__ */
|
|
1269
|
+
className: Y({ part: "chip" }),
|
|
1270
|
+
children: [/* @__PURE__ */ t("span", {
|
|
900
1271
|
className: "truncate",
|
|
901
1272
|
children: r
|
|
902
|
-
}), /* @__PURE__ */
|
|
1273
|
+
}), /* @__PURE__ */ t("button", {
|
|
903
1274
|
type: "button",
|
|
904
1275
|
"aria-label": o.replaceAll("{label}", r),
|
|
905
1276
|
disabled: T,
|
|
906
1277
|
tabIndex: a ? -1 : void 0,
|
|
907
|
-
className:
|
|
908
|
-
onClick: se(
|
|
909
|
-
children: /* @__PURE__ */
|
|
1278
|
+
className: Y({ part: "iconButton" }),
|
|
1279
|
+
onClick: se(e, i),
|
|
1280
|
+
children: /* @__PURE__ */ t(on, {})
|
|
910
1281
|
})]
|
|
911
|
-
},
|
|
1282
|
+
}, e);
|
|
912
1283
|
}),
|
|
913
|
-
V > 0 && /* @__PURE__ */
|
|
1284
|
+
V > 0 && /* @__PURE__ */ t("button", {
|
|
914
1285
|
type: "button",
|
|
915
1286
|
disabled: T,
|
|
916
|
-
className:
|
|
1287
|
+
className: Y({ part: "count" }),
|
|
917
1288
|
onClick: U,
|
|
918
|
-
children:
|
|
1289
|
+
children: c.replaceAll("{count}", String(V))
|
|
919
1290
|
}),
|
|
920
|
-
z.length > 0 && /* @__PURE__ */
|
|
1291
|
+
z.length > 0 && /* @__PURE__ */ t("span", {
|
|
921
1292
|
"aria-hidden": !0,
|
|
922
1293
|
"data-multiselect-count": !0,
|
|
923
|
-
className:
|
|
924
|
-
children:
|
|
1294
|
+
className: Y({ part: "countMeasure" }),
|
|
1295
|
+
children: c.replaceAll("{count}", String(z.length))
|
|
925
1296
|
})
|
|
926
1297
|
]
|
|
927
1298
|
})
|
|
928
1299
|
}),
|
|
929
|
-
z.length > 0 ? /* @__PURE__ */
|
|
1300
|
+
z.length > 0 ? /* @__PURE__ */ t("button", {
|
|
930
1301
|
type: "button",
|
|
931
1302
|
"aria-label": s,
|
|
932
1303
|
disabled: T,
|
|
933
|
-
className:
|
|
1304
|
+
className: Y({ part: "iconButton" }),
|
|
934
1305
|
onClick: ce,
|
|
935
|
-
children: /* @__PURE__ */
|
|
936
|
-
}) : /* @__PURE__ */
|
|
1306
|
+
children: /* @__PURE__ */ t(on, {})
|
|
1307
|
+
}) : /* @__PURE__ */ t("span", {
|
|
937
1308
|
"aria-hidden": !0,
|
|
938
1309
|
className: "size-6 shrink-0"
|
|
939
1310
|
}),
|
|
940
|
-
/* @__PURE__ */
|
|
1311
|
+
/* @__PURE__ */ t("span", {
|
|
941
1312
|
"aria-hidden": !0,
|
|
942
1313
|
className: "size-6 shrink-0"
|
|
943
1314
|
}),
|
|
944
|
-
|
|
945
|
-
ref:
|
|
1315
|
+
L && /* @__PURE__ */ t("div", {
|
|
1316
|
+
ref: X(P),
|
|
946
1317
|
id: S,
|
|
947
1318
|
role: "group",
|
|
948
1319
|
"aria-labelledby": b,
|
|
949
|
-
"data-placement":
|
|
950
|
-
className:
|
|
1320
|
+
"data-placement": ne,
|
|
1321
|
+
className: Y({ part: "surface" }),
|
|
951
1322
|
onMouseDown: pe,
|
|
952
|
-
children: /* @__PURE__ */
|
|
1323
|
+
children: /* @__PURE__ */ t(Yt, {
|
|
953
1324
|
value: {
|
|
954
1325
|
selected: R,
|
|
955
1326
|
disabled: T,
|
|
@@ -960,30 +1331,30 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
960
1331
|
})
|
|
961
1332
|
]
|
|
962
1333
|
}),
|
|
963
|
-
h && /* @__PURE__ */
|
|
1334
|
+
h && /* @__PURE__ */ t("p", {
|
|
964
1335
|
id: C,
|
|
965
1336
|
children: h
|
|
966
1337
|
})
|
|
967
1338
|
]
|
|
968
1339
|
});
|
|
969
|
-
},
|
|
970
|
-
let { selected: a, disabled: o, toggle: s } =
|
|
971
|
-
return /* @__PURE__ */
|
|
1340
|
+
}, cn = ({ value: e, children: r, testId: i }) => {
|
|
1341
|
+
let { selected: a, disabled: o, toggle: s } = Xt("Option"), c = a.has(e);
|
|
1342
|
+
return /* @__PURE__ */ n("button", {
|
|
972
1343
|
type: "button",
|
|
973
1344
|
role: "checkbox",
|
|
974
1345
|
"aria-checked": c,
|
|
975
1346
|
disabled: o,
|
|
976
1347
|
"data-testid": i,
|
|
977
|
-
className:
|
|
978
|
-
onClick: () => s(
|
|
979
|
-
children: [/* @__PURE__ */
|
|
1348
|
+
className: qt(),
|
|
1349
|
+
onClick: () => s(e),
|
|
1350
|
+
children: [/* @__PURE__ */ t("span", {
|
|
980
1351
|
className: "flex size-[var(--choice-marker-size)] shrink-0 items-center justify-center border border-solid border-control-border group-aria-checked/option:border-foreground",
|
|
981
|
-
children: c && /* @__PURE__ */
|
|
1352
|
+
children: c && /* @__PURE__ */ t("svg", {
|
|
982
1353
|
"aria-hidden": !0,
|
|
983
1354
|
focusable: !1,
|
|
984
1355
|
viewBox: "0 0 16 16",
|
|
985
1356
|
className: "size-3 text-foreground",
|
|
986
|
-
children: /* @__PURE__ */
|
|
1357
|
+
children: /* @__PURE__ */ t("path", {
|
|
987
1358
|
d: "M3 8.5l3 3 7-7",
|
|
988
1359
|
fill: "none",
|
|
989
1360
|
stroke: "currentColor",
|
|
@@ -992,81 +1363,81 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
992
1363
|
strokeLinejoin: "round"
|
|
993
1364
|
})
|
|
994
1365
|
})
|
|
995
|
-
}), /* @__PURE__ */
|
|
1366
|
+
}), /* @__PURE__ */ t("span", {
|
|
996
1367
|
className: "min-w-0 flex-1 font-secondary text-body text-foreground [overflow-wrap:anywhere]",
|
|
997
1368
|
children: r
|
|
998
1369
|
})]
|
|
999
1370
|
});
|
|
1000
|
-
},
|
|
1001
|
-
Root:
|
|
1002
|
-
Option:
|
|
1003
|
-
},
|
|
1004
|
-
let v =
|
|
1005
|
-
return
|
|
1371
|
+
}, ln = {
|
|
1372
|
+
Root: sn,
|
|
1373
|
+
Option: cn
|
|
1374
|
+
}, un = y("block w-full rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent px-3 py-2 font-control text-body text-foreground transition-colors duration-[var(--motion-duration-color)] outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)] [&:user-invalid]:border-error aria-[invalid=true]:border-error disabled:cursor-not-allowed disabled:border-disabled disabled:text-muted"), dn = ({ label: e, name: r, required: i, optionalLabel: a, hint: o, invalid: s, errorMessage: c, disabled: d, placeholder: f, defaultValue: m, onInput$: h, reset$: g, testId: _ }) => {
|
|
1375
|
+
let v = u(), y = `${v}-control`, b = `${v}-hint`, x = `${v}-error`, S = [o ? b : void 0, s ? x : void 0].filter(Boolean).join(" ") || void 0, C = p(null);
|
|
1376
|
+
return l(() => {
|
|
1006
1377
|
let e = g?.subscribe(() => {
|
|
1007
1378
|
C.current && (C.current.value = "");
|
|
1008
1379
|
});
|
|
1009
1380
|
return () => e?.unsubscribe();
|
|
1010
|
-
}, [g]), /* @__PURE__ */
|
|
1381
|
+
}, [g]), /* @__PURE__ */ n("div", {
|
|
1011
1382
|
className: "flex flex-col gap-[var(--space-stack)]",
|
|
1012
1383
|
children: [
|
|
1013
|
-
/* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ t("label", {
|
|
1014
1385
|
htmlFor: y,
|
|
1015
1386
|
className: "font-secondary font-medium text-body text-foreground",
|
|
1016
|
-
children:
|
|
1387
|
+
children: e
|
|
1017
1388
|
}),
|
|
1018
|
-
/* @__PURE__ */
|
|
1389
|
+
/* @__PURE__ */ t("input", {
|
|
1019
1390
|
ref: C,
|
|
1020
1391
|
id: y,
|
|
1021
1392
|
name: r,
|
|
1022
1393
|
type: "text",
|
|
1023
1394
|
inputMode: "decimal",
|
|
1024
|
-
className:
|
|
1395
|
+
className: un(),
|
|
1025
1396
|
required: i,
|
|
1026
1397
|
disabled: d,
|
|
1027
1398
|
defaultValue: m,
|
|
1028
|
-
placeholder:
|
|
1399
|
+
placeholder: f,
|
|
1029
1400
|
"aria-invalid": s || void 0,
|
|
1030
1401
|
"aria-describedby": S,
|
|
1031
1402
|
"data-testid": _,
|
|
1032
1403
|
onInput: (e) => !d && h?.next(e.currentTarget.value)
|
|
1033
1404
|
}),
|
|
1034
|
-
!i && a && /* @__PURE__ */
|
|
1405
|
+
!i && a && /* @__PURE__ */ t("span", {
|
|
1035
1406
|
className: "font-secondary text-muted text-small",
|
|
1036
1407
|
children: a
|
|
1037
1408
|
}),
|
|
1038
|
-
o && /* @__PURE__ */
|
|
1409
|
+
o && /* @__PURE__ */ t("p", {
|
|
1039
1410
|
id: b,
|
|
1040
1411
|
className: "font-secondary text-muted text-small",
|
|
1041
1412
|
children: o
|
|
1042
1413
|
}),
|
|
1043
|
-
s && /* @__PURE__ */
|
|
1414
|
+
s && /* @__PURE__ */ t("p", {
|
|
1044
1415
|
id: x,
|
|
1045
1416
|
className: "font-secondary text-error text-small",
|
|
1046
|
-
children:
|
|
1417
|
+
children: c
|
|
1047
1418
|
})
|
|
1048
1419
|
]
|
|
1049
1420
|
});
|
|
1050
|
-
},
|
|
1421
|
+
}, fn = y([
|
|
1051
1422
|
"flex flex-col gap-[var(--space-stack)]",
|
|
1052
1423
|
"[&>label]:font-secondary [&>label]:font-medium [&>label]:text-body [&>label]:text-foreground",
|
|
1053
1424
|
"[&>span]:font-secondary [&>span]:text-muted [&>span]:text-small",
|
|
1054
1425
|
"[&>p]:font-secondary [&>p]:text-small [&>p]:text-muted [&>p[data-error]]:text-error",
|
|
1055
1426
|
"[&>select]:block [&>select]:w-full [&>select]:rounded-[var(--radius-control)] [&>select]:border [&>select]:border-solid [&>select]:border-control-border [&>select]:bg-transparent [&>select]:px-3 [&>select]:py-2",
|
|
1056
|
-
"[&>select]:font-
|
|
1427
|
+
"[&>select]:font-control [&>select]:text-body [&>select]:text-foreground [&>select]:transition-colors [&>select]:duration-[var(--motion-duration-color)]",
|
|
1057
1428
|
"[&>select]:outline-focus-ring [&>select]:outline-offset-[var(--focus-ring-offset)] [&>select]:focus-visible:outline [&>select]:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
1058
1429
|
"[&>select:user-invalid]:border-error [&>select]:aria-[invalid=true]:border-error [&>select]:disabled:cursor-not-allowed [&>select]:disabled:border-disabled [&>select]:disabled:text-muted"
|
|
1059
|
-
].join(" ")),
|
|
1060
|
-
Root: ({ label:
|
|
1061
|
-
let g =
|
|
1062
|
-
return /* @__PURE__ */
|
|
1063
|
-
className:
|
|
1430
|
+
].join(" ")), pn = {
|
|
1431
|
+
Root: ({ label: e, name: r, required: i, optionalLabel: a, disabled: o, invalid: s, hint: c, errorMessage: l, testId: d, defaultValue: f, onChange$: p, placeholder: m, children: h }) => {
|
|
1432
|
+
let g = u(), _ = `${g}-control`, v = `${g}-hint`, y = `${g}-error`, b = [c ? v : void 0, s && l ? y : void 0].filter(Boolean).join(" ") || void 0;
|
|
1433
|
+
return /* @__PURE__ */ n("div", {
|
|
1434
|
+
className: fn(),
|
|
1064
1435
|
children: [
|
|
1065
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ t("label", {
|
|
1066
1437
|
htmlFor: _,
|
|
1067
|
-
children:
|
|
1438
|
+
children: e
|
|
1068
1439
|
}),
|
|
1069
|
-
/* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ n("select", {
|
|
1070
1441
|
id: _,
|
|
1071
1442
|
name: r,
|
|
1072
1443
|
required: i,
|
|
@@ -1076,34 +1447,34 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1076
1447
|
"aria-describedby": b,
|
|
1077
1448
|
"data-testid": d,
|
|
1078
1449
|
onChange: (e) => !o && p?.next(e.currentTarget.value),
|
|
1079
|
-
children: [/* @__PURE__ */
|
|
1450
|
+
children: [/* @__PURE__ */ t("option", {
|
|
1080
1451
|
value: "",
|
|
1081
1452
|
children: m
|
|
1082
1453
|
}), h]
|
|
1083
1454
|
}),
|
|
1084
|
-
!i && a && /* @__PURE__ */
|
|
1085
|
-
c && /* @__PURE__ */
|
|
1455
|
+
!i && a && /* @__PURE__ */ t("span", { children: a }),
|
|
1456
|
+
c && /* @__PURE__ */ t("p", {
|
|
1086
1457
|
id: v,
|
|
1087
1458
|
children: c
|
|
1088
1459
|
}),
|
|
1089
|
-
s &&
|
|
1460
|
+
s && l && /* @__PURE__ */ t("p", {
|
|
1090
1461
|
id: y,
|
|
1091
1462
|
"data-error": !0,
|
|
1092
|
-
children:
|
|
1463
|
+
children: l
|
|
1093
1464
|
})
|
|
1094
1465
|
]
|
|
1095
1466
|
});
|
|
1096
1467
|
},
|
|
1097
|
-
Option: ({ value:
|
|
1098
|
-
value:
|
|
1468
|
+
Option: ({ value: e, children: n, testId: r }) => /* @__PURE__ */ t("option", {
|
|
1469
|
+
value: e,
|
|
1099
1470
|
"data-testid": r,
|
|
1100
1471
|
children: n
|
|
1101
1472
|
})
|
|
1102
|
-
},
|
|
1473
|
+
}, Z = class extends Error {
|
|
1103
1474
|
constructor(e) {
|
|
1104
1475
|
super(`Slider configuration: ${e}`), this.name = "SliderConfigurationError";
|
|
1105
1476
|
}
|
|
1106
|
-
},
|
|
1477
|
+
}, mn = y([
|
|
1107
1478
|
"block h-[var(--slider-thumb-size)] w-full cursor-pointer appearance-none bg-transparent",
|
|
1108
1479
|
"disabled:cursor-not-allowed",
|
|
1109
1480
|
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
@@ -1114,202 +1485,202 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1114
1485
|
"[&::-moz-range-track]:h-[var(--slider-track-thickness)] [&::-moz-range-track]:rounded-[var(--radius-control)] [&::-moz-range-track]:bg-control-border",
|
|
1115
1486
|
"[&::-moz-range-thumb]:size-[var(--slider-thumb-size)] [&::-moz-range-thumb]:rounded-[var(--radius-control)] [&::-moz-range-thumb]:border-none [&::-moz-range-thumb]:bg-foreground",
|
|
1116
1487
|
"[&:disabled::-moz-range-track]:bg-disabled [&:disabled::-moz-range-thumb]:bg-disabled"
|
|
1117
|
-
].join(" ")),
|
|
1118
|
-
for (let [t, n] of Object.entries(e)) if (!Number.isFinite(n)) throw new
|
|
1119
|
-
if (e.min >= e.max) throw new
|
|
1120
|
-
if (e.step <= 0) throw new
|
|
1121
|
-
if (e.value < e.min || e.value > e.max) throw new
|
|
1122
|
-
},
|
|
1123
|
-
let f = `${
|
|
1124
|
-
return
|
|
1125
|
-
min:
|
|
1488
|
+
].join(" ")), hn = (e) => {
|
|
1489
|
+
for (let [t, n] of Object.entries(e)) if (!Number.isFinite(n)) throw new Z(`\`${t}\` must be a finite number, got ${n}`);
|
|
1490
|
+
if (e.min >= e.max) throw new Z(`\`min\` (${e.min}) must be below \`max\` (${e.max})`);
|
|
1491
|
+
if (e.step <= 0) throw new Z(`\`step\` (${e.step}) must be positive`);
|
|
1492
|
+
if (e.value < e.min || e.value > e.max) throw new Z(`\`value\` (${e.value}) must lie within [${e.min}, ${e.max}]`);
|
|
1493
|
+
}, gn = ({ min: e, max: r, step: i = 1, value: a, onInput$: o, label: s, valueText: c, disabled: l, testId: d }) => {
|
|
1494
|
+
let f = `${u()}-control`;
|
|
1495
|
+
return hn({
|
|
1496
|
+
min: e,
|
|
1126
1497
|
max: r,
|
|
1127
1498
|
step: i,
|
|
1128
1499
|
value: a
|
|
1129
|
-
}), /* @__PURE__ */
|
|
1500
|
+
}), /* @__PURE__ */ n("div", {
|
|
1130
1501
|
className: "flex flex-col gap-[var(--space-stack)]",
|
|
1131
|
-
children: [/* @__PURE__ */
|
|
1502
|
+
children: [/* @__PURE__ */ t("label", {
|
|
1132
1503
|
htmlFor: f,
|
|
1133
1504
|
className: "font-secondary font-medium text-body text-foreground",
|
|
1134
1505
|
children: s
|
|
1135
|
-
}), /* @__PURE__ */
|
|
1506
|
+
}), /* @__PURE__ */ t("input", {
|
|
1136
1507
|
id: f,
|
|
1137
1508
|
type: "range",
|
|
1138
|
-
className:
|
|
1139
|
-
min:
|
|
1509
|
+
className: mn(),
|
|
1510
|
+
min: e,
|
|
1140
1511
|
max: r,
|
|
1141
1512
|
step: i,
|
|
1142
1513
|
value: a,
|
|
1143
|
-
disabled:
|
|
1514
|
+
disabled: l,
|
|
1144
1515
|
"aria-valuetext": c,
|
|
1145
1516
|
"data-testid": d,
|
|
1146
1517
|
onChange: (e) => o.next(e.currentTarget.valueAsNumber)
|
|
1147
1518
|
})]
|
|
1148
1519
|
});
|
|
1149
|
-
},
|
|
1520
|
+
}, _n = class extends Error {
|
|
1150
1521
|
constructor(e) {
|
|
1151
1522
|
super(`Tabs.${e} must be composed inside Tabs.Root`), this.name = "TabsCompositionError";
|
|
1152
1523
|
}
|
|
1153
|
-
},
|
|
1524
|
+
}, vn = y([
|
|
1154
1525
|
"flex flex-row overflow-x-auto",
|
|
1155
1526
|
"p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))]",
|
|
1156
1527
|
"m-[calc(-1*(var(--focus-ring-width)+var(--focus-ring-offset)))]",
|
|
1157
1528
|
"scroll-p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))]"
|
|
1158
|
-
].join(" ")),
|
|
1529
|
+
].join(" ")), yn = y([
|
|
1159
1530
|
"font-secondary text-label tracking-label",
|
|
1160
1531
|
"text-muted hover:text-foreground aria-selected:text-foreground",
|
|
1161
1532
|
"border-b-[length:var(--tab-marker-thickness)] border-solid border-transparent aria-selected:border-foreground",
|
|
1162
|
-
"
|
|
1533
|
+
"cursor-pointer select-none px-[var(--tab-inset-inline)] py-[var(--tab-inset-block)]",
|
|
1163
1534
|
"transition-colors duration-[var(--motion-duration-color)]",
|
|
1164
1535
|
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]"
|
|
1165
|
-
].join(" ")),
|
|
1166
|
-
let t =
|
|
1167
|
-
if (t === void 0) throw new
|
|
1536
|
+
].join(" ")), bn = y("outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]"), xn = a(void 0), Sn = (e) => {
|
|
1537
|
+
let t = c(xn);
|
|
1538
|
+
if (t === void 0) throw new _n(e);
|
|
1168
1539
|
return t;
|
|
1169
|
-
},
|
|
1540
|
+
}, Cn = (e) => e.split("").map((e) => e.charCodeAt(0).toString(16).padStart(4, "0")).join(""), wn = (e) => {
|
|
1170
1541
|
e.currentTarget.scrollIntoView({
|
|
1171
1542
|
block: "nearest",
|
|
1172
1543
|
inline: "nearest"
|
|
1173
1544
|
});
|
|
1174
|
-
},
|
|
1545
|
+
}, Tn = (e, t) => `${e}tab-${Cn(t)}`, En = (e, t) => `${e}panel-${Cn(t)}`, Dn = (e, t) => {
|
|
1175
1546
|
let n = e.closest("[role=\"tablist\"]");
|
|
1176
1547
|
if (n === null) return;
|
|
1177
1548
|
let r = Array.from(n.querySelectorAll(":scope > [role=\"tab\"]"));
|
|
1178
1549
|
return r[(r.indexOf(e) + t + r.length) % r.length];
|
|
1179
|
-
},
|
|
1180
|
-
Root: ({ active:
|
|
1181
|
-
let o =
|
|
1182
|
-
return /* @__PURE__ */
|
|
1550
|
+
}, On = {
|
|
1551
|
+
Root: ({ active: e, onSelect$: n, label: r, children: i, testId: a }) => {
|
|
1552
|
+
let o = u();
|
|
1553
|
+
return /* @__PURE__ */ t(xn.Provider, {
|
|
1183
1554
|
value: {
|
|
1184
|
-
active:
|
|
1555
|
+
active: e,
|
|
1185
1556
|
onSelect$: n,
|
|
1186
1557
|
label: r,
|
|
1187
1558
|
baseId: o
|
|
1188
1559
|
},
|
|
1189
|
-
children: /* @__PURE__ */
|
|
1560
|
+
children: /* @__PURE__ */ t("div", {
|
|
1190
1561
|
"data-testid": a,
|
|
1191
1562
|
children: i
|
|
1192
1563
|
})
|
|
1193
1564
|
});
|
|
1194
1565
|
},
|
|
1195
|
-
List: ({ children:
|
|
1196
|
-
let { label: r } =
|
|
1197
|
-
return /* @__PURE__ */
|
|
1566
|
+
List: ({ children: e, testId: n }) => {
|
|
1567
|
+
let { label: r } = Sn("List");
|
|
1568
|
+
return /* @__PURE__ */ t("div", {
|
|
1198
1569
|
role: "tablist",
|
|
1199
1570
|
"aria-label": r,
|
|
1200
|
-
className:
|
|
1571
|
+
className: vn(),
|
|
1201
1572
|
"data-testid": n,
|
|
1202
|
-
children:
|
|
1573
|
+
children: e
|
|
1203
1574
|
});
|
|
1204
1575
|
},
|
|
1205
|
-
Tab: ({ value:
|
|
1206
|
-
let { active: i, onSelect$: a, baseId: o } =
|
|
1207
|
-
return /* @__PURE__ */
|
|
1576
|
+
Tab: ({ value: e, children: n, testId: r }) => {
|
|
1577
|
+
let { active: i, onSelect$: a, baseId: o } = Sn("Tab"), s = i === e;
|
|
1578
|
+
return /* @__PURE__ */ t("button", {
|
|
1208
1579
|
type: "button",
|
|
1209
1580
|
role: "tab",
|
|
1210
|
-
id:
|
|
1581
|
+
id: Tn(o, e),
|
|
1211
1582
|
"aria-selected": s,
|
|
1212
|
-
"aria-controls":
|
|
1583
|
+
"aria-controls": En(o, e),
|
|
1213
1584
|
tabIndex: s ? 0 : -1,
|
|
1214
|
-
"data-value":
|
|
1585
|
+
"data-value": e,
|
|
1215
1586
|
"data-testid": r,
|
|
1216
|
-
className:
|
|
1217
|
-
onClick: () => a.next(
|
|
1587
|
+
className: yn(),
|
|
1588
|
+
onClick: () => a.next(e),
|
|
1218
1589
|
onKeyDown: (e) => {
|
|
1219
1590
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
1220
1591
|
e.preventDefault();
|
|
1221
|
-
let t =
|
|
1592
|
+
let t = Dn(e.currentTarget, e.key === "ArrowRight" ? 1 : -1);
|
|
1222
1593
|
if (t === void 0) return;
|
|
1223
1594
|
t.focus();
|
|
1224
1595
|
let n = t.dataset.value;
|
|
1225
1596
|
n !== void 0 && a.next(n);
|
|
1226
1597
|
},
|
|
1227
|
-
onFocus:
|
|
1598
|
+
onFocus: wn,
|
|
1228
1599
|
children: n
|
|
1229
1600
|
});
|
|
1230
1601
|
},
|
|
1231
|
-
Panel: ({ value:
|
|
1232
|
-
let { active: i, baseId: a } =
|
|
1233
|
-
return /* @__PURE__ */
|
|
1602
|
+
Panel: ({ value: e, children: n, testId: r }) => {
|
|
1603
|
+
let { active: i, baseId: a } = Sn("Panel"), o = i === e;
|
|
1604
|
+
return /* @__PURE__ */ t("div", {
|
|
1234
1605
|
role: "tabpanel",
|
|
1235
|
-
id:
|
|
1236
|
-
"aria-labelledby":
|
|
1606
|
+
id: En(a, e),
|
|
1607
|
+
"aria-labelledby": Tn(a, e),
|
|
1237
1608
|
hidden: !o,
|
|
1238
1609
|
tabIndex: o ? 0 : void 0,
|
|
1239
|
-
className:
|
|
1610
|
+
className: bn(),
|
|
1240
1611
|
"data-testid": r,
|
|
1241
1612
|
children: o ? n : void 0
|
|
1242
1613
|
});
|
|
1243
1614
|
}
|
|
1244
|
-
},
|
|
1245
|
-
let y =
|
|
1246
|
-
return
|
|
1615
|
+
}, kn = y("block min-h-24 w-full rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent px-3 py-2 font-control text-body text-foreground transition-colors duration-[var(--motion-duration-color)] outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)] [&:user-invalid]:border-error aria-[invalid=true]:border-error disabled:cursor-not-allowed disabled:border-disabled disabled:text-muted"), An = ({ label: e, name: r, required: i, optionalLabel: a, invalid: o, disabled: s, defaultValue: c, placeholder: d, autocomplete: f, hint: m, errorMessage: h, onInput$: g, reset$: _, testId: v }) => {
|
|
1616
|
+
let y = u(), b = `${y}-control`, x = `${y}-hint`, S = `${y}-error`, C = [m ? x : void 0, o ? S : void 0].filter(Boolean).join(" ") || void 0, w = p(null);
|
|
1617
|
+
return l(() => {
|
|
1247
1618
|
let e = _?.subscribe(() => {
|
|
1248
1619
|
w.current && (w.current.value = "");
|
|
1249
1620
|
});
|
|
1250
1621
|
return () => e?.unsubscribe();
|
|
1251
|
-
}, [_]), /* @__PURE__ */
|
|
1622
|
+
}, [_]), /* @__PURE__ */ n("div", {
|
|
1252
1623
|
className: "flex flex-col gap-[var(--space-stack)]",
|
|
1253
1624
|
children: [
|
|
1254
|
-
/* @__PURE__ */
|
|
1625
|
+
/* @__PURE__ */ t("label", {
|
|
1255
1626
|
htmlFor: b,
|
|
1256
1627
|
className: "font-secondary font-medium text-body text-foreground",
|
|
1257
|
-
children:
|
|
1628
|
+
children: e
|
|
1258
1629
|
}),
|
|
1259
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ t("textarea", {
|
|
1260
1631
|
ref: w,
|
|
1261
1632
|
id: b,
|
|
1262
1633
|
name: r,
|
|
1263
|
-
className:
|
|
1634
|
+
className: kn(),
|
|
1264
1635
|
required: i,
|
|
1265
1636
|
disabled: s,
|
|
1266
|
-
defaultValue:
|
|
1637
|
+
defaultValue: c,
|
|
1267
1638
|
placeholder: d,
|
|
1268
|
-
autoComplete:
|
|
1639
|
+
autoComplete: f,
|
|
1269
1640
|
"aria-invalid": o || void 0,
|
|
1270
1641
|
"aria-describedby": C,
|
|
1271
1642
|
"data-testid": v,
|
|
1272
1643
|
onInput: (e) => g?.next(e.currentTarget.value)
|
|
1273
1644
|
}),
|
|
1274
|
-
!i && a && /* @__PURE__ */
|
|
1645
|
+
!i && a && /* @__PURE__ */ t("span", {
|
|
1275
1646
|
className: "font-secondary text-muted text-small",
|
|
1276
1647
|
children: a
|
|
1277
1648
|
}),
|
|
1278
|
-
m && /* @__PURE__ */
|
|
1649
|
+
m && /* @__PURE__ */ t("p", {
|
|
1279
1650
|
id: x,
|
|
1280
1651
|
className: "font-secondary text-muted text-small",
|
|
1281
1652
|
children: m
|
|
1282
1653
|
}),
|
|
1283
|
-
o && /* @__PURE__ */
|
|
1654
|
+
o && /* @__PURE__ */ t("p", {
|
|
1284
1655
|
id: S,
|
|
1285
1656
|
className: "font-secondary text-error text-small",
|
|
1286
1657
|
children: h
|
|
1287
1658
|
})
|
|
1288
1659
|
]
|
|
1289
1660
|
});
|
|
1290
|
-
},
|
|
1661
|
+
}, jn = y([
|
|
1291
1662
|
"flex flex-col items-center",
|
|
1292
1663
|
"min-h-[var(--cover-height)]",
|
|
1293
1664
|
"px-[var(--gutter)] py-[var(--space-region)]"
|
|
1294
|
-
].join(" ")),
|
|
1665
|
+
].join(" ")), Mn = "my-auto max-w-full", Nn = ({ children: e, foot: r, testId: i }) => {
|
|
1295
1666
|
let a = r != null && typeof r != "boolean";
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
className:
|
|
1667
|
+
return /* @__PURE__ */ n("div", {
|
|
1668
|
+
className: jn(),
|
|
1298
1669
|
"data-testid": i,
|
|
1299
|
-
children: [/* @__PURE__ */
|
|
1300
|
-
className:
|
|
1301
|
-
children:
|
|
1302
|
-
}), a && /* @__PURE__ */
|
|
1670
|
+
children: [/* @__PURE__ */ t("div", {
|
|
1671
|
+
className: Mn,
|
|
1672
|
+
children: e
|
|
1673
|
+
}), a && /* @__PURE__ */ t("div", { children: r })]
|
|
1303
1674
|
});
|
|
1304
|
-
},
|
|
1675
|
+
}, Pn = class extends Error {
|
|
1305
1676
|
constructor(e) {
|
|
1306
1677
|
super(`Dialog.${e} must be composed inside Dialog.Root`), this.name = "DialogCompositionError";
|
|
1307
1678
|
}
|
|
1308
|
-
},
|
|
1679
|
+
}, Fn = class extends Error {
|
|
1309
1680
|
constructor() {
|
|
1310
1681
|
super("A Dialog takes exactly one accessible naming source: a visible Dialog.Title or ariaLabel on Dialog.Root, never both"), this.name = "DialogNamingError";
|
|
1311
1682
|
}
|
|
1312
|
-
},
|
|
1683
|
+
}, In = y([
|
|
1313
1684
|
"open:flex open:flex-col m-auto p-0 overflow-hidden",
|
|
1314
1685
|
"bg-surface text-foreground",
|
|
1315
1686
|
"rounded-[var(--radius-dialog)] shadow-[var(--elevation-floating)]",
|
|
@@ -1320,61 +1691,61 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1320
1691
|
content: ["w-[32rem] max-w-[calc(100vw-2*var(--gutter))]", "max-h-[calc(100dvh-2*var(--space-region))]"].join(" ")
|
|
1321
1692
|
} },
|
|
1322
1693
|
defaultVariants: { extent: "screen" }
|
|
1323
|
-
}),
|
|
1694
|
+
}), Ln = y(["px-[var(--space-region)] pt-[var(--space-region)] pb-[var(--space-region)]", "[&:has(+[data-dialog-member=description])]:pb-0"].join(" ")), Rn = y(["px-[var(--space-region)] pt-[var(--space-region)] pb-[var(--space-region)]", "[[data-dialog-member=title]+&]:mt-[var(--space-stack)] [[data-dialog-member=title]+&]:pt-0"].join(" ")), zn = y([
|
|
1324
1695
|
"grow shrink min-h-0 overflow-y-auto",
|
|
1325
1696
|
"px-[var(--space-region)] py-[var(--space-region)]",
|
|
1326
1697
|
"[&:not(:first-child)]:border-t [&:not(:first-child)]:border-border"
|
|
1327
|
-
].join(" ")),
|
|
1698
|
+
].join(" ")), Bn = y([
|
|
1328
1699
|
"flex flex-row flex-wrap items-center justify-end gap-[var(--space-stack)] shrink-0",
|
|
1329
1700
|
"px-[var(--space-region)] pt-[var(--space-region)] pb-[var(--space-region)]",
|
|
1330
1701
|
"[[data-dialog-member=content]+&]:border-t [[data-dialog-member=content]+&]:border-border"
|
|
1331
|
-
].join(" ")),
|
|
1332
|
-
let t =
|
|
1333
|
-
if (t === void 0) throw new
|
|
1702
|
+
].join(" ")), Vn = a(void 0), Q = (e) => {
|
|
1703
|
+
let t = c(Vn);
|
|
1704
|
+
if (t === void 0) throw new Pn(e);
|
|
1334
1705
|
return t;
|
|
1335
|
-
},
|
|
1706
|
+
}, Hn = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Un = (e, { presented: t, opener: n }) => {
|
|
1336
1707
|
if (e === void 0 || e.open) return;
|
|
1337
1708
|
let r = document.activeElement;
|
|
1338
|
-
n.current = r instanceof HTMLElement && r !== document.body ? r : void 0, e.showModal(), t.current = !0, e.querySelector(
|
|
1709
|
+
n.current = r instanceof HTMLElement && r !== document.body ? r : void 0, e.showModal(), t.current = !0, e.querySelector(Hn)?.focus();
|
|
1339
1710
|
}, $ = (e, { presented: t }) => {
|
|
1340
1711
|
t.current = !1, e?.open && e.close();
|
|
1341
|
-
},
|
|
1342
|
-
Root: ({ children:
|
|
1343
|
-
let
|
|
1344
|
-
presented:
|
|
1712
|
+
}, Wn = {
|
|
1713
|
+
Root: ({ children: e, onDismiss$: n, showDialog$: r, extent: i, ariaLabel: a, testId: o }) => {
|
|
1714
|
+
let c = u(), d = p(void 0), f = p(!1), h = p(void 0), [g] = m(() => ({
|
|
1715
|
+
presented: f,
|
|
1345
1716
|
opener: h
|
|
1346
|
-
})), [_, v] =
|
|
1717
|
+
})), [_, v] = m({
|
|
1347
1718
|
title: !1,
|
|
1348
1719
|
description: !1
|
|
1349
|
-
}), y =
|
|
1720
|
+
}), y = s((e) => (v((t) => ({
|
|
1350
1721
|
...t,
|
|
1351
1722
|
[e]: !0
|
|
1352
1723
|
})), () => v((t) => ({
|
|
1353
1724
|
...t,
|
|
1354
1725
|
[e]: !1
|
|
1355
1726
|
}))), []), b = {
|
|
1356
|
-
titleId: `${
|
|
1357
|
-
descriptionId: `${
|
|
1727
|
+
titleId: `${c}title`,
|
|
1728
|
+
descriptionId: `${c}description`,
|
|
1358
1729
|
isLabelled: a !== void 0,
|
|
1359
1730
|
registerNamePart: y
|
|
1360
1731
|
}, x = () => {
|
|
1361
1732
|
n.next(), r === void 0 ? $(d.current, g) : r.next(!1);
|
|
1362
1733
|
};
|
|
1363
|
-
return
|
|
1364
|
-
if (r === void 0) return
|
|
1734
|
+
return l(() => {
|
|
1735
|
+
if (r === void 0) return Un(d.current, g), () => $(d.current, g);
|
|
1365
1736
|
let e = r.subscribe((e) => {
|
|
1366
|
-
e ?
|
|
1737
|
+
e ? Un(d.current, g) : $(d.current, g);
|
|
1367
1738
|
});
|
|
1368
1739
|
return () => {
|
|
1369
1740
|
e.unsubscribe(), $(d.current, g);
|
|
1370
1741
|
};
|
|
1371
|
-
}, [r, g]), /* @__PURE__ */
|
|
1742
|
+
}, [r, g]), /* @__PURE__ */ t(Vn.Provider, {
|
|
1372
1743
|
value: b,
|
|
1373
|
-
children: /* @__PURE__ */
|
|
1744
|
+
children: /* @__PURE__ */ t("dialog", {
|
|
1374
1745
|
ref: (e) => {
|
|
1375
1746
|
d.current = e ?? void 0, e?.setAttribute("headingreset", "");
|
|
1376
1747
|
},
|
|
1377
|
-
className:
|
|
1748
|
+
className: In({ extent: i }),
|
|
1378
1749
|
"aria-label": a,
|
|
1379
1750
|
"aria-labelledby": a === void 0 && _.title ? b.titleId : void 0,
|
|
1380
1751
|
"aria-describedby": _.description ? b.descriptionId : void 0,
|
|
@@ -1387,66 +1758,66 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1387
1758
|
},
|
|
1388
1759
|
onClose: () => {
|
|
1389
1760
|
if (d.current?.open) return;
|
|
1390
|
-
let e =
|
|
1391
|
-
|
|
1761
|
+
let e = f.current;
|
|
1762
|
+
f.current = !1;
|
|
1392
1763
|
let t = h.current;
|
|
1393
|
-
h.current = void 0, t?.isConnected && (t.matches(
|
|
1764
|
+
h.current = void 0, t?.isConnected && (t.matches(Hn) || t.hasAttribute("tabindex")) && t.focus(), e && r?.next(!1);
|
|
1394
1765
|
},
|
|
1395
|
-
"data-testid":
|
|
1396
|
-
children:
|
|
1766
|
+
"data-testid": o,
|
|
1767
|
+
children: e
|
|
1397
1768
|
})
|
|
1398
1769
|
});
|
|
1399
1770
|
},
|
|
1400
|
-
Title: ({ children:
|
|
1771
|
+
Title: ({ children: e, testId: n }) => {
|
|
1401
1772
|
let { titleId: r, isLabelled: i, registerNamePart: a } = Q("Title");
|
|
1402
|
-
if (
|
|
1403
|
-
return /* @__PURE__ */
|
|
1773
|
+
if (l(() => a("title"), [a]), i) throw new Fn();
|
|
1774
|
+
return /* @__PURE__ */ t("div", {
|
|
1404
1775
|
"data-dialog-member": "title",
|
|
1405
|
-
className:
|
|
1776
|
+
className: Ln(),
|
|
1406
1777
|
"data-testid": n,
|
|
1407
|
-
children: /* @__PURE__ */
|
|
1778
|
+
children: /* @__PURE__ */ t("h1", {
|
|
1408
1779
|
id: r,
|
|
1409
|
-
className: "font-
|
|
1410
|
-
children:
|
|
1780
|
+
className: "font-heading text-dialog-title leading-dialog-title text-foreground",
|
|
1781
|
+
children: e
|
|
1411
1782
|
})
|
|
1412
1783
|
});
|
|
1413
1784
|
},
|
|
1414
|
-
Description: ({ children:
|
|
1785
|
+
Description: ({ children: e, testId: n }) => {
|
|
1415
1786
|
let { descriptionId: r, registerNamePart: i } = Q("Description");
|
|
1416
|
-
return
|
|
1787
|
+
return l(() => i("description"), [i]), /* @__PURE__ */ t("div", {
|
|
1417
1788
|
"data-dialog-member": "description",
|
|
1418
|
-
className:
|
|
1789
|
+
className: Rn(),
|
|
1419
1790
|
"data-testid": n,
|
|
1420
|
-
children: /* @__PURE__ */
|
|
1791
|
+
children: /* @__PURE__ */ t("p", {
|
|
1421
1792
|
id: r,
|
|
1422
|
-
className: "font-
|
|
1423
|
-
children:
|
|
1793
|
+
className: "font-body text-body leading-body text-foreground",
|
|
1794
|
+
children: e
|
|
1424
1795
|
})
|
|
1425
1796
|
});
|
|
1426
1797
|
},
|
|
1427
|
-
Content: ({ children:
|
|
1798
|
+
Content: ({ children: e, testId: n }) => (Q("Content"), /* @__PURE__ */ t("div", {
|
|
1428
1799
|
"data-dialog-member": "content",
|
|
1429
|
-
className:
|
|
1800
|
+
className: zn(),
|
|
1430
1801
|
"data-testid": n,
|
|
1431
|
-
children:
|
|
1802
|
+
children: e
|
|
1432
1803
|
})),
|
|
1433
|
-
Actions: ({ children:
|
|
1804
|
+
Actions: ({ children: e, testId: n }) => (Q("Actions"), /* @__PURE__ */ t("div", {
|
|
1434
1805
|
"data-dialog-member": "actions",
|
|
1435
|
-
className:
|
|
1806
|
+
className: Bn(),
|
|
1436
1807
|
"data-testid": n,
|
|
1437
|
-
children:
|
|
1808
|
+
children: e
|
|
1438
1809
|
}))
|
|
1439
|
-
},
|
|
1810
|
+
}, Gn = y("font-secondary text-small text-muted py-[var(--space-region)] px-[var(--gutter)]", {
|
|
1440
1811
|
variants: { edge: {
|
|
1441
1812
|
none: "",
|
|
1442
1813
|
rule: "border-t border-solid border-rule"
|
|
1443
1814
|
} },
|
|
1444
1815
|
defaultVariants: { edge: "rule" }
|
|
1445
|
-
}),
|
|
1446
|
-
className:
|
|
1816
|
+
}), Kn = ({ edge: e, children: n, testId: r }) => /* @__PURE__ */ t("footer", {
|
|
1817
|
+
className: Gn({ edge: e }),
|
|
1447
1818
|
"data-testid": r,
|
|
1448
1819
|
children: n
|
|
1449
|
-
}),
|
|
1820
|
+
}), qn = y("font-secondary text-small", {
|
|
1450
1821
|
variants: { state: {
|
|
1451
1822
|
idle: "text-muted",
|
|
1452
1823
|
sending: "text-muted",
|
|
@@ -1454,90 +1825,159 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1454
1825
|
failed: "text-error"
|
|
1455
1826
|
} },
|
|
1456
1827
|
defaultVariants: { state: "idle" }
|
|
1457
|
-
}),
|
|
1828
|
+
}), Jn = {
|
|
1458
1829
|
sent: "status",
|
|
1459
1830
|
failed: "alert"
|
|
1460
|
-
},
|
|
1831
|
+
}, Yn = ({ action: e, method: r = "post", state: i = "idle", children: a, actions: o, note: s, testId: c }) => {
|
|
1461
1832
|
let l = s != null && typeof s != "boolean";
|
|
1462
1833
|
if (i === "sent" && !l) throw Error("Form in the `sent` state must be given a `note` - it is the outcome message.");
|
|
1463
|
-
let u = i !== "sent", d =
|
|
1464
|
-
return /* @__PURE__ */
|
|
1465
|
-
action:
|
|
1834
|
+
let u = i !== "sent", d = Jn[i];
|
|
1835
|
+
return /* @__PURE__ */ n("form", {
|
|
1836
|
+
action: e,
|
|
1466
1837
|
method: r,
|
|
1467
1838
|
"aria-busy": i === "sending" || void 0,
|
|
1468
1839
|
"data-testid": c,
|
|
1469
1840
|
className: "flex max-w-[var(--measure)] flex-col gap-[var(--space-region)]",
|
|
1470
1841
|
children: [
|
|
1471
|
-
u && /* @__PURE__ */
|
|
1842
|
+
u && /* @__PURE__ */ t("div", {
|
|
1472
1843
|
className: "flex flex-col gap-[var(--space-stack)]",
|
|
1473
1844
|
children: a
|
|
1474
1845
|
}),
|
|
1475
|
-
u && o && /* @__PURE__ */
|
|
1846
|
+
u && o && /* @__PURE__ */ t("div", {
|
|
1476
1847
|
className: "flex flex-row gap-[var(--space-stack)]",
|
|
1477
1848
|
children: o
|
|
1478
1849
|
}),
|
|
1479
|
-
l && /* @__PURE__ */
|
|
1850
|
+
l && /* @__PURE__ */ t("p", {
|
|
1480
1851
|
role: d,
|
|
1481
|
-
className:
|
|
1852
|
+
className: qn({ state: i }),
|
|
1482
1853
|
children: s
|
|
1483
1854
|
})
|
|
1484
1855
|
]
|
|
1485
1856
|
});
|
|
1486
|
-
},
|
|
1487
|
-
"flex items-baseline
|
|
1857
|
+
}, Xn = y([
|
|
1858
|
+
"flex items-baseline",
|
|
1488
1859
|
"font-secondary text-label leading-label tracking-label text-muted",
|
|
1489
1860
|
"py-[var(--space-region)] px-[var(--gutter)]",
|
|
1490
1861
|
"[&_[aria-current=page]]:text-foreground"
|
|
1491
1862
|
].join(" "), {
|
|
1492
|
-
variants: {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1863
|
+
variants: {
|
|
1864
|
+
edge: {
|
|
1865
|
+
none: "",
|
|
1866
|
+
rule: "border-b border-solid border-rule"
|
|
1867
|
+
},
|
|
1868
|
+
mode: {
|
|
1869
|
+
navigation: "justify-between",
|
|
1870
|
+
statusAction: "flex-wrap gap-x-[var(--space-region)] gap-y-[var(--space-stack)]"
|
|
1871
|
+
}
|
|
1872
|
+
},
|
|
1873
|
+
defaultVariants: {
|
|
1874
|
+
edge: "rule",
|
|
1875
|
+
mode: "navigation"
|
|
1876
|
+
}
|
|
1877
|
+
}), Zn = [
|
|
1498
1878
|
"inline-flex shrink-0 items-center",
|
|
1499
1879
|
"min-h-[calc(var(--text-label)*var(--leading-label))]",
|
|
1500
1880
|
"min-w-[var(--standing-min-width)]"
|
|
1501
|
-
].join(" "),
|
|
1502
|
-
|
|
1503
|
-
"
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
"
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
}),
|
|
1881
|
+
].join(" "), Qn = "flex flex-wrap items-baseline gap-[var(--space-region)]", $n = "min-w-0 wrap-anywhere", er = "ms-auto", tr = (e) => e != null && typeof e != "boolean" && e !== "", nr = ({ edge: r, testId: i, standing: a, navName: o, children: s, status: c, action: l }) => {
|
|
1882
|
+
let u = c !== void 0 || l !== void 0;
|
|
1883
|
+
return /* @__PURE__ */ t("header", {
|
|
1884
|
+
className: Xn({
|
|
1885
|
+
edge: r,
|
|
1886
|
+
mode: u ? "statusAction" : "navigation"
|
|
1887
|
+
}),
|
|
1888
|
+
"data-testid": i,
|
|
1889
|
+
children: u ? /* @__PURE__ */ n(e, { children: [tr(c) && /* @__PURE__ */ t("div", {
|
|
1890
|
+
className: $n,
|
|
1891
|
+
children: c
|
|
1892
|
+
}), tr(l) && /* @__PURE__ */ t("div", {
|
|
1893
|
+
className: er,
|
|
1894
|
+
children: l
|
|
1895
|
+
})] }) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
|
|
1896
|
+
className: Zn,
|
|
1897
|
+
children: a
|
|
1898
|
+
}), /* @__PURE__ */ t("nav", {
|
|
1899
|
+
"aria-label": o,
|
|
1900
|
+
className: Qn,
|
|
1901
|
+
children: s
|
|
1902
|
+
})] })
|
|
1903
|
+
});
|
|
1904
|
+
}, rr = y("flex flex-col min-h-[var(--fold-height)] gap-[var(--space-stack)]", {
|
|
1513
1905
|
variants: { place: {
|
|
1514
1906
|
start: "justify-start",
|
|
1515
1907
|
center: "justify-center",
|
|
1516
1908
|
between: "justify-between"
|
|
1517
1909
|
} },
|
|
1518
1910
|
defaultVariants: { place: "center" }
|
|
1519
|
-
}),
|
|
1520
|
-
className:
|
|
1911
|
+
}), ir = ({ place: e, children: n, testId: r }) => /* @__PURE__ */ t("div", {
|
|
1912
|
+
className: rr({ place: e }),
|
|
1521
1913
|
"data-testid": r,
|
|
1522
1914
|
children: n
|
|
1523
|
-
}),
|
|
1524
|
-
className:
|
|
1915
|
+
}), ar = y("flex flex-col gap-[var(--space-stack)] py-[var(--space-band)] px-[var(--gutter)]"), or = y("font-heading text-title leading-title tracking-optical text-foreground"), sr = y("font-body text-lede leading-lede text-foreground max-w-[var(--measure-wide)]"), cr = y("font-body text-small text-muted max-w-[var(--measure)]"), lr = ({ title: e, lede: r, intro: i, testId: a }) => /* @__PURE__ */ n("header", {
|
|
1916
|
+
className: ar(),
|
|
1525
1917
|
"data-testid": a,
|
|
1526
1918
|
children: [
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
className:
|
|
1529
|
-
children:
|
|
1919
|
+
/* @__PURE__ */ t("h1", {
|
|
1920
|
+
className: or(),
|
|
1921
|
+
children: e
|
|
1530
1922
|
}),
|
|
1531
|
-
r !== void 0 && /* @__PURE__ */
|
|
1532
|
-
className:
|
|
1923
|
+
r !== void 0 && /* @__PURE__ */ t("p", {
|
|
1924
|
+
className: sr(),
|
|
1533
1925
|
children: r
|
|
1534
1926
|
}),
|
|
1535
|
-
i !== void 0 && /* @__PURE__ */
|
|
1536
|
-
className:
|
|
1927
|
+
i !== void 0 && /* @__PURE__ */ t("p", {
|
|
1928
|
+
className: cr(),
|
|
1537
1929
|
children: i
|
|
1538
1930
|
})
|
|
1539
1931
|
]
|
|
1540
|
-
}),
|
|
1932
|
+
}), ur = y("max-h-full max-w-full min-h-0 min-w-0 outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]", {
|
|
1933
|
+
variants: { axis: {
|
|
1934
|
+
both: "overflow-auto",
|
|
1935
|
+
horizontal: "overflow-x-auto overflow-y-hidden",
|
|
1936
|
+
vertical: "overflow-y-auto overflow-x-hidden"
|
|
1937
|
+
} },
|
|
1938
|
+
defaultVariants: { axis: "both" }
|
|
1939
|
+
}), dr = y("p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))]", {
|
|
1940
|
+
variants: { axis: {
|
|
1941
|
+
both: "w-fit min-w-full",
|
|
1942
|
+
horizontal: "w-fit min-w-full",
|
|
1943
|
+
vertical: "w-full"
|
|
1944
|
+
} },
|
|
1945
|
+
defaultVariants: { axis: "both" }
|
|
1946
|
+
}), fr = (e, t) => {
|
|
1947
|
+
let n = e.scrollWidth > e.clientWidth, r = e.scrollHeight > e.clientHeight;
|
|
1948
|
+
return t !== "vertical" && n || t !== "horizontal" && r;
|
|
1949
|
+
}, pr = (e, t, n) => {
|
|
1950
|
+
let [r, i] = m(!0);
|
|
1951
|
+
return d(() => {
|
|
1952
|
+
let r = e.current;
|
|
1953
|
+
if (r === null) return;
|
|
1954
|
+
let a = () => i(fr(r, n) || r === document.activeElement);
|
|
1955
|
+
a();
|
|
1956
|
+
let o = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(a);
|
|
1957
|
+
return o?.observe(r), t.current !== null && o?.observe(t.current), window.addEventListener("resize", a), r.addEventListener("blur", a), () => {
|
|
1958
|
+
o?.disconnect(), window.removeEventListener("resize", a), r.removeEventListener("blur", a);
|
|
1959
|
+
};
|
|
1960
|
+
}, [
|
|
1961
|
+
e,
|
|
1962
|
+
t,
|
|
1963
|
+
n
|
|
1964
|
+
]), r;
|
|
1965
|
+
}, mr = ({ axis: e, ariaLabel: n, children: r, testId: i }) => {
|
|
1966
|
+
let a = p(null), o = p(null), s = pr(a, o, e ?? "both");
|
|
1967
|
+
return /* @__PURE__ */ t("div", {
|
|
1968
|
+
ref: a,
|
|
1969
|
+
className: ur({ axis: e }),
|
|
1970
|
+
"data-testid": i,
|
|
1971
|
+
role: s ? "group" : void 0,
|
|
1972
|
+
"aria-label": s ? n : void 0,
|
|
1973
|
+
tabIndex: s ? 0 : void 0,
|
|
1974
|
+
children: /* @__PURE__ */ t("div", {
|
|
1975
|
+
ref: o,
|
|
1976
|
+
className: dr({ axis: e }),
|
|
1977
|
+
children: r
|
|
1978
|
+
})
|
|
1979
|
+
});
|
|
1980
|
+
}, hr = y([
|
|
1541
1981
|
"relative",
|
|
1542
1982
|
"py-[var(--space-band)]",
|
|
1543
1983
|
"[[data-section]+&]:border-t [[data-section]+&]:border-solid [[data-section]+&]:border-rule"
|
|
@@ -1547,20 +1987,20 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1547
1987
|
full: ""
|
|
1548
1988
|
} },
|
|
1549
1989
|
defaultVariants: { bleed: "inset" }
|
|
1550
|
-
}),
|
|
1990
|
+
}), gr = ({ bleed: e, name: n, children: r, testId: i }) => /* @__PURE__ */ t("section", {
|
|
1551
1991
|
"data-section": "",
|
|
1552
|
-
className:
|
|
1992
|
+
className: hr({ bleed: e }),
|
|
1553
1993
|
"aria-label": n,
|
|
1554
1994
|
"data-testid": i,
|
|
1555
1995
|
children: r
|
|
1556
|
-
}),
|
|
1996
|
+
}), _r = y([
|
|
1557
1997
|
"grid gap-[var(--space-region)] lg:grid-cols-[12rem_minmax(0,1fr)]",
|
|
1558
1998
|
"[&>div:first-child]:border-solid [&>div:first-child]:border-border [&>div:first-child]:border-b [&>div:first-child]:pb-[var(--space-stack)]",
|
|
1559
1999
|
"lg:[&>div:first-child]:border-b-0 lg:[&>div:first-child]:border-r lg:[&>div:first-child]:pb-0 lg:[&>div:first-child]:pr-[var(--space-stack)]",
|
|
1560
2000
|
"lg:[&>div:first-child>nav]:sticky lg:[&>div:first-child>nav]:top-0 lg:[&>div:first-child>nav]:max-h-[min(100dvh,var(--sidebar-scrollport-height,100dvh))] lg:[&>div:first-child>nav]:overflow-y-auto",
|
|
1561
2001
|
"[&>div:first-child>nav]:p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))] lg:[&>div:first-child>nav]:scroll-p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))]",
|
|
1562
2002
|
"[&>div:first-child>nav>ul]:flex [&>div:first-child>nav>ul]:flex-col [&>div:first-child>nav>ul]:gap-[var(--space-stack)]"
|
|
1563
|
-
].join(" ")),
|
|
2003
|
+
].join(" ")), vr = (e) => {
|
|
1564
2004
|
if (!e) return;
|
|
1565
2005
|
let t = [];
|
|
1566
2006
|
for (let n = e.parentElement; n && n !== e.ownerDocument.documentElement; n = n.parentElement) t.push(n);
|
|
@@ -1574,8 +2014,8 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1574
2014
|
return window.addEventListener("resize", n), () => {
|
|
1575
2015
|
r?.disconnect(), window.removeEventListener("resize", n), e.style.removeProperty("--sidebar-scrollport-height");
|
|
1576
2016
|
};
|
|
1577
|
-
},
|
|
1578
|
-
"w-full text-left font-secondary text-label tracking-label",
|
|
2017
|
+
}, yr = y([
|
|
2018
|
+
"w-full text-left font-secondary text-label tracking-label wrap-anywhere",
|
|
1579
2019
|
"underline-offset-[var(--underline-offset)]",
|
|
1580
2020
|
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]"
|
|
1581
2021
|
].join(" "), {
|
|
@@ -1585,44 +2025,44 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1585
2025
|
inert: "text-muted cursor-not-allowed"
|
|
1586
2026
|
} },
|
|
1587
2027
|
defaultVariants: { state: "usable" }
|
|
1588
|
-
}),
|
|
1589
|
-
let a =
|
|
1590
|
-
return /* @__PURE__ */
|
|
2028
|
+
}), br = a(void 0), xr = ({ entryKey: e, children: n, inert: r, testId: i }) => {
|
|
2029
|
+
let a = c(br), o = a !== void 0 && a.active === e;
|
|
2030
|
+
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t("button", {
|
|
1591
2031
|
type: "button",
|
|
1592
|
-
className:
|
|
2032
|
+
className: yr({ state: r ? "inert" : o ? "active" : "usable" }),
|
|
1593
2033
|
disabled: r,
|
|
1594
2034
|
"aria-current": o ? "true" : void 0,
|
|
1595
2035
|
"data-testid": i,
|
|
1596
2036
|
onClick: () => {
|
|
1597
|
-
o || a?.onSelect$.next(
|
|
2037
|
+
o || a?.onSelect$.next(e);
|
|
1598
2038
|
},
|
|
1599
2039
|
children: n
|
|
1600
2040
|
}) });
|
|
1601
|
-
},
|
|
2041
|
+
}, Sr = ({ children: e, testId: n }) => /* @__PURE__ */ t("div", {
|
|
1602
2042
|
"data-testid": n,
|
|
1603
|
-
children:
|
|
1604
|
-
}),
|
|
1605
|
-
Root: ({ active:
|
|
1606
|
-
let l =
|
|
1607
|
-
return /* @__PURE__ */
|
|
1608
|
-
className:
|
|
2043
|
+
children: e
|
|
2044
|
+
}), Cr = {
|
|
2045
|
+
Root: ({ active: e, label: i, onSelect$: a, children: s, testId: c }) => {
|
|
2046
|
+
let l = r.toArray(s).filter(o);
|
|
2047
|
+
return /* @__PURE__ */ n("div", {
|
|
2048
|
+
className: _r(),
|
|
1609
2049
|
"data-testid": c,
|
|
1610
|
-
children: [/* @__PURE__ */
|
|
1611
|
-
ref:
|
|
2050
|
+
children: [/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t("nav", {
|
|
2051
|
+
ref: vr,
|
|
1612
2052
|
"aria-label": i,
|
|
1613
|
-
children: /* @__PURE__ */
|
|
2053
|
+
children: /* @__PURE__ */ t(br, {
|
|
1614
2054
|
value: {
|
|
1615
|
-
active:
|
|
1616
|
-
onSelect$:
|
|
2055
|
+
active: e,
|
|
2056
|
+
onSelect$: a
|
|
1617
2057
|
},
|
|
1618
|
-
children: /* @__PURE__ */
|
|
2058
|
+
children: /* @__PURE__ */ t("ul", { children: l.filter((e) => e.type === xr) })
|
|
1619
2059
|
})
|
|
1620
|
-
}) }), l.filter((e) => e.type ===
|
|
2060
|
+
}) }), l.filter((e) => e.type === Sr)]
|
|
1621
2061
|
});
|
|
1622
2062
|
},
|
|
1623
|
-
Item:
|
|
1624
|
-
Content:
|
|
1625
|
-
},
|
|
2063
|
+
Item: xr,
|
|
2064
|
+
Content: Sr
|
|
2065
|
+
}, wr = {
|
|
1626
2066
|
surface: "#ffffff",
|
|
1627
2067
|
foreground: "#0f172a",
|
|
1628
2068
|
muted: "#64748b",
|
|
@@ -1646,8 +2086,10 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1646
2086
|
success: "#047857",
|
|
1647
2087
|
warning: "#b45309",
|
|
1648
2088
|
error: "#d63384",
|
|
2089
|
+
errorHover: "#be185d",
|
|
2090
|
+
errorForeground: "#ffffff",
|
|
1649
2091
|
info: "#0e7490"
|
|
1650
|
-
},
|
|
2092
|
+
}, Tr = {
|
|
1651
2093
|
surface: "#0f172a",
|
|
1652
2094
|
foreground: "#f8fafc",
|
|
1653
2095
|
muted: "#94a3b8",
|
|
@@ -1661,8 +2103,8 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1661
2103
|
primary: "#8b5cf6",
|
|
1662
2104
|
primaryHover: "#a78bfa",
|
|
1663
2105
|
primaryForeground: "#020617",
|
|
1664
|
-
secondary: "#
|
|
1665
|
-
secondaryHover: "#
|
|
2106
|
+
secondary: "#0ea5e9",
|
|
2107
|
+
secondaryHover: "#38bdf8",
|
|
1666
2108
|
secondaryForeground: "#020617",
|
|
1667
2109
|
disabled: "#475569",
|
|
1668
2110
|
disabledHover: "#334155",
|
|
@@ -1671,7 +2113,9 @@ var g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e
|
|
|
1671
2113
|
success: "#34d399",
|
|
1672
2114
|
warning: "#fbbf24",
|
|
1673
2115
|
error: "#f48fb1",
|
|
2116
|
+
errorHover: "#f8bbd0",
|
|
2117
|
+
errorForeground: "#020617",
|
|
1674
2118
|
info: "#22d3ee"
|
|
1675
2119
|
};
|
|
1676
2120
|
//#endregion
|
|
1677
|
-
export {
|
|
2121
|
+
export { me as Box, ge as Brandmark, At as Button, ye as Checklist, Rt as Choices, x as Cluster, Se as Collection, ie as ColumnLayout, Nn as Cover, Ne as DefinitionList, Wn as Dialog, st as Eyebrow, de as FieldRow, Fe as Figure, Kn as Footer, Yn as Form, lt as H1, dt as H2, pt as H3, ht as H4, _t as H5, yt as H6, nr as Header, ir as Hero, Re as Icon, Bt as Input, Ht as Link, Ve as Meter, ln as MultiSelect, xt as Note, dn as NumberInput, Ct as P, lr as PageHead, Ot as Prose, Ke as Rail, mr as ScrollContainer, gr as Section, pn as Select, Cr as Sidebar, gn as Slider, pe as Stack, at as Table, On as Tabs, An as TextArea, Tr as dark, wr as light };
|