@orangecheck/ui 0.7.0 → 0.8.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
@@ -492,6 +492,8 @@ function OcAccountMenuView({
492
492
  signInUrl = "/signin",
493
493
  signInLabel = "sign in",
494
494
  menuItems,
495
+ primaryNavLinks,
496
+ secondaryNavLinks,
495
497
  showFamilyDashboard,
496
498
  build,
497
499
  siteState,
@@ -613,7 +615,16 @@ function OcAccountMenuView({
613
615
  /* @__PURE__ */ jsx("div", { className: "text-foreground/90 font-mono text-[11px] leading-tight break-all", children: account.didOc }),
614
616
  displayName ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/80 mt-1 font-mono text-[10px] tracking-wide", children: displayName }) : null
615
617
  ] }),
616
- /* @__PURE__ */ jsxs("div", { className: "p-1", children: [
618
+ primaryNavLinks && primaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
619
+ PopoverSection,
620
+ {
621
+ label: "navigate",
622
+ items: primaryNavLinks,
623
+ onItemClick: () => setOpen(false)
624
+ }
625
+ ) : null,
626
+ /* @__PURE__ */ jsxs("div", { className: "p-1", "data-oc-account-menu-section": "account", children: [
627
+ 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,
617
628
  menuItems?.map((item) => {
618
629
  const onClick = () => setOpen(false);
619
630
  const cls = "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors";
@@ -699,6 +710,15 @@ function OcAccountMenuView({
699
710
  }
700
711
  )
701
712
  ] }),
713
+ secondaryNavLinks && secondaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
714
+ PopoverSection,
715
+ {
716
+ label: "more",
717
+ items: secondaryNavLinks,
718
+ onItemClick: () => setOpen(false),
719
+ bordered: true
720
+ }
721
+ ) : null,
702
722
  build ? /* @__PURE__ */ jsx(BuildFooter, { hostname, build, state: siteState }) : null
703
723
  ]
704
724
  }
@@ -707,6 +727,66 @@ function OcAccountMenuView({
707
727
  }
708
728
  );
709
729
  }
730
+ function PopoverSection({
731
+ label,
732
+ items,
733
+ onItemClick,
734
+ bordered
735
+ }) {
736
+ const cls = "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors";
737
+ return /* @__PURE__ */ jsxs(
738
+ "div",
739
+ {
740
+ className: "p-1 " + (bordered ? "border-border border-t" : ""),
741
+ "data-oc-account-menu-section": label,
742
+ children: [
743
+ /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: [
744
+ "\xA7 ",
745
+ label
746
+ ] }),
747
+ items.map((item) => {
748
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
749
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
750
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label }),
751
+ item.external ? /* @__PURE__ */ jsx(
752
+ "span",
753
+ {
754
+ className: "text-muted-foreground/70 text-[10px]",
755
+ "aria-hidden": true,
756
+ children: "\u2197"
757
+ }
758
+ ) : null
759
+ ] });
760
+ return item.external ? /* @__PURE__ */ jsx(
761
+ "a",
762
+ {
763
+ href: item.href,
764
+ target: "_blank",
765
+ rel: "noreferrer",
766
+ onClick: onItemClick,
767
+ role: "menuitem",
768
+ className: cls,
769
+ "data-oc-account-menu-item": "",
770
+ children: inner
771
+ },
772
+ item.href
773
+ ) : /* @__PURE__ */ jsx(
774
+ Link5,
775
+ {
776
+ href: item.href,
777
+ onClick: onItemClick,
778
+ role: "menuitem",
779
+ className: cls,
780
+ "data-oc-account-menu-item": "",
781
+ children: inner
782
+ },
783
+ item.href
784
+ );
785
+ })
786
+ ]
787
+ }
788
+ );
789
+ }
710
790
  function BuildFooter({
711
791
  hostname,
712
792
  build,