@orangecheck/app-design 1.4.0 → 1.5.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 +5 -4
- package/dist/chrome.d.ts +5 -4
- package/dist/chrome.js +171 -40
- package/dist/chrome.js.map +1 -1
- package/dist/chrome.mjs +172 -41
- package/dist/chrome.mjs.map +1 -1
- package/dist/components.d.mts +46 -9
- package/dist/components.d.ts +46 -9
- package/dist/components.js +334 -167
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +333 -170
- package/dist/components.mjs.map +1 -1
- package/dist/{docs-BB9gK4KF.d.ts → docs-ByUx4t-D.d.ts} +2 -1
- package/dist/{docs-D-T-nHiu.d.mts → docs-CFE5mU_6.d.mts} +2 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +572 -244
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +570 -246
- package/dist/index.mjs.map +1 -1
- package/dist/mdx.d.mts +1 -1
- package/dist/mdx.d.ts +1 -1
- package/dist/mdx.js +7 -2
- package/dist/mdx.js.map +1 -1
- package/dist/mdx.mjs +7 -2
- package/dist/mdx.mjs.map +1 -1
- package/dist/primitives.d.mts +4 -3
- package/dist/primitives.d.ts +4 -3
- package/dist/primitives.js +37 -1
- package/dist/primitives.js.map +1 -1
- package/dist/primitives.mjs +37 -1
- package/dist/primitives.mjs.map +1 -1
- package/dist/session.d.mts +3 -3
- package/dist/session.d.ts +3 -3
- package/dist/session.js +1 -1
- package/dist/session.js.map +1 -1
- package/dist/session.mjs +1 -1
- package/dist/session.mjs.map +1 -1
- package/dist/{tool-shell-D8Q8XX11.d.mts → tool-shell-CQZNRUgH.d.mts} +8 -4
- package/dist/{tool-shell-gmlj47Ie.d.ts → tool-shell-CRmceGrV.d.ts} +8 -4
- package/dist/{tools-DFIxIj5p.d.mts → tools-Bg1gi2HO.d.mts} +1 -1
- package/dist/{tools-BggNN5DV.d.ts → tools-Bw7RhO92.d.ts} +1 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { forwardRef, useContext, createContext, useRef, useState, useCallback, u
|
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
6
6
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
7
|
+
import { useTheme } from 'next-themes';
|
|
7
8
|
import { Toaster as Toaster$1 } from 'sonner';
|
|
8
9
|
export { toast } from 'sonner';
|
|
9
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -12,7 +13,7 @@ import * as LabelPrimitive from '@radix-ui/react-label';
|
|
|
12
13
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
13
14
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
14
15
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
15
|
-
import { ChevronDown, Check, X, Search, ArrowUpRight, ArrowRight, Copy, ChevronLeft, ChevronRight, CornerDownLeft, Download, FileText, Upload, Menu, Sun, Moon, SunMoon, PanelLeft, CircleUser, LogOut, ArrowLeft,
|
|
16
|
+
import { ChevronDown, Check, X, Search, ArrowUpRight, ArrowRight, Copy, ChevronLeft, ChevronRight, Lock, CornerDownLeft, Download, FileText, Upload, Menu, Sun, Moon, SunMoon, PanelLeft, CircleUser, LogOut, ArrowLeft, CircleDashed, CircleMinus, CircleSlash, Clock, CircleX, CircleCheck, Ellipsis } from 'lucide-react';
|
|
16
17
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
17
18
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
18
19
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
@@ -21,7 +22,6 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
|
21
22
|
import QRCode from 'qrcode';
|
|
22
23
|
import Link6 from 'next/link';
|
|
23
24
|
import { useRouter } from 'next/compat/router';
|
|
24
|
-
import { useTheme } from 'next-themes';
|
|
25
25
|
|
|
26
26
|
// src/tokens/index.ts
|
|
27
27
|
var APP_ATTRIBUTE = "data-oc-app";
|
|
@@ -173,10 +173,18 @@ function StatusDot({
|
|
|
173
173
|
}
|
|
174
174
|
);
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
var TOAST_COLOURS = {
|
|
177
|
+
"--normal-bg": "var(--popover)",
|
|
178
|
+
"--normal-text": "var(--popover-foreground)",
|
|
179
|
+
"--normal-border": "var(--border)"
|
|
180
|
+
};
|
|
181
|
+
function Toaster({ style, ...props }) {
|
|
182
|
+
const { resolvedTheme } = useTheme();
|
|
177
183
|
return /* @__PURE__ */ jsx(
|
|
178
184
|
Toaster$1,
|
|
179
185
|
{
|
|
186
|
+
theme: resolvedTheme === "dark" ? "dark" : resolvedTheme === "light" ? "light" : "system",
|
|
187
|
+
style: { ...TOAST_COLOURS, ...style },
|
|
180
188
|
position: "bottom-right",
|
|
181
189
|
toastOptions: {
|
|
182
190
|
classNames: {
|
|
@@ -923,7 +931,9 @@ var none = () => null;
|
|
|
923
931
|
function PromptBody({ ask: a }) {
|
|
924
932
|
const o = a.options;
|
|
925
933
|
const [value, setValue] = useState(o.defaultValue ?? "");
|
|
934
|
+
const [again, setAgain] = useState("");
|
|
926
935
|
const [error, setError] = useState(null);
|
|
936
|
+
const [mismatch, setMismatch] = useState(false);
|
|
927
937
|
const submit = (e) => {
|
|
928
938
|
e.preventDefault();
|
|
929
939
|
if (o.minLength && value.length < o.minLength) {
|
|
@@ -935,6 +945,10 @@ function PromptBody({ ask: a }) {
|
|
|
935
945
|
setError(refused);
|
|
936
946
|
return;
|
|
937
947
|
}
|
|
948
|
+
if (o.confirmField && again !== value) {
|
|
949
|
+
setMismatch(true);
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
938
952
|
a.settle(value);
|
|
939
953
|
done();
|
|
940
954
|
};
|
|
@@ -950,9 +964,30 @@ function PromptBody({ ask: a }) {
|
|
|
950
964
|
onChange: (e) => {
|
|
951
965
|
setValue(e.target.value);
|
|
952
966
|
setError(null);
|
|
967
|
+
setMismatch(false);
|
|
953
968
|
}
|
|
954
969
|
}
|
|
955
970
|
) }),
|
|
971
|
+
o.confirmField ? /* @__PURE__ */ jsx(
|
|
972
|
+
Field,
|
|
973
|
+
{
|
|
974
|
+
label: o.confirmField === true ? "Type it again" : o.confirmField,
|
|
975
|
+
error: mismatch ? "The two do not match." : null,
|
|
976
|
+
className: "mt-4",
|
|
977
|
+
children: /* @__PURE__ */ jsx(
|
|
978
|
+
Input,
|
|
979
|
+
{
|
|
980
|
+
type: o.secret ? "password" : "text",
|
|
981
|
+
autoComplete: o.secret ? "new-password" : "off",
|
|
982
|
+
value: again,
|
|
983
|
+
onChange: (e) => {
|
|
984
|
+
setAgain(e.target.value);
|
|
985
|
+
setMismatch(false);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
)
|
|
989
|
+
}
|
|
990
|
+
) : null,
|
|
956
991
|
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
957
992
|
/* @__PURE__ */ jsx(
|
|
958
993
|
Button,
|
|
@@ -1993,7 +2028,7 @@ var JS_TAG = /<\/?(?=[A-Za-z])/y;
|
|
|
1993
2028
|
var JS_TAG_NAME = /[A-Za-z][\w$.:-]*/y;
|
|
1994
2029
|
var JS_PUNCT = /=>|\.\.\.|[{}()[\];,.<>=+\-*/%!?:&|^~#]/y;
|
|
1995
2030
|
var JSX_BEFORE = /* @__PURE__ */ new Set(["(", ",", "=", "?", ":", "{", "[", ";", ">", "&&", "||", "=>", "return"]);
|
|
1996
|
-
function scanJs(src, emit2,
|
|
2031
|
+
function scanJs(src, emit2, jsx51) {
|
|
1997
2032
|
let i = 0;
|
|
1998
2033
|
let prev = "";
|
|
1999
2034
|
let tagDepth = 0;
|
|
@@ -2019,7 +2054,7 @@ function scanJs(src, emit2, jsx50) {
|
|
|
2019
2054
|
sig('"');
|
|
2020
2055
|
continue;
|
|
2021
2056
|
}
|
|
2022
|
-
if (
|
|
2057
|
+
if (jsx51 && tagDepth === 0 && (m = at(JS_TAG, src, i)) && (prev === "" || JSX_BEFORE.has(prev))) {
|
|
2023
2058
|
const name = at(JS_TAG_NAME, src, i + m.length);
|
|
2024
2059
|
if (name) {
|
|
2025
2060
|
emit2(m);
|
|
@@ -2031,7 +2066,7 @@ function scanJs(src, emit2, jsx50) {
|
|
|
2031
2066
|
continue;
|
|
2032
2067
|
}
|
|
2033
2068
|
}
|
|
2034
|
-
if (
|
|
2069
|
+
if (jsx51 && tagDepth > 0 && braceInTag === 0) {
|
|
2035
2070
|
if (src.startsWith("/>", i) || src[i] === ">") {
|
|
2036
2071
|
const close = src[i] === ">" ? ">" : "/>";
|
|
2037
2072
|
emit2(close);
|
|
@@ -2051,7 +2086,7 @@ function scanJs(src, emit2, jsx50) {
|
|
|
2051
2086
|
continue;
|
|
2052
2087
|
}
|
|
2053
2088
|
if (src[i] === "{") braceInTag = 1;
|
|
2054
|
-
} else if (
|
|
2089
|
+
} else if (jsx51 && tagDepth > 0 && braceInTag > 0) {
|
|
2055
2090
|
if (src[i] === "{") braceInTag++;
|
|
2056
2091
|
else if (src[i] === "}") braceInTag--;
|
|
2057
2092
|
}
|
|
@@ -3000,7 +3035,8 @@ function Well({
|
|
|
3000
3035
|
lines,
|
|
3001
3036
|
maxLines,
|
|
3002
3037
|
diff,
|
|
3003
|
-
lineNumbers
|
|
3038
|
+
lineNumbers,
|
|
3039
|
+
wrap
|
|
3004
3040
|
}) {
|
|
3005
3041
|
const foldable = maxLines !== void 0 && lines > maxLines + 2;
|
|
3006
3042
|
const [open, setOpen] = useState(false);
|
|
@@ -3019,7 +3055,8 @@ function Well({
|
|
|
3019
3055
|
"data-diff": diff ? "" : void 0,
|
|
3020
3056
|
"data-line-numbers": lineNumbers ? "" : void 0,
|
|
3021
3057
|
className: cn(
|
|
3022
|
-
"oca-code
|
|
3058
|
+
"oca-code py-4 font-mono text-[0.875rem] leading-[1.625] text-oca-ink-muted [font-variant-ligatures:none]",
|
|
3059
|
+
wrap ? "whitespace-pre-wrap break-all" : "w-max min-w-full",
|
|
3023
3060
|
!lined && "px-5"
|
|
3024
3061
|
),
|
|
3025
3062
|
children: lined ? /* @__PURE__ */ jsx("code", { className: "block", "data-lang": lang, dangerouslySetInnerHTML: { __html: html } }) : /* @__PURE__ */ jsx("code", { className: "block", "data-lang": lang, children })
|
|
@@ -3061,6 +3098,7 @@ function CodeBlock({
|
|
|
3061
3098
|
highlight: marks,
|
|
3062
3099
|
diff,
|
|
3063
3100
|
lineNumbers,
|
|
3101
|
+
wrap,
|
|
3064
3102
|
actions,
|
|
3065
3103
|
className
|
|
3066
3104
|
}) {
|
|
@@ -3092,6 +3130,7 @@ function CodeBlock({
|
|
|
3092
3130
|
maxLines,
|
|
3093
3131
|
diff: prepared ? prepared.diff : isDiff,
|
|
3094
3132
|
lineNumbers,
|
|
3133
|
+
wrap,
|
|
3095
3134
|
children
|
|
3096
3135
|
}
|
|
3097
3136
|
)
|
|
@@ -3556,6 +3595,169 @@ var ErrorBoundary = class extends Component {
|
|
|
3556
3595
|
) });
|
|
3557
3596
|
}
|
|
3558
3597
|
};
|
|
3598
|
+
|
|
3599
|
+
// src/family/index.ts
|
|
3600
|
+
var OCHK_IO = "https://ochk.io";
|
|
3601
|
+
var DOCS_HREF = `${OCHK_IO}/docs`;
|
|
3602
|
+
function protocol(slug, verb, line, kinds) {
|
|
3603
|
+
return {
|
|
3604
|
+
slug,
|
|
3605
|
+
label: slug,
|
|
3606
|
+
href: `${OCHK_IO}/${slug}`,
|
|
3607
|
+
group: "protocol",
|
|
3608
|
+
line,
|
|
3609
|
+
status: "live",
|
|
3610
|
+
verb,
|
|
3611
|
+
pageHref: `${OCHK_IO}/${slug}`,
|
|
3612
|
+
toolHref: `https://${slug}.ochk.io`,
|
|
3613
|
+
specHref: `https://github.com/orangecheck/oc-${slug}-protocol`,
|
|
3614
|
+
kinds
|
|
3615
|
+
};
|
|
3616
|
+
}
|
|
3617
|
+
var PROTOCOLS = [
|
|
3618
|
+
protocol("attest", "identity", "Show that an address holds bitcoin, and for how long.", "30078"),
|
|
3619
|
+
protocol("lock", "confidentiality", "Encrypt to a Bitcoin address, so only its holder can open it.", "30078"),
|
|
3620
|
+
protocol("vote", "legitimacy", "Polls weighed in sats, that anyone can tally.", "30080\u201330082"),
|
|
3621
|
+
protocol("stamp", "provenance", "Prove who signed something, and when.", "30083"),
|
|
3622
|
+
protocol("agent", "authority", "Give software scoped, revocable permission to act for you.", "30083\u201330086"),
|
|
3623
|
+
protocol("pledge", "commitment", "Make a promise with bitcoin behind it, on a public record.", "30078")
|
|
3624
|
+
];
|
|
3625
|
+
var PROTOCOL_ORDER = PROTOCOLS.map((p) => p.slug);
|
|
3626
|
+
var FAMILY = [
|
|
3627
|
+
{
|
|
3628
|
+
slug: "home",
|
|
3629
|
+
label: "ochk.io",
|
|
3630
|
+
href: OCHK_IO,
|
|
3631
|
+
group: "orangecheck",
|
|
3632
|
+
line: "The open protocols, and the company behind them.",
|
|
3633
|
+
status: "live"
|
|
3634
|
+
},
|
|
3635
|
+
{
|
|
3636
|
+
slug: "me",
|
|
3637
|
+
label: "ochk.app",
|
|
3638
|
+
href: "https://ochk.app",
|
|
3639
|
+
group: "orangecheck",
|
|
3640
|
+
line: "One account, with Bitcoin behind it.",
|
|
3641
|
+
status: "testing"
|
|
3642
|
+
},
|
|
3643
|
+
{
|
|
3644
|
+
slug: "docs",
|
|
3645
|
+
label: "docs",
|
|
3646
|
+
href: DOCS_HREF,
|
|
3647
|
+
group: "orangecheck",
|
|
3648
|
+
line: "Specs, SDKs and guides for every protocol.",
|
|
3649
|
+
status: "live"
|
|
3650
|
+
},
|
|
3651
|
+
...PROTOCOLS,
|
|
3652
|
+
{
|
|
3653
|
+
slug: "vault",
|
|
3654
|
+
label: "vault",
|
|
3655
|
+
href: "https://vault.ochk.io",
|
|
3656
|
+
group: "app",
|
|
3657
|
+
line: "A password manager, encrypted in your browser.",
|
|
3658
|
+
status: "live",
|
|
3659
|
+
protocols: ["lock"]
|
|
3660
|
+
},
|
|
3661
|
+
{
|
|
3662
|
+
slug: "chat",
|
|
3663
|
+
label: "chat",
|
|
3664
|
+
href: "https://chat.ochk.io",
|
|
3665
|
+
group: "app",
|
|
3666
|
+
line: "Messages only the holder of a Bitcoin address can read.",
|
|
3667
|
+
status: "testing",
|
|
3668
|
+
protocols: ["lock"]
|
|
3669
|
+
},
|
|
3670
|
+
{
|
|
3671
|
+
slug: "cosign",
|
|
3672
|
+
label: "cosign",
|
|
3673
|
+
href: "https://cosign.ochk.io",
|
|
3674
|
+
group: "app",
|
|
3675
|
+
line: "Builders find co-founders and backers.",
|
|
3676
|
+
status: "testing",
|
|
3677
|
+
// Signs in with an orangecheck account and a wallet; uses none of the six directly.
|
|
3678
|
+
protocols: []
|
|
3679
|
+
},
|
|
3680
|
+
{
|
|
3681
|
+
slug: "me-demo",
|
|
3682
|
+
// "demo", not the made-up app's own name, so nobody takes it for ours.
|
|
3683
|
+
label: "demo",
|
|
3684
|
+
href: "https://me-demo.ochk.io",
|
|
3685
|
+
group: "app",
|
|
3686
|
+
line: "Lumen Notes, a made-up app that signs in with orangecheck.",
|
|
3687
|
+
status: "live"
|
|
3688
|
+
},
|
|
3689
|
+
{
|
|
3690
|
+
slug: "globe",
|
|
3691
|
+
label: "globe",
|
|
3692
|
+
href: "https://globe.ochk.io",
|
|
3693
|
+
group: "public-good",
|
|
3694
|
+
line: "The Bitcoin network, live, on a globe.",
|
|
3695
|
+
status: "live"
|
|
3696
|
+
},
|
|
3697
|
+
{
|
|
3698
|
+
slug: "btc",
|
|
3699
|
+
label: "btc",
|
|
3700
|
+
href: "https://btc.ochk.io",
|
|
3701
|
+
group: "public-good",
|
|
3702
|
+
line: "A free desk for reading the Bitcoin market.",
|
|
3703
|
+
status: "live"
|
|
3704
|
+
}
|
|
3705
|
+
];
|
|
3706
|
+
var FAMILY_GROUPS = [
|
|
3707
|
+
{ id: "orangecheck", label: "orangecheck" },
|
|
3708
|
+
{ id: "protocol", label: "Protocols" },
|
|
3709
|
+
{ id: "app", label: "Apps" },
|
|
3710
|
+
{ id: "public-good", label: "Public goods" }
|
|
3711
|
+
];
|
|
3712
|
+
var BY_SLUG = new Map(FAMILY.map((s) => [s.slug, s]));
|
|
3713
|
+
function familySite(slug) {
|
|
3714
|
+
return BY_SLUG.get(slug);
|
|
3715
|
+
}
|
|
3716
|
+
function protocolSite(slug) {
|
|
3717
|
+
return BY_SLUG.get(slug);
|
|
3718
|
+
}
|
|
3719
|
+
function familyByGroup() {
|
|
3720
|
+
return FAMILY_GROUPS.map((g) => ({ ...g, sites: FAMILY.filter((s) => s.group === g.id) }));
|
|
3721
|
+
}
|
|
3722
|
+
var LEGAL_LINKS = [
|
|
3723
|
+
{ href: `${OCHK_IO}/privacy`, label: "Privacy" },
|
|
3724
|
+
{ href: `${OCHK_IO}/terms`, label: "Terms" },
|
|
3725
|
+
{ href: `${OCHK_IO}/security`, label: "Security" },
|
|
3726
|
+
{ href: `${OCHK_IO}/trademark`, label: "Trademarks" },
|
|
3727
|
+
{ href: `${OCHK_IO}/contact`, label: "Contact" }
|
|
3728
|
+
];
|
|
3729
|
+
var SELF_HOSTED_LEGAL_LINKS = [
|
|
3730
|
+
{ href: "/privacy", label: "Privacy" },
|
|
3731
|
+
{ href: "/terms", label: "Terms" },
|
|
3732
|
+
{ href: "/security", label: "Security" },
|
|
3733
|
+
{ href: `${OCHK_IO}/trademark`, label: "Trademarks" },
|
|
3734
|
+
{ href: "/contact", label: "Contact" }
|
|
3735
|
+
];
|
|
3736
|
+
var OCHK_IO_NAV = [
|
|
3737
|
+
{
|
|
3738
|
+
href: `${OCHK_IO}/protocols`,
|
|
3739
|
+
label: "Protocols",
|
|
3740
|
+
children: PROTOCOLS.map((p) => ({ href: p.pageHref, label: p.label, description: p.line }))
|
|
3741
|
+
},
|
|
3742
|
+
{ href: `${OCHK_IO}/apps`, label: "Apps" },
|
|
3743
|
+
{ href: DOCS_HREF, label: "Docs" },
|
|
3744
|
+
{ href: `${OCHK_IO}/trust`, label: "Trust" },
|
|
3745
|
+
{ href: `${OCHK_IO}/about`, label: "About" }
|
|
3746
|
+
];
|
|
3747
|
+
var OCHK_IO_FOOTER = [
|
|
3748
|
+
{
|
|
3749
|
+
heading: "Company",
|
|
3750
|
+
links: [
|
|
3751
|
+
{ href: `${OCHK_IO}/about`, label: "About" },
|
|
3752
|
+
{ href: `${OCHK_IO}/trust`, label: "Trust" },
|
|
3753
|
+
{ href: "https://github.com/orangecheck", label: "GitHub", external: true }
|
|
3754
|
+
]
|
|
3755
|
+
}
|
|
3756
|
+
];
|
|
3757
|
+
var SiteHomeContext = sharedContext("site-home", void 0);
|
|
3758
|
+
function useSiteHome() {
|
|
3759
|
+
return useContext(SiteHomeContext);
|
|
3760
|
+
}
|
|
3559
3761
|
var WORDS = {
|
|
3560
3762
|
404: {
|
|
3561
3763
|
name: "Not found",
|
|
@@ -3573,10 +3775,13 @@ function ErrorPage({
|
|
|
3573
3775
|
title,
|
|
3574
3776
|
detail,
|
|
3575
3777
|
actions,
|
|
3576
|
-
home
|
|
3778
|
+
home,
|
|
3779
|
+
protocol: protocol2,
|
|
3577
3780
|
art,
|
|
3578
3781
|
className
|
|
3579
3782
|
}) {
|
|
3783
|
+
const shellHome = useSiteHome();
|
|
3784
|
+
const homeHref = home ?? (protocol2 ? protocolSite(protocol2).pageHref : shellHome ?? OCHK_IO);
|
|
3580
3785
|
const words = WORDS[code] ?? (code >= 500 ? WORDS[500] : WORDS[404]);
|
|
3581
3786
|
const server = code >= 500;
|
|
3582
3787
|
return /* @__PURE__ */ jsx(Section, { space: "none", className: cn("flex min-h-[min(40rem,72dvh)] items-center py-16 md:py-24", className), children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 items-center gap-12 md:grid-cols-12", children: [
|
|
@@ -3590,12 +3795,137 @@ function ErrorPage({
|
|
|
3590
3795
|
/* @__PURE__ */ jsx("p", { className: "oca-lead oca-enter [--enter-delay:150ms]", children: detail ?? words.detail }),
|
|
3591
3796
|
/* @__PURE__ */ jsx("div", { className: "oca-enter flex flex-wrap gap-3 [--enter-delay:230ms]", children: actions ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3592
3797
|
server ? /* @__PURE__ */ jsx(Button, { onClick: () => window.location.reload(), children: "Try again" }) : null,
|
|
3593
|
-
/* @__PURE__ */ jsx(Button, { asChild: true, variant: server ? "secondary" : "primary", children: /* @__PURE__ */ jsx(Link6, { href:
|
|
3798
|
+
/* @__PURE__ */ jsx(Button, { asChild: true, variant: server ? "secondary" : "primary", children: /* @__PURE__ */ jsx(Link6, { href: homeHref, children: "Go home" }) })
|
|
3594
3799
|
] }) })
|
|
3595
3800
|
] }),
|
|
3596
3801
|
art !== null ? /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "oca-enter hidden justify-center md:col-span-5 md:flex [--enter-delay:120ms]", children: art ?? /* @__PURE__ */ jsx(MarkOutline, { className: "w-full max-w-[20rem] text-oca-hairline-strong" }) }) : null
|
|
3597
3802
|
] }) });
|
|
3598
3803
|
}
|
|
3804
|
+
function onSecond(tick) {
|
|
3805
|
+
const id = setInterval(tick, 1e3);
|
|
3806
|
+
return () => clearInterval(id);
|
|
3807
|
+
}
|
|
3808
|
+
var nowSeconds = () => Math.floor(Date.now() / 1e3);
|
|
3809
|
+
function CountdownRing({
|
|
3810
|
+
period,
|
|
3811
|
+
remaining,
|
|
3812
|
+
warnAt = 5,
|
|
3813
|
+
size = 18,
|
|
3814
|
+
showSeconds = true,
|
|
3815
|
+
className
|
|
3816
|
+
}) {
|
|
3817
|
+
const now = useSyncExternalStore(onSecond, nowSeconds, () => null);
|
|
3818
|
+
const left = remaining ?? (now === null ? null : period - now % period);
|
|
3819
|
+
const share = left === null ? 1 : Math.max(0, Math.min(1, left / period));
|
|
3820
|
+
const warn = left !== null && left <= warnAt;
|
|
3821
|
+
const r = size / 2 - 1.5;
|
|
3822
|
+
const c = 2 * Math.PI * r;
|
|
3823
|
+
return /* @__PURE__ */ jsxs(
|
|
3824
|
+
"span",
|
|
3825
|
+
{
|
|
3826
|
+
role: "timer",
|
|
3827
|
+
"aria-label": left === null ? void 0 : `${left} second${left === 1 ? "" : "s"} left`,
|
|
3828
|
+
className: cn("inline-flex items-center gap-1.5", warn ? "text-destructive" : "text-muted-foreground", className),
|
|
3829
|
+
children: [
|
|
3830
|
+
/* @__PURE__ */ jsxs("svg", { "aria-hidden": true, width: size, height: size, viewBox: `0 0 ${size} ${size}`, className: "-rotate-90", children: [
|
|
3831
|
+
/* @__PURE__ */ jsx("circle", { cx: size / 2, cy: size / 2, r, fill: "none", stroke: "var(--border)", strokeWidth: 2 }),
|
|
3832
|
+
/* @__PURE__ */ jsx(
|
|
3833
|
+
"circle",
|
|
3834
|
+
{
|
|
3835
|
+
cx: size / 2,
|
|
3836
|
+
cy: size / 2,
|
|
3837
|
+
r,
|
|
3838
|
+
fill: "none",
|
|
3839
|
+
stroke: "currentColor",
|
|
3840
|
+
strokeWidth: 2,
|
|
3841
|
+
strokeLinecap: "round",
|
|
3842
|
+
strokeDasharray: c,
|
|
3843
|
+
strokeDashoffset: c * (1 - share),
|
|
3844
|
+
className: cn(left !== null && left < period && "transition-[stroke-dashoffset] duration-1000 ease-linear motion-reduce:transition-none")
|
|
3845
|
+
}
|
|
3846
|
+
)
|
|
3847
|
+
] }),
|
|
3848
|
+
showSeconds && left !== null ? /* @__PURE__ */ jsxs("span", { className: "text-[0.8125rem] oca-tabular", children: [
|
|
3849
|
+
left,
|
|
3850
|
+
"s"
|
|
3851
|
+
] }) : null
|
|
3852
|
+
]
|
|
3853
|
+
}
|
|
3854
|
+
);
|
|
3855
|
+
}
|
|
3856
|
+
function PlanCard({
|
|
3857
|
+
name,
|
|
3858
|
+
subtitle,
|
|
3859
|
+
price,
|
|
3860
|
+
period,
|
|
3861
|
+
footnote,
|
|
3862
|
+
features = [],
|
|
3863
|
+
action,
|
|
3864
|
+
badge,
|
|
3865
|
+
badgeTone = "neutral",
|
|
3866
|
+
highlight: highlight2 = false,
|
|
3867
|
+
className
|
|
3868
|
+
}) {
|
|
3869
|
+
return /* @__PURE__ */ jsxs(
|
|
3870
|
+
"section",
|
|
3871
|
+
{
|
|
3872
|
+
className: cn(
|
|
3873
|
+
"flex h-full flex-col gap-5 rounded-[1.25rem] border bg-card p-6",
|
|
3874
|
+
highlight2 ? "border-foreground shadow-sm ring-1 ring-foreground" : "border-border",
|
|
3875
|
+
className
|
|
3876
|
+
),
|
|
3877
|
+
children: [
|
|
3878
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
3879
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
3880
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[1.0625rem] font-medium leading-snug", children: name }),
|
|
3881
|
+
badge ? /* @__PURE__ */ jsx(Badge, { tone: badgeTone, children: badge }) : null
|
|
3882
|
+
] }),
|
|
3883
|
+
subtitle ? /* @__PURE__ */ jsx("p", { className: "text-[0.875rem] leading-snug text-muted-foreground", children: subtitle }) : null
|
|
3884
|
+
] }),
|
|
3885
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
3886
|
+
/* @__PURE__ */ jsxs("p", { className: "flex flex-wrap items-baseline gap-x-1.5", children: [
|
|
3887
|
+
/* @__PURE__ */ jsx("span", { className: "oca-display-3 oca-tabular", children: price }),
|
|
3888
|
+
period ? /* @__PURE__ */ jsx("span", { className: "text-[0.9375rem] text-muted-foreground", children: period }) : null
|
|
3889
|
+
] }),
|
|
3890
|
+
footnote ? /* @__PURE__ */ jsx("p", { className: "text-[0.8125rem] text-muted-foreground", children: footnote }) : null
|
|
3891
|
+
] }),
|
|
3892
|
+
features.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-2.5 text-[0.9375rem]", children: features.map((f, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2.5", children: [
|
|
3893
|
+
/* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: "mt-1 size-4 shrink-0 text-muted-foreground" }),
|
|
3894
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0", children: f })
|
|
3895
|
+
] }, i)) }) : null,
|
|
3896
|
+
action ? /* @__PURE__ */ jsx("div", { className: "mt-auto flex flex-col pt-1 [&>*]:w-full", children: action }) : null
|
|
3897
|
+
]
|
|
3898
|
+
}
|
|
3899
|
+
);
|
|
3900
|
+
}
|
|
3901
|
+
function LockedPreview({
|
|
3902
|
+
title,
|
|
3903
|
+
description,
|
|
3904
|
+
action,
|
|
3905
|
+
children,
|
|
3906
|
+
className
|
|
3907
|
+
}) {
|
|
3908
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
3909
|
+
children ? /* @__PURE__ */ jsx(
|
|
3910
|
+
"div",
|
|
3911
|
+
{
|
|
3912
|
+
inert: true,
|
|
3913
|
+
"aria-hidden": true,
|
|
3914
|
+
"data-oca-locked": "",
|
|
3915
|
+
className: "pointer-events-none max-h-[28rem] select-none overflow-hidden [mask-image:linear-gradient(to_bottom,#000_25%,transparent_85%)]",
|
|
3916
|
+
children
|
|
3917
|
+
}
|
|
3918
|
+
) : null,
|
|
3919
|
+
/* @__PURE__ */ jsxs("div", { className: cn("relative mx-auto flex max-w-md flex-col items-center gap-4 rounded-[1.25rem] border border-border bg-card px-6 py-7 text-center shadow-sm", children && "-mt-40"), children: [
|
|
3920
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "flex size-10 items-center justify-center rounded-full bg-muted text-foreground", children: /* @__PURE__ */ jsx(Lock, { className: "size-[1.125rem]" }) }),
|
|
3921
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
3922
|
+
/* @__PURE__ */ jsx("p", { className: "text-[1.0625rem] font-medium leading-snug", children: title }),
|
|
3923
|
+
description ? /* @__PURE__ */ jsx("p", { className: "text-[0.9375rem] leading-snug text-muted-foreground", children: description }) : null
|
|
3924
|
+
] }),
|
|
3925
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap justify-center gap-2", children: action })
|
|
3926
|
+
] })
|
|
3927
|
+
] });
|
|
3928
|
+
}
|
|
3599
3929
|
function SectionHeading({
|
|
3600
3930
|
eyebrow,
|
|
3601
3931
|
title,
|
|
@@ -3836,165 +4166,6 @@ function LegalDocument({ doc, className }) {
|
|
|
3836
4166
|
}
|
|
3837
4167
|
);
|
|
3838
4168
|
}
|
|
3839
|
-
|
|
3840
|
-
// src/family/index.ts
|
|
3841
|
-
var OCHK_IO = "https://ochk.io";
|
|
3842
|
-
var DOCS_HREF = `${OCHK_IO}/docs`;
|
|
3843
|
-
function protocol(slug, verb, line, kinds) {
|
|
3844
|
-
return {
|
|
3845
|
-
slug,
|
|
3846
|
-
label: slug,
|
|
3847
|
-
href: `${OCHK_IO}/${slug}`,
|
|
3848
|
-
group: "protocol",
|
|
3849
|
-
line,
|
|
3850
|
-
status: "live",
|
|
3851
|
-
verb,
|
|
3852
|
-
pageHref: `${OCHK_IO}/${slug}`,
|
|
3853
|
-
toolHref: `https://${slug}.ochk.io`,
|
|
3854
|
-
specHref: `https://github.com/orangecheck/oc-${slug}-protocol`,
|
|
3855
|
-
kinds
|
|
3856
|
-
};
|
|
3857
|
-
}
|
|
3858
|
-
var PROTOCOLS = [
|
|
3859
|
-
protocol("attest", "identity", "Show that an address holds bitcoin, and for how long.", "30078"),
|
|
3860
|
-
protocol("lock", "confidentiality", "Encrypt to a Bitcoin address, so only its holder can open it.", "30078"),
|
|
3861
|
-
protocol("vote", "legitimacy", "Polls weighed in sats, that anyone can tally.", "30080\u201330082"),
|
|
3862
|
-
protocol("stamp", "provenance", "Prove who signed something, and when.", "30083"),
|
|
3863
|
-
protocol("agent", "authority", "Give software scoped, revocable permission to act for you.", "30083\u201330086"),
|
|
3864
|
-
protocol("pledge", "commitment", "Make a promise with bitcoin behind it, on a public record.", "30078")
|
|
3865
|
-
];
|
|
3866
|
-
var PROTOCOL_ORDER = PROTOCOLS.map((p) => p.slug);
|
|
3867
|
-
var FAMILY = [
|
|
3868
|
-
{
|
|
3869
|
-
slug: "home",
|
|
3870
|
-
label: "ochk.io",
|
|
3871
|
-
href: OCHK_IO,
|
|
3872
|
-
group: "orangecheck",
|
|
3873
|
-
line: "The open protocols, and the company behind them.",
|
|
3874
|
-
status: "live"
|
|
3875
|
-
},
|
|
3876
|
-
{
|
|
3877
|
-
slug: "me",
|
|
3878
|
-
label: "ochk.app",
|
|
3879
|
-
href: "https://ochk.app",
|
|
3880
|
-
group: "orangecheck",
|
|
3881
|
-
line: "One account, with Bitcoin behind it.",
|
|
3882
|
-
status: "testing"
|
|
3883
|
-
},
|
|
3884
|
-
{
|
|
3885
|
-
slug: "docs",
|
|
3886
|
-
label: "docs",
|
|
3887
|
-
href: DOCS_HREF,
|
|
3888
|
-
group: "orangecheck",
|
|
3889
|
-
line: "Specs, SDKs and guides for every protocol.",
|
|
3890
|
-
status: "live"
|
|
3891
|
-
},
|
|
3892
|
-
...PROTOCOLS,
|
|
3893
|
-
{
|
|
3894
|
-
slug: "vault",
|
|
3895
|
-
label: "vault",
|
|
3896
|
-
href: "https://vault.ochk.io",
|
|
3897
|
-
group: "app",
|
|
3898
|
-
line: "A password manager, encrypted in your browser.",
|
|
3899
|
-
status: "live",
|
|
3900
|
-
protocols: ["lock"]
|
|
3901
|
-
},
|
|
3902
|
-
{
|
|
3903
|
-
slug: "chat",
|
|
3904
|
-
label: "chat",
|
|
3905
|
-
href: "https://chat.ochk.io",
|
|
3906
|
-
group: "app",
|
|
3907
|
-
line: "Messages only the holder of a Bitcoin address can read.",
|
|
3908
|
-
status: "testing",
|
|
3909
|
-
protocols: ["lock"]
|
|
3910
|
-
},
|
|
3911
|
-
{
|
|
3912
|
-
slug: "cosign",
|
|
3913
|
-
label: "cosign",
|
|
3914
|
-
href: "https://cosign.ochk.io",
|
|
3915
|
-
group: "app",
|
|
3916
|
-
line: "Builders find co-founders and backers.",
|
|
3917
|
-
status: "testing",
|
|
3918
|
-
// Signs in with an orangecheck account and a wallet; uses none of the six directly.
|
|
3919
|
-
protocols: []
|
|
3920
|
-
},
|
|
3921
|
-
{
|
|
3922
|
-
slug: "me-demo",
|
|
3923
|
-
// "demo", not the made-up app's own name, so nobody takes it for ours.
|
|
3924
|
-
label: "demo",
|
|
3925
|
-
href: "https://me-demo.ochk.io",
|
|
3926
|
-
group: "app",
|
|
3927
|
-
line: "Lumen Notes, a made-up app that signs in with orangecheck.",
|
|
3928
|
-
status: "live"
|
|
3929
|
-
},
|
|
3930
|
-
{
|
|
3931
|
-
slug: "globe",
|
|
3932
|
-
label: "globe",
|
|
3933
|
-
href: "https://globe.ochk.io",
|
|
3934
|
-
group: "public-good",
|
|
3935
|
-
line: "The Bitcoin network, live, on a globe.",
|
|
3936
|
-
status: "live"
|
|
3937
|
-
},
|
|
3938
|
-
{
|
|
3939
|
-
slug: "btc",
|
|
3940
|
-
label: "btc",
|
|
3941
|
-
href: "https://btc.ochk.io",
|
|
3942
|
-
group: "public-good",
|
|
3943
|
-
line: "A free desk for reading the Bitcoin market.",
|
|
3944
|
-
status: "live"
|
|
3945
|
-
}
|
|
3946
|
-
];
|
|
3947
|
-
var FAMILY_GROUPS = [
|
|
3948
|
-
{ id: "orangecheck", label: "orangecheck" },
|
|
3949
|
-
{ id: "protocol", label: "Protocols" },
|
|
3950
|
-
{ id: "app", label: "Apps" },
|
|
3951
|
-
{ id: "public-good", label: "Public goods" }
|
|
3952
|
-
];
|
|
3953
|
-
var BY_SLUG = new Map(FAMILY.map((s) => [s.slug, s]));
|
|
3954
|
-
function familySite(slug) {
|
|
3955
|
-
return BY_SLUG.get(slug);
|
|
3956
|
-
}
|
|
3957
|
-
function protocolSite(slug) {
|
|
3958
|
-
return BY_SLUG.get(slug);
|
|
3959
|
-
}
|
|
3960
|
-
function familyByGroup() {
|
|
3961
|
-
return FAMILY_GROUPS.map((g) => ({ ...g, sites: FAMILY.filter((s) => s.group === g.id) }));
|
|
3962
|
-
}
|
|
3963
|
-
var LEGAL_LINKS = [
|
|
3964
|
-
{ href: `${OCHK_IO}/privacy`, label: "Privacy" },
|
|
3965
|
-
{ href: `${OCHK_IO}/terms`, label: "Terms" },
|
|
3966
|
-
{ href: `${OCHK_IO}/security`, label: "Security" },
|
|
3967
|
-
{ href: `${OCHK_IO}/trademark`, label: "Trademarks" },
|
|
3968
|
-
{ href: `${OCHK_IO}/contact`, label: "Contact" }
|
|
3969
|
-
];
|
|
3970
|
-
var SELF_HOSTED_LEGAL_LINKS = [
|
|
3971
|
-
{ href: "/privacy", label: "Privacy" },
|
|
3972
|
-
{ href: "/terms", label: "Terms" },
|
|
3973
|
-
{ href: "/security", label: "Security" },
|
|
3974
|
-
{ href: `${OCHK_IO}/trademark`, label: "Trademarks" },
|
|
3975
|
-
{ href: "/contact", label: "Contact" }
|
|
3976
|
-
];
|
|
3977
|
-
var OCHK_IO_NAV = [
|
|
3978
|
-
{
|
|
3979
|
-
href: `${OCHK_IO}/protocols`,
|
|
3980
|
-
label: "Protocols",
|
|
3981
|
-
children: PROTOCOLS.map((p) => ({ href: p.pageHref, label: p.label, description: p.line }))
|
|
3982
|
-
},
|
|
3983
|
-
{ href: `${OCHK_IO}/apps`, label: "Apps" },
|
|
3984
|
-
{ href: DOCS_HREF, label: "Docs" },
|
|
3985
|
-
{ href: `${OCHK_IO}/trust`, label: "Trust" },
|
|
3986
|
-
{ href: `${OCHK_IO}/about`, label: "About" }
|
|
3987
|
-
];
|
|
3988
|
-
var OCHK_IO_FOOTER = [
|
|
3989
|
-
{
|
|
3990
|
-
heading: "Company",
|
|
3991
|
-
links: [
|
|
3992
|
-
{ href: `${OCHK_IO}/about`, label: "About" },
|
|
3993
|
-
{ href: `${OCHK_IO}/trust`, label: "Trust" },
|
|
3994
|
-
{ href: "https://github.com/orangecheck", label: "GitHub", external: true }
|
|
3995
|
-
]
|
|
3996
|
-
}
|
|
3997
|
-
];
|
|
3998
4169
|
var InDocsContext = sharedContext("in-docs", false);
|
|
3999
4170
|
function useInDocs() {
|
|
4000
4171
|
return useContext(InDocsContext);
|
|
@@ -4811,6 +4982,7 @@ function SignMessage({
|
|
|
4811
4982
|
error,
|
|
4812
4983
|
submitLabel = "Confirm",
|
|
4813
4984
|
secondary,
|
|
4985
|
+
scheme = "bip322",
|
|
4814
4986
|
onSignature,
|
|
4815
4987
|
className
|
|
4816
4988
|
}) {
|
|
@@ -4825,7 +4997,7 @@ function SignMessage({
|
|
|
4825
4997
|
/* @__PURE__ */ jsx("span", { className: "h-px flex-1 bg-border" })
|
|
4826
4998
|
] })
|
|
4827
4999
|
] }) : null,
|
|
4828
|
-
/* @__PURE__ */ jsx(CodeBlock, { code: message, caption: "Message to sign" }),
|
|
5000
|
+
/* @__PURE__ */ jsx(CodeBlock, { code: message, caption: "Message to sign", wrap: true }),
|
|
4829
5001
|
/* @__PURE__ */ jsxs(
|
|
4830
5002
|
"form",
|
|
4831
5003
|
{
|
|
@@ -4841,7 +5013,9 @@ function SignMessage({
|
|
|
4841
5013
|
label: "Signature",
|
|
4842
5014
|
error,
|
|
4843
5015
|
hint: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4844
|
-
"From your wallet\u2019s \u201Csign message\u201D (
|
|
5016
|
+
"From your wallet\u2019s \u201Csign message\u201D (",
|
|
5017
|
+
scheme === "legacy" ? "legacy, BIP-137" : "BIP-322",
|
|
5018
|
+
"), signed by",
|
|
4845
5019
|
" ",
|
|
4846
5020
|
/* @__PURE__ */ jsx("span", { className: "break-all font-mono", children: address }),
|
|
4847
5021
|
"."
|
|
@@ -4909,6 +5083,7 @@ function SearchDialog({
|
|
|
4909
5083
|
idle,
|
|
4910
5084
|
defaultQuery = "",
|
|
4911
5085
|
debounceMs = 120,
|
|
5086
|
+
browse = false,
|
|
4912
5087
|
className
|
|
4913
5088
|
}) {
|
|
4914
5089
|
const [own, setOwn] = useState(false);
|
|
@@ -4945,7 +5120,7 @@ function SearchDialog({
|
|
|
4945
5120
|
}, [hotkey]);
|
|
4946
5121
|
useEffect(() => {
|
|
4947
5122
|
const q = query.trim();
|
|
4948
|
-
if (!q) {
|
|
5123
|
+
if (!q && !(browse && open)) {
|
|
4949
5124
|
setGroups([]);
|
|
4950
5125
|
setState("idle");
|
|
4951
5126
|
return;
|
|
@@ -4967,14 +5142,15 @@ function SearchDialog({
|
|
|
4967
5142
|
clearTimeout(t);
|
|
4968
5143
|
ctl.abort();
|
|
4969
5144
|
};
|
|
4970
|
-
}, [query, debounceMs]);
|
|
5145
|
+
}, [query, debounceMs, browse, open]);
|
|
4971
5146
|
useEffect(() => {
|
|
4972
5147
|
listRef.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
4973
5148
|
}, [active]);
|
|
4974
5149
|
const choose = (r) => {
|
|
4975
5150
|
setOpen(false);
|
|
4976
|
-
if (
|
|
4977
|
-
else
|
|
5151
|
+
if (r.run) r.run();
|
|
5152
|
+
else if (onSelect) onSelect(r);
|
|
5153
|
+
else if (r.href) window.location.assign(r.href);
|
|
4978
5154
|
};
|
|
4979
5155
|
const optionId = (i) => `${listId}-o${i}`;
|
|
4980
5156
|
const showList = state === "done" && flat.length > 0;
|
|
@@ -5045,25 +5221,28 @@ function SearchDialog({
|
|
|
5045
5221
|
index++;
|
|
5046
5222
|
const i = index;
|
|
5047
5223
|
const on = i === active;
|
|
5224
|
+
const Option = r.href ? "a" : "div";
|
|
5048
5225
|
return /* @__PURE__ */ jsxs(
|
|
5049
|
-
|
|
5226
|
+
Option,
|
|
5050
5227
|
{
|
|
5051
5228
|
id: optionId(i),
|
|
5052
|
-
href: r.href,
|
|
5229
|
+
...r.href ? { href: r.href } : {},
|
|
5053
5230
|
role: "option",
|
|
5054
5231
|
"aria-selected": on,
|
|
5055
5232
|
tabIndex: -1,
|
|
5056
5233
|
onMouseMove: () => setActive(i),
|
|
5057
5234
|
onClick: (e) => {
|
|
5058
|
-
if (e.metaKey || e.ctrlKey || e.shiftKey) return;
|
|
5235
|
+
if (r.href && (e.metaKey || e.ctrlKey || e.shiftKey)) return;
|
|
5059
5236
|
e.preventDefault();
|
|
5060
5237
|
choose(r);
|
|
5061
5238
|
},
|
|
5062
5239
|
className: cn(
|
|
5063
5240
|
"flex items-start gap-3 rounded-xl px-3 py-2.5 transition-colors",
|
|
5064
|
-
on ? "bg-accent" : "hover:bg-accent"
|
|
5241
|
+
on ? "bg-accent" : "hover:bg-accent",
|
|
5242
|
+
!r.href && "cursor-pointer"
|
|
5065
5243
|
),
|
|
5066
5244
|
children: [
|
|
5245
|
+
r.icon ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "mt-0.5 flex size-5 shrink-0 items-center justify-center text-muted-foreground [&_svg]:size-[1.0625rem]", children: r.icon }) : null,
|
|
5067
5246
|
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
5068
5247
|
/* @__PURE__ */ jsx("span", { className: "truncate text-[0.9375rem] font-medium text-foreground", children: r.title }),
|
|
5069
5248
|
r.section ? /* @__PURE__ */ jsx("span", { className: "truncate text-[0.8125rem] text-muted-foreground", children: r.section }) : null,
|
|
@@ -5075,6 +5254,7 @@ function SearchDialog({
|
|
|
5075
5254
|
}
|
|
5076
5255
|
) : r.excerpt ? /* @__PURE__ */ jsx("span", { className: "line-clamp-2 text-[0.875rem] leading-snug text-muted-foreground", children: r.excerpt }) : null
|
|
5077
5256
|
] }),
|
|
5257
|
+
r.meta ? /* @__PURE__ */ jsx("span", { className: "mt-0.5 shrink-0 text-[0.8125rem] text-muted-foreground", children: r.meta }) : null,
|
|
5078
5258
|
/* @__PURE__ */ jsx(CornerDownLeft, { "aria-hidden": true, className: cn("mt-1 size-4 shrink-0 text-muted-foreground", !on && "invisible") })
|
|
5079
5259
|
]
|
|
5080
5260
|
},
|
|
@@ -5083,11 +5263,11 @@ function SearchDialog({
|
|
|
5083
5263
|
})
|
|
5084
5264
|
] }, gi)) }),
|
|
5085
5265
|
state === "idle" ? /* @__PURE__ */ jsx("div", { className: "px-3 py-6 text-[0.9375rem] text-muted-foreground", children: idle ?? "Type a word: a protocol, a function, an error." }) : null,
|
|
5086
|
-
state === "done" && flat.length === 0 ? /* @__PURE__ */
|
|
5266
|
+
state === "done" && flat.length === 0 ? /* @__PURE__ */ jsx("p", { role: "status", className: "px-3 py-6 text-[0.9375rem] text-muted-foreground", children: query.trim() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5087
5267
|
"No results for \u201C",
|
|
5088
5268
|
query.trim(),
|
|
5089
5269
|
"\u201D."
|
|
5090
|
-
] }) : null,
|
|
5270
|
+
] }) : "Nothing here yet." }) : null,
|
|
5091
5271
|
state === "error" ? /* @__PURE__ */ jsx("p", { role: "status", className: "px-3 py-6 text-[0.9375rem] text-muted-foreground", children: "Search is not available right now. Try again in a moment." }) : null
|
|
5092
5272
|
] }),
|
|
5093
5273
|
/* @__PURE__ */ jsxs("div", { "aria-hidden": true, className: "hidden shrink-0 items-center gap-4 border-t border-border px-5 py-2.5 text-[0.75rem] text-muted-foreground sm:flex", children: [
|
|
@@ -5112,6 +5292,13 @@ function SearchDialog({
|
|
|
5112
5292
|
] }) })
|
|
5113
5293
|
] });
|
|
5114
5294
|
}
|
|
5295
|
+
function CommandDialog({
|
|
5296
|
+
label = "Commands",
|
|
5297
|
+
placeholder = "Search, or run a command",
|
|
5298
|
+
...props
|
|
5299
|
+
}) {
|
|
5300
|
+
return /* @__PURE__ */ jsx(SearchDialog, { ...props, label, placeholder, button: false, browse: true });
|
|
5301
|
+
}
|
|
5115
5302
|
function pretty(content) {
|
|
5116
5303
|
try {
|
|
5117
5304
|
return JSON.stringify(JSON.parse(content), null, 2);
|
|
@@ -5353,7 +5540,7 @@ function FormSection({
|
|
|
5353
5540
|
"aria-current": status === "current" ? "step" : void 0,
|
|
5354
5541
|
className: cn("scroll-mt-24 rounded-[1.25rem] border border-border bg-card", className),
|
|
5355
5542
|
children: [
|
|
5356
|
-
/* @__PURE__ */ jsxs("header", { className: cn("flex items-start gap-3.5", tight ? "px-5 pt-5" : "px-6 pt-6"), children: [
|
|
5543
|
+
/* @__PURE__ */ jsxs("header", { className: cn("flex flex-wrap items-start gap-x-3.5 gap-y-3", tight ? "px-5 pt-5" : "px-6 pt-6"), children: [
|
|
5357
5544
|
n !== void 0 ? /* @__PURE__ */ jsx(
|
|
5358
5545
|
"span",
|
|
5359
5546
|
{
|
|
@@ -5380,7 +5567,7 @@ function FormSection({
|
|
|
5380
5567
|
] }),
|
|
5381
5568
|
hint ? /* @__PURE__ */ jsx("p", { className: "text-[0.875rem] leading-snug text-muted-foreground", children: hint }) : null
|
|
5382
5569
|
] }),
|
|
5383
|
-
action ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: action }) : null
|
|
5570
|
+
action ? /* @__PURE__ */ jsx("div", { className: cn("shrink-0 max-sm:basis-full", n !== void 0 && "max-sm:pl-[2.625rem]"), children: action }) : null
|
|
5384
5571
|
] }),
|
|
5385
5572
|
/* @__PURE__ */ jsx("div", { className: cn("flex flex-col", tight ? "gap-4 p-5" : "gap-5 p-6", n !== void 0 && (tight ? "sm:pl-[3.875rem]" : "sm:pl-[4.125rem]")), children })
|
|
5386
5573
|
]
|
|
@@ -5540,6 +5727,13 @@ function BlockCountdown({
|
|
|
5540
5727
|
] }) : null
|
|
5541
5728
|
] });
|
|
5542
5729
|
}
|
|
5730
|
+
var METER_FILL = {
|
|
5731
|
+
ink: "bg-foreground",
|
|
5732
|
+
brand: "bg-oca-orange-deep",
|
|
5733
|
+
good: "bg-success",
|
|
5734
|
+
caution: "bg-warning",
|
|
5735
|
+
bad: "bg-destructive"
|
|
5736
|
+
};
|
|
5543
5737
|
function Meter({
|
|
5544
5738
|
value,
|
|
5545
5739
|
max,
|
|
@@ -5574,7 +5768,7 @@ function Meter({
|
|
|
5574
5768
|
/* @__PURE__ */ jsx(
|
|
5575
5769
|
"div",
|
|
5576
5770
|
{
|
|
5577
|
-
className: cn("h-full shrink-0 rounded-full", tone
|
|
5771
|
+
className: cn("h-full shrink-0 rounded-full", METER_FILL[tone]),
|
|
5578
5772
|
style: { width: `${v * 100}%` }
|
|
5579
5773
|
}
|
|
5580
5774
|
),
|
|
@@ -5610,27 +5804,30 @@ function FilterChips({
|
|
|
5610
5804
|
onChange(cur.includes(v) ? cur.filter((x) => x !== v) : [...cur, v]);
|
|
5611
5805
|
} else onChange(v);
|
|
5612
5806
|
};
|
|
5613
|
-
return
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5807
|
+
return (
|
|
5808
|
+
// Wraps rather than scrolls: every filter stays in view on a phone.
|
|
5809
|
+
/* @__PURE__ */ jsx("div", { role: "group", "aria-label": label, className: cn("flex flex-wrap items-center gap-2 py-0.5", className), children: options.map((o) => {
|
|
5810
|
+
const on = isOn(o.value);
|
|
5811
|
+
return /* @__PURE__ */ jsxs(
|
|
5812
|
+
"button",
|
|
5813
|
+
{
|
|
5814
|
+
type: "button",
|
|
5815
|
+
"aria-pressed": on,
|
|
5816
|
+
onClick: () => press(o.value),
|
|
5817
|
+
className: cn(
|
|
5818
|
+
"inline-flex shrink-0 items-center gap-1.5 rounded-full border px-3.5 text-[0.875rem] transition-colors",
|
|
5819
|
+
tight ? "h-8" : "h-9",
|
|
5820
|
+
on ? "border-foreground bg-foreground text-background" : "border-border bg-card text-muted-foreground hover:border-oca-hairline-strong hover:text-foreground"
|
|
5821
|
+
),
|
|
5822
|
+
children: [
|
|
5823
|
+
o.label,
|
|
5824
|
+
o.count !== void 0 ? /* @__PURE__ */ jsx("span", { className: "oca-tabular", children: o.count.toLocaleString("en-US") }) : null
|
|
5825
|
+
]
|
|
5826
|
+
},
|
|
5827
|
+
o.value
|
|
5828
|
+
);
|
|
5829
|
+
}) })
|
|
5830
|
+
);
|
|
5634
5831
|
}
|
|
5635
5832
|
function ToolGrid({
|
|
5636
5833
|
tools,
|
|
@@ -5818,48 +6015,106 @@ function SectionSwitch({
|
|
|
5818
6015
|
}
|
|
5819
6016
|
);
|
|
5820
6017
|
}
|
|
6018
|
+
function NavBadge({ badge, className }) {
|
|
6019
|
+
if (typeof badge === "number") {
|
|
6020
|
+
return /* @__PURE__ */ jsx(
|
|
6021
|
+
"span",
|
|
6022
|
+
{
|
|
6023
|
+
"aria-hidden": true,
|
|
6024
|
+
className: cn(
|
|
6025
|
+
"absolute flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[0.625rem] font-medium leading-none text-primary-foreground ring-2 ring-background oca-tabular",
|
|
6026
|
+
className
|
|
6027
|
+
),
|
|
6028
|
+
children: badge > 99 ? "99+" : badge
|
|
6029
|
+
}
|
|
6030
|
+
);
|
|
6031
|
+
}
|
|
6032
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("absolute size-2 rounded-full bg-oca-orange-deep ring-2 ring-background", className) });
|
|
6033
|
+
}
|
|
6034
|
+
var TAB = "flex min-w-0 flex-col items-center justify-center gap-1 rounded-2xl text-[0.6875rem] leading-none outline-none transition-colors [-webkit-tap-highlight-color:transparent] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring";
|
|
6035
|
+
function TabFace({ icon, label, badge, active }) {
|
|
6036
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6037
|
+
/* @__PURE__ */ jsxs(
|
|
6038
|
+
"span",
|
|
6039
|
+
{
|
|
6040
|
+
className: cn(
|
|
6041
|
+
"relative flex h-7 w-12 items-center justify-center rounded-full transition-[background-color,box-shadow] duration-200",
|
|
6042
|
+
"[&_svg]:size-[1.125rem] [&_svg]:shrink-0",
|
|
6043
|
+
active ? "bg-card shadow-sm ring-1 ring-border [&_svg]:stroke-2" : "[&_svg]:stroke-[1.75]"
|
|
6044
|
+
),
|
|
6045
|
+
children: [
|
|
6046
|
+
icon,
|
|
6047
|
+
badge ? /* @__PURE__ */ jsx(NavBadge, { badge, className: typeof badge === "number" ? "-top-1 right-0.5" : "right-2.5 top-0.5" }) : null
|
|
6048
|
+
]
|
|
6049
|
+
}
|
|
6050
|
+
),
|
|
6051
|
+
/* @__PURE__ */ jsx("span", { className: "max-w-full truncate px-0.5", children: label }),
|
|
6052
|
+
badge ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: badge }) : null
|
|
6053
|
+
] });
|
|
6054
|
+
}
|
|
5821
6055
|
function TabBar({ items }) {
|
|
6056
|
+
const [more, setMore] = useState(false);
|
|
6057
|
+
const overflow = items.length > 5;
|
|
6058
|
+
const shown = overflow ? items.slice(0, 4) : items;
|
|
6059
|
+
const rest = overflow ? items.slice(4) : [];
|
|
6060
|
+
const restBadge = rest.find((it) => it.badge)?.badge;
|
|
5822
6061
|
return /* @__PURE__ */ jsx(
|
|
5823
6062
|
"nav",
|
|
5824
6063
|
{
|
|
5825
6064
|
"aria-label": "Pages",
|
|
5826
6065
|
"data-oca-tabbar": "",
|
|
5827
6066
|
className: "fixed inset-x-0 bottom-0 z-40 border-t border-border bg-background/90 pb-[env(safe-area-inset-bottom)] backdrop-blur-md md:hidden",
|
|
5828
|
-
children: /* @__PURE__ */
|
|
6067
|
+
children: /* @__PURE__ */ jsxs(
|
|
5829
6068
|
"div",
|
|
5830
6069
|
{
|
|
5831
6070
|
className: "mx-auto grid h-14 max-w-[32rem] px-1.5",
|
|
5832
|
-
style: { gridTemplateColumns: `repeat(${
|
|
5833
|
-
children:
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
it.
|
|
6071
|
+
style: { gridTemplateColumns: `repeat(${shown.length + (overflow ? 1 : 0)}, minmax(0, 1fr))` },
|
|
6072
|
+
children: [
|
|
6073
|
+
shown.map((it) => /* @__PURE__ */ jsx(
|
|
6074
|
+
Link6,
|
|
6075
|
+
{
|
|
6076
|
+
href: it.href,
|
|
6077
|
+
"aria-current": it.active ? "page" : void 0,
|
|
6078
|
+
className: cn(TAB, it.active ? "text-foreground" : "text-muted-foreground hover:text-foreground"),
|
|
6079
|
+
children: /* @__PURE__ */ jsx(TabFace, { icon: it.icon, label: it.label, badge: it.badge, active: it.active })
|
|
6080
|
+
},
|
|
6081
|
+
it.href
|
|
6082
|
+
)),
|
|
6083
|
+
overflow ? /* @__PURE__ */ jsxs(Sheet, { open: more, onOpenChange: setMore, children: [
|
|
6084
|
+
/* @__PURE__ */ jsx(
|
|
6085
|
+
SheetTrigger,
|
|
6086
|
+
{
|
|
6087
|
+
className: cn(TAB, rest.some((it) => it.active) ? "text-foreground" : "text-muted-foreground hover:text-foreground"),
|
|
6088
|
+
children: /* @__PURE__ */ jsx(TabFace, { icon: /* @__PURE__ */ jsx(Ellipsis, {}), label: "More", badge: restBadge ? true : void 0, active: rest.some((it) => it.active) })
|
|
6089
|
+
}
|
|
5841
6090
|
),
|
|
5842
|
-
children: [
|
|
5843
|
-
/* @__PURE__ */
|
|
5844
|
-
|
|
6091
|
+
/* @__PURE__ */ jsxs(SheetContent, { side: "bottom", className: "pb-[calc(1.5rem+env(safe-area-inset-bottom))]", children: [
|
|
6092
|
+
/* @__PURE__ */ jsx(SheetTitle, { className: "px-1 text-[1.0625rem] font-medium", children: "More" }),
|
|
6093
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 grid grid-cols-3 gap-2", children: rest.map((it) => /* @__PURE__ */ jsxs(
|
|
6094
|
+
Link6,
|
|
5845
6095
|
{
|
|
6096
|
+
href: it.href,
|
|
6097
|
+
onClick: () => setMore(false),
|
|
6098
|
+
"aria-current": it.active ? "page" : void 0,
|
|
5846
6099
|
className: cn(
|
|
5847
|
-
"
|
|
5848
|
-
"[&_svg]:size-
|
|
5849
|
-
it.active ? "bg-card
|
|
6100
|
+
"flex min-h-20 flex-col items-center justify-center gap-2 rounded-2xl border px-2 text-center text-[0.8125rem] transition-colors",
|
|
6101
|
+
"[&_svg]:size-5",
|
|
6102
|
+
it.active ? "border-foreground bg-card text-foreground" : "border-border text-muted-foreground hover:text-foreground"
|
|
5850
6103
|
),
|
|
5851
6104
|
children: [
|
|
5852
|
-
|
|
5853
|
-
|
|
6105
|
+
/* @__PURE__ */ jsxs("span", { className: "relative", children: [
|
|
6106
|
+
it.icon,
|
|
6107
|
+
it.badge ? /* @__PURE__ */ jsx(NavBadge, { badge: it.badge, className: typeof it.badge === "number" ? "-right-3 -top-2" : "-right-1 -top-0.5" }) : null
|
|
6108
|
+
] }),
|
|
6109
|
+
/* @__PURE__ */ jsx("span", { className: "max-w-full truncate", children: it.label }),
|
|
6110
|
+
it.badge ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: it.badge }) : null
|
|
5854
6111
|
]
|
|
5855
|
-
}
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
it.href
|
|
5862
|
-
))
|
|
6112
|
+
},
|
|
6113
|
+
it.href
|
|
6114
|
+
)) })
|
|
6115
|
+
] })
|
|
6116
|
+
] }) : null
|
|
6117
|
+
]
|
|
5863
6118
|
}
|
|
5864
6119
|
)
|
|
5865
6120
|
}
|
|
@@ -5867,7 +6122,11 @@ function TabBar({ items }) {
|
|
|
5867
6122
|
}
|
|
5868
6123
|
function tabsFor(groups) {
|
|
5869
6124
|
const items = groups.flatMap((g) => g.items);
|
|
5870
|
-
return items.length >= 2 && items.
|
|
6125
|
+
return items.length >= 2 && items.every((it) => it.icon) ? items : null;
|
|
6126
|
+
}
|
|
6127
|
+
function sectionTabs(sections, current2) {
|
|
6128
|
+
if (!sections || !current2 || sections.length < 2 || !sections.every((sec) => sec.icon)) return null;
|
|
6129
|
+
return sections.map((sec) => ({ href: sec.href, label: sec.label, icon: sec.icon, active: sec.id === current2.id }));
|
|
5871
6130
|
}
|
|
5872
6131
|
var activeItem = (groups) => groups.flatMap((g) => g.items).find((it) => it.active);
|
|
5873
6132
|
var warned = /* @__PURE__ */ new Set();
|
|
@@ -5882,7 +6141,10 @@ function warnDuplicateLabels(groups) {
|
|
|
5882
6141
|
seen.add(it.label);
|
|
5883
6142
|
}
|
|
5884
6143
|
}
|
|
5885
|
-
function AppShell({
|
|
6144
|
+
function AppShell(props) {
|
|
6145
|
+
return props.variant === "rail" ? /* @__PURE__ */ jsx(RailShell, { ...props }) : /* @__PURE__ */ jsx(SidebarShell, { ...props });
|
|
6146
|
+
}
|
|
6147
|
+
function SidebarShell({
|
|
5886
6148
|
nav,
|
|
5887
6149
|
sections,
|
|
5888
6150
|
activeSection,
|
|
@@ -5900,7 +6162,8 @@ function AppShell({
|
|
|
5900
6162
|
const current2 = sections && sections.length > 0 ? sections.find((sec) => sec.id === activeSection) ?? sections.find((sec) => activeItem(sec.groups)) ?? sections[0] : void 0;
|
|
5901
6163
|
const groups = current2 ? [...current2.groups, ...persistent] : [...nav ?? [], ...persistent];
|
|
5902
6164
|
warnDuplicateLabels(groups);
|
|
5903
|
-
const
|
|
6165
|
+
const sectionTabsFor = sectionTabs(sections, current2);
|
|
6166
|
+
const tabs = current2 ? sectionTabsFor : tabsFor(groups);
|
|
5904
6167
|
const page = activeItem(groups);
|
|
5905
6168
|
const place = useMemo(
|
|
5906
6169
|
() => ({
|
|
@@ -5928,8 +6191,8 @@ function AppShell({
|
|
|
5928
6191
|
{
|
|
5929
6192
|
className: cn(
|
|
5930
6193
|
"inline-flex size-10 items-center justify-center rounded-full hover:bg-accent",
|
|
5931
|
-
// The tab bar holds every page; the sheet is left for a footer.
|
|
5932
|
-
tabs && !footer && "max-md:hidden"
|
|
6194
|
+
// The tab bar holds every page; the sheet is left for a footer. Section tabs leave the pages here.
|
|
6195
|
+
tabs && !sectionTabsFor && !footer && "max-md:hidden"
|
|
5933
6196
|
),
|
|
5934
6197
|
"aria-label": "Open navigation",
|
|
5935
6198
|
children: /* @__PURE__ */ jsx(Menu, { className: "size-5" })
|
|
@@ -5937,8 +6200,8 @@ function AppShell({
|
|
|
5937
6200
|
),
|
|
5938
6201
|
/* @__PURE__ */ jsxs(SheetContent, { side: "left", className: "flex flex-col gap-6 overflow-y-auto p-4 pt-16", children: [
|
|
5939
6202
|
/* @__PURE__ */ jsx(SheetTitle, { className: "sr-only", children: "Navigation" }),
|
|
5940
|
-
switcher,
|
|
5941
|
-
/* @__PURE__ */ jsx("div", { className: tabs ? "max-md:hidden" : void 0, children: /* @__PURE__ */ jsx(SideNav, { groups, onNavigate: () => setOpen(false) }) }),
|
|
6203
|
+
switcher ? /* @__PURE__ */ jsx("div", { className: sectionTabsFor ? "max-md:hidden" : void 0, children: switcher }) : null,
|
|
6204
|
+
/* @__PURE__ */ jsx("div", { className: tabs && !sectionTabsFor ? "max-md:hidden" : void 0, children: /* @__PURE__ */ jsx(SideNav, { groups, onNavigate: () => setOpen(false) }) }),
|
|
5942
6205
|
footer ? /* @__PURE__ */ jsx("div", { className: "mt-auto flex flex-col gap-3", children: footer }) : null
|
|
5943
6206
|
] })
|
|
5944
6207
|
] }),
|
|
@@ -5952,7 +6215,7 @@ function AppShell({
|
|
|
5952
6215
|
className: cn(
|
|
5953
6216
|
"flex h-9 items-center gap-1.5 border-t border-border px-4 text-[0.875rem]",
|
|
5954
6217
|
// The active tab already names the page.
|
|
5955
|
-
tabs && !pageOverride && "max-md:hidden"
|
|
6218
|
+
tabs && !sectionTabsFor && !pageOverride && "max-md:hidden"
|
|
5956
6219
|
),
|
|
5957
6220
|
children: [
|
|
5958
6221
|
place.section ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -5985,6 +6248,64 @@ function AppShell({
|
|
|
5985
6248
|
}
|
|
5986
6249
|
) });
|
|
5987
6250
|
}
|
|
6251
|
+
function RailItem({ item }) {
|
|
6252
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
6253
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
6254
|
+
Link6,
|
|
6255
|
+
{
|
|
6256
|
+
href: item.href,
|
|
6257
|
+
"aria-current": item.active ? "page" : void 0,
|
|
6258
|
+
className: cn(
|
|
6259
|
+
"relative flex size-10 items-center justify-center rounded-xl outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",
|
|
6260
|
+
"[&_svg]:size-5 [&_svg]:shrink-0",
|
|
6261
|
+
item.active ? "bg-card text-foreground shadow-sm ring-1 ring-border" : "text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
6262
|
+
),
|
|
6263
|
+
children: [
|
|
6264
|
+
item.icon,
|
|
6265
|
+
/* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
|
|
6266
|
+
item.label,
|
|
6267
|
+
item.badge ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6268
|
+
", ",
|
|
6269
|
+
item.badge
|
|
6270
|
+
] }) : null
|
|
6271
|
+
] }),
|
|
6272
|
+
item.badge ? /* @__PURE__ */ jsx(NavBadge, { badge: item.badge, className: typeof item.badge === "number" ? "-right-1 -top-1" : "right-1 top-1" }) : null
|
|
6273
|
+
]
|
|
6274
|
+
}
|
|
6275
|
+
) }),
|
|
6276
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "right", children: item.label })
|
|
6277
|
+
] });
|
|
6278
|
+
}
|
|
6279
|
+
function RailShell({ nav = [], persistent = [], page: pageOverride, header, account, banner, children, className }) {
|
|
6280
|
+
const main = nav.flatMap((g) => g.items);
|
|
6281
|
+
const foot = persistent.flatMap((g) => g.items);
|
|
6282
|
+
warnDuplicateLabels([...nav, ...persistent]);
|
|
6283
|
+
const tabs = tabsFor([{ items: [...main, ...foot] }]);
|
|
6284
|
+
const active = activeItem([...nav, ...persistent]);
|
|
6285
|
+
const place = useMemo(() => ({ page: pageOverride ?? active?.label }), [pageOverride, active?.label]);
|
|
6286
|
+
return /* @__PURE__ */ jsx(ShellContext.Provider, { value: place, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs("div", { className: cn("flex h-dvh flex-col overflow-hidden bg-background", className), children: [
|
|
6287
|
+
header,
|
|
6288
|
+
banner,
|
|
6289
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1", children: [
|
|
6290
|
+
/* @__PURE__ */ jsxs("nav", { "aria-label": "Pages", className: "hidden w-14 shrink-0 flex-col items-center gap-1 border-r border-border py-3 md:flex", children: [
|
|
6291
|
+
main.map((it) => /* @__PURE__ */ jsx(RailItem, { item: it }, it.href)),
|
|
6292
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-auto flex flex-col items-center gap-1", children: [
|
|
6293
|
+
foot.map((it) => /* @__PURE__ */ jsx(RailItem, { item: it }, it.href)),
|
|
6294
|
+
account
|
|
6295
|
+
] })
|
|
6296
|
+
] }),
|
|
6297
|
+
/* @__PURE__ */ jsx(
|
|
6298
|
+
"main",
|
|
6299
|
+
{
|
|
6300
|
+
id: "main-content",
|
|
6301
|
+
className: cn("flex min-h-0 min-w-0 flex-1 flex-col", tabs && "max-md:pb-[calc(3.5rem_+_env(safe-area-inset-bottom))]"),
|
|
6302
|
+
children
|
|
6303
|
+
}
|
|
6304
|
+
)
|
|
6305
|
+
] }),
|
|
6306
|
+
tabs ? /* @__PURE__ */ jsx(TabBar, { items: tabs }) : null
|
|
6307
|
+
] }) }) });
|
|
6308
|
+
}
|
|
5988
6309
|
function AccountMenu({
|
|
5989
6310
|
name,
|
|
5990
6311
|
detail,
|
|
@@ -6385,12 +6706,14 @@ function SignInFrame({
|
|
|
6385
6706
|
error,
|
|
6386
6707
|
fineprint,
|
|
6387
6708
|
brand,
|
|
6388
|
-
home
|
|
6709
|
+
home,
|
|
6710
|
+
protocol: protocol2,
|
|
6389
6711
|
back,
|
|
6390
6712
|
art,
|
|
6391
6713
|
caption,
|
|
6392
6714
|
className
|
|
6393
6715
|
}) {
|
|
6716
|
+
const homeHref = home ?? (protocol2 ? protocolSite(protocol2).pageHref : OCHK_IO);
|
|
6394
6717
|
return /* @__PURE__ */ jsxs(
|
|
6395
6718
|
"main",
|
|
6396
6719
|
{
|
|
@@ -6399,14 +6722,14 @@ function SignInFrame({
|
|
|
6399
6722
|
children: [
|
|
6400
6723
|
/* @__PURE__ */ jsxs("section", { className: "flex flex-col px-4 pb-8 pt-5 sm:px-8 lg:px-14 lg:pt-8", children: [
|
|
6401
6724
|
/* @__PURE__ */ jsxs("header", { className: "flex items-center justify-between gap-4", children: [
|
|
6402
|
-
/* @__PURE__ */ jsxs(Link6, { href:
|
|
6725
|
+
/* @__PURE__ */ jsxs(Link6, { href: homeHref, className: "w-fit rounded-lg", children: [
|
|
6403
6726
|
brand ?? /* @__PURE__ */ jsx(Lockup, { size: 28 }),
|
|
6404
6727
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: " home" })
|
|
6405
6728
|
] }),
|
|
6406
6729
|
back === void 0 ? /* @__PURE__ */ jsx(
|
|
6407
6730
|
Link6,
|
|
6408
6731
|
{
|
|
6409
|
-
href:
|
|
6732
|
+
href: homeHref,
|
|
6410
6733
|
className: "text-[0.9375rem] text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",
|
|
6411
6734
|
children: "Back to home"
|
|
6412
6735
|
}
|
|
@@ -6655,6 +6978,7 @@ function ToolShell({
|
|
|
6655
6978
|
children
|
|
6656
6979
|
}) {
|
|
6657
6980
|
const p = protocolSite(protocol2);
|
|
6981
|
+
const homeHref = home ?? p.pageHref;
|
|
6658
6982
|
const app = variant === "app";
|
|
6659
6983
|
const tabs = app ? null : tabsFor([{ items: [...tools] }]);
|
|
6660
6984
|
const about = /* @__PURE__ */ jsxs(
|
|
@@ -6684,7 +7008,7 @@ function ToolShell({
|
|
|
6684
7008
|
SiteHeader,
|
|
6685
7009
|
{
|
|
6686
7010
|
variant: "tool",
|
|
6687
|
-
home:
|
|
7011
|
+
home: homeHref,
|
|
6688
7012
|
product: p.label,
|
|
6689
7013
|
family: protocol2,
|
|
6690
7014
|
nav: tools.map((t) => ({ href: t.href, label: t.label, active: t.active })),
|
|
@@ -6709,7 +7033,7 @@ function ToolShell({
|
|
|
6709
7033
|
{
|
|
6710
7034
|
id: "main-content",
|
|
6711
7035
|
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"),
|
|
6712
|
-
children: app ? children : /* @__PURE__ */ jsx("div", { className: "mx-auto w-full max-w-[72rem]", children })
|
|
7036
|
+
children: /* @__PURE__ */ jsx(SiteHomeContext.Provider, { value: homeHref, children: app ? children : /* @__PURE__ */ jsx("div", { className: "mx-auto w-full max-w-[72rem]", children }) })
|
|
6713
7037
|
}
|
|
6714
7038
|
)
|
|
6715
7039
|
] }),
|
|
@@ -6888,6 +7212,6 @@ function createMdxComponents({ mermaid } = {}) {
|
|
|
6888
7212
|
}
|
|
6889
7213
|
var mdxComponents = createMdxComponents();
|
|
6890
7214
|
|
|
6891
|
-
export { APP_ATTRIBUTE, APP_ID, Accent, Accordion, AccordionItem, AccountMenu, ActivityList, AnchorStatus, ApiTable, AppCard, AppGrid, AppIcon, AppShell, ArtifactView, Badge, BlockCountdown, BlockHeight, Breadcrumbs, BrowserFrame, Button, CODE_LANGS, Callout, Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardNumeral, CardTitle, Checkbox, Closing, CodeBlock, CodeTabs, ComparisonTable, Container, CopyButton, Crowd, DOCS_HEADER_NAV, DOCS_HREF, DataTable, DensityProvider, Diagram, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHost, DialogTitle, DialogTrigger, Display, DocHeader, DocLayout, DocsHeading, DocsNav, DocsPager, DocsShell, DropZone, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EmptyLine, EmptyState, EndpointList, ErrorBoundary, ErrorPage, Eyebrow, FAMILY, FAMILY_GROUPS, FactBlock, FactRows, FamilyMenu, Faq, Field, FilterChips, FloatChip, Footnote, FormSection, HalftoneCanvas, HalftoneSphere, HashChip, Input, InstallTabs, IsoCheck, Kbd, KeyValueList, LEGAL_LINKS, Label, Lead, LegalDocument, LinkCard, LoadingBlock, Lockup, MARK_FACES, Mark, MdxTable, Meter, Monogram, Notice, OCHK_APP_ACCOUNT, OCHK_IO, OCHK_IO_FOOTER, OCHK_IO_NAV, OchkIoFooter, OnThisPage, PROTOCOLS, PROTOCOL_ORDER, PackageCard, PageHeader, PageHero, Pagination, PhoneFrame, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProgressSteps, ProofStrip, Prose, ProtocolGrid, ProtocolHero, ProtocolNav, QrCode, RadioGroup, RadioGroupItem, Reveal, SELF_HOSTED_LEGAL_LINKS, SPHERE_GRADIENT, Sats, SatsFigure, ScrollFade, ScrollStory, SearchButton, SearchDialog, Section, SectionHeading, SectionIntro, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Separator, SessionAccountView, Sheet, SheetClose, SheetContent, SheetDescription, SheetTitle, SheetTrigger, ShellContext, SignInFrame, SignMessage, SiteBanner, SiteFooter, SiteHeader, Skeleton, SkipLink, SpecCard, Spinner, SplitBar, StatCard, StatGrid, StateBadge, StatusBadge, StatusDot, StatusPill, Step, StepGrid, Steps, Switch, TOKEN_CLASS, Tabs, TabsContent, TabsList, TabsTrigger, TextLink, Textarea, ThemeToggle, Ticker, Toaster, ToolGrid, ToolShell, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruthTable, UsdApprox, VerifyBox, VerifyReport, appColors, appFonts, badgeVariants, blocksToDuration, buttonVariants, cardVariants, cn, confirm, createMdxComponents, createStateBadge, escapeHtml, explorerUrl, familyByGroup, familySite, formatBlockHeight, formatBytes, formatUtc, grammarOf, highlight, highlightToHtml, languageName, linesToHtml, mdxComponents, monogramGround, monogramLetter, parseCodeMeta, parseLineRanges, portraitTone, prompt, protocolSite, readDiff, rehypeCode, satsText, sectionVariants, shortenMiddle, statusWord, useActiveHeading, useCopy, useDensity, useHeadings, useInView, useShellPlace, useSignInHref, useTimedOut };
|
|
7215
|
+
export { APP_ATTRIBUTE, APP_ID, Accent, Accordion, AccordionItem, AccountMenu, ActivityList, AnchorStatus, ApiTable, AppCard, AppGrid, AppIcon, AppShell, ArtifactView, Badge, BlockCountdown, BlockHeight, Breadcrumbs, BrowserFrame, Button, CODE_LANGS, Callout, Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardNumeral, CardTitle, Checkbox, Closing, CodeBlock, CodeTabs, CommandDialog, ComparisonTable, Container, CopyButton, CountdownRing, Crowd, DOCS_HEADER_NAV, DOCS_HREF, DataTable, DensityProvider, Diagram, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHost, DialogTitle, DialogTrigger, Display, DocHeader, DocLayout, DocsHeading, DocsNav, DocsPager, DocsShell, DropZone, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EmptyLine, EmptyState, EndpointList, ErrorBoundary, ErrorPage, Eyebrow, FAMILY, FAMILY_GROUPS, FactBlock, FactRows, FamilyMenu, Faq, Field, FilterChips, FloatChip, Footnote, FormSection, HalftoneCanvas, HalftoneSphere, HashChip, Input, InstallTabs, IsoCheck, Kbd, KeyValueList, LEGAL_LINKS, Label, Lead, LegalDocument, LinkCard, LoadingBlock, LockedPreview, Lockup, MARK_FACES, Mark, MdxTable, Meter, Monogram, Notice, OCHK_APP_ACCOUNT, OCHK_IO, OCHK_IO_FOOTER, OCHK_IO_NAV, OchkIoFooter, OnThisPage, PROTOCOLS, PROTOCOL_ORDER, PackageCard, PageHeader, PageHero, Pagination, PhoneFrame, PlanCard, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProgressSteps, ProofStrip, Prose, ProtocolGrid, ProtocolHero, ProtocolNav, QrCode, RadioGroup, RadioGroupItem, Reveal, SELF_HOSTED_LEGAL_LINKS, SPHERE_GRADIENT, Sats, SatsFigure, ScrollFade, ScrollStory, SearchButton, SearchDialog, Section, SectionHeading, SectionIntro, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Separator, SessionAccountView, Sheet, SheetClose, SheetContent, SheetDescription, SheetTitle, SheetTrigger, ShellContext, SignInFrame, SignMessage, SiteBanner, SiteFooter, SiteHeader, Skeleton, SkipLink, SpecCard, Spinner, SplitBar, StatCard, StatGrid, StateBadge, StatusBadge, StatusDot, StatusPill, Step, StepGrid, Steps, Switch, TOKEN_CLASS, Tabs, TabsContent, TabsList, TabsTrigger, TextLink, Textarea, ThemeToggle, Ticker, Toaster, ToolGrid, ToolShell, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruthTable, UsdApprox, VerifyBox, VerifyReport, appColors, appFonts, badgeVariants, blocksToDuration, buttonVariants, cardVariants, cn, confirm, createMdxComponents, createStateBadge, escapeHtml, explorerUrl, familyByGroup, familySite, formatBlockHeight, formatBytes, formatUtc, grammarOf, highlight, highlightToHtml, languageName, linesToHtml, mdxComponents, monogramGround, monogramLetter, parseCodeMeta, parseLineRanges, portraitTone, prompt, protocolSite, readDiff, rehypeCode, satsText, sectionVariants, shortenMiddle, statusWord, useActiveHeading, useCopy, useDensity, useHeadings, useInView, useShellPlace, useSignInHref, useTimedOut };
|
|
6892
7216
|
//# sourceMappingURL=index.mjs.map
|
|
6893
7217
|
//# sourceMappingURL=index.mjs.map
|