@orangecheck/design 0.16.0 → 0.18.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/index.mjs CHANGED
@@ -304,17 +304,68 @@ var MODES = [
304
304
  { id: "dark", label: "dark", Icon: Moon },
305
305
  { id: "system", label: "system", Icon: Monitor }
306
306
  ];
307
+ function AppearanceControls({ className }) {
308
+ const { skin, setSkin, themes } = useOcSkin();
309
+ const { theme, setTheme } = useTheme();
310
+ const [mounted, setMounted] = useState(false);
311
+ useEffect(() => setMounted(true), []);
312
+ const activeMode = mounted ? theme ?? "system" : null;
313
+ return /* @__PURE__ */ jsxs("div", { className, children: [
314
+ /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground px-3 pt-3 pb-2", children: "mode" }),
315
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 px-2 pb-2", children: MODES.map(({ id, label, Icon: Icon2 }) => {
316
+ const active = activeMode === id;
317
+ return /* @__PURE__ */ jsxs(
318
+ "button",
319
+ {
320
+ type: "button",
321
+ role: "menuitemradio",
322
+ "aria-checked": active,
323
+ onClick: () => setTheme(id),
324
+ className: cn(
325
+ "flex flex-col items-center gap-1 rounded-md border py-2 text-[11px] transition-colors",
326
+ active ? "border-primary text-foreground bg-accent" : "border-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground"
327
+ ),
328
+ children: [
329
+ /* @__PURE__ */ jsx(Icon2, { className: "size-4", "aria-hidden": true }),
330
+ label
331
+ ]
332
+ },
333
+ id
334
+ );
335
+ }) }),
336
+ /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground border-t px-3 pt-3 pb-1", children: "theme" }),
337
+ /* @__PURE__ */ jsx("ul", { className: "pb-1", children: themes.map((t) => {
338
+ const active = t.id === skin;
339
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
340
+ "button",
341
+ {
342
+ type: "button",
343
+ role: "menuitemradio",
344
+ "aria-checked": active,
345
+ onClick: () => setSkin(t.id),
346
+ className: cn(
347
+ "hover:bg-accent hover:text-accent-foreground flex w-full items-start gap-2 px-3 py-2 text-left transition-colors",
348
+ active && "text-foreground"
349
+ ),
350
+ children: [
351
+ /* @__PURE__ */ jsx("span", { className: "mt-0.5 size-4 shrink-0", children: active && /* @__PURE__ */ jsx(Check, { className: "text-primary size-4", "aria-hidden": true }) }),
352
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
353
+ /* @__PURE__ */ jsx("span", { className: "block text-sm font-medium", children: t.label }),
354
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground block text-xs leading-snug", children: t.description })
355
+ ] })
356
+ ]
357
+ }
358
+ ) }, t.id);
359
+ }) })
360
+ ] });
361
+ }
307
362
  function OcAppearanceMenu({
308
363
  className,
309
364
  triggerClassName,
310
365
  popoverClassName
311
366
  }) {
312
- const { skin, setSkin, themes } = useOcSkin();
313
- const { theme, setTheme } = useTheme();
314
367
  const [open, setOpen] = useState(false);
315
- const [mounted, setMounted] = useState(false);
316
368
  const rootRef = useRef(null);
317
- useEffect(() => setMounted(true), []);
318
369
  useEffect(() => {
319
370
  if (!open) return;
320
371
  function onDown(e) {
@@ -330,7 +381,6 @@ function OcAppearanceMenu({
330
381
  document.removeEventListener("keydown", onKey);
331
382
  };
332
383
  }, [open]);
333
- const activeMode = mounted ? theme ?? "system" : null;
334
384
  return /* @__PURE__ */ jsxs("div", { ref: rootRef, className: cn("relative", className), children: [
335
385
  /* @__PURE__ */ jsx(
336
386
  "button",
@@ -348,7 +398,7 @@ function OcAppearanceMenu({
348
398
  children: /* @__PURE__ */ jsx(Palette, { className: "size-4", "aria-hidden": true })
349
399
  }
350
400
  ),
351
- open && /* @__PURE__ */ jsxs(
401
+ open && /* @__PURE__ */ jsx(
352
402
  "div",
353
403
  {
354
404
  role: "menu",
@@ -356,54 +406,7 @@ function OcAppearanceMenu({
356
406
  "bg-popover text-popover-foreground absolute right-0 z-50 mt-2 w-64 overflow-hidden rounded-md border shadow-md",
357
407
  popoverClassName
358
408
  ),
359
- children: [
360
- /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground px-3 pt-3 pb-2", children: "mode" }),
361
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 px-2 pb-2", children: MODES.map(({ id, label, Icon: Icon2 }) => {
362
- const active = activeMode === id;
363
- return /* @__PURE__ */ jsxs(
364
- "button",
365
- {
366
- type: "button",
367
- role: "menuitemradio",
368
- "aria-checked": active,
369
- onClick: () => setTheme(id),
370
- className: cn(
371
- "flex flex-col items-center gap-1 rounded-md border py-2 text-[11px] transition-colors",
372
- active ? "border-primary text-foreground bg-accent" : "border-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground"
373
- ),
374
- children: [
375
- /* @__PURE__ */ jsx(Icon2, { className: "size-4", "aria-hidden": true }),
376
- label
377
- ]
378
- },
379
- id
380
- );
381
- }) }),
382
- /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground border-t px-3 pt-3 pb-1", children: "theme" }),
383
- /* @__PURE__ */ jsx("ul", { className: "pb-1", children: themes.map((t) => {
384
- const active = t.id === skin;
385
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
386
- "button",
387
- {
388
- type: "button",
389
- role: "menuitemradio",
390
- "aria-checked": active,
391
- onClick: () => setSkin(t.id),
392
- className: cn(
393
- "hover:bg-accent hover:text-accent-foreground flex w-full items-start gap-2 px-3 py-2 text-left transition-colors",
394
- active && "text-foreground"
395
- ),
396
- children: [
397
- /* @__PURE__ */ jsx("span", { className: "mt-0.5 size-4 shrink-0", children: active && /* @__PURE__ */ jsx(Check, { className: "text-primary size-4", "aria-hidden": true }) }),
398
- /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
399
- /* @__PURE__ */ jsx("span", { className: "block text-sm font-medium", children: t.label }),
400
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground block text-xs leading-snug", children: t.description })
401
- ] })
402
- ]
403
- }
404
- ) }, t.id);
405
- }) })
406
- ]
409
+ children: /* @__PURE__ */ jsx(AppearanceControls, {})
407
410
  }
