@vellira-ui/react 2.25.1 → 2.26.1
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 +21 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +549 -570
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,21 +3,21 @@ import l from "clsx";
|
|
|
3
3
|
import { createPortal as u } from "react-dom";
|
|
4
4
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
5
|
import { FloatingPortal as m, arrow as h, autoUpdate as g, flip as _, offset as v, shift as y, size as b, useFloating as x, useFocus as S, useHover as C, useInteractions as w } from "@floating-ui/react";
|
|
6
|
-
import { useControllableState as T,
|
|
7
|
-
import { Check as
|
|
8
|
-
import
|
|
6
|
+
import { useControllableState as T, useDropdown as E, useModal as D, useSelect as O, useTabs as k, useTabsKeyboard as A } from "@vellira-ui/core";
|
|
7
|
+
import { Check as j, ChevronDown as M, Close as N } from "@vellira-ui/icons";
|
|
8
|
+
import P from "focus-trap-react";
|
|
9
9
|
//#region src/utils/cn.ts
|
|
10
|
-
var
|
|
10
|
+
var F = (...e) => l(e), I = ({ children: e }) => {
|
|
11
11
|
let [t, n] = c(!1);
|
|
12
12
|
if (i(() => {
|
|
13
13
|
n(!0);
|
|
14
14
|
}, []), !t) return null;
|
|
15
15
|
let r = document.getElementById("overlay-root") ?? document.body;
|
|
16
16
|
return r ? u(e, r) : null;
|
|
17
|
-
},
|
|
18
|
-
dropdown: "
|
|
19
|
-
|
|
20
|
-
},
|
|
17
|
+
}, L = {
|
|
18
|
+
dropdown: "_dropdown_1rvx9_1",
|
|
19
|
+
"dropdown-in": "_dropdown-in_1rvx9_1"
|
|
20
|
+
}, R = t(({ children: e, floatingStyles: t, menuId: n, labelledById: r, label: i, activeDescendantId: a, onKeyDown: o, className: s }, c) => /* @__PURE__ */ f(I, { children: /* @__PURE__ */ f("ul", {
|
|
21
21
|
ref: c,
|
|
22
22
|
id: n,
|
|
23
23
|
role: "menu",
|
|
@@ -27,13 +27,13 @@ var M = (...e) => l(e), N = ({ children: e }) => {
|
|
|
27
27
|
"aria-activedescendant": a,
|
|
28
28
|
onKeyDown: o,
|
|
29
29
|
style: t,
|
|
30
|
-
className:
|
|
30
|
+
className: F(L.dropdown, s),
|
|
31
31
|
children: e
|
|
32
32
|
}) }));
|
|
33
|
-
|
|
33
|
+
R.displayName = "DropdownContent";
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/hooks/useFloatingPosition.ts
|
|
36
|
-
var
|
|
36
|
+
var z = (e) => {
|
|
37
37
|
let [t, n] = c(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
38
38
|
return i(() => {
|
|
39
39
|
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
@@ -42,15 +42,15 @@ var I = (e) => {
|
|
|
42
42
|
t.removeEventListener("change", r);
|
|
43
43
|
};
|
|
44
44
|
}, [e]), t;
|
|
45
|
-
},
|
|
46
|
-
let l =
|
|
45
|
+
}, B = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", matchTriggerWidth: a = !1, mobileSheetBreakpoint: s, middleware: c = [] } = {}) => {
|
|
46
|
+
let l = z(s), { refs: u, floatingStyles: d, update: f, context: p, middlewareData: m, placement: h } = x({
|
|
47
47
|
open: e,
|
|
48
48
|
onOpenChange: t,
|
|
49
49
|
placement: n,
|
|
50
50
|
strategy: r,
|
|
51
51
|
transform: !1,
|
|
52
52
|
middleware: o(() => [
|
|
53
|
-
v(
|
|
53
|
+
v(2),
|
|
54
54
|
_(),
|
|
55
55
|
b({ apply({ rects: e, elements: t }) {
|
|
56
56
|
!a || l || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
@@ -76,7 +76,7 @@ var I = (e) => {
|
|
|
76
76
|
setFloatingRef: u.setFloating,
|
|
77
77
|
updatePosition: f
|
|
78
78
|
};
|
|
79
|
-
},
|
|
79
|
+
}, ee = (e, t, n = !0) => {
|
|
80
80
|
let r = s(e);
|
|
81
81
|
r.current = e;
|
|
82
82
|
let a = s(t);
|
|
@@ -88,21 +88,21 @@ var I = (e) => {
|
|
|
88
88
|
};
|
|
89
89
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
90
90
|
}, [n]);
|
|
91
|
-
},
|
|
91
|
+
}, V = { group: "_group_aviwv_1" }, te = ({ label: e }) => /* @__PURE__ */ f("li", {
|
|
92
92
|
role: "presentation",
|
|
93
|
-
className:
|
|
93
|
+
className: V.group,
|
|
94
94
|
children: e
|
|
95
|
-
}),
|
|
96
|
-
item: "
|
|
97
|
-
disabled: "
|
|
98
|
-
active: "
|
|
99
|
-
danger: "
|
|
100
|
-
itemIcon: "
|
|
101
|
-
itemShortcut: "
|
|
102
|
-
itemText: "
|
|
103
|
-
"itemText--truncate": "_itemText--
|
|
104
|
-
"itemText--wrap": "_itemText--
|
|
105
|
-
"itemText--nowrap": "_itemText--
|
|
95
|
+
}), H = {
|
|
96
|
+
item: "_item_re11y_1",
|
|
97
|
+
disabled: "_disabled_re11y_21",
|
|
98
|
+
active: "_active_re11y_34",
|
|
99
|
+
danger: "_danger_re11y_40",
|
|
100
|
+
itemIcon: "_itemIcon_re11y_62",
|
|
101
|
+
itemShortcut: "_itemShortcut_re11y_63",
|
|
102
|
+
itemText: "_itemText_re11y_82",
|
|
103
|
+
"itemText--truncate": "_itemText--truncate_re11y_88",
|
|
104
|
+
"itemText--wrap": "_itemText--wrap_re11y_93",
|
|
105
|
+
"itemText--nowrap": "_itemText--nowrap_re11y_97"
|
|
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", {
|
|
@@ -114,228 +114,232 @@ 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:
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
117
|
+
className: F(H.item, {
|
|
118
|
+
[H.active]: o,
|
|
119
|
+
[H.disabled]: a,
|
|
120
|
+
[H.danger]: i
|
|
121
121
|
}, d),
|
|
122
122
|
children: [
|
|
123
123
|
r && /* @__PURE__ */ f("span", {
|
|
124
124
|
"aria-hidden": "true",
|
|
125
|
-
className:
|
|
125
|
+
className: H.itemIcon,
|
|
126
126
|
children: r
|
|
127
127
|
}),
|
|
128
128
|
m && /* @__PURE__ */ f("span", {
|
|
129
|
-
className:
|
|
129
|
+
className: F(H.itemText, H[`itemText--${u}`]),
|
|
130
130
|
children: m
|
|
131
131
|
}),
|
|
132
132
|
l && /* @__PURE__ */ f("span", {
|
|
133
|
-
className:
|
|
133
|
+
className: H.itemShortcut,
|
|
134
134
|
children: l
|
|
135
135
|
})
|
|
136
136
|
]
|
|
137
137
|
});
|
|
138
|
-
},
|
|
138
|
+
}, U = { separator: "_separator_1v11r_1" }, re = () => /* @__PURE__ */ f("li", {
|
|
139
139
|
role: "separator",
|
|
140
|
-
className:
|
|
140
|
+
className: U.separator,
|
|
141
141
|
"aria-hidden": "true"
|
|
142
|
-
}),
|
|
143
|
-
button: "
|
|
144
|
-
disabled: "
|
|
145
|
-
iconLeft: "
|
|
146
|
-
arrow: "
|
|
147
|
-
iconOnly: "
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
142
|
+
}), W = {
|
|
143
|
+
button: "_button_18ucr_1",
|
|
144
|
+
disabled: "_disabled_18ucr_20",
|
|
145
|
+
iconLeft: "_iconLeft_18ucr_32",
|
|
146
|
+
arrow: "_arrow_18ucr_44",
|
|
147
|
+
iconOnly: "_iconOnly_18ucr_47",
|
|
148
|
+
sm: "_sm_18ucr_60",
|
|
149
|
+
md: "_md_18ucr_72",
|
|
150
|
+
lg: "_lg_18ucr_84",
|
|
151
|
+
open: "_open_18ucr_123"
|
|
152
|
+
}, ie = t(({ children: e, isOpen: t, icon: n, arrowIcon: r, showArrow: i = !0, rotateAngle: a = 90, size: o = "md", label: s, ariaLabel: c, className: l, ...u }, d) => {
|
|
153
|
+
let m = !!n, h = !!e, g = m && !h, _ = i && h, v = r ?? /* @__PURE__ */ f(M, {}), y = c ?? (g ? typeof s == "string" ? s : "Open menu" : void 0);
|
|
151
154
|
return /* @__PURE__ */ p("button", {
|
|
152
|
-
...
|
|
153
|
-
ref:
|
|
155
|
+
...u,
|
|
156
|
+
ref: d,
|
|
154
157
|
type: "button",
|
|
155
|
-
className:
|
|
156
|
-
[
|
|
157
|
-
[
|
|
158
|
-
},
|
|
159
|
-
"aria-label":
|
|
158
|
+
className: F(W.button, W[o], {
|
|
159
|
+
[W.disabled]: u.disabled,
|
|
160
|
+
[W.iconOnly]: g
|
|
161
|
+
}, l),
|
|
162
|
+
"aria-label": y,
|
|
160
163
|
"aria-expanded": t,
|
|
161
164
|
"aria-haspopup": "menu",
|
|
162
165
|
style: { "--dropdown-rotate-angle": `${a}deg` },
|
|
163
166
|
children: [
|
|
164
|
-
|
|
167
|
+
m && /* @__PURE__ */ f("span", {
|
|
165
168
|
"aria-hidden": "true",
|
|
166
|
-
className:
|
|
169
|
+
className: W.iconLeft,
|
|
167
170
|
children: n
|
|
168
171
|
}),
|
|
169
172
|
e,
|
|
170
|
-
|
|
173
|
+
_ && /* @__PURE__ */ f("span", {
|
|
171
174
|
"aria-hidden": "true",
|
|
172
|
-
className:
|
|
173
|
-
children:
|
|
175
|
+
className: F(W.arrow, { [W.open]: t }),
|
|
176
|
+
children: v
|
|
174
177
|
})
|
|
175
178
|
]
|
|
176
179
|
});
|
|
177
180
|
});
|
|
178
|
-
|
|
181
|
+
ie.displayName = "DropdownTrigger";
|
|
179
182
|
//#endregion
|
|
180
183
|
//#region src/components/Dropdown/types.ts
|
|
181
|
-
var
|
|
182
|
-
let
|
|
183
|
-
placement:
|
|
184
|
-
matchTriggerWidth:
|
|
184
|
+
var ae = (e) => e.type === void 0 || e.type === "item", oe = (e) => e.type === "group", se = (e) => e.type === "separator", ce = { wrapper: "_wrapper_14ue8_1" }, le = ({ label: e, ariaLabel: t, icon: r, trigger: i, items: c = [], onSelect: l, open: u, defaultOpen: d = !1, onOpenChange: m, size: h = "md", className: g, triggerClassName: _, contentClassName: v, itemClassName: y, disabled: b, rotateAngle: x = 90, placement: S, matchTriggerWidth: C, textWrap: w, showArrow: T = !0, arrowIcon: D }) => {
|
|
185
|
+
let O = s(null), k = s(null), A = a(), j = `${A}-trigger`, { floatingStyles: M, setRef: N, setFloatingRef: P } = B({
|
|
186
|
+
placement: S,
|
|
187
|
+
matchTriggerWidth: C,
|
|
185
188
|
mobileSheetBreakpoint: 640
|
|
186
|
-
}),
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
})
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
S.current = e, O(e);
|
|
210
|
-
}, H = (e) => {
|
|
211
|
-
C.current = e, k(e), e?.focus();
|
|
212
|
-
};
|
|
189
|
+
}), I = o(() => c.flatMap((e, t) => ae(e) ? [{
|
|
190
|
+
item: e,
|
|
191
|
+
itemIndex: t
|
|
192
|
+
}] : []), [c]), L = o(() => I.map(({ item: e }) => e), [I]), z = o(() => new Map(I.map(({ itemIndex: e }, t) => [e, t])), [I]), { activeIndex: V, setActiveIndex: H, isOpen: U, closeDropdown: W, toggleDropdown: le, selectItem: ue, onKeyDown: G } = E({
|
|
193
|
+
items: L,
|
|
194
|
+
open: u,
|
|
195
|
+
defaultOpen: d,
|
|
196
|
+
disabled: b,
|
|
197
|
+
onOpenChange: m,
|
|
198
|
+
onSelect: n((e) => {
|
|
199
|
+
l?.(e), O.current?.focus();
|
|
200
|
+
}, [l]),
|
|
201
|
+
getItemValue: (e) => e.value,
|
|
202
|
+
getItemText: (e) => typeof e.label == "string" ? e.label : e.value
|
|
203
|
+
}), de = U && V >= 0 ? `${A}-item-${V}` : void 0;
|
|
204
|
+
ee([O, k], W, U);
|
|
205
|
+
let fe = n((e) => {
|
|
206
|
+
G(e), U && e.key === "Escape" && O.current?.focus();
|
|
207
|
+
}, [U, G]), pe = n((e) => {
|
|
208
|
+
O.current = e, N(e);
|
|
209
|
+
}, [N]), me = n((e) => {
|
|
210
|
+
k.current = e, P(e), e?.focus();
|
|
211
|
+
}, [P]);
|
|
213
212
|
return /* @__PURE__ */ p("div", {
|
|
214
|
-
className:
|
|
215
|
-
children: [/* @__PURE__ */ f(
|
|
216
|
-
ref:
|
|
217
|
-
id:
|
|
218
|
-
isOpen:
|
|
219
|
-
disabled:
|
|
220
|
-
|
|
213
|
+
className: F(ce.wrapper, g),
|
|
214
|
+
children: [/* @__PURE__ */ f(ie, {
|
|
215
|
+
ref: pe,
|
|
216
|
+
id: j,
|
|
217
|
+
isOpen: U,
|
|
218
|
+
disabled: b,
|
|
219
|
+
size: h,
|
|
220
|
+
icon: r,
|
|
221
221
|
label: e,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
222
|
+
ariaLabel: t,
|
|
223
|
+
showArrow: T,
|
|
224
|
+
arrowIcon: D,
|
|
225
|
+
rotateAngle: x,
|
|
226
|
+
className: _,
|
|
227
|
+
onClick: le,
|
|
228
|
+
onKeyDown: fe,
|
|
229
|
+
"aria-expanded": U,
|
|
228
230
|
"aria-haspopup": "menu",
|
|
229
|
-
...
|
|
230
|
-
children:
|
|
231
|
-
}),
|
|
232
|
-
ref:
|
|
233
|
-
floatingStyles:
|
|
234
|
-
menuId:
|
|
235
|
-
labelledById:
|
|
236
|
-
label:
|
|
237
|
-
activeDescendantId:
|
|
238
|
-
onKeyDown:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if (
|
|
242
|
-
if (
|
|
243
|
-
|
|
231
|
+
...U && { "aria-controls": A },
|
|
232
|
+
children: i
|
|
233
|
+
}), U && /* @__PURE__ */ f(R, {
|
|
234
|
+
ref: me,
|
|
235
|
+
floatingStyles: M,
|
|
236
|
+
menuId: A,
|
|
237
|
+
labelledById: i ? j : void 0,
|
|
238
|
+
label: t ?? (!i && typeof e == "string" ? e : void 0),
|
|
239
|
+
activeDescendantId: de,
|
|
240
|
+
onKeyDown: fe,
|
|
241
|
+
className: v,
|
|
242
|
+
children: c.map((e, t) => {
|
|
243
|
+
if (oe(e)) return /* @__PURE__ */ f(te, { label: e.label }, `group-${e.label}`);
|
|
244
|
+
if (se(e)) return /* @__PURE__ */ f(re, {}, `separator-${t}`);
|
|
245
|
+
if (ae(e)) {
|
|
246
|
+
let n = z.get(t) ?? -1;
|
|
244
247
|
return /* @__PURE__ */ f(ne, {
|
|
245
|
-
id: `${
|
|
248
|
+
id: `${A}-item-${n}`,
|
|
246
249
|
...e,
|
|
247
|
-
active:
|
|
248
|
-
textWrap: e.textWrap ||
|
|
250
|
+
active: V === n,
|
|
251
|
+
textWrap: e.textWrap || w,
|
|
252
|
+
className: y,
|
|
249
253
|
onClick: () => {
|
|
250
|
-
|
|
254
|
+
ue(e), O.current?.focus();
|
|
251
255
|
},
|
|
252
256
|
onMouseEnter: () => {
|
|
253
|
-
|
|
257
|
+
n < 0 || e.disabled || H(n);
|
|
254
258
|
},
|
|
255
259
|
children: e.label
|
|
256
|
-
}, e.value);
|
|
260
|
+
}, `${e.value}-${t}`);
|
|
257
261
|
}
|
|
258
262
|
})
|
|
259
263
|
})]
|
|
260
264
|
});
|
|
261
|
-
},
|
|
262
|
-
let e = r(
|
|
265
|
+
}, ue = e(void 0), G = () => {
|
|
266
|
+
let e = r(ue);
|
|
263
267
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
264
268
|
return e;
|
|
265
269
|
};
|
|
266
|
-
|
|
267
|
-
var
|
|
268
|
-
let { descriptionId: t } =
|
|
270
|
+
ue.displayName = "ModalContext";
|
|
271
|
+
var de = { modalBody: "_modalBody_iv33a_1" }, fe = ({ children: e }) => {
|
|
272
|
+
let { descriptionId: t } = G();
|
|
269
273
|
return /* @__PURE__ */ f("div", {
|
|
270
274
|
id: t,
|
|
271
|
-
className:
|
|
275
|
+
className: de.modalBody,
|
|
272
276
|
children: e
|
|
273
277
|
});
|
|
274
278
|
};
|
|
275
|
-
|
|
276
|
-
var
|
|
277
|
-
className:
|
|
279
|
+
fe.displayName = "ModalBody";
|
|
280
|
+
var pe = { content: "_content_k44g7_1" }, me = ({ children: e }) => /* @__PURE__ */ f("div", {
|
|
281
|
+
className: pe.content,
|
|
278
282
|
children: e
|
|
279
283
|
});
|
|
280
|
-
|
|
281
|
-
var
|
|
282
|
-
className:
|
|
284
|
+
me.displayName = "ModalContent";
|
|
285
|
+
var he = { modalFooter: "_modalFooter_ezys6_1" }, ge = ({ children: e }) => /* @__PURE__ */ f("div", {
|
|
286
|
+
className: he.modalFooter,
|
|
283
287
|
children: e
|
|
284
288
|
});
|
|
285
|
-
|
|
286
|
-
var
|
|
287
|
-
modalHeader: "
|
|
288
|
-
modalHeaderTitle: "
|
|
289
|
-
modalHeaderCloseButton: "
|
|
290
|
-
},
|
|
291
|
-
let { onClose: t, titleId: n } =
|
|
289
|
+
ge.displayName = "ModalFooter";
|
|
290
|
+
var _e = {
|
|
291
|
+
modalHeader: "_modalHeader_p8xf1_1",
|
|
292
|
+
modalHeaderTitle: "_modalHeaderTitle_p8xf1_7",
|
|
293
|
+
modalHeaderCloseButton: "_modalHeaderCloseButton_p8xf1_14"
|
|
294
|
+
}, ve = ({ children: e }) => {
|
|
295
|
+
let { onClose: t, titleId: n } = G();
|
|
292
296
|
return /* @__PURE__ */ p("div", {
|
|
293
|
-
className:
|
|
297
|
+
className: _e.modalHeader,
|
|
294
298
|
children: [/* @__PURE__ */ f("h2", {
|
|
295
299
|
id: n,
|
|
296
|
-
className:
|
|
300
|
+
className: _e.modalHeaderTitle,
|
|
297
301
|
children: e
|
|
298
302
|
}), t && /* @__PURE__ */ f("button", {
|
|
299
303
|
type: "button",
|
|
300
|
-
className:
|
|
304
|
+
className: _e.modalHeaderCloseButton,
|
|
301
305
|
onClick: t,
|
|
302
306
|
"aria-label": "Close modal",
|
|
303
|
-
children: /* @__PURE__ */ f(
|
|
307
|
+
children: /* @__PURE__ */ f(N, { size: 16 })
|
|
304
308
|
})]
|
|
305
309
|
});
|
|
306
310
|
};
|
|
307
|
-
|
|
311
|
+
ve.displayName = "ModalHeader";
|
|
308
312
|
//#endregion
|
|
309
313
|
//#region src/hooks/useModalKeyboard.ts
|
|
310
|
-
var
|
|
314
|
+
var ye = ({ isOpen: e, onClose: t }) => {
|
|
311
315
|
let r = n((n) => {
|
|
312
316
|
e && n.key === "Escape" && (n.preventDefault(), t?.());
|
|
313
317
|
}, [e, t]);
|
|
314
318
|
i(() => (document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r)), [r]);
|
|
315
|
-
},
|
|
316
|
-
overlay: "
|
|
317
|
-
"overlay--open": "_overlay--
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
},
|
|
321
|
-
let p = o ?? c ?? !0, m = s(null), { titleId: h, descriptionId: g } =
|
|
319
|
+
}, be = {
|
|
320
|
+
overlay: "_overlay_dcudn_1",
|
|
321
|
+
"overlay--open": "_overlay--open_dcudn_14",
|
|
322
|
+
modal: "_modal_dcudn_20",
|
|
323
|
+
"overlay--animated": "_overlay--animated_dcudn_28"
|
|
324
|
+
}, xe = 0, Se = "", Ce = ({ children: e, onClose: t, isOpen: r, className: a, closeOnBackdrop: o, closeOnClick: c, closeOnEsc: l = !0, zIndex: u = 1e3, animated: d = !0 }) => {
|
|
325
|
+
let p = o ?? c ?? !0, m = s(null), { titleId: h, descriptionId: g } = G(), _ = n((e) => {
|
|
322
326
|
p && e.target === e.currentTarget && t?.();
|
|
323
327
|
}, [p, t]);
|
|
324
|
-
return
|
|
328
|
+
return ye({
|
|
325
329
|
isOpen: r,
|
|
326
330
|
onClose: l ? t : void 0
|
|
327
331
|
}), i(() => {
|
|
328
|
-
if (r) return
|
|
329
|
-
|
|
332
|
+
if (r) return xe === 0 && (Se = document.body.style.overflow), xe += 1, document.body.style.overflow = "hidden", () => {
|
|
333
|
+
xe = Math.max(0, xe - 1), xe === 0 && (document.body.style.overflow = Se);
|
|
330
334
|
};
|
|
331
|
-
}, [r]), !r && !d ? null : /* @__PURE__ */ f(
|
|
332
|
-
className:
|
|
335
|
+
}, [r]), !r && !d ? null : /* @__PURE__ */ f(I, { children: /* @__PURE__ */ f("div", {
|
|
336
|
+
className: F(be.overlay, r && be["overlay--open"], d && be["overlay--animated"], a),
|
|
333
337
|
onClick: _,
|
|
334
338
|
tabIndex: -1,
|
|
335
339
|
role: "presentation",
|
|
336
340
|
"aria-hidden": !r,
|
|
337
341
|
style: { zIndex: u },
|
|
338
|
-
children: /* @__PURE__ */ f(
|
|
342
|
+
children: /* @__PURE__ */ f(P, {
|
|
339
343
|
active: r,
|
|
340
344
|
focusTrapOptions: {
|
|
341
345
|
fallbackFocus: () => m.current,
|
|
@@ -345,7 +349,7 @@ var ge = ({ isOpen: e, onClose: t }) => {
|
|
|
345
349
|
children: /* @__PURE__ */ f("div", {
|
|
346
350
|
ref: m,
|
|
347
351
|
tabIndex: -1,
|
|
348
|
-
className:
|
|
352
|
+
className: be.modal,
|
|
349
353
|
role: "dialog",
|
|
350
354
|
"aria-modal": "true",
|
|
351
355
|
"aria-labelledby": h,
|
|
@@ -355,50 +359,56 @@ var ge = ({ isOpen: e, onClose: t }) => {
|
|
|
355
359
|
})
|
|
356
360
|
}) });
|
|
357
361
|
};
|
|
358
|
-
|
|
362
|
+
Ce.displayName = "ModalOverlay";
|
|
359
363
|
//#endregion
|
|
360
364
|
//#region src/components/Modal/Modal.tsx
|
|
361
|
-
var
|
|
362
|
-
let
|
|
363
|
-
|
|
365
|
+
var we = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: a = !0 }) => {
|
|
366
|
+
let o = D({
|
|
367
|
+
isOpen: e,
|
|
368
|
+
onClose: n,
|
|
369
|
+
closeOnBackdrop: r,
|
|
370
|
+
closeOnClick: i,
|
|
371
|
+
closeOnEsc: a
|
|
372
|
+
});
|
|
373
|
+
return o.shouldRender ? /* @__PURE__ */ f(ue.Provider, {
|
|
364
374
|
value: {
|
|
365
|
-
onClose:
|
|
366
|
-
titleId:
|
|
367
|
-
descriptionId:
|
|
375
|
+
onClose: o.onClose,
|
|
376
|
+
titleId: o.titleId,
|
|
377
|
+
descriptionId: o.descriptionId
|
|
368
378
|
},
|
|
369
|
-
children: /* @__PURE__ */ f(
|
|
370
|
-
isOpen:
|
|
371
|
-
onClose:
|
|
372
|
-
closeOnBackdrop:
|
|
373
|
-
closeOnEsc: o,
|
|
374
|
-
children: /* @__PURE__ */ f(
|
|
379
|
+
children: /* @__PURE__ */ f(Ce, {
|
|
380
|
+
isOpen: o.isOpen,
|
|
381
|
+
onClose: o.onClose,
|
|
382
|
+
closeOnBackdrop: o.closeOnBackdrop,
|
|
383
|
+
closeOnEsc: o.closeOnEsc,
|
|
384
|
+
children: /* @__PURE__ */ f(me, { children: t })
|
|
375
385
|
})
|
|
376
386
|
}) : null;
|
|
377
387
|
};
|
|
378
|
-
|
|
388
|
+
we.displayName = "Modal";
|
|
379
389
|
//#endregion
|
|
380
390
|
//#region src/components/Modal/index.ts
|
|
381
|
-
var
|
|
382
|
-
Header:
|
|
383
|
-
Body:
|
|
384
|
-
Content:
|
|
385
|
-
Footer:
|
|
386
|
-
}),
|
|
387
|
-
function
|
|
388
|
-
return r(
|
|
391
|
+
var Te = Object.assign(we, {
|
|
392
|
+
Header: ve,
|
|
393
|
+
Body: fe,
|
|
394
|
+
Content: me,
|
|
395
|
+
Footer: ge
|
|
396
|
+
}), Ee = e(null), De = Ee.Provider;
|
|
397
|
+
function Oe() {
|
|
398
|
+
return r(Ee);
|
|
389
399
|
}
|
|
390
400
|
var K = {
|
|
391
|
-
root: "
|
|
392
|
-
label: "
|
|
393
|
-
required: "
|
|
394
|
-
description: "
|
|
395
|
-
items: "
|
|
396
|
-
vertical: "
|
|
397
|
-
horizontal: "
|
|
398
|
-
error: "
|
|
399
|
-
disabled: "
|
|
400
|
-
invalid: "
|
|
401
|
-
},
|
|
401
|
+
root: "_root_1n02e_1",
|
|
402
|
+
label: "_label_1n02e_9",
|
|
403
|
+
required: "_required_1n02e_21",
|
|
404
|
+
description: "_description_1n02e_26",
|
|
405
|
+
items: "_items_1n02e_34",
|
|
406
|
+
vertical: "_vertical_1n02e_39",
|
|
407
|
+
horizontal: "_horizontal_1n02e_45",
|
|
408
|
+
error: "_error_1n02e_51",
|
|
409
|
+
disabled: "_disabled_1n02e_59",
|
|
410
|
+
invalid: "_invalid_1n02e_75"
|
|
411
|
+
}, ke = 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
412
|
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
413
|
value: e,
|
|
404
414
|
defaultValue: t,
|
|
@@ -414,7 +424,7 @@ var K = {
|
|
|
414
424
|
"aria-disabled": r || void 0,
|
|
415
425
|
"aria-required": i || void 0,
|
|
416
426
|
"aria-invalid": k || void 0,
|
|
417
|
-
className:
|
|
427
|
+
className: F(K.root, k && K.invalid, r && K.disabled, h),
|
|
418
428
|
children: [
|
|
419
429
|
c && /* @__PURE__ */ p("div", {
|
|
420
430
|
id: x,
|
|
@@ -430,7 +440,7 @@ var K = {
|
|
|
430
440
|
className: K.description,
|
|
431
441
|
children: l
|
|
432
442
|
}),
|
|
433
|
-
/* @__PURE__ */ f(
|
|
443
|
+
/* @__PURE__ */ f(De, {
|
|
434
444
|
value: {
|
|
435
445
|
name: E,
|
|
436
446
|
value: D,
|
|
@@ -442,7 +452,7 @@ var K = {
|
|
|
442
452
|
onValueChange: O
|
|
443
453
|
},
|
|
444
454
|
children: /* @__PURE__ */ f("div", {
|
|
445
|
-
className:
|
|
455
|
+
className: F(K.items, K[d]),
|
|
446
456
|
children: m
|
|
447
457
|
})
|
|
448
458
|
}),
|
|
@@ -454,34 +464,27 @@ var K = {
|
|
|
454
464
|
]
|
|
455
465
|
});
|
|
456
466
|
});
|
|
457
|
-
|
|
467
|
+
ke.displayName = "RadioGroup";
|
|
458
468
|
var q = {
|
|
459
|
-
wrapper: "
|
|
460
|
-
label: "
|
|
461
|
-
required: "
|
|
462
|
-
description: "
|
|
463
|
-
control: "
|
|
464
|
-
errorText: "
|
|
465
|
-
disabled: "
|
|
466
|
-
|
|
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 }) => {
|
|
469
|
+
wrapper: "_wrapper_byl2d_1",
|
|
470
|
+
label: "_label_byl2d_9",
|
|
471
|
+
required: "_required_byl2d_20",
|
|
472
|
+
description: "_description_byl2d_25",
|
|
473
|
+
control: "_control_byl2d_32",
|
|
474
|
+
errorText: "_errorText_byl2d_40",
|
|
475
|
+
disabled: "_disabled_byl2d_54"
|
|
476
|
+
}, Ae = ({ 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
477
|
let h = n && e ? `${e}-description` : void 0, g = r && e ? `${e}-error` : void 0;
|
|
475
478
|
return /* @__PURE__ */ p("div", {
|
|
476
479
|
...m,
|
|
477
480
|
"aria-disabled": a || void 0,
|
|
478
|
-
className:
|
|
481
|
+
className: F(q.wrapper, a && q.disabled, s),
|
|
479
482
|
"data-disabled": a || void 0,
|
|
480
483
|
"data-invalid": !!r || void 0,
|
|
481
484
|
children: [
|
|
482
485
|
t && /* @__PURE__ */ p("label", {
|
|
483
486
|
htmlFor: e,
|
|
484
|
-
className:
|
|
487
|
+
className: F(q.label, l),
|
|
485
488
|
children: [t, i && /* @__PURE__ */ f("span", {
|
|
486
489
|
className: q.required,
|
|
487
490
|
"aria-hidden": "true",
|
|
@@ -490,39 +493,39 @@ var q = {
|
|
|
490
493
|
}),
|
|
491
494
|
n && /* @__PURE__ */ f("div", {
|
|
492
495
|
id: h,
|
|
493
|
-
className:
|
|
496
|
+
className: F(q.description, u),
|
|
494
497
|
children: n
|
|
495
498
|
}),
|
|
496
499
|
/* @__PURE__ */ f("div", {
|
|
497
|
-
className:
|
|
500
|
+
className: F(q.control, c),
|
|
498
501
|
children: o
|
|
499
502
|
}),
|
|
500
503
|
r && /* @__PURE__ */ f("div", {
|
|
501
504
|
id: g,
|
|
502
|
-
className:
|
|
505
|
+
className: F(q.errorText, d),
|
|
503
506
|
role: "alert",
|
|
504
507
|
children: r
|
|
505
508
|
})
|
|
506
509
|
]
|
|
507
510
|
});
|
|
508
|
-
},
|
|
509
|
-
option: "
|
|
510
|
-
selected: "
|
|
511
|
-
disabled: "
|
|
512
|
-
active: "
|
|
513
|
-
label: "
|
|
514
|
-
check: "
|
|
515
|
-
},
|
|
511
|
+
}, je = {
|
|
512
|
+
option: "_option_l6qjj_1",
|
|
513
|
+
selected: "_selected_l6qjj_18",
|
|
514
|
+
disabled: "_disabled_l6qjj_18",
|
|
515
|
+
active: "_active_l6qjj_34",
|
|
516
|
+
label: "_label_l6qjj_46",
|
|
517
|
+
check: "_check_l6qjj_54"
|
|
518
|
+
}, Me = ({ option: e, isSelected: t, isActive: n, optionId: r, onSelect: i, onMouseEnter: a }) => {
|
|
516
519
|
let o = !!e.disabled;
|
|
517
520
|
return /* @__PURE__ */ p("li", {
|
|
518
521
|
id: r,
|
|
519
522
|
role: "option",
|
|
520
523
|
"aria-selected": t,
|
|
521
524
|
"aria-disabled": o || void 0,
|
|
522
|
-
className:
|
|
523
|
-
[
|
|
524
|
-
[
|
|
525
|
-
[
|
|
525
|
+
className: F(je.option, {
|
|
526
|
+
[je.selected]: t,
|
|
527
|
+
[je.active]: n,
|
|
528
|
+
[je.disabled]: o
|
|
526
529
|
}),
|
|
527
530
|
onClick: () => {
|
|
528
531
|
o || i(e.value);
|
|
@@ -531,28 +534,28 @@ var q = {
|
|
|
531
534
|
o || a();
|
|
532
535
|
},
|
|
533
536
|
children: [/* @__PURE__ */ f("span", {
|
|
534
|
-
className:
|
|
537
|
+
className: je.label,
|
|
535
538
|
children: e.label
|
|
536
539
|
}), /* @__PURE__ */ f("span", {
|
|
537
|
-
className:
|
|
540
|
+
className: je.check,
|
|
538
541
|
"aria-hidden": "true",
|
|
539
|
-
children: t && /* @__PURE__ */ f(
|
|
542
|
+
children: t && /* @__PURE__ */ f(j, {})
|
|
540
543
|
})]
|
|
541
544
|
});
|
|
542
545
|
};
|
|
543
|
-
|
|
544
|
-
var
|
|
545
|
-
dropdown: "
|
|
546
|
-
dropdownIn: "
|
|
547
|
-
empty: "
|
|
548
|
-
},
|
|
546
|
+
Me.displayName = "SelectOption";
|
|
547
|
+
var Ne = {
|
|
548
|
+
dropdown: "_dropdown_qznlq_1",
|
|
549
|
+
dropdownIn: "_dropdownIn_qznlq_1",
|
|
550
|
+
empty: "_empty_qznlq_17"
|
|
551
|
+
}, Pe = ({ 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(I, { children: /* @__PURE__ */ f("ul", {
|
|
549
552
|
ref: r,
|
|
550
553
|
id: t,
|
|
551
554
|
role: "listbox",
|
|
552
555
|
"aria-labelledby": n,
|
|
553
|
-
className: [
|
|
556
|
+
className: [Ne.dropdown, l].filter(Boolean).join(" "),
|
|
554
557
|
style: i,
|
|
555
|
-
children: a.length ? a.map((e, n) => /* @__PURE__ */ f(
|
|
558
|
+
children: a.length ? a.map((e, n) => /* @__PURE__ */ f(Me, {
|
|
556
559
|
option: e,
|
|
557
560
|
isSelected: e.value === s,
|
|
558
561
|
isActive: n === c,
|
|
@@ -560,24 +563,26 @@ var Ae = {
|
|
|
560
563
|
onSelect: u,
|
|
561
564
|
onMouseEnter: () => d(n)
|
|
562
565
|
}, e.value)) : /* @__PURE__ */ f("li", {
|
|
563
|
-
|
|
564
|
-
|
|
566
|
+
role: "option",
|
|
567
|
+
"aria-disabled": "true",
|
|
568
|
+
"aria-selected": "false",
|
|
569
|
+
className: Ne.empty,
|
|
565
570
|
children: o
|
|
566
571
|
})
|
|
567
572
|
}) }) : null;
|
|
568
|
-
|
|
573
|
+
Pe.displayName = "SelectDropdown";
|
|
569
574
|
var J = {
|
|
570
|
-
control: "
|
|
571
|
-
disabled: "
|
|
572
|
-
arrow: "
|
|
573
|
-
sm: "
|
|
574
|
-
md: "
|
|
575
|
-
lg: "
|
|
576
|
-
value: "
|
|
577
|
-
placeholder: "
|
|
578
|
-
error: "
|
|
579
|
-
open: "
|
|
580
|
-
},
|
|
575
|
+
control: "_control_1xma1_1",
|
|
576
|
+
disabled: "_disabled_1xma1_18",
|
|
577
|
+
arrow: "_arrow_1xma1_23",
|
|
578
|
+
sm: "_sm_1xma1_34",
|
|
579
|
+
md: "_md_1xma1_41",
|
|
580
|
+
lg: "_lg_1xma1_48",
|
|
581
|
+
value: "_value_1xma1_55",
|
|
582
|
+
placeholder: "_placeholder_1xma1_63",
|
|
583
|
+
error: "_error_1xma1_67",
|
|
584
|
+
open: "_open_1xma1_109"
|
|
585
|
+
}, Fe = ({ 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", {
|
|
581
586
|
id: e,
|
|
582
587
|
ref: h,
|
|
583
588
|
type: "button",
|
|
@@ -592,7 +597,7 @@ var J = {
|
|
|
592
597
|
"aria-controls": n ? a : void 0,
|
|
593
598
|
"aria-describedby": t,
|
|
594
599
|
"aria-activedescendant": n && o >= 0 ? `${a}-option-${o}` : void 0,
|
|
595
|
-
className:
|
|
600
|
+
className: F(J.control, J[d], {
|
|
596
601
|
[J.error]: !!c,
|
|
597
602
|
[J.disabled]: r
|
|
598
603
|
}, m),
|
|
@@ -601,152 +606,121 @@ var J = {
|
|
|
601
606
|
onBlur: v,
|
|
602
607
|
onFocus: y,
|
|
603
608
|
children: [/* @__PURE__ */ f("span", {
|
|
604
|
-
className:
|
|
609
|
+
className: F(J.value, { [J.placeholder]: u }),
|
|
605
610
|
children: l
|
|
606
611
|
}), /* @__PURE__ */ f("span", {
|
|
607
|
-
className:
|
|
612
|
+
className: F(J.arrow, { [J.open]: n }),
|
|
608
613
|
"aria-hidden": "true",
|
|
609
|
-
children: /* @__PURE__ */ f(
|
|
614
|
+
children: /* @__PURE__ */ f(M, {})
|
|
610
615
|
})]
|
|
611
616
|
});
|
|
612
|
-
|
|
617
|
+
Fe.displayName = "SelectTrigger";
|
|
613
618
|
//#endregion
|
|
614
619
|
//#region src/components/Select/Select.tsx
|
|
615
|
-
var
|
|
616
|
-
let
|
|
617
|
-
value:
|
|
618
|
-
defaultValue:
|
|
619
|
-
onChange:
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
620
|
+
var Ie = ({ label: e, description: t, id: r, name: i, "aria-label": o, value: c, defaultValue: l, onChange: u, options: d, placeholder: m = "Select...", noOptionsText: h = "No options available", size: g = "md", required: _ = !1, disabled: v = !1, error: y, placement: b = "bottom-start", matchTriggerWidth: x = !0, open: S, defaultOpen: C = !1, onOpenChange: w, onBlur: T, onFocus: E, className: D, triggerClassName: k, dropdownClassName: A }) => {
|
|
621
|
+
let j = a(), M = r ?? j, N = `${M}-listbox`, P = !!y, F = P ? `${M}-error` : void 0, I = s(null), L = s(null), { selectedValue: R, selectedOption: z, isOpen: V, setIsOpen: te, activeIndex: H, setActiveIndex: ne, closeDropdown: U, toggleDropdown: re, selectValue: W, onKeyDown: ie } = O({
|
|
622
|
+
value: c,
|
|
623
|
+
defaultValue: l,
|
|
624
|
+
onChange: u,
|
|
625
|
+
options: d,
|
|
626
|
+
disabled: v,
|
|
627
|
+
open: S,
|
|
628
|
+
defaultOpen: C,
|
|
629
|
+
onOpenChange: w
|
|
630
|
+
}), ae = !!z, { floatingStyles: oe, setRef: se, setFloatingRef: ce } = B({
|
|
631
|
+
open: V,
|
|
632
|
+
onOpenChange: te,
|
|
633
|
+
placement: b,
|
|
634
|
+
matchTriggerWidth: x,
|
|
629
635
|
mobileSheetBreakpoint: 640
|
|
630
|
-
}), le = n(() => {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
if (!b) {
|
|
639
|
-
if (H) {
|
|
640
|
-
G();
|
|
641
|
-
return;
|
|
642
|
-
}
|
|
643
|
-
ue();
|
|
644
|
-
}
|
|
645
|
-
}, [
|
|
646
|
-
G,
|
|
647
|
-
b,
|
|
648
|
-
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,
|
|
659
|
-
onSelect: () => {
|
|
660
|
-
let e = h[U];
|
|
661
|
-
!e || e.disabled || fe(e.value);
|
|
662
|
-
},
|
|
663
|
-
getItemText: (e) => e.label
|
|
664
|
-
});
|
|
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);
|
|
636
|
+
}), le = n((e) => {
|
|
637
|
+
W(e), I.current?.focus();
|
|
638
|
+
}, [W]);
|
|
639
|
+
ee([I, L], U, V);
|
|
640
|
+
let ue = n((e) => {
|
|
641
|
+
I.current = e, se(e);
|
|
642
|
+
}, [se]), G = n((e) => {
|
|
643
|
+
L.current = e, ce(e);
|
|
670
644
|
}, [ce]);
|
|
671
|
-
return /* @__PURE__ */ p(
|
|
672
|
-
id:
|
|
645
|
+
return /* @__PURE__ */ p(Ae, {
|
|
646
|
+
id: M,
|
|
673
647
|
label: e,
|
|
674
648
|
description: t,
|
|
675
|
-
error:
|
|
676
|
-
required:
|
|
677
|
-
disabled:
|
|
678
|
-
className:
|
|
649
|
+
error: y,
|
|
650
|
+
required: _,
|
|
651
|
+
disabled: v,
|
|
652
|
+
className: D,
|
|
679
653
|
children: [
|
|
680
|
-
/* @__PURE__ */ f(
|
|
681
|
-
id:
|
|
682
|
-
errorId:
|
|
683
|
-
isOpen:
|
|
684
|
-
disabled:
|
|
685
|
-
required:
|
|
686
|
-
listboxId:
|
|
687
|
-
activeIndex:
|
|
688
|
-
ariaLabel:
|
|
689
|
-
error:
|
|
690
|
-
displayText:
|
|
654
|
+
/* @__PURE__ */ f(Fe, {
|
|
655
|
+
id: M,
|
|
656
|
+
errorId: F,
|
|
657
|
+
isOpen: V,
|
|
658
|
+
disabled: v,
|
|
659
|
+
required: _,
|
|
660
|
+
listboxId: N,
|
|
661
|
+
activeIndex: H,
|
|
662
|
+
ariaLabel: o ?? (e ? void 0 : z?.label || m),
|
|
663
|
+
error: P,
|
|
664
|
+
displayText: z?.label ?? m,
|
|
691
665
|
isPlaceholder: !ae,
|
|
692
|
-
size:
|
|
693
|
-
className:
|
|
694
|
-
buttonRef:
|
|
695
|
-
onClick:
|
|
696
|
-
onKeyDown:
|
|
697
|
-
onBlur:
|
|
698
|
-
onFocus:
|
|
666
|
+
size: g,
|
|
667
|
+
className: k,
|
|
668
|
+
buttonRef: ue,
|
|
669
|
+
onClick: re,
|
|
670
|
+
onKeyDown: ie,
|
|
671
|
+
onBlur: T,
|
|
672
|
+
onFocus: E
|
|
699
673
|
}),
|
|
700
674
|
i && /* @__PURE__ */ f("input", {
|
|
701
675
|
type: "hidden",
|
|
702
676
|
name: i,
|
|
703
|
-
value:
|
|
704
|
-
disabled:
|
|
677
|
+
value: R,
|
|
678
|
+
disabled: v
|
|
705
679
|
}),
|
|
706
|
-
/* @__PURE__ */ f(
|
|
707
|
-
isOpen:
|
|
708
|
-
listboxId:
|
|
709
|
-
labelledById:
|
|
680
|
+
/* @__PURE__ */ f(Pe, {
|
|
681
|
+
isOpen: V,
|
|
682
|
+
listboxId: N,
|
|
683
|
+
labelledById: M,
|
|
710
684
|
style: oe,
|
|
711
|
-
options:
|
|
712
|
-
noOptionsText:
|
|
713
|
-
selectedValue:
|
|
714
|
-
activeIndex:
|
|
715
|
-
className:
|
|
716
|
-
setDropdownRef:
|
|
717
|
-
onSelect:
|
|
718
|
-
onMouseEnter:
|
|
685
|
+
options: d,
|
|
686
|
+
noOptionsText: h,
|
|
687
|
+
selectedValue: R,
|
|
688
|
+
activeIndex: H,
|
|
689
|
+
className: A,
|
|
690
|
+
setDropdownRef: G,
|
|
691
|
+
onSelect: le,
|
|
692
|
+
onMouseEnter: ne
|
|
719
693
|
})
|
|
720
694
|
]
|
|
721
695
|
});
|
|
722
696
|
};
|
|
723
|
-
|
|
697
|
+
Ie.displayName = "Select";
|
|
724
698
|
//#endregion
|
|
725
699
|
//#region src/components/Tabs/TabsContext.tsx
|
|
726
|
-
var
|
|
727
|
-
let e = r(
|
|
700
|
+
var Le = e(null), Re = () => {
|
|
701
|
+
let e = r(Le);
|
|
728
702
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
729
703
|
return e;
|
|
730
|
-
},
|
|
731
|
-
list: "
|
|
732
|
-
vertical: "
|
|
733
|
-
},
|
|
734
|
-
let { orientation: r, appearance: i } =
|
|
704
|
+
}, ze = {
|
|
705
|
+
list: "_list_13hkl_1",
|
|
706
|
+
vertical: "_vertical_13hkl_8"
|
|
707
|
+
}, Be = ({ children: e, className: t, ...n }) => {
|
|
708
|
+
let { orientation: r, appearance: i } = Re();
|
|
735
709
|
return /* @__PURE__ */ f("div", {
|
|
736
710
|
...n,
|
|
737
711
|
role: "tablist",
|
|
738
712
|
"aria-orientation": r,
|
|
739
|
-
className:
|
|
713
|
+
className: F(ze.list, r === "vertical" && ze.vertical, i === "underline" && ze.underline, i === "pills" && ze.pills, t),
|
|
740
714
|
children: e
|
|
741
715
|
});
|
|
742
716
|
};
|
|
743
|
-
|
|
744
|
-
var
|
|
745
|
-
panel: "
|
|
746
|
-
visible: "
|
|
747
|
-
vertical: "
|
|
748
|
-
},
|
|
749
|
-
let { activeIndex: r, orientation: a } =
|
|
717
|
+
Be.displayName = "TabsList";
|
|
718
|
+
var Ve = {
|
|
719
|
+
panel: "_panel_1v1a9_1",
|
|
720
|
+
visible: "_visible_1v1a9_10",
|
|
721
|
+
vertical: "_vertical_1v1a9_14"
|
|
722
|
+
}, He = ({ index: e, children: t, className: n }) => {
|
|
723
|
+
let { activeIndex: r, orientation: a } = Re(), [o, s] = c(!1), l = r === e;
|
|
750
724
|
return i(() => {
|
|
751
725
|
if (!l) {
|
|
752
726
|
s(!1);
|
|
@@ -760,22 +734,22 @@ var Re = {
|
|
|
760
734
|
"aria-labelledby": `tab-${e}`,
|
|
761
735
|
hidden: !l,
|
|
762
736
|
tabIndex: 0,
|
|
763
|
-
className:
|
|
737
|
+
className: F(Ve.panel, o && Ve.visible, a === "vertical" && Ve.vertical, n),
|
|
764
738
|
children: t
|
|
765
739
|
});
|
|
766
740
|
};
|
|
767
|
-
|
|
741
|
+
He.displayName = "TabsPanel";
|
|
768
742
|
var Y = {
|
|
769
|
-
tab: "
|
|
770
|
-
iconOnly: "
|
|
771
|
-
tabIcon: "
|
|
772
|
-
label: "
|
|
773
|
-
default: "
|
|
774
|
-
underline: "
|
|
775
|
-
pills: "
|
|
776
|
-
vertical: "
|
|
777
|
-
},
|
|
778
|
-
let { activeIndex: u, setActiveIndex: d, orientation: m, appearance: h = "default", registerTab: g, onTabKeyDown: _ } =
|
|
743
|
+
tab: "_tab_qe8xc_1",
|
|
744
|
+
iconOnly: "_iconOnly_qe8xc_27",
|
|
745
|
+
tabIcon: "_tabIcon_qe8xc_31",
|
|
746
|
+
label: "_label_qe8xc_45",
|
|
747
|
+
default: "_default_qe8xc_51",
|
|
748
|
+
underline: "_underline_qe8xc_60",
|
|
749
|
+
pills: "_pills_qe8xc_92",
|
|
750
|
+
vertical: "_vertical_qe8xc_106"
|
|
751
|
+
}, Ue = t(({ index: e, children: t, className: r, disabled: i = !1, icon: a, onClick: o, onKeyDown: s, ...c }, l) => {
|
|
752
|
+
let { activeIndex: u, setActiveIndex: d, orientation: m, appearance: h = "default", registerTab: g, onTabKeyDown: _ } = Re(), v = u === e, y = !!a, b = y && t == null;
|
|
779
753
|
return /* @__PURE__ */ p("button", {
|
|
780
754
|
type: "button",
|
|
781
755
|
ref: n((t) => {
|
|
@@ -791,7 +765,7 @@ var Y = {
|
|
|
791
765
|
id: `tab-${e}`,
|
|
792
766
|
disabled: i,
|
|
793
767
|
tabIndex: v ? 0 : -1,
|
|
794
|
-
className:
|
|
768
|
+
className: F(Y.tab, Y[h], m === "vertical" && Y.vertical, y && Y.withIcon, b && Y.iconOnly, r),
|
|
795
769
|
onClick: (t) => {
|
|
796
770
|
i || (d(e), o?.(t));
|
|
797
771
|
},
|
|
@@ -809,47 +783,52 @@ var Y = {
|
|
|
809
783
|
})]
|
|
810
784
|
});
|
|
811
785
|
});
|
|
812
|
-
|
|
813
|
-
var
|
|
814
|
-
tabs: "
|
|
815
|
-
vertical: "
|
|
816
|
-
},
|
|
817
|
-
let
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
}, []),
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
786
|
+
Ue.displayName = "Tab";
|
|
787
|
+
var We = {
|
|
788
|
+
tabs: "_tabs_uqy7q_1",
|
|
789
|
+
vertical: "_vertical_uqy7q_5"
|
|
790
|
+
}, Ge = ({ children: e, activeIndex: t, defaultActiveIndex: r = 0, onChange: i, orientation: a = "horizontal", appearance: o = "default", className: c }) => {
|
|
791
|
+
let { activeIndex: l, setActiveIndex: u } = k({
|
|
792
|
+
activeIndex: t,
|
|
793
|
+
defaultActiveIndex: r,
|
|
794
|
+
onChange: i
|
|
795
|
+
}), d = s([]), p = n((e, t) => {
|
|
796
|
+
d.current[e] = t;
|
|
797
|
+
}, []), { onKeyDown: m } = A({
|
|
798
|
+
activeIndex: l,
|
|
799
|
+
setActiveIndex: u,
|
|
800
|
+
tabRefs: d,
|
|
801
|
+
orientation: a,
|
|
802
|
+
onNavigate: (e) => {
|
|
803
|
+
d.current[e]?.focus();
|
|
804
|
+
}
|
|
805
|
+
}), h = {
|
|
806
|
+
activeIndex: l,
|
|
807
|
+
setActiveIndex: u,
|
|
829
808
|
orientation: a,
|
|
830
809
|
appearance: o,
|
|
831
|
-
registerTab:
|
|
832
|
-
onTabKeyDown:
|
|
810
|
+
registerTab: p,
|
|
811
|
+
onTabKeyDown: m
|
|
833
812
|
};
|
|
834
|
-
return /* @__PURE__ */ f(
|
|
835
|
-
value:
|
|
813
|
+
return /* @__PURE__ */ f(Le.Provider, {
|
|
814
|
+
value: h,
|
|
836
815
|
children: /* @__PURE__ */ f("div", {
|
|
837
|
-
className:
|
|
816
|
+
className: F(We.tabs, a === "vertical" && We.vertical, c),
|
|
838
817
|
children: e
|
|
839
818
|
})
|
|
840
819
|
});
|
|
841
820
|
};
|
|
842
|
-
|
|
821
|
+
Ge.displayName = "Tabs";
|
|
843
822
|
//#endregion
|
|
844
823
|
//#region src/components/Tabs/index.ts
|
|
845
|
-
var
|
|
846
|
-
List:
|
|
847
|
-
Tab:
|
|
848
|
-
Panel:
|
|
849
|
-
}),
|
|
850
|
-
tooltip: "
|
|
851
|
-
arrow: "
|
|
852
|
-
},
|
|
824
|
+
var Ke = Object.assign(Ge, {
|
|
825
|
+
List: Be,
|
|
826
|
+
Tab: Ue,
|
|
827
|
+
Panel: He
|
|
828
|
+
}), qe = {
|
|
829
|
+
tooltip: "_tooltip_10opu_1",
|
|
830
|
+
arrow: "_arrow_10opu_25"
|
|
831
|
+
}, Je = t(({ content: e, placement: t = "top", arrowRef: n, arrowX: r, arrowY: i, className: a, style: o, ...s }, c) => {
|
|
853
832
|
let l = {
|
|
854
833
|
top: "bottom",
|
|
855
834
|
right: "left",
|
|
@@ -864,26 +843,26 @@ var Ue = Object.assign(He, {
|
|
|
864
843
|
};
|
|
865
844
|
return /* @__PURE__ */ p("div", {
|
|
866
845
|
ref: c,
|
|
867
|
-
className:
|
|
846
|
+
className: F(qe.tooltip, a),
|
|
868
847
|
"data-placement": t,
|
|
869
848
|
"data-state": "open",
|
|
870
849
|
style: o,
|
|
871
850
|
...s,
|
|
872
851
|
children: [e, /* @__PURE__ */ f("div", {
|
|
873
852
|
ref: n,
|
|
874
|
-
className:
|
|
853
|
+
className: qe.arrow,
|
|
875
854
|
style: u
|
|
876
855
|
})]
|
|
877
856
|
});
|
|
878
857
|
});
|
|
879
|
-
|
|
858
|
+
Je.displayName = "TooltipContent";
|
|
880
859
|
//#endregion
|
|
881
860
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
882
|
-
var
|
|
861
|
+
var Ye = ({ children: e, placement: t = "top", content: n, disabled: r = !1, delay: i = {
|
|
883
862
|
open: 300,
|
|
884
863
|
close: 100
|
|
885
864
|
}, maxWidth: o = 250, className: l, onOpenChange: u }) => {
|
|
886
|
-
let [g, _] = c(!1), v = s(null), y = a(), { context: b, floatingStyles: x, middlewareData: T, setRef: E, setFloatingRef: D, placement: O } =
|
|
865
|
+
let [g, _] = c(!1), v = s(null), y = a(), { context: b, floatingStyles: x, middlewareData: T, setRef: E, setFloatingRef: D, placement: O } = B({
|
|
887
866
|
open: g,
|
|
888
867
|
onOpenChange: (e) => {
|
|
889
868
|
r || (_(e), u?.(e));
|
|
@@ -900,7 +879,7 @@ var Ke = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
900
879
|
"aria-describedby": g ? y : void 0,
|
|
901
880
|
...j(),
|
|
902
881
|
children: e
|
|
903
|
-
}), /* @__PURE__ */ f(m, { children: g && n && /* @__PURE__ */ f(
|
|
882
|
+
}), /* @__PURE__ */ f(m, { children: g && n && /* @__PURE__ */ f(Je, {
|
|
904
883
|
id: y,
|
|
905
884
|
ref: D,
|
|
906
885
|
content: n,
|
|
@@ -917,33 +896,33 @@ var Ke = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
917
896
|
...M()
|
|
918
897
|
}) })] });
|
|
919
898
|
};
|
|
920
|
-
|
|
899
|
+
Ye.displayName = "Tooltip";
|
|
921
900
|
//#endregion
|
|
922
901
|
//#region src/utils/devWarning.ts
|
|
923
|
-
var
|
|
902
|
+
var Xe = (e, t) => {
|
|
924
903
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
925
904
|
}, X = {
|
|
926
|
-
button: "
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
secondary: "
|
|
931
|
-
danger: "
|
|
932
|
-
close: "
|
|
933
|
-
outline: "
|
|
934
|
-
ghost: "
|
|
935
|
-
sm: "
|
|
936
|
-
md: "
|
|
937
|
-
lg: "
|
|
938
|
-
fullWidth: "
|
|
939
|
-
iconOnly: "
|
|
940
|
-
label: "
|
|
941
|
-
icon: "
|
|
942
|
-
spinner: "
|
|
943
|
-
"button-spin": "_button-
|
|
944
|
-
},
|
|
905
|
+
button: "_button_kajmf_1",
|
|
906
|
+
solid: "_solid_kajmf_21",
|
|
907
|
+
primary: "_primary_kajmf_21",
|
|
908
|
+
loading: "_loading_kajmf_21",
|
|
909
|
+
secondary: "_secondary_kajmf_45",
|
|
910
|
+
danger: "_danger_kajmf_69",
|
|
911
|
+
close: "_close_kajmf_93",
|
|
912
|
+
outline: "_outline_kajmf_117",
|
|
913
|
+
ghost: "_ghost_kajmf_213",
|
|
914
|
+
sm: "_sm_kajmf_327",
|
|
915
|
+
md: "_md_kajmf_333",
|
|
916
|
+
lg: "_lg_kajmf_339",
|
|
917
|
+
fullWidth: "_fullWidth_kajmf_345",
|
|
918
|
+
iconOnly: "_iconOnly_kajmf_349",
|
|
919
|
+
label: "_label_kajmf_353",
|
|
920
|
+
icon: "_icon_kajmf_349",
|
|
921
|
+
spinner: "_spinner_kajmf_375",
|
|
922
|
+
"button-spin": "_button-spin_kajmf_1"
|
|
923
|
+
}, Ze = 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) => {
|
|
945
924
|
let y = d || !e && !!(c || l), b = a || o, x = o && s ? s : e;
|
|
946
|
-
return
|
|
925
|
+
return Xe(!y || !!g, "Button: icon-only buttons must provide aria-label."), /* @__PURE__ */ p("button", {
|
|
947
926
|
..._,
|
|
948
927
|
ref: v,
|
|
949
928
|
type: i,
|
|
@@ -951,7 +930,7 @@ var qe = (e, t) => {
|
|
|
951
930
|
onClick: b ? void 0 : h,
|
|
952
931
|
"aria-label": g || void 0,
|
|
953
932
|
"aria-busy": o || void 0,
|
|
954
|
-
className:
|
|
933
|
+
className: F(X.button, X[t], X[n], X[r], m, {
|
|
955
934
|
[X.disabled]: b,
|
|
956
935
|
[X.loading]: o,
|
|
957
936
|
[X.fullWidth]: u,
|
|
@@ -977,49 +956,49 @@ var qe = (e, t) => {
|
|
|
977
956
|
]
|
|
978
957
|
});
|
|
979
958
|
});
|
|
980
|
-
|
|
959
|
+
Ze.displayName = "Button";
|
|
981
960
|
var Z = {
|
|
982
|
-
wrapper: "
|
|
983
|
-
wrapperSm: "
|
|
984
|
-
wrapperMd: "
|
|
985
|
-
wrapperLg: "
|
|
986
|
-
iconOnly: "
|
|
987
|
-
container: "
|
|
988
|
-
containerSm: "
|
|
989
|
-
containerMd: "
|
|
990
|
-
containerLg: "
|
|
991
|
-
input: "
|
|
992
|
-
customCheckbox: "
|
|
993
|
-
requiredMark: "
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
disabled: "
|
|
1005
|
-
},
|
|
961
|
+
wrapper: "_wrapper_2j84j_1",
|
|
962
|
+
wrapperSm: "_wrapperSm_2j84j_12",
|
|
963
|
+
wrapperMd: "_wrapperMd_2j84j_18",
|
|
964
|
+
wrapperLg: "_wrapperLg_2j84j_24",
|
|
965
|
+
iconOnly: "_iconOnly_2j84j_30",
|
|
966
|
+
container: "_container_2j84j_36",
|
|
967
|
+
containerSm: "_containerSm_2j84j_43",
|
|
968
|
+
containerMd: "_containerMd_2j84j_47",
|
|
969
|
+
containerLg: "_containerLg_2j84j_51",
|
|
970
|
+
input: "_input_2j84j_55",
|
|
971
|
+
customCheckbox: "_customCheckbox_2j84j_67",
|
|
972
|
+
requiredMark: "_requiredMark_2j84j_81",
|
|
973
|
+
error: "_error_2j84j_92",
|
|
974
|
+
checkmark: "_checkmark_2j84j_97",
|
|
975
|
+
indeterminateMark: "_indeterminateMark_2j84j_113",
|
|
976
|
+
label: "_label_2j84j_123",
|
|
977
|
+
descriptionText: "_descriptionText_2j84j_129",
|
|
978
|
+
errorText: "_errorText_2j84j_136",
|
|
979
|
+
labelSm: "_labelSm_2j84j_143",
|
|
980
|
+
labelMd: "_labelMd_2j84j_147",
|
|
981
|
+
labelLg: "_labelLg_2j84j_151",
|
|
982
|
+
indeterminate: "_indeterminate_2j84j_113",
|
|
983
|
+
disabled: "_disabled_2j84j_223"
|
|
984
|
+
}, Qe = {
|
|
1006
985
|
sm: Z.labelSm,
|
|
1007
986
|
md: Z.labelMd,
|
|
1008
987
|
lg: Z.labelLg
|
|
1009
|
-
},
|
|
988
|
+
}, $e = {
|
|
1010
989
|
sm: Z.wrapperSm,
|
|
1011
990
|
md: Z.wrapperMd,
|
|
1012
991
|
lg: Z.wrapperLg
|
|
1013
|
-
},
|
|
992
|
+
}, et = {
|
|
1014
993
|
sm: Z.containerSm,
|
|
1015
994
|
md: Z.containerMd,
|
|
1016
995
|
lg: Z.containerLg
|
|
1017
|
-
},
|
|
1018
|
-
let w = a(), E = e ?? w, D = s(null),
|
|
996
|
+
}, tt = 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) => {
|
|
997
|
+
let w = a(), E = e ?? w, D = s(null), O = !!v, k = r ? `${E}-description` : void 0, A = O ? `${E}-error` : void 0, M = [
|
|
1019
998
|
x,
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
].filter(Boolean).join(" "), [
|
|
999
|
+
k,
|
|
1000
|
+
A
|
|
1001
|
+
].filter(Boolean).join(" "), [N, P] = T({
|
|
1023
1002
|
value: o,
|
|
1024
1003
|
defaultValue: l,
|
|
1025
1004
|
onChange: _
|
|
@@ -1033,42 +1012,42 @@ var Z = {
|
|
|
1033
1012
|
i(() => {
|
|
1034
1013
|
D.current && (D.current.indeterminate = m);
|
|
1035
1014
|
}, [m]);
|
|
1036
|
-
let
|
|
1037
|
-
|
|
1015
|
+
let L = (e) => {
|
|
1016
|
+
P(e.target.checked);
|
|
1038
1017
|
};
|
|
1039
|
-
return
|
|
1040
|
-
className:
|
|
1018
|
+
return Xe(!!(t || y || b), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ p("div", {
|
|
1019
|
+
className: F(Z.container, et[c], h),
|
|
1041
1020
|
children: [
|
|
1042
1021
|
/* @__PURE__ */ p("label", {
|
|
1043
1022
|
htmlFor: E,
|
|
1044
|
-
className:
|
|
1023
|
+
className: F(Z.wrapper, $e[c], !t && Z.iconOnly, u && Z.disabled, g),
|
|
1045
1024
|
children: [
|
|
1046
1025
|
/* @__PURE__ */ f("input", {
|
|
1047
1026
|
...S,
|
|
1048
1027
|
ref: I,
|
|
1049
1028
|
id: E,
|
|
1050
1029
|
type: "checkbox",
|
|
1051
|
-
checked:
|
|
1030
|
+
checked: N,
|
|
1052
1031
|
disabled: u,
|
|
1053
1032
|
required: d,
|
|
1054
|
-
onChange:
|
|
1033
|
+
onChange: L,
|
|
1055
1034
|
className: Z.input,
|
|
1056
1035
|
"aria-label": y,
|
|
1057
1036
|
"aria-labelledby": b,
|
|
1058
1037
|
"aria-checked": m ? "mixed" : S["aria-checked"],
|
|
1059
|
-
"aria-invalid":
|
|
1060
|
-
"aria-describedby":
|
|
1038
|
+
"aria-invalid": O ? !0 : S["aria-invalid"],
|
|
1039
|
+
"aria-describedby": M || void 0
|
|
1061
1040
|
}),
|
|
1062
1041
|
/* @__PURE__ */ f("span", {
|
|
1063
|
-
className:
|
|
1042
|
+
className: F(Z.customCheckbox, O && Z.error, m && Z.indeterminate),
|
|
1064
1043
|
"aria-hidden": "true",
|
|
1065
|
-
children: m ? /* @__PURE__ */ f("span", { className: Z.indeterminateMark }) :
|
|
1044
|
+
children: m ? /* @__PURE__ */ f("span", { className: Z.indeterminateMark }) : N && /* @__PURE__ */ f("span", {
|
|
1066
1045
|
className: Z.checkmark,
|
|
1067
|
-
children: /* @__PURE__ */ f(
|
|
1046
|
+
children: /* @__PURE__ */ f(j, {})
|
|
1068
1047
|
})
|
|
1069
1048
|
}),
|
|
1070
1049
|
t && /* @__PURE__ */ p("span", {
|
|
1071
|
-
className:
|
|
1050
|
+
className: F(Z.label, Qe[c]),
|
|
1072
1051
|
children: [t, d && /* @__PURE__ */ f("span", {
|
|
1073
1052
|
className: Z.requiredMark,
|
|
1074
1053
|
"aria-hidden": "true",
|
|
@@ -1078,39 +1057,39 @@ var Z = {
|
|
|
1078
1057
|
]
|
|
1079
1058
|
}),
|
|
1080
1059
|
r && /* @__PURE__ */ f("span", {
|
|
1081
|
-
id:
|
|
1060
|
+
id: k,
|
|
1082
1061
|
className: Z.descriptionText,
|
|
1083
1062
|
children: r
|
|
1084
1063
|
}),
|
|
1085
|
-
|
|
1086
|
-
id:
|
|
1064
|
+
O && /* @__PURE__ */ f("span", {
|
|
1065
|
+
id: A,
|
|
1087
1066
|
className: Z.errorText,
|
|
1088
1067
|
children: v
|
|
1089
1068
|
})
|
|
1090
1069
|
]
|
|
1091
1070
|
});
|
|
1092
1071
|
});
|
|
1093
|
-
|
|
1072
|
+
tt.displayName = "Checkbox";
|
|
1094
1073
|
var Q = {
|
|
1095
|
-
inputWrapper: "
|
|
1096
|
-
input: "
|
|
1097
|
-
error: "
|
|
1098
|
-
sm: "
|
|
1099
|
-
md: "
|
|
1100
|
-
lg: "
|
|
1101
|
-
hasLeftAdornment: "
|
|
1102
|
-
hasRightAdornment: "
|
|
1103
|
-
leftAdornment: "
|
|
1104
|
-
rightAdornment: "
|
|
1105
|
-
clearButton: "
|
|
1106
|
-
toneDefault: "
|
|
1107
|
-
tonePrimary: "
|
|
1108
|
-
toneSecondary: "
|
|
1109
|
-
toneSuccess: "
|
|
1110
|
-
toneDanger: "
|
|
1111
|
-
toneMuted: "
|
|
1112
|
-
toneInverse: "
|
|
1113
|
-
},
|
|
1074
|
+
inputWrapper: "_inputWrapper_13w4m_1",
|
|
1075
|
+
input: "_input_13w4m_1",
|
|
1076
|
+
error: "_error_13w4m_47",
|
|
1077
|
+
sm: "_sm_13w4m_55",
|
|
1078
|
+
md: "_md_13w4m_59",
|
|
1079
|
+
lg: "_lg_13w4m_63",
|
|
1080
|
+
hasLeftAdornment: "_hasLeftAdornment_13w4m_98",
|
|
1081
|
+
hasRightAdornment: "_hasRightAdornment_13w4m_102",
|
|
1082
|
+
leftAdornment: "_leftAdornment_13w4m_106",
|
|
1083
|
+
rightAdornment: "_rightAdornment_13w4m_107",
|
|
1084
|
+
clearButton: "_clearButton_13w4m_149",
|
|
1085
|
+
toneDefault: "_toneDefault_13w4m_189",
|
|
1086
|
+
tonePrimary: "_tonePrimary_13w4m_193",
|
|
1087
|
+
toneSecondary: "_toneSecondary_13w4m_197",
|
|
1088
|
+
toneSuccess: "_toneSuccess_13w4m_201",
|
|
1089
|
+
toneDanger: "_toneDanger_13w4m_205",
|
|
1090
|
+
toneMuted: "_toneMuted_13w4m_209",
|
|
1091
|
+
toneInverse: "_toneInverse_13w4m_213"
|
|
1092
|
+
}, nt = {
|
|
1114
1093
|
default: Q.toneDefault,
|
|
1115
1094
|
primary: Q.tonePrimary,
|
|
1116
1095
|
secondary: Q.toneSecondary,
|
|
@@ -1118,7 +1097,7 @@ var Q = {
|
|
|
1118
1097
|
danger: Q.toneDanger,
|
|
1119
1098
|
muted: Q.toneMuted,
|
|
1120
1099
|
inverse: Q.toneInverse
|
|
1121
|
-
},
|
|
1100
|
+
}, rt = (e = "text", t) => {
|
|
1122
1101
|
if (t) return t;
|
|
1123
1102
|
switch (e) {
|
|
1124
1103
|
case "email": return "email";
|
|
@@ -1128,50 +1107,50 @@ var Q = {
|
|
|
1128
1107
|
case "search": return "off";
|
|
1129
1108
|
default: return;
|
|
1130
1109
|
}
|
|
1131
|
-
},
|
|
1132
|
-
let
|
|
1133
|
-
|
|
1134
|
-
i ? `${
|
|
1135
|
-
g ? `${
|
|
1110
|
+
}, it = 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: M, onMouseLeave: N, "aria-describedby": P, "aria-invalid": I, ...L }, R) => {
|
|
1111
|
+
let z = a(), B = e ?? z, ee = s(null), [V, te] = c(u ?? ""), H = l !== void 0, ne = H ? l : V, U = ne !== "", re = rt(m, b), W = S && U && !_ && !x, ie = [
|
|
1112
|
+
P,
|
|
1113
|
+
i ? `${B}-description` : void 0,
|
|
1114
|
+
g ? `${B}-error` : void 0
|
|
1136
1115
|
].filter(Boolean).join(" "), ae = E ?? "×", oe = n((e) => {
|
|
1137
|
-
if (
|
|
1138
|
-
|
|
1116
|
+
if (ee.current = e, typeof R == "function") {
|
|
1117
|
+
R(e);
|
|
1139
1118
|
return;
|
|
1140
1119
|
}
|
|
1141
|
-
|
|
1142
|
-
}, [
|
|
1120
|
+
R && (R.current = e);
|
|
1121
|
+
}, [R]), se = n((e) => {
|
|
1143
1122
|
let t = e.target.value;
|
|
1144
|
-
|
|
1145
|
-
}, [
|
|
1146
|
-
|
|
1147
|
-
}, [
|
|
1148
|
-
return /* @__PURE__ */ f(
|
|
1149
|
-
id:
|
|
1123
|
+
H || te(t), d?.(e);
|
|
1124
|
+
}, [H, d]), ce = n(() => {
|
|
1125
|
+
H || te(""), C?.(), ee.current?.focus();
|
|
1126
|
+
}, [H, C]), le = !W && !!T;
|
|
1127
|
+
return /* @__PURE__ */ f(Ae, {
|
|
1128
|
+
id: B,
|
|
1150
1129
|
label: t,
|
|
1151
1130
|
description: i,
|
|
1152
1131
|
error: g,
|
|
1153
1132
|
required: v,
|
|
1154
1133
|
disabled: _,
|
|
1155
1134
|
children: /* @__PURE__ */ p("div", {
|
|
1156
|
-
className:
|
|
1135
|
+
className: F(Q.inputWrapper, {
|
|
1157
1136
|
[Q.hasLeftAdornment]: !!w,
|
|
1158
1137
|
[Q.hasRightAdornment]: !!T || W
|
|
1159
1138
|
}),
|
|
1160
1139
|
children: [
|
|
1161
1140
|
w && /* @__PURE__ */ f("span", {
|
|
1162
1141
|
"aria-hidden": "true",
|
|
1163
|
-
className:
|
|
1142
|
+
className: F(Q.leftAdornment, nt[D]),
|
|
1164
1143
|
children: w
|
|
1165
1144
|
}),
|
|
1166
1145
|
/* @__PURE__ */ f("input", {
|
|
1167
|
-
...
|
|
1146
|
+
...L,
|
|
1168
1147
|
ref: oe,
|
|
1169
|
-
id:
|
|
1148
|
+
id: B,
|
|
1170
1149
|
name: r,
|
|
1171
1150
|
type: m,
|
|
1172
|
-
autoComplete:
|
|
1173
|
-
className:
|
|
1174
|
-
value:
|
|
1151
|
+
autoComplete: re,
|
|
1152
|
+
className: F(Q.input, Q[h], { [Q.error]: !!g }, y),
|
|
1153
|
+
value: ne,
|
|
1175
1154
|
onChange: se,
|
|
1176
1155
|
placeholder: o,
|
|
1177
1156
|
disabled: _,
|
|
@@ -1181,42 +1160,42 @@ var Q = {
|
|
|
1181
1160
|
maxLength: j,
|
|
1182
1161
|
"aria-invalid": g ? !0 : I,
|
|
1183
1162
|
"aria-describedby": ie || void 0,
|
|
1184
|
-
onMouseEnter:
|
|
1185
|
-
onMouseLeave:
|
|
1163
|
+
onMouseEnter: M,
|
|
1164
|
+
onMouseLeave: N
|
|
1186
1165
|
}),
|
|
1187
1166
|
W && /* @__PURE__ */ f("button", {
|
|
1188
1167
|
type: "button",
|
|
1189
|
-
className:
|
|
1168
|
+
className: F(Q.clearButton, nt[k]),
|
|
1190
1169
|
onClick: ce,
|
|
1191
1170
|
"aria-label": "Clear input",
|
|
1192
1171
|
children: ae
|
|
1193
1172
|
}),
|
|
1194
1173
|
le && /* @__PURE__ */ f("div", {
|
|
1195
|
-
className:
|
|
1174
|
+
className: F(Q.rightAdornment, nt[O]),
|
|
1196
1175
|
children: T
|
|
1197
1176
|
})
|
|
1198
1177
|
]
|
|
1199
1178
|
})
|
|
1200
1179
|
});
|
|
1201
1180
|
});
|
|
1202
|
-
|
|
1181
|
+
it.displayName = "Input";
|
|
1203
1182
|
var $ = {
|
|
1204
|
-
root: "
|
|
1205
|
-
invalid: "
|
|
1206
|
-
control: "
|
|
1207
|
-
label: "
|
|
1208
|
-
wrapper: "
|
|
1209
|
-
input: "
|
|
1210
|
-
disabled: "
|
|
1211
|
-
description: "
|
|
1212
|
-
sm: "
|
|
1213
|
-
md: "
|
|
1214
|
-
lg: "
|
|
1215
|
-
indicator: "
|
|
1216
|
-
content: "
|
|
1217
|
-
error: "
|
|
1218
|
-
},
|
|
1219
|
-
let b =
|
|
1183
|
+
root: "_root_ie5a6_1",
|
|
1184
|
+
invalid: "_invalid_ie5a6_14",
|
|
1185
|
+
control: "_control_ie5a6_14",
|
|
1186
|
+
label: "_label_ie5a6_17",
|
|
1187
|
+
wrapper: "_wrapper_ie5a6_20",
|
|
1188
|
+
input: "_input_ie5a6_21",
|
|
1189
|
+
disabled: "_disabled_ie5a6_24",
|
|
1190
|
+
description: "_description_ie5a6_32",
|
|
1191
|
+
sm: "_sm_ie5a6_36",
|
|
1192
|
+
md: "_md_ie5a6_45",
|
|
1193
|
+
lg: "_lg_ie5a6_54",
|
|
1194
|
+
indicator: "_indicator_ie5a6_109",
|
|
1195
|
+
content: "_content_ie5a6_202",
|
|
1196
|
+
error: "_error_ie5a6_219"
|
|
1197
|
+
}, at = 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) => {
|
|
1198
|
+
let b = Oe(), x = a(), S = h ?? x, C = u ? `${S}-description` : void 0, w = s ? `${S}-error` : void 0, E = [
|
|
1220
1199
|
C,
|
|
1221
1200
|
w,
|
|
1222
1201
|
b?.describedBy,
|
|
@@ -1225,7 +1204,7 @@ var $ = {
|
|
|
1225
1204
|
value: t,
|
|
1226
1205
|
defaultValue: n,
|
|
1227
1206
|
onChange: c
|
|
1228
|
-
}), A = D ? b.value === e : O, j = !!b?.disabled || r,
|
|
1207
|
+
}), A = D ? b.value === e : O, j = !!b?.disabled || r, M = !!b?.required || i, N = b?.name ?? g, P = !!(s || b?.invalid), I = o ?? b?.size ?? "md", L = (t) => {
|
|
1229
1208
|
if (!j) {
|
|
1230
1209
|
if (D) {
|
|
1231
1210
|
b.onValueChange(e);
|
|
@@ -1235,25 +1214,25 @@ var $ = {
|
|
|
1235
1214
|
}
|
|
1236
1215
|
};
|
|
1237
1216
|
return /* @__PURE__ */ p("div", {
|
|
1238
|
-
className:
|
|
1217
|
+
className: F($.root, $[I], P && $.invalid, j && $.disabled, m),
|
|
1239
1218
|
children: [/* @__PURE__ */ p("label", {
|
|
1240
1219
|
htmlFor: S,
|
|
1241
|
-
className:
|
|
1220
|
+
className: F($.wrapper, d),
|
|
1242
1221
|
children: [
|
|
1243
1222
|
/* @__PURE__ */ f("input", {
|
|
1244
1223
|
...v,
|
|
1245
1224
|
ref: y,
|
|
1246
1225
|
id: S,
|
|
1247
1226
|
type: "radio",
|
|
1248
|
-
name:
|
|
1227
|
+
name: N,
|
|
1249
1228
|
value: e,
|
|
1250
1229
|
checked: A,
|
|
1251
1230
|
disabled: j,
|
|
1252
|
-
required:
|
|
1253
|
-
"aria-invalid":
|
|
1231
|
+
required: M,
|
|
1232
|
+
"aria-invalid": P || void 0,
|
|
1254
1233
|
"aria-describedby": E,
|
|
1255
1234
|
className: $.input,
|
|
1256
|
-
onChange:
|
|
1235
|
+
onChange: L
|
|
1257
1236
|
}),
|
|
1258
1237
|
/* @__PURE__ */ f("span", {
|
|
1259
1238
|
className: $.control,
|
|
@@ -1279,15 +1258,15 @@ var $ = {
|
|
|
1279
1258
|
})]
|
|
1280
1259
|
});
|
|
1281
1260
|
});
|
|
1282
|
-
|
|
1261
|
+
at.displayName = "Radio";
|
|
1283
1262
|
//#endregion
|
|
1284
1263
|
//#region src/theme/ThemeContext.ts
|
|
1285
|
-
var
|
|
1264
|
+
var ot = e(null), st = (e) => e === "highContrast" ? "high-contrast" : e, ct = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
|
|
1286
1265
|
let [a, s] = T({
|
|
1287
1266
|
value: e,
|
|
1288
1267
|
defaultValue: t,
|
|
1289
1268
|
onChange: n
|
|
1290
|
-
}), c =
|
|
1269
|
+
}), c = st(a);
|
|
1291
1270
|
i(() => {
|
|
1292
1271
|
if (typeof document > "u") return;
|
|
1293
1272
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -1303,7 +1282,7 @@ var rt = e(null), it = (e) => e === "highContrast" ? "high-contrast" : e, at = (
|
|
|
1303
1282
|
theme: a,
|
|
1304
1283
|
setTheme: s
|
|
1305
1284
|
}), [a, s]);
|
|
1306
|
-
return /* @__PURE__ */ f(
|
|
1285
|
+
return /* @__PURE__ */ f(ot.Provider, {
|
|
1307
1286
|
value: l,
|
|
1308
1287
|
children: /* @__PURE__ */ f("div", {
|
|
1309
1288
|
"data-vellira-theme": c,
|
|
@@ -1311,13 +1290,13 @@ var rt = e(null), it = (e) => e === "highContrast" ? "high-contrast" : e, at = (
|
|
|
1311
1290
|
})
|
|
1312
1291
|
});
|
|
1313
1292
|
};
|
|
1314
|
-
|
|
1293
|
+
ct.displayName = "ThemeProvider";
|
|
1315
1294
|
//#endregion
|
|
1316
1295
|
//#region src/theme/useTheme.ts
|
|
1317
|
-
function
|
|
1318
|
-
let e = r(
|
|
1296
|
+
function lt() {
|
|
1297
|
+
let e = r(ot);
|
|
1319
1298
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
1320
1299
|
return e;
|
|
1321
1300
|
}
|
|
1322
1301
|
//#endregion
|
|
1323
|
-
export {
|
|
1302
|
+
export { Ze as Button, tt as Checkbox, le as Dropdown, Ae as FormField, it as Input, Te as Modal, at as Radio, ke as RadioGroup, Ie as Select, Ke as Tabs, ct as ThemeProvider, Ye as Tooltip, lt as useTheme };
|