@burdenoff/microfe-sandbox 2026.624.2 → 2026.625.1

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.
@@ -16,7 +16,7 @@ function l({ expiresAt: l, onExpired: u, onExtend: d, compact: f = !1 }) {
16
16
  role: "timer",
17
17
  "aria-live": "polite",
18
18
  "aria-label": w,
19
- className: `inline-flex items-center gap-1 text-sm font-mono ${x}`,
19
+ className: `inline-flex items-center gap-1 text-sm font-mono tabular-nums ${x}`,
20
20
  children: [/* @__PURE__ */ s(a, {
21
21
  "aria-hidden": "true",
22
22
  className: "size-3.5"
@@ -34,7 +34,7 @@ function l({ expiresAt: l, onExpired: u, onExtend: d, compact: f = !1 }) {
34
34
  /* @__PURE__ */ c("div", {
35
35
  className: "flex flex-col",
36
36
  children: [/* @__PURE__ */ s("span", {
37
- className: `text-lg font-mono font-semibold ${x}`,
37
+ className: `text-lg font-mono font-semibold tabular-nums ${x}`,
38
38
  children: b
39
39
  }), /* @__PURE__ */ s("span", {
40
40
  className: "text-xs text-text-secondary",
@@ -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 ${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 ${color}`}>{timeString}</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,K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;cAAf,CACE,kBAAC,GAAD;KAAe,eAAY;KAAO,WAAU;KAAa,CAAA,EACxD,EAAc,GAAG,8BAA8B,gBAAgB,CAC5D;;GAGP,KAAY,IAAmB,KAC9B,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,cAAY,EAAc,GAAG,wBAAwB,0BAA0B;IAC/E,WAAU;cAJZ,CAME,kBAAC,GAAD;KAAM,eAAY;KAAO,WAAU;KAAa,CAAA,EAC/C,EAAc,GAAG,wBAAwB,SAAS,CAC5C;;GAEP"}
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}`}>{timeString}</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,yCA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7 +37,7 @@ var o = ({ cpuRequest: o, cpuLimit: s, memoryRequest: c, memoryLimit: l, contain
37
37
  children: e.label
38
38
  }),
39
39
  /* @__PURE__ */ i("span", {
40
- className: "text-sm font-semibold",
40
+ className: "text-sm font-semibold tabular-nums",
41
41
  children: e.value
42
42
  })
43
43
  ]
@@ -52,7 +52,7 @@ var o = ({ cpuRequest: o, cpuLimit: s, memoryRequest: c, memoryLimit: l, contain
52
52
  className: e.color
53
53
  }),
54
54
  /* @__PURE__ */ i("span", {
55
- className: "font-medium",
55
+ className: "font-medium tabular-nums",
56
56
  children: e.value
57
57
  }),
58
58
  t < p.length - 1 && /* @__PURE__ */ i("span", {
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceDisplay.js","names":[],"sources":["../../../src/sandbox/components/ResourceDisplay.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Cpu, MemoryStick, Container } from 'lucide-react';\nimport { cn } from '../utils/cn';\n\ninterface ResourceDisplayProps {\n cpuRequest: string;\n cpuLimit?: string;\n memoryRequest: string;\n memoryLimit?: string;\n containerCount?: number;\n className?: string;\n layout?: 'inline' | 'grid';\n}\n\n/**\n * Compact display for sandbox resource allocation (CPU / Memory / Containers)\n */\nexport const ResourceDisplay: FC<ResourceDisplayProps> = ({\n cpuRequest,\n cpuLimit,\n memoryRequest,\n memoryLimit,\n containerCount,\n className,\n layout = 'inline',\n}) => {\n const items = [\n {\n icon: Cpu,\n label: 'CPU',\n value: cpuLimit ? `${cpuRequest} / ${cpuLimit}` : cpuRequest,\n color: 'text-accent-blue',\n },\n {\n icon: MemoryStick,\n label: 'Memory',\n value: memoryLimit ? `${memoryRequest} / ${memoryLimit}` : memoryRequest,\n color: 'text-accent-purple',\n },\n ...(containerCount !== undefined\n ? [\n {\n icon: Container,\n label: 'Containers',\n value: `${containerCount}`,\n color: 'text-status-warning-text',\n },\n ]\n : []),\n ];\n\n if (layout === 'grid') {\n return (\n <div className={cn('grid grid-cols-3 gap-3', className)}>\n {items.map((item) => (\n <div\n key={item.label}\n className=\"flex flex-col items-center gap-1 p-2 rounded-lg bg-bg-sunken/50\"\n >\n <item.icon size={16} className={item.color} />\n <span className=\"text-xs text-text-secondary\">{item.label}</span>\n <span className=\"text-sm font-semibold\">{item.value}</span>\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <div className={cn('flex items-center gap-3 text-sm', className)}>\n {items.map((item, index) => (\n <span key={item.label} className=\"inline-flex items-center gap-1\">\n <item.icon size={14} className={item.color} />\n <span className=\"font-medium\">{item.value}</span>\n {index < items.length - 1 && <span className=\"ml-2 text-text-secondary/40\">|</span>}\n </span>\n ))}\n </div>\n );\n};\n"],"mappings":";;;;AAiBA,IAAa,KAA6C,EACxD,eACA,aACA,kBACA,gBACA,mBACA,cACA,YAAS,eACL;CACJ,IAAM,IAAQ;EACZ;GACE,MAAM;GACN,OAAO;GACP,OAAO,IAAW,GAAG,EAAW,KAAK,MAAa;GAClD,OAAO;GACR;EACD;GACE,MAAM;GACN,OAAO;GACP,OAAO,IAAc,GAAG,EAAc,KAAK,MAAgB;GAC3D,OAAO;GACR;EACD,GAAI,MAAmB,KAAA,IASnB,EAAE,GARF,CACE;GACE,MAAM;GACN,OAAO;GACP,OAAO,GAAG;GACV,OAAO;GACR,CACF;EAEN;AAmBD,QAjBI,MAAW,SAEX,kBAAC,OAAD;EAAK,WAAW,EAAG,0BAA0B,EAAU;YACpD,EAAM,KAAK,MACV,kBAAC,OAAD;GAEE,WAAU;aAFZ;IAIE,kBAAC,EAAK,MAAN;KAAW,MAAM;KAAI,WAAW,EAAK;KAAS,CAAA;IAC9C,kBAAC,QAAD;KAAM,WAAU;eAA+B,EAAK;KAAa,CAAA;IACjE,kBAAC,QAAD;KAAM,WAAU;eAAyB,EAAK;KAAa,CAAA;IACvD;KANC,EAAK,MAMN,CACN;EACE,CAAA,GAKR,kBAAC,OAAD;EAAK,WAAW,EAAG,mCAAmC,EAAU;YAC7D,EAAM,KAAK,GAAM,MAChB,kBAAC,QAAD;GAAuB,WAAU;aAAjC;IACE,kBAAC,EAAK,MAAN;KAAW,MAAM;KAAI,WAAW,EAAK;KAAS,CAAA;IAC9C,kBAAC,QAAD;KAAM,WAAU;eAAe,EAAK;KAAa,CAAA;IAChD,IAAQ,EAAM,SAAS,KAAK,kBAAC,QAAD;KAAM,WAAU;eAA8B;KAAQ,CAAA;IAC9E;KAJI,EAAK,MAIT,CACP;EACE,CAAA"}
1
+ {"version":3,"file":"ResourceDisplay.js","names":[],"sources":["../../../src/sandbox/components/ResourceDisplay.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Cpu, MemoryStick, Container } from 'lucide-react';\nimport { cn } from '../utils/cn';\n\ninterface ResourceDisplayProps {\n cpuRequest: string;\n cpuLimit?: string;\n memoryRequest: string;\n memoryLimit?: string;\n containerCount?: number;\n className?: string;\n layout?: 'inline' | 'grid';\n}\n\n/**\n * Compact display for sandbox resource allocation (CPU / Memory / Containers)\n */\nexport const ResourceDisplay: FC<ResourceDisplayProps> = ({\n cpuRequest,\n cpuLimit,\n memoryRequest,\n memoryLimit,\n containerCount,\n className,\n layout = 'inline',\n}) => {\n const items = [\n {\n icon: Cpu,\n label: 'CPU',\n value: cpuLimit ? `${cpuRequest} / ${cpuLimit}` : cpuRequest,\n color: 'text-accent-blue',\n },\n {\n icon: MemoryStick,\n label: 'Memory',\n value: memoryLimit ? `${memoryRequest} / ${memoryLimit}` : memoryRequest,\n color: 'text-accent-purple',\n },\n ...(containerCount !== undefined\n ? [\n {\n icon: Container,\n label: 'Containers',\n value: `${containerCount}`,\n color: 'text-status-warning-text',\n },\n ]\n : []),\n ];\n\n if (layout === 'grid') {\n return (\n <div className={cn('grid grid-cols-3 gap-3', className)}>\n {items.map((item) => (\n <div\n key={item.label}\n className=\"flex flex-col items-center gap-1 p-2 rounded-lg bg-bg-sunken/50\"\n >\n <item.icon size={16} className={item.color} />\n <span className=\"text-xs text-text-secondary\">{item.label}</span>\n <span className=\"text-sm font-semibold tabular-nums\">{item.value}</span>\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <div className={cn('flex items-center gap-3 text-sm', className)}>\n {items.map((item, index) => (\n <span key={item.label} className=\"inline-flex items-center gap-1\">\n <item.icon size={14} className={item.color} />\n <span className=\"font-medium tabular-nums\">{item.value}</span>\n {index < items.length - 1 && <span className=\"ml-2 text-text-secondary/40\">|</span>}\n </span>\n ))}\n </div>\n );\n};\n"],"mappings":";;;;AAiBA,IAAa,KAA6C,EACxD,eACA,aACA,kBACA,gBACA,mBACA,cACA,YAAS,eACL;CACJ,IAAM,IAAQ;EACZ;GACE,MAAM;GACN,OAAO;GACP,OAAO,IAAW,GAAG,EAAW,KAAK,MAAa;GAClD,OAAO;GACR;EACD;GACE,MAAM;GACN,OAAO;GACP,OAAO,IAAc,GAAG,EAAc,KAAK,MAAgB;GAC3D,OAAO;GACR;EACD,GAAI,MAAmB,KAAA,IASnB,EAAE,GARF,CACE;GACE,MAAM;GACN,OAAO;GACP,OAAO,GAAG;GACV,OAAO;GACR,CACF;EAEN;AAmBD,QAjBI,MAAW,SAEX,kBAAC,OAAD;EAAK,WAAW,EAAG,0BAA0B,EAAU;YACpD,EAAM,KAAK,MACV,kBAAC,OAAD;GAEE,WAAU;aAFZ;IAIE,kBAAC,EAAK,MAAN;KAAW,MAAM;KAAI,WAAW,EAAK;KAAS,CAAA;IAC9C,kBAAC,QAAD;KAAM,WAAU;eAA+B,EAAK;KAAa,CAAA;IACjE,kBAAC,QAAD;KAAM,WAAU;eAAsC,EAAK;KAAa,CAAA;IACpE;KANC,EAAK,MAMN,CACN;EACE,CAAA,GAKR,kBAAC,OAAD;EAAK,WAAW,EAAG,mCAAmC,EAAU;YAC7D,EAAM,KAAK,GAAM,MAChB,kBAAC,QAAD;GAAuB,WAAU;aAAjC;IACE,kBAAC,EAAK,MAAN;KAAW,MAAM;KAAI,WAAW,EAAK;KAAS,CAAA;IAC9C,kBAAC,QAAD;KAAM,WAAU;eAA4B,EAAK;KAAa,CAAA;IAC7D,IAAQ,EAAM,SAAS,KAAK,kBAAC,QAAD;KAAM,WAAU;eAA8B;KAAQ,CAAA;IAC9E;KAJI,EAAK,MAIT,CACP;EACE,CAAA"}
@@ -6,12 +6,15 @@ function i({ runningCount: i, maxConcurrent: a, minutesConsumed: o, minutesQuota
6
6
  let { t: c } = t(), l = a > 0 ? Math.min(100, Math.round(i / a * 100)) : 0;
7
7
  return /* @__PURE__ */ r("output", {
8
8
  "aria-live": "polite",
9
- className: "flex flex-wrap items-center gap-3 rounded-md border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
9
+ className: "flex flex-wrap items-center gap-3 rounded-card border border-border-seam bg-accent-wash px-3.5 py-2.5 text-xs text-text-secondary",
10
10
  children: [
11
- /* @__PURE__ */ n("span", { children: e(c, "sandbox.usageBanner.concurrent", `${i} of ${a} sandboxes running`, {
12
- count: i,
13
- max: a
14
- }) }),
11
+ /* @__PURE__ */ n("span", {
12
+ className: "tabular-nums",
13
+ children: e(c, "sandbox.usageBanner.concurrent", `${i} of ${a} sandboxes running`, {
14
+ count: i,
15
+ max: a
16
+ })
17
+ }),
15
18
  /* @__PURE__ */ n("div", {
16
19
  className: "h-1.5 w-32 overflow-hidden rounded-full bg-bg-surface",
17
20
  "aria-hidden": "true",
@@ -1 +1 @@
1
- {"version":3,"file":"SandboxUsageBanner.js","names":[],"sources":["../../../src/sandbox/components/SandboxUsageBanner.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface Props {\n /** Concurrent running count from the live list (cheap to compute client-side). */\n runningCount: number;\n /** Workspace policy max (`SandboxConfig.maxConcurrentPerWorkspace`). */\n maxConcurrent: number;\n /** Optional consumed/quota minute counts for monthly usage. Hide block if not provided. */\n minutesConsumed?: number;\n minutesQuota?: number;\n}\n\n/**\n * Compact usage banner shown above the sandbox list. Mirrors the per-workspace\n * limits set by admins so members see why creates are blocked when they hit a cap.\n */\nexport function SandboxUsageBanner({\n runningCount,\n maxConcurrent,\n minutesConsumed,\n minutesQuota,\n}: Props) {\n const { t } = useI18n();\n\n const pct =\n maxConcurrent > 0 ? Math.min(100, Math.round((runningCount / maxConcurrent) * 100)) : 0;\n\n return (\n <output\n aria-live=\"polite\"\n className=\"flex flex-wrap items-center gap-3 rounded-md border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary\"\n >\n <span>\n {tWithFallback(\n t,\n 'sandbox.usageBanner.concurrent',\n `${runningCount} of ${maxConcurrent} sandboxes running`,\n { count: runningCount, max: maxConcurrent }\n )}\n </span>\n <div className=\"h-1.5 w-32 overflow-hidden rounded-full bg-bg-surface\" aria-hidden=\"true\">\n <div\n className={`h-full ${pct >= 90 ? 'bg-status-error-bg-default' : pct >= 70 ? 'bg-status-warning-bg-default' : 'bg-status-success-bg-default'}`}\n style={{ width: `${pct}%` }}\n />\n </div>\n {typeof minutesConsumed === 'number' && typeof minutesQuota === 'number' && (\n <span className=\"ml-auto\">\n {tWithFallback(\n t,\n 'sandbox.usageBanner.consumed',\n `${minutesConsumed} of ${minutesQuota} minutes used this month`,\n { minutes: minutesConsumed, quota: minutesQuota }\n )}\n </span>\n )}\n </output>\n );\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAmB,EACjC,iBACA,kBACA,oBACA,mBACQ;CACR,IAAM,EAAE,SAAM,GAAS,EAEjB,IACJ,IAAgB,IAAI,KAAK,IAAI,KAAK,KAAK,MAAO,IAAe,IAAiB,IAAI,CAAC,GAAG;AAExF,QACE,kBAAC,UAAD;EACE,aAAU;EACV,WAAU;YAFZ;GAIE,kBAAC,QAAD,EAAA,UACG,EACC,GACA,kCACA,GAAG,EAAa,MAAM,EAAc,qBACpC;IAAE,OAAO;IAAc,KAAK;IAAe,CAC5C,EACI,CAAA;GACP,kBAAC,OAAD;IAAK,WAAU;IAAwD,eAAY;cACjF,kBAAC,OAAD;KACE,WAAW,UAAU,KAAO,KAAK,+BAA+B,KAAO,KAAK,iCAAiC;KAC7G,OAAO,EAAE,OAAO,GAAG,EAAI,IAAI;KAC3B,CAAA;IACE,CAAA;GACL,OAAO,KAAoB,YAAY,OAAO,KAAiB,YAC9D,kBAAC,QAAD;IAAM,WAAU;cACb,EACC,GACA,gCACA,GAAG,EAAgB,MAAM,EAAa,2BACtC;KAAE,SAAS;KAAiB,OAAO;KAAc,CAClD;IACI,CAAA;GAEF"}
1
+ {"version":3,"file":"SandboxUsageBanner.js","names":[],"sources":["../../../src/sandbox/components/SandboxUsageBanner.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface Props {\n /** Concurrent running count from the live list (cheap to compute client-side). */\n runningCount: number;\n /** Workspace policy max (`SandboxConfig.maxConcurrentPerWorkspace`). */\n maxConcurrent: number;\n /** Optional consumed/quota minute counts for monthly usage. Hide block if not provided. */\n minutesConsumed?: number;\n minutesQuota?: number;\n}\n\n/**\n * Compact usage banner shown above the sandbox list. Mirrors the per-workspace\n * limits set by admins so members see why creates are blocked when they hit a cap.\n */\nexport function SandboxUsageBanner({\n runningCount,\n maxConcurrent,\n minutesConsumed,\n minutesQuota,\n}: Props) {\n const { t } = useI18n();\n\n const pct =\n maxConcurrent > 0 ? Math.min(100, Math.round((runningCount / maxConcurrent) * 100)) : 0;\n\n return (\n <output\n aria-live=\"polite\"\n className=\"flex flex-wrap items-center gap-3 rounded-card border border-border-seam bg-accent-wash px-3.5 py-2.5 text-xs text-text-secondary\"\n >\n <span className=\"tabular-nums\">\n {tWithFallback(\n t,\n 'sandbox.usageBanner.concurrent',\n `${runningCount} of ${maxConcurrent} sandboxes running`,\n { count: runningCount, max: maxConcurrent }\n )}\n </span>\n <div className=\"h-1.5 w-32 overflow-hidden rounded-full bg-bg-surface\" aria-hidden=\"true\">\n <div\n className={`h-full ${pct >= 90 ? 'bg-status-error-bg-default' : pct >= 70 ? 'bg-status-warning-bg-default' : 'bg-status-success-bg-default'}`}\n style={{ width: `${pct}%` }}\n />\n </div>\n {typeof minutesConsumed === 'number' && typeof minutesQuota === 'number' && (\n <span className=\"ml-auto\">\n {tWithFallback(\n t,\n 'sandbox.usageBanner.consumed',\n `${minutesConsumed} of ${minutesQuota} minutes used this month`,\n { minutes: minutesConsumed, quota: minutesQuota }\n )}\n </span>\n )}\n </output>\n );\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAmB,EACjC,iBACA,kBACA,oBACA,mBACQ;CACR,IAAM,EAAE,SAAM,GAAS,EAEjB,IACJ,IAAgB,IAAI,KAAK,IAAI,KAAK,KAAK,MAAO,IAAe,IAAiB,IAAI,CAAC,GAAG;AAExF,QACE,kBAAC,UAAD;EACE,aAAU;EACV,WAAU;YAFZ;GAIE,kBAAC,QAAD;IAAM,WAAU;cACb,EACC,GACA,kCACA,GAAG,EAAa,MAAM,EAAc,qBACpC;KAAE,OAAO;KAAc,KAAK;KAAe,CAC5C;IACI,CAAA;GACP,kBAAC,OAAD;IAAK,WAAU;IAAwD,eAAY;cACjF,kBAAC,OAAD;KACE,WAAW,UAAU,KAAO,KAAK,+BAA+B,KAAO,KAAK,iCAAiC;KAC7G,OAAO,EAAE,OAAO,GAAG,EAAI,IAAI;KAC3B,CAAA;IACE,CAAA;GACL,OAAO,KAAoB,YAAY,OAAO,KAAiB,YAC9D,kBAAC,QAAD;IAAM,WAAU;cACb,EACC,GACA,gCACA,GAAG,EAAgB,MAAM,EAAa,2BACtC;KAAE,SAAS;KAAiB,OAAO;KAAc,CAClD;IACI,CAAA;GAEF"}
@@ -1,2 +1,2 @@
1
- import { Badge as e, Button as t, Card as n, CardContent as r, Checkbox as i, Dialog as a, DialogContent as o, DialogDescription as s, DialogFooter as c, DialogHeader as l, DialogTitle as u, Input as d, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g, Skeleton as _ } from "@burdenoff/fe-libs/ui";
2
- export { e as Badge, t as Button, n as Card, r as CardContent, i as Checkbox, a as Dialog, o as DialogContent, s as DialogDescription, c as DialogFooter, l as DialogHeader, u as DialogTitle, d as Input, f as Select, p as SelectContent, m as SelectItem, h as SelectTrigger, g as SelectValue, _ as Skeleton };
1
+ import { Badge as e, Button as t, CTAOverflowMenu as n, Card as r, CardContent as i, Checkbox as a, Dialog as o, DialogContent as s, DialogDescription as c, DialogFooter as l, DialogHeader as u, DialogTitle as d, EmphasisPanel as f, GlassCard as p, Input as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, ShowMore as b, Skeleton as x } from "@burdenoff/fe-libs/ui";
2
+ export { e as Badge, t as Button, n as CTAOverflowMenu, r as Card, i as CardContent, a as Checkbox, o as Dialog, s as DialogContent, c as DialogDescription, l as DialogFooter, u as DialogHeader, d as DialogTitle, f as EmphasisPanel, p as GlassCard, m as Input, h as Select, g as SelectContent, _ as SelectItem, v as SelectTrigger, y as SelectValue, b as ShowMore, x as Skeleton };