@orangecheck/design 0.14.1 → 0.16.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/dist/chrome.d.mts +1 -0
- package/dist/chrome.d.ts +1 -0
- package/dist/chrome.js +166 -51
- package/dist/chrome.js.map +1 -1
- package/dist/chrome.mjs +167 -52
- package/dist/chrome.mjs.map +1 -1
- package/dist/components.js +166 -51
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +167 -52
- package/dist/components.mjs.map +1 -1
- package/dist/index.js +166 -51
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +167 -52
- package/dist/index.mjs.map +1 -1
- package/dist/styles/theme.css +31 -0
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -1266,7 +1266,11 @@ function OcAccountMenu(props) {
|
|
|
1266
1266
|
// context (oc-www) can opt in incrementally.
|
|
1267
1267
|
roster: session.roster,
|
|
1268
1268
|
switchAccount: session.switchAccount,
|
|
1269
|
-
addAccountUrl: session.addAccountUrl
|
|
1269
|
+
addAccountUrl: session.addAccountUrl,
|
|
1270
|
+
// Structural read keeps the auth-client peer floor at
|
|
1271
|
+
// ^2.17.0 — `tabPinned` ships in 2.18.0 and is simply
|
|
1272
|
+
// undefined (no hint) on older providers.
|
|
1273
|
+
tabPinned: session.tabPinned
|
|
1270
1274
|
}
|
|
1271
1275
|
}
|
|
1272
1276
|
);
|
|
@@ -1295,7 +1299,8 @@ function OcAccountMenuView({
|
|
|
1295
1299
|
setDisplayIdentity,
|
|
1296
1300
|
roster,
|
|
1297
1301
|
switchAccount,
|
|
1298
|
-
addAccountUrl
|
|
1302
|
+
addAccountUrl,
|
|
1303
|
+
tabPinned
|
|
1299
1304
|
} = session;
|
|
1300
1305
|
const [hydrated, setHydrated] = React.useState(false);
|
|
1301
1306
|
const [open, setOpen] = React.useState(false);
|
|
@@ -1365,11 +1370,11 @@ function OcAccountMenuView({
|
|
|
1365
1370
|
"aria-haspopup": "menu",
|
|
1366
1371
|
"aria-expanded": open,
|
|
1367
1372
|
"aria-label": `Signed in as ${account.didOc}. Open account menu.`,
|
|
1368
|
-
className: triggerClassName ?? "border-primary/40 bg-card hover:bg-accent inline-flex h-8 items-center gap-1.5 rounded-md border px-
|
|
1373
|
+
className: triggerClassName ?? "border-primary/40 bg-card hover:bg-accent inline-flex h-8 items-center gap-1.5 rounded-md border px-2 font-mono text-[11px] tracking-wide transition-colors sm:px-3",
|
|
1369
1374
|
"data-oc-account-menu-trigger": "",
|
|
1370
1375
|
children: [
|
|
1371
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-primary inline-block size-1.5 rounded-full", "aria-hidden": true }),
|
|
1372
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: label }),
|
|
1376
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-primary inline-block size-1.5 shrink-0 rounded-full", "aria-hidden": true }),
|
|
1377
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground hidden max-w-[16ch] truncate sm:inline", children: label }),
|
|
1373
1378
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1374
1379
|
"svg",
|
|
1375
1380
|
{
|
|
@@ -1404,7 +1409,19 @@ function OcAccountMenuView({
|
|
|
1404
1409
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-border border-b p-3", children: [
|
|
1405
1410
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-primary mb-1 font-mono text-[10px] tracking-widest uppercase", children: [
|
|
1406
1411
|
"\xA7 signed in \xB7 ",
|
|
1407
|
-
hostname
|
|
1412
|
+
hostname,
|
|
1413
|
+
tabPinned ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1414
|
+
"span",
|
|
1415
|
+
{
|
|
1416
|
+
className: "text-muted-foreground/70 normal-case",
|
|
1417
|
+
"data-oc-account-menu-tab-pin": "",
|
|
1418
|
+
title: "This tab keeps this account even if you switch accounts in another tab",
|
|
1419
|
+
children: [
|
|
1420
|
+
" ",
|
|
1421
|
+
"\xB7 this tab"
|
|
1422
|
+
]
|
|
1423
|
+
}
|
|
1424
|
+
) : null
|
|
1408
1425
|
] }),
|
|
1409
1426
|
/* @__PURE__ */ jsxRuntime.jsx(CopyableDid, { did: account.didOc }),
|
|
1410
1427
|
displayName ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground/80 mt-1 font-mono text-[10px] tracking-wide", children: displayName }) : null
|
|
@@ -1759,54 +1776,146 @@ function isActive(pathname, link) {
|
|
|
1759
1776
|
if (link.href === "/") return pathname === "/";
|
|
1760
1777
|
return pathname === link.href || pathname.startsWith(link.href + "/");
|
|
1761
1778
|
}
|
|
1779
|
+
function ExternalGlyph() {
|
|
1780
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "text-muted-foreground/60 ml-1 text-[9px]", children: "\u2197" });
|
|
1781
|
+
}
|
|
1762
1782
|
function OcPrimaryNav({
|
|
1763
1783
|
activePath,
|
|
1764
1784
|
links,
|
|
1765
1785
|
className
|
|
1766
1786
|
}) {
|
|
1767
|
-
|
|
1768
|
-
|
|
1787
|
+
const [open, setOpen] = React.useState(false);
|
|
1788
|
+
const ref = React.useRef(null);
|
|
1789
|
+
const menuId = React.useId();
|
|
1790
|
+
React.useEffect(() => {
|
|
1791
|
+
setOpen(false);
|
|
1792
|
+
}, [activePath]);
|
|
1793
|
+
React.useEffect(() => {
|
|
1794
|
+
if (!open) return;
|
|
1795
|
+
const onClick = (e) => {
|
|
1796
|
+
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
1797
|
+
};
|
|
1798
|
+
const onKey = (e) => {
|
|
1799
|
+
if (e.key === "Escape") setOpen(false);
|
|
1800
|
+
};
|
|
1801
|
+
document.addEventListener("mousedown", onClick);
|
|
1802
|
+
document.addEventListener("keydown", onKey);
|
|
1803
|
+
return () => {
|
|
1804
|
+
document.removeEventListener("mousedown", onClick);
|
|
1805
|
+
document.removeEventListener("keydown", onKey);
|
|
1806
|
+
};
|
|
1807
|
+
}, [open]);
|
|
1808
|
+
const inlineClass = (active) => "font-display shrink-0 px-2 py-1 sm:px-3 text-[11px] sm:text-[12px] font-semibold tracking-wider uppercase transition-colors " + (active ? "text-primary" : "text-muted-foreground hover:text-foreground");
|
|
1809
|
+
const rowClass = (active) => "font-display flex items-center gap-2 px-3 py-2 text-[12px] font-semibold tracking-wider uppercase transition-colors " + (active ? "text-primary" : "text-muted-foreground hover:text-foreground hover:bg-accent");
|
|
1810
|
+
function renderInline(link) {
|
|
1811
|
+
const active = isActive(activePath, link);
|
|
1812
|
+
const inner = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1813
|
+
link.label,
|
|
1814
|
+
link.external ? /* @__PURE__ */ jsxRuntime.jsx(ExternalGlyph, {}) : null
|
|
1815
|
+
] });
|
|
1816
|
+
return link.external ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1817
|
+
"a",
|
|
1818
|
+
{
|
|
1819
|
+
href: link.href,
|
|
1820
|
+
target: "_blank",
|
|
1821
|
+
rel: "noreferrer",
|
|
1822
|
+
className: inlineClass(false),
|
|
1823
|
+
"data-oc-primary-nav-item": "",
|
|
1824
|
+
children: inner
|
|
1825
|
+
},
|
|
1826
|
+
link.href
|
|
1827
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1828
|
+
Link6__default.default,
|
|
1829
|
+
{
|
|
1830
|
+
href: link.href,
|
|
1831
|
+
"aria-current": active ? "page" : void 0,
|
|
1832
|
+
className: inlineClass(active),
|
|
1833
|
+
"data-oc-primary-nav-item": active ? "active" : "sibling",
|
|
1834
|
+
children: inner
|
|
1835
|
+
},
|
|
1836
|
+
link.href
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1839
|
+
function renderRow(link) {
|
|
1840
|
+
const active = isActive(activePath, link);
|
|
1841
|
+
const inner = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1842
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
|
|
1843
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children: link.label }),
|
|
1844
|
+
link.external ? /* @__PURE__ */ jsxRuntime.jsx(ExternalGlyph, {}) : null
|
|
1845
|
+
] });
|
|
1846
|
+
return link.external ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1847
|
+
"a",
|
|
1848
|
+
{
|
|
1849
|
+
href: link.href,
|
|
1850
|
+
target: "_blank",
|
|
1851
|
+
rel: "noreferrer",
|
|
1852
|
+
role: "menuitem",
|
|
1853
|
+
onClick: () => setOpen(false),
|
|
1854
|
+
className: rowClass(false),
|
|
1855
|
+
"data-oc-primary-nav-item": "",
|
|
1856
|
+
children: inner
|
|
1857
|
+
},
|
|
1858
|
+
link.href
|
|
1859
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1860
|
+
Link6__default.default,
|
|
1861
|
+
{
|
|
1862
|
+
href: link.href,
|
|
1863
|
+
role: "menuitem",
|
|
1864
|
+
"aria-current": active ? "page" : void 0,
|
|
1865
|
+
onClick: () => setOpen(false),
|
|
1866
|
+
className: rowClass(active),
|
|
1867
|
+
"data-oc-primary-nav-item": active ? "active" : "sibling",
|
|
1868
|
+
children: inner
|
|
1869
|
+
},
|
|
1870
|
+
link.href
|
|
1871
|
+
);
|
|
1872
|
+
}
|
|
1873
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1874
|
+
"div",
|
|
1769
1875
|
{
|
|
1770
|
-
|
|
1771
|
-
className: "flex
|
|
1876
|
+
ref,
|
|
1877
|
+
className: "relative flex items-center justify-center " + (className ?? ""),
|
|
1772
1878
|
"data-oc-primary-nav": "",
|
|
1773
|
-
children:
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1879
|
+
children: [
|
|
1880
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1881
|
+
"nav",
|
|
1882
|
+
{
|
|
1883
|
+
"aria-label": "primary",
|
|
1884
|
+
className: "hidden items-center gap-0.5 sm:gap-1 md:flex",
|
|
1885
|
+
children: links.map(renderInline)
|
|
1886
|
+
}
|
|
1887
|
+
),
|
|
1888
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:hidden", children: [
|
|
1889
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1890
|
+
"button",
|
|
1780
1891
|
{
|
|
1781
|
-
"
|
|
1782
|
-
|
|
1783
|
-
|
|
1892
|
+
type: "button",
|
|
1893
|
+
onClick: () => setOpen((v) => !v),
|
|
1894
|
+
"aria-haspopup": "menu",
|
|
1895
|
+
"aria-expanded": open,
|
|
1896
|
+
"aria-controls": menuId,
|
|
1897
|
+
"aria-label": "site navigation",
|
|
1898
|
+
className: "border-input bg-background hover:bg-accent text-muted-foreground inline-flex size-8 items-center justify-center rounded-md border transition-colors",
|
|
1899
|
+
"data-oc-primary-nav-toggle": "",
|
|
1900
|
+
children: open ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4", "aria-hidden": true }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Menu, { className: "size-4", "aria-hidden": true })
|
|
1784
1901
|
}
|
|
1785
|
-
)
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
"aria-current": active ? "page" : void 0,
|
|
1803
|
-
className: className2,
|
|
1804
|
-
"data-oc-primary-nav-item": active ? "active" : "sibling",
|
|
1805
|
-
children: content
|
|
1806
|
-
},
|
|
1807
|
-
link.href
|
|
1808
|
-
);
|
|
1809
|
-
})
|
|
1902
|
+
),
|
|
1903
|
+
open && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1904
|
+
"div",
|
|
1905
|
+
{
|
|
1906
|
+
id: menuId,
|
|
1907
|
+
role: "menu",
|
|
1908
|
+
"aria-label": "primary",
|
|
1909
|
+
className: "border-border bg-popover text-popover-foreground absolute top-[calc(100%+8px)] left-1/2 z-50 w-[min(15rem,calc(100vw-1rem))] -translate-x-1/2 border p-1 shadow-xl",
|
|
1910
|
+
"data-oc-primary-nav-popover": "",
|
|
1911
|
+
children: [
|
|
1912
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 navigate" }),
|
|
1913
|
+
links.map(renderRow)
|
|
1914
|
+
]
|
|
1915
|
+
}
|
|
1916
|
+
)
|
|
1917
|
+
] })
|
|
1918
|
+
]
|
|
1810
1919
|
}
|
|
1811
1920
|
);
|
|
1812
1921
|
}
|
|
@@ -2103,13 +2212,19 @@ function LayoutSubHeader({
|
|
|
2103
2212
|
noHeartbeat = false,
|
|
2104
2213
|
className
|
|
2105
2214
|
}) {
|
|
2106
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("border-b", className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "container flex
|
|
2107
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-
|
|
2108
|
-
!noHeartbeat && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2109
|
-
|
|
2110
|
-
|
|
2215
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("oc-substrip border-b", className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "container flex items-center justify-between gap-x-6 py-2 font-mono text-[11px]", children: [
|
|
2216
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
2217
|
+
!noHeartbeat && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2218
|
+
"span",
|
|
2219
|
+
{
|
|
2220
|
+
className: "bg-primary inline-block size-1.5 shrink-0 animate-pulse rounded-full ring-2 ring-[color-mix(in_oklch,var(--primary),transparent_78%)]",
|
|
2221
|
+
"aria-hidden": true
|
|
2222
|
+
}
|
|
2223
|
+
),
|
|
2224
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground hidden tracking-widest whitespace-nowrap uppercase sm:inline", children: status }),
|
|
2225
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground truncate", children: product })
|
|
2111
2226
|
] }),
|
|
2112
|
-
tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground
|
|
2227
|
+
tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground/55 hidden shrink-0 items-center gap-x-3 tracking-wider whitespace-nowrap uppercase sm:flex", children: tags.map((tag, i) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: tag.hideBelow ? HIDE[tag.hideBelow] : void 0, children: tag.label }, i)) })
|
|
2113
2228
|
] }) });
|
|
2114
2229
|
}
|
|
2115
2230
|
function OcAppBar({
|