@studiolxd/brand 46.0.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 (60) hide show
  1. package/CHANGELOG.md +134 -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/Menu/Menu.d.ts +8 -1
  16. package/dist/_types/molecules/Modal/Modal.d.ts +8 -6
  17. package/dist/_types/molecules/OrgSwitcher/OrgSwitcher.d.ts +15 -1
  18. package/dist/_types/molecules/PrevNextNav/PrevNextNav.d.ts +17 -2
  19. package/dist/_types/molecules/Sheet/Sheet.d.ts +8 -7
  20. package/dist/_types/molecules/SidebarNav/SidebarNav.d.ts +18 -3
  21. package/dist/_types/molecules/SiteNav/SiteNav.d.ts +9 -0
  22. package/dist/_types/molecules/TableOfContents/TableOfContents.d.ts +11 -2
  23. package/dist/_types/molecules/UserMenu/UserMenu.d.ts +16 -1
  24. package/dist/_types/sections/AppHeader/AppHeader.d.ts +8 -2
  25. package/dist/_types/sections/AppRoot/AppRoot.d.ts +12 -1
  26. package/dist/_types/sections/AppShell/AppShell.d.ts +14 -1
  27. package/dist/_types/sections/Sidebar/Sidebar.d.ts +27 -3
  28. package/dist/_types/sections/SiteHeader/SiteHeader.d.ts +22 -3
  29. package/dist/_types/sections/SiteShell/SiteShell.d.ts +11 -5
  30. package/dist/_types/templates/OnboardingShell/OnboardingShell.d.ts +19 -2
  31. package/dist/_types/templates/PublicPageShell/PublicPageShell.d.ts +42 -6
  32. package/dist/app-header.js +1 -1
  33. package/dist/app-launcher.js +62 -58
  34. package/dist/app-root.js +10 -8
  35. package/dist/app-shell.js +51 -50
  36. package/dist/async-multi-select.js +65 -64
  37. package/dist/async-select.js +49 -48
  38. package/dist/breadcrumb.js +24 -21
  39. package/dist/input-phone.js +38 -37
  40. package/dist/menu-button.js +16 -14
  41. package/dist/menu.js +44 -40
  42. package/dist/modal.js +32 -31
  43. package/dist/multi-select.js +106 -105
  44. package/dist/onboarding-shell.js +36 -35
  45. package/dist/org-switcher.js +64 -59
  46. package/dist/popover.js +27 -22
  47. package/dist/prev-next-nav.js +38 -36
  48. package/dist/public-page-shell.js +24 -20
  49. package/dist/select.js +70 -69
  50. package/dist/sheet.js +30 -29
  51. package/dist/sidebar-nav.js +91 -90
  52. package/dist/sidebar.js +72 -71
  53. package/dist/site-header.js +44 -43
  54. package/dist/site-nav.js +27 -25
  55. package/dist/site-shell.js +23 -15
  56. package/dist/table-of-contents.js +30 -27
  57. package/dist/toaster.js +57 -53
  58. package/dist/tooltip.js +45 -41
  59. package/dist/user-menu.js +58 -52
  60. package/package.json +1 -1
@@ -2,72 +2,73 @@
2
2
  import './input-phone.css';
3
3
  import { n as e } from "./_shared/brandmessagescontext.js";
4
4
  import { Icon as t } from "./icon.js";
5
- import { forwardRef as n, useMemo as r } from "react";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { Select as o } from "@base-ui/react/select";
8
- import s, { getCountryCallingCode as c } from "react-phone-number-input";
5
+ import { n } from "./_shared/portal-container.js";
6
+ import { forwardRef as r, useMemo as i } from "react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ import { Select as s } from "@base-ui/react/select";
9
+ import c, { getCountryCallingCode as l } from "react-phone-number-input";
9
10
  //#region src/stories/atoms/InputPhone/InputPhone.tsx
