@studiolxd/brand 46.0.0 → 47.1.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 (70) hide show
  1. package/CHANGELOG.md +176 -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 +29 -1
  13. package/dist/_types/messages/index.d.ts +1 -1
  14. package/dist/_types/molecules/Breadcrumb/Breadcrumb.d.ts +10 -2
  15. package/dist/_types/molecules/EmptyState/EmptyState.d.ts +2 -0
  16. package/dist/_types/molecules/Menu/Menu.d.ts +8 -1
  17. package/dist/_types/molecules/Modal/Modal.d.ts +8 -6
  18. package/dist/_types/molecules/OrgSwitcher/OrgSwitcher.d.ts +15 -1
  19. package/dist/_types/molecules/PageIntro/PageIntro.d.ts +12 -7
  20. package/dist/_types/molecules/PrevNextNav/PrevNextNav.d.ts +17 -2
  21. package/dist/_types/molecules/Sheet/Sheet.d.ts +8 -7
  22. package/dist/_types/molecules/SidebarNav/SidebarNav.d.ts +18 -3
  23. package/dist/_types/molecules/SiteNav/SiteNav.d.ts +9 -0
  24. package/dist/_types/molecules/TableOfContents/TableOfContents.d.ts +11 -2
  25. package/dist/_types/molecules/UserMenu/UserMenu.d.ts +16 -1
  26. package/dist/_types/sections/AppHeader/AppHeader.d.ts +8 -2
  27. package/dist/_types/sections/AppRoot/AppRoot.d.ts +12 -1
  28. package/dist/_types/sections/AppShell/AppShell.d.ts +14 -1
  29. package/dist/_types/sections/Hero/Hero.d.ts +4 -1
  30. package/dist/_types/sections/Sidebar/Sidebar.d.ts +27 -3
  31. package/dist/_types/sections/SiteHeader/SiteHeader.d.ts +22 -3
  32. package/dist/_types/sections/SiteShell/SiteShell.d.ts +11 -5
  33. package/dist/_types/templates/OnboardingShell/OnboardingShell.d.ts +19 -2
  34. package/dist/_types/templates/PublicPageShell/PublicPageShell.d.ts +42 -6
  35. package/dist/app-header.js +1 -1
  36. package/dist/app-launcher.js +62 -58
  37. package/dist/app-root.js +10 -8
  38. package/dist/app-shell.js +51 -50
  39. package/dist/async-multi-select.js +65 -64
  40. package/dist/async-select.js +49 -48
  41. package/dist/brand.css +12 -2
  42. package/dist/breadcrumb.js +24 -21
  43. package/dist/input-phone.js +38 -37
  44. package/dist/link.css +1 -1
  45. package/dist/menu-button.js +16 -14
  46. package/dist/menu.js +44 -40
  47. package/dist/modal.js +32 -31
  48. package/dist/multi-select.js +106 -105
  49. package/dist/onboarding-shell.js +36 -35
  50. package/dist/org-switcher.js +64 -59
  51. package/dist/page-intro.css +1 -1
  52. package/dist/page-intro.js +23 -17
  53. package/dist/popover.js +27 -22
  54. package/dist/prev-next-nav.js +38 -36
  55. package/dist/public-page-shell.js +24 -20
  56. package/dist/select.js +70 -69
  57. package/dist/sheet.js +30 -29
  58. package/dist/sidebar-nav.js +91 -90
  59. package/dist/sidebar.js +72 -71
  60. package/dist/site-header.js +44 -43
  61. package/dist/site-nav.js +27 -25
  62. package/dist/site-shell.js +23 -15
  63. package/dist/table-of-contents.js +30 -27
  64. package/dist/toaster.js +57 -53
  65. package/dist/tokens.css +2 -2
  66. package/dist/tooltip.js +45 -41
  67. package/dist/user-menu.js +58 -52
  68. package/package.json +1 -1
  69. package/src/tokens/molecules/page-intro.css +1 -1
  70. package/src/tokens/scss/molecules/_page-intro.scss +1 -1
@@ -2,124 +2,128 @@
2
2
  import './app-launcher.css';
