ai-design-system 0.1.9 → 0.1.11
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/StateNode/StateNode.tsx +5 -1
- package/components/composites/TransitionNode/TransitionNode.tsx +18 -1
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +3 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -14,6 +14,8 @@ export type StateNodeData = {
|
|
|
14
14
|
label: string;
|
|
15
15
|
description?: string;
|
|
16
16
|
type: "state";
|
|
17
|
+
/** True for terminal states — marks workflow completion, no outgoing transitions */
|
|
18
|
+
isTerminal?: boolean;
|
|
17
19
|
status?: "idle" | "running" | "success" | "error";
|
|
18
20
|
enabled?: boolean;
|
|
19
21
|
};
|
|
@@ -61,12 +63,14 @@ export const StateNode = memo(({ data, selected, id }: StateNodeProps) => {
|
|
|
61
63
|
const displayDescription = data.description;
|
|
62
64
|
const status = data.status;
|
|
63
65
|
const isDisabled = data.enabled === false;
|
|
66
|
+
const isTerminal = data.isTerminal === true;
|
|
64
67
|
|
|
65
68
|
return (
|
|
66
69
|
<Node
|
|
67
70
|
className={cn(
|
|
68
|
-
"relative flex h-auto w-auto min-w-[120px] max-w-[180px] flex-col items-center justify-center
|
|
71
|
+
"relative flex h-auto w-auto min-w-[120px] max-w-[180px] flex-col items-center justify-center border border-border bg-card shadow-none transition-all duration-150 ease-out",
|
|
69
72
|
selected && "border-primary border-2",
|
|
73
|
+
isTerminal && "border-2 border-primary",
|
|
70
74
|
isDisabled && "opacity-50"
|
|
71
75
|
)}
|
|
72
76
|
data-testid={`state-node-${id}`}
|
|
@@ -10,10 +10,27 @@ import {
|
|
|
10
10
|
} from "@/components/ai-elements/node";
|
|
11
11
|
import { cn } from "@/lib/utils";
|
|
12
12
|
|
|
13
|
+
export type TransitionNodeConfig = {
|
|
14
|
+
/** For conditional transitions: form field comparison e.g. "{{record.orderValue}} > {{record.acceptedRange}}" */
|
|
15
|
+
condition?: string;
|
|
16
|
+
/** For human transitions: roles allowed to approve */
|
|
17
|
+
allowed_roles?: string[];
|
|
18
|
+
/** For scheduled transitions: delay in seconds */
|
|
19
|
+
delay_seconds?: number;
|
|
20
|
+
/** For plugin transitions: plugin identifier */
|
|
21
|
+
plugin_id?: string;
|
|
22
|
+
/** For plugin transitions: plugin input values */
|
|
23
|
+
plugin_inputs?: Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
|
|
13
26
|
export type TransitionNodeData = {
|
|
14
27
|
label: string;
|
|
15
28
|
description?: string;
|
|
16
29
|
type: "transition";
|
|
30
|
+
/** Transition execution type */
|
|
31
|
+
transitionType?: "human" | "conditional" | "scheduled" | "plugin";
|
|
32
|
+
/** Transition-type-specific configuration */
|
|
33
|
+
config?: TransitionNodeConfig;
|
|
17
34
|
status?: "idle" | "running" | "success" | "error";
|
|
18
35
|
enabled?: boolean;
|
|
19
36
|
};
|
|
@@ -36,7 +53,7 @@ export const TransitionNode = memo(
|
|
|
36
53
|
return (
|
|
37
54
|
<Node
|
|
38
55
|
className={cn(
|
|
39
|
-
"flex h-auto w-auto min-w-[120px] max-w-[180px] flex-col items-center justify-center
|
|
56
|
+
"flex h-auto w-auto min-w-[120px] max-w-[180px] flex-col items-center justify-center border border-border bg-muted/40 shadow-none transition-all duration-150 ease-out",
|
|
40
57
|
selected && "border-primary border-2"
|
|
41
58
|
)}
|
|
42
59
|
data-testid={`transition-node-${id}`}
|
package/dist/index.cjs
CHANGED
|
@@ -7085,12 +7085,14 @@ var StateNode = React33.memo(({ data, selected, id }) => {
|
|
|
7085
7085
|
const displayDescription = data.description;
|
|
7086
7086
|
const status = data.status;
|
|
7087
7087
|
const isDisabled = data.enabled === false;
|
|
7088
|
+
const isTerminal = data.isTerminal === true;
|
|
7088
7089
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7089
7090
|
Node2,
|
|
7090
7091
|
{
|
|
7091
7092
|
className: cn(
|
|
7092
|
-
"relative flex h-auto w-auto min-w-[120px] max-w-[180px] flex-col items-center justify-center
|
|
7093
|
+
"relative flex h-auto w-auto min-w-[120px] max-w-[180px] flex-col items-center justify-center border border-border bg-card shadow-none transition-all duration-150 ease-out",
|
|
7093
7094
|
selected && "border-primary border-2",
|
|
7095
|
+
isTerminal && "border-2 border-primary",
|
|
7094
7096
|
isDisabled && "opacity-50"
|
|
7095
7097
|
),
|
|
7096
7098
|
"data-testid": `state-node-${id}`,
|
|
@@ -7124,7 +7126,7 @@ var TransitionNode = React33.memo(
|
|
|
7124
7126
|
Node2,
|
|
7125
7127
|
{
|
|
7126
7128
|
className: cn(
|
|
7127
|
-
"flex h-auto w-auto min-w-[120px] max-w-[180px] flex-col items-center justify-center
|
|
7129
|
+
"flex h-auto w-auto min-w-[120px] max-w-[180px] flex-col items-center justify-center border border-border bg-muted/40 shadow-none transition-all duration-150 ease-out",
|
|
7128
7130
|
selected && "border-primary border-2"
|
|
7129
7131
|
),
|
|
7130
7132
|
"data-testid": `transition-node-${id}`,
|