@tangle-network/sandbox-ui 0.8.4 → 0.10.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,8 +1,8 @@
1
- export { B as Backend, a as BackendSelector, b as BackendSelectorProps, C as ClusterStatusBar, c as ClusterStatusBarProps, d as ClusterStatusItem, e as CreditBalance, f as CreditBalanceProps, D as DashboardLayout, g as DashboardLayoutProps, P as DashboardProfile, h as DashboardUser, I as Invoice, i as InvoiceTable, j as InvoiceTableProps, N as NavItem, k as NewSandboxCard, l as NewSandboxCardProps, m as PlanCardData, n as PlanCards, o as PlanCardsProps, p as PlanFeature, q as ProductVariant, r as ProfileAvatar, s as ProfileAvatarProps, t as ProfileComparison, u as ProfileComparisonProps, v as ProfileSelector, w as ProfileSelectorProps, R as RailButton, x as RailButtonProps, y as RailModeButton, z as RailModeButtonProps, A as RailSeparator, E as RailSeparatorProps, F as ResourceMeter, G as ResourceMeterProps, S as SIDEBAR_PANEL_WIDTH, H as SIDEBAR_RAIL_WIDTH, J as SIDEBAR_TOTAL_WIDTH, K as SandboxCard, L as SandboxCardData, M as SandboxCardProps, O as SandboxStatus, Q as SandboxTable, T as SandboxTableProps, U as Sidebar, V as SidebarContent, W as SidebarContentProps, X as SidebarPanel, Y as SidebarPanelContent, Z as SidebarPanelContentProps, _ as SidebarPanelHeader, $ as SidebarPanelHeaderProps, a0 as SidebarPanelProps, a1 as SidebarProps, a2 as SidebarProvider, a3 as SidebarProviderProps, a4 as SidebarRail, a5 as SidebarRailFooter, a6 as SidebarRailFooterProps, a7 as SidebarRailHeader, a8 as SidebarRailHeaderProps, a9 as SidebarRailNav, aa as SidebarRailNavProps, ab as SidebarRailProps, ac as SidebarUser, ad as Variant, ae as VariantList, af as VariantListProps, ag as VariantOutcome, ah as VariantStatus, ai as useSidebar } from './variant-list-C8wx2TqF.js';
1
+ export { B as Backend, a as BackendSelector, b as BackendSelectorProps, C as ClusterStatusBar, c as ClusterStatusBarProps, d as ClusterStatusItem, e as CreditBalance, f as CreditBalanceProps, D as DashboardLayout, g as DashboardLayoutProps, ag as DashboardProfile, h as DashboardUser, I as Invoice, i as InvoiceTable, j as InvoiceTableProps, N as NavItem, k as NewSandboxCard, l as NewSandboxCardProps, m as PlanCardData, n as PlanCards, o as PlanCardsProps, ah as PlanFeature, p as ProductVariant, q as ProfileAvatar, r as ProfileAvatarProps, s as ProfileComparison, t as ProfileComparisonProps, u as ProfileSelector, v as ProfileSelectorProps, R as RailButton, w as RailButtonProps, x as RailModeButton, y as RailModeButtonProps, z as RailSeparator, A as RailSeparatorProps, E as ResourceMeter, F as ResourceMeterProps, S as SIDEBAR_PANEL_WIDTH, G as SIDEBAR_RAIL_WIDTH, H as SIDEBAR_TOTAL_WIDTH, J as SandboxCard, K as SandboxCardData, L as SandboxCardProps, M as SandboxStatus, O as SandboxTable, Q as SandboxTableProps, T as Sidebar, U as SidebarContent, V as SidebarContentProps, W as SidebarPanel, X as SidebarPanelContent, Y as SidebarPanelContentProps, Z as SidebarPanelHeader, _ as SidebarPanelHeaderProps, $ as SidebarPanelProps, a0 as SidebarProps, a1 as SidebarProvider, a2 as SidebarProviderProps, a3 as SidebarRail, a4 as SidebarRailFooter, a5 as SidebarRailFooterProps, a6 as SidebarRailHeader, a7 as SidebarRailHeaderProps, a8 as SidebarRailNav, a9 as SidebarRailNavProps, aa as SidebarRailProps, ab as SidebarUser, ai as Variant, ad as VariantList, ae as VariantListProps, aj as VariantOutcome, ak as VariantStatus, af as useSidebar } from './variant-list-BNwUOSgz.js';
2
2
  export { a as BillingBalance, c as BillingDashboard, d as BillingDashboardProps, B as BillingSubscription, b as BillingUsage, e as PricingPage, f as PricingPageProps, P as PricingTier, g as UsageChart, h as UsageChartProps, U as UsageDataPoint } from './usage-chart-SSiOgeQI.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  export { a as TemplateCard, T as TemplateCardData, b as TemplateCardProps } from './template-card-BAtvcAkU.js';
