@tangle-network/sandbox-ui 0.122.2 → 0.123.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.
@@ -1,9 +1,9 @@
1
- import { Wt as Logo, o as Button$1 } from "./primitives-C4qn9fZ8.js";
1
+ import { Wt as Logo, o as Button$1 } from "./primitives-Db_ASpuT.js";
2
2
  import { t as cn$1 } from "./utils-DzWbktWG.js";
3
3
  import { n as MOTION_SURFACE, r as MOTION_TRAVEL, t as MOTION_CONTROL } from "./motion-DkyBRJb9.js";
4
4
  import { i as moonshot_default } from "./model-brand-hMyDTUqB.js";
5
- import "./page-layout-Cf90DTWr.js";
6
- import { Avatar, AvatarFallback, AvatarImage, Badge, Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Skeleton, StatCard, useTheme } from "@tangle-network/ui/primitives";
5
+ import "./page-layout-DJV7cbxx.js";
6
+ import { Avatar, AvatarFallback, AvatarImage, Badge, Button, Dialog, DialogClose, DialogContent, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Skeleton, StatCard, useTheme } from "@tangle-network/ui/primitives";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import * as React$1 from "react";
9
9
  import { useEffect, useRef, useState } from "react";
@@ -2721,30 +2721,121 @@ function DefaultLink$1({ href, to, className, children, ...rest }) {
2721
2721
  children
2722
2722
  });
2723
2723
  }
2724
- function DashboardLayoutInner({ children, variant = "sandbox", navItems, modeItems = [], panels = [], activeNavId, user, isLoading = false, onLogout, onSettingsClick, settingsHref = "/dashboard/settings", onNewSandbox, className, sidebarClassName, contentClassName, topNavLinks, activeTopNavHref, topBarLeading, LinkComponent = DefaultLink$1, logoHref = "/", labeledRail = false, footer, railFooter, profileMenuItems, appearance, notifications: notifData, notificationsEnabled = true, collapseEmptyTopBar = false }) {
2724
+ /** Notifications use the shared menu's collision handling, keyboard movement and focus return. */
2725
+ function SidebarNotifications({ data, showLabels, mobile }) {
2726
+ const unread = data?.unreadCount ?? 0;
2727
+ const NotificationIcon = ({ className }) => /* @__PURE__ */ jsxs("span", {
2728
+ className: "relative",
2729
+ children: [/* @__PURE__ */ jsx(Bell, {
2730
+ className,
2731
+ "aria-hidden": "true"
2732
+ }), unread > 0 && /* @__PURE__ */ jsx("span", {
2733
+ className: "absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-surface-container-low",
2734
+ "aria-hidden": "true"
2735
+ })]
2736
+ });
2737
+ const content = (item) => /* @__PURE__ */ jsxs(Fragment, { children: [
2738
+ /* @__PURE__ */ jsx("p", {
2739
+ className: cn$1("text-sm", item.read ? "text-muted-foreground" : "font-semibold text-foreground"),
2740
+ children: item.title
2741
+ }),
2742
+ /* @__PURE__ */ jsx("p", {
2743
+ className: "mt-1 text-sm text-muted-foreground",
2744
+ children: item.message
2745
+ }),
2746
+ /* @__PURE__ */ jsx("time", {
2747
+ className: "mt-1 block text-xs text-muted-foreground",
2748
+ dateTime: item.createdAt,
2749
+ children: formatNotifDate(item.createdAt)
2750
+ })
2751
+ ] });
2752
+ return /* @__PURE__ */ jsxs(DropdownMenu, {
2753
+ modal: false,
2754
+ children: [/* @__PURE__ */ jsx(RailButton, {
2755
+ icon: NotificationIcon,
2756
+ label: "Notifications",
2757
+ showLabel: showLabels,
2758
+ asChild: true,
2759
+ children: /* @__PURE__ */ jsx(DropdownMenuTrigger, {
2760
+ "aria-label": "Notifications",
2761
+ "aria-description": unread > 0 ? `${unread} unread` : void 0
2762
+ })
2763
+ }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
2764
+ "aria-label": "Notifications",
2765
+ side: mobile ? "top" : "right",
2766
+ align: mobile ? "start" : "end",
2767
+ sideOffset: 12,
2768
+ collisionPadding: 12,
2769
+ className: "w-80 max-w-[calc(100vw-24px)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto p-1.5",
2770
+ children: [
2771
+ /* @__PURE__ */ jsx(DropdownMenuLabel, {
2772
+ className: "px-2.5 py-2 text-sm",
2773
+ children: "Notifications"
2774
+ }),
2775
+ unread > 0 && data?.onMarkAllRead && /* @__PURE__ */ jsx(DropdownMenuItem, {
2776
+ onSelect: (event) => {
2777
+ event.preventDefault();
2778
+ data.onMarkAllRead?.();
2779
+ },
2780
+ children: "Mark all read"
2781
+ }),
2782
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
2783
+ !data?.items.length ? /* @__PURE__ */ jsx("p", {
2784
+ className: "px-2.5 py-5 text-sm text-muted-foreground",
2785
+ children: "No notifications yet"
2786
+ }) : data.items.map((item) => !item.read && data.onMarkRead ? /* @__PURE__ */ jsx(DropdownMenuItem, {
2787
+ className: "block whitespace-normal px-2.5 py-3",
2788
+ onSelect: (event) => {
2789
+ event.preventDefault();
2790
+ data.onMarkRead?.(item.id);
2791
+ },
2792
+ children: content(item)
2793
+ }, item.id) : /* @__PURE__ */ jsx("div", {
2794
+ className: "px-2.5 py-3",
2795
+ children: content(item)
2796
+ }, item.id))
2797
+ ]
2798
+ })]
2799
+ });
2800
+ }
2801
+ function SidebarLeading({ content, legacy, collapsed }) {
2802
+ if (typeof content === "function") return content({ collapsed });
2803
+ const node = content ?? legacy;
2804
+ if (!node) return null;
2805
+ if (!collapsed) return node;
2806
+ return /* @__PURE__ */ jsxs(DropdownMenu, {
2807
+ modal: false,
2808
+ children: [/* @__PURE__ */ jsx(RailButton, {
2809
+ icon: Users,
2810
+ label: "Workspace",
2811
+ asChild: true,
2812
+ children: /* @__PURE__ */ jsx(DropdownMenuTrigger, {})
2813
+ }), /* @__PURE__ */ jsx(DropdownMenuContent, {
2814
+ "aria-label": "Workspace",
2815
+ side: "right",
2816
+ align: "start",
2817
+ sideOffset: 12,
2818
+ collisionPadding: 12,
2819
+ className: "w-64 max-w-[calc(100vw-24px)] p-3",
2820
+ children: node
2821
+ })]
2822
+ });
2823
+ }
2824
+ function DashboardLayoutInner({ children, variant = "sandbox", navItems, modeItems = [], panels = [], activeNavId, user, isLoading = false, onLogout, onSettingsClick, settingsHref = "/dashboard/settings", onNewSandbox, className, sidebarClassName, contentClassName, topNavLinks, activeTopNavHref, topBarLeading, sidebarLeading, LinkComponent = DefaultLink$1, logoHref = "/", labeledRail = false, footer, railFooter, profileMenuItems, appearance, notifications: notifData, notificationsEnabled = true }) {
2725
2825
  useBrandThemeSync();
2726
2826
  const Link = LinkComponent;
2727
2827
  const [mobileMenuOpen, setMobileMenuOpen] = React$1.useState(false);
2728
- const [notificationsOpen, setNotificationsOpen] = React$1.useState(false);
2729
- const notifRef = React$1.useRef(null);
2730
2828
  React$1.useEffect(() => {
2731
- if (!notificationsOpen) return;
2732
- const handler = (e) => {
2733
- if (notifRef.current && !notifRef.current.contains(e.target)) setNotificationsOpen(false);
2734
- };
2735
- const keyHandler = (e) => {
2736
- if (e.key === "Escape") setNotificationsOpen(false);
2829
+ if (typeof window.matchMedia !== "function") return;
2830
+ const desktop = window.matchMedia("(min-width: 1024px)");
2831
+ const closeOnDesktop = () => {
2832
+ if (desktop.matches) setMobileMenuOpen(false);
2737
2833
  };
2738
- document.addEventListener("mousedown", handler);
2739
- document.addEventListener("keydown", keyHandler);
2740
- return () => {
2741
- document.removeEventListener("mousedown", handler);
2742
- document.removeEventListener("keydown", keyHandler);
2743
- };
2744
- }, [notificationsOpen]);
2745
- const { contentMargin, hidden, mode, hasPanels, panelOpen, toggleRail, railCollapsed } = useSidebar();
2834
+ desktop.addEventListener("change", closeOnDesktop);
2835
+ return () => desktop.removeEventListener("change", closeOnDesktop);
2836
+ }, []);
2837
+ const { mode, hasPanels, panelOpen, toggleRail, railCollapsed } = useSidebar();
2746
2838
  const modeSet = React$1.useMemo(() => new Set(modeItems), [modeItems]);