408
411
  )
409
412
  ] });
@@ -2496,13 +2499,6 @@ var ENTRIES = [
2496
2499
  sub: "unified docs",
2497
2500
  docsHref: "https://docs.ochk.io"
2498
2501
  },
2499
- {
2500
- slug: "fleet",
2501
- href: "https://fleet.ochk.io",
2502
- label: "oc\xB7fleet",
2503
- sub: "managed \u2014 agent fleet",
2504
- docsHref: "https://docs.ochk.io/fleet"
2505
- },
2506
2502
  {
2507
2503
  slug: "me",
2508
2504
  href: "https://me.ochk.io",
@@ -2568,6 +2564,13 @@ var ENTRIES = [
2568
2564
  }
2569
2565
  ];
2570
2566
  var OWNER_ENTRIES = [
2567
+ {
2568
+ slug: "fleet",
2569
+ href: "https://fleet.ochk.io",
2570
+ label: "oc\xB7fleet",
2571
+ sub: "managed \u2014 agent fleet",
2572
+ docsHref: "https://fleet.ochk.io"
2573
+ },
2571
2574
  {
2572
2575
  slug: "analytics",
2573
2576
  href: "https://analytics.ochk.io",
@@ -2728,15 +2731,6 @@ var FAMILY_PROPERTIES = [
2728
2731
  docsHref: "https://docs.ochk.io/chat",
2729
2732
  category: "product"
2730
2733
  },
2731
- {
2732
- slug: "fleet",
2733
- origin: "https://fleet.ochk.io",
2734
- hostname: "fleet.ochk.io",
2735
- label: "oc\xB7fleet",
2736
- sub: "managed \u2014 agent fleet",
2737
- docsHref: "https://docs.ochk.io/fleet",
2738
- category: "product"
2739
- },
2740
2734
  {
2741
2735
  slug: "attest",
2742
2736
  origin: "https://attest.ochk.io",
@@ -2791,6 +2785,15 @@ var FAMILY_PROPERTIES = [
2791
2785
  docsHref: "https://docs.ochk.io/pledge",
2792
2786
  category: "protocol"
2793
2787
  },
2788
+ {
2789
+ slug: "fleet",
2790
+ origin: "https://fleet.ochk.io",
2791
+ hostname: "fleet.ochk.io",
2792
+ label: "oc\xB7fleet",
2793
+ sub: "managed \u2014 agent fleet",
2794
+ docsHref: "https://fleet.ochk.io",
2795
+ category: "owner"
2796
+ },
2794
2797
  {
2795
2798
  slug: "analytics",
2796
2799
  origin: "https://analytics.ochk.io",
@@ -3334,6 +3337,92 @@ function OcAccountMenu(props) {
3334
3337
  }
3335
3338
  );
3336
3339
  }
3340
+ function MobileMenu({
3341
+ primary,
3342
+ secondary
3343
+ }) {
3344
+ const [open, setOpen] = useState(false);
3345
+ const ref = useRef(null);
3346
+ useEffect(() => {
3347
+ if (!open) return;
3348
+ const onClick = (e) => {
3349
+ if (ref.current && !ref.current.contains(e.target)) setOpen(false);
3350
+ };
3351
+ const onKey = (e) => {
3352
+ if (e.key === "Escape") setOpen(false);
3353
+ };
3354
+ document.addEventListener("mousedown", onClick);
3355
+ document.addEventListener("keydown", onKey);
3356
+ return () => {
3357
+ document.removeEventListener("mousedown", onClick);
3358
+ document.removeEventListener("keydown", onKey);
3359
+ };
3360
+ }, [open]);
3361
+ const links = [...primary ?? [], ...secondary ?? []];
3362
+ const rowCls = "font-display flex items-center gap-2 px-3 py-2 text-[12px] font-semibold tracking-wider uppercase text-muted-foreground hover:text-foreground hover:bg-accent transition-colors";
3363
+ return /* @__PURE__ */ jsxs("div", { ref, className: "relative md:hidden", "data-oc-account-mobile-menu": "", children: [
3364
+ /* @__PURE__ */ jsx(
3365
+ "button",
3366
+ {
3367
+ type: "button",
3368
+ onClick: () => setOpen((v) => !v),
3369
+ "aria-haspopup": "menu",
3370
+ "aria-expanded": open,
3371
+ "aria-label": "menu",
3372
+ className: "border-input bg-background hover:bg-accent text-muted-foreground inline-flex size-8 items-center justify-center rounded-md border transition-colors",
3373
+ "data-oc-account-mobile-toggle": "",
3374
+ children: open ? /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": true }) : /* @__PURE__ */ jsx(Menu, { className: "size-4", "aria-hidden": true })
3375
+ }
3376
+ ),
3377
+ open && /* @__PURE__ */ jsxs(
3378
+ "div",
3379
+ {
3380
+ role: "menu",
3381
+ "aria-label": "menu",
3382
+ className: "border-border bg-popover text-popover-foreground absolute top-[calc(100%+6px)] right-0 z-50 w-[min(16rem,calc(100vw-1rem))] overflow-hidden border shadow-xl",
3383
+ "data-oc-account-mobile-popover": "",
3384
+ children: [
3385
+ links.length > 0 && /* @__PURE__ */ jsxs("div", { className: "border-b p-1", children: [
3386
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 navigate" }),
3387
+ links.map(
3388
+ (l) => l.external ? /* @__PURE__ */ jsxs(
3389
+ "a",
3390
+ {
3391
+ href: l.href,
3392
+ target: "_blank",
3393
+ rel: "noreferrer",
3394
+ role: "menuitem",
3395
+ onClick: () => setOpen(false),
3396
+ className: rowCls,
3397
+ children: [
3398
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3399
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: l.label }),
3400
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70 text-[10px]", "aria-hidden": true, children: "\u2197" })
3401
+ ]
3402
+ },
3403
+ l.href
3404
+ ) : /* @__PURE__ */ jsxs(
3405
+ Link6,
3406
+ {
3407
+ href: l.href,
3408
+ role: "menuitem",
3409
+ onClick: () => setOpen(false),
3410
+ className: rowCls,
3411
+ children: [
3412
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3413
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: l.label })
3414
+ ]
3415
+ },
3416
+ l.href
3417
+ )
3418
+ )
3419
+ ] }),
3420
+ /* @__PURE__ */ jsx(AppearanceControls, {})
3421
+ ]
3422
+ }
3423
+ )
3424
+ ] });
3425
+ }
3337
3426
  function OcAccountMenuView({
3338
3427
  current,
3339
3428
  signInUrl = "/signin",
@@ -3406,220 +3495,220 @@ function OcAccountMenuView({
3406
3495
  children: signInLabel
3407
3496
  }
3408
3497
  );
3498
+ const hasNav = (primaryNavLinks?.length ?? 0) + (secondaryNavLinks?.length ?? 0) > 0;
3499
+ const wrap = (identity) => /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1", className), "data-oc-account-menu": "", children: [
3500
+ hasNav ? /* @__PURE__ */ jsx(MobileMenu, { primary: primaryNavLinks, secondary: secondaryNavLinks }) : null,
3501
+ identity
3502
+ ] });
3409
3503
  if (!hydrated || status === "loading") {
3410
- return signInTrigger;
3504
+ return wrap(signInTrigger);
3411
3505
  }
