@studiolxd/brand 41.1.0 → 43.0.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/CHANGELOG.md +118 -0
- package/dist/_shared/datepicker.js +75 -78
- package/dist/_types/atoms/AsyncMultiSelect/AsyncMultiSelect.d.ts +28 -5
- package/dist/_types/atoms/AsyncSelect/AsyncSelect.d.ts +26 -6
- package/dist/_types/atoms/InputPhone/InputPhone.d.ts +15 -4
- package/dist/_types/atoms/MultiSelect/MultiSelect.d.ts +20 -1
- package/dist/_types/atoms/NumberInput/NumberInput.d.ts +14 -4
- package/dist/_types/atoms/OtpInput/OtpInput.d.ts +15 -4
- package/dist/_types/atoms/Select/Select.d.ts +18 -1
- package/dist/_types/atoms/TimeSelect/TimeSelect.d.ts +34 -6
- package/dist/_types/messages/BrandMessages.d.ts +31 -1
- package/dist/_types/messages/index.d.ts +1 -1
- package/dist/_types/molecules/Calendar/Calendar.d.ts +44 -13
- package/dist/_types/molecules/DatePicker/DatePicker.d.ts +56 -26
- package/dist/_types/molecules/DatePicker/dateMask.d.ts +9 -2
- package/dist/_types/molecules/DateTimeField/DateTimeField.d.ts +12 -12
- package/dist/_types/molecules/DocsSearch/DocsSearch.d.ts +31 -12
- package/dist/_types/molecules/FilterBar/FilterBar.d.ts +10 -1
- package/dist/_types/molecules/InputField/InputField.d.ts +16 -2
- package/dist/_types/molecules/MultiSelectField/MultiSelectField.d.ts +9 -1
- package/dist/_types/molecules/PasswordField/PasswordField.d.ts +22 -2
- package/dist/_types/molecules/SearchForm/SearchForm.d.ts +18 -6
- package/dist/_types/molecules/SelectField/SelectField.d.ts +5 -0
- package/dist/_types/molecules/TimeField/TimeField.d.ts +9 -2
- package/dist/_types/molecules/_shared/calendarGrid.d.ts +6 -2
- package/dist/async-multi-select.js +50 -49
- package/dist/async-select.js +89 -88
- package/dist/calendar.js +87 -86
- package/dist/docs-search.js +38 -37
- package/dist/filter-bar.css +1 -1
- package/dist/filter-bar.js +19 -17
- package/dist/input-field.js +66 -65
- package/dist/input-phone.js +39 -38
- package/dist/multi-select.js +109 -108
- package/dist/number-input.js +61 -60
- package/dist/otp-input.js +86 -85
- package/dist/password-field.js +46 -45
- package/dist/search-form.js +35 -34
- package/dist/select.js +75 -71
- package/dist/time-select.js +57 -56
- package/package.json +1 -1
package/dist/otp-input.js
CHANGED
|
@@ -1,115 +1,116 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './otp-input.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Input as t } from "./input.js";
|
|
5
|
+
import { forwardRef as n, useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
7
|
//#region src/stories/atoms/OtpInput/OtpInput.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
9
|
-
let e =
|
|
10
|
-
return Array.from({ length:
|
|
11
|
-
}),
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
let e =
|
|
8
|
+
var l = n(function({ length: n, value: l, defaultValue: u, onChange: d, onComplete: f, disabled: p, readOnly: m, error: h = !1, size: g = "md", describedBy: _, "aria-describedby": v, "aria-label": y, "aria-labelledby": b, groupLabel: x, id: S, name: C, onBlur: w, className: T, digitLabel: E }, D) {
|
|
9
|
+
let O = e("otpInput"), k = l !== void 0, [A, j] = o(() => {
|
|
10
|
+
let e = u ?? "";
|
|
11
|
+
return Array.from({ length: n }, (t, n) => e[n] ?? "");
|
|
12
|
+
}), M = a(null), N = k ? Array.from({ length: n }, (e, t) => l[t] ?? "") : A;
|
|
13
|
+
i(() => {
|
|
14
|
+
if (k) return;
|
|
15
|
+
let e = M.current?.closest("form");
|
|
15
16
|
if (!e) return;
|
|
16
|
-
let
|
|
17
|
-
let e =
|
|
18
|
-
|
|
17
|
+
let t = () => {
|
|
18
|
+
let e = u ?? "";
|
|
19
|
+
j(Array.from({ length: n }, (t, n) => e[n] ?? ""));
|
|
19
20
|
};
|
|
20
|
-
return e.addEventListener("reset",
|
|
21
|
+
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
21
22
|
}, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
k,
|
|
24
|
+
u,
|
|
25
|
+
n
|
|
25
26
|
]);
|
|
26
|
-
let
|
|
27
|
-
let t =
|
|
27
|
+
let P = r((e) => {
|
|
28
|
+
let t = M.current?.querySelectorAll("input");
|
|
28
29
|
t?.[e] && t[e].focus();
|
|
29
|
-
}, []),
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
|
|
30
|
+
}, []), F = r((e) => {
|
|
31
|
+
k || j(e);
|
|
32
|
+
let t = e.join("");
|
|
33
|
+
d?.(t), e.length === n && e.every((e) => e !== "") && f?.(t);
|
|
33
34
|
}, [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
]),
|
|
39
|
-
let r =
|
|
35
|
+
k,
|
|
36
|
+
n,
|
|
37
|
+
d,
|
|
38
|
+
f
|
|
39
|
+
]), I = r((e) => (t) => {
|
|
40
|
+
let r = t.target.value.replace(/\D/g, "").slice(-1);
|
|
40
41
|
if (!r) return;
|
|
41
|
-
let i = [...
|
|
42
|
-
i[e] = r,
|
|
42
|
+
let i = [...N];
|
|
43
|
+
i[e] = r, F(i), e < n - 1 && P(e + 1);
|
|
43
44
|
}, [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
]),
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
} else
|
|
45
|
+
N,
|
|
46
|
+
n,
|
|
47
|
+
P,
|
|
48
|
+
F
|
|
49
|
+
]), L = r((e) => (t) => {
|
|
50
|
+
if (t.key === "Backspace") {
|
|
51
|
+
t.preventDefault();
|
|
52
|
+
let n = [...N];
|
|
53
|
+
n[e] === "" ? e > 0 && (n[e - 1] = "", F(n), P(e - 1)) : (n[e] = "", F(n));
|
|
54
|
+
} else t.key === "ArrowLeft" ? (t.preventDefault(), e > 0 && P(e - 1)) : t.key === "ArrowRight" && (t.preventDefault(), e < n - 1 && P(e + 1));
|
|
54
55
|
}, [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]),
|
|
60
|
-
|
|
61
|
-
let r =
|
|
56
|
+
N,
|
|
57
|
+
n,
|
|
58
|
+
P,
|
|
59
|
+
F
|
|
60
|
+
]), R = r((e) => (t) => {
|
|
61
|
+
t.preventDefault();
|
|
62
|
+
let r = t.clipboardData.getData("text").replace(/\D/g, "");
|
|
62
63
|
if (!r) return;
|
|
63
|
-
let i = [...
|
|
64
|
-
for (let
|
|
65
|
-
|
|
64
|
+
let i = [...N], a = e;
|
|
65
|
+
for (let t = 0; t < r.length && e + t < n; t++) i[e + t] = r[t], a = e + t;
|
|
66
|
+
F(i), P(Math.min(a + 1, n - 1));
|
|
66
67
|
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
N,
|
|
69
|
+
n,
|
|
70
|
+
P,
|
|
71
|
+
F
|
|
71
72
|
]);
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
ref:
|
|
73
|
+
return /* @__PURE__ */ c("div", {
|
|
74
|
+
ref: M,
|
|
74
75
|
role: "group",
|
|
75
|
-
"aria-label":
|
|
76
|
-
"aria-labelledby":
|
|
77
|
-
"aria-describedby":
|
|
78
|
-
"aria-invalid":
|
|
76
|
+
"aria-label": b ? void 0 : y ?? O("group", x),
|
|
77
|
+
"aria-labelledby": b,
|
|
78
|
+
"aria-describedby": _ ?? v,
|
|
79
|
+
"aria-invalid": h || void 0,
|
|
79
80
|
className: [
|
|
80
81
|
"otp-input",
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
g === "md" ? "" : `otp-input--${g}`,
|
|
83
|
+
h ? "otp-input--error" : "",
|
|
84
|
+
p ? "otp-input--disabled" : "",
|
|
85
|
+
T ?? ""
|
|
85
86
|
].filter(Boolean).join(" "),
|
|
86
|
-
children: [Array.from({ length:
|
|
87
|
+
children: [Array.from({ length: n }, (e, r) => /* @__PURE__ */ s(t, {
|
|
87
88
|
className: "otp-input__cell",
|
|
88
|
-
ref: r === 0 ?
|
|
89
|
-
id:
|
|
90
|
-
name:
|
|
89
|
+
ref: r === 0 ? D : void 0,
|
|
90
|
+
id: S ? `${S}-${r}` : void 0,
|
|
91
|
+
name: C ? `${C}-${r}` : void 0,
|
|
91
92
|
type: "text",
|
|
92
|
-
size:
|
|
93
|
-
error:
|
|
94
|
-
disabled:
|
|
95
|
-
readOnly:
|
|
96
|
-
"aria-describedby": r === 0 ?
|
|
93
|
+
size: g,
|
|
94
|
+
error: h,
|
|
95
|
+
disabled: p,
|
|
96
|
+
readOnly: m,
|
|
97
|
+
"aria-describedby": r === 0 ? _ ?? v : void 0,
|
|
97
98
|
inputMode: "numeric",
|
|
98
99
|
pattern: "\\d*",
|
|
99
100
|
maxLength: 1,
|
|
100
101
|
autoComplete: r === 0 ? "one-time-code" : "off",
|
|
101
|
-
"aria-label":
|
|
102
|
-
value:
|
|
103
|
-
onChange:
|
|
104
|
-
onKeyDown:
|
|
105
|
-
onPaste:
|
|
106
|
-
onBlur:
|
|
107
|
-
}, r)),
|
|
102
|
+
"aria-label": O("digit", E)(r + 1, n),
|
|
103
|
+
value: N[r],
|
|
104
|
+
onChange: I(r),
|
|
105
|
+
onKeyDown: L(r),
|
|
106
|
+
onPaste: R(r),
|
|
107
|
+
onBlur: w
|
|
108
|
+
}, r)), C && /* @__PURE__ */ s("input", {
|
|
108
109
|
type: "hidden",
|
|
109
|
-
name:
|
|
110
|
-
value:
|
|
110
|
+
name: C,
|
|
111
|
+
value: N.join("")
|
|
111
112
|
})]
|
|
112
113
|
});
|
|
113
114
|
});
|
|
114
115
|
//#endregion
|
|
115
|
-
export {
|
|
116
|
+
export { l as OtpInput };
|
package/dist/password-field.js
CHANGED
|
@@ -1,65 +1,66 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './password-field.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n } from "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Icon as t } from "./icon.js";
|
|
5
|
+
import { VisuallyHidden as n } from "./visually-hidden.js";
|
|
6
|
+
import { n as r } from "./_shared/form-size.js";
|
|
7
|
+
import { ErrorText as i } from "./error-text.js";
|
|
8
|
+
import { Input as a } from "./input.js";
|
|
9
|
+
import { Label as o } from "./label.js";
|
|
10
|
+
import { forwardRef as s, useId as c, useState as l } from "react";
|
|
11
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
11
12
|
//#region src/stories/molecules/PasswordField/PasswordField.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
className: ["password-field",
|
|
13
|
+
var f = s(function({ label: s, labelHidden: f = !0, error: p = !1, errorMessage: m, helperText: h, action: g, size: _, showPasswordLabel: v, hidePasswordLabel: y, className: b, id: x, disabled: S, placeholder: C, ...w }, T) {
|
|
14
|
+
let E = e("passwordField"), D = r(_), O = c(), k = x ?? O, [A, j] = l(!1), M = m ? `${k}-error` : void 0, N = h ? `${k}-helper` : void 0, P = [M, N].filter(Boolean).join(" ") || void 0;
|
|
15
|
+
return /* @__PURE__ */ d("div", {
|
|
16
|
+
className: ["password-field", b ?? ""].filter(Boolean).join(" "),
|
|
16
17
|
children: [
|
|
17
|
-
|
|
18
|
-
htmlFor:
|
|
19
|
-
hidden:
|
|
20
|
-
size:
|
|
21
|
-
children:
|
|
18
|
+
s && /* @__PURE__ */ u(o, {
|
|
19
|
+
htmlFor: k,
|
|
20
|
+
hidden: f,
|
|
21
|
+
size: D,
|
|
22
|
+
children: s
|
|
22
23
|
}),
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
className: ["password-field__wrapper",
|
|
25
|
-
children: [/* @__PURE__ */
|
|
26
|
-
ref:
|
|
27
|
-
id:
|
|
28
|
-
size:
|
|
29
|
-
error:
|
|
30
|
-
placeholder:
|
|
31
|
-
"aria-describedby":
|
|
32
|
-
...
|
|
33
|
-
type:
|
|
34
|
-
disabled:
|
|
35
|
-
}), /* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ d("div", {
|
|
25
|
+
className: ["password-field__wrapper", D === "md" ? "" : `password-field__wrapper--${D}`].filter(Boolean).join(" "),
|
|
26
|
+
children: [/* @__PURE__ */ u(a, {
|
|
27
|
+
ref: T,
|
|
28
|
+
id: k,
|
|
29
|
+
size: D,
|
|
30
|
+
error: p || !!m,
|
|
31
|
+
placeholder: C ?? (s && f ? s : void 0),
|
|
32
|
+
"aria-describedby": P,
|
|
33
|
+
...w,
|
|
34
|
+
type: A ? "text" : "password",
|
|
35
|
+
disabled: S
|
|
36
|
+
}), /* @__PURE__ */ d("button", {
|
|
36
37
|
type: "button",
|
|
37
38
|
className: "password-field__toggle",
|
|
38
|
-
onClick: () =>
|
|
39
|
-
disabled:
|
|
40
|
-
"aria-controls":
|
|
41
|
-
"aria-pressed":
|
|
42
|
-
children: [/* @__PURE__ */
|
|
43
|
-
name:
|
|
39
|
+
onClick: () => j((e) => !e),
|
|
40
|
+
disabled: S,
|
|
41
|
+
"aria-controls": k,
|
|
42
|
+
"aria-pressed": A,
|
|
43
|
+
children: [/* @__PURE__ */ u(n, { children: A ? E("hide", y) : E("show", v) }), /* @__PURE__ */ u(t, {
|
|
44
|
+
name: A ? "eye-off" : "eye",
|
|
44
45
|
className: "password-field__icon"
|
|
45
46
|
})]
|
|
46
47
|
})]
|
|
47
48
|
}),
|
|
48
|
-
|
|
49
|
-
id:
|
|
50
|
-
children:
|
|
49
|
+
m && /* @__PURE__ */ u(i, {
|
|
50
|
+
id: M,
|
|
51
|
+
children: m
|
|
51
52
|
}),
|
|
52
|
-
|
|
53
|
-
id:
|
|
53
|
+
h && /* @__PURE__ */ u("span", {
|
|
54
|
+
id: N,
|
|
54
55
|
className: "password-field__helper",
|
|
55
|
-
children:
|
|
56
|
+
children: h
|
|
56
57
|
}),
|
|
57
|
-
|
|
58
|
+
g && /* @__PURE__ */ u("div", {
|
|
58
59
|
className: "password-field__action",
|
|
59
|
-
children:
|
|
60
|
+
children: g
|
|
60
61
|
})
|
|
61
62
|
]
|
|
62
63
|
});
|
|
63
64
|
});
|
|
64
65
|
//#endregion
|
|
65
|
-
export {
|
|
66
|
+
export { f as PasswordField };
|
package/dist/search-form.js
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './search-form.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Icon as t } from "./icon.js";
|
|
5
|
+
import { n } from "./_shared/form-size.js";
|
|
6
|
+
import { InputField as r } from "./input-field.js";
|
|
7
|
+
import { forwardRef as i, useId as a } from "react";
|
|
8
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
9
|
//#region src/stories/molecules/SearchForm/SearchForm.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
function
|
|
12
|
-
let t = String(new FormData(e.currentTarget).get(
|
|
13
|
-
if (
|
|
14
|
-
e.preventDefault(), t &&
|
|
10
|
+
var c = i(function({ id: i, name: c = "q", value: l, defaultValue: u, onChange: d, onSubmit: f, action: p, method: m = "get", label: h, labelHidden: g = !0, placeholder: _, submitLabel: v, size: y, disabled: b }, x) {
|
|
11
|
+
let S = e("searchForm"), C = n(y === "xl" ? void 0 : y), w = y === "xl" ? "xl" : C, T = w === "xl" ? "lg" : w, E = a(), D = i ?? E;
|
|
12
|
+
function O(e) {
|
|
13
|
+
let t = String(new FormData(e.currentTarget).get(c) ?? "").trim();
|
|
14
|
+
if (f) {
|
|
15
|
+
e.preventDefault(), t && f(t);
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
t || e.preventDefault();
|
|
18
19
|
}
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className: ["search-form",
|
|
20
|
+
return /* @__PURE__ */ s("form", {
|
|
21
|
+
className: ["search-form", w === "md" ? "" : `search-form--${w}`].filter(Boolean).join(" "),
|
|
21
22
|
role: "search",
|
|
22
|
-
"aria-label":
|
|
23
|
-
action:
|
|
24
|
-
method:
|
|
25
|
-
onSubmit:
|
|
26
|
-
children: [/* @__PURE__ */
|
|
27
|
-
ref:
|
|
23
|
+
"aria-label": S("label", h),
|
|
24
|
+
action: p,
|
|
25
|
+
method: m,
|
|
26
|
+
onSubmit: O,
|
|
27
|
+
children: [/* @__PURE__ */ o(r, {
|
|
28
|
+
ref: x,
|
|
28
29
|
className: "search-form__field",
|
|
29
|
-
id:
|
|
30
|
-
name:
|
|
31
|
-
label:
|
|
32
|
-
labelHidden:
|
|
30
|
+
id: D,
|
|
31
|
+
name: c,
|
|
32
|
+
label: S("label", h),
|
|
33
|
+
labelHidden: g,
|
|
33
34
|
type: "text",
|
|
34
35
|
autoComplete: "off",
|
|
35
36
|
enterKeyHint: "search",
|
|
36
|
-
placeholder:
|
|
37
|
-
value:
|
|
38
|
-
defaultValue:
|
|
39
|
-
disabled:
|
|
40
|
-
size:
|
|
41
|
-
onChange:
|
|
42
|
-
}), /* @__PURE__ */
|
|
37
|
+
placeholder: S("placeholder", _),
|
|
38
|
+
value: l,
|
|
39
|
+
defaultValue: u,
|
|
40
|
+
disabled: b,
|
|
41
|
+
size: T,
|
|
42
|
+
onChange: d
|
|
43
|
+
}), /* @__PURE__ */ o("button", {
|
|
43
44
|
className: "search-form__submit",
|
|
44
45
|
type: "submit",
|
|
45
|
-
disabled:
|
|
46
|
-
"aria-label":
|
|
47
|
-
children: /* @__PURE__ */
|
|
46
|
+
disabled: b,
|
|
47
|
+
"aria-label": S("submit", v),
|
|
48
|
+
children: /* @__PURE__ */ o(t, {
|
|
48
49
|
name: "arrow",
|
|
49
50
|
className: "search-form__submit-glyph"
|
|
50
51
|
})
|
|
@@ -52,4 +53,4 @@ var s = r(function({ id: r, name: s = "q", value: c, defaultValue: l, onChange:
|
|
|
52
53
|
});
|
|
53
54
|
});
|
|
54
55
|
//#endregion
|
|
55
|
-
export {
|
|
56
|
+
export { c as SearchForm };
|
package/dist/select.js
CHANGED
|
@@ -1,156 +1,160 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './select.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Icon as t } from "./icon.js";
|
|
5
|
+
import { Children as n, createContext as r, forwardRef as i, isValidElement as a, useContext as o, useMemo as s } from "react";
|
|
6
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { Select as d } from "@base-ui/react/select";
|
|
7
8
|
//#region src/stories/atoms/Select/Select.tsx
|
|
8
|
-
function
|
|
9
|
+
function f(e) {
|
|
9
10
|
return Array.isArray(e.options);
|
|
10
11
|
}
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
if (!
|
|
15
|
-
let
|
|
16
|
-
if (e.type ===
|
|
17
|
-
typeof
|
|
12
|
+
var p = r(null);
|
|
13
|
+
function m(e, t) {
|
|
14
|
+
n.forEach(e, (e) => {
|
|
15
|
+
if (!a(e)) return;
|
|
16
|
+
let n = e.props ?? {};
|
|
17
|
+
if (e.type === b || typeof n.value == "string" && e.type !== h) {
|
|
18
|
+
typeof n.value == "string" && t.set(n.value, n.children);
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
n.children != null && m(n.children, t);
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
let r =
|
|
24
|
+
function h({ children: e, onValueChange: t, ...n }) {
|
|
25
|
+
let r = s(() => {
|
|
25
26
|
let t = /* @__PURE__ */ new Map();
|
|
26
|
-
return
|
|
27
|
+
return m(e, t), t;
|
|
27
28
|
}, [e]);
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ l(p.Provider, {
|
|
29
30
|
value: r,
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ l(d.Root, {
|
|
31
32
|
onValueChange: t ? (e) => t(e) : void 0,
|
|
32
33
|
...n,
|
|
33
34
|
children: e
|
|
34
35
|
})
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
|
-
var
|
|
38
|
-
let i =
|
|
39
|
-
return /* @__PURE__ */
|
|
38
|
+
var g = i(function({ placeholder: e, children: t, ...n }, r) {
|
|
39
|
+
let i = o(p);
|
|
40
|
+
return /* @__PURE__ */ l(d.Value, {
|
|
40
41
|
ref: r,
|
|
41
42
|
...n,
|
|
42
43
|
children: (n) => typeof t == "function" ? t(n) : t ?? (n == null || n === "" ? e ?? null : i?.get(n) ?? n)
|
|
43
44
|
});
|
|
44
|
-
}),
|
|
45
|
+
}), _ = i(function({ className: e, children: t, ...n }, r) {
|
|
45
46
|
let i = ["select__group", e ?? ""].filter(Boolean).join(" ");
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ l(d.Group, {
|
|
47
48
|
ref: r,
|
|
48
49
|
className: i,
|
|
49
50
|
...n,
|
|
50
51
|
children: t
|
|
51
52
|
});
|
|
52
|
-
}),
|
|
53
|
+
}), v = i(function({ size: e = "md", className: n, children: r, ...i }, a) {
|
|
53
54
|
let o = [
|
|
54
55
|
"select",
|
|
55
|
-
|
|
56
|
+
e === "md" ? "" : `select--${e}`,
|
|
56
57
|
n ?? ""
|
|
57
58
|
].filter(Boolean).join(" ");
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ u(d.Trigger, {
|
|
59
60
|
ref: a,
|
|
60
61
|
className: o,
|
|
61
62
|
...i,
|
|
62
|
-
children: [r, /* @__PURE__ */
|
|
63
|
+
children: [r, /* @__PURE__ */ l(t, {
|
|
63
64
|
name: "chevron",
|
|
64
65
|
className: "select__icon",
|
|
65
|
-
size:
|
|
66
|
+
size: e === "sm" ? "xs" : e === "lg" ? "md" : "sm"
|
|
66
67
|
})]
|
|
67
68
|
});
|
|
68
|
-
}),
|
|
69
|
-
let
|
|
69
|
+
}), y = i(function({ size: e = "md", container: t, className: n, children: r, side: i = "bottom", align: a = "start", sideOffset: o = -1, ...s }, c) {
|
|
70
|
+
let u = [
|
|
70
71
|
"select__content",
|
|
71
72
|
e === "md" ? "" : `select__content--${e}`,
|
|
72
73
|
n ?? ""
|
|
73
74
|
].filter(Boolean).join(" ");
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ l(d.Portal, {
|
|
75
76
|
container: t,
|
|
76
|
-
children: /* @__PURE__ */
|
|
77
|
+
children: /* @__PURE__ */ l(d.Positioner, {
|
|
77
78
|
className: "select__positioner",
|
|
78
79
|
side: i,
|
|
79
80
|
align: a,
|
|
80
81
|
sideOffset: o,
|
|
81
82
|
alignItemWithTrigger: !1,
|
|
82
|
-
children: /* @__PURE__ */
|
|
83
|
-
ref:
|
|
84
|
-
className:
|
|
85
|
-
...
|
|
83
|
+
children: /* @__PURE__ */ l(d.Popup, {
|
|
84
|
+
ref: c,
|
|
85
|
+
className: u,
|
|
86
|
+
...s,
|
|
86
87
|
children: r
|
|
87
88
|
})
|
|
88
89
|
})
|
|
89
90
|
});
|
|
90
|
-
}),
|
|
91
|
+
}), b = i(function({ className: e, children: t, ...n }, r) {
|
|
91
92
|
let i = ["select__item", e ?? ""].filter(Boolean).join(" ");
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ l(d.Item, {
|
|
93
94
|
ref: r,
|
|
94
95
|
className: i,
|
|
95
96
|
...n,
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ l(d.ItemText, { children: t })
|
|
97
98
|
});
|
|
98
|
-
}),
|
|
99
|
+
}), x = i(function({ className: e, children: t, ...n }, r) {
|
|
99
100
|
let i = ["select__label", e ?? ""].filter(Boolean).join(" ");
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ l(d.GroupLabel, {
|
|
101
102
|
ref: r,
|
|
102
103
|
className: i,
|
|
103
104
|
...n,
|
|
104
105
|
children: t
|
|
105
106
|
});
|
|
106
|
-
}),
|
|
107
|
+
}), S = i(function({ className: e, ...t }, n) {
|
|
107
108
|
let r = ["select__separator", e ?? ""].filter(Boolean).join(" ");
|
|
108
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ l(d.Separator, {
|
|
109
110
|
ref: n,
|
|
110
111
|
className: r,
|
|
111
112
|
...t
|
|
112
113
|
});
|
|
113
114
|
});
|
|
114
|
-
function
|
|
115
|
-
return /* @__PURE__ */
|
|
115
|
+
function C({ value: e, label: t, "aria-label": n }) {
|
|
116
|
+
return /* @__PURE__ */ l(b, {
|
|
116
117
|
value: e,
|
|
117
118
|
"aria-label": n,
|
|
118
119
|
children: t
|
|
119
120
|
}, e);
|
|
120
121
|
}
|
|
121
|
-
|
|
122
|
-
return /* @__PURE__ */ c(
|
|
122
|
+
function w({ override: t }) {
|
|
123
|
+
return /* @__PURE__ */ l(c, { children: e("select")("placeholder", t) });
|
|
124
|
+
}
|
|
125
|
+
var T = i(function({ options: e, value: t, defaultValue: n, placeholder: r, disabled: i, readOnly: a, size: o = "md", onValueChange: s, id: c, name: d, required: p, onBlur: m, "aria-label": b, "aria-describedby": S, "aria-invalid": T, container: E }, D) {
|
|
126
|
+
return /* @__PURE__ */ u(h, {
|
|
123
127
|
value: t,
|
|
124
128
|
defaultValue: n,
|
|
125
129
|
disabled: i,
|
|
126
130
|
readOnly: a,
|
|
127
|
-
name:
|
|
128
|
-
required:
|
|
129
|
-
onValueChange:
|
|
130
|
-
children: [/* @__PURE__ */
|
|
131
|
-
ref:
|
|
131
|
+
name: d,
|
|
132
|
+
required: p,
|
|
133
|
+
onValueChange: s,
|
|
134
|
+
children: [/* @__PURE__ */ l(v, {
|
|
135
|
+
ref: D,
|
|
132
136
|
size: o,
|
|
133
|
-
id:
|
|
134
|
-
onBlur:
|
|
135
|
-
"aria-label":
|
|
136
|
-
"aria-describedby":
|
|
137
|
-
"aria-invalid":
|
|
138
|
-
children: /* @__PURE__ */
|
|
139
|
-
}), /* @__PURE__ */
|
|
137
|
+
id: c,
|
|
138
|
+
onBlur: m,
|
|
139
|
+
"aria-label": b,
|
|
140
|
+
"aria-describedby": S,
|
|
141
|
+
"aria-invalid": T || void 0,
|
|
142
|
+
children: /* @__PURE__ */ l(g, { placeholder: /* @__PURE__ */ l(w, { override: r }) })
|
|
143
|
+
}), /* @__PURE__ */ l(y, {
|
|
140
144
|
size: o,
|
|
141
|
-
container:
|
|
142
|
-
children: e.map((e, t) =>
|
|
145
|
+
container: E,
|
|
146
|
+
children: e.map((e, t) => f(e) ? /* @__PURE__ */ u(_, { children: [/* @__PURE__ */ l(x, { children: e.label }), e.options.map(C)] }, `group-${t}`) : C(e))
|
|
143
147
|
})]
|
|
144
148
|
});
|
|
145
|
-
}),
|
|
146
|
-
Root:
|
|
147
|
-
Trigger:
|
|
148
|
-
Value:
|
|
149
|
-
Content:
|
|
150
|
-
Group:
|
|
151
|
-
Label:
|
|
152
|
-
Item:
|
|
153
|
-
Separator:
|
|
149
|
+
}), E = Object.assign(T, {
|
|
150
|
+
Root: h,
|
|
151
|
+
Trigger: v,
|
|
152
|
+
Value: g,
|
|
153
|
+
Content: y,
|
|
154
|
+
Group: _,
|
|
155
|
+
Label: x,
|
|
156
|
+
Item: b,
|
|
157
|
+
Separator: S
|
|
154
158
|
});
|
|
155
159
|
//#endregion
|
|
156
|
-
export {
|
|
160
|
+
export { E as Select, y as SelectContent, _ as SelectGroup, b as SelectItem, x as SelectLabel, h as SelectRoot, S as SelectSeparator, v as SelectTrigger, g as SelectValue, f as isSelectOptionGroup };
|