2747
- const collapseDesktopTopBar = collapseEmptyTopBar && React$1.Children.toArray(topBarLeading).length === 0 && (topNavLinks?.length ?? 0) === 0 && !onNewSandbox && !notificationsEnabled;
2748
2839
  const sidebarUser = React$1.useMemo(() => user ? {
2749
2840
  email: user.email,
2750
2841
  name: user.name,
@@ -2757,7 +2848,7 @@ function DashboardLayoutInner({ children, variant = "sandbox", navItems, modeIte
2757
2848
  user?.avatarUrl
2758
2849
  ]);
2759
2850
  const activePanel = panels.find((p) => p.mode === mode);
2760
- const buildSidebarContent = React$1.useCallback((showLabels, allowCollapse) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(SidebarRail, {
2851
+ const buildSidebarContent = React$1.useCallback((showLabels, allowCollapse, mobile = false) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(SidebarRail, {
2761
2852
  wide: showLabels,
2762
2853
  children: [
2763
2854
  /* @__PURE__ */ jsx(RailHeader, {
@@ -2772,12 +2863,30 @@ function DashboardLayoutInner({ children, variant = "sandbox", navItems, modeIte
2772
2863
  collapsible: allowCollapse,
2773
2864
  LinkComponent: Link
2774
2865
  }),
2775
- /* @__PURE__ */ jsx(SidebarRailNav, {
2866
+ (sidebarLeading != null || topBarLeading != null || onNewSandbox) && /* @__PURE__ */ jsxs("div", {
2867
+ className: cn$1("flex shrink-0 flex-col gap-2 pt-3", showLabels ? "px-2" : "items-center px-1"),
2868
+ children: [(sidebarLeading != null || topBarLeading != null) && /* @__PURE__ */ jsx(SidebarLeading, {
2869
+ content: sidebarLeading,
2870
+ legacy: topBarLeading,
2871
+ collapsed: !showLabels
2872
+ }), onNewSandbox && /* @__PURE__ */ jsx(RailButton, {
2873
+ icon: Plus,
2874
+ label: "New Sandbox",
2875
+ variant: "primary",
2876
+ showLabel: showLabels,
2877
+ className: "min-h-11",
2878
+ onClick: () => {
2879
+ if (mobile) setMobileMenuOpen(false);
2880
+ onNewSandbox();
2881
+ }
2882
+ })]
2883
+ }),
2884
+ /* @__PURE__ */ jsxs(SidebarRailNav, {
2776
2885
  className: cn$1(showLabels ? "px-2" : void 0, !showLabels && allowCollapse && "cursor-pointer"),
2777
2886
  onClick: !showLabels && allowCollapse ? (e) => {
2778
2887
  if (e.target === e.currentTarget) toggleRail();
2779
2888
  } : void 0,
2780
- children: navItems.map((item, i) => {
2889
+ children: [navItems.map((item, i) => {
2781
2890
  const isMode = modeSet.has(item.id);
2782
2891
  const prevIsMode = i > 0 && modeSet.has(navItems[i - 1].id);
2783
2892
  const showSep = i > 0 && isMode && !prevIsMode;
@@ -2804,19 +2913,39 @@ function DashboardLayoutInner({ children, variant = "sandbox", navItems, modeIte
2804
2913
  to: item.href
2805
2914
  })
2806
2915
  })] }, item.id);
2807
- })
2916
+ }), topNavLinks?.map((link) => /* @__PURE__ */ jsx(RailButton, {
2917
+ icon: ExternalLink,
2918
+ label: link.label,
2919
+ isActive: activeTopNavHref === link.href,
2920
+ showLabel: showLabels,
2921
+ asChild: true,
2922
+ children: /* @__PURE__ */ jsx(Link, {
2923
+ href: link.href,
2924
+ to: link.href
2925
+ })
2926
+ }, link.href))]
2808
2927
  }),
2809
- /* @__PURE__ */ jsx(SidebarRailFooter, {
2928
+ /* @__PURE__ */ jsxs(SidebarRailFooter, {
2810
2929
  className: cn$1("border-t border-[var(--md3-outline-variant)] pt-2", showLabels && "items-stretch px-2"),
2811
- children: railFooter !== void 0 ? showLabels ? /* @__PURE__ */ jsxs("div", {
2930
+ children: [notificationsEnabled && /* @__PURE__ */ jsx(SidebarNotifications, {
2931
+ data: notifData,
2932
+ showLabels,
2933
+ mobile
2934
+ }), railFooter !== void 0 ? showLabels ? /* @__PURE__ */ jsxs("div", {
2812
2935
  className: "flex w-full items-center gap-1",
2813
2936
  children: [/* @__PURE__ */ jsx("div", {
2814
2937
  className: "min-w-0 flex-1",
2815
2938
  children: /* @__PURE__ */ jsx(ProfileAvatar, {
2816
2939
  user: sidebarUser,
2817
2940
  isLoading,
2818
- onLogout,
2819
- onSettingsClick,
2941
+ onLogout: onLogout ? () => {
2942
+ if (mobile) setMobileMenuOpen(false);
2943
+ onLogout();
2944
+ } : void 0,
2945
+ onSettingsClick: onSettingsClick ? () => {
2946
+ if (mobile) setMobileMenuOpen(false);
2947
+ onSettingsClick();
2948
+ } : void 0,
2820
2949
  settingsHref,
2821
2950
  showDetails: showLabels,
2822
2951
  appearance,
@@ -2832,8 +2961,14 @@ function DashboardLayoutInner({ children, variant = "sandbox", navItems, modeIte
2832
2961
  children: [railFooter, /* @__PURE__ */ jsx(ProfileAvatar, {
2833
2962
  user: sidebarUser,
2834
2963
  isLoading,
2835
- onLogout,
2836
- onSettingsClick,
2964
+ onLogout: onLogout ? () => {
2965
+ if (mobile) setMobileMenuOpen(false);
2966
+ onLogout();
2967
+ } : void 0,
2968
+ onSettingsClick: onSettingsClick ? () => {
2969
+ if (mobile) setMobileMenuOpen(false);
2970
+ onSettingsClick();
2971
+ } : void 0,
2837
2972
  settingsHref,
2838
2973
  showDetails: showLabels,
2839
2974
  appearance,
@@ -2843,18 +2978,31 @@ function DashboardLayoutInner({ children, variant = "sandbox", navItems, modeIte
2843
2978
  }) : /* @__PURE__ */ jsx(ProfileAvatar, {
2844
2979
  user: sidebarUser,
2845
2980
  isLoading,
2846
- onLogout,
2847
- onSettingsClick,
2981
+ onLogout: onLogout ? () => {
2982
+ if (mobile) setMobileMenuOpen(false);
2983
+ onLogout();
2984
+ } : void 0,
2985
+ onSettingsClick: onSettingsClick ? () => {
2986
+ if (mobile) setMobileMenuOpen(false);
2987
+ onSettingsClick();
2988
+ } : void 0,
2848
2989
  settingsHref,
2849
2990
  showDetails: showLabels,
2850
2991
  appearance,
2851
2992
  LinkComponent,
2852
2993
  children: profileMenuItems
2853
- })
2994
+ })]
2854
2995
  })
2855
2996
  ]
2856
2997
  }), panels.length > 0 && /* @__PURE__ */ jsxs(SidebarPanel, { children: [/* @__PURE__ */ jsx(SidebarPanelHeader, { title: activePanel?.title ?? mode }), /* @__PURE__ */ jsx(SidebarPanelContent, { children: activePanel?.content })] })] }), [
2857
2998
  Link,
2999
+ onNewSandbox,
3000
+ sidebarLeading,
3001
+ topBarLeading,
3002
+ topNavLinks,
3003
+ activeTopNavHref,
3004
+ notificationsEnabled,
3005
+ notifData,
2858
3006
  variant,
2859
3007
  logoHref,
2860
3008
  labeledRail,
@@ -2881,137 +3029,63 @@ function DashboardLayoutInner({ children, variant = "sandbox", navItems, modeIte
2881
3029
  labeledRail,
2882
3030
  railCollapsed
2883
3031
  ]);
2884
- const mobileSidebarContent = React$1.useMemo(() => buildSidebarContent(true, false), [buildSidebarContent]);
3032
+ const mobileSidebarContent = React$1.useMemo(() => buildSidebarContent(true, false, true), [buildSidebarContent]);
2885
3033
  return /* @__PURE__ */ jsxs("div", {
2886
3034
  className: cn$1("min-h-screen bg-surface text-foreground", className),
2887
3035
  children: [
2888
- /* @__PURE__ */ jsxs("nav", {
2889
- className: cn$1("fixed top-0 left-0 right-0 lg:left-[var(--sb-content-margin)] z-50 bg-surface-container-low border-b border-[var(--md3-outline-variant)] flex justify-between items-center px-8 h-14 font-sans text-[13px] tracking-tight transition-[left,width]", MOTION_TRAVEL, collapseDesktopTopBar && "lg:hidden"),
2890
- style: { "--sb-content-margin": `${hidden ? 0 : contentMargin}px` },
2891
- children: [
2892
- /* @__PURE__ */ jsxs("div", {
2893
- className: "flex items-center gap-8",
2894
- children: [
2895
- /* @__PURE__ */ jsx(Link, {
2896
- href: logoHref,
2897
- to: logoHref,
2898
- className: cn$1("lg:hidden flex items-center p-1 rounded-md hover:bg-surface-container-high transition-colors", MOTION_CONTROL),
2899
- children: /* @__PURE__ */ jsx(Logo, {
2900
- variant,
2901
- size: "sm",
2902
- iconOnly: true
2903
- })
2904
- }),
2905
- topBarLeading,
2906
- topNavLinks && topNavLinks.length > 0 && /* @__PURE__ */ jsx("div", {
2907
- className: "hidden md:flex gap-6",
2908
- children: topNavLinks.map((link) => /* @__PURE__ */ jsx(Link, {
2909
- href: link.href,
2910
- to: link.href,
2911
- className: cn$1("transition-all px-2 py-1 rounded", "duration-[var(--duration-fast)] ease-[var(--ease-standard)]", activeTopNavHref === link.href ? "text-foreground border-b-2 border-primary pb-1" : "text-muted-foreground hover:text-foreground hover:bg-surface-container-high"),
2912
- children: link.label
2913
- }, link.href))
2914
- })
2915
- ]
2916
- }),
2917
- /* @__PURE__ */ jsxs("div", {
2918
- className: "flex items-center gap-4",
2919
- children: [onNewSandbox && /* @__PURE__ */ jsxs("button", {
3036
+ /* @__PURE__ */ jsxs(Dialog, {
3037
+ open: mobileMenuOpen,
3038
+ onOpenChange: setMobileMenuOpen,
3039
+ children: [/* @__PURE__ */ jsxs("nav", {
3040
+ "aria-label": "Mobile navigation",
3041
+ className: "fixed inset-x-0 top-0 z-40 flex h-12 items-center justify-between border-b border-[var(--md3-outline-variant)] bg-surface-container-low px-4 lg:hidden",
3042
+ children: [/* @__PURE__ */ jsx(Link, {
3043
+ href: logoHref,
3044
+ to: logoHref,
3045
+ "aria-label": "Home",
3046
+ className: cn$1("rounded-md p-1", focusRing),
3047
+ children: /* @__PURE__ */ jsx(Logo, {
3048
+ variant,
3049
+ size: "sm",
3050
+ iconOnly: true
3051
+ })
3052
+ }), /* @__PURE__ */ jsx(DialogTrigger, {
3053
+ asChild: true,
3054
+ children: /* @__PURE__ */ jsx("button", {
2920
3055
  type: "button",
2921
- onClick: onNewSandbox,
2922
- className: cn$1("hidden md:flex items-center gap-2 bg-[var(--btn-primary-bg)] border border-[var(--border-accent)] text-[var(--btn-primary-text)] px-4 py-2 rounded-lg font-bold hover:bg-[var(--btn-primary-hover)] transition-all active:scale-95 text-xs", "duration-[var(--duration-fast)] ease-[var(--ease-standard)]"),
2923
- children: [/* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" }), "New Sandbox"]
2924
- }), notificationsEnabled && /* @__PURE__ */ jsxs("div", {
2925
- className: "relative",
2926
- ref: notifRef,
2927
- children: [/* @__PURE__ */ jsxs("button", {
2928
- type: "button",
2929
- className: cn$1("relative text-muted-foreground hover:text-foreground transition-colors p-2 rounded-lg hover:bg-surface-container-high", "duration-[var(--duration-fast)] ease-[var(--ease-standard)]"),
2930
- onClick: () => setNotificationsOpen(!notificationsOpen),
2931
- "aria-label": "Notifications",
2932
- "aria-expanded": notificationsOpen,
2933
- children: [/* @__PURE__ */ jsx(Bell, { className: "h-4 w-4" }), (notifData?.unreadCount ?? 0) > 0 && /* @__PURE__ */ jsx("span", { className: "absolute top-1 right-1 h-2 w-2 rounded-full bg-destructive" })]
2934
- }), notificationsOpen && /* @__PURE__ */ jsxs("div", {
2935
- className: "absolute right-0 top-full mt-2 w-80 rounded-lg border border-[var(--md3-outline-variant)] bg-surface-container-highest shadow-[0_8px_30px_rgba(0,0,0,0.45)] ring-1 ring-[#ffffff14] z-50",
2936
- children: [/* @__PURE__ */ jsxs("div", {
2937
- className: "flex items-center justify-between border-b border-[var(--md3-outline-variant)] px-4 py-3",
2938
- children: [/* @__PURE__ */ jsx("p", {
2939
- className: "font-bold text-foreground text-sm",
2940
- children: "Notifications"
2941
- }), (notifData?.unreadCount ?? 0) > 0 && notifData?.onMarkAllRead && /* @__PURE__ */ jsx("button", {
2942
- type: "button",
2943
- onClick: () => {
2944
- notifData.onMarkAllRead?.();
2945
- },
2946
- className: "text-primary text-xs font-medium hover:underline",
2947
- children: "Mark all read"
2948
- })]
2949
- }), !notifData?.items || notifData.items.length === 0 ? /* @__PURE__ */ jsxs("div", {
2950
- className: "flex flex-col items-center justify-center px-4 py-8 text-center",
2951
- children: [
2952
- /* @__PURE__ */ jsx(Bell, { className: "h-8 w-8 text-muted-foreground/40 mb-2" }),
2953
- /* @__PURE__ */ jsx("p", {
2954
- className: "text-muted-foreground text-sm",
2955
- children: "No notifications yet"
2956
- }),
2957
- /* @__PURE__ */ jsx("p", {
2958
- className: "text-muted-foreground/60 text-xs mt-1",
2959
- children: "We'll notify you about important updates"
2960
- })
2961
- ]
2962
- }) : /* @__PURE__ */ jsx("div", {
2963
- className: "max-h-80 overflow-y-auto",
2964
- children: notifData.items.map((n) => /* @__PURE__ */ jsxs("button", {
2965
- type: "button",
2966
- className: cn$1("w-full text-left px-4 py-3 border-b border-[var(--md3-outline-variant)] last:border-0 transition-colors", "duration-[var(--duration-fast)] ease-[var(--ease-standard)]", n.read ? "cursor-default" : "bg-primary/5 hover:bg-white/5"),
2967
- onClick: () => {
2968
- if (!n.read) notifData.onMarkRead?.(n.id);
2969
- },
2970
- children: [
2971
- /* @__PURE__ */ jsx("p", {
2972
- className: cn$1("text-sm", !n.read ? "font-semibold text-foreground" : "text-muted-foreground"),
2973
- children: n.title
2974
- }),
2975
- /* @__PURE__ */ jsx("p", {
2976
- className: "text-xs text-muted-foreground mt-0.5 line-clamp-2",
2977
- children: n.message
2978
- }),
2979
- /* @__PURE__ */ jsx("p", {
2980
- className: "text-[10px] text-muted-foreground/50 mt-1",
2981
- children: formatNotifDate(n.createdAt)
2982
- })
2983
- ]
2984
- }, n.id))
2985
- })]
2986
- })]
2987
- })]
2988
- }),
2989
- /* @__PURE__ */ jsx("button", {
2990
- type: "button",
2991
- onClick: () => setMobileMenuOpen(!mobileMenuOpen),
2992
- className: "rounded-md p-2 hover:bg-surface-container-high lg:hidden",
2993
- "aria-label": mobileMenuOpen ? "Close menu" : "Open menu",
2994
- "aria-expanded": mobileMenuOpen,
2995
- children: mobileMenuOpen ? /* @__PURE__ */ jsx(XIcon, { className: "h-6 w-6" }) : /* @__PURE__ */ jsx(MenuIcon$1, { className: "h-6 w-6" })
2996
- })
2997
- ]
2998
- }),
2999
- mobileMenuOpen && /* @__PURE__ */ jsx("div", {
3000
- className: "fixed inset-0 z-30 bg-black/50 lg:hidden",
3001
- onClick: () => setMobileMenuOpen(false),
3002
- "aria-hidden": "true"
3003
- }),
3004
- /* @__PURE__ */ jsx("aside", {
3005
- className: cn$1("fixed top-14 bottom-0 left-0 z-30 flex bg-surface-container-low transition-transform lg:hidden", MOTION_TRAVEL, mobileMenuOpen ? "translate-x-0" : "-translate-x-full"),
3006
- style: { width: panelOpen && hasPanels ? 524 : 256 },
3007
- children: mobileSidebarContent
3056
+ "aria-label": "Open menu",
3057
+ className: cn$1("flex h-10 w-10 items-center justify-center rounded-md hover:bg-surface-container-high", focusRing),
3058
+ children: /* @__PURE__ */ jsx(MenuIcon$1, { className: "h-5 w-5" })
3059
+ })
3060
+ })]
3061
+ }), /* @__PURE__ */ jsxs(DialogContent, {
3062
+ "aria-describedby": void 0,
3063
+ hideCloseButton: true,
3064
+ className: "inset-y-0 left-0 flex h-dvh max-w-[calc(100vw-24px)] translate-x-0 translate-y-0 gap-0 rounded-none border-y-0 border-l-0 bg-surface-container-low p-0 lg:hidden",
3065
+ style: { width: panelOpen && hasPanels ? 524 : 256 },
3066
+ onClick: (event) => {
3067
+ if (event.target.closest("a[href]")) setMobileMenuOpen(false);
3068
+ },
3069
+ children: [
3070
+ /* @__PURE__ */ jsx(DialogTitle, {
3071
+ className: "sr-only",
3072
+ children: "Navigation"
3073
+ }),
3074
+ /* @__PURE__ */ jsx(DialogClose, {
3075
+ "aria-label": "Close menu",
3076
+ className: cn$1("absolute right-2 top-2 z-10 flex h-10 w-10 items-center justify-center rounded-md hover:bg-surface-container-high", focusRing),
3077
+ children: /* @__PURE__ */ jsx(XIcon, { className: "h-5 w-5" })
3078
+ }),
3079
+ mobileSidebarContent
3080
+ ]
3081
+ })]
3008
3082
  }),
3009
3083
  /* @__PURE__ */ jsx(Sidebar, {
3010
3084
  className: cn$1("hidden lg:flex", sidebarClassName),
3011
3085
  children: sidebarContent
3012
3086
  }),
3013
3087
  /* @__PURE__ */ jsx(SidebarContent, {
3014
- className: cn$1("pt-16 px-6 pb-8 lg:px-8 bg-surface", collapseDesktopTopBar && "lg:pt-0", contentClassName),
3088
+ className: cn$1("pt-12 px-6 pb-8 lg:px-8 lg:pt-0 bg-surface", contentClassName),
3015
3089
  children
3016
3090
  }),
3017
3091
  footer
@@ -1,4 +1,4 @@
1
- import { $ as DashboardLayoutProps, $t as SIDEBAR_RAIL_WIDTH, A as UsageSummaryData, An as SidebarPanelContentProps, At as TeamRole, B as MetricAreaChartProps, Bn as SidebarRailNav, Bt as ClusterStatusBar, C as PortsList, Cn as RailSeparatorProps, Ct as SandboxTableProps, D as GitPanelProps, Dn as SidebarContentProps, Dt as SandboxCardData, E as GitPanel, En as SidebarContent, Et as SandboxCard, F as VariantList, Fn as SidebarRail, Ft as ResourceSnapshot, G as ProfileComparisonProps, Gt as OutOfCreditsModal, H as MetricChartTone, Hn as SidebarRailProps, Ht as ClusterStatusItem, I as VariantListProps, In as SidebarRailFooter, It as ResourceSnapshotItem, J as SidebarLayout, Jt as CreditBalance, K as ProfileSelector, Kt as OutOfCreditsModalProps, L as VariantOutcome, Ln as SidebarRailFooterProps, Lt as ResourceSnapshotProps, M as SystemLogsViewer, Mn as SidebarPanelHeaderProps, Mt as ActivityFeed, N as SystemLogsViewerProps, Nn as SidebarPanelProps, Nt as ActivityFeedProps, O as GitStatusData, On as SidebarPanel, Ot as SandboxCardProps, P as Variant, Pn as SidebarProps, Pt as ActivityItem, Q as DashboardLayout, Qt as SIDEBAR_RAIL_LABELED_WIDTH, R as VariantStatus, Rn as SidebarRailHeader, Rt as ResourceMeter, S as ExposedPort, Sn as RailSeparator, St as SandboxTable, T as GitCommitData, Tn as Sidebar, Tt as NewSandboxCardProps, U as Profile, Un as SidebarUser, Ut as INSUFFICIENT_BALANCE_CODE, V as MetricChartPoint, Vn as SidebarRailNavProps, Vt as ClusterStatusBarProps, W as ProfileComparison, Wn as ThemeMode, Wt as InsufficientBalance, X as SidebarLayoutNavItem, Xt as SIDEBAR_MOBILE_WIDTH, Y as SidebarLayoutFlyoutItem, Yt as CreditBalanceProps, Z as SidebarLayoutProps, Zt as SIDEBAR_PANEL_WIDTH, _ as NetworkConfigData, _n as RailFlyoutProps, _t as PlanCardsProps, a as InfoPanel, an as RailTooltipProps, at as HarnessLogo, b as ProcessList, bn as RailModeButton, bt as InvoiceTable, c as PromoBannerProps, cn as ProfileAvatarProps, ct as HarnessPicker, d as SnapshotListProps, dn as RailCollapseToggle, dt as chatCapableHarnesses, en as SIDEBAR_TOTAL_WIDTH, et as DashboardUser, f as BackendConfig, fn as RailCollapseToggleProps, ft as Backend, g as NetworkConfig, gn as RailFlyout, gt as PlanCards, h as McpServer, hn as RailExpandableSubItem, ht as PlanCardData, i as SandboxPageShellProps, in as RailTooltip, it as HarnessBrand, j as UsageSummaryProps, jn as SidebarPanelHeader, jt as canAdminSandbox, k as UsageSummary, kn as SidebarPanelContent, kt as SandboxStatus, l as SnapshotInfo, ln as RailButton, lt as HarnessPickerProps, m as BackendStatusData, mn as RailExpandableProps, mt as BackendSelectorProps, n as DashboardPageHeaderProps, nn as SidebarProviderProps, nt as ProductVariant, o as InfoPanelProps, on as AppearanceController, ot as HarnessLogoProps, p as BackendConfigProps, pn as RailExpandable, pt as BackendSelector, q as ProfileSelectorProps, qt as parseInsufficientBalance, r as SandboxPageShell, rn as useSidebar, rt as HARNESS_BRAND, s as PromoBanner, sn as ProfileAvatar, st as HARNESS_OPTIONS, t as DashboardPageHeader, tn as SidebarProvider, tt as NavItem, u as SnapshotList, un as RailButtonProps, ut as HarnessType, v as NetworkConfigProps, vn as RailHeader, vt as PlanFeature, w as PortsListProps, wn as RailThemeToggle, wt as NewSandboxCard, x as ProcessListProps, xn as RailModeButtonProps, xt as InvoiceTableProps, y as ProcessInfo, yn as RailHeaderProps, yt as Invoice, z as MetricAreaChart, zn as SidebarRailHeaderProps, zt as ResourceMeterProps } from "./index-CZ2ErGhV.js";
1
+ import { $ as DashboardLayoutProps, $t as SIDEBAR_RAIL_WIDTH, A as UsageSummaryData, An as SidebarPanelContentProps, At as TeamRole, B as MetricAreaChartProps, Bn as SidebarRailNav, Bt as ClusterStatusBar, C as PortsList, Cn as RailSeparatorProps, Ct as SandboxTableProps, D as GitPanelProps, Dn as SidebarContentProps, Dt as SandboxCardData, E as GitPanel, En as SidebarContent, Et as SandboxCard, F as VariantList, Fn as SidebarRail, Ft as ResourceSnapshot, G as ProfileComparisonProps, Gt as OutOfCreditsModal, H as MetricChartTone, Hn as SidebarRailProps, Ht as ClusterStatusItem, I as VariantListProps, In as SidebarRailFooter, It as ResourceSnapshotItem, J as SidebarLayout, Jt as CreditBalance, K as ProfileSelector, Kt as OutOfCreditsModalProps, L as VariantOutcome, Ln as SidebarRailFooterProps, Lt as ResourceSnapshotProps, M as SystemLogsViewer, Mn as SidebarPanelHeaderProps, Mt as ActivityFeed, N as SystemLogsViewerProps, Nn as SidebarPanelProps, Nt as ActivityFeedProps, O as GitStatusData, On as SidebarPanel, Ot as SandboxCardProps, P as Variant, Pn as SidebarProps, Pt as ActivityItem, Q as DashboardLayout, Qt as SIDEBAR_RAIL_LABELED_WIDTH, R as VariantStatus, Rn as SidebarRailHeader, Rt as ResourceMeter, S as ExposedPort, Sn as RailSeparator, St as SandboxTable, T as GitCommitData, Tn as Sidebar, Tt as NewSandboxCardProps, U as Profile, Un as SidebarUser, Ut as INSUFFICIENT_BALANCE_CODE, V as MetricChartPoint, Vn as SidebarRailNavProps, Vt as ClusterStatusBarProps, W as ProfileComparison, Wn as ThemeMode, Wt as InsufficientBalance, X as SidebarLayoutNavItem, Xt as SIDEBAR_MOBILE_WIDTH, Y as SidebarLayoutFlyoutItem, Yt as CreditBalanceProps, Z as SidebarLayoutProps, Zt as SIDEBAR_PANEL_WIDTH, _ as NetworkConfigData, _n as RailFlyoutProps, _t as PlanCardsProps, a as InfoPanel, an as RailTooltipProps, at as HarnessLogo, b as ProcessList, bn as RailModeButton, bt as InvoiceTable, c as PromoBannerProps, cn as ProfileAvatarProps, ct as HarnessPicker, d as SnapshotListProps, dn as RailCollapseToggle, dt as chatCapableHarnesses, en as SIDEBAR_TOTAL_WIDTH, et as DashboardUser, f as BackendConfig, fn as RailCollapseToggleProps, ft as Backend, g as NetworkConfig, gn as RailFlyout, gt as PlanCards, h as McpServer, hn as RailExpandableSubItem, ht as PlanCardData, i as SandboxPageShellProps, in as RailTooltip, it as HarnessBrand, j as UsageSummaryProps, jn as SidebarPanelHeader, jt as canAdminSandbox, k as UsageSummary, kn as SidebarPanelContent, kt as SandboxStatus, l as SnapshotInfo, ln as RailButton, lt as HarnessPickerProps, m as BackendStatusData, mn as RailExpandableProps, mt as BackendSelectorProps, n as DashboardPageHeaderProps, nn as SidebarProviderProps, nt as ProductVariant, o as InfoPanelProps, on as AppearanceController, ot as HarnessLogoProps, p as BackendConfigProps, pn as RailExpandable, pt as BackendSelector, q as ProfileSelectorProps, qt as parseInsufficientBalance, r as SandboxPageShell, rn as useSidebar, rt as HARNESS_BRAND, s as PromoBanner, sn as ProfileAvatar, st as HARNESS_OPTIONS, t as DashboardPageHeader, tn as SidebarProvider, tt as NavItem, u as SnapshotList, un as RailButtonProps, ut as HarnessType, v as NetworkConfigProps, vn as RailHeader, vt as PlanFeature, w as PortsListProps, wn as RailThemeToggle, wt as NewSandboxCard, x as ProcessListProps, xn as RailModeButtonProps, xt as InvoiceTableProps, y as ProcessInfo, yn as RailHeaderProps, yt as Invoice, z as MetricAreaChart, zn as SidebarRailHeaderProps, zt as ResourceMeterProps } from "./index-B_70pkX2.js";
2
2
  import { a as modelBrandFor, i as canonicalModelId, n as ModelBrandStack, r as ModelInfo, t as ModelBrandIdentity } from "./model-brand-B9A4H9pJ.js";
3
3
  import { a as UsageChartProps, c as PricingPageProps, d as BillingBalance, f as BillingDashboard, h as BillingUsage, i as UsageChart, l as PricingTier, m as BillingSubscription, n as TemplateCardData, o as UsageDataPoint, p as BillingDashboardProps, r as TemplateCardProps, s as PricingPage, t as TemplateCard, u as formatPrice } from "./template-card-L-4gmjx2.js";
4
4
  export { ActivityFeed, type ActivityFeedProps, type ActivityItem, type AppearanceController, type Backend, BackendConfig, type BackendConfigProps, BackendSelector, type BackendSelectorProps, type BackendStatusData, type BillingBalance, BillingDashboard, type BillingDashboardProps, type BillingSubscription, type BillingUsage, ClusterStatusBar, type ClusterStatusBarProps, type ClusterStatusItem, CreditBalance, type CreditBalanceProps, DashboardLayout, type DashboardLayoutProps, DashboardPageHeader, type DashboardPageHeaderProps, type Profile as DashboardProfile, type SnapshotInfo as DashboardSnapshotInfo, type DashboardUser, type ExposedPort, type GitCommitData, GitPanel, type GitPanelProps, type GitStatusData, HARNESS_BRAND, HARNESS_OPTIONS, type HarnessBrand, HarnessLogo, type HarnessLogoProps, HarnessPicker, type HarnessPickerProps, type HarnessType, INSUFFICIENT_BALANCE_CODE, InfoPanel, type InfoPanelProps, type InsufficientBalance, type Invoice, InvoiceTable, type InvoiceTableProps, type McpServer, MetricAreaChart, type MetricAreaChartProps, type MetricChartPoint, type MetricChartTone, type ModelBrandIdentity, ModelBrandStack, type ModelInfo, type NavItem, NetworkConfig, type NetworkConfigData, type NetworkConfigProps, NewSandboxCard, type NewSandboxCardProps, OutOfCreditsModal, type OutOfCreditsModalProps, type PlanCardData, PlanCards, type PlanCardsProps, type PlanFeature, PortsList, type PortsListProps, PricingPage, type PricingPageProps, type PricingTier, type ProcessInfo, ProcessList, type ProcessListProps, type ProductVariant, ProfileAvatar, type ProfileAvatarProps, ProfileComparison, type ProfileComparisonProps, ProfileSelector, type ProfileSelectorProps, PromoBanner, type PromoBannerProps, RailButton, type RailButtonProps, RailCollapseToggle, type RailCollapseToggleProps, RailExpandable, type RailExpandableProps, type RailExpandableSubItem, RailFlyout, type RailFlyoutProps, RailHeader, type RailHeaderProps, RailModeButton, type RailModeButtonProps, RailSeparator, type RailSeparatorProps, RailThemeToggle, RailTooltip, type RailTooltipProps, ResourceMeter, type ResourceMeterProps, ResourceSnapshot, type ResourceSnapshotItem, type ResourceSnapshotProps, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_LABELED_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, type SandboxCardData, type SandboxCardProps, SandboxPageShell, type SandboxPageShellProps, type SandboxStatus, SandboxTable, type SandboxTableProps, Sidebar, SidebarContent, type SidebarContentProps, SidebarLayout, type SidebarLayoutFlyoutItem, type SidebarLayoutNavItem, type SidebarLayoutProps, SidebarPanel, SidebarPanelContent, type SidebarPanelContentProps, SidebarPanelHeader, type SidebarPanelHeaderProps, type SidebarPanelProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarRailFooter, type SidebarRailFooterProps, SidebarRailHeader, type SidebarRailHeaderProps, SidebarRailNav, type SidebarRailNavProps, type SidebarRailProps, type SidebarUser, SnapshotList, type SnapshotListProps, SystemLogsViewer, type SystemLogsViewerProps, type TeamRole, TemplateCard, type TemplateCardData, type TemplateCardProps, type ThemeMode, UsageChart, type UsageChartProps, type UsageDataPoint, UsageSummary, type UsageSummaryData, type UsageSummaryProps, type Variant, VariantList, type VariantListProps, type VariantOutcome, type VariantStatus, canAdminSandbox, canonicalModelId, chatCapableHarnesses, formatPrice, modelBrandFor, parseInsufficientBalance, useSidebar };
package/dist/dashboard.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as SidebarRailHeader, A as ResourceSnapshot, B as RailExpandable, C as PlanCards, D as SandboxCard, E as NewSandboxCard, F as parseInsufficientBalance, G as RailThemeToggle, H as RailHeader, I as CreditBalance, J as SidebarPanel, K as Sidebar, L as ProfileAvatar, M as ClusterStatusBar, N as INSUFFICIENT_BALANCE_CODE, O as canAdminSandbox, P as OutOfCreditsModal, Q as SidebarRailFooter, R as RailButton, S as BackendSelector, T as SandboxTable, U as RailModeButton, V as RailFlyout, W as RailSeparator, X as SidebarPanelHeader, Y as SidebarPanelContent, Z as SidebarRail, _ as HARNESS_OPTIONS, a as NetworkConfig, at as SIDEBAR_RAIL_WIDTH, b as HARNESS_BRAND, c as GitPanel, ct as useSidebar, d as VariantList, et as SidebarRailNav, f as MetricAreaChart, g as DashboardLayout, h as SidebarLayout, i as BackendConfig, it as SIDEBAR_RAIL_LABELED_WIDTH, j as ResourceMeter, k as ActivityFeed, l as UsageSummary, m as ProfileSelector, n as PromoBanner, nt as SIDEBAR_MOBILE_WIDTH, o as ProcessList, ot as SIDEBAR_TOTAL_WIDTH, p as ProfileComparison, q as SidebarContent, r as SnapshotList, rt as SIDEBAR_PANEL_WIDTH, s as PortsList, st as SidebarProvider, t as InfoPanel, tt as RailTooltip, u as SystemLogsViewer, v as HarnessPicker, w as InvoiceTable, x as HarnessLogo, y as chatCapableHarnesses, z as RailCollapseToggle } from "./dashboard-BpEeXRo1.js";
1
+ import { $ as SidebarRailHeader, A as ResourceSnapshot, B as RailExpandable, C as PlanCards, D as SandboxCard, E as NewSandboxCard, F as parseInsufficientBalance, G as RailThemeToggle, H as RailHeader, I as CreditBalance, J as SidebarPanel, K as Sidebar, L as ProfileAvatar, M as ClusterStatusBar, N as INSUFFICIENT_BALANCE_CODE, O as canAdminSandbox, P as OutOfCreditsModal, Q as SidebarRailFooter, R as RailButton, S as BackendSelector, T as SandboxTable, U as RailModeButton, V as RailFlyout, W as RailSeparator, X as SidebarPanelHeader, Y as SidebarPanelContent, Z as SidebarRail, _ as HARNESS_OPTIONS, a as NetworkConfig, at as SIDEBAR_RAIL_WIDTH, b as HARNESS_BRAND, c as GitPanel, ct as useSidebar, d as VariantList, et as SidebarRailNav, f as MetricAreaChart, g as DashboardLayout, h as SidebarLayout, i as BackendConfig, it as SIDEBAR_RAIL_LABELED_WIDTH, j as ResourceMeter, k as ActivityFeed, l as UsageSummary, m as ProfileSelector, n as PromoBanner, nt as SIDEBAR_MOBILE_WIDTH, o as ProcessList, ot as SIDEBAR_TOTAL_WIDTH, p as ProfileComparison, q as SidebarContent, r as SnapshotList, rt as SIDEBAR_PANEL_WIDTH, s as PortsList, st as SidebarProvider, t as InfoPanel, tt as RailTooltip, u as SystemLogsViewer, v as HarnessPicker, w as InvoiceTable, x as HarnessLogo, y as chatCapableHarnesses, z as RailCollapseToggle } from "./dashboard-C2VXLIQC.js";
2
2
  import { n as canonicalModelId, r as modelBrandFor, t as ModelBrandStack } from "./model-brand-hMyDTUqB.js";
3
- import { a as PricingPage, i as UsageChart, n as SandboxPageShell, o as formatPrice, r as TemplateCard, s as BillingDashboard, t as DashboardPageHeader } from "./page-layout-Cf90DTWr.js";
3
+ import { a as PricingPage, i as UsageChart, n as SandboxPageShell, o as formatPrice, r as TemplateCard, s as BillingDashboard, t as DashboardPageHeader } from "./page-layout-DJV7cbxx.js";
4
4
  export { ActivityFeed, BackendConfig, BackendSelector, BillingDashboard, ClusterStatusBar, CreditBalance, DashboardLayout, DashboardPageHeader, GitPanel, HARNESS_BRAND, HARNESS_OPTIONS, HarnessLogo, HarnessPicker, INSUFFICIENT_BALANCE_CODE, InfoPanel, InvoiceTable, MetricAreaChart, ModelBrandStack, NetworkConfig, NewSandboxCard, OutOfCreditsModal, PlanCards, PortsList, PricingPage, ProcessList, ProfileAvatar, ProfileComparison, ProfileSelector, PromoBanner, RailButton, RailCollapseToggle, RailExpandable, RailFlyout, RailHeader, RailModeButton, RailSeparator, RailThemeToggle, RailTooltip, ResourceMeter, ResourceSnapshot, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_LABELED_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, SandboxPageShell, SandboxTable, Sidebar, SidebarContent, SidebarLayout, SidebarPanel, SidebarPanelContent, SidebarPanelHeader, SidebarProvider, SidebarRail, SidebarRailFooter, SidebarRailHeader, SidebarRailNav, SnapshotList, SystemLogsViewer, TemplateCard, UsageChart, UsageSummary, VariantList, canAdminSandbox, canonicalModelId, chatCapableHarnesses, formatPrice, modelBrandFor, parseInsufficientBalance, useSidebar };