3412
3506
  if (status !== "authenticated" || !account) {
3413
- return signInTrigger;
3507
+ return wrap(signInTrigger);
3414
3508
  }
3415
3509
  const displayName = account.displayName ?? null;
3416
3510
  const label = displayName ?? obscureIdentity(account.displayIdentity.value);
3417
- return /* @__PURE__ */ jsxs(
3418
- "div",
3419
- {
3420
- ref: wrapRef,
3421
- className: "relative inline-block " + (className ?? ""),
3422
- "data-oc-account-menu": "",
3423
- children: [
3424
- /* @__PURE__ */ jsxs(
3425
- "button",
3426
- {
3427
- type: "button",
3428
- onClick: () => setOpen((v) => !v),
3429
- "aria-haspopup": "menu",
3430
- "aria-expanded": open,
3431
- "aria-label": `Signed in as ${account.didOc}. Open account menu.`,
3432
- className: triggerClassName ?? "border-primary/40 bg-card hover:bg-accent inline-flex h-8 items-center gap-1.5 rounded-md border px-2 font-mono text-[11px] tracking-wide transition-colors sm:px-3",
3433
- "data-oc-account-menu-trigger": "",
3434
- children: [
3435
- /* @__PURE__ */ jsx("span", { className: "bg-primary inline-block size-1.5 shrink-0 rounded-full", "aria-hidden": true }),
3436
- /* @__PURE__ */ jsx("span", { className: "text-foreground hidden max-w-[16ch] truncate sm:inline", children: label }),
3437
- /* @__PURE__ */ jsx(
3438
- "svg",
3439
- {
3440
- width: "9",
3441
- height: "9",
3442
- viewBox: "0 0 10 10",
3443
- "aria-hidden": true,
3444
- className: "opacity-60 transition-transform " + (open ? "rotate-180" : "rotate-0"),
3445
- children: /* @__PURE__ */ jsx(
3446
- "path",
3447
- {
3448
- d: "M2 4 L5 7 L8 4",
3449
- stroke: "currentColor",
3450
- strokeWidth: "1.5",
3451
- fill: "none",
3452
- strokeLinecap: "round"
3453
- }
3454
- )
3455
- }
3456
- )
3457
- ]
3458
- }
3459
- ),
3460
- open && /* @__PURE__ */ jsxs(
3461
- "div",
3462
- {
3463
- role: "menu",
3464
- "aria-label": "Account menu",
3465
- className: popoverClassName ?? "border-border bg-popover text-popover-foreground absolute top-[calc(100%+6px)] right-0 z-50 w-[min(20rem,calc(100vw-1rem))] border shadow-xl",
3466
- "data-oc-account-menu-popover": "",
3467
- children: [
3468
- /* @__PURE__ */ jsxs("div", { className: "border-border border-b p-3", children: [
3469
- /* @__PURE__ */ jsxs("div", { className: "text-primary mb-1 font-mono text-[10px] tracking-widest uppercase", children: [
3470
- "\xA7 signed in \xB7 ",
3471
- hostname,
3472
- tabPinned ? /* @__PURE__ */ jsxs(
3511
+ return wrap(
3512
+ /* @__PURE__ */ jsxs("div", { ref: wrapRef, className: "relative inline-block", children: [
3513
+ /* @__PURE__ */ jsxs(
3514
+ "button",
3515
+ {
3516
+ type: "button",
3517
+ onClick: () => setOpen((v) => !v),
3518
+ "aria-haspopup": "menu",
3519
+ "aria-expanded": open,
3520
+ "aria-label": `Signed in as ${account.didOc}. Open account menu.`,
3521
+ className: triggerClassName ?? "border-primary/40 bg-card hover:bg-accent inline-flex h-8 items-center gap-1.5 rounded-md border px-2 font-mono text-[11px] tracking-wide transition-colors sm:px-3",
3522
+ "data-oc-account-menu-trigger": "",
3523
+ children: [
3524
+ /* @__PURE__ */ jsx("span", { className: "bg-primary inline-block size-1.5 shrink-0 rounded-full", "aria-hidden": true }),
3525
+ /* @__PURE__ */ jsx("span", { className: "text-foreground hidden max-w-[16ch] truncate sm:inline", children: label }),
3526
+ /* @__PURE__ */ jsx(
3527
+ "svg",
3528
+ {
3529
+ width: "9",
3530
+ height: "9",
3531
+ viewBox: "0 0 10 10",
3532
+ "aria-hidden": true,
3533
+ className: "opacity-60 transition-transform " + (open ? "rotate-180" : "rotate-0"),
3534
+ children: /* @__PURE__ */ jsx(
3535
+ "path",
3536
+ {
3537
+ d: "M2 4 L5 7 L8 4",
3538
+ stroke: "currentColor",
3539
+ strokeWidth: "1.5",
3540
+ fill: "none",
3541
+ strokeLinecap: "round"
3542
+ }
3543
+ )
3544
+ }
3545
+ )
3546
+ ]
3547
+ }
3548
+ ),
3549
+ open && /* @__PURE__ */ jsxs(
3550
+ "div",
3551
+ {
3552
+ role: "menu",
3553
+ "aria-label": "Account menu",
3554
+ className: popoverClassName ?? "border-border bg-popover text-popover-foreground absolute top-[calc(100%+6px)] right-0 z-50 w-[min(20rem,calc(100vw-1rem))] border shadow-xl",
3555
+ "data-oc-account-menu-popover": "",
3556
+ children: [
3557
+ /* @__PURE__ */ jsxs("div", { className: "border-border border-b p-3", children: [
3558
+ /* @__PURE__ */ jsxs("div", { className: "text-primary mb-1 font-mono text-[10px] tracking-widest uppercase", children: [
3559
+ "\xA7 signed in \xB7 ",
3560
+ hostname,
3561
+ tabPinned ? /* @__PURE__ */ jsxs(
3562
+ "span",
3563
+ {
3564
+ className: "text-muted-foreground/70 normal-case",
3565
+ "data-oc-account-menu-tab-pin": "",
3566
+ title: "This tab keeps this account even if you switch accounts in another tab",
3567
+ children: [
3568
+ " ",
3569
+ "\xB7 this tab"
3570
+ ]
3571
+ }
3572
+ ) : null
3573
+ ] }),
3574
+ /* @__PURE__ */ jsx(CopyableDid, { did: account.didOc }),
3575
+ displayName ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/80 mt-1 font-mono text-[10px] tracking-wide", children: displayName }) : null
3576
+ ] }),
3577
+ /* @__PURE__ */ jsx(
3578
+ IdentityPromoteSection,
3579
+ {
3580
+ didOc: account.didOc,
3581
+ nostrNpub: account.nostrNpub ?? null,
3582
+ current: account.displayIdentity,
3583
+ open,
3584
+ setDisplayIdentity
3585
+ }
3586
+ ),
3587
+ /* @__PURE__ */ jsx(
3588
+ AccountsSection,
3589
+ {
3590
+ roster: roster ?? [],
3591
+ switchAccount,
3592
+ addAccountUrl,
3593
+ signOut,
3594
+ onActionStart: () => setOpen(false)
3595
+ }
3596
+ ),
3597
+ primaryNavLinks && primaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
3598
+ PopoverSection,
3599
+ {
3600
+ label: "navigate",
3601
+ items: primaryNavLinks,
3602
+ onItemClick: () => setOpen(false),
3603
+ className: "hidden md:block"
3604
+ }
3605
+ ) : null,
3606
+ /* @__PURE__ */ jsxs("div", { className: "p-1", "data-oc-account-menu-section": "account", children: [
3607
+ menuItems?.map((item) => {
3608
+ const onClick = () => setOpen(false);
3609
+ const cls = "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors";
3610
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3611
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3612
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label }),
3613
+ item.external ? /* @__PURE__ */ jsx(
3473
3614
  "span",
3474
3615
  {
3475
- className: "text-muted-foreground/70 normal-case",
3476
- "data-oc-account-menu-tab-pin": "",
3477
- title: "This tab keeps this account even if you switch accounts in another tab",
3478
- children: [
3479
- " ",
3480
- "\xB7 this tab"
3481
- ]
3616
+ className: "text-muted-foreground/70 text-[10px]",
3617
+ "aria-hidden": true,
3618
+ children: "\u2197"
3482
3619
  }
3483
3620
  ) : null
3484
- ] }),
3485
- /* @__PURE__ */ jsx(CopyableDid, { did: account.didOc }),
3486
- displayName ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/80 mt-1 font-mono text-[10px] tracking-wide", children: displayName }) : null
3487
- ] }),
3488
- /* @__PURE__ */ jsx(
3489
- IdentityPromoteSection,
3490
- {
3491
- didOc: account.didOc,
3492
- nostrNpub: account.nostrNpub ?? null,
3493
- current: account.displayIdentity,
3494
- open,
3495
- setDisplayIdentity
3496
- }
3497
- ),
3498
- /* @__PURE__ */ jsx(
3499
- AccountsSection,
3500
- {
3501
- roster: roster ?? [],
3502
- switchAccount,
3503
- addAccountUrl,
3504
- signOut,
3505
- onActionStart: () => setOpen(false)
3506
- }
3507
- ),
3508
- primaryNavLinks && primaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
3509
- PopoverSection,
3510
- {
3511
- label: "navigate",
3512
- items: primaryNavLinks,
3513
- onItemClick: () => setOpen(false)
3514
- }
3515
- ) : null,
3516
- /* @__PURE__ */ jsxs("div", { className: "p-1", "data-oc-account-menu-section": "account", children: [
3517
- primaryNavLinks && primaryNavLinks.length > 0 ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 px-3 pb-1 pt-2 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 account" }) : null,
3518
- menuItems?.map((item) => {
3519
- const onClick = () => setOpen(false);
3520
- const cls = "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors";
3521
- const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3522
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3523
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label }),
3524
- item.external ? /* @__PURE__ */ jsx(
3525
- "span",
3526
- {
3527
- className: "text-muted-foreground/70 text-[10px]",
3528
- "aria-hidden": true,
3529
- children: "\u2197"
3530
- }
3531
- ) : null
3532
- ] });
3533
- return item.external ? /* @__PURE__ */ jsx(
3534
- "a",
3535
- {
3536
- href: item.href,
3537
- target: "_blank",
3538
- rel: "noreferrer",
3539
- onClick,
3540
- role: "menuitem",
3541
- className: cls,
3542
- "data-oc-account-menu-item": "",
3543
- children: inner
3544
- },
3545
- item.href
3546
- ) : /* @__PURE__ */ jsx(
3547
- Link6,
3548
- {
3549
- href: item.href,
3550
- onClick,
3551
- role: "menuitem",
3552
- className: cls,
3553
- "data-oc-account-menu-item": "",
3554
- children: inner
3555
- },
3556
- item.href
3557
- );
3558
- }),
3559
- familyDashboardEnabled ? /* @__PURE__ */ jsxs(
3621
+ ] });
3622
+ return item.external ? /* @__PURE__ */ jsx(
3560
3623
  "a",
3561
3624
  {
3562
- href: "https://ochk.io/dashboard",
3625
+ href: item.href,
3563
3626
  target: "_blank",
3564
3627
  rel: "noreferrer",
3565
- onClick: () => setOpen(false),
3628
+ onClick,
3566
3629
  role: "menuitem",
3567
- className: "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors",
3630
+ className: cls,
3568
3631
  "data-oc-account-menu-item": "",
3569
- "data-oc-account-menu-family-dashboard": "",
3570
- children: [
3571
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3572
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: "family dashboard" }),
3573
- /* @__PURE__ */ jsx(
3574
- "span",
3575
- {
3576
- className: "text-muted-foreground/70 text-[10px]",
3577
- "aria-hidden": true,
3578
- children: "\u2197"
3579
- }
3580
- )
3581
- ]
3582
- }
3583
- ) : null,
3584
- /* @__PURE__ */ jsxs(
3585
- "button",
3632
+ children: inner
3633
+ },
3634
+ item.href
3635
+ ) : /* @__PURE__ */ jsx(
3636
+ Link6,
3586
3637
  {
3587
- type: "button",
3638
+ href: item.href,
3639
+ onClick,
3588
3640
  role: "menuitem",
3589
- onClick: () => {
3590
- setOpen(false);
3591
- void (async () => {
3592
- await signOut();
3593
- if (typeof window !== "undefined") {
3594
- window.location.assign(signOutRedirect);
3595
- }
3596
- })();
3597
- },
3598
- className: "hover:bg-accent flex w-full items-center gap-2 px-3 py-2 text-left font-mono text-[11px] tracking-wide transition-colors",
3641
+ className: cls,
3599
3642
  "data-oc-account-menu-item": "",
3600
- "data-oc-account-menu-signout": "",
3601
- children: [
3602
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3603
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: "sign out" })
3604
- ]
3605
- }
3606
- )
3607
- ] }),
3608
- secondaryNavLinks && secondaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
3609
- PopoverSection,
3643
+ children: inner
3644
+ },
3645
+ item.href
3646
+ );
3647
+ }),
3648
+ familyDashboardEnabled ? /* @__PURE__ */ jsxs(
3649
+ "a",
3610
3650
  {
3611
- label: "more",
3612
- items: secondaryNavLinks,
3613
- onItemClick: () => setOpen(false),
3614
- bordered: true
3651
+ href: "https://ochk.io/dashboard",
3652
+ target: "_blank",
3653
+ rel: "noreferrer",
3654
+ onClick: () => setOpen(false),
3655
+ role: "menuitem",
3656
+ className: "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors",
3657
+ "data-oc-account-menu-item": "",
3658
+ "data-oc-account-menu-family-dashboard": "",
3659
+ children: [
3660
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3661
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: "family dashboard" }),
3662
+ /* @__PURE__ */ jsx(
3663
+ "span",
3664
+ {
3665
+ className: "text-muted-foreground/70 text-[10px]",
3666
+ "aria-hidden": true,
3667
+ children: "\u2197"
3668
+ }
3669
+ )
3670
+ ]
3615
3671
  }
