ai-design-system 0.1.79 → 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.
@@ -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="px-1.5 text-muted-foreground">
286
+ <Badge variant="outline" className={`px-2 py-0.5 text-xs font-medium ${statusClass}`}>
275
287
  {value}
276
288
  </Badge>
277
289
  )
@@ -354,7 +366,7 @@ export function EnhancedDataTable({
354
366
  <Button
355
367
  variant="ghost"
356
368
  size="icon"
357
- className="flex size-8 text-muted-foreground hover:text-foreground"
369
+ className="flex size-8 cursor-pointer text-muted-foreground hover:text-foreground"
358
370
  onClick={(e) => {
359
371
  e.stopPropagation()
360
372
  emitRowAction(singleAction.key, row.original)
@@ -372,7 +384,7 @@ export function EnhancedDataTable({
372
384
  cell: ({ row }) => (
373
385
  <DropdownMenu>
374
386
  <DropdownMenuTrigger asChild>
375
- <Button variant="ghost" className="flex size-8 text-muted-foreground data-[state=open]:bg-muted" size="icon">
387
+ <Button variant="ghost" className="flex size-8 cursor-pointer text-muted-foreground data-[state=open]:bg-muted" size="icon">
376
388
  <Icon name="more-vertical" size="sm" />
377
389
  <span className="sr-only">Open menu</span>
378
390
  </Button>
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority"
5
5
  import { cn } from "@/lib/utils"
6
6
 
7
7
  const buttonVariants = cva(
8
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
8
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
9
9
  {
10
10
  variants: {
11
11
  variant: {
package/dist/index.cjs CHANGED
@@ -132,7 +132,7 @@ function cn(...inputs) {
132
132
  return tailwindMerge.twMerge(clsx.clsx(inputs));
133
133
  }
134
134
  var buttonVariants = classVarianceAuthority.cva(
135
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
135
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
136
136
  {
137
137
  variants: {
138
138
  variant: {
@@ -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
- return /* @__PURE__ */ jsxRuntime.jsx(Badge2, { variant: "outline", className: "px-1.5 text-muted-foreground", children: value });
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)));
@@ -10052,7 +10063,7 @@ function EnhancedDataTable({
10052
10063
  {
10053
10064
  variant: "ghost",
10054
10065
  size: "icon",
10055
- className: "flex size-8 text-muted-foreground hover:text-foreground",
10066
+ className: "flex size-8 cursor-pointer text-muted-foreground hover:text-foreground",
10056
10067
  onClick: (e) => {
10057
10068
  e.stopPropagation();
10058
10069
  emitRowAction(singleAction.key, row.original);
@@ -10067,7 +10078,7 @@ function EnhancedDataTable({
10067
10078
  dynamicColumns.push({
10068
10079
  id: "actions",
10069
10080
  cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu2, { children: [
10070
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button2, { variant: "ghost", className: "flex size-8 text-muted-foreground data-[state=open]:bg-muted", size: "icon", children: [
10081
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button2, { variant: "ghost", className: "flex size-8 cursor-pointer text-muted-foreground data-[state=open]:bg-muted", size: "icon", children: [
10071
10082
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "more-vertical", size: "sm" }),
10072
10083
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Open menu" })
10073
10084
  ] }) }),