@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/tooltip.js CHANGED
@@ -1,60 +1,64 @@
1
1
  'use client';
2
2
  import './tooltip.css';
3
- import { forwardRef as e, useId as t, useState as n } from "react";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import { Tooltip as a } from "@base-ui/react/tooltip";
3
+ import { n as e } from "./_shared/portal-container.js";
4
+ import { forwardRef as t, useId as n, useState as r } from "react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { Tooltip as o } from "@base-ui/react/tooltip";
6
7
  //#region src/stories/atoms/Tooltip/Tooltip.tsx
7
- function o({ children: e, delayDuration: t = 0, skipDelayDuration: n }) {
8
- return /* @__PURE__ */ r(a.Provider, {
8
+ function s({ children: e, delayDuration: t = 0, skipDelayDuration: n }) {
9
+ return /* @__PURE__ */ i(o.Provider, {
9
10
  delay: t,
10
11
  ...n === void 0 ? {} : { timeout: n },
11
12
  children: e
12
13
  });
13
14
  }
14
- function s(e, t) {
15
+ function c(e, t) {
15
16
  let n = parseFloat(e);
16
17
  return Number.isNaN(n) ? 0 : e.endsWith("rem") ? n * parseFloat(getComputedStyle(document.documentElement).fontSize) : e.endsWith("em") ? n * parseFloat(getComputedStyle(t).fontSize) : n;
17
18
  }
18
- function c() {
19
+ function l() {
19
20
  let e = document.documentElement;
20
- return s(getComputedStyle(e).getPropertyValue("--tooltip-offset").trim(), e);
21
+ return c(getComputedStyle(e).getPropertyValue("--tooltip-offset").trim(), e);
21
22
  }
22
- var l = e(function({ label: e, children: o, side: s = "top", align: l = "center", sideOffset: u, open: d, defaultOpen: f, onOpenChange: p, delayDuration: m, describe: h = !0, className: g, ..._ }, v) {
23
- let y = t(), [b, x] = n(f ?? !1), S = d ?? b;
24
- return /* @__PURE__ */ i(a.Root, {
25
- open: d,
26
- defaultOpen: f,
23
+ var u = t(function({ label: t, children: s, side: c = "top", align: u = "center", sideOffset: d, open: f, defaultOpen: p, onOpenChange: m, delayDuration: h, describe: g = !0, container: _, className: v, ...y }, b) {
24
+ let x = e(_), S = n(), [C, w] = r(p ?? !1), T = f ?? C;
25
+ return /* @__PURE__ */ a(o.Root, {
26
+ open: f,
27
+ defaultOpen: p,
27
28
  onOpenChange: (e) => {
28
- d === void 0 && x(e), p?.(e);
29
+ f === void 0 && w(e), m?.(e);
29
30
  },
30
- children: [/* @__PURE__ */ r(a.Trigger, {
31
- ref: v,
32
- render: o,
33
- "aria-describedby": S && h ? y : void 0,
34
- ...m === void 0 ? {} : { delay: m },
35
- ..._
36
- }), /* @__PURE__ */ r(a.Portal, { children: /* @__PURE__ */ r(a.Positioner, {
37
- className: "tooltip__positioner",
38
- side: s,
39
- align: l,
40
- sideOffset: u ?? c,
41
- children: /* @__PURE__ */ i(a.Popup, {
42
- id: y,
43
- role: "tooltip",
44
- className: ["tooltip", g].filter(Boolean).join(" "),
45
- children: [e, /* @__PURE__ */ r(a.Arrow, {
46
- className: "tooltip__arrow",
47
- children: /* @__PURE__ */ r("svg", {
48
- width: "10",
49
- height: "5",
50
- viewBox: "0 0 30 10",
51
- preserveAspectRatio: "none",
52
- children: /* @__PURE__ */ r("polygon", { points: "0,0 30,0 15,10" })
53
- })
54
- })]
31
+ children: [/* @__PURE__ */ i(o.Trigger, {
32
+ ref: b,
33
+ render: s,
34
+ "aria-describedby": T && g ? S : void 0,
35
+ ...h === void 0 ? {} : { delay: h },
36
+ ...y
37
+ }), /* @__PURE__ */ i(o.Portal, {
38
+ container: x,
39
+ children: /* @__PURE__ */ i(o.Positioner, {
40
+ className: "tooltip__positioner",
41
+ side: c,
42
+ align: u,
43
+ sideOffset: d ?? l,
44
+ children: /* @__PURE__ */ a(o.Popup, {
45
+ id: S,
46
+ role: "tooltip",
47
+ className: ["tooltip", v].filter(Boolean).join(" "),
48
+ children: [t, /* @__PURE__ */ i(o.Arrow, {
49
+ className: "tooltip__arrow",
50
+ children: /* @__PURE__ */ i("svg", {
51
+ width: "10",
52
+ height: "5",
53
+ viewBox: "0 0 30 10",
54
+ preserveAspectRatio: "none",
55
+ children: /* @__PURE__ */ i("polygon", { points: "0,0 30,0 15,10" })
56
+ })
57
+ })]
58
+ })
55
59
  })
56
- }) })]
60
+ })]
57
61
  });
58
62
  });
59
63
  //#endregion
60
- export { l as Tooltip, o as TooltipProvider };
64
+ export { u as Tooltip, s as TooltipProvider };
package/dist/user-menu.js CHANGED
@@ -1,85 +1,91 @@
1
1
  'use client';
2
2
  import './user-menu.css';
3
- import { Icon as e } from "./icon.js";
4
- import { Avatar as t } from "./avatar.js";
5
- import { NumberBadge as n } from "./number-badge.js";
6
- import { n as r } from "./_shared/dropdownitems.js";
7
- import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
8
- import { Menu as s } 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 { NumberBadge as i } from "./number-badge.js";
8
+ import { n as a } from "./_shared/dropdownitems.js";
9
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
10
+ import { Menu as l } from "@base-ui/react/menu";
9
11
  //#region src/stories/molecules/UserMenu/UserMenu.tsx
10
- function c(e) {
12
+ function u(e) {
11
13
  let t = parseFloat(e);
12
14
  return Number.isNaN(t) ? 0 : e.endsWith("rem") ? t * parseFloat(getComputedStyle(document.documentElement).fontSize) : t;
13
15
  }
14
- function l() {
16
+ function d() {
15
17
  let e = document.documentElement;
16
- return c(getComputedStyle(e).getPropertyValue("--user-menu-offset").trim());
18
+ return u(getComputedStyle(e).getPropertyValue("--user-menu-offset").trim());
17
19
  }
18
- function u({ children: e, ...t }) {
19
- return /* @__PURE__ */ a("a", {
20
+ function f({ children: e, ...t }) {
21
+ return /* @__PURE__ */ s("a", {
20
22
  ...t,
21
23
  children: e
22
24
  });
23
25
  }
24
- function d(e) {
26
+ function p(e) {
25
27
  return ["user-menu__item", e ? "user-menu__item--destructive" : ""].filter(Boolean).join(" ");
26
28
  }
27
- function f({ name: c, email: f, avatarUrl: p, notificationCount: m, items: h = [], label: g, compact: _ = !1, renderLink: v = u, onOpenChange: y, defaultOpen: b }) {
28
- return /* @__PURE__ */ o(s.Root, {
29
- onOpenChange: (e) => y?.(e),
30
- defaultOpen: b,
31
- children: [/* @__PURE__ */ o(s.Trigger, {
32
- className: ["user-menu__trigger", _ ? "user-menu__trigger--compact" : ""].filter(Boolean).join(" "),
33
- "aria-label": g ?? `Cuenta de ${c}`,
29
+ function m({ name: u, email: m, avatarUrl: h, notificationCount: g, items: _ = [], label: v, compact: y = !1, renderLink: b = f, onOpenChange: x, defaultOpen: S }) {
30
+ let C = e("userMenu"), w = n(void 0);
31
+ return /* @__PURE__ */ c(l.Root, {
32
+ onOpenChange: (e) => x?.(e),
33
+ defaultOpen: S,
34
+ children: [/* @__PURE__ */ c(l.Trigger, {
35
+ className: ["user-menu__trigger", y ? "user-menu__trigger--compact" : ""].filter(Boolean).join(" "),
36
+ "aria-label": v ?? C("trigger")(u),
34
37
  children: [
35
- /* @__PURE__ */ o("span", {
38
+ /* @__PURE__ */ c("span", {
36
39
  className: "user-menu__avatar-wrap",
37
- children: [/* @__PURE__ */ a(t, {
38
- src: p,
39
- name: c,
40
+ children: [/* @__PURE__ */ s(r, {
41
+ src: h,
42
+ name: u,
40
43
  alt: "",
41
44
  size: "sm"
42
- }), !!m && m > 0 && /* @__PURE__ */ a(n, {
43
- count: m,
45
+ }), !!g && g > 0 && /* @__PURE__ */ s(i, {
46
+ count: g,
44
47
  variant: "danger",
45
- "aria-label": `${m} notificaciones sin leer`,
48
+ "aria-label": C("unread")(g),
46
49
  className: "user-menu__notification-badge"
47
50
  })]
48
51
  }),
49
- !_ && /* @__PURE__ */ a("span", {
52
+ !y && /* @__PURE__ */ s("span", {
50
53
  className: "user-menu__name",
51
- children: c
54
+ children: u
52
55
  }),
53
- /* @__PURE__ */ a(e, {
56
+ /* @__PURE__ */ s(t, {
54
57
  name: "chevron",
55
58
  size: "sm",
56
59
  className: "user-menu__chevron"
57
60
  })
58
61
  ]
59
- }), /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(s.Positioner, {
60
- className: "user-menu__positioner",
61
- sideOffset: l,
62
- align: "start",
63
- children: /* @__PURE__ */ o(s.Popup, {
64
- className: "user-menu__content",
65
- children: [/* @__PURE__ */ o("div", {
66
- className: "user-menu__header",
67
- children: [/* @__PURE__ */ a("span", {
68
- className: "user-menu__header-name",
69
- children: c
70
- }), /* @__PURE__ */ a("span", {
71
- className: "user-menu__header-email",
72
- children: f
73
- })]
74
- }), h.length > 0 && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(s.Separator, { className: "user-menu__separator" }), r({
75
- items: h,
76
- itemClass: d,
77
- separatorClass: "user-menu__separator",
78
- renderLink: v
79
- })] })]
62
+ }), /* @__PURE__ */ s(l.Portal, {
63
+ container: w,
64
+ children: /* @__PURE__ */ s(l.Positioner, {
65
+ className: "user-menu__positioner",
66
+ sideOffset: d,
67
+ align: "start",
68
+ children: /* @__PURE__ */ c(l.Popup, {
69
+ className: "user-menu__content",
70
+ children: [/* @__PURE__ */ c("div", {
71
+ className: "user-menu__header",
72
+ children: [/* @__PURE__ */ s("span", {
73
+ className: "user-menu__header-name",
74
+ children: u
75
+ }), /* @__PURE__ */ s("span", {
76
+ className: "user-menu__header-email",
77
+ children: m
78
+ })]
79
+ }), _.length > 0 && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(l.Separator, { className: "user-menu__separator" }), a({
80
+ items: _,
81
+ itemClass: p,
82
+ separatorClass: "user-menu__separator",
83
+ renderLink: b
84
+ })] })]
85
+ })
80
86
  })
81
- }) })]
87
+ })]
82
88
  });
83
89
  }
84
90
  //#endregion
85
- export { f as UserMenu };
91
+ export { m as UserMenu };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiolxd/brand",
3
- "version": "46.0.0",
3
+ "version": "47.1.0",
4
4
  "description": "El sistema de diseño de Studio LXD: componentes React, tokens y documentación de la suite SLXD.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -5,6 +5,6 @@
5
5
  :root {
6
6
  --page-intro-title-space-after: var(--text-heading-space-after); /** Aire bajo el título cuando comparte fila con las acciones: el mismo em que deja un título suelto, para que una cabecera con acciones y una sin ellas separen igual el título de la entradilla */
7
7
  --page-intro-row-column-gap: var(--spacing-5); /** Aire entre el título y las acciones cuando comparten fila (a partir de `md`) */
8
- --page-intro-row-gap: var(--spacing-3); /** Aire entre el título y las acciones cuando las acciones caen debajo (por debajo de `md`) */
8
+ --page-intro-row-gap: var(--spacing-3); /** Aire entre el título y las acciones cuando las acciones caen debajo (por debajo de `md`); también el aire entre el `eyebrow` y el título */
9
9
  --page-intro-actions-gap: var(--form-actions-gap); /** Aire entre las acciones — el de los botones de un formulario: la fila de acciones del sistema es una sola */
10
10
  }
@@ -3,5 +3,5 @@
3
3
 
4
4
  $lxd-page-intro-title-space-after: 0.5em; // Aire bajo el título cuando comparte fila con las acciones: el mismo em que deja un título suelto, para que una cabecera con acciones y una sin ellas separen igual el título de la entradilla
5
5
  $lxd-page-intro-row-column-gap: 1.5rem; // Aire entre el título y las acciones cuando comparten fila (a partir de `md`)
6
- $lxd-page-intro-row-gap: 0.75rem; // Aire entre el título y las acciones cuando las acciones caen debajo (por debajo de `md`)
6
+ $lxd-page-intro-row-gap: 0.75rem; // Aire entre el título y las acciones cuando las acciones caen debajo (por debajo de `md`); también el aire entre el `eyebrow` y el título
7
7
  $lxd-page-intro-actions-gap: 0.75rem; // Aire entre las acciones — el de los botones de un formulario: la fila de acciones del sistema es una sola