3616
3672
  ) : null,
3617
- build ? /* @__PURE__ */ jsx(BuildFooter, { hostname, build, state: siteState }) : null
3618
- ]
3619
- }
3620
- )
3621
- ]
3622
- }
3673
+ /* @__PURE__ */ jsxs(
3674
+ "button",
3675
+ {
3676
+ type: "button",
3677
+ role: "menuitem",
3678
+ onClick: () => {
3679
+ setOpen(false);
3680
+ void (async () => {
3681
+ await signOut();
3682
+ if (typeof window !== "undefined") {
3683
+ window.location.assign(signOutRedirect);
3684
+ }
3685
+ })();
3686
+ },
3687
+ className: "hover:bg-accent flex w-full items-center gap-2 px-3 py-2 text-left font-mono text-[11px] tracking-wide transition-colors",
3688
+ "data-oc-account-menu-item": "",
3689
+ "data-oc-account-menu-signout": "",
3690
+ children: [
3691
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3692
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: "sign out" })
3693
+ ]
3694
+ }
3695
+ )
3696
+ ] }),
3697
+ secondaryNavLinks && secondaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
3698
+ PopoverSection,
3699
+ {
3700
+ label: "more",
3701
+ items: secondaryNavLinks,
3702
+ onItemClick: () => setOpen(false),
3703
+ bordered: true,
3704
+ className: "hidden md:block"
3705
+ }
3706
+ ) : null,
3707
+ build ? /* @__PURE__ */ jsx(BuildFooter, { hostname, build, state: siteState }) : null
3708
+ ]
3709
+ }
3710
+ )
3711
+ ] })
3623
3712
  );
