@studiolxd/brand 45.1.0 → 47.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 (71) hide show
  1. package/CHANGELOG.md +168 -0
  2. package/dist/_shared/portal-container.js +9 -0
  3. package/dist/_types/atoms/AsyncMultiSelect/AsyncMultiSelect.d.ts +8 -7
  4. package/dist/_types/atoms/AsyncSelect/AsyncSelect.d.ts +8 -6
  5. package/dist/_types/atoms/InputPhone/InputPhone.d.ts +8 -5
  6. package/dist/_types/atoms/MenuButton/MenuButton.d.ts +22 -2
  7. package/dist/_types/atoms/MultiSelect/MultiSelect.d.ts +8 -6
  8. package/dist/_types/atoms/Popover/Popover.d.ts +8 -1
  9. package/dist/_types/atoms/Select/Select.d.ts +8 -7
  10. package/dist/_types/atoms/Tooltip/Tooltip.d.ts +7 -0
  11. package/dist/_types/constants/portal-container.d.ts +42 -0
  12. package/dist/_types/messages/BrandMessages.d.ts +41 -1
  13. package/dist/_types/messages/index.d.ts +1 -1
  14. package/dist/_types/molecules/AppLauncher/AppLauncher.d.ts +43 -8
  15. package/dist/_types/molecules/Breadcrumb/Breadcrumb.d.ts +10 -2
  16. package/dist/_types/molecules/CommandPalette/CommandPalette.d.ts +43 -8
  17. package/dist/_types/molecules/Consent/Consent.d.ts +93 -20
  18. package/dist/_types/molecules/Menu/Menu.d.ts +8 -1
  19. package/dist/_types/molecules/Modal/Modal.d.ts +8 -6
  20. package/dist/_types/molecules/NotificationButton/NotificationButton.d.ts +17 -4
  21. package/dist/_types/molecules/NotificationPanel/NotificationPanel.d.ts +54 -8
  22. package/dist/_types/molecules/OrgSwitcher/OrgSwitcher.d.ts +15 -1
  23. package/dist/_types/molecules/PrevNextNav/PrevNextNav.d.ts +17 -2
  24. package/dist/_types/molecules/Sheet/Sheet.d.ts +8 -7
  25. package/dist/_types/molecules/SidebarNav/SidebarNav.d.ts +18 -3
  26. package/dist/_types/molecules/SiteNav/SiteNav.d.ts +9 -0
  27. package/dist/_types/molecules/TableOfContents/TableOfContents.d.ts +11 -2
  28. package/dist/_types/molecules/UserMenu/UserMenu.d.ts +16 -1
  29. package/dist/_types/sections/AppHeader/AppHeader.d.ts +8 -2
  30. package/dist/_types/sections/AppRoot/AppRoot.d.ts +12 -1
  31. package/dist/_types/sections/AppShell/AppShell.d.ts +14 -1
  32. package/dist/_types/sections/FloatingDock/FloatingDock.d.ts +33 -3
  33. package/dist/_types/sections/Sidebar/Sidebar.d.ts +27 -3
  34. package/dist/_types/sections/SiteHeader/SiteHeader.d.ts +22 -3
  35. package/dist/_types/sections/SiteShell/SiteShell.d.ts +11 -5
  36. package/dist/_types/templates/OnboardingShell/OnboardingShell.d.ts +19 -2
  37. package/dist/_types/templates/PublicPageShell/PublicPageShell.d.ts +42 -6
  38. package/dist/app-header.js +1 -1
  39. package/dist/app-launcher.js +73 -63
  40. package/dist/app-root.js +10 -8
  41. package/dist/app-shell.js +51 -50
  42. package/dist/async-multi-select.js +65 -64
  43. package/dist/async-select.js +49 -48
  44. package/dist/breadcrumb.js +24 -21
  45. package/dist/command-palette.js +38 -36
  46. package/dist/consent.js +75 -73
  47. package/dist/floating-dock.js +42 -41
  48. package/dist/input-phone.js +38 -37
  49. package/dist/menu-button.js +16 -14
  50. package/dist/menu.js +44 -40
  51. package/dist/modal.js +32 -31
  52. package/dist/multi-select.js +106 -105
  53. package/dist/notification-button.js +18 -17
  54. package/dist/notification-panel.js +81 -80
  55. package/dist/onboarding-shell.js +36 -35
  56. package/dist/org-switcher.js +64 -59
  57. package/dist/popover.js +27 -22
  58. package/dist/prev-next-nav.js +38 -36
  59. package/dist/public-page-shell.js +24 -20
  60. package/dist/select.js +70 -69
  61. package/dist/sheet.js +30 -29
  62. package/dist/sidebar-nav.js +91 -90
  63. package/dist/sidebar.js +72 -71
  64. package/dist/site-header.js +44 -43
  65. package/dist/site-nav.js +27 -25
  66. package/dist/site-shell.js +23 -15
  67. package/dist/table-of-contents.js +30 -27
  68. package/dist/toaster.js +57 -53
  69. package/dist/tooltip.js +45 -41
  70. package/dist/user-menu.js +58 -52
  71. package/package.json +1 -1
