ai-design-system 0.1.80 → 0.1.81
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/components/composites/DataTable/EnhancedDataTable.tsx +13 -1
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +24 -0
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -270,8 +270,20 @@ export function EnhancedDataTable({
|
|
|
270
270
|
const value = toDisplayValue(rawValue)
|
|
271
271
|
|
|
272
272
|
if (renderType === "badge" || renderType === "status") {
|
|
273
|
+
const lower = value.toLowerCase()
|
|
274
|
+
let statusClass = "text-muted-foreground border-border"
|
|
275
|
+
if (lower.includes("complete") || lower.includes("done") || lower.includes("success") || lower.includes("approved")) {
|
|
276
|
+
statusClass = "text-emerald-400 bg-emerald-500/10 border-emerald-500/20"
|
|
277
|
+
} else if (lower.includes("fail") || lower.includes("error") || lower.includes("reject")) {
|
|
278
|
+
statusClass = "text-rose-400 bg-rose-500/10 border-rose-500/20"
|
|
279
|
+
} else if (lower.includes("cancel")) {
|
|
280
|
+
statusClass = "text-muted-foreground bg-muted/30 border-border"
|
|
281
|
+
} else if (lower.includes("progress") || lower.includes("running") || lower.includes("pending")) {
|
|
282
|
+
statusClass = "text-amber-400 bg-amber-500/10 border-amber-500/20"
|
|
283
|
+
}
|
|
284
|
+
|
|
273
285
|
return (
|
|
274
|
-
<Badge variant="outline" className=
|
|
286
|
+
<Badge variant="outline" className={`px-2 py-0.5 text-xs font-medium ${statusClass}`}>
|
|
275
287
|
{value}
|
|
276
288
|
</Badge>
|
|
277
289
|
)
|
package/dist/index.cjs
CHANGED
|
@@ -9980,7 +9980,18 @@ function EnhancedDataTable({
|
|
|
9980
9980
|
const renderType = (_a2 = column.renderType) != null ? _a2 : "text";
|
|
9981
9981
|
const value = toDisplayValue(rawValue);
|
|
9982
9982
|
if (renderType === "badge" || renderType === "status") {
|
|
9983
|
-
|
|
9983
|
+
const lower = value.toLowerCase();
|
|
9984
|
+
let statusClass = "text-muted-foreground border-border";
|
|
9985
|
+
if (lower.includes("complete") || lower.includes("done") || lower.includes("success") || lower.includes("approved")) {
|
|
9986
|
+
statusClass = "text-emerald-400 bg-emerald-500/10 border-emerald-500/20";
|
|
9987
|
+
} else if (lower.includes("fail") || lower.includes("error") || lower.includes("reject")) {
|
|
9988
|
+
statusClass = "text-rose-400 bg-rose-500/10 border-rose-500/20";
|
|
9989
|
+
} else if (lower.includes("cancel")) {
|
|
9990
|
+
statusClass = "text-muted-foreground bg-muted/30 border-border";
|
|
9991
|
+
} else if (lower.includes("progress") || lower.includes("running") || lower.includes("pending")) {
|
|
9992
|
+
statusClass = "text-amber-400 bg-amber-500/10 border-amber-500/20";
|
|
9993
|
+
}
|
|
9994
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Badge2, { variant: "outline", className: `px-2 py-0.5 text-xs font-medium ${statusClass}`, children: value });
|
|
9984
9995
|
}
|
|
9985
9996
|
if (renderType === "progress") {
|
|
9986
9997
|
const progress = Math.max(0, Math.min(100, toNumberValue(rawValue)));
|