@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
package/dist/consent.js CHANGED
@@ -1,109 +1,111 @@
1
1
  'use client';
2
2
  import './consent.css';
3
- import { VisuallyHidden as e } from "./visually-hidden.js";
4
- import { Button as t } from "./button.js";
5
- import { Heading as n } from "./heading.js";
6
- import { Link as r } from "./link.js";
7
- import { Paragraph as i } from "./paragraph.js";
8
- import { SwitcherField as a } from "./switcher-field.js";
9
- import { Sheet as o } from "./sheet.js";
10
- import { Modal as s } from "./modal.js";
11
- import { useEffect as c, useState as l } from "react";
12
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.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 { Link as i } from "./link.js";
8
+ import { Paragraph as a } from "./paragraph.js";
9
+ import { SwitcherField as o } from "./switcher-field.js";
10
+ import { Sheet as s } from "./sheet.js";
11
+ import { Modal as c } from "./modal.js";
12
+ import { useEffect as l, useState as u } from "react";
13
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
13
14
  //#region src/stories/molecules/Consent/Consent.tsx
14
- function p({ open: e = !0, onAcceptAll: a, onRejectAll: o, onOpenPreferences: s, title: c = "Cookies", description: l = "Usamos cookies propias y de terceros para que el sitio funcione y para entender cómo se usa. Puedes aceptarlas todas, rechazarlas o elegir por categorías.", policyHref: p, policyLabel: m = "Política de cookies", policyExternal: h = !1, acceptAllLabel: g = "Aceptar todas", rejectAllLabel: _ = "Rechazar", preferencesLabel: v = "Preferencias", regionLabel: y = "Consentimiento de cookies", className: b, ...x }) {
15
- return e ? /* @__PURE__ */ d("aside", {
16
- className: ["consent-banner", b].filter(Boolean).join(" "),
15
+ function m({ open: t = !0, onAcceptAll: o, onRejectAll: s, onOpenPreferences: c, title: l, description: u, policyHref: m, policyLabel: h, policyExternal: g = !1, acceptAllLabel: _, rejectAllLabel: v, preferencesLabel: y, regionLabel: b, className: x, ...S }) {
16
+ let C = e("consent");
17
+ return t ? /* @__PURE__ */ f("aside", {
18
+ className: ["consent-banner", x].filter(Boolean).join(" "),
17
19
  role: "region",
18
- "aria-label": y,
19
- ...x,
20
- children: /* @__PURE__ */ f("div", {
20
+ "aria-label": C("regionLabel", b),
21
+ ...S,
22
+ children: /* @__PURE__ */ p("div", {
21
23
  className: "consent-banner__inner",
22
- children: [/* @__PURE__ */ f("div", {
24
+ children: [/* @__PURE__ */ p("div", {
23
25
  className: "consent-banner__text",
24
- children: [/* @__PURE__ */ d(n, {
26
+ children: [/* @__PURE__ */ f(r, {
25
27
  level: 2,
26
28
  size: 3,
27
29
  className: "consent-banner__title",
28
- children: c
29
- }), /* @__PURE__ */ f(i, {
30
+ children: l === void 0 ? C("title") : l
31
+ }), /* @__PURE__ */ p(a, {
30
32
  className: "consent-banner__description",
31
- children: [l, p !== void 0 && /* @__PURE__ */ f(u, { children: [" ", /* @__PURE__ */ d(r, {
32
- href: p,
33
- external: h,
34
- children: m
33
+ children: [u, m !== void 0 && /* @__PURE__ */ p(d, { children: [" ", /* @__PURE__ */ f(i, {
34
+ href: m,
35
+ external: g,
36
+ children: h
35
37
  })] })]
36
38
  })]
37
- }), /* @__PURE__ */ f("div", {
39
+ }), /* @__PURE__ */ p("div", {
38
40
  className: "consent-banner__actions",
39
41
  children: [
40
- /* @__PURE__ */ d(t, {
41
- onClick: a,
42
- children: g
43
- }),
44
- /* @__PURE__ */ d(t, {
42
+ /* @__PURE__ */ f(n, {
45
43
  onClick: o,
46
- children: _
44
+ children: C("acceptAll", _)
47
45
  }),
48
- s && /* @__PURE__ */ d(t, {
49
- variant: "outline",
46
+ /* @__PURE__ */ f(n, {
50
47
  onClick: s,
51
- children: v
48
+ children: C("rejectAll", v)
49
+ }),
50
+ c && /* @__PURE__ */ f(n, {
51
+ variant: "outline",
52
+ onClick: c,
53
+ children: C("preferences", y)
52
54
  })
53
55
  ]
54
56
  })]
55
57
  })
56
58
  }) : null;
57
59
  }
58
- function m(e, t) {
60
+ function h(e, t) {
59
61
  let n = { ...e };
60
62
  for (let e of t) e.required && (n[e.id] = !0);
61
63
  return n;
62
64
  }
63
- function h({ open: t, onOpenChange: n, categories: r, value: i, onChange: p, onSave: h, surface: g = "modal", side: _ = "right", title: v = "Preferencias de cookies", closeLabel: y, alwaysOnLabel: b = "Siempre activa", container: x, className: S }) {
64
- let C = p !== void 0, [w, T] = l(() => m(i, r));
65
- c(() => {
66
- t && !C && T(m(i, r));
67
- }, [t, C]);
68
- let E = C ? m(i, r) : w, D = (e) => {
69
- C ? p(e) : T(e), h?.(e);
70
- }, O = (e, t) => {
71
- D({
72
- ...E,
65
+ function g({ open: n, onOpenChange: r, categories: i, value: a, onChange: m, onSave: g, surface: _ = "modal", side: v = "right", title: y, closeLabel: b, alwaysOnLabel: x, container: S, className: C }) {
66
+ let w = e("consent"), T = m !== void 0, [E, D] = u(() => h(a, i));
67
+ l(() => {
68
+ n && !T && D(h(a, i));
69
+ }, [n, T]);
70
+ let O = T ? h(a, i) : E, k = (e) => {
71
+ T ? m(e) : D(e), g?.(e);
72
+ }, A = (e, t) => {
73
+ k({
74
+ ...O,
73
75
  [e]: t
74
76
  });
75
- }, k = /* @__PURE__ */ d("div", {
76
- className: ["consent-preferences", S].filter(Boolean).join(" "),
77
- children: /* @__PURE__ */ d("ul", {
77
+ }, j = /* @__PURE__ */ f("div", {
78
+ className: ["consent-preferences", C].filter(Boolean).join(" "),
79
+ children: /* @__PURE__ */ f("ul", {
78
80
  className: "consent-preferences__list",
79
- children: r.map((t) => /* @__PURE__ */ d("li", {
81
+ children: i.map((e) => /* @__PURE__ */ f("li", {
80
82
  className: "consent-preferences__category",
81
- children: /* @__PURE__ */ d(a, {
82
- label: t.required ? /* @__PURE__ */ f(u, { children: [t.name, /* @__PURE__ */ d(e, { children: `, ${b}` })] }) : t.name,
83
- helperText: t.description,
84
- checked: t.required ? !0 : E[t.id] === !0,
85
- disabled: t.required,
86
- onCheckedChange: (e) => O(t.id, e)
83
+ children: /* @__PURE__ */ f(o, {
84
+ label: e.required ? /* @__PURE__ */ p(d, { children: [e.name, /* @__PURE__ */ f(t, { children: `, ${w("alwaysOn", x)}` })] }) : e.name,
85
+ helperText: e.description,
86
+ checked: e.required ? !0 : O[e.id] === !0,
87
+ disabled: e.required,
88
+ onCheckedChange: (t) => A(e.id, t)
87
89
  })
88
- }, t.id))
90
+ }, e.id))
89
91
  })
90
- });
91
- return g === "modal" ? /* @__PURE__ */ d(s, {
92
- open: t,
93
- onClose: () => n(!1),
94
- title: typeof v == "string" ? v : void 0,
95
- ...y === void 0 ? {} : { closeLabel: y },
96
- container: x,
97
- children: k
98
- }) : /* @__PURE__ */ d(o, {
99
- open: t,
100
- onOpenChange: n,
101
- side: _,
102
- title: v,
103
- ...y === void 0 ? {} : { closeLabel: y },
104
- container: x,
105
- children: k
92
+ }), M = y === void 0 ? w("preferencesTitle") : y;
93
+ return _ === "modal" ? /* @__PURE__ */ f(c, {
94
+ open: n,
95
+ onClose: () => r(!1),
96
+ title: typeof M == "string" ? M : void 0,
97
+ ...b === void 0 ? {} : { closeLabel: b },
98
+ container: S,
99
+ children: j
100
+ }) : /* @__PURE__ */ f(s, {
101
+ open: n,
102
+ onOpenChange: r,
103
+ side: v,
104
+ title: M,
105
+ ...b === void 0 ? {} : { closeLabel: b },
106
+ container: S,
107
+ children: j
106
108
  });
107
109
  }
108
110
  //#endregion
109
- export { p as ConsentBanner, h as ConsentPreferences };
111
+ export { m as ConsentBanner, g as ConsentPreferences };
@@ -1,72 +1,73 @@
1
1
  'use client';
2
2
  import './floating-dock.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 { CloseButton as r } from "./close-button.js";
7
- import { NumberBadge as i } from "./number-badge.js";
8
- import { useState as a } from "react";
9
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
10
- import { Dialog as c } from "@base-ui/react/dialog";
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 { CloseButton as i } from "./close-button.js";
8
+ import { NumberBadge as a } from "./number-badge.js";
9
+ import { useState as o } from "react";
10
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
11
+ import { Dialog as l } from "@base-ui/react/dialog";
11
12
  //#region src/stories/sections/FloatingDock/FloatingDock.tsx
12
- function l({ label: l, title: u, titleHidden: d = !1, description: f, children: p, icon: m, position: h = "bottom-end", open: g, defaultOpen: _, onOpenChange: v, closeLabel: y = "Cerrar", badge: b = 0, badgeMax: x = 99, badgeLabel: S = (e) => `${e} mensajes nuevos`, badgeLive: C = !0, dismissOnOutsidePress: w = !1, className: T, ...E }) {
13
- let [D, O] = a(null);
14
- return /* @__PURE__ */ o("div", {
15
- ref: O,
16
- className: ["floating-dock", T].filter(Boolean).join(" "),
17
- "data-position": h,
18
- ...E,
19
- children: /* @__PURE__ */ s(c.Root, {
20
- open: g,
21
- defaultOpen: _,
13
+ function u({ label: u, title: d, titleHidden: f = !1, description: p, children: m, icon: h, position: g = "bottom-end", open: _, defaultOpen: v, onOpenChange: y, closeLabel: b, badge: x = 0, badgeMax: S = 99, badgeLabel: C, badgeLive: w = !0, dismissOnOutsidePress: T = !1, className: E, ...D }) {
14
+ let O = e("floatingDock"), [k, A] = o(null);
15
+ return /* @__PURE__ */ s("div", {
16
+ ref: A,
17
+ className: ["floating-dock", E].filter(Boolean).join(" "),
18
+ "data-position": g,
19
+ ...D,
20
+ children: /* @__PURE__ */ c(l.Root, {
21
+ open: _,
22
+ defaultOpen: v,
22
23
  modal: !1,
23
- disablePointerDismissal: !w,
24
- onOpenChange: (e) => v?.(e),
24
+ disablePointerDismissal: !T,
25
+ onOpenChange: (e) => y?.(e),
25
26
  children: [
26
- /* @__PURE__ */ o(c.Trigger, { render: /* @__PURE__ */ s(n, {
27
+ /* @__PURE__ */ s(l.Trigger, { render: /* @__PURE__ */ c(r, {
27
28
  variant: "primary",
28
29
  size: "lg",
29
30
  iconOnly: !0,
30
- "aria-label": l,
31
+ "aria-label": u,
31
32
  className: "floating-dock__trigger",
32
- children: [m ?? /* @__PURE__ */ o(e, {
33
+ children: [h ?? /* @__PURE__ */ s(t, {
33
34
  name: "message",
34
35
  size: "md"
35
- }), b > 0 && /* @__PURE__ */ o(i, {
36
- count: b,
37
- max: x,
36
+ }), x > 0 && /* @__PURE__ */ s(a, {
37
+ count: x,
38
+ max: S,
38
39
  variant: "danger",
39
40
  "aria-hidden": "true",
40
41
  className: "floating-dock__badge"
41
42
  })]
42
43
  }) }),
43
- C && b > 0 && /* @__PURE__ */ o(t, {
44
+ w && x > 0 && /* @__PURE__ */ s(n, {
44
45
  "aria-live": "polite",
45
- children: S(b)
46
+ children: O("badge", C)(x)
46
47
  }),
47
- D && /* @__PURE__ */ o(c.Portal, {
48
- container: D,
48
+ k && /* @__PURE__ */ s(l.Portal, {
49
+ container: k,
49
50
  className: "floating-dock__portal",
50
- children: /* @__PURE__ */ s(c.Popup, {
51
+ children: /* @__PURE__ */ c(l.Popup, {
51
52
  className: "floating-dock__panel",
52
53
  children: [
53
- /* @__PURE__ */ s("header", {
54
+ /* @__PURE__ */ c("header", {
54
55
  className: "floating-dock__header",
55
- children: [d ? /* @__PURE__ */ o(c.Title, { render: /* @__PURE__ */ o(t, { children: u }) }) : /* @__PURE__ */ o(c.Title, {
56
+ children: [f ? /* @__PURE__ */ s(l.Title, { render: /* @__PURE__ */ s(n, { children: d }) }) : /* @__PURE__ */ s(l.Title, {
56
57
  className: "floating-dock__title",
57
- children: u
58
- }), f != null && /* @__PURE__ */ o(c.Description, {
58
+ children: d
59
+ }), p != null && /* @__PURE__ */ s(l.Description, {
59
60
  className: "floating-dock__description",
60
- children: f
61
+ children: p
61
62
  })]
62
63
  }),
63
- /* @__PURE__ */ o(c.Close, {
64
+ /* @__PURE__ */ s(l.Close, {
64
65
  className: "floating-dock__close",
65
- render: /* @__PURE__ */ o(r, { label: y })
66
+ render: /* @__PURE__ */ s(i, { label: O("close", b) })
66
67
  }),
67
- /* @__PURE__ */ o("div", {
68
+ /* @__PURE__ */ s("div", {
68
69
  className: "floating-dock__body",
69
- children: p
70
+ children: m
70
71
  })
71
72
  ]
72
73
  })
@@ -76,4 +77,4 @@ function l({ label: l, title: u, titleHidden: d = !1, description: f, children:
76
77
  });
77
78
  }
78
79
  //#endregion
79
- export { l as FloatingDock };
80
+ export { u as FloatingDock };
@@ -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 };