ai-design-system 0.1.3 → 0.1.4

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.
@@ -10,6 +10,7 @@ import {
10
10
  DropdownMenuItem,
11
11
  DropdownMenuTrigger,
12
12
  } from "@/components/primitives/DropdownMenu";
13
+ import { Icon } from "@/components/primitives/Icon";
13
14
  import { cn } from "@/lib/utils";
14
15
 
15
16
  // ---------------------------------------------------------------------------
@@ -23,8 +24,12 @@ export interface WorkflowVersion {
23
24
 
24
25
  export interface ToolbarAction {
25
26
  id: string;
26
- /** Icon element to render inside the button */
27
- icon: ReactNode;
27
+ /**
28
+ * Icon to render inside the button.
29
+ * Pass a string icon name from the icon registry (preferred — no icon package needed in consumer)
30
+ * or a ReactNode for custom icons.
31
+ */
32
+ icon: string | ReactNode;
28
33
  /** Tooltip text */
29
34
  title: string;
30
35
  onClick?: () => void;
@@ -76,6 +81,8 @@ export function WorkflowToolbarActions({
76
81
  >
77
82
  {action.loading ? (
78
83
  <Loader2 className="size-4 animate-spin" />
84
+ ) : typeof action.icon === 'string' ? (
85
+ <Icon name={action.icon} size="sm" />
79
86
  ) : (
80
87
  action.icon
81
88
  )}
package/dist/index.cjs CHANGED
@@ -2296,6 +2296,11 @@ var defaultIcons = {
2296
2296
  name: "file-text",
2297
2297
  viewBox: "0 0 24 24",
2298
2298
  path: "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8zM14 2v6h6M16 13H8m8 4H8m8-8H8"
2299
+ },
2300
+ "message-square": {
2301
+ name: "message-square",
2302
+ viewBox: "0 0 24 24",
2303
+ path: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"
2299
2304
  }
2300
2305
  };
2301
2306
  var IconRegistry = class {
@@ -7165,7 +7170,7 @@ function WorkflowToolbarActions({
7165
7170
  title: action.title,
7166
7171
  variant: "secondary",
7167
7172
  children: [
7168
- action.loading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }) : action.icon,
7173
+ action.loading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }) : typeof action.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: action.icon, size: "sm" }) : action.icon,
7169
7174
  action.indicator && !action.loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-1.5 right-1.5 size-2 rounded-full bg-primary" })
7170
7175
  ]
7171
7176
  },