3624
3713
  }
3625
3714
  function AccountsSection({
@@ -3732,33 +3821,22 @@ function PopoverSection({
3732
3821
  label,
3733
3822
  items,
3734
3823
  onItemClick,
3735
- bordered
3824
+ bordered,
3825
+ className
3736
3826
  }) {
3737
3827
  const cls = "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors";
3738
3828
  return /* @__PURE__ */ jsxs(
3739
3829
  "div",
3740
3830
  {
3741
- className: "p-1 " + (bordered ? "border-border border-t" : ""),
3831
+ className: cn("p-1", bordered && "border-border border-t", className),
3742
3832
  "data-oc-account-menu-section": label,
3743
3833
  children: [
3744
3834
  /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: [
3745
3835
  "\xA7 ",
3746
3836
  label
3747
3837
  ] }),
3748
- items.map((item) => {
3749
- const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3750
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3751
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label }),
3752
- item.external ? /* @__PURE__ */ jsx(
3753
- "span",
3754
- {
3755
- className: "text-muted-foreground/70 text-[10px]",
3756
- "aria-hidden": true,
3757
- children: "\u2197"
3758
- }
3759
- ) : null
3760
- ] });
3761
- return item.external ? /* @__PURE__ */ jsx(
3838
+ items.map(
3839
+ (item) => item.external ? /* @__PURE__ */ jsxs(
3762
3840
  "a",
3763
3841
  {
3764
3842
  href: item.href,
@@ -3768,10 +3846,14 @@ function PopoverSection({
3768
3846
  role: "menuitem",
3769
3847
  className: cls,
3770
3848
  "data-oc-account-menu-item": "",
3771
- children: inner
3849
+ children: [
3850
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3851
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label }),
3852
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70 text-[10px]", "aria-hidden": true, children: "\u2197" })
3853
+ ]
3772
3854
  },
3773
3855
  item.href
3774
- ) : /* @__PURE__ */ jsx(
3856
+ ) : /* @__PURE__ */ jsxs(
3775
3857
  Link6,
3776
3858
  {
3777
3859
  href: item.href,
@@ -3779,11 +3861,14 @@ function PopoverSection({
3779
3861
  role: "menuitem",
3780
3862
  className: cls,
3781
3863
  "data-oc-account-menu-item": "",
3782
- children: inner
3864
+ children: [
3865
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3866
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label })
3867
+ ]
3783
3868
  },
3784
3869
  item.href
3785
- );
3786
- })
3870
+ )
3871
+ )
3787
3872
  ]
