@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
@@ -1,139 +1,140 @@
1
1
  'use client';
2
2
  import './notification-panel.css';
3
- import { Icon as e } from "./icon.js";
4
- import { VisuallyHidden as t } from "./visually-hidden.js";
5
- import { Button as n } from "./button.js";
6
- import { Heading as r } from "./heading.js";
7
- import { Paragraph as i } from "./paragraph.js";
8
- import { Popover as a } from "./popover.js";
9
- import { Text as o } from "./text.js";
10
- import { NotificationButton as s } from "./notification-button.js";
11
- import { useCallback as c, useId as l, useRef as u, useState as d } from "react";
12
- import { Fragment as f, jsx as p, jsxs as m } 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 { Button as r } from "./button.js";
7
+ import { Heading as i } from "./heading.js";
8
+ import { Paragraph as a } from "./paragraph.js";
9
+ import { Popover as o } from "./popover.js";
10
+ import { Text as s } from "./text.js";
11
+ import { NotificationButton as c } from "./notification-button.js";
12
+ import { useCallback as l, useId as u, useRef as d, useState as f } from "react";
13
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
13
14
  //#region src/stories/molecules/NotificationPanel/NotificationPanel.tsx
14
- function h(e) {
15
+ function g(e) {
15
16
  let t = parseFloat(e);
16
17
  return Number.isNaN(t) ? 0 : e.endsWith("rem") ? t * parseFloat(getComputedStyle(document.documentElement).fontSize) : t;
17
18
  }
18
- function g() {
19
+ function _() {
19
20
  let e = document.documentElement;
20
- return h(getComputedStyle(e).getPropertyValue("--notification-panel-offset").trim());
21
+ return g(getComputedStyle(e).getPropertyValue("--notification-panel-offset").trim());
21
22
  }
22
- function _({ children: e, ...t }) {
23
- return /* @__PURE__ */ p("a", {
23
+ function v({ children: e, ...t }) {
24
+ return /* @__PURE__ */ m("a", {
24
25
  ...t,
25
26
  children: e
26
27
  });
27
28
  }
28
- var v = "button, a[href]", y = "notification-panel__footer-link";
29
- function b({ items: h = [], count: b = 0, max: x, onRead: S, onMarkAllRead: C, allHref: w, preferencesHref: T, renderLink: E = _, label: D, countLabel: O, panelLabel: k = "Notificaciones", unreadLabel: A = "Sin leer", emptyLabel: j = "Estás al día", allLabel: M = "Ver todas las notificaciones", preferencesLabel: N = "Preferencias de notificaciones", markAllReadLabel: P = "Marcar todas como leídas", open: F, defaultOpen: I, onOpenChange: L, className: R }) {
30
- let z = l(), B = u(null), [V, H] = d([]), U = (e) => e.unread && !V.includes(e.id), W = h.some(U), G = (e) => {
31
- U(e) && (H((t) => [...t, e.id]), S(e.id));
32
- }, K = () => {
33
- H(h.map((e) => e.id)), C?.();
34
- }, q = c(() => {
35
- let e = B.current;
36
- return e ? e.querySelector(".notification-panel__item-action") ?? e.querySelector(v) : null;
37
- }, []), J = (e, t) => {
38
- e || H([]), L?.(e, t);
39
- }, Y = `${z}-title`;
40
- return /* @__PURE__ */ p(a, {
41
- trigger: /* @__PURE__ */ p(s, {
42
- count: b,
43
- max: x,
44
- label: D,
45
- countLabel: O
29
+ var y = "button, a[href]", b = "notification-panel__footer-link";
30
+ function x({ items: g = [], count: x = 0, max: S, onRead: C, onMarkAllRead: w, allHref: T, preferencesHref: E, renderLink: D = v, label: O, countLabel: k, panelLabel: A, unreadLabel: j, emptyLabel: M, allLabel: N, preferencesLabel: P, markAllReadLabel: F, open: I, defaultOpen: L, onOpenChange: R, className: z }) {
31
+ let B = e("notificationPanel"), V = u(), H = d(null), [U, W] = f([]), G = (e) => e.unread && !U.includes(e.id), K = g.some(G), q = (e) => {
32
+ G(e) && (W((t) => [...t, e.id]), C(e.id));
33
+ }, J = () => {
34
+ W(g.map((e) => e.id)), w?.();
35
+ }, Y = l(() => {
36
+ let e = H.current;
37
+ return e ? e.querySelector(".notification-panel__item-action") ?? e.querySelector(y) : null;
38
+ }, []), X = (e, t) => {
39
+ e || W([]), R?.(e, t);
40
+ }, Z = `${V}-title`, Q = B("panel", A);
41
+ return /* @__PURE__ */ m(o, {
42
+ trigger: /* @__PURE__ */ m(c, {
43
+ count: x,
44
+ max: S,
45
+ label: O,
46
+ countLabel: k
46
47
  }),
47
- label: k,
48
+ label: Q,
48
49
  align: "end",
49
- sideOffset: g,
50
- open: F,
51
- defaultOpen: I,
52
- onOpenChange: J,
53
- initialFocus: q,
54
- className: ["notification-panel", R].filter(Boolean).join(" "),
55
- children: /* @__PURE__ */ m("div", {
50
+ sideOffset: _,
51
+ open: I,
52
+ defaultOpen: L,
53
+ onOpenChange: X,
54
+ initialFocus: Y,
55
+ className: ["notification-panel", z].filter(Boolean).join(" "),
56
+ children: /* @__PURE__ */ h("div", {
56
57
  className: "notification-panel__body",
57
- ref: B,
58
+ ref: H,
58
59
  children: [
59
- /* @__PURE__ */ p(t, { children: /* @__PURE__ */ p(r, {
60
+ /* @__PURE__ */ m(n, { children: /* @__PURE__ */ m(i, {
60
61
  level: 2,
61
62
  size: 3,
62
- id: Y,
63
- children: k
63
+ id: Z,
64
+ children: Q
64
65
  }) }),
65
- h.length === 0 ? /* @__PURE__ */ p("div", {
66
+ g.length === 0 ? /* @__PURE__ */ m("div", {
66
67
  className: "notification-panel__empty",
67
- children: /* @__PURE__ */ p(i, {
68
+ children: /* @__PURE__ */ m(a, {
68
69
  size: "small",
69
- children: j
70
+ children: B("empty", M)
70
71
  })
71
- }) : /* @__PURE__ */ p("ul", {
72
+ }) : /* @__PURE__ */ m("ul", {
72
73
  className: "notification-panel__list",
73
- "aria-labelledby": Y,
74
- children: h.map((n, r) => {
75
- let i = U(n), a = `${z}-t-${r}`;
76
- return /* @__PURE__ */ p("li", {
74
+ "aria-labelledby": Z,
75
+ children: g.map((e, r) => {
76
+ let i = G(e), a = `${V}-t-${r}`;
77
+ return /* @__PURE__ */ m("li", {
77
78
  className: "notification-panel__item",
78
- children: /* @__PURE__ */ m("button", {
79
+ children: /* @__PURE__ */ h("button", {
79
80
  type: "button",
80
81
  className: "notification-panel__item-action",
81
82
  "aria-disabled": i ? void 0 : !0,
82
- onClick: () => G(n),
83
- children: [/* @__PURE__ */ p("span", {
83
+ onClick: () => q(e),
84
+ children: [/* @__PURE__ */ m("span", {
84
85
  className: "notification-panel__indicator",
85
- children: i && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(e, {
86
+ children: i && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(t, {
86
87
  name: "dot",
87
88
  size: "sm",
88
89
  className: "notification-panel__dot"
89
- }), /* @__PURE__ */ p(t, { children: A })] })
90
- }), /* @__PURE__ */ m("span", {
90
+ }), /* @__PURE__ */ m(n, { children: B("unread", j) })] })
91
+ }), /* @__PURE__ */ h("span", {
91
92
  className: "notification-panel__item-text",
92
93
  children: [
93
- /* @__PURE__ */ p(o, {
94
+ /* @__PURE__ */ m(s, {
94
95
  id: a,
95
96
  tone: i ? "default" : "muted",
96
97
  className: "notification-panel__item-title",
97
- children: n.title
98
+ children: e.title
98
99
  }),
99
- n.body && /* @__PURE__ */ p(o, {
100
+ e.body && /* @__PURE__ */ m(s, {
100
101
  tone: "muted",
101
102
  className: "notification-panel__item-body",
102
- children: n.body
103
+ children: e.body
103
104
  }),
104
- /* @__PURE__ */ p(o, {
105
+ /* @__PURE__ */ m(s, {
105
106
  tone: "muted",
106
107
  className: "notification-panel__item-time",
107
- children: n.time
108
+ children: e.time
108
109
  })
109
110
  ]
110
111
  })]
111
112
  })
112
- }, n.id);
113
+ }, e.id);
113
114
  })
114
115
  }),
115
- C && W && /* @__PURE__ */ p("div", {
116
+ w && K && /* @__PURE__ */ m("div", {
116
117
  className: "notification-panel__mark-all",
117
- children: /* @__PURE__ */ p(n, {
118
+ children: /* @__PURE__ */ m(r, {
118
119
  variant: "outline",
119
120
  size: "sm",
120
121
  block: !0,
121
- onClick: K,
122
- children: P
122
+ onClick: J,
123
+ children: B("markAllRead", F)
123
124
  })
124
125
  }),
125
- /* @__PURE__ */ p("div", {
126
+ /* @__PURE__ */ m("div", {
126
127
  className: "notification-panel__footer",
127
- children: /* @__PURE__ */ m("div", {
128
+ children: /* @__PURE__ */ h("div", {
128
129
  className: "notification-panel__footer-links",
129
- children: [E({
130
- href: w,
131
- className: y,
132
- children: M
133
- }), E({
130
+ children: [D({
134
131
  href: T,
135
- className: y,
136
- children: N
132
+ className: b,
133
+ children: B("all", N)
134
+ }), D({
135
+ href: E,
136
+ className: b,
137
+ children: B("preferences", P)
137
138
  })]
138
139
  })
139
140
  })
@@ -142,4 +143,4 @@ function b({ items: h = [], count: b = 0, max: x, onRead: S, onMarkAllRead: C, a
142
143
  });
143
144
  }
144
145
  //#endregion
145
- export { b as NotificationPanel };
146
+ export { x as NotificationPanel };
@@ -1,69 +1,70 @@
1
1
  'use client';
2
2
  import './onboarding-shell.css';
3
- import { t as e } from "./_shared/form-size.js";
4
- import { Container as t } from "./container.js";
5
- import { PublicPageShell as n } from "./public-page-shell.js";
6
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { t } from "./_shared/form-size.js";
5
+ import { Container as n } from "./container.js";
6
+ import { PublicPageShell as r } from "./public-page-shell.js";
7
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
8
  //#region src/stories/templates/OnboardingShell/OnboardingShell.tsx
8
- function a({ children: a, brand: o, preferences: s, switchers: c, preferencesLabel: l, stepper: u, primaryAction: d, backAction: f, exitAction: p, actionsLabel: m = "Acciones del paso", id: h = "main-content", shell: g = !0, width: _ = "md", className: v }) {
9
- let y = !!(d || f || p), b = s ?? c, x = o && /* @__PURE__ */ r("div", {
9
+ function o({ children: o, brand: s, preferences: c, switchers: l, preferencesLabel: u, stepper: d, primaryAction: f, backAction: p, exitAction: m, actionsLabel: h, id: g = "main-content", shell: _ = !0, width: v = "md", className: y }) {
10
+ let b = e("onboardingShell"), x = e("publicPageShell"), S = !!(f || p || m), C = c ?? l, w = s && /* @__PURE__ */ i("div", {
10
11
  className: "onboarding-shell__brand",
11
- children: o
12
+ children: s
12
13
  });
13
- return /* @__PURE__ */ r(n, {
14
- id: h,
15
- shell: g,
16
- header: x && /* @__PURE__ */ r(t, {
14
+ return /* @__PURE__ */ i(r, {
15
+ id: g,
16
+ shell: _,
17
+ header: w && /* @__PURE__ */ i(n, {
17
18
  as: "header",
18
19
  className: "onboarding-shell__top onboarding-shell__top--band",
19
20
  innerClassName: "onboarding-shell__bar",
20
- children: x
21
+ children: w
21
22
  }),
22
- preferences: b,
23
- preferencesLabel: l,
24
- children: /* @__PURE__ */ i("div", {
25
- className: ["onboarding-shell", v].filter(Boolean).join(" "),
23
+ preferences: C,
24
+ preferencesLabel: u,
25
+ children: /* @__PURE__ */ a("div", {
26
+ className: ["onboarding-shell", y].filter(Boolean).join(" "),
26
27
  children: [
27
- !g && x && /* @__PURE__ */ r("header", {
28
+ !_ && w && /* @__PURE__ */ i("header", {
28
29
  className: "onboarding-shell__top onboarding-shell__bar",
29
- children: x
30
+ children: w
30
31
  }),
31
- /* @__PURE__ */ r(e.Provider, {
32
+ /* @__PURE__ */ i(t.Provider, {
32
33
  value: "lg",
33
- children: /* @__PURE__ */ i("div", {
34
- className: ["onboarding-shell__step", _ === "wide" ? "onboarding-shell__step--wide" : ""].filter(Boolean).join(" "),
34
+ children: /* @__PURE__ */ a("div", {
35
+ className: ["onboarding-shell__step", v === "wide" ? "onboarding-shell__step--wide" : ""].filter(Boolean).join(" "),
35
36
  children: [
36
- u && /* @__PURE__ */ r("div", {
37
+ d && /* @__PURE__ */ i("div", {
37
38
  className: "onboarding-shell__progress",
38
- children: u
39
+ children: d
39
40
  }),
40
- /* @__PURE__ */ r("div", {
41
+ /* @__PURE__ */ i("div", {
41
42
  className: "onboarding-shell__body",
42
- children: a
43
+ children: o
43
44
  }),
44
- y && /* @__PURE__ */ i("div", {
45
+ S && /* @__PURE__ */ a("div", {
45
46
  className: "onboarding-shell__actions",
46
47
  role: "group",
47
- "aria-label": m,
48
- children: [f, (p || d) && /* @__PURE__ */ i("div", {
48
+ "aria-label": b("actions", h),
49
+ children: [p, (m || f) && /* @__PURE__ */ a("div", {
49
50
  className: "onboarding-shell__decisions",
50
- children: [p && /* @__PURE__ */ r("div", {
51
+ children: [m && /* @__PURE__ */ i("div", {
51
52
  className: "onboarding-shell__exit",
52
- children: p
53
- }), d]
53
+ children: m
54
+ }), f]
54
55
  })]
55
56
  })
56
57
  ]
57
58
  })
58
59
  }),
59
- !g && b && /* @__PURE__ */ r("section", {
60
+ !_ && C && /* @__PURE__ */ i("section", {
60
61
  className: "onboarding-shell__settings",
61
- "aria-label": l ?? "Preferencias",
62
- children: b
62
+ "aria-label": x("preferences", u),
63
+ children: C
63
64
  })
64
65
  ]
65
66
  })
66
67
  });
67
68
  }
68
69
  //#endregion
69
- export { a as OnboardingShell };
70
+ export { o as OnboardingShell };
@@ -1,81 +1,86 @@
1
1
  'use client';
2
2
  import './org-switcher.css';
3
- import { Icon as e } from "./icon.js";
4
- import { Avatar as t } from "./avatar.js";
5
- import { n, t as r } from "./_shared/dropdownitems.js";
6
- import { n as i } from "./_shared/sidebarcontext.js";
7
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
8
- import { Menu as c } from "@base-ui/react/menu";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Icon as t } from "./icon.js";
5
+ import { n } from "./_shared/portal-container.js";
6
+ import { Avatar as r } from "./avatar.js";
7
+ import { n as i, t as a } from "./_shared/dropdownitems.js";
8
+ import { n as o } from "./_shared/sidebarcontext.js";
9
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
10
+ import { Menu as u } from "@base-ui/react/menu";
9
11
  //#region src/stories/molecules/OrgSwitcher/OrgSwitcher.tsx
10
- function l({ label: l, block: u = !1, compact: d, current: f, organizations: p, onOrgChange: m, defaultOpen: h, items: g, renderLink: _ = r }) {
11
- let v = p.filter((e) => e.id !== f.id), y = i(), b = d ?? y.rail;
12
- return /* @__PURE__ */ s(c.Root, {
13
- defaultOpen: h,
14
- children: [/* @__PURE__ */ s(c.Trigger, {
12
+ function d({ label: d, block: f = !1, compact: p, current: m, organizations: h, onOrgChange: g, defaultOpen: _, items: v, renderLink: y = a }) {
13
+ let b = e("orgSwitcher"), x = n(void 0), S = h.filter((e) => e.id !== m.id), C = o(), w = p ?? C.rail;
14
+ return /* @__PURE__ */ l(u.Root, {
15
+ defaultOpen: _,
16
+ children: [/* @__PURE__ */ l(u.Trigger, {
15
17
  className: [
16
18
  "org-switcher__trigger",
17
- u && !b ? "org-switcher__trigger--block" : "",
18
- b ? "org-switcher__trigger--compact" : ""
19
+ f && !w ? "org-switcher__trigger--block" : "",
20
+ w ? "org-switcher__trigger--compact" : ""
19
21
  ].filter(Boolean).join(" "),
20
- "aria-label": l ?? `Organización: ${f.name}`,
22
+ "aria-label": d ?? b("trigger")(m.name),
21
23
  children: [
22
- /* @__PURE__ */ o(t, {
23
- src: f.logoUrl,
24
- name: f.name,
24
+ /* @__PURE__ */ c(r, {
25
+ src: m.logoUrl,
26
+ name: m.name,
25
27
  alt: "",
26
28
  size: "sm",
27
29
  shape: "square"
28
30
  }),
29
- !b && /* @__PURE__ */ o("span", {
31
+ !w && /* @__PURE__ */ c("span", {
30
32
  className: "org-switcher__name",
31
- children: f.name
33
+ children: m.name
32
34
  }),
33
- !b && /* @__PURE__ */ o(e, {
35
+ !w && /* @__PURE__ */ c(t, {
34
36
  name: "chevron",
35
37
  size: "sm",
36
38
  className: "org-switcher__chevron"
37
39
  })
38
40
  ]
39
- }), /* @__PURE__ */ o(c.Portal, { children: /* @__PURE__ */ o(c.Positioner, {
40
- className: "org-switcher__positioner",
41
- sideOffset: 4,
42
- align: "start",
43
- children: /* @__PURE__ */ s(c.Popup, {
44
- className: "org-switcher__content",
45
- children: [
46
- /* @__PURE__ */ s(c.CheckboxItem, {
47
- className: "org-switcher__item org-switcher__item--active",
48
- checked: !0,
49
- onCheckedChange: () => void 0,
50
- children: [/* @__PURE__ */ o(t, {
51
- src: f.logoUrl,
52
- name: f.name,
53
- alt: "",
54
- size: "sm",
55
- shape: "square"
56
- }), /* @__PURE__ */ o("span", { children: f.name })]
57
- }),
58
- v.map((e) => /* @__PURE__ */ s(c.Item, {
59
- className: "org-switcher__item",
60
- onClick: () => m(e.id),
61
- children: [/* @__PURE__ */ o(t, {
62
- src: e.logoUrl,
63
- name: e.name,
64
- alt: "",
65
- size: "sm",
66
- shape: "square"
67
- }), /* @__PURE__ */ o("span", { children: e.name })]
68
- }, e.id)),
69
- g && g.length > 0 && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(c.Separator, { className: "org-switcher__separator" }), n({
70
- items: g,
71
- itemClass: (e) => ["org-switcher__item", e ? "org-switcher__item--destructive" : ""].filter(Boolean).join(" "),
72
- separatorClass: "org-switcher__separator",
73
- renderLink: _
74
- })] })
75
- ]
41
+ }), /* @__PURE__ */ c(u.Portal, {
42
+ container: x,
43
+ children: /* @__PURE__ */ c(u.Positioner, {
44
+ className: "org-switcher__positioner",
45
+ sideOffset: 4,
46
+ align: "start",
47
+ children: /* @__PURE__ */ l(u.Popup, {
48
+ className: "org-switcher__content",
49
+ children: [
50
+ /* @__PURE__ */ l(u.CheckboxItem, {
51
+ className: "org-switcher__item org-switcher__item--active",
52
+ checked: !0,
53
+ onCheckedChange: () => void 0,
54
+ children: [/* @__PURE__ */ c(r, {
55
+ src: m.logoUrl,
56
+ name: m.name,
57
+ alt: "",
58
+ size: "sm",
59
+ shape: "square"
60
+ }), /* @__PURE__ */ c("span", { children: m.name })]
61
+ }),
62
+ S.map((e) => /* @__PURE__ */ l(u.Item, {
63
+ className: "org-switcher__item",
64
+ onClick: () => g(e.id),
65
+ children: [/* @__PURE__ */ c(r, {
66
+ src: e.logoUrl,
67
+ name: e.name,
68
+ alt: "",
69
+ size: "sm",
70
+ shape: "square"
71
+ }), /* @__PURE__ */ c("span", { children: e.name })]
72
+ }, e.id)),
73
+ v && v.length > 0 && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(u.Separator, { className: "org-switcher__separator" }), i({
74
+ items: v,
75
+ itemClass: (e) => ["org-switcher__item", e ? "org-switcher__item--destructive" : ""].filter(Boolean).join(" "),
76
+ separatorClass: "org-switcher__separator",
77
+ renderLink: y
78
+ })] })
79
+ ]
80
+ })
76
81
  })
77
- }) })]
82
+ })]
78
83
  });
79
84
  }
80
85
  //#endregion
81
- export { l as OrgSwitcher };
86
+ export { d as OrgSwitcher };
package/dist/popover.js CHANGED
@@ -1,36 +1,41 @@
1
1
  'use client';
2
2
  import './popover.css';
3
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
4
- import { Popover as n } from "@base-ui/react/popover";
3
+ import { n as e } from "./_shared/portal-container.js";
4
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
+ import { Popover as r } from "@base-ui/react/popover";
5
6
  //#region src/stories/atoms/Popover/Popover.tsx
6
- function r(e) {
7
+ function i(e) {
7
8
  let t = parseFloat(e);
8
9
  return Number.isNaN(t) ? 0 : e.endsWith("rem") ? t * parseFloat(getComputedStyle(document.documentElement).fontSize) : t;
9
10
  }
10
- function i() {
11
+ function a() {
11
12
  let e = document.documentElement;
12
- return r(getComputedStyle(e).getPropertyValue("--popover-offset").trim());
13
+ return i(getComputedStyle(e).getPropertyValue("--popover-offset").trim());
13
14
  }
14
- function a({ trigger: r, children: a, label: o, open: s, defaultOpen: c, onOpenChange: l, onPointerDownOutside: u, onFocusOutside: d, onEscapeKeyDown: f, side: p = "bottom", align: m = "start", sideOffset: h, initialFocus: g, className: _ }) {
15
- return /* @__PURE__ */ t(n.Root, {
16
- open: s,
17
- defaultOpen: c,
15
+ function o({ trigger: i, children: o, label: s, open: c, defaultOpen: l, onOpenChange: u, onPointerDownOutside: d, onFocusOutside: f, onEscapeKeyDown: p, side: m = "bottom", align: h = "start", sideOffset: g, initialFocus: _, container: v, className: y }) {
16
+ let b = e(v);
17
+ return /* @__PURE__ */ n(r.Root, {
18
+ open: c,
19
+ defaultOpen: l,
18
20
  onOpenChange: (e, t) => {
19
- e || (t.reason === "outside-press" ? u?.(t) : t.reason === "focus-out" ? d?.(t) : t.reason === "escape-key" && f?.(t)), l?.(e, t);
21
+ e || (t.reason === "outside-press" ? d?.(t) : t.reason === "focus-out" ? f?.(t) : t.reason === "escape-key" && p?.(t)), u?.(e, t);
20
22
  },
21
- children: [/* @__PURE__ */ e(n.Trigger, { render: r }), /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(n.Positioner, {
22
- className: "popover__positioner",
23
- side: p,
24
- align: m,
25
- sideOffset: h ?? i,
26
- children: /* @__PURE__ */ e(n.Popup, {
27
- "aria-label": o,
28
- initialFocus: g,
29
- className: ["popover", _].filter(Boolean).join(" "),
30
- children: a
23
+ children: [/* @__PURE__ */ t(r.Trigger, { render: i }), /* @__PURE__ */ t(r.Portal, {
24
+ container: b,
25
+ children: /* @__PURE__ */ t(r.Positioner, {
26
+ className: "popover__positioner",
27
+ side: m,
28
+ align: h,
29
+ sideOffset: g ?? a,
30
+ children: /* @__PURE__ */ t(r.Popup, {
31
+ "aria-label": s,
32
+ initialFocus: _,
33
+ className: ["popover", y].filter(Boolean).join(" "),
34
+ children: o
35
+ })
31
36
  })
32
- }) })]
37
+ })]
33
38
  });
34
39
  }
35
40
  //#endregion
36
- export { a as Popover };
41
+ export { o as Popover };