@burdenoff/microfe-labsofscience 2026.717.2 → 2026.717.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/labsofscience/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/labsofscience/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyGD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAyB5C,CAAC"}
|
|
@@ -63,7 +63,7 @@ var r = {
|
|
|
63
63
|
confirmed: "success"
|
|
64
64
|
};
|
|
65
65
|
function s(e) {
|
|
66
|
-
return e.replace(/_/g, " ").
|
|
66
|
+
return e.replace(/_/g, " ").toUpperCase();
|
|
67
67
|
}
|
|
68
68
|
var c = ({ status: c, className: l }) => {
|
|
69
69
|
let u = c.toLowerCase(), d = o[u] || "secondary", f = a.has(u);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/labsofscience/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module labsofscience/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-status-info-bg-subtle text-status-info-text',\n outline: 'border border-border-seam text-text-primary',\n};\n\nconst dotColor: Record<BadgeVariant, string> = {\n success: 'bg-status-success-text',\n warning: 'bg-status-warning-text',\n destructive: 'bg-status-error-text',\n secondary: 'bg-text-secondary',\n info: 'bg-status-info-text',\n outline: 'bg-text-secondary',\n};\n\n// Statuses representing a live / active in-flight state get a calm glow-pulse dot.\nconst liveStatuses = new Set(['active', 'running', 'in_progress', 'in_use', 'queued', 'requested']);\n\n// All LabsOfScience domain enums are UPPERCASE on the wire; we normalize to\n// lowercase before lookup, so every key here is lowercase.\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Project lifecycle\n planning: 'secondary',\n active: 'success',\n on_hold: 'warning',\n completed: 'success',\n archived: 'outline',\n\n // Project visibility\n private: 'secondary',\n workspace: 'info',\n public: 'success',\n\n // Experiment lifecycle\n design: 'secondary',\n running: 'info',\n analysis: 'warning',\n complete: 'success',\n abandoned: 'destructive',\n\n // Run / pipeline-run lifecycle\n planned: 'secondary',\n in_progress: 'info',\n succeeded: 'success',\n failed: 'destructive',\n cancelled: 'destructive',\n queued: 'secondary',\n\n // Notebook entry lifecycle\n draft: 'secondary',\n submitted: 'info',\n signed: 'success',\n witnessed: 'success',\n void: 'outline',\n\n // Protocol lifecycle\n published: 'success',\n deprecated: 'outline',\n\n // Dataset lifecycle\n locked: 'warning',\n\n // Inventory derived status\n in_stock: 'success',\n low: 'warning',\n out_of_stock: 'destructive',\n expired: 'destructive',\n quarantined: 'warning',\n\n // Instrument status\n available: 'success',\n in_use: 'info',\n maintenance: 'warning',\n offline: 'destructive',\n\n // Booking status\n requested: 'warning',\n confirmed: 'success',\n};\n\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/labsofscience/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module labsofscience/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-status-info-bg-subtle text-status-info-text',\n outline: 'border border-border-seam text-text-primary',\n};\n\nconst dotColor: Record<BadgeVariant, string> = {\n success: 'bg-status-success-text',\n warning: 'bg-status-warning-text',\n destructive: 'bg-status-error-text',\n secondary: 'bg-text-secondary',\n info: 'bg-status-info-text',\n outline: 'bg-text-secondary',\n};\n\n// Statuses representing a live / active in-flight state get a calm glow-pulse dot.\nconst liveStatuses = new Set(['active', 'running', 'in_progress', 'in_use', 'queued', 'requested']);\n\n// All LabsOfScience domain enums are UPPERCASE on the wire; we normalize to\n// lowercase before lookup, so every key here is lowercase.\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Project lifecycle\n planning: 'secondary',\n active: 'success',\n on_hold: 'warning',\n completed: 'success',\n archived: 'outline',\n\n // Project visibility\n private: 'secondary',\n workspace: 'info',\n public: 'success',\n\n // Experiment lifecycle\n design: 'secondary',\n running: 'info',\n analysis: 'warning',\n complete: 'success',\n abandoned: 'destructive',\n\n // Run / pipeline-run lifecycle\n planned: 'secondary',\n in_progress: 'info',\n succeeded: 'success',\n failed: 'destructive',\n cancelled: 'destructive',\n queued: 'secondary',\n\n // Notebook entry lifecycle\n draft: 'secondary',\n submitted: 'info',\n signed: 'success',\n witnessed: 'success',\n void: 'outline',\n\n // Protocol lifecycle\n published: 'success',\n deprecated: 'outline',\n\n // Dataset lifecycle\n locked: 'warning',\n\n // Inventory derived status\n in_stock: 'success',\n low: 'warning',\n out_of_stock: 'destructive',\n expired: 'destructive',\n quarantined: 'warning',\n\n // Instrument status\n available: 'success',\n in_use: 'info',\n maintenance: 'warning',\n offline: 'destructive',\n\n // Booking status\n requested: 'warning',\n confirmed: 'success',\n};\n\n/**\n * Domain enums arrive UPPERCASE on the wire (see the note on `statusVariantMap`),\n * and the design renders badges UPPERCASE — see the status pills in\n * `labsofscience-specs/product/mockups/labsci-05-experiments-list.png`\n * (\"RUNNING\", \"ANALYSIS\", \"COMPLETE\", \"ABANDONED\"). So the only transform this\n * needs is underscore → space: `IN_PROGRESS` → `IN PROGRESS`.\n *\n * This previously ended in `.replace(/\\b\\w/g, c => c.toUpperCase())`, which read as\n * Title Case but was dead code — the input is already uppercase, so it matched and\n * re-uppercased the same characters and could never change anything. It was removed\n * rather than \"fixed\": title-casing here would silently restyle every badge in the\n * product away from the design. `toUpperCase()` is explicit so a future lowercase\n * caller cannot quietly change the rendering.\n */\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').toUpperCase();\n}\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const normalized = status.toLowerCase();\n const variant = statusVariantMap[normalized] || 'secondary';\n const isLive = liveStatuses.has(normalized);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'h-1.5 w-1.5 rounded-full motion-safe:animate-vc-glow-pulse',\n dotColor[variant]\n )}\n />\n )}\n {formatStatusLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;AAkBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAEK,IAAyC;CAC7C,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAGK,IAAe,IAAI,IAAI;CAAC;CAAU;CAAW;CAAe;CAAU;CAAU;CAAY,CAAC,EAI7F,IAAiD;CAErD,UAAU;CACV,QAAQ;CACR,SAAS;CACT,WAAW;CACX,UAAU;CAGV,SAAS;CACT,WAAW;CACX,QAAQ;CAGR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,UAAU;CACV,WAAW;CAGX,SAAS;CACT,aAAa;CACb,WAAW;CACX,QAAQ;CACR,WAAW;CACX,QAAQ;CAGR,OAAO;CACP,WAAW;CACX,QAAQ;CACR,WAAW;CACX,MAAM;CAGN,WAAW;CACX,YAAY;CAGZ,QAAQ;CAGR,UAAU;CACV,KAAK;CACL,cAAc;CACd,SAAS;CACT,aAAa;CAGb,WAAW;CACX,QAAQ;CACR,aAAa;CACb,SAAS;CAGT,WAAW;CACX,WAAW;CACZ;AAgBD,SAAS,EAAkB,GAAwB;AACjD,QAAO,EAAO,QAAQ,MAAM,IAAI,CAAC,aAAa;;AAGhD,IAAa,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAa,EAAO,aAAa,EACjC,IAAU,EAAiB,MAAe,aAC1C,IAAS,EAAa,IAAI,EAAW;AAE3C,QACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,EACD;YALH,CAOG,KACC,kBAAC,QAAD;GACE,eAAY;GACZ,WAAW,EACT,8DACA,EAAS,GACV;GACD,CAAA,EAEH,EAAkB,EAAO,CACrB"}
|