5
- import 'react';
5
+ import * as React from 'react';
6
6
 
7
7
  interface SystemLogsViewerProps {
8
8
  apiUrl: string;
@@ -128,9 +128,30 @@ interface SnapshotListProps {
128
128
  snapshots: SnapshotInfo[];
129
129
  onCreate: (tags?: string[]) => void;
130
130
  onRestore: (snapshotId: string) => void;
131
+ onSaveAsTemplate?: (snapshotId: string) => void;
131
132
  loading?: boolean;
132
133
  className?: string;
133
134
  }
134
- declare function SnapshotList({ snapshots, onCreate, onRestore, loading, className }: SnapshotListProps): react_jsx_runtime.JSX.Element;
135
+ declare function SnapshotList({ snapshots, onCreate, onRestore, onSaveAsTemplate, loading, className }: SnapshotListProps): react_jsx_runtime.JSX.Element;
135
136
 
136
- export { BackendConfig, type BackendConfigProps, type BackendStatusData, type SnapshotInfo as DashboardSnapshotInfo, type ExposedPort, type GitCommitData, GitPanel, type GitPanelProps, type GitStatusData, type McpServer, NetworkConfig, type NetworkConfigData, type NetworkConfigProps, PortsList, type PortsListProps, type ProcessInfo, ProcessList, type ProcessListProps, SnapshotList, type SnapshotListProps, SystemLogsViewer, type SystemLogsViewerProps, UsageSummary, type UsageSummaryData, type UsageSummaryProps };
137
+ interface PromoBannerProps {
138
+ title: string;
139
+ description: string;
140
+ buttonLabel: string;
141
+ href?: string;
142
+ onClick?: () => void;
143
+ icon?: React.ReactNode;
144
+ disabled?: boolean;
145
+ className?: string;
146
+ }
147
+ declare function PromoBanner({ title, description, buttonLabel, href, onClick, icon, disabled, className, }: PromoBannerProps): react_jsx_runtime.JSX.Element;
148
+
149
+ interface InfoPanelProps {
150
+ label: string;
151
+ title: string;
152
+ description: string;
153
+ className?: string;
154
+ }
155
+ declare function InfoPanel({ label, title, description, className }: InfoPanelProps): react_jsx_runtime.JSX.Element;
156
+
157
+ export { BackendConfig, type BackendConfigProps, type BackendStatusData, type SnapshotInfo as DashboardSnapshotInfo, type ExposedPort, type GitCommitData, GitPanel, type GitPanelProps, type GitStatusData, InfoPanel, type InfoPanelProps, type McpServer, NetworkConfig, type NetworkConfigData, type NetworkConfigProps, PortsList, type PortsListProps, type ProcessInfo, ProcessList, type ProcessListProps, PromoBanner, type PromoBannerProps, SnapshotList, type SnapshotListProps, SystemLogsViewer, type SystemLogsViewerProps, UsageSummary, type UsageSummaryData, type UsageSummaryProps };
package/dist/dashboard.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
+ InfoPanel,
2
3
  TemplateCard
3
- } from "./chunk-7U2Z23NE.js";
4
+ } from "./chunk-VX3XOUEB.js";
4
5
  import {
5
6
  BackendSelector,
6
7
  ClusterStatusBar,
@@ -33,12 +34,12 @@ import {
33
34
  SidebarRailNav,
34
35
  VariantList,
35
36
  useSidebar
36
- } from "./chunk-XXDFEF72.js";
37
+ } from "./chunk-2XCOGNZP.js";
37
38
  import {
38
39
  BillingDashboard,
39
40
  PricingPage,
40
41
  UsageChart
41
- } from "./chunk-UXQMIR3D.js";
42
+ } from "./chunk-OHPW55EV.js";
42
43
  import {
43
44
  StatCard
44
45
  } from "./chunk-OKLQVY3Y.js";
