@tangle-network/sandbox-ui 0.134.7 → 0.134.8

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,15 +1,14 @@
1
- import { b as Button$1, sr as Logo } from "./primitives-DSpl1Thf.js";
1
+ import { b as Button$1, lr as Logo } from "./primitives-CAGwYo7I.js";
2
2
  import { t as cn$1 } from "./utils-DzWbktWG.js";
3
3
  import { r as ShellHeader } from "./shell-header-CTh3oV_e.js";
4
- import { n as MOTION_SURFACE, r as MOTION_TRAVEL, t as MOTION_CONTROL } from "./motion-DkyBRJb9.js";
4
+ import { n as MOTION_SURFACE, t as MOTION_CONTROL } from "./motion-D4njYpys.js";
5
5
  import { a as moonshot_default } from "./model-brand-BSr9on8C.js";
6
6
  import "./page-layout-2IRtfx51.js";
7
- import { Avatar, AvatarFallback, AvatarImage, Dialog, DialogClose, DialogContent, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Skeleton, StatCard, StatusPill } from "@tangle-network/ui/primitives";
7
+ import { Avatar, AvatarFallback, AvatarImage, Dialog, DialogClose, DialogContent, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Sheet, SheetClose, SheetContent, SheetTitle, SheetTrigger, Skeleton, StatCard, StatusPill } from "@tangle-network/ui/primitives";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  import * as React$1 from "react";
10
10
  import { useEffect, useId, useRef, useState } from "react";
11
11
  import { createPortal } from "react-dom";
12
- import * as Dialog$1 from "@radix-ui/react-dialog";
13
12
  import { Activity, ArrowRight, BarChart2, Bell, Bot, Box, Camera, Check, ChevronDown, ChevronLeft, ChevronRight, Clock, Code2, Copy, Cpu, DollarSign, ExternalLink, File, FileEdit, FilePlus, GitBranch, GitCommit, Globe, HardDrive, Key, Layers, MemoryStick, MessageSquare, Monitor, MoreHorizontal, MoreVertical, Network, PanelLeft, Play, Plug, Plus, Power, PowerOff, RotateCcw, Skull, Terminal, Trash2, User, Users } from "lucide-react";
14
13
  import { focusField, focusRing, focusRingInset, timeAgo } from "@tangle-network/ui/utils";
15
14
  import * as Select$1 from "@radix-ui/react-select";
@@ -415,7 +414,7 @@ function Sidebar({ children, className, style }) {
415
414
  const { panelOpen, hidden, hasPanels, railWidth } = useSidebar();
416
415
  return /* @__PURE__ */ jsx("div", {
417
416
  "data-sidebar": "true",
418
- className: cn$1("fixed inset-y-0 left-0 z-40 flex bg-surface-container-low border-r border-[var(--md3-outline-variant)] transition-[transform,width]", MOTION_TRAVEL, hidden && "-translate-x-full", className),
417
+ className: cn$1("fixed inset-y-0 left-0 z-40 flex bg-surface-container-low transition-none border-r border-[var(--md3-outline-variant)]", hidden && "-translate-x-full", className),
419
418
  style: {
420
419
  width: panelOpen && hasPanels ? railWidth + 268 : railWidth,
421
420
  ...style
@@ -557,7 +556,7 @@ function RailFlyout({ icon: Icon, label, description, isActive, showLabel, title
557
556
  className: "text-sm font-medium",
558
557
  children: label
559
558
  }),
560
- showLabel && /* @__PURE__ */ jsx(ChevronRightIcon, { className: cn$1("ml-auto h-4 w-4 shrink-0 text-muted-foreground/60 transition-transform", "duration-[var(--duration-fast)] ease-[var(--ease-standard)]", open && "rotate-180") })
559
+ showLabel && /* @__PURE__ */ jsx(ChevronRightIcon, { className: cn$1("ml-auto h-4 w-4 shrink-0 text-muted-foreground/60 transition-transform", "[transition:color_var(--motion-control),background-color_var(--motion-control),border-color_var(--motion-control),box-shadow_var(--motion-control),transform_var(--motion-control),scale_var(--motion-control),opacity_var(--motion-control)] motion-reduce:transition-none", open && "rotate-180") })
561
560
  ]
562
561
  })
563
562
  }), open && /* @__PURE__ */ jsxs("div", {
@@ -684,10 +683,14 @@ function RailExpandable({ icon: Icon, label, description, href, isActive, showLa
684
683
  className: cn$1("min-w-0 flex-1 truncate", item.isLoading && "agent-shimmer", item.unread && !active && "font-medium text-foreground"),
685
684
  ...item.isLoading ? {
686
685
  role: "status",
687
- "aria-label": "Agent responding",
688
- "data-motion": "essential"
686
+ "aria-label": "Agent responding"
689
687
  } : {},
690
688
  children: item.label
689
+ }),
690
+ item.isLoading && /* @__PURE__ */ jsx("span", {
691
+ "aria-hidden": "true",
692
+ className: "sr-only shrink-0 text-xs text-muted-foreground motion-reduce:not-sr-only",
693
+ children: "Responding"
691
694
  })
692
695
  ]
693
696
  }, item.id);
