@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
package/dist/site-nav.js CHANGED
@@ -1,54 +1,56 @@
1
+ 'use client';
1
2
  import './site-nav.css';
2
- import { Heading as e } from "./heading.js";
3
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Heading as t } from "./heading.js";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
6
  //#region src/stories/molecules/SiteNav/SiteNav.tsx
5
- function r({ href: e, children: n, className: r, "aria-current": i, target: a, rel: o }) {
6
- return /* @__PURE__ */ t("a", {
7
+ function i({ href: e, children: t, className: r, "aria-current": i, target: a, rel: o }) {
8
+ return /* @__PURE__ */ n("a", {
7
9
  href: e,
8
10
  className: r,
9
11
  "aria-current": i,
10
12
  target: a,
11
13
  rel: o,
12
- children: n
14
+ children: t
13
15
  });
14
16
  }
15
- function i(e, t) {
17
+ function a(e, t) {
16
18
  return t || (e === "_blank" ? "noopener noreferrer" : void 0);
17
19
  }
18
- var a = 5;
19
- function o({ groups: o, label: s = "Navegación del sitio", renderLink: c = r, className: l }) {
20
- let u = ["site-nav", l].filter(Boolean).join(" "), d = Math.min(o.length, a) || 1;
21
- return /* @__PURE__ */ t("nav", {
22
- className: u,
23
- "aria-label": s,
24
- "data-columns": d,
25
- children: o.map((r) => /* @__PURE__ */ n("div", {
20
+ var o = 5;
21
+ function s({ groups: s, label: c, renderLink: l = i, className: u }) {
22
+ let d = e("siteNav"), f = ["site-nav", u].filter(Boolean).join(" "), p = Math.min(s.length, o) || 1;
23
+ return /* @__PURE__ */ n("nav", {
24
+ className: f,
25
+ "aria-label": d("label", c),
26
+ "data-columns": p,
27
+ children: s.map((e) => /* @__PURE__ */ r("div", {
26
28
  className: "site-nav__group",
27
- children: [/* @__PURE__ */ t(e, {
29
+ children: [/* @__PURE__ */ n(t, {
28
30
  level: 2,
29
31
  size: 6,
30
32
  className: "site-nav__label",
31
- children: r.href ? c({
32
- href: r.href,
33
+ children: e.href ? l({
34
+ href: e.href,
33
35
  className: "site-nav__label-link",
34
- children: r.label
35
- }) : r.label
36
- }), /* @__PURE__ */ t("ul", {
36
+ children: e.label
37
+ }) : e.label
38
+ }), /* @__PURE__ */ n("ul", {
37
39
  className: "site-nav__list",
38
- children: r.items.map((e) => /* @__PURE__ */ t("li", {
40
+ children: e.items.map((e) => /* @__PURE__ */ n("li", {
39
41
  className: "site-nav__item",
40
- children: c({
42
+ children: l({
41
43
  href: e.href,
42
44
  className: ["site-nav__link", e.current ? "site-nav__link--current" : ""].filter(Boolean).join(" "),
43
45
  "aria-current": e.current ? "page" : void 0,
44
46
  target: e.target,
45
- rel: i(e.target, e.rel),
47
+ rel: a(e.target, e.rel),
46
48
  children: e.label
47
49
  })
48
50
  }, e.id))
49
51
  })]
50
- }, r.id))
52
+ }, e.id))
51
53
  });
52
54
  }
53
55
  //#endregion
54
- export { o as SiteNav };
56
+ export { s as SiteNav };
@@ -1,20 +1,28 @@
1
+ 'use client';
1
2
  import './site-shell.css';
2
- import { forwardRef as e } from "react";
3
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { t as e } from "./_shared/portal-container.js";
4
+ import { forwardRef as t, useCallback as n, useState as r } from "react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
6
  //#region src/stories/sections/SiteShell/SiteShell.tsx
5
- var r = e(function({ header: e, footer: r, children: i, className: a }, o) {
6
- return /* @__PURE__ */ n("div", {
7
- ref: o,
8
- className: ["site-shell", a].filter(Boolean).join(" "),
9
- children: [
10
- e,
11
- /* @__PURE__ */ t("div", {
12
- className: "site-shell__main",
13
- children: i
14
- }),
15
- r
16
- ]
7
+ var o = t(function({ header: t, footer: o, children: s, className: c }, l) {
8
+ let [u, d] = r(null);
9
+ return /* @__PURE__ */ i("div", {
10
+ ref: n((e) => {
11
+ d(e), typeof l == "function" ? l(e) : l && (l.current = e);
12
+ }, [l]),
13
+ className: ["site-shell", c].filter(Boolean).join(" "),
14
+ children: /* @__PURE__ */ a(e.Provider, {
15
+ value: u,
16
+ children: [
17
+ t,
18
+ /* @__PURE__ */ i("div", {
19
+ className: "site-shell__main",
20
+ children: s
21
+ }),
22
+ o
23
+ ]
24
+ })
17
25
  });
18
26
  });
19
27
  //#endregion
20
- export { r as SiteShell };
28
+ export { o as SiteShell };
@@ -1,45 +1,48 @@
1
+ 'use client';
1
2
  import './table-of-contents.css';
2
- import { Link as e } from "./link.js";
3
- import { List as t } from "./list.js";
4
- import { forwardRef as n } from "react";
5
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Link as t } from "./link.js";
5
+ import { List as n } from "./list.js";
6
+ import { forwardRef as r } from "react";
7
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
8
  //#region src/stories/molecules/TableOfContents/TableOfContents.tsx
7
- function a(e, t) {
9
+ function o(e, t) {
8
10
  return Math.min(Math.max(e - t, 0), 5);
9
11
  }
10
- var o = n(function({ items: n, activeId: o, ariaLabel: s = "En esta página", title: c, sticky: l = !1, onItemClick: u, className: d, ...f }, p) {
11
- if (n.length === 0) return null;
12
- let m = Math.min(...n.map((e) => e.level));
13
- return /* @__PURE__ */ i("nav", {
14
- ref: p,
12
+ var s = r(function({ items: r, activeId: s, ariaLabel: c, title: l, sticky: u = !1, onItemClick: d, className: f, ...p }, m) {
13
+ let h = e("tableOfContents");
14
+ if (r.length === 0) return null;
15
+ let g = Math.min(...r.map((e) => e.level));
16
+ return /* @__PURE__ */ a("nav", {
17
+ ref: m,
15
18
  className: [
16
19
  "table-of-contents",
17
- l ? "table-of-contents--sticky" : "",
18
- d ?? ""
20
+ u ? "table-of-contents--sticky" : "",
21
+ f ?? ""
19
22
  ].filter(Boolean).join(" "),
20
- "aria-label": s,
21
- ...f,
22
- children: [c && /* @__PURE__ */ r("p", {
23
+ "aria-label": h("label", c),
24
+ ...p,
25
+ children: [l && /* @__PURE__ */ i("p", {
23
26
  className: "table-of-contents__title",
24
- children: c
25
- }), /* @__PURE__ */ r(t, {
27
+ children: l
28
+ }), /* @__PURE__ */ i(n, {
26
29
  type: "plain",
27
30
  className: "table-of-contents__list",
28
- children: n.map((t) => {
29
- let n = t.id === o;
30
- return /* @__PURE__ */ r("li", {
31
- className: `table-of-contents__item table-of-contents__item--level-${a(t.level, m)}`,
32
- children: /* @__PURE__ */ r(e, {
33
- href: `#${t.id}`,
31
+ children: r.map((e) => {
32
+ let n = e.id === s;
33
+ return /* @__PURE__ */ i("li", {
34
+ className: `table-of-contents__item table-of-contents__item--level-${o(e.level, g)}`,
35
+ children: /* @__PURE__ */ i(t, {
36
+ href: `#${e.id}`,
34
37
  className: ["table-of-contents__link", n ? "table-of-contents__link--active" : ""].filter(Boolean).join(" "),
35
38
  "aria-current": n ? "location" : void 0,
36
- onClick: u ? (e) => u(t, e) : void 0,
37
- children: t.label
39
+ onClick: d ? (t) => d(e, t) : void 0,
40
+ children: e.label
38
41
  })
39
- }, t.id);
42
+ }, e.id);
40
43
  })
41
44
  })]
42
45
  });
43
46
  });
44
47
  //#endregion
45
- export { o as TableOfContents };
48
+ export { s as TableOfContents };
package/dist/toaster.js CHANGED
@@ -1,81 +1,85 @@
1
1
  'use client';
2
2
  import './toaster.css';
3
3
  import { n as e } from "./_shared/brandmessagescontext.js";
4
- import { Button as t } from "./button.js";
5
- import { CloseButton as n } from "./close-button.js";
6
- import { t as r } from "./_shared/css-properties.js";
7
- import { TOAST_DURATION as i, setToastDefaultDuration as a, syncLiveToasts as o, toastManager as s } from "./toast.js";
8
- import { useEffect as c } from "react";
9
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
10
- import { Toast as d } from "@base-ui/react/toast";
4
+ import { n as t } from "./_shared/portal-container.js";
5
+ import { Button as n } from "./button.js";
6
+ import { CloseButton as r } from "./close-button.js";
7
+ import { t as i } from "./_shared/css-properties.js";
8
+ import { TOAST_DURATION as a, setToastDefaultDuration as o, syncLiveToasts as s, toastManager as c } from "./toast.js";
9
+ import { useEffect as l } from "react";
10
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
+ import { Toast as f } from "@base-ui/react/toast";
11
12
  //#region src/stories/molecules/Toast/Toaster.tsx
12
- var f = 8, p = {
13
+ var p = 8, m = {
13
14
  success: "alert--success",
14
15
  error: "alert--error",
15
16
  warning: "alert--warning"
16
17
  };
17
- function m(e, t) {
18
+ function h(e, t) {
18
19
  return [
19
20
  "alert",
20
- p[e ?? ""] ?? "",
21
+ m[e ?? ""] ?? "",
21
22
  e === "warning" ? "" : "surface-dark",
22
23
  t ? "alert--dismissible" : "",
23
24
  "toast"
24
25
  ].filter(Boolean).join(" ");
25
26
  }
26
- function h({ position: i, containerAriaLabel: a, closeLabel: s, closeButton: f, gap: p, expand: h }) {
27
- let g = e("toaster"), { toasts: _ } = d.useToastManager(), [v, y] = i.split("-"), b = _.map((e) => e.id).join(",");
28
- c(() => {
29
- o(b ? b.split(",") : []);
30
- }, [b]);
31
- let x = r({ "--toast-gap": `${p}px` }), S = [
27
+ function g({ position: a, containerAriaLabel: o, closeLabel: c, closeButton: p, gap: m, expand: g }) {
28
+ let _ = e("toaster"), { toasts: v } = f.useToastManager(), [y, b] = a.split("-"), x = v.map((e) => e.id).join(",");
29
+ l(() => {
30
+ s(x ? x.split(",") : []);
31
+ }, [x]);
32
+ let S = i({ "--toast-gap": `${m}px` }), C = t(void 0), w = [
32
33
  "toaster",
33
- v === "top" ? "toaster--top" : "",
34
- y === "right" ? "" : `toaster--${y}`,
35
- h ? "toaster--expanded" : ""
34
+ y === "top" ? "toaster--top" : "",
35
+ b === "right" ? "" : `toaster--${b}`,
36
+ g ? "toaster--expanded" : ""
36
37
  ].filter(Boolean).join(" ");
37
- return /* @__PURE__ */ l(d.Portal, { children: /* @__PURE__ */ l(d.Viewport, {
38
- ref: x,
39
- className: S,
40
- "aria-label": g("container", a),
41
- children: _.map((e) => /* @__PURE__ */ u(d.Root, {
42
- toast: e,
43
- className: m(e.type, f),
44
- children: [/* @__PURE__ */ u("div", {
45
- className: "alert__content",
46
- children: [
47
- /* @__PURE__ */ l(d.Title, { className: "alert__title" }),
48
- /* @__PURE__ */ l(d.Description, { className: "alert__description" }),
49
- /* @__PURE__ */ l(d.Action, {
50
- className: "toast__action",
51
- render: /* @__PURE__ */ l(t, {
52
- variant: "ghost",
53
- size: "sm"
38
+ return /* @__PURE__ */ u(f.Portal, {
39
+ container: C,
40
+ children: /* @__PURE__ */ u(f.Viewport, {
41
+ ref: S,
42
+ className: w,
43
+ "aria-label": _("container", o),
44
+ children: v.map((e) => /* @__PURE__ */ d(f.Root, {
45
+ toast: e,
46
+ className: h(e.type, p),
47
+ children: [/* @__PURE__ */ d("div", {
48
+ className: "alert__content",
49
+ children: [
50
+ /* @__PURE__ */ u(f.Title, { className: "alert__title" }),
51
+ /* @__PURE__ */ u(f.Description, { className: "alert__description" }),
52
+ /* @__PURE__ */ u(f.Action, {
53
+ className: "toast__action",
54
+ render: /* @__PURE__ */ u(n, {
55
+ variant: "ghost",
56
+ size: "sm"
57
+ })
54
58
  })
55
- })
56
- ]
57
- }), f && /* @__PURE__ */ l(d.Close, {
58
- className: "alert__close",
59
- render: /* @__PURE__ */ l(n, { label: g("close", s) })
60
- })]
61
- }, e.id))
62
- }) });
59
+ ]
60
+ }), p && /* @__PURE__ */ u(f.Close, {
61
+ className: "alert__close",
62
+ render: /* @__PURE__ */ u(r, { label: _("close", c) })
63
+ })]
64
+ }, e.id))
65
+ })
66
+ });
63
67
  }
64
- function g({ position: e = "bottom-right", containerAriaLabel: t, closeLabel: n, closeButton: r = !0, duration: o = i, gap: u = f, visibleToasts: p = 3, expand: m = !1 }) {
65
- let g = Number.isFinite(o) ? o : 0;
66
- return c(() => a(g), [g]), /* @__PURE__ */ l(d.Provider, {
67
- toastManager: s,
68
- timeout: g,
69
- limit: p,
70
- children: /* @__PURE__ */ l(h, {
68
+ function _({ position: e = "bottom-right", containerAriaLabel: t, closeLabel: n, closeButton: r = !0, duration: i = a, gap: s = p, visibleToasts: d = 3, expand: m = !1 }) {
69
+ let h = Number.isFinite(i) ? i : 0;
70
+ return l(() => o(h), [h]), /* @__PURE__ */ u(f.Provider, {
71
+ toastManager: c,
72
+ timeout: h,
73
+ limit: d,
74
+ children: /* @__PURE__ */ u(g, {
71
75
  position: e,
72
76
  containerAriaLabel: t,
73
77
  closeLabel: n,
74
78
  closeButton: r,
75
- gap: u,
79
+ gap: s,
76
80
  expand: m
77
81
  })
78
82
  });
79
83
  }
80
84
  //#endregion
81
- export { g as Toaster };
85
+ export { _ as Toaster };