10
- function l({ value: n, onChange: r, options: s, disabled: l, size: u = "md", countryLabel: d, internationalLabel: f = "🌐", container: p }) {
11
- let m = e("inputPhone"), h = "__intl__", g = (e) => e ?? h, _ = (e) => e === h ? void 0 : e, v = u === "sm" ? "xs" : u === "lg" ? "md" : "sm", y = ["input-phone__country-content", u === "md" ? "" : `input-phone__country-content--${u}`].filter(Boolean).join(" ");
12
- return /* @__PURE__ */ a(o.Root, {
13
- value: g(n),
14
- onValueChange: (e) => r(_(e)),
15
- disabled: l,
16
- children: [/* @__PURE__ */ a(o.Trigger, {
11
+ function u({ value: r, onChange: i, options: c, disabled: u, size: d = "md", countryLabel: f, internationalLabel: p = "🌐", container: m }) {
12
+ let h = e("inputPhone"), g = n(m), _ = "__intl__", v = (e) => e ?? _, y = (e) => e === _ ? void 0 : e, b = d === "sm" ? "xs" : d === "lg" ? "md" : "sm", x = ["input-phone__country-content", d === "md" ? "" : `input-phone__country-content--${d}`].filter(Boolean).join(" ");
13
+ return /* @__PURE__ */ o(s.Root, {
14
+ value: v(r),
15
+ onValueChange: (e) => i(y(e)),
16
+ disabled: u,
17
+ children: [/* @__PURE__ */ o(s.Trigger, {
17
18
  className: "input-phone__country",
18
- "aria-label": m("country", d),
19
- children: [/* @__PURE__ */ i(o.Value, { children: n ? `+${c(n)}` : f }), /* @__PURE__ */ i(t, {
19
+ "aria-label": h("country", f),
20
+ children: [/* @__PURE__ */ a(s.Value, { children: r ? `+${l(r)}` : p }), /* @__PURE__ */ a(t, {
20
21
  name: "chevron",
21
22
  className: "input-phone__country-icon",
22
- size: v
23
+ size: b
23
24
  })]
24
- }), /* @__PURE__ */ i(o.Portal, {
25
- container: p,
26
- children: /* @__PURE__ */ i(o.Positioner, {
25
+ }), /* @__PURE__ */ a(s.Portal, {
26
+ container: g,
27
+ children: /* @__PURE__ */ a(s.Positioner, {
27
28
  className: "input-phone__country-positioner",
28
29
  side: "bottom",
29
30
  align: "start",
30
31
  alignItemWithTrigger: !1,
31
- children: /* @__PURE__ */ i(o.Popup, {
32
- className: y,
33
- children: s.map(({ value: e, label: t }) => /* @__PURE__ */ i(o.Item, {
34
- value: g(e),
32
+ children: /* @__PURE__ */ a(s.Popup, {
33
+ className: x,
34
+ children: c.map(({ value: e, label: t }) => /* @__PURE__ */ a(s.Item, {
35
+ value: v(e),
35
36
  className: "input-phone__country-item",
36
- children: /* @__PURE__ */ i(o.ItemText, { children: t })
37
- }, g(e)))
37
+ children: /* @__PURE__ */ a(s.ItemText, { children: t })
38
+ }, v(e)))
38
39
  })
39
40
  })
40
41
  })]
41
42
  });
42
43
  }
43
- var u = n(function({ value: e, defaultCountry: t = "ES", placeholder: a, disabled: o, error: c = !1, size: u = "md", id: f, name: p, describedBy: m, "aria-describedby": h, "aria-label": g, autoComplete: _, required: v, readOnly: y, onChange: b, onBlur: x, onFocus: S, countryLabel: C, internationalLabel: w, container: T }, E) {
44
- return /* @__PURE__ */ i(s, {
44
+ var d = r(function({ value: e, defaultCountry: t = "ES", placeholder: n, disabled: o, error: s = !1, size: l = "md", id: d, name: p, describedBy: m, "aria-describedby": h, "aria-label": g, autoComplete: _, required: v, readOnly: y, onChange: b, onBlur: x, onFocus: S, countryLabel: C, internationalLabel: w, container: T }, E) {
45
+ return /* @__PURE__ */ a(c, {
45
46
  className: [
46
47
  "input-phone",
47
- c ? "input-phone--error" : "",
48
- u === "md" ? "" : `input-phone--${u}`
48
+ s ? "input-phone--error" : "",
49
+ l === "md" ? "" : `input-phone--${l}`
49
50
  ].filter(Boolean).join(" "),
50
51
  value: e,
51
52
  defaultCountry: t,
52
- placeholder: a,
53
+ placeholder: n,
53
54
  disabled: o,
54
55
  readOnly: y,
55
56
  required: v,
56
57
  autoComplete: _,
57
- id: f,
58
+ id: d,
58
59
  name: p,
59
- inputComponent: r(() => n(function(e, t) {
60
- return /* @__PURE__ */ i("input", {
60
+ inputComponent: i(() => r(function(e, t) {
61
+ return /* @__PURE__ */ a("input", {
61
62
  ...e,
62
63
  ref: (e) => {
63
- d(t, e), d(E, e);
64
+ f(t, e), f(E, e);
64
65
  },
65
66
  className: "input-phone__number"
66
67
  });
67
68
  }), [E]),
68
- countrySelectComponent: l,
69
+ countrySelectComponent: u,
69
70
  countrySelectProps: {
70
- size: u,
71
+ size: l,
71
72
  countryLabel: C,
72
73
  internationalLabel: w,
73
74
  container: T
@@ -78,12 +79,12 @@ var u = n(function({ value: e, defaultCountry: t = "ES", placeholder: a, disable
78
79
  numberInputProps: {
79
80
  "aria-describedby": h ?? m,
80
81
  "aria-label": g,
81
- "aria-invalid": c || void 0
82
+ "aria-invalid": s || void 0
82
83
  }
83
84
  });
84
85
  });
85
- function d(e, t) {
86
+ function f(e, t) {
86
87
  typeof e == "function" ? e(t) : e && (e.current = t);
87
88
  }
88
89
  //#endregion
89
- export { u as InputPhone };
90
+ export { d as InputPhone };
@@ -1,27 +1,29 @@
1
1
  'use client';
2
2
  import './menu-button.css';
3
- import { Icon as e } from "./icon.js";
4
- import { forwardRef as t } from "react";
5
- import { jsx as n } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Icon as t } from "./icon.js";
5
+ import { forwardRef as n } from "react";
6
+ import { jsx as r } from "react/jsx-runtime";
6
7
  //#region src/stories/atoms/MenuButton/MenuButton.tsx
7
- var r = t(function({ isOpen: t = !1, label: r = "Menú", closeLabel: i, size: a = "md", className: o, ...s }, c) {
8
- return /* @__PURE__ */ n("button", {
9
- ref: c,
8
+ var i = n(function({ isOpen: n = !1, label: i, closeLabel: a, size: o = "md", className: s, ...c }, l) {
9
+ let u = e("menuButton");
10
+ return /* @__PURE__ */ r("button", {
11
+ ref: l,
10
12
  type: "button",
11
13
  className: [
12
14
  "menu-button",
13
- `menu-button--${a}`,
14
- o
15
+ `menu-button--${o}`,
16
+ s
15
17
  ].filter(Boolean).join(" "),
16
- "aria-label": t && i ? i : r,
17
- "aria-expanded": t,
18
- ...s,
19
- children: /* @__PURE__ */ n(e, {
18
+ "aria-label": n ? u("close", a) : u("open", i),
19
+ "aria-expanded": n,
20
+ ...c,
21
+ children: /* @__PURE__ */ r(t, {
20
22
  name: "menu",
21
- size: a === "lg" ? "lg" : "md",
23
+ size: o === "lg" ? "lg" : "md",
22
24
  className: "menu-button__icon"
23
25
  })
24
26
  });
25
27
  });
26
28
  //#endregion
27
- export { r as MenuButton };
29
+ export { i as MenuButton };
package/dist/menu.js CHANGED
@@ -1,51 +1,55 @@
1
1
  'use client';
2
2
  import './menu.css';
3
- import { t as e } from "./_shared/css-properties.js";
4
- import { n as t, t as n } from "./_shared/dropdownitems.js";
5
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
- import { Menu as a } from "@base-ui/react/menu";
3
+ import { n as e } from "./_shared/portal-container.js";
4
+ import { t } from "./_shared/css-properties.js";
5
+ import { n, t as r } from "./_shared/dropdownitems.js";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ import { Menu as o } from "@base-ui/react/menu";
7
8
  //#region src/stories/molecules/Menu/Menu.tsx
8
- function o(e) {
9
+ function s(e) {
9
10
  return ["menu__item", e ? "menu__item--destructive" : ""].filter(Boolean).join(" ");
10
11
  }
11
- function s({ trigger: s, items: c, value: l, onValueChange: u, renderLink: d = n, open: f, defaultOpen: p, onOpenChange: m, openOnHover: h = !1, hoverDelay: g = 150, side: _ = "bottom", align: v = "start", sideOffset: y = 4, minWidth: b = "10rem", maxWidth: x, size: S = "md", className: C }) {
12
- let w = s, T = typeof w.props?.id == "string" ? w.props.id : void 0, E = e({
13
- "min-width": b,
14
- "max-width": x
12
+ function c({ trigger: c, items: l, value: u, onValueChange: d, renderLink: f = r, open: p, defaultOpen: m, onOpenChange: h, openOnHover: g = !1, hoverDelay: _ = 150, side: v = "bottom", align: y = "start", sideOffset: b = 4, minWidth: x = "10rem", maxWidth: S, size: C = "md", container: w, className: T }) {
13
+ let E = e(w), D = c, O = typeof D.props?.id == "string" ? D.props.id : void 0, k = t({
14
+ "min-width": x,
15
+ "max-width": S
15
16
  });
16
- return /* @__PURE__ */ i(a.Root, {
17
- open: f,
18
- defaultOpen: p,
19
- onOpenChange: (e) => m?.(e),
20
- children: [/* @__PURE__ */ r(a.Trigger, {
21
- id: T,
22
- render: w,
23
- openOnHover: h,
24
- delay: g
25
- }), /* @__PURE__ */ r(a.Portal, { children: /* @__PURE__ */ r(a.Positioner, {
26
- className: "menu__positioner",
27
- side: _,
28
- align: v,
29
- sideOffset: y,
30
- children: /* @__PURE__ */ r(a.Popup, {
31
- ref: E,
32
- className: [
33
- "menu__content",
34
- S === "md" ? "" : `menu__content--${S}`,
35
- C
36
- ].filter(Boolean).join(" "),
37
- children: t({
38
- items: c,
39
- itemClass: o,
40
- separatorClass: "menu__separator",
41
- labelClass: "menu__label",
42
- radioValue: l,
43
- onRadioValueChange: u,
44
- renderLink: d
17
+ return /* @__PURE__ */ a(o.Root, {
18
+ open: p,
19
+ defaultOpen: m,
20
+ onOpenChange: (e) => h?.(e),
21
+ children: [/* @__PURE__ */ i(o.Trigger, {
22
+ id: O,
23
+ render: D,
24
+ openOnHover: g,
25
+ delay: _
26
+ }), /* @__PURE__ */ i(o.Portal, {
27
+ container: E,
28
+ children: /* @__PURE__ */ i(o.Positioner, {
29
+ className: "menu__positioner",
30
+ side: v,
31
+ align: y,
32
+ sideOffset: b,
33
+ children: /* @__PURE__ */ i(o.Popup, {
34
+ ref: k,
35
+ className: [
36
+ "menu__content",
37
+ C === "md" ? "" : `menu__content--${C}`,
38
+ T
39
+ ].filter(Boolean).join(" "),
40
+ children: n({
41
+ items: l,
42
+ itemClass: s,
43
+ separatorClass: "menu__separator",
44
+ labelClass: "menu__label",
45
+ radioValue: u,
46
+ onRadioValueChange: d,
47
+ renderLink: f
48
+ })
45
49
  })
46
50
  })
47
- }) })]
51
+ })]
48
52
  });
49
53
  }
50
54
  //#endregion
51
- export { s as Menu };
55
+ export { c as Menu };
package/dist/modal.js CHANGED
@@ -2,56 +2,57 @@
2
2
  import './modal.css';
3
3
  import { n as e } from "./_shared/brandmessagescontext.js";
4
4
  import { VisuallyHidden as t } from "./visually-hidden.js";
5
- import { CloseButton as n } from "./close-button.js";
6
- import { n as r, r as i, t as a } from "./_shared/dialogsurface.js";
7
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
- import { Dialog as l } from "@base-ui/react/dialog";
5
+ import { n } from "./_shared/portal-container.js";
6
+ import { CloseButton as r } from "./close-button.js";
7
+ import { n as i, r as a, t as o } from "./_shared/dialogsurface.js";
8
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ import { Dialog as u } from "@base-ui/react/dialog";
9
10
  //#region src/stories/molecules/Modal/Modal.tsx
10
- function u({ open: u, onClose: d, title: f, children: p, closeLabel: m, fallbackTitle: h, container: g, description: _, "aria-describedby": v, initialFocus: y, footer: b, footerClassName: x, ...S }) {
11
- let C = e("modal"), w = v === void 0 ? {} : { "aria-describedby": v }, T = y === void 0 ? {} : { initialFocus: y };
12
- return /* @__PURE__ */ s(l.Root, {
13
- open: u,
11
+ function d({ open: d, onClose: f, title: p, children: m, closeLabel: h, fallbackTitle: g, container: _, description: v, "aria-describedby": y, initialFocus: b, footer: x, footerClassName: S, ...C }) {
12
+ let w = e("modal"), T = n(_), E = y === void 0 ? {} : { "aria-describedby": y }, D = b === void 0 ? {} : { initialFocus: b };
13
+ return /* @__PURE__ */ c(u.Root, {
14
+ open: d,
14
15
  onOpenChange: (e) => {
15
- e || d();
16
+ e || f();
16
17
  },
17
- children: /* @__PURE__ */ c(l.Portal, {
18
- container: g,
19
- children: [/* @__PURE__ */ s(i, { className: "modal__overlay" }), /* @__PURE__ */ c(l.Popup, {
18
+ children: /* @__PURE__ */ l(u.Portal, {
19
+ container: T,
20
+ children: [/* @__PURE__ */ c(a, { className: "modal__overlay" }), /* @__PURE__ */ l(u.Popup, {
20
21
  className: "modal__content",
21
- ...w,
22
- ...T,
23
- ...S,
22
+ ...E,
23
+ ...D,
24
+ ...C,
24
25
  children: [
25
- f ? /* @__PURE__ */ c(r, {
26
+ p ? /* @__PURE__ */ l(i, {
26
27
  layout: "inline",
27
28
  className: "modal__header",
28
- children: [/* @__PURE__ */ s(l.Title, {
29
+ children: [/* @__PURE__ */ c(u.Title, {
29
30
  className: "modal__title",
30
- children: f
31
- }), /* @__PURE__ */ s(l.Close, {
31
+ children: p
32
+ }), /* @__PURE__ */ c(u.Close, {
32
33
  className: "modal__close",
33
- render: /* @__PURE__ */ s(n, { label: C("close", m) })
34
+ render: /* @__PURE__ */ c(r, { label: w("close", h) })
34
35
  })]
35
- }) : /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(l.Title, { render: /* @__PURE__ */ s(t, { children: C("fallbackTitle", h) }) }), /* @__PURE__ */ s(r, {
36
+ }) : /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(u.Title, { render: /* @__PURE__ */ c(t, { children: w("fallbackTitle", g) }) }), /* @__PURE__ */ c(i, {
36
37
  layout: "inline",
37
38
  noTitle: !0,
38
39
  className: "modal__header modal__header--no-title",
39
- children: /* @__PURE__ */ s(l.Close, {
40
+ children: /* @__PURE__ */ c(u.Close, {
40
41
  className: "modal__close",
41
- render: /* @__PURE__ */ s(n, { label: C("close", m) })
42
+ render: /* @__PURE__ */ c(r, { label: w("close", h) })
42
43
  })
43
44
  })] }),
44
- _ != null && /* @__PURE__ */ s(l.Description, {
45
+ v != null && /* @__PURE__ */ c(u.Description, {
45
46
  className: "modal__description",
46
- children: _
47
+ children: v
47
48
  }),
48
- /* @__PURE__ */ s("div", {
49
+ /* @__PURE__ */ c("div", {
49
50
  className: "modal__body",
50
- children: p
51
+ children: m
51
52
  }),
52
- b != null && /* @__PURE__ */ s(a, {
53
- className: ["modal__footer", x].filter(Boolean).join(" "),
54
- children: b
53
+ x != null && /* @__PURE__ */ c(o, {
54
+ className: ["modal__footer", S].filter(Boolean).join(" "),
55
+ children: x
55
56
  })
56
57
  ]
57
58
  })]
@@ -59,4 +60,4 @@ function u({ open: u, onClose: d, title: f, children: p, closeLabel: m, fallback
59
60
  });
60
61
  }
61
62
  //#endregion
62
- export { u as Modal };
63
+ export { d as Modal };