@kb.ui/react 0.0.0-stage → 0.10.2
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 +767 -2
- package/dist/check-versions.js +34 -0
- package/dist/components/Badge/Badge.d.ts +15 -0
- package/dist/components/Button/Button.d.ts +19 -0
- package/dist/components/Callout/Callout.d.ts +19 -0
- package/dist/components/Card/Card.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.d.ts +23 -0
- package/dist/components/Code/Code.d.ts +3 -0
- package/dist/components/Combobox/Combobox.d.ts +65 -0
- package/dist/components/Container/Container.d.ts +14 -0
- package/dist/components/Dialog/Dialog.d.ts +50 -0
- package/dist/components/ErrorSummary/ErrorSummary.d.ts +28 -0
- package/dist/components/Fieldset/Fieldset.d.ts +17 -0
- package/dist/components/FileInput/FileInput.d.ts +59 -0
- package/dist/components/FormActions/FormActions.d.ts +10 -0
- package/dist/components/Grid/Grid.d.ts +12 -0
- package/dist/components/Heading/Heading.d.ts +293 -0
- package/dist/components/Inline/Inline.d.ts +14 -0
- package/dist/components/Input/Input.d.ts +25 -0
- package/dist/components/Link/Link.d.ts +6 -0
- package/dist/components/Menu/Menu.d.ts +34 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +67 -0
- package/dist/components/NumberField/NumberField.d.ts +53 -0
- package/dist/components/Panel/Panel.d.ts +75 -0
- package/dist/components/Progress/Progress.d.ts +17 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +45 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +17 -0
- package/dist/components/Select/Select.d.ts +39 -0
- package/dist/components/Separator/Separator.d.ts +9 -0
- package/dist/components/Split/Split.d.ts +20 -0
- package/dist/components/Stat/Stat.d.ts +15 -0
- package/dist/components/Status/Status.d.ts +22 -0
- package/dist/components/Switch/Switch.d.ts +41 -0
- package/dist/components/Text/Text.d.ts +15 -0
- package/dist/components/Textarea/Textarea.d.ts +24 -0
- package/dist/components/Toolbar/Toolbar.d.ts +31 -0
- package/dist/components/Tooltip/Tooltip.d.ts +20 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +1770 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/utils/kb.d.ts +11 -0
- package/dist/utils/layout.d.ts +10 -0
- package/package.json +53 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,1770 @@
|
|
|
1
|
+
import { clsx as e } from "clsx";
|
|
2
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { Button as i } from "@base-ui/react/button";
|
|
4
|
+
import { Children as a, createContext as o, createElement as s, forwardRef as c, useCallback as l, useContext as u, useEffect as d, useId as f, useImperativeHandle as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
5
|
+
import { Combobox as v } from "@base-ui/react/combobox";
|
|
6
|
+
import { Dialog as y } from "@base-ui/react/dialog";
|
|
7
|
+
import { Field as b } from "@base-ui/react/field";
|
|
8
|
+
import { Input as x } from "@base-ui/react/input";
|
|
9
|
+
import { Menu as S } from "@base-ui/react/menu";
|
|
10
|
+
import { Separator as C } from "@base-ui/react/separator";
|
|
11
|
+
import { NumberField as w } from "@base-ui/react/number-field";
|
|
12
|
+
import { Collapsible as T } from "@base-ui/react/collapsible";
|
|
13
|
+
import { Progress as E } from "@base-ui/react/progress";
|
|
14
|
+
import { Radio as D } from "@base-ui/react/radio";
|
|
15
|
+
import { RadioGroup as O } from "@base-ui/react/radio-group";
|
|
16
|
+
import { ScrollArea as k } from "@base-ui/react/scroll-area";
|
|
17
|
+
import { Select as A } from "@base-ui/react/select";
|
|
18
|
+
import { Toolbar as j } from "@base-ui/react/toolbar";
|
|
19
|
+
import { Tooltip as M } from "@base-ui/react/tooltip";
|
|
20
|
+
//#region src/utils/kb.ts
|
|
21
|
+
function N(t, n = {}, r) {
|
|
22
|
+
let i = { className: e(`kb-${t}`, r) };
|
|
23
|
+
for (let [e, t] of Object.entries(n)) t !== void 0 && t !== !1 && (i[`data-${e}`] = t === !0 ? "" : t);
|
|
24
|
+
return i;
|
|
25
|
+
}
|
|
26
|
+
function P(e, t) {
|
|
27
|
+
let n = t !== void 0 && t !== !1 && t !== "false", r = e || n;
|
|
28
|
+
return {
|
|
29
|
+
invalid: r,
|
|
30
|
+
ariaInvalid: n ? t : r ? !0 : t
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/components/Badge/Badge.tsx
|
|
35
|
+
function F({ tone: e = "neutral", appearance: t = "chip", mono: r = !1, preserveCase: i = !1, className: a, ...o }) {
|
|
36
|
+
return /* @__PURE__ */ n("span", {
|
|
37
|
+
...o,
|
|
38
|
+
...N("badge", {
|
|
39
|
+
tone: e,
|
|
40
|
+
appearance: t,
|
|
41
|
+
mono: r,
|
|
42
|
+
"preserve-case": i
|
|
43
|
+
}, a)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/Button/Button.tsx
|
|
48
|
+
function I({ variant: e = "primary", size: t = "md", className: r, ...a }) {
|
|
49
|
+
return /* @__PURE__ */ n(i, {
|
|
50
|
+
...a,
|
|
51
|
+
...N("button", {
|
|
52
|
+
variant: e,
|
|
53
|
+
size: t
|
|
54
|
+
}, r)
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/Callout/Callout.tsx
|
|
59
|
+
function L({ classNames: t, tone: i = "neutral", title: a, icon: o, actions: s, live: c = !1, className: l, children: u, ...d }) {
|
|
60
|
+
return /* @__PURE__ */ r("div", {
|
|
61
|
+
...d,
|
|
62
|
+
...c ? { role: "status" } : {},
|
|
63
|
+
...N("callout", { tone: i }, l),
|
|
64
|
+
children: [o == null ? null : /* @__PURE__ */ n("span", {
|
|
65
|
+
className: e("kb-callout-icon", t?.icon),
|
|
66
|
+
"aria-hidden": "true",
|
|
67
|
+
children: o
|
|
68
|
+
}), /* @__PURE__ */ r("div", {
|
|
69
|
+
className: e("kb-callout-content", t?.content),
|
|
70
|
+
children: [
|
|
71
|
+
a == null ? null : /* @__PURE__ */ n("div", {
|
|
72
|
+
className: e("kb-callout-title", t?.title),
|
|
73
|
+
children: a
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ n("div", {
|
|
76
|
+
className: e("kb-callout-body", t?.body),
|
|
77
|
+
children: u
|
|
78
|
+
}),
|
|
79
|
+
s == null ? null : /* @__PURE__ */ n("div", {
|
|
80
|
+
className: e("kb-callout-actions", t?.actions),
|
|
81
|
+
children: s
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/components/Card/Card.tsx
|
|
89
|
+
function R({ as: e, appearance: t = "outlined", className: n, ...r }) {
|
|
90
|
+
return s(e ?? "article", {
|
|
91
|
+
...r,
|
|
92
|
+
...N("card", { appearance: t }, n)
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/components/Checkbox/Checkbox.tsx
|
|
97
|
+
function z({ classNames: t, label: i, checked: a, onCheckedChange: o, indeterminate: s = !1, visuallyHidden: c, description: l, error: u, disabled: d, readOnly: h, className: _, controlClassName: v, id: y, ref: b, style: x, "aria-invalid": S, ...C }) {
|
|
98
|
+
let w = f(), T = y ?? w, E = g(null);
|
|
99
|
+
p(b, () => E.current), m(() => {
|
|
100
|
+
E.current && (E.current.indeterminate = s);
|
|
101
|
+
});
|
|
102
|
+
let { invalid: D, ariaInvalid: O } = P(!!u, S), k = [
|
|
103
|
+
l ? `${T}-description` : null,
|
|
104
|
+
u ? `${T}-error` : null,
|
|
105
|
+
C["aria-describedby"]
|
|
106
|
+
].filter(Boolean).join(" ") || void 0, A = Object.fromEntries(Object.entries(x ?? {}).filter(([e]) => e.startsWith("--")));
|
|
107
|
+
return /* @__PURE__ */ r("div", {
|
|
108
|
+
...N("checkbox", {
|
|
109
|
+
disabled: d,
|
|
110
|
+
invalid: D
|
|
111
|
+
}, _),
|
|
112
|
+
style: A,
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ n("input", {
|
|
115
|
+
...C,
|
|
116
|
+
style: x,
|
|
117
|
+
id: T,
|
|
118
|
+
ref: E,
|
|
119
|
+
type: "checkbox",
|
|
120
|
+
checked: a,
|
|
121
|
+
"aria-checked": s ? "mixed" : a,
|
|
122
|
+
disabled: d,
|
|
123
|
+
readOnly: h,
|
|
124
|
+
"aria-readonly": h || void 0,
|
|
125
|
+
"aria-invalid": O,
|
|
126
|
+
"aria-describedby": k,
|
|
127
|
+
className: e("kb-checkbox-control", t?.control, v),
|
|
128
|
+
onChange: (e) => {
|
|
129
|
+
e.target.indeterminate = s, !d && !h && o(s ? !0 : e.target.checked);
|
|
130
|
+
}
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ n("span", {
|
|
133
|
+
className: e("kb-checkbox-mark", t?.mark),
|
|
134
|
+
"aria-hidden": "true",
|
|
135
|
+
children: /* @__PURE__ */ r("svg", {
|
|
136
|
+
"aria-hidden": "true",
|
|
137
|
+
viewBox: "0 0 16 16",
|
|
138
|
+
fill: "none",
|
|
139
|
+
stroke: "currentColor",
|
|
140
|
+
strokeWidth: "2",
|
|
141
|
+
children: [/* @__PURE__ */ n("path", {
|
|
142
|
+
className: e("kb-checkbox-tick", t?.tick),
|
|
143
|
+
d: "m3 8 3 3 7-7"
|
|
144
|
+
}), /* @__PURE__ */ n("path", {
|
|
145
|
+
className: e("kb-checkbox-mixed", t?.mixed),
|
|
146
|
+
d: "M3 8h10"
|
|
147
|
+
})]
|
|
148
|
+
})
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ n("label", {
|
|
151
|
+
htmlFor: T,
|
|
152
|
+
className: e("kb-checkbox-label", t?.label, c && "kb-sr-only"),
|
|
153
|
+
children: i
|
|
154
|
+
}),
|
|
155
|
+
l && /* @__PURE__ */ n("p", {
|
|
156
|
+
id: `${T}-description`,
|
|
157
|
+
className: e("kb-checkbox-description", t?.description),
|
|
158
|
+
children: l
|
|
159
|
+
}),
|
|
160
|
+
u && /* @__PURE__ */ n("p", {
|
|
161
|
+
id: `${T}-error`,
|
|
162
|
+
className: e("kb-checkbox-error", t?.error),
|
|
163
|
+
children: u
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/components/Code/Code.tsx
|
|
170
|
+
function B({ className: e, ...t }) {
|
|
171
|
+
return /* @__PURE__ */ n("code", {
|
|
172
|
+
...t,
|
|
173
|
+
...N("code", {}, e)
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/components/Combobox/Combobox.tsx
|
|
178
|
+
var V = c(function({ label: t, options: i, value: a, onValueChange: o, placeholder: s, emptyMessage: c = "No matching options", size: l = "md", description: u, error: d, invalid: p, disabled: m = !1, readOnly: _ = !1, required: y = !1, name: b, open: x, defaultOpen: S, onOpenChange: C, inputValue: w, onInputValueChange: T, clearLabel: E, toggleLabel: D, container: O, className: k, classNames: A, id: j, "aria-describedby": M, "aria-invalid": F, ...I }, L) {
|
|
179
|
+
let R = f(), z = g(null), B = j ?? `${R}-input`, V = `${R}-label`, H = `${R}-desc`, U = `${R}-err`, W = !!d, { invalid: G, ariaInvalid: K } = P(!!p || W, F), q = !!u, J = [
|
|
180
|
+
q ? H : null,
|
|
181
|
+
W ? U : null,
|
|
182
|
+
M
|
|
183
|
+
].filter(Boolean).join(" ") || void 0, Y = h(() => v.createItems(i, {
|
|
184
|
+
getValue: (e) => e.value,
|
|
185
|
+
getLabel: (e) => e.label
|
|
186
|
+
}), [i]), X = h(() => a !== null && i.some((e) => e.value === a) ? a : null, [a, i]);
|
|
187
|
+
return /* @__PURE__ */ n(v.Root, {
|
|
188
|
+
items: Y,
|
|
189
|
+
value: X,
|
|
190
|
+
onValueChange: (e) => {
|
|
191
|
+
m || _ || o(e ?? null);
|
|
192
|
+
},
|
|
193
|
+
inputValue: w,
|
|
194
|
+
onInputValueChange: (e) => {
|
|
195
|
+
T?.(e);
|
|
196
|
+
},
|
|
197
|
+
open: x,
|
|
198
|
+
defaultOpen: S,
|
|
199
|
+
onOpenChange: (e) => {
|
|
200
|
+
C?.(e);
|
|
201
|
+
},
|
|
202
|
+
disabled: m,
|
|
203
|
+
readOnly: _,
|
|
204
|
+
required: y,
|
|
205
|
+
name: b,
|
|
206
|
+
children: /* @__PURE__ */ r("div", {
|
|
207
|
+
...I,
|
|
208
|
+
ref: z,
|
|
209
|
+
...N("combobox", {
|
|
210
|
+
size: l,
|
|
211
|
+
invalid: G,
|
|
212
|
+
disabled: m,
|
|
213
|
+
readonly: _,
|
|
214
|
+
required: y
|
|
215
|
+
}, k),
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ n("label", {
|
|
218
|
+
id: V,
|
|
219
|
+
htmlFor: B,
|
|
220
|
+
className: e("kb-combobox-label", A?.label),
|
|
221
|
+
children: t
|
|
222
|
+
}),
|
|
223
|
+
/* @__PURE__ */ r(v.InputGroup, {
|
|
224
|
+
"aria-labelledby": V,
|
|
225
|
+
className: e("kb-combobox-shell", A?.shell),
|
|
226
|
+
children: [/* @__PURE__ */ n(v.Input, {
|
|
227
|
+
ref: L,
|
|
228
|
+
id: B,
|
|
229
|
+
placeholder: s,
|
|
230
|
+
"aria-labelledby": V,
|
|
231
|
+
"aria-invalid": K,
|
|
232
|
+
"aria-describedby": J,
|
|
233
|
+
className: e("kb-combobox-input", A?.input)
|
|
234
|
+
}), /* @__PURE__ */ r("div", {
|
|
235
|
+
className: e("kb-combobox-actions", A?.actions),
|
|
236
|
+
children: [/* @__PURE__ */ n(v.Clear, {
|
|
237
|
+
"aria-label": E ?? `Clear ${t}`,
|
|
238
|
+
disabled: m || _,
|
|
239
|
+
className: e("kb-combobox-clear", A?.clear),
|
|
240
|
+
children: /* @__PURE__ */ n("span", {
|
|
241
|
+
"aria-hidden": "true",
|
|
242
|
+
children: "×"
|
|
243
|
+
})
|
|
244
|
+
}), /* @__PURE__ */ n(v.Trigger, {
|
|
245
|
+
"aria-label": D ?? `Toggle ${t} options`,
|
|
246
|
+
disabled: m,
|
|
247
|
+
className: e("kb-combobox-trigger", A?.trigger),
|
|
248
|
+
children: /* @__PURE__ */ n("span", {
|
|
249
|
+
"aria-hidden": "true",
|
|
250
|
+
children: "▾"
|
|
251
|
+
})
|
|
252
|
+
})]
|
|
253
|
+
})]
|
|
254
|
+
}),
|
|
255
|
+
/* @__PURE__ */ n(v.Portal, {
|
|
256
|
+
container: O ?? z,
|
|
257
|
+
children: /* @__PURE__ */ n(v.Positioner, {
|
|
258
|
+
sideOffset: 6,
|
|
259
|
+
className: e("kb-combobox-positioner", A?.positioner),
|
|
260
|
+
children: /* @__PURE__ */ r(v.Popup, {
|
|
261
|
+
className: e("kb-combobox-popup", A?.popup),
|
|
262
|
+
children: [/* @__PURE__ */ n(v.List, {
|
|
263
|
+
"aria-labelledby": V,
|
|
264
|
+
className: e("kb-combobox-list", A?.list),
|
|
265
|
+
children: (t) => /* @__PURE__ */ r(v.Item, {
|
|
266
|
+
value: t.value,
|
|
267
|
+
disabled: !!t.disabled,
|
|
268
|
+
className: e("kb-combobox-option", A?.option),
|
|
269
|
+
children: [/* @__PURE__ */ n(v.ItemIndicator, {
|
|
270
|
+
keepMounted: !0,
|
|
271
|
+
className: e("kb-combobox-option-indicator", A?.optionIndicator),
|
|
272
|
+
children: "✓"
|
|
273
|
+
}), /* @__PURE__ */ n("span", {
|
|
274
|
+
className: e("kb-combobox-option-label", A?.optionLabel),
|
|
275
|
+
children: t.label
|
|
276
|
+
})]
|
|
277
|
+
}, t.value)
|
|
278
|
+
}), /* @__PURE__ */ n(v.Empty, {
|
|
279
|
+
className: e("kb-combobox-empty", A?.empty),
|
|
280
|
+
children: c
|
|
281
|
+
})]
|
|
282
|
+
})
|
|
283
|
+
})
|
|
284
|
+
}),
|
|
285
|
+
q && /* @__PURE__ */ n("p", {
|
|
286
|
+
id: H,
|
|
287
|
+
className: e("kb-combobox-description", A?.description),
|
|
288
|
+
children: u
|
|
289
|
+
}),
|
|
290
|
+
W && /* @__PURE__ */ n("p", {
|
|
291
|
+
id: U,
|
|
292
|
+
className: e("kb-combobox-error", A?.error),
|
|
293
|
+
children: d
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
})
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/components/Container/Container.tsx
|
|
301
|
+
function H({ as: e, size: t = "lg", gutter: n = !0, className: r, ...i }) {
|
|
302
|
+
return s(e ?? "div", {
|
|
303
|
+
...i,
|
|
304
|
+
"data-gutter": void 0,
|
|
305
|
+
...N("container", {
|
|
306
|
+
size: t,
|
|
307
|
+
gutter: n ? void 0 : "none"
|
|
308
|
+
}, r)
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/components/Dialog/Dialog.tsx
|
|
313
|
+
function U(e) {
|
|
314
|
+
return /* @__PURE__ */ n(y.Root, { ...e });
|
|
315
|
+
}
|
|
316
|
+
function W(e) {
|
|
317
|
+
return /* @__PURE__ */ n(y.Trigger, { ...e });
|
|
318
|
+
}
|
|
319
|
+
function G(e) {
|
|
320
|
+
return /* @__PURE__ */ n(y.Close, { ...e });
|
|
321
|
+
}
|
|
322
|
+
function K({ className: t, ...r }) {
|
|
323
|
+
return /* @__PURE__ */ n(y.Title, {
|
|
324
|
+
...r,
|
|
325
|
+
className: e("kb-dialog-title", t)
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function q({ className: t, ...r }) {
|
|
329
|
+
return /* @__PURE__ */ n(y.Description, {
|
|
330
|
+
...r,
|
|
331
|
+
className: e("kb-dialog-description", t)
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
function J({ className: t, ...r }) {
|
|
335
|
+
return /* @__PURE__ */ n("div", {
|
|
336
|
+
...r,
|
|
337
|
+
className: e("kb-dialog-actions", t)
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
function Y({ className: t, ...r }) {
|
|
341
|
+
return /* @__PURE__ */ n("div", {
|
|
342
|
+
...r,
|
|
343
|
+
className: e("kb-dialog-header", t)
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function X({ className: t, ...r }) {
|
|
347
|
+
return /* @__PURE__ */ n("div", {
|
|
348
|
+
...r,
|
|
349
|
+
className: e("kb-dialog-body", t)
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
function Z({ className: t, ...r }) {
|
|
353
|
+
return /* @__PURE__ */ n("div", {
|
|
354
|
+
...r,
|
|
355
|
+
className: e("kb-dialog-footer", t)
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
function Q({ classNames: t, title: i, description: a, container: o, children: s, className: c, ...l }) {
|
|
359
|
+
return /* @__PURE__ */ r(y.Portal, {
|
|
360
|
+
container: o,
|
|
361
|
+
children: [/* @__PURE__ */ n(y.Backdrop, { className: e("kb-dialog-backdrop", t?.backdrop) }), /* @__PURE__ */ r(y.Popup, {
|
|
362
|
+
...l,
|
|
363
|
+
className: e("kb-dialog-popup", c),
|
|
364
|
+
children: [
|
|
365
|
+
i != null && i !== "" ? /* @__PURE__ */ n(K, { children: i }) : null,
|
|
366
|
+
a != null && a !== "" ? /* @__PURE__ */ n(q, { children: a }) : null,
|
|
367
|
+
s
|
|
368
|
+
]
|
|
369
|
+
})]
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
var ee = Object.assign(U, {
|
|
373
|
+
Trigger: W,
|
|
374
|
+
Content: Q,
|
|
375
|
+
Title: K,
|
|
376
|
+
Description: q,
|
|
377
|
+
Close: G,
|
|
378
|
+
Actions: J,
|
|
379
|
+
Header: Y,
|
|
380
|
+
Body: X,
|
|
381
|
+
Footer: Z
|
|
382
|
+
}), te = [
|
|
383
|
+
"input:not(:disabled):not([type='hidden']):not([hidden]):not([tabindex='-1']):not([aria-hidden='true'])",
|
|
384
|
+
"textarea:not(:disabled):not([hidden]):not([tabindex='-1']):not([aria-hidden='true'])",
|
|
385
|
+
"select:not(:disabled):not([hidden]):not([tabindex='-1']):not([aria-hidden='true'])",
|
|
386
|
+
"button:not(:disabled):not([hidden]):not([tabindex='-1']):not([aria-hidden='true'])",
|
|
387
|
+
"[tabindex]:not([tabindex='-1']):not(:disabled):not([hidden]):not([aria-hidden='true']):not([aria-disabled='true'])"
|
|
388
|
+
].join(", ");
|
|
389
|
+
function ne(e, t) {
|
|
390
|
+
if (!t.startsWith("#") || t.length < 2) return !1;
|
|
391
|
+
let n = t.slice(1), r = n;
|
|
392
|
+
try {
|
|
393
|
+
r = decodeURIComponent(n);
|
|
394
|
+
} catch {
|
|
395
|
+
r = n;
|
|
396
|
+
}
|
|
397
|
+
let i = e.getElementById(r);
|
|
398
|
+
if (!i) return !1;
|
|
399
|
+
let a = i.matches(te) ? i : i.querySelector(te) ?? (i.hasAttribute("tabindex") && !i.matches(":disabled") && !i.hidden ? i : null);
|
|
400
|
+
return a ? (a.focus(), a.scrollIntoView?.({ block: "nearest" }), !0) : !1;
|
|
401
|
+
}
|
|
402
|
+
var re = ({ ref: t, title: i = "There is a problem", description: a, items: o, headingLevel: s = 2, onItemSelect: c, tabIndex: l = -1, className: u, classNames: d, "aria-labelledby": p, "aria-describedby": m, ...h }) => {
|
|
403
|
+
let g = f();
|
|
404
|
+
if (o.length === 0) return null;
|
|
405
|
+
let _ = h.id ?? `kb-errorsummary-${g}`, v = `${_}-title`, y = a ? `${_}-description` : void 0, b = p ?? v, x = [y, m].filter(Boolean).join(" ") || void 0, S = `h${s}`, C = /* @__PURE__ */ new Map();
|
|
406
|
+
return /* @__PURE__ */ r("div", {
|
|
407
|
+
...h,
|
|
408
|
+
ref: t,
|
|
409
|
+
role: "alert",
|
|
410
|
+
tabIndex: l,
|
|
411
|
+
"aria-labelledby": b,
|
|
412
|
+
"aria-describedby": x,
|
|
413
|
+
...N("errorsummary", {}, u),
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ n(S, {
|
|
416
|
+
id: v,
|
|
417
|
+
className: e("kb-errorsummary-title", d?.title),
|
|
418
|
+
children: i
|
|
419
|
+
}),
|
|
420
|
+
a ? /* @__PURE__ */ n("p", {
|
|
421
|
+
id: y,
|
|
422
|
+
className: e("kb-errorsummary-description", d?.description),
|
|
423
|
+
children: a
|
|
424
|
+
}) : null,
|
|
425
|
+
/* @__PURE__ */ n("ul", {
|
|
426
|
+
className: e("kb-errorsummary-list", d?.list),
|
|
427
|
+
children: o.map((t) => {
|
|
428
|
+
let r = t.id ?? `${t.href}:${typeof t.label == "string" || typeof t.label == "number" ? t.label : ""}`, i = (C.get(r) ?? 0) + 1;
|
|
429
|
+
C.set(r, i);
|
|
430
|
+
let a = i === 1 ? r : `${r}:${i}`;
|
|
431
|
+
return /* @__PURE__ */ n("li", {
|
|
432
|
+
className: e("kb-errorsummary-item", d?.item),
|
|
433
|
+
children: /* @__PURE__ */ n("a", {
|
|
434
|
+
href: t.href,
|
|
435
|
+
className: e("kb-errorsummary-link", d?.link),
|
|
436
|
+
onClick: (e) => {
|
|
437
|
+
c?.(t.href, e), !e.defaultPrevented && ne(e.currentTarget.ownerDocument, t.href) && e.preventDefault();
|
|
438
|
+
},
|
|
439
|
+
children: t.label
|
|
440
|
+
})
|
|
441
|
+
}, a);
|
|
442
|
+
})
|
|
443
|
+
})
|
|
444
|
+
]
|
|
445
|
+
});
|
|
446
|
+
}, ie = ({ ref: t, legend: i, visuallyHidden: a, description: o, error: s, disabled: c, className: l, classNames: u, children: d, "aria-describedby": p, "aria-invalid": m, ...h }) => {
|
|
447
|
+
let g = f(), _ = h.id ?? `kb-fieldset-${g}`, v = !!s, { invalid: y, ariaInvalid: b } = P(v, m), x = o ? `${_}-description` : void 0, S = v ? `${_}-error` : void 0, C = [
|
|
448
|
+
x,
|
|
449
|
+
S,
|
|
450
|
+
p
|
|
451
|
+
].filter(Boolean).join(" ") || void 0;
|
|
452
|
+
return /* @__PURE__ */ r("fieldset", {
|
|
453
|
+
...h,
|
|
454
|
+
ref: t,
|
|
455
|
+
disabled: c,
|
|
456
|
+
"aria-invalid": b,
|
|
457
|
+
"aria-describedby": C,
|
|
458
|
+
...N("fieldset", {
|
|
459
|
+
disabled: !!c,
|
|
460
|
+
invalid: y
|
|
461
|
+
}, l),
|
|
462
|
+
children: [
|
|
463
|
+
/* @__PURE__ */ n("legend", {
|
|
464
|
+
className: e("kb-fieldset-legend", a && "kb-sr-only", u?.legend),
|
|
465
|
+
children: i
|
|
466
|
+
}),
|
|
467
|
+
o ? /* @__PURE__ */ n("p", {
|
|
468
|
+
id: x,
|
|
469
|
+
className: e("kb-fieldset-description", u?.description),
|
|
470
|
+
children: o
|
|
471
|
+
}) : null,
|
|
472
|
+
/* @__PURE__ */ n("div", {
|
|
473
|
+
className: e("kb-fieldset-fields", u?.fields),
|
|
474
|
+
children: d
|
|
475
|
+
}),
|
|
476
|
+
v ? /* @__PURE__ */ n("div", {
|
|
477
|
+
id: S,
|
|
478
|
+
className: e("kb-fieldset-error", u?.error),
|
|
479
|
+
children: s
|
|
480
|
+
}) : null
|
|
481
|
+
]
|
|
482
|
+
});
|
|
483
|
+
}, ae = (e) => `Remove ${e.name}`, oe = (e) => `${e.name} removed.`, se = (e) => `${e} ${e === 1 ? "file" : "files"} selected.`;
|
|
484
|
+
function ce({ classNames: i, label: a, items: o, onFiles: s, onRemove: c, accept: l, multiple: u = !0, disabled: d = !1, readOnly: h = !1, description: v, error: y, visuallyHidden: b, chooseLabel: x = "Choose files", emptyMessage: S = "No files added.", removeLabel: C = ae, removedMessage: w = oe, selectionMessage: T = se, renderItem: E, triggerClassName: D, listClassName: O, itemClassName: k, inputRef: A, triggerRef: j, className: M, onBlurCapture: F, "aria-describedby": L, "aria-invalid": R, ...z }) {
|
|
485
|
+
let B = f(), V = g(null), H = g(null), U = g(/* @__PURE__ */ new Map()), W = g(null), [G, K] = _("");
|
|
486
|
+
p(A, () => V.current), p(j, () => H.current);
|
|
487
|
+
let { invalid: q, ariaInvalid: J } = P(!!y, R), Y = d || h, X = [
|
|
488
|
+
v ? `${B}-description` : null,
|
|
489
|
+
y ? `${B}-error` : null,
|
|
490
|
+
L
|
|
491
|
+
].filter(Boolean).join(" ") || void 0;
|
|
492
|
+
return m(() => {
|
|
493
|
+
let e = W.current;
|
|
494
|
+
if (!e || o.some((t) => t.id === e.item.id)) return;
|
|
495
|
+
W.current = null;
|
|
496
|
+
let t = e.button.ownerDocument.activeElement;
|
|
497
|
+
if (!Y && (t === e.button.ownerDocument.body || t === e.button)) {
|
|
498
|
+
let t = o[Math.min(e.index, o.length - 1)];
|
|
499
|
+
(t ? U.current.get(t.id) : H.current)?.focus();
|
|
500
|
+
}
|
|
501
|
+
K(w(e.item));
|
|
502
|
+
}, [
|
|
503
|
+
o,
|
|
504
|
+
Y,
|
|
505
|
+
w
|
|
506
|
+
]), /* @__PURE__ */ r("div", {
|
|
507
|
+
...z,
|
|
508
|
+
...N("fileinput", {
|
|
509
|
+
disabled: d,
|
|
510
|
+
readonly: h,
|
|
511
|
+
invalid: q
|
|
512
|
+
}, M),
|
|
513
|
+
onBlurCapture: (e) => {
|
|
514
|
+
W.current?.button.isSameNode(e.target) && e.relatedTarget !== W.current.button && (W.current = null), F?.(e);
|
|
515
|
+
},
|
|
516
|
+
children: [
|
|
517
|
+
/* @__PURE__ */ n("span", {
|
|
518
|
+
id: `${B}-label`,
|
|
519
|
+
className: e("kb-fileinput-label", i?.label, b && "kb-sr-only"),
|
|
520
|
+
children: a
|
|
521
|
+
}),
|
|
522
|
+
/* @__PURE__ */ n("input", {
|
|
523
|
+
ref: V,
|
|
524
|
+
type: "file",
|
|
525
|
+
hidden: !0,
|
|
526
|
+
className: e("kb-fileinput-native", i?.native),
|
|
527
|
+
accept: l,
|
|
528
|
+
multiple: u,
|
|
529
|
+
disabled: Y,
|
|
530
|
+
onChange: (e) => {
|
|
531
|
+
let t = e.currentTarget;
|
|
532
|
+
try {
|
|
533
|
+
let e = Array.from(t.files ?? []);
|
|
534
|
+
!Y && e.length && (s(e), K(T(e.length)));
|
|
535
|
+
} finally {
|
|
536
|
+
t.value = "";
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}),
|
|
540
|
+
/* @__PURE__ */ n(I, {
|
|
541
|
+
ref: H,
|
|
542
|
+
type: "button",
|
|
543
|
+
size: "lg",
|
|
544
|
+
variant: "secondary",
|
|
545
|
+
disabled: Y,
|
|
546
|
+
"aria-labelledby": `${B}-label ${B}-action`,
|
|
547
|
+
"aria-describedby": X,
|
|
548
|
+
"aria-invalid": J,
|
|
549
|
+
className: e("kb-fileinput-trigger", i?.trigger, D),
|
|
550
|
+
onClick: () => {
|
|
551
|
+
Y || V.current?.click();
|
|
552
|
+
},
|
|
553
|
+
children: /* @__PURE__ */ n("span", {
|
|
554
|
+
id: `${B}-action`,
|
|
555
|
+
children: x
|
|
556
|
+
})
|
|
557
|
+
}),
|
|
558
|
+
v && /* @__PURE__ */ n("p", {
|
|
559
|
+
id: `${B}-description`,
|
|
560
|
+
className: e("kb-fileinput-description", i?.description),
|
|
561
|
+
children: v
|
|
562
|
+
}),
|
|
563
|
+
y && /* @__PURE__ */ n("p", {
|
|
564
|
+
id: `${B}-error`,
|
|
565
|
+
className: e("kb-fileinput-error", i?.error),
|
|
566
|
+
role: "alert",
|
|
567
|
+
children: y
|
|
568
|
+
}),
|
|
569
|
+
o.length ? /* @__PURE__ */ n("ul", {
|
|
570
|
+
className: e("kb-fileinput-list", i?.list, O),
|
|
571
|
+
"aria-labelledby": `${B}-label`,
|
|
572
|
+
children: o.map((a, o) => /* @__PURE__ */ r("li", {
|
|
573
|
+
className: e("kb-fileinput-item", i?.item, k),
|
|
574
|
+
children: [/* @__PURE__ */ n("div", {
|
|
575
|
+
className: e("kb-fileinput-content", i?.content),
|
|
576
|
+
children: E ? E(a) : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("span", {
|
|
577
|
+
className: e("kb-fileinput-name", i?.name),
|
|
578
|
+
children: a.name
|
|
579
|
+
}), a.description && /* @__PURE__ */ n("span", {
|
|
580
|
+
className: e("kb-fileinput-metadata", i?.metadata),
|
|
581
|
+
children: a.description
|
|
582
|
+
})] })
|
|
583
|
+
}), /* @__PURE__ */ n(I, {
|
|
584
|
+
ref: (e) => {
|
|
585
|
+
e ? U.current.set(a.id, e) : U.current.delete(a.id);
|
|
586
|
+
},
|
|
587
|
+
type: "button",
|
|
588
|
+
size: "lg",
|
|
589
|
+
variant: "ghost",
|
|
590
|
+
disabled: Y,
|
|
591
|
+
className: e("kb-fileinput-remove", i?.remove),
|
|
592
|
+
"aria-label": C(a),
|
|
593
|
+
onClick: (e) => {
|
|
594
|
+
Y || (e.currentTarget === e.currentTarget.ownerDocument.activeElement && (W.current = {
|
|
595
|
+
item: a,
|
|
596
|
+
index: o,
|
|
597
|
+
button: e.currentTarget
|
|
598
|
+
}), c(a.id));
|
|
599
|
+
},
|
|
600
|
+
children: /* @__PURE__ */ n("span", {
|
|
601
|
+
"aria-hidden": "true",
|
|
602
|
+
children: "×"
|
|
603
|
+
})
|
|
604
|
+
})]
|
|
605
|
+
}, a.id))
|
|
606
|
+
}) : /* @__PURE__ */ n("p", {
|
|
607
|
+
className: e("kb-fileinput-empty", i?.empty),
|
|
608
|
+
children: S
|
|
609
|
+
}),
|
|
610
|
+
/* @__PURE__ */ n("p", {
|
|
611
|
+
role: "status",
|
|
612
|
+
"aria-live": "polite",
|
|
613
|
+
"aria-atomic": "true",
|
|
614
|
+
className: "kb-sr-only",
|
|
615
|
+
children: G
|
|
616
|
+
})
|
|
617
|
+
]
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
//#endregion
|
|
621
|
+
//#region src/components/FormActions/FormActions.tsx
|
|
622
|
+
var le = ({ ref: e, align: t = "end", divider: r = !1, className: i, children: a, ...o }) => /* @__PURE__ */ n("div", {
|
|
623
|
+
...o,
|
|
624
|
+
ref: e,
|
|
625
|
+
...N("formactions", {
|
|
626
|
+
align: t,
|
|
627
|
+
divider: r
|
|
628
|
+
}, i),
|
|
629
|
+
children: a
|
|
630
|
+
});
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region src/components/Grid/Grid.tsx
|
|
633
|
+
function ue({ as: e, layout: t = "auto", className: n, ...r }) {
|
|
634
|
+
return s(e ?? "div", {
|
|
635
|
+
...r,
|
|
636
|
+
...N("grid", { layout: t }, n)
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
//#endregion
|
|
640
|
+
//#region src/components/Heading/Heading.tsx
|
|
641
|
+
var de = {
|
|
642
|
+
1: "xl",
|
|
643
|
+
2: "lg",
|
|
644
|
+
3: "md",
|
|
645
|
+
4: "sm",
|
|
646
|
+
5: "sm",
|
|
647
|
+
6: "sm"
|
|
648
|
+
};
|
|
649
|
+
function fe({ level: e = 2, size: t = de[e], className: n, ...r }) {
|
|
650
|
+
return s(`h${e}`, {
|
|
651
|
+
...r,
|
|
652
|
+
...N("heading", { size: t }, n)
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
//#endregion
|
|
656
|
+
//#region src/components/Inline/Inline.tsx
|
|
657
|
+
function pe({ as: e, gap: t = "md", align: n = "center", justify: r = "start", className: i, ...a }) {
|
|
658
|
+
return s(e ?? "div", {
|
|
659
|
+
...a,
|
|
660
|
+
...N("inline", {
|
|
661
|
+
gap: t,
|
|
662
|
+
align: n,
|
|
663
|
+
justify: r
|
|
664
|
+
}, i)
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
//#endregion
|
|
668
|
+
//#region src/components/Input/Input.tsx
|
|
669
|
+
function me({ classNames: t, label: i, visuallyHidden: a, description: o, error: s, size: c = "md", disabled: l, className: u, startContent: d, endContent: f, "aria-invalid": p, ...m }) {
|
|
670
|
+
let { invalid: h, ariaInvalid: g } = P(!!s, p);
|
|
671
|
+
return /* @__PURE__ */ r(b.Root, {
|
|
672
|
+
...N("input", {
|
|
673
|
+
size: c,
|
|
674
|
+
invalid: h,
|
|
675
|
+
"start-adornment": !!d,
|
|
676
|
+
"end-adornment": !!f
|
|
677
|
+
}, u),
|
|
678
|
+
invalid: h,
|
|
679
|
+
disabled: !!l,
|
|
680
|
+
children: [
|
|
681
|
+
/* @__PURE__ */ n(b.Label, {
|
|
682
|
+
className: e("kb-input-label", t?.label, a && "kb-sr-only"),
|
|
683
|
+
children: i
|
|
684
|
+
}),
|
|
685
|
+
/* @__PURE__ */ r("div", {
|
|
686
|
+
className: e("kb-input-shell", t?.shell),
|
|
687
|
+
children: [
|
|
688
|
+
d && /* @__PURE__ */ n("span", {
|
|
689
|
+
className: e("kb-input-start", t?.start),
|
|
690
|
+
children: d
|
|
691
|
+
}),
|
|
692
|
+
/* @__PURE__ */ n(x, {
|
|
693
|
+
...m,
|
|
694
|
+
"aria-invalid": g,
|
|
695
|
+
render: m.render ?? (typeof g == "string" ? /* @__PURE__ */ n("input", { "aria-invalid": g }) : void 0),
|
|
696
|
+
className: e("kb-input-control", t?.control)
|
|
697
|
+
}),
|
|
698
|
+
f && /* @__PURE__ */ n("span", {
|
|
699
|
+
className: e("kb-input-end", t?.end),
|
|
700
|
+
children: f
|
|
701
|
+
})
|
|
702
|
+
]
|
|
703
|
+
}),
|
|
704
|
+
o ? /* @__PURE__ */ n(b.Description, {
|
|
705
|
+
className: e("kb-input-description", t?.description),
|
|
706
|
+
children: o
|
|
707
|
+
}) : null,
|
|
708
|
+
s ? /* @__PURE__ */ n(b.Error, {
|
|
709
|
+
className: e("kb-input-error", t?.error),
|
|
710
|
+
match: !0,
|
|
711
|
+
children: s
|
|
712
|
+
}) : null
|
|
713
|
+
]
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/components/Link/Link.tsx
|
|
718
|
+
function he({ className: e, ...t }) {
|
|
719
|
+
return /* @__PURE__ */ n("a", {
|
|
720
|
+
...t,
|
|
721
|
+
...N("link", {}, e)
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
//#endregion
|
|
725
|
+
//#region src/components/Menu/Menu.tsx
|
|
726
|
+
var ge = o(!1);
|
|
727
|
+
function _e({ onOpenChange: e, ...t }) {
|
|
728
|
+
let [r, i] = _(!1);
|
|
729
|
+
return d(() => {
|
|
730
|
+
if (!r) return;
|
|
731
|
+
let e = () => i(!1);
|
|
732
|
+
return document.addEventListener("keydown", e, {
|
|
733
|
+
capture: !0,
|
|
734
|
+
once: !0
|
|
735
|
+
}), () => document.removeEventListener("keydown", e, !0);
|
|
736
|
+
}, [r]), /* @__PURE__ */ n(ge.Provider, {
|
|
737
|
+
value: r,
|
|
738
|
+
children: /* @__PURE__ */ n(S.Root, {
|
|
739
|
+
...t,
|
|
740
|
+
onOpenChange: (t, n) => {
|
|
741
|
+
let r = n.event;
|
|
742
|
+
i(/^(pointer|mouse|touch|click)/.test(r.type) && !(r.type === "click" && "detail" in r && r.detail === 0)), e?.(t, n);
|
|
743
|
+
}
|
|
744
|
+
})
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
function ve(e) {
|
|
748
|
+
let t = u(ge);
|
|
749
|
+
return /* @__PURE__ */ n(S.Trigger, {
|
|
750
|
+
...e,
|
|
751
|
+
"data-kb-menu-trigger": "",
|
|
752
|
+
"data-pointer-focus": t || void 0
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
function ye({ side: t = "bottom", align: r = "start", className: i, container: a, ...o }) {
|
|
756
|
+
return /* @__PURE__ */ n(S.Portal, {
|
|
757
|
+
container: a,
|
|
758
|
+
children: /* @__PURE__ */ n(S.Positioner, {
|
|
759
|
+
side: t,
|
|
760
|
+
align: r,
|
|
761
|
+
sideOffset: 6,
|
|
762
|
+
children: /* @__PURE__ */ n(S.Popup, {
|
|
763
|
+
...o,
|
|
764
|
+
className: e("kb-menu", i)
|
|
765
|
+
})
|
|
766
|
+
})
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
function be({ className: t, ...r }) {
|
|
770
|
+
return /* @__PURE__ */ n(S.Item, {
|
|
771
|
+
...r,
|
|
772
|
+
className: e("kb-menu-item", t)
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
function xe({ className: t, ...r }) {
|
|
776
|
+
return /* @__PURE__ */ n(C, {
|
|
777
|
+
...r,
|
|
778
|
+
className: e("kb-menu-separator", t)
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
var Se = Object.assign(_e, {
|
|
782
|
+
Trigger: ve,
|
|
783
|
+
Content: ye,
|
|
784
|
+
Item: be,
|
|
785
|
+
Separator: xe
|
|
786
|
+
}), Ce = (e) => `Remove ${e.label}`, we = {
|
|
787
|
+
"aria-readonly": void 0,
|
|
788
|
+
"aria-disabled": void 0
|
|
789
|
+
}, Te = c(function({ label: t, options: i, value: a, onValueChange: o, placeholder: s, emptyMessage: c = "No matching options", size: l = "md", description: u, error: d, invalid: p, disabled: m = !1, readOnly: _ = !1, required: y = !1, name: b, open: x, defaultOpen: S, onOpenChange: C, inputValue: w, onInputValueChange: T, removeLabel: E = Ce, clearLabel: D, toggleLabel: O, container: k, className: A, classNames: j, id: M, "aria-describedby": F, "aria-invalid": I, ...L }, R) {
|
|
790
|
+
let z = f(), B = g(null), V = M ?? `${z}-input`, H = `${z}-label`, U = `${z}-desc`, W = `${z}-err`, G = !!d, { invalid: K, ariaInvalid: q } = P(!!p || G, I), J = !!u, Y = [
|
|
791
|
+
J ? U : null,
|
|
792
|
+
G ? W : null,
|
|
793
|
+
F
|
|
794
|
+
].filter(Boolean).join(" ") || void 0, X = h(() => v.createItems(i, {
|
|
795
|
+
getValue: (e) => e.value,
|
|
796
|
+
getLabel: (e) => e.label
|
|
797
|
+
}), [i]), Z = h(() => new Map(i.map((e) => [e.value, e])), [i]), Q = h(() => a.filter((e, t) => Z.has(e) && a.indexOf(e) === t), [a, Z]), ee = h(() => Q.map((e) => Z.get(e)).filter((e) => e !== void 0), [Q, Z]);
|
|
798
|
+
return /* @__PURE__ */ n(v.Root, {
|
|
799
|
+
multiple: !0,
|
|
800
|
+
items: X,
|
|
801
|
+
value: Q,
|
|
802
|
+
onValueChange: (e) => {
|
|
803
|
+
m || _ || o(e ?? []);
|
|
804
|
+
},
|
|
805
|
+
inputValue: w,
|
|
806
|
+
onInputValueChange: (e) => {
|
|
807
|
+
T?.(e);
|
|
808
|
+
},
|
|
809
|
+
open: x,
|
|
810
|
+
defaultOpen: S,
|
|
811
|
+
onOpenChange: (e) => {
|
|
812
|
+
C?.(e);
|
|
813
|
+
},
|
|
814
|
+
disabled: m,
|
|
815
|
+
readOnly: _,
|
|
816
|
+
required: y,
|
|
817
|
+
name: b,
|
|
818
|
+
children: /* @__PURE__ */ r("div", {
|
|
819
|
+
...L,
|
|
820
|
+
ref: B,
|
|
821
|
+
...N("multiselect", {
|
|
822
|
+
size: l,
|
|
823
|
+
invalid: K,
|
|
824
|
+
disabled: m,
|
|
825
|
+
readonly: _,
|
|
826
|
+
required: y
|
|
827
|
+
}, A),
|
|
828
|
+
children: [
|
|
829
|
+
/* @__PURE__ */ n("label", {
|
|
830
|
+
id: H,
|
|
831
|
+
htmlFor: V,
|
|
832
|
+
className: e("kb-multiselect-label", j?.label),
|
|
833
|
+
children: t
|
|
834
|
+
}),
|
|
835
|
+
/* @__PURE__ */ r(v.InputGroup, {
|
|
836
|
+
"aria-labelledby": H,
|
|
837
|
+
className: e("kb-multiselect-shell", j?.shell),
|
|
838
|
+
children: [/* @__PURE__ */ r(v.Chips, {
|
|
839
|
+
"aria-label": `${t} selections`,
|
|
840
|
+
className: e("kb-multiselect-chips", j?.chips),
|
|
841
|
+
children: [ee.map((t) => /* @__PURE__ */ r(v.Chip, {
|
|
842
|
+
...we,
|
|
843
|
+
className: e("kb-multiselect-chip", j?.chip),
|
|
844
|
+
children: [/* @__PURE__ */ n("span", {
|
|
845
|
+
className: e("kb-multiselect-chip-label", j?.chipLabel),
|
|
846
|
+
children: t.label
|
|
847
|
+
}), /* @__PURE__ */ n(v.ChipRemove, {
|
|
848
|
+
"aria-label": E(t),
|
|
849
|
+
disabled: m || _,
|
|
850
|
+
className: e("kb-multiselect-chip-remove", j?.chipRemove),
|
|
851
|
+
children: /* @__PURE__ */ n("span", {
|
|
852
|
+
"aria-hidden": "true",
|
|
853
|
+
children: "×"
|
|
854
|
+
})
|
|
855
|
+
})]
|
|
856
|
+
}, t.value)), /* @__PURE__ */ n(v.Input, {
|
|
857
|
+
ref: R,
|
|
858
|
+
id: V,
|
|
859
|
+
placeholder: s,
|
|
860
|
+
"aria-labelledby": H,
|
|
861
|
+
"aria-invalid": q,
|
|
862
|
+
"aria-describedby": Y,
|
|
863
|
+
className: e("kb-multiselect-input", j?.input)
|
|
864
|
+
})]
|
|
865
|
+
}), /* @__PURE__ */ r("div", {
|
|
866
|
+
className: e("kb-multiselect-actions", j?.actions),
|
|
867
|
+
children: [/* @__PURE__ */ n(v.Clear, {
|
|
868
|
+
"aria-label": D ?? `Clear ${t}`,
|
|
869
|
+
disabled: m || _,
|
|
870
|
+
className: e("kb-multiselect-clear", j?.clear),
|
|
871
|
+
children: /* @__PURE__ */ n("span", {
|
|
872
|
+
"aria-hidden": "true",
|
|
873
|
+
children: "×"
|
|
874
|
+
})
|
|
875
|
+
}), /* @__PURE__ */ n(v.Trigger, {
|
|
876
|
+
"aria-label": O ?? `Toggle ${t} options`,
|
|
877
|
+
disabled: m,
|
|
878
|
+
className: e("kb-multiselect-trigger", j?.trigger),
|
|
879
|
+
children: /* @__PURE__ */ n("span", {
|
|
880
|
+
"aria-hidden": "true",
|
|
881
|
+
children: "▾"
|
|
882
|
+
})
|
|
883
|
+
})]
|
|
884
|
+
})]
|
|
885
|
+
}),
|
|
886
|
+
/* @__PURE__ */ n(v.Portal, {
|
|
887
|
+
container: k ?? B,
|
|
888
|
+
children: /* @__PURE__ */ n(v.Positioner, {
|
|
889
|
+
sideOffset: 6,
|
|
890
|
+
className: e("kb-multiselect-positioner", j?.positioner),
|
|
891
|
+
children: /* @__PURE__ */ r(v.Popup, {
|
|
892
|
+
className: e("kb-multiselect-popup", j?.popup),
|
|
893
|
+
children: [/* @__PURE__ */ n(v.List, {
|
|
894
|
+
"aria-labelledby": H,
|
|
895
|
+
className: e("kb-multiselect-list", j?.list),
|
|
896
|
+
children: (t) => /* @__PURE__ */ r(v.Item, {
|
|
897
|
+
value: t.value,
|
|
898
|
+
disabled: !!t.disabled,
|
|
899
|
+
className: e("kb-multiselect-option", j?.option),
|
|
900
|
+
children: [/* @__PURE__ */ n(v.ItemIndicator, {
|
|
901
|
+
keepMounted: !0,
|
|
902
|
+
className: e("kb-multiselect-option-indicator", j?.optionIndicator),
|
|
903
|
+
children: "✓"
|
|
904
|
+
}), /* @__PURE__ */ n("span", {
|
|
905
|
+
className: e("kb-multiselect-option-label", j?.optionLabel),
|
|
906
|
+
children: t.label
|
|
907
|
+
})]
|
|
908
|
+
}, t.value)
|
|
909
|
+
}), /* @__PURE__ */ n(v.Empty, {
|
|
910
|
+
className: e("kb-multiselect-empty", j?.empty),
|
|
911
|
+
children: c
|
|
912
|
+
})]
|
|
913
|
+
})
|
|
914
|
+
})
|
|
915
|
+
}),
|
|
916
|
+
J && /* @__PURE__ */ n("p", {
|
|
917
|
+
id: U,
|
|
918
|
+
className: e("kb-multiselect-description", j?.description),
|
|
919
|
+
children: u
|
|
920
|
+
}),
|
|
921
|
+
G && /* @__PURE__ */ n("p", {
|
|
922
|
+
id: W,
|
|
923
|
+
className: e("kb-multiselect-error", j?.error),
|
|
924
|
+
children: d
|
|
925
|
+
})
|
|
926
|
+
]
|
|
927
|
+
})
|
|
928
|
+
});
|
|
929
|
+
});
|
|
930
|
+
//#endregion
|
|
931
|
+
//#region src/components/NumberField/NumberField.tsx
|
|
932
|
+
function Ee({ classNames: t, label: i, value: a, onValueChange: o, min: s, max: c, step: l = 1, locale: u, name: d, form: p, required: m, disabled: h = !1, readOnly: g = !1, visuallyHidden: _, description: v, error: y, size: b = "md", inputClassName: x, groupClassName: S, inputRef: C, inputProps: T, decrementLabel: E = `Decrease ${i}`, incrementLabel: D = `Increase ${i}`, className: O, "aria-describedby": k, "aria-invalid": A, ...j }) {
|
|
933
|
+
let M = f(), { invalid: F, ariaInvalid: I } = P(!!y, T?.["aria-invalid"] ?? A), L = [
|
|
934
|
+
v ? `${M}-description` : null,
|
|
935
|
+
y ? `${M}-error` : null,
|
|
936
|
+
k,
|
|
937
|
+
T?.["aria-describedby"]
|
|
938
|
+
].filter(Boolean).join(" ") || void 0;
|
|
939
|
+
return /* @__PURE__ */ r("div", {
|
|
940
|
+
...j,
|
|
941
|
+
...N("numberfield", {
|
|
942
|
+
size: b,
|
|
943
|
+
disabled: h,
|
|
944
|
+
readonly: g,
|
|
945
|
+
invalid: F
|
|
946
|
+
}, O),
|
|
947
|
+
children: [
|
|
948
|
+
/* @__PURE__ */ n("label", {
|
|
949
|
+
htmlFor: M,
|
|
950
|
+
className: e("kb-numberfield-label", t?.label, _ && "kb-sr-only"),
|
|
951
|
+
children: i
|
|
952
|
+
}),
|
|
953
|
+
/* @__PURE__ */ n(w.Root, {
|
|
954
|
+
id: M,
|
|
955
|
+
value: a,
|
|
956
|
+
onValueChange: (e) => {
|
|
957
|
+
!h && !g && o(e);
|
|
958
|
+
},
|
|
959
|
+
min: s,
|
|
960
|
+
max: c,
|
|
961
|
+
step: l,
|
|
962
|
+
smallStep: l,
|
|
963
|
+
largeStep: l * 10,
|
|
964
|
+
locale: u,
|
|
965
|
+
name: d,
|
|
966
|
+
form: p,
|
|
967
|
+
required: m,
|
|
968
|
+
disabled: h,
|
|
969
|
+
readOnly: g,
|
|
970
|
+
snapOnStep: !0,
|
|
971
|
+
allowOutOfRange: !0,
|
|
972
|
+
allowWheelScrub: !1,
|
|
973
|
+
className: e("kb-numberfield-editor", t?.editor),
|
|
974
|
+
children: /* @__PURE__ */ r(w.Group, {
|
|
975
|
+
className: e("kb-numberfield-group", t?.group, S),
|
|
976
|
+
children: [
|
|
977
|
+
/* @__PURE__ */ n(w.Decrement, {
|
|
978
|
+
"aria-label": E,
|
|
979
|
+
className: e("kb-numberfield-decrement", t?.decrement),
|
|
980
|
+
children: "−"
|
|
981
|
+
}),
|
|
982
|
+
/* @__PURE__ */ n(w.Input, {
|
|
983
|
+
...T,
|
|
984
|
+
ref: C,
|
|
985
|
+
"aria-describedby": L,
|
|
986
|
+
"aria-invalid": I,
|
|
987
|
+
className: e("kb-numberfield-input", t?.input, x)
|
|
988
|
+
}),
|
|
989
|
+
/* @__PURE__ */ n(w.Increment, {
|
|
990
|
+
"aria-label": D,
|
|
991
|
+
className: e("kb-numberfield-increment", t?.increment),
|
|
992
|
+
children: "+"
|
|
993
|
+
})
|
|
994
|
+
]
|
|
995
|
+
})
|
|
996
|
+
}),
|
|
997
|
+
v && /* @__PURE__ */ n("p", {
|
|
998
|
+
id: `${M}-description`,
|
|
999
|
+
className: e("kb-numberfield-description", t?.description),
|
|
1000
|
+
children: v
|
|
1001
|
+
}),
|
|
1002
|
+
y && /* @__PURE__ */ n("p", {
|
|
1003
|
+
id: `${M}-error`,
|
|
1004
|
+
className: e("kb-numberfield-error", t?.error),
|
|
1005
|
+
children: y
|
|
1006
|
+
})
|
|
1007
|
+
]
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
//#endregion
|
|
1011
|
+
//#region src/components/Panel/Panel.tsx
|
|
1012
|
+
var De = o(!1), Oe = o(!1), ke = o("column"), $ = (e) => e?.previousElementSibling;
|
|
1013
|
+
function Ae({ tone: e = "default", rail: t = "none", density: i = "standard", collapsible: a = !1, open: o, defaultOpen: s, onOpenChange: c, className: l, children: d, ref: f, ...p }) {
|
|
1014
|
+
let m = N("panel", {
|
|
1015
|
+
tone: e,
|
|
1016
|
+
rail: t,
|
|
1017
|
+
density: i,
|
|
1018
|
+
nested: u(De),
|
|
1019
|
+
collapsible: a
|
|
1020
|
+
}, l), h = /* @__PURE__ */ n(De, {
|
|
1021
|
+
value: !0,
|
|
1022
|
+
children: /* @__PURE__ */ r(Oe, {
|
|
1023
|
+
value: a,
|
|
1024
|
+
children: [
|
|
1025
|
+
/* @__PURE__ */ n("span", {
|
|
1026
|
+
className: "kb-panel-glow",
|
|
1027
|
+
"aria-hidden": "true"
|
|
1028
|
+
}),
|
|
1029
|
+
/* @__PURE__ */ n("span", {
|
|
1030
|
+
className: "kb-panel-plate",
|
|
1031
|
+
"aria-hidden": "true",
|
|
1032
|
+
children: t === "none" ? null : /* @__PURE__ */ n("span", { className: "kb-panel-rail" })
|
|
1033
|
+
}),
|
|
1034
|
+
d
|
|
1035
|
+
]
|
|
1036
|
+
})
|
|
1037
|
+
});
|
|
1038
|
+
return a ? /* @__PURE__ */ n(T.Root, {
|
|
1039
|
+
...p,
|
|
1040
|
+
ref: f,
|
|
1041
|
+
...o === void 0 ? {} : { open: o },
|
|
1042
|
+
...s === void 0 ? {} : { defaultOpen: s },
|
|
1043
|
+
...c ? { onOpenChange: (e) => c(e) } : {},
|
|
1044
|
+
render: /* @__PURE__ */ n("section", {}),
|
|
1045
|
+
...m,
|
|
1046
|
+
children: h
|
|
1047
|
+
}) : /* @__PURE__ */ n("section", {
|
|
1048
|
+
...p,
|
|
1049
|
+
ref: f,
|
|
1050
|
+
...m,
|
|
1051
|
+
children: h
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
function je({ className: t, ...r }) {
|
|
1055
|
+
return /* @__PURE__ */ n("header", {
|
|
1056
|
+
...r,
|
|
1057
|
+
className: e("kb-panel-header", t)
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
function Me({ className: t, ...r }) {
|
|
1061
|
+
return /* @__PURE__ */ n("div", {
|
|
1062
|
+
...r,
|
|
1063
|
+
className: e("kb-panel-toolbar", t)
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
function Ne({ className: t, ...r }) {
|
|
1067
|
+
let i = u(Oe), a = e("kb-panel-body", t);
|
|
1068
|
+
return n(i ? T.Panel : "div", {
|
|
1069
|
+
...r,
|
|
1070
|
+
className: a
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
function Pe({ className: t, ...r }) {
|
|
1074
|
+
return /* @__PURE__ */ n("footer", {
|
|
1075
|
+
...r,
|
|
1076
|
+
className: e("kb-panel-footer", t)
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
function Fe({ className: t, ...r }) {
|
|
1080
|
+
return /* @__PURE__ */ n("div", {
|
|
1081
|
+
...r,
|
|
1082
|
+
className: e("kb-panel-well", t)
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
function Ie({ className: t, ...r }) {
|
|
1086
|
+
return /* @__PURE__ */ n(T.Trigger, {
|
|
1087
|
+
...r,
|
|
1088
|
+
className: e("kb-panel-toggle", t)
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
function Le({ direction: e = "column", className: t, ...r }) {
|
|
1092
|
+
return /* @__PURE__ */ n(ke, {
|
|
1093
|
+
value: e,
|
|
1094
|
+
children: /* @__PURE__ */ n("div", {
|
|
1095
|
+
...r,
|
|
1096
|
+
...N("panel-group", { direction: e }, t)
|
|
1097
|
+
})
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
function Re({ size: e, defaultSize: t = 50, min: r = 10, max: i = 90, step: a = 5, onSizeChange: o, className: s, ref: c, onKeyDown: l, onPointerDown: d, onPointerMove: p, onPointerUp: h, onPointerCancel: v, ...y }) {
|
|
1101
|
+
let b = u(ke) === "row", x = (e) => Math.min(i, Math.max(r, e)), [S, C] = _(t), w = x(e ?? S), [T, E] = _(), [D, O] = _(!1), k = g(w), A = g(null), j = f();
|
|
1102
|
+
m(() => {
|
|
1103
|
+
let e = $(A.current);
|
|
1104
|
+
e && (e.id ||= j, E(e.id));
|
|
1105
|
+
}, [j]), m(() => {
|
|
1106
|
+
$(A.current)?.style.setProperty("--kb-panel-size", `${w}%`);
|
|
1107
|
+
}, [w]);
|
|
1108
|
+
let M = (t) => {
|
|
1109
|
+
let n = x(t);
|
|
1110
|
+
n !== w && (e === void 0 && C(n), o?.(n));
|
|
1111
|
+
}, P = {
|
|
1112
|
+
[b ? "ArrowLeft" : "ArrowUp"]: () => w - a,
|
|
1113
|
+
[b ? "ArrowRight" : "ArrowDown"]: () => w + a,
|
|
1114
|
+
Home: () => r,
|
|
1115
|
+
End: () => i,
|
|
1116
|
+
Enter: () => w > r ? (k.current = w, r) : k.current
|
|
1117
|
+
}, F = (e) => {
|
|
1118
|
+
l?.(e);
|
|
1119
|
+
let t = P[e.key];
|
|
1120
|
+
!e.defaultPrevented && t && (e.preventDefault(), M(t()));
|
|
1121
|
+
}, I = (e) => {
|
|
1122
|
+
d?.(e), !(e.defaultPrevented || e.button !== 0) && (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId), O(!0));
|
|
1123
|
+
}, L = (e) => {
|
|
1124
|
+
p?.(e);
|
|
1125
|
+
let t = A.current?.parentElement?.getBoundingClientRect(), n = $(A.current)?.getBoundingClientRect();
|
|
1126
|
+
if (!D || !t || !n) return;
|
|
1127
|
+
let r = b ? e.clientX - n.left : e.clientY - n.top, i = b ? t.width : t.height;
|
|
1128
|
+
i > 0 && M(Math.round(r / i * 1e3) / 10);
|
|
1129
|
+
}, R = (e) => {
|
|
1130
|
+
e.currentTarget.releasePointerCapture?.(e.pointerId), O(!1);
|
|
1131
|
+
};
|
|
1132
|
+
return /* @__PURE__ */ n("div", {
|
|
1133
|
+
...y,
|
|
1134
|
+
ref: (e) => {
|
|
1135
|
+
if (A.current = e, typeof c == "function") return c(e);
|
|
1136
|
+
c && (c.current = e);
|
|
1137
|
+
},
|
|
1138
|
+
role: "separator",
|
|
1139
|
+
tabIndex: 0,
|
|
1140
|
+
"aria-orientation": b ? "vertical" : "horizontal",
|
|
1141
|
+
"aria-valuenow": w,
|
|
1142
|
+
"aria-valuemin": r,
|
|
1143
|
+
"aria-valuemax": i,
|
|
1144
|
+
"aria-controls": T,
|
|
1145
|
+
onKeyDown: F,
|
|
1146
|
+
onPointerDown: I,
|
|
1147
|
+
onPointerMove: L,
|
|
1148
|
+
onPointerUp: (e) => {
|
|
1149
|
+
h?.(e), R(e);
|
|
1150
|
+
},
|
|
1151
|
+
onPointerCancel: (e) => {
|
|
1152
|
+
v?.(e), R(e);
|
|
1153
|
+
},
|
|
1154
|
+
...N("panel-handle", {
|
|
1155
|
+
orientation: b ? "vertical" : "horizontal",
|
|
1156
|
+
dragging: D
|
|
1157
|
+
}, s)
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
var ze = Object.assign(Ae, {
|
|
1161
|
+
Header: je,
|
|
1162
|
+
Toolbar: Me,
|
|
1163
|
+
Body: Ne,
|
|
1164
|
+
Footer: Pe,
|
|
1165
|
+
Well: Fe,
|
|
1166
|
+
Toggle: Ie,
|
|
1167
|
+
Group: Le,
|
|
1168
|
+
Handle: Re
|
|
1169
|
+
});
|
|
1170
|
+
//#endregion
|
|
1171
|
+
//#region src/components/Progress/Progress.tsx
|
|
1172
|
+
function Be({ classNames: t, label: i, value: a, valueText: o, className: s, ...c }) {
|
|
1173
|
+
return /* @__PURE__ */ r(E.Root, {
|
|
1174
|
+
...c,
|
|
1175
|
+
value: a,
|
|
1176
|
+
...o ? { getAriaValueText: () => o } : {},
|
|
1177
|
+
...N("progress", {}, s),
|
|
1178
|
+
children: [/* @__PURE__ */ r("div", {
|
|
1179
|
+
className: e("kb-progress-head", t?.head),
|
|
1180
|
+
children: [/* @__PURE__ */ n(E.Label, {
|
|
1181
|
+
className: e("kb-progress-label", t?.label),
|
|
1182
|
+
children: i
|
|
1183
|
+
}), /* @__PURE__ */ n(E.Value, {
|
|
1184
|
+
className: e("kb-progress-value", t?.value),
|
|
1185
|
+
children: (e) => o ?? e
|
|
1186
|
+
})]
|
|
1187
|
+
}), /* @__PURE__ */ n(E.Track, {
|
|
1188
|
+
className: e("kb-progress-track", t?.track),
|
|
1189
|
+
children: /* @__PURE__ */ n(E.Indicator, { className: e("kb-progress-indicator", t?.indicator) })
|
|
1190
|
+
})]
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
//#endregion
|
|
1194
|
+
//#region src/components/RadioGroup/RadioGroup.tsx
|
|
1195
|
+
var Ve = o(null);
|
|
1196
|
+
function He({ segmented: t, className: i, children: a }) {
|
|
1197
|
+
let o = g(null), [s, c] = _(null);
|
|
1198
|
+
return m(() => {
|
|
1199
|
+
let e = o.current;
|
|
1200
|
+
if (!e || !t) {
|
|
1201
|
+
c(null);
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1204
|
+
let n = () => {
|
|
1205
|
+
let t = e.querySelector(".kb-radiogroup-control[data-checked]"), n = t?.closest(".kb-radiogroup-item"), r = n && n.offsetWidth > 0 && n.offsetHeight > 0 ? {
|
|
1206
|
+
x: n.offsetLeft,
|
|
1207
|
+
y: n.offsetTop,
|
|
1208
|
+
width: n.offsetWidth,
|
|
1209
|
+
height: n.offsetHeight,
|
|
1210
|
+
disabled: t?.hasAttribute("data-disabled") ?? !1
|
|
1211
|
+
} : null;
|
|
1212
|
+
c((e) => e?.x === r?.x && e?.y === r?.y && e?.width === r?.width && e?.height === r?.height && e?.disabled === r?.disabled ? e : r);
|
|
1213
|
+
}, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(n), i = () => {
|
|
1214
|
+
r?.disconnect(), r?.observe(e);
|
|
1215
|
+
for (let t of e.querySelectorAll(".kb-radiogroup-item")) r?.observe(t);
|
|
1216
|
+
n();
|
|
1217
|
+
}, a = new MutationObserver(i);
|
|
1218
|
+
return a.observe(e, {
|
|
1219
|
+
subtree: !0,
|
|
1220
|
+
childList: !0,
|
|
1221
|
+
attributes: !0,
|
|
1222
|
+
attributeFilter: ["data-checked", "data-disabled"]
|
|
1223
|
+
}), i(), () => {
|
|
1224
|
+
r?.disconnect(), a.disconnect();
|
|
1225
|
+
};
|
|
1226
|
+
}, [t]), /* @__PURE__ */ r("div", {
|
|
1227
|
+
ref: o,
|
|
1228
|
+
className: e("kb-radiogroup-options", i),
|
|
1229
|
+
"data-selection": t && s ? "" : void 0,
|
|
1230
|
+
children: [t && s && /* @__PURE__ */ n("span", {
|
|
1231
|
+
"aria-hidden": "true",
|
|
1232
|
+
className: "kb-radiogroup-selection",
|
|
1233
|
+
"data-disabled": s.disabled ? "" : void 0,
|
|
1234
|
+
style: {
|
|
1235
|
+
width: s.width,
|
|
1236
|
+
height: s.height,
|
|
1237
|
+
transform: `translate(${s.x}px, ${s.y}px)`
|
|
1238
|
+
}
|
|
1239
|
+
}), a]
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
function Ue({ checked: e, disabled: t, customTabIndex: r, ...i }) {
|
|
1243
|
+
let a = u(Ve), o = a?.update, s = a?.remove, c = f(), l = !t && (r === void 0 || r >= 0);
|
|
1244
|
+
m(() => () => {
|
|
1245
|
+
s?.(c);
|
|
1246
|
+
}, [s, c]), m(() => {
|
|
1247
|
+
o?.(c, {
|
|
1248
|
+
checked: e,
|
|
1249
|
+
eligible: l,
|
|
1250
|
+
tabIndex: i.tabIndex
|
|
1251
|
+
});
|
|
1252
|
+
}, [
|
|
1253
|
+
o,
|
|
1254
|
+
c,
|
|
1255
|
+
e,
|
|
1256
|
+
l,
|
|
1257
|
+
i.tabIndex
|
|
1258
|
+
]);
|
|
1259
|
+
let d = t ? -1 : r ?? (a && !a.inside && a.target !== null ? a.target === c ? 0 : -1 : i.tabIndex);
|
|
1260
|
+
return /* @__PURE__ */ n("span", {
|
|
1261
|
+
...i,
|
|
1262
|
+
tabIndex: d,
|
|
1263
|
+
onFocus: (e) => {
|
|
1264
|
+
a?.markFocused(c), i.onFocus?.(e);
|
|
1265
|
+
}
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
function We({ classNames: t, label: i, value: a, onValueChange: o, disabled: s = !1, appearance: c = "standard", selectionMotion: u = "slide", selectionTone: d = "primary", name: p, description: m, error: h, visuallyHidden: v, className: y, children: b, onFocusCapture: x, onBlurCapture: S, "aria-invalid": C, ...w }) {
|
|
1269
|
+
let T = f(), { invalid: E, ariaInvalid: D } = P(!!h, C), k = g(null), [A, j] = _(!1), M = l((e) => {
|
|
1270
|
+
k.current = e;
|
|
1271
|
+
}, []), [F, I] = _(() => /* @__PURE__ */ new Map()), L = l((e, t) => {
|
|
1272
|
+
I((n) => {
|
|
1273
|
+
let r = n.get(e);
|
|
1274
|
+
return r && r.checked === t.checked && r.eligible === t.eligible && r.tabIndex === t.tabIndex ? n : new Map(n).set(e, t);
|
|
1275
|
+
});
|
|
1276
|
+
}, []), R = l((e) => {
|
|
1277
|
+
k.current === e && (k.current = null, j(!1)), I((t) => {
|
|
1278
|
+
if (!t.has(e)) return t;
|
|
1279
|
+
let n = new Map(t);
|
|
1280
|
+
return n.delete(e), n;
|
|
1281
|
+
});
|
|
1282
|
+
}, []), z = [...F].filter(([, e]) => e.eligible), B = (z.find(([, e]) => e.checked) ?? z.find(([, e]) => e.tabIndex === 0) ?? z[0])?.[0] ?? null, V = [
|
|
1283
|
+
m ? `${T}-description` : null,
|
|
1284
|
+
h ? `${T}-error` : null,
|
|
1285
|
+
w["aria-describedby"]
|
|
1286
|
+
].filter(Boolean).join(" ") || void 0;
|
|
1287
|
+
return /* @__PURE__ */ n(Ve.Provider, {
|
|
1288
|
+
value: {
|
|
1289
|
+
target: B,
|
|
1290
|
+
update: L,
|
|
1291
|
+
remove: R,
|
|
1292
|
+
markFocused: M,
|
|
1293
|
+
inside: A
|
|
1294
|
+
},
|
|
1295
|
+
children: /* @__PURE__ */ r(O, {
|
|
1296
|
+
...w,
|
|
1297
|
+
value: a,
|
|
1298
|
+
onFocusCapture: (e) => {
|
|
1299
|
+
j(!0), x?.(e);
|
|
1300
|
+
},
|
|
1301
|
+
onBlurCapture: (e) => {
|
|
1302
|
+
e.currentTarget.contains(e.relatedTarget) || (k.current = null, j(!1)), S?.(e);
|
|
1303
|
+
},
|
|
1304
|
+
onValueChange: (e) => {
|
|
1305
|
+
e !== null && !s && o(e);
|
|
1306
|
+
},
|
|
1307
|
+
disabled: s,
|
|
1308
|
+
...p ? { name: p } : {},
|
|
1309
|
+
...N("radiogroup", {
|
|
1310
|
+
invalid: E,
|
|
1311
|
+
disabled: s,
|
|
1312
|
+
appearance: c,
|
|
1313
|
+
"selection-motion": u,
|
|
1314
|
+
"selection-tone": d
|
|
1315
|
+
}, y),
|
|
1316
|
+
"aria-labelledby": `${T}-label`,
|
|
1317
|
+
"aria-describedby": V,
|
|
1318
|
+
"aria-invalid": D,
|
|
1319
|
+
children: [
|
|
1320
|
+
/* @__PURE__ */ n("div", {
|
|
1321
|
+
className: e("kb-radiogroup-label", t?.label, v && "kb-sr-only"),
|
|
1322
|
+
id: `${T}-label`,
|
|
1323
|
+
children: i
|
|
1324
|
+
}),
|
|
1325
|
+
/* @__PURE__ */ n(He, {
|
|
1326
|
+
segmented: c === "segmented",
|
|
1327
|
+
className: t?.options,
|
|
1328
|
+
children: b
|
|
1329
|
+
}),
|
|
1330
|
+
m && /* @__PURE__ */ n("p", {
|
|
1331
|
+
id: `${T}-description`,
|
|
1332
|
+
className: e("kb-radiogroup-description", t?.description),
|
|
1333
|
+
children: m
|
|
1334
|
+
}),
|
|
1335
|
+
h && /* @__PURE__ */ n("p", {
|
|
1336
|
+
id: `${T}-error`,
|
|
1337
|
+
className: e("kb-radiogroup-error", t?.error),
|
|
1338
|
+
children: h
|
|
1339
|
+
})
|
|
1340
|
+
]
|
|
1341
|
+
})
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
function Ge({ classNames: t, className: i, children: a, controlClassName: o, ...s }) {
|
|
1345
|
+
return /* @__PURE__ */ r("label", {
|
|
1346
|
+
className: e("kb-radiogroup-item", t?.item, i),
|
|
1347
|
+
children: [/* @__PURE__ */ n(D.Root, {
|
|
1348
|
+
...s,
|
|
1349
|
+
className: e("kb-radiogroup-control", t?.control, o),
|
|
1350
|
+
render: (e, t) => /* @__PURE__ */ n(Ue, {
|
|
1351
|
+
...e,
|
|
1352
|
+
checked: t.checked,
|
|
1353
|
+
disabled: t.disabled,
|
|
1354
|
+
customTabIndex: s.tabIndex
|
|
1355
|
+
}),
|
|
1356
|
+
children: /* @__PURE__ */ n(D.Indicator, { className: e("kb-radiogroup-indicator", t?.indicator) })
|
|
1357
|
+
}), /* @__PURE__ */ n("span", {
|
|
1358
|
+
className: e("kb-radiogroup-content", t?.content),
|
|
1359
|
+
children: a
|
|
1360
|
+
})]
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
var Ke = Object.assign(We, { Item: Ge });
|
|
1364
|
+
//#endregion
|
|
1365
|
+
//#region src/components/ScrollArea/ScrollArea.tsx
|
|
1366
|
+
function qe({ classNames: t, label: i, maxHeight: a, className: o, style: s, children: c, ...l }) {
|
|
1367
|
+
let u = a ? { "--_scrollarea-max-height": a } : {};
|
|
1368
|
+
return /* @__PURE__ */ r(k.Root, {
|
|
1369
|
+
...l,
|
|
1370
|
+
style: {
|
|
1371
|
+
...u,
|
|
1372
|
+
...typeof s == "object" ? s : {}
|
|
1373
|
+
},
|
|
1374
|
+
...N("scrollarea", {}, o),
|
|
1375
|
+
children: [/* @__PURE__ */ n(k.Viewport, {
|
|
1376
|
+
className: e("kb-scrollarea-viewport", t?.viewport),
|
|
1377
|
+
tabIndex: 0,
|
|
1378
|
+
role: "region",
|
|
1379
|
+
"aria-label": i,
|
|
1380
|
+
children: /* @__PURE__ */ n(k.Content, { children: c })
|
|
1381
|
+
}), /* @__PURE__ */ n(k.Scrollbar, {
|
|
1382
|
+
className: e("kb-scrollarea-scrollbar", t?.scrollbar),
|
|
1383
|
+
orientation: "vertical",
|
|
1384
|
+
children: /* @__PURE__ */ n(k.Thumb, { className: e("kb-scrollarea-thumb", t?.thumb) })
|
|
1385
|
+
})]
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
//#endregion
|
|
1389
|
+
//#region src/components/Select/Select.tsx
|
|
1390
|
+
function Je({ classNames: t, label: i, value: a, onValueChange: o, options: s, placeholder: c = "Choose an option", description: l, error: u, disabled: d = !1, readOnly: m = !1, name: h, className: v, controlClassName: y, popupClassName: b, container: x, ref: S, "aria-describedby": C, "aria-invalid": w, ...T }) {
|
|
1391
|
+
let E = f(), D = g(null), O = g(null), k = g(null), j = g("keyboard"), [M, F] = _(!1);
|
|
1392
|
+
p(S, () => D.current);
|
|
1393
|
+
let { invalid: I, ariaInvalid: L } = P(!!u, w), R = s.length === 0, z = d || R, B = [l, R && "No options available"].filter(Boolean).join(" ") || void 0, V = [
|
|
1394
|
+
B ? `${E}-description` : null,
|
|
1395
|
+
u ? `${E}-error` : null,
|
|
1396
|
+
C
|
|
1397
|
+
].filter(Boolean).join(" ") || void 0;
|
|
1398
|
+
return /* @__PURE__ */ r("div", {
|
|
1399
|
+
...T,
|
|
1400
|
+
ref: D,
|
|
1401
|
+
...N("select", {
|
|
1402
|
+
disabled: z,
|
|
1403
|
+
invalid: I
|
|
1404
|
+
}, v),
|
|
1405
|
+
children: [
|
|
1406
|
+
/* @__PURE__ */ r(A.Root, {
|
|
1407
|
+
modal: !1,
|
|
1408
|
+
items: s,
|
|
1409
|
+
value: a,
|
|
1410
|
+
onValueChange: (e) => {
|
|
1411
|
+
!z && !m && (e === null || s.some((t) => t.value === e && !t.disabled)) && o(e);
|
|
1412
|
+
},
|
|
1413
|
+
disabled: z,
|
|
1414
|
+
readOnly: m,
|
|
1415
|
+
onOpenChange: (e, t) => {
|
|
1416
|
+
t.event.type.startsWith("key") ? j.current = "keyboard" : /^(pointer|mouse)/.test(t.event.type) && (j.current = "pointer");
|
|
1417
|
+
},
|
|
1418
|
+
...h ? { name: h } : {},
|
|
1419
|
+
children: [
|
|
1420
|
+
/* @__PURE__ */ n(A.Label, {
|
|
1421
|
+
className: e("kb-select-label", t?.label),
|
|
1422
|
+
children: i
|
|
1423
|
+
}),
|
|
1424
|
+
/* @__PURE__ */ r(A.Trigger, {
|
|
1425
|
+
ref: O,
|
|
1426
|
+
className: e("kb-select-control", t?.control, y),
|
|
1427
|
+
"aria-describedby": V,
|
|
1428
|
+
"aria-invalid": L,
|
|
1429
|
+
"data-pointer-focus": M || void 0,
|
|
1430
|
+
onPointerDown: () => {
|
|
1431
|
+
j.current = "pointer", F(!0);
|
|
1432
|
+
},
|
|
1433
|
+
onKeyDown: () => {
|
|
1434
|
+
j.current = "keyboard", F(!1);
|
|
1435
|
+
},
|
|
1436
|
+
onBlur: () => F(!1),
|
|
1437
|
+
children: [/* @__PURE__ */ n(A.Value, { placeholder: c }), /* @__PURE__ */ n(A.Icon, {
|
|
1438
|
+
className: e("kb-select-icon", t?.icon),
|
|
1439
|
+
"aria-hidden": "true",
|
|
1440
|
+
children: /* @__PURE__ */ n("svg", {
|
|
1441
|
+
width: "16",
|
|
1442
|
+
height: "16",
|
|
1443
|
+
viewBox: "0 0 16 16",
|
|
1444
|
+
fill: "none",
|
|
1445
|
+
"aria-hidden": "true",
|
|
1446
|
+
children: /* @__PURE__ */ n("path", {
|
|
1447
|
+
d: "m4 6 4 4 4-4",
|
|
1448
|
+
stroke: "currentColor",
|
|
1449
|
+
strokeWidth: "1.5"
|
|
1450
|
+
})
|
|
1451
|
+
})
|
|
1452
|
+
})]
|
|
1453
|
+
}),
|
|
1454
|
+
/* @__PURE__ */ n(A.Portal, {
|
|
1455
|
+
container: x ?? D,
|
|
1456
|
+
className: e("kb-select-portal", t?.portal),
|
|
1457
|
+
children: /* @__PURE__ */ n(A.Positioner, {
|
|
1458
|
+
className: e("kb-select-positioner", t?.positioner),
|
|
1459
|
+
sideOffset: 6,
|
|
1460
|
+
alignItemWithTrigger: !1,
|
|
1461
|
+
children: /* @__PURE__ */ n(A.Popup, {
|
|
1462
|
+
ref: k,
|
|
1463
|
+
className: e("kb-select-popup", t?.popup, b),
|
|
1464
|
+
onPointerDownCapture: () => {
|
|
1465
|
+
j.current = "pointer";
|
|
1466
|
+
},
|
|
1467
|
+
onKeyDownCapture: () => {
|
|
1468
|
+
j.current = "keyboard";
|
|
1469
|
+
},
|
|
1470
|
+
finalFocus: () => {
|
|
1471
|
+
let e = document.activeElement;
|
|
1472
|
+
return e instanceof HTMLElement && e !== document.body && e !== O.current && !k.current?.contains(e) && !e.hasAttribute("data-base-ui-focus-guard") ? (F(!1), !1) : (F(j.current === "pointer"), !0);
|
|
1473
|
+
},
|
|
1474
|
+
children: /* @__PURE__ */ n(A.List, {
|
|
1475
|
+
className: e("kb-select-list", t?.list),
|
|
1476
|
+
"aria-label": i,
|
|
1477
|
+
children: s.length ? s.map((i) => /* @__PURE__ */ r(A.Item, {
|
|
1478
|
+
value: i.value,
|
|
1479
|
+
disabled: !!i.disabled,
|
|
1480
|
+
className: e("kb-select-item", t?.item),
|
|
1481
|
+
children: [/* @__PURE__ */ n(A.ItemText, { children: i.label }), /* @__PURE__ */ n(A.ItemIndicator, {
|
|
1482
|
+
className: e("kb-select-indicator", t?.indicator),
|
|
1483
|
+
"aria-hidden": "true",
|
|
1484
|
+
children: "✓"
|
|
1485
|
+
})]
|
|
1486
|
+
}, i.value)) : /* @__PURE__ */ n(A.Item, {
|
|
1487
|
+
value: "",
|
|
1488
|
+
disabled: !0,
|
|
1489
|
+
className: e("kb-select-item kb-select-empty", t?.item, t?.empty),
|
|
1490
|
+
children: /* @__PURE__ */ n(A.ItemText, { children: "No options available" })
|
|
1491
|
+
})
|
|
1492
|
+
})
|
|
1493
|
+
})
|
|
1494
|
+
})
|
|
1495
|
+
})
|
|
1496
|
+
]
|
|
1497
|
+
}),
|
|
1498
|
+
B && /* @__PURE__ */ n("p", {
|
|
1499
|
+
className: e("kb-select-description", t?.description),
|
|
1500
|
+
id: `${E}-description`,
|
|
1501
|
+
children: B
|
|
1502
|
+
}),
|
|
1503
|
+
u && /* @__PURE__ */ n("p", {
|
|
1504
|
+
className: e("kb-select-error", t?.error),
|
|
1505
|
+
id: `${E}-error`,
|
|
1506
|
+
children: u
|
|
1507
|
+
})
|
|
1508
|
+
]
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
//#endregion
|
|
1512
|
+
//#region src/components/Separator/Separator.tsx
|
|
1513
|
+
function Ye({ orientation: e = "horizontal", decorative: t = !1, className: r, ...i }) {
|
|
1514
|
+
return /* @__PURE__ */ n("hr", {
|
|
1515
|
+
...i,
|
|
1516
|
+
...N("separator", { orientation: e }, r),
|
|
1517
|
+
role: t ? "none" : void 0,
|
|
1518
|
+
"aria-hidden": t ? !0 : void 0,
|
|
1519
|
+
"aria-orientation": t ? void 0 : e
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
//#endregion
|
|
1523
|
+
//#region src/components/Split/Split.tsx
|
|
1524
|
+
function Xe({ as: t, ratio: r = "equal", collapse: i = "md", gap: o = "md", align: c = "stretch", className: l, classNames: u, children: d, ...f }) {
|
|
1525
|
+
let p = e("kb-split-track", u?.track);
|
|
1526
|
+
return s(t ?? "div", {
|
|
1527
|
+
...f,
|
|
1528
|
+
...N("split", {
|
|
1529
|
+
ratio: r,
|
|
1530
|
+
collapse: i,
|
|
1531
|
+
gap: o,
|
|
1532
|
+
align: c
|
|
1533
|
+
}, l)
|
|
1534
|
+
}, a.map(d, (e) => e == null ? null : /* @__PURE__ */ n("div", {
|
|
1535
|
+
className: p,
|
|
1536
|
+
children: e
|
|
1537
|
+
})));
|
|
1538
|
+
}
|
|
1539
|
+
//#endregion
|
|
1540
|
+
//#region src/components/Stat/Stat.tsx
|
|
1541
|
+
function Ze({ classNames: t, label: i, value: a, size: o = "md", className: s, ...c }) {
|
|
1542
|
+
return /* @__PURE__ */ r("div", {
|
|
1543
|
+
...c,
|
|
1544
|
+
...N("stat", { size: o }, s),
|
|
1545
|
+
children: [/* @__PURE__ */ n("span", {
|
|
1546
|
+
className: e("kb-stat-label", t?.label),
|
|
1547
|
+
children: i
|
|
1548
|
+
}), /* @__PURE__ */ n("span", {
|
|
1549
|
+
className: e("kb-stat-value", t?.value),
|
|
1550
|
+
children: a
|
|
1551
|
+
})]
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
//#endregion
|
|
1555
|
+
//#region src/components/Status/Status.tsx
|
|
1556
|
+
function Qe({ classNames: t, tone: i = "neutral", appearance: a = "plain", icon: o, live: s = !1, compact: c = !1, className: l, children: u, ...d }) {
|
|
1557
|
+
return /* @__PURE__ */ r("span", {
|
|
1558
|
+
...d,
|
|
1559
|
+
...s ? { role: "status" } : {},
|
|
1560
|
+
...N("status", {
|
|
1561
|
+
tone: i,
|
|
1562
|
+
appearance: a,
|
|
1563
|
+
compact: c
|
|
1564
|
+
}, l),
|
|
1565
|
+
children: [o == null ? null : /* @__PURE__ */ n("span", {
|
|
1566
|
+
className: e("kb-status-icon", t?.icon),
|
|
1567
|
+
"aria-hidden": "true",
|
|
1568
|
+
children: o
|
|
1569
|
+
}), /* @__PURE__ */ n("span", {
|
|
1570
|
+
className: e("kb-status-text", t?.text),
|
|
1571
|
+
children: u
|
|
1572
|
+
})]
|
|
1573
|
+
});
|
|
1574
|
+
}
|
|
1575
|
+
//#endregion
|
|
1576
|
+
//#region src/components/Switch/Switch.tsx
|
|
1577
|
+
function $e({ classNames: t, label: i, checked: a, onCheckedChange: o, size: s, tone: c, offTone: l, onTone: u, offColor: d, onColor: p, description: m, error: h, visuallyHidden: g, offIcon: _, onIcon: v, controlClassName: y, className: b, style: x, id: S, disabled: C, readOnly: w, "aria-describedby": T, "aria-invalid": E, ...D }) {
|
|
1578
|
+
let O = {
|
|
1579
|
+
...Object.fromEntries(Object.entries(x ?? {}).filter(([e]) => e.startsWith("--"))),
|
|
1580
|
+
...d ? { "--kb-switch-off-color": d } : {},
|
|
1581
|
+
...p ? { "--kb-switch-on-color": p } : {}
|
|
1582
|
+
}, k = d ? "custom" : l, A = p ? "custom" : u ?? c ?? "accent", j = f(), M = S ?? `kb-switch-${j}`, { invalid: F, ariaInvalid: I } = P(!!h, E), L = `${M}-description`, R = `${M}-error`, z = [
|
|
1583
|
+
T,
|
|
1584
|
+
m && L,
|
|
1585
|
+
h && R
|
|
1586
|
+
].filter(Boolean).join(" ") || void 0;
|
|
1587
|
+
return /* @__PURE__ */ r("div", {
|
|
1588
|
+
style: O,
|
|
1589
|
+
...N("switch", {
|
|
1590
|
+
size: s,
|
|
1591
|
+
"off-tone": k,
|
|
1592
|
+
"on-tone": A,
|
|
1593
|
+
checked: a,
|
|
1594
|
+
disabled: C,
|
|
1595
|
+
readonly: w,
|
|
1596
|
+
invalid: F
|
|
1597
|
+
}, b),
|
|
1598
|
+
children: [
|
|
1599
|
+
/* @__PURE__ */ r("div", {
|
|
1600
|
+
className: e("kb-switch-field", t?.field),
|
|
1601
|
+
children: [/* @__PURE__ */ r("span", {
|
|
1602
|
+
className: e("kb-switch-target", t?.target),
|
|
1603
|
+
children: [/* @__PURE__ */ n("input", {
|
|
1604
|
+
...D,
|
|
1605
|
+
style: x,
|
|
1606
|
+
id: M,
|
|
1607
|
+
type: "checkbox",
|
|
1608
|
+
role: "switch",
|
|
1609
|
+
"aria-checked": a,
|
|
1610
|
+
className: e("kb-switch-control", t?.control, y),
|
|
1611
|
+
checked: a,
|
|
1612
|
+
disabled: C,
|
|
1613
|
+
readOnly: w,
|
|
1614
|
+
"aria-readonly": w || void 0,
|
|
1615
|
+
"aria-invalid": I,
|
|
1616
|
+
"aria-describedby": z,
|
|
1617
|
+
onChange: (e) => {
|
|
1618
|
+
w || o(e.currentTarget.checked);
|
|
1619
|
+
}
|
|
1620
|
+
}), /* @__PURE__ */ r("span", {
|
|
1621
|
+
className: e("kb-switch-track", t?.track),
|
|
1622
|
+
"aria-hidden": "true",
|
|
1623
|
+
children: [
|
|
1624
|
+
/* @__PURE__ */ n("span", { className: e("kb-switch-thumb", t?.thumb) }),
|
|
1625
|
+
/* @__PURE__ */ n("span", {
|
|
1626
|
+
className: e("kb-switch-off", t?.off),
|
|
1627
|
+
children: _
|
|
1628
|
+
}),
|
|
1629
|
+
/* @__PURE__ */ n("span", {
|
|
1630
|
+
className: e("kb-switch-on", t?.on),
|
|
1631
|
+
children: v
|
|
1632
|
+
})
|
|
1633
|
+
]
|
|
1634
|
+
})]
|
|
1635
|
+
}), /* @__PURE__ */ n("label", {
|
|
1636
|
+
htmlFor: M,
|
|
1637
|
+
className: e("kb-switch-label", t?.label, g && "kb-sr-only"),
|
|
1638
|
+
children: i
|
|
1639
|
+
})]
|
|
1640
|
+
}),
|
|
1641
|
+
m && /* @__PURE__ */ n("p", {
|
|
1642
|
+
className: e("kb-switch-description", t?.description),
|
|
1643
|
+
id: L,
|
|
1644
|
+
children: m
|
|
1645
|
+
}),
|
|
1646
|
+
h && /* @__PURE__ */ n("p", {
|
|
1647
|
+
className: e("kb-switch-error", t?.error),
|
|
1648
|
+
id: R,
|
|
1649
|
+
children: h
|
|
1650
|
+
})
|
|
1651
|
+
]
|
|
1652
|
+
});
|
|
1653
|
+
}
|
|
1654
|
+
//#endregion
|
|
1655
|
+
//#region src/components/Text/Text.tsx
|
|
1656
|
+
function et({ as: e, size: t = "md", tone: n = "default", className: r, ...i }) {
|
|
1657
|
+
return s(e ?? "p", {
|
|
1658
|
+
...i,
|
|
1659
|
+
...N("text", {
|
|
1660
|
+
size: t,
|
|
1661
|
+
tone: n
|
|
1662
|
+
}, r)
|
|
1663
|
+
});
|
|
1664
|
+
}
|
|
1665
|
+
//#endregion
|
|
1666
|
+
//#region src/components/Textarea/Textarea.tsx
|
|
1667
|
+
var tt = ({ ref: t, id: i, label: a, visuallyHidden: o, description: s, error: c, resize: l = "vertical", rows: u = 4, disabled: d, readOnly: p, onChange: m, onValueChange: h, className: g, classNames: _, "aria-describedby": v, "aria-invalid": y, ...b }) => {
|
|
1668
|
+
let x = f(), S = i ?? `kb-textarea-${x}`, { invalid: C, ariaInvalid: w } = P(!!c, y), T = s ? `${S}-description` : void 0, E = c ? `${S}-error` : void 0, D = [
|
|
1669
|
+
T,
|
|
1670
|
+
E,
|
|
1671
|
+
v
|
|
1672
|
+
].filter(Boolean).join(" ") || void 0;
|
|
1673
|
+
return /* @__PURE__ */ r("div", {
|
|
1674
|
+
...N("textarea", {
|
|
1675
|
+
resize: l,
|
|
1676
|
+
invalid: C,
|
|
1677
|
+
disabled: d,
|
|
1678
|
+
readonly: p
|
|
1679
|
+
}, g),
|
|
1680
|
+
children: [
|
|
1681
|
+
/* @__PURE__ */ n("label", {
|
|
1682
|
+
htmlFor: S,
|
|
1683
|
+
className: e("kb-textarea-label", o && "kb-sr-only", _?.label),
|
|
1684
|
+
children: a
|
|
1685
|
+
}),
|
|
1686
|
+
/* @__PURE__ */ n("textarea", {
|
|
1687
|
+
...b,
|
|
1688
|
+
ref: t,
|
|
1689
|
+
id: S,
|
|
1690
|
+
rows: u,
|
|
1691
|
+
disabled: d,
|
|
1692
|
+
readOnly: p,
|
|
1693
|
+
"aria-invalid": w,
|
|
1694
|
+
"aria-describedby": D,
|
|
1695
|
+
className: e("kb-textarea-control", _?.control),
|
|
1696
|
+
onChange: (e) => {
|
|
1697
|
+
m?.(e), h?.(e.currentTarget.value);
|
|
1698
|
+
}
|
|
1699
|
+
}),
|
|
1700
|
+
s ? /* @__PURE__ */ n("p", {
|
|
1701
|
+
id: T,
|
|
1702
|
+
className: e("kb-textarea-description", _?.description),
|
|
1703
|
+
children: s
|
|
1704
|
+
}) : null,
|
|
1705
|
+
c ? /* @__PURE__ */ n("div", {
|
|
1706
|
+
id: E,
|
|
1707
|
+
className: e("kb-textarea-error", _?.error),
|
|
1708
|
+
children: c
|
|
1709
|
+
}) : null
|
|
1710
|
+
]
|
|
1711
|
+
});
|
|
1712
|
+
};
|
|
1713
|
+
//#endregion
|
|
1714
|
+
//#region src/components/Toolbar/Toolbar.tsx
|
|
1715
|
+
function nt({ className: t, ...r }) {
|
|
1716
|
+
return /* @__PURE__ */ n(j.Root, {
|
|
1717
|
+
...r,
|
|
1718
|
+
className: e("kb-toolbar", t)
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
function rt({ className: t, ...r }) {
|
|
1722
|
+
return /* @__PURE__ */ n(j.Group, {
|
|
1723
|
+
...r,
|
|
1724
|
+
className: e("kb-toolbar-group", t)
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
function it({ variant: e = "ghost", className: t, ...r }) {
|
|
1728
|
+
return /* @__PURE__ */ n(j.Button, {
|
|
1729
|
+
...r,
|
|
1730
|
+
render: /* @__PURE__ */ n(I, {
|
|
1731
|
+
variant: e,
|
|
1732
|
+
size: "sm",
|
|
1733
|
+
...t ? { className: t } : {}
|
|
1734
|
+
})
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
function at({ className: t, ...r }) {
|
|
1738
|
+
return /* @__PURE__ */ n(j.Separator, {
|
|
1739
|
+
...r,
|
|
1740
|
+
className: e("kb-toolbar-separator", t)
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
var ot = Object.assign(nt, {
|
|
1744
|
+
Group: rt,
|
|
1745
|
+
Button: it,
|
|
1746
|
+
Separator: at
|
|
1747
|
+
});
|
|
1748
|
+
//#endregion
|
|
1749
|
+
//#region src/components/Tooltip/Tooltip.tsx
|
|
1750
|
+
function st({ content: t, children: i, side: a = "top", delay: o = 400, container: s, className: c, ref: l }) {
|
|
1751
|
+
return /* @__PURE__ */ r(M.Root, { children: [/* @__PURE__ */ n(M.Trigger, {
|
|
1752
|
+
delay: o,
|
|
1753
|
+
render: i
|
|
1754
|
+
}), /* @__PURE__ */ n(M.Portal, {
|
|
1755
|
+
container: s,
|
|
1756
|
+
children: /* @__PURE__ */ n(M.Positioner, {
|
|
1757
|
+
side: a,
|
|
1758
|
+
sideOffset: 6,
|
|
1759
|
+
children: /* @__PURE__ */ n(M.Popup, {
|
|
1760
|
+
ref: l,
|
|
1761
|
+
className: e("kb-tooltip", c),
|
|
1762
|
+
children: t
|
|
1763
|
+
})
|
|
1764
|
+
})
|
|
1765
|
+
})] });
|
|
1766
|
+
}
|
|
1767
|
+
//#endregion
|
|
1768
|
+
export { F as Badge, I as Button, L as Callout, R as Card, z as Checkbox, B as Code, V as Combobox, H as Container, ee as Dialog, re as ErrorSummary, ie as Fieldset, ce as FileInput, le as FormActions, ue as Grid, fe as Heading, pe as Inline, me as Input, he as Link, Se as Menu, Te as MultiSelect, Ee as NumberField, ze as Panel, Be as Progress, Ke as RadioGroup, qe as ScrollArea, Je as Select, Ye as Separator, Xe as Split, Ze as Stat, Qe as Status, $e as Switch, et as Text, tt as Textarea, ot as Toolbar, st as Tooltip, N as kb };
|
|
1769
|
+
|
|
1770
|
+
//# sourceMappingURL=index.js.map
|