@agentiffai/design 1.5.3 → 1.5.5

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,208 +1,214 @@
1
+ export { b as WorkflowCard, W as WorkflowCardProps, d as WorkflowErrorAlert, c as WorkflowErrorAlertProps, a as WorkflowIntegration, f as WorkflowProgressBar, e as WorkflowProgressBarProps, h as WorkflowResultPanel, g as WorkflowResultPanelProps, j as WorkflowStatusBadge, i as WorkflowStatusBadgeProps } from '../WorkflowStatusBadge-47sYxc2F.js';
1
2
  import React__default from 'react';
2
3
 
3
4
  /**
4
- * WorkflowCard Component
5
+ * WorkflowDiscoveryCard Component (v2 of WorkflowCard)
5
6
  *
6
- * A card for displaying available workflows in a list.
7
- * Used for browsing and activating workflows, showing
8
- * integrations and input requirements.
7
+ * Linear: APP-262 Design subtask: Workflow list card UI and metadata states
8
+ * Linear: AGE-56 Workflow Card Design and Implementation
9
+ *
10
+ * The next-generation workflow list card. Designed for the workflows discovery
11
+ * screen where users browse and pick a workflow to run.
12
+ *
13
+ * Why this is a new component (vs editing WorkflowCard):
14
+ * - The existing WorkflowCard answers "what's the name and which integrations".
15
+ * That isn't enough for users facing 100s of workflows. They also need to
16
+ * know "can I run this now?", "do I need n8n / a paid sub / a Google login?",
17
+ * "is there a demo I can watch?".
18
+ * - Keeping the original simple card stable for places it is still used.
19
+ *
20
+ * Card has two states:
21
+ * • Collapsed — compact, scannable. Name, 1-line summary, readiness
22
+ * status, integration icons, tiny metadata icons.
23
+ * • Expanded — the "decision layer". Full description, setup checklist,
24
+ * required vs optional integrations, paid sheet trigger, demo player,
25
+ * source link, run button.
26
+ *
27
+ * Designed to be responsive — works at mobile, tablet, and desktop widths.
28
+ * Extensible — accepts arbitrary `customIndicators` for future flags
29
+ * (secure/private LLM, community node, etc.) without code changes here.
30
+ *
31
+ * Ranking/popularity slot is always reserved per Nick's note on Linear: even
32
+ * when the feature is not backed yet, design the indicator in and let the
33
+ * slot render empty.
9
34
  */
10
35
 
