@behavioral-agentic-design-system/core 0.7.0 → 0.8.1
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/package.json +7 -2
- package/src/api/layers.ts +34 -6
- package/src/api/onboarding-extract.ts +435 -0
- package/src/api/onboarding.ts +82 -0
- package/src/app/shell.tsx +87 -25
- package/src/components/Foundations/Colors.stories.tsx +10 -1
- package/src/components/customize-tab.tsx +3 -0
- package/src/components/home-tab.tsx +1 -1
- package/src/components/layers-tab.tsx +172 -7
- package/src/components/onboarding-wizard.tsx +1421 -0
- package/src/components/ui/dialog.tsx +4 -1
- package/src/components/ui/dropdown-menu.tsx +4 -0
- package/src/components/ui/popover.tsx +6 -0
- package/src/components/ui/scroll-area.tsx +5 -0
- package/src/components/ui/select.tsx +4 -0
- package/src/components/ui/sheet.tsx +7 -0
- package/src/components/ui/slider.tsx +22 -7
- package/src/components/ui/tooltip.tsx +4 -0
- package/src/hooks/use-portal-theme-class.tsx +90 -0
|
@@ -0,0 +1,1421 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useMemo, useState } from "react";
|
|
4
|
+
import {
|
|
5
|
+
AlertCircle,
|
|
6
|
+
ArrowLeft,
|
|
7
|
+
ArrowRight,
|
|
8
|
+
Check,
|
|
9
|
+
CheckCircle2,
|
|
10
|
+
ClipboardCopy,
|
|
11
|
+
FileText,
|
|
12
|
+
FolderGit2,
|
|
13
|
+
Globe,
|
|
14
|
+
Loader2,
|
|
15
|
+
Palette,
|
|
16
|
+
RefreshCcw,
|
|
17
|
+
Save,
|
|
18
|
+
ShieldCheck,
|
|
19
|
+
Sparkles,
|
|
20
|
+
Type,
|
|
21
|
+
Wand2,
|
|
22
|
+
} from "lucide-react";
|
|
23
|
+
|
|
24
|
+
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
25
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
26
|
+
import {
|
|
27
|
+
Card,
|
|
28
|
+
CardContent,
|
|
29
|
+
CardDescription,
|
|
30
|
+
CardHeader,
|
|
31
|
+
CardTitle,
|
|
32
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
33
|
+
import { Checkbox } from "@behavioral-agentic-design-system/core/components/ui/checkbox";
|
|
34
|
+
import { Input } from "@behavioral-agentic-design-system/core/components/ui/input";
|
|
35
|
+
import { Progress } from "@behavioral-agentic-design-system/core/components/ui/progress";
|
|
36
|
+
import { Separator } from "@behavioral-agentic-design-system/core/components/ui/separator";
|
|
37
|
+
import { Textarea } from "@behavioral-agentic-design-system/core/components/ui/textarea";
|
|
38
|
+
|
|
39
|
+
const STORAGE_KEY = "bads:onboarding-wizard:v1";
|
|
40
|
+
|
|
41
|
+
type ArrayField = "sourceTypes" | "sensitiveData" | "surfaces";
|
|
42
|
+
|
|
43
|
+
type ExtractedColor = { value: string; count: number; source: string };
|
|
44
|
+
type ExtractedFont = { family: string; source: string; url?: string };
|
|
45
|
+
type ExtractedLogo = { kind: "svg" | "image"; url?: string; svg?: string };
|
|
46
|
+
|
|
47
|
+
type ExtractResult = {
|
|
48
|
+
url: string;
|
|
49
|
+
finalUrl: string;
|
|
50
|
+
title: string | null;
|
|
51
|
+
siteName: string | null;
|
|
52
|
+
description: string | null;
|
|
53
|
+
headline: string | null;
|
|
54
|
+
subhead: string | null;
|
|
55
|
+
ctas: string[];
|
|
56
|
+
colors: ExtractedColor[];
|
|
57
|
+
fonts: ExtractedFont[];
|
|
58
|
+
logo: ExtractedLogo | null;
|
|
59
|
+
themeColor: string | null;
|
|
60
|
+
warnings: string[];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
type ExtractStatus =
|
|
64
|
+
| { kind: "idle" }
|
|
65
|
+
| { kind: "loading" }
|
|
66
|
+
| { kind: "success"; result: ExtractResult }
|
|
67
|
+
| { kind: "error"; message: string };
|
|
68
|
+
|
|
69
|
+
type OnboardingDraft = {
|
|
70
|
+
displayName: string;
|
|
71
|
+
slug: string;
|
|
72
|
+
productKind: string;
|
|
73
|
+
productStage: string;
|
|
74
|
+
sourceTypes: string[];
|
|
75
|
+
liveSite: string;
|
|
76
|
+
codebasePath: string;
|
|
77
|
+
knowledgeBase: string;
|
|
78
|
+
designFiles: string;
|
|
79
|
+
sourceNotes: string;
|
|
80
|
+
oneLiner: string;
|
|
81
|
+
industry: string;
|
|
82
|
+
audience: string;
|
|
83
|
+
primaryOutcome: string;
|
|
84
|
+
competitors: string;
|
|
85
|
+
personality: string;
|
|
86
|
+
voiceExamples: string;
|
|
87
|
+
wordsUse: string;
|
|
88
|
+
wordsAvoid: string;
|
|
89
|
+
microcopyNotes: string;
|
|
90
|
+
sensitiveData: string[];
|
|
91
|
+
aiUsage: string;
|
|
92
|
+
consentMoments: string;
|
|
93
|
+
privacyNotes: string;
|
|
94
|
+
primaryColor: string;
|
|
95
|
+
secondaryColor: string;
|
|
96
|
+
fontDirection: string;
|
|
97
|
+
radiusPreference: string;
|
|
98
|
+
visualReferences: string;
|
|
99
|
+
surfaces: string[];
|
|
100
|
+
screenDescriptions: string;
|
|
101
|
+
componentGaps: string;
|
|
102
|
+
approveNewComponents: boolean;
|
|
103
|
+
patternNotes: string;
|
|
104
|
+
chromaticPlan: string;
|
|
105
|
+
finalNotes: string;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
type StepDefinition = {
|
|
109
|
+
id: string;
|
|
110
|
+
label: string;
|
|
111
|
+
title: string;
|
|
112
|
+
description: string;
|
|
113
|
+
icon: typeof Sparkles;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type SaveStatus =
|
|
117
|
+
| { kind: "idle" }
|
|
118
|
+
| { kind: "saving" }
|
|
119
|
+
| { kind: "success"; path: string }
|
|
120
|
+
| { kind: "error"; message: string };
|
|
121
|
+
|
|
122
|
+
type CopyTarget = "brief" | "prompt" | null;
|
|
123
|
+
|
|
124
|
+
const productKinds = [
|
|
125
|
+
"Personal app",
|
|
126
|
+
"Internal tool",
|
|
127
|
+
"Client product",
|
|
128
|
+
"Open-source library",
|
|
129
|
+
"Marketing site",
|
|
130
|
+
"Other",
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
const productStages = [
|
|
134
|
+
"Fresh fork",
|
|
135
|
+
"Existing product",
|
|
136
|
+
"Redesign",
|
|
137
|
+
"Design-system cleanup",
|
|
138
|
+
"Exploration",
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
const sourceTypeOptions = [
|
|
142
|
+
"Live site",
|
|
143
|
+
"Codebase",
|
|
144
|
+
"Knowledge base",
|
|
145
|
+
"Design files",
|
|
146
|
+
"No existing source",
|
|
147
|
+
];
|
|
148
|
+
|
|
149
|
+
const sensitiveDataOptions = [
|
|
150
|
+
"None",
|
|
151
|
+
"Location",
|
|
152
|
+
"Payments",
|
|
153
|
+
"Health or biometrics",
|
|
154
|
+
"Kids under 13",
|
|
155
|
+
"AI-generated content",
|
|
156
|
+
"User uploads",
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
const radiusOptions = ["Sharp", "Balanced", "Soft"];
|
|
160
|
+
|
|
161
|
+
const surfaceOptions = [
|
|
162
|
+
"Marketing",
|
|
163
|
+
"Auth",
|
|
164
|
+
"Dashboard",
|
|
165
|
+
"Forms",
|
|
166
|
+
"Data tables",
|
|
167
|
+
"Billing",
|
|
168
|
+
"Messaging",
|
|
169
|
+
"Settings",
|
|
170
|
+
];
|
|
171
|
+
|
|
172
|
+
const chromaticOptions = [
|
|
173
|
+
"Set up now",
|
|
174
|
+
"Defer for later",
|
|
175
|
+
"Already configured",
|
|
176
|
+
"Not sure yet",
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
const steps: StepDefinition[] = [
|
|
180
|
+
{
|
|
181
|
+
id: "start",
|
|
182
|
+
label: "Start",
|
|
183
|
+
title: "Paste your website",
|
|
184
|
+
description: "If you have a live site, drop the URL — we'll pull colors, fonts, logo, and tone from it. No site yet? Just give the product a name.",
|
|
185
|
+
icon: Globe,
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: "sources",
|
|
189
|
+
label: "Sources",
|
|
190
|
+
title: "Other signals to inspect",
|
|
191
|
+
description: "Anything else we should read alongside the live site — codebase, knowledge base, design files.",
|
|
192
|
+
icon: FolderGit2,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: "brand",
|
|
196
|
+
label: "Brand",
|
|
197
|
+
title: "Shape the product brief",
|
|
198
|
+
description: "A few grounded answers beat a generic brand exercise.",
|
|
199
|
+
icon: Globe,
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: "voice",
|
|
203
|
+
label: "Voice",
|
|
204
|
+
title: "Tune the words",
|
|
205
|
+
description: "Capture the copy rules that make the system sound intentional.",
|
|
206
|
+
icon: FileText,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: "ethics",
|
|
210
|
+
label: "Ethics",
|
|
211
|
+
title: "Name the responsibility gates",
|
|
212
|
+
description: "Data, consent, AI, and kid-facing surfaces get called out before build work.",
|
|
213
|
+
icon: ShieldCheck,
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "visuals",
|
|
217
|
+
label: "Visuals",
|
|
218
|
+
title: "Set visual direction",
|
|
219
|
+
description: "Collect enough to tune tokens without inventing taste in the dark.",
|
|
220
|
+
icon: Palette,
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: "components",
|
|
224
|
+
label: "Components",
|
|
225
|
+
title: "Plan components and patterns",
|
|
226
|
+
description: "Turn screens into a component gap matrix and reusable recipes.",
|
|
227
|
+
icon: Wand2,
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
id: "baseline",
|
|
231
|
+
label: "Baseline",
|
|
232
|
+
title: "Choose the quality baseline",
|
|
233
|
+
description: "Decide how visual regression and final setup notes should land.",
|
|
234
|
+
icon: CheckCircle2,
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: "review",
|
|
238
|
+
label: "Review",
|
|
239
|
+
title: "Review and hand off",
|
|
240
|
+
description: "Save the interview, copy the brief, or hand it to the agent.",
|
|
241
|
+
icon: ClipboardCopy,
|
|
242
|
+
},
|
|
243
|
+
];
|
|
244
|
+
|
|
245
|
+
function slugify(value: string) {
|
|
246
|
+
return value
|
|
247
|
+
.toLowerCase()
|
|
248
|
+
.trim()
|
|
249
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
250
|
+
.replace(/^-+|-+$/g, "")
|
|
251
|
+
.slice(0, 64);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function createDefaultDraft(defaultProductName: string): OnboardingDraft {
|
|
255
|
+
return {
|
|
256
|
+
displayName: defaultProductName === "BADS" ? "" : defaultProductName,
|
|
257
|
+
slug: defaultProductName === "BADS" ? "" : slugify(defaultProductName),
|
|
258
|
+
productKind: "Client product",
|
|
259
|
+
productStage: "Fresh fork",
|
|
260
|
+
sourceTypes: [],
|
|
261
|
+
liveSite: "",
|
|
262
|
+
codebasePath: "",
|
|
263
|
+
knowledgeBase: "",
|
|
264
|
+
designFiles: "",
|
|
265
|
+
sourceNotes: "",
|
|
266
|
+
oneLiner: "",
|
|
267
|
+
industry: "",
|
|
268
|
+
audience: "",
|
|
269
|
+
primaryOutcome: "",
|
|
270
|
+
competitors: "",
|
|
271
|
+
personality: "",
|
|
272
|
+
voiceExamples: "",
|
|
273
|
+
wordsUse: "",
|
|
274
|
+
wordsAvoid: "",
|
|
275
|
+
microcopyNotes: "",
|
|
276
|
+
sensitiveData: [],
|
|
277
|
+
aiUsage: "",
|
|
278
|
+
consentMoments: "",
|
|
279
|
+
privacyNotes: "",
|
|
280
|
+
primaryColor: "",
|
|
281
|
+
secondaryColor: "",
|
|
282
|
+
fontDirection: "",
|
|
283
|
+
radiusPreference: "Balanced",
|
|
284
|
+
visualReferences: "",
|
|
285
|
+
surfaces: [],
|
|
286
|
+
screenDescriptions: "",
|
|
287
|
+
componentGaps: "",
|
|
288
|
+
approveNewComponents: false,
|
|
289
|
+
patternNotes: "",
|
|
290
|
+
chromaticPlan: "Set up now",
|
|
291
|
+
finalNotes: "",
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function normalizeDraft(
|
|
296
|
+
input: Partial<OnboardingDraft>,
|
|
297
|
+
defaultProductName: string,
|
|
298
|
+
): OnboardingDraft {
|
|
299
|
+
const base = createDefaultDraft(defaultProductName);
|
|
300
|
+
return {
|
|
301
|
+
...base,
|
|
302
|
+
...input,
|
|
303
|
+
sourceTypes: Array.isArray(input.sourceTypes) ? input.sourceTypes : base.sourceTypes,
|
|
304
|
+
sensitiveData: Array.isArray(input.sensitiveData)
|
|
305
|
+
? input.sensitiveData
|
|
306
|
+
: base.sensitiveData,
|
|
307
|
+
surfaces: Array.isArray(input.surfaces) ? input.surfaces : base.surfaces,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function hasText(value: string) {
|
|
312
|
+
return value.trim().length > 0;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function list(values: string[]) {
|
|
316
|
+
return values.length ? values.join(", ") : "None yet";
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function fieldLine(label: string, value: string | boolean | string[]) {
|
|
320
|
+
const rendered = Array.isArray(value)
|
|
321
|
+
? list(value)
|
|
322
|
+
: typeof value === "boolean"
|
|
323
|
+
? value
|
|
324
|
+
? "Yes"
|
|
325
|
+
: "No"
|
|
326
|
+
: value.trim() || "Not answered";
|
|
327
|
+
return `- ${label}: ${rendered}`;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function buildBrief(draft: OnboardingDraft) {
|
|
331
|
+
return [
|
|
332
|
+
`# ${draft.displayName || "Untitled product"} onboarding brief`,
|
|
333
|
+
"",
|
|
334
|
+
"## Product identity",
|
|
335
|
+
fieldLine("Display name", draft.displayName),
|
|
336
|
+
fieldLine("Slug", draft.slug),
|
|
337
|
+
fieldLine("Product kind", draft.productKind),
|
|
338
|
+
fieldLine("Product stage", draft.productStage),
|
|
339
|
+
"",
|
|
340
|
+
"## Source discovery",
|
|
341
|
+
fieldLine("Existing sources", draft.sourceTypes),
|
|
342
|
+
fieldLine("Live site", draft.liveSite),
|
|
343
|
+
fieldLine("Codebase path", draft.codebasePath),
|
|
344
|
+
fieldLine("Knowledge base", draft.knowledgeBase),
|
|
345
|
+
fieldLine("Design files", draft.designFiles),
|
|
346
|
+
fieldLine("Notes", draft.sourceNotes),
|
|
347
|
+
"",
|
|
348
|
+
"## Brand context",
|
|
349
|
+
fieldLine("One-liner", draft.oneLiner),
|
|
350
|
+
fieldLine("Industry", draft.industry),
|
|
351
|
+
fieldLine("Audience", draft.audience),
|
|
352
|
+
fieldLine("Primary outcome", draft.primaryOutcome),
|
|
353
|
+
fieldLine("Alternatives or competitors", draft.competitors),
|
|
354
|
+
"",
|
|
355
|
+
"## Voice and microcopy",
|
|
356
|
+
fieldLine("Personality", draft.personality),
|
|
357
|
+
fieldLine("Copy examples", draft.voiceExamples),
|
|
358
|
+
fieldLine("Words to use", draft.wordsUse),
|
|
359
|
+
fieldLine("Words to avoid", draft.wordsAvoid),
|
|
360
|
+
fieldLine("Microcopy notes", draft.microcopyNotes),
|
|
361
|
+
"",
|
|
362
|
+
"## Ethics and responsibility",
|
|
363
|
+
fieldLine("Sensitive areas", draft.sensitiveData),
|
|
364
|
+
fieldLine("AI usage", draft.aiUsage),
|
|
365
|
+
fieldLine("Consent moments", draft.consentMoments),
|
|
366
|
+
fieldLine("Privacy notes", draft.privacyNotes),
|
|
367
|
+
"",
|
|
368
|
+
"## Visual system",
|
|
369
|
+
fieldLine("Primary color", draft.primaryColor),
|
|
370
|
+
fieldLine("Secondary color", draft.secondaryColor),
|
|
371
|
+
fieldLine("Font direction", draft.fontDirection),
|
|
372
|
+
fieldLine("Radius preference", draft.radiusPreference),
|
|
373
|
+
fieldLine("Visual references", draft.visualReferences),
|
|
374
|
+
"",
|
|
375
|
+
"## Components and patterns",
|
|
376
|
+
fieldLine("Surfaces", draft.surfaces),
|
|
377
|
+
fieldLine("Screen descriptions", draft.screenDescriptions),
|
|
378
|
+
fieldLine("Component gaps", draft.componentGaps),
|
|
379
|
+
fieldLine("Approved to add new primitives", draft.approveNewComponents),
|
|
380
|
+
fieldLine("Pattern notes", draft.patternNotes),
|
|
381
|
+
"",
|
|
382
|
+
"## Quality baseline",
|
|
383
|
+
fieldLine("Chromatic plan", draft.chromaticPlan),
|
|
384
|
+
fieldLine("Final setup notes", draft.finalNotes),
|
|
385
|
+
].join("\n");
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function buildAgentPrompt(draft: OnboardingDraft, setupPrompt: string) {
|
|
389
|
+
return [
|
|
390
|
+
setupPrompt,
|
|
391
|
+
"",
|
|
392
|
+
"Use this completed in-app onboarding brief as the source of truth. Do not re-ask questions that are already answered. Ask only for missing or contradictory details.",
|
|
393
|
+
"",
|
|
394
|
+
buildBrief(draft),
|
|
395
|
+
].join("\n");
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function TextField({
|
|
399
|
+
id,
|
|
400
|
+
label,
|
|
401
|
+
value,
|
|
402
|
+
onChange,
|
|
403
|
+
placeholder,
|
|
404
|
+
helper,
|
|
405
|
+
}: {
|
|
406
|
+
id: string;
|
|
407
|
+
label: string;
|
|
408
|
+
value: string;
|
|
409
|
+
onChange: (value: string) => void;
|
|
410
|
+
placeholder?: string;
|
|
411
|
+
helper?: string;
|
|
412
|
+
}) {
|
|
413
|
+
return (
|
|
414
|
+
<div className="space-y-2">
|
|
415
|
+
<label className="text-sm font-medium text-foreground" htmlFor={id}>
|
|
416
|
+
{label}
|
|
417
|
+
</label>
|
|
418
|
+
<Input
|
|
419
|
+
id={id}
|
|
420
|
+
value={value}
|
|
421
|
+
onChange={(event) => onChange(event.target.value)}
|
|
422
|
+
placeholder={placeholder}
|
|
423
|
+
/>
|
|
424
|
+
{helper ? <p className="text-sm text-muted-foreground">{helper}</p> : null}
|
|
425
|
+
</div>
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function TextAreaField({
|
|
430
|
+
id,
|
|
431
|
+
label,
|
|
432
|
+
value,
|
|
433
|
+
onChange,
|
|
434
|
+
placeholder,
|
|
435
|
+
helper,
|
|
436
|
+
rows = 4,
|
|
437
|
+
}: {
|
|
438
|
+
id: string;
|
|
439
|
+
label: string;
|
|
440
|
+
value: string;
|
|
441
|
+
onChange: (value: string) => void;
|
|
442
|
+
placeholder?: string;
|
|
443
|
+
helper?: string;
|
|
444
|
+
rows?: number;
|
|
445
|
+
}) {
|
|
446
|
+
return (
|
|
447
|
+
<div className="space-y-2">
|
|
448
|
+
<label className="text-sm font-medium text-foreground" htmlFor={id}>
|
|
449
|
+
{label}
|
|
450
|
+
</label>
|
|
451
|
+
<Textarea
|
|
452
|
+
id={id}
|
|
453
|
+
value={value}
|
|
454
|
+
rows={rows}
|
|
455
|
+
onChange={(event) => onChange(event.target.value)}
|
|
456
|
+
placeholder={placeholder}
|
|
457
|
+
className="min-h-24"
|
|
458
|
+
/>
|
|
459
|
+
{helper ? <p className="text-sm text-muted-foreground">{helper}</p> : null}
|
|
460
|
+
</div>
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function ChoiceGroup({
|
|
465
|
+
label,
|
|
466
|
+
options,
|
|
467
|
+
value,
|
|
468
|
+
onChange,
|
|
469
|
+
}: {
|
|
470
|
+
label: string;
|
|
471
|
+
options: string[];
|
|
472
|
+
value: string;
|
|
473
|
+
onChange: (value: string) => void;
|
|
474
|
+
}) {
|
|
475
|
+
return (
|
|
476
|
+
<div className="space-y-2">
|
|
477
|
+
<p className="text-sm font-medium text-foreground">{label}</p>
|
|
478
|
+
<div className="grid gap-2 sm:grid-cols-2 lg:grid-cols-3">
|
|
479
|
+
{options.map((option) => {
|
|
480
|
+
const selected = value === option;
|
|
481
|
+
return (
|
|
482
|
+
<Button
|
|
483
|
+
key={option}
|
|
484
|
+
type="button"
|
|
485
|
+
variant={selected ? "default" : "outline"}
|
|
486
|
+
className="h-auto min-h-10 justify-start whitespace-normal text-left"
|
|
487
|
+
aria-pressed={selected}
|
|
488
|
+
onClick={() => onChange(option)}
|
|
489
|
+
>
|
|
490
|
+
{selected ? <Check className="h-4 w-4" strokeWidth={1.5} /> : null}
|
|
491
|
+
<span>{option}</span>
|
|
492
|
+
</Button>
|
|
493
|
+
);
|
|
494
|
+
})}
|
|
495
|
+
</div>
|
|
496
|
+
</div>
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function CheckboxGroup({
|
|
501
|
+
label,
|
|
502
|
+
options,
|
|
503
|
+
values,
|
|
504
|
+
onToggle,
|
|
505
|
+
}: {
|
|
506
|
+
label: string;
|
|
507
|
+
options: string[];
|
|
508
|
+
values: string[];
|
|
509
|
+
onToggle: (value: string) => void;
|
|
510
|
+
}) {
|
|
511
|
+
return (
|
|
512
|
+
<fieldset className="space-y-2">
|
|
513
|
+
<legend className="text-sm font-medium text-foreground">{label}</legend>
|
|
514
|
+
<div className="grid gap-2 sm:grid-cols-2 lg:grid-cols-3">
|
|
515
|
+
{options.map((option) => {
|
|
516
|
+
const id = `${label}-${option}`.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
517
|
+
const checked = values.includes(option);
|
|
518
|
+
return (
|
|
519
|
+
<label
|
|
520
|
+
key={option}
|
|
521
|
+
htmlFor={id}
|
|
522
|
+
className="flex min-h-12 items-center gap-3 rounded-md border bg-background px-3 py-2 text-sm"
|
|
523
|
+
>
|
|
524
|
+
<Checkbox
|
|
525
|
+
id={id}
|
|
526
|
+
checked={checked}
|
|
527
|
+
onCheckedChange={() => onToggle(option)}
|
|
528
|
+
aria-label={option}
|
|
529
|
+
/>
|
|
530
|
+
<span>{option}</span>
|
|
531
|
+
</label>
|
|
532
|
+
);
|
|
533
|
+
})}
|
|
534
|
+
</div>
|
|
535
|
+
</fieldset>
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function ReviewPair({ label, value }: { label: string; value: string | string[] | boolean }) {
|
|
540
|
+
const rendered = Array.isArray(value)
|
|
541
|
+
? list(value)
|
|
542
|
+
: typeof value === "boolean"
|
|
543
|
+
? value
|
|
544
|
+
? "Yes"
|
|
545
|
+
: "No"
|
|
546
|
+
: value.trim() || "Not answered";
|
|
547
|
+
return (
|
|
548
|
+
<div className="grid gap-1 border-b py-3 last:border-b-0 md:grid-cols-[12rem_1fr]">
|
|
549
|
+
<dt className="text-sm font-medium text-muted-foreground">{label}</dt>
|
|
550
|
+
<dd className="text-sm text-foreground">{rendered}</dd>
|
|
551
|
+
</div>
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function ExtractionSummary({ result }: { result: ExtractResult }) {
|
|
556
|
+
const colorSwatches = result.colors.slice(0, 8);
|
|
557
|
+
const fontList = result.fonts.slice(0, 4);
|
|
558
|
+
return (
|
|
559
|
+
<div className="space-y-4 rounded-md border bg-muted/30 p-4">
|
|
560
|
+
<div className="flex items-center gap-2 text-sm font-medium text-foreground">
|
|
561
|
+
<CheckCircle2 className="h-4 w-4 text-primary" strokeWidth={1.5} />
|
|
562
|
+
Extracted from {new URL(result.finalUrl).host}
|
|
563
|
+
</div>
|
|
564
|
+
|
|
565
|
+
{result.logo ? (
|
|
566
|
+
<div className="flex items-center gap-3">
|
|
567
|
+
<span className="text-xs font-medium text-muted-foreground uppercase tracking-wide">
|
|
568
|
+
Logo
|
|
569
|
+
</span>
|
|
570
|
+
<div className="flex h-12 w-12 items-center justify-center rounded-md border bg-background p-1.5">
|
|
571
|
+
{result.logo.kind === "svg" && result.logo.svg ? (
|
|
572
|
+
<span
|
|
573
|
+
className="block h-full w-full [&>svg]:h-full [&>svg]:w-full"
|
|
574
|
+
dangerouslySetInnerHTML={{ __html: result.logo.svg }}
|
|
575
|
+
/>
|
|
576
|
+
) : result.logo.url ? (
|
|
577
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
578
|
+
<img src={result.logo.url} alt="Site logo" className="max-h-full max-w-full" />
|
|
579
|
+
) : null}
|
|
580
|
+
</div>
|
|
581
|
+
</div>
|
|
582
|
+
) : null}
|
|
583
|
+
|
|
584
|
+
{colorSwatches.length ? (
|
|
585
|
+
<div className="space-y-2">
|
|
586
|
+
<span className="text-xs font-medium text-muted-foreground uppercase tracking-wide">
|
|
587
|
+
Colors
|
|
588
|
+
</span>
|
|
589
|
+
<div className="flex flex-wrap gap-2">
|
|
590
|
+
{colorSwatches.map((c) => (
|
|
591
|
+
<div
|
|
592
|
+
key={c.value}
|
|
593
|
+
className="flex items-center gap-2 rounded-md border bg-background px-2 py-1 text-xs"
|
|
594
|
+
title={`${c.value} (used ${c.count}x)`}
|
|
595
|
+
>
|
|
596
|
+
<span
|
|
597
|
+
className="h-4 w-4 rounded-sm border"
|
|
598
|
+
style={{ backgroundColor: c.value }}
|
|
599
|
+
/>
|
|
600
|
+
<span className="font-mono">{c.value}</span>
|
|
601
|
+
</div>
|
|
602
|
+
))}
|
|
603
|
+
</div>
|
|
604
|
+
</div>
|
|
605
|
+
) : null}
|
|
606
|
+
|
|
607
|
+
{fontList.length ? (
|
|
608
|
+
<div className="space-y-2">
|
|
609
|
+
<span className="text-xs font-medium text-muted-foreground uppercase tracking-wide">
|
|
610
|
+
Fonts
|
|
611
|
+
</span>
|
|
612
|
+
<div className="flex flex-wrap gap-2">
|
|
613
|
+
{fontList.map((f) => (
|
|
614
|
+
<div
|
|
615
|
+
key={f.family}
|
|
616
|
+
className="flex items-center gap-2 rounded-md border bg-background px-2 py-1 text-xs"
|
|
617
|
+
>
|
|
618
|
+
<Type className="h-3.5 w-3.5 text-muted-foreground" strokeWidth={1.5} />
|
|
619
|
+
<span>{f.family}</span>
|
|
620
|
+
</div>
|
|
621
|
+
))}
|
|
622
|
+
</div>
|
|
623
|
+
</div>
|
|
624
|
+
) : null}
|
|
625
|
+
|
|
626
|
+
{result.description || result.headline ? (
|
|
627
|
+
<div className="space-y-2">
|
|
628
|
+
<span className="text-xs font-medium text-muted-foreground uppercase tracking-wide">
|
|
629
|
+
Tone signals
|
|
630
|
+
</span>
|
|
631
|
+
<div className="space-y-1 text-sm text-foreground">
|
|
632
|
+
{result.headline ? <p className="font-medium">{result.headline}</p> : null}
|
|
633
|
+
{result.description ? (
|
|
634
|
+
<p className="text-muted-foreground">{result.description}</p>
|
|
635
|
+
) : null}
|
|
636
|
+
</div>
|
|
637
|
+
</div>
|
|
638
|
+
) : null}
|
|
639
|
+
|
|
640
|
+
{result.warnings.length ? (
|
|
641
|
+
<div className="space-y-1 text-xs text-muted-foreground">
|
|
642
|
+
{result.warnings.map((w) => (
|
|
643
|
+
<div key={w} className="flex items-start gap-1.5">
|
|
644
|
+
<AlertCircle className="mt-0.5 h-3 w-3 shrink-0" strokeWidth={1.5} />
|
|
645
|
+
<span>{w}</span>
|
|
646
|
+
</div>
|
|
647
|
+
))}
|
|
648
|
+
</div>
|
|
649
|
+
) : null}
|
|
650
|
+
|
|
651
|
+
<p className="text-xs text-muted-foreground">
|
|
652
|
+
We've pre-filled the brand, voice, and visual direction steps. Review and tweak as you continue.
|
|
653
|
+
</p>
|
|
654
|
+
</div>
|
|
655
|
+
);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function stepComplete(index: number, draft: OnboardingDraft) {
|
|
659
|
+
switch (index) {
|
|
660
|
+
case 0:
|
|
661
|
+
return hasText(draft.liveSite) || (hasText(draft.displayName) && hasText(draft.slug));
|
|
662
|
+
case 1:
|
|
663
|
+
return draft.sourceTypes.length > 0;
|
|
664
|
+
case 2:
|
|
665
|
+
return hasText(draft.oneLiner) && hasText(draft.audience);
|
|
666
|
+
case 3:
|
|
667
|
+
return hasText(draft.personality) || hasText(draft.voiceExamples);
|
|
668
|
+
case 4:
|
|
669
|
+
return draft.sensitiveData.length > 0 || hasText(draft.privacyNotes);
|
|
670
|
+
case 5:
|
|
671
|
+
return (
|
|
672
|
+
hasText(draft.primaryColor) ||
|
|
673
|
+
hasText(draft.fontDirection) ||
|
|
674
|
+
hasText(draft.visualReferences)
|
|
675
|
+
);
|
|
676
|
+
case 6:
|
|
677
|
+
return draft.surfaces.length > 0 || hasText(draft.screenDescriptions);
|
|
678
|
+
case 7:
|
|
679
|
+
return hasText(draft.chromaticPlan);
|
|
680
|
+
case 8:
|
|
681
|
+
return true;
|
|
682
|
+
default:
|
|
683
|
+
return false;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
export function OnboardingWizard({
|
|
688
|
+
setupPrompt,
|
|
689
|
+
defaultProductName = "BADS",
|
|
690
|
+
}: {
|
|
691
|
+
setupPrompt: string;
|
|
692
|
+
defaultProductName?: string;
|
|
693
|
+
}) {
|
|
694
|
+
const [draft, setDraft] = useState<OnboardingDraft>(() =>
|
|
695
|
+
createDefaultDraft(defaultProductName),
|
|
696
|
+
);
|
|
697
|
+
const [activeStep, setActiveStep] = useState(0);
|
|
698
|
+
const [hydrated, setHydrated] = useState(false);
|
|
699
|
+
const [copied, setCopied] = useState<CopyTarget>(null);
|
|
700
|
+
const [saveStatus, setSaveStatus] = useState<SaveStatus>({ kind: "idle" });
|
|
701
|
+
const [extractStatus, setExtractStatus] = useState<ExtractStatus>({ kind: "idle" });
|
|
702
|
+
|
|
703
|
+
useEffect(() => {
|
|
704
|
+
try {
|
|
705
|
+
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
706
|
+
if (raw) {
|
|
707
|
+
const parsed = JSON.parse(raw) as {
|
|
708
|
+
draft?: Partial<OnboardingDraft>;
|
|
709
|
+
activeStep?: number;
|
|
710
|
+
};
|
|
711
|
+
if (parsed.draft) {
|
|
712
|
+
setDraft(normalizeDraft(parsed.draft, defaultProductName));
|
|
713
|
+
}
|
|
714
|
+
if (typeof parsed.activeStep === "number") {
|
|
715
|
+
setActiveStep(Math.min(Math.max(parsed.activeStep, 0), steps.length - 1));
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
} catch {}
|
|
719
|
+
setHydrated(true);
|
|
720
|
+
}, [defaultProductName]);
|
|
721
|
+
|
|
722
|
+
useEffect(() => {
|
|
723
|
+
if (!hydrated) return;
|
|
724
|
+
window.localStorage.setItem(STORAGE_KEY, JSON.stringify({ draft, activeStep }));
|
|
725
|
+
}, [activeStep, draft, hydrated]);
|
|
726
|
+
|
|
727
|
+
const brief = useMemo(() => buildBrief(draft), [draft]);
|
|
728
|
+
const agentPrompt = useMemo(
|
|
729
|
+
() => buildAgentPrompt(draft, setupPrompt),
|
|
730
|
+
[draft, setupPrompt],
|
|
731
|
+
);
|
|
732
|
+
const completedSteps = steps
|
|
733
|
+
.slice(0, -1)
|
|
734
|
+
.filter((_, index) => stepComplete(index, draft)).length;
|
|
735
|
+
const completion = Math.round((completedSteps / (steps.length - 1)) * 100);
|
|
736
|
+
const current = steps[activeStep];
|
|
737
|
+
const CurrentIcon = current.icon;
|
|
738
|
+
|
|
739
|
+
const updateDraft = (patch: Partial<OnboardingDraft>) => {
|
|
740
|
+
setDraft((prev) => ({ ...prev, ...patch }));
|
|
741
|
+
setSaveStatus({ kind: "idle" });
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
const updateName = (displayName: string) => {
|
|
745
|
+
setDraft((prev) => ({
|
|
746
|
+
...prev,
|
|
747
|
+
displayName,
|
|
748
|
+
slug: prev.slug && prev.slug !== slugify(prev.displayName) ? prev.slug : slugify(displayName),
|
|
749
|
+
}));
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
const toggleArrayField = (field: ArrayField, value: string) => {
|
|
753
|
+
setDraft((prev) => {
|
|
754
|
+
const currentValues = prev[field];
|
|
755
|
+
const hasValue = currentValues.includes(value);
|
|
756
|
+
const nextValues = hasValue
|
|
757
|
+
? currentValues.filter((item) => item !== value)
|
|
758
|
+
: [...currentValues, value];
|
|
759
|
+
const normalized =
|
|
760
|
+
value === "None" && !hasValue
|
|
761
|
+
? ["None"]
|
|
762
|
+
: nextValues.filter((item) => item !== "None");
|
|
763
|
+
return { ...prev, [field]: normalized };
|
|
764
|
+
});
|
|
765
|
+
setSaveStatus({ kind: "idle" });
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
const copyText = async (target: Exclude<CopyTarget, null>, text: string) => {
|
|
769
|
+
try {
|
|
770
|
+
await navigator.clipboard.writeText(text);
|
|
771
|
+
setCopied(target);
|
|
772
|
+
window.setTimeout(() => setCopied(null), 2000);
|
|
773
|
+
} catch {}
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
const saveBrief = async () => {
|
|
777
|
+
setSaveStatus({ kind: "saving" });
|
|
778
|
+
try {
|
|
779
|
+
const response = await fetch("/api/onboarding", {
|
|
780
|
+
method: "POST",
|
|
781
|
+
headers: { "Content-Type": "application/json" },
|
|
782
|
+
body: JSON.stringify({ draft, brief, agentPrompt }),
|
|
783
|
+
});
|
|
784
|
+
const data = (await response.json()) as {
|
|
785
|
+
ok?: boolean;
|
|
786
|
+
path?: string;
|
|
787
|
+
error?: string;
|
|
788
|
+
};
|
|
789
|
+
if (!response.ok || !data.ok) {
|
|
790
|
+
setSaveStatus({ kind: "error", message: data.error ?? "Save failed" });
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
setSaveStatus({ kind: "success", path: data.path ?? "onboarding-brief.json" });
|
|
794
|
+
} catch (error) {
|
|
795
|
+
setSaveStatus({
|
|
796
|
+
kind: "error",
|
|
797
|
+
message: error instanceof Error ? error.message : "Save failed",
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
const reset = () => {
|
|
803
|
+
const next = createDefaultDraft(defaultProductName);
|
|
804
|
+
setDraft(next);
|
|
805
|
+
setActiveStep(0);
|
|
806
|
+
setSaveStatus({ kind: "idle" });
|
|
807
|
+
setExtractStatus({ kind: "idle" });
|
|
808
|
+
try {
|
|
809
|
+
window.localStorage.removeItem(STORAGE_KEY);
|
|
810
|
+
} catch {}
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
const analyzeUrl = async () => {
|
|
814
|
+
if (!hasText(draft.liveSite)) return;
|
|
815
|
+
setExtractStatus({ kind: "loading" });
|
|
816
|
+
try {
|
|
817
|
+
const response = await fetch("/api/onboarding/extract", {
|
|
818
|
+
method: "POST",
|
|
819
|
+
headers: { "Content-Type": "application/json" },
|
|
820
|
+
body: JSON.stringify({ url: draft.liveSite }),
|
|
821
|
+
});
|
|
822
|
+
const data = (await response.json()) as {
|
|
823
|
+
ok?: boolean;
|
|
824
|
+
result?: ExtractResult;
|
|
825
|
+
error?: string;
|
|
826
|
+
};
|
|
827
|
+
if (!response.ok || !data.ok || !data.result) {
|
|
828
|
+
setExtractStatus({
|
|
829
|
+
kind: "error",
|
|
830
|
+
message: data.error ?? `Extraction failed (${response.status})`,
|
|
831
|
+
});
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
const result = data.result;
|
|
835
|
+
const inferredName =
|
|
836
|
+
result.siteName ||
|
|
837
|
+
(result.title ? result.title.split(/[—–|·:]/)[0].trim() : "") ||
|
|
838
|
+
"";
|
|
839
|
+
const inferredOneLiner =
|
|
840
|
+
result.description ||
|
|
841
|
+
(result.headline && result.subhead
|
|
842
|
+
? `${result.headline} — ${result.subhead}`
|
|
843
|
+
: result.headline || "");
|
|
844
|
+
const topColor = result.themeColor || result.colors[0]?.value || "";
|
|
845
|
+
const accentColor = result.colors[1]?.value || "";
|
|
846
|
+
const fontList = result.fonts
|
|
847
|
+
.map((f) => f.family)
|
|
848
|
+
.filter((f, i, arr) => arr.indexOf(f) === i)
|
|
849
|
+
.slice(0, 4)
|
|
850
|
+
.join(", ");
|
|
851
|
+
|
|
852
|
+
setDraft((prev) => ({
|
|
853
|
+
...prev,
|
|
854
|
+
liveSite: result.finalUrl || prev.liveSite,
|
|
855
|
+
displayName: prev.displayName || inferredName,
|
|
856
|
+
slug: prev.slug || (inferredName ? slugify(inferredName) : prev.slug),
|
|
857
|
+
oneLiner: prev.oneLiner || inferredOneLiner,
|
|
858
|
+
primaryColor: prev.primaryColor || topColor,
|
|
859
|
+
secondaryColor: prev.secondaryColor || accentColor,
|
|
860
|
+
fontDirection: prev.fontDirection || fontList,
|
|
861
|
+
visualReferences: prev.visualReferences || result.finalUrl || result.url,
|
|
862
|
+
sourceTypes: prev.sourceTypes.includes("Live site")
|
|
863
|
+
? prev.sourceTypes
|
|
864
|
+
: [...prev.sourceTypes.filter((s) => s !== "No existing source"), "Live site"],
|
|
865
|
+
}));
|
|
866
|
+
setExtractStatus({ kind: "success", result });
|
|
867
|
+
} catch (error) {
|
|
868
|
+
setExtractStatus({
|
|
869
|
+
kind: "error",
|
|
870
|
+
message: error instanceof Error ? error.message : "Extraction failed",
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
return (
|
|
876
|
+
<Card className="overflow-hidden">
|
|
877
|
+
<CardHeader className="border-b">
|
|
878
|
+
<div className="flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">
|
|
879
|
+
<div className="space-y-2">
|
|
880
|
+
<Badge variant="outline" className="w-fit gap-1.5">
|
|
881
|
+
<CurrentIcon className="h-3.5 w-3.5" strokeWidth={1.5} />
|
|
882
|
+
In-app onboarding
|
|
883
|
+
</Badge>
|
|
884
|
+
<div className="space-y-1.5">
|
|
885
|
+
<CardTitle className="text-xl">{current.title}</CardTitle>
|
|
886
|
+
<CardDescription className="max-w-2xl">{current.description}</CardDescription>
|
|
887
|
+
</div>
|
|
888
|
+
</div>
|
|
889
|
+
<div className="flex items-center gap-2">
|
|
890
|
+
<Button type="button" variant="outline" size="sm" onClick={reset}>
|
|
891
|
+
<RefreshCcw className="h-4 w-4" strokeWidth={1.5} />
|
|
892
|
+
Reset
|
|
893
|
+
</Button>
|
|
894
|
+
</div>
|
|
895
|
+
</div>
|
|
896
|
+
<div className="space-y-2 pt-2">
|
|
897
|
+
<div className="flex items-center justify-between gap-4 text-sm">
|
|
898
|
+
<span className="text-muted-foreground">
|
|
899
|
+
{completedSteps} of {steps.length - 1} interview sections ready
|
|
900
|
+
</span>
|
|
901
|
+
<span className="font-medium">{completion}%</span>
|
|
902
|
+
</div>
|
|
903
|
+
<Progress value={completion} />
|
|
904
|
+
</div>
|
|
905
|
+
</CardHeader>
|
|
906
|
+
|
|
907
|
+
<CardContent className="p-0">
|
|
908
|
+
<div className="grid min-h-[42rem] lg:grid-cols-[16rem_1fr]">
|
|
909
|
+
<nav className="border-b bg-muted/30 p-4 lg:border-b-0 lg:border-r">
|
|
910
|
+
<div className="grid gap-1">
|
|
911
|
+
{steps.map((step, index) => {
|
|
912
|
+
const Icon = step.icon;
|
|
913
|
+
const selected = index === activeStep;
|
|
914
|
+
const complete = stepComplete(index, draft);
|
|
915
|
+
return (
|
|
916
|
+
<button
|
|
917
|
+
key={step.id}
|
|
918
|
+
type="button"
|
|
919
|
+
onClick={() => setActiveStep(index)}
|
|
920
|
+
className={[
|
|
921
|
+
"flex min-h-11 w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors",
|
|
922
|
+
selected
|
|
923
|
+
? "bg-background text-foreground shadow-xs"
|
|
924
|
+
: "text-muted-foreground hover:bg-background/70 hover:text-foreground",
|
|
925
|
+
].join(" ")}
|
|
926
|
+
aria-current={selected ? "step" : undefined}
|
|
927
|
+
>
|
|
928
|
+
<Icon className="h-4 w-4 shrink-0" strokeWidth={1.5} />
|
|
929
|
+
<span className="min-w-0 flex-1 truncate">{step.label}</span>
|
|
930
|
+
{complete ? (
|
|
931
|
+
<CheckCircle2 className="h-4 w-4 shrink-0 text-primary" strokeWidth={1.5} />
|
|
932
|
+
) : null}
|
|
933
|
+
</button>
|
|
934
|
+
);
|
|
935
|
+
})}
|
|
936
|
+
</div>
|
|
937
|
+
</nav>
|
|
938
|
+
|
|
939
|
+
<div className="flex min-w-0 flex-col">
|
|
940
|
+
<div className="flex-1 p-5 md:p-6">
|
|
941
|
+
{activeStep === 0 ? (
|
|
942
|
+
<div className="space-y-8">
|
|
943
|
+
<div className="space-y-3">
|
|
944
|
+
<label
|
|
945
|
+
htmlFor="onboarding-live-site"
|
|
946
|
+
className="text-base font-semibold text-foreground"
|
|
947
|
+
>
|
|
948
|
+
Website URL
|
|
949
|
+
</label>
|
|
950
|
+
<div className="flex flex-col gap-2 sm:flex-row">
|
|
951
|
+
<div className="relative flex-1">
|
|
952
|
+
<Globe
|
|
953
|
+
className="pointer-events-none absolute top-1/2 left-3 h-5 w-5 -translate-y-1/2 text-muted-foreground"
|
|
954
|
+
strokeWidth={1.5}
|
|
955
|
+
/>
|
|
956
|
+
<Input
|
|
957
|
+
id="onboarding-live-site"
|
|
958
|
+
value={draft.liveSite}
|
|
959
|
+
onChange={(event) => updateDraft({ liveSite: event.target.value })}
|
|
960
|
+
onKeyDown={(event) => {
|
|
961
|
+
if (event.key === "Enter") {
|
|
962
|
+
event.preventDefault();
|
|
963
|
+
void analyzeUrl();
|
|
964
|
+
}
|
|
965
|
+
}}
|
|
966
|
+
placeholder="https://example.com"
|
|
967
|
+
className="h-14 pl-11 text-lg"
|
|
968
|
+
/>
|
|
969
|
+
</div>
|
|
970
|
+
<Button
|
|
971
|
+
type="button"
|
|
972
|
+
size="lg"
|
|
973
|
+
onClick={analyzeUrl}
|
|
974
|
+
disabled={
|
|
975
|
+
extractStatus.kind === "loading" || !hasText(draft.liveSite)
|
|
976
|
+
}
|
|
977
|
+
className="h-14 px-6"
|
|
978
|
+
>
|
|
979
|
+
{extractStatus.kind === "loading" ? (
|
|
980
|
+
<>
|
|
981
|
+
<Loader2 className="h-4 w-4 animate-spin" strokeWidth={1.5} />
|
|
982
|
+
Analyzing
|
|
983
|
+
</>
|
|
984
|
+
) : (
|
|
985
|
+
<>
|
|
986
|
+
<Wand2 className="h-4 w-4" strokeWidth={1.5} />
|
|
987
|
+
Analyze
|
|
988
|
+
</>
|
|
989
|
+
)}
|
|
990
|
+
</Button>
|
|
991
|
+
</div>
|
|
992
|
+
<p className="text-sm text-muted-foreground">
|
|
993
|
+
We'll extract colors, fonts, logo, and brand tone from your live site and use them to populate the design system. If the site is gated or doesn't exist yet, skip this and fill in the name below.
|
|
994
|
+
</p>
|
|
995
|
+
{extractStatus.kind === "error" ? (
|
|
996
|
+
<div className="flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive">
|
|
997
|
+
<AlertCircle className="mt-0.5 h-4 w-4 shrink-0" strokeWidth={1.5} />
|
|
998
|
+
<span>{extractStatus.message}</span>
|
|
999
|
+
</div>
|
|
1000
|
+
) : null}
|
|
1001
|
+
{extractStatus.kind === "success" ? (
|
|
1002
|
+
<ExtractionSummary result={extractStatus.result} />
|
|
1003
|
+
) : null}
|
|
1004
|
+
</div>
|
|
1005
|
+
<Separator />
|
|
1006
|
+
<div className="grid gap-5 md:grid-cols-2">
|
|
1007
|
+
<TextField
|
|
1008
|
+
id="onboarding-display-name"
|
|
1009
|
+
label="Display name"
|
|
1010
|
+
value={draft.displayName}
|
|
1011
|
+
onChange={updateName}
|
|
1012
|
+
placeholder="Acme Studio"
|
|
1013
|
+
helper="Used for the app header, package rename, and brand docs."
|
|
1014
|
+
/>
|
|
1015
|
+
<TextField
|
|
1016
|
+
id="onboarding-slug"
|
|
1017
|
+
label="Slug"
|
|
1018
|
+
value={draft.slug}
|
|
1019
|
+
onChange={(slug) => updateDraft({ slug: slugify(slug) })}
|
|
1020
|
+
placeholder="acme-studio"
|
|
1021
|
+
helper="Lowercase repo/package-friendly name."
|
|
1022
|
+
/>
|
|
1023
|
+
</div>
|
|
1024
|
+
<ChoiceGroup
|
|
1025
|
+
label="What kind of product is this?"
|
|
1026
|
+
options={productKinds}
|
|
1027
|
+
value={draft.productKind}
|
|
1028
|
+
onChange={(productKind) => updateDraft({ productKind })}
|
|
1029
|
+
/>
|
|
1030
|
+
<ChoiceGroup
|
|
1031
|
+
label="Where is the product right now?"
|
|
1032
|
+
options={productStages}
|
|
1033
|
+
value={draft.productStage}
|
|
1034
|
+
onChange={(productStage) => updateDraft({ productStage })}
|
|
1035
|
+
/>
|
|
1036
|
+
</div>
|
|
1037
|
+
) : null}
|
|
1038
|
+
|
|
1039
|
+
{activeStep === 1 ? (
|
|
1040
|
+
<div className="space-y-6">
|
|
1041
|
+
<CheckboxGroup
|
|
1042
|
+
label="What can we inspect first?"
|
|
1043
|
+
options={sourceTypeOptions}
|
|
1044
|
+
values={draft.sourceTypes}
|
|
1045
|
+
onToggle={(value) => toggleArrayField("sourceTypes", value)}
|
|
1046
|
+
/>
|
|
1047
|
+
<div className="grid gap-5 md:grid-cols-2">
|
|
1048
|
+
<TextField
|
|
1049
|
+
id="onboarding-codebase"
|
|
1050
|
+
label="Existing codebase path"
|
|
1051
|
+
value={draft.codebasePath}
|
|
1052
|
+
onChange={(codebasePath) => updateDraft({ codebasePath })}
|
|
1053
|
+
placeholder="/Users/name/project"
|
|
1054
|
+
/>
|
|
1055
|
+
<TextField
|
|
1056
|
+
id="onboarding-kb"
|
|
1057
|
+
label="Knowledge base or docs"
|
|
1058
|
+
value={draft.knowledgeBase}
|
|
1059
|
+
onChange={(knowledgeBase) => updateDraft({ knowledgeBase })}
|
|
1060
|
+
placeholder="Notion, Drive, docs URL, or folder"
|
|
1061
|
+
/>
|
|
1062
|
+
<TextField
|
|
1063
|
+
id="onboarding-design-files"
|
|
1064
|
+
label="Design files"
|
|
1065
|
+
value={draft.designFiles}
|
|
1066
|
+
onChange={(designFiles) => updateDraft({ designFiles })}
|
|
1067
|
+
placeholder="Figma link or local assets"
|
|
1068
|
+
/>
|
|
1069
|
+
</div>
|
|
1070
|
+
<TextAreaField
|
|
1071
|
+
id="onboarding-source-notes"
|
|
1072
|
+
label="Known gaps or contradictions"
|
|
1073
|
+
value={draft.sourceNotes}
|
|
1074
|
+
onChange={(sourceNotes) => updateDraft({ sourceNotes })}
|
|
1075
|
+
placeholder="Example: the app UI is current, but the marketing site has old messaging."
|
|
1076
|
+
/>
|
|
1077
|
+
</div>
|
|
1078
|
+
) : null}
|
|
1079
|
+
|
|
1080
|
+
{activeStep === 2 ? (
|
|
1081
|
+
<div className="space-y-6">
|
|
1082
|
+
<TextField
|
|
1083
|
+
id="onboarding-one-liner"
|
|
1084
|
+
label="One-liner"
|
|
1085
|
+
value={draft.oneLiner}
|
|
1086
|
+
onChange={(oneLiner) => updateDraft({ oneLiner })}
|
|
1087
|
+
placeholder="What does this product help people do?"
|
|
1088
|
+
/>
|
|
1089
|
+
<div className="grid gap-5 md:grid-cols-2">
|
|
1090
|
+
<TextField
|
|
1091
|
+
id="onboarding-industry"
|
|
1092
|
+
label="Industry or category"
|
|
1093
|
+
value={draft.industry}
|
|
1094
|
+
onChange={(industry) => updateDraft({ industry })}
|
|
1095
|
+
placeholder="Healthcare, education, devtools, swim teams..."
|
|
1096
|
+
/>
|
|
1097
|
+
<TextField
|
|
1098
|
+
id="onboarding-audience"
|
|
1099
|
+
label="Primary audience"
|
|
1100
|
+
value={draft.audience}
|
|
1101
|
+
onChange={(audience) => updateDraft({ audience })}
|
|
1102
|
+
placeholder="Who uses it most?"
|
|
1103
|
+
/>
|
|
1104
|
+
</div>
|
|
1105
|
+
<TextAreaField
|
|
1106
|
+
id="onboarding-outcome"
|
|
1107
|
+
label="Primary outcome"
|
|
1108
|
+
value={draft.primaryOutcome}
|
|
1109
|
+
onChange={(primaryOutcome) => updateDraft({ primaryOutcome })}
|
|
1110
|
+
placeholder="What should the product make easier, faster, calmer, or more trustworthy?"
|
|
1111
|
+
/>
|
|
1112
|
+
<TextAreaField
|
|
1113
|
+
id="onboarding-competitors"
|
|
1114
|
+
label="Alternatives or competitors"
|
|
1115
|
+
value={draft.competitors}
|
|
1116
|
+
onChange={(competitors) => updateDraft({ competitors })}
|
|
1117
|
+
placeholder="Products, workflows, spreadsheets, agencies, or manual processes this replaces."
|
|
1118
|
+
/>
|
|
1119
|
+
</div>
|
|
1120
|
+
) : null}
|
|
1121
|
+
|
|
1122
|
+
{activeStep === 3 ? (
|
|
1123
|
+
<div className="space-y-6">
|
|
1124
|
+
<TextAreaField
|
|
1125
|
+
id="onboarding-personality"
|
|
1126
|
+
label="Voice personality"
|
|
1127
|
+
value={draft.personality}
|
|
1128
|
+
onChange={(personality) => updateDraft({ personality })}
|
|
1129
|
+
placeholder="Example: warm, decisive, quietly expert. Not cute, not corporate."
|
|
1130
|
+
/>
|
|
1131
|
+
<TextAreaField
|
|
1132
|
+
id="onboarding-copy-examples"
|
|
1133
|
+
label="Existing copy examples"
|
|
1134
|
+
value={draft.voiceExamples}
|
|
1135
|
+
onChange={(voiceExamples) => updateDraft({ voiceExamples })}
|
|
1136
|
+
placeholder="Paste snippets from emails, product screens, docs, landing pages, or founder notes."
|
|
1137
|
+
/>
|
|
1138
|
+
<div className="grid gap-5 md:grid-cols-2">
|
|
1139
|
+
<TextAreaField
|
|
1140
|
+
id="onboarding-words-use"
|
|
1141
|
+
label="Words we use"
|
|
1142
|
+
value={draft.wordsUse}
|
|
1143
|
+
onChange={(wordsUse) => updateDraft({ wordsUse })}
|
|
1144
|
+
placeholder="Preferred terms, product nouns, audience language."
|
|
1145
|
+
/>
|
|
1146
|
+
<TextAreaField
|
|
1147
|
+
id="onboarding-words-avoid"
|
|
1148
|
+
label="Words we avoid"
|
|
1149
|
+
value={draft.wordsAvoid}
|
|
1150
|
+
onChange={(wordsAvoid) => updateDraft({ wordsAvoid })}
|
|
1151
|
+
placeholder="Banned phrases, jargon, competitor terms, tone traps."
|
|
1152
|
+
/>
|
|
1153
|
+
</div>
|
|
1154
|
+
<TextAreaField
|
|
1155
|
+
id="onboarding-microcopy"
|
|
1156
|
+
label="Microcopy notes"
|
|
1157
|
+
value={draft.microcopyNotes}
|
|
1158
|
+
onChange={(microcopyNotes) => updateDraft({ microcopyNotes })}
|
|
1159
|
+
placeholder="Button labels, empty states, error tone, confirmation wording."
|
|
1160
|
+
/>
|
|
1161
|
+
</div>
|
|
1162
|
+
) : null}
|
|
1163
|
+
|
|
1164
|
+
{activeStep === 4 ? (
|
|
1165
|
+
<div className="space-y-6">
|
|
1166
|
+
<CheckboxGroup
|
|
1167
|
+
label="Sensitive or protected areas"
|
|
1168
|
+
options={sensitiveDataOptions}
|
|
1169
|
+
values={draft.sensitiveData}
|
|
1170
|
+
onToggle={(value) => toggleArrayField("sensitiveData", value)}
|
|
1171
|
+
/>
|
|
1172
|
+
<TextAreaField
|
|
1173
|
+
id="onboarding-ai-usage"
|
|
1174
|
+
label="AI usage"
|
|
1175
|
+
value={draft.aiUsage}
|
|
1176
|
+
onChange={(aiUsage) => updateDraft({ aiUsage })}
|
|
1177
|
+
placeholder="Where might AI write, rank, summarize, suggest, or act for a user?"
|
|
1178
|
+
/>
|
|
1179
|
+
<TextAreaField
|
|
1180
|
+
id="onboarding-consent"
|
|
1181
|
+
label="Consent moments"
|
|
1182
|
+
value={draft.consentMoments}
|
|
1183
|
+
onChange={(consentMoments) => updateDraft({ consentMoments })}
|
|
1184
|
+
placeholder="Data collection, tracking, uploads, billing, account deletion, notifications."
|
|
1185
|
+
/>
|
|
1186
|
+
<TextAreaField
|
|
1187
|
+
id="onboarding-privacy"
|
|
1188
|
+
label="Privacy and safety notes"
|
|
1189
|
+
value={draft.privacyNotes}
|
|
1190
|
+
onChange={(privacyNotes) => updateDraft({ privacyNotes })}
|
|
1191
|
+
placeholder="Anything that needs explicit consent, special disclosure, opt-out, or deletion support."
|
|
1192
|
+
/>
|
|
1193
|
+
</div>
|
|
1194
|
+
) : null}
|
|
1195
|
+
|
|
1196
|
+
{activeStep === 5 ? (
|
|
1197
|
+
<div className="space-y-6">
|
|
1198
|
+
<div className="grid gap-5 md:grid-cols-2">
|
|
1199
|
+
<TextField
|
|
1200
|
+
id="onboarding-primary-color"
|
|
1201
|
+
label="Primary color direction"
|
|
1202
|
+
value={draft.primaryColor}
|
|
1203
|
+
onChange={(primaryColor) => updateDraft({ primaryColor })}
|
|
1204
|
+
placeholder="Hex, color name, or reference"
|
|
1205
|
+
/>
|
|
1206
|
+
<TextField
|
|
1207
|
+
id="onboarding-secondary-color"
|
|
1208
|
+
label="Secondary or accent direction"
|
|
1209
|
+
value={draft.secondaryColor}
|
|
1210
|
+
onChange={(secondaryColor) => updateDraft({ secondaryColor })}
|
|
1211
|
+
placeholder="Optional"
|
|
1212
|
+
/>
|
|
1213
|
+
</div>
|
|
1214
|
+
<TextAreaField
|
|
1215
|
+
id="onboarding-fonts"
|
|
1216
|
+
label="Typography direction"
|
|
1217
|
+
value={draft.fontDirection}
|
|
1218
|
+
onChange={(fontDirection) => updateDraft({ fontDirection })}
|
|
1219
|
+
placeholder="Existing fonts, desired mood, readability needs, or references."
|
|
1220
|
+
/>
|
|
1221
|
+
<ChoiceGroup
|
|
1222
|
+
label="Corner radius preference"
|
|
1223
|
+
options={radiusOptions}
|
|
1224
|
+
value={draft.radiusPreference}
|
|
1225
|
+
onChange={(radiusPreference) => updateDraft({ radiusPreference })}
|
|
1226
|
+
/>
|
|
1227
|
+
<TextAreaField
|
|
1228
|
+
id="onboarding-visual-references"
|
|
1229
|
+
label="Visual references"
|
|
1230
|
+
value={draft.visualReferences}
|
|
1231
|
+
onChange={(visualReferences) => updateDraft({ visualReferences })}
|
|
1232
|
+
placeholder="Sites, products, screenshots, brand PDFs, or adjectives that should inform the system."
|
|
1233
|
+
/>
|
|
1234
|
+
</div>
|
|
1235
|
+
) : null}
|
|
1236
|
+
|
|
1237
|
+
{activeStep === 6 ? (
|
|
1238
|
+
<div className="space-y-6">
|
|
1239
|
+
<CheckboxGroup
|
|
1240
|
+
label="Surfaces this system needs to cover"
|
|
1241
|
+
options={surfaceOptions}
|
|
1242
|
+
values={draft.surfaces}
|
|
1243
|
+
onToggle={(value) => toggleArrayField("surfaces", value)}
|
|
1244
|
+
/>
|
|
1245
|
+
<TextAreaField
|
|
1246
|
+
id="onboarding-screens"
|
|
1247
|
+
label="Two to five key screen descriptions"
|
|
1248
|
+
value={draft.screenDescriptions}
|
|
1249
|
+
onChange={(screenDescriptions) => updateDraft({ screenDescriptions })}
|
|
1250
|
+
placeholder="Example: dashboard with KPI cards, payment table, empty state, invite flow."
|
|
1251
|
+
/>
|
|
1252
|
+
<TextAreaField
|
|
1253
|
+
id="onboarding-component-gaps"
|
|
1254
|
+
label="Known component gaps"
|
|
1255
|
+
value={draft.componentGaps}
|
|
1256
|
+
onChange={(componentGaps) => updateDraft({ componentGaps })}
|
|
1257
|
+
placeholder="Anything missing from the current registry or existing components that feel wrong."
|
|
1258
|
+
/>
|
|
1259
|
+
<label className="flex min-h-12 items-center gap-3 rounded-md border bg-background px-3 py-2 text-sm">
|
|
1260
|
+
<Checkbox
|
|
1261
|
+
checked={draft.approveNewComponents}
|
|
1262
|
+
onCheckedChange={(checked) =>
|
|
1263
|
+
updateDraft({ approveNewComponents: Boolean(checked) })
|
|
1264
|
+
}
|
|
1265
|
+
aria-label="Approve candidate new primitives"
|
|
1266
|
+
/>
|
|
1267
|
+
<span>Allow the setup flow to propose candidate new primitives for approval.</span>
|
|
1268
|
+
</label>
|
|
1269
|
+
<TextAreaField
|
|
1270
|
+
id="onboarding-patterns"
|
|
1271
|
+
label="Pattern notes"
|
|
1272
|
+
value={draft.patternNotes}
|
|
1273
|
+
onChange={(patternNotes) => updateDraft({ patternNotes })}
|
|
1274
|
+
placeholder="Common recipes, repeated workflows, decision trees, or flows that should become rules."
|
|
1275
|
+
/>
|
|
1276
|
+
</div>
|
|
1277
|
+
) : null}
|
|
1278
|
+
|
|
1279
|
+
{activeStep === 7 ? (
|
|
1280
|
+
<div className="space-y-6">
|
|
1281
|
+
<ChoiceGroup
|
|
1282
|
+
label="Chromatic visual regression"
|
|
1283
|
+
options={chromaticOptions}
|
|
1284
|
+
value={draft.chromaticPlan}
|
|
1285
|
+
onChange={(chromaticPlan) => updateDraft({ chromaticPlan })}
|
|
1286
|
+
/>
|
|
1287
|
+
<TextAreaField
|
|
1288
|
+
id="onboarding-final-notes"
|
|
1289
|
+
label="Final setup notes"
|
|
1290
|
+
value={draft.finalNotes}
|
|
1291
|
+
onChange={(finalNotes) => updateDraft({ finalNotes })}
|
|
1292
|
+
placeholder="GitHub repo plans, deployment target, deadlines, review preferences, or anything the agent should know before editing."
|
|
1293
|
+
/>
|
|
1294
|
+
<div className="rounded-md border bg-muted/30 p-4 text-sm text-muted-foreground">
|
|
1295
|
+
The generated handoff keeps the original setup order: rename, discovery,
|
|
1296
|
+
brand, voice, microcopy, ethics, tokens, components, patterns, and
|
|
1297
|
+
Chromatic. It skips anything that does not apply.
|
|
1298
|
+
</div>
|
|
1299
|
+
</div>
|
|
1300
|
+
) : null}
|
|
1301
|
+
|
|
1302
|
+
{activeStep === 8 ? (
|
|
1303
|
+
<div className="space-y-6">
|
|
1304
|
+
<div className="grid gap-6 xl:grid-cols-[minmax(0,1fr)_20rem]">
|
|
1305
|
+
<div className="min-w-0 space-y-4">
|
|
1306
|
+
<div className="flex flex-wrap items-center justify-between gap-3">
|
|
1307
|
+
<div>
|
|
1308
|
+
<h3 className="text-base font-semibold">Interview brief</h3>
|
|
1309
|
+
<p className="text-sm text-muted-foreground">
|
|
1310
|
+
This is the structured source of truth for setup.
|
|
1311
|
+
</p>
|
|
1312
|
+
</div>
|
|
1313
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
1314
|
+
<Button
|
|
1315
|
+
type="button"
|
|
1316
|
+
variant="outline"
|
|
1317
|
+
size="sm"
|
|
1318
|
+
onClick={() => copyText("brief", brief)}
|
|
1319
|
+
>
|
|
1320
|
+
{copied === "brief" ? (
|
|
1321
|
+
<Check className="h-4 w-4" strokeWidth={1.5} />
|
|
1322
|
+
) : (
|
|
1323
|
+
<ClipboardCopy className="h-4 w-4" strokeWidth={1.5} />
|
|
1324
|
+
)}
|
|
1325
|
+
Brief
|
|
1326
|
+
</Button>
|
|
1327
|
+
<Button
|
|
1328
|
+
type="button"
|
|
1329
|
+
variant="outline"
|
|
1330
|
+
size="sm"
|
|
1331
|
+
onClick={() => copyText("prompt", agentPrompt)}
|
|
1332
|
+
>
|
|
1333
|
+
{copied === "prompt" ? (
|
|
1334
|
+
<Check className="h-4 w-4" strokeWidth={1.5} />
|
|
1335
|
+
) : (
|
|
1336
|
+
<ClipboardCopy className="h-4 w-4" strokeWidth={1.5} />
|
|
1337
|
+
)}
|
|
1338
|
+
Agent prompt
|
|
1339
|
+
</Button>
|
|
1340
|
+
<Button
|
|
1341
|
+
type="button"
|
|
1342
|
+
variant="default"
|
|
1343
|
+
size="sm"
|
|
1344
|
+
onClick={saveBrief}
|
|
1345
|
+
disabled={saveStatus.kind === "saving"}
|
|
1346
|
+
>
|
|
1347
|
+
<Save className="h-4 w-4" strokeWidth={1.5} />
|
|
1348
|
+
Save
|
|
1349
|
+
</Button>
|
|
1350
|
+
</div>
|
|
1351
|
+
</div>
|
|
1352
|
+
<pre className="max-h-96 overflow-auto rounded-md border bg-muted p-4 text-sm leading-relaxed whitespace-pre-wrap">
|
|
1353
|
+
<code>{brief}</code>
|
|
1354
|
+
</pre>
|
|
1355
|
+
{saveStatus.kind === "success" ? (
|
|
1356
|
+
<p className="text-sm text-muted-foreground">
|
|
1357
|
+
Saved to <span className="font-mono text-foreground">{saveStatus.path}</span>.
|
|
1358
|
+
</p>
|
|
1359
|
+
) : null}
|
|
1360
|
+
{saveStatus.kind === "error" ? (
|
|
1361
|
+
<p className="text-sm font-medium text-destructive">{saveStatus.message}</p>
|
|
1362
|
+
) : null}
|
|
1363
|
+
</div>
|
|
1364
|
+
|
|
1365
|
+
<div className="rounded-md border p-4">
|
|
1366
|
+
<h3 className="text-base font-semibold">Readiness</h3>
|
|
1367
|
+
<dl className="mt-2">
|
|
1368
|
+
<ReviewPair label="Product" value={draft.displayName} />
|
|
1369
|
+
<ReviewPair label="Sources" value={draft.sourceTypes} />
|
|
1370
|
+
<ReviewPair label="Audience" value={draft.audience} />
|
|
1371
|
+
<ReviewPair label="Sensitive areas" value={draft.sensitiveData} />
|
|
1372
|
+
<ReviewPair label="Visual direction" value={draft.primaryColor || draft.visualReferences} />
|
|
1373
|
+
<ReviewPair label="Surfaces" value={draft.surfaces} />
|
|
1374
|
+
<ReviewPair label="Chromatic" value={draft.chromaticPlan} />
|
|
1375
|
+
</dl>
|
|
1376
|
+
</div>
|
|
1377
|
+
</div>
|
|
1378
|
+
</div>
|
|
1379
|
+
) : null}
|
|
1380
|
+
</div>
|
|
1381
|
+
|
|
1382
|
+
<Separator />
|
|
1383
|
+
|
|
1384
|
+
<div className="flex flex-col gap-3 p-5 md:flex-row md:items-center md:justify-between md:p-6">
|
|
1385
|
+
<Button
|
|
1386
|
+
type="button"
|
|
1387
|
+
variant="outline"
|
|
1388
|
+
onClick={() => setActiveStep((step) => Math.max(0, step - 1))}
|
|
1389
|
+
disabled={activeStep === 0}
|
|
1390
|
+
>
|
|
1391
|
+
<ArrowLeft className="h-4 w-4" strokeWidth={1.5} />
|
|
1392
|
+
Back
|
|
1393
|
+
</Button>
|
|
1394
|
+
<div className="text-sm text-muted-foreground">
|
|
1395
|
+
Step {activeStep + 1} of {steps.length}: {current.label}
|
|
1396
|
+
</div>
|
|
1397
|
+
{activeStep < steps.length - 1 ? (
|
|
1398
|
+
<Button
|
|
1399
|
+
type="button"
|
|
1400
|
+
onClick={() => setActiveStep((step) => Math.min(steps.length - 1, step + 1))}
|
|
1401
|
+
>
|
|
1402
|
+
Continue
|
|
1403
|
+
<ArrowRight className="h-4 w-4" strokeWidth={1.5} />
|
|
1404
|
+
</Button>
|
|
1405
|
+
) : (
|
|
1406
|
+
<Button type="button" onClick={() => copyText("prompt", agentPrompt)}>
|
|
1407
|
+
{copied === "prompt" ? (
|
|
1408
|
+
<Check className="h-4 w-4" strokeWidth={1.5} />
|
|
1409
|
+
) : (
|
|
1410
|
+
<ClipboardCopy className="h-4 w-4" strokeWidth={1.5} />
|
|
1411
|
+
)}
|
|
1412
|
+
Copy agent prompt
|
|
1413
|
+
</Button>
|
|
1414
|
+
)}
|
|
1415
|
+
</div>
|
|
1416
|
+
</div>
|
|
1417
|
+
</div>
|
|
1418
|
+
</CardContent>
|
|
1419
|
+
</Card>
|
|
1420
|
+
);
|
|
1421
|
+
}
|