@@ -47,7 +48,7 @@ import {
47
48
  Skeleton
48
49
  } from "./chunk-66EZOYZR.js";
49
50
  import "./chunk-ZMNSRDMH.js";
50
- import "./chunk-2QZ6G7NM.js";
51
+ import "./chunk-MKTSMWVD.js";
51
52
  import {
52
53
  cn
53
54
  } from "./chunk-RQHJBTEU.js";
@@ -768,7 +769,7 @@ function formatDate(dateStr) {
768
769
  if (Number.isNaN(d.getTime())) return dateStr;
769
770
  return d.toLocaleDateString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
770
771
  }
771
- function SnapshotList({ snapshots, onCreate, onRestore, loading = false, className }) {
772
+ function SnapshotList({ snapshots, onCreate, onRestore, onSaveAsTemplate, loading = false, className }) {
772
773
  const [showCreate, setShowCreate] = React6.useState(false);
773
774
  const [tags, setTags] = React6.useState("");
774
775
  const handleCreate = () => {
@@ -852,19 +853,31 @@ function SnapshotList({ snapshots, onCreate, onRestore, loading = false, classNa
852
853
  formatBytes(s.sizeBytes)
853
854
  ] }) }),
854
855
  /* @__PURE__ */ jsx8("td", { className: "px-4 py-3", children: s.tags?.length ? /* @__PURE__ */ jsx8("div", { className: "flex items-center gap-1 flex-wrap", children: s.tags.map((tag) => /* @__PURE__ */ jsx8("span", { className: "rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground border border-border", children: tag }, tag)) }) : /* @__PURE__ */ jsx8("span", { className: "text-xs text-muted-foreground", children: "-" }) }),
855
- /* @__PURE__ */ jsx8("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsxs8(
856
- "button",
857
- {
858
- type: "button",
859
- onClick: () => onRestore(s.id),
860
- className: "inline-flex items-center gap-1.5 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-foreground hover:bg-muted/80 transition-colors border border-border",
861
- title: "Restore to new sandbox",
862
- children: [
863
- /* @__PURE__ */ jsx8(RotateCcw, { className: "h-3 w-3" }),
864
- "Restore"
865
- ]
866
- }
867
- ) })
856
+ /* @__PURE__ */ jsx8("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-end gap-2", children: [
857
+ /* @__PURE__ */ jsxs8(
858
+ "button",
859
+ {
860
+ type: "button",
861
+ onClick: () => onRestore(s.id),
862
+ className: "inline-flex items-center gap-1.5 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-foreground hover:bg-muted/80 transition-colors border border-border",
863
+ title: "Restore to new sandbox",
864
+ children: [
865
+ /* @__PURE__ */ jsx8(RotateCcw, { className: "h-3 w-3" }),
866
+ "Restore"
867
+ ]
868
+ }
869
+ ),
870
+ onSaveAsTemplate && /* @__PURE__ */ jsx8(
871
+ "button",
872
+ {
873
+ type: "button",
874
+ onClick: () => onSaveAsTemplate(s.id),
875
+ className: "inline-flex items-center gap-1.5 rounded-md bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary hover:bg-primary/20 transition-colors border border-primary/20",
876
+ title: "Save as reusable template",
877
+ children: "Save as Template"
878
+ }
879
+ )
880
+ ] }) })
868
881
  ] }, s.id)) })
