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