@@ -3,22 +3,23 @@ import './async-multi-select.css';
3
3
  import { n as e } from "./_shared/brandmessagescontext.js";
4
4
  import { Icon as t } from "./icon.js";
5
5
  import { Spinner as n } from "./spinner.js";
6
- import { forwardRef as r, useCallback as ee, useEffect as te, useId as i, useRef as a, useState as o } from "react";
7
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
- import { Popover as l } from "@base-ui/react/popover";
6
+ import { n as r } from "./_shared/portal-container.js";
7
+ import { forwardRef as i, useCallback as a, useEffect as o, useId as s, useRef as c, useState as l } from "react";
8
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
+ import { Popover as f } from "@base-ui/react/popover";
9
10
  //#region src/stories/atoms/AsyncMultiSelect/AsyncMultiSelect.tsx
10
- function u(e, t) {
11
+ function ee(e, t) {
11
12
  typeof e == "function" ? e(t) : e && (e.current = t);
12
13
  }
13
- var d = r(function({ onSearch: r, value: d, defaultValue: f = [], onValueChange: p, selectedOptions: ne, placeholder: m, disabled: h, readOnly: g, size: _ = "md", debounceMs: v = 300, id: re, name: y, error: b = !1, required: ie, onBlur: ae, className: x, "aria-label": S, "aria-describedby": C, removeLabel: w, emptyMessage: T, loadingLabel: E, container: D }, oe) {
14
- let O = e("asyncMultiSelect"), [k, A] = o(!1), [j, M] = o(""), [N, P] = o(!1), [F, I] = o([]), [L, R] = o(!1), [z, B] = o(-1), [V, H] = o(f), [U, W] = o([]), G = a(null), K = a(0), q = a(null), J = a(null), Y = i(), se = i(), X = d === void 0 ? V : d, ce = X.map((e) => ne?.find((t) => t.value === e) ?? U.find((t) => t.value === e) ?? {
14
+ var p = i(function({ onSearch: i, value: p, defaultValue: te = [], onValueChange: ne, selectedOptions: m, placeholder: h, disabled: g, readOnly: _, size: v = "md", debounceMs: re = 300, id: ie, name: y, error: b = !1, required: x, onBlur: S, className: ae, "aria-label": C, "aria-describedby": oe, removeLabel: se, emptyMessage: ce, loadingLabel: w, container: T }, E) {
15
+ let D = e("asyncMultiSelect"), O = r(T), [k, A] = l(!1), [j, M] = l(""), [N, P] = l(!1), [F, I] = l([]), [L, R] = l(!1), [z, B] = l(-1), [V, H] = l(te), [U, W] = l([]), G = c(null), K = c(0), q = c(null), J = c(null), Y = s(), le = s(), X = p === void 0 ? V : p, ue = X.map((e) => m?.find((t) => t.value === e) ?? U.find((t) => t.value === e) ?? {
15
16
  value: e,
16
17
  label: e
17
- }), Z = (e) => `${se}-opt-${e}`, Q = ee(async (e) => {
18
+ }), Z = (e) => `${le}-opt-${e}`, Q = a(async (e) => {
18
19
  let t = ++K.current;
19
20
  P(!0), R(!1);
20
21
  try {
21
- let n = await r(e);
22
+ let n = await i(e);
22
23
  if (t !== K.current) return;
23
24
  I(n), B(-1);
24
25
  } catch {
@@ -27,22 +28,22 @@ var d = r(function({ onSearch: r, value: d, defaultValue: f = [], onValueChange:
27
28
  } finally {
28
29
  t === K.current && (P(!1), R(!0));
29
30
  }
30
- }, [r]);
31
- te(() => () => {
31
+ }, [i]);
32
+ o(() => () => {
32
33
  K.current += 1, G.current && clearTimeout(G.current);
33
34
  }, []);
34
- function le(e) {
35
+ function de(e) {
35
36
  let t = e.target.value;
36
- M(t), k || A(!0), G.current && clearTimeout(G.current), G.current = setTimeout(() => void Q(t), v);
37
+ M(t), k || A(!0), G.current && clearTimeout(G.current), G.current = setTimeout(() => void Q(t), re);
37
38
  }
38
- function ue(e) {
39
- h || g || k || (e.preventDefault(), q.current?.focus(), B(-1), M(""), I([]), R(!1), A(!0), Q(""));
39
+ function fe(e) {
40
+ g || _ || k || (e.preventDefault(), q.current?.focus(), B(-1), M(""), I([]), R(!1), A(!0), Q(""));
40
41
  }
41
42
  function $(e, t) {
42
43
  let n = X.includes(e) ? X.filter((t) => t !== e) : [...X, e];
43
- t && W((e) => e.some((e) => e.value === t.value) ? e : [...e, t]), d === void 0 && H(n), p?.(n);
44
+ t && W((e) => e.some((e) => e.value === t.value) ? e : [...e, t]), p === void 0 && H(n), ne?.(n);
44
45
  }
45
- function de(e) {
46
+ function pe(e) {
46
47
  if (e.key === "ArrowDown") e.preventDefault(), k ? B((e) => Math.min(e + 1, F.length - 1)) : (A(!0), Q(j));
47
48
  else if (e.key === "ArrowUp") e.preventDefault(), B((e) => Math.max(e - 1, -1));
48
49
  else if (e.key === "Enter" && z >= 0 && F[z]) e.preventDefault(), $(F[z].value, F[z]), q.current?.focus();
@@ -53,7 +54,7 @@ var d = r(function({ onSearch: r, value: d, defaultValue: f = [], onValueChange:
53
54
  $(e);
54
55
  }
55
56
  }
56
- function fe(e, t) {
57
+ function me(e, t) {
57
58
  if (!e) {
58
59
  if (t.reason === "outside-press") {
59
60
  let e = t.event?.target;
@@ -62,61 +63,61 @@ var d = r(function({ onSearch: r, value: d, defaultValue: f = [], onValueChange:
62
63
  A(!1), M(""), B(-1);
63
64
  }
64
65
  }
65
- let pe = [
66
+ let he = [
66
67
  "async-multi-select",
67
- _ === "md" ? "" : `async-multi-select--${_}`,
68
- h ? "async-multi-select--disabled" : "",
68
+ v === "md" ? "" : `async-multi-select--${v}`,
69
+ g ? "async-multi-select--disabled" : "",
69
70
  k ? "async-multi-select--open" : "",
70
71
  b ? "async-multi-select--error" : "",
71
- x ?? ""
72
- ].filter(Boolean).join(" "), me = ["async-multi-select__content", _ === "md" ? "" : `async-multi-select__content--${_}`].filter(Boolean).join(" ");
73
- return /* @__PURE__ */ c(l.Root, {
72
+ ae ?? ""
73
+ ].filter(Boolean).join(" "), ge = ["async-multi-select__content", v === "md" ? "" : `async-multi-select__content--${v}`].filter(Boolean).join(" ");
74
+ return /* @__PURE__ */ d(f.Root, {
74
75
  open: k,
75
- onOpenChange: fe,
76
- children: [/* @__PURE__ */ c("div", {
76
+ onOpenChange: me,
77
+ children: [/* @__PURE__ */ d("div", {
77
78
  ref: J,
78
- className: pe,
79
+ className: he,
79
80
  "data-popup-open": k || void 0,
80
- children: [/* @__PURE__ */ c("div", {
81
+ children: [/* @__PURE__ */ d("div", {
81
82
  className: "async-multi-select__input-area",
82
83
  children: [
83
- ce.map((e) => /* @__PURE__ */ c("span", {
84
+ ue.map((e) => /* @__PURE__ */ d("span", {
84
85
  className: "async-multi-select__pill",
85
- children: [/* @__PURE__ */ s("span", {
86
+ children: [/* @__PURE__ */ u("span", {
86
87
  className: "async-multi-select__pill-label",
87
88
  children: e.label
88
- }), !h && !g && /* @__PURE__ */ s("button", {
89
+ }), !g && !_ && /* @__PURE__ */ u("button", {
89
90
  type: "button",
90
91
  className: "async-multi-select__pill-remove",
91
- "aria-label": O("remove", w)(e.label),
92
+ "aria-label": D("remove", se)(e.label),
92
93
  tabIndex: -1,
93
94
  onMouseDown: (t) => {
94
95
  t.preventDefault(), $(e.value);
95
96
  },
96
- children: /* @__PURE__ */ s(t, {
97
+ children: /* @__PURE__ */ u(t, {
97
98
  name: "close",
98
99
  size: "xs"
99
100
  })
100
101
  })]
101
102
  }, e.value)),
102
- /* @__PURE__ */ s("input", {
103
+ /* @__PURE__ */ u("input", {
103
104
  ref: (e) => {
104
- q.current = e, u(oe, e);
105
+ q.current = e, ee(E, e);
105
106
  },
106
- id: re,
107
+ id: ie,
107
108
  type: "text",
108
109
  className: "async-multi-select__input",
109
110
  value: j,
110
- onChange: le,
111
- onPointerDown: ue,
112
- onKeyDown: de,
113
- placeholder: X.length === 0 ? O("placeholder", m) : void 0,
114
- disabled: h,
115
- readOnly: g,
116
- "aria-label": S,
117
- "aria-describedby": C,
111
+ onChange: de,
112
+ onPointerDown: fe,
113
+ onKeyDown: pe,
114
+ placeholder: X.length === 0 ? D("placeholder", h) : void 0,
115
+ disabled: g,
116
+ readOnly: _,
117
+ "aria-label": C,
118
+ "aria-describedby": oe,
118
119
  "aria-invalid": b || void 0,
119
- "aria-required": ie || void 0,
120
+ "aria-required": x || void 0,
120
121
  "aria-expanded": k,
121
122
  "aria-haspopup": "listbox",
122
123
  "aria-controls": k ? Y : void 0,
@@ -124,49 +125,49 @@ var d = r(function({ onSearch: r, value: d, defaultValue: f = [], onValueChange:
124
125
  autoComplete: "off",
125
126
  role: "combobox",
126
127
  "aria-autocomplete": "list",
127
- onBlur: ae
128
+ onBlur: S
128
129
  }),
129
- y && X.map((e) => /* @__PURE__ */ s("input", {
130
+ y && X.map((e) => /* @__PURE__ */ u("input", {
130
131
  type: "hidden",
131
132
  name: y,
132
133
  value: e
133
134
  }, e))
134
135
  ]
135
- }), N && /* @__PURE__ */ s(n, {
136
+ }), N && /* @__PURE__ */ u(n, {
136
137
  size: "sm",
137
138
  "aria-hidden": !0
138
139
  })]
139
- }), /* @__PURE__ */ s(l.Portal, {
140
- container: D,
141
- children: /* @__PURE__ */ s(l.Positioner, {
140
+ }), /* @__PURE__ */ u(f.Portal, {
141
+ container: O,
142
+ children: /* @__PURE__ */ u(f.Positioner, {
142
143
  className: "async-multi-select__positioner",
143
144
  anchor: J,
144
145
  align: "start",
145
146
  sideOffset: -1,
146
- children: /* @__PURE__ */ s(l.Popup, {
147
- className: me,
147
+ children: /* @__PURE__ */ u(f.Popup, {
148
+ className: ge,
148
149
  initialFocus: !1,
149
150
  finalFocus: !1,
150
- children: /* @__PURE__ */ c("div", {
151
+ children: /* @__PURE__ */ d("div", {
151
152
  role: "listbox",
152
153
  "aria-multiselectable": "true",
153
- "aria-label": S ?? O("placeholder", m),
154
+ "aria-label": C ?? D("placeholder", h),
154
155
  id: Y,
155
156
  children: [
156
- N && /* @__PURE__ */ s("div", {
157
+ N && /* @__PURE__ */ u("div", {
157
158
  className: "async-multi-select__loading",
158
- children: /* @__PURE__ */ s(n, {
159
+ children: /* @__PURE__ */ u(n, {
159
160
  size: "sm",
160
- label: O("loading", E)
161
+ label: D("loading", w)
161
162
  })
162
163
  }),
163
- !N && L && F.length === 0 && /* @__PURE__ */ s("div", {
164
+ !N && L && F.length === 0 && /* @__PURE__ */ u("div", {
164
165
  className: "async-multi-select__empty",
165
- children: O("empty", T)
166
+ children: D("empty", ce)
166
167
  }),
167
168
  !N && F.map((e, t) => {
168
169
  let n = X.includes(e.value), r = z === t;
169
- return /* @__PURE__ */ c("div", {
170
+ return /* @__PURE__ */ d("div", {
170
171
  id: Z(t),
171
172
  role: "option",
172
173
  "aria-selected": n,
@@ -179,11 +180,11 @@ var d = r(function({ onSearch: r, value: d, defaultValue: f = [], onValueChange:
179
180
  onClick: () => {
180
181
  $(e.value, e), q.current?.focus();
181
182
  },
182
- children: [/* @__PURE__ */ s("span", {
183
+ children: [/* @__PURE__ */ u("span", {
183
184
  className: "async-multi-select__item-check",
184
185
  "aria-hidden": "true",
185
- children: /* @__PURE__ */ s("span", { className: "async-multi-select__item-check-mark" })
186
- }), /* @__PURE__ */ s("span", { children: e.label })]
186
+ children: /* @__PURE__ */ u("span", { className: "async-multi-select__item-check-mark" })
187
+ }), /* @__PURE__ */ u("span", { children: e.label })]
187
188
  }, e.value);
188
189
  })
189
190
  ]
@@ -194,4 +195,4 @@ var d = r(function({ onSearch: r, value: d, defaultValue: f = [], onValueChange:
194
195
  });
195
196
  });
196
197
  //#endregion
197
- export { d as AsyncMultiSelect };
198
+ export { p as AsyncMultiSelect };
@@ -3,19 +3,20 @@ import './async-select.css';
3
3
  import { n as e } from "./_shared/brandmessagescontext.js";
4
4
  import { Icon as t } from "./icon.js";
5
5
  import { Spinner as n } from "./spinner.js";
6
- import { forwardRef as r, useCallback as i, useEffect as a, useId as o, useRef as s, useState as c } from "react";
6
+ import { n as r } from "./_shared/portal-container.js";
7
+ import { forwardRef as i, useCallback as ee, useEffect as a, useId as o, useRef as s, useState as c } from "react";
7
8
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
9
  import { Popover as d } from "@base-ui/react/popover";
9
10
  //#region src/stories/atoms/AsyncSelect/AsyncSelect.tsx
10
- function ee(e, t) {
11
+ function f(e, t) {
11
12
  typeof e == "function" ? e(t) : e && (e.current = t);
12
13
  }
13
- var f = r(function({ onSearch: r, value: f, onValueChange: p, selectedOption: m, placeholder: h, disabled: g, readOnly: _, size: v = "md", debounceMs: y = 300, id: b, name: x, error: S = !1, required: te, onBlur: ne, className: C, "aria-label": w, "aria-describedby": T, emptyMessage: re, loadingLabel: ie, clearLabel: ae, container: E }, D) {
14
- let O = e("asyncSelect"), [k, A] = c(!1), [j, M] = c(""), [N, P] = c(!1), [F, I] = c([]), [oe, L] = c(!1), [R, z] = c(-1), [B, V] = c(null), [H, U] = c(null), W = s(null), G = s(0), K = s(null), q = s(null), J = o(), se = o(), Y = f === void 0 ? B : f, ce = m === void 0 ? H : m, X = (e) => `${se}-opt-${e}`, Z = i(async (e) => {
14
+ var p = i(function({ onSearch: i, value: p, onValueChange: m, selectedOption: h, placeholder: g, disabled: _, readOnly: v, size: y = "md", debounceMs: b = 300, id: x, name: S, error: C = !1, required: te, onBlur: ne, className: w, "aria-label": T, "aria-describedby": re, emptyMessage: E, loadingLabel: D, clearLabel: ie, container: ae }, oe) {
15
+ let O = e("asyncSelect"), se = r(ae), [k, A] = c(!1), [j, M] = c(""), [N, P] = c(!1), [F, I] = c([]), [ce, L] = c(!1), [R, z] = c(-1), [B, V] = c(null), [H, U] = c(null), W = s(null), G = s(0), K = s(null), q = s(null), J = o(), le = o(), Y = p === void 0 ? B : p, ue = h === void 0 ? H : h, X = (e) => `${le}-opt-${e}`, Z = ee(async (e) => {
15
16
  let t = ++G.current;
16
17
  P(!0), L(!1);
17
18
  try {
18
- let n = await r(e);
19
+ let n = await i(e);
19
20
  if (t !== G.current) return;
20
21
  I(n), z(-1);
21
22
  } catch {
@@ -24,30 +25,30 @@ var f = r(function({ onSearch: r, value: f, onValueChange: p, selectedOption: m,
24
25
  } finally {
25
26
  t === G.current && (P(!1), L(!0));
26
27
  }
27
- }, [r]);
28
+ }, [i]);
28
29
  a(() => () => {
29
30
  G.current += 1, W.current && clearTimeout(W.current);
30
31
  }, []);
31
- function le(e) {
32
+ function de(e) {
32
33
  let t = e.target.value;
33
- M(t), W.current && clearTimeout(W.current), W.current = setTimeout(() => void Z(t), y);
34
+ M(t), W.current && clearTimeout(W.current), W.current = setTimeout(() => void Z(t), b);
34
35
  }
35
- function ue(e) {
36
- g || _ || k || (e.preventDefault(), K.current?.focus(), z(-1), M(""), I([]), L(!1), A(!0), Z(""));
36
+ function fe(e) {
37
+ _ || v || k || (e.preventDefault(), K.current?.focus(), z(-1), M(""), I([]), L(!1), A(!0), Z(""));
37
38
  }
38
39
  function Q(e) {
39
- f === void 0 && (V(e.value), U(e)), p?.(e.value, e), A(!1), z(-1), M("");
40
+ p === void 0 && (V(e.value), U(e)), m?.(e.value, e), A(!1), z(-1), M("");
40
41
  }
41
42
  function $() {
42
- f === void 0 && (V(null), U(null)), p?.(null, null), M(""), I([]), L(!1), K.current?.focus();
43
+ p === void 0 && (V(null), U(null)), m?.(null, null), M(""), I([]), L(!1), K.current?.focus();
43
44
  }
44
- function de(e) {
45
+ function pe(e) {
45
46
  e.stopPropagation(), $();
46
47
  }
47
- function fe(e) {
48
- e.key === "ArrowDown" ? (e.preventDefault(), k ? z((e) => Math.min(e + 1, F.length - 1)) : (A(!0), Z(j))) : e.key === "ArrowUp" ? (e.preventDefault(), z((e) => Math.max(e - 1, -1))) : e.key === "Enter" && R >= 0 && F[R] ? (e.preventDefault(), Q(F[R])) : e.key === "Escape" ? (A(!1), M(""), z(-1)) : e.key === "Tab" ? (A(!1), z(-1)) : (e.key === "Backspace" || e.key === "Delete") && j === "" && Y && !g && !_ ? (e.preventDefault(), $()) : !k && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), M(e.key), A(!0), I([]), L(!1), W.current && clearTimeout(W.current), W.current = setTimeout(() => void Z(e.key), y));
48
+ function me(e) {
49
+ e.key === "ArrowDown" ? (e.preventDefault(), k ? z((e) => Math.min(e + 1, F.length - 1)) : (A(!0), Z(j))) : e.key === "ArrowUp" ? (e.preventDefault(), z((e) => Math.max(e - 1, -1))) : e.key === "Enter" && R >= 0 && F[R] ? (e.preventDefault(), Q(F[R])) : e.key === "Escape" ? (A(!1), M(""), z(-1)) : e.key === "Tab" ? (A(!1), z(-1)) : (e.key === "Backspace" || e.key === "Delete") && j === "" && Y && !_ && !v ? (e.preventDefault(), $()) : !k && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), M(e.key), A(!0), I([]), L(!1), W.current && clearTimeout(W.current), W.current = setTimeout(() => void Z(e.key), b));
49
50
  }
50
- function pe(e, t) {
51
+ function he(e, t) {
51
52
  if (!e) {
52
53
  if (t.reason === "outside-press") {
53
54
  let e = t.event?.target;
@@ -56,38 +57,38 @@ var f = r(function({ onSearch: r, value: f, onValueChange: p, selectedOption: m,
56
57
  A(!1), M(""), z(-1);
57
58
  }
58
59
  }
59
- let me = k ? j : ce?.label ?? "", he = [
60
+ let ge = k ? j : ue?.label ?? "", _e = [
60
61
  "async-select",
61
- v === "md" ? "" : `async-select--${v}`,
62
- g ? "async-select--disabled" : "",
63
- S ? "async-select--error" : "",
64
- C ?? ""
65
- ].filter(Boolean).join(" "), ge = ["async-select__content", v === "md" ? "" : `async-select__content--${v}`].filter(Boolean).join(" ");
62
+ y === "md" ? "" : `async-select--${y}`,
63
+ _ ? "async-select--disabled" : "",
64
+ C ? "async-select--error" : "",
65
+ w ?? ""
66
+ ].filter(Boolean).join(" "), ve = ["async-select__content", y === "md" ? "" : `async-select__content--${y}`].filter(Boolean).join(" ");
66
67
  return /* @__PURE__ */ u(d.Root, {
67
68
  open: k,
68
- onOpenChange: pe,
69
+ onOpenChange: he,
69
70
  children: [/* @__PURE__ */ u("div", {
70
71
  ref: q,
71
- className: he,
72
+ className: _e,
72
73
  "data-popup-open": k || void 0,
73
74
  children: [
74
75
  /* @__PURE__ */ l("input", {
75
76
  ref: (e) => {
76
- K.current = e, ee(D, e);
77
+ K.current = e, f(oe, e);
77
78
  },
78
- id: b,
79
+ id: x,
79
80
  type: "text",
80
81
  className: "async-select__input",
81
- value: me,
82
- onChange: le,
83
- onPointerDown: ue,
84
- onKeyDown: fe,
85
- placeholder: O("placeholder", h),
86
- disabled: g,
87
- readOnly: _,
88
- "aria-label": w,
89
- "aria-describedby": T,
90
- "aria-invalid": S || void 0,
82
+ value: ge,
83
+ onChange: de,
84
+ onPointerDown: fe,
85
+ onKeyDown: me,
86
+ placeholder: O("placeholder", g),
87
+ disabled: _,
88
+ readOnly: v,
89
+ "aria-label": T,
90
+ "aria-describedby": re,
91
+ "aria-invalid": C || void 0,
91
92
  "aria-required": te || void 0,
92
93
  "aria-expanded": k,
93
94
  "aria-haspopup": "listbox",
@@ -98,21 +99,21 @@ var f = r(function({ onSearch: r, value: f, onValueChange: p, selectedOption: m,
98
99
  "aria-autocomplete": "list",
99
100
  onBlur: ne
100
101
  }),
101
- x && /* @__PURE__ */ l("input", {
102
+ S && /* @__PURE__ */ l("input", {
102
103
  type: "hidden",
103
- name: x,
104
+ name: S,
104
105
  value: Y ?? ""
105
106
  }),
106
107
  N && /* @__PURE__ */ l(n, {
107
108
  size: "sm",
108
109
  "aria-hidden": !0
109
110
  }),
110
- !N && Y && !g && !_ && /* @__PURE__ */ l("button", {
111
+ !N && Y && !_ && !v && /* @__PURE__ */ l("button", {
111
112
  type: "button",
112
113
  className: "async-select__clear",
113
- "aria-label": O("clear", ae),
114
+ "aria-label": O("clear", ie),
114
115
  tabIndex: -1,
115
- onMouseDown: de,
116
+ onMouseDown: pe,
116
117
  children: /* @__PURE__ */ l(t, {
117
118
  name: "close",
118
119
  size: "xs"
@@ -120,31 +121,31 @@ var f = r(function({ onSearch: r, value: f, onValueChange: p, selectedOption: m,
120
121
  })
121
122
  ]
122
123
  }), /* @__PURE__ */ l(d.Portal, {
123
- container: E,
124
+ container: se,
124
125
  children: /* @__PURE__ */ l(d.Positioner, {
125
126
  className: "async-select__positioner",
126
127
  anchor: q,
127
128
  align: "start",
128
129
  sideOffset: -1,
129
130
  children: /* @__PURE__ */ l(d.Popup, {
130
- className: ge,
131
+ className: ve,
131
132
  initialFocus: !1,
132
133
  finalFocus: !1,
133
134
  children: /* @__PURE__ */ u("div", {
134
135
  role: "listbox",
135
- "aria-label": w ?? O("placeholder", h),
136
+ "aria-label": T ?? O("placeholder", g),
136
137
  id: J,
137
138
  children: [
138
139
  N && /* @__PURE__ */ l("div", {
139
140
  className: "async-select__loading",
140
141
  children: /* @__PURE__ */ l(n, {
141
142
  size: "sm",
142
- label: O("loading", ie)
143
+ label: O("loading", D)
143
144
  })
144
145
  }),
145
- !N && oe && F.length === 0 && /* @__PURE__ */ l("div", {
146
+ !N && ce && F.length === 0 && /* @__PURE__ */ l("div", {
146
147
  className: "async-select__empty",
147
- children: O("empty", re)
148
+ children: O("empty", E)
148
149
  }),
149
150
  !N && F.map((e, t) => {
150
151
  let n = e.value === Y, r = R === t;
@@ -170,4 +171,4 @@ var f = r(function({ onSearch: r, value: f, onValueChange: p, selectedOption: m,
170
171
  });
171
172
  });
172
173
  //#endregion
173
- export { f as AsyncSelect };
174
+ export { p as AsyncSelect };
@@ -1,39 +1,42 @@
1
+ 'use client';
1
2
  import './breadcrumb.css';
2
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
5
  //#region src/stories/molecules/Breadcrumb/Breadcrumb.tsx
4
- function n({ children: t, ...n }) {
5
- return /* @__PURE__ */ e("a", {
6
+ function r({ children: e, ...n }) {
7
+ return /* @__PURE__ */ t("a", {
6
8
  ...n,
7
- children: t
9
+ children: e
8
10
  });
9
11
  }
10
- function r({ items: r, renderLink: i = n, separator: a = "/", ariaLabel: o = "Migas de pan", className: s }) {
11
- return /* @__PURE__ */ e("nav", {
12
- "aria-label": o,
13
- className: ["breadcrumb", s].filter(Boolean).join(" "),
14
- children: /* @__PURE__ */ e("ol", {
12
+ function i({ items: i, renderLink: a = r, separator: o = "/", ariaLabel: s, className: c }) {
13
+ let l = e("breadcrumb");
14
+ return /* @__PURE__ */ t("nav", {
15
+ "aria-label": l("label", s),
16
+ className: ["breadcrumb", c].filter(Boolean).join(" "),
17
+ children: /* @__PURE__ */ t("ol", {
15
18
  className: "breadcrumb__list",
16
- children: r.map((n, o) => {
17
- let s = o === r.length - 1;
18
- return /* @__PURE__ */ t("li", {
19
+ children: i.map((e, r) => {
20
+ let s = r === i.length - 1;
21
+ return /* @__PURE__ */ n("li", {
19
22
  className: ["breadcrumb__item", s ? "breadcrumb__item--current" : ""].filter(Boolean).join(" "),
20
- children: [s || !n.href ? /* @__PURE__ */ e("span", {
23
+ children: [s || !e.href ? /* @__PURE__ */ t("span", {
21
24
  className: s ? "breadcrumb__current" : "breadcrumb__static",
22
25
  ...s ? { "aria-current": "page" } : {},
23
- children: n.label
24
- }) : i({
25
- href: n.href,
26
- children: n.label,
26
+ children: e.label
27
+ }) : a({
28
+ href: e.href,
29
+ children: e.label,
27
30
  className: "breadcrumb__link"
28
- }), !s && /* @__PURE__ */ e("span", {
31
+ }), !s && /* @__PURE__ */ t("span", {
29
32
  className: "breadcrumb__separator",
30
33
  "aria-hidden": "true",
31
- children: a
34
+ children: o
32
35
  })]
33
- }, `${n.label}-${o}`);
36
+ }, `${e.label}-${r}`);
34
37
  })
35
38
  })
36
39
  });
37
40
  }
38
41
  //#endregion
39
- export { r as Breadcrumb };
42
+ export { i as Breadcrumb };
@@ -1,62 +1,64 @@
1
1
  'use client';
2
2
  import './command-palette.css';
3
- import { Modal as e } from "./modal.js";
4
- import { useCallback as t, useEffect as n } from "react";
5
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
- import { Autocomplete as a } from "@base-ui/react/autocomplete";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Modal as t } from "./modal.js";
5
+ import { useCallback as n, useEffect as r } from "react";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ import { Autocomplete as o } from "@base-ui/react/autocomplete";
7
8
  //#region src/stories/molecules/CommandPalette/CommandPalette.tsx
8
- function o({ open: o, onOpenChange: s, groups: c, title: l, placeholder: u, emptyLabel: d, listLabel: f, closeLabel: p, shortcut: m = "k", locale: h, className: g }) {
9
- n(() => {
10
- if (m === !1) return;
9
+ function s({ open: s, onOpenChange: c, groups: l, title: u, placeholder: d, emptyLabel: f, listLabel: p, closeLabel: m, shortcut: h = "k", locale: g, className: _ }) {
10
+ let v = e("commandPalette");
11
+ r(() => {
12
+ if (h === !1) return;
11
13
  let e = (e) => {
12
- typeof e.key == "string" && e.key.toLowerCase() === m && (e.metaKey || e.ctrlKey) && (e.preventDefault(), s(!o));
14
+ typeof e.key == "string" && e.key.toLowerCase() === h && (e.metaKey || e.ctrlKey) && (e.preventDefault(), c(!s));
13
15
  };
14
16
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
15
17
  }, [
16
- m,
17
- o,
18
- s
18
+ h,
19
+ s,
20
+ c
19
21
  ]);
20
- let _ = a.useFilter({
22
+ let y = o.useFilter({
21
23
  sensitivity: "base",
22
- locale: h
23
- }), v = t((e, t) => _.contains(e.label, t) || (e.keywords ?? []).some((e) => _.contains(e, t)), [_]);
24
- return /* @__PURE__ */ r(e, {
25
- open: o,
26
- onClose: () => s(!1),
27
- title: l,
28
- ...p ? { closeLabel: p } : {},
29
- children: /* @__PURE__ */ r(a.Root, {
24
+ locale: g
25
+ }), b = n((e, t) => y.contains(e.label, t) || (e.keywords ?? []).some((e) => y.contains(e, t)), [y]);
26
+ return /* @__PURE__ */ i(t, {
27
+ open: s,
28
+ onClose: () => c(!1),
29
+ title: v("title", u),
30
+ ...m ? { closeLabel: m } : {},
31
+ children: /* @__PURE__ */ i(o.Root, {
30
32
  inline: !0,
31
33
  open: !0,
32
- items: c,
33
- filter: v,
34
+ items: l,
35
+ filter: b,
34
36
  autoHighlight: "always",
35
- children: /* @__PURE__ */ i("div", {
36
- className: ["command-palette", g].filter(Boolean).join(" "),
37
+ children: /* @__PURE__ */ a("div", {
38
+ className: ["command-palette", _].filter(Boolean).join(" "),
37
39
  children: [
38
- /* @__PURE__ */ r(a.Input, {
40
+ /* @__PURE__ */ i(o.Input, {
39
41
  className: "command-palette__input",
40
- placeholder: u,
42
+ placeholder: v("placeholder", d),
41
43
  autoFocus: !0
42
44
  }),
43
- /* @__PURE__ */ r(a.List, {
45
+ /* @__PURE__ */ i(o.List, {
44
46
  className: "command-palette__list",
45
- "aria-label": f,
46
- children: (e) => /* @__PURE__ */ i(a.Group, {
47
+ "aria-label": v("list", p),
48
+ children: (e) => /* @__PURE__ */ a(o.Group, {
47
49
  items: e.items,
48
50
  className: "command-palette__group",
49
- children: [/* @__PURE__ */ r(a.GroupLabel, {
51
+ children: [/* @__PURE__ */ i(o.GroupLabel, {
50
52
  className: "command-palette__heading",
51
53
  children: e.heading
52
- }), /* @__PURE__ */ r(a.Collection, { children: (e) => /* @__PURE__ */ i(a.Item, {
54
+ }), /* @__PURE__ */ i(o.Collection, { children: (e) => /* @__PURE__ */ a(o.Item, {
53
55
  value: e,
54
56
  disabled: e.disabled,
55
57
  className: "command-palette__item",
56
58
  onClick: () => {
57
- s(!1), e.onSelect();
59
+ c(!1), e.onSelect();
58
60
  },
59
- children: [e.icon && /* @__PURE__ */ r("span", {
61
+ children: [e.icon && /* @__PURE__ */ i("span", {
60
62
  className: "command-palette__item-icon",
61
63
  "aria-hidden": "true",
62
64
  children: e.icon
@@ -64,9 +66,9 @@ function o({ open: o, onOpenChange: s, groups: c, title: l, placeholder: u, empt
64
66
  }, e.id) })]
65
67
  }, e.id)
66
68
  }),
67
- /* @__PURE__ */ r(a.Empty, {
69
+ /* @__PURE__ */ i(o.Empty, {
68
70
  className: "command-palette__empty",
69
- children: d
71
+ children: v("empty", f)
70
72
  })
71
73
  ]
72
74
  })
@@ -74,4 +76,4 @@ function o({ open: o, onOpenChange: s, groups: c, title: l, placeholder: u, empt
74
76
  });
75
77
  }
76
78
  //#endregion
77
- export { o as CommandPalette };
79
+ export { s as CommandPalette };