@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
@@ -1 +1 @@
1
- .filter-bar{gap:var(--filter-bar-gap);flex-direction:column;display:flex}.filter-bar__search{inline-size:100%}.filter-bar__row{grid-template-columns:repeat(auto-fill, minmax(min(var(--filter-bar-column-min-inline-size), 100%), 1fr));column-gap:var(--filter-bar-column-gap);row-gap:var(--filter-bar-row-gap);display:grid}.filter-bar__filters{display:contents}.filter-bar__filter{min-inline-size:0}.filter-bar__actions{align-items:stretch;gap:var(--filter-bar-actions-gap);flex-direction:column;min-inline-size:0;display:flex}.filter-bar__actions>*{inline-size:100%}@media (width>=768px){.filter-bar__actions{flex-flow:wrap;align-items:center}.filter-bar__actions>*{inline-size:auto}:is(.filter-bar__row:has(.label:not(.visually-hidden)) .filter-bar__filter:not(:has(.label:not(.visually-hidden))),.filter-bar__row:has(.label:not(.visually-hidden))>.filter-bar__actions){align-self:start;padding-block-start:var(--filter-bar-label-offset)}.filter-bar__row:has(.label:not(.visually-hidden)) .filter-bar__filter:not(:has(.label:not(.visually-hidden))){block-size:calc(var(--filter-bar-label-offset) + var(--filter-bar-control-block-size));flex-direction:column;justify-content:center;display:flex}.filter-bar__row:has(.label:not(.visually-hidden))>.filter-bar__actions{min-block-size:calc(var(--filter-bar-label-offset) + var(--filter-bar-control-block-size))}}
1
+ .filter-bar{gap:var(--filter-bar-gap);flex-direction:column;display:flex}.filter-bar__search{inline-size:100%}.filter-bar__row{column-gap:var(--filter-bar-column-gap);row-gap:var(--filter-bar-row-gap);grid-template-columns:1fr;display:grid}.filter-bar__filters{display:contents}.filter-bar__filter{min-inline-size:0}.filter-bar__actions{align-items:stretch;gap:var(--filter-bar-actions-gap);flex-direction:column;min-inline-size:0;display:flex}.filter-bar__actions>*{inline-size:100%}@media (width>=768px){.filter-bar__row{grid-template-columns:repeat(auto-fill, minmax(min(var(--filter-bar-column-min-inline-size), 100%), 1fr))}.filter-bar__actions{flex-flow:wrap;align-items:center}.filter-bar__actions>*{inline-size:auto}:is(.filter-bar__row:has(.label:not(.visually-hidden)) .filter-bar__filter:not(:has(.label:not(.visually-hidden))),.filter-bar__row:has(.label:not(.visually-hidden))>.filter-bar__actions){align-self:start;padding-block-start:var(--filter-bar-label-offset)}.filter-bar__row:has(.label:not(.visually-hidden)) .filter-bar__filter:not(:has(.label:not(.visually-hidden))){block-size:calc(var(--filter-bar-label-offset) + var(--filter-bar-control-block-size));flex-direction:column;justify-content:center;display:flex}.filter-bar__row:has(.label:not(.visually-hidden))>.filter-bar__actions{min-block-size:calc(var(--filter-bar-label-offset) + var(--filter-bar-control-block-size))}}
@@ -1,31 +1,33 @@
1
+ 'use client';
1
2
  import './filter-bar.css';
2
- import { Children as e } from "react";
3
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Children as t } from "react";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
6
  //#region src/stories/molecules/FilterBar/FilterBar.tsx
