@burdenoff/microfe-sandbox 2026.625.1 → 2026.625.3
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/sandbox/components/CountdownTimer.js.map +1 -1
- package/dist/sandbox/components/PageLayout.js +36 -43
- package/dist/sandbox/components/PageLayout.js.map +1 -1
- package/dist/sandbox/components/StatusBadge.js +4 -4
- package/dist/sandbox/components/StatusBadge.js.map +1 -1
- package/dist/sandbox/pages/AdminPage.js +107 -105
- package/dist/sandbox/pages/AdminPage.js.map +1 -1
- package/dist/sandbox/pages/AdminTemplatesPage.js +48 -48
- package/dist/sandbox/pages/AdminTemplatesPage.js.map +1 -1
- package/dist/sandbox/pages/SandboxDetailPage.js +242 -244
- package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -1
- package/dist/sandbox/pages/SandboxListPage.js +380 -379
- package/dist/sandbox/pages/SandboxListPage.js.map +1 -1
- package/dist/sandbox/pages/UserTemplatesPage.js +38 -37
- package/dist/sandbox/pages/UserTemplatesPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountdownTimer.js","names":[],"sources":["../../../src/sandbox/components/CountdownTimer.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { Timer, Plus, AlertTriangle } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\nimport { useRemainingSeconds } from '../hooks/useRemainingSeconds';\n\ninterface CountdownTimerProps {\n expiresAt: string;\n onExpired?: () => void;\n onExtend?: () => void;\n compact?: boolean;\n}\n\nexport function CountdownTimer({\n expiresAt,\n onExpired,\n onExtend,\n compact = false,\n}: CountdownTimerProps) {\n const remainingSeconds = useRemainingSeconds(expiresAt, onExpired);\n const { t } = useI18n();\n\n // Browser notification at 60 seconds remaining, once per expiresAt window.\n // Ref-based flag avoids a render cycle and tracks the active expiresAt directly.\n const alertedForRef = useRef<string | null>(null);\n if (\n alertedForRef.current !== expiresAt &&\n remainingSeconds <= 60 &&\n remainingSeconds > 0 &&\n typeof window !== 'undefined' &&\n 'Notification' in window &&\n Notification.permission === 'granted'\n ) {\n alertedForRef.current = expiresAt;\n new Notification(tWithFallback(t, 'sandbox.timer.alertTitle', 'Sandbox expiring'), {\n body: tWithFallback(\n t,\n 'sandbox.timer.alertBody',\n 'Your sandbox will be destroyed in less than 1 minute. Extend it to continue working.'\n ),\n icon: '/favicon.ico',\n });\n }\n\n const hours = Math.floor(remainingSeconds / 3600);\n const minutes = Math.floor((remainingSeconds % 3600) / 60);\n const seconds = remainingSeconds % 60;\n const fmt = (n: number) => String(n).padStart(2, '0');\n const timeString =\n hours > 0 ? `${fmt(hours)}:${fmt(minutes)}:${fmt(seconds)}` : `${fmt(minutes)}:${fmt(seconds)}`;\n\n const color = (() => {\n if (remainingSeconds <= 0) return 'text-text-secondary';\n if (remainingSeconds <= 30) return 'text-status-error-text animate-pulse';\n if (remainingSeconds <= 60) return 'text-status-error-text';\n if (remainingSeconds <= 300) return 'text-status-warning-text';\n return 'text-status-success-text';\n })();\n\n const bg = (() => {\n if (remainingSeconds <= 0) return 'bg-bg-sunken border-border-subtle';\n if (remainingSeconds <= 60) return 'bg-status-error-bg-subtle border-border-default';\n if (remainingSeconds <= 300) return 'bg-status-warning-bg-subtle border-border-default';\n return 'bg-status-success-bg-subtle border-border-default';\n })();\n\n const remainingMinutes = Math.max(1, Math.ceil(remainingSeconds / 60));\n const accessibleLabel =\n remainingSeconds <= 0\n ? tWithFallback(t, 'sandbox.timer.expired', 'Expired')\n : tWithFallback(t, 'sandbox.timer.remaining', `${remainingMinutes} minutes remaining`, {\n count: remainingMinutes,\n });\n\n if (compact) {\n return (\n <span\n role=\"timer\"\n aria-live=\"polite\"\n aria-label={accessibleLabel}\n className={`inline-flex items-center gap-1 text-sm font-mono tabular-nums ${color}`}\n >\n <Timer aria-hidden=\"true\" className=\"size-3.5\" />\n {timeString}\n </span>\n );\n }\n\n return (\n <div\n role=\"timer\"\n aria-live=\"polite\"\n aria-label={accessibleLabel}\n className={`flex items-center gap-3 rounded-lg border px-4 py-2 ${bg}`}\n >\n <Timer aria-hidden=\"true\" className={`size-5 ${color}`} />\n <div className=\"flex flex-col\">\n <span className={`text-lg font-mono font-semibold tabular-nums ${color}`}
|
|
1
|
+
{"version":3,"file":"CountdownTimer.js","names":[],"sources":["../../../src/sandbox/components/CountdownTimer.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { Timer, Plus, AlertTriangle } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\nimport { useRemainingSeconds } from '../hooks/useRemainingSeconds';\n\ninterface CountdownTimerProps {\n expiresAt: string;\n onExpired?: () => void;\n onExtend?: () => void;\n compact?: boolean;\n}\n\nexport function CountdownTimer({\n expiresAt,\n onExpired,\n onExtend,\n compact = false,\n}: CountdownTimerProps) {\n const remainingSeconds = useRemainingSeconds(expiresAt, onExpired);\n const { t } = useI18n();\n\n // Browser notification at 60 seconds remaining, once per expiresAt window.\n // Ref-based flag avoids a render cycle and tracks the active expiresAt directly.\n const alertedForRef = useRef<string | null>(null);\n if (\n alertedForRef.current !== expiresAt &&\n remainingSeconds <= 60 &&\n remainingSeconds > 0 &&\n typeof window !== 'undefined' &&\n 'Notification' in window &&\n Notification.permission === 'granted'\n ) {\n alertedForRef.current = expiresAt;\n new Notification(tWithFallback(t, 'sandbox.timer.alertTitle', 'Sandbox expiring'), {\n body: tWithFallback(\n t,\n 'sandbox.timer.alertBody',\n 'Your sandbox will be destroyed in less than 1 minute. Extend it to continue working.'\n ),\n icon: '/favicon.ico',\n });\n }\n\n const hours = Math.floor(remainingSeconds / 3600);\n const minutes = Math.floor((remainingSeconds % 3600) / 60);\n const seconds = remainingSeconds % 60;\n const fmt = (n: number) => String(n).padStart(2, '0');\n const timeString =\n hours > 0 ? `${fmt(hours)}:${fmt(minutes)}:${fmt(seconds)}` : `${fmt(minutes)}:${fmt(seconds)}`;\n\n const color = (() => {\n if (remainingSeconds <= 0) return 'text-text-secondary';\n if (remainingSeconds <= 30) return 'text-status-error-text animate-pulse';\n if (remainingSeconds <= 60) return 'text-status-error-text';\n if (remainingSeconds <= 300) return 'text-status-warning-text';\n return 'text-status-success-text';\n })();\n\n const bg = (() => {\n if (remainingSeconds <= 0) return 'bg-bg-sunken border-border-subtle';\n if (remainingSeconds <= 60) return 'bg-status-error-bg-subtle border-border-default';\n if (remainingSeconds <= 300) return 'bg-status-warning-bg-subtle border-border-default';\n return 'bg-status-success-bg-subtle border-border-default';\n })();\n\n const remainingMinutes = Math.max(1, Math.ceil(remainingSeconds / 60));\n const accessibleLabel =\n remainingSeconds <= 0\n ? tWithFallback(t, 'sandbox.timer.expired', 'Expired')\n : tWithFallback(t, 'sandbox.timer.remaining', `${remainingMinutes} minutes remaining`, {\n count: remainingMinutes,\n });\n\n if (compact) {\n return (\n <span\n role=\"timer\"\n aria-live=\"polite\"\n aria-label={accessibleLabel}\n className={`inline-flex items-center gap-1 text-sm font-mono tabular-nums ${color}`}\n >\n <Timer aria-hidden=\"true\" className=\"size-3.5\" />\n {timeString}\n </span>\n );\n }\n\n return (\n <div\n role=\"timer\"\n aria-live=\"polite\"\n aria-label={accessibleLabel}\n className={`flex items-center gap-3 rounded-lg border px-4 py-2 ${bg}`}\n >\n <Timer aria-hidden=\"true\" className={`size-5 ${color}`} />\n <div className=\"flex flex-col\">\n <span className={`text-lg font-mono font-semibold tabular-nums ${color}`}>\n {timeString}\n </span>\n <span className=\"text-xs text-text-secondary\">\n {remainingSeconds <= 0\n ? tWithFallback(t, 'sandbox.timer.expired', 'Expired')\n : tWithFallback(t, 'sandbox.timer.label', 'Time remaining')}\n </span>\n </div>\n\n {remainingSeconds <= 60 && remainingSeconds > 0 && (\n <div className=\"flex items-center gap-1 text-xs text-status-error-text font-medium\">\n <AlertTriangle aria-hidden=\"true\" className=\"size-3.5\" />\n {tWithFallback(t, 'sandbox.timer.expiringSoon', 'Expiring soon')}\n </div>\n )}\n\n {onExtend && remainingSeconds > 0 && (\n <button\n type=\"button\"\n onClick={onExtend}\n aria-label={tWithFallback(t, 'sandbox.timer.extend', 'Extend sandbox duration')}\n className=\"ml-auto flex items-center gap-1 rounded-md bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-secondary shadow-sm border border-border-subtle hover:bg-bg-sunken transition-colors\"\n >\n <Plus aria-hidden=\"true\" className=\"size-3.5\" />\n {tWithFallback(t, 'sandbox.timer.extend', 'Extend')}\n </button>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAaA,SAAgB,EAAe,EAC7B,cACA,cACA,aACA,aAAU,MACY;CACtB,IAAM,IAAmB,EAAoB,GAAW,EAAU,EAC5D,EAAE,SAAM,GAAS,EAIjB,IAAgB,EAAsB,KAAK;AACjD,CACE,EAAc,YAAY,KAC1B,KAAoB,MACpB,IAAmB,KACnB,OAAO,SAAW,OAClB,kBAAkB,UAClB,aAAa,eAAe,cAE5B,EAAc,UAAU,GACxB,IAAI,aAAa,EAAc,GAAG,4BAA4B,mBAAmB,EAAE;EACjF,MAAM,EACJ,GACA,2BACA,uFACD;EACD,MAAM;EACP,CAAC;CAGJ,IAAM,IAAQ,KAAK,MAAM,IAAmB,KAAK,EAC3C,IAAU,KAAK,MAAO,IAAmB,OAAQ,GAAG,EACpD,IAAU,IAAmB,IAC7B,KAAO,MAAc,OAAO,EAAE,CAAC,SAAS,GAAG,IAAI,EAC/C,IACJ,IAAQ,IAAI,GAAG,EAAI,EAAM,CAAC,GAAG,EAAI,EAAQ,CAAC,GAAG,EAAI,EAAQ,KAAK,GAAG,EAAI,EAAQ,CAAC,GAAG,EAAI,EAAQ,IAEzF,IACA,KAAoB,IAAU,wBAC9B,KAAoB,KAAW,yCAC/B,KAAoB,KAAW,2BAC/B,KAAoB,MAAY,6BAC7B,4BAGH,IACA,KAAoB,IAAU,sCAC9B,KAAoB,KAAW,oDAC/B,KAAo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import
|
|
3
|
+
import "@burdenoff/fe-libs/ui";
|
|
4
4
|
//#region src/sandbox/components/PageLayout.tsx
|
|
5
|
-
var
|
|
5
|
+
var r = {
|
|
6
6
|
sm: "max-w-screen-sm",
|
|
7
7
|
md: "max-w-screen-md",
|
|
8
8
|
lg: "max-w-screen-lg",
|
|
@@ -11,57 +11,50 @@ var i = {
|
|
|
11
11
|
"3xl": "max-w-[1600px]",
|
|
12
12
|
full: "max-w-full"
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function i({ children: i, title: a, subtitle: o, icon: s, headerActions: c, headerContent: l, heroBackdrop: u, maxWidth: d = "xl", showHeader: f = !0, className: p, contentClassName: m }) {
|
|
15
15
|
return /* @__PURE__ */ t("div", {
|
|
16
|
-
className: e("min-h-screen w-full bg-bg-surface text-text-primary", "px-4 sm:px-6 lg:px-8 xl:px-12", "py-6 sm:py-8 lg:py-10", "animate-in fade-in-0 slide-in-from-bottom-4 duration-200",
|
|
16
|
+
className: e("min-h-screen w-full bg-bg-surface text-text-primary", "px-4 sm:px-6 lg:px-8 xl:px-12", "py-6 sm:py-8 lg:py-10", "animate-in fade-in-0 slide-in-from-bottom-4 duration-200", p),
|
|
17
17
|
children: /* @__PURE__ */ n("div", {
|
|
18
|
-
className: e("mx-auto w-full",
|
|
19
|
-
children: [
|
|
20
|
-
className: "mb-6 sm:mb-8",
|
|
21
|
-
children: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
className: "
|
|
25
|
-
children: [
|
|
26
|
-
className: "
|
|
27
|
-
children: [s && /* @__PURE__ */
|
|
28
|
-
className: "flex
|
|
29
|
-
children: s
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
className: e("mx-auto w-full", r[d], m),
|
|
19
|
+
children: [f && (a || c) && /* @__PURE__ */ n("header", {
|
|
20
|
+
className: e("mb-6 sm:mb-8", u && "relative overflow-hidden rounded-2xl px-4 py-5 sm:px-6 sm:py-6"),
|
|
21
|
+
children: [
|
|
22
|
+
u,
|
|
23
|
+
/* @__PURE__ */ n("div", {
|
|
24
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
25
|
+
children: [/* @__PURE__ */ n("div", {
|
|
26
|
+
className: "space-y-1",
|
|
27
|
+
children: [(a || s) && /* @__PURE__ */ n("div", {
|
|
28
|
+
className: "flex items-center gap-3",
|
|
29
|
+
children: [s && /* @__PURE__ */ t("div", {
|
|
30
|
+
className: "flex-shrink-0 p-2.5 rounded-xl bg-action-primary-bg/10 text-primary",
|
|
31
|
+
children: s
|
|
32
|
+
}), a && /* @__PURE__ */ t("h1", {
|
|
33
|
+
className: "text-2xl sm:text-3xl font-bold tracking-tight text-text-primary",
|
|
34
|
+
children: a
|
|
35
|
+
})]
|
|
36
|
+
}), o && /* @__PURE__ */ t("p", {
|
|
37
|
+
className: "text-sm sm:text-base text-text-secondary max-w-2xl",
|
|
38
|
+
children: o
|
|
33
39
|
})]
|
|
34
|
-
}),
|
|
35
|
-
className: "
|
|
36
|
-
children:
|
|
40
|
+
}), c && /* @__PURE__ */ t("div", {
|
|
41
|
+
className: "flex items-center gap-2 flex-shrink-0",
|
|
42
|
+
children: c
|
|
37
43
|
})]
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
children: l
|
|
45
|
-
})]
|
|
44
|
+
}),
|
|
45
|
+
l && /* @__PURE__ */ t("div", {
|
|
46
|
+
className: "mt-4",
|
|
47
|
+
children: l
|
|
48
|
+
})
|
|
49
|
+
]
|
|
46
50
|
}), /* @__PURE__ */ t("div", {
|
|
47
51
|
className: "space-y-6",
|
|
48
|
-
children:
|
|
52
|
+
children: i
|
|
49
53
|
})]
|
|
50
54
|
})
|
|
51
55
|
});
|
|
52
56
|
}
|
|
53
|
-
function o({ icon: e, title: n, description: i, action: a, className: o }) {
|
|
54
|
-
return /* @__PURE__ */ t("div", {
|
|
55
|
-
className: o,
|
|
56
|
-
children: /* @__PURE__ */ t(r, {
|
|
57
|
-
icon: e,
|
|
58
|
-
title: n,
|
|
59
|
-
description: i,
|
|
60
|
-
action: a
|
|
61
|
-
})
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
57
|
//#endregion
|
|
65
|
-
export {
|
|
58
|
+
export { i as PageLayout };
|
|
66
59
|
|
|
67
60
|
//# sourceMappingURL=PageLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/sandbox/components/PageLayout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { EmptyState as CanonicalEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n children: ReactNode;\n /** Page title */\n title?:
|
|
1
|
+
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/sandbox/components/PageLayout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { EmptyState as CanonicalEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n children: ReactNode;\n /** Page title (string, or a node when a gradient/emphasis treatment is needed) */\n title?: ReactNode;\n /** Page subtitle/description */\n subtitle?: string;\n /** Icon component to display next to title */\n icon?: ReactNode;\n /** Actions to display in header (buttons, etc.) */\n headerActions?: ReactNode;\n /** Additional header content below title */\n headerContent?: ReactNode;\n /**\n * Optional decorative backdrop rendered behind the header section (e.g. an\n * `<AuroraBackground />`). It is placed in a `relative overflow-hidden`\n * wrapper at -z-10 so it never moves or covers content. Use sparingly — one\n * hero backdrop per MFE (the primary page).\n */\n heroBackdrop?: ReactNode;\n /** Maximum width of content: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' */\n maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';\n /** Whether to show the header section */\n showHeader?: boolean;\n /** Additional CSS classes for the container */\n className?: string;\n /** Additional CSS classes for the content area */\n contentClassName?: string;\n}\n\nconst maxWidthClasses = {\n sm: 'max-w-screen-sm',\n md: 'max-w-screen-md',\n lg: 'max-w-screen-lg',\n xl: 'max-w-screen-xl',\n '2xl': 'max-w-screen-2xl',\n '3xl': 'max-w-[1600px]',\n full: 'max-w-full',\n};\n\n/**\n * PageLayout - A consistent page wrapper with responsive design\n */\nexport function PageLayout({\n children,\n title,\n subtitle,\n icon,\n headerActions,\n headerContent,\n heroBackdrop,\n maxWidth = 'xl',\n showHeader = true,\n className,\n contentClassName,\n}: PageLayoutProps) {\n return (\n <div\n className={cn(\n 'min-h-screen w-full bg-bg-surface text-text-primary',\n 'px-4 sm:px-6 lg:px-8 xl:px-12',\n 'py-6 sm:py-8 lg:py-10',\n 'animate-in fade-in-0 slide-in-from-bottom-4 duration-200',\n className\n )}\n >\n <div className={cn('mx-auto w-full', maxWidthClasses[maxWidth], contentClassName)}>\n {showHeader && (title || headerActions) && (\n <header\n className={cn(\n 'mb-6 sm:mb-8',\n heroBackdrop && 'relative overflow-hidden rounded-2xl px-4 py-5 sm:px-6 sm:py-6'\n )}\n >\n {heroBackdrop}\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"space-y-1\">\n {(title || icon) && (\n <div className=\"flex items-center gap-3\">\n {icon && (\n <div className=\"flex-shrink-0 p-2.5 rounded-xl bg-action-primary-bg/10 text-primary\">\n {icon}\n </div>\n )}\n {title && (\n <h1 className=\"text-2xl sm:text-3xl font-bold tracking-tight text-text-primary\">\n {title}\n </h1>\n )}\n </div>\n )}\n {subtitle && (\n <p className=\"text-sm sm:text-base text-text-secondary max-w-2xl\">{subtitle}</p>\n )}\n </div>\n {headerActions && (\n <div className=\"flex items-center gap-2 flex-shrink-0\">{headerActions}</div>\n )}\n </div>\n {headerContent && <div className=\"mt-4\">{headerContent}</div>}\n </header>\n )}\n {/* Page content — must not use a <main> landmark here because the\n host shell (AppShellLayout) already renders one; nesting <main>\n elements is invalid HTML and an a11y violation. */}\n <div className=\"space-y-6\">{children}</div>\n </div>\n </div>\n );\n}\n\n/**\n * Local wrapper around the canonical `EmptyState` from `@burdenoff/fe-libs/ui`.\n * Keeps the existing microfe-sandbox call sites stable while routing all\n * empty-state rendering through the shared primitive.\n */\nexport function EmptyState({\n icon,\n title,\n description,\n action,\n className,\n}: {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}) {\n return (\n <div className={className}>\n <CanonicalEmptyState icon={icon} title={title} description={description} action={action} />\n </div>\n );\n}\n"],"mappings":";;;;AAiCA,IAAM,IAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,MAAM;CACP;AAKD,SAAgB,EAAW,EACzB,aACA,UACA,aACA,SACA,kBACA,kBACA,iBACA,cAAW,MACX,gBAAa,IACb,cACA,uBACkB;AAClB,QACE,kBAAC,OAAD;EACE,WAAW,EACT,uDACA,iCACA,yBACA,4DACA,EACD;YAED,kBAAC,OAAD;GAAK,WAAW,EAAG,kBAAkB,EAAgB,IAAW,EAAiB;aAAjF,CACG,MAAe,KAAS,MACvB,kBAAC,UAAD;IACE,WAAW,EACT,gBACA,KAAgB,iEACjB;cAJH;KAMG;KACD,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,OAAD;OAAK,WAAU;iBAAf,EACI,KAAS,MACT,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACG,KACC,kBAAC,OAAD;SAAK,WAAU;mBACZ;SACG,CAAA,EAEP,KACC,kBAAC,MAAD;SAAI,WAAU;mBACX;SACE,CAAA,CAEH;WAEP,KACC,kBAAC,KAAD;QAAG,WAAU;kBAAsD;QAAa,CAAA,CAE9E;UACL,KACC,kBAAC,OAAD;OAAK,WAAU;iBAAyC;OAAoB,CAAA,CAE1E;;KACL,KAAiB,kBAAC,OAAD;MAAK,WAAU;gBAAQ;MAAoB,CAAA;KACtD;OAKX,kBAAC,OAAD;IAAK,WAAU;IAAa;IAAe,CAAA,CACvC;;EACF,CAAA"}
|
|
@@ -59,7 +59,7 @@ var p = {
|
|
|
59
59
|
color: "text-text-secondary",
|
|
60
60
|
bg: "bg-bg-sunken border-border-subtle",
|
|
61
61
|
icon: i
|
|
62
|
-
}, l = c.icon, m = n === "PROVISIONING" || n === "STOPPING", h = {
|
|
62
|
+
}, l = c.icon, m = n === "PROVISIONING" || n === "STOPPING", h = n === "RUNNING", g = {
|
|
63
63
|
PENDING: t(s, "sandbox.status.pending", "Pending"),
|
|
64
64
|
PROVISIONING: t(s, "sandbox.status.provisioning", "Provisioning"),
|
|
65
65
|
RUNNING: t(s, "sandbox.status.running", "Running"),
|
|
@@ -70,13 +70,13 @@ var p = {
|
|
|
70
70
|
FAILED: t(s, "sandbox.status.failed", "Failed")
|
|
71
71
|
}[n] ?? c.label;
|
|
72
72
|
return /* @__PURE__ */ f("output", {
|
|
73
|
-
"aria-label":
|
|
73
|
+
"aria-label": g,
|
|
74
74
|
className: e("inline-flex items-center gap-1.5 border rounded-full font-medium", o === "sm" ? "px-2.5 py-0.5 text-xs" : "px-3 py-1 text-sm", c.bg, c.color, r),
|
|
75
75
|
children: [a && /* @__PURE__ */ d(l, {
|
|
76
76
|
size: o === "sm" ? 12 : 14,
|
|
77
77
|
"aria-hidden": "true",
|
|
78
|
-
className: e(m && "animate-spin")
|
|
79
|
-
}),
|
|
78
|
+
className: e(m && "animate-spin", h && "motion-safe:animate-vc-glow-pulse")
|
|
79
|
+
}), g]
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/sandbox/components/StatusBadge.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n Clock,\n Loader2,\n CheckCircle2,\n StopCircle,\n AlertTriangle,\n TimerOff,\n XCircle,\n Circle,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { cn } from '../utils/cn';\nimport type { SandboxStatus } from '../types';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface StatusBadgeProps {\n status: SandboxStatus;\n className?: string;\n showIcon?: boolean;\n size?: 'sm' | 'md';\n}\n\nconst statusConfig: Record<\n SandboxStatus,\n { label: string; color: string; bg: string; icon: FC<{ size?: number; className?: string }> }\n> = {\n PENDING: {\n label: 'Pending',\n color: 'text-status-warning-text',\n bg: 'bg-status-warning-bg-subtle border-border-default',\n icon: Clock,\n },\n PROVISIONING: {\n label: 'Provisioning',\n color: 'text-status-info-text',\n bg: 'bg-status-info-bg-subtle border-border-default',\n icon: Loader2,\n },\n RUNNING: {\n label: 'Running',\n color: 'text-status-success-text',\n bg: 'bg-status-success-bg-subtle border-border-default',\n icon: CheckCircle2,\n },\n STOPPING: {\n label: 'Stopping',\n color: 'text-accent-orange',\n bg: 'bg-accent-orange-subtle border-border-default',\n icon: Loader2,\n },\n STOPPED: {\n label: 'Stopped',\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-default',\n icon: StopCircle,\n },\n ERROR: {\n label: 'Error',\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg-subtle border-border-default',\n icon: AlertTriangle,\n },\n EXPIRED: {\n label: 'Expired',\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-default',\n icon: TimerOff,\n },\n FAILED: {\n label: 'Failed',\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg-subtle border-border-default',\n icon: XCircle,\n },\n};\n\n/**\n * Color-coded status badge for sandbox lifecycle states\n */\nexport const StatusBadge: FC<StatusBadgeProps> = ({\n status,\n className,\n showIcon = true,\n size = 'sm',\n}) => {\n const { t } = useI18n();\n const config = statusConfig[status] || {\n label: status,\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-subtle',\n icon: Circle,\n };\n const Icon = config.icon;\n const isAnimated = status === 'PROVISIONING' || status === 'STOPPING';\n const labels: Record<SandboxStatus, string> = {\n PENDING: tWithFallback(t, 'sandbox.status.pending', 'Pending'),\n PROVISIONING: tWithFallback(t, 'sandbox.status.provisioning', 'Provisioning'),\n RUNNING: tWithFallback(t, 'sandbox.status.running', 'Running'),\n STOPPING: tWithFallback(t, 'sandbox.status.stopping', 'Stopping'),\n STOPPED: tWithFallback(t, 'sandbox.status.stopped', 'Stopped'),\n ERROR: tWithFallback(t, 'sandbox.status.error', 'Error'),\n EXPIRED: tWithFallback(t, 'sandbox.status.expired', 'Expired'),\n FAILED: tWithFallback(t, 'sandbox.status.failed', 'Failed'),\n };\n\n const label = labels[status] ?? config.label;\n return (\n <output\n aria-label={label}\n className={cn(\n 'inline-flex items-center gap-1.5 border rounded-full font-medium',\n size === 'sm' ? 'px-2.5 py-0.5 text-xs' : 'px-3 py-1 text-sm',\n config.bg,\n config.color,\n className\n )}\n >\n {showIcon && (\n <Icon\n size={size === 'sm' ? 12 : 14}\n aria-hidden=\"true\"\n className={cn(isAnimated && 'animate-spin')}\n />\n )}\n {label}\n </output>\n );\n};\n"],"mappings":";;;;;;AAuBA,IAAM,IAGF;CACF,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,cAAc;EACZ,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,UAAU;EACR,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,OAAO;EACL,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,QAAQ;EACN,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACF,EAKY,KAAqC,EAChD,WACA,cACA,cAAW,IACX,UAAO,WACH;CACJ,IAAM,EAAE,SAAM,GAAS,EACjB,IAAS,EAAa,MAAW;EACrC,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP,EACK,IAAO,EAAO,MACd,IAAa,MAAW,kBAAkB,MAAW,
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/sandbox/components/StatusBadge.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n Clock,\n Loader2,\n CheckCircle2,\n StopCircle,\n AlertTriangle,\n TimerOff,\n XCircle,\n Circle,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { cn } from '../utils/cn';\nimport type { SandboxStatus } from '../types';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface StatusBadgeProps {\n status: SandboxStatus;\n className?: string;\n showIcon?: boolean;\n size?: 'sm' | 'md';\n}\n\nconst statusConfig: Record<\n SandboxStatus,\n { label: string; color: string; bg: string; icon: FC<{ size?: number; className?: string }> }\n> = {\n PENDING: {\n label: 'Pending',\n color: 'text-status-warning-text',\n bg: 'bg-status-warning-bg-subtle border-border-default',\n icon: Clock,\n },\n PROVISIONING: {\n label: 'Provisioning',\n color: 'text-status-info-text',\n bg: 'bg-status-info-bg-subtle border-border-default',\n icon: Loader2,\n },\n RUNNING: {\n label: 'Running',\n color: 'text-status-success-text',\n bg: 'bg-status-success-bg-subtle border-border-default',\n icon: CheckCircle2,\n },\n STOPPING: {\n label: 'Stopping',\n color: 'text-accent-orange',\n bg: 'bg-accent-orange-subtle border-border-default',\n icon: Loader2,\n },\n STOPPED: {\n label: 'Stopped',\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-default',\n icon: StopCircle,\n },\n ERROR: {\n label: 'Error',\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg-subtle border-border-default',\n icon: AlertTriangle,\n },\n EXPIRED: {\n label: 'Expired',\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-default',\n icon: TimerOff,\n },\n FAILED: {\n label: 'Failed',\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg-subtle border-border-default',\n icon: XCircle,\n },\n};\n\n/**\n * Color-coded status badge for sandbox lifecycle states\n */\nexport const StatusBadge: FC<StatusBadgeProps> = ({\n status,\n className,\n showIcon = true,\n size = 'sm',\n}) => {\n const { t } = useI18n();\n const config = statusConfig[status] || {\n label: status,\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-subtle',\n icon: Circle,\n };\n const Icon = config.icon;\n const isAnimated = status === 'PROVISIONING' || status === 'STOPPING';\n // Subtle opacity pulse on the live/running indicator (reduced-motion-safe).\n const isLive = status === 'RUNNING';\n const labels: Record<SandboxStatus, string> = {\n PENDING: tWithFallback(t, 'sandbox.status.pending', 'Pending'),\n PROVISIONING: tWithFallback(t, 'sandbox.status.provisioning', 'Provisioning'),\n RUNNING: tWithFallback(t, 'sandbox.status.running', 'Running'),\n STOPPING: tWithFallback(t, 'sandbox.status.stopping', 'Stopping'),\n STOPPED: tWithFallback(t, 'sandbox.status.stopped', 'Stopped'),\n ERROR: tWithFallback(t, 'sandbox.status.error', 'Error'),\n EXPIRED: tWithFallback(t, 'sandbox.status.expired', 'Expired'),\n FAILED: tWithFallback(t, 'sandbox.status.failed', 'Failed'),\n };\n\n const label = labels[status] ?? config.label;\n return (\n <output\n aria-label={label}\n className={cn(\n 'inline-flex items-center gap-1.5 border rounded-full font-medium',\n size === 'sm' ? 'px-2.5 py-0.5 text-xs' : 'px-3 py-1 text-sm',\n config.bg,\n config.color,\n className\n )}\n >\n {showIcon && (\n <Icon\n size={size === 'sm' ? 12 : 14}\n aria-hidden=\"true\"\n className={cn(\n isAnimated && 'animate-spin',\n isLive && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n )}\n {label}\n </output>\n );\n};\n"],"mappings":";;;;;;AAuBA,IAAM,IAGF;CACF,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,cAAc;EACZ,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;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