3788
3873
  }
3789
3874
  );
@@ -3835,146 +3920,54 @@ function isActive(pathname, link) {
3835
3920
  if (link.href === "/") return pathname === "/";
3836
3921
  return pathname === link.href || pathname.startsWith(link.href + "/");
3837
3922
  }
3838
- function ExternalGlyph() {
3839
- return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-muted-foreground/60 ml-1 text-[9px]", children: "\u2197" });
3840
- }
3841
3923
  function OcPrimaryNav({
3842
3924
  activePath,
3843
3925
  links,
3844
3926
  className
3845
3927
  }) {
3846
- const [open, setOpen] = useState(false);
3847
- const ref = useRef(null);
3848
- const menuId = useId();
3849
- useEffect(() => {
3850
- setOpen(false);
3851
- }, [activePath]);
3852
- useEffect(() => {
3853
- if (!open) return;
3854
- const onClick = (e) => {
3855
- if (ref.current && !ref.current.contains(e.target)) setOpen(false);
3856
- };
3857
- const onKey = (e) => {
3858
- if (e.key === "Escape") setOpen(false);
3859
- };
3860
- document.addEventListener("mousedown", onClick);
3861
- document.addEventListener("keydown", onKey);
3862
- return () => {
3863
- document.removeEventListener("mousedown", onClick);
3864
- document.removeEventListener("keydown", onKey);
3865
- };
3866
- }, [open]);
3867
- const inlineClass = (active) => "font-display shrink-0 px-2 py-1 sm:px-3 text-[11px] sm:text-[12px] font-semibold tracking-wider uppercase transition-colors " + (active ? "text-primary" : "text-muted-foreground hover:text-foreground");
3868
- const rowClass = (active) => "font-display flex items-center gap-2 px-3 py-2 text-[12px] font-semibold tracking-wider uppercase transition-colors " + (active ? "text-primary" : "text-muted-foreground hover:text-foreground hover:bg-accent");
3869
- function renderInline(link) {
3870
- const active = isActive(activePath, link);
3871
- const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3872
- link.label,
3873
- link.external ? /* @__PURE__ */ jsx(ExternalGlyph, {}) : null
3874
- ] });
3875
- return link.external ? /* @__PURE__ */ jsx(
3876
- "a",
3877
- {
3878
- href: link.href,
3879
- target: "_blank",
3880
- rel: "noreferrer",
3881
- className: inlineClass(false),
3882
- "data-oc-primary-nav-item": "",
3883
- children: inner
3884
- },
3885
- link.href
3886
- ) : /* @__PURE__ */ jsx(
3887
- Link6,
3888
- {
3889
- href: link.href,
3890
- "aria-current": active ? "page" : void 0,
3891
- className: inlineClass(active),
3892
- "data-oc-primary-nav-item": active ? "active" : "sibling",
3893
- children: inner
3894
- },
3895
- link.href
3896
- );
3897
- }
3898
- function renderRow(link) {
3899
- const active = isActive(activePath, link);
3900
- const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3901
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3902
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: link.label }),
3903
- link.external ? /* @__PURE__ */ jsx(ExternalGlyph, {}) : null
3904
- ] });
3905
- return link.external ? /* @__PURE__ */ jsx(
3906
- "a",
3907
- {
3908
- href: link.href,
3909
- target: "_blank",
3910
- rel: "noreferrer",
3911
- role: "menuitem",
3912
- onClick: () => setOpen(false),
3913
- className: rowClass(false),
3914
- "data-oc-primary-nav-item": "",
3915
- children: inner
3916
- },
3917
- link.href
3918
- ) : /* @__PURE__ */ jsx(
3919
- Link6,
3920
- {
3921
- href: link.href,
3922
- role: "menuitem",
3923
- "aria-current": active ? "page" : void 0,
3924
- onClick: () => setOpen(false),
3925
- className: rowClass(active),
3926
- "data-oc-primary-nav-item": active ? "active" : "sibling",
3927
- children: inner
3928
- },
3929
- link.href
3930
- );
3931
- }
3932
- return /* @__PURE__ */ jsxs(
3933
- "div",
3928
+ return /* @__PURE__ */ jsx(
3929
+ "nav",
3934
3930
  {
3935
- ref,
3936
- className: "relative flex items-center justify-center " + (className ?? ""),
3931
+ "aria-label": "primary",
3932
+ className: "hidden items-center gap-0.5 sm:gap-1 md:flex " + (className ?? ""),
3937
3933
  "data-oc-primary-nav": "",
3938
- children: [
3939
- /* @__PURE__ */ jsx(
3940
- "nav",
3941
- {
3942
- "aria-label": "primary",
3943
- className: "hidden items-center gap-0.5 sm:gap-1 md:flex",
3944
- children: links.map(renderInline)
3945
- }
3946
- ),
3947
- /* @__PURE__ */ jsxs("div", { className: "md:hidden", children: [
3948
- /* @__PURE__ */ jsx(
3949
- "button",
3934
+ children: links.map((link) => {
3935
+ const active = isActive(activePath, link);
3936
+ const cls = "font-display shrink-0 px-2 py-1 sm:px-3 text-[11px] sm:text-[12px] font-semibold tracking-wider uppercase transition-colors " + (active ? "text-primary" : "text-muted-foreground hover:text-foreground");
3937
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
3938
+ link.label,
3939
+ link.external ? /* @__PURE__ */ jsx(
3940
+ "span",
3950
3941
  {
3951
- type: "button",
3952
- onClick: () => setOpen((v) => !v),
3953
- "aria-haspopup": "menu",
3954
- "aria-expanded": open,
3955
- "aria-controls": menuId,
3956
- "aria-label": "site navigation",
3957
- className: "border-input bg-background hover:bg-accent text-muted-foreground inline-flex size-8 items-center justify-center rounded-md border transition-colors",
3958
- "data-oc-primary-nav-toggle": "",
3959
- children: open ? /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": true }) : /* @__PURE__ */ jsx(Menu, { className: "size-4", "aria-hidden": true })
3960
- }
3961
- ),
3962
- open && /* @__PURE__ */ jsxs(
3963
- "div",
3964
- {
3965
- id: menuId,
3966
- role: "menu",
3967
- "aria-label": "primary",
3968
- className: "border-border bg-popover text-popover-foreground absolute top-[calc(100%+8px)] left-1/2 z-50 w-[min(15rem,calc(100vw-1rem))] -translate-x-1/2 border p-1 shadow-xl",
3969
- "data-oc-primary-nav-popover": "",
3970
- children: [
3971
- /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 navigate" }),
3972
- links.map(renderRow)
3973
- ]
3942
+ "aria-hidden": true,
3943
+ className: "text-muted-foreground/60 ml-1 text-[9px]",
3944
+ children: "\u2197"
3974
3945
  }
3975
- )
3976
- ] })
3977
- ]
3946
+ ) : null
3947
+ ] });
3948
+ return link.external ? /* @__PURE__ */ jsx(
3949
+ "a",
3950
+ {
3951
+ href: link.href,
3952
+ target: "_blank",
3953
+ rel: "noreferrer",
3954
+ className: cls,
3955
+ "data-oc-primary-nav-item": "",
3956
+ children: content
3957
+ },
3958
+ link.href
3959
+ ) : /* @__PURE__ */ jsx(
3960
+ Link6,
3961
+ {
3962
+ href: link.href,
3963
+ "aria-current": active ? "page" : void 0,
3964
+ className: cls,
3965
+ "data-oc-primary-nav-item": active ? "active" : "sibling",
3966
+ children: content
3967
+ },
3968
+ link.href
3969
+ );
3970
+ })
3978
3971
  }
