@vellira-ui/react 2.23.0 → 2.25.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 +37 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +534 -413
- package/dist/styles.css +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -88,11 +88,11 @@ var I = (e) => {
|
|
|
88
88
|
};
|
|
89
89
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
90
90
|
}, [n]);
|
|
91
|
-
}, R = { group: "_group_1yomt_1" },
|
|
91
|
+
}, R = { group: "_group_1yomt_1" }, te = ({ label: e }) => /* @__PURE__ */ f("li", {
|
|
92
92
|
role: "presentation",
|
|
93
93
|
className: R.group,
|
|
94
94
|
children: e
|
|
95
|
-
}),
|
|
95
|
+
}), z = {
|
|
96
96
|
item: "_item_t87eq_1",
|
|
97
97
|
disabled: "_disabled_t87eq_18",
|
|
98
98
|
active: "_active_t87eq_28",
|
|
@@ -103,7 +103,7 @@ var I = (e) => {
|
|
|
103
103
|
"itemText--truncate": "_itemText--truncate_t87eq_74",
|
|
104
104
|
"itemText--wrap": "_itemText--wrap_t87eq_79",
|
|
105
105
|
"itemText--nowrap": "_itemText--nowrap_t87eq_83"
|
|
106
|
-
},
|
|
106
|
+
}, ne = ({ id: e, children: t, label: n, icon: r, danger: i, disabled: a, active: o, onClick: s, onMouseEnter: c, shortcut: l, textWrap: u = "truncate", className: d }) => {
|
|
107
107
|
let m = t || n;
|
|
108
108
|
return /* @__PURE__ */ p("li", {
|
|
109
109
|
id: e,
|
|
@@ -114,47 +114,47 @@ var I = (e) => {
|
|
|
114
114
|
"data-danger": i || void 0,
|
|
115
115
|
onClick: a ? void 0 : s,
|
|
116
116
|
onMouseEnter: a ? void 0 : c,
|
|
117
|
-
className: M(
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
117
|
+
className: M(z.item, {
|
|
118
|
+
[z.active]: o,
|
|
119
|
+
[z.disabled]: a,
|
|
120
|
+
[z.danger]: i
|
|
121
121
|
}, d),
|
|
122
122
|
children: [
|
|
123
123
|
r && /* @__PURE__ */ f("span", {
|
|
124
124
|
"aria-hidden": "true",
|
|
125
|
-
className:
|
|
125
|
+
className: z.itemIcon,
|
|
126
126
|
children: r
|
|
127
127
|
}),
|
|
128
128
|
m && /* @__PURE__ */ f("span", {
|
|
129
|
-
className: M(
|
|
129
|
+
className: M(z.itemText, z[`itemText--${u}`]),
|
|
130
130
|
children: m
|
|
131
131
|
}),
|
|
132
132
|
l && /* @__PURE__ */ f("span", {
|
|
133
|
-
className:
|
|
133
|
+
className: z.itemShortcut,
|
|
134
134
|
children: l
|
|
135
135
|
})
|
|
136
136
|
]
|
|
137
137
|
});
|
|
138
|
-
},
|
|
138
|
+
}, B = { group: "_group_ts4nb_1" }, V = () => /* @__PURE__ */ f("li", {
|
|
139
139
|
role: "separator",
|
|
140
|
-
className:
|
|
140
|
+
className: B.separator,
|
|
141
141
|
"aria-hidden": "true"
|
|
142
|
-
}),
|
|
142
|
+
}), H = {
|
|
143
143
|
button: "_button_ii6sx_1",
|
|
144
144
|
disabled: "_disabled_ii6sx_16",
|
|
145
145
|
iconLeft: "_iconLeft_ii6sx_27",
|
|
146
146
|
arrow: "_arrow_ii6sx_39",
|
|
147
147
|
iconOnly: "_iconOnly_ii6sx_42",
|
|
148
148
|
open: "_open_ii6sx_75"
|
|
149
|
-
},
|
|
149
|
+
}, re = t(({ children: e, isOpen: t, icon: n, arrowIcon: r, showArrow: i = !0, rotateAngle: a = 90, label: o, className: s, ...c }, l) => {
|
|
150
150
|
let u = !!n, d = !!e, m = u && !d, h = i && d, g = r ?? /* @__PURE__ */ f(k, {}), _ = m ? o ?? "Open menu" : void 0;
|
|
151
151
|
return /* @__PURE__ */ p("button", {
|
|
152
152
|
...c,
|
|
153
153
|
ref: l,
|
|
154
154
|
type: "button",
|
|
155
|
-
className: M(
|
|
156
|
-
[
|
|
157
|
-
[
|
|
155
|
+
className: M(H.button, {
|
|
156
|
+
[H.disabled]: c.disabled,
|
|
157
|
+
[H.iconOnly]: m
|
|
158
158
|
}, s),
|
|
159
159
|
"aria-label": _,
|
|
160
160
|
"aria-expanded": t,
|
|
@@ -163,27 +163,27 @@ var I = (e) => {
|
|
|
163
163
|
children: [
|
|
164
164
|
u && /* @__PURE__ */ f("span", {
|
|
165
165
|
"aria-hidden": "true",
|
|
166
|
-
className:
|
|
166
|
+
className: H.iconLeft,
|
|
167
167
|
children: n
|
|
168
168
|
}),
|
|
169
169
|
e,
|
|
170
170
|
h && /* @__PURE__ */ f("span", {
|
|
171
171
|
"aria-hidden": "true",
|
|
172
|
-
className: M(
|
|
172
|
+
className: M(H.arrow, { [H.open]: t }),
|
|
173
173
|
children: g
|
|
174
174
|
})
|
|
175
175
|
]
|
|
176
176
|
});
|
|
177
177
|
});
|
|
178
|
-
|
|
178
|
+
re.displayName = "DropdownTrigger";
|
|
179
179
|
//#endregion
|
|
180
180
|
//#region src/components/Dropdown/types.ts
|
|
181
|
-
var
|
|
181
|
+
var U = (e) => e.type !== "group" && e.type !== "separator", W = (e) => e.type === "group", ie = (e) => e.type === "separator", ae = { wrapper: "_wrapper_14ue8_1" }, oe = ({ label: e, icon: t, trigger: n, items: r = [], onSelect: i, className: o, disabled: l, rotateAngle: u = 90, placement: d, matchTriggerWidth: m, textWrap: h, showArrow: g = !0, arrowIcon: _ }) => {
|
|
182
182
|
let [v, y] = c(!1), [b, x] = c(-1), S = s(null), C = s(null), w = a(), T = `${w}-trigger`, { floatingStyles: D, setRef: O, setFloatingRef: k } = ee({
|
|
183
183
|
placement: d,
|
|
184
184
|
matchTriggerWidth: m,
|
|
185
185
|
mobileSheetBreakpoint: 640
|
|
186
|
-
}), A = r.filter(
|
|
186
|
+
}), A = r.filter(U), j = v && b >= 0 ? `${w}-item-${b}` : void 0, N = () => A.findIndex((e) => !e.disabled), P = () => {
|
|
187
187
|
l || y((e) => {
|
|
188
188
|
let t = !e;
|
|
189
189
|
return x(t ? N() : -1), t;
|
|
@@ -192,7 +192,7 @@ var ne = (e) => e.type !== "group" && e.type !== "separator", G = (e) => e.type
|
|
|
192
192
|
y(!1), x(-1);
|
|
193
193
|
}, R = () => {
|
|
194
194
|
I(), S.current?.focus();
|
|
195
|
-
}, { onKeyDown:
|
|
195
|
+
}, { onKeyDown: z } = E({
|
|
196
196
|
activeIndex: b,
|
|
197
197
|
setActiveIndex: x,
|
|
198
198
|
items: A,
|
|
@@ -205,15 +205,15 @@ var ne = (e) => e.type !== "group" && e.type !== "separator", G = (e) => e.type
|
|
|
205
205
|
onClose: R
|
|
206
206
|
});
|
|
207
207
|
L([S, C], () => I(), v);
|
|
208
|
-
let
|
|
208
|
+
let B = (e) => {
|
|
209
209
|
S.current = e, O(e);
|
|
210
|
-
},
|
|
210
|
+
}, H = (e) => {
|
|
211
211
|
C.current = e, k(e), e?.focus();
|
|
212
212
|
};
|
|
213
213
|
return /* @__PURE__ */ p("div", {
|
|
214
|
-
className: M(
|
|
215
|
-
children: [/* @__PURE__ */ f(
|
|
216
|
-
ref:
|
|
214
|
+
className: M(ae.wrapper, o),
|
|
215
|
+
children: [/* @__PURE__ */ f(re, {
|
|
216
|
+
ref: B,
|
|
217
217
|
id: T,
|
|
218
218
|
isOpen: v,
|
|
219
219
|
disabled: l,
|
|
@@ -223,25 +223,25 @@ var ne = (e) => e.type !== "group" && e.type !== "separator", G = (e) => e.type
|
|
|
223
223
|
arrowIcon: _,
|
|
224
224
|
rotateAngle: u,
|
|
225
225
|
onClick: P,
|
|
226
|
-
onKeyDown:
|
|
226
|
+
onKeyDown: z,
|
|
227
227
|
"aria-expanded": v,
|
|
228
228
|
"aria-haspopup": "menu",
|
|
229
229
|
...v && { "aria-controls": w },
|
|
230
230
|
children: n
|
|
231
231
|
}), v && /* @__PURE__ */ f(F, {
|
|
232
|
-
ref:
|
|
232
|
+
ref: H,
|
|
233
233
|
floatingStyles: D,
|
|
234
234
|
menuId: w,
|
|
235
235
|
labelledById: n ? T : void 0,
|
|
236
236
|
label: n ? void 0 : e,
|
|
237
237
|
activeDescendantId: j,
|
|
238
|
-
onKeyDown:
|
|
238
|
+
onKeyDown: z,
|
|
239
239
|
children: r.map((e, t) => {
|
|
240
|
-
if (
|
|
241
|
-
if (
|
|
242
|
-
if (
|
|
240
|
+
if (W(e)) return /* @__PURE__ */ f(te, { label: e.label }, `group-${e.label}`);
|
|
241
|
+
if (ie(e)) return /* @__PURE__ */ f(V, {}, `separator-${t}`);
|
|
242
|
+
if (U(e)) {
|
|
243
243
|
let t = A.findIndex((t) => t === e);
|
|
244
|
-
return /* @__PURE__ */ f(
|
|
244
|
+
return /* @__PURE__ */ f(ne, {
|
|
245
245
|
id: `${w}-item-${t}`,
|
|
246
246
|
...e,
|
|
247
247
|
active: b === t,
|
|
@@ -258,23 +258,23 @@ var ne = (e) => e.type !== "group" && e.type !== "separator", G = (e) => e.type
|
|
|
258
258
|
})
|
|
259
259
|
})]
|
|
260
260
|
});
|
|
261
|
-
},
|
|
262
|
-
let e = r(
|
|
261
|
+
}, se = e(void 0), ce = () => {
|
|
262
|
+
let e = r(se);
|
|
263
263
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
264
264
|
return e;
|
|
265
265
|
};
|
|
266
|
-
|
|
267
|
-
var
|
|
268
|
-
let { descriptionId: t } =
|
|
266
|
+
se.displayName = "ModalContext";
|
|
267
|
+
var le = { modalBody: "_modalBody_iv33a_1" }, ue = ({ children: e }) => {
|
|
268
|
+
let { descriptionId: t } = ce();
|
|
269
269
|
return /* @__PURE__ */ f("div", {
|
|
270
270
|
id: t,
|
|
271
|
-
className:
|
|
271
|
+
className: le.modalBody,
|
|
272
272
|
children: e
|
|
273
273
|
});
|
|
274
274
|
};
|
|
275
|
-
|
|
276
|
-
var
|
|
277
|
-
className:
|
|
275
|
+
ue.displayName = "ModalBody";
|
|
276
|
+
var G = { content: "_content_avpai_1" }, de = ({ children: e }) => /* @__PURE__ */ f("div", {
|
|
277
|
+
className: G.content,
|
|
278
278
|
children: e
|
|
279
279
|
});
|
|
280
280
|
de.displayName = "ModalContent";
|
|
@@ -288,7 +288,7 @@ var me = {
|
|
|
288
288
|
modalHeaderTitle: "_modalHeaderTitle_155d7_8",
|
|
289
289
|
modalHeaderCloseButton: "_modalHeaderCloseButton_155d7_15"
|
|
290
290
|
}, he = ({ children: e }) => {
|
|
291
|
-
let { onClose: t, titleId: n } =
|
|
291
|
+
let { onClose: t, titleId: n } = ce();
|
|
292
292
|
return /* @__PURE__ */ p("div", {
|
|
293
293
|
className: me.modalHeader,
|
|
294
294
|
children: [/* @__PURE__ */ f("h2", {
|
|
@@ -317,16 +317,16 @@ var ge = ({ isOpen: e, onClose: t }) => {
|
|
|
317
317
|
"overlay--open": "_overlay--open_1xotg_13",
|
|
318
318
|
"overlay--animated": "_overlay--animated_1xotg_17",
|
|
319
319
|
modal: "_modal_1xotg_21"
|
|
320
|
-
},
|
|
321
|
-
let p = o ?? c ?? !0, m = s(null), { titleId: h, descriptionId: g } =
|
|
320
|
+
}, ve = 0, ye = "", be = ({ children: e, onClose: t, isOpen: r, className: a, closeOnBackdrop: o, closeOnClick: c, closeOnEsc: l = !0, zIndex: u = 1e3, animated: d = !0 }) => {
|
|
321
|
+
let p = o ?? c ?? !0, m = s(null), { titleId: h, descriptionId: g } = ce(), _ = n((e) => {
|
|
322
322
|
p && e.target === e.currentTarget && t?.();
|
|
323
323
|
}, [p, t]);
|
|
324
324
|
return ge({
|
|
325
325
|
isOpen: r,
|
|
326
326
|
onClose: l ? t : void 0
|
|
327
327
|
}), i(() => {
|
|
328
|
-
if (r) return
|
|
329
|
-
|
|
328
|
+
if (r) return ve === 0 && (ye = document.body.style.overflow), ve += 1, document.body.style.overflow = "hidden", () => {
|
|
329
|
+
ve = Math.max(0, ve - 1), ve === 0 && (document.body.style.overflow = ye);
|
|
330
330
|
};
|
|
331
331
|
}, [r]), !r && !d ? null : /* @__PURE__ */ f(N, { children: /* @__PURE__ */ f("div", {
|
|
332
332
|
className: M(_e.overlay, r && _e["overlay--open"], d && _e["overlay--animated"], a),
|
|
@@ -355,18 +355,18 @@ var ge = ({ isOpen: e, onClose: t }) => {
|
|
|
355
355
|
})
|
|
356
356
|
}) });
|
|
357
357
|
};
|
|
358
|
-
|
|
358
|
+
be.displayName = "ModalOverlay";
|
|
359
359
|
//#endregion
|
|
360
360
|
//#region src/components/Modal/Modal.tsx
|
|
361
|
-
var
|
|
361
|
+
var xe = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: o = !0 }) => {
|
|
362
362
|
let s = a(), c = a();
|
|
363
|
-
return e ? /* @__PURE__ */ f(
|
|
363
|
+
return e ? /* @__PURE__ */ f(se.Provider, {
|
|
364
364
|
value: {
|
|
365
365
|
onClose: n,
|
|
366
366
|
titleId: s,
|
|
367
367
|
descriptionId: c
|
|
368
368
|
},
|
|
369
|
-
children: /* @__PURE__ */ f(
|
|
369
|
+
children: /* @__PURE__ */ f(be, {
|
|
370
370
|
isOpen: e,
|
|
371
371
|
onClose: n,
|
|
372
372
|
closeOnBackdrop: r ?? i,
|
|
@@ -375,144 +375,154 @@ var be = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick
|
|
|
375
375
|
})
|
|
376
376
|
}) : null;
|
|
377
377
|
};
|
|
378
|
-
|
|
378
|
+
xe.displayName = "Modal";
|
|
379
379
|
//#endregion
|
|
380
380
|
//#region src/components/Modal/index.ts
|
|
381
|
-
var
|
|
381
|
+
var Se = Object.assign(xe, {
|
|
382
382
|
Header: he,
|
|
383
|
-
Body:
|
|
383
|
+
Body: ue,
|
|
384
384
|
Content: de,
|
|
385
385
|
Footer: pe
|
|
386
|
-
}),
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
386
|
+
}), Ce = e(null), we = Ce.Provider;
|
|
387
|
+
function Te() {
|
|
388
|
+
return r(Ce);
|
|
389
|
+
}
|
|
390
|
+
var K = {
|
|
391
|
+
root: "_root_7wga8_1",
|
|
392
|
+
label: "_label_7wga8_9",
|
|
393
|
+
required: "_required_7wga8_20",
|
|
394
|
+
description: "_description_7wga8_24",
|
|
395
|
+
items: "_items_7wga8_31",
|
|
396
|
+
vertical: "_vertical_7wga8_36",
|
|
397
|
+
horizontal: "_horizontal_7wga8_42",
|
|
398
|
+
error: "_error_7wga8_48",
|
|
399
|
+
disabled: "_disabled_7wga8_55",
|
|
400
|
+
invalid: "_invalid_7wga8_60"
|
|
401
|
+
}, Ee = t(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: o = "md", name: s, label: c, description: l, error: u, orientation: d = "vertical", children: m, className: h, id: g, ..._ }, v) => {
|
|
402
|
+
let y = a(), b = g ?? y, x = c ? `${b}-label` : void 0, S = l ? `${b}-description` : void 0, C = u ? `${b}-error` : void 0, w = [S, C].filter(Boolean).join(" ") || void 0, E = s ?? `${b}-radio`, [D, O] = T({
|
|
403
|
+
value: e,
|
|
404
|
+
defaultValue: t,
|
|
405
|
+
onChange: n
|
|
406
|
+
}), k = !!u;
|
|
407
|
+
return /* @__PURE__ */ p("div", {
|
|
408
|
+
..._,
|
|
409
|
+
ref: v,
|
|
410
|
+
id: b,
|
|
411
|
+
role: "radiogroup",
|
|
412
|
+
"aria-labelledby": x,
|
|
413
|
+
"aria-describedby": w,
|
|
414
|
+
"aria-disabled": r || void 0,
|
|
415
|
+
"aria-required": i || void 0,
|
|
416
|
+
"aria-invalid": k || void 0,
|
|
417
|
+
className: M(K.root, k && K.invalid, r && K.disabled, h),
|
|
418
|
+
children: [
|
|
419
|
+
c && /* @__PURE__ */ p("div", {
|
|
420
|
+
id: x,
|
|
421
|
+
className: K.label,
|
|
422
|
+
children: [c, i && /* @__PURE__ */ f("span", {
|
|
423
|
+
className: K.required,
|
|
424
|
+
"aria-hidden": "true",
|
|
425
|
+
children: "*"
|
|
426
|
+
})]
|
|
427
|
+
}),
|
|
428
|
+
l && /* @__PURE__ */ f("div", {
|
|
429
|
+
id: S,
|
|
430
|
+
className: K.description,
|
|
431
|
+
children: l
|
|
432
|
+
}),
|
|
433
|
+
/* @__PURE__ */ f(we, {
|
|
434
|
+
value: {
|
|
435
|
+
name: E,
|
|
436
|
+
value: D,
|
|
437
|
+
disabled: r,
|
|
438
|
+
required: i,
|
|
439
|
+
invalid: k,
|
|
440
|
+
size: o,
|
|
441
|
+
describedBy: w,
|
|
442
|
+
onValueChange: O
|
|
443
|
+
},
|
|
444
|
+
children: /* @__PURE__ */ f("div", {
|
|
445
|
+
className: M(K.items, K[d]),
|
|
446
|
+
children: m
|
|
447
|
+
})
|
|
448
|
+
}),
|
|
449
|
+
u && /* @__PURE__ */ f("div", {
|
|
450
|
+
id: C,
|
|
451
|
+
className: K.error,
|
|
452
|
+
children: u
|
|
453
|
+
})
|
|
454
|
+
]
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
Ee.displayName = "RadioGroup";
|
|
458
|
+
var q = {
|
|
459
|
+
wrapper: "_wrapper_w0lsp_1",
|
|
460
|
+
label: "_label_w0lsp_9",
|
|
461
|
+
required: "_required_w0lsp_20",
|
|
462
|
+
description: "_description_w0lsp_25",
|
|
463
|
+
control: "_control_w0lsp_32",
|
|
464
|
+
errorText: "_errorText_w0lsp_40",
|
|
465
|
+
disabled: "_disabled_w0lsp_47",
|
|
466
|
+
storyInput: "_storyInput_w0lsp_60",
|
|
467
|
+
storyBadge: "_storyBadge_w0lsp_65",
|
|
468
|
+
storyCustomRoot: "_storyCustomRoot_w0lsp_76",
|
|
469
|
+
storyCustomLabel: "_storyCustomLabel_w0lsp_83",
|
|
470
|
+
storyCustomControl: "_storyCustomControl_w0lsp_87",
|
|
471
|
+
storyCustomDescription: "_storyCustomDescription_w0lsp_91",
|
|
472
|
+
storyCustomError: "_storyCustomError_w0lsp_95"
|
|
473
|
+
}, De = ({ id: e, label: t, description: n, error: r, required: i = !1, disabled: a = !1, children: o, className: s, controlClassName: c, labelClassName: l, descriptionClassName: u, errorClassName: d, ...m }) => {
|
|
474
|
+
let h = n && e ? `${e}-description` : void 0, g = r && e ? `${e}-error` : void 0;
|
|
396
475
|
return /* @__PURE__ */ p("div", {
|
|
397
|
-
|
|
398
|
-
"
|
|
476
|
+
...m,
|
|
477
|
+
"aria-disabled": a || void 0,
|
|
478
|
+
className: M(q.wrapper, a && q.disabled, s),
|
|
479
|
+
"data-disabled": a || void 0,
|
|
399
480
|
"data-invalid": !!r || void 0,
|
|
400
481
|
children: [
|
|
401
482
|
t && /* @__PURE__ */ p("label", {
|
|
402
|
-
|
|
403
|
-
|
|
483
|
+
htmlFor: e,
|
|
484
|
+
className: M(q.label, l),
|
|
404
485
|
children: [t, i && /* @__PURE__ */ f("span", {
|
|
405
486
|
className: q.required,
|
|
406
487
|
"aria-hidden": "true",
|
|
407
488
|
children: "*"
|
|
408
489
|
})]
|
|
409
490
|
}),
|
|
410
|
-
n && /* @__PURE__ */ f("
|
|
411
|
-
|
|
412
|
-
|
|
491
|
+
n && /* @__PURE__ */ f("div", {
|
|
492
|
+
id: h,
|
|
493
|
+
className: M(q.description, u),
|
|
413
494
|
children: n
|
|
414
495
|
}),
|
|
415
496
|
/* @__PURE__ */ f("div", {
|
|
416
|
-
className: q.control,
|
|
417
|
-
children:
|
|
497
|
+
className: M(q.control, c),
|
|
498
|
+
children: o
|
|
418
499
|
}),
|
|
419
|
-
r && /* @__PURE__ */ f("
|
|
420
|
-
|
|
421
|
-
|
|
500
|
+
r && /* @__PURE__ */ f("div", {
|
|
501
|
+
id: g,
|
|
502
|
+
className: M(q.errorText, d),
|
|
422
503
|
role: "alert",
|
|
423
504
|
children: r
|
|
424
505
|
})
|
|
425
506
|
]
|
|
426
507
|
});
|
|
427
|
-
},
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
customRadio: "_customRadio_10xq8_44",
|
|
436
|
-
input: "_input_10xq8_49",
|
|
437
|
-
label: "_label_10xq8_100"
|
|
438
|
-
}, Ce = ({ label: e, description: t, value: n, defaultValue: r, onChange: i, options: o, name: s, required: c = !1, disabled: l = !1, error: u, className: d, orientation: m = "vertical" }) => {
|
|
439
|
-
let h = a(), g = `${h}-group`, _ = e ? `${h}-label` : void 0, v = [t ? `${h}-description` : void 0, u ? `${h}-error` : void 0].filter(Boolean).join(" ") || void 0, [y, b] = T({
|
|
440
|
-
value: n,
|
|
441
|
-
defaultValue: r ?? "",
|
|
442
|
-
onChange: i
|
|
443
|
-
});
|
|
444
|
-
return /* @__PURE__ */ p(Se, {
|
|
445
|
-
id: h,
|
|
446
|
-
description: t,
|
|
447
|
-
required: c,
|
|
448
|
-
disabled: l,
|
|
449
|
-
error: u,
|
|
450
|
-
children: [e && /* @__PURE__ */ p("span", {
|
|
451
|
-
id: _,
|
|
452
|
-
className: J.groupLabel,
|
|
453
|
-
children: [e, c && /* @__PURE__ */ f("span", {
|
|
454
|
-
className: J.required,
|
|
455
|
-
"aria-hidden": "true",
|
|
456
|
-
children: "*"
|
|
457
|
-
})]
|
|
458
|
-
}), /* @__PURE__ */ f("div", {
|
|
459
|
-
id: g,
|
|
460
|
-
className: M(J.group, J[m], d),
|
|
461
|
-
role: "radiogroup",
|
|
462
|
-
"aria-labelledby": _,
|
|
463
|
-
"aria-required": c || void 0,
|
|
464
|
-
"aria-invalid": !!u || void 0,
|
|
465
|
-
"aria-describedby": v,
|
|
466
|
-
children: o.map((e) => {
|
|
467
|
-
let t = `${h}-${e.value}`, n = l || e.disabled;
|
|
468
|
-
return /* @__PURE__ */ p("label", {
|
|
469
|
-
htmlFor: t,
|
|
470
|
-
className: M(J.option, { [J.disabled]: n }),
|
|
471
|
-
children: [
|
|
472
|
-
/* @__PURE__ */ f("input", {
|
|
473
|
-
id: t,
|
|
474
|
-
type: "radio",
|
|
475
|
-
name: s,
|
|
476
|
-
value: e.value,
|
|
477
|
-
checked: y === e.value,
|
|
478
|
-
required: c,
|
|
479
|
-
disabled: n,
|
|
480
|
-
onChange: () => {
|
|
481
|
-
n || b(e.value);
|
|
482
|
-
},
|
|
483
|
-
className: J.input
|
|
484
|
-
}),
|
|
485
|
-
/* @__PURE__ */ f("span", {
|
|
486
|
-
className: J.customRadio,
|
|
487
|
-
"aria-hidden": "true"
|
|
488
|
-
}),
|
|
489
|
-
/* @__PURE__ */ f("span", {
|
|
490
|
-
className: J.label,
|
|
491
|
-
children: e.label
|
|
492
|
-
})
|
|
493
|
-
]
|
|
494
|
-
}, e.value);
|
|
495
|
-
})
|
|
496
|
-
})]
|
|
497
|
-
});
|
|
498
|
-
};
|
|
499
|
-
Ce.displayName = "RadioGroup";
|
|
500
|
-
var we = {
|
|
501
|
-
option: "_option_1qm3g_1",
|
|
502
|
-
selected: "_selected_1qm3g_10",
|
|
503
|
-
disabled: "_disabled_1qm3g_10",
|
|
504
|
-
active: "_active_1qm3g_21"
|
|
505
|
-
}, Te = ({ option: e, isSelected: t, isActive: n, optionId: r, onSelect: i, onMouseEnter: a }) => {
|
|
508
|
+
}, Oe = {
|
|
509
|
+
option: "_option_1mcld_1",
|
|
510
|
+
selected: "_selected_1mcld_17",
|
|
511
|
+
disabled: "_disabled_1mcld_17",
|
|
512
|
+
active: "_active_1mcld_28",
|
|
513
|
+
label: "_label_1mcld_40",
|
|
514
|
+
check: "_check_1mcld_48"
|
|
515
|
+
}, ke = ({ option: e, isSelected: t, isActive: n, optionId: r, onSelect: i, onMouseEnter: a }) => {
|
|
506
516
|
let o = !!e.disabled;
|
|
507
|
-
return /* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ p("li", {
|
|
508
518
|
id: r,
|
|
509
519
|
role: "option",
|
|
510
520
|
"aria-selected": t,
|
|
511
521
|
"aria-disabled": o || void 0,
|
|
512
|
-
className: M(
|
|
513
|
-
[
|
|
514
|
-
[
|
|
515
|
-
[
|
|
522
|
+
className: M(Oe.option, {
|
|
523
|
+
[Oe.selected]: t,
|
|
524
|
+
[Oe.active]: n,
|
|
525
|
+
[Oe.disabled]: o
|
|
516
526
|
}),
|
|
517
527
|
onClick: () => {
|
|
518
528
|
o || i(e.value);
|
|
@@ -520,41 +530,56 @@ var we = {
|
|
|
520
530
|
onMouseEnter: () => {
|
|
521
531
|
o || a();
|
|
522
532
|
},
|
|
523
|
-
children:
|
|
533
|
+
children: [/* @__PURE__ */ f("span", {
|
|
534
|
+
className: Oe.label,
|
|
535
|
+
children: e.label
|
|
536
|
+
}), /* @__PURE__ */ f("span", {
|
|
537
|
+
className: Oe.check,
|
|
538
|
+
"aria-hidden": "true",
|
|
539
|
+
children: t && /* @__PURE__ */ f(O, {})
|
|
540
|
+
})]
|
|
524
541
|
});
|
|
525
542
|
};
|
|
526
|
-
|
|
527
|
-
var
|
|
528
|
-
dropdown: "
|
|
529
|
-
dropdownIn: "
|
|
530
|
-
|
|
543
|
+
ke.displayName = "SelectOption";
|
|
544
|
+
var Ae = {
|
|
545
|
+
dropdown: "_dropdown_jl377_1",
|
|
546
|
+
dropdownIn: "_dropdownIn_jl377_1",
|
|
547
|
+
empty: "_empty_jl377_17"
|
|
548
|
+
}, je = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, noOptionsText: o, selectedValue: s, activeIndex: c, className: l, onSelect: u, onMouseEnter: d }) => e ? /* @__PURE__ */ f(N, { children: /* @__PURE__ */ f("ul", {
|
|
531
549
|
ref: r,
|
|
532
550
|
id: t,
|
|
533
551
|
role: "listbox",
|
|
534
552
|
"aria-labelledby": n,
|
|
535
|
-
className:
|
|
553
|
+
className: [Ae.dropdown, l].filter(Boolean).join(" "),
|
|
536
554
|
style: i,
|
|
537
|
-
children: a.map((e, n) => /* @__PURE__ */ f(
|
|
555
|
+
children: a.length ? a.map((e, n) => /* @__PURE__ */ f(ke, {
|
|
538
556
|
option: e,
|
|
539
|
-
isSelected: e.value ===
|
|
540
|
-
isActive: n ===
|
|
557
|
+
isSelected: e.value === s,
|
|
558
|
+
isActive: n === c,
|
|
541
559
|
optionId: `${t}-option-${n}`,
|
|
542
|
-
onSelect:
|
|
543
|
-
onMouseEnter: () =>
|
|
544
|
-
}, e.value))
|
|
560
|
+
onSelect: u,
|
|
561
|
+
onMouseEnter: () => d(n)
|
|
562
|
+
}, e.value)) : /* @__PURE__ */ f("li", {
|
|
563
|
+
className: Ae.empty,
|
|
564
|
+
role: "presentation",
|
|
565
|
+
children: o
|
|
566
|
+
})
|
|
545
567
|
}) }) : null;
|
|
546
|
-
|
|
547
|
-
var
|
|
548
|
-
control: "
|
|
549
|
-
disabled: "
|
|
550
|
-
arrow: "
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
568
|
+
je.displayName = "SelectDropdown";
|
|
569
|
+
var J = {
|
|
570
|
+
control: "_control_ole58_1",
|
|
571
|
+
disabled: "_disabled_ole58_18",
|
|
572
|
+
arrow: "_arrow_ole58_23",
|
|
573
|
+
sm: "_sm_ole58_33",
|
|
574
|
+
md: "_md_ole58_40",
|
|
575
|
+
lg: "_lg_ole58_47",
|
|
576
|
+
value: "_value_ole58_54",
|
|
577
|
+
placeholder: "_placeholder_ole58_62",
|
|
578
|
+
error: "_error_ole58_66",
|
|
579
|
+
open: "_open_ole58_107"
|
|
580
|
+
}, Me = ({ id: e, errorId: t, isOpen: n, disabled: r, required: i, listboxId: a, activeIndex: o, ariaLabel: s, error: c, displayText: l, isPlaceholder: u, size: d = "md", className: m, buttonRef: h, onClick: g, onKeyDown: _, onBlur: v, onFocus: y }) => /* @__PURE__ */ p("button", {
|
|
556
581
|
id: e,
|
|
557
|
-
ref:
|
|
582
|
+
ref: h,
|
|
558
583
|
type: "button",
|
|
559
584
|
role: "combobox",
|
|
560
585
|
disabled: r,
|
|
@@ -563,149 +588,165 @@ var Y = {
|
|
|
563
588
|
"aria-expanded": n,
|
|
564
589
|
"aria-haspopup": "listbox",
|
|
565
590
|
"aria-label": s,
|
|
591
|
+
"aria-invalid": c || void 0,
|
|
566
592
|
"aria-controls": n ? a : void 0,
|
|
567
593
|
"aria-describedby": t,
|
|
568
594
|
"aria-activedescendant": n && o >= 0 ? `${a}-option-${o}` : void 0,
|
|
569
|
-
className: M(
|
|
570
|
-
[
|
|
571
|
-
[
|
|
572
|
-
}),
|
|
573
|
-
onClick:
|
|
574
|
-
onKeyDown:
|
|
595
|
+
className: M(J.control, J[d], {
|
|
596
|
+
[J.error]: !!c,
|
|
597
|
+
[J.disabled]: r
|
|
598
|
+
}, m),
|
|
599
|
+
onClick: g,
|
|
600
|
+
onKeyDown: _,
|
|
601
|
+
onBlur: v,
|
|
602
|
+
onFocus: y,
|
|
575
603
|
children: [/* @__PURE__ */ f("span", {
|
|
576
|
-
className: M(
|
|
604
|
+
className: M(J.value, { [J.placeholder]: u }),
|
|
577
605
|
children: l
|
|
578
606
|
}), /* @__PURE__ */ f("span", {
|
|
579
|
-
className: M(
|
|
607
|
+
className: M(J.arrow, { [J.open]: n }),
|
|
580
608
|
"aria-hidden": "true",
|
|
581
609
|
children: /* @__PURE__ */ f(k, {})
|
|
582
610
|
})]
|
|
583
611
|
});
|
|
584
|
-
|
|
612
|
+
Me.displayName = "SelectTrigger";
|
|
585
613
|
//#endregion
|
|
586
614
|
//#region src/components/Select/Select.tsx
|
|
587
|
-
var
|
|
588
|
-
let
|
|
589
|
-
value:
|
|
590
|
-
defaultValue:
|
|
591
|
-
onChange:
|
|
592
|
-
}), [
|
|
593
|
-
|
|
594
|
-
|
|
615
|
+
var Ne = ({ label: e, description: t, id: r, name: i, "aria-label": l, value: u, defaultValue: d, onChange: m, options: h, placeholder: g = "Select...", noOptionsText: _ = "No options available", size: v = "md", required: y = !1, disabled: b = !1, error: x, placement: S = "bottom-start", matchTriggerWidth: C = !0, open: w, defaultOpen: D = !1, onOpenChange: O, onBlur: k, onFocus: A, className: j, triggerClassName: M, dropdownClassName: N }) => {
|
|
616
|
+
let P = a(), F = r ?? P, I = `${F}-listbox`, R = !!x, te = R ? `${F}-error` : void 0, z = s(null), ne = s(null), [B, V] = T({
|
|
617
|
+
value: u,
|
|
618
|
+
defaultValue: d ?? "",
|
|
619
|
+
onChange: m
|
|
620
|
+
}), [H, re] = T({
|
|
621
|
+
value: w,
|
|
622
|
+
defaultValue: D,
|
|
623
|
+
onChange: O
|
|
624
|
+
}), [U, W] = c(-1), ie = o(() => h.find((e) => e.value === B), [h, B]), ae = !!ie, { floatingStyles: oe, setRef: se, setFloatingRef: ce } = ee({
|
|
625
|
+
open: H,
|
|
626
|
+
onOpenChange: re,
|
|
627
|
+
placement: S,
|
|
628
|
+
matchTriggerWidth: C,
|
|
595
629
|
mobileSheetBreakpoint: 640
|
|
596
|
-
}),
|
|
597
|
-
let e =
|
|
598
|
-
return e >= 0 ? e :
|
|
599
|
-
}, [
|
|
600
|
-
|
|
601
|
-
}, [
|
|
602
|
-
|
|
603
|
-
}, []),
|
|
604
|
-
if (!
|
|
605
|
-
if (
|
|
606
|
-
|
|
630
|
+
}), le = n(() => {
|
|
631
|
+
let e = h.findIndex((e) => e.value === B && !e.disabled);
|
|
632
|
+
return e >= 0 ? e : h.findIndex((e) => !e.disabled);
|
|
633
|
+
}, [h, B]), ue = n(() => {
|
|
634
|
+
b || (W(le()), re(!0));
|
|
635
|
+
}, [b, le]), G = n(() => {
|
|
636
|
+
re(!1);
|
|
637
|
+
}, []), de = n(() => {
|
|
638
|
+
if (!b) {
|
|
639
|
+
if (H) {
|
|
640
|
+
G();
|
|
607
641
|
return;
|
|
608
642
|
}
|
|
609
|
-
|
|
643
|
+
ue();
|
|
610
644
|
}
|
|
611
645
|
}, [
|
|
646
|
+
G,
|
|
647
|
+
b,
|
|
612
648
|
H,
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
V
|
|
616
|
-
]),
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
onOpen: V,
|
|
624
|
-
onClose: H,
|
|
649
|
+
ue
|
|
650
|
+
]), fe = n((e) => {
|
|
651
|
+
V(e), G(), z.current?.focus();
|
|
652
|
+
}, [G, V]), { onKeyDown: pe } = E({
|
|
653
|
+
activeIndex: U,
|
|
654
|
+
setActiveIndex: W,
|
|
655
|
+
items: h,
|
|
656
|
+
isOpen: H,
|
|
657
|
+
onOpen: ue,
|
|
658
|
+
onClose: G,
|
|
625
659
|
onSelect: () => {
|
|
626
|
-
let e =
|
|
627
|
-
!e || e.disabled ||
|
|
628
|
-
}
|
|
660
|
+
let e = h[U];
|
|
661
|
+
!e || e.disabled || fe(e.value);
|
|
662
|
+
},
|
|
663
|
+
getItemText: (e) => e.label
|
|
629
664
|
});
|
|
630
|
-
L([
|
|
631
|
-
let
|
|
632
|
-
|
|
633
|
-
}, [
|
|
634
|
-
|
|
635
|
-
}, [
|
|
636
|
-
return /* @__PURE__ */ p(
|
|
637
|
-
id:
|
|
665
|
+
L([z, ne], G, H);
|
|
666
|
+
let me = n((e) => {
|
|
667
|
+
z.current = e, se(e);
|
|
668
|
+
}, [se]), he = n((e) => {
|
|
669
|
+
ne.current = e, ce(e);
|
|
670
|
+
}, [ce]);
|
|
671
|
+
return /* @__PURE__ */ p(De, {
|
|
672
|
+
id: F,
|
|
638
673
|
label: e,
|
|
639
674
|
description: t,
|
|
640
|
-
error:
|
|
641
|
-
required:
|
|
642
|
-
disabled:
|
|
643
|
-
className:
|
|
675
|
+
error: x,
|
|
676
|
+
required: y,
|
|
677
|
+
disabled: b,
|
|
678
|
+
className: j,
|
|
644
679
|
children: [
|
|
645
|
-
/* @__PURE__ */ f(
|
|
646
|
-
id:
|
|
647
|
-
errorId:
|
|
648
|
-
isOpen:
|
|
649
|
-
disabled:
|
|
650
|
-
required:
|
|
651
|
-
listboxId:
|
|
652
|
-
activeIndex:
|
|
653
|
-
ariaLabel: e ? void 0 :
|
|
654
|
-
error:
|
|
655
|
-
displayText:
|
|
656
|
-
isPlaceholder: !
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
680
|
+
/* @__PURE__ */ f(Me, {
|
|
681
|
+
id: F,
|
|
682
|
+
errorId: te,
|
|
683
|
+
isOpen: H,
|
|
684
|
+
disabled: b,
|
|
685
|
+
required: y,
|
|
686
|
+
listboxId: I,
|
|
687
|
+
activeIndex: U,
|
|
688
|
+
ariaLabel: l ?? (e ? void 0 : ie?.label || g),
|
|
689
|
+
error: R,
|
|
690
|
+
displayText: ie?.label ?? g,
|
|
691
|
+
isPlaceholder: !ae,
|
|
692
|
+
size: v,
|
|
693
|
+
className: M,
|
|
694
|
+
buttonRef: me,
|
|
695
|
+
onClick: de,
|
|
696
|
+
onKeyDown: pe,
|
|
697
|
+
onBlur: k,
|
|
698
|
+
onFocus: A
|
|
660
699
|
}),
|
|
661
700
|
i && /* @__PURE__ */ f("input", {
|
|
662
701
|
type: "hidden",
|
|
663
702
|
name: i,
|
|
664
|
-
value:
|
|
665
|
-
disabled:
|
|
703
|
+
value: B,
|
|
704
|
+
disabled: b
|
|
666
705
|
}),
|
|
667
|
-
/* @__PURE__ */ f(
|
|
668
|
-
isOpen:
|
|
669
|
-
listboxId:
|
|
670
|
-
labelledById:
|
|
671
|
-
style:
|
|
672
|
-
options:
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
706
|
+
/* @__PURE__ */ f(je, {
|
|
707
|
+
isOpen: H,
|
|
708
|
+
listboxId: I,
|
|
709
|
+
labelledById: F,
|
|
710
|
+
style: oe,
|
|
711
|
+
options: h,
|
|
712
|
+
noOptionsText: _,
|
|
713
|
+
selectedValue: B,
|
|
714
|
+
activeIndex: U,
|
|
715
|
+
className: N,
|
|
716
|
+
setDropdownRef: he,
|
|
717
|
+
onSelect: fe,
|
|
718
|
+
onMouseEnter: W
|
|
678
719
|
})
|
|
679
720
|
]
|
|
680
721
|
});
|
|
681
722
|
};
|
|
682
|
-
|
|
723
|
+
Ne.displayName = "Select";
|
|
683
724
|
//#endregion
|
|
684
725
|
//#region src/components/Tabs/TabsContext.tsx
|
|
685
|
-
var
|
|
686
|
-
let e = r(
|
|
726
|
+
var Pe = e(null), Fe = () => {
|
|
727
|
+
let e = r(Pe);
|
|
687
728
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
688
729
|
return e;
|
|
689
|
-
},
|
|
730
|
+
}, Ie = {
|
|
690
731
|
list: "_list_astty_1",
|
|
691
732
|
vertical: "_vertical_astty_8"
|
|
692
|
-
},
|
|
693
|
-
let { orientation: r, appearance: i } =
|
|
733
|
+
}, Le = ({ children: e, className: t, ...n }) => {
|
|
734
|
+
let { orientation: r, appearance: i } = Fe();
|
|
694
735
|
return /* @__PURE__ */ f("div", {
|
|
695
736
|
...n,
|
|
696
737
|
role: "tablist",
|
|
697
738
|
"aria-orientation": r,
|
|
698
|
-
className: M(
|
|
739
|
+
className: M(Ie.list, r === "vertical" && Ie.vertical, i === "underline" && Ie.underline, i === "pills" && Ie.pills, t),
|
|
699
740
|
children: e
|
|
700
741
|
});
|
|
701
742
|
};
|
|
702
|
-
|
|
703
|
-
var
|
|
743
|
+
Le.displayName = "TabsList";
|
|
744
|
+
var Re = {
|
|
704
745
|
panel: "_panel_1e9ds_1",
|
|
705
746
|
visible: "_visible_1e9ds_10",
|
|
706
747
|
vertical: "_vertical_1e9ds_15"
|
|
707
|
-
},
|
|
708
|
-
let { activeIndex: r, orientation: a } =
|
|
748
|
+
}, ze = ({ index: e, children: t, className: n }) => {
|
|
749
|
+
let { activeIndex: r, orientation: a } = Fe(), [o, s] = c(!1), l = r === e;
|
|
709
750
|
return i(() => {
|
|
710
751
|
if (!l) {
|
|
711
752
|
s(!1);
|
|
@@ -719,12 +760,12 @@ var Pe = {
|
|
|
719
760
|
"aria-labelledby": `tab-${e}`,
|
|
720
761
|
hidden: !l,
|
|
721
762
|
tabIndex: 0,
|
|
722
|
-
className: M(
|
|
763
|
+
className: M(Re.panel, o && Re.visible, a === "vertical" && Re.vertical, n),
|
|
723
764
|
children: t
|
|
724
765
|
});
|
|
725
766
|
};
|
|
726
|
-
|
|
727
|
-
var
|
|
767
|
+
ze.displayName = "TabsPanel";
|
|
768
|
+
var Y = {
|
|
728
769
|
tab: "_tab_160gh_1",
|
|
729
770
|
iconOnly: "_iconOnly_160gh_19",
|
|
730
771
|
tabIcon: "_tabIcon_160gh_27",
|
|
@@ -733,8 +774,8 @@ var X = {
|
|
|
733
774
|
underline: "_underline_160gh_53",
|
|
734
775
|
pills: "_pills_160gh_81",
|
|
735
776
|
vertical: "_vertical_160gh_93"
|
|
736
|
-
},
|
|
737
|
-
let { activeIndex: u, setActiveIndex: d, orientation: m, appearance: h = "default", registerTab: g, onTabKeyDown: _ } =
|
|
777
|
+
}, Be = t(({ index: e, children: t, className: r, disabled: i = !1, icon: a, onClick: o, onKeyDown: s, ...c }, l) => {
|
|
778
|
+
let { activeIndex: u, setActiveIndex: d, orientation: m, appearance: h = "default", registerTab: g, onTabKeyDown: _ } = Fe(), v = u === e, y = !!a, b = y && t == null;
|
|
738
779
|
return /* @__PURE__ */ p("button", {
|
|
739
780
|
type: "button",
|
|
740
781
|
ref: n((t) => {
|
|
@@ -750,7 +791,7 @@ var X = {
|
|
|
750
791
|
id: `tab-${e}`,
|
|
751
792
|
disabled: i,
|
|
752
793
|
tabIndex: v ? 0 : -1,
|
|
753
|
-
className: M(
|
|
794
|
+
className: M(Y.tab, Y[h], m === "vertical" && Y.vertical, y && Y.withIcon, b && Y.iconOnly, r),
|
|
754
795
|
onClick: (t) => {
|
|
755
796
|
i || (d(e), o?.(t));
|
|
756
797
|
},
|
|
@@ -759,20 +800,20 @@ var X = {
|
|
|
759
800
|
},
|
|
760
801
|
...c,
|
|
761
802
|
children: [y && /* @__PURE__ */ f("span", {
|
|
762
|
-
className:
|
|
803
|
+
className: Y.tabIcon,
|
|
763
804
|
"aria-hidden": "true",
|
|
764
805
|
children: a
|
|
765
806
|
}), t != null && /* @__PURE__ */ f("span", {
|
|
766
|
-
className:
|
|
807
|
+
className: Y.label,
|
|
767
808
|
children: t
|
|
768
809
|
})]
|
|
769
810
|
});
|
|
770
811
|
});
|
|
771
|
-
|
|
772
|
-
var
|
|
812
|
+
Be.displayName = "Tab";
|
|
813
|
+
var Ve = {
|
|
773
814
|
tabs: "_tabs_15a7w_1",
|
|
774
815
|
vertical: "_vertical_15a7w_4"
|
|
775
|
-
},
|
|
816
|
+
}, He = ({ children: e, activeIndex: t, defaultActiveIndex: r = 0, onChange: i, orientation: a = "horizontal", appearance: o = "default", className: l }) => {
|
|
776
817
|
let [u, d] = c(r), p = t !== void 0, m = p ? t : u, h = n((e) => {
|
|
777
818
|
p || d(e), i?.(e);
|
|
778
819
|
}, [p, i]), g = s([]), _ = n((e, t) => {
|
|
@@ -790,25 +831,25 @@ var Le = {
|
|
|
790
831
|
registerTab: _,
|
|
791
832
|
onTabKeyDown: v
|
|
792
833
|
};
|
|
793
|
-
return /* @__PURE__ */ f(
|
|
834
|
+
return /* @__PURE__ */ f(Pe.Provider, {
|
|
794
835
|
value: y,
|
|
795
836
|
children: /* @__PURE__ */ f("div", {
|
|
796
|
-
className: M(
|
|
837
|
+
className: M(Ve.tabs, a === "vertical" && Ve.vertical, l),
|
|
797
838
|
children: e
|
|
798
839
|
})
|
|
799
840
|
});
|
|
800
841
|
};
|
|
801
|
-
|
|
842
|
+
He.displayName = "Tabs";
|
|
802
843
|
//#endregion
|
|
803
844
|
//#region src/components/Tabs/index.ts
|
|
804
|
-
var
|
|
805
|
-
List:
|
|
806
|
-
Tab:
|
|
807
|
-
Panel:
|
|
808
|
-
}),
|
|
845
|
+
var Ue = Object.assign(He, {
|
|
846
|
+
List: Le,
|
|
847
|
+
Tab: Be,
|
|
848
|
+
Panel: ze
|
|
849
|
+
}), We = {
|
|
809
850
|
tooltip: "_tooltip_frlq7_1",
|
|
810
851
|
arrow: "_arrow_frlq7_22"
|
|
811
|
-
},
|
|
852
|
+
}, Ge = t(({ content: e, placement: t = "top", arrowRef: n, arrowX: r, arrowY: i, className: a, style: o, ...s }, c) => {
|
|
812
853
|
let l = {
|
|
813
854
|
top: "bottom",
|
|
814
855
|
right: "left",
|
|
@@ -823,22 +864,22 @@ var ze = Object.assign(Re, {
|
|
|
823
864
|
};
|
|
824
865
|
return /* @__PURE__ */ p("div", {
|
|
825
866
|
ref: c,
|
|
826
|
-
className: M(
|
|
867
|
+
className: M(We.tooltip, a),
|
|
827
868
|
"data-placement": t,
|
|
828
869
|
"data-state": "open",
|
|
829
870
|
style: o,
|
|
830
871
|
...s,
|
|
831
872
|
children: [e, /* @__PURE__ */ f("div", {
|
|
832
873
|
ref: n,
|
|
833
|
-
className:
|
|
874
|
+
className: We.arrow,
|
|
834
875
|
style: u
|
|
835
876
|
})]
|
|
836
877
|
});
|
|
837
878
|
});
|
|
838
|
-
|
|
879
|
+
Ge.displayName = "TooltipContent";
|
|
839
880
|
//#endregion
|
|
840
881
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
841
|
-
var
|
|
882
|
+
var Ke = ({ children: e, placement: t = "top", content: n, disabled: r = !1, delay: i = {
|
|
842
883
|
open: 300,
|
|
843
884
|
close: 100
|
|
844
885
|
}, maxWidth: o = 250, className: l, onOpenChange: u }) => {
|
|
@@ -859,7 +900,7 @@ var He = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
859
900
|
"aria-describedby": g ? y : void 0,
|
|
860
901
|
...j(),
|
|
861
902
|
children: e
|
|
862
|
-
}), /* @__PURE__ */ f(m, { children: g && n && /* @__PURE__ */ f(
|
|
903
|
+
}), /* @__PURE__ */ f(m, { children: g && n && /* @__PURE__ */ f(Ge, {
|
|
863
904
|
id: y,
|
|
864
905
|
ref: D,
|
|
865
906
|
content: n,
|
|
@@ -876,12 +917,12 @@ var He = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
876
917
|
...M()
|
|
877
918
|
}) })] });
|
|
878
919
|
};
|
|
879
|
-
|
|
920
|
+
Ke.displayName = "Tooltip";
|
|
880
921
|
//#endregion
|
|
881
922
|
//#region src/utils/devWarning.ts
|
|
882
|
-
var
|
|
923
|
+
var qe = (e, t) => {
|
|
883
924
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
884
|
-
},
|
|
925
|
+
}, X = {
|
|
885
926
|
button: "_button_s76yk_1",
|
|
886
927
|
loading: "_loading_s76yk_21",
|
|
887
928
|
solid: "_solid_s76yk_32",
|
|
@@ -900,9 +941,9 @@ var Ue = (e, t) => {
|
|
|
900
941
|
icon: "_icon_s76yk_303",
|
|
901
942
|
spinner: "_spinner_s76yk_329",
|
|
902
943
|
"button-spin": "_button-spin_s76yk_1"
|
|
903
|
-
},
|
|
944
|
+
}, Je = t(({ children: e, color: t = "primary", variant: n = "solid", size: r = "md", type: i = "button", disabled: a = !1, loading: o = !1, loadingText: s, leftIcon: c, rightIcon: l, fullWidth: u = !1, iconOnly: d = !1, className: m, onClick: h, "aria-label": g, ..._ }, v) => {
|
|
904
945
|
let y = d || !e && !!(c || l), b = a || o, x = o && s ? s : e;
|
|
905
|
-
return
|
|
946
|
+
return qe(!y || !!g, "Button: icon-only buttons must provide aria-label."), /* @__PURE__ */ p("button", {
|
|
906
947
|
..._,
|
|
907
948
|
ref: v,
|
|
908
949
|
type: i,
|
|
@@ -910,34 +951,34 @@ var Ue = (e, t) => {
|
|
|
910
951
|
onClick: b ? void 0 : h,
|
|
911
952
|
"aria-label": g || void 0,
|
|
912
953
|
"aria-busy": o || void 0,
|
|
913
|
-
className: M(
|
|
914
|
-
[
|
|
915
|
-
[
|
|
916
|
-
[
|
|
917
|
-
[
|
|
954
|
+
className: M(X.button, X[t], X[n], X[r], m, {
|
|
955
|
+
[X.disabled]: b,
|
|
956
|
+
[X.loading]: o,
|
|
957
|
+
[X.fullWidth]: u,
|
|
958
|
+
[X.iconOnly]: y
|
|
918
959
|
}),
|
|
919
960
|
children: [
|
|
920
961
|
o && /* @__PURE__ */ f("span", {
|
|
921
|
-
className:
|
|
962
|
+
className: X.spinner,
|
|
922
963
|
"aria-hidden": "true"
|
|
923
964
|
}),
|
|
924
965
|
!o && c && /* @__PURE__ */ f("span", {
|
|
925
|
-
className:
|
|
966
|
+
className: X.icon,
|
|
926
967
|
children: c
|
|
927
968
|
}),
|
|
928
969
|
x && !y && /* @__PURE__ */ f("span", {
|
|
929
|
-
className:
|
|
970
|
+
className: X.label,
|
|
930
971
|
children: x
|
|
931
972
|
}),
|
|
932
973
|
!o && l && /* @__PURE__ */ f("span", {
|
|
933
|
-
className:
|
|
974
|
+
className: X.icon,
|
|
934
975
|
children: l
|
|
935
976
|
})
|
|
936
977
|
]
|
|
937
978
|
});
|
|
938
979
|
});
|
|
939
|
-
|
|
940
|
-
var
|
|
980
|
+
Je.displayName = "Button";
|
|
981
|
+
var Z = {
|
|
941
982
|
wrapper: "_wrapper_1xtic_1",
|
|
942
983
|
wrapperSm: "_wrapperSm_1xtic_12",
|
|
943
984
|
wrapperMd: "_wrapperMd_1xtic_18",
|
|
@@ -961,19 +1002,19 @@ var Q = {
|
|
|
961
1002
|
indeterminate: "_indeterminate_1xtic_108",
|
|
962
1003
|
error: "_error_1xtic_130",
|
|
963
1004
|
disabled: "_disabled_1xtic_200"
|
|
964
|
-
},
|
|
965
|
-
sm:
|
|
966
|
-
md:
|
|
967
|
-
lg:
|
|
968
|
-
},
|
|
969
|
-
sm:
|
|
970
|
-
md:
|
|
971
|
-
lg:
|
|
972
|
-
},
|
|
973
|
-
sm:
|
|
974
|
-
md:
|
|
975
|
-
lg:
|
|
976
|
-
},
|
|
1005
|
+
}, Ye = {
|
|
1006
|
+
sm: Z.labelSm,
|
|
1007
|
+
md: Z.labelMd,
|
|
1008
|
+
lg: Z.labelLg
|
|
1009
|
+
}, Xe = {
|
|
1010
|
+
sm: Z.wrapperSm,
|
|
1011
|
+
md: Z.wrapperMd,
|
|
1012
|
+
lg: Z.wrapperLg
|
|
1013
|
+
}, Ze = {
|
|
1014
|
+
sm: Z.containerSm,
|
|
1015
|
+
md: Z.containerMd,
|
|
1016
|
+
lg: Z.containerLg
|
|
1017
|
+
}, Qe = t(({ id: e, label: t, description: r, checked: o, size: c = "md", defaultChecked: l = !1, disabled: u = !1, required: d = !1, indeterminate: m = !1, className: h, wrapperClassName: g, onCheckedChange: _, error: v, "aria-label": y, "aria-labelledby": b, "aria-describedby": x, ...S }, C) => {
|
|
977
1018
|
let w = a(), E = e ?? w, D = s(null), k = !!v, A = r ? `${E}-description` : void 0, j = k ? `${E}-error` : void 0, N = [
|
|
978
1019
|
x,
|
|
979
1020
|
A,
|
|
@@ -995,12 +1036,12 @@ var Q = {
|
|
|
995
1036
|
let ee = (e) => {
|
|
996
1037
|
F(e.target.checked);
|
|
997
1038
|
};
|
|
998
|
-
return
|
|
999
|
-
className: M(
|
|
1039
|
+
return qe(!!(t || y || b), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ p("div", {
|
|
1040
|
+
className: M(Z.container, Ze[c], h),
|
|
1000
1041
|
children: [
|
|
1001
1042
|
/* @__PURE__ */ p("label", {
|
|
1002
1043
|
htmlFor: E,
|
|
1003
|
-
className: M(
|
|
1044
|
+
className: M(Z.wrapper, Xe[c], !t && Z.iconOnly, u && Z.disabled, g),
|
|
1004
1045
|
children: [
|
|
1005
1046
|
/* @__PURE__ */ f("input", {
|
|
1006
1047
|
...S,
|
|
@@ -1011,7 +1052,7 @@ var Q = {
|
|
|
1011
1052
|
disabled: u,
|
|
1012
1053
|
required: d,
|
|
1013
1054
|
onChange: ee,
|
|
1014
|
-
className:
|
|
1055
|
+
className: Z.input,
|
|
1015
1056
|
"aria-label": y,
|
|
1016
1057
|
"aria-labelledby": b,
|
|
1017
1058
|
"aria-checked": m ? "mixed" : S["aria-checked"],
|
|
@@ -1019,17 +1060,17 @@ var Q = {
|
|
|
1019
1060
|
"aria-describedby": N || void 0
|
|
1020
1061
|
}),
|
|
1021
1062
|
/* @__PURE__ */ f("span", {
|
|
1022
|
-
className: M(
|
|
1063
|
+
className: M(Z.customCheckbox, k && Z.error, m && Z.indeterminate),
|
|
1023
1064
|
"aria-hidden": "true",
|
|
1024
|
-
children: m ? /* @__PURE__ */ f("span", { className:
|
|
1025
|
-
className:
|
|
1065
|
+
children: m ? /* @__PURE__ */ f("span", { className: Z.indeterminateMark }) : P && /* @__PURE__ */ f("span", {
|
|
1066
|
+
className: Z.checkmark,
|
|
1026
1067
|
children: /* @__PURE__ */ f(O, {})
|
|
1027
1068
|
})
|
|
1028
1069
|
}),
|
|
1029
1070
|
t && /* @__PURE__ */ p("span", {
|
|
1030
|
-
className: M(
|
|
1071
|
+
className: M(Z.label, Ye[c]),
|
|
1031
1072
|
children: [t, d && /* @__PURE__ */ f("span", {
|
|
1032
|
-
className:
|
|
1073
|
+
className: Z.requiredMark,
|
|
1033
1074
|
"aria-hidden": "true",
|
|
1034
1075
|
children: "*"
|
|
1035
1076
|
})]
|
|
@@ -1038,46 +1079,46 @@ var Q = {
|
|
|
1038
1079
|
}),
|
|
1039
1080
|
r && /* @__PURE__ */ f("span", {
|
|
1040
1081
|
id: A,
|
|
1041
|
-
className:
|
|
1082
|
+
className: Z.descriptionText,
|
|
1042
1083
|
children: r
|
|
1043
1084
|
}),
|
|
1044
1085
|
k && /* @__PURE__ */ f("span", {
|
|
1045
1086
|
id: j,
|
|
1046
|
-
className:
|
|
1087
|
+
className: Z.errorText,
|
|
1047
1088
|
children: v
|
|
1048
1089
|
})
|
|
1049
1090
|
]
|
|
1050
1091
|
});
|
|
1051
1092
|
});
|
|
1052
|
-
|
|
1053
|
-
var
|
|
1054
|
-
inputWrapper: "
|
|
1055
|
-
input: "
|
|
1056
|
-
error: "
|
|
1057
|
-
sm: "
|
|
1058
|
-
md: "
|
|
1059
|
-
lg: "
|
|
1060
|
-
hasLeftAdornment: "
|
|
1061
|
-
hasRightAdornment: "
|
|
1062
|
-
leftAdornment: "
|
|
1063
|
-
rightAdornment: "
|
|
1064
|
-
clearButton: "
|
|
1065
|
-
toneDefault: "
|
|
1066
|
-
tonePrimary: "
|
|
1067
|
-
toneSecondary: "
|
|
1068
|
-
toneSuccess: "
|
|
1069
|
-
toneDanger: "
|
|
1070
|
-
toneMuted: "
|
|
1071
|
-
toneInverse: "
|
|
1072
|
-
},
|
|
1073
|
-
default:
|
|
1074
|
-
primary:
|
|
1075
|
-
secondary:
|
|
1076
|
-
success:
|
|
1077
|
-
danger:
|
|
1078
|
-
muted:
|
|
1079
|
-
inverse:
|
|
1080
|
-
},
|
|
1093
|
+
Qe.displayName = "Checkbox";
|
|
1094
|
+
var Q = {
|
|
1095
|
+
inputWrapper: "_inputWrapper_1553r_1",
|
|
1096
|
+
input: "_input_1553r_1",
|
|
1097
|
+
error: "_error_1553r_47",
|
|
1098
|
+
sm: "_sm_1553r_54",
|
|
1099
|
+
md: "_md_1553r_58",
|
|
1100
|
+
lg: "_lg_1553r_62",
|
|
1101
|
+
hasLeftAdornment: "_hasLeftAdornment_1553r_90",
|
|
1102
|
+
hasRightAdornment: "_hasRightAdornment_1553r_94",
|
|
1103
|
+
leftAdornment: "_leftAdornment_1553r_98",
|
|
1104
|
+
rightAdornment: "_rightAdornment_1553r_99",
|
|
1105
|
+
clearButton: "_clearButton_1553r_120",
|
|
1106
|
+
toneDefault: "_toneDefault_1553r_159",
|
|
1107
|
+
tonePrimary: "_tonePrimary_1553r_163",
|
|
1108
|
+
toneSecondary: "_toneSecondary_1553r_167",
|
|
1109
|
+
toneSuccess: "_toneSuccess_1553r_171",
|
|
1110
|
+
toneDanger: "_toneDanger_1553r_175",
|
|
1111
|
+
toneMuted: "_toneMuted_1553r_179",
|
|
1112
|
+
toneInverse: "_toneInverse_1553r_183"
|
|
1113
|
+
}, $e = {
|
|
1114
|
+
default: Q.toneDefault,
|
|
1115
|
+
primary: Q.tonePrimary,
|
|
1116
|
+
secondary: Q.toneSecondary,
|
|
1117
|
+
success: Q.toneSuccess,
|
|
1118
|
+
danger: Q.toneDanger,
|
|
1119
|
+
muted: Q.toneMuted,
|
|
1120
|
+
inverse: Q.toneInverse
|
|
1121
|
+
}, et = (e = "text", t) => {
|
|
1081
1122
|
if (t) return t;
|
|
1082
1123
|
switch (e) {
|
|
1083
1124
|
case "email": return "email";
|
|
@@ -1087,51 +1128,51 @@ var $ = {
|
|
|
1087
1128
|
case "search": return "off";
|
|
1088
1129
|
default: return;
|
|
1089
1130
|
}
|
|
1090
|
-
},
|
|
1091
|
-
let R = a(),
|
|
1131
|
+
}, tt = t(({ id: e, label: t, name: r, description: i, placeholder: o, value: l, defaultValue: u, onChange: d, type: m = "text", size: h = "md", error: g, disabled: _ = !1, required: v = !1, className: y, autoComplete: b, readOnly: x = !1, clearable: S = !1, onClear: C, leftAdornment: w, rightAdornment: T, clearIcon: E, leftAdornmentTone: D = "default", rightAdornmentTone: O = "default", clearIconTone: k = "danger", autoFocus: A, maxLength: j, onMouseEnter: N, onMouseLeave: P, "aria-describedby": F, "aria-invalid": I, ...ee }, L) => {
|
|
1132
|
+
let R = a(), te = e ?? R, z = s(null), [ne, B] = c(u ?? ""), V = l !== void 0, H = V ? l : ne, re = H !== "", U = et(m, b), W = S && re && !_ && !x, ie = [
|
|
1092
1133
|
F,
|
|
1093
|
-
i ? `${
|
|
1094
|
-
g ? `${
|
|
1095
|
-
].filter(Boolean).join(" "),
|
|
1096
|
-
if (
|
|
1134
|
+
i ? `${te}-description` : void 0,
|
|
1135
|
+
g ? `${te}-error` : void 0
|
|
1136
|
+
].filter(Boolean).join(" "), ae = E ?? "×", oe = n((e) => {
|
|
1137
|
+
if (z.current = e, typeof L == "function") {
|
|
1097
1138
|
L(e);
|
|
1098
1139
|
return;
|
|
1099
1140
|
}
|
|
1100
1141
|
L && (L.current = e);
|
|
1101
|
-
}, [L]),
|
|
1142
|
+
}, [L]), se = n((e) => {
|
|
1102
1143
|
let t = e.target.value;
|
|
1103
|
-
|
|
1104
|
-
}, [
|
|
1105
|
-
|
|
1106
|
-
}, [
|
|
1107
|
-
return /* @__PURE__ */ f(
|
|
1108
|
-
id:
|
|
1144
|
+
V || B(t), d?.(e);
|
|
1145
|
+
}, [V, d]), ce = n(() => {
|
|
1146
|
+
V || B(""), C?.(), z.current?.focus();
|
|
1147
|
+
}, [V, C]), le = !W && !!T;
|
|
1148
|
+
return /* @__PURE__ */ f(De, {
|
|
1149
|
+
id: te,
|
|
1109
1150
|
label: t,
|
|
1110
1151
|
description: i,
|
|
1111
1152
|
error: g,
|
|
1112
1153
|
required: v,
|
|
1113
1154
|
disabled: _,
|
|
1114
1155
|
children: /* @__PURE__ */ p("div", {
|
|
1115
|
-
className: M(
|
|
1116
|
-
[
|
|
1117
|
-
[
|
|
1156
|
+
className: M(Q.inputWrapper, {
|
|
1157
|
+
[Q.hasLeftAdornment]: !!w,
|
|
1158
|
+
[Q.hasRightAdornment]: !!T || W
|
|
1118
1159
|
}),
|
|
1119
1160
|
children: [
|
|
1120
1161
|
w && /* @__PURE__ */ f("span", {
|
|
1121
1162
|
"aria-hidden": "true",
|
|
1122
|
-
className: M(
|
|
1163
|
+
className: M(Q.leftAdornment, $e[D]),
|
|
1123
1164
|
children: w
|
|
1124
1165
|
}),
|
|
1125
1166
|
/* @__PURE__ */ f("input", {
|
|
1126
1167
|
...ee,
|
|
1127
|
-
ref:
|
|
1128
|
-
id:
|
|
1168
|
+
ref: oe,
|
|
1169
|
+
id: te,
|
|
1129
1170
|
name: r,
|
|
1130
1171
|
type: m,
|
|
1131
|
-
autoComplete:
|
|
1132
|
-
className: M(
|
|
1133
|
-
value:
|
|
1134
|
-
onChange:
|
|
1172
|
+
autoComplete: U,
|
|
1173
|
+
className: M(Q.input, Q[h], { [Q.error]: !!g }, y),
|
|
1174
|
+
value: H,
|
|
1175
|
+
onChange: se,
|
|
1135
1176
|
placeholder: o,
|
|
1136
1177
|
disabled: _,
|
|
1137
1178
|
readOnly: x,
|
|
@@ -1139,34 +1180,114 @@ var $ = {
|
|
|
1139
1180
|
autoFocus: A,
|
|
1140
1181
|
maxLength: j,
|
|
1141
1182
|
"aria-invalid": g ? !0 : I,
|
|
1142
|
-
"aria-describedby":
|
|
1183
|
+
"aria-describedby": ie || void 0,
|
|
1143
1184
|
onMouseEnter: N,
|
|
1144
1185
|
onMouseLeave: P
|
|
1145
1186
|
}),
|
|
1146
|
-
|
|
1187
|
+
W && /* @__PURE__ */ f("button", {
|
|
1147
1188
|
type: "button",
|
|
1148
|
-
className: M(
|
|
1149
|
-
onClick:
|
|
1189
|
+
className: M(Q.clearButton, $e[k]),
|
|
1190
|
+
onClick: ce,
|
|
1150
1191
|
"aria-label": "Clear input",
|
|
1151
|
-
children:
|
|
1192
|
+
children: ae
|
|
1152
1193
|
}),
|
|
1153
|
-
|
|
1154
|
-
className: M(
|
|
1194
|
+
le && /* @__PURE__ */ f("div", {
|
|
1195
|
+
className: M(Q.rightAdornment, $e[O]),
|
|
1155
1196
|
children: T
|
|
1156
1197
|
})
|
|
1157
1198
|
]
|
|
1158
1199
|
})
|
|
1159
1200
|
});
|
|
1160
1201
|
});
|
|
1161
|
-
|
|
1202
|
+
tt.displayName = "Input";
|
|
1203
|
+
var $ = {
|
|
1204
|
+
root: "_root_6w580_1",
|
|
1205
|
+
invalid: "_invalid_6w580_14",
|
|
1206
|
+
control: "_control_6w580_14",
|
|
1207
|
+
label: "_label_6w580_17",
|
|
1208
|
+
wrapper: "_wrapper_6w580_20",
|
|
1209
|
+
input: "_input_6w580_21",
|
|
1210
|
+
disabled: "_disabled_6w580_24",
|
|
1211
|
+
description: "_description_6w580_32",
|
|
1212
|
+
sm: "_sm_6w580_36",
|
|
1213
|
+
md: "_md_6w580_45",
|
|
1214
|
+
lg: "_lg_6w580_54",
|
|
1215
|
+
indicator: "_indicator_6w580_109",
|
|
1216
|
+
content: "_content_6w580_182",
|
|
1217
|
+
error: "_error_6w580_198"
|
|
1218
|
+
}, nt = t(({ value: e, checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, size: o, error: s, onCheckedChange: c, label: l, description: u, wrapperClassName: d, className: m, id: h, name: g, "aria-describedby": _, ...v }, y) => {
|
|
1219
|
+
let b = Te(), x = a(), S = h ?? x, C = u ? `${S}-description` : void 0, w = s ? `${S}-error` : void 0, E = [
|
|
1220
|
+
C,
|
|
1221
|
+
w,
|
|
1222
|
+
b?.describedBy,
|
|
1223
|
+
_
|
|
1224
|
+
].filter(Boolean).join(" ") || void 0, D = b !== null, [O, k] = T({
|
|
1225
|
+
value: t,
|
|
1226
|
+
defaultValue: n,
|
|
1227
|
+
onChange: c
|
|
1228
|
+
}), A = D ? b.value === e : O, j = !!b?.disabled || r, N = !!b?.required || i, P = b?.name ?? g, F = !!(s || b?.invalid), I = o ?? b?.size ?? "md", ee = (t) => {
|
|
1229
|
+
if (!j) {
|
|
1230
|
+
if (D) {
|
|
1231
|
+
b.onValueChange(e);
|
|
1232
|
+
return;
|
|
1233
|
+
}
|
|
1234
|
+
k(t.currentTarget.checked);
|
|
1235
|
+
}
|
|
1236
|
+
};
|
|
1237
|
+
return /* @__PURE__ */ p("div", {
|
|
1238
|
+
className: M($.root, $[I], F && $.invalid, j && $.disabled, m),
|
|
1239
|
+
children: [/* @__PURE__ */ p("label", {
|
|
1240
|
+
htmlFor: S,
|
|
1241
|
+
className: M($.wrapper, d),
|
|
1242
|
+
children: [
|
|
1243
|
+
/* @__PURE__ */ f("input", {
|
|
1244
|
+
...v,
|
|
1245
|
+
ref: y,
|
|
1246
|
+
id: S,
|
|
1247
|
+
type: "radio",
|
|
1248
|
+
name: P,
|
|
1249
|
+
value: e,
|
|
1250
|
+
checked: A,
|
|
1251
|
+
disabled: j,
|
|
1252
|
+
required: N,
|
|
1253
|
+
"aria-invalid": F || void 0,
|
|
1254
|
+
"aria-describedby": E,
|
|
1255
|
+
className: $.input,
|
|
1256
|
+
onChange: ee
|
|
1257
|
+
}),
|
|
1258
|
+
/* @__PURE__ */ f("span", {
|
|
1259
|
+
className: $.control,
|
|
1260
|
+
"aria-hidden": "true",
|
|
1261
|
+
children: /* @__PURE__ */ f("span", { className: $.indicator })
|
|
1262
|
+
}),
|
|
1263
|
+
(l || u) && /* @__PURE__ */ p("span", {
|
|
1264
|
+
className: $.content,
|
|
1265
|
+
children: [l && /* @__PURE__ */ f("span", {
|
|
1266
|
+
className: $.label,
|
|
1267
|
+
children: l
|
|
1268
|
+
}), u && /* @__PURE__ */ f("span", {
|
|
1269
|
+
id: C,
|
|
1270
|
+
className: $.description,
|
|
1271
|
+
children: u
|
|
1272
|
+
})]
|
|
1273
|
+
})
|
|
1274
|
+
]
|
|
1275
|
+
}), s && /* @__PURE__ */ f("div", {
|
|
1276
|
+
id: w,
|
|
1277
|
+
className: $.error,
|
|
1278
|
+
children: s
|
|
1279
|
+
})]
|
|
1280
|
+
});
|
|
1281
|
+
});
|
|
1282
|
+
nt.displayName = "Radio";
|
|
1162
1283
|
//#endregion
|
|
1163
1284
|
//#region src/theme/ThemeContext.ts
|
|
1164
|
-
var
|
|
1285
|
+
var rt = e(null), it = (e) => e === "highContrast" ? "high-contrast" : e, at = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
|
|
1165
1286
|
let [a, s] = T({
|
|
1166
1287
|
value: e,
|
|
1167
1288
|
defaultValue: t,
|
|
1168
1289
|
onChange: n
|
|
1169
|
-
}), c =
|
|
1290
|
+
}), c = it(a);
|
|
1170
1291
|
i(() => {
|
|
1171
1292
|
if (typeof document > "u") return;
|
|
1172
1293
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -1182,7 +1303,7 @@ var Qe = e(null), $e = (e) => e === "highContrast" ? "high-contrast" : e, et = (
|
|
|
1182
1303
|
theme: a,
|
|
1183
1304
|
setTheme: s
|
|
1184
1305
|
}), [a, s]);
|
|
1185
|
-
return /* @__PURE__ */ f(
|
|
1306
|
+
return /* @__PURE__ */ f(rt.Provider, {
|
|
1186
1307
|
value: l,
|
|
1187
1308
|
children: /* @__PURE__ */ f("div", {
|
|
1188
1309
|
"data-vellira-theme": c,
|
|
@@ -1190,13 +1311,13 @@ var Qe = e(null), $e = (e) => e === "highContrast" ? "high-contrast" : e, et = (
|
|
|
1190
1311
|
})
|
|
1191
1312
|
});
|
|
1192
1313
|
};
|
|
1193
|
-
|
|
1314
|
+
at.displayName = "ThemeProvider";
|
|
1194
1315
|
//#endregion
|
|
1195
1316
|
//#region src/theme/useTheme.ts
|
|
1196
|
-
function
|
|
1197
|
-
let e = r(
|
|
1317
|
+
function ot() {
|
|
1318
|
+
let e = r(rt);
|
|
1198
1319
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
1199
1320
|
return e;
|
|
1200
1321
|
}
|
|
1201
1322
|
//#endregion
|
|
1202
|
-
export {
|
|
1323
|
+
export { Je as Button, Qe as Checkbox, oe as Dropdown, De as FormField, tt as Input, Se as Modal, nt as Radio, Ee as RadioGroup, Ne as Select, Ue as Tabs, at as ThemeProvider, Ke as Tooltip, ot as useTheme };
|