@the-portland-company/shell 0.67.0 → 0.68.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 +26 -0
- package/dist/app-chrome.cjs +577 -430
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +39 -11
- package/dist/app-chrome.d.ts +39 -11
- package/dist/app-chrome.js +33 -15
- package/dist/app-chrome.js.map +1 -1
- package/dist/chrome.css +96 -16
- package/dist/{chunk-JHIFJZ73.js → chunk-NHBNM5P3.js} +17 -8
- package/dist/chunk-NHBNM5P3.js.map +1 -0
- package/dist/{chunk-T5ERHFNT.js → chunk-ZKYREVCK.js} +528 -376
- package/dist/chunk-ZKYREVCK.js.map +1 -0
- package/dist/index.cjs +12 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/native.cjs +546 -385
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +62 -3
- package/dist/native.d.ts +62 -3
- package/dist/native.js +2 -2
- package/dist/theme-preference.cjs +15 -6
- package/dist/theme-preference.cjs.map +1 -1
- package/dist/theme-preference.d.cts +3 -3
- package/dist/theme-preference.d.ts +3 -3
- package/dist/theme-preference.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-JHIFJZ73.js.map +0 -1
- package/dist/chunk-T5ERHFNT.js.map +0 -1
package/dist/native.cjs
CHANGED
|
@@ -131,14 +131,24 @@ function clearPendingThemeChoice() {
|
|
|
131
131
|
writeSharedCookie(THEME_PENDING_COOKIE, "", 0);
|
|
132
132
|
}
|
|
133
133
|
function resolveTheme(pref) {
|
|
134
|
+
if (pref === "dark") return "dark";
|
|
135
|
+
if (pref === "system") {
|
|
136
|
+
try {
|
|
137
|
+
if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
|
|
138
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
139
|
+
}
|
|
140
|
+
} catch {
|
|
141
|
+
}
|
|
142
|
+
}
|
|
134
143
|
return "light";
|
|
135
144
|
}
|
|
136
145
|
function applyThemePreference(pref) {
|
|
137
146
|
if (typeof document === "undefined") return;
|
|
138
|
-
const resolved = resolveTheme();
|
|
147
|
+
const resolved = resolveTheme(pref);
|
|
139
148
|
const d = document.documentElement;
|
|
140
|
-
d.classList.
|
|
149
|
+
d.classList.toggle("dark", resolved === "dark");
|
|
141
150
|
try {
|
|
151
|
+
d.setAttribute("data-theme", resolved);
|
|
142
152
|
d.style.colorScheme = resolved;
|
|
143
153
|
} catch {
|
|
144
154
|
}
|
|
@@ -152,11 +162,10 @@ var ls=null;try{ls=localStorage.getItem(KEY);}catch(e){}
|
|
|
152
162
|
var pref=cookie||ls||"system";
|
|
153
163
|
if(VALID.indexOf(pref)===-1)pref="system";
|
|
154
164
|
if(cookie&&cookie!==ls){try{localStorage.setItem(KEY,cookie);}catch(e){}}
|
|
155
|
-
|
|
156
|
-
// stale dark class a pre-retirement cookie/localStorage value left behind.
|
|
165
|
+
var dark=pref==="dark"||(pref==="system"&&!!(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches));
|
|
157
166
|
var d=document.documentElement;
|
|
158
|
-
d.classList.remove("dark");
|
|
159
|
-
try{d.style.colorScheme="light";}catch(e){}
|
|
167
|
+
if(dark)d.classList.add("dark");else d.classList.remove("dark");
|
|
168
|
+
try{d.setAttribute("data-theme",dark?"dark":"light");d.style.colorScheme=dark?"dark":"light";}catch(e){}
|
|
160
169
|
}catch(e){}})();`;
|
|
161
170
|
var CORE_APP_ORIGIN = "https://app.politogyvrm.com";
|
|
162
171
|
var CORE_BILLING_PATH = "/organization-settings/subscription-billing/text-email";
|
|
@@ -177,12 +186,13 @@ function resolveOrgLogoUrl(url) {
|
|
|
177
186
|
if (/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(raw)) return raw;
|
|
178
187
|
return `${CORE_APP_ORIGIN}${raw.startsWith("/") ? "" : "/"}${raw}`;
|
|
179
188
|
}
|
|
189
|
+
var TOPBAR_GLYPH_SIZE = 17;
|
|
180
190
|
function topBarIconButtonClass(tone = "default") {
|
|
181
191
|
const toneClass = tone === "danger" || tone === "warning" ? "text-[color:var(--chrome-danger)] hover:text-[color:var(--chrome-danger)]" : "text-[color:var(--topbar-icon-color,var(--muted))] hover:text-[color:var(--topbar-icon-hover-color,var(--foreground))] hover:bg-[color:var(--topbar-icon-hover-bg,transparent)]";
|
|
182
192
|
return [
|
|
183
193
|
// `group/tbtip` powers the shared <TopBarTooltip> rendered inside the trigger.
|
|
184
|
-
"group/tbtip relative flex items-center justify-center rounded-
|
|
185
|
-
"h-[var(--topbar-icon-button-size,
|
|
194
|
+
"group/tbtip relative flex items-center justify-center rounded-[var(--topbar-icon-button-radius,5px)] border border-[color:var(--line)] transition",
|
|
195
|
+
"h-[var(--topbar-icon-button-size,34px)] w-[var(--topbar-icon-button-size,34px)]",
|
|
186
196
|
toneClass
|
|
187
197
|
].join(" ");
|
|
188
198
|
}
|
|
@@ -205,7 +215,7 @@ function useAnyTopBarPanelOpen() {
|
|
|
205
215
|
}
|
|
206
216
|
function TopBarCountBadge({ count }) {
|
|
207
217
|
if (!(count > 0)) return null;
|
|
208
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-
|
|
218
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-[5px] -right-[5px] flex h-4 min-w-4 items-center justify-center rounded-full bg-[color:var(--chrome-danger)] px-1 text-[10px] font-bold leading-4 text-white", children: count > 99 ? "99+" : count });
|
|
209
219
|
}
|
|
210
220
|
function TopBarTooltip({
|
|
211
221
|
title,
|
|
@@ -391,7 +401,7 @@ function ValueSkeleton({ className }) {
|
|
|
391
401
|
function SlotGlyph({
|
|
392
402
|
slot,
|
|
393
403
|
fallback: Fallback,
|
|
394
|
-
size =
|
|
404
|
+
size = TOPBAR_GLYPH_SIZE
|
|
395
405
|
}) {
|
|
396
406
|
const glyphName = useTopBarIconSlotGlyph(slot ?? "apps");
|
|
397
407
|
const BrandGlyph = slot ? resolveBrandGlyph(glyphName) : null;
|
|
@@ -483,7 +493,7 @@ function TopBarPopover({
|
|
|
483
493
|
) : null
|
|
484
494
|
] });
|
|
485
495
|
}
|
|
486
|
-
function BatteryGlyph({ size =
|
|
496
|
+
function BatteryGlyph({ size = TOPBAR_GLYPH_SIZE, className }) {
|
|
487
497
|
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className, "aria-hidden": true, children: [
|
|
488
498
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "1", y: "6", width: "18", height: "12", rx: "2", ry: "2" }),
|
|
489
499
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "23", y1: "10", x2: "23", y2: "14" }),
|
|
@@ -491,7 +501,7 @@ function BatteryGlyph({ size = 20, className }) {
|
|
|
491
501
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "10", x2: "9", y2: "14" })
|
|
492
502
|
] });
|
|
493
503
|
}
|
|
494
|
-
function BellGlyph({ size =
|
|
504
|
+
function BellGlyph({ size = TOPBAR_GLYPH_SIZE, className }) {
|
|
495
505
|
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className, "aria-hidden": true, children: [
|
|
496
506
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" }),
|
|
497
507
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.73 21a2 2 0 0 1-3.46 0" })
|
|
@@ -506,7 +516,7 @@ function BellOffGlyph({ size = 14, className }) {
|
|
|
506
516
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
507
517
|
] });
|
|
508
518
|
}
|
|
509
|
-
function LifeBuoyGlyph({ size =
|
|
519
|
+
function LifeBuoyGlyph({ size = TOPBAR_GLYPH_SIZE, className }) {
|
|
510
520
|
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className, "aria-hidden": true, children: [
|
|
511
521
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
512
522
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "4" }),
|
|
@@ -516,7 +526,7 @@ function LifeBuoyGlyph({ size = 20, className }) {
|
|
|
516
526
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4.93", y1: "19.07", x2: "9.17", y2: "14.83" })
|
|
517
527
|
] });
|
|
518
528
|
}
|
|
519
|
-
function LayoutGlyph({ size =
|
|
529
|
+
function LayoutGlyph({ size = TOPBAR_GLYPH_SIZE, className }) {
|
|
520
530
|
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className, "aria-hidden": true, children: [
|
|
521
531
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
522
532
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "9", x2: "21", y2: "9" }),
|
|
@@ -1534,7 +1544,7 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
|
|
|
1534
1544
|
className: topBarIconButtonClass(badgeTone),
|
|
1535
1545
|
onClick: () => setOpen(true),
|
|
1536
1546
|
children: [
|
|
1537
|
-
/* @__PURE__ */ jsxRuntime.jsx(LayoutGlyph, { size:
|
|
1547
|
+
/* @__PURE__ */ jsxRuntime.jsx(LayoutGlyph, { size: TOPBAR_GLYPH_SIZE, className: "text-current" }),
|
|
1538
1548
|
badgeLabel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1539
1549
|
"span",
|
|
1540
1550
|
{
|
|
@@ -1745,7 +1755,7 @@ function useThemePreference() {
|
|
|
1745
1755
|
}
|
|
1746
1756
|
const pref = cookie ?? (isThemePreference(ls) ? ls : null) ?? "system";
|
|
1747
1757
|
setValueState(pref);
|
|
1748
|
-
applyThemePreference();
|
|
1758
|
+
applyThemePreference(pref);
|
|
1749
1759
|
}, []);
|
|
1750
1760
|
const meCtx = react.useContext(NavChromeContext);
|
|
1751
1761
|
react.useEffect(() => {
|
|
@@ -1754,7 +1764,7 @@ function useThemePreference() {
|
|
|
1754
1764
|
if (pending) {
|
|
1755
1765
|
if (meCtx?.me) reconciled.current = true;
|
|
1756
1766
|
setValueState(pending);
|
|
1757
|
-
applyThemePreference();
|
|
1767
|
+
applyThemePreference(pending);
|
|
1758
1768
|
writeThemeCookie(pending);
|
|
1759
1769
|
try {
|
|
1760
1770
|
localStorage.setItem(THEME_STORAGE_KEY, pending);
|
|
@@ -1773,7 +1783,7 @@ function useThemePreference() {
|
|
|
1773
1783
|
if (isThemePreference(pref)) {
|
|
1774
1784
|
reconciled.current = true;
|
|
1775
1785
|
setValueState(pref);
|
|
1776
|
-
applyThemePreference();
|
|
1786
|
+
applyThemePreference(pref);
|
|
1777
1787
|
writeThemeCookie(pref);
|
|
1778
1788
|
try {
|
|
1779
1789
|
localStorage.setItem(THEME_STORAGE_KEY, pref);
|
|
@@ -1792,7 +1802,7 @@ function useThemePreference() {
|
|
|
1792
1802
|
const cookie = readThemeCookie();
|
|
1793
1803
|
if (cookie) {
|
|
1794
1804
|
setValueState((prev) => {
|
|
1795
|
-
if (cookie !== prev) applyThemePreference();
|
|
1805
|
+
if (cookie !== prev) applyThemePreference(cookie);
|
|
1796
1806
|
return cookie;
|
|
1797
1807
|
});
|
|
1798
1808
|
}
|
|
@@ -1814,14 +1824,14 @@ function useThemePreference() {
|
|
|
1814
1824
|
} catch {
|
|
1815
1825
|
return;
|
|
1816
1826
|
}
|
|
1817
|
-
const onChange = () => applyThemePreference();
|
|
1827
|
+
const onChange = () => applyThemePreference("system");
|
|
1818
1828
|
mq.addEventListener("change", onChange);
|
|
1819
1829
|
return () => mq.removeEventListener("change", onChange);
|
|
1820
1830
|
}, [value]);
|
|
1821
1831
|
const setValue = react.useCallback(
|
|
1822
1832
|
(next) => {
|
|
1823
1833
|
setValueState(next);
|
|
1824
|
-
applyThemePreference();
|
|
1834
|
+
applyThemePreference(next);
|
|
1825
1835
|
writeThemeCookie(next);
|
|
1826
1836
|
try {
|
|
1827
1837
|
localStorage.setItem(THEME_STORAGE_KEY, next);
|
|
@@ -1856,6 +1866,16 @@ var SIGNS_ORIGIN = "https://signs.politogyvrm.com/";
|
|
|
1856
1866
|
var POLLS_ORIGIN = "https://polls.politogyvrm.com/";
|
|
1857
1867
|
var CONTACTS_TRIBES = "https://contacts.politogyvrm.com/tribes";
|
|
1858
1868
|
var PETITION_MODE_ORIGIN = "https://petition-mode.politogyvrm.com/";
|
|
1869
|
+
function applyHiddenItems(items, hidden) {
|
|
1870
|
+
if (!hidden || hidden.length === 0) return items;
|
|
1871
|
+
const drop = new Set(hidden.map((h) => h.trim().toLowerCase()));
|
|
1872
|
+
const kept = items.filter((i) => i.kind === "section" || !drop.has(i.label.toLowerCase()));
|
|
1873
|
+
return kept.filter((item, idx) => {
|
|
1874
|
+
if (item.kind !== "section") return true;
|
|
1875
|
+
const next = kept[idx + 1];
|
|
1876
|
+
return !!next && next.kind !== "section";
|
|
1877
|
+
});
|
|
1878
|
+
}
|
|
1859
1879
|
var CONTACTS_APP = "https://contacts.politogyvrm.com";
|
|
1860
1880
|
var APP_CONTACTS_CHILDREN = [
|
|
1861
1881
|
{ label: "Dashboard", icon: "grid", href: `${CONTACTS_APP}/` },
|
|
@@ -1970,7 +1990,8 @@ function standardPolitogyNav(opts) {
|
|
|
1970
1990
|
label: "Contacts",
|
|
1971
1991
|
icon: icon("users"),
|
|
1972
1992
|
href: opts.contactsItem.href,
|
|
1973
|
-
children: opts.contactsItem.children
|
|
1993
|
+
children: opts.contactsItem.children,
|
|
1994
|
+
badge: opts.contactsItem.count ?? void 0
|
|
1974
1995
|
} : {
|
|
1975
1996
|
label: "Contacts",
|
|
1976
1997
|
icon: icon("users"),
|
|
@@ -1982,10 +2003,11 @@ function standardPolitogyNav(opts) {
|
|
|
1982
2003
|
}))
|
|
1983
2004
|
};
|
|
1984
2005
|
return [
|
|
2006
|
+
{ kind: "section", label: "Relationship" },
|
|
1985
2007
|
{ label: "Dashboard", icon: icon("home"), href: withOrg(abs("/relationship/dashboard")) },
|
|
1986
2008
|
contacts,
|
|
1987
2009
|
{
|
|
1988
|
-
label: "Email
|
|
2010
|
+
label: "Email broadcast",
|
|
1989
2011
|
icon: icon("mail"),
|
|
1990
2012
|
href: withOrg(`${EMAIL_APP}/dashboard`),
|
|
1991
2013
|
children: [
|
|
@@ -1993,20 +2015,19 @@ function standardPolitogyNav(opts) {
|
|
|
1993
2015
|
...leaves([EMAIL_V1_LEGACY])
|
|
1994
2016
|
]
|
|
1995
2017
|
},
|
|
1996
|
-
// SMS/MMS Blast IS a2p (Specs/A2P) — the standalone delivery engine
|
|
1997
|
-
// shared with Campaign Mode, not a core-hosted surface (the old
|
|
1998
|
-
// `/relationship/sms-mms-blast/*` core routes are dead; core no longer
|
|
1999
|
-
// hosts them). Every link carries `mode=relationship` so a2p's nav
|
|
2000
|
-
// resolves the Relationship tree instead of its own Campaign default
|
|
2001
|
-
// (resolveActiveMode, mode-preference.ts).
|
|
2002
2018
|
{
|
|
2003
|
-
|
|
2019
|
+
// SMS/MMS Blast is the a2p app entered in RELATIONSHIP mode (a2p is
|
|
2020
|
+
// dual-mode; Specs/A2P). The `?mode=relationship` param pins the
|
|
2021
|
+
// destination's tree so the row that got you there is the row that
|
|
2022
|
+
// lights up on arrival.
|
|
2023
|
+
label: "SMS/MMS blast",
|
|
2004
2024
|
icon: icon("messageSquare"),
|
|
2005
2025
|
href: withOrg(`${A2P_ORIGIN}?mode=relationship`),
|
|
2006
2026
|
children: appLeaves(A2P_ORIGIN, APP_A2P_CHILDREN, "relationship")
|
|
2007
2027
|
},
|
|
2008
|
-
|
|
2009
|
-
|
|
2028
|
+
{ kind: "section", label: "Collect" },
|
|
2029
|
+
// Carries no top-level href in VRM core (parent row only toggles).
|
|
2030
|
+
{ label: "Calls to action", icon: icon("layout"), children: leaves(CTA_CHILDREN) },
|
|
2010
2031
|
{
|
|
2011
2032
|
label: "Forms",
|
|
2012
2033
|
icon: icon("activity"),
|
|
@@ -2031,9 +2052,12 @@ function standardPolitogyNav(opts) {
|
|
|
2031
2052
|
href: withOrg("https://ctas.politogyvrm.com/"),
|
|
2032
2053
|
children: APP_CTAS_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: withOrg(c.href) }))
|
|
2033
2054
|
},
|
|
2055
|
+
{ kind: "section", label: "Account" },
|
|
2056
|
+
// My Profile is global — NOT org-suffixed (main-app ShellChromeBridge).
|
|
2057
|
+
{ label: "My profile", icon: icon("user"), href: withOrg(abs("/my-profile")) },
|
|
2034
2058
|
{
|
|
2035
|
-
label: "Organization
|
|
2036
|
-
icon: icon("
|
|
2059
|
+
label: "Organization settings",
|
|
2060
|
+
icon: icon("settings"),
|
|
2037
2061
|
href: withOrg(abs("/organization-settings")),
|
|
2038
2062
|
children: branches(ORG_SETTINGS_CHILDREN)
|
|
2039
2063
|
}
|
|
@@ -2089,7 +2113,8 @@ function standardPolitogyNav(opts) {
|
|
|
2089
2113
|
} : { label: "Dashboard", icon: icon("home"), href: withOrg(PETITION_MODE_ORIGIN) }
|
|
2090
2114
|
];
|
|
2091
2115
|
const mode = opts.mode ?? "relationship";
|
|
2092
|
-
const
|
|
2116
|
+
const built = mode === "campaign" ? buildCampaign() : mode === "petition" ? buildPetition() : buildRelationship();
|
|
2117
|
+
const items = applyHiddenItems(built, opts.hiddenItems);
|
|
2093
2118
|
if (opts.supportItem) {
|
|
2094
2119
|
items.push({
|
|
2095
2120
|
label: "Support",
|
|
@@ -2219,6 +2244,7 @@ function NavSidebar({
|
|
|
2219
2244
|
const ModeIcon = mode?.icon;
|
|
2220
2245
|
const orgLogoSrc = resolveOrgLogoUrl(org?.logoUrl);
|
|
2221
2246
|
const orgGradient = org?.brandColor ? `linear-gradient(to right, ${org.brandColor}, ${org.brandColorSecondary || org.brandColor})` : "linear-gradient(to right, #007BFF, #A54B7A, #E63946)";
|
|
2247
|
+
const orgCardStyle = hexToRgba(org?.brandColor, 0.42) ? { borderColor: hexToRgba(org?.brandColor, 0.42) } : void 0;
|
|
2222
2248
|
const activeGroupKey = react.useMemo(() => {
|
|
2223
2249
|
for (let i = 0; i < nav.items.length; i++) {
|
|
2224
2250
|
const item = nav.items[i];
|
|
@@ -2252,7 +2278,7 @@ function NavSidebar({
|
|
|
2252
2278
|
"aria-modal": open ? "true" : void 0,
|
|
2253
2279
|
"aria-label": open ? "Navigation" : void 0,
|
|
2254
2280
|
className: clsx__default.default(
|
|
2255
|
-
"fixed inset-y-0 left-0 w-[
|
|
2281
|
+
"fixed inset-y-0 left-0 w-[var(--sidebar-width,236px)] flex-col border-r border-[color:var(--sidebar-line,var(--line))] bg-[color:var(--sidebar-bg,var(--nav-surface))] lg:flex",
|
|
2256
2282
|
open ? "flex z-50" : "hidden z-30"
|
|
2257
2283
|
),
|
|
2258
2284
|
style: { fontFamily: 'var(--font-family, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif)' },
|
|
@@ -2272,31 +2298,31 @@ function NavSidebar({
|
|
|
2272
2298
|
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {})
|
|
2273
2299
|
}
|
|
2274
2300
|
) : null,
|
|
2275
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2290
|
-
|
|
2291
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2292
|
-
|
|
2301
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-shrink-0 flex-col gap-[14px] border-b border-[color:var(--sidebar-line,var(--line))] px-[18px] py-4", children: [
|
|
2302
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2303
|
+
Link,
|
|
2304
|
+
{
|
|
2305
|
+
href: brand.homeHref ?? "/",
|
|
2306
|
+
className: "flex items-center gap-2.5",
|
|
2307
|
+
children: brand.logoSrc ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2308
|
+
"img",
|
|
2309
|
+
{
|
|
2310
|
+
src: brand.logoSrc,
|
|
2311
|
+
alt: brand.logoAlt ?? brand.title,
|
|
2312
|
+
draggable: false,
|
|
2313
|
+
className: "h-[var(--sidebar-brand-logo-height,24px)] w-auto object-contain"
|
|
2314
|
+
}
|
|
2315
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2316
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-9 w-9 items-center justify-center rounded-xl bg-[color:var(--color-accent)] text-base font-black text-white shadow-sm", children: brand.badgeLabel }),
|
|
2317
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-col leading-tight", children: [
|
|
2318
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-extrabold tracking-[-0.01em] text-[color:var(--color-accent)]", children: brand.title }),
|
|
2319
|
+
brand.subtitle ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-semibold uppercase tracking-[0.16em] text-[color:var(--muted)]", children: brand.subtitle }) : null
|
|
2320
|
+
] })
|
|
2293
2321
|
] })
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
org ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3", children: [
|
|
2299
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 flex items-center justify-between px-1", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] font-semibold uppercase tracking-[0.08em] text-[color:var(--sidebar-text-muted,var(--muted))]", children: "Organization" }) }),
|
|
2322
|
+
}
|
|
2323
|
+
),
|
|
2324
|
+
org ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2325
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-[7px] flex items-center justify-between", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: NAV_EYEBROW_CLASS, children: "Organization" }) }),
|
|
2300
2326
|
org.loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center gap-2.5 rounded-md border border-[color:var(--line)] bg-[color:var(--panel-elevated)] px-2.5 py-2 shadow-sm", children: [
|
|
2301
2327
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2302
2328
|
"span",
|
|
@@ -2314,34 +2340,41 @@ function NavSidebar({
|
|
|
2314
2340
|
),
|
|
2315
2341
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading organization" })
|
|
2316
2342
|
] }) : org.organizations && org.organizations.length > 0 && org.onSwitch ? /* @__PURE__ */ jsxRuntime.jsxs("details", { "data-nav-details": true, className: "group relative", children: [
|
|
2317
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
className: "
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
"span",
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2343
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2344
|
+
"summary",
|
|
2345
|
+
{
|
|
2346
|
+
style: orgCardStyle,
|
|
2347
|
+
className: "flex w-full cursor-pointer list-none flex-col overflow-hidden rounded-[5px] border border-[color:var(--sidebar-card-border,var(--sidebar-line,var(--line)))] bg-[color:var(--sidebar-card-bg,var(--panel-elevated))] text-left text-[color:var(--sidebar-text,var(--foreground))] transition hover:bg-[color:var(--sidebar-row-hover-bg,var(--panel))] [&::-webkit-details-marker]:hidden",
|
|
2348
|
+
children: [
|
|
2349
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative flex h-[var(--sidebar-org-band-height,48px)] w-full items-center justify-center bg-white px-3 py-[7px]", children: [
|
|
2350
|
+
orgLogoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: orgLogoSrc, alt: "", className: "max-h-full max-w-[132px] object-contain" }) : org.canUploadLogo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2351
|
+
"a",
|
|
2352
|
+
{
|
|
2353
|
+
href: org.uploadLogoHref ?? "#",
|
|
2354
|
+
onClick: (e) => e.stopPropagation(),
|
|
2355
|
+
className: "text-xs font-semibold text-[color:var(--color-accent)] underline",
|
|
2356
|
+
children: "Upload logo"
|
|
2357
|
+
}
|
|
2358
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-neutral-800", children: org.name ?? "Organization" }),
|
|
2359
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "absolute inset-x-0 bottom-0 h-[3px]", style: { backgroundImage: orgGradient } })
|
|
2360
|
+
] }),
|
|
2361
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex w-full min-w-0 items-center justify-between gap-[9px] px-[10px] py-2", children: [
|
|
2362
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col", children: [
|
|
2363
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2364
|
+
"span",
|
|
2365
|
+
{
|
|
2366
|
+
title: org.name ?? void 0,
|
|
2367
|
+
className: "truncate text-[12px] font-semibold leading-[1.2]",
|
|
2368
|
+
children: org.name ?? "No organizations"
|
|
2369
|
+
}
|
|
2370
|
+
),
|
|
2371
|
+
org.id && !org.loading ? /* @__PURE__ */ jsxRuntime.jsx(OrgIdCopyButton, { id: org.id }) : null
|
|
2372
|
+
] }),
|
|
2373
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 14 })
|
|
2374
|
+
] })
|
|
2375
|
+
]
|
|
2376
|
+
}
|
|
2377
|
+
),
|
|
2345
2378
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute left-0 right-0 z-40 mt-1 max-h-[min(60vh,520px)] overflow-y-auto rounded-xl border border-[color:var(--line)] bg-[color:var(--panel-elevated)] py-1 shadow-[var(--shadow-soft)]", children: [
|
|
2346
2379
|
shouldShowOrgFilter(org.organizations.length) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 bg-[color:var(--panel-elevated)] px-2 pb-1 pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2347
2380
|
"input",
|
|
@@ -2410,10 +2443,11 @@ function NavSidebar({
|
|
|
2410
2443
|
{
|
|
2411
2444
|
type: "button",
|
|
2412
2445
|
onClick: org.onClick,
|
|
2413
|
-
|
|
2446
|
+
style: orgCardStyle,
|
|
2447
|
+
className: "flex w-full flex-col overflow-hidden rounded-[5px] border border-[color:var(--sidebar-card-border,var(--sidebar-line,var(--line)))] bg-[color:var(--sidebar-card-bg,var(--panel-elevated))] text-left text-[color:var(--sidebar-text,var(--foreground))] transition hover:bg-[color:var(--sidebar-row-hover-bg,var(--panel))]",
|
|
2414
2448
|
children: [
|
|
2415
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative flex h-[
|
|
2416
|
-
orgLogoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: orgLogoSrc, alt: "", className: "max-h-
|
|
2449
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative flex h-[var(--sidebar-org-band-height,48px)] w-full items-center justify-center bg-white px-3 py-[7px]", children: [
|
|
2450
|
+
orgLogoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: orgLogoSrc, alt: "", className: "max-h-full max-w-[132px] object-contain" }) : org.canUploadLogo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2417
2451
|
"a",
|
|
2418
2452
|
{
|
|
2419
2453
|
href: org.uploadLogoHref ?? "#",
|
|
@@ -2424,31 +2458,31 @@ function NavSidebar({
|
|
|
2424
2458
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-neutral-800", children: org.name ?? "Organization" }),
|
|
2425
2459
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "absolute inset-x-0 bottom-0 h-[3px]", style: { backgroundImage: orgGradient } })
|
|
2426
2460
|
] }),
|
|
2427
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex w-full min-w-0 items-center justify-between gap-
|
|
2461
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex w-full min-w-0 items-center justify-between gap-[9px] px-[10px] py-2", children: [
|
|
2428
2462
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col", children: [
|
|
2429
2463
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2430
2464
|
"span",
|
|
2431
2465
|
{
|
|
2432
2466
|
title: org.name ?? void 0,
|
|
2433
|
-
className: "truncate text-[
|
|
2467
|
+
className: "truncate text-[12px] font-semibold leading-[1.2]",
|
|
2434
2468
|
children: org.name ?? "No organizations"
|
|
2435
2469
|
}
|
|
2436
2470
|
),
|
|
2437
2471
|
org.id && !org.loading ? /* @__PURE__ */ jsxRuntime.jsx(OrgIdCopyButton, { id: org.id }) : null
|
|
2438
2472
|
] }),
|
|
2439
|
-
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {})
|
|
2473
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 14 })
|
|
2440
2474
|
] })
|
|
2441
2475
|
]
|
|
2442
2476
|
}
|
|
2443
2477
|
)
|
|
2444
2478
|
] }) : null,
|
|
2445
|
-
mode ? /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
2479
|
+
mode ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2446
2480
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2447
2481
|
"div",
|
|
2448
2482
|
{
|
|
2449
2483
|
role: "radiogroup",
|
|
2450
2484
|
"aria-label": "Mode",
|
|
2451
|
-
className: "flex items-center
|
|
2485
|
+
className: "flex w-full items-center gap-1 rounded-lg border border-[color:var(--border-inverse,var(--sidebar-line,var(--line)))] bg-[color:var(--mode-track-bg,var(--panel-elevated))] p-[3px]",
|
|
2452
2486
|
children: (mode.options && mode.options.length > 0 ? mode.options : [{ id: mode.label, label: mode.label, icon: ModeIcon }]).map(
|
|
2453
2487
|
(opt) => {
|
|
2454
2488
|
const selected = opt.label === mode.label;
|
|
@@ -2469,8 +2503,8 @@ function NavSidebar({
|
|
|
2469
2503
|
},
|
|
2470
2504
|
disabled: !available,
|
|
2471
2505
|
className: [
|
|
2472
|
-
"flex
|
|
2473
|
-
!available ? "cursor-not-allowed text-[color:var(--sidebar-text-muted,var(--muted))] opacity-35" : selected ? "bg-[color:var(--mode-accent,var(--color-accent))] text-[color:var(--mode-on-accent,white)]
|
|
2506
|
+
"flex flex-1 items-center justify-center rounded-[5px] px-[9px] py-[6px] transition",
|
|
2507
|
+
!available ? "cursor-not-allowed text-[color:var(--sidebar-text-muted,var(--muted))] opacity-35" : selected ? "bg-[color:var(--sidebar-mode-selected-bg,var(--mode-accent,var(--color-accent)))] text-[color:var(--mode-on-accent,white)]" : "text-[color:var(--sidebar-text-muted,var(--muted))] hover:bg-white/5 hover:text-[color:var(--sidebar-text,var(--foreground))]"
|
|
2474
2508
|
].join(" "),
|
|
2475
2509
|
children: OptIcon ? /* @__PURE__ */ jsxRuntime.jsx(OptIcon, { size: 15, className: "shrink-0" }) : null
|
|
2476
2510
|
},
|
|
@@ -2480,93 +2514,99 @@ function NavSidebar({
|
|
|
2480
2514
|
)
|
|
2481
2515
|
}
|
|
2482
2516
|
),
|
|
2483
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-
|
|
2484
|
-
] }) : null
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
NavSectionRow,
|
|
2503
|
-
{
|
|
2504
|
-
label: child.label,
|
|
2505
|
-
first: idx === 0 && i === 0
|
|
2506
|
-
},
|
|
2507
|
-
`flat-section-${idx}-${i}-${child.label}`
|
|
2508
|
-
);
|
|
2509
|
-
}
|
|
2517
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-left text-[11px] leading-[1.2] text-[color:var(--sidebar-caption,var(--sidebar-text-muted,var(--muted)))]", children: modeCaption(mode.label) })
|
|
2518
|
+
] }) : null
|
|
2519
|
+
] }),
|
|
2520
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col overflow-y-auto px-[10px] py-3", children: /* @__PURE__ */ jsxRuntime.jsxs("nav", { className: "flex flex-col gap-0.5", children: [
|
|
2521
|
+
nav.groupLabel ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: `${NAV_EYEBROW_CLASS} px-2 pb-1.5 pt-1`, children: nav.groupLabel }) : null,
|
|
2522
|
+
nav.items.map((item, idx) => {
|
|
2523
|
+
if (item.kind === "section") {
|
|
2524
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2525
|
+
NavSectionRow,
|
|
2526
|
+
{
|
|
2527
|
+
label: item.label,
|
|
2528
|
+
first: idx === 0
|
|
2529
|
+
},
|
|
2530
|
+
`section-${idx}-${item.label}`
|
|
2531
|
+
);
|
|
2532
|
+
}
|
|
2533
|
+
if (nav.flatten && item.children && item.children.length > 0) {
|
|
2534
|
+
return item.children.map((child, i) => {
|
|
2535
|
+
if (child.kind === "section") {
|
|
2510
2536
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2511
|
-
|
|
2537
|
+
NavSectionRow,
|
|
2512
2538
|
{
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
Link,
|
|
2516
|
-
variant: "flat"
|
|
2539
|
+
label: child.label,
|
|
2540
|
+
first: idx === 0 && i === 0
|
|
2517
2541
|
},
|
|
2518
|
-
|
|
2542
|
+
`flat-section-${idx}-${i}-${child.label}`
|
|
2519
2543
|
);
|
|
2520
|
-
}
|
|
2521
|
-
}
|
|
2522
|
-
if (item.children && item.children.length > 0) {
|
|
2523
|
-
const key = groupKeyOf(item, idx);
|
|
2524
|
-
const selfActive = item.href ? activeFn(pathname, item.href) : false;
|
|
2525
|
-
const parentActive = selfActive || hasActiveChild(item, pathname, activeFn);
|
|
2544
|
+
}
|
|
2526
2545
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2527
|
-
|
|
2546
|
+
NavRow,
|
|
2528
2547
|
{
|
|
2529
|
-
item,
|
|
2530
|
-
active:
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
pathname,
|
|
2534
|
-
activeFn,
|
|
2535
|
-
Link
|
|
2548
|
+
item: child,
|
|
2549
|
+
active: child.href ? activeFn(pathname, child.href) : false,
|
|
2550
|
+
Link,
|
|
2551
|
+
variant: "flat"
|
|
2536
2552
|
},
|
|
2537
|
-
|
|
2553
|
+
child.href ?? `flat-${idx}-${i}-${child.label}`
|
|
2538
2554
|
);
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
if (item.children && item.children.length > 0) {
|
|
2558
|
+
const key = groupKeyOf(item, idx);
|
|
2559
|
+
const selfActive = item.href ? activeFn(pathname, item.href) : false;
|
|
2560
|
+
const parentActive = selfActive || hasActiveChild(item, pathname, activeFn);
|
|
2541
2561
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2542
|
-
|
|
2562
|
+
NavGroup,
|
|
2543
2563
|
{
|
|
2544
2564
|
item,
|
|
2545
|
-
active,
|
|
2565
|
+
active: parentActive,
|
|
2566
|
+
open: openGroup === key,
|
|
2567
|
+
onToggle: () => toggleGroup(key),
|
|
2568
|
+
pathname,
|
|
2569
|
+
activeFn,
|
|
2546
2570
|
Link
|
|
2547
2571
|
},
|
|
2548
|
-
|
|
2572
|
+
key
|
|
2549
2573
|
);
|
|
2550
|
-
}
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
footer.links && footer.links.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center justify-center gap-1.5 text-xs", children: footer.links.map((l, idx) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
2555
|
-
idx > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[color:var(--muted)]", children: "|" }) : null,
|
|
2556
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2557
|
-
"a",
|
|
2574
|
+
}
|
|
2575
|
+
const active = item.href ? activeFn(pathname, item.href) : false;
|
|
2576
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2577
|
+
NavRow,
|
|
2558
2578
|
{
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
}
|
|
2563
|
-
|
|
2564
|
-
|
|
2579
|
+
item,
|
|
2580
|
+
active,
|
|
2581
|
+
Link
|
|
2582
|
+
},
|
|
2583
|
+
item.href ?? `nav-${idx}-${item.label}`
|
|
2584
|
+
);
|
|
2585
|
+
})
|
|
2586
|
+
] }) }),
|
|
2587
|
+
footer ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0 border-t border-[color:var(--sidebar-line,var(--line))] px-[14px] py-3", children: [
|
|
2588
|
+
footer.user ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2589
|
+
NavSidebarUserCard,
|
|
2590
|
+
{
|
|
2591
|
+
user: footer.user,
|
|
2592
|
+
userMenu: footer.userMenu ?? void 0,
|
|
2593
|
+
onSignOut: footer.onSignOut
|
|
2594
|
+
}
|
|
2595
|
+
) : null,
|
|
2596
|
+
footer.links && footer.links.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex flex-wrap items-center gap-[10px] text-[11px] leading-[1.2] ${footer.user ? "mt-3" : ""}`, children: footer.links.map((l) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2597
|
+
"a",
|
|
2598
|
+
{
|
|
2599
|
+
href: safeHref(l.href),
|
|
2600
|
+
className: "text-[color:var(--sidebar-caption,var(--sidebar-text-muted,var(--muted)))] hover:text-[color:var(--sidebar-text,var(--foreground))] hover:underline",
|
|
2601
|
+
children: l.label
|
|
2602
|
+
},
|
|
2603
|
+
l.label
|
|
2604
|
+
)) }) : null,
|
|
2565
2605
|
footer.envLabel && footer.envLabel.trim().toLowerCase() !== "production" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2566
2606
|
"div",
|
|
2567
2607
|
{
|
|
2568
2608
|
"data-shell-meta": true,
|
|
2569
|
-
className: "mt-1.5 flex flex-col items-
|
|
2609
|
+
className: "mt-1.5 flex flex-col items-start gap-0.5 font-[family-name:var(--font-plex-mono)] text-[10px] text-[color:var(--sidebar-meta-text,var(--sidebar-text))]",
|
|
2570
2610
|
children: [
|
|
2571
2611
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
2572
2612
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2629,6 +2669,27 @@ function HamburgerIcon() {
|
|
|
2629
2669
|
}
|
|
2630
2670
|
);
|
|
2631
2671
|
}
|
|
2672
|
+
function BookOpenIcon() {
|
|
2673
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2674
|
+
"svg",
|
|
2675
|
+
{
|
|
2676
|
+
width: 14,
|
|
2677
|
+
height: 14,
|
|
2678
|
+
viewBox: "0 0 24 24",
|
|
2679
|
+
fill: "none",
|
|
2680
|
+
stroke: "currentColor",
|
|
2681
|
+
strokeWidth: 2,
|
|
2682
|
+
strokeLinecap: "round",
|
|
2683
|
+
strokeLinejoin: "round",
|
|
2684
|
+
className: "shrink-0",
|
|
2685
|
+
"aria-hidden": "true",
|
|
2686
|
+
children: [
|
|
2687
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 7v14" }),
|
|
2688
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" })
|
|
2689
|
+
]
|
|
2690
|
+
}
|
|
2691
|
+
);
|
|
2692
|
+
}
|
|
2632
2693
|
function SearchIcon({ className } = {}) {
|
|
2633
2694
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2634
2695
|
"svg",
|
|
@@ -2670,12 +2731,12 @@ function CloseIcon() {
|
|
|
2670
2731
|
}
|
|
2671
2732
|
);
|
|
2672
2733
|
}
|
|
2673
|
-
function ChevronDown({ className } = {}) {
|
|
2734
|
+
function ChevronDown({ className, size = 16 } = {}) {
|
|
2674
2735
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2675
2736
|
"svg",
|
|
2676
2737
|
{
|
|
2677
|
-
width:
|
|
2678
|
-
height:
|
|
2738
|
+
width: size,
|
|
2739
|
+
height: size,
|
|
2679
2740
|
viewBox: "0 0 24 24",
|
|
2680
2741
|
fill: "none",
|
|
2681
2742
|
stroke: "currentColor",
|
|
@@ -2689,6 +2750,28 @@ function ChevronDown({ className } = {}) {
|
|
|
2689
2750
|
);
|
|
2690
2751
|
}
|
|
2691
2752
|
var NAV_HOVER_GRADIENT = "var(--nav-hover-gradient)";
|
|
2753
|
+
var NAV_EYEBROW_CLASS = "text-[11px] font-bold uppercase leading-[1.2] tracking-[0.09em] text-[color:var(--sidebar-eyebrow,var(--sidebar-text-muted,var(--muted)))]";
|
|
2754
|
+
var NAV_TOP_ICON_SIZE = 17;
|
|
2755
|
+
var NAV_TOP_ROW_CLASS = (active) => `gap-[11px] px-[10px] py-[9px] text-[13px] leading-none ${active ? "font-semibold" : "font-normal"}`;
|
|
2756
|
+
var NAV_TOP_ACTIVE_CLASS = "bg-[color:var(--sidebar-active-bg,var(--color-accent))] text-[color:var(--sidebar-active-text,white)]";
|
|
2757
|
+
var NAV_TOP_INACTIVE_CLASS = "text-[color:var(--sidebar-row-text,var(--sidebar-text,var(--muted)))] hover:bg-[color:var(--sidebar-row-hover-bg,var(--panel-elevated))] hover:text-[color:var(--sidebar-text,var(--foreground))]";
|
|
2758
|
+
function modeCaption(label) {
|
|
2759
|
+
return label.replace(/\s+Mode$/i, " mode");
|
|
2760
|
+
}
|
|
2761
|
+
function NavActiveRail() {
|
|
2762
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2763
|
+
"span",
|
|
2764
|
+
{
|
|
2765
|
+
"aria-hidden": "true",
|
|
2766
|
+
className: "pointer-events-none absolute inset-y-0 left-0 w-[2px]",
|
|
2767
|
+
style: { background: "var(--mode-accent, transparent)" }
|
|
2768
|
+
}
|
|
2769
|
+
);
|
|
2770
|
+
}
|
|
2771
|
+
function NavRowBadge({ value }) {
|
|
2772
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
2773
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto shrink-0 font-[family-name:var(--font-plex-mono,ui-monospace,monospace)] text-[11px] font-semibold leading-none text-[color:var(--sidebar-caption,var(--sidebar-text-muted,var(--muted)))]", children: value });
|
|
2774
|
+
}
|
|
2692
2775
|
function NavSectionRow({
|
|
2693
2776
|
label,
|
|
2694
2777
|
first,
|
|
@@ -2698,9 +2781,9 @@ function NavSectionRow({
|
|
|
2698
2781
|
"p",
|
|
2699
2782
|
{
|
|
2700
2783
|
className: [
|
|
2701
|
-
|
|
2702
|
-
variant === "sub" ? "px-3 pb-0.5" : "px-2 pb-1",
|
|
2703
|
-
first ? "" : "mt-3"
|
|
2784
|
+
NAV_EYEBROW_CLASS,
|
|
2785
|
+
variant === "sub" ? "px-3 pb-0.5" : "px-2 pb-1.5 pt-1",
|
|
2786
|
+
first ? "" : variant === "sub" ? "mt-3" : "mt-[14px]"
|
|
2704
2787
|
].join(" "),
|
|
2705
2788
|
children: label
|
|
2706
2789
|
}
|
|
@@ -2715,39 +2798,32 @@ function NavRow({
|
|
|
2715
2798
|
const Icon = item.icon;
|
|
2716
2799
|
const isSub = variant === "sub";
|
|
2717
2800
|
const washActive = variant !== "top";
|
|
2718
|
-
const activeClasses = washActive ? "bg-[color:var(--mode-accent-surface,var(--panel-elevated))] text-[color:var(--color-accent)] shadow-sm" :
|
|
2801
|
+
const activeClasses = washActive ? "bg-[color:var(--mode-accent-surface,var(--panel-elevated))] text-[color:var(--color-accent)] shadow-sm" : NAV_TOP_ACTIVE_CLASS;
|
|
2719
2802
|
const wrapperClasses = [
|
|
2720
|
-
"group relative block overflow-hidden
|
|
2721
|
-
|
|
2803
|
+
"group relative block overflow-hidden transition",
|
|
2804
|
+
isSub ? "rounded-md" : "rounded-[5px]",
|
|
2805
|
+
active ? activeClasses : isSub ? "text-[color:var(--sidebar-text,var(--muted))] hover:text-white" : NAV_TOP_INACTIVE_CLASS
|
|
2722
2806
|
].join(" ");
|
|
2723
|
-
const rowPadding = isSub ? "px-3 py-1.5 text-[13px]" :
|
|
2724
|
-
const iconSize = isSub ? 16 :
|
|
2725
|
-
const iconClass =
|
|
2807
|
+
const rowPadding = isSub ? "gap-3 px-3 py-1.5 text-[13px] font-semibold" : NAV_TOP_ROW_CLASS(active);
|
|
2808
|
+
const iconSize = isSub ? 16 : NAV_TOP_ICON_SIZE;
|
|
2809
|
+
const iconClass = "text-current";
|
|
2726
2810
|
const inner = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2727
|
-
!active ?
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
className: "pointer-events-none absolute inset-y-0 left-0 w-0 transition-[width] duration-300 group-hover:w-full",
|
|
2732
|
-
style: { background: NAV_HOVER_GRADIENT }
|
|
2733
|
-
}
|
|
2734
|
-
) : (
|
|
2735
|
-
// Active-row rail, in the Mode's accent. `--mode-accent` is only set by
|
|
2736
|
-
// a declared Mode chrome group, and the inline `transparent` fallback
|
|
2737
|
-
// is what every other app gets — so this span is present but invisible
|
|
2738
|
-
// there, and being absolutely positioned it moves nothing.
|
|
2739
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2811
|
+
!active ? (
|
|
2812
|
+
// Sub rows keep the left→right gradient sweep; top-level rows take a
|
|
2813
|
+
// flat wash on hover (design rail: rgba(255,255,255,.05)).
|
|
2814
|
+
isSub ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2740
2815
|
"span",
|
|
2741
2816
|
{
|
|
2742
2817
|
"aria-hidden": "true",
|
|
2743
|
-
className: "pointer-events-none absolute inset-y-0 left-0 w-[
|
|
2744
|
-
style: { background:
|
|
2818
|
+
className: "pointer-events-none absolute inset-y-0 left-0 w-0 transition-[width] duration-300 group-hover:w-full",
|
|
2819
|
+
style: { background: NAV_HOVER_GRADIENT }
|
|
2745
2820
|
}
|
|
2746
|
-
)
|
|
2747
|
-
),
|
|
2748
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `relative z-10 flex items-center
|
|
2749
|
-
Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: iconSize, className: iconClass }) : null,
|
|
2750
|
-
item.label
|
|
2821
|
+
) : null
|
|
2822
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(NavActiveRail, {}),
|
|
2823
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `relative z-10 flex items-center ${rowPadding}`, children: [
|
|
2824
|
+
Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: iconSize, className: `shrink-0 ${iconClass}` }) : null,
|
|
2825
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
2826
|
+
/* @__PURE__ */ jsxRuntime.jsx(NavRowBadge, { value: item.badge })
|
|
2751
2827
|
] })
|
|
2752
2828
|
] });
|
|
2753
2829
|
if (item.disabled) {
|
|
@@ -2786,8 +2862,8 @@ function NavGroup({
|
|
|
2786
2862
|
const Icon = item.icon;
|
|
2787
2863
|
const headerClasses = [
|
|
2788
2864
|
"group relative block w-full overflow-hidden text-left transition",
|
|
2789
|
-
open ? "rounded-t-
|
|
2790
|
-
active ?
|
|
2865
|
+
open ? "rounded-t-[5px]" : "rounded-[5px]",
|
|
2866
|
+
active ? NAV_TOP_ACTIVE_CLASS : open ? "bg-[color:var(--sidebar-row-hover-bg,var(--panel))] text-[color:var(--sidebar-text,var(--foreground))]" : NAV_TOP_INACTIVE_CLASS
|
|
2791
2867
|
].join(" ");
|
|
2792
2868
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2793
2869
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2801,17 +2877,11 @@ function NavGroup({
|
|
|
2801
2877
|
"aria-expanded": open,
|
|
2802
2878
|
className: headerClasses,
|
|
2803
2879
|
children: [
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
{
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
style: { background: NAV_HOVER_GRADIENT }
|
|
2810
|
-
}
|
|
2811
|
-
) : null,
|
|
2812
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative z-10 flex items-center gap-3 px-3 py-2 text-sm font-semibold", children: [
|
|
2813
|
-
Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 18, className: active ? "text-white" : "text-current" }) : null,
|
|
2814
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children: item.label }),
|
|
2880
|
+
active ? /* @__PURE__ */ jsxRuntime.jsx(NavActiveRail, {}) : null,
|
|
2881
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `relative z-10 flex items-center ${NAV_TOP_ROW_CLASS(active)}`, children: [
|
|
2882
|
+
Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: NAV_TOP_ICON_SIZE, className: "shrink-0 text-current" }) : null,
|
|
2883
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
2884
|
+
/* @__PURE__ */ jsxRuntime.jsx(NavRowBadge, { value: item.badge }),
|
|
2815
2885
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2816
2886
|
ChevronDown,
|
|
2817
2887
|
{
|
|
@@ -2928,8 +2998,8 @@ function OrgIdCopyButton({ id }) {
|
|
|
2928
2998
|
setTimeout(() => setCopied(false), 1500);
|
|
2929
2999
|
},
|
|
2930
3000
|
title: "Copy organization id",
|
|
2931
|
-
className: "rounded px-1 text-[
|
|
2932
|
-
children: copied ? "Copied" :
|
|
3001
|
+
className: "-ml-1 rounded px-1 text-left font-[family-name:var(--font-plex-mono,ui-monospace,monospace)] text-[12px] leading-[1.2] text-[color:var(--sidebar-caption,var(--sidebar-text-muted,var(--muted)))] hover:bg-[color:var(--sidebar-row-hover-bg,var(--panel))]",
|
|
3002
|
+
children: copied ? "Copied" : `\u2026${id.slice(-8)}`
|
|
2933
3003
|
}
|
|
2934
3004
|
);
|
|
2935
3005
|
}
|
|
@@ -2946,7 +3016,8 @@ function NavTopBar({
|
|
|
2946
3016
|
onOpenNav,
|
|
2947
3017
|
navOpen,
|
|
2948
3018
|
search,
|
|
2949
|
-
buildNotes
|
|
3019
|
+
buildNotes,
|
|
3020
|
+
accountMenu = "topbar"
|
|
2950
3021
|
}) {
|
|
2951
3022
|
const rawName = user?.name?.trim() || "";
|
|
2952
3023
|
const hasRealName = rawName.length > 0 && !rawName.includes("@");
|
|
@@ -2954,7 +3025,7 @@ function NavTopBar({
|
|
|
2954
3025
|
const initials = (hasRealName ? rawName : user?.email ?? "P").slice(0, 2).toUpperCase();
|
|
2955
3026
|
const secondary = hasRealName ? user?.email || [user?.tier, user?.role].filter(Boolean).join(" \xB7 ") || "member" : [user?.tier, user?.role].filter(Boolean).join(" \xB7 ") || "member";
|
|
2956
3027
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sticky top-0 z-20", children: [
|
|
2957
|
-
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex h-[var(--topbar-height,60px)] items-center justify-between gap-
|
|
3028
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex h-[var(--topbar-height,60px)] items-center justify-between gap-[14px] border-b border-[color:var(--line)] bg-[color:var(--panel)] px-[var(--topbar-padding-x,20px)]", children: [
|
|
2958
3029
|
onOpenNav ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2959
3030
|
"button",
|
|
2960
3031
|
{
|
|
@@ -2967,8 +3038,8 @@ function NavTopBar({
|
|
|
2967
3038
|
children: /* @__PURE__ */ jsxRuntime.jsx(HamburgerIcon, {})
|
|
2968
3039
|
}
|
|
2969
3040
|
) : null,
|
|
2970
|
-
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "relative flex w-[320px] max-w-full shrink-0 items-center", children: [
|
|
2971
|
-
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "pointer-events-none absolute left-
|
|
3041
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "relative flex h-9 w-[320px] max-w-full shrink-0 items-center", children: [
|
|
3042
|
+
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "pointer-events-none absolute left-[10px] h-[15px] w-[15px] text-[color:var(--muted)]" }),
|
|
2972
3043
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2973
3044
|
"input",
|
|
2974
3045
|
{
|
|
@@ -2980,32 +3051,35 @@ function NavTopBar({
|
|
|
2980
3051
|
if (e.key === "Enter") search.onSubmit?.(e.target.value);
|
|
2981
3052
|
} : void 0,
|
|
2982
3053
|
readOnly: !search?.onChange,
|
|
2983
|
-
className: "w-full rounded-
|
|
3054
|
+
className: "h-full w-full rounded-[5px] border border-[color:var(--line)] bg-[color:var(--surface-sunken,var(--panel-elevated))] pl-[33px] pr-10 text-[13px] text-[color:var(--foreground)] placeholder:text-[color:var(--muted)] focus:outline-none focus:ring-2 focus:ring-[color:var(--color-accent)]"
|
|
2984
3055
|
}
|
|
2985
3056
|
),
|
|
2986
3057
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2987
3058
|
"kbd",
|
|
2988
3059
|
{
|
|
2989
3060
|
"aria-hidden": true,
|
|
2990
|
-
className: "pointer-events-none absolute right-
|
|
3061
|
+
className: "pointer-events-none absolute right-[10px] rounded-[3px] border border-[color:var(--line)] px-[5px] py-px font-[family-name:var(--font-plex-mono,ui-monospace,monospace)] text-[12px] leading-[1.2] text-[color:var(--muted)]",
|
|
2991
3062
|
children: "/"
|
|
2992
3063
|
}
|
|
2993
3064
|
)
|
|
2994
3065
|
] }),
|
|
2995
3066
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative ml-auto flex shrink-0 items-center gap-[var(--topbar-icon-gap,8px)]", children: [
|
|
2996
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3067
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2997
3068
|
"button",
|
|
2998
3069
|
{
|
|
2999
3070
|
type: "button",
|
|
3000
3071
|
onClick: buildNotes?.onOpen,
|
|
3001
|
-
className: "shrink-0
|
|
3002
|
-
children:
|
|
3072
|
+
className: "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-[5px] px-3 text-xs font-semibold text-[color:var(--muted)] transition hover:bg-[color:var(--surface-sunken,var(--panel-elevated))] hover:text-[color:var(--foreground)]",
|
|
3073
|
+
children: [
|
|
3074
|
+
/* @__PURE__ */ jsxRuntime.jsx(BookOpenIcon, {}),
|
|
3075
|
+
buildNotes?.label ?? "Build notes"
|
|
3076
|
+
]
|
|
3003
3077
|
}
|
|
3004
3078
|
),
|
|
3005
3079
|
actionsList && actionsList.length > 0 ? actionsList.map((action) => /* @__PURE__ */ jsxRuntime.jsx(NavTopBarActionButton, { action }, action.key)) : null,
|
|
3006
3080
|
actions,
|
|
3007
3081
|
themeToggle,
|
|
3008
|
-
/* @__PURE__ */ jsxRuntime.jsxs("details", { "data-nav-details": true, className: "group/acct relative", children: [
|
|
3082
|
+
accountMenu === "topbar" ? /* @__PURE__ */ jsxRuntime.jsxs("details", { "data-nav-details": true, className: "group/acct relative", children: [
|
|
3009
3083
|
/* @__PURE__ */ jsxRuntime.jsxs("summary", { className: "group/tbtip relative flex cursor-pointer list-none items-center gap-2.5 rounded-full py-1 pl-1 pr-2 transition hover:bg-[color:var(--panel-elevated)] [&::-webkit-details-marker]:hidden", children: [
|
|
3010
3084
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-[var(--topbar-icon-button-size,32px)] w-[var(--topbar-icon-button-size,32px)] items-center justify-center overflow-hidden rounded-full bg-[color:var(--color-accent)] text-xs font-bold text-white", children: user?.avatarUrl || user?.memojiUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3011
3085
|
"img",
|
|
@@ -3036,127 +3110,9 @@ function NavTopBar({
|
|
|
3036
3110
|
}
|
|
3037
3111
|
) })
|
|
3038
3112
|
] }),
|
|
3039
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
userMenu?.myProfileHref ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3043
|
-
"a",
|
|
3044
|
-
{
|
|
3045
|
-
href: safeHref(userMenu.myProfileHref),
|
|
3046
|
-
className: "flex w-full items-center gap-2.5 px-4 py-2.5 text-left text-sm font-medium text-[color:var(--foreground)] hover:bg-[color:var(--panel)]",
|
|
3047
|
-
children: [
|
|
3048
|
-
/* @__PURE__ */ jsxRuntime.jsx(ProfileIcon, {}),
|
|
3049
|
-
"My Profile"
|
|
3050
|
-
]
|
|
3051
|
-
}
|
|
3052
|
-
) : null,
|
|
3053
|
-
userMenu?.organizationSettingsHref ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3054
|
-
"a",
|
|
3055
|
-
{
|
|
3056
|
-
href: safeHref(userMenu.organizationSettingsHref),
|
|
3057
|
-
className: "flex w-full items-center gap-2.5 border-t border-[color:var(--line)] px-4 py-2.5 text-left text-sm font-medium text-[color:var(--foreground)] hover:bg-[color:var(--panel)]",
|
|
3058
|
-
children: [
|
|
3059
|
-
/* @__PURE__ */ jsxRuntime.jsx(BriefcaseIcon, {}),
|
|
3060
|
-
"Organization Settings"
|
|
3061
|
-
]
|
|
3062
|
-
}
|
|
3063
|
-
) : null,
|
|
3064
|
-
userMenu?.roles && userMenu.roles.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[color:var(--line)] px-4 py-3", children: [
|
|
3065
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-[color:var(--muted)]", children: "Roles & Organizations" }),
|
|
3066
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1.5", children: userMenu.roles.map((r, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex flex-wrap items-center gap-1.5 text-sm", children: [
|
|
3067
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-md bg-[color:var(--panel)] px-2 py-0.5 text-xs font-bold uppercase tracking-wide text-[color:var(--foreground)]", children: r.role }),
|
|
3068
|
-
r.orgName ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[color:var(--muted)]", children: [
|
|
3069
|
-
"in ",
|
|
3070
|
-
r.orgName
|
|
3071
|
-
] }) : null
|
|
3072
|
-
] }, `${r.role}-${i}`)) })
|
|
3073
|
-
] }) : null,
|
|
3074
|
-
userMenu?.accounts && userMenu.accounts.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[color:var(--line)] px-4 py-3", children: [
|
|
3075
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-[color:var(--muted)]", children: "Accounts" }),
|
|
3076
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1", children: userMenu.accounts.map((a) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2.5", children: [
|
|
3077
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3078
|
-
"button",
|
|
3079
|
-
{
|
|
3080
|
-
type: "button",
|
|
3081
|
-
onClick: () => {
|
|
3082
|
-
if (!a.active) userMenu.onSwitchAccount?.(a.id);
|
|
3083
|
-
},
|
|
3084
|
-
className: "flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-1 py-1 text-left hover:bg-[color:var(--panel)]",
|
|
3085
|
-
children: [
|
|
3086
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-full bg-[color:var(--color-accent)] text-[11px] font-bold text-white", children: a.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: a.avatarUrl, alt: "", className: "h-full w-full object-cover" }) : (a.name ?? a.email ?? "?").slice(0, 2).toUpperCase() }),
|
|
3087
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col leading-tight", children: [
|
|
3088
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3089
|
-
"span",
|
|
3090
|
-
{
|
|
3091
|
-
className: [
|
|
3092
|
-
"truncate text-sm font-semibold",
|
|
3093
|
-
a.active ? "text-[color:var(--color-accent)]" : "text-[color:var(--foreground)]"
|
|
3094
|
-
].join(" "),
|
|
3095
|
-
children: a.name ?? a.email ?? a.id.slice(0, 8)
|
|
3096
|
-
}
|
|
3097
|
-
),
|
|
3098
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-[color:var(--muted)]", children: a.active ? "Active" : a.email ?? "" })
|
|
3099
|
-
] })
|
|
3100
|
-
]
|
|
3101
|
-
}
|
|
3102
|
-
),
|
|
3103
|
-
!a.active && userMenu.onRemoveAccount ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3104
|
-
"button",
|
|
3105
|
-
{
|
|
3106
|
-
type: "button",
|
|
3107
|
-
"aria-label": `Remove ${a.name ?? a.email ?? "account"}`,
|
|
3108
|
-
onClick: () => userMenu.onRemoveAccount?.(a.id),
|
|
3109
|
-
className: "shrink-0 rounded p-1 text-[color:var(--color-accent)] hover:bg-[color:var(--panel)]",
|
|
3110
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {})
|
|
3111
|
-
}
|
|
3112
|
-
) : null
|
|
3113
|
-
] }, a.id)) }),
|
|
3114
|
-
userMenu.addAccountHref || userMenu.onAddAccount ? userMenu.addAccountHref ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3115
|
-
"a",
|
|
3116
|
-
{
|
|
3117
|
-
href: safeHref(userMenu.addAccountHref),
|
|
3118
|
-
className: "mt-1.5 flex items-center gap-2.5 rounded-lg px-1 py-1.5 text-sm font-semibold text-[color:var(--color-accent)] hover:bg-[color:var(--panel)]",
|
|
3119
|
-
children: [
|
|
3120
|
-
/* @__PURE__ */ jsxRuntime.jsx(AddUserIcon, {}),
|
|
3121
|
-
"Add Account"
|
|
3122
|
-
]
|
|
3123
|
-
}
|
|
3124
|
-
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3125
|
-
"button",
|
|
3126
|
-
{
|
|
3127
|
-
type: "button",
|
|
3128
|
-
onClick: userMenu.onAddAccount,
|
|
3129
|
-
className: "mt-1.5 flex w-full items-center gap-2.5 rounded-lg px-1 py-1.5 text-left text-sm font-semibold text-[color:var(--color-accent)] hover:bg-[color:var(--panel)]",
|
|
3130
|
-
children: [
|
|
3131
|
-
/* @__PURE__ */ jsxRuntime.jsx(AddUserIcon, {}),
|
|
3132
|
-
"Add Account"
|
|
3133
|
-
]
|
|
3134
|
-
}
|
|
3135
|
-
) : null
|
|
3136
|
-
] }) : null,
|
|
3137
|
-
userMenu?.theme ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[color:var(--line)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3138
|
-
NavThemeControl,
|
|
3139
|
-
{
|
|
3140
|
-
value: userMenu.theme.value,
|
|
3141
|
-
onChange: userMenu.theme.onChange
|
|
3142
|
-
}
|
|
3143
|
-
) }) : null
|
|
3144
|
-
] }),
|
|
3145
|
-
onSignOut ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3146
|
-
"button",
|
|
3147
|
-
{
|
|
3148
|
-
type: "button",
|
|
3149
|
-
onClick: onSignOut,
|
|
3150
|
-
className: "flex w-full shrink-0 items-center gap-2.5 border-t border-[color:var(--line)] px-4 py-2.5 text-left text-sm font-medium text-[color:var(--foreground)] hover:bg-[color:var(--panel)] hover:text-[color:var(--color-accent)]",
|
|
3151
|
-
children: [
|
|
3152
|
-
/* @__PURE__ */ jsxRuntime.jsx(SignOutIcon, {}),
|
|
3153
|
-
"Sign out"
|
|
3154
|
-
]
|
|
3155
|
-
}
|
|
3156
|
-
) : null
|
|
3157
|
-
] })
|
|
3158
|
-
] }),
|
|
3159
|
-
!hasRealName && user ? /* @__PURE__ */ jsxRuntime.jsx(NamePromptBubble, { profileHref: userMenu?.myProfileHref }) : null
|
|
3113
|
+
/* @__PURE__ */ jsxRuntime.jsx(NavAccountMenuPanel, { userMenu, onSignOut, placement: "below" })
|
|
3114
|
+
] }) : null,
|
|
3115
|
+
accountMenu === "topbar" && !hasRealName && user ? /* @__PURE__ */ jsxRuntime.jsx(NamePromptBubble, { profileHref: userMenu?.myProfileHref }) : null
|
|
3160
3116
|
] })
|
|
3161
3117
|
] }),
|
|
3162
3118
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3171,7 +3127,191 @@ function NavTopBar({
|
|
|
3171
3127
|
)
|
|
3172
3128
|
] });
|
|
3173
3129
|
}
|
|
3174
|
-
function
|
|
3130
|
+
function NavAccountMenuPanel({
|
|
3131
|
+
userMenu,
|
|
3132
|
+
onSignOut,
|
|
3133
|
+
placement
|
|
3134
|
+
}) {
|
|
3135
|
+
const wrapper = placement === "above" ? "absolute bottom-full left-0 right-0 z-40 mb-2 flex max-h-[calc(100vh-5rem)] flex-col overflow-hidden rounded-xl border border-[color:var(--line)] bg-[color:var(--panel-elevated)] py-1 text-[color:var(--foreground)] shadow-[var(--shadow-soft)]" : "absolute right-0 z-30 mt-2 flex max-h-[calc(100vh-5rem)] w-72 flex-col overflow-hidden rounded-xl border border-[color:var(--line)] bg-[color:var(--panel-elevated)] py-1 shadow-[var(--shadow-soft)]";
|
|
3136
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapper, children: [
|
|
3137
|
+
placement === "below" ? /* @__PURE__ */ jsxRuntime.jsx(TopBarPanelArrow, {}) : null,
|
|
3138
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain", children: [
|
|
3139
|
+
userMenu?.myProfileHref ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3140
|
+
"a",
|
|
3141
|
+
{
|
|
3142
|
+
href: safeHref(userMenu.myProfileHref),
|
|
3143
|
+
className: "flex w-full items-center gap-2.5 px-4 py-2.5 text-left text-sm font-medium text-[color:var(--foreground)] hover:bg-[color:var(--panel)]",
|
|
3144
|
+
children: [
|
|
3145
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProfileIcon, {}),
|
|
3146
|
+
"My Profile"
|
|
3147
|
+
]
|
|
3148
|
+
}
|
|
3149
|
+
) : null,
|
|
3150
|
+
userMenu?.organizationSettingsHref ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3151
|
+
"a",
|
|
3152
|
+
{
|
|
3153
|
+
href: safeHref(userMenu.organizationSettingsHref),
|
|
3154
|
+
className: "flex w-full items-center gap-2.5 border-t border-[color:var(--line)] px-4 py-2.5 text-left text-sm font-medium text-[color:var(--foreground)] hover:bg-[color:var(--panel)]",
|
|
3155
|
+
children: [
|
|
3156
|
+
/* @__PURE__ */ jsxRuntime.jsx(BriefcaseIcon, {}),
|
|
3157
|
+
"Organization Settings"
|
|
3158
|
+
]
|
|
3159
|
+
}
|
|
3160
|
+
) : null,
|
|
3161
|
+
userMenu?.roles && userMenu.roles.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[color:var(--line)] px-4 py-3", children: [
|
|
3162
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-[color:var(--muted)]", children: "Roles & Organizations" }),
|
|
3163
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1.5", children: userMenu.roles.map((r, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex flex-wrap items-center gap-1.5 text-sm", children: [
|
|
3164
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-md bg-[color:var(--panel)] px-2 py-0.5 text-xs font-bold uppercase tracking-wide text-[color:var(--foreground)]", children: r.role }),
|
|
3165
|
+
r.orgName ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[color:var(--muted)]", children: [
|
|
3166
|
+
"in ",
|
|
3167
|
+
r.orgName
|
|
3168
|
+
] }) : null
|
|
3169
|
+
] }, `${r.role}-${i}`)) })
|
|
3170
|
+
] }) : null,
|
|
3171
|
+
userMenu?.accounts && userMenu.accounts.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[color:var(--line)] px-4 py-3", children: [
|
|
3172
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-[color:var(--muted)]", children: "Accounts" }),
|
|
3173
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1", children: userMenu.accounts.map((a) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2.5", children: [
|
|
3174
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3175
|
+
"button",
|
|
3176
|
+
{
|
|
3177
|
+
type: "button",
|
|
3178
|
+
onClick: () => {
|
|
3179
|
+
if (!a.active) userMenu.onSwitchAccount?.(a.id);
|
|
3180
|
+
},
|
|
3181
|
+
className: "flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-1 py-1 text-left hover:bg-[color:var(--panel)]",
|
|
3182
|
+
children: [
|
|
3183
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-full bg-[color:var(--color-accent)] text-[11px] font-bold text-white", children: a.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: a.avatarUrl, alt: "", className: "h-full w-full object-cover" }) : (a.name ?? a.email ?? "?").slice(0, 2).toUpperCase() }),
|
|
3184
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col leading-tight", children: [
|
|
3185
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3186
|
+
"span",
|
|
3187
|
+
{
|
|
3188
|
+
className: [
|
|
3189
|
+
"truncate text-sm font-semibold",
|
|
3190
|
+
a.active ? "text-[color:var(--color-accent)]" : "text-[color:var(--foreground)]"
|
|
3191
|
+
].join(" "),
|
|
3192
|
+
children: a.name ?? a.email ?? a.id.slice(0, 8)
|
|
3193
|
+
}
|
|
3194
|
+
),
|
|
3195
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-[color:var(--muted)]", children: a.active ? "Active" : a.email ?? "" })
|
|
3196
|
+
] })
|
|
3197
|
+
]
|
|
3198
|
+
}
|
|
3199
|
+
),
|
|
3200
|
+
!a.active && userMenu.onRemoveAccount ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3201
|
+
"button",
|
|
3202
|
+
{
|
|
3203
|
+
type: "button",
|
|
3204
|
+
"aria-label": `Remove ${a.name ?? a.email ?? "account"}`,
|
|
3205
|
+
onClick: () => userMenu.onRemoveAccount?.(a.id),
|
|
3206
|
+
className: "shrink-0 rounded p-1 text-[color:var(--color-accent)] hover:bg-[color:var(--panel)]",
|
|
3207
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {})
|
|
3208
|
+
}
|
|
3209
|
+
) : null
|
|
3210
|
+
] }, a.id)) }),
|
|
3211
|
+
userMenu.addAccountHref || userMenu.onAddAccount ? userMenu.addAccountHref ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3212
|
+
"a",
|
|
3213
|
+
{
|
|
3214
|
+
href: safeHref(userMenu.addAccountHref),
|
|
3215
|
+
className: "mt-1.5 flex items-center gap-2.5 rounded-lg px-1 py-1.5 text-sm font-semibold text-[color:var(--color-accent)] hover:bg-[color:var(--panel)]",
|
|
3216
|
+
children: [
|
|
3217
|
+
/* @__PURE__ */ jsxRuntime.jsx(AddUserIcon, {}),
|
|
3218
|
+
"Add Account"
|
|
3219
|
+
]
|
|
3220
|
+
}
|
|
3221
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3222
|
+
"button",
|
|
3223
|
+
{
|
|
3224
|
+
type: "button",
|
|
3225
|
+
onClick: userMenu.onAddAccount,
|
|
3226
|
+
className: "mt-1.5 flex w-full items-center gap-2.5 rounded-lg px-1 py-1.5 text-left text-sm font-semibold text-[color:var(--color-accent)] hover:bg-[color:var(--panel)]",
|
|
3227
|
+
children: [
|
|
3228
|
+
/* @__PURE__ */ jsxRuntime.jsx(AddUserIcon, {}),
|
|
3229
|
+
"Add Account"
|
|
3230
|
+
]
|
|
3231
|
+
}
|
|
3232
|
+
) : null
|
|
3233
|
+
] }) : null,
|
|
3234
|
+
userMenu?.theme ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[color:var(--line)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3235
|
+
NavThemeControl,
|
|
3236
|
+
{
|
|
3237
|
+
value: userMenu.theme.value,
|
|
3238
|
+
onChange: userMenu.theme.onChange
|
|
3239
|
+
}
|
|
3240
|
+
) }) : null,
|
|
3241
|
+
userMenu?.navDisplay ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[color:var(--line)] px-4 py-3", children: [
|
|
3242
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-[color:var(--muted)]", children: "Navigation display" }),
|
|
3243
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { role: "radiogroup", "aria-label": "Navigation display", className: "flex flex-col gap-0.5", children: NAV_DISPLAY_OPTIONS.map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3244
|
+
"button",
|
|
3245
|
+
{
|
|
3246
|
+
type: "button",
|
|
3247
|
+
role: "radio",
|
|
3248
|
+
"aria-checked": userMenu.navDisplay?.value === opt.value,
|
|
3249
|
+
onClick: () => userMenu.navDisplay?.onChange(opt.value),
|
|
3250
|
+
className: [
|
|
3251
|
+
"flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left text-sm font-medium",
|
|
3252
|
+
userMenu.navDisplay?.value === opt.value ? "text-[color:var(--color-accent)]" : "text-[color:var(--foreground)] hover:bg-[color:var(--panel)]"
|
|
3253
|
+
].join(" "),
|
|
3254
|
+
children: [
|
|
3255
|
+
opt.label,
|
|
3256
|
+
userMenu.navDisplay?.value === opt.value ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\u2713" }) : null
|
|
3257
|
+
]
|
|
3258
|
+
},
|
|
3259
|
+
opt.value
|
|
3260
|
+
)) })
|
|
3261
|
+
] }) : null
|
|
3262
|
+
] }),
|
|
3263
|
+
onSignOut ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3264
|
+
"button",
|
|
3265
|
+
{
|
|
3266
|
+
type: "button",
|
|
3267
|
+
onClick: onSignOut,
|
|
3268
|
+
className: "flex w-full shrink-0 items-center gap-2.5 border-t border-[color:var(--line)] px-4 py-2.5 text-left text-sm font-medium text-[color:var(--foreground)] hover:bg-[color:var(--panel)] hover:text-[color:var(--color-accent)]",
|
|
3269
|
+
children: [
|
|
3270
|
+
/* @__PURE__ */ jsxRuntime.jsx(SignOutIcon, {}),
|
|
3271
|
+
"Sign out"
|
|
3272
|
+
]
|
|
3273
|
+
}
|
|
3274
|
+
) : null
|
|
3275
|
+
] });
|
|
3276
|
+
}
|
|
3277
|
+
function NavSidebarUserCard({
|
|
3278
|
+
user,
|
|
3279
|
+
userMenu,
|
|
3280
|
+
onSignOut
|
|
3281
|
+
}) {
|
|
3282
|
+
const rawName = user.name?.trim() || "";
|
|
3283
|
+
const hasRealName = rawName.length > 0 && !rawName.includes("@");
|
|
3284
|
+
const displayName = hasRealName ? rawName : user.email ?? "Signed in";
|
|
3285
|
+
const initials = (hasRealName ? rawName : user.email ?? "P").slice(0, 2).toUpperCase();
|
|
3286
|
+
const secondary = hasRealName ? user.email || [user.tier, user.role].filter(Boolean).join(" \xB7 ") || "member" : [user.tier, user.role].filter(Boolean).join(" \xB7 ") || "member";
|
|
3287
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("details", { "data-nav-details": true, className: "group/acct relative", children: [
|
|
3288
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3289
|
+
"summary",
|
|
3290
|
+
{
|
|
3291
|
+
"aria-label": "My Account",
|
|
3292
|
+
className: "flex w-full cursor-pointer list-none items-center gap-[9px] rounded-[5px] px-1 py-1 text-left transition hover:bg-[color:var(--sidebar-row-hover-bg,var(--panel-elevated))] [&::-webkit-details-marker]:hidden",
|
|
3293
|
+
children: [
|
|
3294
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-full bg-[color:var(--sidebar-avatar-bg,var(--color-accent))] text-[11px] font-bold text-white", children: user.avatarUrl || user.memojiUrl ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: user.avatarUrl || user.memojiUrl, alt: "", className: "h-full w-full object-cover" }) : initials }),
|
|
3295
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
3296
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-[12px] font-semibold leading-[1.2] text-[color:var(--sidebar-text,var(--foreground))]", children: displayName }),
|
|
3297
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-[11px] leading-[1.3] text-[color:var(--sidebar-caption,var(--sidebar-text-muted,var(--muted)))]", children: secondary })
|
|
3298
|
+
] }),
|
|
3299
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 14, className: "shrink-0 rotate-180 text-[color:var(--sidebar-caption,var(--sidebar-text-muted,var(--muted)))] transition group-open/acct:rotate-0" })
|
|
3300
|
+
]
|
|
3301
|
+
}
|
|
3302
|
+
),
|
|
3303
|
+
/* @__PURE__ */ jsxRuntime.jsx(NavAccountMenuPanel, { userMenu, onSignOut, placement: "above" }),
|
|
3304
|
+
!hasRealName ? /* @__PURE__ */ jsxRuntime.jsx(NamePromptBubble, { profileHref: userMenu?.myProfileHref, placement: "above" }) : null
|
|
3305
|
+
] });
|
|
3306
|
+
}
|
|
3307
|
+
function hexToRgba(hex, alpha) {
|
|
3308
|
+
if (!hex) return void 0;
|
|
3309
|
+
const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());
|
|
3310
|
+
if (!m) return void 0;
|
|
3311
|
+
const n = parseInt(m[1], 16);
|
|
3312
|
+
return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${alpha})`;
|
|
3313
|
+
}
|
|
3314
|
+
function NamePromptBubble({ profileHref, placement = "below" }) {
|
|
3175
3315
|
const KEY = "politogy_name_prompt_dismissed";
|
|
3176
3316
|
const [dismissed, setDismissed] = react.useState(true);
|
|
3177
3317
|
react.useEffect(() => {
|
|
@@ -3182,42 +3322,48 @@ function NamePromptBubble({ profileHref }) {
|
|
|
3182
3322
|
}
|
|
3183
3323
|
}, []);
|
|
3184
3324
|
if (dismissed) return null;
|
|
3185
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
"
|
|
3198
|
-
{
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
{
|
|
3207
|
-
type: "button",
|
|
3208
|
-
onClick: () => {
|
|
3209
|
-
setDismissed(true);
|
|
3210
|
-
try {
|
|
3211
|
-
sessionStorage.setItem(KEY, "1");
|
|
3212
|
-
} catch {
|
|
3325
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3326
|
+
"div",
|
|
3327
|
+
{
|
|
3328
|
+
className: placement === "above" ? "absolute bottom-full left-0 z-30 mb-2 w-64 rounded-xl border border-[color:var(--line)] bg-[color:var(--panel-elevated)] p-3 text-left shadow-[var(--shadow-soft)]" : "absolute right-4 top-full z-30 mt-2 w-64 rounded-xl border border-[color:var(--line)] bg-[color:var(--panel-elevated)] p-3 shadow-[var(--shadow-soft)]",
|
|
3329
|
+
children: [
|
|
3330
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3331
|
+
"span",
|
|
3332
|
+
{
|
|
3333
|
+
"aria-hidden": true,
|
|
3334
|
+
className: placement === "above" ? "absolute -bottom-[5px] left-[14px] h-2.5 w-2.5 rotate-45 border-b border-r border-[color:var(--line)] bg-[color:var(--panel-elevated)]" : "absolute -top-[5px] right-[11px] h-2.5 w-2.5 rotate-45 border-l border-t border-[color:var(--line)] bg-[color:var(--panel-elevated)]"
|
|
3335
|
+
}
|
|
3336
|
+
),
|
|
3337
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-[color:var(--foreground)]", children: "Add your name" }),
|
|
3338
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs leading-snug text-[color:var(--muted)]", children: "Set your first and last name so teammates see you \u2014 not your email." }),
|
|
3339
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
3340
|
+
profileHref ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3341
|
+
"a",
|
|
3342
|
+
{
|
|
3343
|
+
href: safeHref(profileHref),
|
|
3344
|
+
className: "rounded-full bg-[color:var(--color-accent)] px-3 py-1 text-xs font-semibold text-white hover:opacity-90",
|
|
3345
|
+
children: "Set name"
|
|
3213
3346
|
}
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3347
|
+
) : null,
|
|
3348
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3349
|
+
"button",
|
|
3350
|
+
{
|
|
3351
|
+
type: "button",
|
|
3352
|
+
onClick: () => {
|
|
3353
|
+
setDismissed(true);
|
|
3354
|
+
try {
|
|
3355
|
+
sessionStorage.setItem(KEY, "1");
|
|
3356
|
+
} catch {
|
|
3357
|
+
}
|
|
3358
|
+
},
|
|
3359
|
+
className: "rounded-full border border-[color:var(--line)] px-3 py-1 text-xs font-semibold text-[color:var(--foreground)] hover:bg-[color:var(--panel)]",
|
|
3360
|
+
children: "Dismiss"
|
|
3361
|
+
}
|
|
3362
|
+
)
|
|
3363
|
+
] })
|
|
3364
|
+
]
|
|
3365
|
+
}
|
|
3366
|
+
);
|
|
3221
3367
|
}
|
|
3222
3368
|
function formatFirstLast(name) {
|
|
3223
3369
|
const parts = name.split(/\s+/).filter(Boolean);
|
|
@@ -3278,8 +3424,8 @@ function NavTopBarActionButton({ action }) {
|
|
|
3278
3424
|
const BrandGlyph = action.slot ? resolveBrandGlyph(glyphName) : null;
|
|
3279
3425
|
const Glyph = BrandGlyph ?? Icon;
|
|
3280
3426
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3281
|
-
/* @__PURE__ */ jsxRuntime.jsx(Glyph, { size:
|
|
3282
|
-
typeof action.badge === "number" && action.badge > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-
|
|
3427
|
+
/* @__PURE__ */ jsxRuntime.jsx(Glyph, { size: TOPBAR_GLYPH_SIZE, className: "text-current" }),
|
|
3428
|
+
typeof action.badge === "number" && action.badge > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-[5px] -right-[5px] flex h-4 min-w-4 items-center justify-center rounded-full bg-[color:var(--chrome-danger,var(--color-accent))] px-1 text-[10px] font-bold leading-4 text-white", children: action.badge }) : null,
|
|
3283
3429
|
/* @__PURE__ */ jsxRuntime.jsx(TopBarTooltip, { title: action.label, description: action.description })
|
|
3284
3430
|
] });
|
|
3285
3431
|
const isExternal = action.href ? /^https?:\/\//.test(action.href) : false;
|
|
@@ -3504,6 +3650,7 @@ function NavAppShell({
|
|
|
3504
3650
|
topBar,
|
|
3505
3651
|
betaBanner,
|
|
3506
3652
|
contentWrapper = "padded",
|
|
3653
|
+
accountMenuPlacement = "sidebar",
|
|
3507
3654
|
modeId,
|
|
3508
3655
|
children
|
|
3509
3656
|
}) {
|
|
@@ -3520,15 +3667,29 @@ function NavAppShell({
|
|
|
3520
3667
|
document.body.style.overflow = previous;
|
|
3521
3668
|
};
|
|
3522
3669
|
}, [navOpen]);
|
|
3670
|
+
const sidebarFooter = accountMenuPlacement === "sidebar" && topBar.user ? {
|
|
3671
|
+
...sidebar.footer ?? {},
|
|
3672
|
+
user: sidebar.footer?.user ?? topBar.user,
|
|
3673
|
+
userMenu: sidebar.footer?.userMenu ?? topBar.userMenu,
|
|
3674
|
+
onSignOut: sidebar.footer?.onSignOut ?? topBar.onSignOut
|
|
3675
|
+
} : sidebar.footer;
|
|
3523
3676
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3524
3677
|
"div",
|
|
3525
3678
|
{
|
|
3526
3679
|
"data-politogy-mode": modeId,
|
|
3527
3680
|
className: "min-h-screen bg-[color:var(--background)] text-[color:var(--foreground)]",
|
|
3528
3681
|
children: [
|
|
3529
|
-
/* @__PURE__ */ jsxRuntime.jsx(NavSidebar, { ...sidebar, open: navOpen, onClose: () => setNavOpen(false) }),
|
|
3530
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lg:pl-[
|
|
3531
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3682
|
+
/* @__PURE__ */ jsxRuntime.jsx(NavSidebar, { ...sidebar, footer: sidebarFooter, open: navOpen, onClose: () => setNavOpen(false) }),
|
|
3683
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lg:pl-[var(--sidebar-width,236px)]", children: [
|
|
3684
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3685
|
+
NavTopBar,
|
|
3686
|
+
{
|
|
3687
|
+
...topBar,
|
|
3688
|
+
accountMenu: topBar.accountMenu ?? (accountMenuPlacement === "sidebar" ? "sidebar" : "topbar"),
|
|
3689
|
+
onOpenNav: () => setNavOpen(true),
|
|
3690
|
+
navOpen
|
|
3691
|
+
}
|
|
3692
|
+
),
|
|
3532
3693
|
betaBanner ? /* @__PURE__ */ jsxRuntime.jsx(NavBetaBanner, { ...betaBanner }) : null,
|
|
3533
3694
|
topBar.title ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "px-6 pt-7 text-xl font-semibold text-[color:var(--foreground)]", children: topBar.title }) : null,
|
|
3534
3695
|
contentWrapper === "bare" ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-shell-content": "", className: topBar.title ? "mt-[22px]" : void 0, children }) : (
|