@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.
- package/CHANGELOG.md +176 -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 +29 -1
- package/dist/_types/messages/index.d.ts +1 -1
- package/dist/_types/molecules/Breadcrumb/Breadcrumb.d.ts +10 -2
- package/dist/_types/molecules/EmptyState/EmptyState.d.ts +2 -0
- package/dist/_types/molecules/Menu/Menu.d.ts +8 -1
- package/dist/_types/molecules/Modal/Modal.d.ts +8 -6
- package/dist/_types/molecules/OrgSwitcher/OrgSwitcher.d.ts +15 -1
- package/dist/_types/molecules/PageIntro/PageIntro.d.ts +12 -7
- 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/Hero/Hero.d.ts +4 -1
- 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 +62 -58
- 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/brand.css +12 -2
- package/dist/breadcrumb.js +24 -21
- package/dist/input-phone.js +38 -37
- package/dist/link.css +1 -1
- 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/onboarding-shell.js +36 -35
- package/dist/org-switcher.js +64 -59
- package/dist/page-intro.css +1 -1
- package/dist/page-intro.js +23 -17
- 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/tokens.css +2 -2
- package/dist/tooltip.js +45 -41
- package/dist/user-menu.js +58 -52
- package/package.json +1 -1
- package/src/tokens/molecules/page-intro.css +1 -1
- package/src/tokens/scss/molecules/_page-intro.scss +1 -1
package/dist/breadcrumb.js
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import './breadcrumb.css';
|
|
2
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
5
|
//#region src/stories/molecules/Breadcrumb/Breadcrumb.tsx
|
|
4
|
-
function
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
+
function r({ children: e, ...n }) {
|
|
7
|
+
return /* @__PURE__ */ t("a", {
|
|
6
8
|
...n,
|
|
7
|
-
children:
|
|
9
|
+
children: e
|
|
8
10
|
});
|
|
9
11
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
function i({ items: i, renderLink: a = r, separator: o = "/", ariaLabel: s, className: c }) {
|
|
13
|
+
let l = e("breadcrumb");
|
|
14
|
+
return /* @__PURE__ */ t("nav", {
|
|
15
|
+
"aria-label": l("label", s),
|
|
16
|
+
className: ["breadcrumb", c].filter(Boolean).join(" "),
|
|
17
|
+
children: /* @__PURE__ */ t("ol", {
|
|
15
18
|
className: "breadcrumb__list",
|
|
16
|
-
children:
|
|
17
|
-
let s =
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
+
children: i.map((e, r) => {
|
|
20
|
+
let s = r === i.length - 1;
|
|
21
|
+
return /* @__PURE__ */ n("li", {
|
|
19
22
|
className: ["breadcrumb__item", s ? "breadcrumb__item--current" : ""].filter(Boolean).join(" "),
|
|
20
|
-
children: [s || !
|
|
23
|
+
children: [s || !e.href ? /* @__PURE__ */ t("span", {
|
|
21
24
|
className: s ? "breadcrumb__current" : "breadcrumb__static",
|
|
22
25
|
...s ? { "aria-current": "page" } : {},
|
|
23
|
-
children:
|
|
24
|
-
}) :
|
|
25
|
-
href:
|
|
26
|
-
children:
|
|
26
|
+
children: e.label
|
|
27
|
+
}) : a({
|
|
28
|
+
href: e.href,
|
|
29
|
+
children: e.label,
|
|
27
30
|
className: "breadcrumb__link"
|
|
28
|
-
}), !s && /* @__PURE__ */
|
|
31
|
+
}), !s && /* @__PURE__ */ t("span", {
|
|
29
32
|
className: "breadcrumb__separator",
|
|
30
33
|
"aria-hidden": "true",
|
|
31
|
-
children:
|
|
34
|
+
children: o
|
|
32
35
|
})]
|
|
33
|
-
}, `${
|
|
36
|
+
}, `${e.label}-${r}`);
|
|
34
37
|
})
|
|
35
38
|
})
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
//#endregion
|
|
39
|
-
export {
|
|
42
|
+
export { i as Breadcrumb };
|
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/link.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(button.link){appearance:none;font:inherit;text-align:inherit;color:inherit;background:0 0;border:0;margin:0;padding:0}a:where(:not(.button)),:where(.link){color:var(--link-color);box-shadow:inset 0 calc(-1 * var(--link-underline-width)) 0 0 currentColor;cursor:var(--link-cursor);padding-block-end:var(--link-underline-offset);text-decoration:none}a:where(:not(.button)):hover,:where(.link):hover{color:var(--link-hover-color);box-shadow:inset 0 calc(-1 * var(--link-hover-underline-width)) 0 0 currentColor}a:focus-visible,:where(.link):focus-visible{outline:var(--link-focus-ring-width) solid var(--link-focus-ring-color);outline-offset:var(--link-focus-ring-offset)}.link--with-icon{align-items:center;gap:var(--link-icon-gap);display:inline-flex}.link__icon{flex-shrink:0}.link--ink{color:var(--link-ink-color);box-shadow:inset 0 calc(-1 * var(--link-ink-underline-width)) 0 0 currentColor}.link--ink:hover{color:var(--link-ink-color);box-shadow:inset 0 calc(-1 * var(--link-ink-hover-underline-width)) 0 0 currentColor}.link--accent-1{color:var(--link-accent-1-color);box-shadow:inset 0 calc(-1 * var(--link-accent-1-underline-width)) 0 0 currentColor}.link--accent-1:hover{color:var(--link-accent-1-hover-color);box-shadow:inset 0 calc(-1 * var(--link-accent-1-hover-underline-width)) 0 0 currentColor}
|
|
1
|
+
:where(button.link){appearance:none;font:inherit;text-align:inherit;color:inherit;background:0 0;border:0;margin:0;padding:0}a:where(:not(.button)),:where(.link){color:var(--link-color);box-shadow:inset 0 calc(-1 * var(--link-underline-width)) 0 0 currentColor;cursor:var(--link-cursor);inline-size:fit-content;padding-block-end:var(--link-underline-offset);text-decoration:none}a:where(:not(.button)):hover,:where(.link):hover{color:var(--link-hover-color);box-shadow:inset 0 calc(-1 * var(--link-hover-underline-width)) 0 0 currentColor}a:focus-visible,:where(.link):focus-visible{outline:var(--link-focus-ring-width) solid var(--link-focus-ring-color);outline-offset:var(--link-focus-ring-offset)}.link--with-icon{align-items:center;gap:var(--link-icon-gap);display:inline-flex}.link__icon{flex-shrink:0}.link--ink{color:var(--link-ink-color);box-shadow:inset 0 calc(-1 * var(--link-ink-underline-width)) 0 0 currentColor}.link--ink:hover{color:var(--link-ink-color);box-shadow:inset 0 calc(-1 * var(--link-ink-hover-underline-width)) 0 0 currentColor}.link--accent-1{color:var(--link-accent-1-color);box-shadow:inset 0 calc(-1 * var(--link-accent-1-underline-width)) 0 0 currentColor}.link--accent-1:hover{color:var(--link-accent-1-hover-color);box-shadow:inset 0 calc(-1 * var(--link-accent-1-hover-underline-width)) 0 0 currentColor}
|
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 };
|
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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
|
11
|
-
let
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
open:
|
|
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 ||
|
|
16
|
+
e || f();
|
|
16
17
|
},
|
|
17
|
-
children: /* @__PURE__ */
|
|
18
|
-
container:
|
|
19
|
-
children: [/* @__PURE__ */
|
|
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
|
-
...
|
|
22
|
-
...
|
|
23
|
-
...
|
|
22
|
+
...E,
|
|
23
|
+
...D,
|
|
24
|
+
...C,
|
|
24
25
|
children: [
|
|
25
|
-
|
|
26
|
+
p ? /* @__PURE__ */ l(i, {
|
|
26
27
|
layout: "inline",
|
|
27
28
|
className: "modal__header",
|
|
28
|
-
children: [/* @__PURE__ */
|
|
29
|
+
children: [/* @__PURE__ */ c(u.Title, {
|
|
29
30
|
className: "modal__title",
|
|
30
|
-
children:
|
|
31
|
-
}), /* @__PURE__ */
|
|
31
|
+
children: p
|
|
32
|
+
}), /* @__PURE__ */ c(u.Close, {
|
|
32
33
|
className: "modal__close",
|
|
33
|
-
render: /* @__PURE__ */
|
|
34
|
+
render: /* @__PURE__ */ c(r, { label: w("close", h) })
|
|
34
35
|
})]
|
|
35
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
40
|
+
children: /* @__PURE__ */ c(u.Close, {
|
|
40
41
|
className: "modal__close",
|
|
41
|
-
render: /* @__PURE__ */
|
|
42
|
+
render: /* @__PURE__ */ c(r, { label: w("close", h) })
|
|
42
43
|
})
|
|
43
44
|
})] }),
|
|
44
|
-
|
|
45
|
+
v != null && /* @__PURE__ */ c(u.Description, {
|
|
45
46
|
className: "modal__description",
|
|
46
|
-
children:
|
|
47
|
+
children: v
|
|
47
48
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ c("div", {
|
|
49
50
|
className: "modal__body",
|
|
50
|
-
children:
|
|
51
|
+
children: m
|
|
51
52
|
}),
|
|
52
|
-
|
|
53
|
-
className: ["modal__footer",
|
|
54
|
-
children:
|
|
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 {
|
|
63
|
+
export { d as Modal };
|