@@ -873,12 +876,16 @@ function RailExpandable({ icon: Icon, label, description, href, isActive, showLa
873
876
  }), /* @__PURE__ */ jsx("div", {
874
877
  ref: discloseRef,
875
878
  id: discloseId,
876
- className: "agent-disclose",
879
+ className: "grid transition-none",
880
+ style: { gridTemplateRows: open ? "1fr" : "0fr" },
877
881
  "data-open": open ? "true" : "false",
878
- children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", {
879
- className: "flex flex-col gap-0.5 pl-3 pt-0.5",
880
- children: everOpened ? list : null
881
- }) })
882
+ children: /* @__PURE__ */ jsx("div", {
883
+ className: "min-h-0 overflow-hidden",
884
+ children: /* @__PURE__ */ jsx("div", {
885
+ className: "flex flex-col gap-0.5 pl-3 pt-0.5",
886
+ children: everOpened ? list : null
887
+ })
888
+ })
882
889
  })]
883
890
  });
884
891
  }
@@ -925,7 +932,7 @@ function SidebarPanelContent({ children, className }) {
925
932
  function SidebarContent({ children, className }) {
926
933
  const { contentMargin } = useSidebar();
927
934
  return /* @__PURE__ */ jsx("main", {
928
- className: cn$1("min-h-screen transition-[margin-left] lg:ml-[var(--sb-content-margin,0px)]", MOTION_TRAVEL, className),
935
+ className: cn$1("min-h-screen transition-none lg:ml-[var(--sb-content-margin,0px)]", className),
929
936
  style: { "--sb-content-margin": `${contentMargin}px` },
930
937
  children
931
938
  });
@@ -2595,25 +2602,19 @@ function DashboardLayoutInner({ children, variant = "sandbox", navItems, modeIte
2595
2602
  const isMode = modeSet.has(item.id);
2596
2603
  const prevIsMode = i > 0 && modeSet.has(navItems[i - 1].id);
2597
2604
  const showSep = i > 0 && isMode && !prevIsMode;
2598
- const arrival = {
2599
- className: "agent-arrive",
2600
- style: { "--stagger-index": i }
2601
- };
2602
2605
  return /* @__PURE__ */ jsxs(React$1.Fragment, { children: [showSep && /* @__PURE__ */ jsx(RailSeparator, { className: showLabels ? "w-full" : void 0 }), isMode ? /* @__PURE__ */ jsx(RailModeButton, {
2603
2606
  mode: item.id,
2604
2607
  icon: item.icon,
2605
2608
  label: item.label,
2606
2609
  badge: item.badge,
2607
2610
  badgeLabel: item.badgeLabel,
2608
- showLabel: showLabels,
2609
- ...arrival
2611
+ showLabel: showLabels
2610
2612
  }) : /* @__PURE__ */ jsx(RailButton, {
2611
2613
  icon: item.icon,
2612
2614
  label: item.label,
2613
2615
  isActive: activeNavId === item.id,
2614
2616
  showLabel: showLabels,
2615
2617
  asChild: true,
2616
- ...arrival,
2617
2618
  children: /* @__PURE__ */ jsx(Link, {
2618
2619
  href: item.href,
2619
2620
  to: item.href
@@ -2888,6 +2889,10 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
2888
2889
  const hasProfile = user !== void 0 || onLogout !== void 0 || onSettingsClick !== void 0;
2889
2890
  const showLabels = railLabels && !railCollapsed;
2890
2891
  const [mobileNavOpen, setMobileNavOpen] = React$1.useState(false);
2892
+ const [mobileNavPresent, setMobileNavPresent] = React$1.useState(false);
2893
+ const handleMobileNavRef = React$1.useCallback((node) => {
2894
+ setMobileNavPresent(node !== null);
2895
+ }, []);
2891
2896
  const closeMobileNav = React$1.useCallback(() => setMobileNavOpen(false), []);
2892
2897
  React$1.useEffect(() => {
2893
2898
  if (!mobileNavOpen) return;
@@ -2905,24 +2910,16 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
2905
2910
  return () => desktop.removeEventListener("change", closeOnDesktop);
2906
2911
  }, [hideBelow, mobileNavOpen]);
2907
2912
  const railVisible = useRailVisible(hideBelow);
2908
- const headerSlot = mobileNavOpen ? "drawer" : railVisible ? "rail" : "bar";
2913
+ const headerSlot = mobileNavOpen || mobileNavPresent ? "drawer" : railVisible ? "rail" : "bar";
2909
2914
  /**
2910
2915
  * One nav list, rendered twice — once in the desktop rail, once in the mobile
2911
2916
  * drawer. Sharing the renderer is the point: a product adds a destination to
2912
2917
  * `navItems` and it appears on both, so a phone can never silently lose a
2913
2918
  * door the desktop has.
2914
2919
  *
2915
- * Every item arrives on the shared entrance, staggered by its position: the
2916
- * rail reads as a list unfolding top-down rather than a block of icons
2917
- * appearing at once. `--stagger-index` is capped inside `.agent-arrive`, so a
2918
- * long nav does not open with a cascade.
2919
2920
  */
2920
2921
  function renderNavItems({ showLabels, onNavigate }) {
2921
- return navItems.map((item, index) => {
2922
- const arrival = {
2923
- className: "agent-arrive",
2924
- style: { "--stagger-index": index }
2925
- };
2922
+ return navItems.map((item) => {
2926
2923
  if (item.expandable) return /* @__PURE__ */ jsx(RailExpandable, {
2927
2924
  icon: item.icon,
2928
2925
  label: item.label,
@@ -2936,8 +2933,7 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
2936
2933
  emptyLabel: item.emptyLabel,
2937
2934
  defaultOpen: item.defaultOpen,
2938
2935
  onNavigate,
2939
- LinkComponent,
2940
- ...arrival
2936
+ LinkComponent
2941
2937
  }, item.id);
2942
2938
  if (item.flyoutItems && item.flyoutItems.length > 0) {
2943
2939
  const activeSet = new Set(item.flyoutActiveIds ?? []);
@@ -2948,7 +2944,6 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
2948
2944
  title: item.label,
2949
2945
  showLabel: showLabels,
2950
2946
  isActive: activeId === item.id || item.flyoutItems.some((f) => activeSet.has(f.id)),
2951
- ...arrival,
2952
2947
  children: item.flyoutItems.map((f) => {
2953
2948
  const FIcon = f.icon;
2954
2949
  const active = activeSet.has(f.id);
@@ -2978,8 +2973,7 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
2978
2973
  togglePanel();
2979
2974
  onNavigate?.();
2980
2975
  },
2981
- showLabel: showLabels,
2982
- ...arrival
2976
+ showLabel: showLabels
2983
2977
  }, item.id) : /* @__PURE__ */ jsx(RailButton, {
2984
2978
  icon: item.icon,
2985
2979
  label: item.label,
@@ -2990,7 +2984,6 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
2990
2984
  showLabel: showLabels,
2991
2985
  variant: item.variant,
2992
2986
  asChild: true,
2993
- ...arrival,
2994
2987
  children: /* @__PURE__ */ jsx(Link, {
2995
2988
  href: item.href,
2996
2989
  to: item.href,
@@ -3000,7 +2993,7 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
3000
2993
  }, item.id);
3001
2994
  });
3002
2995
  }
3003
- return /* @__PURE__ */ jsx(Dialog$1.Root, {
2996
+ return /* @__PURE__ */ jsx(Sheet, {
3004
2997
  open: mobileNavOpen,
3005
2998
  onOpenChange: setMobileNavOpen,
3006
2999
  children: /* @__PURE__ */ jsxs("div", {
@@ -3052,7 +3045,7 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
3052
3045
  divider: false,
3053
3046
  className: cn$1("gap-1 border-b border-[var(--md3-outline-variant)] bg-surface px-2", SHOW_BELOW_CLASS[hideBelow]),
3054
3047
  children: [
3055
- /* @__PURE__ */ jsx(Dialog$1.Trigger, {
3048
+ /* @__PURE__ */ jsx(SheetTrigger, {
3056
3049
  asChild: true,
3057
3050
  children: /* @__PURE__ */ jsx("button", {
3058
3051
  type: "button",
@@ -3060,7 +3053,7 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
3060
3053
  "aria-expanded": mobileNavOpen,
3061
3054
  "aria-controls": "sidebar-mobile-nav",
3062
3055
  "aria-haspopup": "dialog",
3063
- className: cn$1("flex size-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-[var(--accent-surface-soft)] hover:text-foreground", "duration-[var(--duration-fast)] ease-[var(--ease-standard)]"),
3056
+ className: cn$1("flex size-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-[var(--accent-surface-soft)] hover:text-foreground", "[transition:color_var(--motion-control),background-color_var(--motion-control),border-color_var(--motion-control),box-shadow_var(--motion-control),transform_var(--motion-control),scale_var(--motion-control),opacity_var(--motion-control)] motion-reduce:transition-none"),
3064
3057
  children: /* @__PURE__ */ jsx(MenuIcon, { className: "size-5" })
3065
3058
  })
3066
3059
  }),
@@ -3086,9 +3079,10 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
3086
3079
  ]
3087
3080
  }), children]
3088
3081
  }),
3089
- hideBelow && mobileNavOpen && /* @__PURE__ */ jsx(MobileNavDrawer, {
3082
+ hideBelow && /* @__PURE__ */ jsx(MobileNavDrawer, {
3083
+ contentRef: handleMobileNavRef,
3090
3084
  breakpoint: hideBelow,
3091
- header: railHeaderContent ?? logo,
3085
+ header: headerSlot === "drawer" ? railHeaderContent ?? logo : void 0,
3092
3086
  footer: railFooter !== void 0 || hasProfile ? /* @__PURE__ */ jsxs(Fragment, { children: [railFooter, hasProfile && /* @__PURE__ */ jsx(ProfileAvatar, {
3093
3087
  user: user ?? void 0,
3094
3088
  isLoading,
@@ -3121,14 +3115,17 @@ function SidebarLayoutInner({ children, navItems, activeId, panel, logo, logoHre
3121
3115
  * Use the same modal layer as the account menu and other shared disclosures:
3122
3116
  * only the top layer handles Escape, and the trigger owns return focus.
3123
3117
  */
3124
- function MobileNavDrawer({ breakpoint, header, footer, panel, children }) {
3125
- return /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [/* @__PURE__ */ jsx(Dialog$1.Overlay, { className: cn$1("fixed inset-0 z-50 bg-black/50", SHOW_BELOW_CLASS[breakpoint]) }), /* @__PURE__ */ jsxs(Dialog$1.Content, {
3118
+ function MobileNavDrawer({ contentRef, breakpoint, header, footer, panel, children }) {
3119
+ return /* @__PURE__ */ jsxs(SheetContent, {
3120
+ ref: contentRef,
3121
+ side: "left",
3122
+ hideCloseButton: true,
3126
3123
  id: "sidebar-mobile-nav",
3127
3124
  "aria-describedby": void 0,
3128
3125
  style: { width: 256 },
3129
- className: cn$1("agent-arrive fixed inset-y-0 left-0 z-50 flex max-w-[85vw] flex-col border-r border-[var(--md3-outline-variant)] bg-surface-container-low shadow-xl", SHOW_BELOW_CLASS[breakpoint]),
3126
+ className: cn$1("max-w-[85vw] gap-0 border-[var(--md3-outline-variant)] bg-surface-container-low", SHOW_BELOW_CLASS[breakpoint]),
3130
3127
  children: [
3131
- /* @__PURE__ */ jsx(Dialog$1.Title, {
3128
+ /* @__PURE__ */ jsx(SheetTitle, {
3132
3129
  className: "sr-only",
3133
3130
  children: "Navigation"
3134
3131
  }),
@@ -3138,7 +3135,7 @@ function MobileNavDrawer({ breakpoint, header, footer, panel, children }) {
3138
3135
  children: [/* @__PURE__ */ jsx("div", {
3139
3136
  className: "flex min-w-0 flex-1 items-center",
3140
3137
  children: header
3141
- }), /* @__PURE__ */ jsx(Dialog$1.Close, {
3138
+ }), /* @__PURE__ */ jsx(SheetClose, {
3142
3139
  asChild: true,
3143
3140
  children: /* @__PURE__ */ jsx("button", {
3144
3141
  type: "button",
@@ -3161,7 +3158,7 @@ function MobileNavDrawer({ breakpoint, header, footer, panel, children }) {
3161
3158
  children: footer
3162
3159
  })
3163
3160
  ]
3164
- })] });
3161
+ });
3165
3162
  }
3166
3163
  /**
3167
3164
  * App shell built on the sidebar rail + slide-out panel, without a top nav bar.
package/dist/dashboard.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as useSidebar, A as parseInsufficientBalance, B as SidebarPanel, C as SandboxStatusPill, D as ResourceMeter, E as ResourceSnapshot, F as RailHeader, G as SidebarRailNav, H as SidebarPanelHeader, I as RailModeButton, J as SIDEBAR_PANEL_WIDTH, K as RailTooltip, L as RailSeparator, M as RailButton, N as RailExpandable, O as INSUFFICIENT_BALANCE_CODE, P as RailFlyout, Q as SidebarProvider, R as Sidebar, S as SANDBOX_STATUS, T as ActivityFeed, U as SidebarRail, V as SidebarPanelContent, W as SidebarRailFooter, X as SIDEBAR_RAIL_WIDTH, Y as SIDEBAR_RAIL_LABELED_WIDTH, Z as SIDEBAR_TOTAL_WIDTH, _ as BackendSelector, a as PortsList, b as SandboxCard, c as SystemLogsViewer, d as DashboardLayout, f as HARNESS_OPTIONS, g as HarnessLogo, h as HARNESS_BRAND, i as TemplateCard, j as ProfileAvatar, k as OutOfCreditsModal, l as MetricAreaChart, m as chatCapableHarnesses, n as SnapshotList, o as GitPanel, p as HarnessPicker, q as SIDEBAR_MOBILE_WIDTH, r as ProcessList, s as UsageSummary, t as PromoBanner, u as SidebarLayout, v as SandboxTable, w as sandboxStatus, x as canAdminSandbox, y as NewSandboxCard, z as SidebarContent } from "./dashboard-Ba7DlJHW.js";
1
+ import { $ as useSidebar, A as parseInsufficientBalance, B as SidebarPanel, C as SandboxStatusPill, D as ResourceMeter, E as ResourceSnapshot, F as RailHeader, G as SidebarRailNav, H as SidebarPanelHeader, I as RailModeButton, J as SIDEBAR_PANEL_WIDTH, K as RailTooltip, L as RailSeparator, M as RailButton, N as RailExpandable, O as INSUFFICIENT_BALANCE_CODE, P as RailFlyout, Q as SidebarProvider, R as Sidebar, S as SANDBOX_STATUS, T as ActivityFeed, U as SidebarRail, V as SidebarPanelContent, W as SidebarRailFooter, X as SIDEBAR_RAIL_WIDTH, Y as SIDEBAR_RAIL_LABELED_WIDTH, Z as SIDEBAR_TOTAL_WIDTH, _ as BackendSelector, a as PortsList, b as SandboxCard, c as SystemLogsViewer, d as DashboardLayout, f as HARNESS_OPTIONS, g as HarnessLogo, h as HARNESS_BRAND, i as TemplateCard, j as ProfileAvatar, k as OutOfCreditsModal, l as MetricAreaChart, m as chatCapableHarnesses, n as SnapshotList, o as GitPanel, p as HarnessPicker, q as SIDEBAR_MOBILE_WIDTH, r as ProcessList, s as UsageSummary, t as PromoBanner, u as SidebarLayout, v as SandboxTable, w as sandboxStatus, x as canAdminSandbox, y as NewSandboxCard, z as SidebarContent } from "./dashboard-CUFAz94r.js";
2
2
  import { i as modelBrandFor, n as ProviderMark, r as canonicalModelId, t as ModelBrandStack } from "./model-brand-BSr9on8C.js";
3
3
  import { a as formatPrice, i as PricingPage, n as SandboxPageShell, o as BillingDashboard, r as UsageChart, t as DashboardPageHeader } from "./page-layout-2IRtfx51.js";
4
4
  export { ActivityFeed, BackendSelector, BillingDashboard, DashboardLayout, DashboardPageHeader, GitPanel, HARNESS_BRAND, HARNESS_OPTIONS, HarnessLogo, HarnessPicker, INSUFFICIENT_BALANCE_CODE, MetricAreaChart, ModelBrandStack, NewSandboxCard, OutOfCreditsModal, PortsList, PricingPage, ProcessList, ProfileAvatar, PromoBanner, ProviderMark, RailButton, RailExpandable, RailFlyout, RailHeader, RailModeButton, RailSeparator, RailTooltip, ResourceMeter, ResourceSnapshot, SANDBOX_STATUS, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_LABELED_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, SandboxPageShell, SandboxStatusPill, SandboxTable, Sidebar, SidebarContent, SidebarLayout, SidebarPanel, SidebarPanelContent, SidebarPanelHeader, SidebarProvider, SidebarRail, SidebarRailFooter, SidebarRailNav, SnapshotList, SystemLogsViewer, TemplateCard, UsageChart, UsageSummary, canAdminSandbox, canonicalModelId, chatCapableHarnesses, formatPrice, modelBrandFor, parseInsufficientBalance, sandboxStatus, useSidebar };