869
882
  ] }) }) : /* @__PURE__ */ jsxs8("div", { className: "rounded-lg border border-border bg-muted/20 p-6 text-center", children: [
870
883
  /* @__PURE__ */ jsx8(Camera, { className: "mx-auto h-8 w-8 text-muted-foreground mb-2" }),
@@ -873,6 +886,40 @@ function SnapshotList({ snapshots, onCreate, onRestore, loading = false, classNa
873
886
  ] })
874
887
  ] });
875
888
  }
889
+
890
+ // src/dashboard/promo-banner.tsx
891
+ import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
892
+ function PromoBanner({
893
+ title,
894
+ description,
895
+ buttonLabel,
896
+ href,
897
+ onClick,
898
+ icon,
899
+ disabled = false,
900
+ className
901
+ }) {
902
+ const buttonClasses = cn(
903
+ "mt-6 inline-flex items-center gap-2 rounded-md border border-white/20 bg-[var(--btn-primary-bg)] px-4 py-2 text-sm font-medium text-[var(--btn-primary-text)] transition-colors",
904
+ disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-[var(--btn-primary-hover)]"
905
+ );
906
+ const buttonContent = /* @__PURE__ */ jsxs9(Fragment2, { children: [
907
+ buttonLabel,
908
+ /* @__PURE__ */ jsxs9("svg", { "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-4 w-4", children: [
909
+ /* @__PURE__ */ jsx9("path", { d: "M5 12h14" }),
910
+ /* @__PURE__ */ jsx9("path", { d: "m12 5 7 7-7 7" })
911
+ ] })
912
+ ] });
913
+ return /* @__PURE__ */ jsxs9("div", { className: cn("relative overflow-hidden rounded-xl bg-[var(--brand-strong)] p-8 md:flex md:items-center md:justify-between", className), children: [
914
+ /* @__PURE__ */ jsxs9("div", { className: "relative z-10", children: [
915
+ /* @__PURE__ */ jsx9("h3", { className: "text-xl font-bold text-[var(--brand-strong-text)]", children: title }),
916
+ /* @__PURE__ */ jsx9("p", { className: "mt-2 max-w-md text-sm text-[var(--brand-strong-text-muted)]", children: description }),
917
+ href && !disabled ? /* @__PURE__ */ jsx9("a", { href, target: "_blank", rel: "noopener noreferrer", onClick, className: buttonClasses, children: buttonContent }) : /* @__PURE__ */ jsx9("button", { type: "button", onClick, disabled, className: buttonClasses, children: buttonContent })
918
+ ] }),
919
+ icon && /* @__PURE__ */ jsx9("div", { className: "relative z-10 mt-6 flex items-center md:mt-0", children: /* @__PURE__ */ jsx9("div", { className: "flex h-16 w-16 items-center justify-center rounded-2xl border border-white/10 bg-white/10", children: icon }) }),
920
+ /* @__PURE__ */ jsx9("div", { className: "pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l from-white/5 to-transparent" })
921
+ ] });
922
+ }
876
923
  export {
877
924
  BackendConfig,
878
925
  BackendSelector,
@@ -881,6 +928,7 @@ export {
881
928
  CreditBalance,
882
929
  DashboardLayout,
883
930
  GitPanel,
931
+ InfoPanel,
884
932
  InvoiceTable,
885
933
  NetworkConfig,
886
934
  NewSandboxCard,
@@ -891,6 +939,7 @@ export {
891
939
  ProfileAvatar,
892
940
  ProfileComparison,
893
941
  ProfileSelector,
942
+ PromoBanner,
894
943
  RailButton,
895
944
  RailModeButton,
896
945
  RailSeparator,