11
- interface WorkflowIntegration {
12
- /** Icon URL or path */
13
- icon: string;
14
- /** Integration name for alt text */
36
+ /**
37
+ * Readiness state the single most important piece of info on the card.
38
+ * Translates "can the user run this workflow right now?" into one clear label.
39
+ */
40
+ type WorkflowReadiness = 'ready' | 'setup-required' | 'needs-n8n' | 'paid' | 'provisioning' | 'failed' | 'unavailable';
41
+ interface WorkflowDiscoveryIntegration {
42
+ /** Icon — string URL or a React node (e.g. an icon component) */
43
+ icon: string | React__default.ReactNode;
44
+ /** Integration name for alt text / tooltip */
15
45
  name: string;
16
- /** Whether this integration is connected */
46
+ /** Whether the integration is connected */
17
47
  connected?: boolean;
18
- /** Whether this integration is optional (softer visual when not connected) */
48
+ /** Whether the integration is optional */
19
49
  optional?: boolean;
20
50
  }
21
- interface WorkflowCardProps {
22
- /** Unique identifier for the workflow */
23
- id: string;
24
- /** Workflow name */
51
+ interface PaidIntegrationInfo {
52
+ /** Name of the paid integration (e.g. "Apify", "Postiz") */
25
53
  name: string;
26
- /** Workflow description */
27
- description?: string;
28
- /** List of required integrations */
29
- integrations?: WorkflowIntegration[];
30
- /** Whether the workflow needs setup (not yet provisioned) */
31
- needsSetup?: boolean;
32
- /** Estimated cost per run (e.g., "~$0.15") */
33
- estimatedCostPerRun?: string;
34
- /** Click handler */
35
- onClick?: () => void;
36
- /** Whether the card is disabled */
37
- disabled?: boolean;
38
- /** Optional className for styling */
39
- className?: string;
54
+ /** Short pricing note, e.g. "$5/mo · free trial available" */
55
+ pricingNote?: string;
56
+ /** True if the integration offers a free trial */
57
+ hasFreeTrial?: boolean;
58
+ /** Affiliate signup URL */
59
+ signupUrl?: string;
60
+ /** Optional Loom/YouTube setup video URL */
61
+ setupVideoUrl?: string;
40
62
  }
41
- declare const WorkflowCard: React__default.FC<WorkflowCardProps>;
42
-
43
- /**
44
- * WorkflowErrorAlert Component
45
- *
46
- * Displays workflow execution errors with inline, banner, or modal variants.
47
- *
48
- * @see specs/015-restyle-ai-chat/spec.md
49
- */
50
-
51
- interface WorkflowErrorAlertProps {
52
- /** Error object or message */
53
- error: Error | string;
54
- /** Optional error code */
55
- errorCode?: string;
56
- /** Timestamp of the error */
57
- timestamp?: string;
58
- /** Visual variant */
59
- variant?: 'inline' | 'banner' | 'modal';
60
- /** Severity level */
61
- severity?: 'error' | 'warning' | 'info';
62
- /** Whether the error can be retried */
63
- retryable?: boolean;
64
- /** Callback when retry is clicked */
65
- onRetry?: () => void;
66
- /** Callback when dismiss is clicked */
67
- onDismiss?: () => void;
68
- /** Whether to show details section */
69
- showDetails?: boolean;
70
- /** Stack trace to display */
71
- stackTrace?: string;
72
- /** Custom title */
73
- title?: string;
74
- /** Custom className */
75
- className?: string;
63
+ type SetupRequirementType = 'oauth' | 'api-key' | 'n8n' | 'paid' | 'apify-rental';
64
+ interface SetupRequirement {
65
+ /** Unique key */
66
+ id: string;
67
+ /** Kind of requirement (drives icon / styling) */
68
+ type: SetupRequirementType;
69
+ /** Human-readable label, e.g. "Connect Google", "Deploy n8n" */
70
+ label: string;
71
+ /** Whether this requirement is already satisfied */
72
+ done?: boolean;
73
+ /** Label for the action button, e.g. "Connect", "Set up" */
74
+ actionLabel?: string;
75
+ /** Action callback */
76
+ onAction?: () => void;
76
77
  }
77
- /**
78
- * WorkflowErrorAlert component for displaying workflow errors
79
- *
80
- * Features:
81
- * - Inline, banner, and modal variants
82
- * - Severity levels (error/warning/info)
83
- * - Error code and timestamp display
84
- * - Expandable stack trace
85
- * - Retry and dismiss actions
86
- * - Accessible error reporting
87
- */
88
- declare const WorkflowErrorAlert: React__default.FC<WorkflowErrorAlertProps>;
89
-
90
- /**
91
- * WorkflowProgressBar Component
92
- *
93
- * Displays workflow execution progress with linear or circular variants.
94
- *
95
- * @see specs/015-restyle-ai-chat/spec.md
96
- */
97
-
98
- interface WorkflowProgressBarProps {
99
- /** Progress percentage (0-100), or undefined for indeterminate */
100
- progress?: number;
101
- /** Optional message to display */
102
- message?: string;
103
- /** Status affects the color */
104
- status?: 'pending' | 'running' | 'completed' | 'failed' | 'timeout';
105
- /** Visual variant */
106
- variant?: 'linear' | 'circular';
107
- /** Size of the progress bar */
108
- size?: 'sm' | 'md' | 'lg';
109
- /** Whether to show percentage text */
110
- showPercentage?: boolean;
111
- /** Whether to animate progress changes */
112
- animated?: boolean;
113
- /** Custom className */
114
- className?: string;
78
+ interface PopularityInfo {
79
+ /** Total run count (e.g. 1240) */
80
+ runCount?: number;
81
+ /** Ranking position (e.g. 2 = #2) */
82
+ rank?: number;
83
+ /** "Trending" flag */
84
+ trending?: boolean;
85
+ }
86
+ interface CustomIndicator {
87
+ /** Unique key */
88
+ id: string;
89
+ /** Small icon (16px target) */
90
+ icon: React__default.ReactNode;
91
+ /** Tooltip / aria-label text */
92
+ tooltip: string;
93
+ /** Optional accent color */
94
+ color?: string;
95
+ }
96
+ interface ProvenanceSource {
97
+ /** Display label, e.g. "n8n.io template" */
98
+ label: string;
99
+ /** Source URL */
100
+ url: string;
115
101
  }
116
102
  /**
117
- * WorkflowProgressBar component for showing workflow execution progress
118
- *
119
- * Features:
120
- * - Linear and circular variants
121
- * - Determinate and indeterminate modes
122
- * - Color-coded status (gray/blue/green/red/orange)
123
- * - Size options (sm/md/lg)
124
- * - Optional percentage display
125
- * - Smooth animations
126
- * - Progress message support
127
- */
128
- declare const WorkflowProgressBar: React__default.FC<WorkflowProgressBarProps>;
129
-
130
- /**
131
- * WorkflowResultPanel Component
132
- *
133
- * Displays workflow execution results with JSON/formatted/table views.
134
- *
135
- * @see specs/015-restyle-ai-chat/spec.md
103
+ * Community voting state for a workflow. Lives in design exploration only —
104
+ * each brainstorm variation can place it differently to see how it feels.
136
105
  */
137
-
138
- interface WorkflowResultPanelProps {
139
- /** Output data to display */
140
- outputData: unknown;
141
- /** Visual variant */
142
- variant?: 'json' | 'formatted' | 'table';
143
- /** Whether the panel can be collapsed */
144
- collapsible?: boolean;
145
- /** Default expanded state */
146
- defaultExpanded?: boolean;
147
- /** Maximum height of content area */
148
- maxHeight?: string;
149
- /** Callback when download is clicked */
150
- onDownload?: () => void;
151
- /** Callback when copy is clicked */
152
- onCopy?: () => void;
153
- /** Custom title */
154
- title?: string;
155
- /** Custom className */
156
- className?: string;
106
+ interface VotesInfo {
107
+ /** Upvote count */
108
+ up: number;
109
+ /** Downvote count */
110
+ down: number;
111
+ /** What the current user has voted (or null if not voted) */
112
+ userVote?: 'up' | 'down' | null;
157
113
  }
158
114
  /**
159
- * WorkflowResultPanel component for displaying workflow results
160
- *
161
- * Features:
162
- * - JSON, formatted, and table view variants
163
- * - Collapsible content
164
- * - Download and copy actions
165
- * - Maximum height with scrolling
166
- * - Empty state handling
167
- * - Syntax highlighting for JSON
115
+ * Where the voting affordance renders on the card. Each placement is a
116
+ * distinct design hypothesis — we audition them in the brainstorm story
117
+ * so product + design can pick the right home for voting.
168
118
  */
169
- declare const WorkflowResultPanel: React__default.FC<WorkflowResultPanelProps>;
170
-
119
+ type VotesPlacement =
120
+ /** Tiny compact arrow + count in the metadata icon row (top-right) */
121
+ 'metadata'
122
+ /** Full pill (up arrow + count + down arrow + count) on the collapsed bottom row */
123
+ | 'bottom-row'
124
+ /** Block at the bottom of the expanded view */
125
+ | 'expanded-footer';
171
126
  /**
172
- * WorkflowStatusBadge Component
173
- *
174
- * Displays workflow execution status with color coding.
175
- *
176
- * @see specs/015-restyle-ai-chat/spec.md
127
+ * Where the support / report-issue affordance renders on the card.
177
128
  */
178
-
179
- interface WorkflowStatusBadgeProps {
180
- /** Workflow execution status */
181
- status: 'pending' | 'running' | 'completed' | 'failed' | 'timeout';
182
- /** Size of the badge */
183
- size?: 'sm' | 'md' | 'lg';
184
- /** Whether to show status icon */
185
- showIcon?: boolean;
186
- /** Whether to show status label */
187
- showLabel?: boolean;
188
- /** Whether to animate the icon */
189
- animated?: boolean;
190
- /** Custom status label text */
191
- label?: string;
129
+ type SupportPlacement =
130
+ /** Tiny icon in the metadata icon row (top-right) */
131
+ 'metadata'
132
+ /** Button in the expanded view footer */
133
+ | 'expanded-footer';
134
+ interface WorkflowDiscoveryCardProps {
135
+ /** Unique workflow identifier */
136
+ id: string;
137
+ /** Workflow display name */
138
+ name: string;
139
+ /** 1-line plain English summary (collapsed view) */
140
+ summary: string;
141
+ /** Longer description (expanded view). Falls back to `summary` if absent. */
142
+ description?: string;
143
+ /** Optional category */
144
+ category?: 'social_media' | 'ops' | 'crm' | string;
145
+ /** Optional workflow icon (URL or node) */
146
+ icon?: string | React__default.ReactNode;
147
+ /** Readiness state — drives the status label color and copy */
148
+ readiness: WorkflowReadiness;
149
+ /** Custom status label override (otherwise derived from `readiness`) */
150
+ statusLabel?: string;
151
+ /** Integration icons (collapsed view shows up to 4, rest as "+N") */
152
+ integrations?: WorkflowDiscoveryIntegration[];
153
+ /** Optional integrations — shown separately in expanded view */
154
+ optionalIntegrations?: WorkflowDiscoveryIntegration[];
155
+ /** Setup checklist for expanded view */
156
+ setupRequirements?: SetupRequirement[];
157
+ /** When set, the card shows a play-demo affordance */
158
+ demoVideoUrl?: string;
159
+ /** When set, the card shows the paid affiliate indicator + expanded sheet */
160
+ paidIntegration?: PaidIntegrationInfo;
161
+ /**
162
+ * Whether the workflow uses n8n under the hood. Shows a small n8n badge
163
+ * in the metadata icon row — except when the status already says "Needs n8n",
164
+ * in which case the badge is hidden to avoid duplication.
165
+ */
166
+ usesN8n?: boolean;
167
+ /** Provenance source (e.g. n8n.io template the workflow was based on) */
168
+ source?: ProvenanceSource;
169
+ /** Popularity info — always reserves a slot per Nick's design ask */
170
+ popularity?: PopularityInfo;
171
+ /** Reserve popularity slot even if data is empty (defaults to true) */
172
+ reservePopularitySpace?: boolean;
173
+ /** Future-proofing — extra indicators (secure LLM, community node, etc.) */
174
+ customIndicators?: CustomIndicator[];
175
+ /** Estimated cost per run, e.g. "~$0.15" */
176
+ estimatedCostPerRun?: string;
177
+ /** Whether the card starts expanded (uncontrolled) */
178
+ defaultExpanded?: boolean;
179
+ /** Controlled expanded state */
180
+ isExpanded?: boolean;
181
+ /** Called when the expand state toggles */
182
+ onToggleExpanded?: (id: string, nextExpanded: boolean) => void;
183
+ /** Called when the user clicks Run (or the primary action) */
184
+ onRun?: (id: string) => void;
185
+ /** Called when the user wants to play the demo */
186
+ onPlayDemo?: (id: string, url: string) => void;
187
+ /** Called when the user wants to open the paid-integration sheet */
188
+ onOpenPaidSheet?: (id: string, info: PaidIntegrationInfo) => void;
189
+ /**
190
+ * Community voting state. When provided the voting affordance renders in
191
+ * the placement specified by `votesPlacement` (defaults to expanded-footer).
192
+ */
193
+ votes?: VotesInfo;
194
+ /** Where to render the voting affordance. Only used if `votes` is set. */
195
+ votesPlacement?: VotesPlacement;
196
+ /** Called when the user up/down votes */
197
+ onVote?: (id: string, direction: 'up' | 'down') => void;
198
+ /**
199
+ * Called when the user wants to report an issue with this workflow. The
200
+ * workflow name is passed so the consumer can pre-fill the support form
201
+ * with it as context (as Nick asked). Pass this callback to render the
202
+ * support affordance in the placement set by `supportPlacement`.
203
+ */
204
+ onReportIssue?: (id: string, workflowName: string) => void;
205
+ /** Where to render the support affordance. Only used if `onReportIssue` is set. */
206
+ supportPlacement?: SupportPlacement;
207
+ /** Disabled state (greyed out, not interactive) */
208
+ disabled?: boolean;
192
209
  /** Custom className */
193
210
  className?: string;
194
211
  }
195
- /**
196
- * WorkflowStatusBadge component for showing workflow execution status
197
- *
198
- * Features:
199
- * - Color-coded status badges (gray/blue/green/red/orange)
200
- * - Status icons with optional animations
201
- * - Size options (sm/md/lg)
202
- * - Optional status labels
203
- * - Spinning animation for running state
204
- * - Pulse animation for pending state
205
- */
206
- declare const WorkflowStatusBadge: React__default.FC<WorkflowStatusBadgeProps>;
212
+ declare const WorkflowDiscoveryCard: React__default.FC<WorkflowDiscoveryCardProps>;
207
213
 
208
- export { WorkflowCard, type WorkflowCardProps, WorkflowErrorAlert, type WorkflowErrorAlertProps, type WorkflowIntegration, WorkflowProgressBar, type WorkflowProgressBarProps, WorkflowResultPanel, type WorkflowResultPanelProps, WorkflowStatusBadge, type WorkflowStatusBadgeProps };
214
+ export { type CustomIndicator, type PaidIntegrationInfo, type PopularityInfo, type ProvenanceSource, type SetupRequirement, type SetupRequirementType, type SupportPlacement, type VotesInfo, type VotesPlacement, WorkflowDiscoveryCard, type WorkflowDiscoveryCardProps, type WorkflowDiscoveryIntegration, type WorkflowReadiness };