3979
3972
  );
3980
3973
  }
@@ -4320,6 +4313,6 @@ function OcAppBar({
4320
4313
  );
4321
4314
  }
4322
4315
 
4323
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, AppShell, Badge, Bar, BitcoinAddress, Button, Callout, Card, Checkbox, ConfirmHost, CopyButton, DEFAULT_OC_THEME, DataRow, DefinitionList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EcosystemSwitcher, EmptyState, ErrorBoundary, FAMILY_PROPERTIES, HelpHint, Input, Label, LayoutSubHeader, Modal, OC_DEFAULT_ACCENT, OC_SKIN_COOKIE, OC_THEMES, OcAccountMenu, OcAccountMenuView, OcAppBar, OcAppearanceMenu, OcAurora, OcDashboardHub, OcDashboardShell, OcLogoDropdown, OcPrimaryNav, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SITE_STATE_LABEL, SatsAmount, SectionHeader, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatCard, StatGrid, StatTile, StatusPill, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Tooltip, Working, WorkingPanel, accentFor, asOf, badgeVariants, buttonVariants, cn, confirm, explorerUrl, findFamilyProperty, formatSats, formatSatsCompact, getOcThemeInitScript, isKnownTheme, makeStatusPill, priceBoth, prompt, relativeTime, resolveTheme, satsToUsd, shortenAddress, usdToSats, useOcSkin, useSpotPrice };
4316
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, AppShell, AppearanceControls, Badge, Bar, BitcoinAddress, Button, Callout, Card, Checkbox, ConfirmHost, CopyButton, DEFAULT_OC_THEME, DataRow, DefinitionList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EcosystemSwitcher, EmptyState, ErrorBoundary, FAMILY_PROPERTIES, HelpHint, Input, Label, LayoutSubHeader, Modal, OC_DEFAULT_ACCENT, OC_SKIN_COOKIE, OC_THEMES, OcAccountMenu, OcAccountMenuView, OcAppBar, OcAppearanceMenu, OcAurora, OcDashboardHub, OcDashboardShell, OcLogoDropdown, OcPrimaryNav, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SITE_STATE_LABEL, SatsAmount, SectionHeader, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatCard, StatGrid, StatTile, StatusPill, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Tooltip, Working, WorkingPanel, accentFor, asOf, badgeVariants, buttonVariants, cn, confirm, explorerUrl, findFamilyProperty, formatSats, formatSatsCompact, getOcThemeInitScript, isKnownTheme, makeStatusPill, priceBoth, prompt, relativeTime, resolveTheme, satsToUsd, shortenAddress, usdToSats, useOcSkin, useSpotPrice };
4324
4317
  //# sourceMappingURL=index.mjs.map
4325
4318
  //# sourceMappingURL=index.mjs.map