@vellira-ui/react 2.24.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 +28 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +256 -218
- package/dist/styles.css +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var I = (e) => {
|
|
|
42
42
|
t.removeEventListener("change", r);
|
|
43
43
|
};
|
|
44
44
|
}, [e]), t;
|
|
45
|
-
},
|
|
45
|
+
}, ee = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", matchTriggerWidth: a = !1, mobileSheetBreakpoint: s, middleware: c = [] } = {}) => {
|
|
46
46
|
let l = I(s), { refs: u, floatingStyles: d, update: f, context: p, middlewareData: m, placement: h } = x({
|
|
47
47
|
open: e,
|
|
48
48
|
onOpenChange: t,
|
|
@@ -76,7 +76,7 @@ var I = (e) => {
|
|
|
76
76
|
setFloatingRef: u.setFloating,
|
|
77
77
|
updatePosition: f
|
|
78
78
|
};
|
|
79
|
-
},
|
|
79
|
+
}, L = (e, t, n = !0) => {
|
|
80
80
|
let r = s(e);
|
|
81
81
|
r.current = e;
|
|
82
82
|
let a = s(t);
|
|
@@ -88,11 +88,11 @@ var I = (e) => {
|
|
|
88
88
|
};
|
|
89
89
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
90
90
|
}, [n]);
|
|
91
|
-
},
|
|
91
|
+
}, R = { group: "_group_1yomt_1" }, te = ({ label: e }) => /* @__PURE__ */ f("li", {
|
|
92
92
|
role: "presentation",
|
|
93
|
-
className:
|
|
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,36 +163,36 @@ 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
|
|
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 } =
|
|
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
|
+
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;
|
|
190
190
|
});
|
|
191
191
|
}, I = () => {
|
|
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,
|
|
@@ -200,20 +200,20 @@ var te = (e) => e.type !== "group" && e.type !== "separator", ne = (e) => e.type
|
|
|
200
200
|
onOpen: P,
|
|
201
201
|
onSelect: () => {
|
|
202
202
|
let e = A[b];
|
|
203
|
-
!e || e.disabled || (i?.(e.value),
|
|
203
|
+
!e || e.disabled || (i?.(e.value), R());
|
|
204
204
|
},
|
|
205
|
-
onClose:
|
|
205
|
+
onClose: R
|
|
206
206
|
});
|
|
207
|
-
|
|
208
|
-
let
|
|
207
|
+
L([S, C], () => I(), v);
|
|
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,31 +223,31 @@ var te = (e) => e.type !== "group" && e.type !== "separator", ne = (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,
|
|
248
248
|
textWrap: e.textWrap || h,
|
|
249
249
|
onClick: () => {
|
|
250
|
-
e.disabled || (i?.(e.value),
|
|
250
|
+
e.disabled || (i?.(e.value), R());
|
|
251
251
|
},
|
|
252
252
|
onMouseEnter: () => {
|
|
253
253
|
t < 0 || e.disabled || x(t);
|
|
@@ -258,23 +258,23 @@ var te = (e) => e.type !== "group" && e.type !== "separator", ne = (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", {
|
|
@@ -318,7 +318,7 @@ var ge = ({ isOpen: e, onClose: t }) => {
|
|
|
318
318
|
"overlay--animated": "_overlay--animated_1xotg_17",
|
|
319
319
|
modal: "_modal_1xotg_21"
|
|
320
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 } =
|
|
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({
|
|
@@ -360,7 +360,7 @@ be.displayName = "ModalOverlay";
|
|
|
360
360
|
//#region src/components/Modal/Modal.tsx
|
|
361
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,
|
|
@@ -380,7 +380,7 @@ xe.displayName = "Modal";
|
|
|
380
380
|
//#region src/components/Modal/index.ts
|
|
381
381
|
var Se = Object.assign(xe, {
|
|
382
382
|
Header: he,
|
|
383
|
-
Body:
|
|
383
|
+
Body: ue,
|
|
384
384
|
Content: de,
|
|
385
385
|
Footer: pe
|
|
386
386
|
}), Ce = e(null), we = Ce.Provider;
|
|
@@ -456,15 +456,20 @@ var K = {
|
|
|
456
456
|
});
|
|
457
457
|
Ee.displayName = "RadioGroup";
|
|
458
458
|
var q = {
|
|
459
|
-
wrapper: "
|
|
460
|
-
label: "
|
|
461
|
-
required: "
|
|
462
|
-
description: "
|
|
463
|
-
control: "
|
|
464
|
-
errorText: "
|
|
465
|
-
disabled: "
|
|
466
|
-
storyInput: "
|
|
467
|
-
storyBadge: "
|
|
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"
|
|
468
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
474
|
let h = n && e ? `${e}-description` : void 0, g = r && e ? `${e}-error` : void 0;
|
|
470
475
|
return /* @__PURE__ */ p("div", {
|
|
@@ -501,13 +506,15 @@ var q = {
|
|
|
501
506
|
]
|
|
502
507
|
});
|
|
503
508
|
}, Oe = {
|
|
504
|
-
option: "
|
|
505
|
-
selected: "
|
|
506
|
-
disabled: "
|
|
507
|
-
active: "
|
|
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"
|
|
508
515
|
}, ke = ({ option: e, isSelected: t, isActive: n, optionId: r, onSelect: i, onMouseEnter: a }) => {
|
|
509
516
|
let o = !!e.disabled;
|
|
510
|
-
return /* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ p("li", {
|
|
511
518
|
id: r,
|
|
512
519
|
role: "option",
|
|
513
520
|
"aria-selected": t,
|
|
@@ -523,41 +530,56 @@ var q = {
|
|
|
523
530
|
onMouseEnter: () => {
|
|
524
531
|
o || a();
|
|
525
532
|
},
|
|
526
|
-
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
|
+
})]
|
|
527
541
|
});
|
|
528
542
|
};
|
|
529
543
|
ke.displayName = "SelectOption";
|
|
530
544
|
var Ae = {
|
|
531
|
-
dropdown: "
|
|
532
|
-
dropdownIn: "
|
|
533
|
-
|
|
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", {
|
|
534
549
|
ref: r,
|
|
535
550
|
id: t,
|
|
536
551
|
role: "listbox",
|
|
537
552
|
"aria-labelledby": n,
|
|
538
|
-
className: Ae.dropdown,
|
|
553
|
+
className: [Ae.dropdown, l].filter(Boolean).join(" "),
|
|
539
554
|
style: i,
|
|
540
|
-
children: a.map((e, n) => /* @__PURE__ */ f(ke, {
|
|
555
|
+
children: a.length ? a.map((e, n) => /* @__PURE__ */ f(ke, {
|
|
541
556
|
option: e,
|
|
542
|
-
isSelected: e.value ===
|
|
543
|
-
isActive: n ===
|
|
557
|
+
isSelected: e.value === s,
|
|
558
|
+
isActive: n === c,
|
|
544
559
|
optionId: `${t}-option-${n}`,
|
|
545
|
-
onSelect:
|
|
546
|
-
onMouseEnter: () =>
|
|
547
|
-
}, 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
|
+
})
|
|
548
567
|
}) }) : null;
|
|
549
568
|
je.displayName = "SelectDropdown";
|
|
550
569
|
var J = {
|
|
551
|
-
control: "
|
|
552
|
-
disabled: "
|
|
553
|
-
arrow: "
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
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", {
|
|
559
581
|
id: e,
|
|
560
|
-
ref:
|
|
582
|
+
ref: h,
|
|
561
583
|
type: "button",
|
|
562
584
|
role: "combobox",
|
|
563
585
|
disabled: r,
|
|
@@ -566,15 +588,18 @@ var J = {
|
|
|
566
588
|
"aria-expanded": n,
|
|
567
589
|
"aria-haspopup": "listbox",
|
|
568
590
|
"aria-label": s,
|
|
591
|
+
"aria-invalid": c || void 0,
|
|
569
592
|
"aria-controls": n ? a : void 0,
|
|
570
593
|
"aria-describedby": t,
|
|
571
594
|
"aria-activedescendant": n && o >= 0 ? `${a}-option-${o}` : void 0,
|
|
572
|
-
className: M(J.control, {
|
|
595
|
+
className: M(J.control, J[d], {
|
|
573
596
|
[J.error]: !!c,
|
|
574
597
|
[J.disabled]: r
|
|
575
|
-
}),
|
|
576
|
-
onClick:
|
|
577
|
-
onKeyDown:
|
|
598
|
+
}, m),
|
|
599
|
+
onClick: g,
|
|
600
|
+
onKeyDown: _,
|
|
601
|
+
onBlur: v,
|
|
602
|
+
onFocus: y,
|
|
578
603
|
children: [/* @__PURE__ */ f("span", {
|
|
579
604
|
className: M(J.value, { [J.placeholder]: u }),
|
|
580
605
|
children: l
|
|
@@ -587,97 +612,110 @@ var J = {
|
|
|
587
612
|
Me.displayName = "SelectTrigger";
|
|
588
613
|
//#endregion
|
|
589
614
|
//#region src/components/Select/Select.tsx
|
|
590
|
-
var Ne = ({ label: e, description: t, id: r, name: i,
|
|
591
|
-
let
|
|
592
|
-
value:
|
|
593
|
-
defaultValue:
|
|
594
|
-
onChange:
|
|
595
|
-
}), [
|
|
596
|
-
|
|
597
|
-
|
|
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,
|
|
598
629
|
mobileSheetBreakpoint: 640
|
|
599
|
-
}),
|
|
600
|
-
let e =
|
|
601
|
-
return e >= 0 ? e :
|
|
602
|
-
}, [
|
|
603
|
-
|
|
604
|
-
}, [
|
|
605
|
-
|
|
606
|
-
}, []),
|
|
607
|
-
if (!
|
|
608
|
-
if (
|
|
609
|
-
|
|
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();
|
|
610
641
|
return;
|
|
611
642
|
}
|
|
612
|
-
|
|
643
|
+
ue();
|
|
613
644
|
}
|
|
614
645
|
}, [
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
]),
|
|
620
|
-
|
|
621
|
-
}, [
|
|
622
|
-
activeIndex:
|
|
623
|
-
setActiveIndex:
|
|
624
|
-
items:
|
|
625
|
-
isOpen:
|
|
626
|
-
onOpen:
|
|
627
|
-
onClose:
|
|
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,
|
|
628
659
|
onSelect: () => {
|
|
629
|
-
let e =
|
|
630
|
-
!e || e.disabled ||
|
|
631
|
-
}
|
|
660
|
+
let e = h[U];
|
|
661
|
+
!e || e.disabled || fe(e.value);
|
|
662
|
+
},
|
|
663
|
+
getItemText: (e) => e.label
|
|
632
664
|
});
|
|
633
|
-
|
|
634
|
-
let
|
|
635
|
-
|
|
636
|
-
}, [
|
|
637
|
-
|
|
638
|
-
}, [
|
|
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]);
|
|
639
671
|
return /* @__PURE__ */ p(De, {
|
|
640
|
-
id:
|
|
672
|
+
id: F,
|
|
641
673
|
label: e,
|
|
642
674
|
description: t,
|
|
643
|
-
error:
|
|
644
|
-
required:
|
|
645
|
-
disabled:
|
|
646
|
-
className:
|
|
675
|
+
error: x,
|
|
676
|
+
required: y,
|
|
677
|
+
disabled: b,
|
|
678
|
+
className: j,
|
|
647
679
|
children: [
|
|
648
680
|
/* @__PURE__ */ f(Me, {
|
|
649
|
-
id:
|
|
650
|
-
errorId:
|
|
651
|
-
isOpen:
|
|
652
|
-
disabled:
|
|
653
|
-
required:
|
|
654
|
-
listboxId:
|
|
655
|
-
activeIndex:
|
|
656
|
-
ariaLabel: e ? void 0 :
|
|
657
|
-
error:
|
|
658
|
-
displayText:
|
|
659
|
-
isPlaceholder: !
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
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
|
|
663
699
|
}),
|
|
664
700
|
i && /* @__PURE__ */ f("input", {
|
|
665
701
|
type: "hidden",
|
|
666
702
|
name: i,
|
|
667
|
-
value:
|
|
668
|
-
disabled:
|
|
703
|
+
value: B,
|
|
704
|
+
disabled: b
|
|
669
705
|
}),
|
|
670
706
|
/* @__PURE__ */ f(je, {
|
|
671
|
-
isOpen:
|
|
672
|
-
listboxId:
|
|
673
|
-
labelledById:
|
|
674
|
-
style:
|
|
675
|
-
options:
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
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
|
|
681
719
|
})
|
|
682
720
|
]
|
|
683
721
|
});
|
|
@@ -845,7 +883,7 @@ var Ke = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
845
883
|
open: 300,
|
|
846
884
|
close: 100
|
|
847
885
|
}, maxWidth: o = 250, className: l, onOpenChange: u }) => {
|
|
848
|
-
let [g, _] = c(!1), v = s(null), y = a(), { context: b, floatingStyles: x, middlewareData: T, setRef: E, setFloatingRef: D, placement: O } =
|
|
886
|
+
let [g, _] = c(!1), v = s(null), y = a(), { context: b, floatingStyles: x, middlewareData: T, setRef: E, setFloatingRef: D, placement: O } = ee({
|
|
849
887
|
open: g,
|
|
850
888
|
onOpenChange: (e) => {
|
|
851
889
|
r || (_(e), u?.(e));
|
|
@@ -995,7 +1033,7 @@ var Z = {
|
|
|
995
1033
|
i(() => {
|
|
996
1034
|
D.current && (D.current.indeterminate = m);
|
|
997
1035
|
}, [m]);
|
|
998
|
-
let
|
|
1036
|
+
let ee = (e) => {
|
|
999
1037
|
F(e.target.checked);
|
|
1000
1038
|
};
|
|
1001
1039
|
return qe(!!(t || y || b), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ p("div", {
|
|
@@ -1013,7 +1051,7 @@ var Z = {
|
|
|
1013
1051
|
checked: P,
|
|
1014
1052
|
disabled: u,
|
|
1015
1053
|
required: d,
|
|
1016
|
-
onChange:
|
|
1054
|
+
onChange: ee,
|
|
1017
1055
|
className: Z.input,
|
|
1018
1056
|
"aria-label": y,
|
|
1019
1057
|
"aria-labelledby": b,
|
|
@@ -1054,24 +1092,24 @@ var Z = {
|
|
|
1054
1092
|
});
|
|
1055
1093
|
Qe.displayName = "Checkbox";
|
|
1056
1094
|
var Q = {
|
|
1057
|
-
inputWrapper: "
|
|
1058
|
-
input: "
|
|
1059
|
-
error: "
|
|
1060
|
-
sm: "
|
|
1061
|
-
md: "
|
|
1062
|
-
lg: "
|
|
1063
|
-
hasLeftAdornment: "
|
|
1064
|
-
hasRightAdornment: "
|
|
1065
|
-
leftAdornment: "
|
|
1066
|
-
rightAdornment: "
|
|
1067
|
-
clearButton: "
|
|
1068
|
-
toneDefault: "
|
|
1069
|
-
tonePrimary: "
|
|
1070
|
-
toneSecondary: "
|
|
1071
|
-
toneSuccess: "
|
|
1072
|
-
toneDanger: "
|
|
1073
|
-
toneMuted: "
|
|
1074
|
-
toneInverse: "
|
|
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"
|
|
1075
1113
|
}, $e = {
|
|
1076
1114
|
default: Q.toneDefault,
|
|
1077
1115
|
primary: Q.tonePrimary,
|
|
@@ -1090,25 +1128,25 @@ var Q = {
|
|
|
1090
1128
|
case "search": return "off";
|
|
1091
1129
|
default: return;
|
|
1092
1130
|
}
|
|
1093
|
-
}, 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, ...
|
|
1094
|
-
let
|
|
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 = [
|
|
1095
1133
|
F,
|
|
1096
|
-
i ? `${
|
|
1097
|
-
g ? `${
|
|
1098
|
-
].filter(Boolean).join(" "),
|
|
1099
|
-
if (
|
|
1100
|
-
|
|
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") {
|
|
1138
|
+
L(e);
|
|
1101
1139
|
return;
|
|
1102
1140
|
}
|
|
1103
|
-
|
|
1104
|
-
}, [
|
|
1141
|
+
L && (L.current = e);
|
|
1142
|
+
}, [L]), se = n((e) => {
|
|
1105
1143
|
let t = e.target.value;
|
|
1106
|
-
|
|
1107
|
-
}, [
|
|
1108
|
-
|
|
1109
|
-
}, [
|
|
1144
|
+
V || B(t), d?.(e);
|
|
1145
|
+
}, [V, d]), ce = n(() => {
|
|
1146
|
+
V || B(""), C?.(), z.current?.focus();
|
|
1147
|
+
}, [V, C]), le = !W && !!T;
|
|
1110
1148
|
return /* @__PURE__ */ f(De, {
|
|
1111
|
-
id:
|
|
1149
|
+
id: te,
|
|
1112
1150
|
label: t,
|
|
1113
1151
|
description: i,
|
|
1114
1152
|
error: g,
|
|
@@ -1117,7 +1155,7 @@ var Q = {
|
|
|
1117
1155
|
children: /* @__PURE__ */ p("div", {
|
|
1118
1156
|
className: M(Q.inputWrapper, {
|
|
1119
1157
|
[Q.hasLeftAdornment]: !!w,
|
|
1120
|
-
[Q.hasRightAdornment]: !!T ||
|
|
1158
|
+
[Q.hasRightAdornment]: !!T || W
|
|
1121
1159
|
}),
|
|
1122
1160
|
children: [
|
|
1123
1161
|
w && /* @__PURE__ */ f("span", {
|
|
@@ -1126,15 +1164,15 @@ var Q = {
|
|
|
1126
1164
|
children: w
|
|
1127
1165
|
}),
|
|
1128
1166
|
/* @__PURE__ */ f("input", {
|
|
1129
|
-
...
|
|
1130
|
-
ref:
|
|
1131
|
-
id:
|
|
1167
|
+
...ee,
|
|
1168
|
+
ref: oe,
|
|
1169
|
+
id: te,
|
|
1132
1170
|
name: r,
|
|
1133
1171
|
type: m,
|
|
1134
|
-
autoComplete:
|
|
1172
|
+
autoComplete: U,
|
|
1135
1173
|
className: M(Q.input, Q[h], { [Q.error]: !!g }, y),
|
|
1136
|
-
value:
|
|
1137
|
-
onChange:
|
|
1174
|
+
value: H,
|
|
1175
|
+
onChange: se,
|
|
1138
1176
|
placeholder: o,
|
|
1139
1177
|
disabled: _,
|
|
1140
1178
|
readOnly: x,
|
|
@@ -1142,18 +1180,18 @@ var Q = {
|
|
|
1142
1180
|
autoFocus: A,
|
|
1143
1181
|
maxLength: j,
|
|
1144
1182
|
"aria-invalid": g ? !0 : I,
|
|
1145
|
-
"aria-describedby":
|
|
1183
|
+
"aria-describedby": ie || void 0,
|
|
1146
1184
|
onMouseEnter: N,
|
|
1147
1185
|
onMouseLeave: P
|
|
1148
1186
|
}),
|
|
1149
|
-
|
|
1187
|
+
W && /* @__PURE__ */ f("button", {
|
|
1150
1188
|
type: "button",
|
|
1151
1189
|
className: M(Q.clearButton, $e[k]),
|
|
1152
|
-
onClick:
|
|
1190
|
+
onClick: ce,
|
|
1153
1191
|
"aria-label": "Clear input",
|
|
1154
|
-
children:
|
|
1192
|
+
children: ae
|
|
1155
1193
|
}),
|
|
1156
|
-
|
|
1194
|
+
le && /* @__PURE__ */ f("div", {
|
|
1157
1195
|
className: M(Q.rightAdornment, $e[O]),
|
|
1158
1196
|
children: T
|
|
1159
1197
|
})
|
|
@@ -1187,7 +1225,7 @@ var $ = {
|
|
|
1187
1225
|
value: t,
|
|
1188
1226
|
defaultValue: n,
|
|
1189
1227
|
onChange: c
|
|
1190
|
-
}), 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",
|
|
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) => {
|
|
1191
1229
|
if (!j) {
|
|
1192
1230
|
if (D) {
|
|
1193
1231
|
b.onValueChange(e);
|
|
@@ -1215,7 +1253,7 @@ var $ = {
|
|
|
1215
1253
|
"aria-invalid": F || void 0,
|
|
1216
1254
|
"aria-describedby": E,
|
|
1217
1255
|
className: $.input,
|
|
1218
|
-
onChange:
|
|
1256
|
+
onChange: ee
|
|
1219
1257
|
}),
|
|
1220
1258
|
/* @__PURE__ */ f("span", {
|
|
1221
1259
|
className: $.control,
|
|
@@ -1282,4 +1320,4 @@ function ot() {
|
|
|
1282
1320
|
return e;
|
|
1283
1321
|
}
|
|
1284
1322
|
//#endregion
|
|
1285
|
-
export { Je as Button, Qe as Checkbox,
|
|
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 };
|