@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
|
@@ -1,139 +1,140 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './notification-panel.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 { 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 { Heading as i } from "./heading.js";
|
|
8
|
+
import { Paragraph as a } from "./paragraph.js";
|
|
9
|
+
import { Popover as o } from "./popover.js";
|
|
10
|
+
import { Text as s } from "./text.js";
|
|
11
|
+
import { NotificationButton as c } from "./notification-button.js";
|
|
12
|
+
import { useCallback as l, useId as u, useRef as d, useState as f } from "react";
|
|
13
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
13
14
|
//#region src/stories/molecules/NotificationPanel/NotificationPanel.tsx
|
|
14
|
-
function
|
|
15
|
+
function g(e) {
|
|
15
16
|
let t = parseFloat(e);
|
|
16
17
|
return Number.isNaN(t) ? 0 : e.endsWith("rem") ? t * parseFloat(getComputedStyle(document.documentElement).fontSize) : t;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function _() {
|
|
19
20
|
let e = document.documentElement;
|
|
20
|
-
return
|
|
21
|
+
return g(getComputedStyle(e).getPropertyValue("--notification-panel-offset").trim());
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
function v({ children: e, ...t }) {
|
|
24
|
+
return /* @__PURE__ */ m("a", {
|
|
24
25
|
...t,
|
|
25
26
|
children: e
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
var
|
|
29
|
-
function
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
let e =
|
|
36
|
-
return e ? e.querySelector(".notification-panel__item-action") ?? e.querySelector(
|
|
37
|
-
}, []),
|
|
38
|
-
e ||
|
|
39
|
-
},
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
trigger: /* @__PURE__ */
|
|
42
|
-
count:
|
|
43
|
-
max:
|
|
44
|
-
label:
|
|
45
|
-
countLabel:
|
|
29
|
+
var y = "button, a[href]", b = "notification-panel__footer-link";
|
|
30
|
+
function x({ items: g = [], count: x = 0, max: S, onRead: C, onMarkAllRead: w, allHref: T, preferencesHref: E, renderLink: D = v, label: O, countLabel: k, panelLabel: A, unreadLabel: j, emptyLabel: M, allLabel: N, preferencesLabel: P, markAllReadLabel: F, open: I, defaultOpen: L, onOpenChange: R, className: z }) {
|
|
31
|
+
let B = e("notificationPanel"), V = u(), H = d(null), [U, W] = f([]), G = (e) => e.unread && !U.includes(e.id), K = g.some(G), q = (e) => {
|
|
32
|
+
G(e) && (W((t) => [...t, e.id]), C(e.id));
|
|
33
|
+
}, J = () => {
|
|
34
|
+
W(g.map((e) => e.id)), w?.();
|
|
35
|
+
}, Y = l(() => {
|
|
36
|
+
let e = H.current;
|
|
37
|
+
return e ? e.querySelector(".notification-panel__item-action") ?? e.querySelector(y) : null;
|
|
38
|
+
}, []), X = (e, t) => {
|
|
39
|
+
e || W([]), R?.(e, t);
|
|
40
|
+
}, Z = `${V}-title`, Q = B("panel", A);
|
|
41
|
+
return /* @__PURE__ */ m(o, {
|
|
42
|
+
trigger: /* @__PURE__ */ m(c, {
|
|
43
|
+
count: x,
|
|
44
|
+
max: S,
|
|
45
|
+
label: O,
|
|
46
|
+
countLabel: k
|
|
46
47
|
}),
|
|
47
|
-
label:
|
|
48
|
+
label: Q,
|
|
48
49
|
align: "end",
|
|
49
|
-
sideOffset:
|
|
50
|
-
open:
|
|
51
|
-
defaultOpen:
|
|
52
|
-
onOpenChange:
|
|
53
|
-
initialFocus:
|
|
54
|
-
className: ["notification-panel",
|
|
55
|
-
children: /* @__PURE__ */
|
|
50
|
+
sideOffset: _,
|
|
51
|
+
open: I,
|
|
52
|
+
defaultOpen: L,
|
|
53
|
+
onOpenChange: X,
|
|
54
|
+
initialFocus: Y,
|
|
55
|
+
className: ["notification-panel", z].filter(Boolean).join(" "),
|
|
56
|
+
children: /* @__PURE__ */ h("div", {
|
|
56
57
|
className: "notification-panel__body",
|
|
57
|
-
ref:
|
|
58
|
+
ref: H,
|
|
58
59
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ m(n, { children: /* @__PURE__ */ m(i, {
|
|
60
61
|
level: 2,
|
|
61
62
|
size: 3,
|
|
62
|
-
id:
|
|
63
|
-
children:
|
|
63
|
+
id: Z,
|
|
64
|
+
children: Q
|
|
64
65
|
}) }),
|
|
65
|
-
|
|
66
|
+
g.length === 0 ? /* @__PURE__ */ m("div", {
|
|
66
67
|
className: "notification-panel__empty",
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ m(a, {
|
|
68
69
|
size: "small",
|
|
69
|
-
children:
|
|
70
|
+
children: B("empty", M)
|
|
70
71
|
})
|
|
71
|
-
}) : /* @__PURE__ */
|
|
72
|
+
}) : /* @__PURE__ */ m("ul", {
|
|
72
73
|
className: "notification-panel__list",
|
|
73
|
-
"aria-labelledby":
|
|
74
|
-
children:
|
|
75
|
-
let i =
|
|
76
|
-
return /* @__PURE__ */
|
|
74
|
+
"aria-labelledby": Z,
|
|
75
|
+
children: g.map((e, r) => {
|
|
76
|
+
let i = G(e), a = `${V}-t-${r}`;
|
|
77
|
+
return /* @__PURE__ */ m("li", {
|
|
77
78
|
className: "notification-panel__item",
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ h("button", {
|
|
79
80
|
type: "button",
|
|
80
81
|
className: "notification-panel__item-action",
|
|
81
82
|
"aria-disabled": i ? void 0 : !0,
|
|
82
|
-
onClick: () =>
|
|
83
|
-
children: [/* @__PURE__ */
|
|
83
|
+
onClick: () => q(e),
|
|
84
|
+
children: [/* @__PURE__ */ m("span", {
|
|
84
85
|
className: "notification-panel__indicator",
|
|
85
|
-
children: i && /* @__PURE__ */
|
|
86
|
+
children: i && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(t, {
|
|
86
87
|
name: "dot",
|
|
87
88
|
size: "sm",
|
|
88
89
|
className: "notification-panel__dot"
|
|
89
|
-
}), /* @__PURE__ */
|
|
90
|
-
}), /* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ m(n, { children: B("unread", j) })] })
|
|
91
|
+
}), /* @__PURE__ */ h("span", {
|
|
91
92
|
className: "notification-panel__item-text",
|
|
92
93
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ m(s, {
|
|
94
95
|
id: a,
|
|
95
96
|
tone: i ? "default" : "muted",
|
|
96
97
|
className: "notification-panel__item-title",
|
|
97
|
-
children:
|
|
98
|
+
children: e.title
|
|
98
99
|
}),
|
|
99
|
-
|
|
100
|
+
e.body && /* @__PURE__ */ m(s, {
|
|
100
101
|
tone: "muted",
|
|
101
102
|
className: "notification-panel__item-body",
|
|
102
|
-
children:
|
|
103
|
+
children: e.body
|
|
103
104
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ m(s, {
|
|
105
106
|
tone: "muted",
|
|
106
107
|
className: "notification-panel__item-time",
|
|
107
|
-
children:
|
|
108
|
+
children: e.time
|
|
108
109
|
})
|
|
109
110
|
]
|
|
110
111
|
})]
|
|
111
112
|
})
|
|
112
|
-
},
|
|
113
|
+
}, e.id);
|
|
113
114
|
})
|
|
114
115
|
}),
|
|
115
|
-
|
|
116
|
+
w && K && /* @__PURE__ */ m("div", {
|
|
116
117
|
className: "notification-panel__mark-all",
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ m(r, {
|
|
118
119
|
variant: "outline",
|
|
119
120
|
size: "sm",
|
|
120
121
|
block: !0,
|
|
121
|
-
onClick:
|
|
122
|
-
children:
|
|
122
|
+
onClick: J,
|
|
123
|
+
children: B("markAllRead", F)
|
|
123
124
|
})
|
|
124
125
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ m("div", {
|
|
126
127
|
className: "notification-panel__footer",
|
|
127
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ h("div", {
|
|
128
129
|
className: "notification-panel__footer-links",
|
|
129
|
-
children: [
|
|
130
|
-
href: w,
|
|
131
|
-
className: y,
|
|
132
|
-
children: M
|
|
133
|
-
}), E({
|
|
130
|
+
children: [D({
|
|
134
131
|
href: T,
|
|
135
|
-
className:
|
|
136
|
-
children: N
|
|
132
|
+
className: b,
|
|
133
|
+
children: B("all", N)
|
|
134
|
+
}), D({
|
|
135
|
+
href: E,
|
|
136
|
+
className: b,
|
|
137
|
+
children: B("preferences", P)
|
|
137
138
|
})]
|
|
138
139
|
})
|
|
139
140
|
})
|
|
@@ -142,4 +143,4 @@ function b({ items: h = [], count: b = 0, max: x, onRead: S, onMarkAllRead: C, a
|
|
|
142
143
|
});
|
|
143
144
|
}
|
|
144
145
|
//#endregion
|
|
145
|
-
export {
|
|
146
|
+
export { x as NotificationPanel };
|
package/dist/onboarding-shell.js
CHANGED
|
@@ -1,69 +1,70 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './onboarding-shell.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { t } from "./_shared/form-size.js";
|
|
5
|
+
import { Container as n } from "./container.js";
|
|
6
|
+
import { PublicPageShell as r } from "./public-page-shell.js";
|
|
7
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
8
|
//#region src/stories/templates/OnboardingShell/OnboardingShell.tsx
|
|
8
|
-
function
|
|
9
|
-
let
|
|
9
|
+
function o({ children: o, brand: s, preferences: c, switchers: l, preferencesLabel: u, stepper: d, primaryAction: f, backAction: p, exitAction: m, actionsLabel: h, id: g = "main-content", shell: _ = !0, width: v = "md", className: y }) {
|
|
10
|
+
let b = e("onboardingShell"), x = e("publicPageShell"), S = !!(f || p || m), C = c ?? l, w = s && /* @__PURE__ */ i("div", {
|
|
10
11
|
className: "onboarding-shell__brand",
|
|
11
|
-
children:
|
|
12
|
+
children: s
|
|
12
13
|
});
|
|
13
|
-
return /* @__PURE__ */ r
|
|
14
|
-
id:
|
|
15
|
-
shell:
|
|
16
|
-
header:
|
|
14
|
+
return /* @__PURE__ */ i(r, {
|
|
15
|
+
id: g,
|
|
16
|
+
shell: _,
|
|
17
|
+
header: w && /* @__PURE__ */ i(n, {
|
|
17
18
|
as: "header",
|
|
18
19
|
className: "onboarding-shell__top onboarding-shell__top--band",
|
|
19
20
|
innerClassName: "onboarding-shell__bar",
|
|
20
|
-
children:
|
|
21
|
+
children: w
|
|
21
22
|
}),
|
|
22
|
-
preferences:
|
|
23
|
-
preferencesLabel:
|
|
24
|
-
children: /* @__PURE__ */
|
|
25
|
-
className: ["onboarding-shell",
|
|
23
|
+
preferences: C,
|
|
24
|
+
preferencesLabel: u,
|
|
25
|
+
children: /* @__PURE__ */ a("div", {
|
|
26
|
+
className: ["onboarding-shell", y].filter(Boolean).join(" "),
|
|
26
27
|
children: [
|
|
27
|
-
!
|
|
28
|
+
!_ && w && /* @__PURE__ */ i("header", {
|
|
28
29
|
className: "onboarding-shell__top onboarding-shell__bar",
|
|
29
|
-
children:
|
|
30
|
+
children: w
|
|
30
31
|
}),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ i(t.Provider, {
|
|
32
33
|
value: "lg",
|
|
33
|
-
children: /* @__PURE__ */
|
|
34
|
-
className: ["onboarding-shell__step",
|
|
34
|
+
children: /* @__PURE__ */ a("div", {
|
|
35
|
+
className: ["onboarding-shell__step", v === "wide" ? "onboarding-shell__step--wide" : ""].filter(Boolean).join(" "),
|
|
35
36
|
children: [
|
|
36
|
-
|
|
37
|
+
d && /* @__PURE__ */ i("div", {
|
|
37
38
|
className: "onboarding-shell__progress",
|
|
38
|
-
children:
|
|
39
|
+
children: d
|
|
39
40
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ i("div", {
|
|
41
42
|
className: "onboarding-shell__body",
|
|
42
|
-
children:
|
|
43
|
+
children: o
|
|
43
44
|
}),
|
|
44
|
-
|
|
45
|
+
S && /* @__PURE__ */ a("div", {
|
|
45
46
|
className: "onboarding-shell__actions",
|
|
46
47
|
role: "group",
|
|
47
|
-
"aria-label":
|
|
48
|
-
children: [
|
|
48
|
+
"aria-label": b("actions", h),
|
|
49
|
+
children: [p, (m || f) && /* @__PURE__ */ a("div", {
|
|
49
50
|
className: "onboarding-shell__decisions",
|
|
50
|
-
children: [
|
|
51
|
+
children: [m && /* @__PURE__ */ i("div", {
|
|
51
52
|
className: "onboarding-shell__exit",
|
|
52
|
-
children:
|
|
53
|
-
}),
|
|
53
|
+
children: m
|
|
54
|
+
}), f]
|
|
54
55
|
})]
|
|
55
56
|
})
|
|
56
57
|
]
|
|
57
58
|
})
|
|
58
59
|
}),
|
|
59
|
-
!
|
|
60
|
+
!_ && C && /* @__PURE__ */ i("section", {
|
|
60
61
|
className: "onboarding-shell__settings",
|
|
61
|
-
"aria-label":
|
|
62
|
-
children:
|
|
62
|
+
"aria-label": x("preferences", u),
|
|
63
|
+
children: C
|
|
63
64
|
})
|
|
64
65
|
]
|
|
65
66
|
})
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
//#endregion
|
|
69
|
-
export {
|
|
70
|
+
export { o as OnboardingShell };
|
package/dist/org-switcher.js
CHANGED
|
@@ -1,81 +1,86 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './org-switcher.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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 { n as i, t as a } from "./_shared/dropdownitems.js";
|
|
8
|
+
import { n as o } from "./_shared/sidebarcontext.js";
|
|
9
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
import { Menu as u } from "@base-ui/react/menu";
|
|
9
11
|
//#region src/stories/molecules/OrgSwitcher/OrgSwitcher.tsx
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
defaultOpen:
|
|
14
|
-
children: [/* @__PURE__ */
|
|
12
|
+
function d({ label: d, block: f = !1, compact: p, current: m, organizations: h, onOrgChange: g, defaultOpen: _, items: v, renderLink: y = a }) {
|
|
13
|
+
let b = e("orgSwitcher"), x = n(void 0), S = h.filter((e) => e.id !== m.id), C = o(), w = p ?? C.rail;
|
|
14
|
+
return /* @__PURE__ */ l(u.Root, {
|
|
15
|
+
defaultOpen: _,
|
|
16
|
+
children: [/* @__PURE__ */ l(u.Trigger, {
|
|
15
17
|
className: [
|
|
16
18
|
"org-switcher__trigger",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
f && !w ? "org-switcher__trigger--block" : "",
|
|
20
|
+
w ? "org-switcher__trigger--compact" : ""
|
|
19
21
|
].filter(Boolean).join(" "),
|
|
20
|
-
"aria-label":
|
|
22
|
+
"aria-label": d ?? b("trigger")(m.name),
|
|
21
23
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
src:
|
|
24
|
-
name:
|
|
24
|
+
/* @__PURE__ */ c(r, {
|
|
25
|
+
src: m.logoUrl,
|
|
26
|
+
name: m.name,
|
|
25
27
|
alt: "",
|
|
26
28
|
size: "sm",
|
|
27
29
|
shape: "square"
|
|
28
30
|
}),
|
|
29
|
-
!
|
|
31
|
+
!w && /* @__PURE__ */ c("span", {
|
|
30
32
|
className: "org-switcher__name",
|
|
31
|
-
children:
|
|
33
|
+
children: m.name
|
|
32
34
|
}),
|
|
33
|
-
!
|
|
35
|
+
!w && /* @__PURE__ */ c(t, {
|
|
34
36
|
name: "chevron",
|
|
35
37
|
size: "sm",
|
|
36
38
|
className: "org-switcher__chevron"
|
|
37
39
|
})
|
|
38
40
|
]
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
children:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
41
|
+
}), /* @__PURE__ */ c(u.Portal, {
|
|
42
|
+
container: x,
|
|
43
|
+
children: /* @__PURE__ */ c(u.Positioner, {
|
|
44
|
+
className: "org-switcher__positioner",
|
|
45
|
+
sideOffset: 4,
|
|
46
|
+
align: "start",
|
|
47
|
+
children: /* @__PURE__ */ l(u.Popup, {
|
|
48
|
+
className: "org-switcher__content",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ l(u.CheckboxItem, {
|
|
51
|
+
className: "org-switcher__item org-switcher__item--active",
|
|
52
|
+
checked: !0,
|
|
53
|
+
onCheckedChange: () => void 0,
|
|
54
|
+
children: [/* @__PURE__ */ c(r, {
|
|
55
|
+
src: m.logoUrl,
|
|
56
|
+
name: m.name,
|
|
57
|
+
alt: "",
|
|
58
|
+
size: "sm",
|
|
59
|
+
shape: "square"
|
|
60
|
+
}), /* @__PURE__ */ c("span", { children: m.name })]
|
|
61
|
+
}),
|
|
62
|
+
S.map((e) => /* @__PURE__ */ l(u.Item, {
|
|
63
|
+
className: "org-switcher__item",
|
|
64
|
+
onClick: () => g(e.id),
|
|
65
|
+
children: [/* @__PURE__ */ c(r, {
|
|
66
|
+
src: e.logoUrl,
|
|
67
|
+
name: e.name,
|
|
68
|
+
alt: "",
|
|
69
|
+
size: "sm",
|
|
70
|
+
shape: "square"
|
|
71
|
+
}), /* @__PURE__ */ c("span", { children: e.name })]
|
|
72
|
+
}, e.id)),
|
|
73
|
+
v && v.length > 0 && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(u.Separator, { className: "org-switcher__separator" }), i({
|
|
74
|
+
items: v,
|
|
75
|
+
itemClass: (e) => ["org-switcher__item", e ? "org-switcher__item--destructive" : ""].filter(Boolean).join(" "),
|
|
76
|
+
separatorClass: "org-switcher__separator",
|
|
77
|
+
renderLink: y
|
|
78
|
+
})] })
|
|
79
|
+
]
|
|
80
|
+
})
|
|
76
81
|
})
|
|
77
|
-
})
|
|
82
|
+
})]
|
|
78
83
|
});
|
|
79
84
|
}
|
|
80
85
|
//#endregion
|
|
81
|
-
export {
|
|
86
|
+
export { d as OrgSwitcher };
|
package/dist/popover.js
CHANGED
|
@@ -1,36 +1,41 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './popover.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/portal-container.js";
|
|
4
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
|
+
import { Popover as r } from "@base-ui/react/popover";
|
|
5
6
|
//#region src/stories/atoms/Popover/Popover.tsx
|
|
6
|
-
function
|
|
7
|
+
function i(e) {
|
|
7
8
|
let t = parseFloat(e);
|
|
8
9
|
return Number.isNaN(t) ? 0 : e.endsWith("rem") ? t * parseFloat(getComputedStyle(document.documentElement).fontSize) : t;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function a() {
|
|
11
12
|
let e = document.documentElement;
|
|
12
|
-
return
|
|
13
|
+
return i(getComputedStyle(e).getPropertyValue("--popover-offset").trim());
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
function o({ trigger: i, children: o, label: s, open: c, defaultOpen: l, onOpenChange: u, onPointerDownOutside: d, onFocusOutside: f, onEscapeKeyDown: p, side: m = "bottom", align: h = "start", sideOffset: g, initialFocus: _, container: v, className: y }) {
|
|
16
|
+
let b = e(v);
|
|
17
|
+
return /* @__PURE__ */ n(r.Root, {
|
|
18
|
+
open: c,
|
|
19
|
+
defaultOpen: l,
|
|
18
20
|
onOpenChange: (e, t) => {
|
|
19
|
-
e || (t.reason === "outside-press" ?
|
|
21
|
+
e || (t.reason === "outside-press" ? d?.(t) : t.reason === "focus-out" ? f?.(t) : t.reason === "escape-key" && p?.(t)), u?.(e, t);
|
|
20
22
|
},
|
|
21
|
-
children: [/* @__PURE__ */
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
children: [/* @__PURE__ */ t(r.Trigger, { render: i }), /* @__PURE__ */ t(r.Portal, {
|
|
24
|
+
container: b,
|
|
25
|
+
children: /* @__PURE__ */ t(r.Positioner, {
|
|
26
|
+
className: "popover__positioner",
|
|
27
|
+
side: m,
|
|
28
|
+
align: h,
|
|
29
|
+
sideOffset: g ?? a,
|
|
30
|
+
children: /* @__PURE__ */ t(r.Popup, {
|
|
31
|
+
"aria-label": s,
|
|
32
|
+
initialFocus: _,
|
|
33
|
+
className: ["popover", y].filter(Boolean).join(" "),
|
|
34
|
+
children: o
|
|
35
|
+
})
|
|
31
36
|
})
|
|
32
|
-
})
|
|
37
|
+
})]
|
|
33
38
|
});
|
|
34
39
|
}
|
|
35
40
|
//#endregion
|
|
36
|
-
export {
|
|
41
|
+
export { o as Popover };
|