@the-portland-company/shell 0.68.0 → 0.69.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 +46 -0
- package/README.md +4 -1
- package/dist/FormColumn-DsNP6NVG.d.cts +21 -0
- package/dist/FormColumn-DsNP6NVG.d.ts +21 -0
- package/dist/app-chrome.cjs +254 -97
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +24 -12
- package/dist/app-chrome.d.ts +24 -12
- package/dist/app-chrome.js +73 -15
- package/dist/app-chrome.js.map +1 -1
- package/dist/app-icons.cjs +6 -10
- package/dist/app-icons.cjs.map +1 -1
- package/dist/app-icons.d.cts +6 -6
- package/dist/app-icons.d.ts +6 -6
- package/dist/app-icons.js +6 -10
- package/dist/app-icons.js.map +1 -1
- package/dist/chunk-LPSBSAF3.js +26 -0
- package/dist/chunk-LPSBSAF3.js.map +1 -0
- package/dist/{chunk-ZKYREVCK.js → chunk-WFUWFMCA.js} +195 -123
- package/dist/chunk-WFUWFMCA.js.map +1 -0
- package/dist/index.cjs +68 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -9
- package/dist/index.d.ts +30 -9
- package/dist/index.js +59 -45
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +211 -121
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +56 -29
- package/dist/native.d.ts +56 -29
- package/dist/native.js +2 -1
- package/package.json +1 -1
- package/dist/chunk-ZKYREVCK.js.map +0 -1
package/dist/app-chrome.cjs
CHANGED
|
@@ -59,6 +59,21 @@ function resolveBrandGlyph(name) {
|
|
|
59
59
|
return GLYPHS[name.trim().toLowerCase()] ?? null;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
// src/lib/deprecation.ts
|
|
63
|
+
var warned = /* @__PURE__ */ new Set();
|
|
64
|
+
function isDev() {
|
|
65
|
+
try {
|
|
66
|
+
return typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function warnDeprecated(key, message) {
|
|
72
|
+
if (!isDev() || warned.has(key)) return;
|
|
73
|
+
warned.add(key);
|
|
74
|
+
console.warn(`[@the-portland-company/shell] ${message}`);
|
|
75
|
+
}
|
|
76
|
+
|
|
62
77
|
// src/native/orgFilter.ts
|
|
63
78
|
var ORG_FILTER_THRESHOLD = 8;
|
|
64
79
|
function filterOrgs(orgs, query) {
|
|
@@ -215,7 +230,7 @@ function useAnyTopBarPanelOpen() {
|
|
|
215
230
|
}
|
|
216
231
|
function TopBarCountBadge({ count }) {
|
|
217
232
|
if (!(count > 0)) return null;
|
|
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-
|
|
233
|
+
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-[#FFFFFF]", children: count > 99 ? "99+" : count });
|
|
219
234
|
}
|
|
220
235
|
function TopBarTooltip({
|
|
221
236
|
title,
|
|
@@ -285,7 +300,7 @@ function NavThemeControl({
|
|
|
285
300
|
onClick: () => onChange(opt.value),
|
|
286
301
|
className: [
|
|
287
302
|
"flex-1 px-3 py-1.5 text-xs font-semibold transition",
|
|
288
|
-
value === opt.value ? "bg-[color:var(--color-accent)] text-
|
|
303
|
+
value === opt.value ? "bg-[color:var(--color-accent)] text-[#FFFFFF]" : "text-[color:var(--muted)] hover:bg-[color:var(--panel)] hover:text-[color:var(--foreground)]"
|
|
289
304
|
].join(" "),
|
|
290
305
|
children: opt.label
|
|
291
306
|
},
|
|
@@ -629,7 +644,7 @@ function LowFuelHint({ lowFuel, orgId }) {
|
|
|
629
644
|
"div",
|
|
630
645
|
{
|
|
631
646
|
role: "status",
|
|
632
|
-
className: "absolute right-0 top-[calc(100%+10px)] z-50 w-60 rounded-lg border border-[color:var(--chrome-danger)] bg-[color:var(--chrome-danger)] px-3 py-2 text-
|
|
647
|
+
className: "absolute right-0 top-[calc(100%+10px)] z-50 w-60 rounded-lg border border-[color:var(--chrome-danger)] bg-[color:var(--chrome-danger)] px-3 py-2 text-[#FFFFFF] shadow-[var(--shadow-soft)]",
|
|
633
648
|
onClick: (e) => e.stopPropagation(),
|
|
634
649
|
children: [
|
|
635
650
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -657,7 +672,7 @@ function LowFuelHint({ lowFuel, orgId }) {
|
|
|
657
672
|
type: "button",
|
|
658
673
|
"aria-label": "Dismiss low fuel notice",
|
|
659
674
|
onClick: dismiss,
|
|
660
|
-
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-
|
|
675
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-[#FFFFFF]/90 transition hover:bg-[#FFFFFF]/20",
|
|
661
676
|
children: /* @__PURE__ */ jsxRuntime.jsx(XGlyph, {})
|
|
662
677
|
}
|
|
663
678
|
)
|
|
@@ -841,7 +856,7 @@ function NewReplyToast({
|
|
|
841
856
|
activate();
|
|
842
857
|
}
|
|
843
858
|
},
|
|
844
|
-
className: "absolute right-[-6px] top-[calc(100%+12px)] z-50 min-w-[240px] max-w-[320px] cursor-pointer rounded-xl bg-[#161616] px-4 py-3 text-
|
|
859
|
+
className: "absolute right-[-6px] top-[calc(100%+12px)] z-50 min-w-[240px] max-w-[320px] cursor-pointer rounded-xl bg-[#161616] px-4 py-3 text-[#FFFFFF] shadow-[var(--shadow-soft)]",
|
|
845
860
|
style: {
|
|
846
861
|
opacity: visible ? 1 : 0,
|
|
847
862
|
transform: visible ? "translateY(0px)" : "translateY(-4px)",
|
|
@@ -865,7 +880,7 @@ function NewReplyToast({
|
|
|
865
880
|
setVisible(false);
|
|
866
881
|
onClose();
|
|
867
882
|
},
|
|
868
|
-
className: "absolute right-2 top-2 flex h-5 w-5 items-center justify-center rounded-full text-
|
|
883
|
+
className: "absolute right-2 top-2 flex h-5 w-5 items-center justify-center rounded-full text-[#FFFFFF] opacity-60 transition hover:bg-[#FFFFFF]/10 hover:opacity-100",
|
|
869
884
|
children: /* @__PURE__ */ jsxRuntime.jsx(XGlyph, { size: 12 })
|
|
870
885
|
}
|
|
871
886
|
),
|
|
@@ -880,7 +895,7 @@ function NewReplyToast({
|
|
|
880
895
|
setVisible(false);
|
|
881
896
|
onSilence();
|
|
882
897
|
},
|
|
883
|
-
className: "mt-2 inline-flex items-center gap-1 text-[11px] font-semibold text-
|
|
898
|
+
className: "mt-2 inline-flex items-center gap-1 text-[11px] font-semibold text-[#FFFFFF] opacity-60 transition hover:opacity-100",
|
|
884
899
|
children: [
|
|
885
900
|
/* @__PURE__ */ jsxRuntime.jsx(BellOffGlyph, { size: 12 }),
|
|
886
901
|
"Silence notifications"
|
|
@@ -1253,7 +1268,7 @@ function SupportAction({ orgId } = {}) {
|
|
|
1253
1268
|
{
|
|
1254
1269
|
type: "button",
|
|
1255
1270
|
onClick: close,
|
|
1256
|
-
className: "rounded-full bg-[color:var(--color-accent)] px-4 py-2 text-sm font-semibold text-
|
|
1271
|
+
className: "rounded-full bg-[color:var(--color-accent)] px-4 py-2 text-sm font-semibold text-[#FFFFFF] hover:opacity-90",
|
|
1257
1272
|
children: "Done"
|
|
1258
1273
|
}
|
|
1259
1274
|
) })
|
|
@@ -1313,7 +1328,7 @@ function SupportAction({ orgId } = {}) {
|
|
|
1313
1328
|
type: "button",
|
|
1314
1329
|
onClick: submit,
|
|
1315
1330
|
disabled: !message.trim() || state === "sending",
|
|
1316
|
-
className: "rounded-full bg-[color:var(--color-accent)] px-4 py-2 text-sm font-semibold text-
|
|
1331
|
+
className: "rounded-full bg-[color:var(--color-accent)] px-4 py-2 text-sm font-semibold text-[#FFFFFF] transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1317
1332
|
children: state === "sending" ? "Sending\u2026" : "Send request"
|
|
1318
1333
|
}
|
|
1319
1334
|
)
|
|
@@ -1549,7 +1564,7 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
|
|
|
1549
1564
|
"span",
|
|
1550
1565
|
{
|
|
1551
1566
|
className: [
|
|
1552
|
-
"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] font-normal leading-none text-
|
|
1567
|
+
"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] font-normal leading-none text-[#FFFFFF]",
|
|
1553
1568
|
status && status.matched ? status.passed ? "bg-[color:var(--chrome-success,#2f855a)]" : "bg-[color:var(--chrome-danger)]" : "bg-[color:var(--muted)]"
|
|
1554
1569
|
].join(" "),
|
|
1555
1570
|
children: badgeLabel
|
|
@@ -2150,6 +2165,24 @@ function envChipClasses(label) {
|
|
|
2150
2165
|
return "bg-[rgba(107,114,128,0.16)] text-[#6b7280]";
|
|
2151
2166
|
}
|
|
2152
2167
|
var ORG_PILL_DEFAULT = "var(--color-accent)";
|
|
2168
|
+
var RailCollapsibleContext = react.createContext(false);
|
|
2169
|
+
function useRailCollapse() {
|
|
2170
|
+
const collapsible = react.useContext(RailCollapsibleContext);
|
|
2171
|
+
return (cls) => collapsible ? cls : "";
|
|
2172
|
+
}
|
|
2173
|
+
function OrgIconMark({ org, logoSrc }) {
|
|
2174
|
+
const rc = useRailCollapse();
|
|
2175
|
+
const src = resolveOrgLogoUrl(org.iconUrl) ?? logoSrc;
|
|
2176
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2177
|
+
"span",
|
|
2178
|
+
{
|
|
2179
|
+
"aria-hidden": true,
|
|
2180
|
+
"data-rail-org-mark": "",
|
|
2181
|
+
className: `hidden h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-[5px] bg-[#FFFFFF] text-[11px] font-bold text-neutral-800 ${rc("max-md:flex")}`,
|
|
2182
|
+
children: src ? /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt: "", className: "max-h-full max-w-full object-contain" }) : (org.name ?? "Org").slice(0, 2).toUpperCase()
|
|
2183
|
+
}
|
|
2184
|
+
);
|
|
2185
|
+
}
|
|
2153
2186
|
function NavSidebar({
|
|
2154
2187
|
pathname,
|
|
2155
2188
|
brand,
|
|
@@ -2162,6 +2195,8 @@ function NavSidebar({
|
|
|
2162
2195
|
onClose
|
|
2163
2196
|
}) {
|
|
2164
2197
|
const Link = linkComponent ?? DefaultLink;
|
|
2198
|
+
const collapsible = !open;
|
|
2199
|
+
const rc = (cls) => collapsible ? cls : "";
|
|
2165
2200
|
const asideRef = react.useRef(null);
|
|
2166
2201
|
const closeButtonRef = react.useRef(null);
|
|
2167
2202
|
const previouslyFocusedRef = react.useRef(null);
|
|
@@ -2228,12 +2263,12 @@ function NavSidebar({
|
|
|
2228
2263
|
setOpenGroup(activeGroupKey);
|
|
2229
2264
|
}, [activeGroupKey]);
|
|
2230
2265
|
const toggleGroup = (key) => setOpenGroup((prev) => prev === key ? null : key);
|
|
2231
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2266
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RailCollapsibleContext.Provider, { value: collapsible, children: [
|
|
2232
2267
|
open ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2233
2268
|
"div",
|
|
2234
2269
|
{
|
|
2235
2270
|
"aria-hidden": true,
|
|
2236
|
-
className: "fixed inset-0 z-40 bg-black/40
|
|
2271
|
+
className: "fixed inset-0 z-40 bg-black/40 md:hidden",
|
|
2237
2272
|
onClick: onClose
|
|
2238
2273
|
}
|
|
2239
2274
|
) : null,
|
|
@@ -2246,8 +2281,10 @@ function NavSidebar({
|
|
|
2246
2281
|
"aria-modal": open ? "true" : void 0,
|
|
2247
2282
|
"aria-label": open ? "Navigation" : void 0,
|
|
2248
2283
|
className: clsx__default.default(
|
|
2249
|
-
"fixed inset-y-0 left-0
|
|
2250
|
-
|
|
2284
|
+
"fixed inset-y-0 left-0 flex flex-col border-r border-[color:var(--sidebar-line,var(--line))] bg-[color:var(--sidebar-bg,var(--nav-surface))]",
|
|
2285
|
+
// Never hidden: the 64px icon rail below `md`, the full rail from
|
|
2286
|
+
// `md` up, and the full rail as a drawer when expanded below `md`.
|
|
2287
|
+
open ? "z-50 w-[var(--sidebar-width,236px)]" : "z-30 w-[var(--sidebar-collapsed-width,64px)] md:w-[var(--sidebar-width,236px)]"
|
|
2251
2288
|
),
|
|
2252
2289
|
style: { fontFamily: 'var(--font-family, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif)' },
|
|
2253
2290
|
onKeyDown: trapTab,
|
|
@@ -2262,36 +2299,62 @@ function NavSidebar({
|
|
|
2262
2299
|
ref: closeButtonRef,
|
|
2263
2300
|
onClick: onClose,
|
|
2264
2301
|
"aria-label": "Close menu",
|
|
2265
|
-
className: "absolute right-3 top-3 flex h-8 w-8 items-center justify-center rounded-full text-[color:var(--muted)] transition hover:bg-[color:var(--panel-elevated)] hover:text-[color:var(--foreground)]
|
|
2302
|
+
className: "absolute right-3 top-3 flex h-8 w-8 items-center justify-center rounded-full text-[color:var(--muted)] transition hover:bg-[color:var(--panel-elevated)] hover:text-[color:var(--foreground)] md:hidden",
|
|
2266
2303
|
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {})
|
|
2267
2304
|
}
|
|
2268
2305
|
) : null,
|
|
2269
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2270
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2306
|
+
/* @__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 ${rc("max-md:items-center max-md:px-[10px]")}`, children: [
|
|
2307
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2271
2308
|
Link,
|
|
2272
2309
|
{
|
|
2273
2310
|
href: brand.homeHref ?? "/",
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2311
|
+
"aria-label": brand.logoAlt ?? brand.title,
|
|
2312
|
+
className: `flex items-center gap-2.5 ${rc("max-md:justify-center")}`,
|
|
2313
|
+
children: [
|
|
2314
|
+
brand.logoSquareSrc ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2315
|
+
"img",
|
|
2316
|
+
{
|
|
2317
|
+
src: brand.logoSquareSrc,
|
|
2318
|
+
alt: "",
|
|
2319
|
+
draggable: false,
|
|
2320
|
+
"data-rail-logo": "square",
|
|
2321
|
+
className: `hidden h-8 w-8 object-contain ${rc("max-md:block")}`
|
|
2322
|
+
}
|
|
2323
|
+
) : brand.logoPending ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: `hidden h-8 w-8 ${rc("max-md:block")}` }) : null,
|
|
2324
|
+
brand.logoSrc ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2325
|
+
"img",
|
|
2326
|
+
{
|
|
2327
|
+
src: brand.logoSrc,
|
|
2328
|
+
alt: brand.logoAlt ?? brand.title,
|
|
2329
|
+
draggable: false,
|
|
2330
|
+
"data-rail-logo": "horizontal",
|
|
2331
|
+
className: `h-[var(--sidebar-brand-logo-height,24px)] w-auto object-contain ${rc("max-md:hidden")}`
|
|
2332
|
+
}
|
|
2333
|
+
) : brand.logoPending ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2334
|
+
"span",
|
|
2335
|
+
{
|
|
2336
|
+
"aria-hidden": true,
|
|
2337
|
+
className: `block h-[var(--sidebar-brand-logo-height,24px)] ${rc("max-md:hidden")}`
|
|
2338
|
+
}
|
|
2339
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2340
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2341
|
+
"span",
|
|
2342
|
+
{
|
|
2343
|
+
className: `flex h-9 w-9 items-center justify-center rounded-xl bg-[color:var(--color-accent)] text-base font-black text-[#FFFFFF] shadow-sm ${brand.logoSquareSrc ? rc("max-md:hidden") : ""}`,
|
|
2344
|
+
children: brand.badgeLabel
|
|
2345
|
+
}
|
|
2346
|
+
),
|
|
2347
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `flex flex-col leading-tight ${rc("max-md:hidden")}`, children: [
|
|
2348
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-extrabold tracking-[-0.01em] text-[color:var(--color-accent)]", children: brand.title }),
|
|
2349
|
+
brand.subtitle ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-semibold uppercase tracking-[0.16em] text-[color:var(--muted)]", children: brand.subtitle }) : null
|
|
2350
|
+
] })
|
|
2288
2351
|
] })
|
|
2289
|
-
]
|
|
2352
|
+
]
|
|
2290
2353
|
}
|
|
2291
2354
|
),
|
|
2292
|
-
org ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2293
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2294
|
-
org.loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2355
|
+
org ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: rc("max-md:flex max-md:justify-center"), children: [
|
|
2356
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `mb-[7px] flex items-center justify-between ${rc("max-md:hidden")}`, children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: NAV_EYEBROW_CLASS, children: "Organization" }) }),
|
|
2357
|
+
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 ${rc("max-md:w-auto max-md:border-0 max-md:bg-transparent max-md:p-0 max-md:shadow-none")}`, children: [
|
|
2295
2358
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2296
2359
|
"span",
|
|
2297
2360
|
{
|
|
@@ -2303,7 +2366,7 @@ function NavSidebar({
|
|
|
2303
2366
|
"span",
|
|
2304
2367
|
{
|
|
2305
2368
|
"aria-hidden": true,
|
|
2306
|
-
className:
|
|
2369
|
+
className: `h-4 flex-1 animate-pulse rounded bg-[color:var(--panel)] ${rc("max-md:hidden")}`
|
|
2307
2370
|
}
|
|
2308
2371
|
),
|
|
2309
2372
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading organization" })
|
|
@@ -2312,9 +2375,11 @@ function NavSidebar({
|
|
|
2312
2375
|
"summary",
|
|
2313
2376
|
{
|
|
2314
2377
|
style: orgCardStyle,
|
|
2315
|
-
|
|
2378
|
+
title: org.name ?? void 0,
|
|
2379
|
+
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 ${rc("max-md:w-auto max-md:items-center max-md:overflow-visible max-md:border-0 max-md:bg-transparent")}`,
|
|
2316
2380
|
children: [
|
|
2317
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2381
|
+
/* @__PURE__ */ jsxRuntime.jsx(OrgIconMark, { org, logoSrc: orgLogoSrc }),
|
|
2382
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `relative flex h-[var(--sidebar-org-band-height,48px)] w-full items-center justify-center bg-[#FFFFFF] px-3 py-[7px] ${rc("max-md:hidden")}`, children: [
|
|
2318
2383
|
orgLogoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: orgLogoSrc, alt: "", className: "max-h-full max-w-[132px] object-contain" }) : org.canUploadLogo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2319
2384
|
"a",
|
|
2320
2385
|
{
|
|
@@ -2326,7 +2391,7 @@ function NavSidebar({
|
|
|
2326
2391
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-neutral-800", children: org.name ?? "Organization" }),
|
|
2327
2392
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "absolute inset-x-0 bottom-0 h-[3px]", style: { backgroundImage: orgGradient } })
|
|
2328
2393
|
] }),
|
|
2329
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
2394
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `flex w-full min-w-0 items-center justify-between gap-[9px] px-[10px] py-2 ${rc("max-md:hidden")}`, children: [
|
|
2330
2395
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col", children: [
|
|
2331
2396
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2332
2397
|
"span",
|
|
@@ -2343,7 +2408,7 @@ function NavSidebar({
|
|
|
2343
2408
|
]
|
|
2344
2409
|
}
|
|
2345
2410
|
),
|
|
2346
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2411
|
+
/* @__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)] ${rc("max-md:right-auto max-md:w-[236px]")}`, children: [
|
|
2347
2412
|
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(
|
|
2348
2413
|
"input",
|
|
2349
2414
|
{
|
|
@@ -2388,7 +2453,7 @@ function NavSidebar({
|
|
|
2388
2453
|
"span",
|
|
2389
2454
|
{
|
|
2390
2455
|
style: { backgroundColor: o.brandColor || ORG_PILL_DEFAULT },
|
|
2391
|
-
className: "flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full text-[10px] font-bold text-
|
|
2456
|
+
className: "flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full text-[10px] font-bold text-[#FFFFFF]",
|
|
2392
2457
|
children: resolveOrgLogoUrl(o.logoUrl) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2393
2458
|
"img",
|
|
2394
2459
|
{
|
|
@@ -2412,9 +2477,11 @@ function NavSidebar({
|
|
|
2412
2477
|
type: "button",
|
|
2413
2478
|
onClick: org.onClick,
|
|
2414
2479
|
style: orgCardStyle,
|
|
2415
|
-
|
|
2480
|
+
title: org.name ?? void 0,
|
|
2481
|
+
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))] ${rc("max-md:w-auto max-md:items-center max-md:overflow-visible max-md:border-0 max-md:bg-transparent")}`,
|
|
2416
2482
|
children: [
|
|
2417
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2483
|
+
/* @__PURE__ */ jsxRuntime.jsx(OrgIconMark, { org, logoSrc: orgLogoSrc }),
|
|
2484
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `relative flex h-[var(--sidebar-org-band-height,48px)] w-full items-center justify-center bg-[#FFFFFF] px-3 py-[7px] ${rc("max-md:hidden")}`, children: [
|
|
2418
2485
|
orgLogoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: orgLogoSrc, alt: "", className: "max-h-full max-w-[132px] object-contain" }) : org.canUploadLogo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2419
2486
|
"a",
|
|
2420
2487
|
{
|
|
@@ -2426,7 +2493,7 @@ function NavSidebar({
|
|
|
2426
2493
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-neutral-800", children: org.name ?? "Organization" }),
|
|
2427
2494
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "absolute inset-x-0 bottom-0 h-[3px]", style: { backgroundImage: orgGradient } })
|
|
2428
2495
|
] }),
|
|
2429
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
2496
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `flex w-full min-w-0 items-center justify-between gap-[9px] px-[10px] py-2 ${rc("max-md:hidden")}`, children: [
|
|
2430
2497
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col", children: [
|
|
2431
2498
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2432
2499
|
"span",
|
|
@@ -2444,13 +2511,13 @@ function NavSidebar({
|
|
|
2444
2511
|
}
|
|
2445
2512
|
)
|
|
2446
2513
|
] }) : null,
|
|
2447
|
-
mode ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2514
|
+
mode ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: rc("max-md:w-full"), children: [
|
|
2448
2515
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2449
2516
|
"div",
|
|
2450
2517
|
{
|
|
2451
2518
|
role: "radiogroup",
|
|
2452
2519
|
"aria-label": "Mode",
|
|
2453
|
-
className:
|
|
2520
|
+
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] ${rc("max-md:flex-col max-md:items-stretch")}`,
|
|
2454
2521
|
children: (mode.options && mode.options.length > 0 ? mode.options : [{ id: mode.label, label: mode.label, icon: ModeIcon }]).map(
|
|
2455
2522
|
(opt) => {
|
|
2456
2523
|
const selected = opt.label === mode.label;
|
|
@@ -2472,7 +2539,7 @@ function NavSidebar({
|
|
|
2472
2539
|
disabled: !available,
|
|
2473
2540
|
className: [
|
|
2474
2541
|
"flex flex-1 items-center justify-center rounded-[5px] px-[9px] py-[6px] transition",
|
|
2475
|
-
!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-
|
|
2542
|
+
!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-[#FFFFFF]/5 hover:text-[color:var(--sidebar-text,var(--foreground))]"
|
|
2476
2543
|
].join(" "),
|
|
2477
2544
|
children: OptIcon ? /* @__PURE__ */ jsxRuntime.jsx(OptIcon, { size: 15, className: "shrink-0" }) : null
|
|
2478
2545
|
},
|
|
@@ -2482,11 +2549,11 @@ function NavSidebar({
|
|
|
2482
2549
|
)
|
|
2483
2550
|
}
|
|
2484
2551
|
),
|
|
2485
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className:
|
|
2552
|
+
/* @__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)))] ${rc("max-md:hidden")}`, children: modeCaption(mode.label) })
|
|
2486
2553
|
] }) : null
|
|
2487
2554
|
] }),
|
|
2488
2555
|
/* @__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: [
|
|
2489
|
-
nav.groupLabel ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: `${NAV_EYEBROW_CLASS} px-2 pb-1.5 pt-1`, children: nav.groupLabel }) : null,
|
|
2556
|
+
nav.groupLabel ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: `${NAV_EYEBROW_CLASS} px-2 pb-1.5 pt-1 ${rc("max-md:hidden")}`, children: nav.groupLabel }) : null,
|
|
2490
2557
|
nav.items.map((item, idx) => {
|
|
2491
2558
|
if (item.kind === "section") {
|
|
2492
2559
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2552,7 +2619,7 @@ function NavSidebar({
|
|
|
2552
2619
|
);
|
|
2553
2620
|
})
|
|
2554
2621
|
] }) }),
|
|
2555
|
-
footer ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2622
|
+
footer ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `relative flex-shrink-0 border-t border-[color:var(--sidebar-line,var(--line))] px-[14px] py-3 ${rc("max-md:px-[10px]")}`, children: [
|
|
2556
2623
|
footer.user ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2557
2624
|
NavSidebarUserCard,
|
|
2558
2625
|
{
|
|
@@ -2561,7 +2628,7 @@ function NavSidebar({
|
|
|
2561
2628
|
onSignOut: footer.onSignOut
|
|
2562
2629
|
}
|
|
2563
2630
|
) : null,
|
|
2564
|
-
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(
|
|
2631
|
+
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" : ""} ${rc("max-md:hidden")}`, children: footer.links.map((l) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2565
2632
|
"a",
|
|
2566
2633
|
{
|
|
2567
2634
|
href: safeHref(l.href),
|
|
@@ -2574,7 +2641,7 @@ function NavSidebar({
|
|
|
2574
2641
|
"div",
|
|
2575
2642
|
{
|
|
2576
2643
|
"data-shell-meta": true,
|
|
2577
|
-
className:
|
|
2644
|
+
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))] ${rc("max-md:hidden")}`,
|
|
2578
2645
|
children: [
|
|
2579
2646
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
2580
2647
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2737,21 +2804,27 @@ function NavActiveRail() {
|
|
|
2737
2804
|
);
|
|
2738
2805
|
}
|
|
2739
2806
|
function NavRowBadge({ value }) {
|
|
2807
|
+
const rc = useRailCollapse();
|
|
2740
2808
|
if (value === void 0 || value === null || value === "") return null;
|
|
2741
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
2809
|
+
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)))] ${rc("max-md:hidden")}`, children: value });
|
|
2742
2810
|
}
|
|
2743
2811
|
function NavSectionRow({
|
|
2744
2812
|
label,
|
|
2745
2813
|
first,
|
|
2746
2814
|
variant = "top"
|
|
2747
2815
|
}) {
|
|
2816
|
+
const rc = useRailCollapse();
|
|
2817
|
+
const collapsed = variant === "sub" ? "" : first ? rc("max-md:sr-only") : rc(
|
|
2818
|
+
"max-md:mx-2 max-md:my-2 max-md:h-px max-md:overflow-hidden max-md:bg-[color:var(--sidebar-line,var(--line))] max-md:p-0 max-md:text-transparent"
|
|
2819
|
+
);
|
|
2748
2820
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2749
2821
|
"p",
|
|
2750
2822
|
{
|
|
2751
2823
|
className: [
|
|
2752
2824
|
NAV_EYEBROW_CLASS,
|
|
2753
2825
|
variant === "sub" ? "px-3 pb-0.5" : "px-2 pb-1.5 pt-1",
|
|
2754
|
-
first ? "" : variant === "sub" ? "mt-3" : "mt-[14px]"
|
|
2826
|
+
first ? "" : variant === "sub" ? "mt-3" : "mt-[14px]",
|
|
2827
|
+
collapsed
|
|
2755
2828
|
].join(" "),
|
|
2756
2829
|
children: label
|
|
2757
2830
|
}
|
|
@@ -2763,6 +2836,7 @@ function NavRow({
|
|
|
2763
2836
|
Link,
|
|
2764
2837
|
variant = "top"
|
|
2765
2838
|
}) {
|
|
2839
|
+
const rc = useRailCollapse();
|
|
2766
2840
|
const Icon = item.icon;
|
|
2767
2841
|
const isSub = variant === "sub";
|
|
2768
2842
|
const washActive = variant !== "top";
|
|
@@ -2770,7 +2844,7 @@ function NavRow({
|
|
|
2770
2844
|
const wrapperClasses = [
|
|
2771
2845
|
"group relative block overflow-hidden transition",
|
|
2772
2846
|
isSub ? "rounded-md" : "rounded-[5px]",
|
|
2773
|
-
active ? activeClasses : isSub ? "text-[color:var(--sidebar-text,var(--muted))] hover:text-
|
|
2847
|
+
active ? activeClasses : isSub ? "text-[color:var(--sidebar-text,var(--muted))] hover:text-[#FFFFFF]" : NAV_TOP_INACTIVE_CLASS
|
|
2774
2848
|
].join(" ");
|
|
2775
2849
|
const rowPadding = isSub ? "gap-3 px-3 py-1.5 text-[13px] font-semibold" : NAV_TOP_ROW_CLASS(active);
|
|
2776
2850
|
const iconSize = isSub ? 16 : NAV_TOP_ICON_SIZE;
|
|
@@ -2788,9 +2862,12 @@ function NavRow({
|
|
|
2788
2862
|
}
|
|
2789
2863
|
) : null
|
|
2790
2864
|
) : /* @__PURE__ */ jsxRuntime.jsx(NavActiveRail, {}),
|
|
2791
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `relative z-10 flex items-center ${rowPadding}`, children: [
|
|
2792
|
-
Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: iconSize, className: `shrink-0 ${iconClass}` }) :
|
|
2793
|
-
|
|
2865
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `relative z-10 flex items-center ${rowPadding} ${rc("max-md:justify-center max-md:px-0")}`, children: [
|
|
2866
|
+
Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: iconSize, className: `shrink-0 ${iconClass}` }) : (
|
|
2867
|
+
// A row with no glyph still needs something on the icon rail.
|
|
2868
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: `hidden text-[11px] font-semibold uppercase ${rc("max-md:inline")}`, children: item.label.slice(0, 2) })
|
|
2869
|
+
),
|
|
2870
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `min-w-0 flex-1 truncate ${rc("max-md:hidden")}`, children: item.label }),
|
|
2794
2871
|
/* @__PURE__ */ jsxRuntime.jsx(NavRowBadge, { value: item.badge })
|
|
2795
2872
|
] })
|
|
2796
2873
|
] });
|
|
@@ -2799,20 +2876,30 @@ function NavRow({
|
|
|
2799
2876
|
"span",
|
|
2800
2877
|
{
|
|
2801
2878
|
"aria-disabled": "true",
|
|
2802
|
-
title: item.disabledTitle,
|
|
2879
|
+
title: item.disabledTitle ?? item.label,
|
|
2803
2880
|
className: `${wrapperClasses} cursor-not-allowed opacity-50`,
|
|
2804
2881
|
children: inner
|
|
2805
2882
|
}
|
|
2806
2883
|
);
|
|
2807
2884
|
}
|
|
2808
2885
|
if (item.onClick && !item.href) {
|
|
2809
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2886
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2887
|
+
"button",
|
|
2888
|
+
{
|
|
2889
|
+
type: "button",
|
|
2890
|
+
onClick: item.onClick,
|
|
2891
|
+
title: item.label,
|
|
2892
|
+
className: `w-full text-left ${wrapperClasses}`,
|
|
2893
|
+
children: inner
|
|
2894
|
+
}
|
|
2895
|
+
);
|
|
2810
2896
|
}
|
|
2811
2897
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2812
2898
|
Link,
|
|
2813
2899
|
{
|
|
2814
2900
|
href: item.href ?? "#",
|
|
2815
2901
|
"aria-current": active ? "page" : void 0,
|
|
2902
|
+
title: item.label,
|
|
2816
2903
|
className: wrapperClasses,
|
|
2817
2904
|
children: inner
|
|
2818
2905
|
}
|
|
@@ -2827,6 +2914,7 @@ function NavGroup({
|
|
|
2827
2914
|
activeFn,
|
|
2828
2915
|
Link
|
|
2829
2916
|
}) {
|
|
2917
|
+
const rc = useRailCollapse();
|
|
2830
2918
|
const Icon = item.icon;
|
|
2831
2919
|
const headerClasses = [
|
|
2832
2920
|
"group relative block w-full overflow-hidden text-left transition",
|
|
@@ -2843,19 +2931,21 @@ function NavGroup({
|
|
|
2843
2931
|
item.onClick?.();
|
|
2844
2932
|
},
|
|
2845
2933
|
"aria-expanded": open,
|
|
2934
|
+
title: item.label,
|
|
2846
2935
|
className: headerClasses,
|
|
2847
2936
|
children: [
|
|
2848
2937
|
active ? /* @__PURE__ */ jsxRuntime.jsx(NavActiveRail, {}) : null,
|
|
2849
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `relative z-10 flex items-center ${NAV_TOP_ROW_CLASS(active)}`, children: [
|
|
2938
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `relative z-10 flex items-center ${NAV_TOP_ROW_CLASS(active)} ${rc("max-md:justify-center max-md:px-0")}`, children: [
|
|
2850
2939
|
Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: NAV_TOP_ICON_SIZE, className: "shrink-0 text-current" }) : null,
|
|
2851
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
2940
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `min-w-0 flex-1 truncate ${rc("max-md:hidden")}`, children: item.label }),
|
|
2852
2941
|
/* @__PURE__ */ jsxRuntime.jsx(NavRowBadge, { value: item.badge }),
|
|
2853
2942
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2854
2943
|
ChevronDown,
|
|
2855
2944
|
{
|
|
2856
2945
|
className: [
|
|
2857
2946
|
"shrink-0 opacity-80 transition-transform duration-200",
|
|
2858
|
-
open ? "rotate-180" : ""
|
|
2947
|
+
open ? "rotate-180" : "",
|
|
2948
|
+
rc("max-md:hidden")
|
|
2859
2949
|
].join(" ")
|
|
2860
2950
|
}
|
|
2861
2951
|
)
|
|
@@ -2863,7 +2953,7 @@ function NavGroup({
|
|
|
2863
2953
|
]
|
|
2864
2954
|
}
|
|
2865
2955
|
),
|
|
2866
|
-
open ? /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2956
|
+
open ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `overflow-hidden rounded-b-md bg-[color:var(--nav-submenu-bg)] p-1 ${rc("max-md:hidden")}`, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-0.5", children: item.children.map((child, i) => {
|
|
2867
2957
|
if (child.kind === "section") {
|
|
2868
2958
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2869
2959
|
NavSectionRow,
|
|
@@ -3002,7 +3092,7 @@ function NavTopBar({
|
|
|
3002
3092
|
"aria-label": "Open menu",
|
|
3003
3093
|
"aria-expanded": navOpen ?? false,
|
|
3004
3094
|
"aria-controls": "politogy-nav-drawer",
|
|
3005
|
-
className: `${topBarIconButtonClass("default")} mr-1 shrink-0
|
|
3095
|
+
className: `${topBarIconButtonClass("default")} mr-1 shrink-0 md:hidden`,
|
|
3006
3096
|
children: /* @__PURE__ */ jsxRuntime.jsx(HamburgerIcon, {})
|
|
3007
3097
|
}
|
|
3008
3098
|
) : null,
|
|
@@ -3049,7 +3139,7 @@ function NavTopBar({
|
|
|
3049
3139
|
themeToggle,
|
|
3050
3140
|
accountMenu === "topbar" ? /* @__PURE__ */ jsxRuntime.jsxs("details", { "data-nav-details": true, className: "group/acct relative", children: [
|
|
3051
3141
|
/* @__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: [
|
|
3052
|
-
/* @__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-
|
|
3142
|
+
/* @__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-[#FFFFFF]", children: user?.avatarUrl || user?.memojiUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3053
3143
|
"img",
|
|
3054
3144
|
{
|
|
3055
3145
|
src: user.avatarUrl || user.memojiUrl,
|
|
@@ -3100,7 +3190,8 @@ function NavAccountMenuPanel({
|
|
|
3100
3190
|
onSignOut,
|
|
3101
3191
|
placement
|
|
3102
3192
|
}) {
|
|
3103
|
-
const
|
|
3193
|
+
const rc = useRailCollapse();
|
|
3194
|
+
const wrapper = placement === "above" ? rc("max-md:right-auto max-md:w-64") + " 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)]";
|
|
3104
3195
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapper, children: [
|
|
3105
3196
|
placement === "below" ? /* @__PURE__ */ jsxRuntime.jsx(TopBarPanelArrow, {}) : null,
|
|
3106
3197
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain", children: [
|
|
@@ -3148,7 +3239,7 @@ function NavAccountMenuPanel({
|
|
|
3148
3239
|
},
|
|
3149
3240
|
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)]",
|
|
3150
3241
|
children: [
|
|
3151
|
-
/* @__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-
|
|
3242
|
+
/* @__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-[#FFFFFF]", 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() }),
|
|
3152
3243
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col leading-tight", children: [
|
|
3153
3244
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3154
3245
|
"span",
|
|
@@ -3252,19 +3343,20 @@ function NavSidebarUserCard({
|
|
|
3252
3343
|
const displayName = hasRealName ? rawName : user.email ?? "Signed in";
|
|
3253
3344
|
const initials = (hasRealName ? rawName : user.email ?? "P").slice(0, 2).toUpperCase();
|
|
3254
3345
|
const secondary = hasRealName ? user.email || [user.tier, user.role].filter(Boolean).join(" \xB7 ") || "member" : [user.tier, user.role].filter(Boolean).join(" \xB7 ") || "member";
|
|
3346
|
+
const rc = useRailCollapse();
|
|
3255
3347
|
return /* @__PURE__ */ jsxRuntime.jsxs("details", { "data-nav-details": true, className: "group/acct relative", children: [
|
|
3256
3348
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3257
3349
|
"summary",
|
|
3258
3350
|
{
|
|
3259
3351
|
"aria-label": "My Account",
|
|
3260
|
-
className:
|
|
3352
|
+
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 ${rc("max-md:justify-center max-md:px-0")}`,
|
|
3261
3353
|
children: [
|
|
3262
|
-
/* @__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-
|
|
3263
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
3354
|
+
/* @__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-[#FFFFFF]", children: user.avatarUrl || user.memojiUrl ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: user.avatarUrl || user.memojiUrl, alt: "", className: "h-full w-full object-cover" }) : initials }),
|
|
3355
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `flex min-w-0 flex-1 flex-col ${rc("max-md:hidden")}`, children: [
|
|
3264
3356
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-[12px] font-semibold leading-[1.2] text-[color:var(--sidebar-text,var(--foreground))]", children: displayName }),
|
|
3265
3357
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-[11px] leading-[1.3] text-[color:var(--sidebar-caption,var(--sidebar-text-muted,var(--muted)))]", children: secondary })
|
|
3266
3358
|
] }),
|
|
3267
|
-
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 14, className:
|
|
3359
|
+
/* @__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 ${rc("max-md:hidden")}` })
|
|
3268
3360
|
]
|
|
3269
3361
|
}
|
|
3270
3362
|
),
|
|
@@ -3309,7 +3401,7 @@ function NamePromptBubble({ profileHref, placement = "below" }) {
|
|
|
3309
3401
|
"a",
|
|
3310
3402
|
{
|
|
3311
3403
|
href: safeHref(profileHref),
|
|
3312
|
-
className: "rounded-full bg-[color:var(--color-accent)] px-3 py-1 text-xs font-semibold text-
|
|
3404
|
+
className: "rounded-full bg-[color:var(--color-accent)] px-3 py-1 text-xs font-semibold text-[#FFFFFF] hover:opacity-90",
|
|
3313
3405
|
children: "Set name"
|
|
3314
3406
|
}
|
|
3315
3407
|
) : null,
|
|
@@ -3393,7 +3485,7 @@ function NavTopBarActionButton({ action }) {
|
|
|
3393
3485
|
const Glyph = BrandGlyph ?? Icon;
|
|
3394
3486
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3395
3487
|
/* @__PURE__ */ jsxRuntime.jsx(Glyph, { size: TOPBAR_GLYPH_SIZE, className: "text-current" }),
|
|
3396
|
-
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-
|
|
3488
|
+
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-[#FFFFFF]", children: action.badge }) : null,
|
|
3397
3489
|
/* @__PURE__ */ jsxRuntime.jsx(TopBarTooltip, { title: action.label, description: action.description })
|
|
3398
3490
|
] });
|
|
3399
3491
|
const isExternal = action.href ? /^https?:\/\//.test(action.href) : false;
|
|
@@ -3525,6 +3617,12 @@ function NavAppShell({
|
|
|
3525
3617
|
children
|
|
3526
3618
|
}) {
|
|
3527
3619
|
useCloseNavDetailsOnOutsideClick();
|
|
3620
|
+
if (contentWrapper === "bare") {
|
|
3621
|
+
warnDeprecated(
|
|
3622
|
+
"contentWrapper",
|
|
3623
|
+
"`contentWrapper: 'bare'` is deprecated: the frame's <main> is fluid and apps must not emit their own page container. Remove the app's PageContainer and drop the prop."
|
|
3624
|
+
);
|
|
3625
|
+
}
|
|
3528
3626
|
const [navOpen, setNavOpen] = react.useState(false);
|
|
3529
3627
|
react.useEffect(() => {
|
|
3530
3628
|
setNavOpen(false);
|
|
@@ -3550,7 +3648,7 @@ function NavAppShell({
|
|
|
3550
3648
|
className: "min-h-screen bg-[color:var(--background)] text-[color:var(--foreground)]",
|
|
3551
3649
|
children: [
|
|
3552
3650
|
/* @__PURE__ */ jsxRuntime.jsx(NavSidebar, { ...sidebar, footer: sidebarFooter, open: navOpen, onClose: () => setNavOpen(false) }),
|
|
3553
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
3651
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pl-[var(--sidebar-collapsed-width,64px)] md:pl-[var(--sidebar-width,236px)]", children: [
|
|
3554
3652
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3555
3653
|
NavTopBar,
|
|
3556
3654
|
{
|
|
@@ -3561,19 +3659,21 @@ function NavAppShell({
|
|
|
3561
3659
|
}
|
|
3562
3660
|
),
|
|
3563
3661
|
betaBanner ? /* @__PURE__ */ jsxRuntime.jsx(NavBetaBanner, { ...betaBanner }) : null,
|
|
3564
|
-
topBar.title ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "px-
|
|
3662
|
+
topBar.title ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "px-4 pt-7 text-xl font-semibold text-[color:var(--foreground)] md:px-6", children: topBar.title }) : null,
|
|
3565
3663
|
contentWrapper === "bare" ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-shell-content": "", className: topBar.title ? "mt-[22px]" : void 0, children }) : (
|
|
3566
|
-
//
|
|
3567
|
-
//
|
|
3568
|
-
// gutter
|
|
3569
|
-
//
|
|
3570
|
-
//
|
|
3664
|
+
// Brand guidelines "Content width is fluid" + "Content body
|
|
3665
|
+
// padding": `<main>` fills the space beside the rail with ONE
|
|
3666
|
+
// gutter — 24px, or 16px below `md`, horizontally and vertically —
|
|
3667
|
+
// and has no max-width and no centered container. Form and settings
|
|
3668
|
+
// pages constrain themselves with <FormColumn> (960px, left-aligned).
|
|
3669
|
+
// The shell owns the page background and the gutter; an app's own
|
|
3670
|
+
// cards are its own furniture and stay app-owned.
|
|
3571
3671
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3572
3672
|
"main",
|
|
3573
3673
|
{
|
|
3574
3674
|
"data-shell-content": "",
|
|
3575
|
-
className: `min-h-[calc(100vh-63px)] bg-[color:var(--chrome-page-bg,#F4F5F7)] px-6 ${topBar.title ? "
|
|
3576
|
-
children
|
|
3675
|
+
className: `min-h-[calc(100vh-63px)] bg-[color:var(--chrome-page-bg,#F4F5F7)] px-4 pb-4 md:px-6 md:pb-6 ${topBar.title ? "pt-[22px]" : "pt-4 md:pt-6"}`,
|
|
3676
|
+
children
|
|
3577
3677
|
}
|
|
3578
3678
|
)
|
|
3579
3679
|
)
|
|
@@ -4228,13 +4328,54 @@ function LoadingScreen({
|
|
|
4228
4328
|
}
|
|
4229
4329
|
);
|
|
4230
4330
|
}
|
|
4331
|
+
function parseCssUrl(value) {
|
|
4332
|
+
if (!value) return null;
|
|
4333
|
+
const m = /^url\(\s*(['"]?)(.*?)\1\s*\)$/i.exec(value.trim());
|
|
4334
|
+
const url = m?.[2]?.trim();
|
|
4335
|
+
return url && /^https:\/\//i.test(url) ? url : null;
|
|
4336
|
+
}
|
|
4337
|
+
function readBrandAsset(kind) {
|
|
4338
|
+
if (typeof document === "undefined") return null;
|
|
4339
|
+
try {
|
|
4340
|
+
return parseCssUrl(
|
|
4341
|
+
window.getComputedStyle(document.documentElement).getPropertyValue(`--asset-${kind}`)
|
|
4342
|
+
);
|
|
4343
|
+
} catch {
|
|
4344
|
+
return null;
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
var EMPTY = { logoHorizontal: null, logoSquare: null };
|
|
4348
|
+
var RETRY_MS = [0, 250, 1e3, 3e3];
|
|
4349
|
+
function useBrandAssets() {
|
|
4350
|
+
const [assets, setAssets] = react.useState(EMPTY);
|
|
4351
|
+
react.useEffect(() => {
|
|
4352
|
+
let done = false;
|
|
4353
|
+
const read = () => {
|
|
4354
|
+
if (done) return;
|
|
4355
|
+
const next = {
|
|
4356
|
+
logoHorizontal: readBrandAsset("logo-horizontal"),
|
|
4357
|
+
logoSquare: readBrandAsset("logo-square")
|
|
4358
|
+
};
|
|
4359
|
+
setAssets(
|
|
4360
|
+
(prev) => prev.logoHorizontal === next.logoHorizontal && prev.logoSquare === next.logoSquare ? prev : next
|
|
4361
|
+
);
|
|
4362
|
+
};
|
|
4363
|
+
const links = Array.from(
|
|
4364
|
+
document.querySelectorAll('link[rel="stylesheet"][href*="api/tokens"]')
|
|
4365
|
+
);
|
|
4366
|
+
links.forEach((l) => l.addEventListener("load", read));
|
|
4367
|
+
const timers = RETRY_MS.map((ms) => window.setTimeout(read, ms));
|
|
4368
|
+
read();
|
|
4369
|
+
return () => {
|
|
4370
|
+
done = true;
|
|
4371
|
+
links.forEach((l) => l.removeEventListener("load", read));
|
|
4372
|
+
timers.forEach((t) => window.clearTimeout(t));
|
|
4373
|
+
};
|
|
4374
|
+
}, []);
|
|
4375
|
+
return assets;
|
|
4376
|
+
}
|
|
4231
4377
|
var CORE_APP = "vrm";
|
|
4232
4378
|
var DEFAULT_SIGN_OUT_URL = "/auth/signout";
|
|
4233
|
-
var DEFAULT_BRAND_LOGO = "/brand/logos/relationship-mode-logo.png";
|
|
4234
|
-
var MODE_BRAND_LOGOS = {
|
|
4235
|
-
petition: "/brand/logos/petition-mode-logo.svg"
|
|
4236
|
-
};
|
|
4237
|
-
var modeBrandLogo = (mode) => mode && MODE_BRAND_LOGOS[mode] || DEFAULT_BRAND_LOGO;
|
|
4238
4379
|
var POLITOGY_APPS = {
|
|
4239
4380
|
vrm: { title: "Politogy VRM", origin: "https://app.politogyvrm.com", storagePrefix: "vrm" },
|
|
4240
4381
|
contacts: {
|
|
@@ -4252,13 +4393,12 @@ var POLITOGY_APPS = {
|
|
|
4252
4393
|
origin: "https://petition-mode.politogyvrm.com",
|
|
4253
4394
|
storagePrefix: "petitions",
|
|
4254
4395
|
mode: "petition",
|
|
4255
|
-
//
|
|
4256
|
-
//
|
|
4257
|
-
//
|
|
4258
|
-
//
|
|
4259
|
-
//
|
|
4260
|
-
|
|
4261
|
-
grants: ["contentWrapper", "breadcrumbs", "title"],
|
|
4396
|
+
// Its adjudication case is addressed per sheet and per line — a trail
|
|
4397
|
+
// derived from the nav tree reads "Dashboard › Adjudication" on every one
|
|
4398
|
+
// of those URLs and cannot name the record you are actually on. 'title'
|
|
4399
|
+
// for the same reason: its pages have real names ("Batches"), where the
|
|
4400
|
+
// registry can only say "Petitions".
|
|
4401
|
+
grants: ["breadcrumbs", "title"],
|
|
4262
4402
|
navShape: "flat",
|
|
4263
4403
|
beta: false
|
|
4264
4404
|
},
|
|
@@ -4350,6 +4490,19 @@ function FrameBody({
|
|
|
4350
4490
|
}) {
|
|
4351
4491
|
const meta = POLITOGY_APPS[app];
|
|
4352
4492
|
const chrome = useChromeState();
|
|
4493
|
+
const brandAssets = useBrandAssets();
|
|
4494
|
+
if (data?.frame?.contentWrapper !== void 0) {
|
|
4495
|
+
warnDeprecated(
|
|
4496
|
+
"frame.contentWrapper",
|
|
4497
|
+
"`data.frame.contentWrapper` is retired and ignored: the frame's <main> is fluid. Remove the app's own page container and drop the prop."
|
|
4498
|
+
);
|
|
4499
|
+
}
|
|
4500
|
+
if (data?.core?.brandLogoSrc !== void 0) {
|
|
4501
|
+
warnDeprecated(
|
|
4502
|
+
"core.brandLogoSrc",
|
|
4503
|
+
"`data.core.brandLogoSrc` is ignored: the rail logo is read at runtime from Brand `assets.logoHorizontal`."
|
|
4504
|
+
);
|
|
4505
|
+
}
|
|
4353
4506
|
const bootAppMode = meta.mode;
|
|
4354
4507
|
const bootOrgId = chrome?.orgId ?? null;
|
|
4355
4508
|
const [bootVisible, setBootVisible] = react.useState(true);
|
|
@@ -4488,7 +4641,11 @@ function FrameBody({
|
|
|
4488
4641
|
sidebar: {
|
|
4489
4642
|
pathname,
|
|
4490
4643
|
brand: {
|
|
4491
|
-
logoSrc:
|
|
4644
|
+
logoSrc: brandAssets.logoHorizontal ?? void 0,
|
|
4645
|
+
logoSquareSrc: brandAssets.logoSquare ?? void 0,
|
|
4646
|
+
// Reserve the logo's box while the token sheet loads; never draw a
|
|
4647
|
+
// stand-in.
|
|
4648
|
+
logoPending: true,
|
|
4492
4649
|
logoAlt: "Politogy",
|
|
4493
4650
|
badgeLabel: "P",
|
|
4494
4651
|
title: "Politogy"
|
|
@@ -4520,7 +4677,7 @@ function FrameBody({
|
|
|
4520
4677
|
},
|
|
4521
4678
|
betaBanner: meta.beta === true ? {} : void 0,
|
|
4522
4679
|
modeId: appMode,
|
|
4523
|
-
contentWrapper: core?.contentWrapper
|
|
4680
|
+
contentWrapper: core?.contentWrapper,
|
|
4524
4681
|
topBar: {
|
|
4525
4682
|
// Core's pages publish their own identity; every other app is one
|
|
4526
4683
|
// product surface and takes its registry title.
|