@juwel-development/design-system 3.8.0 → 3.9.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 +171 -0
- package/dist/design-system.js +644 -258
- package/dist/index.css +1 -1
- package/dist/types/Interaction/MultiSelect/MultiSelect.d.ts +102 -0
- package/dist/types/Interaction/MultiSelect/MultiSelectCompositionError.d.ts +3 -0
- package/dist/types/Interaction/MultiSelect/fitChips.d.ts +6 -0
- package/dist/types/Interaction/NumberInput/NumberInput.d.ts +34 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/Interaction/MultiSelect/MultiSelect.tsx +820 -0
- package/src/Interaction/MultiSelect/MultiSelectCompositionError.ts +6 -0
- package/src/Interaction/MultiSelect/fitChips.ts +27 -0
- package/src/Interaction/NumberInput/NumberInput.tsx +125 -0
- package/src/index.ts +2 -0
package/dist/design-system.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { Children as n,
|
|
2
|
+
import { Children as n, Fragment as r, createContext as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useLayoutEffect as u, useReducer as d, useRef as f, useState as p } from "react";
|
|
3
3
|
import './index.css';//#region node_modules/clsx/dist/clsx.mjs
|
|
4
|
-
function
|
|
4
|
+
function m(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 = m(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 h() {
|
|
16
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = m(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 g = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _ = h, v = (e, t) => (n) => {
|
|
22
|
+
if (t?.variants == null) return _(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 = g(t) || g(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 _(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 p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
46
46
|
r
|
|
47
47
|
] : e;
|
|
48
48
|
}, []), n?.class, n?.className);
|
|
49
|
-
},
|
|
49
|
+
}, y = v("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,14 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
61
61
|
gap: "region",
|
|
62
62
|
justify: "start"
|
|
63
63
|
}
|
|
64
|
-
}),
|
|
65
|
-
className:
|
|
64
|
+
}), b = ({ gap: t, justify: n, children: r, testId: i }) => /* @__PURE__ */ e("div", {
|
|
65
|
+
className: y({
|
|
66
66
|
gap: t,
|
|
67
67
|
justify: n
|
|
68
68
|
}),
|
|
69
69
|
"data-testid": i,
|
|
70
70
|
children: r
|
|
71
|
-
}),
|
|
71
|
+
}), x = v("flex", {
|
|
72
72
|
variants: {
|
|
73
73
|
gap: {
|
|
74
74
|
stack: "gap-[var(--space-stack)]",
|
|
@@ -93,8 +93,8 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
93
93
|
measure: !1,
|
|
94
94
|
direction: "column"
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
97
|
-
className:
|
|
96
|
+
}), S = ({ gap: t, measure: n, direction: r, align: i, children: a, testId: o }) => /* @__PURE__ */ e("div", {
|
|
97
|
+
className: x({
|
|
98
98
|
gap: t,
|
|
99
99
|
measure: n,
|
|
100
100
|
direction: r,
|
|
@@ -102,55 +102,55 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
102
102
|
}),
|
|
103
103
|
"data-testid": o,
|
|
104
104
|
children: a
|
|
105
|
-
}),
|
|
105
|
+
}), C = v("inline-flex", { variants: { cut: {
|
|
106
106
|
full: "",
|
|
107
107
|
compact: ""
|
|
108
|
-
} } }),
|
|
108
|
+
} } }), w = ({ name: t, cut: n, children: r, testId: i }) => t === "" ? /* @__PURE__ */ e("span", {
|
|
109
109
|
"aria-hidden": "true",
|
|
110
110
|
"data-cut": n,
|
|
111
|
-
className:
|
|
111
|
+
className: C({ cut: n }),
|
|
112
112
|
"data-testid": i,
|
|
113
113
|
children: r
|
|
114
114
|
}) : /* @__PURE__ */ e("span", {
|
|
115
115
|
role: "img",
|
|
116
116
|
"aria-label": t,
|
|
117
117
|
"data-cut": n,
|
|
118
|
-
className:
|
|
118
|
+
className: C({ cut: n }),
|
|
119
119
|
"data-testid": i,
|
|
120
120
|
children: r
|
|
121
|
-
}),
|
|
121
|
+
}), T = v("m-0 list-none p-0"), ee = v([
|
|
122
122
|
"flex items-start gap-3 font-primary text-body leading-body text-foreground",
|
|
123
123
|
"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
124
|
"[&: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(" ")),
|
|
125
|
+
].join(" ")), E = {
|
|
126
126
|
Root: ({ children: t, testId: n }) => /* @__PURE__ */ e("ul", {
|
|
127
|
-
className:
|
|
127
|
+
className: T(),
|
|
128
128
|
role: "list",
|
|
129
129
|
"data-testid": n,
|
|
130
130
|
children: t
|
|
131
131
|
}),
|
|
132
132
|
Item: ({ children: t }) => /* @__PURE__ */ e("li", {
|
|
133
|
-
className:
|
|
133
|
+
className: ee(),
|
|
134
134
|
children: t
|
|
135
135
|
})
|
|
136
|
-
},
|
|
136
|
+
}, te = v("m-0 list-none p-0"), D = v("py-[var(--space-collection-item)] [&+li]:border-t [&+li]:border-solid [&+li]:border-border"), O = {
|
|
137
137
|
Root: ({ children: t, testId: n }) => /* @__PURE__ */ e("ul", {
|
|
138
|
-
className:
|
|
138
|
+
className: te(),
|
|
139
139
|
role: "list",
|
|
140
140
|
"data-testid": n,
|
|
141
141
|
children: t
|
|
142
142
|
}),
|
|
143
143
|
Item: ({ children: t, testId: n }) => /* @__PURE__ */ e("li", {
|
|
144
|
-
className:
|
|
144
|
+
className: D(),
|
|
145
145
|
"data-testid": n,
|
|
146
146
|
children: t
|
|
147
147
|
})
|
|
148
|
-
}, ne =
|
|
148
|
+
}, ne = v([
|
|
149
149
|
"grid gap-[var(--space-stack)] py-6",
|
|
150
150
|
"border-b border-solid border-border first:border-t",
|
|
151
151
|
"lg:grid-cols-[16rem_minmax(0,1fr)] lg:items-baseline lg:gap-x-12",
|
|
152
152
|
"lg:[&>dt]:col-start-1 lg:[&>dd]:col-start-2 lg:[&>dd]:row-start-1"
|
|
153
|
-
].join(" ")), re =
|
|
153
|
+
].join(" ")), re = v("font-primary text-subtitle leading-subtitle text-foreground"), ie = v("font-primary text-body leading-body text-muted max-w-[var(--measure)]"), ae = {
|
|
154
154
|
Root: ({ children: t, testId: n }) => /* @__PURE__ */ e("dl", {
|
|
155
155
|
"data-testid": n,
|
|
156
156
|
children: t
|
|
@@ -168,7 +168,7 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
168
168
|
className: ie(),
|
|
169
169
|
children: t
|
|
170
170
|
})
|
|
171
|
-
},
|
|
171
|
+
}, k = v("block w-full object-cover bg-backing", {
|
|
172
172
|
variants: {
|
|
173
173
|
ratio: {
|
|
174
174
|
portrait: "aspect-portrait",
|
|
@@ -185,13 +185,13 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
187
|
defaultVariants: { focus: "center" }
|
|
188
|
-
}),
|
|
188
|
+
}), A = ({ src: n, alt: r, width: i, height: a, ratio: o, focus: s, responsive: c, caption: l, overlay: u, priority: d, testId: f }) => {
|
|
189
189
|
let p = u != null && typeof u != "boolean", m = /* @__PURE__ */ e("img", {
|
|
190
190
|
src: n,
|
|
191
191
|
alt: r,
|
|
192
192
|
width: i,
|
|
193
193
|
height: a,
|
|
194
|
-
className:
|
|
194
|
+
className: k({
|
|
195
195
|
ratio: o,
|
|
196
196
|
focus: s
|
|
197
197
|
}),
|
|
@@ -214,20 +214,20 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
214
214
|
children: l
|
|
215
215
|
})]
|
|
216
216
|
});
|
|
217
|
-
},
|
|
217
|
+
}, j = class extends Error {
|
|
218
218
|
constructor(e) {
|
|
219
219
|
super(`Meter configuration is invalid: ${e}`), this.name = "MeterConfigurationError";
|
|
220
220
|
}
|
|
221
|
-
},
|
|
221
|
+
}, M = v("w-full h-[var(--meter-track-thickness)] bg-meter-track border border-solid border-rule"), N = v("h-full w-[calc(var(--meter-level)*100%)]", {
|
|
222
222
|
variants: { treatment: {
|
|
223
223
|
neutral: "bg-meter-fill",
|
|
224
224
|
depleting: "bg-[color-mix(in_oklab,var(--color-meter-fill)_calc(var(--meter-level)*100%),var(--color-error))]"
|
|
225
225
|
} },
|
|
226
226
|
defaultVariants: { treatment: "neutral" }
|
|
227
|
-
}),
|
|
228
|
-
if (!Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) throw new
|
|
229
|
-
if (n >= r) throw new
|
|
230
|
-
if (t < n || t > r) throw new
|
|
227
|
+
}), P = ({ value: t, min: n = 0, max: r, treatment: i, label: a, valueText: o, testId: s }) => {
|
|
228
|
+
if (!Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) throw new j(`value, min and max must be finite numbers (got value=${t}, min=${n}, max=${r})`);
|
|
229
|
+
if (n >= r) throw new j(`min must be less than max (got min=${n}, max=${r})`);
|
|
230
|
+
if (t < n || t > r) throw new j(`value must lie within [min, max] (got value=${t}, min=${n}, max=${r})`);
|
|
231
231
|
let c = { "--meter-level": (t - n) / (r - n) };
|
|
232
232
|
return /* @__PURE__ */ e("div", {
|
|
233
233
|
role: "meter",
|
|
@@ -237,28 +237,28 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
237
237
|
"aria-label": a,
|
|
238
238
|
"aria-valuetext": o,
|
|
239
239
|
"data-testid": s,
|
|
240
|
-
className:
|
|
240
|
+
className: M(),
|
|
241
241
|
style: c,
|
|
242
242
|
children: /* @__PURE__ */ e("div", {
|
|
243
243
|
"aria-hidden": "true",
|
|
244
|
-
className:
|
|
244
|
+
className: N({ treatment: i })
|
|
245
245
|
})
|
|
246
246
|
});
|
|
247
|
-
},
|
|
247
|
+
}, F = v(["grid gap-[var(--space-stack)]", "lg:grid-cols-[10rem_minmax(0,1fr)] lg:items-start lg:gap-x-12"].join(" ")), I = v("lg:sticky lg:top-6"), L = v("block border-b border-solid border-border pb-1 font-secondary text-label tracking-label text-muted"), R = v("block pt-1 font-secondary text-label tracking-label text-foreground"), z = {
|
|
248
248
|
Root: ({ children: t, testId: n }) => /* @__PURE__ */ e("div", {
|
|
249
|
-
className:
|
|
249
|
+
className: F(),
|
|
250
250
|
"data-testid": n,
|
|
251
251
|
children: t
|
|
252
252
|
}),
|
|
253
253
|
Index: ({ number: n, children: r, testId: i }) => /* @__PURE__ */ t("div", {
|
|
254
|
-
className:
|
|
254
|
+
className: I(),
|
|
255
255
|
"data-testid": i,
|
|
256
256
|
"aria-hidden": "true",
|
|
257
257
|
children: [n !== void 0 && /* @__PURE__ */ e("span", {
|
|
258
|
-
className:
|
|
258
|
+
className: L(),
|
|
259
259
|
children: n
|
|
260
260
|
}), /* @__PURE__ */ e("span", {
|
|
261
|
-
className:
|
|
261
|
+
className: R(),
|
|
262
262
|
children: r
|
|
263
263
|
})]
|
|
264
264
|
}),
|
|
@@ -266,7 +266,7 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
266
266
|
"data-testid": n,
|
|
267
267
|
children: t
|
|
268
268
|
})
|
|
269
|
-
},
|
|
269
|
+
}, B = v([
|
|
270
270
|
"[&:not([data-notes])]:overflow-x-auto",
|
|
271
271
|
"[&>table]:w-full [&>table]:border-collapse [&>table]:text-left",
|
|
272
272
|
"[&_caption]:pb-3 [&_caption]:text-left [&_caption]:font-secondary [&_caption]:text-label [&_caption]:tracking-label [&_caption]:text-muted",
|
|
@@ -275,7 +275,7 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
275
275
|
"[&[data-notes=content]>table]:max-md:block",
|
|
276
276
|
"[&[data-notes=content]_thead]:max-md:block [&[data-notes=content]_tbody]:max-md:block [&[data-notes=content]_tfoot]:max-md:block",
|
|
277
277
|
"[&[data-notes=content]_tr]:max-md:block [&[data-notes=content]_td]:max-md:block [&[data-notes=content]_th]:max-md:block"
|
|
278
|
-
].join(" ")),
|
|
278
|
+
].join(" ")), V = v("border-t border-solid border-border"), H = v("px-4 py-2 text-small first:pl-0 last:pr-0", {
|
|
279
279
|
variants: {
|
|
280
280
|
variant: {
|
|
281
281
|
value: "font-primary text-foreground tabular-nums",
|
|
@@ -291,24 +291,24 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
291
291
|
variant: "value",
|
|
292
292
|
align: "left"
|
|
293
293
|
}
|
|
294
|
-
}),
|
|
294
|
+
}), oe = v("px-4 py-2 font-secondary font-medium text-label text-muted tracking-label first:pl-0 last:pr-0", {
|
|
295
295
|
variants: { align: {
|
|
296
296
|
left: "text-left",
|
|
297
297
|
right: "text-right",
|
|
298
298
|
center: "text-center"
|
|
299
299
|
} },
|
|
300
300
|
defaultVariants: { align: "left" }
|
|
301
|
-
}),
|
|
301
|
+
}), se = {
|
|
302
302
|
Root: ({ caption: n, notes: r, children: i, testId: a }) => {
|
|
303
303
|
let o = /* @__PURE__ */ t("table", { children: [/* @__PURE__ */ e("caption", { children: n }), i] });
|
|
304
304
|
return r === void 0 ? /* @__PURE__ */ e("section", {
|
|
305
|
-
className:
|
|
305
|
+
className: B(),
|
|
306
306
|
"data-testid": a,
|
|
307
307
|
"aria-label": n,
|
|
308
308
|
tabIndex: 0,
|
|
309
309
|
children: o
|
|
310
310
|
}) : /* @__PURE__ */ e("div", {
|
|
311
|
-
className:
|
|
311
|
+
className: B(),
|
|
312
312
|
"data-notes": r,
|
|
313
313
|
"data-testid": a,
|
|
314
314
|
children: o
|
|
@@ -318,24 +318,24 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
318
318
|
Body: ({ children: t }) => /* @__PURE__ */ e("tbody", { children: t }),
|
|
319
319
|
Footer: ({ children: t }) => /* @__PURE__ */ e("tfoot", { children: t }),
|
|
320
320
|
Row: ({ children: t, testId: n }) => /* @__PURE__ */ e("tr", {
|
|
321
|
-
className:
|
|
321
|
+
className: V(),
|
|
322
322
|
"data-testid": n,
|
|
323
323
|
children: t
|
|
324
324
|
}),
|
|
325
325
|
HeaderCell: ({ scope: t, align: n, children: r }) => /* @__PURE__ */ e("th", {
|
|
326
326
|
scope: t,
|
|
327
|
-
className:
|
|
327
|
+
className: oe({ align: n }),
|
|
328
328
|
children: r
|
|
329
329
|
}),
|
|
330
330
|
Cell: ({ variant: t, align: n, children: r }) => /* @__PURE__ */ e("td", {
|
|
331
|
-
className:
|
|
331
|
+
className: H({
|
|
332
332
|
variant: t,
|
|
333
333
|
align: n
|
|
334
334
|
}),
|
|
335
335
|
"data-variant": t ?? "value",
|
|
336
336
|
children: r
|
|
337
337
|
})
|
|
338
|
-
},
|
|
338
|
+
}, ce = v("font-secondary text-label tracking-label font-medium", {
|
|
339
339
|
variants: { color: {
|
|
340
340
|
foreground: "text-foreground",
|
|
341
341
|
muted: "text-muted",
|
|
@@ -345,11 +345,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
345
345
|
info: "text-info"
|
|
346
346
|
} },
|
|
347
347
|
defaultVariants: { color: "muted" }
|
|
348
|
-
}),
|
|
349
|
-
className:
|
|
348
|
+
}), U = ({ children: t, color: n, testId: r }) => /* @__PURE__ */ e("p", {
|
|
349
|
+
className: ce({ color: n }),
|
|
350
350
|
"data-testid": r,
|
|
351
351
|
children: t
|
|
352
|
-
}),
|
|
352
|
+
}), le = v("font-primary text-display leading-display tracking-optical max-w-[var(--measure-display)]", {
|
|
353
353
|
variants: { color: {
|
|
354
354
|
foreground: "text-foreground",
|
|
355
355
|
muted: "text-muted",
|
|
@@ -359,11 +359,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
359
359
|
info: "text-info"
|
|
360
360
|
} },
|
|
361
361
|
defaultVariants: { color: "foreground" }
|
|
362
|
-
}),
|
|
363
|
-
className:
|
|
362
|
+
}), ue = ({ children: t, color: n, testId: r }) => /* @__PURE__ */ e("h1", {
|
|
363
|
+
className: le({ color: n }),
|
|
364
364
|
"data-testid": r,
|
|
365
365
|
children: t
|
|
366
|
-
}),
|
|
366
|
+
}), W = v("font-primary text-title leading-title tracking-optical", {
|
|
367
367
|
variants: { color: {
|
|
368
368
|
foreground: "text-foreground",
|
|
369
369
|
muted: "text-muted",
|
|
@@ -373,11 +373,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
373
373
|
info: "text-info"
|
|
374
374
|
} },
|
|
375
375
|
defaultVariants: { color: "foreground" }
|
|
376
|
-
}),
|
|
377
|
-
className:
|
|
376
|
+
}), de = ({ children: t, color: n, testId: r }) => /* @__PURE__ */ e("h2", {
|
|
377
|
+
className: W({ color: n }),
|
|
378
378
|
"data-testid": r,
|
|
379
379
|
children: t
|
|
380
|
-
}),
|
|
380
|
+
}), fe = v("font-primary text-subtitle leading-subtitle", {
|
|
381
381
|
variants: { color: {
|
|
382
382
|
foreground: "text-foreground",
|
|
383
383
|
muted: "text-muted",
|
|
@@ -387,11 +387,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
387
387
|
info: "text-info"
|
|
388
388
|
} },
|
|
389
389
|
defaultVariants: { color: "foreground" }
|
|
390
|
-
}),
|
|
391
|
-
className:
|
|
390
|
+
}), pe = ({ children: t, color: n, testId: r }) => /* @__PURE__ */ e("h3", {
|
|
391
|
+
className: fe({ color: n }),
|
|
392
392
|
"data-testid": r,
|
|
393
393
|
children: t
|
|
394
|
-
}),
|
|
394
|
+
}), me = v("font-primary text-body leading-body font-bold", {
|
|
395
395
|
variants: { color: {
|
|
396
396
|
foreground: "text-foreground",
|
|
397
397
|
muted: "text-muted",
|
|
@@ -401,11 +401,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
401
401
|
info: "text-info"
|
|
402
402
|
} },
|
|
403
403
|
defaultVariants: { color: "foreground" }
|
|
404
|
-
}),
|
|
405
|
-
className:
|
|
404
|
+
}), he = ({ children: t, color: n, testId: r }) => /* @__PURE__ */ e("h4", {
|
|
405
|
+
className: me({ color: n }),
|
|
406
406
|
"data-testid": r,
|
|
407
407
|
children: t
|
|
408
|
-
}),
|
|
408
|
+
}), ge = v("font-primary text-body leading-body font-semibold", {
|
|
409
409
|
variants: { color: {
|
|
410
410
|
foreground: "text-foreground",
|
|
411
411
|
muted: "text-muted",
|
|
@@ -415,11 +415,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
415
415
|
info: "text-info"
|
|
416
416
|
} },
|
|
417
417
|
defaultVariants: { color: "foreground" }
|
|
418
|
-
}),
|
|
419
|
-
className:
|
|
418
|
+
}), _e = ({ children: t, color: n, testId: r }) => /* @__PURE__ */ e("h5", {
|
|
419
|
+
className: ge({ color: n }),
|
|
420
420
|
"data-testid": r,
|
|
421
421
|
children: t
|
|
422
|
-
}),
|
|
422
|
+
}), ve = v("font-primary text-body leading-body font-medium", {
|
|
423
423
|
variants: { color: {
|
|
424
424
|
foreground: "text-foreground",
|
|
425
425
|
muted: "text-muted",
|
|
@@ -429,11 +429,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
429
429
|
info: "text-info"
|
|
430
430
|
} },
|
|
431
431
|
defaultVariants: { color: "foreground" }
|
|
432
|
-
}),
|
|
433
|
-
className:
|
|
432
|
+
}), ye = ({ children: t, color: n, testId: r }) => /* @__PURE__ */ e("h6", {
|
|
433
|
+
className: ve({ color: n }),
|
|
434
434
|
"data-testid": r,
|
|
435
435
|
children: t
|
|
436
|
-
}),
|
|
436
|
+
}), be = v("font-secondary text-small", {
|
|
437
437
|
variants: { color: {
|
|
438
438
|
foreground: "text-foreground",
|
|
439
439
|
muted: "text-muted",
|
|
@@ -443,11 +443,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
443
443
|
info: "text-info"
|
|
444
444
|
} },
|
|
445
445
|
defaultVariants: { color: "foreground" }
|
|
446
|
-
}),
|
|
447
|
-
className:
|
|
446
|
+
}), xe = ({ children: t, color: n, testId: r }) => /* @__PURE__ */ e("p", {
|
|
447
|
+
className: be({ color: n }),
|
|
448
448
|
"data-testid": r,
|
|
449
449
|
children: t
|
|
450
|
-
}),
|
|
450
|
+
}), Se = v("font-primary text-body leading-body", {
|
|
451
451
|
variants: { color: {
|
|
452
452
|
foreground: "text-foreground",
|
|
453
453
|
muted: "text-muted",
|
|
@@ -457,11 +457,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
457
457
|
info: "text-info"
|
|
458
458
|
} },
|
|
459
459
|
defaultVariants: { color: "foreground" }
|
|
460
|
-
}),
|
|
461
|
-
className:
|
|
460
|
+
}), Ce = ({ children: t, color: n, testId: r }) => /* @__PURE__ */ e("p", {
|
|
461
|
+
className: Se({ color: n }),
|
|
462
462
|
"data-testid": r,
|
|
463
463
|
children: t
|
|
464
|
-
}),
|
|
464
|
+
}), we = v("flex max-w-[var(--measure)] flex-col gap-[var(--space-stack)]"), Te = v("font-primary text-lede leading-lede text-foreground"), Ee = v("font-primary text-body leading-body", {
|
|
465
465
|
variants: { color: {
|
|
466
466
|
foreground: "text-foreground",
|
|
467
467
|
muted: "text-muted",
|
|
@@ -471,66 +471,66 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
471
471
|
info: "text-info"
|
|
472
472
|
} },
|
|
473
473
|
defaultVariants: { color: "foreground" }
|
|
474
|
-
}),
|
|
474
|
+
}), De = v("font-primary text-small text-muted"), Oe = {
|
|
475
475
|
Root: ({ children: t, testId: n }) => /* @__PURE__ */ e("div", {
|
|
476
|
-
className:
|
|
476
|
+
className: we(),
|
|
477
477
|
"data-testid": n,
|
|
478
478
|
children: t
|
|
479
479
|
}),
|
|
480
480
|
Lede: ({ children: t }) => /* @__PURE__ */ e("p", {
|
|
481
|
-
className:
|
|
481
|
+
className: Te(),
|
|
482
482
|
children: t
|
|
483
483
|
}),
|
|
484
484
|
Body: ({ color: t, children: n }) => /* @__PURE__ */ e("p", {
|
|
485
|
-
className:
|
|
485
|
+
className: Ee({ color: t }),
|
|
486
486
|
children: n
|
|
487
487
|
}),
|
|
488
488
|
Tail: ({ children: t }) => /* @__PURE__ */ e("p", {
|
|
489
|
-
className:
|
|
489
|
+
className: De(),
|
|
490
490
|
children: t
|
|
491
491
|
})
|
|
492
|
-
},
|
|
492
|
+
}, ke = v("font-primary text-body transition-colors duration-[var(--motion-duration-color)] rounded-[var(--radius-control)] py-2 sm:py-2 disabled:bg-disabled disabled:hover:bg-disabled-hover cursor-pointer disabled:cursor-not-allowed select-none text-nowrap inline-flex flex-row items-center justify-center gap-2 outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]", {
|
|
493
493
|
variants: { variant: {
|
|
494
494
|
primary: "px-4 sm:px-6 min-w-[var(--control-min-width)] bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
495
495
|
secondary: "px-4 sm:px-6 min-w-[var(--control-min-width)] bg-secondary text-secondary-foreground hover:bg-secondary-hover",
|
|
496
496
|
ghost: "px-2 min-w-0 bg-transparent text-foreground hover:underline hover:decoration-[length:var(--underline-thickness)] hover:underline-offset-[var(--underline-offset)]"
|
|
497
497
|
} },
|
|
498
498
|
defaultVariants: { variant: "primary" }
|
|
499
|
-
}),
|
|
499
|
+
}), Ae = ({ children: t, disabled: n, testId: r, variant: i, onClick$: a, ariaLabel: o, type: s = "button" }) => /* @__PURE__ */ e("button", {
|
|
500
500
|
type: s,
|
|
501
501
|
"data-testid": r,
|
|
502
|
-
className:
|
|
502
|
+
className: ke({ variant: i }),
|
|
503
503
|
onClick: () => a?.next(),
|
|
504
504
|
disabled: n,
|
|
505
505
|
"aria-label": o,
|
|
506
506
|
children: t
|
|
507
|
-
}),
|
|
507
|
+
}), je = class extends Error {
|
|
508
508
|
constructor(e) {
|
|
509
509
|
super(`Choices.${e} must be composed inside Choices.Root`), this.name = "ChoicesCompositionError";
|
|
510
510
|
}
|
|
511
|
-
},
|
|
511
|
+
}, Me = v("flex flex-col gap-[var(--space-stack)]"), Ne = v([
|
|
512
512
|
"group/choice flex w-full flex-row items-start gap-3 text-left",
|
|
513
513
|
"rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent aria-checked:border-foreground",
|
|
514
514
|
"px-3 py-2",
|
|
515
515
|
"cursor-pointer disabled:cursor-not-allowed",
|
|
516
516
|
"transition-colors duration-[var(--motion-duration-color)]",
|
|
517
517
|
"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
|
|
518
|
+
].join(" ")), Pe = i(void 0), Fe = (e) => {
|
|
519
|
+
let t = s(Pe);
|
|
520
|
+
if (t === void 0) throw new je(e);
|
|
521
521
|
return t;
|
|
522
|
-
},
|
|
522
|
+
}, Ie = (e, t) => {
|
|
523
523
|
let n = e.closest("[role=\"radiogroup\"]");
|
|
524
524
|
if (n === null) return;
|
|
525
525
|
let r = Array.from(n.querySelectorAll(":scope > [role=\"radio\"]"));
|
|
526
526
|
return r[(r.indexOf(e) + t + r.length) % r.length];
|
|
527
|
-
},
|
|
527
|
+
}, Le = {
|
|
528
528
|
ArrowDown: 1,
|
|
529
529
|
ArrowRight: 1,
|
|
530
530
|
ArrowUp: -1,
|
|
531
531
|
ArrowLeft: -1
|
|
532
|
-
},
|
|
533
|
-
Root: ({ selected: t, onSelect$: n, label: r, inert: i, children: a, testId: o }) => /* @__PURE__ */ e(
|
|
532
|
+
}, Re = {
|
|
533
|
+
Root: ({ selected: t, onSelect$: n, label: r, inert: i, children: a, testId: o }) => /* @__PURE__ */ e(Pe.Provider, {
|
|
534
534
|
value: {
|
|
535
535
|
selected: t,
|
|
536
536
|
onSelect$: n,
|
|
@@ -540,32 +540,32 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
540
540
|
role: "radiogroup",
|
|
541
541
|
"aria-label": r,
|
|
542
542
|
"aria-disabled": i === !0 ? "true" : void 0,
|
|
543
|
-
className:
|
|
543
|
+
className: Me(),
|
|
544
544
|
"data-testid": o,
|
|
545
545
|
children: a
|
|
546
546
|
})
|
|
547
547
|
}),
|
|
548
548
|
Choice: ({ value: n, children: r, description: i, testId: a }) => {
|
|
549
|
-
let { selected: o, onSelect$: s, inert:
|
|
549
|
+
let { selected: o, onSelect$: s, inert: c } = Fe("Choice"), u = o === n, d = l(), f = `${d}-name`, p = `${d}-description`;
|
|
550
550
|
return /* @__PURE__ */ t("button", {
|
|
551
551
|
type: "button",
|
|
552
552
|
role: "radio",
|
|
553
553
|
"aria-checked": u,
|
|
554
554
|
"aria-labelledby": f,
|
|
555
555
|
"aria-describedby": p,
|
|
556
|
-
tabIndex: u && !
|
|
557
|
-
disabled:
|
|
556
|
+
tabIndex: u && !c ? 0 : -1,
|
|
557
|
+
disabled: c,
|
|
558
558
|
"data-value": n,
|
|
559
559
|
"data-testid": a,
|
|
560
|
-
className:
|
|
560
|
+
className: Ne(),
|
|
561
561
|
onClick: () => {
|
|
562
562
|
u || s.next(n);
|
|
563
563
|
},
|
|
564
564
|
onKeyDown: (e) => {
|
|
565
|
-
let t =
|
|
566
|
-
if (t === void 0 ||
|
|
565
|
+
let t = Le[e.key];
|
|
566
|
+
if (t === void 0 || c) return;
|
|
567
567
|
e.preventDefault();
|
|
568
|
-
let n =
|
|
568
|
+
let n = Ie(e.currentTarget, t);
|
|
569
569
|
if (n === void 0) return;
|
|
570
570
|
n.focus();
|
|
571
571
|
let r = n.dataset.value;
|
|
@@ -591,16 +591,16 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
591
591
|
})]
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
|
-
},
|
|
594
|
+
}, ze = v("block w-full rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent px-3 py-2 font-primary 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
595
|
variants: { variant: {
|
|
596
596
|
text: "",
|
|
597
597
|
email: "",
|
|
598
598
|
url: ""
|
|
599
599
|
} },
|
|
600
600
|
defaultVariants: { variant: "text" }
|
|
601
|
-
}),
|
|
602
|
-
let b =
|
|
603
|
-
return
|
|
601
|
+
}), Be = ({ label: n, name: r, variant: i, required: a, optionalLabel: o, invalid: s, disabled: u, defaultValue: d, placeholder: p, autocomplete: m, hint: h, errorMessage: g, onInput$: _, reset$: v, testId: y }) => {
|
|
602
|
+
let b = l(), x = `${b}-control`, S = `${b}-hint`, C = `${b}-error`, w = [h ? S : void 0, s ? C : void 0].filter(Boolean).join(" ") || void 0, T = f(null);
|
|
603
|
+
return c(() => {
|
|
604
604
|
let e = v?.subscribe(() => {
|
|
605
605
|
T.current && (T.current.value = "");
|
|
606
606
|
});
|
|
@@ -618,13 +618,13 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
618
618
|
id: x,
|
|
619
619
|
name: r,
|
|
620
620
|
type: i ?? "text",
|
|
621
|
-
className:
|
|
621
|
+
className: ze({ variant: i }),
|
|
622
622
|
required: a,
|
|
623
|
-
disabled:
|
|
624
|
-
defaultValue:
|
|
623
|
+
disabled: u,
|
|
624
|
+
defaultValue: d,
|
|
625
625
|
placeholder: p,
|
|
626
626
|
autoComplete: m,
|
|
627
|
-
"aria-invalid":
|
|
627
|
+
"aria-invalid": s || void 0,
|
|
628
628
|
"aria-describedby": w,
|
|
629
629
|
"data-testid": y,
|
|
630
630
|
onInput: (e) => _?.next(e.currentTarget.value)
|
|
@@ -638,14 +638,14 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
638
638
|
className: "font-secondary text-muted text-small",
|
|
639
639
|
children: h
|
|
640
640
|
}),
|
|
641
|
-
|
|
641
|
+
s && /* @__PURE__ */ e("p", {
|
|
642
642
|
id: C,
|
|
643
643
|
className: "font-secondary text-error text-small",
|
|
644
644
|
children: g
|
|
645
645
|
})
|
|
646
646
|
]
|
|
647
647
|
});
|
|
648
|
-
},
|
|
648
|
+
}, Ve = v("outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]", {
|
|
649
649
|
variants: { treatment: {
|
|
650
650
|
prose: "text-link underline decoration-[length:var(--underline-thickness)] underline-offset-[var(--underline-offset)] hover:decoration-[length:var(--underline-thickness-hover)]",
|
|
651
651
|
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 +653,401 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
653
653
|
graphic: "text-inherit no-underline"
|
|
654
654
|
} },
|
|
655
655
|
defaultVariants: { treatment: "prose" }
|
|
656
|
-
}),
|
|
656
|
+
}), He = ({ href: t, children: n, treatment: r, external: i, current: a, testId: o }) => /* @__PURE__ */ e("a", {
|
|
657
657
|
href: t,
|
|
658
|
-
className:
|
|
658
|
+
className: Ve({ treatment: r }),
|
|
659
659
|
target: i ? "_blank" : void 0,
|
|
660
660
|
rel: i ? "noopener noreferrer" : void 0,
|
|
661
661
|
"aria-current": a ? "page" : void 0,
|
|
662
662
|
"data-testid": o,
|
|
663
663
|
children: n
|
|
664
|
-
}),
|
|
664
|
+
}), Ue = (e, t, n, r) => {
|
|
665
|
+
let i = Math.max(e.length - 1, 0) * r;
|
|
666
|
+
if (e.reduce((e, t) => e + t, 0) + i <= n) return e.length;
|
|
667
|
+
let a = 0, o = t;
|
|
668
|
+
for (let t of e) {
|
|
669
|
+
if (o + t + r > n) break;
|
|
670
|
+
o += t + r, a += 1;
|
|
671
|
+
}
|
|
672
|
+
return a;
|
|
673
|
+
}, We = class extends Error {
|
|
674
|
+
constructor(e) {
|
|
675
|
+
super(`MultiSelect.${e} must be composed inside MultiSelect.Root`), this.name = "MultiSelectCompositionError";
|
|
676
|
+
}
|
|
677
|
+
}, G = "outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]", Ge = `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 ${G}`, K = v("", {
|
|
678
|
+
variants: { part: {
|
|
679
|
+
root: [
|
|
680
|
+
"relative flex flex-col gap-[var(--space-stack)]",
|
|
681
|
+
"[&>label]:font-secondary [&>label]:font-medium [&>label]:text-body [&>label]:text-foreground",
|
|
682
|
+
"[&>p]:font-secondary [&>p]:text-small [&>p]:text-muted"
|
|
683
|
+
].join(" "),
|
|
684
|
+
field: [
|
|
685
|
+
"group/field relative flex items-center gap-1",
|
|
686
|
+
"rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent px-3 py-2",
|
|
687
|
+
"font-primary text-body text-foreground transition-colors duration-[var(--motion-duration-color)]",
|
|
688
|
+
"data-[disabled]:border-disabled data-[disabled]:text-muted"
|
|
689
|
+
].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 ${G}`,
|
|
691
|
+
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
|
+
track: "relative flex min-h-[calc(var(--text-body)*var(--leading-body))] items-center gap-1",
|
|
693
|
+
chip: [
|
|
694
|
+
"relative inline-flex max-w-[12rem] shrink-0 items-center gap-1 pointer-events-auto",
|
|
695
|
+
"rounded-[var(--radius-control)] bg-backing py-0.5 pr-0.5 pl-2 font-secondary text-small text-foreground",
|
|
696
|
+
"group-data-[disabled]/field:text-muted data-[overflow]:invisible data-[overflow]:absolute"
|
|
697
|
+
].join(" "),
|
|
698
|
+
count: Ge,
|
|
699
|
+
countMeasure: `${Ge} invisible absolute`,
|
|
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 ${G}`,
|
|
701
|
+
surface: [
|
|
702
|
+
"absolute left-0 right-0 z-10 flex flex-col gap-1 overflow-y-auto p-1",
|
|
703
|
+
"rounded-[var(--radius-control)] border border-solid border-border bg-surface shadow-[var(--elevation-floating)]",
|
|
704
|
+
"max-h-[var(--multiselect-surface-max-height,50vh)]",
|
|
705
|
+
"data-[placement=below]:top-full data-[placement=below]:mt-1 data-[placement=above]:bottom-full data-[placement=above]:mb-1"
|
|
706
|
+
].join(" ")
|
|
707
|
+
} },
|
|
708
|
+
defaultVariants: { part: "root" }
|
|
709
|
+
}), Ke = v([
|
|
710
|
+
"group/option flex w-full flex-row items-center gap-3 text-left",
|
|
711
|
+
"rounded-[var(--radius-control)] bg-transparent px-3 py-2 hover:bg-backing",
|
|
712
|
+
"cursor-pointer disabled:cursor-not-allowed",
|
|
713
|
+
"transition-colors duration-[var(--motion-duration-color)]",
|
|
714
|
+
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]"
|
|
715
|
+
].join(" ")), q = 8, qe = i(void 0), Je = (e) => {
|
|
716
|
+
let t = s(qe);
|
|
717
|
+
if (t === void 0) throw new We(e);
|
|
718
|
+
return t;
|
|
719
|
+
}, J = (e) => (t) => {
|
|
720
|
+
e.current = t ?? void 0;
|
|
721
|
+
}, Y = (e) => e.getBoundingClientRect().width, Ye = (e) => n.toArray(e).flatMap((e) => {
|
|
722
|
+
if (!a(e)) return [];
|
|
723
|
+
if (e.type === r) return Ye(e.props.children);
|
|
724
|
+
if (e.type === it) {
|
|
725
|
+
let { value: t, children: n } = e.props;
|
|
726
|
+
return [{
|
|
727
|
+
value: t,
|
|
728
|
+
label: n
|
|
729
|
+
}];
|
|
730
|
+
}
|
|
731
|
+
return [];
|
|
732
|
+
}), Xe = (e) => Array.from(e.querySelectorAll("[data-multiselect-chip]:not([data-overflow]) button")), Ze = (e) => {
|
|
733
|
+
let t = document.activeElement;
|
|
734
|
+
return !e.contains(t) || t instanceof Element && t.closest("[data-overflow]") !== null;
|
|
735
|
+
}, Qe = (e) => e.querySelector("[role=\"checkbox\"][aria-checked=\"true\"]") ?? e.querySelector("[role=\"checkbox\"]") ?? void 0, $e = (e, t) => [...new Set(e.map(({ value: e }) => e).filter((e) => t.has(e)))], et = (e) => e.kind === "firstOption" || !e.control.isConnected, tt = (e, t, n, r) => {
|
|
736
|
+
switch (e.kind) {
|
|
737
|
+
case "firstOption": return r === void 0 ? void 0 : Qe(r);
|
|
738
|
+
case "afterRemoval": {
|
|
739
|
+
let r = Xe(t);
|
|
740
|
+
return r[e.index] ?? r[e.index - 1] ?? n;
|
|
741
|
+
}
|
|
742
|
+
case "afterClear": return n;
|
|
743
|
+
}
|
|
744
|
+
}, nt = () => /* @__PURE__ */ e("svg", {
|
|
745
|
+
"aria-hidden": !0,
|
|
746
|
+
focusable: !1,
|
|
747
|
+
viewBox: "0 0 16 16",
|
|
748
|
+
className: "size-3",
|
|
749
|
+
children: /* @__PURE__ */ e("path", {
|
|
750
|
+
d: "M4 4l8 8M12 4l-8 8",
|
|
751
|
+
fill: "none",
|
|
752
|
+
stroke: "currentColor",
|
|
753
|
+
strokeWidth: 1.5,
|
|
754
|
+
strokeLinecap: "round"
|
|
755
|
+
})
|
|
756
|
+
}), rt = ({ label: n, selected$: r, onChange$: i, emptyLabel: a, removeLabel: o, clearLabel: s, overflowLabel: m, hint: h, disabled: g, testId: _, children: v }) => {
|
|
757
|
+
let y = l(), b = `${y}-label`, x = `${y}-trigger`, S = `${y}-options`, C = `${y}-hint`, w = `${y}-empty`, T = g === !0, [ee, E] = p([]), [te, D] = p(!1), [O, ne] = p(void 0), [re, ie] = p("below"), [, ae] = d((e) => e + 1, 0), k = f(void 0), A = f(void 0), j = f(void 0), M = f(void 0), N = f(void 0), P = f(void 0), F = f(!1), I = te && !T, L = Ye(v), R = new Set(ee), z = L.filter((e) => R.has(e.value)), B = O === void 0 ? z.length : Math.min(O, z.length), V = z.length - B;
|
|
758
|
+
u(() => {
|
|
759
|
+
E([]);
|
|
760
|
+
let e = r.subscribe((e) => E(e));
|
|
761
|
+
return () => e.unsubscribe();
|
|
762
|
+
}, [r]), c(() => {
|
|
763
|
+
T && D(!1);
|
|
764
|
+
}, [T]), u(() => {
|
|
765
|
+
let e = M.current;
|
|
766
|
+
if (e === void 0 || typeof ResizeObserver > "u") return;
|
|
767
|
+
let t = new ResizeObserver(() => ae());
|
|
768
|
+
return t.observe(e), () => t.disconnect();
|
|
769
|
+
}, []), u(() => {
|
|
770
|
+
let e = M.current;
|
|
771
|
+
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 = Ue(t.map(Y), n === null ? 0 : Y(n), Y(e), r);
|
|
773
|
+
ne((e) => e === i ? e : i);
|
|
774
|
+
}), u(() => {
|
|
775
|
+
let e = A.current, t = N.current;
|
|
776
|
+
if (!I || e === void 0 || t === void 0) return;
|
|
777
|
+
let n = e.getBoundingClientRect(), r = window.innerHeight - n.bottom - q, i = n.top - q, a = t.scrollHeight > r && i > r;
|
|
778
|
+
t.style.setProperty("--multiselect-surface-max-height", `${Math.max(a ? i : r, 0)}px`), ie(a ? "above" : "below");
|
|
779
|
+
}), c(() => {
|
|
780
|
+
if (!I) return;
|
|
781
|
+
let e = (e) => {
|
|
782
|
+
let t = k.current;
|
|
783
|
+
t !== void 0 && e.target instanceof Node && !t.contains(e.target) && (F.current = !1, P.current = void 0, D(!1));
|
|
784
|
+
};
|
|
785
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
786
|
+
}, [I]), u(() => {
|
|
787
|
+
let e = k.current, t = j.current;
|
|
788
|
+
if (e === void 0 || t === void 0) return;
|
|
789
|
+
let n = P.current;
|
|
790
|
+
n !== void 0 && et(n) ? (P.current = void 0, tt(n, e, t, I ? N.current : void 0)?.focus()) : n === void 0 && F.current && Ze(e) && t.focus(), F.current = e.contains(document.activeElement);
|
|
791
|
+
});
|
|
792
|
+
let H = (e) => {
|
|
793
|
+
i.next($e(L, e));
|
|
794
|
+
}, oe = (e) => {
|
|
795
|
+
if (T) return;
|
|
796
|
+
let t = new Set(R);
|
|
797
|
+
t.delete(e) || t.add(e), H(t);
|
|
798
|
+
}, se = (e, t) => (n) => {
|
|
799
|
+
if (T) return;
|
|
800
|
+
document.activeElement === n.currentTarget && (P.current = {
|
|
801
|
+
kind: "afterRemoval",
|
|
802
|
+
index: t,
|
|
803
|
+
control: n.currentTarget
|
|
804
|
+
});
|
|
805
|
+
let r = new Set(R);
|
|
806
|
+
r.delete(e), H(r);
|
|
807
|
+
}, ce = (e) => {
|
|
808
|
+
T || (document.activeElement === e.currentTarget && (P.current = {
|
|
809
|
+
kind: "afterClear",
|
|
810
|
+
control: e.currentTarget
|
|
811
|
+
}), i.next([]));
|
|
812
|
+
}, U = (e) => {
|
|
813
|
+
T || (e.detail === 0 && (P.current = { kind: "firstOption" }), D(!0));
|
|
814
|
+
}, le = (e) => {
|
|
815
|
+
I ? D(!1) : U(e);
|
|
816
|
+
}, ue = (e) => {
|
|
817
|
+
if (e.key !== "ArrowDown" || T) return;
|
|
818
|
+
e.preventDefault();
|
|
819
|
+
let t = N.current;
|
|
820
|
+
I && t !== void 0 ? Qe(t)?.focus() : (P.current = { kind: "firstOption" }, D(!0));
|
|
821
|
+
}, W = (e) => {
|
|
822
|
+
e.key !== "Escape" || !I || (e.preventDefault(), e.stopPropagation(), D(!1), j.current?.focus());
|
|
823
|
+
}, de = (e) => {
|
|
824
|
+
F.current = !0;
|
|
825
|
+
let t = P.current;
|
|
826
|
+
t !== void 0 && t.kind !== "firstOption" && e.target !== t.control && (P.current = void 0);
|
|
827
|
+
}, fe = (e) => {
|
|
828
|
+
let t = k.current, n = e.relatedTarget;
|
|
829
|
+
t !== void 0 && n instanceof Node && t.contains(n) || e.target.isConnected && (F.current = !1, P.current = void 0, D(!1));
|
|
830
|
+
}, pe = (e) => {
|
|
831
|
+
(!(e.target instanceof Element) || e.target.closest("button") === null) && e.preventDefault();
|
|
832
|
+
}, me = [z.length === 0 ? w : void 0, h ? C : void 0].filter(Boolean).join(" ") || void 0;
|
|
833
|
+
return /* @__PURE__ */ t("div", {
|
|
834
|
+
ref: J(k),
|
|
835
|
+
className: K(),
|
|
836
|
+
onKeyDown: W,
|
|
837
|
+
onFocus: de,
|
|
838
|
+
onBlur: fe,
|
|
839
|
+
children: [
|
|
840
|
+
/* @__PURE__ */ e("label", {
|
|
841
|
+
id: b,
|
|
842
|
+
htmlFor: x,
|
|
843
|
+
children: n
|
|
844
|
+
}),
|
|
845
|
+
/* @__PURE__ */ t("div", {
|
|
846
|
+
ref: J(A),
|
|
847
|
+
"data-multiselect-field": !0,
|
|
848
|
+
"data-disabled": T || void 0,
|
|
849
|
+
className: K({ part: "field" }),
|
|
850
|
+
children: [
|
|
851
|
+
/* @__PURE__ */ e("button", {
|
|
852
|
+
ref: J(j),
|
|
853
|
+
id: x,
|
|
854
|
+
type: "button",
|
|
855
|
+
"aria-labelledby": b,
|
|
856
|
+
"aria-expanded": I,
|
|
857
|
+
"aria-controls": I ? S : void 0,
|
|
858
|
+
"aria-describedby": me,
|
|
859
|
+
disabled: T,
|
|
860
|
+
"data-testid": _,
|
|
861
|
+
className: K({ part: "trigger" }),
|
|
862
|
+
onClick: le,
|
|
863
|
+
onKeyDown: ue,
|
|
864
|
+
children: /* @__PURE__ */ e("svg", {
|
|
865
|
+
"aria-hidden": !0,
|
|
866
|
+
focusable: !1,
|
|
867
|
+
viewBox: "0 0 16 16",
|
|
868
|
+
className: "size-4",
|
|
869
|
+
children: /* @__PURE__ */ e("path", {
|
|
870
|
+
d: "M3 6l5 5 5-5",
|
|
871
|
+
fill: "none",
|
|
872
|
+
stroke: "currentColor",
|
|
873
|
+
strokeWidth: 1.5,
|
|
874
|
+
strokeLinecap: "round",
|
|
875
|
+
strokeLinejoin: "round"
|
|
876
|
+
})
|
|
877
|
+
})
|
|
878
|
+
}),
|
|
879
|
+
/* @__PURE__ */ e("div", {
|
|
880
|
+
className: K({ part: "clip" }),
|
|
881
|
+
children: /* @__PURE__ */ t("div", {
|
|
882
|
+
ref: J(M),
|
|
883
|
+
"data-multiselect-track": !0,
|
|
884
|
+
className: K({ part: "track" }),
|
|
885
|
+
children: [
|
|
886
|
+
z.length === 0 && /* @__PURE__ */ e("span", {
|
|
887
|
+
id: w,
|
|
888
|
+
className: "truncate text-muted",
|
|
889
|
+
children: a
|
|
890
|
+
}),
|
|
891
|
+
z.map(({ value: n, label: r }, i) => {
|
|
892
|
+
let a = i >= B;
|
|
893
|
+
return /* @__PURE__ */ t("span", {
|
|
894
|
+
"data-multiselect-chip": !0,
|
|
895
|
+
"data-overflow": a || void 0,
|
|
896
|
+
"aria-hidden": a || void 0,
|
|
897
|
+
inert: a || void 0,
|
|
898
|
+
className: K({ part: "chip" }),
|
|
899
|
+
children: [/* @__PURE__ */ e("span", {
|
|
900
|
+
className: "truncate",
|
|
901
|
+
children: r
|
|
902
|
+
}), /* @__PURE__ */ e("button", {
|
|
903
|
+
type: "button",
|
|
904
|
+
"aria-label": o.replaceAll("{label}", r),
|
|
905
|
+
disabled: T,
|
|
906
|
+
tabIndex: a ? -1 : void 0,
|
|
907
|
+
className: K({ part: "iconButton" }),
|
|
908
|
+
onClick: se(n, i),
|
|
909
|
+
children: /* @__PURE__ */ e(nt, {})
|
|
910
|
+
})]
|
|
911
|
+
}, n);
|
|
912
|
+
}),
|
|
913
|
+
V > 0 && /* @__PURE__ */ e("button", {
|
|
914
|
+
type: "button",
|
|
915
|
+
disabled: T,
|
|
916
|
+
className: K({ part: "count" }),
|
|
917
|
+
onClick: U,
|
|
918
|
+
children: m.replaceAll("{count}", String(V))
|
|
919
|
+
}),
|
|
920
|
+
z.length > 0 && /* @__PURE__ */ e("span", {
|
|
921
|
+
"aria-hidden": !0,
|
|
922
|
+
"data-multiselect-count": !0,
|
|
923
|
+
className: K({ part: "countMeasure" }),
|
|
924
|
+
children: m.replaceAll("{count}", String(z.length))
|
|
925
|
+
})
|
|
926
|
+
]
|
|
927
|
+
})
|
|
928
|
+
}),
|
|
929
|
+
z.length > 0 ? /* @__PURE__ */ e("button", {
|
|
930
|
+
type: "button",
|
|
931
|
+
"aria-label": s,
|
|
932
|
+
disabled: T,
|
|
933
|
+
className: K({ part: "iconButton" }),
|
|
934
|
+
onClick: ce,
|
|
935
|
+
children: /* @__PURE__ */ e(nt, {})
|
|
936
|
+
}) : /* @__PURE__ */ e("span", {
|
|
937
|
+
"aria-hidden": !0,
|
|
938
|
+
className: "size-6 shrink-0"
|
|
939
|
+
}),
|
|
940
|
+
/* @__PURE__ */ e("span", {
|
|
941
|
+
"aria-hidden": !0,
|
|
942
|
+
className: "size-6 shrink-0"
|
|
943
|
+
}),
|
|
944
|
+
I && /* @__PURE__ */ e("div", {
|
|
945
|
+
ref: J(N),
|
|
946
|
+
id: S,
|
|
947
|
+
role: "group",
|
|
948
|
+
"aria-labelledby": b,
|
|
949
|
+
"data-placement": re,
|
|
950
|
+
className: K({ part: "surface" }),
|
|
951
|
+
onMouseDown: pe,
|
|
952
|
+
children: /* @__PURE__ */ e(qe, {
|
|
953
|
+
value: {
|
|
954
|
+
selected: R,
|
|
955
|
+
disabled: T,
|
|
956
|
+
toggle: oe
|
|
957
|
+
},
|
|
958
|
+
children: v
|
|
959
|
+
})
|
|
960
|
+
})
|
|
961
|
+
]
|
|
962
|
+
}),
|
|
963
|
+
h && /* @__PURE__ */ e("p", {
|
|
964
|
+
id: C,
|
|
965
|
+
children: h
|
|
966
|
+
})
|
|
967
|
+
]
|
|
968
|
+
});
|
|
969
|
+
}, it = ({ value: n, children: r, testId: i }) => {
|
|
970
|
+
let { selected: a, disabled: o, toggle: s } = Je("Option"), c = a.has(n);
|
|
971
|
+
return /* @__PURE__ */ t("button", {
|
|
972
|
+
type: "button",
|
|
973
|
+
role: "checkbox",
|
|
974
|
+
"aria-checked": c,
|
|
975
|
+
disabled: o,
|
|
976
|
+
"data-testid": i,
|
|
977
|
+
className: Ke(),
|
|
978
|
+
onClick: () => s(n),
|
|
979
|
+
children: [/* @__PURE__ */ e("span", {
|
|
980
|
+
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__ */ e("svg", {
|
|
982
|
+
"aria-hidden": !0,
|
|
983
|
+
focusable: !1,
|
|
984
|
+
viewBox: "0 0 16 16",
|
|
985
|
+
className: "size-3 text-foreground",
|
|
986
|
+
children: /* @__PURE__ */ e("path", {
|
|
987
|
+
d: "M3 8.5l3 3 7-7",
|
|
988
|
+
fill: "none",
|
|
989
|
+
stroke: "currentColor",
|
|
990
|
+
strokeWidth: 2,
|
|
991
|
+
strokeLinecap: "round",
|
|
992
|
+
strokeLinejoin: "round"
|
|
993
|
+
})
|
|
994
|
+
})
|
|
995
|
+
}), /* @__PURE__ */ e("span", {
|
|
996
|
+
className: "min-w-0 flex-1 font-secondary text-body text-foreground [overflow-wrap:anywhere]",
|
|
997
|
+
children: r
|
|
998
|
+
})]
|
|
999
|
+
});
|
|
1000
|
+
}, at = {
|
|
1001
|
+
Root: rt,
|
|
1002
|
+
Option: it
|
|
1003
|
+
}, ot = v("block w-full rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent px-3 py-2 font-primary 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"), st = ({ label: n, name: r, required: i, optionalLabel: a, hint: o, invalid: s, errorMessage: u, disabled: d, placeholder: p, defaultValue: m, onInput$: h, reset$: g, testId: _ }) => {
|
|
1004
|
+
let v = l(), y = `${v}-control`, b = `${v}-hint`, x = `${v}-error`, S = [o ? b : void 0, s ? x : void 0].filter(Boolean).join(" ") || void 0, C = f(null);
|
|
1005
|
+
return c(() => {
|
|
1006
|
+
let e = g?.subscribe(() => {
|
|
1007
|
+
C.current && (C.current.value = "");
|
|
1008
|
+
});
|
|
1009
|
+
return () => e?.unsubscribe();
|
|
1010
|
+
}, [g]), /* @__PURE__ */ t("div", {
|
|
1011
|
+
className: "flex flex-col gap-[var(--space-stack)]",
|
|
1012
|
+
children: [
|
|
1013
|
+
/* @__PURE__ */ e("label", {
|
|
1014
|
+
htmlFor: y,
|
|
1015
|
+
className: "font-secondary font-medium text-body text-foreground",
|
|
1016
|
+
children: n
|
|
1017
|
+
}),
|
|
1018
|
+
/* @__PURE__ */ e("input", {
|
|
1019
|
+
ref: C,
|
|
1020
|
+
id: y,
|
|
1021
|
+
name: r,
|
|
1022
|
+
type: "text",
|
|
1023
|
+
inputMode: "decimal",
|
|
1024
|
+
className: ot(),
|
|
1025
|
+
required: i,
|
|
1026
|
+
disabled: d,
|
|
1027
|
+
defaultValue: m,
|
|
1028
|
+
placeholder: p,
|
|
1029
|
+
"aria-invalid": s || void 0,
|
|
1030
|
+
"aria-describedby": S,
|
|
1031
|
+
"data-testid": _,
|
|
1032
|
+
onInput: (e) => !d && h?.next(e.currentTarget.value)
|
|
1033
|
+
}),
|
|
1034
|
+
!i && a && /* @__PURE__ */ e("span", {
|
|
1035
|
+
className: "font-secondary text-muted text-small",
|
|
1036
|
+
children: a
|
|
1037
|
+
}),
|
|
1038
|
+
o && /* @__PURE__ */ e("p", {
|
|
1039
|
+
id: b,
|
|
1040
|
+
className: "font-secondary text-muted text-small",
|
|
1041
|
+
children: o
|
|
1042
|
+
}),
|
|
1043
|
+
s && /* @__PURE__ */ e("p", {
|
|
1044
|
+
id: x,
|
|
1045
|
+
className: "font-secondary text-error text-small",
|
|
1046
|
+
children: u
|
|
1047
|
+
})
|
|
1048
|
+
]
|
|
1049
|
+
});
|
|
1050
|
+
}, ct = v([
|
|
665
1051
|
"flex flex-col gap-[var(--space-stack)]",
|
|
666
1052
|
"[&>label]:font-secondary [&>label]:font-medium [&>label]:text-body [&>label]:text-foreground",
|
|
667
1053
|
"[&>span]:font-secondary [&>span]:text-muted [&>span]:text-small",
|
|
@@ -670,11 +1056,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
670
1056
|
"[&>select]:font-primary [&>select]:text-body [&>select]:text-foreground [&>select]:transition-colors [&>select]:duration-[var(--motion-duration-color)]",
|
|
671
1057
|
"[&>select]:outline-focus-ring [&>select]:outline-offset-[var(--focus-ring-offset)] [&>select]:focus-visible:outline [&>select]:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
672
1058
|
"[&>select:user-invalid]:border-error [&>select]:aria-[invalid=true]:border-error [&>select]:disabled:cursor-not-allowed [&>select]:disabled:border-disabled [&>select]:disabled:text-muted"
|
|
673
|
-
].join(" ")),
|
|
674
|
-
Root: ({ label: n, name: r, required: i, optionalLabel: a, disabled: o, invalid: s, hint:
|
|
675
|
-
let g =
|
|
1059
|
+
].join(" ")), lt = {
|
|
1060
|
+
Root: ({ label: n, name: r, required: i, optionalLabel: a, disabled: o, invalid: s, hint: c, errorMessage: u, testId: d, defaultValue: f, onChange$: p, placeholder: m, children: h }) => {
|
|
1061
|
+
let g = l(), _ = `${g}-control`, v = `${g}-hint`, y = `${g}-error`, b = [c ? v : void 0, s && u ? y : void 0].filter(Boolean).join(" ") || void 0;
|
|
676
1062
|
return /* @__PURE__ */ t("div", {
|
|
677
|
-
className:
|
|
1063
|
+
className: ct(),
|
|
678
1064
|
children: [
|
|
679
1065
|
/* @__PURE__ */ e("label", {
|
|
680
1066
|
htmlFor: _,
|
|
@@ -696,9 +1082,9 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
696
1082
|
}), h]
|
|
697
1083
|
}),
|
|
698
1084
|
!i && a && /* @__PURE__ */ e("span", { children: a }),
|
|
699
|
-
|
|
1085
|
+
c && /* @__PURE__ */ e("p", {
|
|
700
1086
|
id: v,
|
|
701
|
-
children:
|
|
1087
|
+
children: c
|
|
702
1088
|
}),
|
|
703
1089
|
s && u && /* @__PURE__ */ e("p", {
|
|
704
1090
|
id: y,
|
|
@@ -713,11 +1099,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
713
1099
|
"data-testid": r,
|
|
714
1100
|
children: n
|
|
715
1101
|
})
|
|
716
|
-
},
|
|
1102
|
+
}, X = class extends Error {
|
|
717
1103
|
constructor(e) {
|
|
718
1104
|
super(`Slider configuration: ${e}`), this.name = "SliderConfigurationError";
|
|
719
1105
|
}
|
|
720
|
-
},
|
|
1106
|
+
}, ut = v([
|
|
721
1107
|
"block h-[var(--slider-thumb-size)] w-full cursor-pointer appearance-none bg-transparent",
|
|
722
1108
|
"disabled:cursor-not-allowed",
|
|
723
1109
|
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
@@ -728,19 +1114,19 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
728
1114
|
"[&::-moz-range-track]:h-[var(--slider-track-thickness)] [&::-moz-range-track]:rounded-[var(--radius-control)] [&::-moz-range-track]:bg-control-border",
|
|
729
1115
|
"[&::-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",
|
|
730
1116
|
"[&:disabled::-moz-range-track]:bg-disabled [&:disabled::-moz-range-thumb]:bg-disabled"
|
|
731
|
-
].join(" ")),
|
|
732
|
-
for (let [t, n] of Object.entries(e)) if (!Number.isFinite(n)) throw new
|
|
733
|
-
if (e.min >= e.max) throw new
|
|
734
|
-
if (e.step <= 0) throw new
|
|
735
|
-
if (e.value < e.min || e.value > e.max) throw new
|
|
736
|
-
},
|
|
1117
|
+
].join(" ")), dt = (e) => {
|
|
1118
|
+
for (let [t, n] of Object.entries(e)) if (!Number.isFinite(n)) throw new X(`\`${t}\` must be a finite number, got ${n}`);
|
|
1119
|
+
if (e.min >= e.max) throw new X(`\`min\` (${e.min}) must be below \`max\` (${e.max})`);
|
|
1120
|
+
if (e.step <= 0) throw new X(`\`step\` (${e.step}) must be positive`);
|
|
1121
|
+
if (e.value < e.min || e.value > e.max) throw new X(`\`value\` (${e.value}) must lie within [${e.min}, ${e.max}]`);
|
|
1122
|
+
}, ft = ({ min: t, max: n, step: r = 1, value: i, onInput$: a, label: o, valueText: s, disabled: c, testId: l }) => (dt({
|
|
737
1123
|
min: t,
|
|
738
1124
|
max: n,
|
|
739
1125
|
step: r,
|
|
740
1126
|
value: i
|
|
741
1127
|
}), /* @__PURE__ */ e("input", {
|
|
742
1128
|
type: "range",
|
|
743
|
-
className:
|
|
1129
|
+
className: ut(),
|
|
744
1130
|
min: t,
|
|
745
1131
|
max: n,
|
|
746
1132
|
step: r,
|
|
@@ -750,40 +1136,40 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
750
1136
|
"aria-valuetext": s,
|
|
751
1137
|
"data-testid": l,
|
|
752
1138
|
onChange: (e) => a.next(e.currentTarget.valueAsNumber)
|
|
753
|
-
})),
|
|
1139
|
+
})), pt = class extends Error {
|
|
754
1140
|
constructor(e) {
|
|
755
1141
|
super(`Tabs.${e} must be composed inside Tabs.Root`), this.name = "TabsCompositionError";
|
|
756
1142
|
}
|
|
757
|
-
},
|
|
1143
|
+
}, mt = v([
|
|
758
1144
|
"flex flex-row overflow-x-auto",
|
|
759
1145
|
"p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))]",
|
|
760
1146
|
"m-[calc(-1*(var(--focus-ring-width)+var(--focus-ring-offset)))]",
|
|
761
1147
|
"scroll-p-[calc(var(--focus-ring-width)+var(--focus-ring-offset))]"
|
|
762
|
-
].join(" ")),
|
|
1148
|
+
].join(" ")), ht = v([
|
|
763
1149
|
"font-secondary text-label tracking-label",
|
|
764
1150
|
"text-muted hover:text-foreground aria-selected:text-foreground",
|
|
765
1151
|
"border-b-[length:var(--tab-marker-thickness)] border-solid border-transparent aria-selected:border-foreground",
|
|
766
1152
|
"shrink-0 cursor-pointer select-none text-nowrap px-[var(--tab-inset-inline)] py-[var(--tab-inset-block)]",
|
|
767
1153
|
"transition-colors duration-[var(--motion-duration-color)]",
|
|
768
1154
|
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]"
|
|
769
|
-
].join(" ")),
|
|
770
|
-
let t =
|
|
771
|
-
if (t === void 0) throw new
|
|
1155
|
+
].join(" ")), gt = v("outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]"), _t = i(void 0), Z = (e) => {
|
|
1156
|
+
let t = s(_t);
|
|
1157
|
+
if (t === void 0) throw new pt(e);
|
|
772
1158
|
return t;
|
|
773
|
-
},
|
|
1159
|
+
}, vt = (e) => e.split("").map((e) => e.charCodeAt(0).toString(16).padStart(4, "0")).join(""), yt = (e) => {
|
|
774
1160
|
e.currentTarget.scrollIntoView({
|
|
775
1161
|
block: "nearest",
|
|
776
1162
|
inline: "nearest"
|
|
777
1163
|
});
|
|
778
|
-
},
|
|
1164
|
+
}, bt = (e, t) => `${e}tab-${vt(t)}`, xt = (e, t) => `${e}panel-${vt(t)}`, St = (e, t) => {
|
|
779
1165
|
let n = e.closest("[role=\"tablist\"]");
|
|
780
1166
|
if (n === null) return;
|
|
781
1167
|
let r = Array.from(n.querySelectorAll(":scope > [role=\"tab\"]"));
|
|
782
1168
|
return r[(r.indexOf(e) + t + r.length) % r.length];
|
|
783
|
-
},
|
|
1169
|
+
}, Ct = {
|
|
784
1170
|
Root: ({ active: t, onSelect$: n, label: r, children: i, testId: a }) => {
|
|
785
|
-
let o =
|
|
786
|
-
return /* @__PURE__ */ e(
|
|
1171
|
+
let o = l();
|
|
1172
|
+
return /* @__PURE__ */ e(_t.Provider, {
|
|
787
1173
|
value: {
|
|
788
1174
|
active: t,
|
|
789
1175
|
onSelect$: n,
|
|
@@ -797,57 +1183,57 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
797
1183
|
});
|
|
798
1184
|
},
|
|
799
1185
|
List: ({ children: t, testId: n }) => {
|
|
800
|
-
let { label: r } =
|
|
1186
|
+
let { label: r } = Z("List");
|
|
801
1187
|
return /* @__PURE__ */ e("div", {
|
|
802
1188
|
role: "tablist",
|
|
803
1189
|
"aria-label": r,
|
|
804
|
-
className:
|
|
1190
|
+
className: mt(),
|
|
805
1191
|
"data-testid": n,
|
|
806
1192
|
children: t
|
|
807
1193
|
});
|
|
808
1194
|
},
|
|
809
1195
|
Tab: ({ value: t, children: n, testId: r }) => {
|
|
810
|
-
let { active: i, onSelect$: a, baseId: o } =
|
|
1196
|
+
let { active: i, onSelect$: a, baseId: o } = Z("Tab"), s = i === t;
|
|
811
1197
|
return /* @__PURE__ */ e("button", {
|
|
812
1198
|
type: "button",
|
|
813
1199
|
role: "tab",
|
|
814
|
-
id:
|
|
1200
|
+
id: bt(o, t),
|
|
815
1201
|
"aria-selected": s,
|
|
816
|
-
"aria-controls":
|
|
1202
|
+
"aria-controls": xt(o, t),
|
|
817
1203
|
tabIndex: s ? 0 : -1,
|
|
818
1204
|
"data-value": t,
|
|
819
1205
|
"data-testid": r,
|
|
820
|
-
className:
|
|
1206
|
+
className: ht(),
|
|
821
1207
|
onClick: () => a.next(t),
|
|
822
1208
|
onKeyDown: (e) => {
|
|
823
1209
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
824
1210
|
e.preventDefault();
|
|
825
|
-
let t =
|
|
1211
|
+
let t = St(e.currentTarget, e.key === "ArrowRight" ? 1 : -1);
|
|
826
1212
|
if (t === void 0) return;
|
|
827
1213
|
t.focus();
|
|
828
1214
|
let n = t.dataset.value;
|
|
829
1215
|
n !== void 0 && a.next(n);
|
|
830
1216
|
},
|
|
831
|
-
onFocus:
|
|
1217
|
+
onFocus: yt,
|
|
832
1218
|
children: n
|
|
833
1219
|
});
|
|
834
1220
|
},
|
|
835
1221
|
Panel: ({ value: t, children: n, testId: r }) => {
|
|
836
|
-
let { active: i, baseId: a } =
|
|
1222
|
+
let { active: i, baseId: a } = Z("Panel"), o = i === t;
|
|
837
1223
|
return /* @__PURE__ */ e("div", {
|
|
838
1224
|
role: "tabpanel",
|
|
839
|
-
id:
|
|
840
|
-
"aria-labelledby":
|
|
1225
|
+
id: xt(a, t),
|
|
1226
|
+
"aria-labelledby": bt(a, t),
|
|
841
1227
|
hidden: !o,
|
|
842
1228
|
tabIndex: o ? 0 : void 0,
|
|
843
|
-
className:
|
|
1229
|
+
className: gt(),
|
|
844
1230
|
"data-testid": r,
|
|
845
1231
|
children: o ? n : void 0
|
|
846
1232
|
});
|
|
847
1233
|
}
|
|
848
|
-
},
|
|
849
|
-
let y =
|
|
850
|
-
return
|
|
1234
|
+
}, wt = v("block min-h-24 w-full rounded-[var(--radius-control)] border border-solid border-control-border bg-transparent px-3 py-2 font-primary 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"), Tt = ({ label: n, name: r, required: i, optionalLabel: a, invalid: o, disabled: s, defaultValue: u, placeholder: d, autocomplete: p, hint: m, errorMessage: h, onInput$: g, reset$: _, testId: v }) => {
|
|
1235
|
+
let y = l(), b = `${y}-control`, x = `${y}-hint`, S = `${y}-error`, C = [m ? x : void 0, o ? S : void 0].filter(Boolean).join(" ") || void 0, w = f(null);
|
|
1236
|
+
return c(() => {
|
|
851
1237
|
let e = _?.subscribe(() => {
|
|
852
1238
|
w.current && (w.current.value = "");
|
|
853
1239
|
});
|
|
@@ -864,11 +1250,11 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
864
1250
|
ref: w,
|
|
865
1251
|
id: b,
|
|
866
1252
|
name: r,
|
|
867
|
-
className:
|
|
1253
|
+
className: wt(),
|
|
868
1254
|
required: i,
|
|
869
|
-
disabled:
|
|
870
|
-
defaultValue:
|
|
871
|
-
placeholder:
|
|
1255
|
+
disabled: s,
|
|
1256
|
+
defaultValue: u,
|
|
1257
|
+
placeholder: d,
|
|
872
1258
|
autoComplete: p,
|
|
873
1259
|
"aria-invalid": o || void 0,
|
|
874
1260
|
"aria-describedby": C,
|
|
@@ -891,29 +1277,29 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
891
1277
|
})
|
|
892
1278
|
]
|
|
893
1279
|
});
|
|
894
|
-
},
|
|
1280
|
+
}, Et = v([
|
|
895
1281
|
"flex flex-col items-center",
|
|
896
1282
|
"min-h-[var(--cover-height)]",
|
|
897
1283
|
"px-[var(--gutter)] py-[var(--space-region)]"
|
|
898
|
-
].join(" ")),
|
|
1284
|
+
].join(" ")), Dt = "my-auto max-w-full", Ot = ({ children: n, foot: r, testId: i }) => {
|
|
899
1285
|
let a = r != null && typeof r != "boolean";
|
|
900
1286
|
return /* @__PURE__ */ t("div", {
|
|
901
|
-
className:
|
|
1287
|
+
className: Et(),
|
|
902
1288
|
"data-testid": i,
|
|
903
1289
|
children: [/* @__PURE__ */ e("div", {
|
|
904
|
-
className:
|
|
1290
|
+
className: Dt,
|
|
905
1291
|
children: n
|
|
906
1292
|
}), a && /* @__PURE__ */ e("div", { children: r })]
|
|
907
1293
|
});
|
|
908
|
-
},
|
|
1294
|
+
}, kt = class extends Error {
|
|
909
1295
|
constructor(e) {
|
|
910
1296
|
super(`Dialog.${e} must be composed inside Dialog.Root`), this.name = "DialogCompositionError";
|
|
911
1297
|
}
|
|
912
|
-
},
|
|
1298
|
+
}, At = class extends Error {
|
|
913
1299
|
constructor() {
|
|
914
1300
|
super("A Dialog takes exactly one accessible naming source: a visible Dialog.Title or ariaLabel on Dialog.Root, never both"), this.name = "DialogNamingError";
|
|
915
1301
|
}
|
|
916
|
-
},
|
|
1302
|
+
}, jt = v([
|
|
917
1303
|
"open:flex open:flex-col m-auto p-0 overflow-hidden",
|
|
918
1304
|
"bg-surface text-foreground",
|
|
919
1305
|
"rounded-[var(--radius-dialog)] shadow-[var(--elevation-floating)]",
|
|
@@ -924,89 +1310,89 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
924
1310
|
content: ["w-[32rem] max-w-[calc(100vw-2*var(--gutter))]", "max-h-[calc(100dvh-2*var(--space-region))]"].join(" ")
|
|
925
1311
|
} },
|
|
926
1312
|
defaultVariants: { extent: "screen" }
|
|
927
|
-
}),
|
|
1313
|
+
}), Mt = v(["px-[var(--space-region)] pt-[var(--space-region)] pb-[var(--space-region)]", "[&:has(+[data-dialog-member=description])]:pb-0"].join(" ")), Nt = v(["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(" ")), Pt = v([
|
|
928
1314
|
"grow shrink min-h-0 overflow-y-auto",
|
|
929
1315
|
"px-[var(--space-region)] py-[var(--space-region)]",
|
|
930
1316
|
"[&:not(:first-child)]:border-t [&:not(:first-child)]:border-border"
|
|
931
|
-
].join(" ")),
|
|
1317
|
+
].join(" ")), Ft = v([
|
|
932
1318
|
"flex flex-row flex-wrap items-center justify-end gap-[var(--space-stack)] shrink-0",
|
|
933
1319
|
"px-[var(--space-region)] pt-[var(--space-region)] pb-[var(--space-region)]",
|
|
934
1320
|
"[[data-dialog-member=content]+&]:border-t [[data-dialog-member=content]+&]:border-border"
|
|
935
|
-
].join(" ")),
|
|
936
|
-
let t =
|
|
937
|
-
if (t === void 0) throw new
|
|
1321
|
+
].join(" ")), It = i(void 0), Q = (e) => {
|
|
1322
|
+
let t = s(It);
|
|
1323
|
+
if (t === void 0) throw new kt(e);
|
|
938
1324
|
return t;
|
|
939
|
-
},
|
|
1325
|
+
}, Lt = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Rt = (e, { presented: t, opener: n }) => {
|
|
940
1326
|
if (e === void 0 || e.open) return;
|
|
941
1327
|
let r = document.activeElement;
|
|
942
|
-
n.current = r instanceof HTMLElement && r !== document.body ? r : void 0, e.showModal(), t.current = !0, e.querySelector(
|
|
943
|
-
},
|
|
1328
|
+
n.current = r instanceof HTMLElement && r !== document.body ? r : void 0, e.showModal(), t.current = !0, e.querySelector(Lt)?.focus();
|
|
1329
|
+
}, $ = (e, { presented: t }) => {
|
|
944
1330
|
t.current = !1, e?.open && e.close();
|
|
945
|
-
},
|
|
946
|
-
Root: ({ children: t, onDismiss$: n, showDialog$: r, extent: i, ariaLabel:
|
|
947
|
-
let
|
|
1331
|
+
}, zt = {
|
|
1332
|
+
Root: ({ children: t, onDismiss$: n, showDialog$: r, extent: i, ariaLabel: a, testId: s }) => {
|
|
1333
|
+
let u = l(), d = f(void 0), m = f(!1), h = f(void 0), [g] = p(() => ({
|
|
948
1334
|
presented: m,
|
|
949
1335
|
opener: h
|
|
950
|
-
})), [_, v] =
|
|
1336
|
+
})), [_, v] = p({
|
|
951
1337
|
title: !1,
|
|
952
1338
|
description: !1
|
|
953
|
-
}), y =
|
|
1339
|
+
}), y = o((e) => (v((t) => ({
|
|
954
1340
|
...t,
|
|
955
1341
|
[e]: !0
|
|
956
1342
|
})), () => v((t) => ({
|
|
957
1343
|
...t,
|
|
958
1344
|
[e]: !1
|
|
959
1345
|
}))), []), b = {
|
|
960
|
-
titleId: `${
|
|
961
|
-
descriptionId: `${
|
|
962
|
-
isLabelled:
|
|
1346
|
+
titleId: `${u}title`,
|
|
1347
|
+
descriptionId: `${u}description`,
|
|
1348
|
+
isLabelled: a !== void 0,
|
|
963
1349
|
registerNamePart: y
|
|
964
1350
|
}, x = () => {
|
|
965
|
-
n.next(), r === void 0 ?
|
|
1351
|
+
n.next(), r === void 0 ? $(d.current, g) : r.next(!1);
|
|
966
1352
|
};
|
|
967
|
-
return
|
|
968
|
-
if (r === void 0) return
|
|
1353
|
+
return c(() => {
|
|
1354
|
+
if (r === void 0) return Rt(d.current, g), () => $(d.current, g);
|
|
969
1355
|
let e = r.subscribe((e) => {
|
|
970
|
-
e ?
|
|
1356
|
+
e ? Rt(d.current, g) : $(d.current, g);
|
|
971
1357
|
});
|
|
972
1358
|
return () => {
|
|
973
|
-
e.unsubscribe(),
|
|
1359
|
+
e.unsubscribe(), $(d.current, g);
|
|
974
1360
|
};
|
|
975
|
-
}, [r, g]), /* @__PURE__ */ e(
|
|
1361
|
+
}, [r, g]), /* @__PURE__ */ e(It.Provider, {
|
|
976
1362
|
value: b,
|
|
977
1363
|
children: /* @__PURE__ */ e("dialog", {
|
|
978
1364
|
ref: (e) => {
|
|
979
|
-
|
|
1365
|
+
d.current = e ?? void 0, e?.setAttribute("headingreset", "");
|
|
980
1366
|
},
|
|
981
|
-
className:
|
|
982
|
-
"aria-label":
|
|
983
|
-
"aria-labelledby":
|
|
1367
|
+
className: jt({ extent: i }),
|
|
1368
|
+
"aria-label": a,
|
|
1369
|
+
"aria-labelledby": a === void 0 && _.title ? b.titleId : void 0,
|
|
984
1370
|
"aria-describedby": _.description ? b.descriptionId : void 0,
|
|
985
1371
|
onCancel: x,
|
|
986
1372
|
onClick: (e) => {
|
|
987
|
-
let t =
|
|
1373
|
+
let t = d.current;
|
|
988
1374
|
if (t === void 0 || e.target !== t || !t.open) return;
|
|
989
1375
|
let n = t.getBoundingClientRect();
|
|
990
1376
|
e.clientX >= n.left && e.clientX <= n.right && e.clientY >= n.top && e.clientY <= n.bottom || x();
|
|
991
1377
|
},
|
|
992
1378
|
onClose: () => {
|
|
993
|
-
if (
|
|
1379
|
+
if (d.current?.open) return;
|
|
994
1380
|
let e = m.current;
|
|
995
1381
|
m.current = !1;
|
|
996
1382
|
let t = h.current;
|
|
997
|
-
h.current = void 0, t?.isConnected && (t.matches(
|
|
1383
|
+
h.current = void 0, t?.isConnected && (t.matches(Lt) || t.hasAttribute("tabindex")) && t.focus(), e && r?.next(!1);
|
|
998
1384
|
},
|
|
999
|
-
"data-testid":
|
|
1385
|
+
"data-testid": s,
|
|
1000
1386
|
children: t
|
|
1001
1387
|
})
|
|
1002
1388
|
});
|
|
1003
1389
|
},
|
|
1004
1390
|
Title: ({ children: t, testId: n }) => {
|
|
1005
|
-
let { titleId: r, isLabelled: i, registerNamePart: a } =
|
|
1006
|
-
if (
|
|
1391
|
+
let { titleId: r, isLabelled: i, registerNamePart: a } = Q("Title");
|
|
1392
|
+
if (c(() => a("title"), [a]), i) throw new At();
|
|
1007
1393
|
return /* @__PURE__ */ e("div", {
|
|
1008
1394
|
"data-dialog-member": "title",
|
|
1009
|
-
className:
|
|
1395
|
+
className: Mt(),
|
|
1010
1396
|
"data-testid": n,
|
|
1011
1397
|
children: /* @__PURE__ */ e("h1", {
|
|
1012
1398
|
id: r,
|
|
@@ -1016,10 +1402,10 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1016
1402
|
});
|
|
1017
1403
|
},
|
|
1018
1404
|
Description: ({ children: t, testId: n }) => {
|
|
1019
|
-
let { descriptionId: r, registerNamePart: i } =
|
|
1020
|
-
return
|
|
1405
|
+
let { descriptionId: r, registerNamePart: i } = Q("Description");
|
|
1406
|
+
return c(() => i("description"), [i]), /* @__PURE__ */ e("div", {
|
|
1021
1407
|
"data-dialog-member": "description",
|
|
1022
|
-
className:
|
|
1408
|
+
className: Nt(),
|
|
1023
1409
|
"data-testid": n,
|
|
1024
1410
|
children: /* @__PURE__ */ e("p", {
|
|
1025
1411
|
id: r,
|
|
@@ -1028,29 +1414,29 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1028
1414
|
})
|
|
1029
1415
|
});
|
|
1030
1416
|
},
|
|
1031
|
-
Content: ({ children: t, testId: n }) => (
|
|
1417
|
+
Content: ({ children: t, testId: n }) => (Q("Content"), /* @__PURE__ */ e("div", {
|
|
1032
1418
|
"data-dialog-member": "content",
|
|
1033
|
-
className:
|
|
1419
|
+
className: Pt(),
|
|
1034
1420
|
"data-testid": n,
|
|
1035
1421
|
children: t
|
|
1036
1422
|
})),
|
|
1037
|
-
Actions: ({ children: t, testId: n }) => (
|
|
1423
|
+
Actions: ({ children: t, testId: n }) => (Q("Actions"), /* @__PURE__ */ e("div", {
|
|
1038
1424
|
"data-dialog-member": "actions",
|
|
1039
|
-
className:
|
|
1425
|
+
className: Ft(),
|
|
1040
1426
|
"data-testid": n,
|
|
1041
1427
|
children: t
|
|
1042
1428
|
}))
|
|
1043
|
-
},
|
|
1429
|
+
}, Bt = v("font-secondary text-small text-muted py-[var(--space-region)] px-[var(--gutter)]", {
|
|
1044
1430
|
variants: { edge: {
|
|
1045
1431
|
none: "",
|
|
1046
1432
|
rule: "border-t border-solid border-rule"
|
|
1047
1433
|
} },
|
|
1048
1434
|
defaultVariants: { edge: "rule" }
|
|
1049
|
-
}),
|
|
1050
|
-
className:
|
|
1435
|
+
}), Vt = ({ edge: t, children: n, testId: r }) => /* @__PURE__ */ e("footer", {
|
|
1436
|
+
className: Bt({ edge: t }),
|
|
1051
1437
|
"data-testid": r,
|
|
1052
1438
|
children: n
|
|
1053
|
-
}),
|
|
1439
|
+
}), Ht = v("font-secondary text-small", {
|
|
1054
1440
|
variants: { state: {
|
|
1055
1441
|
idle: "text-muted",
|
|
1056
1442
|
sending: "text-muted",
|
|
@@ -1058,13 +1444,13 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1058
1444
|
failed: "text-error"
|
|
1059
1445
|
} },
|
|
1060
1446
|
defaultVariants: { state: "idle" }
|
|
1061
|
-
}),
|
|
1447
|
+
}), Ut = {
|
|
1062
1448
|
sent: "status",
|
|
1063
1449
|
failed: "alert"
|
|
1064
|
-
},
|
|
1450
|
+
}, Wt = ({ action: n, method: r = "post", state: i = "idle", children: a, actions: o, note: s, testId: c }) => {
|
|
1065
1451
|
let l = s != null && typeof s != "boolean";
|
|
1066
1452
|
if (i === "sent" && !l) throw Error("Form in the `sent` state must be given a `note` - it is the outcome message.");
|
|
1067
|
-
let u = i !== "sent", d =
|
|
1453
|
+
let u = i !== "sent", d = Ut[i];
|
|
1068
1454
|
return /* @__PURE__ */ t("form", {
|
|
1069
1455
|
action: n,
|
|
1070
1456
|
method: r,
|
|
@@ -1082,12 +1468,12 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1082
1468
|
}),
|
|
1083
1469
|
l && /* @__PURE__ */ e("p", {
|
|
1084
1470
|
role: d,
|
|
1085
|
-
className:
|
|
1471
|
+
className: Ht({ state: i }),
|
|
1086
1472
|
children: s
|
|
1087
1473
|
})
|
|
1088
1474
|
]
|
|
1089
1475
|
});
|
|
1090
|
-
},
|
|
1476
|
+
}, Gt = v([
|
|
1091
1477
|
"flex items-baseline justify-between",
|
|
1092
1478
|
"font-secondary text-label leading-label tracking-label text-muted",
|
|
1093
1479
|
"py-[var(--space-region)] px-[var(--gutter)]",
|
|
@@ -1098,50 +1484,50 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1098
1484
|
rule: "border-b border-solid border-rule"
|
|
1099
1485
|
} },
|
|
1100
1486
|
defaultVariants: { edge: "rule" }
|
|
1101
|
-
}),
|
|
1487
|
+
}), Kt = [
|
|
1102
1488
|
"inline-flex shrink-0 items-center",
|
|
1103
1489
|
"min-h-[calc(var(--text-label)*var(--leading-label))]",
|
|
1104
1490
|
"min-w-[var(--standing-min-width)]"
|
|
1105
|
-
].join(" "),
|
|
1106
|
-
className:
|
|
1491
|
+
].join(" "), qt = ({ edge: n, standing: r, navName: i, children: a, testId: o }) => /* @__PURE__ */ t("header", {
|
|
1492
|
+
className: Gt({ edge: n }),
|
|
1107
1493
|
"data-testid": o,
|
|
1108
1494
|
children: [/* @__PURE__ */ e("div", {
|
|
1109
|
-
className:
|
|
1495
|
+
className: Kt,
|
|
1110
1496
|
children: r
|
|
1111
1497
|
}), /* @__PURE__ */ e("nav", {
|
|
1112
1498
|
"aria-label": i,
|
|
1113
1499
|
className: "flex flex-wrap items-baseline gap-[var(--space-region)]",
|
|
1114
1500
|
children: a
|
|
1115
1501
|
})]
|
|
1116
|
-
}),
|
|
1502
|
+
}), Jt = v("flex flex-col min-h-[var(--fold-height)] gap-[var(--space-stack)]", {
|
|
1117
1503
|
variants: { place: {
|
|
1118
1504
|
start: "justify-start",
|
|
1119
1505
|
center: "justify-center",
|
|
1120
1506
|
between: "justify-between"
|
|
1121
1507
|
} },
|
|
1122
1508
|
defaultVariants: { place: "center" }
|
|
1123
|
-
}),
|
|
1124
|
-
className:
|
|
1509
|
+
}), Yt = ({ place: t, children: n, testId: r }) => /* @__PURE__ */ e("div", {
|
|
1510
|
+
className: Jt({ place: t }),
|
|
1125
1511
|
"data-testid": r,
|
|
1126
1512
|
children: n
|
|
1127
|
-
}),
|
|
1128
|
-
className:
|
|
1513
|
+
}), Xt = v("flex flex-col gap-[var(--space-stack)] py-[var(--space-band)] px-[var(--gutter)]"), Zt = v("font-primary text-title leading-title tracking-optical text-foreground"), Qt = v("font-primary text-lede leading-lede text-foreground max-w-[var(--measure-wide)]"), $t = v("font-primary text-small text-muted max-w-[var(--measure)]"), en = ({ title: n, lede: r, intro: i, testId: a }) => /* @__PURE__ */ t("header", {
|
|
1514
|
+
className: Xt(),
|
|
1129
1515
|
"data-testid": a,
|
|
1130
1516
|
children: [
|
|
1131
1517
|
/* @__PURE__ */ e("h1", {
|
|
1132
|
-
className:
|
|
1518
|
+
className: Zt(),
|
|
1133
1519
|
children: n
|
|
1134
1520
|
}),
|
|
1135
1521
|
r !== void 0 && /* @__PURE__ */ e("p", {
|
|
1136
|
-
className:
|
|
1522
|
+
className: Qt(),
|
|
1137
1523
|
children: r
|
|
1138
1524
|
}),
|
|
1139
1525
|
i !== void 0 && /* @__PURE__ */ e("p", {
|
|
1140
|
-
className:
|
|
1526
|
+
className: $t(),
|
|
1141
1527
|
children: i
|
|
1142
1528
|
})
|
|
1143
1529
|
]
|
|
1144
|
-
}),
|
|
1530
|
+
}), tn = v([
|
|
1145
1531
|
"relative",
|
|
1146
1532
|
"py-[var(--space-band)]",
|
|
1147
1533
|
"[[data-section]+&]:border-t [[data-section]+&]:border-solid [[data-section]+&]:border-rule"
|
|
@@ -1151,20 +1537,20 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1151
1537
|
full: ""
|
|
1152
1538
|
} },
|
|
1153
1539
|
defaultVariants: { bleed: "inset" }
|
|
1154
|
-
}),
|
|
1540
|
+
}), nn = ({ bleed: t, name: n, children: r, testId: i }) => /* @__PURE__ */ e("section", {
|
|
1155
1541
|
"data-section": "",
|
|
1156
|
-
className:
|
|
1542
|
+
className: tn({ bleed: t }),
|
|
1157
1543
|
"aria-label": n,
|
|
1158
1544
|
"data-testid": i,
|
|
1159
1545
|
children: r
|
|
1160
|
-
}),
|
|
1546
|
+
}), rn = v([
|
|
1161
1547
|
"grid gap-[var(--space-region)] lg:grid-cols-[12rem_minmax(0,1fr)]",
|
|
1162
1548
|
"[&>div:first-child]:border-solid [&>div:first-child]:border-border [&>div:first-child]:border-b [&>div:first-child]:pb-[var(--space-stack)]",
|
|
1163
1549
|
"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)]",
|
|
1164
1550
|
"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",
|
|
1165
1551
|
"[&>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))]",
|
|
1166
1552
|
"[&>div:first-child>nav>ul]:flex [&>div:first-child>nav>ul]:flex-col [&>div:first-child>nav>ul]:gap-[var(--space-stack)]"
|
|
1167
|
-
].join(" ")),
|
|
1553
|
+
].join(" ")), an = (e) => {
|
|
1168
1554
|
if (!e) return;
|
|
1169
1555
|
let t = [];
|
|
1170
1556
|
for (let n = e.parentElement; n && n !== e.ownerDocument.documentElement; n = n.parentElement) t.push(n);
|
|
@@ -1178,7 +1564,7 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1178
1564
|
return window.addEventListener("resize", n), () => {
|
|
1179
1565
|
r?.disconnect(), window.removeEventListener("resize", n), e.style.removeProperty("--sidebar-scrollport-height");
|
|
1180
1566
|
};
|
|
1181
|
-
},
|
|
1567
|
+
}, on = v([
|
|
1182
1568
|
"w-full text-left font-secondary text-label tracking-label",
|
|
1183
1569
|
"underline-offset-[var(--underline-offset)]",
|
|
1184
1570
|
"outline-focus-ring outline-offset-[var(--focus-ring-offset)] focus-visible:outline focus-visible:outline-[length:var(--focus-ring-width)]"
|
|
@@ -1189,44 +1575,44 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1189
1575
|
inert: "text-muted cursor-not-allowed"
|
|
1190
1576
|
} },
|
|
1191
1577
|
defaultVariants: { state: "usable" }
|
|
1192
|
-
}),
|
|
1193
|
-
let a =
|
|
1578
|
+
}), sn = i(void 0), cn = ({ entryKey: t, children: n, inert: r, testId: i }) => {
|
|
1579
|
+
let a = s(sn), o = a !== void 0 && a.active === t;
|
|
1194
1580
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", {
|
|
1195
1581
|
type: "button",
|
|
1196
|
-
className:
|
|
1582
|
+
className: on({ state: r ? "inert" : o ? "active" : "usable" }),
|
|
1197
1583
|
disabled: r,
|
|
1198
|
-
"aria-current":
|
|
1584
|
+
"aria-current": o ? "true" : void 0,
|
|
1199
1585
|
"data-testid": i,
|
|
1200
1586
|
onClick: () => {
|
|
1201
|
-
|
|
1587
|
+
o || a?.onSelect$.next(t);
|
|
1202
1588
|
},
|
|
1203
1589
|
children: n
|
|
1204
1590
|
}) });
|
|
1205
|
-
},
|
|
1591
|
+
}, ln = ({ children: t, testId: n }) => /* @__PURE__ */ e("div", {
|
|
1206
1592
|
"data-testid": n,
|
|
1207
1593
|
children: t
|
|
1208
|
-
}),
|
|
1209
|
-
Root: ({ active: r, label:
|
|
1210
|
-
let l = n.toArray(s).filter(
|
|
1594
|
+
}), un = {
|
|
1595
|
+
Root: ({ active: r, label: i, onSelect$: o, children: s, testId: c }) => {
|
|
1596
|
+
let l = n.toArray(s).filter(a);
|
|
1211
1597
|
return /* @__PURE__ */ t("div", {
|
|
1212
|
-
className:
|
|
1598
|
+
className: rn(),
|
|
1213
1599
|
"data-testid": c,
|
|
1214
1600
|
children: [/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("nav", {
|
|
1215
|
-
ref:
|
|
1216
|
-
"aria-label":
|
|
1217
|
-
children: /* @__PURE__ */ e(
|
|
1601
|
+
ref: an,
|
|
1602
|
+
"aria-label": i,
|
|
1603
|
+
children: /* @__PURE__ */ e(sn, {
|
|
1218
1604
|
value: {
|
|
1219
1605
|
active: r,
|
|
1220
1606
|
onSelect$: o
|
|
1221
1607
|
},
|
|
1222
|
-
children: /* @__PURE__ */ e("ul", { children: l.filter((e) => e.type ===
|
|
1608
|
+
children: /* @__PURE__ */ e("ul", { children: l.filter((e) => e.type === cn) })
|
|
1223
1609
|
})
|
|
1224
|
-
}) }), l.filter((e) => e.type ===
|
|
1610
|
+
}) }), l.filter((e) => e.type === ln)]
|
|
1225
1611
|
});
|
|
1226
1612
|
},
|
|
1227
|
-
Item:
|
|
1228
|
-
Content:
|
|
1229
|
-
},
|
|
1613
|
+
Item: cn,
|
|
1614
|
+
Content: ln
|
|
1615
|
+
}, dn = {
|
|
1230
1616
|
surface: "#ffffff",
|
|
1231
1617
|
foreground: "#0f172a",
|
|
1232
1618
|
muted: "#64748b",
|
|
@@ -1251,7 +1637,7 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1251
1637
|
warning: "#b45309",
|
|
1252
1638
|
error: "#d63384",
|
|
1253
1639
|
info: "#0e7490"
|
|
1254
|
-
},
|
|
1640
|
+
}, fn = {
|
|
1255
1641
|
surface: "#0f172a",
|
|
1256
1642
|
foreground: "#f8fafc",
|
|
1257
1643
|
muted: "#94a3b8",
|
|
@@ -1278,4 +1664,4 @@ var p = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, m = f, h = (e
|
|
|
1278
1664
|
info: "#22d3ee"
|
|
1279
1665
|
};
|
|
1280
1666
|
//#endregion
|
|
1281
|
-
export {
|
|
1667
|
+
export { w as Brandmark, Ae as Button, E as Checklist, Re as Choices, b as Cluster, O as Collection, Ot as Cover, ae as DefinitionList, zt as Dialog, U as Eyebrow, A as Figure, Vt as Footer, Wt as Form, ue as H1, de as H2, pe as H3, he as H4, _e as H5, ye as H6, qt as Header, Yt as Hero, Be as Input, He as Link, P as Meter, at as MultiSelect, xe as Note, st as NumberInput, Ce as P, en as PageHead, Oe as Prose, z as Rail, nn as Section, lt as Select, un as Sidebar, ft as Slider, S as Stack, se as Table, Ct as Tabs, Tt as TextArea, fn as dark, dn as light };
|