3
3
  import { n as e } from "./_shared/brandmessagescontext.js";
4
4
  import { Icon as t } from "./icon.js";
5
- import { Tag as n } from "./tag.js";
6
- import { Modal as r } from "./modal.js";
7
- import { useState as i } from "react";
8
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
9
- import { Popover as c } from "@base-ui/react/popover";
5
+ import { n } from "./_shared/portal-container.js";
6
+ import { Tag as r } from "./tag.js";
7
+ import { Modal as i } from "./modal.js";
8
+ import { useState as a } from "react";
9
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
10
+ import { Popover as l } from "@base-ui/react/popover";
10
11
  //#region src/stories/molecules/AppLauncher/AppLauncher.tsx
11
- function l({ app: t, isCurrent: r, newLabel: i }) {
12
+ function u({ app: t, isCurrent: n, newLabel: i }) {
12
13
  let a = e("appLauncher");
13
- return /* @__PURE__ */ s("a", {
14
+ return /* @__PURE__ */ c("a", {
14
15
  href: t.url,
15
- className: `app-launcher__tile${r ? " app-launcher__tile--active" : ""}`,
16
- "aria-current": r ? "page" : void 0,
17
- children: [/* @__PURE__ */ o("span", {
16
+ className: `app-launcher__tile${n ? " app-launcher__tile--active" : ""}`,
17
+ "aria-current": n ? "page" : void 0,
18
+ children: [/* @__PURE__ */ s("span", {
18
19
  className: "app-launcher__tile-name",
19
20
  children: t.name
20
- }), t.isNew && /* @__PURE__ */ o(n, {
21
+ }), t.isNew && /* @__PURE__ */ s(r, {
21
22
  variant: "info",
22
23
  className: "app-launcher__tile-badge",
23
24
  children: a("new", i)
24
25
  })]
25
26
  });
26
27
  }
27
- function u({ apps: e, currentAppId: t, newLabel: n }) {
28
- return /* @__PURE__ */ o("ul", {
28
+ function d({ apps: e, currentAppId: t, newLabel: n }) {
29
+ return /* @__PURE__ */ s("ul", {
29
30
  className: "app-launcher__grid",
30
31
  role: "list",
31
- children: e.map((e) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(l, {
32
+ children: e.map((e) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(u, {
32
33
  app: e,
33
34
  isCurrent: e.id === t,
34
35
  newLabel: n
35
36
  }) }, e.id))
36
37
  });
37
38
  }
38
- function d({ apps: n, labels: r, currentAppId: i, open: a, defaultOpen: l, onOpenChange: d }) {
39
- let f = e("appLauncher");
40
- return /* @__PURE__ */ s(c.Root, {
41
- open: a,
42
- defaultOpen: l,
43
- onOpenChange: (e) => d?.(e),
44
- children: [/* @__PURE__ */ o(c.Trigger, { render: r.trigger ? /* @__PURE__ */ s("button", {
39
+ function f({ apps: r, labels: i, currentAppId: a, open: o, defaultOpen: u, onOpenChange: f }) {
40
+ let p = e("appLauncher"), m = n(void 0);
41
+ return /* @__PURE__ */ c(l.Root, {
42
+ open: o,
43
+ defaultOpen: u,
44
+ onOpenChange: (e) => f?.(e),
45
+ children: [/* @__PURE__ */ s(l.Trigger, { render: i.trigger ? /* @__PURE__ */ c("button", {
45
46
  type: "button",
46
47
  className: "app-launcher__trigger app-launcher__trigger--label",
47
- children: [/* @__PURE__ */ o(t, {
48
+ children: [/* @__PURE__ */ s(t, {
48
49
  name: "grid",
49
50
  size: "md"
50
- }), /* @__PURE__ */ o("span", {
51
+ }), /* @__PURE__ */ s("span", {
51
52
  className: "app-launcher__trigger-label",
52
- children: r.trigger
53
+ children: i.trigger
53
54
  })]
54
- }) : /* @__PURE__ */ o("button", {
55
+ }) : /* @__PURE__ */ s("button", {
55
56
  type: "button",
56
57
  className: "app-launcher__trigger",
57
- "aria-label": f("open", r.open),
58
- children: /* @__PURE__ */ o(t, {
58
+ "aria-label": p("open", i.open),
59
+ children: /* @__PURE__ */ s(t, {
59
60
  name: "grid",
60
61
  size: "md"
61
62
  })
62
- }) }), /* @__PURE__ */ o(c.Portal, { children: /* @__PURE__ */ o(c.Positioner, {
63
- className: "app-launcher__positioner",
64
- sideOffset: 4,
65
- align: "end",
66
- children: /* @__PURE__ */ o(c.Popup, {
67
- className: "app-launcher__content",
68
- children: /* @__PURE__ */ o(u, {
69
- apps: n,
70
- currentAppId: i,
71
- newLabel: r.new
63
+ }) }), /* @__PURE__ */ s(l.Portal, {
64
+ container: m,
65
+ children: /* @__PURE__ */ s(l.Positioner, {
66
+ className: "app-launcher__positioner",
67
+ sideOffset: 4,
68
+ align: "end",
69
+ children: /* @__PURE__ */ s(l.Popup, {
70
+ className: "app-launcher__content",
71
+ children: /* @__PURE__ */ s(d, {
72
+ apps: r,
73
+ currentAppId: a,
74
+ newLabel: i.new
75
+ })
72
76
  })
73
77
  })
74
- }) })]
78
+ })]
75
79
  });
76
80
  }
77
- function f(e, t, n) {
78
- let [r, a] = i(t ?? !1);
81
+ function p(e, t, n) {
82
+ let [r, i] = a(t ?? !1);
79
83
  return [e ?? r, (t) => {
80
- e === void 0 && a(t), n?.(t);
84
+ e === void 0 && i(t), n?.(t);
81
85
  }];
82
86
  }
83
- function p({ apps: n, labels: i, currentAppId: c, open: l, defaultOpen: d, onOpenChange: p }) {
84
- let m = e("appLauncher"), [h, g] = f(l, d, p);
85
- return /* @__PURE__ */ s(a, { children: [i.trigger ? /* @__PURE__ */ s("button", {
87
+ function m({ apps: n, labels: r, currentAppId: a, open: l, defaultOpen: u, onOpenChange: f }) {
88
+ let m = e("appLauncher"), [h, g] = p(l, u, f);
89
+ return /* @__PURE__ */ c(o, { children: [r.trigger ? /* @__PURE__ */ c("button", {
86
90
  type: "button",
87
91
  className: "app-launcher__trigger app-launcher__trigger--label",
88
92
  "aria-haspopup": "dialog",
89
93
  onClick: () => g(!0),
90
- children: [/* @__PURE__ */ o(t, {
94
+ children: [/* @__PURE__ */ s(t, {
91
95
  name: "grid",
92
96
  size: "md"
93
- }), /* @__PURE__ */ o("span", {
97
+ }), /* @__PURE__ */ s("span", {
94
98
  className: "app-launcher__trigger-label",
95
- children: i.trigger
99
+ children: r.trigger
96
100
  })]
97
- }) : /* @__PURE__ */ o("button", {
101
+ }) : /* @__PURE__ */ s("button", {
98
102
  type: "button",
99
103
  className: "app-launcher__trigger",
100
- "aria-label": m("open", i.open),
104
+ "aria-label": m("open", r.open),
101
105
  "aria-haspopup": "dialog",
102
106
  onClick: () => g(!0),
103
- children: /* @__PURE__ */ o(t, {
107
+ children: /* @__PURE__ */ s(t, {
104
108
  name: "grid",
105
109
  size: "md"
106
110
  })
107
- }), /* @__PURE__ */ o(r, {
111
+ }), /* @__PURE__ */ s(i, {
108
112
  open: h,
109
113
  onClose: () => g(!1),
110
- title: m("title", i.title),
111
- children: /* @__PURE__ */ o(u, {
114
+ title: m("title", r.title),
115
+ children: /* @__PURE__ */ s(d, {
112
116
  apps: n,
113
- currentAppId: c,
114
- newLabel: i.new
117
+ currentAppId: a,
118
+ newLabel: r.new
115
119
  })
116
120
  })] });
117
121
  }
118
- function m({ presentation: e = "modal", labels: t = {}, ...n }) {
119
- return o(e === "popover" ? d : p, {
122
+ function h({ presentation: e = "modal", labels: t = {}, ...n }) {
123
+ return s(e === "popover" ? f : m, {
120
124
  labels: t,
121
125
  ...n
122
126
  });
123
127
  }
124
128
  //#endregion
125
- export { m as AppLauncher };
129
+ export { h as AppLauncher };
package/dist/app-root.js CHANGED
@@ -1,11 +1,13 @@
1
- import { SkipLink as e } from "./skip-link.js";
2
- import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
1
+ 'use client';
2
+ import { n as e } from "./_shared/brandmessagescontext.js";
3
+ import { SkipLink as t } from "./skip-link.js";
4
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
3
5
  //#region src/stories/sections/AppRoot/AppRoot.tsx
4
- function i({ skipLabel: i = "Saltar al contenido principal", skipHref: a = "#main-content", children: o }) {
5
- return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(e, {
6
- href: a,
7
- children: i
8
- }), o] });
6
+ function a({ skipLabel: a, skipHref: o = "#main-content", children: s }) {
7
+ return /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(t, {
8
+ href: o,
9
+ children: e("appRoot")("skipToContent", a)
10
+ }), s] });
9
11
  }
10
12
  //#endregion
11
- export { i as AppRoot };
13
+ export { a as AppRoot };
package/dist/app-shell.js CHANGED
@@ -1,78 +1,79 @@
1
1
  'use client';
2
2
  import './app-shell.css';
3
- import { SkipLink as e } from "./skip-link.js";
4
- import { TooltipProvider as t } from "./tooltip.js";
5
- import { t as n } from "./_shared/css-properties.js";
6
- import { n as r, t as i } from "./_shared/appshellcontext.js";
7
- import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
8
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { SkipLink as t } from "./skip-link.js";
5
+ import { TooltipProvider as n } from "./tooltip.js";
6
+ import { t as r } from "./_shared/css-properties.js";
7
+ import { n as i, t as a } from "./_shared/appshellcontext.js";
8
+ import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
9
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
10
  //#region src/stories/sections/AppShell/AppShell.tsx
10
- var d = "(min-width: 1024px)";
11
- function f() {
12
- let [e, t] = c(() => typeof window > "u" ? !0 : window.matchMedia(d).matches);
13
- return o(() => {
14
- let e = window.matchMedia(d), n = () => t(e.matches);
11
+ var f = "(min-width: 1024px)";
12
+ function p() {
13
+ let [e, t] = l(() => typeof window > "u" ? !0 : window.matchMedia(f).matches);
14
+ return s(() => {
15
+ let e = window.matchMedia(f), n = () => t(e.matches);
15
16
  return n(), e.addEventListener("change", n), () => e.removeEventListener("change", n);
16
17
  }, []), e;
17
18
  }
18
- function p({ header: r, sidebar: d, children: p, defaultSidebar: m = "open", sidebarState: h, onSidebarChange: g, defaultSidebarWidth: _, onSidebarWidthChange: v, skipLabel: y = "Saltar al contenido principal" }) {
19
- let b = f(), [x, S] = c(m), [C, w] = c(!1), [T, E] = c(_), D = b ? h ?? x : C ? "open" : "closed", O = a((e) => {
20
- b ? (S(e), g?.(e)) : w(e === "open");
21
- }, [b, g]), k = a(() => O(D === "open" ? "closed" : "open"), [O, D]), A = a(() => O("closed"), [O]), j = a((e) => {
22
- E(e), v?.(e);
23
- }, [v]);
24
- o(() => {
25
- if (b || !C) return;
19
+ function m({ header: i, sidebar: f, children: m, defaultSidebar: h = "open", sidebarState: g, onSidebarChange: _, defaultSidebarWidth: v, onSidebarWidthChange: y, skipLabel: b }) {
20
+ let x = e("appShell"), S = p(), [C, w] = l(h), [T, E] = l(!1), [D, O] = l(v), k = S ? g ?? C : T ? "open" : "closed", A = o((e) => {
21
+ S ? (w(e), _?.(e)) : E(e === "open");
22
+ }, [S, _]), j = o(() => A(k === "open" ? "closed" : "open"), [A, k]), M = o(() => A("closed"), [A]), N = o((e) => {
23
+ O(e), y?.(e);
24
+ }, [y]);
25
+ s(() => {
26
+ if (S || !T) return;
26
27
  let e = (e) => {
27
- e.key === "Escape" && w(!1);
28
+ e.key === "Escape" && E(!1);
28
29
  };
29
30
  document.addEventListener("keydown", e);
30
31
  let t = document.body.style.overflow;
31
32
  return document.body.style.overflow = "hidden", () => {
32
33
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
33
34
  };
34
- }, [b, C]);
35
- let M = s(() => ({
36
- sidebar: D,
37
- setSidebar: O,
38
- sidebarWidth: T ?? 0,
39
- setSidebarWidth: j,
40
- toggleSidebar: k,
41
- closeSidebar: A,
42
- isDesktop: b
35
+ }, [S, T]);
36
+ let P = c(() => ({
37
+ sidebar: k,
38
+ setSidebar: A,
39
+ sidebarWidth: D ?? 0,
40
+ setSidebarWidth: N,
41
+ toggleSidebar: j,
42
+ closeSidebar: M,
43
+ isDesktop: S
43
44
  }), [
44
- D,
45
- O,
46
- T,
47
- j,
48
45
  k,
49
46
  A,
50
- b
51
- ]), N = n({ "--app-shell-sidebar-width": T ? `${T}px` : void 0 }), P = !b && C;
52
- return /* @__PURE__ */ l(i.Provider, {
53
- value: M,
54
- children: /* @__PURE__ */ u(t, { children: [/* @__PURE__ */ l(e, {
47
+ D,
48
+ N,
49
+ j,
50
+ M,
51
+ S
52
+ ]), F = r({ "--app-shell-sidebar-width": D ? `${D}px` : void 0 }), I = !S && T;
53
+ return /* @__PURE__ */ u(a.Provider, {
54
+ value: P,
55
+ children: /* @__PURE__ */ d(n, { children: [/* @__PURE__ */ u(t, {
55
56
  href: "#main-content",
56
- children: y
57
- }), /* @__PURE__ */ u("div", {
58
- ref: N,
57
+ children: x("skipToContent", b)
58
+ }), /* @__PURE__ */ d("div", {
59
+ ref: F,
59
60
  className: "app-shell",
60
- "data-sidebar": D,
61
- children: [r, /* @__PURE__ */ u("div", {
61
+ "data-sidebar": k,
62
+ children: [i, /* @__PURE__ */ d("div", {
62
63
  className: "app-shell__body",
63
64
  children: [
64
- d,
65
- P && /* @__PURE__ */ l("div", {
65
+ f,
66
+ I && /* @__PURE__ */ u("div", {
66
67
  className: "app-shell__backdrop",
67
- onClick: A,
68
+ onClick: M,
68
69
  "aria-hidden": "true"
69
70
  }),
70
- /* @__PURE__ */ l("main", {
71
+ /* @__PURE__ */ u("main", {
71
72
  id: "main-content",
72
73
  tabIndex: -1,
73
74
  className: "app-shell__content",
74
- inert: P || void 0,
75
- children: p
75
+ inert: I || void 0,
76
+ children: m
76
77
  })
77
78
  ]
78
79
  })]
@@ -80,4 +81,4 @@ function p({ header: r, sidebar: d, children: p, defaultSidebar: m = "open", sid
80
81
  });
81
82
  }
82
83
  //#endregion
83
- export { p as AppShell, r as useAppShell };
84
+ export { m as AppShell, i as useAppShell };
@@ -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 };