@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.
- package/CHANGELOG.md +168 -0
- package/dist/_shared/portal-container.js +9 -0
- package/dist/_types/atoms/AsyncMultiSelect/AsyncMultiSelect.d.ts +8 -7
- package/dist/_types/atoms/AsyncSelect/AsyncSelect.d.ts +8 -6
- package/dist/_types/atoms/InputPhone/InputPhone.d.ts +8 -5
- package/dist/_types/atoms/MenuButton/MenuButton.d.ts +22 -2
- package/dist/_types/atoms/MultiSelect/MultiSelect.d.ts +8 -6
- package/dist/_types/atoms/Popover/Popover.d.ts +8 -1
- package/dist/_types/atoms/Select/Select.d.ts +8 -7
- package/dist/_types/atoms/Tooltip/Tooltip.d.ts +7 -0
- package/dist/_types/constants/portal-container.d.ts +42 -0
- package/dist/_types/messages/BrandMessages.d.ts +41 -1
- package/dist/_types/messages/index.d.ts +1 -1
- package/dist/_types/molecules/AppLauncher/AppLauncher.d.ts +43 -8
- package/dist/_types/molecules/Breadcrumb/Breadcrumb.d.ts +10 -2
- package/dist/_types/molecules/CommandPalette/CommandPalette.d.ts +43 -8
- package/dist/_types/molecules/Consent/Consent.d.ts +93 -20
- package/dist/_types/molecules/Menu/Menu.d.ts +8 -1
- package/dist/_types/molecules/Modal/Modal.d.ts +8 -6
- package/dist/_types/molecules/NotificationButton/NotificationButton.d.ts +17 -4
- package/dist/_types/molecules/NotificationPanel/NotificationPanel.d.ts +54 -8
- package/dist/_types/molecules/OrgSwitcher/OrgSwitcher.d.ts +15 -1
- package/dist/_types/molecules/PrevNextNav/PrevNextNav.d.ts +17 -2
- package/dist/_types/molecules/Sheet/Sheet.d.ts +8 -7
- package/dist/_types/molecules/SidebarNav/SidebarNav.d.ts +18 -3
- package/dist/_types/molecules/SiteNav/SiteNav.d.ts +9 -0
- package/dist/_types/molecules/TableOfContents/TableOfContents.d.ts +11 -2
- package/dist/_types/molecules/UserMenu/UserMenu.d.ts +16 -1
- package/dist/_types/sections/AppHeader/AppHeader.d.ts +8 -2
- package/dist/_types/sections/AppRoot/AppRoot.d.ts +12 -1
- package/dist/_types/sections/AppShell/AppShell.d.ts +14 -1
- package/dist/_types/sections/FloatingDock/FloatingDock.d.ts +33 -3
- package/dist/_types/sections/Sidebar/Sidebar.d.ts +27 -3
- package/dist/_types/sections/SiteHeader/SiteHeader.d.ts +22 -3
- package/dist/_types/sections/SiteShell/SiteShell.d.ts +11 -5
- package/dist/_types/templates/OnboardingShell/OnboardingShell.d.ts +19 -2
- package/dist/_types/templates/PublicPageShell/PublicPageShell.d.ts +42 -6
- package/dist/app-header.js +1 -1
- package/dist/app-launcher.js +73 -63
- package/dist/app-root.js +10 -8
- package/dist/app-shell.js +51 -50
- package/dist/async-multi-select.js +65 -64
- package/dist/async-select.js +49 -48
- package/dist/breadcrumb.js +24 -21
- package/dist/command-palette.js +38 -36
- package/dist/consent.js +75 -73
- package/dist/floating-dock.js +42 -41
- package/dist/input-phone.js +38 -37
- package/dist/menu-button.js +16 -14
- package/dist/menu.js +44 -40
- package/dist/modal.js +32 -31
- package/dist/multi-select.js +106 -105
- package/dist/notification-button.js +18 -17
- package/dist/notification-panel.js +81 -80
- package/dist/onboarding-shell.js +36 -35
- package/dist/org-switcher.js +64 -59
- package/dist/popover.js +27 -22
- package/dist/prev-next-nav.js +38 -36
- package/dist/public-page-shell.js +24 -20
- package/dist/select.js +70 -69
- package/dist/sheet.js +30 -29
- package/dist/sidebar-nav.js +91 -90
- package/dist/sidebar.js +72 -71
- package/dist/site-header.js +44 -43
- package/dist/site-nav.js +27 -25
- package/dist/site-shell.js +23 -15
- package/dist/table-of-contents.js +30 -27
- package/dist/toaster.js +57 -53
- package/dist/tooltip.js +45 -41
- package/dist/user-menu.js +58 -52
- 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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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
|
|
15
|
-
|
|
16
|
-
|
|
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":
|
|
19
|
-
...
|
|
20
|
-
children: /* @__PURE__ */
|
|
20
|
+
"aria-label": C("regionLabel", b),
|
|
21
|
+
...S,
|
|
22
|
+
children: /* @__PURE__ */ p("div", {
|
|
21
23
|
className: "consent-banner__inner",
|
|
22
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ p("div", {
|
|
23
25
|
className: "consent-banner__text",
|
|
24
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ f(r, {
|
|
25
27
|
level: 2,
|
|
26
28
|
size: 3,
|
|
27
29
|
className: "consent-banner__title",
|
|
28
|
-
children:
|
|
29
|
-
}), /* @__PURE__ */
|
|
30
|
+
children: l === void 0 ? C("title") : l
|
|
31
|
+
}), /* @__PURE__ */ p(a, {
|
|
30
32
|
className: "consent-banner__description",
|
|
31
|
-
children: [
|
|
32
|
-
href:
|
|
33
|
-
external:
|
|
34
|
-
children:
|
|
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__ */
|
|
39
|
+
}), /* @__PURE__ */ p("div", {
|
|
38
40
|
className: "consent-banner__actions",
|
|
39
41
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
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
|
|
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
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
...
|
|
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
|
-
},
|
|
76
|
-
className: ["consent-preferences",
|
|
77
|
-
children: /* @__PURE__ */
|
|
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:
|
|
81
|
+
children: i.map((e) => /* @__PURE__ */ f("li", {
|
|
80
82
|
className: "consent-preferences__category",
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
label:
|
|
83
|
-
helperText:
|
|
84
|
-
checked:
|
|
85
|
-
disabled:
|
|
86
|
-
onCheckedChange: (
|
|
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
|
-
},
|
|
90
|
+
}, e.id))
|
|
89
91
|
})
|
|
90
|
-
});
|
|
91
|
-
return
|
|
92
|
-
open:
|
|
93
|
-
onClose: () =>
|
|
94
|
-
title: typeof
|
|
95
|
-
...
|
|
96
|
-
container:
|
|
97
|
-
children:
|
|
98
|
-
}) : /* @__PURE__ */
|
|
99
|
-
open:
|
|
100
|
-
onOpenChange:
|
|
101
|
-
side:
|
|
102
|
-
title:
|
|
103
|
-
...
|
|
104
|
-
container:
|
|
105
|
-
children:
|
|
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 {
|
|
111
|
+
export { m as ConsentBanner, g as ConsentPreferences };
|
package/dist/floating-dock.js
CHANGED
|
@@ -1,72 +1,73 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './floating-dock.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
|
|
13
|
-
let [
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
ref:
|
|
16
|
-
className: ["floating-dock",
|
|
17
|
-
"data-position":
|
|
18
|
-
...
|
|
19
|
-
children: /* @__PURE__ */
|
|
20
|
-
open:
|
|
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: !
|
|
24
|
-
onOpenChange: (e) =>
|
|
24
|
+
disablePointerDismissal: !T,
|
|
25
|
+
onOpenChange: (e) => y?.(e),
|
|
25
26
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ s(l.Trigger, { render: /* @__PURE__ */ c(r, {
|
|
27
28
|
variant: "primary",
|
|
28
29
|
size: "lg",
|
|
29
30
|
iconOnly: !0,
|
|
30
|
-
"aria-label":
|
|
31
|
+
"aria-label": u,
|
|
31
32
|
className: "floating-dock__trigger",
|
|
32
|
-
children: [
|
|
33
|
+
children: [h ?? /* @__PURE__ */ s(t, {
|
|
33
34
|
name: "message",
|
|
34
35
|
size: "md"
|
|
35
|
-
}),
|
|
36
|
-
count:
|
|
37
|
-
max:
|
|
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
|
-
|
|
44
|
+
w && x > 0 && /* @__PURE__ */ s(n, {
|
|
44
45
|
"aria-live": "polite",
|
|
45
|
-
children:
|
|
46
|
+
children: O("badge", C)(x)
|
|
46
47
|
}),
|
|
47
|
-
|
|
48
|
-
container:
|
|
48
|
+
k && /* @__PURE__ */ s(l.Portal, {
|
|
49
|
+
container: k,
|
|
49
50
|
className: "floating-dock__portal",
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ c(l.Popup, {
|
|
51
52
|
className: "floating-dock__panel",
|
|
52
53
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ c("header", {
|
|
54
55
|
className: "floating-dock__header",
|
|
55
|
-
children: [
|
|
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:
|
|
58
|
-
}),
|
|
58
|
+
children: d
|
|
59
|
+
}), p != null && /* @__PURE__ */ s(l.Description, {
|
|
59
60
|
className: "floating-dock__description",
|
|
60
|
-
children:
|
|
61
|
+
children: p
|
|
61
62
|
})]
|
|
62
63
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ s(l.Close, {
|
|
64
65
|
className: "floating-dock__close",
|
|
65
|
-
render: /* @__PURE__ */
|
|
66
|
+
render: /* @__PURE__ */ s(i, { label: O("close", b) })
|
|
66
67
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ s("div", {
|
|
68
69
|
className: "floating-dock__body",
|
|
69
|
-
children:
|
|
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 {
|
|
80
|
+
export { u as FloatingDock };
|
package/dist/input-phone.js
CHANGED
|
@@ -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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
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
|
|
11
|
-
let
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
value:
|
|
14
|
-
onValueChange: (e) =>
|
|
15
|
-
disabled:
|
|
16
|
-
children: [/* @__PURE__ */
|
|
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":
|
|
19
|
-
children: [/* @__PURE__ */
|
|
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:
|
|
23
|
+
size: b
|
|
23
24
|
})]
|
|
24
|
-
}), /* @__PURE__ */
|
|
25
|
-
container:
|
|
26
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
32
|
-
className:
|
|
33
|
-
children:
|
|
34
|
-
value:
|
|
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__ */
|
|
37
|
-
},
|
|
37
|
+
children: /* @__PURE__ */ a(s.ItemText, { children: t })
|
|
38
|
+
}, v(e)))
|
|
38
39
|
})
|
|
39
40
|
})
|
|
40
41
|
})]
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
|
-
var
|
|
44
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
48
|
-
|
|
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:
|
|
53
|
+
placeholder: n,
|
|
53
54
|
disabled: o,
|
|
54
55
|
readOnly: y,
|
|
55
56
|
required: v,
|
|
56
57
|
autoComplete: _,
|
|
57
|
-
id:
|
|
58
|
+
id: d,
|
|
58
59
|
name: p,
|
|
59
|
-
inputComponent:
|
|
60
|
-
return /* @__PURE__ */
|
|
60
|
+
inputComponent: i(() => r(function(e, t) {
|
|
61
|
+
return /* @__PURE__ */ a("input", {
|
|
61
62
|
...e,
|
|
62
63
|
ref: (e) => {
|
|
63
|
-
|
|
64
|
+
f(t, e), f(E, e);
|
|
64
65
|
},
|
|
65
66
|
className: "input-phone__number"
|
|
66
67
|
});
|
|
67
68
|
}), [E]),
|
|
68
|
-
countrySelectComponent:
|
|
69
|
+
countrySelectComponent: u,
|
|
69
70
|
countrySelectProps: {
|
|
70
|
-
size:
|
|
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":
|
|
82
|
+
"aria-invalid": s || void 0
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
85
|
});
|
|
85
|
-
function
|
|
86
|
+
function f(e, t) {
|
|
86
87
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
87
88
|
}
|
|
88
89
|
//#endregion
|
|
89
|
-
export {
|
|
90
|
+
export { d as InputPhone };
|
package/dist/menu-button.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './menu-button.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
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--${
|
|
14
|
-
|
|
15
|
+
`menu-button--${o}`,
|
|
16
|
+
s
|
|
15
17
|
].filter(Boolean).join(" "),
|
|
16
|
-
"aria-label":
|
|
17
|
-
"aria-expanded":
|
|
18
|
-
...
|
|
19
|
-
children: /* @__PURE__ */
|
|
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:
|
|
23
|
+
size: o === "lg" ? "lg" : "md",
|
|
22
24
|
className: "menu-button__icon"
|
|
23
25
|
})
|
|
24
26
|
});
|
|
25
27
|
});
|
|
26
28
|
//#endregion
|
|
27
|
-
export {
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
|
9
|
+
function s(e) {
|
|
9
10
|
return ["menu__item", e ? "menu__item--destructive" : ""].filter(Boolean).join(" ");
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
let w =
|
|
13
|
-
"min-width":
|
|
14
|
-
"max-width":
|
|
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__ */
|
|
17
|
-
open:
|
|
18
|
-
defaultOpen:
|
|
19
|
-
onOpenChange: (e) =>
|
|
20
|
-
children: [/* @__PURE__ */
|
|
21
|
-
id:
|
|
22
|
-
render:
|
|
23
|
-
openOnHover:
|
|
24
|
-
delay:
|
|
25
|
-
}), /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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 {
|
|
55
|
+
export { c as Menu };
|