5
- function r({ search: r, children: i, actions: a, ariaLabel: o = "Filtros", className: s, ...c }) {
6
- let l = e.toArray(i);
7
- return /* @__PURE__ */ n("div", {
8
- className: ["filter-bar", s].filter(Boolean).join(" "),
7
+ function i({ search: i, children: a, actions: o, ariaLabel: s, className: c, ...l }) {
8
+ let u = e("filterBar"), d = t.toArray(a);
9
+ return /* @__PURE__ */ r("div", {
10
+ className: ["filter-bar", c].filter(Boolean).join(" "),
9
11
  role: "search",
10
- "aria-label": o,
11
- ...c,
12
- children: [r && /* @__PURE__ */ t("div", {
12
+ "aria-label": u("label", s),
13
+ ...l,
14
+ children: [i && /* @__PURE__ */ n("div", {
13
15
  className: "filter-bar__search",
14
- children: r
15
- }), (l.length > 0 || a) && /* @__PURE__ */ n("div", {
16
+ children: i
17
+ }), (d.length > 0 || o) && /* @__PURE__ */ r("div", {
16
18
  className: "filter-bar__row",
17
- children: [l.length > 0 && /* @__PURE__ */ t("div", {
19
+ children: [d.length > 0 && /* @__PURE__ */ n("div", {
18
20
  className: "filter-bar__filters",
19
- children: l.map((e, n) => /* @__PURE__ */ t("div", {
21
+ children: d.map((e, t) => /* @__PURE__ */ n("div", {
20
22
  className: "filter-bar__filter",
21
23
  children: e
22
- }, n))
23
- }), a && /* @__PURE__ */ t("div", {
24
+ }, t))
25
+ }), o && /* @__PURE__ */ n("div", {
24
26
  className: "filter-bar__actions",
25
- children: a
27
+ children: o
26
28
  })]
27
29
  })]
28
30
  });
29
31
  }
30
32
  //#endregion
31
- export { r as FilterBar };
33
+ export { i as FilterBar };
@@ -1,100 +1,101 @@
1
1
  'use client';
2
2
  import './input-field.css';
3
- import { Icon as e } from "./icon.js";
4
- import { n as t } from "./_shared/form-size.js";
5
- import { ErrorText as n } from "./error-text.js";
6
- import { Input as r } from "./input.js";
7
- import { Label as i } from "./label.js";
8
- import { n as a } from "./_shared/field-labels.js";
9
- import { forwardRef as o, useImperativeHandle as s, useRef as c, useState as l } from "react";
10
- import { jsx as u, jsxs as d } 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 { 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 { n as o } from "./_shared/field-labels.js";
10
+ import { forwardRef as s, useImperativeHandle as c, useRef as l, useState as u } from "react";
11
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
12
  //#region src/stories/molecules/InputField/InputField.tsx
12
- var f = o(function({ id: o, label: f, labelHidden: p, name: m, type: h, kind: g = "text", clearable: _ = !1, clearLabel: v = "Borrar", onClear: y, placeholder: b, value: x, defaultValue: S, disabled: C, readOnly: w, size: T, error: E = !1, errorMessage: D, helperText: O, onChange: k, onBlur: A, onFocus: j, className: M, ...N }, P) {
13
- let F = a(p), I = t(T), L = D ? `${o}-error` : void 0, R = O ? `${o}-helper` : void 0, z = [
14
- L,
15
- R,
16
- N["aria-describedby"]
17
- ].filter(Boolean).join(" ") || void 0, B = E || !!D, V = g === "search", H = c(null);
18
- s(P, () => H.current);
19
- let [U, W] = l(() => (S ?? "") !== ""), G = V && _ && (x === void 0 ? U : x !== "") && !C && !w;
20
- function K(e) {
21
- x === void 0 && W(e.target.value !== ""), k?.(e);
13
+ var p = s(function({ id: s, label: p, labelHidden: m, name: h, type: g, kind: _ = "text", clearable: v = !1, clearLabel: y, onClear: b, placeholder: x, value: S, defaultValue: C, disabled: w, readOnly: T, size: E, error: D = !1, errorMessage: O, helperText: k, onChange: A, onBlur: j, onFocus: M, className: N, ...P }, F) {
14
+ let I = e("inputField"), L = o(m), R = n(E), z = O ? `${s}-error` : void 0, B = k ? `${s}-helper` : void 0, V = [
15
+ z,
16
+ B,
17
+ P["aria-describedby"]
18
+ ].filter(Boolean).join(" ") || void 0, H = D || !!O, U = _ === "search", W = l(null);
19
+ c(F, () => W.current);
20
+ let [G, K] = u(() => (C ?? "") !== ""), q = U && v && (S === void 0 ? G : S !== "") && !w && !T;
21
+ function J(e) {
22
+ S === void 0 && K(e.target.value !== ""), A?.(e);
22
23
  }
23
- function q() {
24
- let e = H.current;
25
- e && ((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), W(!1), e.focus(), y?.());
24
+ function Y() {
25
+ let e = W.current;
26
+ e && ((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), K(!1), e.focus(), b?.());
26
27
  }
27
- let J = /* @__PURE__ */ u(r, {
28
- ref: H,
29
- ...V ? {
28
+ let X = /* @__PURE__ */ d(i, {
29
+ ref: W,
30
+ ...U ? {
30
31
  type: "text",
31
32
  autoComplete: "off",
32
33
  enterKeyHint: "search"
33
- } : { type: h },
34
- ...N,
35
- id: o,
36
- name: m,
37
- placeholder: b ?? (F ? f : void 0),
38
- value: x,
39
- defaultValue: S,
40
- disabled: C,
41
- readOnly: w,
42
- size: I,
43
- error: B,
44
- "aria-describedby": z,
45
- onChange: K,
46
- onBlur: A,
47
- onFocus: j
34
+ } : { type: g },
35
+ ...P,
36
+ id: s,
37
+ name: h,
38
+ placeholder: x ?? (L ? p : void 0),
39
+ value: S,
40
+ defaultValue: C,
41
+ disabled: w,
42
+ readOnly: T,
43
+ size: R,
44
+ error: H,
45
+ "aria-describedby": V,
46
+ onChange: J,
47
+ onBlur: j,
48
+ onFocus: M
48
49
  });
49
- return /* @__PURE__ */ d("div", {
50
- className: ["input-field", M].filter(Boolean).join(" "),
50
+ return /* @__PURE__ */ f("div", {
51
+ className: ["input-field", N].filter(Boolean).join(" "),
51
52
  children: [
52
- /* @__PURE__ */ u(i, {
53
- htmlFor: o,
54
- hidden: F,
55
- size: I,
56
- children: f
53
+ /* @__PURE__ */ d(a, {
54
+ htmlFor: s,
55
+ hidden: L,
56
+ size: R,
57
+ children: p
57
58
  }),
58
- V ? /* @__PURE__ */ d("div", {
59
+ U ? /* @__PURE__ */ f("div", {
59
60
  className: [
60
61
  "input-field__search",
61
- I === "md" ? "" : `input-field__search--${I}`,
62
- _ ? "input-field__search--clearable" : ""
62
+ R === "md" ? "" : `input-field__search--${R}`,
63
+ v ? "input-field__search--clearable" : ""
63
64
  ].filter(Boolean).join(" "),
64
65
  children: [
65
- /* @__PURE__ */ u("span", {
66
+ /* @__PURE__ */ d("span", {
66
67
  className: "input-field__search-icon",
67
68
  "aria-hidden": "true",
68
- children: /* @__PURE__ */ u(e, {
69
+ children: /* @__PURE__ */ d(t, {
69
70
  name: "search",
70
71
  className: "input-field__search-glyph"
71
72
  })
72
73
  }),
73
- J,
74
- G && /* @__PURE__ */ u("button", {
74
+ X,
75
+ q && /* @__PURE__ */ d("button", {
75
76
  type: "button",
76
77
  className: "input-field__clear",
77
- "aria-label": v,
78
- "aria-controls": o,
79
- onClick: q,
80
- children: /* @__PURE__ */ u(e, {
78
+ "aria-label": I("clear", y),
79
+ "aria-controls": s,
80
+ onClick: Y,
81
+ children: /* @__PURE__ */ d(t, {
81
82
  name: "close",
82
83
  className: "input-field__search-glyph"
83
84
  })
84
85
  })
85
86
  ]
86
- }) : J,
87
- D && /* @__PURE__ */ u(n, {
88
- id: L,
89
- children: D
87
+ }) : X,
88
+ O && /* @__PURE__ */ d(r, {
89
+ id: z,
90
+ children: O
90
91
  }),
91
- O && /* @__PURE__ */ u("span", {
92
- id: R,
92
+ k && /* @__PURE__ */ d("span", {
93
+ id: B,
93
94
  className: "input-field__helper",
94
- children: O
95
+ children: k
95
96
  })
96
97
  ]
97
98
  });
98
99
  });
99
100
  //#endregion
100
- export { f as InputField };
101
+ export { p as InputField };
@@ -1,72 +1,73 @@
1
1
  'use client';
2
2
  import './input-phone.css';
3
- import { Icon as e } from "./icon.js";
4
- import { forwardRef as t, useMemo as n } from "react";
5
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
- import { Select as a } from "@base-ui/react/select";
7
- import o, { getCountryCallingCode as s } from "react-phone-number-input";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Icon as t } from "./icon.js";
5
+ import { forwardRef as n, useMemo as r } from "react";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ import { Select as o } from "@base-ui/react/select";
8
+ import s, { getCountryCallingCode as c } from "react-phone-number-input";
8
9
  //#region src/stories/atoms/InputPhone/InputPhone.tsx
9
- function c({ value: t, onChange: n, options: o, disabled: c, size: l = "md", countryLabel: u = "País", internationalLabel: d = "🌐", container: f }) {
10
- let p = "__intl__", m = (e) => e ?? p, h = (e) => e === p ? void 0 : e, g = l === "sm" ? "xs" : l === "lg" ? "md" : "sm", _ = ["input-phone__country-content", l === "md" ? "" : `input-phone__country-content--${l}`].filter(Boolean).join(" ");
11
- return /* @__PURE__ */ i(a.Root, {
12
- value: m(t),
13
- onValueChange: (e) => n(h(e)),
14
- disabled: c,
15
- children: [/* @__PURE__ */ i(a.Trigger, {
10
+ function l({ value: n, onChange: r, options: s, disabled: l, size: u = "md", countryLabel: d, internationalLabel: f = "🌐", container: p }) {
11
+ let m = e("inputPhone"), h = "__intl__", g = (e) => e ?? h, _ = (e) => e === h ? void 0 : e, v = u === "sm" ? "xs" : u === "lg" ? "md" : "sm", y = ["input-phone__country-content", u === "md" ? "" : `input-phone__country-content--${u}`].filter(Boolean).join(" ");
12
+ return /* @__PURE__ */ a(o.Root, {
13
+ value: g(n),
14
+ onValueChange: (e) => r(_(e)),
15
+ disabled: l,
16
+ children: [/* @__PURE__ */ a(o.Trigger, {
16
17
  className: "input-phone__country",
17
- "aria-label": u,
18
- children: [/* @__PURE__ */ r(a.Value, { children: t ? `+${s(t)}` : d }), /* @__PURE__ */ r(e, {
18
+ "aria-label": m("country", d),
19
+ children: [/* @__PURE__ */ i(o.Value, { children: n ? `+${c(n)}` : f }), /* @__PURE__ */ i(t, {
19
20
  name: "chevron",
20
21
  className: "input-phone__country-icon",
21
- size: g
22
+ size: v
22
23
  })]
23
- }), /* @__PURE__ */ r(a.Portal, {
24
- container: f,
25
- children: /* @__PURE__ */ r(a.Positioner, {
24
+ }), /* @__PURE__ */ i(o.Portal, {
25
+ container: p,
26
+ children: /* @__PURE__ */ i(o.Positioner, {
26
27
  className: "input-phone__country-positioner",
27
28
  side: "bottom",
28
29
  align: "start",
29
30
  alignItemWithTrigger: !1,
30
- children: /* @__PURE__ */ r(a.Popup, {
31
- className: _,
32
- children: o.map(({ value: e, label: t }) => /* @__PURE__ */ r(a.Item, {
33
- value: m(e),
31
+ children: /* @__PURE__ */ i(o.Popup, {
32
+ className: y,
33
+ children: s.map(({ value: e, label: t }) => /* @__PURE__ */ i(o.Item, {
34
+ value: g(e),
34
35
  className: "input-phone__country-item",
35
- children: /* @__PURE__ */ r(a.ItemText, { children: t })
36
- }, m(e)))
36
+ children: /* @__PURE__ */ i(o.ItemText, { children: t })
37
+ }, g(e)))
37
38
  })
38
39
  })
39
40
  })]
40
41
  });
41
42
  }
42
- var l = t(function({ value: e, defaultCountry: i = "ES", placeholder: a, disabled: s, error: l = !1, size: d = "md", id: f, name: p, describedBy: m, "aria-describedby": h, "aria-label": g, autoComplete: _, required: v, readOnly: y, onChange: b, onBlur: x, onFocus: S, countryLabel: C, internationalLabel: w, container: T }, E) {
43
- return /* @__PURE__ */ r(o, {
43
+ var u = n(function({ value: e, defaultCountry: t = "ES", placeholder: a, disabled: o, error: c = !1, size: u = "md", id: f, name: p, describedBy: m, "aria-describedby": h, "aria-label": g, autoComplete: _, required: v, readOnly: y, onChange: b, onBlur: x, onFocus: S, countryLabel: C, internationalLabel: w, container: T }, E) {
44
+ return /* @__PURE__ */ i(s, {
44
45
  className: [
45
46
  "input-phone",
46
- l ? "input-phone--error" : "",
47
- d === "md" ? "" : `input-phone--${d}`
47
+ c ? "input-phone--error" : "",
48
+ u === "md" ? "" : `input-phone--${u}`
48
49
  ].filter(Boolean).join(" "),
49
50
  value: e,
50
- defaultCountry: i,
51
+ defaultCountry: t,
51
52
  placeholder: a,
52
- disabled: s,
53
+ disabled: o,
53
54
  readOnly: y,
54
55
  required: v,
55
56
  autoComplete: _,
56
57
  id: f,
57
58
  name: p,
58
- inputComponent: n(() => t(function(e, t) {
59
- return /* @__PURE__ */ r("input", {
59
+ inputComponent: r(() => n(function(e, t) {
60
+ return /* @__PURE__ */ i("input", {
60
61
  ...e,
61
62
  ref: (e) => {
62
- u(t, e), u(E, e);
63
+ d(t, e), d(E, e);
63
64
  },
64
65
  className: "input-phone__number"
65
66
  });
66
67
  }), [E]),
67
- countrySelectComponent: c,
68
+ countrySelectComponent: l,
68
69
  countrySelectProps: {
69
- size: d,
70
+ size: u,
70
71
  countryLabel: C,
71
72
  internationalLabel: w,
72
73
  container: T
@@ -77,12 +78,12 @@ var l = t(function({ value: e, defaultCountry: i = "ES", placeholder: a, disable
77
78
  numberInputProps: {
78
79
  "aria-describedby": h ?? m,
79
80
  "aria-label": g,
80
- "aria-invalid": l || void 0
81
+ "aria-invalid": c || void 0
81
82
  }
82
83
  });
83
84
  });
84
- function u(e, t) {
85
+ function d(e, t) {
85
86
  typeof e == "function" ? e(t) : e && (e.current = t);
86
87
  }
87
88
  //#endregion
88
- export { l as InputPhone };
89
+ export { u as InputPhone };