@vellira-ui/react 2.28.0 → 2.29.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/dist/index.cjs +1 -1
- package/dist/index.js +296 -280
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -88,11 +88,11 @@ var V = (e) => {
|
|
|
88
88
|
};
|
|
89
89
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
90
90
|
}, [n]);
|
|
91
|
-
}, H = { group: "_group_aviwv_1" },
|
|
91
|
+
}, H = { group: "_group_aviwv_1" }, U = ({ label: e }) => /* @__PURE__ */ m("li", {
|
|
92
92
|
role: "presentation",
|
|
93
93
|
className: H.group,
|
|
94
94
|
children: e
|
|
95
|
-
}),
|
|
95
|
+
}), W = {
|
|
96
96
|
item: "_item_re11y_1",
|
|
97
97
|
disabled: "_disabled_re11y_21",
|
|
98
98
|
active: "_active_re11y_34",
|
|
@@ -103,7 +103,7 @@ var V = (e) => {
|
|
|
103
103
|
"itemText--truncate": "_itemText--truncate_re11y_88",
|
|
104
104
|
"itemText--wrap": "_itemText--wrap_re11y_93",
|
|
105
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 f = t || n;
|
|
108
108
|
return /* @__PURE__ */ h("li", {
|
|
109
109
|
id: e,
|
|
@@ -114,32 +114,32 @@ var V = (e) => {
|
|
|
114
114
|
"data-danger": i || void 0,
|
|
115
115
|
onClick: a ? void 0 : s,
|
|
116
116
|
onMouseEnter: a ? void 0 : c,
|
|
117
|
-
className: L(
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
117
|
+
className: L(W.item, {
|
|
118
|
+
[W.active]: o,
|
|
119
|
+
[W.disabled]: a,
|
|
120
|
+
[W.danger]: i
|
|
121
121
|
}, d),
|
|
122
122
|
children: [
|
|
123
123
|
r && /* @__PURE__ */ m("span", {
|
|
124
124
|
"aria-hidden": "true",
|
|
125
|
-
className:
|
|
125
|
+
className: W.itemIcon,
|
|
126
126
|
children: r
|
|
127
127
|
}),
|
|
128
128
|
f && /* @__PURE__ */ m("span", {
|
|
129
|
-
className: L(
|
|
129
|
+
className: L(W.itemText, W[`itemText--${u}`]),
|
|
130
130
|
children: f
|
|
131
131
|
}),
|
|
132
132
|
l && /* @__PURE__ */ m("span", {
|
|
133
|
-
className:
|
|
133
|
+
className: W.itemShortcut,
|
|
134
134
|
children: l
|
|
135
135
|
})
|
|
136
136
|
]
|
|
137
137
|
});
|
|
138
|
-
},
|
|
138
|
+
}, G = { separator: "_separator_1v11r_1" }, re = () => /* @__PURE__ */ m("li", {
|
|
139
139
|
role: "separator",
|
|
140
|
-
className:
|
|
140
|
+
className: G.separator,
|
|
141
141
|
"aria-hidden": "true"
|
|
142
|
-
}),
|
|
142
|
+
}), K = {
|
|
143
143
|
button: "_button_18ucr_1",
|
|
144
144
|
disabled: "_disabled_18ucr_20",
|
|
145
145
|
iconLeft: "_iconLeft_18ucr_32",
|
|
@@ -149,15 +149,15 @@ var V = (e) => {
|
|
|
149
149
|
md: "_md_18ucr_72",
|
|
150
150
|
lg: "_lg_18ucr_84",
|
|
151
151
|
open: "_open_18ucr_123"
|
|
152
|
-
},
|
|
152
|
+
}, ie = n(({ 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
153
|
let f = !!n, p = !!e, g = f && !p, _ = i && p, v = r ?? /* @__PURE__ */ m(P, {}), y = c ?? (g ? typeof s == "string" ? s : "Open menu" : void 0);
|
|
154
154
|
return /* @__PURE__ */ h("button", {
|
|
155
155
|
...u,
|
|
156
156
|
ref: d,
|
|
157
157
|
type: "button",
|
|
158
|
-
className: L(
|
|
159
|
-
[
|
|
160
|
-
[
|
|
158
|
+
className: L(K.button, K[o], {
|
|
159
|
+
[K.disabled]: u.disabled,
|
|
160
|
+
[K.iconOnly]: g
|
|
161
161
|
}, l),
|
|
162
162
|
"aria-label": y,
|
|
163
163
|
"aria-expanded": t,
|
|
@@ -166,30 +166,30 @@ var V = (e) => {
|
|
|
166
166
|
children: [
|
|
167
167
|
f && /* @__PURE__ */ m("span", {
|
|
168
168
|
"aria-hidden": "true",
|
|
169
|
-
className:
|
|
169
|
+
className: K.iconLeft,
|
|
170
170
|
children: n
|
|
171
171
|
}),
|
|
172
172
|
e,
|
|
173
173
|
_ && /* @__PURE__ */ m("span", {
|
|
174
174
|
"aria-hidden": "true",
|
|
175
|
-
className: L(
|
|
175
|
+
className: L(K.arrow, { [K.open]: t }),
|
|
176
176
|
children: v
|
|
177
177
|
})
|
|
178
178
|
]
|
|
179
179
|
});
|
|
180
180
|
});
|
|
181
|
-
|
|
181
|
+
ie.displayName = "DropdownTrigger";
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region src/components/Dropdown/types.ts
|
|
184
|
-
var
|
|
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: n, trigger: r, items: a = [], onSelect: o, open: u, defaultOpen: d = !1, onOpenChange: f, size: p = "md", className: g, triggerClassName: _, contentClassName: v, itemClassName: y, disabled: b, rotateAngle: x = 90, placement: S, matchTriggerWidth: C, textWrap: w, showArrow: T = !0, arrowIcon: E }) => {
|
|
185
185
|
let D = l(null), k = l(null), A = s(), j = `${A}-trigger`, { floatingStyles: M, setRef: N, setFloatingRef: P } = ee({
|
|
186
186
|
placement: S,
|
|
187
187
|
matchTriggerWidth: C,
|
|
188
188
|
mobileSheetBreakpoint: 640
|
|
189
|
-
}), F = c(() => a.flatMap((e, t) =>
|
|
189
|
+
}), F = c(() => a.flatMap((e, t) => ae(e) ? [{
|
|
190
190
|
item: e,
|
|
191
191
|
itemIndex: t
|
|
192
|
-
}] : []), [a]), I = c(() => F.map(({ item: e }) => e), [F]), R = c(() => new Map(F.map(({ itemIndex: e }, t) => [e, t])), [F]), { activeIndex: z, setActiveIndex: V, isOpen: H, closeDropdown:
|
|
192
|
+
}] : []), [a]), I = c(() => F.map(({ item: e }) => e), [F]), R = c(() => new Map(F.map(({ itemIndex: e }, t) => [e, t])), [F]), { activeIndex: z, setActiveIndex: V, isOpen: H, closeDropdown: W, toggleDropdown: G, selectItem: K, onKeyDown: le } = O({
|
|
193
193
|
items: I,
|
|
194
194
|
open: u,
|
|
195
195
|
defaultOpen: d,
|
|
@@ -200,19 +200,19 @@ var oe = (e) => e.type === void 0 || e.type === "item", se = (e) => e.type === "
|
|
|
200
200
|
}, [o]),
|
|
201
201
|
getItemValue: (e) => e.value,
|
|
202
202
|
getItemText: (e) => typeof e.label == "string" ? e.label : e.value
|
|
203
|
-
}),
|
|
204
|
-
te([D, k],
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
}, [H,
|
|
203
|
+
}), ue = H && z >= 0 ? `${A}-item-${z}` : void 0;
|
|
204
|
+
te([D, k], W, H);
|
|
205
|
+
let de = i((e) => {
|
|
206
|
+
le(e), H && e.key === "Escape" && D.current?.focus();
|
|
207
|
+
}, [H, le]), fe = i((e) => {
|
|
208
208
|
D.current = e, N(e);
|
|
209
|
-
}, [N]),
|
|
209
|
+
}, [N]), pe = i((e) => {
|
|
210
210
|
k.current = e, P(e), e?.focus();
|
|
211
211
|
}, [P]);
|
|
212
212
|
return /* @__PURE__ */ h("div", {
|
|
213
|
-
className: L(
|
|
214
|
-
children: [/* @__PURE__ */ m(
|
|
215
|
-
ref:
|
|
213
|
+
className: L(ce.wrapper, g),
|
|
214
|
+
children: [/* @__PURE__ */ m(ie, {
|
|
215
|
+
ref: fe,
|
|
216
216
|
id: j,
|
|
217
217
|
isOpen: H,
|
|
218
218
|
disabled: b,
|
|
@@ -224,34 +224,34 @@ var oe = (e) => e.type === void 0 || e.type === "item", se = (e) => e.type === "
|
|
|
224
224
|
arrowIcon: E,
|
|
225
225
|
rotateAngle: x,
|
|
226
226
|
className: _,
|
|
227
|
-
onClick:
|
|
228
|
-
onKeyDown:
|
|
227
|
+
onClick: G,
|
|
228
|
+
onKeyDown: de,
|
|
229
229
|
"aria-expanded": H,
|
|
230
230
|
"aria-haspopup": "menu",
|
|
231
231
|
...H && { "aria-controls": A },
|
|
232
232
|
children: r
|
|
233
233
|
}), H && /* @__PURE__ */ m(B, {
|
|
234
|
-
ref:
|
|
234
|
+
ref: pe,
|
|
235
235
|
floatingStyles: M,
|
|
236
236
|
menuId: A,
|
|
237
237
|
labelledById: r ? j : void 0,
|
|
238
238
|
label: t ?? (!r && typeof e == "string" ? e : void 0),
|
|
239
|
-
activeDescendantId:
|
|
240
|
-
onKeyDown:
|
|
239
|
+
activeDescendantId: ue,
|
|
240
|
+
onKeyDown: de,
|
|
241
241
|
className: v,
|
|
242
242
|
children: a.map((e, t) => {
|
|
243
|
-
if (
|
|
244
|
-
if (
|
|
245
|
-
if (
|
|
243
|
+
if (oe(e)) return /* @__PURE__ */ m(U, { label: e.label }, `group-${e.label}`);
|
|
244
|
+
if (se(e)) return /* @__PURE__ */ m(re, {}, `separator-${t}`);
|
|
245
|
+
if (ae(e)) {
|
|
246
246
|
let n = R.get(t) ?? -1;
|
|
247
|
-
return /* @__PURE__ */ m(
|
|
247
|
+
return /* @__PURE__ */ m(ne, {
|
|
248
248
|
id: `${A}-item-${n}`,
|
|
249
249
|
...e,
|
|
250
250
|
active: z === n,
|
|
251
251
|
textWrap: e.textWrap || w,
|
|
252
252
|
className: y,
|
|
253
253
|
onClick: () => {
|
|
254
|
-
|
|
254
|
+
K(e), D.current?.focus();
|
|
255
255
|
},
|
|
256
256
|
onMouseEnter: () => {
|
|
257
257
|
n < 0 || e.disabled || V(n);
|
|
@@ -262,78 +262,78 @@ var oe = (e) => e.type === void 0 || e.type === "item", se = (e) => e.type === "
|
|
|
262
262
|
})
|
|
263
263
|
})]
|
|
264
264
|
});
|
|
265
|
-
},
|
|
266
|
-
let e = a(
|
|
265
|
+
}, ue = t(void 0), de = () => {
|
|
266
|
+
let e = a(ue);
|
|
267
267
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
268
268
|
return e;
|
|
269
269
|
};
|
|
270
|
-
|
|
271
|
-
var
|
|
272
|
-
let { descriptionId: t } =
|
|
270
|
+
ue.displayName = "ModalContext";
|
|
271
|
+
var fe = { modalBody: "_modalBody_iv33a_1" }, pe = ({ children: e }) => {
|
|
272
|
+
let { descriptionId: t } = de();
|
|
273
273
|
return /* @__PURE__ */ m("div", {
|
|
274
274
|
id: t,
|
|
275
|
-
className:
|
|
275
|
+
className: fe.modalBody,
|
|
276
276
|
children: e
|
|
277
277
|
});
|
|
278
278
|
};
|
|
279
|
-
|
|
280
|
-
var
|
|
281
|
-
className:
|
|
279
|
+
pe.displayName = "ModalBody";
|
|
280
|
+
var me = { content: "_content_k44g7_1" }, he = ({ children: e }) => /* @__PURE__ */ m("div", {
|
|
281
|
+
className: me.content,
|
|
282
282
|
children: e
|
|
283
283
|
});
|
|
284
|
-
|
|
285
|
-
var
|
|
286
|
-
className:
|
|
284
|
+
he.displayName = "ModalContent";
|
|
285
|
+
var ge = { modalFooter: "_modalFooter_ezys6_1" }, _e = ({ children: e }) => /* @__PURE__ */ m("div", {
|
|
286
|
+
className: ge.modalFooter,
|
|
287
287
|
children: e
|
|
288
288
|
});
|
|
289
|
-
|
|
290
|
-
var
|
|
289
|
+
_e.displayName = "ModalFooter";
|
|
290
|
+
var ve = {
|
|
291
291
|
modalHeader: "_modalHeader_p8xf1_1",
|
|
292
292
|
modalHeaderTitle: "_modalHeaderTitle_p8xf1_7",
|
|
293
293
|
modalHeaderCloseButton: "_modalHeaderCloseButton_p8xf1_14"
|
|
294
|
-
},
|
|
295
|
-
let { onClose: t, titleId: n } =
|
|
294
|
+
}, ye = ({ children: e }) => {
|
|
295
|
+
let { onClose: t, titleId: n } = de();
|
|
296
296
|
return /* @__PURE__ */ h("div", {
|
|
297
|
-
className:
|
|
297
|
+
className: ve.modalHeader,
|
|
298
298
|
children: [/* @__PURE__ */ m("h2", {
|
|
299
299
|
id: n,
|
|
300
|
-
className:
|
|
300
|
+
className: ve.modalHeaderTitle,
|
|
301
301
|
children: e
|
|
302
302
|
}), t && /* @__PURE__ */ m("button", {
|
|
303
303
|
type: "button",
|
|
304
|
-
className:
|
|
304
|
+
className: ve.modalHeaderCloseButton,
|
|
305
305
|
onClick: t,
|
|
306
306
|
"aria-label": "Close modal",
|
|
307
307
|
children: /* @__PURE__ */ m(F, { size: 16 })
|
|
308
308
|
})]
|
|
309
309
|
});
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
ye.displayName = "ModalHeader";
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/hooks/useModalKeyboard.ts
|
|
314
|
-
var
|
|
314
|
+
var be = ({ isOpen: e, onClose: t }) => {
|
|
315
315
|
let n = i((n) => {
|
|
316
316
|
e && n.key === "Escape" && (n.preventDefault(), t?.());
|
|
317
317
|
}, [e, t]);
|
|
318
318
|
o(() => (document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n)), [n]);
|
|
319
|
-
},
|
|
319
|
+
}, xe = {
|
|
320
320
|
overlay: "_overlay_dcudn_1",
|
|
321
321
|
"overlay--open": "_overlay--open_dcudn_14",
|
|
322
322
|
modal: "_modal_dcudn_20",
|
|
323
323
|
"overlay--animated": "_overlay--animated_dcudn_28"
|
|
324
|
-
},
|
|
325
|
-
let f = a ?? s ?? !0, p = l(null), { titleId: h, descriptionId: g } =
|
|
324
|
+
}, Se = 0, Ce = "", we = ({ children: e, onClose: t, isOpen: n, className: r, closeOnBackdrop: a, closeOnClick: s, closeOnEsc: c = !0, zIndex: u = 1e3, animated: d = !0 }) => {
|
|
325
|
+
let f = a ?? s ?? !0, p = l(null), { titleId: h, descriptionId: g } = de(), _ = i((e) => {
|
|
326
326
|
f && e.target === e.currentTarget && t?.();
|
|
327
327
|
}, [f, t]);
|
|
328
|
-
return
|
|
328
|
+
return be({
|
|
329
329
|
isOpen: n,
|
|
330
330
|
onClose: c ? t : void 0
|
|
331
331
|
}), o(() => {
|
|
332
|
-
if (n) return
|
|
333
|
-
|
|
332
|
+
if (n) return Se === 0 && (Ce = document.body.style.overflow), Se += 1, document.body.style.overflow = "hidden", () => {
|
|
333
|
+
Se = Math.max(0, Se - 1), Se === 0 && (document.body.style.overflow = Ce);
|
|
334
334
|
};
|
|
335
335
|
}, [n]), !n && !d ? null : /* @__PURE__ */ m(R, { children: /* @__PURE__ */ m("div", {
|
|
336
|
-
className: L(
|
|
336
|
+
className: L(xe.overlay, n && xe["overlay--open"], d && xe["overlay--animated"], r),
|
|
337
337
|
onClick: _,
|
|
338
338
|
tabIndex: -1,
|
|
339
339
|
role: "presentation",
|
|
@@ -349,7 +349,7 @@ var xe = ({ isOpen: e, onClose: t }) => {
|
|
|
349
349
|
children: /* @__PURE__ */ m("div", {
|
|
350
350
|
ref: p,
|
|
351
351
|
tabIndex: -1,
|
|
352
|
-
className:
|
|
352
|
+
className: xe.modal,
|
|
353
353
|
role: "dialog",
|
|
354
354
|
"aria-modal": "true",
|
|
355
355
|
"aria-labelledby": h,
|
|
@@ -359,10 +359,10 @@ var xe = ({ isOpen: e, onClose: t }) => {
|
|
|
359
359
|
})
|
|
360
360
|
}) });
|
|
361
361
|
};
|
|
362
|
-
|
|
362
|
+
we.displayName = "ModalOverlay";
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region src/components/Modal/Modal.tsx
|
|
365
|
-
var
|
|
365
|
+
var Te = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: a = !0 }) => {
|
|
366
366
|
let o = k({
|
|
367
367
|
isOpen: e,
|
|
368
368
|
onClose: n,
|
|
@@ -370,34 +370,34 @@ var Ee = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick
|
|
|
370
370
|
closeOnClick: i,
|
|
371
371
|
closeOnEsc: a
|
|
372
372
|
});
|
|
373
|
-
return o.shouldRender ? /* @__PURE__ */ m(
|
|
373
|
+
return o.shouldRender ? /* @__PURE__ */ m(ue.Provider, {
|
|
374
374
|
value: {
|
|
375
375
|
onClose: o.onClose,
|
|
376
376
|
titleId: o.titleId,
|
|
377
377
|
descriptionId: o.descriptionId
|
|
378
378
|
},
|
|
379
|
-
children: /* @__PURE__ */ m(
|
|
379
|
+
children: /* @__PURE__ */ m(we, {
|
|
380
380
|
isOpen: o.isOpen,
|
|
381
381
|
onClose: o.onClose,
|
|
382
382
|
closeOnBackdrop: o.closeOnBackdrop,
|
|
383
383
|
closeOnEsc: o.closeOnEsc,
|
|
384
|
-
children: /* @__PURE__ */ m(
|
|
384
|
+
children: /* @__PURE__ */ m(he, { children: t })
|
|
385
385
|
})
|
|
386
386
|
}) : null;
|
|
387
387
|
};
|
|
388
|
-
|
|
388
|
+
Te.displayName = "Modal";
|
|
389
389
|
//#endregion
|
|
390
390
|
//#region src/components/Modal/index.ts
|
|
391
|
-
var
|
|
392
|
-
Header:
|
|
393
|
-
Body:
|
|
394
|
-
Content:
|
|
395
|
-
Footer:
|
|
396
|
-
}),
|
|
397
|
-
function
|
|
398
|
-
return a(
|
|
391
|
+
var Ee = Object.assign(Te, {
|
|
392
|
+
Header: ye,
|
|
393
|
+
Body: pe,
|
|
394
|
+
Content: he,
|
|
395
|
+
Footer: _e
|
|
396
|
+
}), De = t(null), Oe = De.Provider;
|
|
397
|
+
function ke() {
|
|
398
|
+
return a(De);
|
|
399
399
|
}
|
|
400
|
-
var
|
|
400
|
+
var q = {
|
|
401
401
|
root: "_root_1n02e_1",
|
|
402
402
|
label: "_label_1n02e_9",
|
|
403
403
|
required: "_required_1n02e_21",
|
|
@@ -408,64 +408,65 @@ var K = {
|
|
|
408
408
|
error: "_error_1n02e_51",
|
|
409
409
|
disabled: "_disabled_1n02e_59",
|
|
410
410
|
invalid: "_invalid_1n02e_75"
|
|
411
|
-
},
|
|
412
|
-
let
|
|
411
|
+
}, Ae = n(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: a = "md", color: o = "primary", name: c, label: l, description: u, error: d, orientation: f = "vertical", children: p, className: g, id: _, ...v }, y) => {
|
|
412
|
+
let b = s(), x = _ ?? b, S = l ? `${x}-label` : void 0, C = u ? `${x}-description` : void 0, w = d ? `${x}-error` : void 0, T = [C, w].filter(Boolean).join(" ") || void 0, E = c ?? `${x}-radio`, [O, k] = D({
|
|
413
413
|
value: e,
|
|
414
414
|
defaultValue: t,
|
|
415
415
|
onChange: n
|
|
416
|
-
}),
|
|
416
|
+
}), A = !!d;
|
|
417
417
|
return /* @__PURE__ */ h("div", {
|
|
418
|
-
...
|
|
419
|
-
ref:
|
|
420
|
-
id:
|
|
418
|
+
...v,
|
|
419
|
+
ref: y,
|
|
420
|
+
id: x,
|
|
421
421
|
role: "radiogroup",
|
|
422
|
-
"aria-labelledby":
|
|
423
|
-
"aria-describedby":
|
|
422
|
+
"aria-labelledby": S,
|
|
423
|
+
"aria-describedby": T,
|
|
424
424
|
"aria-disabled": r || void 0,
|
|
425
425
|
"aria-required": i || void 0,
|
|
426
|
-
"aria-invalid":
|
|
427
|
-
className: L(
|
|
426
|
+
"aria-invalid": A || void 0,
|
|
427
|
+
className: L(q.root, A && q.invalid, r && q.disabled, g),
|
|
428
428
|
children: [
|
|
429
|
-
|
|
430
|
-
id:
|
|
431
|
-
className:
|
|
432
|
-
children: [
|
|
433
|
-
className:
|
|
429
|
+
l && /* @__PURE__ */ h("div", {
|
|
430
|
+
id: S,
|
|
431
|
+
className: q.label,
|
|
432
|
+
children: [l, i && /* @__PURE__ */ m("span", {
|
|
433
|
+
className: q.required,
|
|
434
434
|
"aria-hidden": "true",
|
|
435
435
|
children: "*"
|
|
436
436
|
})]
|
|
437
437
|
}),
|
|
438
|
-
|
|
439
|
-
id:
|
|
440
|
-
className:
|
|
441
|
-
children:
|
|
438
|
+
u && /* @__PURE__ */ m("div", {
|
|
439
|
+
id: C,
|
|
440
|
+
className: q.description,
|
|
441
|
+
children: u
|
|
442
442
|
}),
|
|
443
|
-
/* @__PURE__ */ m(
|
|
443
|
+
/* @__PURE__ */ m(Oe, {
|
|
444
444
|
value: {
|
|
445
|
-
name:
|
|
446
|
-
value:
|
|
445
|
+
name: E,
|
|
446
|
+
value: O,
|
|
447
447
|
disabled: r,
|
|
448
448
|
required: i,
|
|
449
|
-
invalid:
|
|
449
|
+
invalid: A,
|
|
450
450
|
size: a,
|
|
451
|
-
|
|
452
|
-
|
|
451
|
+
color: o,
|
|
452
|
+
describedBy: T,
|
|
453
|
+
onValueChange: k
|
|
453
454
|
},
|
|
454
455
|
children: /* @__PURE__ */ m("div", {
|
|
455
|
-
className: L(
|
|
456
|
-
children:
|
|
456
|
+
className: L(q.items, q[f]),
|
|
457
|
+
children: p
|
|
457
458
|
})
|
|
458
459
|
}),
|
|
459
|
-
|
|
460
|
-
id:
|
|
461
|
-
className:
|
|
462
|
-
children:
|
|
460
|
+
d && /* @__PURE__ */ m("div", {
|
|
461
|
+
id: w,
|
|
462
|
+
className: q.error,
|
|
463
|
+
children: d
|
|
463
464
|
})
|
|
464
465
|
]
|
|
465
466
|
});
|
|
466
467
|
});
|
|
467
|
-
|
|
468
|
-
var
|
|
468
|
+
Ae.displayName = "RadioGroup";
|
|
469
|
+
var J = {
|
|
469
470
|
wrapper: "_wrapper_byl2d_1",
|
|
470
471
|
label: "_label_byl2d_9",
|
|
471
472
|
required: "_required_byl2d_20",
|
|
@@ -473,59 +474,59 @@ var q = {
|
|
|
473
474
|
control: "_control_byl2d_32",
|
|
474
475
|
errorText: "_errorText_byl2d_40",
|
|
475
476
|
disabled: "_disabled_byl2d_54"
|
|
476
|
-
},
|
|
477
|
+
}, je = ({ 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, ...f }) => {
|
|
477
478
|
let p = n && e ? `${e}-description` : void 0, g = r && e ? `${e}-error` : void 0;
|
|
478
479
|
return /* @__PURE__ */ h("div", {
|
|
479
480
|
...f,
|
|
480
481
|
"aria-disabled": a || void 0,
|
|
481
|
-
className: L(
|
|
482
|
+
className: L(J.wrapper, a && J.disabled, s),
|
|
482
483
|
"data-disabled": a || void 0,
|
|
483
484
|
"data-invalid": !!r || void 0,
|
|
484
485
|
children: [
|
|
485
486
|
t && /* @__PURE__ */ h("label", {
|
|
486
487
|
htmlFor: e,
|
|
487
|
-
className: L(
|
|
488
|
+
className: L(J.label, l),
|
|
488
489
|
children: [t, i && /* @__PURE__ */ m("span", {
|
|
489
|
-
className:
|
|
490
|
+
className: J.required,
|
|
490
491
|
"aria-hidden": "true",
|
|
491
492
|
children: "*"
|
|
492
493
|
})]
|
|
493
494
|
}),
|
|
494
495
|
n && /* @__PURE__ */ m("div", {
|
|
495
496
|
id: p,
|
|
496
|
-
className: L(
|
|
497
|
+
className: L(J.description, u),
|
|
497
498
|
children: n
|
|
498
499
|
}),
|
|
499
500
|
/* @__PURE__ */ m("div", {
|
|
500
|
-
className: L(
|
|
501
|
+
className: L(J.control, c),
|
|
501
502
|
children: o
|
|
502
503
|
}),
|
|
503
504
|
r && /* @__PURE__ */ m("div", {
|
|
504
505
|
id: g,
|
|
505
|
-
className: L(
|
|
506
|
+
className: L(J.errorText, d),
|
|
506
507
|
role: "alert",
|
|
507
508
|
children: r
|
|
508
509
|
})
|
|
509
510
|
]
|
|
510
511
|
});
|
|
511
|
-
},
|
|
512
|
+
}, Me = {
|
|
512
513
|
option: "_option_l6qjj_1",
|
|
513
514
|
selected: "_selected_l6qjj_18",
|
|
514
515
|
disabled: "_disabled_l6qjj_18",
|
|
515
516
|
active: "_active_l6qjj_34",
|
|
516
517
|
label: "_label_l6qjj_46",
|
|
517
518
|
check: "_check_l6qjj_54"
|
|
518
|
-
},
|
|
519
|
+
}, Ne = ({ option: e, isSelected: t, isActive: n, optionId: r, onSelect: i, onMouseEnter: a }) => {
|
|
519
520
|
let o = !!e.disabled;
|
|
520
521
|
return /* @__PURE__ */ h("li", {
|
|
521
522
|
id: r,
|
|
522
523
|
role: "option",
|
|
523
524
|
"aria-selected": t,
|
|
524
525
|
"aria-disabled": o || void 0,
|
|
525
|
-
className: L(
|
|
526
|
-
[
|
|
527
|
-
[
|
|
528
|
-
[
|
|
526
|
+
className: L(Me.option, {
|
|
527
|
+
[Me.selected]: t,
|
|
528
|
+
[Me.active]: n,
|
|
529
|
+
[Me.disabled]: o
|
|
529
530
|
}),
|
|
530
531
|
onClick: () => {
|
|
531
532
|
o || i(e.value);
|
|
@@ -534,28 +535,28 @@ var q = {
|
|
|
534
535
|
o || a();
|
|
535
536
|
},
|
|
536
537
|
children: [/* @__PURE__ */ m("span", {
|
|
537
|
-
className:
|
|
538
|
+
className: Me.label,
|
|
538
539
|
children: e.label
|
|
539
540
|
}), /* @__PURE__ */ m("span", {
|
|
540
|
-
className:
|
|
541
|
+
className: Me.check,
|
|
541
542
|
"aria-hidden": "true",
|
|
542
543
|
children: t && /* @__PURE__ */ m(N, {})
|
|
543
544
|
})]
|
|
544
545
|
});
|
|
545
546
|
};
|
|
546
|
-
|
|
547
|
-
var
|
|
547
|
+
Ne.displayName = "SelectOption";
|
|
548
|
+
var Pe = {
|
|
548
549
|
dropdown: "_dropdown_qznlq_1",
|
|
549
550
|
dropdownIn: "_dropdownIn_qznlq_1",
|
|
550
551
|
empty: "_empty_qznlq_17"
|
|
551
|
-
},
|
|
552
|
+
}, Fe = ({ 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__ */ m(R, { children: /* @__PURE__ */ m("ul", {
|
|
552
553
|
ref: r,
|
|
553
554
|
id: t,
|
|
554
555
|
role: "listbox",
|
|
555
556
|
"aria-labelledby": n,
|
|
556
|
-
className: [
|
|
557
|
+
className: [Pe.dropdown, l].filter(Boolean).join(" "),
|
|
557
558
|
style: i,
|
|
558
|
-
children: a.length ? a.map((e, n) => /* @__PURE__ */ m(
|
|
559
|
+
children: a.length ? a.map((e, n) => /* @__PURE__ */ m(Ne, {
|
|
559
560
|
option: e,
|
|
560
561
|
isSelected: e.value === s,
|
|
561
562
|
isActive: n === c,
|
|
@@ -566,12 +567,12 @@ var Fe = {
|
|
|
566
567
|
role: "option",
|
|
567
568
|
"aria-disabled": "true",
|
|
568
569
|
"aria-selected": "false",
|
|
569
|
-
className:
|
|
570
|
+
className: Pe.empty,
|
|
570
571
|
children: o
|
|
571
572
|
})
|
|
572
573
|
}) }) : null;
|
|
573
|
-
|
|
574
|
-
var
|
|
574
|
+
Fe.displayName = "SelectDropdown";
|
|
575
|
+
var Y = {
|
|
575
576
|
control: "_control_1xma1_1",
|
|
576
577
|
disabled: "_disabled_1xma1_18",
|
|
577
578
|
arrow: "_arrow_1xma1_23",
|
|
@@ -582,7 +583,7 @@ var J = {
|
|
|
582
583
|
placeholder: "_placeholder_1xma1_63",
|
|
583
584
|
error: "_error_1xma1_67",
|
|
584
585
|
open: "_open_1xma1_109"
|
|
585
|
-
},
|
|
586
|
+
}, Ie = ({ 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: f, buttonRef: p, onClick: g, onKeyDown: _, onBlur: v, onFocus: y }) => /* @__PURE__ */ h("button", {
|
|
586
587
|
id: e,
|
|
587
588
|
ref: p,
|
|
588
589
|
type: "button",
|
|
@@ -597,28 +598,28 @@ var J = {
|
|
|
597
598
|
"aria-controls": n ? a : void 0,
|
|
598
599
|
"aria-describedby": t,
|
|
599
600
|
"aria-activedescendant": n && o >= 0 ? `${a}-option-${o}` : void 0,
|
|
600
|
-
className: L(
|
|
601
|
-
[
|
|
602
|
-
[
|
|
601
|
+
className: L(Y.control, Y[d], {
|
|
602
|
+
[Y.error]: !!c,
|
|
603
|
+
[Y.disabled]: r
|
|
603
604
|
}, f),
|
|
604
605
|
onClick: g,
|
|
605
606
|
onKeyDown: _,
|
|
606
607
|
onBlur: v,
|
|
607
608
|
onFocus: y,
|
|
608
609
|
children: [/* @__PURE__ */ m("span", {
|
|
609
|
-
className: L(
|
|
610
|
+
className: L(Y.value, { [Y.placeholder]: u }),
|
|
610
611
|
children: l
|
|
611
612
|
}), /* @__PURE__ */ m("span", {
|
|
612
|
-
className: L(
|
|
613
|
+
className: L(Y.arrow, { [Y.open]: n }),
|
|
613
614
|
"aria-hidden": "true",
|
|
614
615
|
children: /* @__PURE__ */ m(P, {})
|
|
615
616
|
})]
|
|
616
617
|
});
|
|
617
|
-
|
|
618
|
+
Ie.displayName = "SelectTrigger";
|
|
618
619
|
//#endregion
|
|
619
620
|
//#region src/components/Select/Select.tsx
|
|
620
|
-
var
|
|
621
|
-
let j = s(), M = n ?? j, N = `${M}-listbox`, P = !!y, F = P ? `${M}-error` : void 0, I = l(null), L = l(null), { selectedValue: R, selectedOption: z, isOpen: B, setIsOpen: V, activeIndex: H, setActiveIndex:
|
|
621
|
+
var Le = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o, defaultValue: c, onChange: u, options: d, placeholder: f = "Select...", noOptionsText: p = "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: O, dropdownClassName: k }) => {
|
|
622
|
+
let j = s(), M = n ?? j, N = `${M}-listbox`, P = !!y, F = P ? `${M}-error` : void 0, I = l(null), L = l(null), { selectedValue: R, selectedOption: z, isOpen: B, setIsOpen: V, activeIndex: H, setActiveIndex: U, closeDropdown: W, toggleDropdown: ne, selectValue: G, onKeyDown: re } = A({
|
|
622
623
|
value: o,
|
|
623
624
|
defaultValue: c,
|
|
624
625
|
onChange: u,
|
|
@@ -627,22 +628,22 @@ var Re = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
627
628
|
open: S,
|
|
628
629
|
defaultOpen: C,
|
|
629
630
|
onOpenChange: w
|
|
630
|
-
}),
|
|
631
|
+
}), K = !!z, { floatingStyles: ie, setRef: ae, setFloatingRef: oe } = ee({
|
|
631
632
|
open: B,
|
|
632
633
|
onOpenChange: V,
|
|
633
634
|
placement: b,
|
|
634
635
|
matchTriggerWidth: x,
|
|
635
636
|
mobileSheetBreakpoint: 640
|
|
636
|
-
}),
|
|
637
|
-
|
|
638
|
-
}, [
|
|
639
|
-
te([I, L],
|
|
640
|
-
let
|
|
641
|
-
I.current = e,
|
|
642
|
-
}, [
|
|
643
|
-
L.current = e,
|
|
644
|
-
}, [
|
|
645
|
-
return /* @__PURE__ */ h(
|
|
637
|
+
}), se = i((e) => {
|
|
638
|
+
G(e), I.current?.focus();
|
|
639
|
+
}, [G]);
|
|
640
|
+
te([I, L], W, B);
|
|
641
|
+
let ce = i((e) => {
|
|
642
|
+
I.current = e, ae(e);
|
|
643
|
+
}, [ae]), le = i((e) => {
|
|
644
|
+
L.current = e, oe(e);
|
|
645
|
+
}, [oe]);
|
|
646
|
+
return /* @__PURE__ */ h(je, {
|
|
646
647
|
id: M,
|
|
647
648
|
label: e,
|
|
648
649
|
description: t,
|
|
@@ -651,7 +652,7 @@ var Re = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
651
652
|
disabled: v,
|
|
652
653
|
className: D,
|
|
653
654
|
children: [
|
|
654
|
-
/* @__PURE__ */ m(
|
|
655
|
+
/* @__PURE__ */ m(Ie, {
|
|
655
656
|
id: M,
|
|
656
657
|
errorId: F,
|
|
657
658
|
isOpen: B,
|
|
@@ -662,12 +663,12 @@ var Re = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
662
663
|
ariaLabel: a ?? (e ? void 0 : z?.label || f),
|
|
663
664
|
error: P,
|
|
664
665
|
displayText: z?.label ?? f,
|
|
665
|
-
isPlaceholder: !
|
|
666
|
+
isPlaceholder: !K,
|
|
666
667
|
size: g,
|
|
667
668
|
className: O,
|
|
668
|
-
buttonRef:
|
|
669
|
-
onClick:
|
|
670
|
-
onKeyDown:
|
|
669
|
+
buttonRef: ce,
|
|
670
|
+
onClick: ne,
|
|
671
|
+
onKeyDown: re,
|
|
671
672
|
onBlur: T,
|
|
672
673
|
onFocus: E
|
|
673
674
|
}),
|
|
@@ -677,50 +678,50 @@ var Re = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
677
678
|
value: R,
|
|
678
679
|
disabled: v
|
|
679
680
|
}),
|
|
680
|
-
/* @__PURE__ */ m(
|
|
681
|
+
/* @__PURE__ */ m(Fe, {
|
|
681
682
|
isOpen: B,
|
|
682
683
|
listboxId: N,
|
|
683
684
|
labelledById: M,
|
|
684
|
-
style:
|
|
685
|
+
style: ie,
|
|
685
686
|
options: d,
|
|
686
687
|
noOptionsText: p,
|
|
687
688
|
selectedValue: R,
|
|
688
689
|
activeIndex: H,
|
|
689
690
|
className: k,
|
|
690
|
-
setDropdownRef:
|
|
691
|
-
onSelect:
|
|
692
|
-
onMouseEnter:
|
|
691
|
+
setDropdownRef: le,
|
|
692
|
+
onSelect: se,
|
|
693
|
+
onMouseEnter: U
|
|
693
694
|
})
|
|
694
695
|
]
|
|
695
696
|
});
|
|
696
697
|
};
|
|
697
|
-
|
|
698
|
+
Le.displayName = "Select";
|
|
698
699
|
//#endregion
|
|
699
700
|
//#region src/components/Tabs/TabsContext.tsx
|
|
700
|
-
var
|
|
701
|
-
let e = a(
|
|
701
|
+
var Re = t(null), ze = () => {
|
|
702
|
+
let e = a(Re);
|
|
702
703
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
703
704
|
return e;
|
|
704
|
-
},
|
|
705
|
+
}, Be = {
|
|
705
706
|
list: "_list_13hkl_1",
|
|
706
707
|
vertical: "_vertical_13hkl_8"
|
|
707
|
-
},
|
|
708
|
-
let { orientation: r, appearance: i } =
|
|
708
|
+
}, Ve = ({ children: e, className: t, ...n }) => {
|
|
709
|
+
let { orientation: r, appearance: i } = ze();
|
|
709
710
|
return /* @__PURE__ */ m("div", {
|
|
710
711
|
...n,
|
|
711
712
|
role: "tablist",
|
|
712
713
|
"aria-orientation": r,
|
|
713
|
-
className: L(
|
|
714
|
+
className: L(Be.list, r === "vertical" && Be.vertical, i === "underline" && Be.underline, i === "pills" && Be.pills, t),
|
|
714
715
|
children: e
|
|
715
716
|
});
|
|
716
717
|
};
|
|
717
|
-
|
|
718
|
-
var
|
|
718
|
+
Ve.displayName = "TabsList";
|
|
719
|
+
var He = {
|
|
719
720
|
panel: "_panel_1v1a9_1",
|
|
720
721
|
visible: "_visible_1v1a9_10",
|
|
721
722
|
vertical: "_vertical_1v1a9_14"
|
|
722
|
-
},
|
|
723
|
-
let { activeIndex: r, orientation: i } =
|
|
723
|
+
}, Ue = ({ index: e, children: t, className: n }) => {
|
|
724
|
+
let { activeIndex: r, orientation: i } = ze(), [a, s] = u(!1), c = r === e;
|
|
724
725
|
return o(() => {
|
|
725
726
|
if (!c) {
|
|
726
727
|
s(!1);
|
|
@@ -734,12 +735,12 @@ var Ue = {
|
|
|
734
735
|
"aria-labelledby": `tab-${e}`,
|
|
735
736
|
hidden: !c,
|
|
736
737
|
tabIndex: 0,
|
|
737
|
-
className: L(
|
|
738
|
+
className: L(He.panel, a && He.visible, i === "vertical" && He.vertical, n),
|
|
738
739
|
children: t
|
|
739
740
|
});
|
|
740
741
|
};
|
|
741
|
-
|
|
742
|
-
var
|
|
742
|
+
Ue.displayName = "TabsPanel";
|
|
743
|
+
var We = {
|
|
743
744
|
tab: "_tab_qe8xc_1",
|
|
744
745
|
iconOnly: "_iconOnly_qe8xc_27",
|
|
745
746
|
tabIcon: "_tabIcon_qe8xc_31",
|
|
@@ -749,7 +750,7 @@ var Y = {
|
|
|
749
750
|
pills: "_pills_qe8xc_92",
|
|
750
751
|
vertical: "_vertical_qe8xc_106"
|
|
751
752
|
}, Ge = n(({ index: e, children: t, className: n, disabled: r = !1, icon: a, onClick: o, onKeyDown: s, ...c }, l) => {
|
|
752
|
-
let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: g, onTabKeyDown: _ } =
|
|
753
|
+
let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: g, onTabKeyDown: _ } = ze(), v = u === e, y = !!a, b = y && t == null;
|
|
753
754
|
return /* @__PURE__ */ h("button", {
|
|
754
755
|
type: "button",
|
|
755
756
|
ref: i((t) => {
|
|
@@ -765,7 +766,7 @@ var Y = {
|
|
|
765
766
|
id: `tab-${e}`,
|
|
766
767
|
disabled: r,
|
|
767
768
|
tabIndex: v ? 0 : -1,
|
|
768
|
-
className: L(
|
|
769
|
+
className: L(We.tab, We[p], f === "vertical" && We.vertical, y && We.withIcon, b && We.iconOnly, n),
|
|
769
770
|
onClick: (t) => {
|
|
770
771
|
r || (d(e), o?.(t));
|
|
771
772
|
},
|
|
@@ -774,11 +775,11 @@ var Y = {
|
|
|
774
775
|
},
|
|
775
776
|
...c,
|
|
776
777
|
children: [y && /* @__PURE__ */ m("span", {
|
|
777
|
-
className:
|
|
778
|
+
className: We.tabIcon,
|
|
778
779
|
"aria-hidden": "true",
|
|
779
780
|
children: a
|
|
780
781
|
}), t != null && /* @__PURE__ */ m("span", {
|
|
781
|
-
className:
|
|
782
|
+
className: We.label,
|
|
782
783
|
children: t
|
|
783
784
|
})]
|
|
784
785
|
});
|
|
@@ -810,7 +811,7 @@ var Ke = {
|
|
|
810
811
|
registerTab: f,
|
|
811
812
|
onTabKeyDown: p
|
|
812
813
|
};
|
|
813
|
-
return /* @__PURE__ */ m(
|
|
814
|
+
return /* @__PURE__ */ m(Re.Provider, {
|
|
814
815
|
value: h,
|
|
815
816
|
children: /* @__PURE__ */ m("div", {
|
|
816
817
|
className: L(Ke.tabs, a === "vertical" && Ke.vertical, s),
|
|
@@ -822,9 +823,9 @@ qe.displayName = "Tabs";
|
|
|
822
823
|
//#endregion
|
|
823
824
|
//#region src/components/Tabs/index.ts
|
|
824
825
|
var Je = Object.assign(qe, {
|
|
825
|
-
List:
|
|
826
|
+
List: Ve,
|
|
826
827
|
Tab: Ge,
|
|
827
|
-
Panel:
|
|
828
|
+
Panel: Ue
|
|
828
829
|
}), Ye = {
|
|
829
830
|
tooltip: "_tooltip_10opu_1",
|
|
830
831
|
arrow: "_arrow_10opu_25"
|
|
@@ -930,22 +931,22 @@ var Qe = (e, t) => {
|
|
|
930
931
|
badge: "_badge_2nghu_786",
|
|
931
932
|
shortcut: "_shortcut_2nghu_800"
|
|
932
933
|
}, $e = n(({ children: t, color: n = "primary", appearance: i = "solid", size: a = "md", shape: o = "pill", type: s = "button", disabled: c = !1, loading: l = !1, loadingText: u, iconStart: d, iconEnd: f, spinner: g, badge: _, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: N, ...P }, F) => {
|
|
933
|
-
let I = S && r(t) ? t : void 0, R = I ? I.props.children : t, z = x || !R && !!(d || f), B = !!(T || E || I?.props["aria-label"] || I?.props["aria-labelledby"]), V = c || l, ee = l && u ? u : R, te = u && R && !z && (typeof R == "string" || typeof R == "number") && (typeof u == "string" || typeof u == "number") ? String(l ? R : u) : void 0, H = O === "_blank" && !k ? "noreferrer noopener" : k,
|
|
934
|
+
let I = S && r(t) ? t : void 0, R = I ? I.props.children : t, z = x || !R && !!(d || f), B = !!(T || E || I?.props["aria-label"] || I?.props["aria-labelledby"]), V = c || l, ee = l && u ? u : R, te = u && R && !z && (typeof R == "string" || typeof R == "number") && (typeof u == "string" || typeof u == "number") ? String(l ? R : u) : void 0, H = O === "_blank" && !k ? "noreferrer noopener" : k, U = L(X.button, X[n], X[i], X[a], X[o], C, {
|
|
934
935
|
[X.disabled]: V,
|
|
935
936
|
[X.loading]: l,
|
|
936
937
|
[X.fullWidth]: b,
|
|
937
938
|
[X.iconOnly]: z
|
|
938
939
|
});
|
|
939
940
|
Qe(!S || !D, "Button: pass href to the child element when using asChild."), Qe(!S || !!I, "Button: asChild requires a single valid React element child."), Qe(!z || B, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
940
|
-
let
|
|
941
|
+
let W = (e) => {
|
|
941
942
|
e.preventDefault(), e.stopPropagation();
|
|
942
|
-
},
|
|
943
|
+
}, ne = (e) => {
|
|
943
944
|
if (V) {
|
|
944
|
-
|
|
945
|
+
W(e);
|
|
945
946
|
return;
|
|
946
947
|
}
|
|
947
948
|
I?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
948
|
-
},
|
|
949
|
+
}, G = /* @__PURE__ */ h(p, { children: [
|
|
949
950
|
l && (g ? /* @__PURE__ */ m("span", {
|
|
950
951
|
className: X.icon,
|
|
951
952
|
"aria-hidden": "true",
|
|
@@ -986,12 +987,12 @@ var Qe = (e, t) => {
|
|
|
986
987
|
"aria-disabled": V || void 0,
|
|
987
988
|
"aria-label": T || I.props["aria-label"] || void 0,
|
|
988
989
|
"aria-labelledby": E || I.props["aria-labelledby"] || void 0,
|
|
989
|
-
className: L(I.props.className,
|
|
990
|
+
className: L(I.props.className, U),
|
|
990
991
|
href: V ? void 0 : I.props.href,
|
|
991
|
-
onClick:
|
|
992
|
+
onClick: ne,
|
|
992
993
|
tabIndex: V ? -1 : I.props.tabIndex,
|
|
993
994
|
title: y || I.props.title,
|
|
994
|
-
children:
|
|
995
|
+
children: G
|
|
995
996
|
}) : D ? /* @__PURE__ */ m("a", {
|
|
996
997
|
ref: F,
|
|
997
998
|
href: V ? void 0 : D,
|
|
@@ -1001,14 +1002,14 @@ var Qe = (e, t) => {
|
|
|
1001
1002
|
target: O,
|
|
1002
1003
|
rel: H,
|
|
1003
1004
|
download: A,
|
|
1004
|
-
onClick: V ?
|
|
1005
|
+
onClick: V ? W : w,
|
|
1005
1006
|
"aria-disabled": V || void 0,
|
|
1006
1007
|
"aria-label": T || void 0,
|
|
1007
1008
|
"aria-labelledby": E || void 0,
|
|
1008
1009
|
"aria-busy": l || void 0,
|
|
1009
|
-
className:
|
|
1010
|
+
className: U,
|
|
1010
1011
|
title: y,
|
|
1011
|
-
children:
|
|
1012
|
+
children: G
|
|
1012
1013
|
}) : /* @__PURE__ */ m("button", {
|
|
1013
1014
|
...P,
|
|
1014
1015
|
ref: F,
|
|
@@ -1021,9 +1022,9 @@ var Qe = (e, t) => {
|
|
|
1021
1022
|
"aria-label": T || void 0,
|
|
1022
1023
|
"aria-labelledby": E || void 0,
|
|
1023
1024
|
"aria-busy": l || void 0,
|
|
1024
|
-
className:
|
|
1025
|
+
className: U,
|
|
1025
1026
|
title: y,
|
|
1026
|
-
children:
|
|
1027
|
+
children: G
|
|
1027
1028
|
});
|
|
1028
1029
|
});
|
|
1029
1030
|
$e.displayName = "Button";
|
|
@@ -1196,23 +1197,23 @@ var Q = {
|
|
|
1196
1197
|
default: return;
|
|
1197
1198
|
}
|
|
1198
1199
|
}, st = n(({ id: e, label: t, name: n, description: r, placeholder: a, value: o, defaultValue: c, onChange: d, type: f = "text", size: p = "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": F, ...I }, R) => {
|
|
1199
|
-
let z = s(), B = e ?? z, V = l(null), [ee, te] = u(c ?? ""), H = o !== void 0,
|
|
1200
|
+
let z = s(), B = e ?? z, V = l(null), [ee, te] = u(c ?? ""), H = o !== void 0, U = H ? o : ee, W = U !== "", ne = ot(f, b), G = S && W && !_ && !x, re = [
|
|
1200
1201
|
P,
|
|
1201
1202
|
r ? `${B}-description` : void 0,
|
|
1202
1203
|
g ? `${B}-error` : void 0
|
|
1203
|
-
].filter(Boolean).join(" "),
|
|
1204
|
+
].filter(Boolean).join(" "), K = E ?? "×", ie = i((e) => {
|
|
1204
1205
|
if (V.current = e, typeof R == "function") {
|
|
1205
1206
|
R(e);
|
|
1206
1207
|
return;
|
|
1207
1208
|
}
|
|
1208
1209
|
R && (R.current = e);
|
|
1209
|
-
}, [R]),
|
|
1210
|
+
}, [R]), ae = i((e) => {
|
|
1210
1211
|
let t = e.target.value;
|
|
1211
1212
|
H || te(t), d?.(e);
|
|
1212
|
-
}, [H, d]),
|
|
1213
|
+
}, [H, d]), oe = i(() => {
|
|
1213
1214
|
H || te(""), C?.(), V.current?.focus();
|
|
1214
|
-
}, [H, C]),
|
|
1215
|
-
return /* @__PURE__ */ m(
|
|
1215
|
+
}, [H, C]), se = !G && !!T;
|
|
1216
|
+
return /* @__PURE__ */ m(je, {
|
|
1216
1217
|
id: B,
|
|
1217
1218
|
label: t,
|
|
1218
1219
|
description: r,
|
|
@@ -1222,7 +1223,7 @@ var Q = {
|
|
|
1222
1223
|
children: /* @__PURE__ */ h("div", {
|
|
1223
1224
|
className: L(Q.inputWrapper, {
|
|
1224
1225
|
[Q.hasLeftAdornment]: !!w,
|
|
1225
|
-
[Q.hasRightAdornment]: !!T ||
|
|
1226
|
+
[Q.hasRightAdornment]: !!T || G
|
|
1226
1227
|
}),
|
|
1227
1228
|
children: [
|
|
1228
1229
|
w && /* @__PURE__ */ m("span", {
|
|
@@ -1232,14 +1233,14 @@ var Q = {
|
|
|
1232
1233
|
}),
|
|
1233
1234
|
/* @__PURE__ */ m("input", {
|
|
1234
1235
|
...I,
|
|
1235
|
-
ref:
|
|
1236
|
+
ref: ie,
|
|
1236
1237
|
id: B,
|
|
1237
1238
|
name: n,
|
|
1238
1239
|
type: f,
|
|
1239
|
-
autoComplete:
|
|
1240
|
+
autoComplete: ne,
|
|
1240
1241
|
className: L(Q.input, Q[p], { [Q.error]: !!g }, y),
|
|
1241
|
-
value:
|
|
1242
|
-
onChange:
|
|
1242
|
+
value: U,
|
|
1243
|
+
onChange: ae,
|
|
1243
1244
|
placeholder: a,
|
|
1244
1245
|
disabled: _,
|
|
1245
1246
|
readOnly: x,
|
|
@@ -1247,18 +1248,18 @@ var Q = {
|
|
|
1247
1248
|
autoFocus: A,
|
|
1248
1249
|
maxLength: j,
|
|
1249
1250
|
"aria-invalid": g ? !0 : F,
|
|
1250
|
-
"aria-describedby":
|
|
1251
|
+
"aria-describedby": re || void 0,
|
|
1251
1252
|
onMouseEnter: M,
|
|
1252
1253
|
onMouseLeave: N
|
|
1253
1254
|
}),
|
|
1254
|
-
|
|
1255
|
+
G && /* @__PURE__ */ m("button", {
|
|
1255
1256
|
type: "button",
|
|
1256
1257
|
className: L(Q.clearButton, at[k]),
|
|
1257
|
-
onClick:
|
|
1258
|
+
onClick: oe,
|
|
1258
1259
|
"aria-label": "Clear input",
|
|
1259
|
-
children:
|
|
1260
|
+
children: K
|
|
1260
1261
|
}),
|
|
1261
|
-
|
|
1262
|
+
se && /* @__PURE__ */ m("div", {
|
|
1262
1263
|
className: L(Q.rightAdornment, at[O]),
|
|
1263
1264
|
children: T
|
|
1264
1265
|
})
|
|
@@ -1268,93 +1269,108 @@ var Q = {
|
|
|
1268
1269
|
});
|
|
1269
1270
|
st.displayName = "Input";
|
|
1270
1271
|
var $ = {
|
|
1271
|
-
root: "
|
|
1272
|
-
invalid: "
|
|
1273
|
-
control: "
|
|
1274
|
-
label: "
|
|
1275
|
-
wrapper: "
|
|
1276
|
-
input: "
|
|
1277
|
-
disabled: "
|
|
1278
|
-
description: "
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1272
|
+
root: "_root_qb9nm_1",
|
|
1273
|
+
invalid: "_invalid_qb9nm_27",
|
|
1274
|
+
control: "_control_qb9nm_27",
|
|
1275
|
+
label: "_label_qb9nm_30",
|
|
1276
|
+
wrapper: "_wrapper_qb9nm_33",
|
|
1277
|
+
input: "_input_qb9nm_34",
|
|
1278
|
+
disabled: "_disabled_qb9nm_37",
|
|
1279
|
+
description: "_description_qb9nm_45",
|
|
1280
|
+
colorPrimary: "_colorPrimary_qb9nm_49",
|
|
1281
|
+
colorNeutral: "_colorNeutral_qb9nm_65",
|
|
1282
|
+
colorSuccess: "_colorSuccess_qb9nm_81",
|
|
1283
|
+
colorWarning: "_colorWarning_qb9nm_97",
|
|
1284
|
+
colorDanger: "_colorDanger_qb9nm_113",
|
|
1285
|
+
sm: "_sm_qb9nm_129",
|
|
1286
|
+
md: "_md_qb9nm_138",
|
|
1287
|
+
lg: "_lg_qb9nm_147",
|
|
1288
|
+
indicator: "_indicator_qb9nm_202",
|
|
1289
|
+
customIcon: "_customIcon_qb9nm_216",
|
|
1290
|
+
content: "_content_qb9nm_335",
|
|
1291
|
+
error: "_error_qb9nm_352"
|
|
1292
|
+
}, ct = {
|
|
1293
|
+
primary: $.colorPrimary,
|
|
1294
|
+
neutral: $.colorNeutral,
|
|
1295
|
+
success: $.colorSuccess,
|
|
1296
|
+
warning: $.colorWarning,
|
|
1297
|
+
danger: $.colorDanger
|
|
1298
|
+
}, lt = n(({ value: e, checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, size: a, color: o, error: c, onCheckedChange: l, label: u, description: d, icon: f, wrapperClassName: p, className: g, id: _, name: v, "aria-describedby": y, ...b }, x) => {
|
|
1299
|
+
let S = ke(), C = s(), w = _ ?? C, T = d ? `${w}-description` : void 0, E = c ? `${w}-error` : void 0, O = [
|
|
1300
|
+
T,
|
|
1301
|
+
E,
|
|
1302
|
+
S?.describedBy,
|
|
1303
|
+
y
|
|
1304
|
+
].filter(Boolean).join(" ") || void 0, k = S !== null, [A, j] = D({
|
|
1292
1305
|
value: t,
|
|
1293
1306
|
defaultValue: n,
|
|
1294
|
-
onChange:
|
|
1295
|
-
}),
|
|
1296
|
-
if (!
|
|
1297
|
-
if (
|
|
1298
|
-
|
|
1307
|
+
onChange: l
|
|
1308
|
+
}), M = k ? S.value === e : A, N = !!S?.disabled || r, P = !!S?.required || i, F = S?.name ?? v, I = !!(c || S?.invalid), R = a ?? S?.size ?? "md", z = o ?? S?.color ?? "primary", B = (t) => {
|
|
1309
|
+
if (!N) {
|
|
1310
|
+
if (k) {
|
|
1311
|
+
S.onValueChange(e);
|
|
1299
1312
|
return;
|
|
1300
1313
|
}
|
|
1301
|
-
|
|
1314
|
+
j(t.currentTarget.checked);
|
|
1302
1315
|
}
|
|
1303
1316
|
};
|
|
1304
1317
|
return /* @__PURE__ */ h("div", {
|
|
1305
|
-
className: L($.root, $[
|
|
1318
|
+
className: L($.root, $[R], I && $.invalid, N && $.disabled, ct[z], g),
|
|
1306
1319
|
children: [/* @__PURE__ */ h("label", {
|
|
1307
|
-
htmlFor:
|
|
1308
|
-
className: L($.wrapper,
|
|
1320
|
+
htmlFor: w,
|
|
1321
|
+
className: L($.wrapper, p),
|
|
1309
1322
|
children: [
|
|
1310
1323
|
/* @__PURE__ */ m("input", {
|
|
1311
|
-
...
|
|
1312
|
-
ref:
|
|
1313
|
-
id:
|
|
1324
|
+
...b,
|
|
1325
|
+
ref: x,
|
|
1326
|
+
id: w,
|
|
1314
1327
|
type: "radio",
|
|
1315
|
-
name:
|
|
1328
|
+
name: F,
|
|
1316
1329
|
value: e,
|
|
1317
|
-
checked:
|
|
1318
|
-
disabled:
|
|
1319
|
-
required:
|
|
1320
|
-
"aria-invalid":
|
|
1321
|
-
"aria-describedby":
|
|
1330
|
+
checked: M,
|
|
1331
|
+
disabled: N,
|
|
1332
|
+
required: P,
|
|
1333
|
+
"aria-invalid": I || void 0,
|
|
1334
|
+
"aria-describedby": O,
|
|
1322
1335
|
className: $.input,
|
|
1323
|
-
onChange:
|
|
1336
|
+
onChange: B
|
|
1324
1337
|
}),
|
|
1325
1338
|
/* @__PURE__ */ m("span", {
|
|
1326
1339
|
className: $.control,
|
|
1327
1340
|
"aria-hidden": "true",
|
|
1328
|
-
children: /* @__PURE__ */ m("span", {
|
|
1341
|
+
children: /* @__PURE__ */ m("span", {
|
|
1342
|
+
className: L($.indicator, f && $.customIcon),
|
|
1343
|
+
children: f
|
|
1344
|
+
})
|
|
1329
1345
|
}),
|
|
1330
|
-
(
|
|
1346
|
+
(u || d) && /* @__PURE__ */ h("span", {
|
|
1331
1347
|
className: $.content,
|
|
1332
|
-
children: [
|
|
1348
|
+
children: [u && /* @__PURE__ */ m("span", {
|
|
1333
1349
|
className: $.label,
|
|
1334
|
-
children: l
|
|
1335
|
-
}), u && /* @__PURE__ */ m("span", {
|
|
1336
|
-
id: C,
|
|
1337
|
-
className: $.description,
|
|
1338
1350
|
children: u
|
|
1351
|
+
}), d && /* @__PURE__ */ m("span", {
|
|
1352
|
+
id: T,
|
|
1353
|
+
className: $.description,
|
|
1354
|
+
children: d
|
|
1339
1355
|
})]
|
|
1340
1356
|
})
|
|
1341
1357
|
]
|
|
1342
|
-
}),
|
|
1343
|
-
id:
|
|
1358
|
+
}), c && /* @__PURE__ */ m("div", {
|
|
1359
|
+
id: E,
|
|
1344
1360
|
className: $.error,
|
|
1345
|
-
children:
|
|
1361
|
+
children: c
|
|
1346
1362
|
})]
|
|
1347
1363
|
});
|
|
1348
1364
|
});
|
|
1349
|
-
|
|
1365
|
+
lt.displayName = "Radio";
|
|
1350
1366
|
//#endregion
|
|
1351
1367
|
//#region src/theme/ThemeContext.ts
|
|
1352
|
-
var
|
|
1368
|
+
var ut = t(null), dt = (e) => e === "highContrast" ? "high-contrast" : e, ft = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
|
|
1353
1369
|
let [i, a] = D({
|
|
1354
1370
|
value: e,
|
|
1355
1371
|
defaultValue: t,
|
|
1356
1372
|
onChange: n
|
|
1357
|
-
}), s =
|
|
1373
|
+
}), s = dt(i);
|
|
1358
1374
|
o(() => {
|
|
1359
1375
|
if (typeof document > "u") return;
|
|
1360
1376
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -1370,7 +1386,7 @@ var lt = t(null), ut = (e) => e === "highContrast" ? "high-contrast" : e, dt = (
|
|
|
1370
1386
|
theme: i,
|
|
1371
1387
|
setTheme: a
|
|
1372
1388
|
}), [i, a]);
|
|
1373
|
-
return /* @__PURE__ */ m(
|
|
1389
|
+
return /* @__PURE__ */ m(ut.Provider, {
|
|
1374
1390
|
value: l,
|
|
1375
1391
|
children: /* @__PURE__ */ m("div", {
|
|
1376
1392
|
"data-vellira-theme": s,
|
|
@@ -1378,13 +1394,13 @@ var lt = t(null), ut = (e) => e === "highContrast" ? "high-contrast" : e, dt = (
|
|
|
1378
1394
|
})
|
|
1379
1395
|
});
|
|
1380
1396
|
};
|
|
1381
|
-
|
|
1397
|
+
ft.displayName = "ThemeProvider";
|
|
1382
1398
|
//#endregion
|
|
1383
1399
|
//#region src/theme/useTheme.ts
|
|
1384
|
-
function
|
|
1385
|
-
let e = a(
|
|
1400
|
+
function pt() {
|
|
1401
|
+
let e = a(ut);
|
|
1386
1402
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
1387
1403
|
return e;
|
|
1388
1404
|
}
|
|
1389
1405
|
//#endregion
|
|
1390
|
-
export { $e as Button, it as Checkbox,
|
|
1406
|
+
export { $e as Button, it as Checkbox, le as Dropdown, je as FormField, st as Input, Ee as Modal, lt as Radio, Ae as RadioGroup, Le as Select, Je as Tabs, ft as ThemeProvider, Ze as Tooltip, pt as useTheme };
|