@orangecheck/app-design 1.0.0 → 1.1.1
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/README.md +21 -5
- package/dist/chrome.d.mts +31 -42
- package/dist/chrome.d.ts +31 -42
- package/dist/chrome.js +502 -24
- package/dist/chrome.js.map +1 -1
- package/dist/chrome.mjs +497 -26
- package/dist/chrome.mjs.map +1 -1
- package/dist/code.d.mts +52 -0
- package/dist/code.d.ts +52 -0
- package/dist/code.js +534 -0
- package/dist/code.js.map +1 -0
- package/dist/code.mjs +522 -0
- package/dist/code.mjs.map +1 -0
- package/dist/components.d.mts +61 -117
- package/dist/components.d.ts +61 -117
- package/dist/components.js +2178 -106
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +2150 -110
- package/dist/components.mjs.map +1 -1
- package/dist/docs-DhnstueM.d.ts +219 -0
- package/dist/docs-DiR6s43s.d.mts +219 -0
- package/dist/family.js +2 -1
- package/dist/family.js.map +1 -1
- package/dist/family.mjs +2 -1
- package/dist/family.mjs.map +1 -1
- package/dist/format.d.mts +12 -0
- package/dist/format.d.ts +12 -0
- package/dist/format.js +65 -0
- package/dist/format.js.map +1 -0
- package/dist/format.mjs +58 -0
- package/dist/format.mjs.map +1 -0
- package/dist/hero-Dn37il-9.d.mts +31 -0
- package/dist/hero-Dn37il-9.d.ts +31 -0
- package/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +2675 -131
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2621 -134
- package/dist/index.mjs.map +1 -1
- package/dist/mdx.d.mts +58 -0
- package/dist/mdx.d.ts +58 -0
- package/dist/mdx.js +1719 -0
- package/dist/mdx.js.map +1 -0
- package/dist/mdx.mjs +1692 -0
- package/dist/mdx.mjs.map +1 -0
- package/dist/primitives.d.mts +22 -5
- package/dist/primitives.d.ts +22 -5
- package/dist/primitives.js +51 -5
- package/dist/primitives.js.map +1 -1
- package/dist/primitives.mjs +51 -7
- package/dist/primitives.mjs.map +1 -1
- package/dist/session.d.mts +18 -0
- package/dist/session.d.ts +18 -0
- package/dist/session.js +432 -0
- package/dist/session.js.map +1 -0
- package/dist/session.mjs +401 -0
- package/dist/session.mjs.map +1 -0
- package/dist/styles/code.css +97 -0
- package/dist/styles/theme.css +2 -0
- package/dist/styles/tokens.css +40 -0
- package/dist/styles.css +1 -0
- package/dist/tool-shell-B1C7ahKE.d.ts +81 -0
- package/dist/tool-shell-BDx_N5ai.d.mts +81 -0
- package/dist/tools-BggNN5DV.d.ts +131 -0
- package/dist/tools-DFIxIj5p.d.mts +131 -0
- package/package.json +31 -2
package/dist/chrome.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var lucideReact = require('lucide-react');
|
|
4
|
-
var
|
|
4
|
+
var Link5 = require('next/link');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -11,6 +11,9 @@ var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
|
11
11
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
12
12
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
13
13
|
var classVarianceAuthority = require('class-variance-authority');
|
|
14
|
+
var SeparatorPrimitive = require('@radix-ui/react-separator');
|
|
15
|
+
require('sonner');
|
|
16
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
14
17
|
var nextThemes = require('next-themes');
|
|
15
18
|
|
|
16
19
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -33,11 +36,12 @@ function _interopNamespace(e) {
|
|
|
33
36
|
return Object.freeze(n);
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
var
|
|
39
|
+
var Link5__default = /*#__PURE__*/_interopDefault(Link5);
|
|
37
40
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
38
41
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
39
42
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
40
43
|
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
44
|
+
var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
|
|
41
45
|
|
|
42
46
|
var merge = tailwindMerge.extendTailwindMerge({
|
|
43
47
|
extend: {
|
|
@@ -207,7 +211,8 @@ var FAMILY = [
|
|
|
207
211
|
group: "app",
|
|
208
212
|
line: "Builders find co-founders and backers.",
|
|
209
213
|
status: "testing",
|
|
210
|
-
|
|
214
|
+
// Signs in with an orangecheck account and a wallet; uses none of the six directly.
|
|
215
|
+
protocols: []
|
|
211
216
|
},
|
|
212
217
|
{
|
|
213
218
|
slug: "me-demo",
|
|
@@ -241,7 +246,10 @@ var FAMILY_GROUPS = [
|
|
|
241
246
|
{ id: "app", label: "Apps" },
|
|
242
247
|
{ id: "public-good", label: "Public goods" }
|
|
243
248
|
];
|
|
244
|
-
new Map(FAMILY.map((s) => [s.slug, s]));
|
|
249
|
+
var BY_SLUG = new Map(FAMILY.map((s) => [s.slug, s]));
|
|
250
|
+
function protocolSite(slug) {
|
|
251
|
+
return BY_SLUG.get(slug);
|
|
252
|
+
}
|
|
245
253
|
function familyByGroup() {
|
|
246
254
|
return FAMILY_GROUPS.map((g) => ({ ...g, sites: FAMILY.filter((s) => s.group === g.id) }));
|
|
247
255
|
}
|
|
@@ -252,7 +260,7 @@ var LEGAL_LINKS = [
|
|
|
252
260
|
{ href: `${OCHK_IO}/trademark`, label: "Trademarks" },
|
|
253
261
|
{ href: `${OCHK_IO}/contact`, label: "Contact" }
|
|
254
262
|
];
|
|
255
|
-
[
|
|
263
|
+
var OCHK_IO_NAV = [
|
|
256
264
|
{
|
|
257
265
|
href: `${OCHK_IO}/protocols`,
|
|
258
266
|
label: "Protocols",
|
|
@@ -263,6 +271,16 @@ var LEGAL_LINKS = [
|
|
|
263
271
|
{ href: `${OCHK_IO}/trust`, label: "Trust" },
|
|
264
272
|
{ href: `${OCHK_IO}/about`, label: "About" }
|
|
265
273
|
];
|
|
274
|
+
var OCHK_IO_FOOTER = [
|
|
275
|
+
{
|
|
276
|
+
heading: "Company",
|
|
277
|
+
links: [
|
|
278
|
+
{ href: `${OCHK_IO}/about`, label: "About" },
|
|
279
|
+
{ href: `${OCHK_IO}/trust`, label: "Trust" },
|
|
280
|
+
{ href: "https://github.com/orangecheck", label: "GitHub", external: true }
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
];
|
|
266
284
|
var overlayClass = "oca-animate-fade fixed inset-0 z-50 bg-[rgb(10_10_10/0.38)] backdrop-blur-[2px] data-[state=closed]:opacity-0";
|
|
267
285
|
react.forwardRef(function DialogContent2({ className, children, hideClose, ...props }, ref) {
|
|
268
286
|
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
|
|
@@ -543,16 +561,23 @@ function FamilyMenu({ current, className }) {
|
|
|
543
561
|
)
|
|
544
562
|
] });
|
|
545
563
|
}
|
|
546
|
-
function NavLink({
|
|
564
|
+
function NavLink({
|
|
565
|
+
item,
|
|
566
|
+
className,
|
|
567
|
+
onNavigate,
|
|
568
|
+
line = false
|
|
569
|
+
}) {
|
|
547
570
|
const cls = cn(
|
|
548
571
|
"rounded-full px-3 py-2 text-[0.9375rem] transition-colors",
|
|
549
572
|
item.active ? "text-foreground" : "text-muted-foreground hover:text-foreground",
|
|
573
|
+
line && "relative after:absolute after:inset-x-3 after:-bottom-[0.625rem] after:h-0.5 after:rounded-full",
|
|
574
|
+
line && item.active && "after:bg-foreground",
|
|
550
575
|
className
|
|
551
576
|
);
|
|
552
577
|
if (item.external) {
|
|
553
578
|
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, className: cls, rel: "noreferrer", onClick: onNavigate, children: item.label });
|
|
554
579
|
}
|
|
555
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
580
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Link5__default.default, { href: item.href, className: cls, "aria-current": item.active ? "page" : void 0, onClick: onNavigate, children: item.label });
|
|
556
581
|
}
|
|
557
582
|
function NavRow({ item, onNavigate }) {
|
|
558
583
|
const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -563,7 +588,7 @@ function NavRow({ item, onNavigate }) {
|
|
|
563
588
|
"flex flex-col gap-0.5 rounded-xl px-3 py-2 transition-colors hover:bg-accent",
|
|
564
589
|
item.active && "bg-muted hover:bg-muted dark:bg-white/[0.06]"
|
|
565
590
|
);
|
|
566
|
-
return item.external ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, className: cls, rel: "noreferrer", onClick: onNavigate, children: body }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
591
|
+
return item.external ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, className: cls, rel: "noreferrer", onClick: onNavigate, children: body }) : /* @__PURE__ */ jsxRuntime.jsx(Link5__default.default, { href: item.href, className: cls, "aria-current": item.active ? "page" : void 0, onClick: onNavigate, children: body });
|
|
567
592
|
}
|
|
568
593
|
var seeAll = (item) => typeof item.label === "string" ? `All ${item.label.toLowerCase()}` : "See all";
|
|
569
594
|
function NavDropdown({ item }) {
|
|
@@ -605,13 +630,16 @@ function SiteHeader({
|
|
|
605
630
|
search,
|
|
606
631
|
actions,
|
|
607
632
|
variant = "site",
|
|
633
|
+
navOnPhone = true,
|
|
634
|
+
menu: menuExtra,
|
|
608
635
|
className
|
|
609
636
|
}) {
|
|
610
637
|
const [open, setOpen] = react.useState(false);
|
|
611
638
|
const tool = variant === "tool";
|
|
612
639
|
const size = tool ? 24 : 28;
|
|
613
640
|
const current = typeof family === "string" ? family : void 0;
|
|
614
|
-
const
|
|
641
|
+
const phoneNav = navOnPhone ? nav : [];
|
|
642
|
+
const menu = phoneNav.length > 0 || Boolean(family) || Boolean(menuExtra);
|
|
615
643
|
const brandNode = brand ?? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center", children: [
|
|
616
644
|
/* @__PURE__ */ jsxRuntime.jsx(Lockup, { size }),
|
|
617
645
|
product ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -619,7 +647,9 @@ function SiteHeader({
|
|
|
619
647
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium tracking-[-0.01em]", style: { fontSize: size * 0.56 }, children: product })
|
|
620
648
|
] }) : null
|
|
621
649
|
] });
|
|
622
|
-
const navigation = nav.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Main", className: "hidden items-center gap-1 md:flex", children: nav.map(
|
|
650
|
+
const navigation = nav.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Main", className: "hidden items-center gap-1 md:flex", children: nav.map(
|
|
651
|
+
(n) => n.children?.length ? /* @__PURE__ */ jsxRuntime.jsx(NavDropdown, { item: n }, n.href) : /* @__PURE__ */ jsxRuntime.jsx(NavLink, { item: n, line: tool }, n.href)
|
|
652
|
+
) }) : null;
|
|
623
653
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
624
654
|
"header",
|
|
625
655
|
{
|
|
@@ -641,7 +671,7 @@ function SiteHeader({
|
|
|
641
671
|
),
|
|
642
672
|
children: [
|
|
643
673
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex min-w-0 items-center gap-1", tool ? "md:gap-1" : "justify-self-start"), children: [
|
|
644
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
674
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Link5__default.default, { href: home, className: "-ml-1 min-w-0 rounded-lg p-1", children: [
|
|
645
675
|
brandNode,
|
|
646
676
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: " home" })
|
|
647
677
|
] }),
|
|
@@ -663,7 +693,8 @@ function SiteHeader({
|
|
|
663
693
|
),
|
|
664
694
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "pt-16", children: [
|
|
665
695
|
/* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { className: "sr-only", children: "Menu" }),
|
|
666
|
-
|
|
696
|
+
menuExtra ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col", (phoneNav.length > 0 || family) && "border-b border-border pb-3"), children: menuExtra }) : null,
|
|
697
|
+
phoneNav.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Main", className: "flex flex-col", children: phoneNav.map(
|
|
667
698
|
(n) => n.children?.length ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col py-2", children: [
|
|
668
699
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-3 pb-1 text-[0.8125rem] text-muted-foreground", children: n.label }),
|
|
669
700
|
n.children.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -685,7 +716,7 @@ function SiteHeader({
|
|
|
685
716
|
n.href
|
|
686
717
|
)
|
|
687
718
|
) }) : null,
|
|
688
|
-
family ? /* @__PURE__ */ jsxRuntime.jsxs("details", { className: cn("group",
|
|
719
|
+
family ? /* @__PURE__ */ jsxRuntime.jsxs("details", { className: cn("group", phoneNav.length > 0 && "mt-2 border-t border-border pt-4"), children: [
|
|
689
720
|
/* @__PURE__ */ jsxRuntime.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between rounded-xl px-3 py-2.5 text-[1.0625rem] [&::-webkit-details-marker]:hidden", children: [
|
|
690
721
|
"All orangecheck sites",
|
|
691
722
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { "aria-hidden": true, className: "size-4 text-muted-foreground transition-transform group-open:rotate-180" })
|
|
@@ -916,12 +947,12 @@ function SignInFrame({
|
|
|
916
947
|
children: [
|
|
917
948
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col px-4 pb-8 pt-5 sm:px-8 lg:px-14 lg:pt-8", children: [
|
|
918
949
|
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex items-center justify-between gap-4", children: [
|
|
919
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
950
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Link5__default.default, { href: home, className: "w-fit rounded-lg", children: [
|
|
920
951
|
brand ?? /* @__PURE__ */ jsxRuntime.jsx(Lockup, { size: 28 }),
|
|
921
952
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: " home" })
|
|
922
953
|
] }),
|
|
923
954
|
back === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
924
|
-
|
|
955
|
+
Link5__default.default,
|
|
925
956
|
{
|
|
926
957
|
href: home,
|
|
927
958
|
className: "text-[0.9375rem] text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",
|
|
@@ -954,15 +985,335 @@ function SignInFrame({
|
|
|
954
985
|
}
|
|
955
986
|
);
|
|
956
987
|
}
|
|
957
|
-
|
|
988
|
+
function Spinner({ className, label }) {
|
|
989
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
990
|
+
"svg",
|
|
991
|
+
{
|
|
992
|
+
viewBox: "0 0 24 24",
|
|
993
|
+
fill: "none",
|
|
994
|
+
role: label ? "status" : void 0,
|
|
995
|
+
"aria-label": label,
|
|
996
|
+
"aria-hidden": label ? void 0 : true,
|
|
997
|
+
className: cn("size-4 animate-spin", className),
|
|
998
|
+
children: [
|
|
999
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2.5" }),
|
|
1000
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" })
|
|
1001
|
+
]
|
|
1002
|
+
}
|
|
1003
|
+
);
|
|
1004
|
+
}
|
|
1005
|
+
react.forwardRef(function Separator3({ className, orientation = "horizontal", decorative = true, ...props }, ref) {
|
|
1006
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1007
|
+
SeparatorPrimitive__namespace.Root,
|
|
1008
|
+
{
|
|
1009
|
+
ref,
|
|
1010
|
+
decorative,
|
|
1011
|
+
orientation,
|
|
1012
|
+
className: cn(
|
|
1013
|
+
"shrink-0 bg-border",
|
|
1014
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
1015
|
+
className
|
|
1016
|
+
),
|
|
1017
|
+
...props
|
|
1018
|
+
}
|
|
1019
|
+
);
|
|
1020
|
+
});
|
|
1021
|
+
function sharedContext(name, initial) {
|
|
1022
|
+
const key = /* @__PURE__ */ Symbol.for(`@orangecheck/app-design/${name}`);
|
|
1023
|
+
const store = globalThis;
|
|
1024
|
+
return store[key] ?? (store[key] = react.createContext(initial));
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
// src/lib/density.ts
|
|
1028
|
+
var DensityContext = sharedContext("density", "comfortable");
|
|
1029
|
+
function DensityProvider({ density, children }) {
|
|
1030
|
+
return react.createElement(DensityContext.Provider, { value: density }, children);
|
|
1031
|
+
}
|
|
1032
|
+
var ShellContext = sharedContext("shell-place", {});
|
|
958
1033
|
function useShellPlace() {
|
|
959
1034
|
return react.useContext(ShellContext);
|
|
960
1035
|
}
|
|
1036
|
+
var buttonVariants = classVarianceAuthority.cva(
|
|
1037
|
+
[
|
|
1038
|
+
"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium",
|
|
1039
|
+
"transition-[background-color,border-color,color,box-shadow,transform] duration-150",
|
|
1040
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1041
|
+
"active:translate-y-px disabled:pointer-events-none",
|
|
1042
|
+
// Disabled is one look for every variant: a quiet grey pill, never a
|
|
1043
|
+
// faded black or orange slab that reads as broken.
|
|
1044
|
+
"disabled:border disabled:border-border disabled:bg-muted disabled:text-oca-subtle disabled:shadow-none",
|
|
1045
|
+
"[&_svg]:pointer-events-none [&_svg]:size-[1.1em] [&_svg]:shrink-0"
|
|
1046
|
+
],
|
|
1047
|
+
{
|
|
1048
|
+
variants: {
|
|
1049
|
+
variant: {
|
|
1050
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary/85",
|
|
1051
|
+
secondary: "border border-border bg-secondary text-secondary-foreground hover:border-oca-hairline-strong hover:bg-accent",
|
|
1052
|
+
brand: "bg-brand text-brand-foreground hover:bg-oca-orange-deep",
|
|
1053
|
+
ghost: "text-foreground hover:bg-accent",
|
|
1054
|
+
danger: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1055
|
+
link: "h-auto rounded-none px-0 text-foreground underline decoration-foreground/35 underline-offset-4 hover:decoration-foreground",
|
|
1056
|
+
onInk: "bg-white text-oca-ink hover:bg-white/90",
|
|
1057
|
+
onInkOutline: "border border-white/20 text-white hover:bg-white/10"
|
|
1058
|
+
},
|
|
1059
|
+
size: {
|
|
1060
|
+
sm: "h-9 px-4 text-sm",
|
|
1061
|
+
md: "h-11 px-5 text-[0.9375rem]",
|
|
1062
|
+
lg: "h-14 px-7 text-[1.0625rem]",
|
|
1063
|
+
icon: "size-10",
|
|
1064
|
+
"icon-sm": "size-8"
|
|
1065
|
+
}
|
|
1066
|
+
},
|
|
1067
|
+
compoundVariants: [{ variant: "link", className: "h-auto px-0" }],
|
|
1068
|
+
defaultVariants: { variant: "primary", size: "md" }
|
|
1069
|
+
}
|
|
1070
|
+
);
|
|
1071
|
+
var Button = react.forwardRef(function Button2({ className, variant, size, asChild = false, loading = false, disabled, children, type, ...props }, ref) {
|
|
1072
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
1073
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1074
|
+
Comp,
|
|
1075
|
+
{
|
|
1076
|
+
ref,
|
|
1077
|
+
"data-ui": "button",
|
|
1078
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
1079
|
+
disabled: asChild ? void 0 : disabled || loading,
|
|
1080
|
+
"aria-busy": loading || void 0,
|
|
1081
|
+
type: asChild ? void 0 : type ?? "button",
|
|
1082
|
+
...props,
|
|
1083
|
+
children: asChild ? children : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1084
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "size-[1.1em]" }) : null,
|
|
1085
|
+
children
|
|
1086
|
+
] })
|
|
1087
|
+
}
|
|
1088
|
+
);
|
|
1089
|
+
});
|
|
1090
|
+
function useActiveHeading(ids) {
|
|
1091
|
+
const [active, setActive] = react.useState(ids[0]);
|
|
1092
|
+
const key = ids.join("|");
|
|
1093
|
+
react.useEffect(() => {
|
|
1094
|
+
setActive(key.split("|")[0] || void 0);
|
|
1095
|
+
const els = key.split("|").map((id) => document.getElementById(id)).filter((el) => el !== null);
|
|
1096
|
+
if (els.length === 0 || typeof IntersectionObserver === "undefined") return;
|
|
1097
|
+
const io = new IntersectionObserver(
|
|
1098
|
+
(entries) => {
|
|
1099
|
+
const hit = entries.filter((e) => e.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)[0];
|
|
1100
|
+
if (hit) setActive(hit.target.id);
|
|
1101
|
+
},
|
|
1102
|
+
{ rootMargin: "-80px 0px -65% 0px" }
|
|
1103
|
+
);
|
|
1104
|
+
els.forEach((el) => io.observe(el));
|
|
1105
|
+
return () => io.disconnect();
|
|
1106
|
+
}, [key]);
|
|
1107
|
+
return active;
|
|
1108
|
+
}
|
|
1109
|
+
function useHeadings(selector = "#docs-content", key) {
|
|
1110
|
+
const [items, setItems] = react.useState([]);
|
|
1111
|
+
react.useEffect(() => {
|
|
1112
|
+
const read = () => {
|
|
1113
|
+
const root = document.querySelector(selector);
|
|
1114
|
+
if (!root) return setItems([]);
|
|
1115
|
+
setItems(
|
|
1116
|
+
Array.from(root.querySelectorAll("h2[id], h3[id]")).map((h) => ({
|
|
1117
|
+
id: h.id,
|
|
1118
|
+
// The anchor link's "#" is not part of the name.
|
|
1119
|
+
label: (h.querySelector("[data-heading-text]") ?? h).textContent?.trim() ?? "",
|
|
1120
|
+
level: h.tagName === "H3" ? 3 : 2
|
|
1121
|
+
}))
|
|
1122
|
+
);
|
|
1123
|
+
};
|
|
1124
|
+
const raf = requestAnimationFrame(read);
|
|
1125
|
+
const t = setTimeout(read, 80);
|
|
1126
|
+
return () => {
|
|
1127
|
+
cancelAnimationFrame(raf);
|
|
1128
|
+
clearTimeout(t);
|
|
1129
|
+
};
|
|
1130
|
+
}, [selector, key]);
|
|
1131
|
+
const activeId = useActiveHeading(items.map((i) => i.id));
|
|
1132
|
+
return { items, activeId };
|
|
1133
|
+
}
|
|
1134
|
+
function OnThisPage({
|
|
1135
|
+
items,
|
|
1136
|
+
activeId,
|
|
1137
|
+
title = "On this page",
|
|
1138
|
+
onNavigate,
|
|
1139
|
+
className
|
|
1140
|
+
}) {
|
|
1141
|
+
const id = react.useId();
|
|
1142
|
+
if (items.length === 0) return null;
|
|
1143
|
+
return (
|
|
1144
|
+
// With no visible title (a folded list under its own summary) the name is still "On this page".
|
|
1145
|
+
/* @__PURE__ */ jsxRuntime.jsxs("nav", { "aria-labelledby": title ? id : void 0, "aria-label": title ? void 0 : "On this page", className, children: [
|
|
1146
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx("p", { id, className: "mb-3 text-[0.875rem] font-medium", children: title }) : null,
|
|
1147
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { children: items.map((t) => {
|
|
1148
|
+
const on = t.id === activeId;
|
|
1149
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1150
|
+
"a",
|
|
1151
|
+
{
|
|
1152
|
+
href: `#${t.id}`,
|
|
1153
|
+
onClick: onNavigate,
|
|
1154
|
+
"aria-current": on ? "location" : void 0,
|
|
1155
|
+
className: cn(
|
|
1156
|
+
"block border-l py-1.5 text-[0.875rem] leading-snug transition-colors",
|
|
1157
|
+
t.level === 3 ? "pl-7" : "pl-4",
|
|
1158
|
+
on ? "border-foreground text-foreground" : "border-border text-muted-foreground hover:text-foreground"
|
|
1159
|
+
),
|
|
1160
|
+
children: t.label
|
|
1161
|
+
}
|
|
1162
|
+
) }, t.id);
|
|
1163
|
+
}) })
|
|
1164
|
+
] })
|
|
1165
|
+
);
|
|
1166
|
+
}
|
|
1167
|
+
var STATUS_WORDS = /* @__PURE__ */ new Set(["live", "testing", "not-yet", "paused", "good", "caution", "refused"]);
|
|
1168
|
+
var pathOf = (href) => href.split(/[?#]/)[0].replace(/(.)\/$/, "$1");
|
|
1169
|
+
function DocsNav({
|
|
1170
|
+
sections,
|
|
1171
|
+
current,
|
|
1172
|
+
onNavigate,
|
|
1173
|
+
className
|
|
1174
|
+
}) {
|
|
1175
|
+
const here = pathOf(current);
|
|
1176
|
+
const activeSection = react.useMemo(
|
|
1177
|
+
() => sections.findIndex((s) => s.items.some((i) => pathOf(i.href) === here)),
|
|
1178
|
+
[sections, here]
|
|
1179
|
+
);
|
|
1180
|
+
const [peeked, setPeeked] = react.useState(() => /* @__PURE__ */ new Set());
|
|
1181
|
+
react.useEffect(() => setPeeked(/* @__PURE__ */ new Set()), [activeSection]);
|
|
1182
|
+
const activeRef = react.useRef(null);
|
|
1183
|
+
react.useEffect(() => {
|
|
1184
|
+
const id = requestAnimationFrame(() => activeRef.current?.scrollIntoView({ block: "nearest" }));
|
|
1185
|
+
return () => cancelAnimationFrame(id);
|
|
1186
|
+
}, [here]);
|
|
1187
|
+
const base = react.useId();
|
|
1188
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Docs", className: cn("flex flex-col gap-0.5", className), children: sections.map((section, si) => {
|
|
1189
|
+
const isActive = si === activeSection;
|
|
1190
|
+
const open = isActive || peeked.has(si);
|
|
1191
|
+
const panel = `${base}-s${si}`;
|
|
1192
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1193
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1194
|
+
"button",
|
|
1195
|
+
{
|
|
1196
|
+
type: "button",
|
|
1197
|
+
"aria-expanded": open,
|
|
1198
|
+
"aria-controls": panel,
|
|
1199
|
+
onClick: () => {
|
|
1200
|
+
if (isActive) return;
|
|
1201
|
+
setPeeked((p) => {
|
|
1202
|
+
const n = new Set(p);
|
|
1203
|
+
if (n.has(si)) n.delete(si);
|
|
1204
|
+
else n.add(si);
|
|
1205
|
+
return n;
|
|
1206
|
+
});
|
|
1207
|
+
},
|
|
1208
|
+
className: cn(
|
|
1209
|
+
"flex min-h-9 w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-left text-[0.875rem] transition-colors",
|
|
1210
|
+
isActive ? "font-medium text-foreground" : "text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
1211
|
+
isActive && "cursor-default"
|
|
1212
|
+
),
|
|
1213
|
+
children: [
|
|
1214
|
+
section.label,
|
|
1215
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1216
|
+
lucideReact.ChevronRight,
|
|
1217
|
+
{
|
|
1218
|
+
"aria-hidden": true,
|
|
1219
|
+
className: cn("size-3.5 shrink-0 text-oca-subtle transition-transform duration-200", open && "rotate-90")
|
|
1220
|
+
}
|
|
1221
|
+
)
|
|
1222
|
+
]
|
|
1223
|
+
}
|
|
1224
|
+
),
|
|
1225
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { id: panel, hidden: !open, className: "mb-2 ml-2.5 mt-0.5 border-l border-border", children: section.items.map((item) => {
|
|
1226
|
+
const on = pathOf(item.href) === here;
|
|
1227
|
+
const badge = typeof item.badge === "string" && STATUS_WORDS.has(item.badge) ? /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: item.badge }) : item.badge ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { tone: "muted", children: item.badge }) : null;
|
|
1228
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1229
|
+
Link5__default.default,
|
|
1230
|
+
{
|
|
1231
|
+
href: item.href,
|
|
1232
|
+
ref: on ? activeRef : void 0,
|
|
1233
|
+
onClick: onNavigate,
|
|
1234
|
+
"aria-current": on ? "page" : void 0,
|
|
1235
|
+
className: cn(
|
|
1236
|
+
"-ml-px flex min-h-9 items-center gap-2 border-l-2 py-1.5 pl-3.5 pr-2 text-[0.875rem] leading-snug transition-colors",
|
|
1237
|
+
on ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:border-oca-hairline-strong hover:text-foreground"
|
|
1238
|
+
),
|
|
1239
|
+
children: [
|
|
1240
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1", children: item.label }),
|
|
1241
|
+
badge
|
|
1242
|
+
]
|
|
1243
|
+
}
|
|
1244
|
+
) }, item.href);
|
|
1245
|
+
}) })
|
|
1246
|
+
] }, section.label);
|
|
1247
|
+
}) });
|
|
1248
|
+
}
|
|
1249
|
+
var DOCS_HEADER_NAV = OCHK_IO_NAV.map((n) => n.href === DOCS_HREF ? { ...n, active: true } : n);
|
|
1250
|
+
function DocsShell({
|
|
1251
|
+
nav,
|
|
1252
|
+
current,
|
|
1253
|
+
header,
|
|
1254
|
+
search,
|
|
1255
|
+
actions,
|
|
1256
|
+
breadcrumbs,
|
|
1257
|
+
toc,
|
|
1258
|
+
pager,
|
|
1259
|
+
footer,
|
|
1260
|
+
children
|
|
1261
|
+
}) {
|
|
1262
|
+
const [menu, setMenu] = react.useState(false);
|
|
1263
|
+
react.useEffect(() => setMenu(false), [current]);
|
|
1264
|
+
const read = useHeadings("#docs-content", current);
|
|
1265
|
+
const items = toc ?? read.items;
|
|
1266
|
+
const activeId = toc ? void 0 : read.activeId;
|
|
1267
|
+
const here = pathOf(current);
|
|
1268
|
+
const place = react.useMemo(() => {
|
|
1269
|
+
for (const s of nav) {
|
|
1270
|
+
const it = s.items.find((i) => pathOf(i.href) === here);
|
|
1271
|
+
if (it) return { section: s.label, page: it.label };
|
|
1272
|
+
}
|
|
1273
|
+
return null;
|
|
1274
|
+
}, [nav, here]);
|
|
1275
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-dvh flex-col bg-background", children: [
|
|
1276
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkipLink, {}),
|
|
1277
|
+
header ?? /* @__PURE__ */ jsxRuntime.jsx(SiteHeader, { home: OCHK_IO, family: "docs", nav: DOCS_HEADER_NAV, search, actions }),
|
|
1278
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-16 z-30 border-b border-border bg-background/95 backdrop-blur-md supports-[backdrop-filter]:bg-background/90 md:top-[4.5rem] lg:hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oca-container flex h-12 items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open: menu, onOpenChange: setMenu, children: [
|
|
1279
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SheetTrigger, { className: "-ml-2 inline-flex h-10 min-w-0 items-center gap-2 rounded-full px-2.5 text-[0.875rem] hover:bg-accent", children: [
|
|
1280
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeft, { "aria-hidden": true, className: "size-[1.125rem] shrink-0" }),
|
|
1281
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Docs menu. " }),
|
|
1282
|
+
place ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
1283
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-muted-foreground", children: place.section }),
|
|
1284
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { "aria-hidden": true, className: "size-3.5 shrink-0 text-oca-subtle" }),
|
|
1285
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium", children: place.page })
|
|
1286
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "Docs" })
|
|
1287
|
+
] }),
|
|
1288
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "left", className: "w-[min(88vw,22rem)] gap-0 p-0", children: [
|
|
1289
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border px-5 py-4 pr-14", children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { className: "text-[1.0625rem] font-medium", children: "Docs" }) }),
|
|
1290
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto p-3", children: /* @__PURE__ */ jsxRuntime.jsx(DocsNav, { sections: nav, current, onNavigate: () => setMenu(false) }) })
|
|
1291
|
+
] })
|
|
1292
|
+
] }) }) }),
|
|
1293
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "oca-container flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lg:grid lg:grid-cols-[13.5rem_minmax(0,1fr)] lg:gap-x-10 xl:grid-cols-[13.5rem_minmax(0,1fr)_11rem]", children: [
|
|
1294
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-[4.5rem] hidden max-h-[calc(100dvh-4.5rem)] self-start overflow-y-auto overscroll-contain py-8 pr-1 lg:block", children: /* @__PURE__ */ jsxRuntime.jsx(DocsNav, { sections: nav, current }) }),
|
|
1295
|
+
/* @__PURE__ */ jsxRuntime.jsxs("main", { id: "main-content", className: "min-w-0 pb-16 pt-6 md:pt-8", children: [
|
|
1296
|
+
breadcrumbs ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6 max-lg:hidden", children: breadcrumbs }) : null,
|
|
1297
|
+
items.length > 1 ? /* @__PURE__ */ jsxRuntime.jsxs("details", { className: "group mb-8 rounded-2xl border border-border bg-card xl:hidden", children: [
|
|
1298
|
+
/* @__PURE__ */ jsxRuntime.jsxs("summary", { className: "flex min-h-12 cursor-pointer list-none items-center justify-between px-4 text-[0.9375rem] font-medium [&::-webkit-details-marker]:hidden", children: [
|
|
1299
|
+
"On this page",
|
|
1300
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { "aria-hidden": true, className: "size-4 text-muted-foreground transition-transform group-open:rotate-180" })
|
|
1301
|
+
] }),
|
|
1302
|
+
/* @__PURE__ */ jsxRuntime.jsx(OnThisPage, { items, activeId, title: null, className: "px-4 pb-4" })
|
|
1303
|
+
] }) : null,
|
|
1304
|
+
/* @__PURE__ */ jsxRuntime.jsx("article", { id: "docs-content", className: "max-w-[46rem]", children }),
|
|
1305
|
+
pager ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-16 max-w-[46rem]", children: pager }) : null
|
|
1306
|
+
] }),
|
|
1307
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-[4.5rem] hidden max-h-[calc(100dvh-4.5rem)] self-start overflow-y-auto py-10 xl:block", children: items.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx(OnThisPage, { items, activeId }) : null })
|
|
1308
|
+
] }) }),
|
|
1309
|
+
footer ?? /* @__PURE__ */ jsxRuntime.jsx(SiteFooter, { columns: OCHK_IO_FOOTER, family: true, legal: true, signature: false })
|
|
1310
|
+
] });
|
|
1311
|
+
}
|
|
961
1312
|
function SideNav({ groups, onNavigate }) {
|
|
962
1313
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Pages", className: "flex flex-col gap-5", children: groups.map((g, gi) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5", children: [
|
|
963
1314
|
g.label ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-3 pb-1 text-[0.8125rem] text-muted-foreground", children: g.label }) : null,
|
|
964
1315
|
g.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
965
|
-
|
|
1316
|
+
Link5__default.default,
|
|
966
1317
|
{
|
|
967
1318
|
href: it.href,
|
|
968
1319
|
onClick: onNavigate,
|
|
@@ -997,7 +1348,7 @@ function SectionSwitch({
|
|
|
997
1348
|
children: sections.map((sec) => {
|
|
998
1349
|
const on = sec.id === current.id;
|
|
999
1350
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1000
|
-
|
|
1351
|
+
Link5__default.default,
|
|
1001
1352
|
{
|
|
1002
1353
|
href: sec.href,
|
|
1003
1354
|
onClick: onNavigate,
|
|
@@ -1027,7 +1378,7 @@ function TabBar({ items }) {
|
|
|
1027
1378
|
className: "mx-auto grid h-14 max-w-[32rem] px-1.5",
|
|
1028
1379
|
style: { gridTemplateColumns: `repeat(${items.length}, minmax(0, 1fr))` },
|
|
1029
1380
|
children: items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1030
|
-
|
|
1381
|
+
Link5__default.default,
|
|
1031
1382
|
{
|
|
1032
1383
|
href: it.href,
|
|
1033
1384
|
"aria-current": it.active ? "page" : void 0,
|
|
@@ -1136,7 +1487,7 @@ function AppShell({
|
|
|
1136
1487
|
footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-auto flex flex-col gap-3", children: footer }) : null
|
|
1137
1488
|
] })
|
|
1138
1489
|
] }),
|
|
1139
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1490
|
+
/* @__PURE__ */ jsxRuntime.jsx(Link5__default.default, { href: home, "aria-label": "Home", className: "rounded-lg p-1", children: /* @__PURE__ */ jsxRuntime.jsx(Lockup, { size: 22 }) }),
|
|
1140
1491
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto flex items-center", children: account })
|
|
1141
1492
|
] }),
|
|
1142
1493
|
place.page ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1159,7 +1510,7 @@ function AppShell({
|
|
|
1159
1510
|
] }),
|
|
1160
1511
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto flex w-full max-w-[90rem]", children: [
|
|
1161
1512
|
/* @__PURE__ */ jsxRuntime.jsxs("aside", { className: "sticky top-0 hidden h-dvh w-[17rem] shrink-0 flex-col gap-6 overflow-y-auto px-4 py-6 lg:flex", children: [
|
|
1162
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1513
|
+
/* @__PURE__ */ jsxRuntime.jsx(Link5__default.default, { href: home, className: "px-2", "aria-label": "Home", children: /* @__PURE__ */ jsxRuntime.jsx(Lockup, { size: 26 }) }),
|
|
1163
1514
|
switcher,
|
|
1164
1515
|
/* @__PURE__ */ jsxRuntime.jsx(SideNav, { groups }),
|
|
1165
1516
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-auto flex flex-col gap-3", children: footer })
|
|
@@ -1190,9 +1541,16 @@ function AccountMenu({
|
|
|
1190
1541
|
"inline-flex h-10 items-center gap-2.5 rounded-full border border-border bg-card pl-1 pr-1 text-[0.9375rem] outline-none transition-colors hover:border-oca-hairline-strong focus-visible:ring-2 focus-visible:ring-ring",
|
|
1191
1542
|
nameFrom === "lg" ? "lg:pr-3.5" : "sm:pr-3.5"
|
|
1192
1543
|
),
|
|
1193
|
-
"aria-label":
|
|
1544
|
+
"aria-label": `${name}, account menu`,
|
|
1194
1545
|
children: [
|
|
1195
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1546
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1547
|
+
"span",
|
|
1548
|
+
{
|
|
1549
|
+
"aria-hidden": true,
|
|
1550
|
+
"data-initial": initial,
|
|
1551
|
+
className: "flex size-8 items-center justify-center rounded-full bg-foreground text-[0.8125rem] font-medium text-background before:content-[attr(data-initial)]"
|
|
1552
|
+
}
|
|
1553
|
+
),
|
|
1196
1554
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("max-w-[10rem] truncate", nameFrom === "lg" ? "max-lg:hidden" : "max-sm:hidden"), children: name })
|
|
1197
1555
|
]
|
|
1198
1556
|
}
|
|
@@ -1204,7 +1562,7 @@ function AccountMenu({
|
|
|
1204
1562
|
] }),
|
|
1205
1563
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
|
|
1206
1564
|
items.map(
|
|
1207
|
-
(it, i) => it === "separator" ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}, `sep-${i}`) : it.href ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, destructive: it.destructive, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1565
|
+
(it, i) => it === "separator" ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}, `sep-${i}`) : it.href ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, destructive: it.destructive, children: /* @__PURE__ */ jsxRuntime.jsxs(Link5__default.default, { href: it.href, children: [
|
|
1208
1566
|
it.icon,
|
|
1209
1567
|
it.label
|
|
1210
1568
|
] }) }, it.label) : /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onSelect: it.onSelect, destructive: it.destructive, children: [
|
|
@@ -1237,10 +1595,129 @@ function ThemeToggle({ className }) {
|
|
|
1237
1595
|
}
|
|
1238
1596
|
);
|
|
1239
1597
|
}
|
|
1598
|
+
var OCHK_APP_ACCOUNT = "https://ochk.app/me/account";
|
|
1599
|
+
function SessionAccountView({
|
|
1600
|
+
state,
|
|
1601
|
+
name,
|
|
1602
|
+
detail,
|
|
1603
|
+
items = [],
|
|
1604
|
+
signInHref,
|
|
1605
|
+
signInLabel = "Sign in",
|
|
1606
|
+
accountHref = OCHK_APP_ACCOUNT,
|
|
1607
|
+
onSignOut,
|
|
1608
|
+
nameFrom = "lg"
|
|
1609
|
+
}) {
|
|
1610
|
+
if (state === "in") {
|
|
1611
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1612
|
+
AccountMenu,
|
|
1613
|
+
{
|
|
1614
|
+
name: name || "Your account",
|
|
1615
|
+
detail,
|
|
1616
|
+
nameFrom,
|
|
1617
|
+
items: [
|
|
1618
|
+
...items,
|
|
1619
|
+
...items.length > 0 ? ["separator"] : [],
|
|
1620
|
+
{ label: "Your account", href: accountHref, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleUser, {}) },
|
|
1621
|
+
"separator",
|
|
1622
|
+
{ label: "Sign out", onSelect: onSignOut, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, {}) }
|
|
1623
|
+
]
|
|
1624
|
+
}
|
|
1625
|
+
);
|
|
1626
|
+
}
|
|
1627
|
+
if (state === "unknown") {
|
|
1628
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Button, { asChild: true, size: "sm", variant: "secondary", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: accountHref, children: "Your account" }) });
|
|
1629
|
+
}
|
|
1630
|
+
return (
|
|
1631
|
+
// No box of its own: it sits exactly where the signed-in chip will. While checking it is only unseen.
|
|
1632
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: state === "checking" ? "contents invisible" : "contents", "aria-hidden": state === "checking" || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { asChild: true, size: "sm", variant: "secondary", tabIndex: state === "checking" ? -1 : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: signInHref, children: signInLabel }) }) })
|
|
1633
|
+
);
|
|
1634
|
+
}
|
|
1635
|
+
function ToolShell({
|
|
1636
|
+
protocol: protocol2,
|
|
1637
|
+
tools,
|
|
1638
|
+
home = "/",
|
|
1639
|
+
account,
|
|
1640
|
+
rail = false,
|
|
1641
|
+
railFooter,
|
|
1642
|
+
variant = "tool",
|
|
1643
|
+
banner,
|
|
1644
|
+
footer,
|
|
1645
|
+
children
|
|
1646
|
+
}) {
|
|
1647
|
+
const p = protocolSite(protocol2);
|
|
1648
|
+
const app = variant === "app";
|
|
1649
|
+
const tabs = app ? null : tabsFor([{ items: [...tools] }]);
|
|
1650
|
+
const about = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1651
|
+
"a",
|
|
1652
|
+
{
|
|
1653
|
+
href: p.pageHref,
|
|
1654
|
+
className: "inline-flex items-center gap-1 rounded-full px-3 py-2 text-[0.9375rem] text-muted-foreground transition-colors hover:text-foreground",
|
|
1655
|
+
children: [
|
|
1656
|
+
"About ",
|
|
1657
|
+
p.label,
|
|
1658
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpRight, { "aria-hidden": true, className: "size-3.5" })
|
|
1659
|
+
]
|
|
1660
|
+
}
|
|
1661
|
+
);
|
|
1662
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DensityProvider, { density: "compact", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1663
|
+
"div",
|
|
1664
|
+
{
|
|
1665
|
+
className: cn(
|
|
1666
|
+
"flex flex-col bg-background",
|
|
1667
|
+
app ? "h-dvh overflow-hidden" : "min-h-dvh",
|
|
1668
|
+
tabs && "max-md:pb-[calc(3.5rem_+_env(safe-area-inset-bottom))]"
|
|
1669
|
+
),
|
|
1670
|
+
children: [
|
|
1671
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkipLink, {}),
|
|
1672
|
+
banner,
|
|
1673
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1674
|
+
SiteHeader,
|
|
1675
|
+
{
|
|
1676
|
+
variant: "tool",
|
|
1677
|
+
home,
|
|
1678
|
+
product: p.label,
|
|
1679
|
+
family: protocol2,
|
|
1680
|
+
nav: tools.map((t) => ({ href: t.href, label: t.label, active: t.active })),
|
|
1681
|
+
navOnPhone: !tabs,
|
|
1682
|
+
menu: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "[&>a]:px-3 [&>a]:py-3 [&>a]:text-[1.0625rem]", children: about }),
|
|
1683
|
+
className: cn(rail && "lg:[&_nav[aria-label=Main]]:hidden"),
|
|
1684
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1685
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden lg:contents", children: about }),
|
|
1686
|
+
p.status !== "live" ? /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: p.status, className: "max-sm:hidden" }) : null,
|
|
1687
|
+
/* @__PURE__ */ jsxRuntime.jsx(ThemeToggle, { className: "max-sm:hidden" }),
|
|
1688
|
+
account
|
|
1689
|
+
] })
|
|
1690
|
+
}
|
|
1691
|
+
),
|
|
1692
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mx-auto flex w-full", app ? "min-h-0 flex-1" : "max-w-[90rem] flex-1"), children: [
|
|
1693
|
+
rail ? /* @__PURE__ */ jsxRuntime.jsxs("aside", { className: "sticky top-14 hidden h-[calc(100dvh-3.5rem)] w-60 shrink-0 flex-col gap-6 overflow-y-auto px-4 py-6 lg:flex", children: [
|
|
1694
|
+
/* @__PURE__ */ jsxRuntime.jsx(SideNav, { groups: [{ label: "Tools", items: tools.map(({ href, label, icon, active }) => ({ href, label, icon, active })) }] }),
|
|
1695
|
+
railFooter ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-auto flex flex-col gap-0.5 px-3 text-[0.875rem] text-muted-foreground [&_a:hover]:text-foreground [&_a]:py-1.5 [&_a]:transition-colors", children: railFooter }) : null
|
|
1696
|
+
] }) : null,
|
|
1697
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1698
|
+
"main",
|
|
1699
|
+
{
|
|
1700
|
+
id: "main-content",
|
|
1701
|
+
className: cn("min-w-0 flex-1", app ? "flex min-h-0 flex-col" : "px-4 pb-16 pt-8 md:px-8 md:pt-10"),
|
|
1702
|
+
children: app ? children : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto w-full max-w-[72rem]", children })
|
|
1703
|
+
}
|
|
1704
|
+
)
|
|
1705
|
+
] }),
|
|
1706
|
+
app || footer === false ? null : footer ?? /* @__PURE__ */ jsxRuntime.jsx(SiteFooter, { compact: true, family: true, legal: true }),
|
|
1707
|
+
tabs ? /* @__PURE__ */ jsxRuntime.jsx(TabBar, { items: tabs }) : null
|
|
1708
|
+
]
|
|
1709
|
+
}
|
|
1710
|
+
) });
|
|
1711
|
+
}
|
|
1240
1712
|
|
|
1241
1713
|
exports.AccountMenu = AccountMenu;
|
|
1242
1714
|
exports.AppShell = AppShell;
|
|
1715
|
+
exports.DOCS_HEADER_NAV = DOCS_HEADER_NAV;
|
|
1716
|
+
exports.DocsNav = DocsNav;
|
|
1717
|
+
exports.DocsShell = DocsShell;
|
|
1243
1718
|
exports.FamilyMenu = FamilyMenu;
|
|
1719
|
+
exports.OCHK_APP_ACCOUNT = OCHK_APP_ACCOUNT;
|
|
1720
|
+
exports.SessionAccountView = SessionAccountView;
|
|
1244
1721
|
exports.ShellContext = ShellContext;
|
|
1245
1722
|
exports.SignInFrame = SignInFrame;
|
|
1246
1723
|
exports.SiteBanner = SiteBanner;
|
|
@@ -1248,6 +1725,7 @@ exports.SiteFooter = SiteFooter;
|
|
|
1248
1725
|
exports.SiteHeader = SiteHeader;
|
|
1249
1726
|
exports.SkipLink = SkipLink;
|
|
1250
1727
|
exports.ThemeToggle = ThemeToggle;
|
|
1728
|
+
exports.ToolShell = ToolShell;
|
|
1251
1729
|
exports.useShellPlace = useShellPlace;
|
|
1252
1730
|
//# sourceMappingURL=chrome.js.map
|
|
1253
1731
|
//# sourceMappingURL=chrome.js.map
|